weaver-work-cli 0.1.8 → 0.1.20
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 +11 -11
- 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 +432 -0
- package/dist/core/state.js +26 -0
- package/dist/internal/e10/auth/commands.js +2 -2
- package/dist/internal/e10/auth/session.js +14 -0
- package/dist/internal/e10/auth/xiaoe.js +116 -51
- package/dist/internal/e10/request-runtime.js +5 -0
- 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 +346 -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 +969 -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 +623 -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/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/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 +6 -3
- package/dist/shortcuts/workflow/operations/form.js +931 -589
- package/dist/shortcuts/workflow/operations/read.js +128 -205
- 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 +2 -2
- package/docs/hrm.md +19 -9
- 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 +2 -2
- package/scripts/package-skill.mjs +32 -20
- 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/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 +216 -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 +136 -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 +118 -0
- package/skills/weaver-e10-caizhilian/references/org-browser.md +104 -0
- package/skills/weaver-e10-caizhilian/references/setting-attach.md +410 -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 +5079 -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 +54 -6
- package/skills/weaver-e10-hrm/references/employee.md +89 -15
- package/skills/weaver-e10-hrm/references/org.md +7 -4
- 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 +166 -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 +36 -25
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +10 -31
- package/skills/weaver-e10-shared/references/json-output-contract.md +20 -11
- 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-wenshuding/SKILL.md +5 -16
- package/skills/weaver-e10-wenshuding/references/source-manifest.json +7 -7
- package/skills/weaver-e10-workflow/SKILL.md +32 -37
- 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 +79 -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 +38 -20
- 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 +75 -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,623 @@
|
|
|
1
|
+
import { schemaOf } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* 采知连(E10 文档中心)操作规格表。
|
|
4
|
+
*
|
|
5
|
+
* 由源 Skill `weaver-e10-caizhilian` 的 64 个 operation(scripts/*_plugins.py +
|
|
6
|
+
* doc-business-operations/*.json)1:1 派生:
|
|
7
|
+
* - 60 个 canonical operation 保留(4 个本地配置类 operation 落到 manifest.withheldOperations);
|
|
8
|
+
* - 入参名严格保持源 snake_case(doc_id / folder_id / page_no / save_path ...);
|
|
9
|
+
* - `sourceOperation` 记录源 operation 名,便于回溯;
|
|
10
|
+
* - `requiresConfirmation` 的写操作由 registry 展开为 `<name>.prepare` / `<name>.apply`。
|
|
11
|
+
*/
|
|
12
|
+
const S = (description, extra = {}) => ({ type: 'string', description, ...extra });
|
|
13
|
+
const ID = (description) => ({ type: 'string', pattern: '^\\d+$', minLength: 1, description });
|
|
14
|
+
const INT = (description, extra = {}) => ({ type: 'integer', description, ...extra });
|
|
15
|
+
const BOOL = (description, extra = {}) => ({ type: 'boolean', description, ...extra });
|
|
16
|
+
const LIST = (description, items = { type: 'string' }) => ({
|
|
17
|
+
type: 'array',
|
|
18
|
+
minItems: 1,
|
|
19
|
+
items,
|
|
20
|
+
description,
|
|
21
|
+
});
|
|
22
|
+
const FILE = (description) => ({ type: 'string', minLength: 1, description });
|
|
23
|
+
/** 源 folder_plugins._VALID_PERMISSION_TYPES。 */
|
|
24
|
+
export const PERMISSION_TYPES = [
|
|
25
|
+
'copyPermission',
|
|
26
|
+
'deletePremisstion',
|
|
27
|
+
'downloadPremisstion',
|
|
28
|
+
'folderDefaultParticipants',
|
|
29
|
+
'movePermission',
|
|
30
|
+
'newCreateDocPremisstion',
|
|
31
|
+
'newCreateFolderPremisstion',
|
|
32
|
+
'settingPermission',
|
|
33
|
+
];
|
|
34
|
+
/** 源 folder_plugins._VALID_DETAIL_TYPES。 */
|
|
35
|
+
export const SETTING_TYPES = [
|
|
36
|
+
'copyPermission',
|
|
37
|
+
'defaultShares',
|
|
38
|
+
'deletePremisstion',
|
|
39
|
+
'downloadPremisstion',
|
|
40
|
+
'folderDefaultParticipants',
|
|
41
|
+
'movePermission',
|
|
42
|
+
'newCreateDocPremisstion',
|
|
43
|
+
'newCreateFolderPremisstion',
|
|
44
|
+
'settingPermission',
|
|
45
|
+
];
|
|
46
|
+
/** 源 folder_plugins._QUERY_FOLDER_VALID_PERMISSION_KEYS。 */
|
|
47
|
+
export const FOLDER_PERMISSION_KEYS = [
|
|
48
|
+
'copyPermission',
|
|
49
|
+
'deletePremisstion',
|
|
50
|
+
'downloadPremisstion',
|
|
51
|
+
'folderDefaultParticipants',
|
|
52
|
+
'folderDefaultShareNew',
|
|
53
|
+
'movePermission',
|
|
54
|
+
'newCreateDocPremisstion',
|
|
55
|
+
'newCreateFolderPremisstion',
|
|
56
|
+
'settingPermission',
|
|
57
|
+
];
|
|
58
|
+
/** 源 document_plugins._FIELD_MAP 的键。 */
|
|
59
|
+
export const DOC_UPDATE_FIELDS = ['abstract', 'auto_invalid_date', 'keywords', 'name'];
|
|
60
|
+
const FOLDER_TYPE = S('文件夹类型:company=公共/privy=个人/sys=系统', { enum: ['company', 'privy', 'sys'] });
|
|
61
|
+
const KB_TYPE = S('知识库类型', { enum: ['company', 'privy', 'sys'], default: 'company' });
|
|
62
|
+
const PERMISSION_TYPE = S('权限类型', { enum: [...PERMISSION_TYPES] });
|
|
63
|
+
const SETTING_TYPE = S('设置项类型', { enum: [...SETTING_TYPES] });
|
|
64
|
+
function pageProps(defaultPageSize) {
|
|
65
|
+
return {
|
|
66
|
+
page_no: INT('页码(1-indexed)', { minimum: 1, default: 1 }),
|
|
67
|
+
page_size: INT('每页条数', { minimum: 1, default: defaultPageSize }),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/** 源 create_html_document / create_markdown_document / create_office_document 的公共可选入参。 */
|
|
71
|
+
const CREATE_DOC_OPTIONALS = {
|
|
72
|
+
participant_ids: LIST('参与人(人员 ID)列表;缺省时按文件夹默认参与人回填'),
|
|
73
|
+
abstract_text: S('摘要'),
|
|
74
|
+
keywords: S('关键词'),
|
|
75
|
+
auto_invalidate_date: S('自动失效日期(YYYY-MM-DD)'),
|
|
76
|
+
tags: LIST('标签列表(源样透传给 document.tags)', { type: 'object', additionalProperties: true }),
|
|
77
|
+
virtual_folder_ids: LIST('虚拟文件夹 ID 列表;缺省时按文件夹默认虚拟目录回填'),
|
|
78
|
+
doc_category: INT('文档类别:0=普通,1=重要', { enum: [0, 1], default: 0 }),
|
|
79
|
+
cover_picture_id: ID('封面图片文件 ID'),
|
|
80
|
+
};
|
|
81
|
+
/** 源 add_doc_share / add_folder_set_default_share 的共享对象 ID 字段(1:1 保留 11 个)。 */
|
|
82
|
+
const SHARE_ID_FIELDS = {
|
|
83
|
+
obj_id: LIST('共享对象 ID(人员等)'),
|
|
84
|
+
obj_id_department: LIST('部门 ID'),
|
|
85
|
+
obj_id_subcompany: LIST('分部/子公司 ID'),
|
|
86
|
+
obj_id_role: LIST('角色 ID'),
|
|
87
|
+
obj_id_group: LIST('组 ID'),
|
|
88
|
+
obj_id_external: LIST('外部人员 ID'),
|
|
89
|
+
obj_id_customer: LIST('客户 ID'),
|
|
90
|
+
obj_id_customer_type: LIST('客户类型 ID'),
|
|
91
|
+
obj_id_position: LIST('岗位 ID'),
|
|
92
|
+
obj_id_manager: LIST('上级 ID'),
|
|
93
|
+
obj_id_grade: LIST('职级 ID'),
|
|
94
|
+
};
|
|
95
|
+
/** 源共享表单的可选级联参数。 */
|
|
96
|
+
const SHARE_OPTION_FIELDS = {
|
|
97
|
+
download: LIST('下载权限(share_level != 1 且未传时默认 ["download"])'),
|
|
98
|
+
department_attribute: LIST('部门属性'),
|
|
99
|
+
role_level: S('角色层级'),
|
|
100
|
+
position_level: S('岗位层级'),
|
|
101
|
+
position_attribute: LIST('岗位属性'),
|
|
102
|
+
virtualCompany: S('虚拟组织'),
|
|
103
|
+
createrPositionLevel: S('创建人岗位层级'),
|
|
104
|
+
};
|
|
105
|
+
function spec(resource, action, sourceOperation, risk, summary, properties, required = [], options = {}) {
|
|
106
|
+
return {
|
|
107
|
+
name: `caizhilian.${resource}.${action}`,
|
|
108
|
+
resource,
|
|
109
|
+
method: options.method ?? 'plugin',
|
|
110
|
+
action,
|
|
111
|
+
summary,
|
|
112
|
+
risk,
|
|
113
|
+
...(options.requiresConfirmation ? { requiresConfirmation: true } : {}),
|
|
114
|
+
sourceOperation,
|
|
115
|
+
...(options.deprecatedInputAliases ? { deprecatedInputAliases: options.deprecatedInputAliases } : {}),
|
|
116
|
+
...(options.permissions ? { permissions: options.permissions } : {}),
|
|
117
|
+
inputSchema: schemaOf(properties, { required }),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* 源资料声明的权限/接口前置条件(doc-business-operations 的「权限校验:…」表述)。
|
|
122
|
+
* 只在源明确写出的操作上记录,不推断。
|
|
123
|
+
*/
|
|
124
|
+
const PERMISSION_FOLDER_CREATE_DOCUMENT = ['folder.create-document'];
|
|
125
|
+
const PERMISSION_COMPARE_UPLOAD = ['compare.upload'];
|
|
126
|
+
export const caizhilianOperationSpecs = [
|
|
127
|
+
// ── document ────────────────────────────────────────────
|
|
128
|
+
spec('document', 'search', 'search_documents', 'read', '按关键词/文件夹/创建人/创建时间检索文档(源 search_documents)', {
|
|
129
|
+
keywords: S('检索关键词'),
|
|
130
|
+
folder_id: ID('文件夹 ID:100=系统,200=公共,300=个人'),
|
|
131
|
+
include_sub_folder: BOOL('是否包含子文件夹(仅在传了 folder_id 时生效)', { default: false }),
|
|
132
|
+
creator_user_id: ID('创建人(人员 ID)'),
|
|
133
|
+
create_time: S('创建时间范围,支持 today/last_7_days 等枚举或 last_<N>_days'),
|
|
134
|
+
...pageProps(40),
|
|
135
|
+
}),
|
|
136
|
+
spec('document', 'get', 'fetch_doc_base_info_by_docid', 'read', '按 doc_id 获取文档详情(源模板 FetchDocBaseInfoByDocid)', {
|
|
137
|
+
doc_id: ID('文档 ID'),
|
|
138
|
+
}, ['doc_id'], { method: 'http_template' }),
|
|
139
|
+
spec('document', 'create-html', 'create_html_document', 'high-risk-write', '在指定文件夹创建 HTML 文档(源 create_html_document)', {
|
|
140
|
+
name: S('文档标题'),
|
|
141
|
+
folder_id: ID('目标文件夹 ID'),
|
|
142
|
+
folder_type: FOLDER_TYPE,
|
|
143
|
+
author_id: ID('作者(人员 ID)'),
|
|
144
|
+
summary: S('HTML 正文内容'),
|
|
145
|
+
...CREATE_DOC_OPTIONALS,
|
|
146
|
+
}, ['name', 'folder_id', 'folder_type', 'author_id'], {
|
|
147
|
+
requiresConfirmation: true,
|
|
148
|
+
permissions: PERMISSION_FOLDER_CREATE_DOCUMENT,
|
|
149
|
+
}),
|
|
150
|
+
spec('document', 'create-markdown', 'create_markdown_document', 'high-risk-write', '在指定文件夹创建 Markdown 文档(源 create_markdown_document)', {
|
|
151
|
+
name: S('文档标题'),
|
|
152
|
+
folder_id: ID('目标文件夹 ID'),
|
|
153
|
+
folder_type: FOLDER_TYPE,
|
|
154
|
+
author_id: ID('作者(人员 ID)'),
|
|
155
|
+
summary: S('Markdown 正文内容;传 file_path 时其内容覆盖 summary,两者都可不传'),
|
|
156
|
+
file_path: FILE('本地 .md/.markdown 文件路径,读取内容覆盖 summary'),
|
|
157
|
+
...CREATE_DOC_OPTIONALS,
|
|
158
|
+
}, ['name', 'folder_id', 'folder_type', 'author_id'], {
|
|
159
|
+
requiresConfirmation: true,
|
|
160
|
+
permissions: PERMISSION_FOLDER_CREATE_DOCUMENT,
|
|
161
|
+
}),
|
|
162
|
+
spec('document', 'create-office', 'create_office_document', 'read-with-upload', '上传 Office 文件并创建文档(源 create_office_document)', {
|
|
163
|
+
file_path: FILE('本地 Office 文件路径(.doc/.docx/.xls/.xlsx/.ppt/.pptx)'),
|
|
164
|
+
name: S('文档标题,缺省取文件名(不含扩展名)'),
|
|
165
|
+
folder_id: ID('目标文件夹 ID'),
|
|
166
|
+
folder_type: FOLDER_TYPE,
|
|
167
|
+
author_id: ID('作者(人员 ID)'),
|
|
168
|
+
...CREATE_DOC_OPTIONALS,
|
|
169
|
+
}, ['file_path', 'folder_id', 'folder_type', 'author_id'], {
|
|
170
|
+
requiresConfirmation: true,
|
|
171
|
+
permissions: PERMISSION_FOLDER_CREATE_DOCUMENT,
|
|
172
|
+
}),
|
|
173
|
+
spec('document', 'create-by-upload', 'create_document_by_upload', 'read-with-upload', '批量上传文件直接建文档(源 create_document_by_upload)', {
|
|
174
|
+
file_paths: LIST('本地文件路径列表(最多并发 8 个)'),
|
|
175
|
+
folder_id: ID('目标文件夹 ID'),
|
|
176
|
+
folder_type: FOLDER_TYPE,
|
|
177
|
+
author_id: ID('作者(人员 ID),缺省取当前登录人'),
|
|
178
|
+
participant_ids: LIST('参与人(人员 ID)列表'),
|
|
179
|
+
keywords: S('关键词'),
|
|
180
|
+
abstract_text: S('摘要'),
|
|
181
|
+
auto_invalidate_date: S('自动失效日期(YYYY-MM-DD)'),
|
|
182
|
+
tags: LIST('标签列表', { type: 'object', additionalProperties: true }),
|
|
183
|
+
virtual_folder_ids: LIST('虚拟文件夹 ID 列表'),
|
|
184
|
+
doc_category: INT('文档类别:0=普通,1=重要', { enum: [0, 1], default: 0 }),
|
|
185
|
+
}, ['file_paths', 'folder_id', 'folder_type'], {
|
|
186
|
+
requiresConfirmation: true,
|
|
187
|
+
permissions: PERMISSION_FOLDER_CREATE_DOCUMENT,
|
|
188
|
+
}),
|
|
189
|
+
spec('document', 'update-field', 'update_doc_field', 'high-risk-write', '修改文档基础字段(源 update_doc_field)', {
|
|
190
|
+
doc_id: ID('文档 ID'),
|
|
191
|
+
field: S('字段名', { enum: [...DOC_UPDATE_FIELDS] }),
|
|
192
|
+
value: S('字段值(name 字段不允许空串)'),
|
|
193
|
+
}, ['doc_id', 'field', 'value'], { requiresConfirmation: true }),
|
|
194
|
+
spec('document', 'update-author', 'update_doc_author', 'high-risk-write', '变更文档作者(源 update_doc_author)', {
|
|
195
|
+
doc_id: ID('文档 ID'),
|
|
196
|
+
user_id: ID('新作者(人员 ID)'),
|
|
197
|
+
}, ['doc_id', 'user_id'], { requiresConfirmation: true }),
|
|
198
|
+
spec('document', 'update-html', 'update_doc_html_content', 'high-risk-write', '保存 HTML 正文并生成新版本(源 update_doc_html_content)', {
|
|
199
|
+
doc_id: ID('文档 ID'),
|
|
200
|
+
summary: S('HTML 正文内容'),
|
|
201
|
+
}, ['doc_id', 'summary'], { requiresConfirmation: true }),
|
|
202
|
+
spec('document', 'replace-content', 'replace_document_content', 'read-with-upload', '用本地文件替换文档正文(源 replace_document_content,走 reUpload)', {
|
|
203
|
+
file_path: FILE('本地文件路径,扩展名需与文档正文类型匹配'),
|
|
204
|
+
doc_id: ID('文档 ID'),
|
|
205
|
+
}, ['file_path', 'doc_id'], { requiresConfirmation: true }),
|
|
206
|
+
// ── folder ──────────────────────────────────────────────
|
|
207
|
+
spec('folder', 'create', 'create_folder', 'high-risk-write', '创建文件夹(源 create_folder)', {
|
|
208
|
+
name: S('文件夹名称'),
|
|
209
|
+
parent_id: ID('父文件夹 ID'),
|
|
210
|
+
parent_type: S('父文件夹类型', { enum: ['company', 'privy'] }),
|
|
211
|
+
sequence: INT('排序号,范围 -9999~99999;parent_type=privy 时强制为 0', { minimum: -9999, maximum: 99999, default: 0 }),
|
|
212
|
+
inherit_parent: BOOL('是否继承父文件夹设置;parent_type=privy 时强制为 false', { default: false }),
|
|
213
|
+
}, ['name', 'parent_id', 'parent_type'], { requiresConfirmation: true }),
|
|
214
|
+
spec('folder', 'search-virtual', 'search_virtual_folders', 'read', '检索虚拟文件夹(源 search_virtual_folders)', {
|
|
215
|
+
name: S('虚拟文件夹名称关键词'),
|
|
216
|
+
...pageProps(50),
|
|
217
|
+
}),
|
|
218
|
+
spec('folder', 'query-by-name', 'query_folders_by_name', 'read', '按名称查询文件夹并展平为路径列表(源模板 FlattenSearchResultFolderTree)', {
|
|
219
|
+
folder_name: S('文件夹名称'),
|
|
220
|
+
kb_type: KB_TYPE,
|
|
221
|
+
}, ['folder_name'], { method: 'http_template' }),
|
|
222
|
+
spec('folder', 'get-settings', 'fetch_folder_default_settings', 'read', '查询文件夹默认设置(虚拟目录/默认参与人/默认共享)', {
|
|
223
|
+
folder_id: ID('文件夹 ID'),
|
|
224
|
+
}, ['folder_id'], { method: 'http_template' }),
|
|
225
|
+
spec('folder', 'list-default-shares', 'fetch_folder_default_shares', 'read', '查询文件夹文档默认共享人列表(源入参名为 folderId)', {
|
|
226
|
+
folder_id: ID('文件夹 ID'),
|
|
227
|
+
folderId: ID('旧名字段,等价 folder_id(已废弃,与新名同时出现且取值不一致会报 alias_conflict)'),
|
|
228
|
+
}, ['folder_id'], { deprecatedInputAliases: { folder_id: ['folderId'] } }),
|
|
229
|
+
spec('folder', 'default-share.form', 'fetch_folder_set_default_share_form', 'read', '查询“默认共享人”表单配置(对象类型 + 级联参数)', {
|
|
230
|
+
folder_id: ID('文件夹 ID'),
|
|
231
|
+
category: S('表单类别', { enum: ['creator', 'generic'] }),
|
|
232
|
+
}, ['folder_id', 'category']),
|
|
233
|
+
spec('folder', 'default-share.list', 'fetch_folder_set_default_share_list', 'read', '查询“默认共享人”设置列表', {
|
|
234
|
+
folder_id: ID('文件夹 ID'),
|
|
235
|
+
}, ['folder_id']),
|
|
236
|
+
spec('folder', 'default-share.add', 'add_folder_set_default_share', 'high-risk-write', '添加文件夹默认共享人', {
|
|
237
|
+
folder_id: ID('文件夹 ID'),
|
|
238
|
+
obj_type: S('共享对象类型(取自 default-share.form 的 obj_types[].id)'),
|
|
239
|
+
share_level: S('共享级别'),
|
|
240
|
+
...SHARE_ID_FIELDS,
|
|
241
|
+
...SHARE_OPTION_FIELDS,
|
|
242
|
+
seclevel_min: INT('密级下限,范围 -999~999', { minimum: -999, maximum: 999 }),
|
|
243
|
+
seclevel_max: INT('密级上限,范围 -999~999', { minimum: -999, maximum: 999 }),
|
|
244
|
+
}, ['folder_id', 'obj_type', 'share_level'], { requiresConfirmation: true }),
|
|
245
|
+
spec('folder', 'default-share.delete', 'delete_folder_set_default_share', 'high-risk-write', '删除文件夹默认共享人', {
|
|
246
|
+
folder_id: ID('文件夹 ID'),
|
|
247
|
+
ids: LIST('待删除条目 ID 列表'),
|
|
248
|
+
}, ['folder_id', 'ids'], { requiresConfirmation: true }),
|
|
249
|
+
spec('folder', 'permission.form', 'fetch_folder_permission_form', 'read', '查询文件夹文档权限设置的表单配置', {
|
|
250
|
+
folder_id: ID('文件夹 ID'),
|
|
251
|
+
permission_type: PERMISSION_TYPE,
|
|
252
|
+
}, ['folder_id', 'permission_type']),
|
|
253
|
+
spec('folder', 'permission.list', 'list_folder_permission', 'read', '查询文件夹文档权限设置列表', {
|
|
254
|
+
folder_id: ID('文件夹 ID'),
|
|
255
|
+
permission_type: PERMISSION_TYPE,
|
|
256
|
+
}, ['folder_id', 'permission_type']),
|
|
257
|
+
spec('folder', 'permission.add', 'add_folder_permission', 'high-risk-write', '添加文件夹文档权限设置', {
|
|
258
|
+
folder_id: ID('文件夹 ID'),
|
|
259
|
+
permission_type: PERMISSION_TYPE,
|
|
260
|
+
obj_type: S('权限对象类型'),
|
|
261
|
+
obj_id: LIST('对象 ID(人员等)'),
|
|
262
|
+
obj_id_department: LIST('部门 ID'),
|
|
263
|
+
obj_id_subcompany: LIST('分部 ID'),
|
|
264
|
+
obj_id_role: LIST('角色 ID'),
|
|
265
|
+
obj_id_position: LIST('岗位 ID'),
|
|
266
|
+
obj_id_customer: LIST('客户 ID'),
|
|
267
|
+
obj_id_customer_type: LIST('客户类型 ID'),
|
|
268
|
+
department_attribute: LIST('部门属性'),
|
|
269
|
+
role_level: S('角色层级'),
|
|
270
|
+
position_level: S('岗位层级'),
|
|
271
|
+
position_attribute: LIST('岗位属性'),
|
|
272
|
+
position_level_department: LIST('岗位层级-部门'),
|
|
273
|
+
position_level_subcompany: LIST('岗位层级-分部'),
|
|
274
|
+
}, ['folder_id', 'permission_type', 'obj_type'], { requiresConfirmation: true }),
|
|
275
|
+
spec('folder', 'permission.delete', 'delete_folder_permission', 'high-risk-write', '删除文件夹文档权限设置', {
|
|
276
|
+
folder_id: ID('文件夹 ID'),
|
|
277
|
+
permission_type: PERMISSION_TYPE,
|
|
278
|
+
ids: LIST('待删除条目 ID 列表'),
|
|
279
|
+
}, ['folder_id', 'permission_type', 'ids'], { requiresConfirmation: true }),
|
|
280
|
+
spec('folder', 'permission.get-auth', 'fetch_folder_permission_auth', 'read', '查询文件夹权限类型当前值(true/user/false)', {
|
|
281
|
+
folder_id: ID('文件夹 ID'),
|
|
282
|
+
permission_type: PERMISSION_TYPE,
|
|
283
|
+
}, ['folder_id', 'permission_type']),
|
|
284
|
+
spec('folder', 'permission.set-auth', 'update_folder_permission_auth', 'high-risk-write', '设置文件夹权限类型(true/user/false)', {
|
|
285
|
+
folder_id: ID('文件夹 ID'),
|
|
286
|
+
permission_type: PERMISSION_TYPE,
|
|
287
|
+
value: S('目标值', { enum: ['true', 'user', 'false'] }),
|
|
288
|
+
}, ['folder_id', 'permission_type', 'value'], { requiresConfirmation: true }),
|
|
289
|
+
spec('folder', 'permission.detail', 'fetch_folder_permission_detail', 'read', '查询文件夹单个设置项详情(含标题与人员明细)', {
|
|
290
|
+
folder_id: ID('文件夹 ID'),
|
|
291
|
+
setting_type: SETTING_TYPE,
|
|
292
|
+
}, ['folder_id', 'setting_type']),
|
|
293
|
+
spec('folder', 'permission.query', 'query_folder_permissions', 'read', '批量查询文件夹权限白名单字段(源模板 FilterFolderPermissionFields)', {
|
|
294
|
+
folder_ids: LIST('文件夹 ID 列表'),
|
|
295
|
+
}, ['folder_ids'], { method: 'http_template' }),
|
|
296
|
+
spec('folder', 'query-by-permission', 'query_folders_by_permission', 'read', '按权限类型 + 权限对象反查文件夹', {
|
|
297
|
+
permission_key: S('权限类型', { enum: [...FOLDER_PERMISSION_KEYS] }),
|
|
298
|
+
permissions: LIST('权限对象列表,如 [{"object_type":"all"}] 或 [{"object_type":"resource","object_ids":["123"]}]', {
|
|
299
|
+
type: 'object',
|
|
300
|
+
additionalProperties: false,
|
|
301
|
+
properties: {
|
|
302
|
+
object_type: S('对象类型'),
|
|
303
|
+
object_ids: LIST('对象 ID 列表(正整数)'),
|
|
304
|
+
},
|
|
305
|
+
required: ['object_type'],
|
|
306
|
+
}),
|
|
307
|
+
...pageProps(20),
|
|
308
|
+
}, ['permission_key', 'permissions']),
|
|
309
|
+
// ── setting-attach ──────────────────────────────────────
|
|
310
|
+
spec('setting-attach', 'get', 'get_setting_attach', 'read', '读取附件设置(文件设置 → 附件设置)', {}, [], {
|
|
311
|
+
method: 'http_template',
|
|
312
|
+
}),
|
|
313
|
+
spec('setting-attach', 'list-workflows-by-folders', 'list_approval_workflows_by_folders', 'read', '通过文件夹 ID 反查哪些审批流程将这些文件夹设置为附件上传目录', {
|
|
314
|
+
folder_ids: LIST('文件夹 ID 列表'),
|
|
315
|
+
}, ['folder_ids'], {
|
|
316
|
+
method: 'http_template',
|
|
317
|
+
}),
|
|
318
|
+
spec('setting-attach', 'set', 'set_setting_attach', 'high-risk-write', '保存附件设置(只改指定字段,未指定字段透传原值)', {
|
|
319
|
+
items: {
|
|
320
|
+
type: 'object',
|
|
321
|
+
properties: {
|
|
322
|
+
'upload-max': S('上传最大(如 2G、512MB)'),
|
|
323
|
+
'shard-size': INT('上传分片大小(MB,1-50)'),
|
|
324
|
+
'format-mode': S('格式控制方式(whitelist/blacklist)'),
|
|
325
|
+
'format-list': S('格式列表(逗号分隔扩展名)'),
|
|
326
|
+
'non-image-open': S('非图片打开方式(newTab/popupWindow)'),
|
|
327
|
+
'image-open': S('图片打开方式(newTab/previewComponent)'),
|
|
328
|
+
'show-attach-list': BOOL('预览显示附件列表'),
|
|
329
|
+
'attach-expand': BOOL('附件列默认展开'),
|
|
330
|
+
'custom-msg': S('附加提示(true::文本 或 false)'),
|
|
331
|
+
'batch-download': BOOL('附件批量下载'),
|
|
332
|
+
'mobile-block': BOOL('禁止移动端下载'),
|
|
333
|
+
},
|
|
334
|
+
additionalProperties: false,
|
|
335
|
+
},
|
|
336
|
+
}, ['items'], { requiresConfirmation: true }),
|
|
337
|
+
// ── setting-backup ──────────────────────────────────────
|
|
338
|
+
spec('setting-backup', 'get', 'get_setting_backup', 'read', '读取备份开关状态(文件设置 → 备份设置)', {}, [], {
|
|
339
|
+
method: 'http_template',
|
|
340
|
+
}),
|
|
341
|
+
spec('setting-backup', 'set', 'set_setting_backup', 'high-risk-write', '设置备份开关', {
|
|
342
|
+
enabled: BOOL('是否启用本地备份'),
|
|
343
|
+
}, ['enabled'], { requiresConfirmation: true }),
|
|
344
|
+
spec('setting-backup', 'rule.list', 'list_backup_rules', 'read', '列出备份规则', {
|
|
345
|
+
...pageProps(20),
|
|
346
|
+
}),
|
|
347
|
+
spec('setting-backup', 'rule.get', 'get_backup_rule', 'read', '获取备份规则详情', {
|
|
348
|
+
id: ID('规则 ID'),
|
|
349
|
+
}, ['id']),
|
|
350
|
+
spec('setting-backup', 'rule.update', 'update_backup_rule', 'high-risk-write', '更新备份规则', {
|
|
351
|
+
id: ID('规则 ID'),
|
|
352
|
+
name: S('规则名称'),
|
|
353
|
+
path: S('备份路径'),
|
|
354
|
+
period: INT('备份周期(分钟,60-1440)'),
|
|
355
|
+
}, ['id'], { requiresConfirmation: true }),
|
|
356
|
+
spec('setting-backup', 'rule.delete', 'delete_backup_rule', 'high-risk-write', '删除备份规则', {
|
|
357
|
+
id: ID('规则 ID'),
|
|
358
|
+
}, ['id'], { requiresConfirmation: true }),
|
|
359
|
+
spec('setting-backup', 'rule.enable', 'enable_backup_rule', 'high-risk-write', '启停备份规则', {
|
|
360
|
+
id: ID('规则 ID'),
|
|
361
|
+
enabled: BOOL('是否启用'),
|
|
362
|
+
}, ['id', 'enabled'], { requiresConfirmation: true }),
|
|
363
|
+
// ── setting-encrypt ─────────────────────────────────────
|
|
364
|
+
spec('setting-encrypt', 'get', 'get_setting_encrypt', 'read', '读取加解密设置(文件设置 → 加解密设置)', {}, [], {
|
|
365
|
+
method: 'http_template',
|
|
366
|
+
}),
|
|
367
|
+
spec('setting-encrypt', 'set', 'set_setting_encrypt', 'high-risk-write', '保存加解密设置(整对象 POST)', {
|
|
368
|
+
items: {
|
|
369
|
+
type: 'object',
|
|
370
|
+
properties: {
|
|
371
|
+
'enabled': BOOL('是否启用加解密功能'),
|
|
372
|
+
'plugs': S('加解密插件类型'),
|
|
373
|
+
'url': S('加解密服务地址'),
|
|
374
|
+
'scene': S('加解密场景(uploadAndDownloadEncrypt/uploadEncrypt/downloadEncrypt/custom)'),
|
|
375
|
+
'upload-encrypted': S('加密文件上传规则'),
|
|
376
|
+
'download-encrypted': S('加密文件下载规则'),
|
|
377
|
+
'upload-unencrypted': S('未加密文件上传规则'),
|
|
378
|
+
'download-unencrypted': S('未加密文件下载规则'),
|
|
379
|
+
},
|
|
380
|
+
additionalProperties: false,
|
|
381
|
+
},
|
|
382
|
+
}, ['items'], { requiresConfirmation: true }),
|
|
383
|
+
// ── setting-storage ─────────────────────────────────────
|
|
384
|
+
spec('setting-storage', 'instance.list', 'list_storage_instances', 'read', '列出存储实例', {
|
|
385
|
+
...pageProps(20),
|
|
386
|
+
}),
|
|
387
|
+
spec('setting-storage', 'instance.get', 'get_storage_instance', 'read', '获取存储实例详情', {
|
|
388
|
+
id: ID('实例 ID'),
|
|
389
|
+
instance_type: S('实例类型(可选)'),
|
|
390
|
+
}, ['id']),
|
|
391
|
+
spec('setting-storage', 'rule.form', 'get_rule_form', 'read', '拉规则表单', {
|
|
392
|
+
id: ID('规则 ID(可选,不传拉默认)'),
|
|
393
|
+
}),
|
|
394
|
+
spec('setting-storage', 'rule.table', 'get_rule_table', 'read', '拉规则表', {}, [], {
|
|
395
|
+
method: 'http_template',
|
|
396
|
+
}),
|
|
397
|
+
spec('setting-storage', 'rule.search', 'search_rules', 'read', '高级搜索规则', {
|
|
398
|
+
conditions: LIST('搜索条件数组', {
|
|
399
|
+
type: 'object',
|
|
400
|
+
properties: {
|
|
401
|
+
field: S('字段名'),
|
|
402
|
+
value: S('值'),
|
|
403
|
+
operate: S('操作符'),
|
|
404
|
+
},
|
|
405
|
+
required: ['field', 'value', 'operate'],
|
|
406
|
+
}),
|
|
407
|
+
rule_type: S('规则类型(可选)'),
|
|
408
|
+
}),
|
|
409
|
+
spec('setting-storage', 'rule.save', 'save_rule', 'high-risk-write', '保存存储规则', {
|
|
410
|
+
rule_info_list: LIST('规则信息列表', {
|
|
411
|
+
type: 'object',
|
|
412
|
+
additionalProperties: true,
|
|
413
|
+
}),
|
|
414
|
+
default_rule: BOOL('是否默认规则'),
|
|
415
|
+
}, ['rule_info_list'], { requiresConfirmation: true }),
|
|
416
|
+
spec('setting-storage', 'rule.delete', 'delete_rule', 'high-risk-write', '删除存储规则', {
|
|
417
|
+
rule_ids: LIST('规则 ID 列表'),
|
|
418
|
+
}, ['rule_ids'], { requiresConfirmation: true }),
|
|
419
|
+
spec('setting-storage', 'rule.enable', 'enable_rule', 'high-risk-write', '启停存储规则', {
|
|
420
|
+
rule_info_list: LIST('规则信息列表(含 id 和 openStatus)', {
|
|
421
|
+
type: 'object',
|
|
422
|
+
properties: {
|
|
423
|
+
id: ID('规则 ID'),
|
|
424
|
+
openStatus: BOOL('是否启用'),
|
|
425
|
+
},
|
|
426
|
+
required: ['id', 'openStatus'],
|
|
427
|
+
}),
|
|
428
|
+
}, ['rule_info_list'], { requiresConfirmation: true }),
|
|
429
|
+
spec('setting-storage', 'rule.order', 'save_rule_order', 'high-risk-write', '改规则顺序', {
|
|
430
|
+
rule_ids: LIST('规则 ID 列表(按顺序)'),
|
|
431
|
+
}, ['rule_ids'], { requiresConfirmation: true }),
|
|
432
|
+
// ── file-collection ─────────────────────────────────────
|
|
433
|
+
spec('file-collection', 'task.list', 'list_collection_tasks', 'read', '列出采集任务', {}, [], {
|
|
434
|
+
method: 'http_template',
|
|
435
|
+
}),
|
|
436
|
+
spec('file-collection', 'task.form', 'get_collection_task_form', 'read', '获取采集任务表单', {
|
|
437
|
+
id: ID('任务 ID(可选)'),
|
|
438
|
+
}),
|
|
439
|
+
spec('file-collection', 'storage.check', 'check_collection_storage', 'read', '检查存储连接', {}, [], {
|
|
440
|
+
method: 'http_template',
|
|
441
|
+
}),
|
|
442
|
+
spec('file-collection', 'scan', 'scan_collection', 'high-risk-write', '扫描采集任务', {
|
|
443
|
+
task_id: ID('任务 ID'),
|
|
444
|
+
full_coll: BOOL('是否全量扫描(默认增量)'),
|
|
445
|
+
}, ['task_id'], { requiresConfirmation: true }),
|
|
446
|
+
spec('file-collection', 'scan.progress', 'scan_collection_progress', 'read', '查询扫描进度', {}, [], {
|
|
447
|
+
method: 'http_template',
|
|
448
|
+
}),
|
|
449
|
+
spec('file-collection', 'run', 'run_collection', 'high-risk-write', '运行/暂停采集任务', {
|
|
450
|
+
task_id: ID('任务 ID'),
|
|
451
|
+
action: S('操作类型(run/pause)'),
|
|
452
|
+
}, ['task_id', 'action'], { requiresConfirmation: true }),
|
|
453
|
+
spec('file-collection', 'run.progress', 'run_collection_progress', 'read', '查询运行进度', {}, [], {
|
|
454
|
+
method: 'http_template',
|
|
455
|
+
}),
|
|
456
|
+
spec('file-collection', 'detail', 'get_collection_detail', 'read', '查询采集详情', {}, [], {
|
|
457
|
+
method: 'http_template',
|
|
458
|
+
}),
|
|
459
|
+
spec('file-collection', 'cancel', 'cancel_collection', 'high-risk-write', '取消采集任务', {
|
|
460
|
+
task_id: ID('任务 ID'),
|
|
461
|
+
}, ['task_id'], { requiresConfirmation: true }),
|
|
462
|
+
spec('file-collection', 'delete', 'delete_collection_task', 'high-risk-write', '删除采集任务', {
|
|
463
|
+
task_id: ID('任务 ID'),
|
|
464
|
+
}, ['task_id'], { requiresConfirmation: true }),
|
|
465
|
+
// ── file-upload ─────────────────────────────────────────
|
|
466
|
+
spec('file-upload', 'contract', 'get_upload_contract', 'read', '获取上传接口合约', {}, [], {
|
|
467
|
+
method: 'http_template',
|
|
468
|
+
}),
|
|
469
|
+
spec('file-upload', 'prepare', 'prepare_upload', 'read', '准备上传(本地文件校验与元数据)', {
|
|
470
|
+
file_path: FILE('本地文件绝对路径'),
|
|
471
|
+
module: S('业务模块(如 document、workflow 等)'),
|
|
472
|
+
}, ['file_path', 'module']),
|
|
473
|
+
spec('file-upload', 'upload', 'upload_file', 'high-risk-write', '上传文件到文件服务', {
|
|
474
|
+
file_path: FILE('本地文件绝对路径'),
|
|
475
|
+
module: S('业务模块(如 document、workflow 等)'),
|
|
476
|
+
user_confirmed: BOOL('用户已确认上传'),
|
|
477
|
+
}, ['file_path', 'module', 'user_confirmed'], { requiresConfirmation: true }),
|
|
478
|
+
// ── org ─────────────────────────────────────────────────
|
|
479
|
+
spec('org', 'search-user', 'search_user', 'read', '人员浏览器检索(源 search_user → /api/hrm/common/browser/data/resource)', {
|
|
480
|
+
keyword: S('检索关键词(按 username 快搜)'),
|
|
481
|
+
...pageProps(50),
|
|
482
|
+
}),
|
|
483
|
+
spec('org', 'search-department', 'search_department', 'read', '部门浏览器检索(源 search_department)', {
|
|
484
|
+
keyword: S('检索关键词'),
|
|
485
|
+
...pageProps(50),
|
|
486
|
+
}),
|
|
487
|
+
spec('org', 'search-subcompany', 'search_subcompany', 'read', '分部/子公司浏览器检索(源 search_subcompany)', {
|
|
488
|
+
keyword: S('检索关键词'),
|
|
489
|
+
...pageProps(50),
|
|
490
|
+
}),
|
|
491
|
+
spec('org', 'search-external', 'search_external', 'read', '外部人员浏览器检索(源 search_external)', {
|
|
492
|
+
keyword: S('检索关键词'),
|
|
493
|
+
...pageProps(50),
|
|
494
|
+
}),
|
|
495
|
+
spec('org', 'search-position', 'search_position', 'read', '岗位浏览器检索(源 search_position)', {
|
|
496
|
+
keyword: S('检索关键词'),
|
|
497
|
+
...pageProps(50),
|
|
498
|
+
}),
|
|
499
|
+
spec('org', 'search-role', 'search_role', 'read', '角色浏览器检索(源 search_role)', {
|
|
500
|
+
keyword: S('检索关键词'),
|
|
501
|
+
...pageProps(50),
|
|
502
|
+
}),
|
|
503
|
+
spec('org', 'search-customer', 'search_customer', 'read', 'CRM 客户浏览器检索(源 search_customer)', {
|
|
504
|
+
keyword: S('检索关键词'),
|
|
505
|
+
...pageProps(50),
|
|
506
|
+
}),
|
|
507
|
+
spec('org', 'search-customer-type', 'search_customer_type', 'read', 'CRM 客户类型字典检索(源 search_customer_type)', {
|
|
508
|
+
keyword: S('检索关键词'),
|
|
509
|
+
...pageProps(50),
|
|
510
|
+
}),
|
|
511
|
+
// ── user ────────────────────────────────────────────────
|
|
512
|
+
spec('user', 'current', 'fetch_current_user_info', 'read', '获取当前登录人信息(employeeId / employeeName)', {}, [], {
|
|
513
|
+
method: 'http_template',
|
|
514
|
+
}),
|
|
515
|
+
// ── tag ─────────────────────────────────────────────────
|
|
516
|
+
spec('tag', 'search', 'search_tags', 'read', '检索标签(type=0 公共标签限定 document 模块,type=1 个人标签)', {
|
|
517
|
+
name: S('标签名称关键词'),
|
|
518
|
+
type: INT('标签类型:0=公共,1=个人', { enum: [0, 1] }),
|
|
519
|
+
...pageProps(50),
|
|
520
|
+
}, ['type']),
|
|
521
|
+
spec('tag', 'list', 'fetch_doc_tags', 'read', '查询文档已打标签(公共 + 个人合并)', {
|
|
522
|
+
doc_id: ID('文档 ID'),
|
|
523
|
+
}, ['doc_id']),
|
|
524
|
+
spec('tag', 'add', 'add_doc_tag', 'high-risk-write', '为文档添加标签', {
|
|
525
|
+
doc_id: ID('文档 ID'),
|
|
526
|
+
tags: LIST('标签列表,元素形如 {"id":"1","privacy":false} 或 {"name":"xx","privacy":true}', {
|
|
527
|
+
type: 'object',
|
|
528
|
+
additionalProperties: true,
|
|
529
|
+
}),
|
|
530
|
+
}, ['doc_id', 'tags'], { requiresConfirmation: true }),
|
|
531
|
+
spec('tag', 'remove', 'remove_doc_tag', 'high-risk-write', '移除文档标签', {
|
|
532
|
+
doc_id: ID('文档 ID'),
|
|
533
|
+
tags: LIST('标签列表,元素形如 {"id":"1","privacy":false}', { type: 'object', additionalProperties: true }),
|
|
534
|
+
}, ['doc_id', 'tags'], { requiresConfirmation: true }),
|
|
535
|
+
// ── participant ─────────────────────────────────────────
|
|
536
|
+
spec('participant', 'list', 'fetch_doc_participants', 'read', '查询文档参与人列表', {
|
|
537
|
+
doc_id: ID('文档 ID'),
|
|
538
|
+
}, ['doc_id']),
|
|
539
|
+
spec('participant', 'add', 'add_doc_participant', 'high-risk-write', '添加文档参与人', {
|
|
540
|
+
doc_id: ID('文档 ID'),
|
|
541
|
+
user_id: ID('人员 ID'),
|
|
542
|
+
}, ['doc_id', 'user_id'], { requiresConfirmation: true }),
|
|
543
|
+
spec('participant', 'remove', 'remove_doc_participant', 'high-risk-write', '移除文档参与人', {
|
|
544
|
+
share_entry_id: ID('共享条目 ID(来自 participant.list)'),
|
|
545
|
+
doc_id: ID('文档 ID'),
|
|
546
|
+
}, ['share_entry_id', 'doc_id'], { requiresConfirmation: true }),
|
|
547
|
+
// ── share ───────────────────────────────────────────────
|
|
548
|
+
spec('share', 'form', 'fetch_doc_share_form', 'read', '查询文档共享表单配置(对象类型 + 级联参数)', {
|
|
549
|
+
doc_id: ID('文档 ID'),
|
|
550
|
+
}, ['doc_id']),
|
|
551
|
+
spec('share', 'list', 'fetch_doc_share_list', 'read', '查询文档共享列表(含 download / can_delete)', {
|
|
552
|
+
doc_id: ID('文档 ID'),
|
|
553
|
+
}, ['doc_id']),
|
|
554
|
+
spec('share', 'add', 'add_doc_share', 'high-risk-write', '添加文档共享', {
|
|
555
|
+
doc_id: ID('文档 ID'),
|
|
556
|
+
obj_type: S('共享对象类型'),
|
|
557
|
+
share_level: S('共享级别'),
|
|
558
|
+
...SHARE_ID_FIELDS,
|
|
559
|
+
...SHARE_OPTION_FIELDS,
|
|
560
|
+
}, ['doc_id', 'obj_type', 'share_level'], { requiresConfirmation: true }),
|
|
561
|
+
spec('share', 'delete', 'delete_doc_share', 'high-risk-write', '删除文档共享', {
|
|
562
|
+
doc_id: ID('文档 ID'),
|
|
563
|
+
ids: LIST('待删除共享条目 ID 列表'),
|
|
564
|
+
}, ['doc_id', 'ids'], { requiresConfirmation: true }),
|
|
565
|
+
// ── attachment ──────────────────────────────────────────
|
|
566
|
+
spec('attachment', 'upload', 'upload_attachment_to_doc', 'read-with-upload', '向文档上传附件', {
|
|
567
|
+
file_path: FILE('本地文件路径'),
|
|
568
|
+
doc_id: ID('文档 ID'),
|
|
569
|
+
folder_id: ID('文档所属文件夹 ID'),
|
|
570
|
+
}, ['file_path', 'doc_id'], { requiresConfirmation: true }),
|
|
571
|
+
spec('attachment', 'replace', 'replace_document_attachment', 'read-with-upload', '替换文档附件(reUpload,保留附件 ID)', {
|
|
572
|
+
file_path: FILE('本地文件路径'),
|
|
573
|
+
doc_id: ID('文档 ID'),
|
|
574
|
+
attachment_id: ID('被替换的附件 ID'),
|
|
575
|
+
folder_id: ID('文档所属文件夹 ID'),
|
|
576
|
+
}, ['file_path', 'doc_id', 'attachment_id', 'folder_id'], { requiresConfirmation: true }),
|
|
577
|
+
spec('attachment', 'download', 'download_doc_attachment', 'local-file-write', '下载文档附件到本地(写本地磁盘,不改服务端)', {
|
|
578
|
+
attachment_id: ID('附件 ID'),
|
|
579
|
+
doc_id: ID('文档 ID'),
|
|
580
|
+
save_path: FILE('保存路径(完整文件路径或目录)'),
|
|
581
|
+
}, ['attachment_id', 'doc_id']),
|
|
582
|
+
spec('attachment', 'download-as-pdf', 'download_doc_attachment_to_pdf', 'local-file-write', '下载文档附件的 PDF 转换版本(写本地磁盘)', {
|
|
583
|
+
attachment_id: ID('附件 ID'),
|
|
584
|
+
doc_id: ID('文档 ID'),
|
|
585
|
+
save_path: FILE('保存路径(完整文件路径或目录)'),
|
|
586
|
+
}, ['attachment_id', 'doc_id']),
|
|
587
|
+
// ── cover ───────────────────────────────────────────────
|
|
588
|
+
spec('cover', 'upload', 'upload_cover_image', 'read-with-upload', '上传封面图片,仅返回 file_id(不改文档)', {
|
|
589
|
+
file_path: FILE('本地图片路径(.png/.jpg/.jpeg/.gif/.webp/.bmp)'),
|
|
590
|
+
}, ['file_path'], { requiresConfirmation: true }),
|
|
591
|
+
spec('cover', 'set', 'set_doc_cover', 'read-with-upload', '上传图片并设为文档封面', {
|
|
592
|
+
doc_id: ID('文档 ID'),
|
|
593
|
+
file_path: FILE('本地图片路径'),
|
|
594
|
+
}, ['doc_id', 'file_path'], { requiresConfirmation: true }),
|
|
595
|
+
spec('cover', 'remove', 'remove_doc_cover', 'high-risk-write', '移除文档封面', {
|
|
596
|
+
doc_id: ID('文档 ID'),
|
|
597
|
+
}, ['doc_id'], { requiresConfirmation: true }),
|
|
598
|
+
// ── compare ─────────────────────────────────────────────
|
|
599
|
+
spec('compare', 'search-documents', 'search_doc_compare_documents', 'read', '文档比对:检索可比对文档', {
|
|
600
|
+
name: S('文档名称'),
|
|
601
|
+
author: S('作者'),
|
|
602
|
+
creator: S('创建人'),
|
|
603
|
+
create_time: S('创建时间范围'),
|
|
604
|
+
folder: S('所属文件夹'),
|
|
605
|
+
...pageProps(20),
|
|
606
|
+
}),
|
|
607
|
+
spec('compare', 'list-file-objects', 'doc_compare_query_file_objects', 'read', '文档比对:列出文档下可比对的文件对象', {
|
|
608
|
+
doc_id: ID('文档 ID'),
|
|
609
|
+
}, ['doc_id']),
|
|
610
|
+
spec('compare', 'upload-file', 'doc_compare_upload_file', 'read-with-upload', '文档比对:上传本地文件参与比对', {
|
|
611
|
+
file_path: FILE('本地文件路径'),
|
|
612
|
+
}, ['file_path'], {
|
|
613
|
+
requiresConfirmation: true,
|
|
614
|
+
permissions: PERMISSION_COMPARE_UPLOAD,
|
|
615
|
+
}),
|
|
616
|
+
spec('compare', 'submit', 'doc_compare_upload_compared', 'external-artifact', '文档比对:提交左右文件生成比对链接(外部制品)', {
|
|
617
|
+
left_file_id: ID('左侧文件 ID'),
|
|
618
|
+
right_file_id: ID('右侧文件 ID'),
|
|
619
|
+
}, ['left_file_id', 'right_file_id'], { requiresConfirmation: true }),
|
|
620
|
+
// ── system ──────────────────────────────────────────────
|
|
621
|
+
spec('system', 'health', 'check_system_health', 'read', '采知连接口连通性与登录态自检', {}),
|
|
622
|
+
];
|
|
623
|
+
export const CAIZHILIAN_SPECS_BY_NAME = new Map(caizhilianOperationSpecs.map((item) => [item.name, item]));
|