weaver-work-cli 0.1.8 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -17
- package/dist/cmd/action.js +76 -0
- package/dist/cmd/index.js +2 -0
- package/dist/cmd/refs/index.js +103 -0
- package/dist/cmd/register.js +31 -0
- package/dist/cmd/root.js +1 -0
- package/dist/cmd/setup/index.js +25 -5
- package/dist/cmd/skills/index.js +37 -5
- package/dist/core/connector.js +54 -0
- package/dist/core/context.js +2 -1
- package/dist/core/input.js +48 -0
- package/dist/core/output.js +298 -3
- package/dist/core/refs.js +435 -0
- package/dist/core/state.js +26 -0
- package/dist/internal/e10/auth/commands.js +34 -19
- package/dist/internal/e10/auth/session.js +74 -2
- package/dist/internal/e10/auth/xiaoe.js +359 -94
- package/dist/internal/e10/context.js +18 -6
- package/dist/internal/e10/request-runtime.js +8 -1
- package/dist/internal/skills/install.js +148 -28
- package/dist/internal/skills/reader.js +12 -9
- package/dist/shortcuts/blog/continuation.js +74 -0
- package/dist/shortcuts/blog/errors.js +60 -0
- package/dist/shortcuts/blog/host.js +175 -0
- package/dist/shortcuts/blog/index.js +324 -0
- package/dist/shortcuts/blog/manifest.js +415 -0
- package/dist/shortcuts/blog/operations/comment.js +125 -0
- package/dist/shortcuts/blog/operations/comments.js +31 -0
- package/dist/shortcuts/blog/operations/edit.js +131 -0
- package/dist/shortcuts/blog/operations/export.js +46 -0
- package/dist/shortcuts/blog/operations/like.js +80 -0
- package/dist/shortcuts/blog/operations/publish.js +157 -0
- package/dist/shortcuts/blog/operations/query-user.js +58 -0
- package/dist/shortcuts/blog/operations/query.js +96 -0
- package/dist/shortcuts/blog/operations/registry.js +54 -0
- package/dist/shortcuts/blog/operations/remind.js +176 -0
- package/dist/shortcuts/blog/operations/shared.js +330 -0
- package/dist/shortcuts/blog/operations/types.js +16 -0
- package/dist/shortcuts/blog/operations.js +9 -0
- package/dist/shortcuts/caizhilian/continuation.js +70 -0
- package/dist/shortcuts/caizhilian/errors.js +53 -0
- package/dist/shortcuts/caizhilian/host.js +190 -0
- package/dist/shortcuts/caizhilian/index.js +186 -0
- package/dist/shortcuts/caizhilian/manifest.js +42 -0
- package/dist/shortcuts/caizhilian/operations/api.js +801 -0
- package/dist/shortcuts/caizhilian/operations/confirm.js +75 -0
- package/dist/shortcuts/caizhilian/operations/files.js +306 -0
- package/dist/shortcuts/caizhilian/operations/form.js +170 -0
- package/dist/shortcuts/caizhilian/operations/handlers/collab.js +611 -0
- package/dist/shortcuts/caizhilian/operations/handlers/document.js +890 -0
- package/dist/shortcuts/caizhilian/operations/handlers/file-collection.js +1227 -0
- package/dist/shortcuts/caizhilian/operations/handlers/file-upload.js +192 -0
- package/dist/shortcuts/caizhilian/operations/handlers/fileops.js +570 -0
- package/dist/shortcuts/caizhilian/operations/handlers/folder.js +1024 -0
- package/dist/shortcuts/caizhilian/operations/handlers/search.js +318 -0
- package/dist/shortcuts/caizhilian/operations/handlers/setting-attach.js +294 -0
- package/dist/shortcuts/caizhilian/operations/handlers/setting-backup.js +423 -0
- package/dist/shortcuts/caizhilian/operations/handlers/setting-encrypt.js +238 -0
- package/dist/shortcuts/caizhilian/operations/handlers/setting-storage.js +364 -0
- package/dist/shortcuts/caizhilian/operations/handlers/system.js +106 -0
- package/dist/shortcuts/caizhilian/operations/registry.js +151 -0
- package/dist/shortcuts/caizhilian/operations/shared.js +408 -0
- package/dist/shortcuts/caizhilian/operations/specs.js +698 -0
- package/dist/shortcuts/caizhilian/operations/types.js +57 -0
- package/dist/shortcuts/caizhilian/operations.js +21 -0
- package/dist/shortcuts/contract/continuation.js +70 -0
- package/dist/shortcuts/contract/errors.js +62 -0
- package/dist/shortcuts/contract/host.js +205 -0
- package/dist/shortcuts/contract/index.js +318 -0
- package/dist/shortcuts/contract/manifest.js +596 -0
- package/dist/shortcuts/contract/operations/clause-reference.js +78 -0
- package/dist/shortcuts/contract/operations/form-info.js +371 -0
- package/dist/shortcuts/contract/operations/read.js +118 -0
- package/dist/shortcuts/contract/operations/registry.js +43 -0
- package/dist/shortcuts/contract/operations/request.js +300 -0
- package/dist/shortcuts/contract/operations/shared.js +133 -0
- package/dist/shortcuts/contract/operations/subject.js +157 -0
- package/dist/shortcuts/contract/operations/template.js +81 -0
- package/dist/shortcuts/contract/operations/types.js +7 -0
- package/dist/shortcuts/contract/operations/workflow.js +52 -0
- package/dist/shortcuts/contract/operations/write.js +131 -0
- package/dist/shortcuts/contract/operations.js +8 -0
- package/dist/shortcuts/hrm/index.js +83 -2
- package/dist/shortcuts/hrm/manifest.js +16 -9
- package/dist/shortcuts/hrm/operations/employee.js +160 -30
- package/dist/shortcuts/hrm/operations/org.js +17 -3
- package/dist/shortcuts/hrm/operations/position.js +18 -2
- package/dist/shortcuts/hrm/operations/registry.js +2 -0
- package/dist/shortcuts/hrm/operations/resolve.js +449 -0
- package/dist/shortcuts/index.js +5 -1
- package/dist/shortcuts/invoice/index.js +74 -36
- package/dist/shortcuts/invoice/manifest.js +674 -4
- package/dist/shortcuts/invoice/markdown.js +172 -0
- package/dist/shortcuts/invoice/operations/add.js +3 -3
- package/dist/shortcuts/invoice/operations/delete.js +2 -2
- package/dist/shortcuts/invoice/operations/get.js +10 -2
- package/dist/shortcuts/invoice/operations/import.js +2 -2
- package/dist/shortcuts/invoice/operations/registry.js +8 -1
- package/dist/shortcuts/invoice/operations/reim-auto.js +719 -0
- package/dist/shortcuts/invoice/operations/reim.js +85 -2
- package/dist/shortcuts/invoice/operations/shared.js +75 -8
- package/dist/shortcuts/invoice/operations/update.js +2 -2
- package/dist/shortcuts/invoice/operations/upload-and-validate.js +93 -0
- package/dist/shortcuts/invoice/operations/validate-preview.js +2 -1
- package/dist/shortcuts/invoice/projection.js +328 -0
- package/dist/shortcuts/meeting/host.js +18 -1
- package/dist/shortcuts/meeting/manifest.js +30 -18
- package/dist/shortcuts/meeting/operations/eb/catalog.js +390 -0
- package/dist/shortcuts/meeting/operations/eb/conflict.js +389 -0
- package/dist/shortcuts/meeting/operations/eb/factory.js +389 -0
- package/dist/shortcuts/meeting/operations/eb/index.js +22 -0
- package/dist/shortcuts/meeting/operations/env.js +8 -1
- package/dist/shortcuts/meeting/operations/registry.js +2 -0
- package/dist/shortcuts/meeting/operations/signs.js +216 -2
- package/dist/shortcuts/workflow/endpoints.js +2 -1
- package/dist/shortcuts/workflow/errors.js +8 -2
- package/dist/shortcuts/workflow/host.js +11 -4
- package/dist/shortcuts/workflow/operations/form.js +1016 -590
- package/dist/shortcuts/workflow/operations/read.js +913 -231
- package/dist/shortcuts/workflow/operations/shared.js +21 -0
- package/dist/shortcuts/workflow/operations/write.js +750 -52
- package/dist/shortcuts/workflow/operations.js +36 -10
- package/docs/_catalog.md +6 -0
- package/docs/agent-invoice.md +5 -1
- package/docs/agent-io-channel-design.md +468 -0
- package/docs/agent-skill-install.md +9 -4
- package/docs/blog.md +123 -0
- package/docs/caizhilian.md +304 -0
- package/docs/contract.md +91 -0
- package/docs/e10-auth.md +4 -2
- package/docs/hrm.md +53 -11
- package/docs/invoice.md +5 -1
- package/docs/meeting.md +1 -1
- package/docs/operation-manual.md +15 -3
- package/docs/skill-review-2026-09-19.md +2 -2
- package/package.json +1 -1
- package/scripts/package-skill.mjs +32 -20
- package/scripts/xiaoe_env.py +118 -0
- package/skill-template/business-info.json +113 -14
- package/skill-template/domains/blog.md +24 -0
- package/skill-template/domains/caizhilian.md +22 -0
- package/skill-template/domains/hrm.md +2 -1
- package/skill-template/domains/jinchengda.md +23 -0
- package/skill-template/domains/meeting.md +1 -1
- package/skill-template/domains/workflow.md +1 -1
- package/skill-template/skill-template.md +1 -1
- package/skills/weaver-e10-blog/SKILL.md +111 -0
- package/skills/weaver-e10-blog/references/blog-comment.md +51 -0
- package/skills/weaver-e10-blog/references/blog-comments.md +39 -0
- package/skills/weaver-e10-blog/references/blog-default-permission.md +38 -0
- package/skills/weaver-e10-blog/references/blog-disabled-capabilities.md +11 -0
- package/skills/weaver-e10-blog/references/blog-edit.md +51 -0
- package/skills/weaver-e10-blog/references/blog-export.md +42 -0
- package/skills/weaver-e10-blog/references/blog-like.md +50 -0
- package/skills/weaver-e10-blog/references/blog-publish.md +52 -0
- package/skills/weaver-e10-blog/references/blog-query-user.md +45 -0
- package/skills/weaver-e10-blog/references/blog-query.md +49 -0
- package/skills/weaver-e10-blog/references/blog-remind.md +51 -0
- package/skills/weaver-e10-blog/references/blog-resolve-users.md +38 -0
- package/skills/weaver-e10-blog/references/source-manifest.json +1540 -0
- package/skills/weaver-e10-caizhilian/SKILL.md +217 -0
- package/skills/weaver-e10-caizhilian/references/agent-entry.md +106 -0
- package/skills/weaver-e10-caizhilian/references/collaboration.md +112 -0
- package/skills/weaver-e10-caizhilian/references/document.md +111 -0
- package/skills/weaver-e10-caizhilian/references/file-collection.md +173 -0
- package/skills/weaver-e10-caizhilian/references/file-upload.md +309 -0
- package/skills/weaver-e10-caizhilian/references/files.md +120 -0
- package/skills/weaver-e10-caizhilian/references/folder.md +122 -0
- package/skills/weaver-e10-caizhilian/references/org-browser.md +104 -0
- package/skills/weaver-e10-caizhilian/references/setting-attach.md +440 -0
- package/skills/weaver-e10-caizhilian/references/setting-backup.md +372 -0
- package/skills/weaver-e10-caizhilian/references/setting-encrypt.md +399 -0
- package/skills/weaver-e10-caizhilian/references/setting-storage.md +603 -0
- package/skills/weaver-e10-caizhilian/references/source-manifest.json +5694 -0
- package/skills/weaver-e10-caizhilian/references/withheld.md +93 -0
- package/skills/weaver-e10-caizhilian/references/write-protocol.md +120 -0
- package/skills/weaver-e10-calendar/SKILL.md +4 -3
- package/skills/weaver-e10-ebuilder-form/SKILL.md +4 -9
- package/skills/weaver-e10-ebuilder-form/references/context-routing.md +0 -9
- package/skills/weaver-e10-ebuilder-form/references/custom-api.md +1 -5
- package/skills/weaver-e10-ebuilder-form/references/fields-browser.md +1 -5
- package/skills/weaver-e10-ebuilder-form/references/list-nlist.md +1 -5
- package/skills/weaver-e10-ebuilder-form/references/openapi-read.md +1 -5
- package/skills/weaver-e10-ebuilder-form/references/openapi-write.md +1 -5
- package/skills/weaver-e10-esb/SKILL.md +2 -2
- package/skills/weaver-e10-esb/references/source-manifest.json +9 -9
- package/skills/weaver-e10-hrm/SKILL.md +104 -9
- package/skills/weaver-e10-hrm/references/employee.md +89 -15
- package/skills/weaver-e10-hrm/references/org.md +114 -5
- package/skills/weaver-e10-hrm/references/position.md +14 -7
- package/skills/weaver-e10-hrm/references/source-manifest.json +1 -1
- package/skills/weaver-e10-jinchengda/SKILL.md +167 -0
- package/skills/weaver-e10-jinchengda/references/contract-agent-entry.md +82 -0
- package/skills/weaver-e10-jinchengda/references/contract-clause-recommender.md +69 -0
- package/skills/weaver-e10-jinchengda/references/contract-clause-reference-save.md +78 -0
- package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +27 -0
- package/skills/weaver-e10-jinchengda/references/contract-request-status.md +71 -0
- package/skills/weaver-e10-jinchengda/references/contract-request-write.md +94 -0
- package/skills/weaver-e10-jinchengda/references/contract-signing-subjects.md +89 -0
- package/skills/weaver-e10-jinchengda/references/contract-subject-create.md +77 -0
- package/skills/weaver-e10-jinchengda/references/contract-template-selector.md +66 -0
- package/skills/weaver-e10-jinchengda/references/contract-workflow-discovery.md +94 -0
- package/skills/weaver-e10-jinchengda/references/source-manifest.json +259 -0
- package/skills/weaver-e10-jiuchuanhui/SKILL.md +5 -11
- package/skills/weaver-e10-jucailin/SKILL.md +4 -3
- package/skills/weaver-e10-mail/SKILL.md +4 -11
- package/skills/weaver-e10-meeting/SKILL.md +66 -32
- package/skills/weaver-e10-meeting/references/meeting-change.md +5 -2
- package/skills/weaver-e10-meeting/references/meeting-create.md +2 -1
- package/skills/weaver-e10-meeting/references/meeting-eb.md +114 -0
- package/skills/weaver-e10-meeting/references/meeting-lifecycle.md +9 -8
- package/skills/weaver-e10-meeting/references/meeting-receipts-signs.md +35 -7
- package/skills/weaver-e10-meeting/references/meeting-update.md +1 -1
- package/skills/weaver-e10-okr/SKILL.md +6 -11
- package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
- package/skills/weaver-e10-plan/SKILL.md +3 -3
- package/skills/weaver-e10-plan/references/plan-collect-and-compose.md +1 -1
- package/skills/weaver-e10-plan/references/plan-overview-and-routing.md +1 -1
- package/skills/weaver-e10-plan/references/source-manifest.json +13 -13
- package/skills/weaver-e10-qiyecheng/SKILL.md +4 -10
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +9 -9
- package/skills/weaver-e10-shared/SKILL.md +42 -34
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +16 -43
- package/skills/weaver-e10-shared/references/json-output-contract.md +20 -11
- package/skills/weaver-e10-shared/references/non-interactive-environment.md +21 -14
- package/skills/weaver-e10-shijingran/SKILL.md +2 -1
- package/skills/weaver-e10-shijingran/references/source-manifest.json +9 -9
- package/skills/weaver-e10-skill-maker/SKILL.md +4 -10
- package/skills/weaver-e10-skill-maker/references/business-skill-generation.md +5 -3
- package/skills/weaver-e10-skill-maker/references/module-cli-generation.md +12 -27
- package/skills/weaver-e10-skill-maker/references/module-gap-audit-and-repair.md +17 -5
- package/skills/weaver-e10-skill-maker/references/source-update-detection.md +4 -27
- package/skills/weaver-e10-skill-maker/references/weaver-skill-style.md +1 -1
- package/skills/weaver-e10-wenshuding/SKILL.md +5 -16
- package/skills/weaver-e10-wenshuding/references/source-manifest.json +7 -7
- package/skills/weaver-e10-workflow/SKILL.md +41 -46
- package/skills/weaver-e10-workflow/references/source-manifest.json +39 -75
- package/skills/weaver-e10-workflow/references/workflow-batch.md +90 -29
- package/skills/weaver-e10-workflow/references/workflow-create.md +83 -109
- package/skills/weaver-e10-workflow/references/workflow-memory.md +19 -9
- package/skills/weaver-e10-workflow/references/workflow-operate.md +2 -2
- package/skills/weaver-e10-workflow/references/workflow-query.md +40 -27
- package/skills/weaver-e10-workflow/references/workflow-share.md +18 -2
- package/skills/weaver-e10-workflow/references/workflow-view.md +3 -4
- package/skills/weaver-e10-yepiaotong/SKILL.md +74 -39
- package/skills/weaver-e10-yepiaotong/references/invoice-detail.md +22 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +3 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +135 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +15 -3
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-summarize.py +217 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-upload-and-validate.md +88 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-validation-preview.md +7 -2
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +89 -9
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +1 -0
- package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +70 -49
- package/skills/weaver-e10-yepiaotong/references/reim-fast-path.md +119 -0
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +55 -36
- package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +4 -0
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +149 -0
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +125 -5
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +430 -63
- package/skills/weaver-e10-yimiaoban/SKILL.md +4 -12
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +3 -3
- package/skills/weaver-e10-ziguanjia/SKILL.md +2 -1
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-agent-entry.md +3 -3
- package/tools/weaver-skill-detector-1.0.13/SKILL.md +9 -9
- package/tools/weaver-skill-detector-1.0.13/references/checklist.md +3 -3
- package/tools/weaver-skill-detector-1.0.13/scripts/__pycache__/validate_skill.cpython-313.pyc +0 -0
- package/tools/weaver-skill-detector-1.0.13/scripts/validate_skill.py +98 -91
- package/scripts/sync-connector-skills.mjs +0 -172
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# 今承达合同管理 CLI 入口
|
|
2
|
+
|
|
3
|
+
## 请求头 / 认证
|
|
4
|
+
|
|
5
|
+
所有 `weaver-work-cli contract run <operation>` 发起的 API 请求均自动携带以下凭证头,值来自 E10 登录会话(由 `weaver-work-cli auth login` 建立),禁止业务输入携带:
|
|
6
|
+
|
|
7
|
+
| 头 | 值来源 | 说明 |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| `Cookie` | E10 登录返回的完整原始 Cookie 串 | CLI 从会话注入,禁止裁剪/去重/改写 |
|
|
10
|
+
| `eteamsid` | E10 登录返回的 ETEAMSID | CLI 从会话注入 |
|
|
11
|
+
| `User-Agent` | `AgentType=<agentType>,IsAgent=true` | CLI 自动拼接,`agentType` 来自登录时的 `--agent_type` 参数 |
|
|
12
|
+
|
|
13
|
+
业务输入(`--input-json` / `--input`)**不得包含** `userid`、`userId`、`token`、`cookie`、`eteamsid` 等字段,用户 ID 由 CLI 从会话注入。
|
|
14
|
+
|
|
15
|
+
## operation 合约第一信息源
|
|
16
|
+
|
|
17
|
+
`weaver-work-cli contract schema` 输出 operation 名称、`risk`、`fixed`(固定的方法与路径)、`inputSchema` 和 `withheldOperations`。调用前先读它,不要凭记忆拼 operation 名和字段名。
|
|
18
|
+
|
|
19
|
+
- operation 名称统一为 `contract.<domain>.<action>`。
|
|
20
|
+
- 写操作一律是 `*.prepare` -> `*.apply` 两段:`prepare` 返回脱敏 `preview` 和 `continuation`,`apply` 必须带 `continuation` 与 `confirm: true`。
|
|
21
|
+
- `inputSchema` 的 `additionalProperties` 为 `false`,未声明的字段会被拒绝。
|
|
22
|
+
- `withheldOperations` 列出源资料不足、暂未实现的能力,遇到对应意图直接说明不可用,不要尝试用其它接口替代。
|
|
23
|
+
|
|
24
|
+
## 统一调用方式
|
|
25
|
+
|
|
26
|
+
所有 operation 都通过 `contract run <operation>` 调用。三种输入方式:
|
|
27
|
+
|
|
28
|
+
1. `--input-json '<json>'`:简单 JSON,推荐。
|
|
29
|
+
2. `--input <path>`:复杂或多行 JSON,先写入 UTF-8(无 BOM 也可,CLI 会自动剥离 BOM)文件。
|
|
30
|
+
3. `--input -`:stdin,只有确认当前 shell 能稳定传管道时才使用。
|
|
31
|
+
|
|
32
|
+
`--input` 与 `--input-json` 不能同时传,同时传会返回 `validation/input_conflict`。
|
|
33
|
+
|
|
34
|
+
Windows PowerShell:
|
|
35
|
+
|
|
36
|
+
```powershell
|
|
37
|
+
weaver-work-cli contract schema
|
|
38
|
+
weaver-work-cli --json contract run contract.template.list --input-json '{"templateName":"采购合同","pageNo":1,"pageSize":10}'
|
|
39
|
+
weaver-work-cli --json contract run contract.request.status --input-json '{"requestId":"12345"}'
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
macOS/Linux(bash/zsh):
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
weaver-work-cli contract schema
|
|
46
|
+
weaver-work-cli --json contract run contract.template.list --input-json '{"templateName":"采购合同","pageNo":1,"pageSize":10}'
|
|
47
|
+
weaver-work-cli --json contract run contract.request.status --input-json '{"requestId":"12345"}'
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## 人类友好子命令
|
|
51
|
+
|
|
52
|
+
除了 `run`,CLI 也提供分组子命令(参数会转成对应的 operation 输入),可用于排查和手工操作:
|
|
53
|
+
|
|
54
|
+
- `contract type tree`
|
|
55
|
+
- `contract template tree|list|detail`
|
|
56
|
+
- `contract clause tree|list|groups|search|tags`
|
|
57
|
+
- `contract clause reference get|save-prepare|save-apply`
|
|
58
|
+
- `contract subject app|form|fields|options|query|create-prepare|create-apply`
|
|
59
|
+
- `contract workflow query|list|form-info|field-options`
|
|
60
|
+
- `contract request create-prepare|create-apply|save-prepare|save-apply|submit-prepare|submit-apply|supervise-prepare|supervise-apply|status|log`
|
|
61
|
+
|
|
62
|
+
Agent 侧优先用 `run <operation>`,保证输入与 manifest 完全一致。
|
|
63
|
+
|
|
64
|
+
## 退出码
|
|
65
|
+
|
|
66
|
+
| 退出码 | 含义 |
|
|
67
|
+
|---|---|
|
|
68
|
+
| 0 | 成功 |
|
|
69
|
+
| 1 | 业务/服务错误 |
|
|
70
|
+
| 2 | 输入用法错误(含 ID 非法、字段非法) |
|
|
71
|
+
| 3 | 认证失败或登录态失效 |
|
|
72
|
+
| 4 | 网络错误 |
|
|
73
|
+
| 5 | 内部错误 |
|
|
74
|
+
| 6 | 策略拒绝(重复引用、流程状态不允许等) |
|
|
75
|
+
| 10 | 需要确认(缺少 `confirm` 或 continuation) |
|
|
76
|
+
| 11 | `partial/write_uncertain`,结果不确定,禁止自动重试 |
|
|
77
|
+
|
|
78
|
+
## 注意
|
|
79
|
+
|
|
80
|
+
- 业务输入不得包含 `userid`、`userId`、`token`、`cookie`、`eteamsid` 等字段;用户 ID 由 CLI 从会话注入。
|
|
81
|
+
- 环境相关 ID(`appId`、`objId`、`formId`、`workflowId`、`nodeId`)只能运行时解析,禁止使用文档示例值或标准环境 ID 兜底。
|
|
82
|
+
- 涉及合同正文或附件的操作,文件内容可能进入大模型上下文,执行前必须获得用户明确确认。
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# 条款查询与推荐
|
|
2
|
+
|
|
3
|
+
## 请求头 / 认证
|
|
4
|
+
|
|
5
|
+
本文件描述的 API 请求通过 `weaver-work-cli` 执行,CLI 从 E10 登录会话自动注入以下凭证头(禁止业务输入携带):
|
|
6
|
+
|
|
7
|
+
| 请求头 | 值 |
|
|
8
|
+
|--------|-----|
|
|
9
|
+
| `Cookie` | `<e10-login 返回的完整原始 Cookie 串>`(禁止裁剪/去重/改写) |
|
|
10
|
+
| `eteamsid` | `<e10-login 返回的 ETEAMSID>` |
|
|
11
|
+
| `User-Agent` | `AgentType=<agentType>,IsAgent=true` |
|
|
12
|
+
|
|
13
|
+
业务输入(`--input-json` / `--input`)**不得包含** `userid`、`userId`、`token`、`cookie`、`eteamsid` 等字段,用户 ID 由 CLI 从会话注入。
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
用途:按标签、分类或关键词查找合同条款,供用户挑选。五个 operation 全部为 `read`。
|
|
17
|
+
|
|
18
|
+
## operation 与接口
|
|
19
|
+
|
|
20
|
+
| operation | 方法 | 路径 | 关键输入 |
|
|
21
|
+
|---|---|---|---|
|
|
22
|
+
| `contract.clause.tags` | GET | `/api/ebd/contract/clauseinfo/getClausesConfig` | `label`、`value`、`pageNum`、`pageSize` |
|
|
23
|
+
| `contract.clause.tree` | GET | `/api/ebd/contract/tree/queryList` | 无(无需传参) |
|
|
24
|
+
| `contract.clause.search` | GET | `/api/ebd/contract/clauseinfo/getClauses` | `id`、`title`、`tagId`、`content`、`group`、`mark`、`pageNum`、`pageSize` |
|
|
25
|
+
| `contract.clause.list` | GET | `/api/ebd/contract/clauseinfo/getListPage` | `belongId`、`clauseName`、`clauseNum`、`clauseStatus`、`clauseGroup`、`contractType`、`pageNo`、`pageSize` |
|
|
26
|
+
| `contract.clause.group.list` | GET | `/api/ebd/contract/clausegroup/getListPage` | `belongId`、`clauseName`、`clauseNum`、`clauseStatus`、`contractType`、`pageNo`、`pageSize` |
|
|
27
|
+
|
|
28
|
+
分页参数命名差异(源资料原文,不要统一):
|
|
29
|
+
- `contract.clause.list` / `contract.clause.group.list` 用 `pageNo`(默认 1)+ `pageSize`(默认 10)。
|
|
30
|
+
- `contract.clause.search` / `contract.clause.tags` 用 `pageNum`(默认 **0**)+ `pageSize`(默认 10)。
|
|
31
|
+
|
|
32
|
+
## 处理链
|
|
33
|
+
|
|
34
|
+
1. `contract.clause.tags` 是**语义匹配的关键前置接口**,先拿 `tagId`。
|
|
35
|
+
2. `contract.clause.tree` 拿条款分类树,取 `belongId`。
|
|
36
|
+
3. `contract.clause.search` 是核心查询接口,传 `tagId`、`title` 或 `content`。
|
|
37
|
+
4. 需要按分类浏览时用 `contract.clause.list`;需要按条款组浏览时用 `contract.clause.group.list`。
|
|
38
|
+
|
|
39
|
+
## 调用示例
|
|
40
|
+
|
|
41
|
+
Windows PowerShell:
|
|
42
|
+
|
|
43
|
+
```powershell
|
|
44
|
+
weaver-work-cli --json contract run contract.clause.tags --input-json '{"pageNum":0,"pageSize":10}'
|
|
45
|
+
weaver-work-cli --json contract run contract.clause.tree
|
|
46
|
+
weaver-work-cli --json contract run contract.clause.search --input-json '{"tagId":"12345","title":"违约金","pageNum":0,"pageSize":10}'
|
|
47
|
+
weaver-work-cli --json contract run contract.clause.list --input-json '{"belongId":"12345","pageNo":1,"pageSize":10}'
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
macOS/Linux(bash/zsh):
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
weaver-work-cli --json contract run contract.clause.tags --input-json '{"pageNum":0,"pageSize":10}'
|
|
54
|
+
weaver-work-cli --json contract run contract.clause.tree
|
|
55
|
+
weaver-work-cli --json contract run contract.clause.search --input-json '{"tagId":"12345","title":"违约金","pageNum":0,"pageSize":10}'
|
|
56
|
+
weaver-work-cli --json contract run contract.clause.list --input-json '{"belongId":"12345","pageNo":1,"pageSize":10}'
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 结果解读
|
|
60
|
+
|
|
61
|
+
- 成功码为顶层 `code = 0`。
|
|
62
|
+
- 展示候选时给条款名称、状态和推荐理由;**不伪造"智能评分"**。
|
|
63
|
+
- 命中多条时先展示候选请用户选择,不要把第一条当成唯一答案。
|
|
64
|
+
- 标签 ID、分类 ID、条款 ID 均为环境相关字符串,必须运行时解析。
|
|
65
|
+
|
|
66
|
+
## 注意
|
|
67
|
+
|
|
68
|
+
- 只做查询和推荐,不写入。要把条款真正插入合同文档,必须先走 [`contract-clause-reference-save.md`](contract-clause-reference-save.md) 的确认链。
|
|
69
|
+
- 推荐前先用 `contract.clause.reference.get` 查已引用条款,避免推荐用户已经插入过的条款。
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# 条款引用:查询与写入(本模块唯一条款写操作)
|
|
2
|
+
|
|
3
|
+
## 请求头 / 认证
|
|
4
|
+
|
|
5
|
+
本文件描述的 API 请求通过 `weaver-work-cli` 执行,CLI 从 E10 登录会话自动注入以下凭证头(禁止业务输入携带):
|
|
6
|
+
|
|
7
|
+
| 请求头 | 值 |
|
|
8
|
+
|--------|-----|
|
|
9
|
+
| `Cookie` | `<e10-login 返回的完整原始 Cookie 串>`(禁止裁剪/去重/改写) |
|
|
10
|
+
| `eteamsid` | `<e10-login 返回的 ETEAMSID>` |
|
|
11
|
+
| `User-Agent` | `AgentType=<agentType>,IsAgent=true` |
|
|
12
|
+
|
|
13
|
+
业务输入(`--input-json` / `--input`)**不得包含** `userid`、`userId`、`token`、`cookie`、`eteamsid` 等字段,用户 ID 由 CLI 从会话注入。
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## 查询:`contract.clause.reference.get`
|
|
17
|
+
|
|
18
|
+
- 方法/路径:`POST /api/ebd/contract/clauseReference/selectData`
|
|
19
|
+
- 风险:`read`(虽为 POST,但属于查询)
|
|
20
|
+
- 输入:`fileId`、`requestId`、`clauseId`、`referenceObjType`(默认 1,1=条款)、`startTime`、`endTime`、`pageNum`、`pageSize`
|
|
21
|
+
- 响应关键字段:`data.records[].clauseId`、`data.records[].fileName`、`data.total`
|
|
22
|
+
|
|
23
|
+
用途:查看当前合同文档已引用哪些条款,以及在写入前做重复校验。
|
|
24
|
+
|
|
25
|
+
## 写入:`contract.clause.reference.save.prepare` -> `contract.clause.reference.save.apply`
|
|
26
|
+
|
|
27
|
+
- 方法/路径:`POST /api/ebd/contract/clauseReference/saveData`
|
|
28
|
+
- 风险:`read-before-write` / `high-risk-write`
|
|
29
|
+
- 必填输入:`clauseIds`(非空 ID 数组)、`fileId`、`requestId`;可选 `fileName`、`requestName`
|
|
30
|
+
- 固定值:`referenceObjType = 1`(1=条款)
|
|
31
|
+
|
|
32
|
+
`prepare` 阶段 CLI 会先调用 `selectData` 查已引用条款:若传入的 `clauseIds` 中存在已被引用的条款,直接抛 `policy/already_referenced` 并停止,避免重复插入。
|
|
33
|
+
|
|
34
|
+
`apply` 阶段写入成功后,CLI 会再次调用 `selectData` 回读:若仍有条款未出现在已引用列表中,返回 `partial/write_uncertain`(退出码 11),此时禁止自动重试,只补一次只读查询并向用户报告。
|
|
35
|
+
|
|
36
|
+
## 确认要求
|
|
37
|
+
|
|
38
|
+
写入前必须向用户展示并确认**具体条款、合同和文件**:
|
|
39
|
+
|
|
40
|
+
- 目标合同文件(`fileId` / `fileName`)
|
|
41
|
+
- 关联流程(`requestId` / `requestName`)
|
|
42
|
+
- 待引用条款数量与条款 ID 摘要(CLI 返回的 `preview` 已脱敏)
|
|
43
|
+
|
|
44
|
+
不要把"推荐"描述为"已插入";只有 `apply` 回读成功后才能说条款已生效。
|
|
45
|
+
|
|
46
|
+
## 调用示例
|
|
47
|
+
|
|
48
|
+
Windows PowerShell:
|
|
49
|
+
|
|
50
|
+
```powershell
|
|
51
|
+
weaver-work-cli --json contract run contract.clause.reference.get --input-json '{"fileId":"901","requestId":"902","pageNum":1,"pageSize":20}'
|
|
52
|
+
weaver-work-cli --json contract run contract.clause.reference.save.prepare --input-json '{"clauseIds":["301","302"],"fileId":"901","requestId":"902","requestName":"2024年IT设备采购合同"}'
|
|
53
|
+
weaver-work-cli --json contract run contract.clause.reference.save.apply --input-json '{"clauseIds":["301","302"],"fileId":"901","requestId":"902","requestName":"2024年IT设备采购合同","continuation":"PREPARE_CONTINUATION","confirm":true}'
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
macOS/Linux(bash/zsh):
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
weaver-work-cli --json contract run contract.clause.reference.get --input-json '{"fileId":"901","requestId":"902","pageNum":1,"pageSize":20}'
|
|
60
|
+
weaver-work-cli --json contract run contract.clause.reference.save.prepare --input-json '{"clauseIds":["301","302"],"fileId":"901","requestId":"902","requestName":"2024年IT设备采购合同"}'
|
|
61
|
+
weaver-work-cli --json contract run contract.clause.reference.save.apply --input-json '{"clauseIds":["301","302"],"fileId":"901","requestId":"902","requestName":"2024年IT设备采购合同","continuation":"PREPARE_CONTINUATION","confirm":true}'
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## 错误与边界
|
|
65
|
+
|
|
66
|
+
| 场景 | 表现 | 处理 |
|
|
67
|
+
|---|---|---|
|
|
68
|
+
| 传入已引用条款 | `policy/already_referenced` | 停止,提示用户这些条款已插入,不要重复 |
|
|
69
|
+
| `apply` 缺少 `confirm` | `confirmation/required`,退出码 10 | 重新调用时带 `confirm: true` 和 `prepare` 的 `continuation` |
|
|
70
|
+
| `apply` 输入与 `prepare` 不一致 | `validation/target_changed` | 停止,重新 `prepare` |
|
|
71
|
+
| 写入后回读缺失 | `partial/write_uncertain`,退出码 11 | 停止,不自动重放;只补一次 `contract.clause.reference.get` |
|
|
72
|
+
| `code != 0` | `api/business_error` | 报告相对路径、脱敏参数摘要与错误信息后停止 |
|
|
73
|
+
|
|
74
|
+
## 注意
|
|
75
|
+
|
|
76
|
+
- `fileId` 需从编辑会话获取、`requestId` 需从流程上下文获取,均为环境相关 ID,禁止使用示例值。
|
|
77
|
+
- 合同正文与附件内容可能进入大模型上下文;在读取、展示或写入合同文档前必须获得用户明确确认。
|
|
78
|
+
- `continuation` 有效期 10 分钟,由 CLI 生成,禁止手工构造或跨操作复用。
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# 未实现能力(withheldOperations)
|
|
2
|
+
|
|
3
|
+
以下能力出现在源资料的能力清单里,但源资料**没有给出可用的接口路径、方法、参数或响应结构**,因此未纳入 CLI manifest,也没有对应 operation。遇到这些意图时直接说明不可用,不要尝试用其它接口替代或猜测接口。
|
|
4
|
+
|
|
5
|
+
| 能力 | 源资料状态 | 处理方式 |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| `contract.credit.query`(相对方工商资信查询,CM-018) | `references/enterprise-credit/api-enterprise-credit.md` 只有 9 行索引,指向的 `api-credit-info.md`、`api-enterprise-change.md`、`api-monitor-config.md` 三个子文档在源资料中不存在 | 告知用户当前不可用;如确需使用,请先提供完整的接口文档 |
|
|
8
|
+
| `contract.credit.change`(企业变更查询) | 同上,接口文档缺失 | 同上 |
|
|
9
|
+
| `contract.credit.monitor`(企业监控开启/修改) | 同上;且属于写操作,缺少确认与回查契约 | 同上;不得在未拿到契约前实现写操作 |
|
|
10
|
+
| `contract.workflow.withdraw`(撤回/退回流程) | 源资料只提到"除非调用撤回/退回接口",未给出路径、方法和参数 | 告知用户当前不可用;如需撤回请到 E10 前台操作 |
|
|
11
|
+
|
|
12
|
+
## 已知的源资料状态冲突
|
|
13
|
+
|
|
14
|
+
- `SKILL.md` 能力清单把 CM-005 ~ CM-015 多数标注为"可用",但 `feature-map.json` 的 `not_released` 里写着 CM-005 ~ CM-015 未完成,且 `features` 只列出 CM-001、CM-002、CM-004、CM-018、CM-043、CM-044、CM-045。
|
|
15
|
+
- 本 CLI 的实现以"接口文档完整可读"为准:只有能拿到路径、方法、参数和响应结构的接口才生成 operation,其余一律列入 `withheldOperations`。
|
|
16
|
+
- 如果用户后续补齐了文档,需要同步更新 CLI 与 Skill,并更新 `references/source-manifest.json` 的指纹。
|
|
17
|
+
|
|
18
|
+
## 其它边界
|
|
19
|
+
|
|
20
|
+
- 12 类合同审批流程(销售、采购、协议、变更、解除、关闭、开票、收款、付款、履约计划、进度提报、供应商准入)共用同一组接口;流程差异体现在运行时解析出的 `workflowId` 与表单字段,而不是不同的接口路径。
|
|
21
|
+
- 企业资信与合同审批是两条互不相干的链:不要把"查一下某公司资信"路由到 `contract.request.*`。
|
|
22
|
+
- 提交审批后流程不可撤回(撤回接口未实现),执行前必须让用户清楚这一点。
|
|
23
|
+
|
|
24
|
+
## 注意
|
|
25
|
+
|
|
26
|
+
- 不要为了"完成任务"而猜测未文档化的接口路径或字段名。
|
|
27
|
+
- 涉及未实现能力的用户请求,回复中应说明缺什么(路径/参数/响应/确认契约),并给出需要用户提供的材料。
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# 审批状态与签字意见
|
|
2
|
+
|
|
3
|
+
## 请求头 / 认证
|
|
4
|
+
|
|
5
|
+
本文件描述的 API 请求通过 `weaver-work-cli` 执行,CLI 从 E10 登录会话自动注入以下凭证头(禁止业务输入携带):
|
|
6
|
+
|
|
7
|
+
| 请求头 | 值 |
|
|
8
|
+
|--------|-----|
|
|
9
|
+
| `Cookie` | `<e10-login 返回的完整原始 Cookie 串>`(禁止裁剪/去重/改写) |
|
|
10
|
+
| `eteamsid` | `<e10-login 返回的 ETEAMSID>` |
|
|
11
|
+
| `User-Agent` | `AgentType=<agentType>,IsAgent=true` |
|
|
12
|
+
|
|
13
|
+
业务输入(`--input-json` / `--input`)**不得包含** `userid`、`userId`、`token`、`cookie`、`eteamsid` 等字段,用户 ID 由 CLI 从会话注入。
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
用途:查审批进度、查审批意见,以及写操作后的持久化回读。两个 operation 均为 `read`。
|
|
17
|
+
|
|
18
|
+
| operation | 方法 | 路径 | 输入 |
|
|
19
|
+
|---|---|---|---|
|
|
20
|
+
| `contract.request.status` | GET | `/api/workflow/core/paService/v1/getRequestStatus` | `requestId`(必填)、`userid` 由 CLI 注入 query |
|
|
21
|
+
| `contract.request.log` | GET | `/api/workflow/core/paService/v1/getRequestLog` | `requestId`(必填)、`otherParams`(分页 JSON 串,如 `{"pageSize":10,"pageNumber":1}`) |
|
|
22
|
+
|
|
23
|
+
## `flowStatus.code` 枚举(源资料原文)
|
|
24
|
+
|
|
25
|
+
| code | 含义 |
|
|
26
|
+
|---|---|
|
|
27
|
+
| 0 | 草稿 |
|
|
28
|
+
| 1 | 审批中 |
|
|
29
|
+
| 2 | 已退回 |
|
|
30
|
+
| 3 | 正常归档 |
|
|
31
|
+
| 4 | 强制结束 |
|
|
32
|
+
| 5 | 已作废 |
|
|
33
|
+
| 6 | 待提交 |
|
|
34
|
+
| 7 | 暂停 |
|
|
35
|
+
| 8 | 撤销 |
|
|
36
|
+
|
|
37
|
+
## 调用示例
|
|
38
|
+
|
|
39
|
+
Windows PowerShell(复杂入参写 UTF-8 文件后传 `--input`,不要在单引号 JSON 里用反斜杠转义引号):
|
|
40
|
+
|
|
41
|
+
```powershell
|
|
42
|
+
weaver-work-cli --json contract run contract.request.status --input-json '{"requestId":"67890"}'
|
|
43
|
+
weaver-work-cli --json contract run contract.request.log --input .\request-log.json
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
macOS/Linux(bash/zsh):
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
weaver-work-cli --json contract run contract.request.status --input-json '{"requestId":"67890"}'
|
|
50
|
+
weaver-work-cli --json contract run contract.request.log --input-json '{"requestId":"67890","otherParams":"{\"pageSize\":10,\"pageNumber\":1}"}'
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
复杂 JSON 建议写入 UTF-8 文件后用 `--input <path>`,避免不同 shell 的引号转义差异。
|
|
54
|
+
|
|
55
|
+
## 结果解读
|
|
56
|
+
|
|
57
|
+
- `contract.request.status` 返回 `requestId`、`workflowId`、`requestName`、`status`、`flowStatus`(`code` + `desc`)、`currentNodeType`;`lastOperator` 等人员 ID 已脱敏。
|
|
58
|
+
- `contract.request.log` 返回 `operatorName`、`content`、`commentType`、`stepName`、`addTime`(毫秒时间戳)。
|
|
59
|
+
- 成功码为 `message.errcode = "0"`;`data.workflowBaseInfo` 不存在或 `requestId` 与入参不一致时按失败处理。
|
|
60
|
+
- `data` 为空数组表示暂无审批记录,属于正常返回。
|
|
61
|
+
|
|
62
|
+
## 用途约束
|
|
63
|
+
|
|
64
|
+
- 提交审批后必须用它回读 `flowStatus.code` 为 1 或 3,才能说"提交已生效"。
|
|
65
|
+
- 保存表单、创建流程后也用它核验持久化结果。
|
|
66
|
+
- 查流程列表用 `contract.workflow.list`,查流程基础信息用 `contract.workflow.query`,不要用本文件的接口替代。
|
|
67
|
+
|
|
68
|
+
## 注意
|
|
69
|
+
|
|
70
|
+
- 不要输出完整 `lastOperator`、`creatorId` 等人员 ID。
|
|
71
|
+
- 回读一次即可;不要陷入"查询 -> 写入 -> 查询"的循环。
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# 合同审批流程:创建、保存、提交、催办(写操作)
|
|
2
|
+
|
|
3
|
+
## 请求头 / 认证
|
|
4
|
+
|
|
5
|
+
本文件描述的 API 请求通过 `weaver-work-cli` 执行,CLI 从 E10 登录会话自动注入以下凭证头(禁止业务输入携带):
|
|
6
|
+
|
|
7
|
+
| 请求头 | 值 |
|
|
8
|
+
|--------|-----|
|
|
9
|
+
| `Cookie` | `<e10-login 返回的完整原始 Cookie 串>`(禁止裁剪/去重/改写) |
|
|
10
|
+
| `eteamsid` | `<e10-login 返回的 ETEAMSID>` |
|
|
11
|
+
| `User-Agent` | `AgentType=<agentType>,IsAgent=true` |
|
|
12
|
+
|
|
13
|
+
业务输入(`--input-json` / `--input`)**不得包含** `userid`、`userId`、`token`、`cookie`、`eteamsid` 等字段,用户 ID 由 CLI 从会话注入。
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
四个写操作全部是 `prepare -> apply` 两段,且必须分别报告每一步结果。
|
|
17
|
+
|
|
18
|
+
| 动作 | prepare | apply | 路径 | 风险 |
|
|
19
|
+
|---|---|---|---|---|
|
|
20
|
+
| 创建流程实例 | `contract.request.create.prepare` | `contract.request.create.apply` | `POST /api/workflow/core/paService/v2/doCreateRequest` | write |
|
|
21
|
+
| 保存表单 | `contract.request.save.prepare` | `contract.request.save.apply` | `POST /api/workflow/core/paService/v1/saveFormData` | write |
|
|
22
|
+
| 提交审批 | `contract.request.submit.prepare` | `contract.request.submit.apply` | `POST /api/workflow/core/paService/v1/submitRequest` | high-impact |
|
|
23
|
+
| 催办 | `contract.request.supervise.prepare` | `contract.request.supervise.apply` | `POST /api/workflow/core/paService/v1/requestSupervise` | high-impact |
|
|
24
|
+
|
|
25
|
+
用户 ID 由 CLI 从会话注入:前三个接口注入 `userid`,催办接口注入 `userId`(源资料原文如此)。
|
|
26
|
+
|
|
27
|
+
## 创建流程实例
|
|
28
|
+
|
|
29
|
+
- 输入:`workflowId`(必填)、`requestname`、`remark`、`isnextflow`(默认 0)、`isVerifyFormRequired`(默认 false)、`requestLevel`(默认 0)、`formData`、`isNewFormData`、`seniorFormParam`
|
|
30
|
+
- `prepare` 不再请求活动版本接口(`getActiveWfId` 在部分租户返回 500 系统错误且无必要),直接用 `contract.workflow.query` / `contract.workflow.list` 解析出的 `workflowId` 创建
|
|
31
|
+
- `apply` 成功后从 `message.requestId` 取实例 ID,再用 `getRequestStatus` 回读;缺少 `requestId` 或回读 ID 不一致时返回 `partial/write_uncertain`
|
|
32
|
+
|
|
33
|
+
## 保存表单
|
|
34
|
+
|
|
35
|
+
- 输入:`requestId`(必填)、`formData`(必填,含 `dataDetails` 非空数组)、`workflowId`、`userCurrentNodeId`、`isNewFormData`、`seniorFormParam`
|
|
36
|
+
- `formData.dataDetails[]` 用 `fieldId` 或 `dataKey` 二选一定位字段;选择类字段用 `dataOptions[].optionId`,有值时优先于 `content`
|
|
37
|
+
- `prepare` 先读流程状态,只有草稿(0)、已退回(2)、待提交(6)可写;审批中(1)抛 `policy/already_submitted`,已结束(3/4/5/8)抛 `policy/request_closed`
|
|
38
|
+
- 保存 ≠ 创建 ≠ 提交,三者必须分别报告
|
|
39
|
+
|
|
40
|
+
## 提交审批(最高风险)
|
|
41
|
+
|
|
42
|
+
- 输入:`requestId`(必填)、`remark`、`userCurrentNodeId`、`requestName`、`formdata`(注意全小写 d)、`otherParams`、`isVerifyFormRequired`(默认 true)
|
|
43
|
+
- **必须与"创建并保存"分开的第二次确认**
|
|
44
|
+
- `apply` 成功后必须回读 `contract.request.status` 的 `flowStatus.code`:只有 1(审批中)或 3(已归档)才算生效;否则返回 `partial/write_uncertain`
|
|
45
|
+
- `1200301`(当前 userid 为空):停止并诊断会话状态,**不自动切换接口或盲目重试**
|
|
46
|
+
- `1200306`(服务端必填校验):解析缺失字段列表,逐字段补全后重试(最多 3 轮),不切换接口
|
|
47
|
+
- 提交后流程进入审批流转,不可撤回(撤回/退回接口未实现)
|
|
48
|
+
|
|
49
|
+
## 催办(会发送真实通知)
|
|
50
|
+
|
|
51
|
+
- 输入:`requestId`(必填)、`otherParam`(必填)、`remark`
|
|
52
|
+
- `otherParam` 的 `currentOperator`、`doneOperator`、`submitOperator`、`ccOperator`、`otherReminder` **必须至少填 1 个**;`messageRemind`、`emailRemind` 只是提醒方式,不能算作提醒对象
|
|
53
|
+
- `prepare` 先读流程状态,只有审批中(1)可催办,否则抛 `policy/not_in_approval`
|
|
54
|
+
- 高影响操作:会向真实接收人发送通知,执行前必须展示脱敏摘要并获得明确确认;测试时只向明确的内部测试接收人发送,`remark` 包含 `[WB-SKILL-TEST]`
|
|
55
|
+
|
|
56
|
+
## 调用示例
|
|
57
|
+
|
|
58
|
+
Windows PowerShell:
|
|
59
|
+
|
|
60
|
+
```powershell
|
|
61
|
+
weaver-work-cli --json contract run contract.request.create.prepare --input-json '{"workflowId":"12345","requestname":"WB-SKILL-TEST 销售合同审批流程"}'
|
|
62
|
+
weaver-work-cli --json contract run contract.request.create.apply --input-json '{"workflowId":"12345","requestname":"WB-SKILL-TEST 销售合同审批流程","continuation":"PREPARE_CONTINUATION","confirm":true}'
|
|
63
|
+
weaver-work-cli --json contract run contract.request.save.prepare --input-json '{"requestId":"67890","formData":{"dataDetails":[{"fieldId":"111","content":"WB-SKILL-TEST 客户"}]}}'
|
|
64
|
+
weaver-work-cli --json contract run contract.request.submit.prepare --input-json '{"requestId":"67890","requestName":"WB-SKILL-TEST 销售合同审批流程"}'
|
|
65
|
+
weaver-work-cli --json contract run contract.request.supervise.prepare --input-json '{"requestId":"67890","remark":"[WB-SKILL-TEST] 测试催办","otherParam":{"currentOperator":1}}'
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
macOS/Linux(bash/zsh):
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
weaver-work-cli --json contract run contract.request.create.prepare --input-json '{"workflowId":"12345","requestname":"WB-SKILL-TEST 销售合同审批流程"}'
|
|
72
|
+
weaver-work-cli --json contract run contract.request.create.apply --input-json '{"workflowId":"12345","requestname":"WB-SKILL-TEST 销售合同审批流程","continuation":"PREPARE_CONTINUATION","confirm":true}'
|
|
73
|
+
weaver-work-cli --json contract run contract.request.save.prepare --input-json '{"requestId":"67890","formData":{"dataDetails":[{"fieldId":"111","content":"WB-SKILL-TEST 客户"}]}}'
|
|
74
|
+
weaver-work-cli --json contract run contract.request.submit.prepare --input-json '{"requestId":"67890","requestName":"WB-SKILL-TEST 销售合同审批流程"}'
|
|
75
|
+
weaver-work-cli --json contract run contract.request.supervise.prepare --input-json '{"requestId":"67890","remark":"[WB-SKILL-TEST] 测试催办","otherParam":{"currentOperator":1}}'
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## 错误与边界
|
|
79
|
+
|
|
80
|
+
| 场景 | 表现 | 处理 |
|
|
81
|
+
|---|---|---|
|
|
82
|
+
| `apply` 缺少 `confirm` | `confirmation/required`,退出码 10 | 带 `confirm: true` 与 `prepare` 的 `continuation` 重新调用 |
|
|
83
|
+
| 输入与 `prepare` 不一致 | `validation/target_changed` | 重新 `prepare` |
|
|
84
|
+
| 流程状态不允许写 | `policy/already_submitted` / `request_closed` / `not_in_approval` | 停止,先撤回/退回或换流程实例 |
|
|
85
|
+
| `workflowId` 无效或不可创建 | `doCreateRequest` 返回业务失败 | 重新用 `contract.workflow.query` / `contract.workflow.list` 解析 `workflowId` |
|
|
86
|
+
| 提交返回 `1200301` | `authentication/session_expired` | 停止,先确认 E10 登录态 |
|
|
87
|
+
| 提交返回 `1200306` | `api/missing_required_fields` | 解析缺失字段补全后重试,最多 3 轮 |
|
|
88
|
+
| 写请求超时/断线 | `partial/write_uncertain`,退出码 11 | 停止,只补一次 `contract.request.status` 查询 |
|
|
89
|
+
|
|
90
|
+
## 注意
|
|
91
|
+
|
|
92
|
+
- 不要连续重复提交同一个 `.apply`;提交审批最容易因重复提交造成重复流转。
|
|
93
|
+
- 12 类合同审批流程共用这组接口,不要为某一类流程假设特殊参数。
|
|
94
|
+
- `continuation` 有效期 10 分钟,由 CLI 生成,禁止手工构造或跨操作复用。
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# 签约主体:定位与查询
|
|
2
|
+
|
|
3
|
+
## 请求头 / 认证
|
|
4
|
+
|
|
5
|
+
本文件描述的 API 请求通过 `weaver-work-cli` 执行,CLI 从 E10 登录会话自动注入以下凭证头(禁止业务输入携带):
|
|
6
|
+
|
|
7
|
+
| 请求头 | 值 |
|
|
8
|
+
|--------|-----|
|
|
9
|
+
| `Cookie` | `<e10-login 返回的完整原始 Cookie 串>`(禁止裁剪/去重/改写) |
|
|
10
|
+
| `eteamsid` | `<e10-login 返回的 ETEAMSID>` |
|
|
11
|
+
| `User-Agent` | `AgentType=<agentType>,IsAgent=true` |
|
|
12
|
+
|
|
13
|
+
业务输入(`--input-json` / `--input`)**不得包含** `userid`、`userId`、`token`、`cookie`、`eteamsid` 等字段,用户 ID 由 CLI 从会话注入。
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
用途:查询我方、客户方或供应商签约主体。全部为 `read`。
|
|
17
|
+
|
|
18
|
+
## 调用链(每步只能用上一步运行时返回的 ID)
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
① 应用 Tag -> contract.subject.app GET /api/bs/ebuilder/app/tags/getAppIds 取 appId
|
|
22
|
+
② 表单 Tag -> contract.subject.form GET /api/ebuilder/form/obj/getObjsByTag 取 objId / formId
|
|
23
|
+
③ 读字段 -> contract.subject.fields POST /api/ebuilder/common/ds/fields 取 fields[].id / name / config.dataKey
|
|
24
|
+
④ 读选项 -> contract.subject.options GET /api/ebuilder/common/ds/options 取选项 id <-> name
|
|
25
|
+
⑤ 查询 -> contract.subject.query POST /api/ebuilder/form/dataset/v2/getAllData
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## 准确的 Tag 字符串
|
|
29
|
+
|
|
30
|
+
| 步骤 | Tag | 说明 |
|
|
31
|
+
|---|---|---|
|
|
32
|
+
| 应用 Tag | `合同管理` | 固定值;CLI 默认也是它 |
|
|
33
|
+
| 表单 Tag(我方) | `我方签约主体库` | 查我方签约主体 |
|
|
34
|
+
| 表单 Tag(客户方) | `客户签约主体库` | 查客户签约主体 |
|
|
35
|
+
| 表单 Tag(供应商) | `供应商签约主体库` | 查供应商主体 |
|
|
36
|
+
|
|
37
|
+
Tag 需要 URL 编码,CLI 已处理;Agent 只需要传原始中文 Tag。
|
|
38
|
+
|
|
39
|
+
## 各 operation 输入
|
|
40
|
+
|
|
41
|
+
| operation | 必填 | 可选 |
|
|
42
|
+
|---|---|---|
|
|
43
|
+
| `contract.subject.app` | 无(默认 `tag=合同管理`) | `tag` |
|
|
44
|
+
| `contract.subject.form` | `appId`、`tag` | 无 |
|
|
45
|
+
| `contract.subject.fields` | `appId`、`objId` | `detailFieldsGroup`、`enableMerge`、`customParam`、`params` |
|
|
46
|
+
| `contract.subject.options` | `appId`、`objId`、`fieldName` | 无 |
|
|
47
|
+
| `contract.subject.query` | `objId` | `mainTable`、`pageNo`、`pageSize`、`isReturnDetail` |
|
|
48
|
+
|
|
49
|
+
请求形状说明(CLI 负责转换,Agent 只按上表传):
|
|
50
|
+
|
|
51
|
+
- `contract.subject.fields` 走 `multipart/form-data`:`groupId=appId`、`sourceId=objId`、`sourceType=FORM`。
|
|
52
|
+
- `contract.subject.options` 的 query 为 `groupId=appId`、`objId`、`sourceType=FORM`、`fieldName`。
|
|
53
|
+
- `contract.subject.query` 的 body 为 `{ datajson: { header: { objId }, mainTable, pageInfo, operationinfo: { isReturnDetail } } }`;`mainTable` 内多个字段之间为 AND 关系。
|
|
54
|
+
|
|
55
|
+
## 调用示例
|
|
56
|
+
|
|
57
|
+
Windows PowerShell:
|
|
58
|
+
|
|
59
|
+
```powershell
|
|
60
|
+
weaver-work-cli --json contract run contract.subject.app --input-json '{"tag":"合同管理"}'
|
|
61
|
+
weaver-work-cli --json contract run contract.subject.form --input-json '{"appId":"12345","tag":"我方签约主体库"}'
|
|
62
|
+
weaver-work-cli --json contract run contract.subject.fields --input-json '{"appId":"12345","objId":"67890"}'
|
|
63
|
+
weaver-work-cli --json contract run contract.subject.options --input-json '{"appId":"12345","objId":"67890","fieldName":"111"}'
|
|
64
|
+
weaver-work-cli --json contract run contract.subject.query --input-json '{"objId":"67890","mainTable":{"clm_party_name":"XX科技"},"pageNo":1,"pageSize":10}'
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
macOS/Linux(bash/zsh):
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
weaver-work-cli --json contract run contract.subject.app --input-json '{"tag":"合同管理"}'
|
|
71
|
+
weaver-work-cli --json contract run contract.subject.form --input-json '{"appId":"12345","tag":"我方签约主体库"}'
|
|
72
|
+
weaver-work-cli --json contract run contract.subject.fields --input-json '{"appId":"12345","objId":"67890"}'
|
|
73
|
+
weaver-work-cli --json contract run contract.subject.options --input-json '{"appId":"12345","objId":"67890","fieldName":"111"}'
|
|
74
|
+
weaver-work-cli --json contract run contract.subject.query --input-json '{"objId":"67890","mainTable":{"clm_party_name":"XX科技"},"pageNo":1,"pageSize":10}'
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## 结果解读与边界
|
|
78
|
+
|
|
79
|
+
- ebuilder 元数据接口成功码是顶层 `code = 200` 且 `status` 不为 false;`getAllData` 成功码是 `message.code = "0"`。
|
|
80
|
+
- `contract.subject.app` 返回 `appIds`;`contract.subject.form` 只返回 `id`、`objName`、`showName`、`tag`,不输出完整 `appId`、`permissionId`。
|
|
81
|
+
- `data` 为空数组表示 Tag 在当前应用中不存在:提示用户确认 Tag 名称或换 Tag,**不使用标准环境 ID 兜底**。
|
|
82
|
+
- 查询无结果时如实说明;返回多条时展示候选请用户选择。
|
|
83
|
+
- 名称、证件、联系和银行字段不得跨表单猜测;字段键以 `fields` 接口返回为准(系统字段用 `name`,自定义字段用 `config.dataKey`,**不要用 `text`**)。
|
|
84
|
+
- 选择类字段的值使用选项 ID(`id`),不要使用选项名称(`name`)。
|
|
85
|
+
|
|
86
|
+
## 注意
|
|
87
|
+
|
|
88
|
+
- 新建签约主体不是本文件的范围,见 [`contract-subject-create.md`](contract-subject-create.md)。
|
|
89
|
+
- 企业资信、企业变更、企业监控未实现,见 [`contract-disabled-capabilities.md`](contract-disabled-capabilities.md)。
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# 新建签约主体(写操作)
|
|
2
|
+
|
|
3
|
+
## 请求头 / 认证
|
|
4
|
+
|
|
5
|
+
本文件描述的 API 请求通过 `weaver-work-cli` 执行,CLI 从 E10 登录会话自动注入以下凭证头(禁止业务输入携带):
|
|
6
|
+
|
|
7
|
+
| 请求头 | 值 |
|
|
8
|
+
|--------|-----|
|
|
9
|
+
| `Cookie` | `<e10-login 返回的完整原始 Cookie 串>`(禁止裁剪/去重/改写) |
|
|
10
|
+
| `eteamsid` | `<e10-login 返回的 ETEAMSID>` |
|
|
11
|
+
| `User-Agent` | `AgentType=<agentType>,IsAgent=true` |
|
|
12
|
+
|
|
13
|
+
业务输入(`--input-json` / `--input`)**不得包含** `userid`、`userId`、`token`、`cookie`、`eteamsid` 等字段,用户 ID 由 CLI 从会话注入。
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
- operation:`contract.subject.create.prepare` -> `contract.subject.create.apply`
|
|
17
|
+
- 方法/路径:`POST /api/ebuilder/form/dataset/v2/saveFormData`
|
|
18
|
+
- 风险:`read-before-write` / `high-risk-write`
|
|
19
|
+
|
|
20
|
+
## 输入
|
|
21
|
+
|
|
22
|
+
| 字段 | 必填 | 说明 |
|
|
23
|
+
|---|---|---|
|
|
24
|
+
| `objId` | 是 | 表单对象 ID,来自 [`contract-signing-subjects.md`](contract-signing-subjects.md) 第 ② 步 |
|
|
25
|
+
| `mainTable` | 是 | 主表字段对象,键使用实际数据键,至少 1 个字段 |
|
|
26
|
+
| `details` | 否 | 明细表数据,键按 `detail1`、`detail2`… 传入 |
|
|
27
|
+
| `fieldNoFindIgnore` | 否 | 字段不存在是否忽略,默认 `"true"` |
|
|
28
|
+
| `doAction` | 否 | 是否执行 action,默认 `"false"` |
|
|
29
|
+
| `verify` | 否 | `{ field, value }`,写前查重条件 |
|
|
30
|
+
|
|
31
|
+
CLI 会把输入转成 `{ datajson: { header: { objId }, datas: [{ mainTable, ...details }], operationinfo: { fieldNoFindIgnore, doAction } } }`。
|
|
32
|
+
|
|
33
|
+
## 写前确认
|
|
34
|
+
|
|
35
|
+
`prepare` 会返回脱敏摘要 `preview`(字段数量 + 每个字段值的掩码),**必须先展示给用户并获得明确确认**后才执行 `apply`。
|
|
36
|
+
|
|
37
|
+
若传入 `verify`,`prepare` 会先用 `getAllData` 按 `field=value` 查重;命中记录时抛 `policy/already_exists` 并停止,提示用户复用已有记录而不是重复新建。
|
|
38
|
+
|
|
39
|
+
## 调用示例
|
|
40
|
+
|
|
41
|
+
Windows PowerShell:
|
|
42
|
+
|
|
43
|
+
```powershell
|
|
44
|
+
weaver-work-cli --json contract run contract.subject.create.prepare --input-json '{"objId":"67890","mainTable":{"clm_party_name":"XX科技有限公司"},"verify":{"field":"clm_party_name","value":"XX科技有限公司"}}'
|
|
45
|
+
weaver-work-cli --json contract run contract.subject.create.apply --input-json '{"objId":"67890","mainTable":{"clm_party_name":"XX科技有限公司"},"continuation":"PREPARE_CONTINUATION","confirm":true}'
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
macOS/Linux(bash/zsh):
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
weaver-work-cli --json contract run contract.subject.create.prepare --input-json '{"objId":"67890","mainTable":{"clm_party_name":"XX科技有限公司"},"verify":{"field":"clm_party_name","value":"XX科技有限公司"}}'
|
|
52
|
+
weaver-work-cli --json contract run contract.subject.create.apply --input-json '{"objId":"67890","mainTable":{"clm_party_name":"XX科技有限公司"},"continuation":"PREPARE_CONTINUATION","confirm":true}'
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## 成功判定
|
|
56
|
+
|
|
57
|
+
1. HTTP 200 且 `message.code = "0"`。
|
|
58
|
+
2. `data.datajson.status` 为 `true` 且 `data.datajson.dataIds` 非空。
|
|
59
|
+
3. CLI 在 `apply` 中校验这两项;不满足时返回 `partial/write_uncertain`(退出码 11),此时先用 `contract.subject.query` 确认是否已创建,**不盲目重试**。
|
|
60
|
+
|
|
61
|
+
成功后保存返回的 `dataIds`,用于后续详情、修改和删除操作。
|
|
62
|
+
|
|
63
|
+
## 错误与边界
|
|
64
|
+
|
|
65
|
+
| 场景 | 表现 | 处理 |
|
|
66
|
+
|---|---|---|
|
|
67
|
+
| `mainTable` 为空 | `policy/empty_main_table` | 停止,补齐主表字段 |
|
|
68
|
+
| 查重命中 | `policy/already_exists` | 停止,与用户确认是否复用已有记录 |
|
|
69
|
+
| `apply` 缺少 `confirm` | `confirmation/required`,退出码 10 | 带 `confirm: true` 重新调用 |
|
|
70
|
+
| 输入与 `prepare` 不一致 | `validation/target_changed` | 重新 `prepare` |
|
|
71
|
+
| 网络中断 | `partial/write_uncertain`,退出码 11 | 停止,只补一次查询确认 |
|
|
72
|
+
|
|
73
|
+
## 注意
|
|
74
|
+
|
|
75
|
+
- 字段键规则:系统字段直接用 `name`;自定义字段(`name` 等于 `id`)改用 `config.dataKey`;**禁止用字段 `text` 作为键**。选择字段值用选项 ID。
|
|
76
|
+
- 主体名称、证件号、联系方式、银行账号属于敏感信息;CLI 的 `preview` 已脱敏,回复用户时也不要贴完整证件号或银行账号。
|
|
77
|
+
- 测试数据命名建议使用 `WB-SKILL-TEST-<日期>-<随机串>`,便于识别和清理。
|