diff --git a/api-reference/openapi.en.json b/api-reference/openapi.en.json index 95a3c2e1..67ce2402 100644 --- a/api-reference/openapi.en.json +++ b/api-reference/openapi.en.json @@ -3215,6 +3215,55 @@ ], "type": "object" }, + "AutomationExecutionLocation": { + "description": "Read-only description of where the rule runs, shown in the console.", + "properties": { + "chat_name": { + "description": "Chat name of the pinned chat. Set only for an IM destination.", + "type": "string" + }, + "conversation_mode": { + "description": "Conversation mode of the pinned chat. Set only for an IM destination.", + "type": "string" + }, + "description": { + "description": "Human-readable destination label: the chat name, the platform and mode, or `Web console`.", + "type": "string" + }, + "place": { + "description": "Execution place: `im` or `web_console`.", + "enum": [ + "im", + "web_console" + ], + "type": "string" + }, + "platform": { + "description": "IM platform of the pinned chat. Set only for an IM destination.", + "type": "string" + }, + "run_scope": { + "description": "Run scope of the pinned destination.", + "enum": [ + "person", + "team" + ], + "type": "string" + }, + "team_id": { + "description": "Team ID of the pinned scope; 0 for a personal scope.", + "format": "int64", + "type": "integer" + } + }, + "required": [ + "place", + "run_scope", + "team_id", + "description" + ], + "type": "object" + }, "AutomationRuleCreateRequest": { "description": "Create an Automation rule.", "properties": { @@ -3288,10 +3337,24 @@ ] }, "team_id": { - "description": "Scope team ID. 0 or omitted means a personal rule; >0 means a team in the account. Can be reassigned later via update (converting a team rule to personal is owner-only; moving into a team requires the caller to belong to it).", + "description": "Scope team ID. Omitted means inherit the scope of the conversation the rule is created from, when the request carries an IM conversation; otherwise the rule is personal. An explicit `0` asks for a personal rule and `>0` targets that team in the account. Can be reassigned later via update (converting a team rule to personal is owner-only; moving into a team requires the caller to belong to it).", "format": "int64", "minimum": 0, - "type": "integer" + "type": [ + "integer", + "null" + ] + }, + "run_in": { + "description": "Where the rule runs. `current-chat` binds it to the live IM conversation it is created from, so its runs stay in that chat; `web` runs it in a hidden console session. Defaults to `current-chat` for a request carrying an IM conversation and to `web` otherwise; `current-chat` is rejected without a live IM conversation.", + "enum": [ + "current-chat", + "web" + ], + "type": [ + "string", + "null" + ] }, "timezone": { "description": "IANA timezone `cron_expr` is evaluated in, e.g. `Asia/Shanghai`. Must be a timezone name loadable by the server; an invalid value is rejected. Defaults to the caller's member timezone, then the account timezone, then the server default (Asia/Shanghai) when omitted.", @@ -3355,6 +3418,17 @@ ], "type": "string" }, + "execution_location": { + "$ref": "#/components/schemas/AutomationExecutionLocation" + }, + "execution_place": { + "description": "Where this rule's ordinary triggers run: `web_console` (a hidden console session) or `im` (the IM chat the rule is pinned to). A war-room trigger still runs in that event's war room. The pinned chat and scope cannot be changed after create.", + "enum": [ + "im", + "web_console" + ], + "type": "string" + }, "http_post_token": { "description": "HTTP POST trigger token. Returned only on create or token rotation; save it immediately.", "type": "string" @@ -3472,7 +3546,8 @@ "created_at", "updated_at", "schedule_next_fire_at_ms", - "oncall_incident_trigger_enabled" + "oncall_incident_trigger_enabled", + "execution_place" ], "type": "object" }, @@ -21172,6 +21247,15 @@ }, "type": "object" }, + "resolve_mode": { + "description": "Reopen policy of this issue. `any` reopens it on any recurrence; `version` reopens it only when the error recurs in an application version the issue has not seen. Issues created before this field shipped carry an empty value, which behaves like `version`.", + "enum": [ + "", + "any", + "version" + ], + "type": "string" + }, "resolved_at": { "description": "Time the issue was marked resolved, Unix timestamp in milliseconds; 0 while unresolved.", "format": "int64", @@ -21407,6 +21491,14 @@ ], "type": "string" }, + "resolve_mode": { + "description": "Reopen policy set together with `status: resolved`. `any` reopens the issue on any recurring error; `version` reopens it only when the error recurs in an application version the issue has not seen. Applied only while `status` is `resolved`; omitted there means the issue is resolved with `any`.", + "enum": [ + "any", + "version" + ], + "type": "string" + }, "suspected_cause": { "description": "New suspected cause; setting it marks the cause source as `user`, overriding the automatic classification. One of:\n\n| Value | Meaning |\n|---|---|\n| `api.failed_request` | API request failure |\n| `network.error` | Network connectivity error |\n| `code.exception` | Code exception |\n| `code.invalid_object_access` | Invalid object access |\n| `code.invalid_argument` | Invalid argument |\n| `unknown` | Unknown cause |", "enum": [ @@ -52849,6 +52941,7 @@ "timestamp": 1775961839090, "version": "1.0.0" }, + "resolve_mode": "version", "resolved_at": 0, "resolved_by": 0, "service": "fd-console", @@ -52969,6 +53062,7 @@ "timestamp": 1775961839090, "version": "1.0.0" }, + "resolve_mode": "version", "resolved_at": 0, "resolved_by": 0, "service": "fd-console", @@ -53007,6 +53101,7 @@ "timestamp": 1775189527762, "version": "1.0.0" }, + "resolve_mode": "version", "resolved_at": 0, "resolved_by": 0, "service": "fd-console", @@ -53918,6 +54013,7 @@ "application/json": { "example": { "issue_id": "NHEacQHi2DhXqobr9qPQz9", + "resolve_mode": "version", "status": "resolved" }, "schema": { @@ -55856,6 +55952,7 @@ ], "oncall_incident_trigger_enabled": true, "prompt": "Summarize last week's alert noise and escalation load.", + "run_in": "web", "schedule_trigger_enabled": true, "team_id": 123, "timezone": "Asia/Shanghai" @@ -55880,6 +55977,13 @@ "enabled": true, "environment_id": "", "environment_kind": "", + "execution_location": { + "place": "web_console", + "run_scope": "team", + "team_id": 123, + "description": "Web console" + }, + "execution_place": "web_console", "http_post_token": "sat_yQ9p8V7n6M5k4J3h2G1f0E9d8C7b6A5z4Y3x2W1v0U", "http_post_trigger_enabled": true, "http_post_trigger_id": "atrig_2bLq4xT8mP1sWd9cN3rF6y", @@ -56069,6 +56173,13 @@ "enabled": true, "environment_id": "", "environment_kind": "", + "execution_location": { + "place": "web_console", + "run_scope": "team", + "team_id": 123, + "description": "Web console" + }, + "execution_place": "web_console", "http_post_trigger_enabled": true, "http_post_trigger_id": "atrig_2bLq4xT8mP1sWd9cN3rF6y", "http_post_trigger_url": "/safari/automation/triggers/atrig_2bLq4xT8mP1sWd9cN3rF6y/fire", @@ -56181,6 +56292,13 @@ "enabled": true, "environment_id": "", "environment_kind": "", + "execution_location": { + "place": "web_console", + "run_scope": "team", + "team_id": 123, + "description": "Web console" + }, + "execution_place": "web_console", "http_post_trigger_enabled": true, "http_post_trigger_id": "atrig_2bLq4xT8mP1sWd9cN3rF6y", "http_post_trigger_url": "/safari/automation/triggers/atrig_2bLq4xT8mP1sWd9cN3rF6y/fire", @@ -56403,6 +56521,13 @@ "enabled": true, "environment_id": "", "environment_kind": "", + "execution_location": { + "place": "web_console", + "run_scope": "team", + "team_id": 123, + "description": "Web console" + }, + "execution_place": "web_console", "http_post_token": "sat_yQ9p8V7n6M5k4J3h2G1f0E9d8C7b6A5z4Y3x2W1v0U", "http_post_trigger_enabled": true, "http_post_trigger_id": "atrig_2bLq4xT8mP1sWd9cN3rF6y", diff --git a/api-reference/openapi.zh.json b/api-reference/openapi.zh.json index 99adf484..2297563a 100644 --- a/api-reference/openapi.zh.json +++ b/api-reference/openapi.zh.json @@ -3215,6 +3215,55 @@ ], "type": "object" }, + "AutomationExecutionLocation": { + "description": "规则执行位置的只读描述,在控制台中展示。", + "properties": { + "chat_name": { + "description": "绑定会话的名称,仅 IM 目标会返回。", + "type": "string" + }, + "conversation_mode": { + "description": "绑定会话的会话模式,仅 IM 目标会返回。", + "type": "string" + }, + "description": { + "description": "可读的执行位置说明:会话名称、平台与会话模式,或 `Web console`。", + "type": "string" + }, + "place": { + "description": "执行位置:`im` 或 `web_console`。", + "enum": [ + "im", + "web_console" + ], + "type": "string" + }, + "platform": { + "description": "绑定会话的 IM 平台,仅 IM 目标会返回。", + "type": "string" + }, + "run_scope": { + "description": "绑定目标的作用域。", + "enum": [ + "person", + "team" + ], + "type": "string" + }, + "team_id": { + "description": "绑定作用域的团队 ID;个人作用域为 0。", + "format": "int64", + "type": "integer" + } + }, + "required": [ + "place", + "run_scope", + "team_id", + "description" + ], + "type": "object" + }, "AutomationRuleCreateRequest": { "description": "创建自动化规则。", "properties": { @@ -3288,10 +3337,24 @@ ] }, "team_id": { - "description": "作用域团队 ID。0 或省略表示个人规则;>0 表示账户下某团队。之后可通过 update 改派(团队规则转个人仅规则 owner 可操作;转入团队要求调用者属于该团队)。", + "description": "作用域团队 ID。省略表示继承创建该规则所在会话的作用域(当请求来自 IM 会话时);否则创建为个人规则。显式传 `0` 表示个人规则,`>0` 表示账户内的该团队。之后可通过 update 重新指定(团队规则转为个人规则仅限规则所有者;移入某个团队要求调用者属于该团队)。", "format": "int64", "minimum": 0, - "type": "integer" + "type": [ + "integer", + "null" + ] + }, + "run_in": { + "description": "规则的执行位置。`current-chat` 表示将其绑定到创建规则的当前 IM 会话,后续执行都在该会话中进行;`web` 表示在控制台的隐藏会话中执行。请求携带 IM 会话时默认为 `current-chat`,否则为 `web`;请求不携带实时 IM 会话时,`current-chat` 会被拒绝。", + "enum": [ + "current-chat", + "web" + ], + "type": [ + "string", + "null" + ] }, "timezone": { "description": "`cron_expr` 计算所用的 IANA 时区,例如 `Asia/Shanghai`。必须是服务端可加载的合法时区名,非法值会被拒绝。省略时依次回退到调用者的成员时区、账户时区,最后是服务端默认时区(Asia/Shanghai)。", @@ -3355,6 +3418,17 @@ ], "type": "string" }, + "execution_location": { + "$ref": "#/components/schemas/AutomationExecutionLocation" + }, + "execution_place": { + "description": "该规则普通触发器的执行位置:`web_console`(控制台隐藏会话)或 `im`(规则绑定的 IM 会话)。war room 触发器仍在该事件的作战室中执行。绑定的会话与作用域在创建后不可更改。", + "enum": [ + "im", + "web_console" + ], + "type": "string" + }, "http_post_token": { "description": "HTTP POST trigger token。只在创建或轮换 token 的响应中返回;请立即保存。", "type": "string" @@ -3472,7 +3546,8 @@ "created_at", "updated_at", "schedule_next_fire_at_ms", - "oncall_incident_trigger_enabled" + "oncall_incident_trigger_enabled", + "execution_place" ], "type": "object" }, @@ -21172,6 +21247,15 @@ }, "type": "object" }, + "resolve_mode": { + "description": "该问题的重新打开策略。`any` 表示出现任何复发错误都重新打开;`version` 表示只在问题未见过的应用版本再次出现该错误时才重新打开。本字段上线前创建的问题为空值,其行为等同于 `version`。", + "enum": [ + "", + "any", + "version" + ], + "type": "string" + }, "resolved_at": { "description": "标记为已解决的时间,Unix 时间戳(毫秒);未解决时为 0。", "format": "int64", @@ -21407,6 +21491,14 @@ ], "type": "string" }, + "resolve_mode": { + "description": "随 `status: resolved` 一起设置的重新打开策略。`any` 表示出现任何复发错误都重新打开该问题;`version` 表示只在问题未见过的应用版本再次出现该错误时才重新打开。仅在 `status` 为 `resolved` 时生效;该场景下省略表示以 `any` 解决。", + "enum": [ + "any", + "version" + ], + "type": "string" + }, "suspected_cause": { "description": "新的疑似原因;设置后原因来源会标记为 `user`(用户指定),覆盖自动判定结果。取值:\n\n| 值 | 含义 |\n|---|---|\n| `api.failed_request` | API/接口请求失败 |\n| `network.error` | 网络连接错误 |\n| `code.exception` | 代码异常 |\n| `code.invalid_object_access` | 非法对象访问 |\n| `code.invalid_argument` | 非法参数 |\n| `unknown` | 未知原因 |", "enum": [ @@ -52849,6 +52941,7 @@ "timestamp": 1775961839090, "version": "1.0.0" }, + "resolve_mode": "version", "resolved_at": 0, "resolved_by": 0, "service": "fd-console", @@ -52969,6 +53062,7 @@ "timestamp": 1775961839090, "version": "1.0.0" }, + "resolve_mode": "version", "resolved_at": 0, "resolved_by": 0, "service": "fd-console", @@ -53007,6 +53101,7 @@ "timestamp": 1775189527762, "version": "1.0.0" }, + "resolve_mode": "version", "resolved_at": 0, "resolved_by": 0, "service": "fd-console", @@ -53918,6 +54013,7 @@ "application/json": { "example": { "issue_id": "NHEacQHi2DhXqobr9qPQz9", + "resolve_mode": "version", "status": "resolved" }, "schema": { @@ -55856,6 +55952,7 @@ ], "oncall_incident_trigger_enabled": true, "prompt": "Summarize last week's alert noise and escalation load.", + "run_in": "web", "schedule_trigger_enabled": true, "team_id": 123, "timezone": "Asia/Shanghai" @@ -55880,6 +55977,13 @@ "enabled": true, "environment_id": "", "environment_kind": "", + "execution_location": { + "place": "web_console", + "run_scope": "team", + "team_id": 123, + "description": "Web console" + }, + "execution_place": "web_console", "http_post_token": "sat_yQ9p8V7n6M5k4J3h2G1f0E9d8C7b6A5z4Y3x2W1v0U", "http_post_trigger_enabled": true, "http_post_trigger_id": "atrig_2bLq4xT8mP1sWd9cN3rF6y", @@ -56069,6 +56173,13 @@ "enabled": true, "environment_id": "", "environment_kind": "", + "execution_location": { + "place": "web_console", + "run_scope": "team", + "team_id": 123, + "description": "Web console" + }, + "execution_place": "web_console", "http_post_trigger_enabled": true, "http_post_trigger_id": "atrig_2bLq4xT8mP1sWd9cN3rF6y", "http_post_trigger_url": "/safari/automation/triggers/atrig_2bLq4xT8mP1sWd9cN3rF6y/fire", @@ -56181,6 +56292,13 @@ "enabled": true, "environment_id": "", "environment_kind": "", + "execution_location": { + "place": "web_console", + "run_scope": "team", + "team_id": 123, + "description": "Web console" + }, + "execution_place": "web_console", "http_post_trigger_enabled": true, "http_post_trigger_id": "atrig_2bLq4xT8mP1sWd9cN3rF6y", "http_post_trigger_url": "/safari/automation/triggers/atrig_2bLq4xT8mP1sWd9cN3rF6y/fire", @@ -56403,6 +56521,13 @@ "enabled": true, "environment_id": "", "environment_kind": "", + "execution_location": { + "place": "web_console", + "run_scope": "team", + "team_id": 123, + "description": "Web console" + }, + "execution_place": "web_console", "http_post_token": "sat_yQ9p8V7n6M5k4J3h2G1f0E9d8C7b6A5z4Y3x2W1v0U", "http_post_trigger_enabled": true, "http_post_trigger_id": "atrig_2bLq4xT8mP1sWd9cN3rF6y", diff --git a/api-reference/rum.openapi.en.json b/api-reference/rum.openapi.en.json index ea3b9647..1f6a8d12 100644 --- a/api-reference/rum.openapi.en.json +++ b/api-reference/rum.openapi.en.json @@ -2238,6 +2238,15 @@ }, "type": "object" }, + "resolve_mode": { + "description": "Reopen policy of this issue. `any` reopens it on any recurrence; `version` reopens it only when the error recurs in an application version the issue has not seen. Issues created before this field shipped carry an empty value, which behaves like `version`.", + "enum": [ + "", + "any", + "version" + ], + "type": "string" + }, "resolved_at": { "description": "Time the issue was marked resolved, Unix timestamp in milliseconds; 0 while unresolved.", "format": "int64", @@ -2473,6 +2482,14 @@ ], "type": "string" }, + "resolve_mode": { + "description": "Reopen policy set together with `status: resolved`. `any` reopens the issue on any recurring error; `version` reopens it only when the error recurs in an application version the issue has not seen. Applied only while `status` is `resolved`; omitted there means the issue is resolved with `any`.", + "enum": [ + "any", + "version" + ], + "type": "string" + }, "suspected_cause": { "description": "New suspected cause; setting it marks the cause source as `user`, overriding the automatic classification. One of:\n\n| Value | Meaning |\n|---|---|\n| `api.failed_request` | API request failure |\n| `network.error` | Network connectivity error |\n| `code.exception` | Code exception |\n| `code.invalid_object_access` | Invalid object access |\n| `code.invalid_argument` | Invalid argument |\n| `unknown` | Unknown cause |", "enum": [ @@ -6411,6 +6428,7 @@ "timestamp": 1775961839090, "version": "1.0.0" }, + "resolve_mode": "version", "resolved_at": 0, "resolved_by": 0, "service": "fd-console", @@ -6531,6 +6549,7 @@ "timestamp": 1775961839090, "version": "1.0.0" }, + "resolve_mode": "version", "resolved_at": 0, "resolved_by": 0, "service": "fd-console", @@ -6569,6 +6588,7 @@ "timestamp": 1775189527762, "version": "1.0.0" }, + "resolve_mode": "version", "resolved_at": 0, "resolved_by": 0, "service": "fd-console", @@ -7480,6 +7500,7 @@ "application/json": { "example": { "issue_id": "NHEacQHi2DhXqobr9qPQz9", + "resolve_mode": "version", "status": "resolved" }, "schema": { diff --git a/api-reference/rum.openapi.zh.json b/api-reference/rum.openapi.zh.json index f447f52f..decb970f 100644 --- a/api-reference/rum.openapi.zh.json +++ b/api-reference/rum.openapi.zh.json @@ -2238,6 +2238,15 @@ }, "type": "object" }, + "resolve_mode": { + "description": "该问题的重新打开策略。`any` 表示出现任何复发错误都重新打开;`version` 表示只在问题未见过的应用版本再次出现该错误时才重新打开。本字段上线前创建的问题为空值,其行为等同于 `version`。", + "enum": [ + "", + "any", + "version" + ], + "type": "string" + }, "resolved_at": { "description": "标记为已解决的时间,Unix 时间戳(毫秒);未解决时为 0。", "format": "int64", @@ -2473,6 +2482,14 @@ ], "type": "string" }, + "resolve_mode": { + "description": "随 `status: resolved` 一起设置的重新打开策略。`any` 表示出现任何复发错误都重新打开该问题;`version` 表示只在问题未见过的应用版本再次出现该错误时才重新打开。仅在 `status` 为 `resolved` 时生效;该场景下省略表示以 `any` 解决。", + "enum": [ + "any", + "version" + ], + "type": "string" + }, "suspected_cause": { "description": "新的疑似原因;设置后原因来源会标记为 `user`(用户指定),覆盖自动判定结果。取值:\n\n| 值 | 含义 |\n|---|---|\n| `api.failed_request` | API/接口请求失败 |\n| `network.error` | 网络连接错误 |\n| `code.exception` | 代码异常 |\n| `code.invalid_object_access` | 非法对象访问 |\n| `code.invalid_argument` | 非法参数 |\n| `unknown` | 未知原因 |", "enum": [ @@ -6411,6 +6428,7 @@ "timestamp": 1775961839090, "version": "1.0.0" }, + "resolve_mode": "version", "resolved_at": 0, "resolved_by": 0, "service": "fd-console", @@ -6531,6 +6549,7 @@ "timestamp": 1775961839090, "version": "1.0.0" }, + "resolve_mode": "version", "resolved_at": 0, "resolved_by": 0, "service": "fd-console", @@ -6569,6 +6588,7 @@ "timestamp": 1775189527762, "version": "1.0.0" }, + "resolve_mode": "version", "resolved_at": 0, "resolved_by": 0, "service": "fd-console", @@ -7480,6 +7500,7 @@ "application/json": { "example": { "issue_id": "NHEacQHi2DhXqobr9qPQz9", + "resolve_mode": "version", "status": "resolved" }, "schema": { diff --git a/api-reference/safari.openapi.en.json b/api-reference/safari.openapi.en.json index ad49ef08..8e6b4d3d 100644 --- a/api-reference/safari.openapi.en.json +++ b/api-reference/safari.openapi.en.json @@ -717,6 +717,13 @@ "http_post_trigger_id": "atrig_2bLq4xT8mP1sWd9cN3rF6y", "http_post_trigger_url": "/safari/automation/triggers/atrig_2bLq4xT8mP1sWd9cN3rF6y/fire", "http_post_trigger_enabled": true, + "execution_place": "web_console", + "execution_location": { + "place": "web_console", + "run_scope": "team", + "team_id": 123, + "description": "Web console" + }, "can_edit": true, "created_at": 1780367971228, "updated_at": 1780367971228, @@ -762,6 +769,7 @@ "example": { "name": "Weekly on-call review", "team_id": 123, + "run_in": "web", "enabled": true, "cron_expr": "0 9 * * 1", "timezone": "Asia/Shanghai", @@ -921,6 +929,13 @@ "http_post_trigger_id": "atrig_2bLq4xT8mP1sWd9cN3rF6y", "http_post_trigger_url": "/safari/automation/triggers/atrig_2bLq4xT8mP1sWd9cN3rF6y/fire", "http_post_trigger_enabled": true, + "execution_place": "web_console", + "execution_location": { + "place": "web_console", + "run_scope": "team", + "team_id": 123, + "description": "Web console" + }, "can_edit": true, "created_at": 1780367971228, "updated_at": 1780367971228, @@ -1033,6 +1048,13 @@ "http_post_trigger_id": "atrig_2bLq4xT8mP1sWd9cN3rF6y", "http_post_trigger_url": "/safari/automation/triggers/atrig_2bLq4xT8mP1sWd9cN3rF6y/fire", "http_post_trigger_enabled": true, + "execution_place": "web_console", + "execution_location": { + "place": "web_console", + "run_scope": "team", + "team_id": 123, + "description": "Web console" + }, "can_edit": true, "created_at": 1780367971228, "updated_at": 1780367971228, @@ -1244,6 +1266,13 @@ "http_post_trigger_id": "atrig_2bLq4xT8mP1sWd9cN3rF6y", "http_post_trigger_url": "/safari/automation/triggers/atrig_2bLq4xT8mP1sWd9cN3rF6y/fire", "http_post_trigger_enabled": true, + "execution_place": "web_console", + "execution_location": { + "place": "web_console", + "run_scope": "team", + "team_id": 123, + "description": "Web console" + }, "can_edit": true, "created_at": 1780367971228, "updated_at": 1780367971228, @@ -5543,6 +5572,55 @@ "agent_id" ] }, + "AutomationExecutionLocation": { + "type": "object", + "description": "Read-only description of where the rule runs, shown in the console.", + "properties": { + "place": { + "type": "string", + "description": "Execution place: `im` or `web_console`.", + "enum": [ + "im", + "web_console" + ] + }, + "run_scope": { + "type": "string", + "description": "Run scope of the pinned destination.", + "enum": [ + "person", + "team" + ] + }, + "team_id": { + "type": "integer", + "format": "int64", + "description": "Team ID of the pinned scope; 0 for a personal scope." + }, + "platform": { + "type": "string", + "description": "IM platform of the pinned chat. Set only for an IM destination." + }, + "conversation_mode": { + "type": "string", + "description": "Conversation mode of the pinned chat. Set only for an IM destination." + }, + "chat_name": { + "type": "string", + "description": "Chat name of the pinned chat. Set only for an IM destination." + }, + "description": { + "type": "string", + "description": "Human-readable destination label: the chat name, the platform and mode, or `Web console`." + } + }, + "required": [ + "place", + "run_scope", + "team_id", + "description" + ] + }, "AutomationRuleCreateRequest": { "type": "object", "description": "Create an Automation rule.", @@ -5554,10 +5632,24 @@ "description": "Rule name." }, "team_id": { - "type": "integer", + "type": [ + "integer", + "null" + ], "format": "int64", "minimum": 0, - "description": "Scope team ID. 0 or omitted means a personal rule; >0 means a team in the account. Can be reassigned later via update (converting a team rule to personal is owner-only; moving into a team requires the caller to belong to it)." + "description": "Scope team ID. Omitted means inherit the scope of the conversation the rule is created from, when the request carries an IM conversation; otherwise the rule is personal. An explicit `0` asks for a personal rule and `>0` targets that team in the account. Can be reassigned later via update (converting a team rule to personal is owner-only; moving into a team requires the caller to belong to it)." + }, + "run_in": { + "type": [ + "string", + "null" + ], + "description": "Where the rule runs. `current-chat` binds it to the live IM conversation it is created from, so its runs stay in that chat; `web` runs it in a hidden console session. Defaults to `current-chat` for a request carrying an IM conversation and to `web` otherwise; `current-chat` is rejected without a live IM conversation.", + "enum": [ + "current-chat", + "web" + ] }, "enabled": { "type": "boolean", @@ -5762,6 +5854,17 @@ "type": "string", "description": "HTTP POST trigger token. Returned only on create or token rotation; save it immediately." }, + "execution_place": { + "type": "string", + "description": "Where this rule's ordinary triggers run: `web_console` (a hidden console session) or `im` (the IM chat the rule is pinned to). A war-room trigger still runs in that event's war room. The pinned chat and scope cannot be changed after create.", + "enum": [ + "im", + "web_console" + ] + }, + "execution_location": { + "$ref": "#/components/schemas/AutomationExecutionLocation" + }, "can_edit": { "type": "boolean", "description": "True when the caller can manage this rule: the personal rule owner; for team rules, an account admin or a member of the rule's team." @@ -5801,7 +5904,8 @@ "created_at", "updated_at", "schedule_next_fire_at_ms", - "oncall_incident_trigger_enabled" + "oncall_incident_trigger_enabled", + "execution_place" ] }, "AutomationRuleListRequest": { diff --git a/api-reference/safari.openapi.zh.json b/api-reference/safari.openapi.zh.json index c17d8252..8b881413 100644 --- a/api-reference/safari.openapi.zh.json +++ b/api-reference/safari.openapi.zh.json @@ -717,6 +717,13 @@ "http_post_trigger_id": "atrig_2bLq4xT8mP1sWd9cN3rF6y", "http_post_trigger_url": "/safari/automation/triggers/atrig_2bLq4xT8mP1sWd9cN3rF6y/fire", "http_post_trigger_enabled": true, + "execution_place": "web_console", + "execution_location": { + "place": "web_console", + "run_scope": "team", + "team_id": 123, + "description": "Web console" + }, "can_edit": true, "created_at": 1780367971228, "updated_at": 1780367971228, @@ -762,6 +769,7 @@ "example": { "name": "Weekly on-call review", "team_id": 123, + "run_in": "web", "enabled": true, "cron_expr": "0 9 * * 1", "timezone": "Asia/Shanghai", @@ -921,6 +929,13 @@ "http_post_trigger_id": "atrig_2bLq4xT8mP1sWd9cN3rF6y", "http_post_trigger_url": "/safari/automation/triggers/atrig_2bLq4xT8mP1sWd9cN3rF6y/fire", "http_post_trigger_enabled": true, + "execution_place": "web_console", + "execution_location": { + "place": "web_console", + "run_scope": "team", + "team_id": 123, + "description": "Web console" + }, "can_edit": true, "created_at": 1780367971228, "updated_at": 1780367971228, @@ -1033,6 +1048,13 @@ "http_post_trigger_id": "atrig_2bLq4xT8mP1sWd9cN3rF6y", "http_post_trigger_url": "/safari/automation/triggers/atrig_2bLq4xT8mP1sWd9cN3rF6y/fire", "http_post_trigger_enabled": true, + "execution_place": "web_console", + "execution_location": { + "place": "web_console", + "run_scope": "team", + "team_id": 123, + "description": "Web console" + }, "can_edit": true, "created_at": 1780367971228, "updated_at": 1780367971228, @@ -1244,6 +1266,13 @@ "http_post_trigger_id": "atrig_2bLq4xT8mP1sWd9cN3rF6y", "http_post_trigger_url": "/safari/automation/triggers/atrig_2bLq4xT8mP1sWd9cN3rF6y/fire", "http_post_trigger_enabled": true, + "execution_place": "web_console", + "execution_location": { + "place": "web_console", + "run_scope": "team", + "team_id": 123, + "description": "Web console" + }, "can_edit": true, "created_at": 1780367971228, "updated_at": 1780367971228, @@ -5543,6 +5572,55 @@ "agent_id" ] }, + "AutomationExecutionLocation": { + "type": "object", + "description": "规则执行位置的只读描述,在控制台中展示。", + "properties": { + "place": { + "type": "string", + "description": "执行位置:`im` 或 `web_console`。", + "enum": [ + "im", + "web_console" + ] + }, + "run_scope": { + "type": "string", + "description": "绑定目标的作用域。", + "enum": [ + "person", + "team" + ] + }, + "team_id": { + "type": "integer", + "format": "int64", + "description": "绑定作用域的团队 ID;个人作用域为 0。" + }, + "platform": { + "type": "string", + "description": "绑定会话的 IM 平台,仅 IM 目标会返回。" + }, + "conversation_mode": { + "type": "string", + "description": "绑定会话的会话模式,仅 IM 目标会返回。" + }, + "chat_name": { + "type": "string", + "description": "绑定会话的名称,仅 IM 目标会返回。" + }, + "description": { + "type": "string", + "description": "可读的执行位置说明:会话名称、平台与会话模式,或 `Web console`。" + } + }, + "required": [ + "place", + "run_scope", + "team_id", + "description" + ] + }, "AutomationRuleCreateRequest": { "type": "object", "description": "创建自动化规则。", @@ -5554,10 +5632,24 @@ "description": "规则名称。" }, "team_id": { - "type": "integer", + "type": [ + "integer", + "null" + ], "format": "int64", "minimum": 0, - "description": "作用域团队 ID。0 或省略表示个人规则;>0 表示账户下某团队。之后可通过 update 改派(团队规则转个人仅规则 owner 可操作;转入团队要求调用者属于该团队)。" + "description": "作用域团队 ID。省略表示继承创建该规则所在会话的作用域(当请求来自 IM 会话时);否则创建为个人规则。显式传 `0` 表示个人规则,`>0` 表示账户内的该团队。之后可通过 update 重新指定(团队规则转为个人规则仅限规则所有者;移入某个团队要求调用者属于该团队)。" + }, + "run_in": { + "type": [ + "string", + "null" + ], + "description": "规则的执行位置。`current-chat` 表示将其绑定到创建规则的当前 IM 会话,后续执行都在该会话中进行;`web` 表示在控制台的隐藏会话中执行。请求携带 IM 会话时默认为 `current-chat`,否则为 `web`;请求不携带实时 IM 会话时,`current-chat` 会被拒绝。", + "enum": [ + "current-chat", + "web" + ] }, "enabled": { "type": "boolean", @@ -5762,6 +5854,17 @@ "type": "string", "description": "HTTP POST trigger token。只在创建或轮换 token 的响应中返回;请立即保存。" }, + "execution_place": { + "type": "string", + "description": "该规则普通触发器的执行位置:`web_console`(控制台隐藏会话)或 `im`(规则绑定的 IM 会话)。war room 触发器仍在该事件的作战室中执行。绑定的会话与作用域在创建后不可更改。", + "enum": [ + "im", + "web_console" + ] + }, + "execution_location": { + "$ref": "#/components/schemas/AutomationExecutionLocation" + }, "can_edit": { "type": "boolean", "description": "当调用者可管理该规则时为 true:个人规则仅限创建者;团队规则限账户管理员或规则所属团队成员。" @@ -5801,7 +5904,8 @@ "created_at", "updated_at", "schedule_next_fire_at_ms", - "oncall_incident_trigger_enabled" + "oncall_incident_trigger_enabled", + "execution_place" ] }, "AutomationRuleListRequest": {