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
|
@@ -1,5 +1,27 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { meetingConfirmationError, meetingPartialError, meetingValidationError } from '../errors.js';
|
|
1
3
|
import { meetingSuccess, SCHEMA_ID } from './types.js';
|
|
2
4
|
import { extractRows, toIdString } from './shared.js';
|
|
5
|
+
const CONTINUATION_TTL_SECONDS = 600;
|
|
6
|
+
function fingerprint(value) {
|
|
7
|
+
return createHash('sha256').update(JSON.stringify(value ?? null)).digest('hex').slice(0, 32);
|
|
8
|
+
}
|
|
9
|
+
function requireConfirm(args, action) {
|
|
10
|
+
if (args.confirm !== true) {
|
|
11
|
+
throw meetingConfirmationError(action, { hint: '重新调用时传入 confirm=true 与 prepare 返回的 continuation' });
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
async function verifyLease(args, action, env) {
|
|
15
|
+
const lease = await env.continuation.verify(args.continuation, action);
|
|
16
|
+
const session = await env.host.getSession();
|
|
17
|
+
if (lease.baseUrl !== session.baseUrl || lease.profile !== session.profile || lease.userId !== session.userId) {
|
|
18
|
+
throw meetingValidationError('context_mismatch', '确认上下文已变化(租户或登录账号不同),请重新执行 prepare');
|
|
19
|
+
}
|
|
20
|
+
return lease;
|
|
21
|
+
}
|
|
22
|
+
function isNetworkError(error) {
|
|
23
|
+
return error instanceof Error && error.type === 'network';
|
|
24
|
+
}
|
|
3
25
|
// ---------------------------------------------------------------------------
|
|
4
26
|
// 签到列表(getMeetingSignInfoList)
|
|
5
27
|
// ---------------------------------------------------------------------------
|
|
@@ -8,7 +30,7 @@ const meetingSignList = {
|
|
|
8
30
|
resource: 'sign',
|
|
9
31
|
method: 'sign.list',
|
|
10
32
|
action: 'meeting.sign.list',
|
|
11
|
-
summary: '查询会议签到记录(getMeetingSignInfoList
|
|
33
|
+
summary: '查询会议签到记录(getMeetingSignInfoList)并输出已签/未签统计;返回的 id 是签到记录 id,供补签/清除使用',
|
|
12
34
|
capability: 'sign',
|
|
13
35
|
risk: 'read',
|
|
14
36
|
inputSchema: {
|
|
@@ -38,4 +60,196 @@ const meetingSignList = {
|
|
|
38
60
|
});
|
|
39
61
|
},
|
|
40
62
|
};
|
|
41
|
-
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
// 签到写操作:补签 / 补签退 / 清除签到记录
|
|
65
|
+
//
|
|
66
|
+
// 源码依据(MeetingSignController + MeetingSignServiceImpl):
|
|
67
|
+
// - signMeetingByHandOne(params, tenant, user):读取 params.id(**签到记录 id**)与
|
|
68
|
+
// params.meetingid,把 signtime 置为当前时间;任一为空或记录不存在时返回 false。
|
|
69
|
+
// - signBackMeetingByHandOne:同上,写 signbackTime。
|
|
70
|
+
// - delSign(params, user):清空 signtime/signbackTime/site/flag 等(复位为未签到)。
|
|
71
|
+
// - controller 自行注入 ip(Utils.getIp(request))与 tenantKey,CLI 不传。
|
|
72
|
+
// - 返回 WeaResult.success(false) 表示"未生效",必须在 CLI 侧识别为失败。
|
|
73
|
+
// - 目标记录回查用 getMeetingSignInfo(GET,@RequestParam id,返回单条 MeetingSign)。
|
|
74
|
+
// ---------------------------------------------------------------------------
|
|
75
|
+
const SIGN_RECORD_PATH = '/api/meeting/sign/getMeetingSignInfo';
|
|
76
|
+
const SIGN_WRITE_SPECS = [
|
|
77
|
+
{
|
|
78
|
+
action: 'mark',
|
|
79
|
+
path: '/api/meeting/sign/signMeetingByHandOne',
|
|
80
|
+
summaryPrepare: '准备补签(单一补录签到):回查签到记录并展示目标人员/会议,生成确认预览,不写入',
|
|
81
|
+
summaryApply: '提交补签(signMeetingByHandOne,body 传参);必须在用户明确确认后调用',
|
|
82
|
+
note: '补签会把该人员的签到时间写为当前时间,属于改写签到事实;仅会议召集人/有权限者应执行,且需用户明确确认。',
|
|
83
|
+
effect: '把签到时间补录为当前时间(若原本已有签到时间会被覆盖)',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
action: 'back',
|
|
87
|
+
path: '/api/meeting/sign/signBackMeetingByHandOne',
|
|
88
|
+
summaryPrepare: '准备补签退(补录签退时间):回查签到记录并展示目标人员/会议,生成确认预览,不写入',
|
|
89
|
+
summaryApply: '提交补签退(signBackMeetingByHandOne,body 传参);必须在用户明确确认后调用',
|
|
90
|
+
note: '补签退会把该人员的签退时间写为当前时间,属于改写签到事实,需用户明确确认。',
|
|
91
|
+
effect: '把签退时间补录为当前时间',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
action: 'clear',
|
|
95
|
+
path: '/api/meeting/sign/delSign',
|
|
96
|
+
summaryPrepare: '准备清除签到记录(复位为未签到):回查签到记录并展示目标人员/会议,生成确认预览,不写入',
|
|
97
|
+
summaryApply: '提交清除签到记录(delSign,body 传参);必须在用户明确确认后调用',
|
|
98
|
+
note: '清除签到记录会复位签到/签退时间与地点,等于该人员回到"未签到"状态;不可通过 CLI 恢复,需用户明确确认。',
|
|
99
|
+
effect: '清空签到时间、签退时间与签到地点,复位为未签到',
|
|
100
|
+
},
|
|
101
|
+
];
|
|
102
|
+
async function resolveSignTarget(args, env, operation) {
|
|
103
|
+
const signRecordId = toIdString(args.id, 'id');
|
|
104
|
+
let response;
|
|
105
|
+
try {
|
|
106
|
+
response = await env.host.request({
|
|
107
|
+
method: 'GET',
|
|
108
|
+
path: SIGN_RECORD_PATH,
|
|
109
|
+
operation,
|
|
110
|
+
query: { id: signRecordId },
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
throw meetingValidationError('sign_record_unreadable', `未能回查签到记录 ${signRecordId}(getMeetingSignInfo 失败):${error instanceof Error ? error.message : String(error)}`);
|
|
115
|
+
}
|
|
116
|
+
const record = response?.data;
|
|
117
|
+
if (!record || typeof record !== 'object') {
|
|
118
|
+
throw meetingValidationError('sign_record_not_found', `未找到签到记录 ${signRecordId}:id 必须是签到记录 id(来自 meeting.sign.list 的 signs[].id),不是会议 id,也不是人员 id`);
|
|
119
|
+
}
|
|
120
|
+
const recordMeetingId = record.mtId !== undefined && record.mtId !== null ? String(record.mtId) : '';
|
|
121
|
+
const passedMeetingId = args.mtId !== undefined && args.mtId !== null ? toIdString(args.mtId, 'mtId') : '';
|
|
122
|
+
if (passedMeetingId && recordMeetingId && passedMeetingId !== recordMeetingId) {
|
|
123
|
+
throw meetingValidationError('sign_record_mismatch', `签到记录 ${signRecordId} 属于会议 ${recordMeetingId},与传入的 mtId=${passedMeetingId} 不一致,请核对后重试`);
|
|
124
|
+
}
|
|
125
|
+
const meetingId = passedMeetingId || recordMeetingId;
|
|
126
|
+
if (!meetingId) {
|
|
127
|
+
throw meetingValidationError('meeting_id_required', `签到记录 ${signRecordId} 未返回会议 id,请显式传入 mtId(会议 id)后重试`);
|
|
128
|
+
}
|
|
129
|
+
return { signRecordId, meetingId, record };
|
|
130
|
+
}
|
|
131
|
+
function signWritePair(spec) {
|
|
132
|
+
const prepareName = `meeting.sign.${spec.action}.prepare`;
|
|
133
|
+
const applyName = `meeting.sign.${spec.action}.apply`;
|
|
134
|
+
const inputProps = {
|
|
135
|
+
id: { ...SCHEMA_ID, description: '签到记录 id(必填,来自 meeting.sign.list 的 signs[].id)' },
|
|
136
|
+
mtId: { ...SCHEMA_ID, description: '会议 id(可选:省略时按签到记录回查;传入则必须与记录一致)' },
|
|
137
|
+
};
|
|
138
|
+
const prepare = {
|
|
139
|
+
name: prepareName,
|
|
140
|
+
resource: 'sign',
|
|
141
|
+
method: `sign.${spec.action}.prepare`,
|
|
142
|
+
action: prepareName,
|
|
143
|
+
summary: spec.summaryPrepare,
|
|
144
|
+
capability: 'sign',
|
|
145
|
+
risk: 'read-before-write',
|
|
146
|
+
requiresConfirmation: true,
|
|
147
|
+
inputSchema: {
|
|
148
|
+
type: 'object',
|
|
149
|
+
additionalProperties: false,
|
|
150
|
+
properties: inputProps,
|
|
151
|
+
required: ['id'],
|
|
152
|
+
},
|
|
153
|
+
handler: async (args, env) => {
|
|
154
|
+
const target = await resolveSignTarget(args, env, prepareName);
|
|
155
|
+
const payload = { id: target.signRecordId, meetingid: target.meetingId };
|
|
156
|
+
const session = await env.host.getSession();
|
|
157
|
+
const token = await env.continuation.issue({
|
|
158
|
+
operation: applyName,
|
|
159
|
+
baseUrl: session.baseUrl,
|
|
160
|
+
profile: session.profile,
|
|
161
|
+
userId: session.userId,
|
|
162
|
+
payload,
|
|
163
|
+
fingerprint: fingerprint(payload),
|
|
164
|
+
}, CONTINUATION_TTL_SECONDS * 1000);
|
|
165
|
+
const record = target.record;
|
|
166
|
+
const alreadySigned = record.signtime !== undefined && record.signtime !== null && record.signtime !== '';
|
|
167
|
+
const alreadyBack = record.signbackTime !== undefined && record.signbackTime !== null && record.signbackTime !== '';
|
|
168
|
+
const warnings = [];
|
|
169
|
+
if (spec.action === 'mark' && alreadySigned) {
|
|
170
|
+
warnings.push(`该人员已有签到时间(${record.signtime}),补签会覆盖为当前时间`);
|
|
171
|
+
}
|
|
172
|
+
if (spec.action === 'back' && !alreadySigned) {
|
|
173
|
+
warnings.push('该人员尚未签到,先补签退可能不符合业务预期');
|
|
174
|
+
}
|
|
175
|
+
if (spec.action === 'back' && alreadyBack) {
|
|
176
|
+
warnings.push(`该人员已有签退时间(${record.signbackTime}),补签退会覆盖为当前时间`);
|
|
177
|
+
}
|
|
178
|
+
if (spec.action === 'clear' && !alreadySigned && !alreadyBack) {
|
|
179
|
+
warnings.push('该人员当前没有签到/签退记录,清除操作不会改变数据');
|
|
180
|
+
}
|
|
181
|
+
return meetingSuccess(prepareName, {
|
|
182
|
+
status: 'AWAITING_CONFIRMATION',
|
|
183
|
+
preview: {
|
|
184
|
+
action: spec.action,
|
|
185
|
+
signRecordId: target.signRecordId,
|
|
186
|
+
meetingId: target.meetingId,
|
|
187
|
+
userid: record.userid !== undefined && record.userid !== null ? String(record.userid) : undefined,
|
|
188
|
+
current: { signtime: record.signtime ?? null, signbackTime: record.signbackTime ?? null, flag: record.flag ?? null },
|
|
189
|
+
effect: spec.effect,
|
|
190
|
+
warnings,
|
|
191
|
+
note: spec.note,
|
|
192
|
+
},
|
|
193
|
+
continuation: token,
|
|
194
|
+
expiresInSeconds: CONTINUATION_TTL_SECONDS,
|
|
195
|
+
});
|
|
196
|
+
},
|
|
197
|
+
};
|
|
198
|
+
const apply = {
|
|
199
|
+
name: applyName,
|
|
200
|
+
resource: 'sign',
|
|
201
|
+
method: `sign.${spec.action}.apply`,
|
|
202
|
+
action: applyName,
|
|
203
|
+
summary: spec.summaryApply,
|
|
204
|
+
capability: 'sign',
|
|
205
|
+
risk: 'high-risk-write',
|
|
206
|
+
requiresConfirmation: true,
|
|
207
|
+
inputSchema: {
|
|
208
|
+
type: 'object',
|
|
209
|
+
additionalProperties: false,
|
|
210
|
+
properties: {
|
|
211
|
+
confirm: { const: true },
|
|
212
|
+
continuation: { type: 'string', minLength: 1 },
|
|
213
|
+
...inputProps,
|
|
214
|
+
},
|
|
215
|
+
required: ['confirm', 'continuation', 'id'],
|
|
216
|
+
},
|
|
217
|
+
handler: async (args, env) => {
|
|
218
|
+
requireConfirm(args, applyName);
|
|
219
|
+
const lease = await verifyLease(args, applyName, env);
|
|
220
|
+
const target = await resolveSignTarget(args, env, applyName);
|
|
221
|
+
const payload = { id: target.signRecordId, meetingid: target.meetingId };
|
|
222
|
+
if (lease.fingerprint !== fingerprint(payload)) {
|
|
223
|
+
throw meetingValidationError('target_changed', '签到记录或会议与 prepare 时的快照不一致,请重新执行 prepare');
|
|
224
|
+
}
|
|
225
|
+
let response;
|
|
226
|
+
try {
|
|
227
|
+
response = await env.host.request({
|
|
228
|
+
method: 'POST',
|
|
229
|
+
path: spec.path,
|
|
230
|
+
operation: applyName,
|
|
231
|
+
// controller 自行注入 ip 与 tenantKey;此处只传业务参数。
|
|
232
|
+
body: payload,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
catch (error) {
|
|
236
|
+
if (isNetworkError(error)) {
|
|
237
|
+
throw meetingPartialError(`${spec.action} 请求发送后连接中断,是否已生效不确定,禁止自动重试,请用 meeting.sign.list 回查后再决定`, { attempted: payload }, { stage: `sign.${spec.action}` });
|
|
238
|
+
}
|
|
239
|
+
throw error;
|
|
240
|
+
}
|
|
241
|
+
// 源码:接口返回 WeaResult.success(false) 表示未生效(记录不存在/参数缺失),
|
|
242
|
+
// 业务包装层不会报错,必须在此识别为失败,避免向用户谎报成功。
|
|
243
|
+
const applied = response?.data;
|
|
244
|
+
if (applied === false) {
|
|
245
|
+
throw meetingValidationError('sign_not_applied', `服务端未生效(${spec.action} 返回 false):签到记录可能已被删除或参数不匹配,请先用 meeting.sign.list 复查`);
|
|
246
|
+
}
|
|
247
|
+
return meetingSuccess(applyName, { status: 'COMPLETE', action: spec.action, ...payload });
|
|
248
|
+
},
|
|
249
|
+
};
|
|
250
|
+
return [prepare, apply];
|
|
251
|
+
}
|
|
252
|
+
export const meetingSignOperations = [
|
|
253
|
+
meetingSignList,
|
|
254
|
+
...SIGN_WRITE_SPECS.flatMap((spec) => signWritePair(spec)),
|
|
255
|
+
];
|
|
@@ -77,7 +77,8 @@ export const WORKFLOW_ENDPOINTS = {
|
|
|
77
77
|
FORWARD_REQUEST: '/api/workflow/core/paService/v1/forward',
|
|
78
78
|
CC_REQUEST: '/api/workflow/core/paService/v1/manualCC',
|
|
79
79
|
ADD_REVIEW_REQUEST: '/api/workflow/core/paService/v1/addSignOperator',
|
|
80
|
-
|
|
80
|
+
/** 批量提交(2026-09-20 用户指定换成前端同款端点;旧路径 /api/workflow/core/paService/v1/batchSubmit 已停用) */
|
|
81
|
+
BATCH_SUBMIT: '/api/workflow/core/flow/batchSubmit',
|
|
81
82
|
FORCE_DRAW_BACK: '/api/workflow/core/paService/v1/doForceDrawBack',
|
|
82
83
|
FORCE_OVER: '/api/workflow/core/paService/v1/doForceOver',
|
|
83
84
|
CONSUL: '/api/workflow/core/paService/v1/consul',
|
|
@@ -88,7 +88,8 @@ export const CLARIFICATION_SUBTYPE = 'needs_clarification';
|
|
|
88
88
|
* 底层解析函数(`read.ts` 的 `resolveTerm` / `resolveRequestLevel` / `resolveFilterFieldItem` /
|
|
89
89
|
* `resolveFieldValues`)无法直接产出信封,故仍以错误形式向上抛;**调度层(`operations.ts`)会把它
|
|
90
90
|
* 转成成功信封**:`ok:true` + `data.type=workflowClarification` + `data.status=NEEDS_CLARIFICATION`。
|
|
91
|
-
*
|
|
91
|
+
* **查询侧与发起侧共用这一条通道**(发起侧由 `form.ts` 的 `resolveCreateWorkflow` 抛出,
|
|
92
|
+
* `clarificationType` 同样是 `workflow`),于是「名称→ID 拿不准」在两个方向上表现完全一致。
|
|
92
93
|
*
|
|
93
94
|
* 形态来源(对齐 V11.3):`e10_workflow.py:10356-10400`(工作流名 0 命中 / 多命中分支)与
|
|
94
95
|
* `resolve_system_name_condition`(L8262)都返回 `success:true` + `needClarification:true`
|
|
@@ -98,14 +99,19 @@ export const CLARIFICATION_SUBTYPE = 'needs_clarification';
|
|
|
98
99
|
* 覆盖的两种情形(与 V11.3 一致):
|
|
99
100
|
* 1. **0 命中** —— 名称在当前环境没有对应对象(`candidates` 为空);
|
|
100
101
|
* 2. **多命中且没有唯一全名精确匹配** —— 列出候选让用户挑;有唯一全名精确匹配时**不澄清**,直接用。
|
|
102
|
+
*
|
|
103
|
+
* `extra` 供调用方补充**可判别的原因**(如 `clarificationReason: 'workflow_not_exist' | 'no_create_right'`),
|
|
104
|
+
* 由 `operations.ts` 的 `clarificationEnvelope` 原样带到信封上——不加这个字段的话,
|
|
105
|
+
* 「ID 不存在」与「ID 存在但没有发起权限」在模型眼里长得一模一样,会把后者说成前者。
|
|
101
106
|
*/
|
|
102
|
-
export function workflowClarificationError(clarificationType, keyword, question, candidates = []) {
|
|
107
|
+
export function workflowClarificationError(clarificationType, keyword, question, candidates = [], extra = {}) {
|
|
103
108
|
return new WorkflowCliError('validation', CLARIFICATION_SUBTYPE, question, {
|
|
104
109
|
details: {
|
|
105
110
|
clarificationType,
|
|
106
111
|
clarificationKeyword: keyword,
|
|
107
112
|
clarificationQuestion: question,
|
|
108
113
|
candidates,
|
|
114
|
+
...extra,
|
|
109
115
|
},
|
|
110
116
|
exitCode: ExitCode.UsageError,
|
|
111
117
|
});
|
|
@@ -200,9 +200,12 @@ export function createWorkflowHost(ctx, dependencies = {}) {
|
|
|
200
200
|
details: { status: response.status },
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
|
-
|
|
204
|
-
if (
|
|
205
|
-
|
|
203
|
+
// `tolerateBusinessError` 的调用方要的是**响应体里的结论**,不能过滤(见 WorkflowRequest 的说明)。
|
|
204
|
+
if (request.tolerateBusinessError !== true) {
|
|
205
|
+
const businessError = extractApiBusinessError(response.value);
|
|
206
|
+
if (businessError) {
|
|
207
|
+
throw workflowApiError('business_error', `OA 接口返回错误,本次操作已停止。接口提示:${businessError}。如果您无法处理,请联系系统管理员。`, { details: { endpointKey: operation, businessError } });
|
|
208
|
+
}
|
|
206
209
|
}
|
|
207
210
|
return { status: response.status, value: response.value };
|
|
208
211
|
}
|