weaver-work-cli 0.1.44 → 0.1.45
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 +9 -5
- package/dist/chunks/{archive-P6TBQGKL.js → archive-ZQ4A4TV6.js} +388 -44
- package/dist/chunks/{archive-oa-7TQ2NXOH.js → archive-oa-BBDP7AKJ.js} +2 -2
- package/dist/chunks/{asset-3ELRG37G.js → asset-ZOJVBWZH.js} +2 -2
- package/dist/chunks/{asset-idle-WIGMUFMD.js → asset-idle-XGB5IPGT.js} +2 -2
- package/dist/chunks/{attachment-content-E3276UOV.js → attachment-content-CE3GMWTS.js} +3 -3
- package/dist/chunks/{blog-C5NMZAAC.js → blog-QSHLZSFW.js} +2 -2
- package/dist/chunks/caizhilian-KCQYFH72.js +204 -0
- package/dist/chunks/{calendar-FI2WNSBO.js → calendar-DLGMRJQA.js} +2 -2
- package/dist/chunks/{chunk-CWYGFU5B.js → chunk-3WBIQLMB.js} +2 -2
- package/dist/chunks/{chunk-PUQS5MWL.js → chunk-3YV7PKRL.js} +1 -1
- package/dist/chunks/{chunk-PC7VKEB5.js → chunk-3ZMAQQ3W.js} +161 -33
- package/dist/chunks/{chunk-GM6J7Q4B.js → chunk-4EXOIQDI.js} +40 -10
- package/dist/chunks/{chunk-ETNJSKMM.js → chunk-6NXT4ICB.js} +148 -21
- package/dist/chunks/chunk-762M5XJS.js +215 -0
- package/dist/chunks/{chunk-GAMZLAG2.js → chunk-77YP6I52.js} +1 -1
- package/dist/chunks/{chunk-WSF4NNMR.js → chunk-CZNZKOHR.js} +2 -2
- package/dist/chunks/{chunk-Z7VYWPZV.js → chunk-DGMYACGJ.js} +1 -1
- package/dist/chunks/{chunk-TA7FXXJD.js → chunk-DLY5GUXX.js} +1 -1
- package/dist/chunks/{chunk-BCVYBYYT.js → chunk-GR76ZDDX.js} +2 -2
- package/dist/chunks/{chunk-GRDRG6HP.js → chunk-HFXK54M4.js} +2 -2
- package/dist/chunks/{chunk-XNIK66I4.js → chunk-JB34OE7R.js} +790 -77
- package/dist/chunks/{chunk-QVSWRLLU.js → chunk-JWWTI63L.js} +55 -5
- package/dist/chunks/{chunk-FRZKBMSW.js → chunk-LGKWL4OH.js} +176 -39
- package/dist/chunks/{chunk-XHK4MDR5.js → chunk-LRCPNDZA.js} +38 -6
- package/dist/chunks/{chunk-OF4S23UB.js → chunk-LXFVWZLM.js} +4 -4
- package/dist/chunks/{chunk-D4ADSZ7H.js → chunk-O6CMPO65.js} +24 -1
- package/dist/chunks/{chunk-N4M2DDFE.js → chunk-OAE3AZBQ.js} +11 -11
- package/dist/chunks/chunk-P5GQRWDC.js +60 -0
- package/dist/chunks/{caizhilian-5XSM2DFP.js → chunk-PGO4ILMQ.js} +41 -521
- package/dist/chunks/{chunk-HIT4Y6OI.js → chunk-T4MWQAQB.js} +7 -5
- package/dist/chunks/{chunk-F4E4EM35.js → chunk-TGAGQV4I.js} +2 -2
- package/dist/chunks/{chunk-UFIT2UU3.js → chunk-U6R6FZHD.js} +168 -14
- package/dist/chunks/{chunk-FAZTGX7S.js → chunk-VIMCY4DI.js} +5 -5
- package/dist/chunks/chunk-VRPH24IC.js +76 -0
- package/dist/chunks/{chunk-3YBDYOC4.js → chunk-YIKSL36S.js} +2 -2
- package/dist/chunks/{chunk-IAZ3UPY6.js → chunk-Z6UUBY37.js} +2 -2
- package/dist/chunks/{conflict-ARLSZJ6V.js → conflict-IYJETSGT.js} +2 -2
- package/dist/chunks/continuation-GW6PRWK3.js +12 -0
- package/dist/chunks/{contract-DNIIW5VJ.js → contract-3QLAGYQL.js} +5793 -4591
- package/dist/chunks/{cowork-GMLRGVIW.js → cowork-3ACICHDQ.js} +2 -2
- package/dist/chunks/{create-flow-J22BO65E.js → create-flow-7JLC7UID.js} +6 -6
- package/dist/chunks/{ebuilder-form-ANV2FHYV.js → ebuilder-form-GWDTKEI2.js} +5 -5
- package/dist/chunks/{ehr-GSTGAIY3.js → ehr-MYRDCHZ4.js} +121 -49
- package/dist/chunks/{employee-22BGJ3QS.js → employee-NOHNXC46.js} +1 -1
- package/dist/chunks/{env-BX3VRFS7.js → env-3MBHAWBL.js} +2 -2
- package/dist/chunks/{esb-ATAIASX2.js → esb-4BQHNP5C.js} +4 -4
- package/dist/chunks/{factory-PETTFME6.js → factory-TZEVU4DU.js} +1 -1
- package/dist/chunks/{fna-YEKBSFSX.js → fna-ZVB2IILI.js} +2 -2
- package/dist/chunks/{group-chat-BFVXAYFX.js → group-chat-KL3HFKRM.js} +3 -3
- package/dist/chunks/{host-WIKN2EJ5.js → host-3TNBMDTR.js} +3 -3
- package/dist/chunks/host-7NTIBSPK.js +25 -0
- package/dist/chunks/{host-SZGV4UNT.js → host-7OWWPLM4.js} +3 -3
- package/dist/chunks/{host-HRBXEPDQ.js → host-G3VU7SDW.js} +3 -3
- package/dist/chunks/{host-LR55CTHP.js → host-M4XP5URR.js} +3 -3
- package/dist/chunks/{host-SUOY6VYQ.js → host-TUOIOEMC.js} +3 -3
- package/dist/chunks/{hrm-NRDO4W5G.js → hrm-UNKCCCGP.js} +5 -5
- package/dist/chunks/{im-IQ2HN23S.js → im-NJB7ZYMH.js} +3 -3
- package/dist/chunks/{invoice-MNRW76PP.js → invoice-OQP3TMKQ.js} +3 -3
- package/dist/chunks/{jiuchuanhui-DTRBAX4N.js → jiuchuanhui-ASFZBMPU.js} +2 -2
- package/dist/chunks/{lazy-dispatch-ZVWAI25B.js → lazy-dispatch-UH6HGK2I.js} +4 -4
- package/dist/chunks/{mail-ZVAUXOJA.js → mail-M3HJF5ER.js} +2 -2
- package/dist/chunks/{meeting-FEVPZ67S.js → meeting-C67EHQ4Z.js} +12 -12
- package/dist/chunks/{okr-SDH3E5RA.js → okr-EVX7FB5G.js} +2 -2
- package/dist/chunks/operations-J7PUIVWZ.js +15 -0
- package/dist/chunks/{plan-E35JFDI7.js → plan-2QJQEPBO.js} +2 -2
- package/dist/chunks/{project-73QXBAB2.js → project-XELELW2T.js} +2 -2
- package/dist/chunks/{reception-UWZVACBN.js → reception-5WITA44R.js} +2 -2
- package/dist/chunks/{recruit-stage-4MAOCKFY.js → recruit-stage-AHY5QAMF.js} +450 -117
- package/dist/chunks/{registry-JDUS4E7D.js → registry-AQVGHUM6.js} +2 -2
- package/dist/chunks/{registry-KNKSCJNT.js → registry-QJCZ2GVG.js} +4 -4
- package/dist/chunks/{registry-PO7SI256.js → registry-VWXWPVAG.js} +2 -2
- package/dist/chunks/{registry-IM5G23LS.js → registry-XPWPGHYE.js} +10 -10
- package/dist/chunks/{room-recommend-H7KLXA5R.js → room-recommend-CNWE5WQK.js} +6 -4
- package/dist/chunks/{schedule-ESZIBAUO.js → schedule-YYNYBQIE.js} +4 -4
- package/dist/chunks/{workflow-CWJFJLQU.js → workflow-BSYT5TGL.js} +6 -4
- package/dist/index.js +30 -30
- package/dist/internal/e10/auth/commands.js +32 -0
- package/dist/internal/e10/auth/error-log.js +156 -26
- package/dist/internal/e10/auth/xiaoe.js +176 -13
- package/dist/internal/e10/context.js +12 -1
- package/dist/shortcuts/archive/operations/borrow-list.js +105 -14
- package/dist/shortcuts/archive/operations/flow-url.js +182 -22
- package/dist/shortcuts/archive/operations/getPageUrl.js +75 -0
- package/dist/shortcuts/archive/operations/prelib.js +33 -4
- package/dist/shortcuts/archive/operations/shared.js +52 -0
- package/dist/shortcuts/contract/host.js +111 -4
- package/dist/shortcuts/contract/index.js +19 -0
- package/dist/shortcuts/contract/manifest.js +125 -0
- package/dist/shortcuts/contract/ooxml/clause-insert.js +249 -0
- package/dist/shortcuts/contract/operations/clause-insert.js +56 -0
- package/dist/shortcuts/contract/operations/customer.js +192 -0
- package/dist/shortcuts/contract/operations/file-download.js +75 -0
- package/dist/shortcuts/contract/operations/flow.js +44 -2
- package/dist/shortcuts/contract/operations/form-info.js +162 -62
- package/dist/shortcuts/contract/operations/registry.js +8 -0
- package/dist/shortcuts/contract/operations/review.js +116 -1
- package/dist/shortcuts/contract/operations/summary.js +177 -0
- package/dist/shortcuts/contract/operations/upload.js +64 -4
- package/dist/shortcuts/contract/upload-cache.js +104 -0
- package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +4 -2
- package/dist/shortcuts/ehr/operations/recruit-position.js +136 -35
- package/dist/shortcuts/ehr/operations/recruit-write.js +17 -18
- package/dist/shortcuts/ehr/operations/recruit.js +17 -5
- package/dist/shortcuts/hrm/operations/employee.js +29 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +182 -58
- package/dist/shortcuts/meeting/operations/eb/draft-memory.js +56 -0
- package/dist/shortcuts/meeting/operations/eb/factory.js +58 -3
- package/dist/shortcuts/meeting/operations/eb/person-cache.js +2 -2
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +47 -5
- package/dist/shortcuts/meeting/operations/invitation-publish.js +132 -0
- package/dist/shortcuts/meeting/operations/registry.js +2 -0
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +86 -16
- package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +6 -4
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +208 -56
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +42 -16
- package/dist/shortcuts/recruit-stage/shared.js +161 -18
- package/dist/shortcuts/workflow/index.js +2 -0
- package/dist/shortcuts/workflow/operations/read.js +8 -3
- package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupRules.js +92 -5
- package/dist/shortcuts/workflow/operations/todoSmartConvert/priorityExpr.js +509 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoListRows.js +22 -1
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +32 -6
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +57 -11
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +165 -52
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +57 -14
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +44 -18
- package/docs/contract.md +1 -0
- package/docs/e10-auth.md +4 -2
- package/docs/todo-smart-convert/data-contract.md +7 -0
- package/package.json +1 -1
- package/skill-template/domains/jinchengda.md +2 -0
- package/skills/weaver-e10-jinchengda/SKILL.md +198 -205
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +759 -0
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +250 -0
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +146 -7
- package/skills/weaver-e10-jinchengda/references/contract-clause-insert.md +178 -0
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +75 -0
- package/skills/weaver-e10-jinchengda/references/contract-compare-report-template.html +137 -0
- package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +163 -0
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +52 -3
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +92 -5
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +602 -0
- package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +209 -0
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +126 -0
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +312 -0
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +555 -0
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +47 -12
- package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +469 -0
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +154 -1
- package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +224 -0
- package/skills/weaver-e10-jinchengda/references/orchestration.md +355 -0
- package/skills/weaver-e10-jucailin/references/recruit-create.md +5 -3
- package/skills/weaver-e10-jucailin/references/recruit-write.md +2 -2
- package/skills/weaver-e10-meeting/SKILL.md +57 -9
- package/skills/weaver-e10-recruit-stage/SKILL.md +11 -6
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +10 -2
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +3 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +13 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +19 -18
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +27 -14
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +7 -1
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +4 -2
- package/skills/weaver-e10-wenshuding/SKILL.md +17 -7
- package/skills/weaver-e10-wenshuding/references/archive-borrow-list.md +28 -0
- package/skills/weaver-e10-wenshuding/references/archive-flow.md +24 -8
- package/skills/weaver-e10-wenshuding/references/archive-prelib-list.md +3 -0
- package/skills/weaver-e10-wenshuding/references/archive-prelib-open.md +4 -0
- package/skills/weaver-e10-wenshuding/references/archive-search.md +3 -1
- package/skills/weaver-e10-workflow/SKILL.md +19 -17
- package/skills/weaver-e10-workflow/aigroup/default.json +10 -6
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +36 -3
- package/skills/weaver-e10-workflow/references/workflow-memory.md +1 -1
- package/skills/weaver-e10-workflow/references/workflow-query.md +9 -6
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +152 -1
- package/skills/weaver-e10-yimiaoban/SKILL.md +17 -5
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +30 -0
- package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +72 -0
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +7 -7
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 邀请函 → E10 文档(2026-11-06 用户需求)。
|
|
3
|
+
*
|
|
4
|
+
* 链路:`meeting.invitation.render`(模板填充,已有)→ `caizhilian.document.create-office`
|
|
5
|
+
* (上传 Office 文件并直接生成文档,源 create_office_document)→ 返回 `docId`。
|
|
6
|
+
*
|
|
7
|
+
* 拿到 docId 后由建会链路写入表单「邀请函」字段(Document 组件):
|
|
8
|
+
* `extraFields: { "邀请函": [{ id: docId, name: 文档名 }] }`
|
|
9
|
+
* (字段值格式 2026-11-06 真机实测:键用**字段 id** 1334688905776169004,值 `[{id,name}]`;
|
|
10
|
+
* 传 dataKey `yqh` 服务端认不到;隐藏字段同样能写入。)
|
|
11
|
+
*/
|
|
12
|
+
import { win32 } from 'node:path';
|
|
13
|
+
import { meetingValidationError } from '../errors.js';
|
|
14
|
+
import { meetingSuccess, SCHEMA_ID } from './types.js';
|
|
15
|
+
/** 邀请函默认落库目录(2026-11-06 用户指定:文档中心目录 300,公共文档)。 */
|
|
16
|
+
const DEFAULT_FOLDER_ID = '300';
|
|
17
|
+
const DEFAULT_FOLDER_TYPE = 'company';
|
|
18
|
+
function normalizeWinPath(path) {
|
|
19
|
+
// ⛔ create-office 的 apply 会拿 file_path 字符串和 prepare 时的指纹**逐字**比对,
|
|
20
|
+
// 斜杠方向不同就报「参数 file_path 与 prepare 时不一致」(2026-11-06 真机踩到)。
|
|
21
|
+
// 统一成 Windows 反斜杠绝对路径。
|
|
22
|
+
return win32.normalize(path);
|
|
23
|
+
}
|
|
24
|
+
const meetingInvitationPublish = {
|
|
25
|
+
name: 'meeting.invitation.publish',
|
|
26
|
+
resource: 'invitation',
|
|
27
|
+
method: 'publish',
|
|
28
|
+
action: 'meeting.invitation.publish',
|
|
29
|
+
summary: '生成邀请函并**发布成 E10 文档**:模板填充 → 上传到文档中心(默认目录 300)→ 返回 docId。'
|
|
30
|
+
+ '拿到后把 `extraFields: {"邀请函":[{"id":docId,"name":文档名}]}` 传给建会接口即可写进表单。'
|
|
31
|
+
+ '会真实创建文档(需 confirm: true)。',
|
|
32
|
+
capability: 'invitation',
|
|
33
|
+
risk: 'high-risk-write',
|
|
34
|
+
inputSchema: {
|
|
35
|
+
type: 'object',
|
|
36
|
+
additionalProperties: false,
|
|
37
|
+
properties: {
|
|
38
|
+
mtId: { ...SCHEMA_ID, description: '会议 id(与下面字段二选一):有则按真实会议数据生成' },
|
|
39
|
+
mt_name: { type: 'string', description: '会议名称(无 mtId 时必填)' },
|
|
40
|
+
begin_datetime: { type: 'string', description: '开始时间 yyyy-MM-dd HH:mm' },
|
|
41
|
+
end_datetime: { type: 'string', description: '结束时间 yyyy-MM-dd HH:mm' },
|
|
42
|
+
address: { type: 'string', description: '会议地点(名称)' },
|
|
43
|
+
hrm_members: { type: 'string', description: '参会人姓名(逗号/顿号分隔)' },
|
|
44
|
+
mt_desc: { type: 'string', description: '会议内容' },
|
|
45
|
+
org_members: { type: 'string', description: '落款单位' },
|
|
46
|
+
caller: { type: 'string', description: '召集人' },
|
|
47
|
+
contacter: { type: 'string', description: '联系人' },
|
|
48
|
+
total_member: { type: 'string', description: '参会人数' },
|
|
49
|
+
extra: {
|
|
50
|
+
type: 'object',
|
|
51
|
+
additionalProperties: { type: 'string' },
|
|
52
|
+
description: '自定义字段(如 guest_org=客户单位;agenda=议程)',
|
|
53
|
+
},
|
|
54
|
+
doc_name: { type: 'string', description: '文档名,默认「邀请函-<会议名>-<日期>」' },
|
|
55
|
+
folder_id: { type: 'string', description: `文档中心目录 id,默认 ${DEFAULT_FOLDER_ID}` },
|
|
56
|
+
folder_type: { type: 'string', enum: ['company', 'privy', 'sys'], description: `目录类型,默认 ${DEFAULT_FOLDER_TYPE}` },
|
|
57
|
+
confirm: { type: 'boolean', description: '必须显式传 true —— 会真实创建一篇文档' },
|
|
58
|
+
},
|
|
59
|
+
required: ['confirm'],
|
|
60
|
+
},
|
|
61
|
+
handler: async (args, env) => {
|
|
62
|
+
if (args.confirm !== true) {
|
|
63
|
+
throw meetingValidationError('confirm_required', '会真实创建文档,必须显式传 confirm: true(可先不带 confirm 调 meeting.invitation.render 预览正文)');
|
|
64
|
+
}
|
|
65
|
+
const { getMeetingOperation } = await import('./registry.js');
|
|
66
|
+
const render = getMeetingOperation('meeting.invitation.render');
|
|
67
|
+
const rendered = await render.handler({
|
|
68
|
+
...(args.mtId !== undefined ? { mtId: args.mtId } : {}),
|
|
69
|
+
...(args.mt_name !== undefined ? { mt_name: args.mt_name } : {}),
|
|
70
|
+
...(args.begin_datetime !== undefined ? { begin_datetime: args.begin_datetime } : {}),
|
|
71
|
+
...(args.end_datetime !== undefined ? { end_datetime: args.end_datetime } : {}),
|
|
72
|
+
...(args.address !== undefined ? { address: args.address } : {}),
|
|
73
|
+
...(args.hrm_members !== undefined ? { hrm_members: args.hrm_members } : {}),
|
|
74
|
+
...(args.mt_desc !== undefined ? { mt_desc: args.mt_desc } : {}),
|
|
75
|
+
...(args.org_members !== undefined ? { org_members: args.org_members } : {}),
|
|
76
|
+
...(args.caller !== undefined ? { caller: args.caller } : {}),
|
|
77
|
+
...(args.contacter !== undefined ? { contacter: args.contacter } : {}),
|
|
78
|
+
...(args.total_member !== undefined ? { total_member: args.total_member } : {}),
|
|
79
|
+
...(args.extra !== undefined ? { extra: args.extra } : {}),
|
|
80
|
+
}, env);
|
|
81
|
+
const filePath = String(rendered?.data?.filePath ?? '').trim();
|
|
82
|
+
if (!filePath)
|
|
83
|
+
throw meetingValidationError('render_failed', '邀请函 docx 未生成(render 未返回 filePath)');
|
|
84
|
+
const session = await env.host.getSession();
|
|
85
|
+
const authorId = String(session?.userId ?? '').trim();
|
|
86
|
+
if (!authorId)
|
|
87
|
+
throw meetingValidationError('session_missing', '拿不到当前登录人,无法创建文档');
|
|
88
|
+
const docName = String(args.doc_name ?? '').trim()
|
|
89
|
+
|| String(rendered?.data?.fileName ?? '').replace(/\.docx$/i, '')
|
|
90
|
+
|| '邀请函';
|
|
91
|
+
const caizhilianArgs = {
|
|
92
|
+
file_path: normalizeWinPath(filePath),
|
|
93
|
+
name: docName,
|
|
94
|
+
folder_id: String(args.folder_id ?? DEFAULT_FOLDER_ID),
|
|
95
|
+
folder_type: String(args.folder_type ?? DEFAULT_FOLDER_TYPE),
|
|
96
|
+
author_id: authorId,
|
|
97
|
+
};
|
|
98
|
+
const { executeCaizhilianOperation } = await import('../../caizhilian/operations.js');
|
|
99
|
+
const { createCaizhilianHost } = await import('../../caizhilian/host.js');
|
|
100
|
+
const { createCaizhilianContinuationSigner } = await import('../../caizhilian/continuation.js');
|
|
101
|
+
const caizhilianEnv = {
|
|
102
|
+
ctx: env.ctx,
|
|
103
|
+
host: createCaizhilianHost(env.ctx),
|
|
104
|
+
continuation: createCaizhilianContinuationSigner(env.ctx),
|
|
105
|
+
};
|
|
106
|
+
// prepare 只校验/预览;apply 用**完全相同**的入参 + continuation 才不会被判「目标变了」
|
|
107
|
+
const prepared = await executeCaizhilianOperation('caizhilian.document.create-office.prepare', caizhilianArgs, caizhilianEnv);
|
|
108
|
+
const continuation = String(prepared?.data?.continuation ?? '');
|
|
109
|
+
if (!continuation) {
|
|
110
|
+
throw meetingValidationError('publish_prepare_failed', 'create-office.prepare 未返回 continuation');
|
|
111
|
+
}
|
|
112
|
+
const applied = await executeCaizhilianOperation('caizhilian.document.create-office.apply', { ...caizhilianArgs, continuation, confirm: true }, caizhilianEnv);
|
|
113
|
+
const docId = String(applied?.data?.doc_id ?? '').trim();
|
|
114
|
+
if (!docId)
|
|
115
|
+
throw meetingValidationError('publish_failed', 'create-office.apply 未返回 doc_id');
|
|
116
|
+
return meetingSuccess('meeting.invitation.publish', {
|
|
117
|
+
docId,
|
|
118
|
+
docName,
|
|
119
|
+
filePath,
|
|
120
|
+
folderId: caizhilianArgs.folder_id,
|
|
121
|
+
folderType: caizhilianArgs.folder_type,
|
|
122
|
+
// 直接可用的表单字段值(建会时放进 extraFields.邀请函)
|
|
123
|
+
formFieldValue: [{ id: docId, name: docName }],
|
|
124
|
+
// 对话里要贴正文,别只给 id
|
|
125
|
+
text: rendered?.data?.text ?? '',
|
|
126
|
+
pendingFields: rendered?.data?.pendingFields ?? [],
|
|
127
|
+
}, {
|
|
128
|
+
...(Array.isArray(applied?.warnings) && applied.warnings.length > 0 ? { warnings: applied.warnings } : {}),
|
|
129
|
+
});
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
export const meetingInvitationPublishOperations = [meetingInvitationPublish];
|
|
@@ -17,6 +17,7 @@ import { meetingMinuteFromGroupChatOperations } from './from-group-chat.js';
|
|
|
17
17
|
import { meetingDecisionNotifyOperations } from './task-notify.js';
|
|
18
18
|
import { meetingPipelineOperations } from './pipeline.js';
|
|
19
19
|
import { meetingInvitationOperations } from './invitation.js';
|
|
20
|
+
import { meetingInvitationPublishOperations } from './invitation-publish.js';
|
|
20
21
|
import { meetingQrOperations } from './qrcode.js';
|
|
21
22
|
import { meetingSummaryOperations } from './summary.js';
|
|
22
23
|
import { meetingFormFieldOperations } from './form-fields.js';
|
|
@@ -42,6 +43,7 @@ function buildRegistry() {
|
|
|
42
43
|
...meetingDecisionNotifyOperations,
|
|
43
44
|
...meetingPipelineOperations,
|
|
44
45
|
...meetingInvitationOperations,
|
|
46
|
+
...meetingInvitationPublishOperations,
|
|
45
47
|
...meetingQrOperations,
|
|
46
48
|
...meetingSummaryOperations,
|
|
47
49
|
...meetingFormFieldOperations,
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
import { randomUUID } from 'node:crypto';
|
|
23
23
|
import { rsSuccess, schemaOf } from './types.js';
|
|
24
24
|
import { rsFail, rsValidationError, rsConfirmationError } from '../errors.js';
|
|
25
|
-
import { objIdOf, formIdOf, getFormLayout, getFormLayoutMeta, saveFormData, runEsb, getFormButtons, resolvePersonId, getDsOptions,
|
|
25
|
+
import { objIdOf, formIdOf, getFormLayout, getFormLayoutMeta, saveFormData, runEsb, getFormButtons, resolvePersonId, getDsOptions, findMenuNode, resolveCurrentUser, buildCardUrl, buildListUrl, talentLinkExtra, pickSaveButtonActions, computeRequiredHint, randHex32, dsOptionsSnapshot, restoreDsOptions, invalidateEnvCache, verifySubmitted, expectedFields, probeCreatePermission, } from '../shared.js';
|
|
26
26
|
// 面试计划表单字段 dataKey(缓存 fields 里取)。
|
|
27
27
|
// 注意:digital_id 不放入此列表——它只在「面试方式含 AI」时才是必填,
|
|
28
28
|
// 放进来会让未部署数字人的环境连非 AI 面试都建不了(单独按需校验)。
|
|
@@ -243,7 +243,7 @@ function planBrief(items) {
|
|
|
243
243
|
return (items || []).map((x) => x.name + (x.position ? '(岗位:' + x.position + ')' : '') + ' [id=' + x.id + ']').join(';');
|
|
244
244
|
}
|
|
245
245
|
async function buildPlan(opts) {
|
|
246
|
-
const { ctx, talentId, positionId, interviewer, type, session, start, end, email, mobile, aiPlan } = opts;
|
|
246
|
+
const { ctx, talentId, positionId, interviewer, type, session, start, end, email, mobile, aiPlan, rounds } = opts;
|
|
247
247
|
const { host, appId, cache } = ctx;
|
|
248
248
|
const objId = objIdOf(cache, 'interview_plan');
|
|
249
249
|
const formId = formIdOf(cache, 'interview_plan');
|
|
@@ -262,8 +262,10 @@ async function buildPlan(opts) {
|
|
|
262
262
|
if (!candManageId)
|
|
263
263
|
throw rsFail('未定位到应聘管理记录(candidateManageId),请确认候选人已有应聘批次');
|
|
264
264
|
// 面试方式/轮次枚举:环境缓存 field_options 已有同名映射时直接反转使用(省 2 请求),未覆盖才回源
|
|
265
|
-
const typeMap
|
|
266
|
-
|
|
265
|
+
const [typeMap, sessionMap] = await Promise.all([
|
|
266
|
+
getDsOptions(host, objId, fid('interview_type')),
|
|
267
|
+
getDsOptions(host, objId, fid('interview_session')),
|
|
268
|
+
]);
|
|
267
269
|
const typeId = typeMap[type];
|
|
268
270
|
if (!typeId)
|
|
269
271
|
throw rsFail('面试方式「' + type + '」不在枚举中(' + Object.keys(typeMap).join('/') + ')');
|
|
@@ -362,6 +364,46 @@ async function buildPlan(opts) {
|
|
|
362
364
|
if (aiPlanPicked) {
|
|
363
365
|
dataDetails.push({ formField: { id: digitalFid }, dataOptions: [{ optionId: aiPlanPicked.id, content: aiPlanPicked.name }] });
|
|
364
366
|
}
|
|
367
|
+
// ① 表单默认值优先(用户 2026-11-06 定稿):CLI 走 saveFormData 直写,不触发表单渲染,
|
|
368
|
+
// 页面点「保存」会自动带出的 defaultDetails 必须显式并入提交体,否则「状态」等字段落库为空。
|
|
369
|
+
// 布局元数据回源(有进程内 memo),不读可能过期的磁盘选项缓存。
|
|
370
|
+
const meta = await getFormLayoutMeta(host, formId).catch(() => null);
|
|
371
|
+
const invFields = {};
|
|
372
|
+
for (const [k, v] of Object.entries(fields))
|
|
373
|
+
invFields[String(v)] = k;
|
|
374
|
+
// AI 专属字段由 aiPlan / 面试方式联动控制,不能拿页面默认值覆盖;轮次由下面单独处理(仅当默认里没有时)
|
|
375
|
+
const EXCLUDE_DEFAULTS = new Set(['digital_id', 'interview_type', 'interview_paper_id', 'send_channel']);
|
|
376
|
+
const defaultsApplied = [];
|
|
377
|
+
for (const d of (meta?.defaultDetails || [])) {
|
|
378
|
+
const did = String(d.fieldId || '');
|
|
379
|
+
if (!did || dataDetails.some((x) => String(x.formField.id) === did))
|
|
380
|
+
continue;
|
|
381
|
+
const dk = invFields[did] || '';
|
|
382
|
+
if (EXCLUDE_DEFAULTS.has(dk))
|
|
383
|
+
continue;
|
|
384
|
+
const o = (d.dataOptions || [])[0];
|
|
385
|
+
if (o?.optionId)
|
|
386
|
+
dataDetails.push({ formField: { id: did }, dataOptions: [{ optionId: String(o.optionId), content: o.content || '' }] });
|
|
387
|
+
else if (d.content !== undefined && d.content !== '')
|
|
388
|
+
dataDetails.push({ formField: { id: did }, content: String(d.content) });
|
|
389
|
+
else
|
|
390
|
+
continue;
|
|
391
|
+
defaultsApplied.push(dk || did);
|
|
392
|
+
}
|
|
393
|
+
// ② 轮次 interview_rounds(ebbrowser 关联字段,值=数据字典表记录 id,跨环境必变,运行时按名解析)。
|
|
394
|
+
// 2026-11-06 真机实测:defaultDetails 无该字段、viewLinkages 只有 hide/edit/readonly/required/show
|
|
395
|
+
// (无 value 赋值联动)、initDetails 为空 ⇒ 页面联动不可用,按用户裁定默认「第一轮」。
|
|
396
|
+
const roundsName = String(rounds || '第一轮').trim();
|
|
397
|
+
let roundsWarning = null;
|
|
398
|
+
const roundsFid = fid('interview_rounds');
|
|
399
|
+
if (roundsFid && !dataDetails.some((x) => String(x.formField.id) === String(roundsFid))) {
|
|
400
|
+
const hit = (cache.dict?.raw || []).find((r) => String(r.selection_name || '').trim() === roundsName
|
|
401
|
+
&& ['one', 'two', 'three', 'four'].includes(String(r.browser_key || '')));
|
|
402
|
+
if (hit)
|
|
403
|
+
dataDetails.push({ formField: { id: roundsFid }, dataOptions: [{ optionId: String(hit.option_id), content: roundsName }] });
|
|
404
|
+
else
|
|
405
|
+
roundsWarning = '数据字典未找到轮次「' + roundsName + '」(browserKey one/two/three/four),已跳过该字段,不臆造';
|
|
406
|
+
}
|
|
365
407
|
return {
|
|
366
408
|
host: ctx.host,
|
|
367
409
|
objId, formId, appId, dataDetails, cand, typeId, sessionId, interviewerId, isAI, layoutId,
|
|
@@ -377,6 +419,9 @@ async function buildPlan(opts) {
|
|
|
377
419
|
aiPlan: isAI
|
|
378
420
|
? (aiPlanPicked ? aiPlanPicked.name + '(id=' + aiPlanPicked.id + ')' : '未选择(AI面试必填,需用户指定)')
|
|
379
421
|
: '(非 AI 面试,不适用)',
|
|
422
|
+
rounds: roundsName,
|
|
423
|
+
defaultsApplied: defaultsApplied.length ? defaultsApplied : undefined,
|
|
424
|
+
roundsWarning: roundsWarning || undefined,
|
|
380
425
|
isAIInterview: isAI,
|
|
381
426
|
},
|
|
382
427
|
};
|
|
@@ -457,8 +502,13 @@ async function resolveRequiredHint(plan, ctx) {
|
|
|
457
502
|
// 人才卡片详情 URL(EB 详情页):{baseUrl}/sp/ebdpage/view/{ebdDetailPageId}?talentId={id}
|
|
458
503
|
function resolveTalentCardUrl(ctx, talentId) {
|
|
459
504
|
const pid = ctx.cache.ebdDetailPageId;
|
|
460
|
-
if (!pid)
|
|
461
|
-
|
|
505
|
+
if (!pid || !talentId) {
|
|
506
|
+
// 缓存缺 ebdDetailPageId(首次运行/换环境)时禁止返回 null:退化为 EB 卡片单页,
|
|
507
|
+
// objId 从环境缓存 talent_pool 取,跨环境动态解析,绝不写死。
|
|
508
|
+
const forms = ctx.cache.forms || {};
|
|
509
|
+
const tobj = String(forms.talent_pool?.objId || forms.talent?.objId || '');
|
|
510
|
+
return tobj && talentId ? buildCardUrl(ctx.baseUrl, tobj, String(talentId)) : null;
|
|
511
|
+
}
|
|
462
512
|
return `${ctx.baseUrl}/sp/ebdpage/view/${pid}?talentId=${talentId}${talentLinkExtra(ctx.cache)}`;
|
|
463
513
|
}
|
|
464
514
|
// 面试管理列表 URL:优先环境缓存菜单,回退 allMenus 解析(别名匹配,跨环境不写死)
|
|
@@ -531,7 +581,8 @@ const baseInput = {
|
|
|
531
581
|
positionId: { type: 'string', description: '应聘职位 id(简历池人才必填)' },
|
|
532
582
|
interviewer: { type: 'string', description: '面试官姓名(缺省=当前登录用户)' },
|
|
533
583
|
type: { type: 'string', description: '面试方式(现场面试/视频面试/电话面试/AI面试;含 AI 时邮箱与方案必填)' },
|
|
534
|
-
session: { type: 'string', description: '
|
|
584
|
+
session: { type: 'string', description: '面试阶段(初试/复试/…)' },
|
|
585
|
+
rounds: { type: 'string', description: '面试轮次(第一轮/第二轮/第三轮/第四轮;缺省=页面默认值或第一轮,按数据字典运行时解析)' },
|
|
535
586
|
start: { type: 'string', pattern: '^\\d{4}-\\d{1,2}-\\d{1,2}[ T]\\d{1,2}:\\d{2}$', description: '开始时间 YYYY-MM-DD HH:mm(缺省=当前时间)' },
|
|
536
587
|
end: { type: 'string', pattern: '^\\d{4}-\\d{1,2}-\\d{1,2}[ T]\\d{1,2}:\\d{2}$', description: '结束时间(缺省=AI +7天 / 其它 +1小时)' },
|
|
537
588
|
email: { type: 'string', description: '候选人邮箱(AI 面试必填;补录值优先于人才资料)' },
|
|
@@ -539,6 +590,9 @@ const baseInput = {
|
|
|
539
590
|
};
|
|
540
591
|
async function prepare(args, env) {
|
|
541
592
|
const ctx = await makeCtx(env);
|
|
593
|
+
const perm = await probeCreatePermission(ctx.host, objIdOf(ctx.cache, 'interview_plan'));
|
|
594
|
+
if (perm === 'denied')
|
|
595
|
+
throw rsFail('当前账号没有「面试计划」表单的创建权限,已阻断(未写入任何数据)');
|
|
542
596
|
const talentId = await locateTalentId(ctx, args);
|
|
543
597
|
const auto = nowAndEnd(args.type || '现场面试');
|
|
544
598
|
const startTime = args.start || auto.s;
|
|
@@ -552,6 +606,7 @@ async function prepare(args, env) {
|
|
|
552
606
|
email: args.email ? String(args.email) : undefined,
|
|
553
607
|
mobile: args.mobile ? String(args.mobile) : undefined,
|
|
554
608
|
aiPlan: args.aiPlan ? String(args.aiPlan) : undefined,
|
|
609
|
+
rounds: args.rounds ? String(args.rounds) : undefined,
|
|
555
610
|
});
|
|
556
611
|
plan.host = ctx.host;
|
|
557
612
|
const aiPlanCandidates = plan.isAI
|
|
@@ -574,7 +629,8 @@ async function prepare(args, env) {
|
|
|
574
629
|
const willSubmit = { formId: plan.formId, objId: plan.objId, dataDetails: plan.dataDetails };
|
|
575
630
|
const { createHash } = await import('node:crypto');
|
|
576
631
|
const fp = createHash('sha256').update(JSON.stringify(willSubmit)).digest('hex');
|
|
577
|
-
const continuation = await env.continuation.issue({ operation: 'recruit-stage.interview.arrange.apply', fingerprint: fp
|
|
632
|
+
const continuation = await env.continuation.issue({ operation: 'recruit-stage.interview.arrange.apply', fingerprint: fp,
|
|
633
|
+
enumMaps: await dsOptionsSnapshot(), timeWindow: { start: String(startTime), end: String(endTime) } });
|
|
578
634
|
return rsSuccess('recruit-stage.interview.arrange.prepare', {
|
|
579
635
|
mode: 'prepare', ...plan.summary,
|
|
580
636
|
needAiPlan: plan.isAI && !plan.aiPlanPicked,
|
|
@@ -597,11 +653,13 @@ async function apply(args, env) {
|
|
|
597
653
|
if (!args.continuation)
|
|
598
654
|
throw rsValidationError('continuation_required', '缺少 continuation(来自 prepare 的 meta)');
|
|
599
655
|
const payload = await env.continuation.verify(String(args.continuation), 'recruit-stage.interview.arrange.apply');
|
|
656
|
+
restoreDsOptions(payload.enumMaps);
|
|
600
657
|
const ctx = await makeCtx(env);
|
|
601
658
|
const talentId = await locateTalentId(ctx, args);
|
|
602
659
|
const auto = nowAndEnd(args.type || '现场面试');
|
|
603
|
-
|
|
604
|
-
const
|
|
660
|
+
// prepare 已把时间窗口放进 continuation:apply 复用它,避免两次运行时刻不同导致 fingerprint 漂移
|
|
661
|
+
const startTime = args.start || payload.timeWindow?.start || auto.s;
|
|
662
|
+
const endTime = args.end || (args.start ? (shiftTime(String(args.start), auto.isAI ? 7 * 24 * 3600 * 1000 : 3600 * 1000) || auto.e) : (payload.timeWindow?.end || auto.e));
|
|
605
663
|
const plan = await buildPlan({
|
|
606
664
|
ctx, talentId,
|
|
607
665
|
positionId: args.positionId ? String(args.positionId) : undefined,
|
|
@@ -611,6 +669,7 @@ async function apply(args, env) {
|
|
|
611
669
|
email: args.email ? String(args.email) : undefined,
|
|
612
670
|
mobile: args.mobile ? String(args.mobile) : undefined,
|
|
613
671
|
aiPlan: args.aiPlan ? String(args.aiPlan) : undefined,
|
|
672
|
+
rounds: args.rounds ? String(args.rounds) : undefined,
|
|
614
673
|
});
|
|
615
674
|
plan.host = ctx.host;
|
|
616
675
|
// AI 面试方案必填:未选定直接阻断,不落库、不执行动作链
|
|
@@ -629,17 +688,28 @@ async function apply(args, env) {
|
|
|
629
688
|
name: '面试管理-' + plan.cand.name + ' ' + plan.summary.time, dataDetails: plan.dataDetails,
|
|
630
689
|
});
|
|
631
690
|
const actionsRun = await execSaveActions(plan, formDataId);
|
|
691
|
+
// 第三层门禁:写完回查关键字段(后端对无效 optionId 会静默丢弃仍返回 success)
|
|
692
|
+
// union_status 可能被动作链推进,只要求非空;其余字段严格比对提交值。
|
|
693
|
+
const verification = await verifySubmitted({
|
|
694
|
+
host: ctx.host, formId: plan.formId, objId: plan.objId, dataId: formDataId,
|
|
695
|
+
expected: expectedFields(plan.dataDetails, ctx.cache.fields[plan.objId] || {}, ['interview_type', 'interview_session', 'interview_rounds', 'digital_id', 'email', 'union_status'], ['union_status']),
|
|
696
|
+
});
|
|
697
|
+
if (verification.mismatches.length)
|
|
698
|
+
invalidateEnvCache(ctx.baseUrl, ctx.appId);
|
|
699
|
+
const verifyWarnings = verification.mismatches.map((m) => '落库回查不一致:' + m.label + ' 期望 ' + m.expected + ',实际 ' + m.actual + '(该字段可能未写入)');
|
|
632
700
|
const detailUrl = buildCardUrl(ctx.baseUrl, plan.objId, formDataId);
|
|
633
|
-
|
|
701
|
+
// 列表链接只打开列表;详情单页由 viewLink 单独给出,不再用「列表+滑出详情」组合地址。
|
|
702
|
+
const listLocateUrl = buildListUrl(ctx.baseUrl, (ctx.cache.lists?.interview?.listId) || '');
|
|
634
703
|
return rsSuccess('recruit-stage.interview.arrange.apply', {
|
|
635
|
-
mode: 'apply', result: 'success', interviewFormId: formDataId,
|
|
704
|
+
mode: 'apply', result: verification.mismatches.length ? 'partial' : 'success', interviewFormId: formDataId,
|
|
636
705
|
interviewCardUrl: detailUrl,
|
|
637
706
|
viewLink: detailUrl ? `[查看 ${plan.cand.name || ''} 的面试安排详情](${detailUrl})` : null,
|
|
638
|
-
listLocateLink: listLocateUrl ? `[
|
|
639
|
-
agentNote: '产物 = 两个 Markdown 链接(平台实证可点击):① viewLink
|
|
707
|
+
listLocateLink: listLocateUrl ? `[打开面试管理列表](${listLocateUrl})` : null,
|
|
708
|
+
agentNote: '产物 = 两个 Markdown 链接(平台实证可点击):① viewLink 面试安排详情单页 ② listLocateLink 面试管理列表(只打开列表,不打开详情)。按顺序原样放回答正文,缺哪个只给另一个、不输出半截。不要包 browsertool / <artifact> 标签。',
|
|
640
709
|
aiPlan: plan.isAI && plan.aiPlanPicked ? { id: plan.aiPlanPicked.id, name: plan.aiPlanPicked.name } : undefined,
|
|
641
710
|
saveActions: actionsRun.executed,
|
|
642
|
-
|
|
711
|
+
verification: { checked: verification.checked, mismatches: verification.mismatches, unavailable: verification.unavailable || null },
|
|
712
|
+
warnings: [...(actionsRun.warnings || []), ...verifyWarnings],
|
|
643
713
|
assigned: actionsRun.assigned || {},
|
|
644
714
|
});
|
|
645
715
|
}
|
|
@@ -653,7 +723,7 @@ async function prefill(args, env) {
|
|
|
653
723
|
const typeFid = fields.interview_type;
|
|
654
724
|
if (!typeFid)
|
|
655
725
|
throw rsFail('面试计划缺少字段 interview_type(ds/fields 解析不到)');
|
|
656
|
-
const typeMap =
|
|
726
|
+
const typeMap = await getDsOptions(ctx.host, objId, typeFid);
|
|
657
727
|
const typeId = typeMap[typeKey];
|
|
658
728
|
if (!typeId)
|
|
659
729
|
throw rsFail('面试方式「' + typeKey + '」不在枚举中(' + Object.keys(typeMap).join('/') + ')');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { rsSuccess, schemaOf } from './types.js';
|
|
2
2
|
import { rsFail, rsValidationError, rsConfirmationError } from '../errors.js';
|
|
3
|
-
import { objIdOf, formIdOf, saveFormData, runEsb, getDsOptions,
|
|
3
|
+
import { objIdOf, formIdOf, saveFormData, runEsb, getDsOptions, getFormButtonsForData, findSubmitButton, analyzeButtonActions, getFormDataRecord, toSubmitDetails, randHex32, dsOptionsSnapshot, restoreDsOptions, } from '../shared.js';
|
|
4
4
|
// InterviewStatusEnum.INVALID(已失效):系统反馈按钮(填写/编辑/代评价)均要求非此状态
|
|
5
5
|
const INVALID_STATUS_ID = '841052191228968977';
|
|
6
6
|
const R = (v) => String(v ?? '').replace(/^<p>|<\/p>$/g, '').trim();
|
|
@@ -110,7 +110,7 @@ async function prepare(args, env) {
|
|
|
110
110
|
// result optionId
|
|
111
111
|
let newOptionId = null;
|
|
112
112
|
if (args.result) {
|
|
113
|
-
const opts =
|
|
113
|
+
const opts = await getDsOptions(t.host, t.objId, t.resultFid);
|
|
114
114
|
newOptionId = opts[String(args.result)];
|
|
115
115
|
if (!newOptionId)
|
|
116
116
|
throw rsFail('未识别的面试结果「' + args.result + '」,可选:' + Object.keys(opts).join('/'));
|
|
@@ -120,7 +120,8 @@ async function prepare(args, env) {
|
|
|
120
120
|
const willSubmit = { feedbackId: String(t.target.feedbackId), result: newResultName, comment: newComment };
|
|
121
121
|
const { createHash } = await import('node:crypto');
|
|
122
122
|
const fp = createHash('sha256').update(JSON.stringify(willSubmit)).digest('hex');
|
|
123
|
-
const continuation = await env.continuation.issue({ operation: 'recruit-stage.interview.feedback.edit.apply', fingerprint: fp
|
|
123
|
+
const continuation = await env.continuation.issue({ operation: 'recruit-stage.interview.feedback.edit.apply', fingerprint: fp,
|
|
124
|
+
enumMaps: await dsOptionsSnapshot() });
|
|
124
125
|
return rsSuccess('recruit-stage.interview.feedback.edit.prepare', {
|
|
125
126
|
mode: 'prepare',
|
|
126
127
|
talentId: t.talentId,
|
|
@@ -146,13 +147,14 @@ async function apply(args, env) {
|
|
|
146
147
|
if (!args.continuation)
|
|
147
148
|
throw rsValidationError('continuation_required', '缺少 continuation(来自 prepare 的 meta)');
|
|
148
149
|
const payload = await env.continuation.verify(String(args.continuation), 'recruit-stage.interview.feedback.edit.apply');
|
|
150
|
+
restoreDsOptions(payload.enumMaps);
|
|
149
151
|
const t = await buildTarget(env, args);
|
|
150
152
|
// 重新取最新 updateTimeStamp(乐观锁)
|
|
151
153
|
const rec2 = await getFormDataRecord(t.host, t.formId, String(t.target.feedbackId), t.objId);
|
|
152
154
|
const details2 = toSubmitDetails(rec2.dataDetails);
|
|
153
155
|
let newOptionId = null;
|
|
154
156
|
if (args.result) {
|
|
155
|
-
const opts =
|
|
157
|
+
const opts = await getDsOptions(t.host, t.objId, t.resultFid);
|
|
156
158
|
newOptionId = opts[String(args.result)];
|
|
157
159
|
if (!newOptionId)
|
|
158
160
|
throw rsFail('未识别的面试结果「' + args.result + '」,可选:' + Object.keys(opts).join('/'));
|