fix cr problem
This commit is contained in:
1 parent
2610c8ce87
commit
591609fdee
6 files changed
+37
-37
No files matched your search
@@ -87,8 +87,8 @@ dws devapp
|
||||
permission add Apply permissions into current app version changes
|
||||
permission remove Remove authorized permissions
|
||||
event list List subscribable events and current subscription state
|
||||
event subscribe Subscribe one event by eventCode
|
||||
event unsubscribe Unsubscribe one event by eventCode
|
||||
event subscribe Subscribe events by eventCodes
|
||||
event unsubscribe Unsubscribe events by eventCodes
|
||||
robot create Create a new agent app + robot synchronously
|
||||
robot submit Submit async robot-create task (supports retry by taskId)
|
||||
robot result Query async robot-create task result
|
||||
@@ -948,14 +948,14 @@ Rules:
|
||||
Event and version commands are needed for a full application lifecycle but should not be folded into permission add.
|
||||
|
||||
Implemented event tools (verified against the `op-app` MCP `tools/list`). The
|
||||
real model is "list subscribable events + subscribe/unsubscribe one event by
|
||||
`eventCode`", not a single callbackUrl/token/aesKey config call:
|
||||
real model is "list subscribable events + subscribe/unsubscribe events by
|
||||
`eventCodes`", not a single callbackUrl/token/aesKey config call:
|
||||
|
||||
| CLI | MCP tool | Notes |
|
||||
| --- | --- | --- |
|
||||
| `devapp event list` | `list_dev_app_events` | Args `unifiedAppId`; returns `pushType` + `events[]` (`eventCode`/`eventName`/`subscribed`). Read. |
|
||||
| `devapp event subscribe` | `subscribe_dev_app_event` | Args `unifiedAppId` + `eventCode`. Write (`--dry-run`/`--yes`). |
|
||||
| `devapp event unsubscribe` | `unsubscribe_dev_app_event` | Args `unifiedAppId` + `eventCode`. Write. |
|
||||
| `devapp event subscribe` | `subscribe_dev_app_events` | Args `unifiedAppId` + `eventCodes`. Write (`--dry-run`/`--yes`). |
|
||||
| `devapp event unsubscribe` | `unsubscribe_dev_app_events` | Args `unifiedAppId` + `eventCodes`. Write. |
|
||||
|
||||
Note: for gray unified apps, subscribe/unsubscribe are staged into version
|
||||
metadata and only take effect after `version publish`. The event callback URL
|
||||
@@ -1086,7 +1086,7 @@ Yulan invocation examples:
|
||||
| "把应用图标换成 ICON_RESOURCE" | `dws devapp update --unified-app-id ... --icon ICON_RESOURCE --dry-run --format json` | Icon change is app base info update and must be guarded. |
|
||||
| "已确认删除这个开放平台应用" | `dws devapp delete --unified-app-id ... --yes --format json` | Destructive write only after unique app resolution and confirmation. |
|
||||
| "手机号权限要申请,虽然需要审核" | `dws devapp permission add --permissions Contact.User.mobile --dry-run/--yes` | `requiredApproval=true` is still appliable; approval moves to version publish. |
|
||||
| "订阅通讯录用户增加事件" | `dws devapp event list ...` then `dws devapp event subscribe --event-code user_add_org --dry-run --format json` | Pick eventCode from list, then subscribe; gray apps need a version publish to take effect. |
|
||||
| "订阅通讯录用户增加事件" | `dws devapp event list ...` then `dws devapp event subscribe --event-codes user_add_org --dry-run --format json` | Pick eventCode from list, then subscribe; gray apps need a version publish to take effect. |
|
||||
| "保存版本并看审核状态" | `version create`, `check-approval`, `publish`, `status` | Version flow owns approver selection and publish audit state. |
|
||||
| "创建 MCP 服务并配置 HSF tool" | OpenDev MCP platform workflow, not `dws devapp create` | MCP connector/tool is a platform artifact, not an enterprise internal app. |
|
||||
|
||||
|
||||
@@ -60,8 +60,8 @@ const (
|
||||
|
||||
// 事件订阅能力(op-app MCP 工具,硬编码不走服务发现)。
|
||||
devAppEventListTool = "list_dev_app_events"
|
||||
devAppEventSubscribeTool = "subscribe_dev_app_event"
|
||||
devAppEventUnsubscribeTool = "unsubscribe_dev_app_event"
|
||||
devAppEventSubscribeTool = "subscribe_dev_app_events"
|
||||
devAppEventUnsubscribeTool = "unsubscribe_dev_app_events"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -217,8 +217,8 @@ func newDevAppCommand(runner executor.Runner) *cobra.Command {
|
||||
}
|
||||
event.AddCommand(
|
||||
newDevAppEventListCommand(runner),
|
||||
newDevAppEventSubscribeCommand(runner, "subscribe", "订阅单个事件", devAppEventSubscribeTool),
|
||||
newDevAppEventSubscribeCommand(runner, "unsubscribe", "退订单个事件", devAppEventUnsubscribeTool),
|
||||
newDevAppEventSubscribeCommand(runner, "subscribe", "批量订阅事件", devAppEventSubscribeTool),
|
||||
newDevAppEventSubscribeCommand(runner, "unsubscribe", "批量退订事件", devAppEventUnsubscribeTool),
|
||||
)
|
||||
|
||||
root.AddCommand(
|
||||
|
||||
@@ -320,13 +320,13 @@ func TestDevAppEventCommandsBuildToolParams(t *testing.T) {
|
||||
{
|
||||
name: "subscribe",
|
||||
args: []string{"event", "subscribe", "--unified-app-id", "u-1", "--event-codes", "user_add_org,org_dept_modify", "--yes"},
|
||||
wantTool: "subscribe_dev_app_event",
|
||||
wantTool: "subscribe_dev_app_events",
|
||||
wantParams: map[string]any{"unifiedAppId": "u-1", "eventCodes": []string{"user_add_org", "org_dept_modify"}},
|
||||
},
|
||||
{
|
||||
name: "unsubscribe",
|
||||
args: []string{"event", "unsubscribe", "--unified-app-id", "u-1", "--event-codes", "user_add_org", "--yes"},
|
||||
wantTool: "unsubscribe_dev_app_event",
|
||||
wantTool: "unsubscribe_dev_app_events",
|
||||
wantParams: map[string]any{"unifiedAppId": "u-1", "eventCodes": []string{"user_add_org"}},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 事件订阅
|
||||
|
||||
管理开放平台企业内部应用的事件订阅:列出可订阅事件、按事件码订阅/退订。
|
||||
管理开放平台企业内部应用的事件订阅:列出可订阅事件、按事件码列表批量订阅/退订。
|
||||
|
||||
> 所有命令通过 `--unified-app-id` 定位应用;`corpId` / `userId` 由 MCP 系统上下文注入,CLI 不传。订阅/退订是写操作,先 `--dry-run`,确认后再 `--yes`。
|
||||
|
||||
@@ -23,27 +23,27 @@ MCP tool: `list_dev_app_events`。返回 `pushType`(当前推送类型)和 `
|
||||
## 订阅事件
|
||||
|
||||
```bash
|
||||
dws devapp event subscribe --unified-app-id <unifiedAppId> --event-code user_add_org --dry-run --format json
|
||||
dws devapp event subscribe --unified-app-id <unifiedAppId> --event-code user_add_org --yes --format json
|
||||
dws devapp event subscribe --unified-app-id <unifiedAppId> --event-codes user_add_org,org_dept_modify --dry-run --format json
|
||||
dws devapp event subscribe --unified-app-id <unifiedAppId> --event-codes user_add_org,org_dept_modify --yes --format json
|
||||
```
|
||||
|
||||
MCP tool: `subscribe_dev_app_event`(入参 `unifiedAppId` + `eventCode`,一次订阅一个)。
|
||||
MCP tool: `subscribe_dev_app_events`(入参 `unifiedAppId` + `eventCodes`,一次订阅多个事件码)。
|
||||
|
||||
## 退订事件
|
||||
|
||||
```bash
|
||||
dws devapp event unsubscribe --unified-app-id <unifiedAppId> --event-code user_add_org --dry-run --format json
|
||||
dws devapp event unsubscribe --unified-app-id <unifiedAppId> --event-code user_add_org --yes --format json
|
||||
dws devapp event unsubscribe --unified-app-id <unifiedAppId> --event-codes user_add_org,org_dept_modify --dry-run --format json
|
||||
dws devapp event unsubscribe --unified-app-id <unifiedAppId> --event-codes user_add_org,org_dept_modify --yes --format json
|
||||
```
|
||||
|
||||
MCP tool: `unsubscribe_dev_app_event`(入参 `unifiedAppId` + `eventCode`)。
|
||||
MCP tool: `unsubscribe_dev_app_events`(入参 `unifiedAppId` + `eventCodes`,一次退订多个事件码)。
|
||||
|
||||
## 字段映射
|
||||
|
||||
| CLI | MCP | 必填 | 说明 |
|
||||
|-----|-----|------|------|
|
||||
| `--unified-app-id` | `unifiedAppId` | 是 | 统一应用 ID |
|
||||
| `--event-code` | `eventCode` | subscribe/unsubscribe 必填 | 事件码,取自 `event list` |
|
||||
| `--event-codes` | `eventCodes` | subscribe/unsubscribe 必填 | 事件码列表,逗号分隔,取自 `event list` |
|
||||
|
||||
## 灰度应用需发布版本生效(重要)
|
||||
|
||||
@@ -67,7 +67,7 @@ event subscribe/unsubscribe 订阅变更写入版本元数据
|
||||
→ 从返回里挑 eventCode
|
||||
|
||||
2. 订阅
|
||||
dws devapp event subscribe --unified-app-id <ID> --event-code <CODE> --dry-run --format json
|
||||
dws devapp event subscribe --unified-app-id <ID> --event-codes <CODE1>,<CODE2> --dry-run --format json
|
||||
→ 确认后加 --yes
|
||||
|
||||
3. 验证
|
||||
@@ -79,6 +79,6 @@ event subscribe/unsubscribe 订阅变更写入版本元数据
|
||||
|
||||
| 情况 | 处理 |
|
||||
|------|------|
|
||||
| `--event-code` 缺失 | CLI 直接报错,先 `event list` 取事件码 |
|
||||
| `--event-codes` 缺失 | CLI 直接报错,先 `event list` 取事件码 |
|
||||
| 订阅后 `subscribed` 仍为 false | 灰度应用需先 `version publish` 发布版本 |
|
||||
| `ServiceResult.success=false` | 透传 `errorCode/errorMsg` |
|
||||
@@ -321,13 +321,13 @@ MCP tools: `create_dev_app_version` / `list_dev_app_versions` / `get_dev_app_ver
|
||||
|
||||
```bash
|
||||
dws devapp event list --unified-app-id ID --format json
|
||||
dws devapp event subscribe --unified-app-id ID --event-code user_add_org --dry-run --format json
|
||||
dws devapp event unsubscribe --unified-app-id ID --event-code user_add_org --dry-run --format json
|
||||
dws devapp event subscribe --unified-app-id ID --event-codes user_add_org,org_dept_modify --dry-run --format json
|
||||
dws devapp event unsubscribe --unified-app-id ID --event-codes user_add_org,org_dept_modify --dry-run --format json
|
||||
```
|
||||
|
||||
MCP tools: `list_dev_app_events` / `subscribe_dev_app_event` / `unsubscribe_dev_app_event`。
|
||||
MCP tools: `list_dev_app_events` / `subscribe_dev_app_events` / `unsubscribe_dev_app_events`。
|
||||
|
||||
- `event list` 返回 `pushType` 与 `events[]`(每项 `eventCode`/`eventName`/`subscribed`);订阅/退订只接受 `--event-code`(取自 list 返回),一次一个。
|
||||
- `event list` 返回 `pushType` 与 `events[]`(每项 `eventCode`/`eventName`/`subscribed`);订阅/退订接受 `--event-codes` 逗号分隔列表(取自 list 返回),一次可传多个。
|
||||
- 写操作走 `--dry-run`/`--yes` 写保护;`list` 是只读。
|
||||
- **灰度统一应用**:`subscribe`/`unsubscribe` 只把变更暂存到版本元数据,需后续 `version create → publish` 发布版本后才生效。订阅后 `event list` 若仍 `subscribed=false`,先发布版本再回读。
|
||||
- 回调地址不在此模型内:消息/事件回调地址走机器人配置(`robot config --outgoing-url/--event-url`)。
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 事件订阅
|
||||
|
||||
管理开放平台企业内部应用的事件订阅:列出可订阅事件、按事件码订阅/退订。
|
||||
管理开放平台企业内部应用的事件订阅:列出可订阅事件、按事件码列表批量订阅/退订。
|
||||
|
||||
> 所有命令通过 `--unified-app-id` 定位应用;`corpId` / `userId` 由 MCP 系统上下文注入,CLI 不传。订阅/退订是写操作,先 `--dry-run`,确认后再 `--yes`。
|
||||
|
||||
@@ -23,27 +23,27 @@ MCP tool: `list_dev_app_events`。返回 `pushType`(当前推送类型)和 `
|
||||
## 订阅事件
|
||||
|
||||
```bash
|
||||
dws devapp event subscribe --unified-app-id <unifiedAppId> --event-code user_add_org --dry-run --format json
|
||||
dws devapp event subscribe --unified-app-id <unifiedAppId> --event-code user_add_org --yes --format json
|
||||
dws devapp event subscribe --unified-app-id <unifiedAppId> --event-codes user_add_org,org_dept_modify --dry-run --format json
|
||||
dws devapp event subscribe --unified-app-id <unifiedAppId> --event-codes user_add_org,org_dept_modify --yes --format json
|
||||
```
|
||||
|
||||
MCP tool: `subscribe_dev_app_event`(入参 `unifiedAppId` + `eventCode`,一次订阅一个)。
|
||||
MCP tool: `subscribe_dev_app_events`(入参 `unifiedAppId` + `eventCodes`,一次订阅多个事件码)。
|
||||
|
||||
## 退订事件
|
||||
|
||||
```bash
|
||||
dws devapp event unsubscribe --unified-app-id <unifiedAppId> --event-code user_add_org --dry-run --format json
|
||||
dws devapp event unsubscribe --unified-app-id <unifiedAppId> --event-code user_add_org --yes --format json
|
||||
dws devapp event unsubscribe --unified-app-id <unifiedAppId> --event-codes user_add_org,org_dept_modify --dry-run --format json
|
||||
dws devapp event unsubscribe --unified-app-id <unifiedAppId> --event-codes user_add_org,org_dept_modify --yes --format json
|
||||
```
|
||||
|
||||
MCP tool: `unsubscribe_dev_app_event`(入参 `unifiedAppId` + `eventCode`)。
|
||||
MCP tool: `unsubscribe_dev_app_events`(入参 `unifiedAppId` + `eventCodes`,一次退订多个事件码)。
|
||||
|
||||
## 字段映射
|
||||
|
||||
| CLI | MCP | 必填 | 说明 |
|
||||
|-----|-----|------|------|
|
||||
| `--unified-app-id` | `unifiedAppId` | 是 | 统一应用 ID |
|
||||
| `--event-code` | `eventCode` | subscribe/unsubscribe 必填 | 事件码,取自 `event list` |
|
||||
| `--event-codes` | `eventCodes` | subscribe/unsubscribe 必填 | 事件码列表,逗号分隔,取自 `event list` |
|
||||
|
||||
## 灰度应用需发布版本生效(重要)
|
||||
|
||||
@@ -67,7 +67,7 @@ event subscribe/unsubscribe 订阅变更写入版本元数据
|
||||
→ 从返回里挑 eventCode
|
||||
|
||||
2. 订阅
|
||||
dws devapp event subscribe --unified-app-id <ID> --event-code <CODE> --dry-run --format json
|
||||
dws devapp event subscribe --unified-app-id <ID> --event-codes <CODE1>,<CODE2> --dry-run --format json
|
||||
→ 确认后加 --yes
|
||||
|
||||
3. 验证
|
||||
@@ -79,6 +79,6 @@ event subscribe/unsubscribe 订阅变更写入版本元数据
|
||||
|
||||
| 情况 | 处理 |
|
||||
|------|------|
|
||||
| `--event-code` 缺失 | CLI 直接报错,先 `event list` 取事件码 |
|
||||
| `--event-codes` 缺失 | CLI 直接报错,先 `event list` 取事件码 |
|
||||
| 订阅后 `subscribed` 仍为 false | 灰度应用需先 `version publish` 发布版本 |
|
||||
| `ServiceResult.success=false` | 透传 `errorCode/errorMsg` |
|
||||
Reference in new issue
Block a user