weaver-work-cli 0.1.42 → 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 +21 -0
- package/dist/chunks/{archive-J4I6MCKF.js → archive-ZQ4A4TV6.js} +399 -47
- package/dist/chunks/{archive-oa-BRZKKTO4.js → archive-oa-BBDP7AKJ.js} +12 -5
- package/dist/chunks/{asset-L7D4FAOZ.js → asset-ZOJVBWZH.js} +11 -4
- package/dist/chunks/{asset-idle-DADLLV75.js → asset-idle-XGB5IPGT.js} +7 -3
- package/dist/chunks/{attachment-content-K4C7VLWQ.js → attachment-content-CE3GMWTS.js} +5 -4
- package/dist/chunks/{blog-BVGQ7NZL.js → blog-QSHLZSFW.js} +11 -4
- package/dist/chunks/caizhilian-KCQYFH72.js +204 -0
- package/dist/chunks/{calendar-Q7NQY5Z2.js → calendar-DLGMRJQA.js} +12 -5
- package/dist/chunks/{chunk-W7BEHOSR.js → chunk-3WBIQLMB.js} +2 -2
- package/dist/chunks/{chunk-4PD5NWAX.js → chunk-3YV7PKRL.js} +2 -2
- package/dist/chunks/{chunk-JPRO6ER2.js → chunk-3ZMAQQ3W.js} +185 -60
- package/dist/chunks/{chunk-R4CHUSKC.js → chunk-4EXOIQDI.js} +40 -10
- package/dist/chunks/{chunk-OOUTBLZ4.js → chunk-56EZERK4.js} +1 -1
- package/dist/chunks/chunk-6N4JPNFL.js +76 -0
- package/dist/chunks/{chunk-SA6VBIHY.js → chunk-6NXT4ICB.js} +342 -17
- package/dist/chunks/{chunk-ZUX3P6BQ.js → chunk-727FH2NI.js} +1 -1
- package/dist/chunks/chunk-762M5XJS.js +215 -0
- package/dist/chunks/{chunk-GEWYMQME.js → chunk-77YP6I52.js} +1 -1
- package/dist/chunks/chunk-7BDPM5ST.js +11 -0
- package/dist/chunks/{chunk-G4UR6NXN.js → chunk-CZNZKOHR.js} +3 -3
- package/dist/chunks/{chunk-GHXCDPTM.js → chunk-DGMYACGJ.js} +1 -1
- package/dist/chunks/{chunk-4RAE6JXP.js → chunk-DLY5GUXX.js} +6 -3
- package/dist/chunks/{chunk-BYBSCN4X.js → chunk-G7PQWD4L.js} +6 -3
- package/dist/chunks/{chunk-EKWAQSLU.js → chunk-GR76ZDDX.js} +432 -2248
- package/dist/chunks/{chunk-APVFJUQH.js → chunk-HFXK54M4.js} +3 -3
- package/dist/chunks/{chunk-EZALDOQH.js → chunk-HP7JIYMT.js} +5 -2
- package/dist/chunks/{chunk-ZEDWSH32.js → chunk-IC62NFM5.js} +1 -1
- package/dist/chunks/{chunk-3KTFS4IA.js → chunk-JB34OE7R.js} +808 -85
- package/dist/chunks/{chunk-72CKAUAG.js → chunk-JWWTI63L.js} +59 -7
- package/dist/chunks/{chunk-P26ZWSKU.js → chunk-KIHNAS25.js} +5 -2
- package/dist/chunks/{chunk-NKZRQXST.js → chunk-LGKWL4OH.js} +200 -47
- package/dist/chunks/chunk-LRCPNDZA.js +2529 -0
- package/dist/chunks/{chunk-QKNKR4RH.js → chunk-LXFVWZLM.js} +4 -4
- package/dist/chunks/{chunk-NOODWMCL.js → chunk-O6CMPO65.js} +25 -2
- package/dist/chunks/{chunk-BIPYLLVS.js → chunk-OAE3AZBQ.js} +15 -15
- package/dist/chunks/chunk-P5GQRWDC.js +60 -0
- package/dist/chunks/{caizhilian-SAADNFD6.js → chunk-PGO4ILMQ.js} +44 -517
- package/dist/chunks/{chunk-2LV74IWP.js → chunk-Q4OYAQYH.js} +1 -1
- package/dist/chunks/{chunk-LDZQPUIA.js → chunk-T4MWQAQB.js} +8 -6
- package/dist/chunks/{chunk-BBKDXQEC.js → chunk-TGAGQV4I.js} +3 -3
- package/dist/chunks/{chunk-GPMFD4RD.js → chunk-TXUG266F.js} +1 -1
- package/dist/chunks/{chunk-FOAA27U5.js → chunk-U6R6FZHD.js} +184 -18
- package/dist/chunks/{chunk-LUSPKZKY.js → chunk-UG5G54VL.js} +1 -0
- package/dist/chunks/{chunk-NIAJ5ZCG.js → chunk-UL5XUQ25.js} +5 -2
- package/dist/chunks/{chunk-IZ7S7QUS.js → chunk-VIMCY4DI.js} +6 -6
- package/dist/chunks/chunk-VRPH24IC.js +76 -0
- package/dist/chunks/{chunk-FMPJJYYI.js → chunk-WRXSAVKO.js} +1 -1
- package/dist/chunks/{chunk-YRSZQUD2.js → chunk-YIKSL36S.js} +3 -3
- package/dist/chunks/{chunk-3SO6QL6U.js → chunk-YWX377BY.js} +5 -2
- package/dist/chunks/{chunk-BYATLLEF.js → chunk-Z3GDFVJR.js} +1 -1
- package/dist/chunks/{chunk-LADPYOWC.js → chunk-Z6UUBY37.js} +3 -3
- package/dist/chunks/{conflict-F2OMZRTO.js → conflict-IYJETSGT.js} +4 -3
- package/dist/chunks/{continuation-2CKSBLA6.js → continuation-3S37AUSH.js} +4 -3
- package/dist/chunks/{continuation-RN6PZN2M.js → continuation-3XLYYTKV.js} +4 -3
- package/dist/chunks/continuation-GW6PRWK3.js +12 -0
- package/dist/chunks/{continuation-HZIZRZBX.js → continuation-HFW2YT5S.js} +4 -3
- package/dist/chunks/{continuation-NLECEJPX.js → continuation-KI7DRRZN.js} +4 -3
- package/dist/chunks/{contract-5BETHRSG.js → contract-3QLAGYQL.js} +5803 -4593
- package/dist/chunks/{cowork-3MN6EQQO.js → cowork-3ACICHDQ.js} +11 -4
- package/dist/chunks/{create-flow-5FQNNMVO.js → create-flow-7JLC7UID.js} +8 -7
- package/dist/chunks/{ebuilder-form-SBHOYBUD.js → ebuilder-form-GWDTKEI2.js} +14 -9
- package/dist/chunks/{ehr-KMOJULKG.js → ehr-MYRDCHZ4.js} +357 -43
- package/dist/chunks/{employee-SAK2QYXX.js → employee-NOHNXC46.js} +3 -3
- package/dist/chunks/{env-LB7NBL2O.js → env-3MBHAWBL.js} +4 -3
- package/dist/chunks/{esb-W2PJCFCX.js → esb-4BQHNP5C.js} +12 -7
- package/dist/chunks/{factory-6ZFQXQ46.js → factory-TZEVU4DU.js} +3 -2
- package/dist/chunks/{fna-ZQPCUV4R.js → fna-ZVB2IILI.js} +14 -8
- package/dist/chunks/{group-chat-2HHAJN46.js → group-chat-KL3HFKRM.js} +5 -4
- package/dist/chunks/{host-YTODKMSL.js → host-3TNBMDTR.js} +5 -5
- package/dist/chunks/host-7NTIBSPK.js +25 -0
- package/dist/chunks/{host-4CBHGOHT.js → host-7OWWPLM4.js} +5 -5
- package/dist/chunks/{host-ATKVNZAT.js → host-G3VU7SDW.js} +5 -5
- package/dist/chunks/{host-BQH22NTQ.js → host-M4XP5URR.js} +5 -5
- package/dist/chunks/{host-X2CSLFM6.js → host-TUOIOEMC.js} +5 -5
- package/dist/chunks/{hrm-FFM4UJFS.js → hrm-UNKCCCGP.js} +11 -7
- package/dist/chunks/{im-VEHKDQPB.js → im-NJB7ZYMH.js} +8 -7
- package/dist/chunks/{invoice-LVIKSIIF.js → invoice-OQP3TMKQ.js} +636 -1768
- package/dist/chunks/{jiuchuanhui-X6DINO5P.js → jiuchuanhui-ASFZBMPU.js} +14 -6
- package/dist/chunks/{lazy-dispatch-KSWTN5L6.js → lazy-dispatch-UH6HGK2I.js} +7 -6
- package/dist/chunks/{mail-VDKRGUD3.js → mail-M3HJF5ER.js} +16 -14
- package/dist/chunks/{meeting-CLC6HP3Z.js → meeting-C67EHQ4Z.js} +21 -14
- package/dist/chunks/{okr-CHG4OO3U.js → okr-EVX7FB5G.js} +12 -5
- package/dist/chunks/{operations-5QL3AECO.js → operations-62N6EP3C.js} +4 -3
- package/dist/chunks/operations-J7PUIVWZ.js +15 -0
- package/dist/chunks/{plan-XWR75667.js → plan-2QJQEPBO.js} +12 -5
- package/dist/chunks/{project-5BXOOKMG.js → project-XELELW2T.js} +11 -4
- package/dist/chunks/reception-5WITA44R.js +1899 -0
- package/dist/chunks/{recruit-stage-DGMFNNDE.js → recruit-stage-AHY5QAMF.js} +745 -149
- package/dist/chunks/{registry-RHMW6ANW.js → registry-AQVGHUM6.js} +7 -6
- package/dist/chunks/{registry-OZSMDVPP.js → registry-PVUZQDDQ.js} +3 -3
- package/dist/chunks/{registry-7FFOXIAW.js → registry-QJCZ2GVG.js} +7 -6
- package/dist/chunks/{registry-Z43434VG.js → registry-VWXWPVAG.js} +4 -4
- package/dist/chunks/registry-XPWPGHYE.js +24 -0
- package/dist/chunks/{room-recommend-62H7ZQQ6.js → room-recommend-CNWE5WQK.js} +8 -5
- package/dist/chunks/{schedule-FNXKH3DQ.js → schedule-YYNYBQIE.js} +6 -5
- package/dist/chunks/{workflow-ADHKCAJK.js → workflow-BSYT5TGL.js} +15 -8
- package/dist/cmd/action.js +6 -0
- package/dist/cmd/identity/index.js +45 -0
- package/dist/cmd/index.js +2 -0
- package/dist/core/continuation-ttl.js +18 -0
- package/dist/core/error-codes.js +85 -0
- package/dist/core/logger.js +11 -0
- package/dist/index.js +37 -31
- package/dist/internal/e10/auth/commands.js +195 -8
- package/dist/internal/e10/auth/error-log.js +312 -0
- package/dist/internal/e10/auth/session.js +17 -3
- package/dist/internal/e10/auth/xiaoe.js +176 -13
- package/dist/internal/e10/auth-recovery.js +39 -12
- package/dist/internal/e10/context.js +29 -3
- package/dist/internal/skills/install.js +9 -1
- package/dist/shortcuts/archive/continuation.js +2 -1
- package/dist/shortcuts/archive/index.js +3 -0
- package/dist/shortcuts/archive/operations/borrow-list.js +105 -14
- package/dist/shortcuts/archive/operations/confirm.js +2 -1
- 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/archive-oa/continuation.js +2 -1
- package/dist/shortcuts/archive-oa/index.js +2 -0
- package/dist/shortcuts/archive-oa/operations/confirm.js +2 -1
- package/dist/shortcuts/asset/continuation.js +2 -1
- package/dist/shortcuts/asset/index.js +2 -0
- package/dist/shortcuts/asset-idle/index.js +2 -0
- package/dist/shortcuts/blog/continuation.js +2 -1
- package/dist/shortcuts/blog/index.js +2 -0
- package/dist/shortcuts/caizhilian/continuation.js +2 -1
- package/dist/shortcuts/caizhilian/index.js +2 -0
- package/dist/shortcuts/caizhilian/operations/confirm.js +3 -2
- package/dist/shortcuts/calendar/continuation.js +2 -1
- package/dist/shortcuts/calendar/index.js +2 -0
- package/dist/shortcuts/calendar/operations/write.js +1 -1
- package/dist/shortcuts/contract/continuation.js +2 -1
- package/dist/shortcuts/contract/host.js +111 -4
- package/dist/shortcuts/contract/index.js +21 -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/operations/write.js +2 -1
- package/dist/shortcuts/contract/upload-cache.js +104 -0
- package/dist/shortcuts/cowork/continuation.js +2 -1
- package/dist/shortcuts/cowork/index.js +2 -0
- package/dist/shortcuts/ebuilder-form/continuation.js +2 -1
- package/dist/shortcuts/ebuilder-form/index.js +2 -0
- package/dist/shortcuts/ebuilder-form/operations/write.js +3 -2
- package/dist/shortcuts/ehr/continuation.js +2 -1
- package/dist/shortcuts/ehr/index.js +2 -0
- package/dist/shortcuts/ehr/operations/attend-write.js +1 -1
- package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +186 -5
- package/dist/shortcuts/ehr/operations/recruit-position.js +239 -6
- package/dist/shortcuts/ehr/operations/recruit-write.js +18 -19
- package/dist/shortcuts/ehr/operations/recruit.js +17 -5
- package/dist/shortcuts/esb/continuation.js +2 -1
- package/dist/shortcuts/esb/index.js +2 -0
- package/dist/shortcuts/esb/operations/trigger.js +2 -1
- package/dist/shortcuts/fna/continuation.js +2 -1
- package/dist/shortcuts/fna/index.js +2 -0
- package/dist/shortcuts/fna/operations/invoice-writeoff.js +1 -1
- package/dist/shortcuts/fna/operations/loan.js +1 -1
- package/dist/shortcuts/hrm/index.js +2 -0
- package/dist/shortcuts/hrm/operations/employee.js +29 -1
- package/dist/shortcuts/im/continuation.js +2 -1
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/invoice/continuation.js +2 -1
- package/dist/shortcuts/invoice/index.js +14 -15
- package/dist/shortcuts/invoice/invoice-record.js +93 -0
- package/dist/shortcuts/invoice/manifest.js +190 -393
- package/dist/shortcuts/invoice/operations/add.js +2 -1
- package/dist/shortcuts/invoice/operations/delete.js +2 -1
- package/dist/shortcuts/invoice/operations/import.js +2 -1
- package/dist/shortcuts/invoice/operations/issuing-contract-detail.js +86 -0
- package/dist/shortcuts/invoice/operations/issuing-contracts.js +210 -0
- package/dist/shortcuts/invoice/operations/registry.js +17 -17
- package/dist/shortcuts/invoice/operations/reim-auto.js +4 -569
- package/dist/shortcuts/invoice/operations/reim.js +52 -341
- package/dist/shortcuts/invoice/operations/shared.js +21 -4
- package/dist/shortcuts/invoice/operations/update.js +2 -1
- package/dist/shortcuts/invoice/projection.js +10 -62
- package/dist/shortcuts/jiuchuanhui/continuation.js +2 -1
- package/dist/shortcuts/jiuchuanhui/index.js +2 -0
- package/dist/shortcuts/jiuchuanhui/operations/datajson.js +2 -1
- package/dist/shortcuts/jiuchuanhui/operations/esb.js +2 -1
- package/dist/shortcuts/mail/continuation.js +2 -1
- package/dist/shortcuts/mail/index.js +2 -0
- package/dist/shortcuts/mail/operations/mail-blacklist.js +1 -1
- package/dist/shortcuts/mail/operations/mail-contacts.js +1 -1
- package/dist/shortcuts/mail/operations/mail-send.js +1 -1
- package/dist/shortcuts/mail/operations/mail-sign.js +1 -1
- package/dist/shortcuts/mail/operations/mail-template.js +1 -1
- package/dist/shortcuts/meeting/continuation.js +2 -1
- package/dist/shortcuts/meeting/index.js +2 -0
- package/dist/shortcuts/meeting/operations/change.js +1 -1
- package/dist/shortcuts/meeting/operations/create.js +1 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +198 -65
- package/dist/shortcuts/meeting/operations/eb/decision.js +1 -1
- package/dist/shortcuts/meeting/operations/eb/draft-memory.js +56 -0
- package/dist/shortcuts/meeting/operations/eb/factory.js +59 -4
- 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/lifecycle.js +1 -1
- package/dist/shortcuts/meeting/operations/receipts.js +1 -1
- package/dist/shortcuts/meeting/operations/registry.js +2 -0
- package/dist/shortcuts/meeting/operations/signs.js +1 -1
- package/dist/shortcuts/okr/continuation.js +2 -1
- package/dist/shortcuts/okr/index.js +2 -0
- package/dist/shortcuts/okr/operations/write.js +1 -1
- package/dist/shortcuts/plan/continuation.js +2 -1
- package/dist/shortcuts/plan/index.js +2 -0
- package/dist/shortcuts/plan/operations/write.js +1 -1
- package/dist/shortcuts/project/continuation.js +2 -1
- package/dist/shortcuts/project/index.js +2 -0
- package/dist/shortcuts/reception/constants.js +53 -0
- package/dist/shortcuts/reception/errors.js +54 -0
- package/dist/shortcuts/reception/host.js +125 -0
- package/dist/shortcuts/reception/index.js +198 -0
- package/dist/shortcuts/reception/manifest.js +177 -0
- package/dist/shortcuts/reception/operations/ask.js +71 -0
- package/dist/shortcuts/reception/operations/browsertool.js +58 -0
- package/dist/shortcuts/reception/operations/compose.js +129 -0
- package/dist/shortcuts/reception/operations/customparams.js +74 -0
- package/dist/shortcuts/reception/operations/doc.js +238 -0
- package/dist/shortcuts/reception/operations/docrender.js +36 -0
- package/dist/shortcuts/reception/operations/panels.js +179 -0
- package/dist/shortcuts/reception/operations/registry.js +26 -0
- package/dist/shortcuts/reception/operations/render-assets.js +184 -0
- package/dist/shortcuts/reception/operations/render.js +123 -0
- package/dist/shortcuts/reception/operations/runs.js +38 -0
- package/dist/shortcuts/reception/operations/schedule.js +127 -0
- package/dist/shortcuts/reception/operations/shared.js +196 -0
- package/dist/shortcuts/reception/operations/snapshot.js +68 -0
- package/dist/shortcuts/reception/operations/types.js +1 -0
- package/dist/shortcuts/reception/operations.js +33 -0
- package/dist/shortcuts/reception/upload.js +218 -0
- package/dist/shortcuts/recruit-stage/context.js +145 -33
- package/dist/shortcuts/recruit-stage/continuation.js +2 -1
- 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 +289 -48
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +207 -25
- package/dist/shortcuts/recruit-stage/shared.js +161 -18
- package/dist/shortcuts/workflow/continuation.js +2 -1
- package/dist/shortcuts/workflow/index.js +4 -0
- package/dist/shortcuts/workflow/operations/form.js +32 -8
- 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/dist/shortcuts/workflow/operations/write.js +1 -1
- package/docs/_catalog.md +3 -0
- package/docs/agent-invoice.md +1 -1
- package/docs/archive-oa.md +1 -1
- package/docs/caizhilian.md +1 -1
- package/docs/calendar.md +1 -1
- package/docs/contract.md +2 -1
- package/docs/e10-auth.md +19 -1
- package/docs/ehr.md +2 -2
- package/docs/esb.md +1 -1
- package/docs/im.md +1 -1
- package/docs/invoice.md +8 -12
- package/docs/okr.md +1 -1
- package/docs/reception.md +119 -0
- package/docs/todo-smart-convert/data-contract.md +7 -0
- package/package.json +1 -1
- package/scripts/clean.mjs +43 -2
- package/skill-template/business-info.json +18 -2
- package/skill-template/domains/caizhilian.md +1 -1
- package/skill-template/domains/jinchengda.md +2 -0
- package/skill-template/domains/reception-flow.md +18 -0
- package/skill-template/domains/yepiaotong.md +4 -7
- package/skills/weaver-e10-archive-oa/references/source-manifest.json +14 -14
- package/skills/weaver-e10-blog/references/blog-publish.md +1 -1
- package/skills/weaver-e10-blog/references/source-manifest.json +7 -7
- package/skills/weaver-e10-caizhilian/references/source-manifest.json +21 -21
- package/skills/weaver-e10-caizhilian/references/write-protocol.md +2 -2
- package/skills/weaver-e10-calendar/references/calendar-write.md +1 -1
- package/skills/weaver-e10-cowork/SKILL.md +1 -1
- package/skills/weaver-e10-ebuilder-form/SKILL.md +1 -1
- package/skills/weaver-e10-ebuilder-form/references/custom-api.md +1 -1
- package/skills/weaver-e10-ebuilder-form/references/openapi-write.md +1 -1
- package/skills/weaver-e10-esb/SKILL.md +2 -2
- package/skills/weaver-e10-esb/references/source-manifest.json +22 -22
- package/skills/weaver-e10-esb/references/trigger.md +2 -2
- 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-clause-library-crud.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-clause-reference-save.md +1 -1
- 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-request-write.md +1 -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-jinchengda/references/source-manifest.json +29 -29
- package/skills/weaver-e10-jucailin/SKILL.md +1 -1
- package/skills/weaver-e10-jucailin/references/attend-write.md +2 -2
- package/skills/weaver-e10-jucailin/references/recruit-create.md +15 -4
- package/skills/weaver-e10-jucailin/references/recruit-write.md +3 -3
- package/skills/weaver-e10-meeting/SKILL.md +64 -14
- package/skills/weaver-e10-meeting/references/meeting-change.md +1 -1
- package/skills/weaver-e10-meeting/references/meeting-create.md +1 -1
- package/skills/weaver-e10-meeting/references/meeting-lifecycle.md +1 -1
- package/skills/weaver-e10-meeting/references/meeting-verification.md +1 -1
- package/skills/weaver-e10-okr/references/okr-align.md +1 -1
- package/skills/weaver-e10-okr/references/okr-keyresult.md +1 -1
- package/skills/weaver-e10-okr/references/okr-write.md +1 -1
- package/skills/weaver-e10-okr/references/source-manifest.json +8 -8
- package/skills/weaver-e10-plan/references/plan-report-write.md +1 -1
- package/skills/weaver-e10-plan/references/source-manifest.json +20 -20
- package/skills/weaver-e10-qiyecheng/references/loan-management.md +1 -1
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +18 -18
- package/skills/weaver-e10-reception-flow/SKILL.md +173 -0
- package/skills/weaver-e10-reception-flow/assets//350/241/214/347/250/213/345/215/225/346/250/241/346/235/277-/346/263/233/345/276/256.docx +0 -0
- package/skills/weaver-e10-reception-flow/data/fields-snapshot.json +213 -0
- package/skills/weaver-e10-reception-flow/references/browsertool.md +68 -0
- package/skills/weaver-e10-reception-flow/references/env-pitfalls.md +51 -0
- package/skills/weaver-e10-reception-flow/references/fields-snapshot.md +227 -0
- package/skills/weaver-e10-reception-flow/references/guide.md +179 -0
- package/skills/weaver-e10-reception-flow/scripts/locate.sh +14 -0
- package/skills/weaver-e10-reception-flow/scripts/render.py +724 -0
- package/skills/weaver-e10-recruit-stage/SKILL.md +19 -10
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +10 -2
- package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +1 -1
- package/skills/weaver-e10-recruit-stage/lib/xiaoe-session.mjs +66 -0
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +204 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +13 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +29 -6
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +27 -14
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +21 -2
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +9 -1
- package/skills/weaver-e10-shijingran/SKILL.md +5 -5
- package/skills/weaver-e10-shijingran/references/source-manifest.json +37 -36
- package/skills/weaver-e10-skill-maker/references/module-cli-generation.md +2 -0
- 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-wenshuding/references/source-manifest.json +3 -3
- 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/source-manifest.json +32 -32
- 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-yepiaotong/SKILL.md +19 -26
- package/skills/weaver-e10-yepiaotong/references/invoice-detail.md +13 -10
- package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +2 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +194 -155
- package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +28 -32
- package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +5 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +8 -10
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +211 -616
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +149 -117
- package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +17 -20
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +20 -39
- package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +55 -22
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +7 -17
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +88 -92
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +144 -354
- package/skills/weaver-e10-yimiaoban/SKILL.md +18 -6
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +31 -1
- package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +1 -1
- package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +72 -0
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +11 -11
- package/dist/chunks/chunk-TTPJJJC4.js +0 -465
- package/dist/chunks/registry-BKBZPBAJ.js +0 -23
- package/dist/shortcuts/invoice/markdown.js +0 -172
- package/dist/shortcuts/invoice/operations/issuing-qys.js +0 -424
- package/skills/weaver-e10-meeting.zip +0 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-examples.md +0 -131
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-form-fill-rules.md +0 -179
|
@@ -2,22 +2,25 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
createRecruitContextLoader
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-T4MWQAQB.js";
|
|
6
|
+
import {
|
|
7
|
+
CONTINUATION_TTL_MS
|
|
8
|
+
} from "./chunk-7BDPM5ST.js";
|
|
6
9
|
import {
|
|
7
10
|
E10ApiError,
|
|
8
11
|
createE10RequestRuntime,
|
|
9
12
|
isE10SessionExpiredResponse,
|
|
10
13
|
requireE10Session
|
|
11
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-6NXT4ICB.js";
|
|
12
15
|
import {
|
|
13
16
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
14
17
|
getActiveProfile
|
|
15
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-U6R6FZHD.js";
|
|
16
19
|
import {
|
|
17
20
|
CliError,
|
|
18
21
|
isCliError,
|
|
19
22
|
toErrorEnvelope
|
|
20
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-UG5G54VL.js";
|
|
21
24
|
import "./chunk-BUSC6UAE.js";
|
|
22
25
|
|
|
23
26
|
// src/shortcuts/recruit-stage/index.ts
|
|
@@ -111,7 +114,7 @@ function signature(payload, key) {
|
|
|
111
114
|
}
|
|
112
115
|
function createRecruitStageContinuationSigner(ctx) {
|
|
113
116
|
return {
|
|
114
|
-
async issue(payload, ttlMs =
|
|
117
|
+
async issue(payload, ttlMs = CONTINUATION_TTL_MS) {
|
|
115
118
|
const issuedAt = Date.now();
|
|
116
119
|
const body = encode({ ...payload, issuedAt, expiresAt: issuedAt + ttlMs });
|
|
117
120
|
const sig = signature(body, await loadKey(ctx));
|
|
@@ -272,6 +275,9 @@ function schemaOf(properties, options = {}) {
|
|
|
272
275
|
|
|
273
276
|
// src/shortcuts/recruit-stage/shared.ts
|
|
274
277
|
import { randomUUID } from "node:crypto";
|
|
278
|
+
import { unlinkSync } from "node:fs";
|
|
279
|
+
import { homedir as homedir2 } from "node:os";
|
|
280
|
+
import { join, resolve as resolvePath } from "node:path";
|
|
275
281
|
function randHex32() {
|
|
276
282
|
return randomUUID().replace(/-/g, "");
|
|
277
283
|
}
|
|
@@ -344,6 +350,32 @@ async function getFormButtons(host, objId, layoutId) {
|
|
|
344
350
|
}
|
|
345
351
|
return actions;
|
|
346
352
|
}
|
|
353
|
+
async function probeCreatePermission(host, objId) {
|
|
354
|
+
try {
|
|
355
|
+
const r = await host.request({
|
|
356
|
+
path: "/api/ebuilder/form/data/getFormButtons",
|
|
357
|
+
body: {
|
|
358
|
+
layoutType: "formLayout",
|
|
359
|
+
objId,
|
|
360
|
+
dataId: "",
|
|
361
|
+
formDataId: "",
|
|
362
|
+
type: "1",
|
|
363
|
+
fromRecycle: false,
|
|
364
|
+
otherOperator: "",
|
|
365
|
+
objectAppId: "",
|
|
366
|
+
browser: "Chrome",
|
|
367
|
+
isTamper: "0"
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
const d = r?.data;
|
|
371
|
+
const btns = Array.isArray(d) ? d : d?.buttons || [];
|
|
372
|
+
if (!Array.isArray(btns) || !btns.length) return "unknown";
|
|
373
|
+
const hasSave = btns.some((b) => String(b?.buttonKey || "").toLowerCase().includes("save") || String(b?.name || "").includes("\u4FDD\u5B58"));
|
|
374
|
+
return hasSave ? "ok" : "denied";
|
|
375
|
+
} catch {
|
|
376
|
+
return "unknown";
|
|
377
|
+
}
|
|
378
|
+
}
|
|
347
379
|
function pickSaveButtonActions(actions, { includeDisabled = false } = {}) {
|
|
348
380
|
const all = actions || [];
|
|
349
381
|
let own = all.filter((a) => a._buttonKey === "save");
|
|
@@ -530,23 +562,114 @@ async function resolvePersonId(host, fieldId, keyword) {
|
|
|
530
562
|
const list = r?.data?.data || r?.data || [];
|
|
531
563
|
return list[0]?.id || list[0]?.value || null;
|
|
532
564
|
}
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
for (const x of list) map[x.name] = x.id;
|
|
541
|
-
return map;
|
|
565
|
+
var dsOptionsMemo = /* @__PURE__ */ new Map();
|
|
566
|
+
function restoreDsOptions(snapshot) {
|
|
567
|
+
for (const [key, value] of Object.entries(snapshot || {})) {
|
|
568
|
+
if (value && typeof value === "object" && Object.keys(value).length) {
|
|
569
|
+
dsOptionsMemo.set(key, Promise.resolve(value));
|
|
570
|
+
}
|
|
571
|
+
}
|
|
542
572
|
}
|
|
543
|
-
function
|
|
544
|
-
const
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
573
|
+
async function dsOptionsSnapshot() {
|
|
574
|
+
const out = {};
|
|
575
|
+
await Promise.all([...dsOptionsMemo.entries()].map(async ([key, task]) => {
|
|
576
|
+
try {
|
|
577
|
+
const value = await task;
|
|
578
|
+
if (value && Object.keys(value).length) out[key] = value;
|
|
579
|
+
} catch {
|
|
580
|
+
}
|
|
581
|
+
}));
|
|
582
|
+
return out;
|
|
583
|
+
}
|
|
584
|
+
function expectedFields(details, fields, keys, nonEmptyOnly = [], optionalKeys = []) {
|
|
585
|
+
const out = [];
|
|
586
|
+
for (const k of keys) {
|
|
587
|
+
const fid = fields[k];
|
|
588
|
+
if (!fid) continue;
|
|
589
|
+
const d = (details || []).find((x) => String(x?.formField?.id) === String(fid));
|
|
590
|
+
if (!d) continue;
|
|
591
|
+
const value = String((d.dataOptions || [])[0]?.optionId ?? d.content ?? d.dataText?.content ?? d.value ?? "");
|
|
592
|
+
const optional = optionalKeys.includes(k);
|
|
593
|
+
if (nonEmptyOnly.includes(k)) out.push({ fieldId: String(fid), label: k, expected: "*", optional });
|
|
594
|
+
else if (value) out.push({ fieldId: String(fid), label: k, expected: value, optional });
|
|
595
|
+
}
|
|
596
|
+
return out;
|
|
597
|
+
}
|
|
598
|
+
async function verifySubmitted(opts) {
|
|
599
|
+
const { host, formId, objId, dataId, expected } = opts;
|
|
600
|
+
if (!expected.length) return { checked: 0, mismatches: [] };
|
|
601
|
+
let details = [];
|
|
602
|
+
try {
|
|
603
|
+
const r = await host.request({
|
|
604
|
+
path: "/api/ebuilder/form/form/core/getFormDataAndLayout?formId=" + encodeURIComponent(formId) + "&dataId=" + encodeURIComponent(dataId),
|
|
605
|
+
method: "POST",
|
|
606
|
+
body: {
|
|
607
|
+
terminalType: "PC",
|
|
608
|
+
dataId,
|
|
609
|
+
formId,
|
|
610
|
+
module: "ebuilderform",
|
|
611
|
+
newLayout: true,
|
|
612
|
+
cacheUid: "",
|
|
613
|
+
layoutMultiId: "",
|
|
614
|
+
dataCrossLayout: false,
|
|
615
|
+
permissionId: "",
|
|
616
|
+
allReadOnly: false,
|
|
617
|
+
initialDatas: [],
|
|
618
|
+
dynamicData: false,
|
|
619
|
+
cost: false,
|
|
620
|
+
customParam: { objId }
|
|
621
|
+
}
|
|
622
|
+
});
|
|
623
|
+
details = r?.data?.formData?.dataDetails || [];
|
|
624
|
+
} catch (e) {
|
|
625
|
+
return { checked: 0, mismatches: [], unavailable: e?.message || "\u56DE\u67E5\u63A5\u53E3\u4E0D\u53EF\u7528" };
|
|
626
|
+
}
|
|
627
|
+
const byId = /* @__PURE__ */ new Map();
|
|
628
|
+
for (const d of details) {
|
|
629
|
+
const fid = String(d?.fieldId || d?.formField?.id || "");
|
|
630
|
+
if (fid) byId.set(fid, d);
|
|
631
|
+
}
|
|
632
|
+
const mismatches = [];
|
|
633
|
+
for (const e of expected) {
|
|
634
|
+
const d = byId.get(e.fieldId);
|
|
635
|
+
if (!d && e.optional) continue;
|
|
636
|
+
const actual = d ? String((d.dataOptions || [])[0]?.optionId ?? d.content ?? d.dataText?.content ?? d.value ?? "") : "";
|
|
637
|
+
const bad = e.expected === "*" ? !actual : actual !== e.expected;
|
|
638
|
+
if (bad) mismatches.push({ label: e.label, expected: e.expected === "*" ? "\uFF08\u975E\u7A7A\uFF09" : e.expected, actual: actual || "\uFF08\u7A7A\uFF09" });
|
|
639
|
+
}
|
|
640
|
+
return { checked: expected.length, mismatches };
|
|
641
|
+
}
|
|
642
|
+
function invalidateEnvCache(baseUrl, appId) {
|
|
643
|
+
dsOptionsMemo.clear();
|
|
644
|
+
if (!baseUrl || !appId) return;
|
|
645
|
+
try {
|
|
646
|
+
const host = baseUrl.replace(/^https?:\/\//, "").replace(/\/+$/, "").replace(/:/g, "_");
|
|
647
|
+
const home = process.env.WEAVER_WORK_CLI_HOME || process.env.WORK_CLI_HOME || resolvePath(homedir2(), ".weaver-work-cli");
|
|
648
|
+
const root = process.env.E10_SKILL_CACHE_DIR || join(home, "env-cache", "recruit-ops");
|
|
649
|
+
unlinkSync(join(root, host, appId + ".json"));
|
|
650
|
+
} catch {
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
async function getDsOptions(host, objId, fieldId, groupId = "") {
|
|
654
|
+
const key = objId + ":" + fieldId;
|
|
655
|
+
const hit = dsOptionsMemo.get(key);
|
|
656
|
+
if (hit) return hit;
|
|
657
|
+
const task = (async () => {
|
|
658
|
+
const r = await host.request({
|
|
659
|
+
path: "/api/ebuilder/common/ds/options?fieldName=" + fieldId + "&objId=" + objId + "&sourceType=FORM" + (groupId ? "&groupId=" + groupId : ""),
|
|
660
|
+
method: "GET"
|
|
661
|
+
});
|
|
662
|
+
const list = r?.data || [];
|
|
663
|
+
const map = {};
|
|
664
|
+
for (const x of list) if (x?.name && x?.id) map[String(x.name)] = String(x.id);
|
|
665
|
+
if (!Object.keys(map).length) dsOptionsMemo.delete(key);
|
|
666
|
+
return map;
|
|
667
|
+
})();
|
|
668
|
+
dsOptionsMemo.set(key, task);
|
|
669
|
+
task.catch(() => {
|
|
670
|
+
dsOptionsMemo.delete(key);
|
|
671
|
+
});
|
|
672
|
+
return task;
|
|
550
673
|
}
|
|
551
674
|
async function getFormButtonsForData(host, objId, formId, dataId, layoutId) {
|
|
552
675
|
const body = {
|
|
@@ -747,10 +870,9 @@ function buildCardUrl(baseUrl, objId, dataId) {
|
|
|
747
870
|
if (!baseUrl || !objId || !dataId) return null;
|
|
748
871
|
return String(baseUrl).replace(/\/+$/, "") + "/sp/ebdfpage/card/0/" + objId + "/" + dataId;
|
|
749
872
|
}
|
|
750
|
-
function
|
|
751
|
-
if (!baseUrl || !listId
|
|
752
|
-
|
|
753
|
-
return `${base}/sp/ebdfpage/list/${listId}/card/0/${objId}/${dataId}/${listId}?id=${dataId}&openSource=field&openSourceId=${dataId}&openSourceAppId=${appId}`;
|
|
873
|
+
function buildListUrl(baseUrl, listId) {
|
|
874
|
+
if (!baseUrl || !listId) return null;
|
|
875
|
+
return String(baseUrl).replace(/\/+$/, "") + "/sp/ebdfpage/list/" + listId;
|
|
754
876
|
}
|
|
755
877
|
|
|
756
878
|
// src/shortcuts/recruit-stage/operations/jd-create.ts
|
|
@@ -765,11 +887,11 @@ var DEF_FROM_REF = [
|
|
|
765
887
|
"job_category",
|
|
766
888
|
"education",
|
|
767
889
|
"work_years",
|
|
768
|
-
"work_location",
|
|
769
890
|
"salary_min",
|
|
770
891
|
"salary_max"
|
|
771
892
|
];
|
|
772
893
|
var DEF_STATUS = "\u62DB\u8058\u4E2D";
|
|
894
|
+
var DEFAULT_WORK_LOCATION = "\u6D66\u6C5F\u9547\u4E09\u9C81\u516C\u8DEF3419\u53F7\u6CDB\u5FAE\u8F6F\u4EF6\u56ED";
|
|
773
895
|
var NUM_KEYS = /* @__PURE__ */ new Set(["recruit_count", "number_of_pay_months", "salary_min", "salary_max", "internship_duration", "working_days"]);
|
|
774
896
|
var PERSON_KEYS = /* @__PURE__ */ new Set(["recr_principal", "recr_helper", "employ_manager", "interviewer"]);
|
|
775
897
|
var OPTION_KEYS = /* @__PURE__ */ new Set(["salary_type", "recruit_type", "status"]);
|
|
@@ -842,46 +964,143 @@ function refToSubmit(d) {
|
|
|
842
964
|
else return null;
|
|
843
965
|
return o;
|
|
844
966
|
}
|
|
845
|
-
|
|
967
|
+
var WORK_PLACE_NAMES = ["\u529E\u516C\u5730\u70B9", "\u5DE5\u4F5C\u5730\u70B9"];
|
|
968
|
+
async function findWorkPlaceMenu(ctx) {
|
|
846
969
|
const { host, appId, cache } = ctx;
|
|
847
|
-
const
|
|
848
|
-
const
|
|
849
|
-
const
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
970
|
+
const ok = (m) => m && m.listId;
|
|
971
|
+
const allSearch = (cache.lists || {}).all_search || [];
|
|
972
|
+
const hit1 = allSearch.find((m) => ok(m) && WORK_PLACE_NAMES.some((n) => String(m.menuName || "").includes(n)));
|
|
973
|
+
if (hit1) return { listId: String(hit1.listId), cusMenuId: String(hit1.cusMenuId || ""), menuName: String(hit1.menuName || "") };
|
|
974
|
+
const hit2 = findMenuNode(cache.menus || [], WORK_PLACE_NAMES, (m) => ok(m));
|
|
975
|
+
if (hit2) return { listId: String(hit2.listId), cusMenuId: String(hit2.cusMenuId || ""), menuName: String(hit2.menuName || "") };
|
|
976
|
+
try {
|
|
977
|
+
const r = await host.request({ path: `/api/cusapp/app/allMenus?isFront=1&appId=${appId}&terminalType=PC`, method: "GET" });
|
|
978
|
+
const flat = [];
|
|
979
|
+
(function walk(ns) {
|
|
980
|
+
for (const n of ns || []) if (n && typeof n === "object") {
|
|
981
|
+
flat.push(n);
|
|
982
|
+
walk(n.children || n.childs);
|
|
983
|
+
}
|
|
984
|
+
})(r?.data?.cusAppMenus || r?.data);
|
|
985
|
+
const hit3 = findMenuNode(flat, WORK_PLACE_NAMES, (m) => ok(m));
|
|
986
|
+
if (hit3) return { listId: String(hit3.listId), cusMenuId: String(hit3.cusMenuId || ""), menuName: String(hit3.menuName || "") };
|
|
987
|
+
} catch {
|
|
988
|
+
}
|
|
989
|
+
return null;
|
|
990
|
+
}
|
|
991
|
+
var workPlaceMemo = /* @__PURE__ */ new Map();
|
|
992
|
+
function stripHtml(s) {
|
|
993
|
+
return String(s ?? "").replace(/<[^>]*>/g, "").trim();
|
|
994
|
+
}
|
|
995
|
+
function parseSpans(raw) {
|
|
996
|
+
try {
|
|
997
|
+
const v = Array.isArray(raw) ? raw : JSON.parse(String(raw || "[]"));
|
|
998
|
+
return Array.isArray(v) ? v : [];
|
|
999
|
+
} catch {
|
|
1000
|
+
return [];
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
function isEnabledText(s) {
|
|
1004
|
+
const t = stripHtml(s);
|
|
1005
|
+
return t.includes("\u542F\u7528") && !t.includes("\u7981\u7528");
|
|
1006
|
+
}
|
|
1007
|
+
async function loadWorkPlaces(ctx) {
|
|
1008
|
+
const { host, appId } = ctx;
|
|
1009
|
+
const menu = await findWorkPlaceMenu(ctx);
|
|
1010
|
+
if (!menu) return { rows: [], statusFiltered: false };
|
|
1011
|
+
const key = appId + "|" + menu.listId;
|
|
1012
|
+
const cached = workPlaceMemo.get(key);
|
|
1013
|
+
if (cached) return cached;
|
|
1014
|
+
const [tagObjId] = await Promise.all([
|
|
1015
|
+
host.request({ path: `/api/ebuilder/form/obj/getObjsByTag?appId=${appId}&tag=uf_rcrt_work_place`, method: "GET" }).then((t) => Array.isArray(t?.data) && t.data[0] ? String(t.data[0].id || "") : "").catch(() => "")
|
|
1016
|
+
]);
|
|
1017
|
+
const pObj = tagObjId || String(menu.objId || "");
|
|
1018
|
+
if (!pObj) return { rows: [], statusFiltered: false };
|
|
1019
|
+
const pageSize = 200;
|
|
1020
|
+
const rawRows = [];
|
|
1021
|
+
const dispRows = [];
|
|
1022
|
+
for (let page = 1; page <= 5; page++) {
|
|
1023
|
+
const body = {
|
|
1024
|
+
current: page,
|
|
1025
|
+
pageSize,
|
|
1026
|
+
tableuid: randHex32(),
|
|
1027
|
+
listId: menu.listId,
|
|
1028
|
+
searchParamData: { searchType: "3", type: "and" },
|
|
1029
|
+
terminal: "PC",
|
|
1030
|
+
browser: "Chrome",
|
|
1031
|
+
requiredMatch: 1,
|
|
1032
|
+
mapResult: 1,
|
|
1033
|
+
recheckQuery: 1,
|
|
1034
|
+
isFollow: 0,
|
|
1035
|
+
isShareToMe: 0,
|
|
1036
|
+
filterCondition: {},
|
|
1037
|
+
cusMenuId: menu.cusMenuId,
|
|
1038
|
+
urlPageTitle: menu.menuName,
|
|
1039
|
+
menuName: menu.menuName
|
|
1040
|
+
};
|
|
1041
|
+
const r = await host.request({
|
|
1042
|
+
path: `/api/ebuilder/form/list/getListDatas?passid=${pObj}&cid=${pObj}`,
|
|
1043
|
+
body,
|
|
1044
|
+
headers: { ebBusinessId: menu.listId }
|
|
1045
|
+
});
|
|
1046
|
+
const batch = r?.data?.data || r?.data?.displayData || [];
|
|
1047
|
+
rawRows.push(...batch);
|
|
1048
|
+
dispRows.push(...r?.data?.displayData || []);
|
|
1049
|
+
if (batch.length < pageSize) break;
|
|
1050
|
+
}
|
|
1051
|
+
const enabledStatusIds = /* @__PURE__ */ new Set();
|
|
1052
|
+
const enabledRowIds = /* @__PURE__ */ new Set();
|
|
1053
|
+
for (const d of dispRows) {
|
|
1054
|
+
const rid = String(d?.form_data_id || d?.id || "");
|
|
1055
|
+
if (isEnabledText(d?.place_status) && rid) enabledRowIds.add(rid);
|
|
1056
|
+
for (const s of parseSpans(d?.place_statusSpan)) {
|
|
1057
|
+
if (isEnabledText(s?.name) && s?.id) enabledStatusIds.add(String(s.id));
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
const statusFiltered = enabledRowIds.size > 0 || enabledStatusIds.size > 0;
|
|
1061
|
+
const rows = rawRows.filter((x) => !statusFiltered || enabledRowIds.has(String(x?.form_data_id || x?.id || "")) || enabledStatusIds.has(String(x?.place_status || ""))).map((x) => ({
|
|
1062
|
+
id: String(x?.form_data_id || x?.id || ""),
|
|
1063
|
+
name: String(x?.name || ""),
|
|
1064
|
+
detail: String(x?.detail_location || ""),
|
|
1065
|
+
area: String(x?.area_text || ""),
|
|
1066
|
+
city: String(x?.city || "")
|
|
1067
|
+
})).filter((x) => !!x.id);
|
|
1068
|
+
const out = { rows, statusFiltered };
|
|
1069
|
+
workPlaceMemo.set(key, out);
|
|
1070
|
+
return out;
|
|
1071
|
+
}
|
|
1072
|
+
function matchWorkPlace(rows, value) {
|
|
872
1073
|
const v = String(value).trim();
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
return
|
|
1074
|
+
if (!v || !rows.length) return null;
|
|
1075
|
+
const exact = rows.find((r) => r.detail === v) || rows.find((r) => r.name === v);
|
|
1076
|
+
if (exact) return exact;
|
|
1077
|
+
const valid = (s) => s.length >= 4 && !/^\d+$/.test(s);
|
|
1078
|
+
return rows.find((r) => r.detail.includes(v) && valid(r.detail) || r.name.includes(v) && valid(r.name) || r.area.includes(v) && valid(r.area) || v.includes(r.detail) && valid(r.detail)) || null;
|
|
1079
|
+
}
|
|
1080
|
+
async function resolveWorkLocation(ctx, value) {
|
|
1081
|
+
if (!String(value).trim()) return null;
|
|
1082
|
+
const { rows } = await loadWorkPlaces(ctx);
|
|
1083
|
+
const hit = matchWorkPlace(rows, value);
|
|
1084
|
+
return hit ? { id: hit.id, name: hit.detail || hit.name || String(value) } : null;
|
|
1085
|
+
}
|
|
1086
|
+
async function resolveDefaultWorkLocation(ctx) {
|
|
1087
|
+
return resolveWorkLocation(ctx, DEFAULT_WORK_LOCATION);
|
|
878
1088
|
}
|
|
879
1089
|
async function resolveSetValue(ctx, key, value, refByFid) {
|
|
880
1090
|
const { host, appId, cache } = ctx;
|
|
881
1091
|
const objId = objIdOf(cache, "position_manage");
|
|
882
1092
|
const id = (cache.fields[objId] || {})[key];
|
|
883
1093
|
if (!id) return null;
|
|
884
|
-
if (NUM_KEYS.has(key))
|
|
1094
|
+
if (NUM_KEYS.has(key)) {
|
|
1095
|
+
if (key === "salary_min" || key === "salary_max") {
|
|
1096
|
+
const n = Number(String(value).replace(/,/g, ""));
|
|
1097
|
+
if (Number.isFinite(n) && n > 0) {
|
|
1098
|
+
const k = n / 1e3;
|
|
1099
|
+
return { formField: { id }, content: String(Number.isInteger(k) ? k : Number(k.toFixed(3))) };
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
return { formField: { id }, content: String(value) };
|
|
1103
|
+
}
|
|
885
1104
|
if (MTEXT_KEYS.has(key)) return { formField: { id }, dataText: { content: String(value) } };
|
|
886
1105
|
if (key === "position_name") return { formField: { id }, content: String(value) };
|
|
887
1106
|
if (PERSON_KEYS.has(key)) {
|
|
@@ -889,7 +1108,7 @@ async function resolveSetValue(ctx, key, value, refByFid) {
|
|
|
889
1108
|
return uid ? { formField: { id }, dataOptions: [{ optionId: String(uid), content: value }] } : null;
|
|
890
1109
|
}
|
|
891
1110
|
if (OPTION_KEYS.has(key)) {
|
|
892
|
-
const m =
|
|
1111
|
+
const m = await getDsOptions(host, objId, id);
|
|
893
1112
|
const oid = m[value];
|
|
894
1113
|
return oid ? { formField: { id }, dataOptions: [{ optionId: String(oid), content: value }] } : null;
|
|
895
1114
|
}
|
|
@@ -1042,6 +1261,7 @@ async function buildJd(opts) {
|
|
|
1042
1261
|
const fid = (k) => fields[k];
|
|
1043
1262
|
for (const k of DATAKEYS_TEXT) if (!fid(k)) throw rsFail("\u804C\u4F4D\u7BA1\u7406\u7F3A\u5C11\u5B57\u6BB5 " + k + "\uFF08ds/fields \u89E3\u6790\u4E0D\u5230\uFF09");
|
|
1044
1263
|
for (const k of DATAKEYS_MTEXT) if (!fid(k)) throw rsFail("\u804C\u4F4D\u7BA1\u7406\u7F3A\u5C11\u5B57\u6BB5 " + k + "\uFF08ds/fields \u89E3\u6790\u4E0D\u5230\uFF09");
|
|
1264
|
+
const currentUserPromise = resolveCurrentUser(host).catch(() => null);
|
|
1045
1265
|
const refByFid = await fetchRefByFid(ctx);
|
|
1046
1266
|
const map = /* @__PURE__ */ new Map();
|
|
1047
1267
|
const put = (d) => {
|
|
@@ -1060,8 +1280,10 @@ async function buildJd(opts) {
|
|
|
1060
1280
|
}
|
|
1061
1281
|
const appliedSets = [];
|
|
1062
1282
|
const skippedSets = [];
|
|
1063
|
-
|
|
1064
|
-
|
|
1283
|
+
const resolvedSets = await Promise.all(
|
|
1284
|
+
sets.map(async ([k, v]) => ({ k, v, d: await resolveSetValue(ctx, k, v, refByFid).catch(() => null) }))
|
|
1285
|
+
);
|
|
1286
|
+
for (const { k, v, d } of resolvedSets) {
|
|
1065
1287
|
if (d) {
|
|
1066
1288
|
put(d);
|
|
1067
1289
|
appliedSets.push(k + "=" + v);
|
|
@@ -1071,7 +1293,7 @@ async function buildJd(opts) {
|
|
|
1071
1293
|
}
|
|
1072
1294
|
if (!hasKey("status")) {
|
|
1073
1295
|
if (!fid("status")) throw rsFail("\u804C\u4F4D\u7BA1\u7406\u7F3A\u5C11\u5B57\u6BB5 status\uFF08ds/fields \u89E3\u6790\u4E0D\u5230\uFF09");
|
|
1074
|
-
const statusMap =
|
|
1296
|
+
const statusMap = await getDsOptions(host, objId, fid("status"));
|
|
1075
1297
|
const statusId = statusMap[DEF_STATUS];
|
|
1076
1298
|
if (!statusId) throw rsFail("\u804C\u4F4D\u7BA1\u7406\u300C\u62DB\u8058\u72B6\u6001\u300D\u672A\u89E3\u6790\u5230\u300C" + DEF_STATUS + "\u300D\u9009\u9879\uFF08ds/options \u8FD4\u56DE\u4E3A\u7A7A\uFF09");
|
|
1077
1299
|
put({ formField: { id: fid("status") }, dataOptions: [{ optionId: String(statusId), content: DEF_STATUS }] });
|
|
@@ -1083,7 +1305,7 @@ async function buildJd(opts) {
|
|
|
1083
1305
|
const filled = [];
|
|
1084
1306
|
let currentUser = null;
|
|
1085
1307
|
if (DEF_CURRENT_USER.some((k) => fid(k) && !hasKey(k))) {
|
|
1086
|
-
currentUser = await
|
|
1308
|
+
currentUser = await currentUserPromise;
|
|
1087
1309
|
if (currentUser && currentUser.id) {
|
|
1088
1310
|
for (const k of DEF_CURRENT_USER) {
|
|
1089
1311
|
if (fid(k) && !hasKey(k)) {
|
|
@@ -1101,7 +1323,7 @@ async function buildJd(opts) {
|
|
|
1101
1323
|
}
|
|
1102
1324
|
for (const [k, name] of Object.entries(DEF_OPTION)) {
|
|
1103
1325
|
if (fid(k) && !hasKey(k)) {
|
|
1104
|
-
const m =
|
|
1326
|
+
const m = await getDsOptions(host, objId, fid(k));
|
|
1105
1327
|
const oid = m[name];
|
|
1106
1328
|
if (oid) {
|
|
1107
1329
|
put({ formField: { id: fid(k) }, dataOptions: [{ optionId: String(oid), content: name }] });
|
|
@@ -1109,6 +1331,7 @@ async function buildJd(opts) {
|
|
|
1109
1331
|
}
|
|
1110
1332
|
}
|
|
1111
1333
|
}
|
|
1334
|
+
const inheritedFromRef = [];
|
|
1112
1335
|
for (const k of DEF_FROM_REF) {
|
|
1113
1336
|
const id = fid(k);
|
|
1114
1337
|
if (id && !map.has(String(id)) && refByFid[String(id)]) {
|
|
@@ -1116,9 +1339,31 @@ async function buildJd(opts) {
|
|
|
1116
1339
|
if (d) {
|
|
1117
1340
|
put(d);
|
|
1118
1341
|
filled.push(k);
|
|
1342
|
+
inheritedFromRef.push({ field: k, value: detailValueId(refByFid[String(id)]) });
|
|
1119
1343
|
}
|
|
1120
1344
|
}
|
|
1121
1345
|
}
|
|
1346
|
+
const inheritedSalaryWarnings = [];
|
|
1347
|
+
for (const key of ["salary_min", "salary_max"]) {
|
|
1348
|
+
const hit = inheritedFromRef.find((x) => x.field === key);
|
|
1349
|
+
if (!hit) continue;
|
|
1350
|
+
const num = Number(String(hit.value).replace(/[^\d.]/g, ""));
|
|
1351
|
+
if (hit.value && Number.isFinite(num) && (num < 1 || num > 100)) {
|
|
1352
|
+
inheritedSalaryWarnings.push(key + " \u7EE7\u627F\u503C\u300C" + hit.value + "\u300D\uFF08\u5343\u5143\uFF09\u660E\u663E\u5F02\u5E38\uFF0C\u8BF7\u4EBA\u5DE5\u6838\u5BF9\u540E\u518D\u63D0\u4EA4");
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
let workLocationDefault = null;
|
|
1356
|
+
let workLocationWarning = null;
|
|
1357
|
+
if (!hasKey("work_location") && fid("work_location")) {
|
|
1358
|
+
const loc = await resolveDefaultWorkLocation(ctx).catch(() => null);
|
|
1359
|
+
if (loc) {
|
|
1360
|
+
put({ formField: { id: fid("work_location") }, dataOptions: [{ optionId: loc.id, content: loc.name }] });
|
|
1361
|
+
filled.push("work_location");
|
|
1362
|
+
workLocationDefault = loc.name;
|
|
1363
|
+
} else {
|
|
1364
|
+
workLocationWarning = `\u672A\u5728\u300C\u529E\u516C\u5730\u70B9\u300D\u5217\u8868\u627E\u5230\u542F\u7528\u72B6\u6001\u7684\u9ED8\u8BA4\u5730\u70B9\u300C${DEFAULT_WORK_LOCATION}\u300D\uFF0C\u672C\u6B21\u4E0D\u5199 work_location\uFF1B\u8BF7\u7528 sets \u6307\u5B9A`;
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1122
1367
|
const inv = {};
|
|
1123
1368
|
for (const [k, v] of Object.entries(fields)) inv[String(v)] = k;
|
|
1124
1369
|
const requiredDefaultsFilled = [...map.keys()].map((f) => inv[f] || f).filter((k) => filled.includes(k));
|
|
@@ -1134,10 +1379,18 @@ async function buildJd(opts) {
|
|
|
1134
1379
|
requestLen: (requestText || "").length,
|
|
1135
1380
|
demand: demandId ? demandName || demandId : "\uFF08\u672A\u5173\u8054\u9700\u6C42\uFF09",
|
|
1136
1381
|
status: DEF_STATUS,
|
|
1137
|
-
|
|
1382
|
+
// 解析不到环境默认流程时不写该字段,表单自身默认值生效;文案按实际行为表述,避免误导。
|
|
1383
|
+
recruitFlow: defFlow && defFlow.id ? defFlow.name : "\uFF08\u6CBF\u7528\u8868\u5355\u9ED8\u8BA4\u503C\uFF09",
|
|
1138
1384
|
currentUser: currentUser ? currentUser.name : null,
|
|
1139
1385
|
setApplied: appliedSets,
|
|
1140
1386
|
setSkipped: skippedSets,
|
|
1387
|
+
// 明示哪些字段值继承自「环境内最近一条职位记录」——这些不是用户指定的,可能来自脏数据,
|
|
1388
|
+
// 必须在确认摘要里人工核对(工作地点不参与继承,见 workLocationDefault)
|
|
1389
|
+
inheritedFromRef: inheritedFromRef.length ? inheritedFromRef : void 0,
|
|
1390
|
+
inheritedSalaryWarnings: inheritedSalaryWarnings.length ? inheritedSalaryWarnings : void 0,
|
|
1391
|
+
inheritedNote: inheritedFromRef.length ? "\u4EE5\u4E0A\u5B57\u6BB5\u672A\u6307\u5B9A\uFF0C\u503C\u7EE7\u627F\u81EA\u73AF\u5883\u5185\u6700\u8FD1\u4E00\u6761\u804C\u4F4D\u8BB0\u5F55\uFF0C\u53EF\u80FD\u542B\u5386\u53F2\u810F\u6570\u636E\uFF0C\u8BF7\u6838\u5BF9\u540E\u518D\u63D0\u4EA4\uFF08\u5DE5\u4F5C\u5730\u70B9\u4E0D\u53C2\u4E0E\u7EE7\u627F\uFF09" : void 0,
|
|
1392
|
+
workLocationDefault: workLocationDefault || void 0,
|
|
1393
|
+
workLocationWarning: workLocationWarning || void 0,
|
|
1141
1394
|
requiredDefaultsFilled
|
|
1142
1395
|
}
|
|
1143
1396
|
};
|
|
@@ -1164,6 +1417,8 @@ async function prepare(args, env) {
|
|
|
1164
1417
|
const session = await host.getSession();
|
|
1165
1418
|
const ctx = { host, baseUrl: session.baseUrl.replace(/\/+$/, ""), appId: "", cache: await env.recruitContext() };
|
|
1166
1419
|
ctx.appId = ctx.cache.appId;
|
|
1420
|
+
const perm = await probeCreatePermission(ctx.host, objIdOf(ctx.cache, "position_manage"));
|
|
1421
|
+
if (perm === "denied") throw rsFail("\u5F53\u524D\u8D26\u53F7\u6CA1\u6709\u300C\u804C\u4F4D\u7BA1\u7406\u300D\u8868\u5355\u7684\u521B\u5EFA\u6743\u9650\uFF0C\u5DF2\u963B\u65AD\uFF08\u672A\u5199\u5165\u4EFB\u4F55\u6570\u636E\uFF09");
|
|
1167
1422
|
const positionName = String(args.positionName || "").trim();
|
|
1168
1423
|
if (!positionName) throw rsValidationError("position_name_required", "positionName \u5FC5\u586B");
|
|
1169
1424
|
const jd = await buildJd({
|
|
@@ -1175,16 +1430,36 @@ async function prepare(args, env) {
|
|
|
1175
1430
|
demandName: args.demandName ? String(args.demandName) : void 0,
|
|
1176
1431
|
sets: setsOf(args)
|
|
1177
1432
|
});
|
|
1178
|
-
const refs = await fetchRecentReferences(ctx, jd, String(args.referenceKeyword
|
|
1433
|
+
const refs = args.referenceKeyword ? await fetchRecentReferences(ctx, jd, String(args.referenceKeyword)).catch((e) => ({ available: false, reason: e.message, items: [] })) : {
|
|
1434
|
+
available: false,
|
|
1435
|
+
skipped: true,
|
|
1436
|
+
reason: "\u672A\u663E\u5F0F\u6307\u5B9A referenceKeyword\uFF0C\u5DF2\u8DF3\u8FC7\u540C\u7C7B\u804C\u4F4D\u53C2\u8003\u68C0\u7D22\uFF08\u6539\u7528 references/position-templates.md \u7684\u5C97\u4F4D\u6A21\u677F\uFF09",
|
|
1437
|
+
items: []
|
|
1438
|
+
};
|
|
1179
1439
|
const willSubmit = { formId: jd.formId, objId: jd.objId, dataDetails: jd.dataDetails };
|
|
1180
1440
|
const fp = fingerprint(willSubmit);
|
|
1181
|
-
const continuation = await env.continuation.issue({
|
|
1441
|
+
const continuation = await env.continuation.issue({
|
|
1442
|
+
operation: "recruit-stage.jd.create.apply",
|
|
1443
|
+
fingerprint: fp,
|
|
1444
|
+
enumMaps: await dsOptionsSnapshot()
|
|
1445
|
+
});
|
|
1446
|
+
const invFieldKeys = {};
|
|
1447
|
+
for (const [k, v] of Object.entries(ctx.cache.fields[jd.objId] || {})) invFieldKeys[String(v)] = k;
|
|
1182
1448
|
return rsSuccess("recruit-stage.jd.create.prepare", {
|
|
1183
1449
|
mode: "prepare",
|
|
1450
|
+
continuation,
|
|
1451
|
+
fingerprint: fp,
|
|
1184
1452
|
...jd.summary,
|
|
1185
1453
|
recentReferences: refs.items,
|
|
1186
|
-
recentReferencesNote: refs.available ? `\u5DF2\u6309\u300C${refs.keyword}\u300D\u5728\u5F53\u524D\u73AF\u5883\u804C\u4F4D\u5217\u8868\u4E2D\u68C0\u7D22\uFF08\u626B\u63CF ${refs.scanned} \u6761\uFF0C\u547D\u4E2D ${refs.items.length} \u6761\uFF09\u2014\u2014\u8BF7\u5BF9\u6807\u8FD9\u4E9B\u540C\u7C7B\u804C\u4F4D\u7684\u85AA\u916C/\u4EBA\u6570/\u8981\u6C42\u7ED9\u51FA\u63A8\u8350\u503C\uFF0C\u4E00\u5E76\u653E\u8FDB\u786E\u8BA4\u6458\u8981\uFF0C\u4E0D\u8981\u9010\u5B57\u6BB5\u8BE2\u95EE\u7528\u6237` : "\u53C2\u8003\u68C0\u7D22\u4E0D\u53EF\u7528\uFF1A" + (refs.reason || ""),
|
|
1187
|
-
willSubmit
|
|
1454
|
+
recentReferencesNote: refs.skipped ? refs.reason : refs.available ? `\u5DF2\u6309\u300C${refs.keyword}\u300D\u5728\u5F53\u524D\u73AF\u5883\u804C\u4F4D\u5217\u8868\u4E2D\u68C0\u7D22\uFF08\u626B\u63CF ${refs.scanned} \u6761\uFF0C\u547D\u4E2D ${refs.items.length} \u6761\uFF09\u2014\u2014\u8BF7\u5BF9\u6807\u8FD9\u4E9B\u540C\u7C7B\u804C\u4F4D\u7684\u85AA\u916C/\u4EBA\u6570/\u8981\u6C42\u7ED9\u51FA\u63A8\u8350\u503C\uFF0C\u4E00\u5E76\u653E\u8FDB\u786E\u8BA4\u6458\u8981\uFF0C\u4E0D\u8981\u9010\u5B57\u6BB5\u8BE2\u95EE\u7528\u6237` : "\u53C2\u8003\u68C0\u7D22\u4E0D\u53EF\u7528\uFF1A" + (refs.reason || ""),
|
|
1455
|
+
willSubmit: {
|
|
1456
|
+
formId: willSubmit.formId,
|
|
1457
|
+
objId: willSubmit.objId,
|
|
1458
|
+
fieldCount: willSubmit.dataDetails.length,
|
|
1459
|
+
fields: willSubmit.dataDetails.map(
|
|
1460
|
+
(d) => invFieldKeys[String(d.formField && d.formField.id)] || String(d.formField && d.formField.id)
|
|
1461
|
+
)
|
|
1462
|
+
}
|
|
1188
1463
|
}, {
|
|
1189
1464
|
continuation,
|
|
1190
1465
|
fingerprint: fp,
|
|
@@ -1195,6 +1470,7 @@ async function apply(args, env) {
|
|
|
1195
1470
|
if (args.confirm !== true) throw rsConfirmationError("recruit-stage.jd.create.apply", { hint: "\u5199\u64CD\u4F5C\u5FC5\u987B\u663E\u5F0F confirm:true" });
|
|
1196
1471
|
if (!args.continuation) throw rsValidationError("continuation_required", "\u7F3A\u5C11 continuation\uFF08\u6765\u81EA prepare \u7684 meta\uFF09");
|
|
1197
1472
|
const payload = await env.continuation.verify(String(args.continuation), "recruit-stage.jd.create.apply");
|
|
1473
|
+
restoreDsOptions(payload.enumMaps);
|
|
1198
1474
|
const host = env.host;
|
|
1199
1475
|
const session = await host.getSession();
|
|
1200
1476
|
const ctx = { host, baseUrl: session.baseUrl.replace(/\/+$/, ""), appId: "", cache: await env.recruitContext() };
|
|
@@ -1226,24 +1502,42 @@ async function apply(args, env) {
|
|
|
1226
1502
|
const positionPostId = data.positionPostId;
|
|
1227
1503
|
const checkRpa = data.checkRpa;
|
|
1228
1504
|
const rpaValidMsg = data.rpaValidMsg || null;
|
|
1229
|
-
const
|
|
1230
|
-
const
|
|
1505
|
+
const okByResponse = r2?.status !== false && r2?.fail !== false && data.fail !== true;
|
|
1506
|
+
const verification = await verifySubmitted({
|
|
1507
|
+
host,
|
|
1508
|
+
formId: jd.formId,
|
|
1509
|
+
objId: jd.objId,
|
|
1510
|
+
dataId: formDataId,
|
|
1511
|
+
expected: expectedFields(
|
|
1512
|
+
jd.dataDetails,
|
|
1513
|
+
ctx.cache.fields[jd.objId] || {},
|
|
1514
|
+
["position_name", "status", "salary_min", "salary_max", "work_location"],
|
|
1515
|
+
["position_name", "status"],
|
|
1516
|
+
["salary_min", "salary_max", "work_location"]
|
|
1517
|
+
)
|
|
1518
|
+
});
|
|
1519
|
+
if (verification.mismatches.length) invalidateEnvCache(ctx.baseUrl, ctx.appId);
|
|
1520
|
+
const recordOk = verification.unavailable ? okByResponse : verification.mismatches.length === 0;
|
|
1521
|
+
const created = okByResponse && recordOk;
|
|
1522
|
+
const result = !created ? "failed" : verification.mismatches.length ? "partial" : "success";
|
|
1523
|
+
const listUrl = buildListUrl(ctx.baseUrl, ctx.cache.lists?.position?.listId || "");
|
|
1231
1524
|
const cardUrl = buildCardUrl(ctx.baseUrl, jd.objId, formDataId);
|
|
1232
|
-
const locateUrl = buildListLocateUrl(ctx.baseUrl, ctx.appId, ctx.cache.lists?.position?.listId || "", jd.objId, formDataId);
|
|
1233
1525
|
return rsSuccess("recruit-stage.jd.create.apply", {
|
|
1234
1526
|
mode: "apply",
|
|
1235
|
-
result
|
|
1527
|
+
result,
|
|
1236
1528
|
formDataId,
|
|
1237
1529
|
positionPostId: positionPostId || null,
|
|
1238
1530
|
rpaChecked: checkRpa === void 0 ? null : !!checkRpa,
|
|
1239
1531
|
rpaValidMsg,
|
|
1240
|
-
|
|
1532
|
+
verification: { checked: verification.checked, mismatches: verification.mismatches, unavailable: verification.unavailable || null },
|
|
1533
|
+
verifyWarnings: verification.mismatches.map((m) => "\u843D\u5E93\u56DE\u67E5\u4E0D\u4E00\u81F4\uFF1A" + m.label + " \u671F\u671B " + m.expected + "\uFF0C\u5B9E\u9645 " + m.actual),
|
|
1534
|
+
positionListUrl: listUrl,
|
|
1241
1535
|
positionCardUrl: cardUrl,
|
|
1242
|
-
positionListLocateUrl:
|
|
1536
|
+
positionListLocateUrl: listUrl,
|
|
1243
1537
|
// 产物链接(Agent 原样搬运成 Markdown 链接,按顺序:详情在前、列表在后)
|
|
1244
1538
|
viewLink: cardUrl ? `[\u67E5\u770B ${jd.summary.positionName || "\u65B0\u5EFA\u804C\u4F4D"} \u804C\u4F4D\u8BE6\u60C5](${cardUrl})` : null,
|
|
1245
|
-
listLocateLink:
|
|
1246
|
-
agentNote: "\u67E5\u770B\u5165\u53E3 = \u4E24\u4E2A Markdown \u94FE\u63A5\uFF08\
|
|
1539
|
+
listLocateLink: listUrl ? `[\u6253\u5F00\u804C\u4F4D\u5217\u8868](${listUrl})` : null,
|
|
1540
|
+
agentNote: "\u67E5\u770B\u5165\u53E3 = \u4E24\u4E2A Markdown \u94FE\u63A5\uFF1A\u2460 viewLink \u804C\u4F4D\u8BE6\u60C5\u5355\u9875 \u2461 listLocateLink \u804C\u4F4D\u5217\u8868\uFF08\u53EA\u6253\u5F00\u5217\u8868\uFF0C\u4E0D\u6253\u5F00\u8BE6\u60C5\uFF09\u3002\u6309\u987A\u5E8F\u539F\u6837\u642C\u8FD0\uFF0C\u4E0D\u8981\u5305 browsertool \u6807\u7B7E\uFF1B\u7F3A\u54EA\u4E2A\u53EA\u7ED9\u53E6\u4E00\u4E2A\u3002\u94FE\u63A5\u53EA\u662F\u67E5\u770B\u5165\u53E3\uFF0C\u91CD\u590D\u70B9\u51FB\u4E0D\u4F1A\u91CD\u590D\u521B\u5EFA\u3002",
|
|
1247
1541
|
...jd.summary
|
|
1248
1542
|
});
|
|
1249
1543
|
}
|
|
@@ -1832,9 +2126,9 @@ function buildSubDetails(structured, subs, cache) {
|
|
|
1832
2126
|
const parts = Array.isArray(v) ? v : String(v).split(/[,~]/);
|
|
1833
2127
|
const s = String(parts[0] || "").trim();
|
|
1834
2128
|
const e = String(parts[1] || "").trim();
|
|
1835
|
-
if (
|
|
1836
|
-
row[col.
|
|
1837
|
-
|
|
2129
|
+
if (s) row[col.startKey] = s;
|
|
2130
|
+
if (e) row[col.endKey] = e;
|
|
2131
|
+
if (!s && !e) continue;
|
|
1838
2132
|
continue;
|
|
1839
2133
|
}
|
|
1840
2134
|
const scalar = typeof v === "object" ? String(v.optionId ?? v.content ?? "") : String(v);
|
|
@@ -1942,13 +2236,17 @@ function makeBriefReader(ctx, formId, objId, fields) {
|
|
|
1942
2236
|
}
|
|
1943
2237
|
function resolveTalentCardUrl(ctx, talentId) {
|
|
1944
2238
|
const pid = ctx.cache.ebdDetailPageId;
|
|
1945
|
-
if (!pid)
|
|
2239
|
+
if (!pid || !talentId) {
|
|
2240
|
+
const forms = ctx.cache.forms || {};
|
|
2241
|
+
const tobj = String(forms.talent_pool?.objId || forms.talent?.objId || "");
|
|
2242
|
+
return tobj && talentId ? buildCardUrl(ctx.baseUrl, tobj, String(talentId)) : null;
|
|
2243
|
+
}
|
|
1946
2244
|
return `${ctx.baseUrl}/sp/ebdpage/view/${pid}?talentId=${talentId}${talentLinkExtra(ctx.cache)}`;
|
|
1947
2245
|
}
|
|
1948
|
-
function resolveTalentListLocateUrl(ctx,
|
|
2246
|
+
function resolveTalentListLocateUrl(ctx, _talentId) {
|
|
1949
2247
|
const listId = ctx.cache.lists?.talent?.listId;
|
|
1950
|
-
if (!listId
|
|
1951
|
-
return `${ctx.baseUrl}/sp/ebdfpage/list/${listId}
|
|
2248
|
+
if (!listId) return null;
|
|
2249
|
+
return `${ctx.baseUrl.replace(/\/+$/, "")}/sp/ebdfpage/list/${listId}`;
|
|
1952
2250
|
}
|
|
1953
2251
|
async function readTalentSnapshot(ctx, opts) {
|
|
1954
2252
|
const { host, formId, objId, fields, subMeta, dataId } = opts;
|
|
@@ -2191,6 +2489,100 @@ function normalizeTextStructured(cache, s, warnings) {
|
|
|
2191
2489
|
fixRows(s.languageAbilities, ["mastery", "ls_ability", "literacy"]);
|
|
2192
2490
|
return s;
|
|
2193
2491
|
}
|
|
2492
|
+
var DATE_ONLY_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
2493
|
+
var ONGOING_RE = /至今|现在|今|now|present/i;
|
|
2494
|
+
var RE_RANGE_FULL = /^\s*(\d{4}[.\-/年]\d{1,2}[.\-/月]\d{1,2}\s*日?)\s*[-–—~至,,]\s*(\d{4}[.\-/年]\d{1,2}[.\-/月]\d{1,2}\s*日?|至今|现在|今)\s*$/;
|
|
2495
|
+
var RE_RANGE_YM = /^\s*(\d{4}[.\-/年]\d{1,2})\s*[-–—~至,,]\s*(\d{4}[.\-/年]\d{1,2}|至今|现在|今)\s*$/;
|
|
2496
|
+
function normDatePart(raw, isEnd) {
|
|
2497
|
+
const s = String(raw ?? "").trim();
|
|
2498
|
+
if (!s) return "";
|
|
2499
|
+
if (ONGOING_RE.test(s)) return "";
|
|
2500
|
+
if (DATE_ONLY_RE.test(s)) return s;
|
|
2501
|
+
const m = s.match(/^(\d{4})\s*[.\-/年]?\s*(\d{1,2})?\s*[.\-/月]?\s*(\d{1,2})?\s*日?$/);
|
|
2502
|
+
if (!m) return "";
|
|
2503
|
+
const y = Number(m[1]);
|
|
2504
|
+
const mo = m[2] ? Number(m[2]) : 1;
|
|
2505
|
+
if (!y || mo < 1 || mo > 12) return "";
|
|
2506
|
+
const lastDay = new Date(y, mo, 0).getDate();
|
|
2507
|
+
let d;
|
|
2508
|
+
if (m[3]) {
|
|
2509
|
+
d = Number(m[3]);
|
|
2510
|
+
if (d < 1 || d > lastDay) return "";
|
|
2511
|
+
} else {
|
|
2512
|
+
d = isEnd ? lastDay : 1;
|
|
2513
|
+
}
|
|
2514
|
+
return y + "-" + String(mo).padStart(2, "0") + "-" + String(d).padStart(2, "0");
|
|
2515
|
+
}
|
|
2516
|
+
function normDateRange(raw) {
|
|
2517
|
+
const s = Array.isArray(raw) ? raw.map((x) => String(x ?? "").trim()).filter(Boolean).join(",") : String(raw ?? "").trim();
|
|
2518
|
+
if (!s) return "";
|
|
2519
|
+
const m = s.match(RE_RANGE_FULL) || s.match(RE_RANGE_YM);
|
|
2520
|
+
if (m) {
|
|
2521
|
+
const a = normDatePart(m[1], false);
|
|
2522
|
+
if (!a) return "";
|
|
2523
|
+
const b = normDatePart(m[2], true);
|
|
2524
|
+
return b ? a + "," + b : a;
|
|
2525
|
+
}
|
|
2526
|
+
return normDatePart(s, false);
|
|
2527
|
+
}
|
|
2528
|
+
function normalizeDates(s, warnings) {
|
|
2529
|
+
if (!s || typeof s !== "object") return;
|
|
2530
|
+
const one = (label, val, isEnd = false) => {
|
|
2531
|
+
const before = String(val ?? "").trim();
|
|
2532
|
+
if (!before) return "";
|
|
2533
|
+
if (ONGOING_RE.test(before)) return "";
|
|
2534
|
+
const after = normDatePart(before, isEnd);
|
|
2535
|
+
if (!after) {
|
|
2536
|
+
warnings.push("\u65E5\u671F\u65E0\u6CD5\u8BC6\u522B\uFF0C\u5DF2\u8DF3\u8FC7\u8BE5\u5B57\u6BB5\uFF08\u907F\u514D\u63A5\u53E3\u6574\u6279\u6821\u9A8C\u5931\u8D25\uFF09\uFF1A" + label + " = \u300C" + before + "\u300D");
|
|
2537
|
+
return "";
|
|
2538
|
+
}
|
|
2539
|
+
if (after !== before) warnings.push("\u65E5\u671F\u5DF2\u89C4\u8303\u5316\uFF1A" + label + " \u300C" + before + "\u300D\u2192\u300C" + after + "\u300D");
|
|
2540
|
+
return after;
|
|
2541
|
+
};
|
|
2542
|
+
for (const k of ["joinworkdate", "graduate_date", "birthday"]) {
|
|
2543
|
+
if (s[k] === void 0 || s[k] === null) continue;
|
|
2544
|
+
s[k] = one(k, s[k], false);
|
|
2545
|
+
}
|
|
2546
|
+
if (Array.isArray(s.academicInformations)) {
|
|
2547
|
+
for (let i = 0; i < s.academicInformations.length; i++) {
|
|
2548
|
+
const r = s.academicInformations[i];
|
|
2549
|
+
if (!r || typeof r !== "object" || r.study_date === void 0) continue;
|
|
2550
|
+
const before = String(r.study_date ?? "").trim();
|
|
2551
|
+
if (!before) continue;
|
|
2552
|
+
const after = normDateRange(before);
|
|
2553
|
+
if (!after) {
|
|
2554
|
+
warnings.push("\u65E5\u671F\u533A\u95F4\u65E0\u6CD5\u8BC6\u522B\uFF0C\u5DF2\u8DF3\u8FC7\uFF08\u907F\u514D\u63A5\u53E3\u6574\u6279\u6821\u9A8C\u5931\u8D25\uFF09\uFF1AacademicInformations[" + i + "].study_date = \u300C" + before + "\u300D");
|
|
2555
|
+
r.study_date = "";
|
|
2556
|
+
} else {
|
|
2557
|
+
if (after !== before) warnings.push("\u65E5\u671F\u5DF2\u89C4\u8303\u5316\uFF1AacademicInformations[" + i + "].study_date \u300C" + before + "\u300D\u2192\u300C" + after + "\u300D");
|
|
2558
|
+
r.study_date = after;
|
|
2559
|
+
}
|
|
2560
|
+
}
|
|
2561
|
+
}
|
|
2562
|
+
for (const key of ["jobInformations", "workExperiences", "projectExperiences"]) {
|
|
2563
|
+
const arr = s[key];
|
|
2564
|
+
if (!Array.isArray(arr)) continue;
|
|
2565
|
+
for (let i = 0; i < arr.length; i++) {
|
|
2566
|
+
const r = arr[i];
|
|
2567
|
+
if (!r || typeof r !== "object") continue;
|
|
2568
|
+
if (r.start_date !== void 0 && r.start_date !== null) {
|
|
2569
|
+
r.start_date = one(key + "[" + i + "].start_date", r.start_date, false);
|
|
2570
|
+
}
|
|
2571
|
+
if (r.end_date !== void 0 && r.end_date !== null) {
|
|
2572
|
+
r.end_date = one(key + "[" + i + "].end_date", r.end_date, true);
|
|
2573
|
+
}
|
|
2574
|
+
}
|
|
2575
|
+
}
|
|
2576
|
+
for (const [key, field] of [["internshipExperiences", "entry_time"], ["awardExperiences", "award_date"]]) {
|
|
2577
|
+
const arr = s[key];
|
|
2578
|
+
if (!Array.isArray(arr)) continue;
|
|
2579
|
+
for (let i = 0; i < arr.length; i++) {
|
|
2580
|
+
const r = arr[i];
|
|
2581
|
+
if (!r || typeof r !== "object") continue;
|
|
2582
|
+
if (r[field] !== void 0 && r[field] !== null) r[field] = one(key + "[" + i + "]." + field, r[field], false);
|
|
2583
|
+
}
|
|
2584
|
+
}
|
|
2585
|
+
}
|
|
2194
2586
|
async function verifySubRows(ctx, formId, objId, dataId) {
|
|
2195
2587
|
const L = await getFormLayoutMeta(ctx.host, formId);
|
|
2196
2588
|
const r = await ctx.host.request({
|
|
@@ -2236,7 +2628,9 @@ async function loadStructured(ctx, args) {
|
|
|
2236
2628
|
if (!String(s.telephone || "").trim() && !String(s.candidateName || "").trim()) {
|
|
2237
2629
|
throw rsValidationError("structured_invalid", "\u7ED3\u6784\u5316\u7B80\u5386\u7F3A\u5C11 telephone \u4E0E candidateName\uFF08\u81F3\u5C11\u8981\u6709\u624B\u673A\u53F7\u6216\u59D3\u540D\uFF0C\u5426\u5219\u65E0\u6CD5\u67E5\u91CD\u5EFA\u6863\uFF09");
|
|
2238
2630
|
}
|
|
2239
|
-
|
|
2631
|
+
const normalizedInline = normalizeTextStructured(ctx.cache, s, warnings);
|
|
2632
|
+
normalizeDates(normalizedInline, warnings);
|
|
2633
|
+
return { structured: normalizedInline, textMode: true, warnings };
|
|
2240
2634
|
}
|
|
2241
2635
|
if (args.structuredFile) {
|
|
2242
2636
|
const p = path.resolve(String(args.structuredFile));
|
|
@@ -2245,7 +2639,9 @@ async function loadStructured(ctx, args) {
|
|
|
2245
2639
|
if (!String(s.telephone || "").trim() && !String(s.candidateName || "").trim()) {
|
|
2246
2640
|
throw rsValidationError("structured_invalid", "\u7ED3\u6784\u5316\u7B80\u5386\u7F3A\u5C11 telephone \u4E0E candidateName");
|
|
2247
2641
|
}
|
|
2248
|
-
|
|
2642
|
+
const normalizedFile = normalizeTextStructured(ctx.cache, s, warnings);
|
|
2643
|
+
normalizeDates(normalizedFile, warnings);
|
|
2644
|
+
return { structured: normalizedFile, textMode: true, warnings };
|
|
2249
2645
|
}
|
|
2250
2646
|
return { structured: null, textMode: false, warnings };
|
|
2251
2647
|
}
|
|
@@ -2294,8 +2690,8 @@ async function buildImport(ctx, args) {
|
|
|
2294
2690
|
channelLabel = "\u624B\u52A8\u5F55\u5165\uFF08\u56FA\u5B9A\uFF09";
|
|
2295
2691
|
}
|
|
2296
2692
|
if (fields.is_blacklist) {
|
|
2297
|
-
const opt = (
|
|
2298
|
-
const noId =
|
|
2693
|
+
const opt = await getDsOptions(host, objId, fields.is_blacklist).catch(() => ({}));
|
|
2694
|
+
const noId = opt["\u5426"];
|
|
2299
2695
|
if (noId) dataDetails.push({ formField: { id: fields.is_blacklist }, dataOptions: [{ optionId: String(noId), content: "\u5426" }] });
|
|
2300
2696
|
}
|
|
2301
2697
|
let subBuild = { byTable: {}, stats: {} };
|
|
@@ -2421,6 +2817,8 @@ async function prepare2(args, env) {
|
|
|
2421
2817
|
const session = await host.getSession();
|
|
2422
2818
|
const ctx = { host, baseUrl: session.baseUrl.replace(/\/+$/, ""), appId: "", cache: await env.recruitContext() };
|
|
2423
2819
|
ctx.appId = ctx.cache.appId;
|
|
2820
|
+
const perm = await probeCreatePermission(ctx.host, objIdOf(ctx.cache, "talent_pool"));
|
|
2821
|
+
if (perm === "denied") throw rsFail("\u5F53\u524D\u8D26\u53F7\u6CA1\u6709\u300C\u4EBA\u624D\u5E93\u300D\u8868\u5355\u7684\u521B\u5EFA\u6743\u9650\uFF0C\u5DF2\u963B\u65AD\uFF08\u672A\u5199\u5165\u4EFB\u4F55\u6570\u636E\uFF09");
|
|
2424
2822
|
const argsT = args;
|
|
2425
2823
|
if (!argsT.structured && !argsT.structuredFile && !argsT.fileId && !argsT.resumeFile) {
|
|
2426
2824
|
throw rsValidationError("input_required", "\u9700\u8981 structured/structuredFile/fileId/resumeFile \u4E4B\u4E00");
|
|
@@ -2476,7 +2874,11 @@ async function prepare2(args, env) {
|
|
|
2476
2874
|
}
|
|
2477
2875
|
const willSubmit2 = { updateTalentId, mainTable: fingerprintMainTable(upMain), details: built.detailsPayload };
|
|
2478
2876
|
const fp2 = fingerprint2(willSubmit2);
|
|
2479
|
-
const continuation2 = await env.continuation.issue({
|
|
2877
|
+
const continuation2 = await env.continuation.issue({
|
|
2878
|
+
operation: "recruit-stage.resume.import.apply",
|
|
2879
|
+
fingerprint: fp2,
|
|
2880
|
+
enumMaps: await dsOptionsSnapshot()
|
|
2881
|
+
});
|
|
2480
2882
|
return rsSuccess("recruit-stage.resume.import.prepare", {
|
|
2481
2883
|
mode: "prepare-update",
|
|
2482
2884
|
action: "\u6309\u7B80\u5386\u66F4\u65B0\u5DF2\u6709\u4EBA\u624D",
|
|
@@ -2544,7 +2946,11 @@ async function prepare2(args, env) {
|
|
|
2544
2946
|
};
|
|
2545
2947
|
const willSubmit = { formId: built.formId, objId: built.objId, mainTable: fingerprintMainTable(toDatasetMainTable(built.dataDetails, built.fields)), details: built.detailsPayload };
|
|
2546
2948
|
const fp = fingerprint2(willSubmit);
|
|
2547
|
-
const continuation = await env.continuation.issue({
|
|
2949
|
+
const continuation = await env.continuation.issue({
|
|
2950
|
+
operation: "recruit-stage.resume.import.apply",
|
|
2951
|
+
fingerprint: fp,
|
|
2952
|
+
enumMaps: await dsOptionsSnapshot()
|
|
2953
|
+
});
|
|
2548
2954
|
return rsSuccess("recruit-stage.resume.import.prepare", {
|
|
2549
2955
|
mode: "prepare",
|
|
2550
2956
|
...summary,
|
|
@@ -2558,6 +2964,7 @@ async function apply2(args, env) {
|
|
|
2558
2964
|
if (args.confirm !== true) throw rsConfirmationError("recruit-stage.resume.import.apply", { hint: "\u5199\u64CD\u4F5C\u5FC5\u987B\u663E\u5F0F confirm:true" });
|
|
2559
2965
|
if (!args.continuation) throw rsValidationError("continuation_required", "\u7F3A\u5C11 continuation\uFF08\u6765\u81EA prepare \u7684 meta\uFF09");
|
|
2560
2966
|
const payload = await env.continuation.verify(String(args.continuation), "recruit-stage.resume.import.apply");
|
|
2967
|
+
restoreDsOptions(payload.enumMaps);
|
|
2561
2968
|
const host = env.host;
|
|
2562
2969
|
const session = await host.getSession();
|
|
2563
2970
|
const ctx = { host, baseUrl: session.baseUrl.replace(/\/+$/, ""), appId: "", cache: await env.recruitContext() };
|
|
@@ -2600,11 +3007,11 @@ async function apply2(args, env) {
|
|
|
2600
3007
|
verifyWarnings = checkAfter(after);
|
|
2601
3008
|
}
|
|
2602
3009
|
return rsSuccess("recruit-stage.resume.import.apply", {
|
|
3010
|
+
// 更新模式同理:明细行/格数对不上时只能报 partial,不能因主表写入成功就报 success
|
|
2603
3011
|
mode: "update",
|
|
2604
|
-
result: "success",
|
|
3012
|
+
result: verifyWarnings.length ? "partial" : "success",
|
|
3013
|
+
detailsState: verifyWarnings.length ? "missing" : "complete",
|
|
2605
3014
|
talentId: updateTalentId,
|
|
2606
|
-
applied: verifyWarnings,
|
|
2607
|
-
// placeholder replaced below
|
|
2608
3015
|
afterSummary: { mainFieldCount: Object.keys(after.main).length, subRows: after.subRows, subCells: after.subCells },
|
|
2609
3016
|
verifyWarnings: verifyWarnings.length ? verifyWarnings : void 0,
|
|
2610
3017
|
talentCardUrl: resolveTalentCardUrl(ctx, updateTalentId),
|
|
@@ -2680,21 +3087,43 @@ async function apply2(args, env) {
|
|
|
2680
3087
|
)
|
|
2681
3088
|
]);
|
|
2682
3089
|
const subTableVerify = verifyRes.ok ? verifyRes.v : { error: verifyRes.e?.message };
|
|
2683
|
-
|
|
2684
|
-
|
|
3090
|
+
let detailsState = "complete";
|
|
3091
|
+
if (!verifyRes.ok) {
|
|
3092
|
+
detailsState = "unverified";
|
|
3093
|
+
writeWarnings.push("\u660E\u7EC6\u8BFB\u56DE\u6821\u9A8C\u5931\u8D25\uFF08\u65E0\u6CD5\u786E\u8BA4\u660E\u7EC6\u662F\u5426\u843D\u5E93\uFF09\uFF1A" + (verifyRes.e?.message || ""));
|
|
3094
|
+
} else if (built.subRowTotal > 0) {
|
|
3095
|
+
const gotRows = Number(subTableVerify?.rowTotal || 0);
|
|
3096
|
+
if (gotRows < built.subRowTotal) {
|
|
3097
|
+
detailsState = "missing";
|
|
3098
|
+
writeWarnings.push("\u660E\u7EC6\u884C\u672A\u5B8C\u6574\u843D\u5E93\uFF08\u671F\u671B " + built.subRowTotal + " \u884C\uFF0C\u8BFB\u56DE " + gotRows + " \u884C\uFF09\uFF1A\u4E3B\u8868\u5DF2\u5199\u5165\uFF0C\u8BF7\u6309 writeWarnings \u4FEE\u6B63\u540E\u8D70 updateTalentId \u8865\u660E\u7EC6");
|
|
3099
|
+
}
|
|
2685
3100
|
}
|
|
2686
3101
|
const saveEsbActions = esbRes.ok ? esbRes.v : { error: esbRes.e?.message };
|
|
2687
3102
|
const labelMatch = labelRes.ok ? labelRes.v : "ERR:" + (labelRes.e?.message || "");
|
|
2688
3103
|
const tagResult = tagRes.ok ? tagRes.v : { applied: [], skipped: built.tagNames, error: tagRes.e?.message };
|
|
2689
3104
|
const tags = await queryEntityTags(host, talentId).catch(() => []);
|
|
3105
|
+
const verification = await verifySubmitted({
|
|
3106
|
+
host,
|
|
3107
|
+
formId: built.formId,
|
|
3108
|
+
objId: built.objId,
|
|
3109
|
+
dataId: newId,
|
|
3110
|
+
expected: expectedFields(built.dataDetails, built.fields, ["candidate_name", "telephone", "email"], [], ["email"])
|
|
3111
|
+
});
|
|
3112
|
+
if (verification.mismatches.length) {
|
|
3113
|
+
invalidateEnvCache(ctx.baseUrl, ctx.appId);
|
|
3114
|
+
for (const m of verification.mismatches) writeWarnings.push("\u843D\u5E93\u56DE\u67E5\u4E0D\u4E00\u81F4\uFF1A" + m.label + " \u671F\u671B " + m.expected + "\uFF0C\u5B9E\u9645 " + m.actual);
|
|
3115
|
+
}
|
|
3116
|
+
const result = detailsState === "complete" && !verification.mismatches.length ? "success" : "partial";
|
|
2690
3117
|
const talentCardUrl = resolveTalentCardUrl(ctx, talentId);
|
|
2691
3118
|
const talentListLocateUrl = resolveTalentListLocateUrl(ctx, talentId);
|
|
2692
3119
|
return rsSuccess("recruit-stage.resume.import.apply", {
|
|
2693
3120
|
mode: "apply",
|
|
2694
|
-
result
|
|
3121
|
+
result,
|
|
3122
|
+
detailsState,
|
|
2695
3123
|
newCandidateFormDataId: newId,
|
|
2696
3124
|
talentId,
|
|
2697
3125
|
writeChannel,
|
|
3126
|
+
verification: { checked: verification.checked, mismatches: verification.mismatches, unavailable: verification.unavailable || null },
|
|
2698
3127
|
writeWarnings: writeWarnings.length ? writeWarnings : void 0,
|
|
2699
3128
|
subTablesExpected: built.subBuild.stats,
|
|
2700
3129
|
subTableVerify,
|
|
@@ -2707,10 +3136,10 @@ async function apply2(args, env) {
|
|
|
2707
3136
|
tags,
|
|
2708
3137
|
talentCardUrl,
|
|
2709
3138
|
talentListLocateUrl,
|
|
2710
|
-
// 产物链接(Agent 原样搬运:①
|
|
3139
|
+
// 产物链接(Agent 原样搬运:① 人才卡片单页 ② 人才库列表;缺失哪个只给另一个)
|
|
2711
3140
|
viewLink: talentCardUrl ? `[\u67E5\u770B ${built.structured.candidateName || "\u65B0\u4EBA\u624D"} \u7684\u4EBA\u624D\u5361\u7247](${talentCardUrl})` : null,
|
|
2712
|
-
listLocateLink: talentListLocateUrl ? `[\
|
|
2713
|
-
agentNote: "\u6B63\u6587\u7ED9\u4E24\u4E2A Markdown \u94FE\u63A5\u2014\u2014\u2460 [\u67E5\u770B <\u59D3\u540D> \u7684\u4EBA\u624D\u5361\u7247](talentCardUrl) \u2461 [\
|
|
3141
|
+
listLocateLink: talentListLocateUrl ? `[\u6253\u5F00\u4EBA\u624D\u5E93\u5217\u8868](${talentListLocateUrl})` : null,
|
|
3142
|
+
agentNote: "\u6B63\u6587\u7ED9\u4E24\u4E2A Markdown \u94FE\u63A5\u2014\u2014\u2460 [\u67E5\u770B <\u59D3\u540D> \u7684\u4EBA\u624D\u5361\u7247](talentCardUrl) \u8BE6\u60C5\u5355\u9875 \u2461 [\u6253\u5F00\u4EBA\u624D\u5E93\u5217\u8868](talentListLocateUrl) \u53EA\u6253\u5F00\u5217\u8868\u3001\u4E0D\u6253\u5F00\u8BE6\u60C5\uFF1B\u7F3A\u5931\u54EA\u4E2A\u5C31\u53EA\u7ED9\u53E6\u4E00\u4E2A\uFF0C\u4E0D\u8F93\u51FA\u534A\u622A\u3002\u4E0D\u8981\u7528 artifact / browsertool\u3002",
|
|
2714
3143
|
parsed: {
|
|
2715
3144
|
name: built.structured.candidateName,
|
|
2716
3145
|
mobile: built.structured.telephone,
|
|
@@ -2986,7 +3415,7 @@ function planBrief(items) {
|
|
|
2986
3415
|
return (items || []).map((x) => x.name + (x.position ? "\uFF08\u5C97\u4F4D\uFF1A" + x.position + "\uFF09" : "") + " [id=" + x.id + "]").join("\uFF1B");
|
|
2987
3416
|
}
|
|
2988
3417
|
async function buildPlan(opts) {
|
|
2989
|
-
const { ctx, talentId, positionId, interviewer, type, session, start, end, email, mobile, aiPlan } = opts;
|
|
3418
|
+
const { ctx, talentId, positionId, interviewer, type, session, start, end, email, mobile, aiPlan, rounds } = opts;
|
|
2990
3419
|
const { host, appId, cache } = ctx;
|
|
2991
3420
|
const objId = objIdOf(cache, "interview_plan");
|
|
2992
3421
|
const formId = formIdOf(cache, "interview_plan");
|
|
@@ -3000,8 +3429,10 @@ async function buildPlan(opts) {
|
|
|
3000
3429
|
}
|
|
3001
3430
|
const candManageId = cand.candidateManageId ? String(cand.candidateManageId) : "";
|
|
3002
3431
|
if (!candManageId) throw rsFail("\u672A\u5B9A\u4F4D\u5230\u5E94\u8058\u7BA1\u7406\u8BB0\u5F55\uFF08candidateManageId\uFF09\uFF0C\u8BF7\u786E\u8BA4\u5019\u9009\u4EBA\u5DF2\u6709\u5E94\u8058\u6279\u6B21");
|
|
3003
|
-
const typeMap
|
|
3004
|
-
|
|
3432
|
+
const [typeMap, sessionMap] = await Promise.all([
|
|
3433
|
+
getDsOptions(host, objId, fid("interview_type")),
|
|
3434
|
+
getDsOptions(host, objId, fid("interview_session"))
|
|
3435
|
+
]);
|
|
3005
3436
|
const typeId = typeMap[type];
|
|
3006
3437
|
if (!typeId) throw rsFail("\u9762\u8BD5\u65B9\u5F0F\u300C" + type + "\u300D\u4E0D\u5728\u679A\u4E3E\u4E2D\uFF08" + Object.keys(typeMap).join("/") + "\uFF09");
|
|
3007
3438
|
const sessionId = sessionMap[session];
|
|
@@ -3083,6 +3514,32 @@ async function buildPlan(opts) {
|
|
|
3083
3514
|
if (aiPlanPicked) {
|
|
3084
3515
|
dataDetails.push({ formField: { id: digitalFid }, dataOptions: [{ optionId: aiPlanPicked.id, content: aiPlanPicked.name }] });
|
|
3085
3516
|
}
|
|
3517
|
+
const meta = await getFormLayoutMeta(host, formId).catch(() => null);
|
|
3518
|
+
const invFields = {};
|
|
3519
|
+
for (const [k, v] of Object.entries(fields)) invFields[String(v)] = k;
|
|
3520
|
+
const EXCLUDE_DEFAULTS = /* @__PURE__ */ new Set(["digital_id", "interview_type", "interview_paper_id", "send_channel"]);
|
|
3521
|
+
const defaultsApplied = [];
|
|
3522
|
+
for (const d of meta?.defaultDetails || []) {
|
|
3523
|
+
const did = String(d.fieldId || "");
|
|
3524
|
+
if (!did || dataDetails.some((x) => String(x.formField.id) === did)) continue;
|
|
3525
|
+
const dk = invFields[did] || "";
|
|
3526
|
+
if (EXCLUDE_DEFAULTS.has(dk)) continue;
|
|
3527
|
+
const o = (d.dataOptions || [])[0];
|
|
3528
|
+
if (o?.optionId) dataDetails.push({ formField: { id: did }, dataOptions: [{ optionId: String(o.optionId), content: o.content || "" }] });
|
|
3529
|
+
else if (d.content !== void 0 && d.content !== "") dataDetails.push({ formField: { id: did }, content: String(d.content) });
|
|
3530
|
+
else continue;
|
|
3531
|
+
defaultsApplied.push(dk || did);
|
|
3532
|
+
}
|
|
3533
|
+
const roundsName = String(rounds || "\u7B2C\u4E00\u8F6E").trim();
|
|
3534
|
+
let roundsWarning = null;
|
|
3535
|
+
const roundsFid = fid("interview_rounds");
|
|
3536
|
+
if (roundsFid && !dataDetails.some((x) => String(x.formField.id) === String(roundsFid))) {
|
|
3537
|
+
const hit = (cache.dict?.raw || []).find(
|
|
3538
|
+
(r) => String(r.selection_name || "").trim() === roundsName && ["one", "two", "three", "four"].includes(String(r.browser_key || ""))
|
|
3539
|
+
);
|
|
3540
|
+
if (hit) dataDetails.push({ formField: { id: roundsFid }, dataOptions: [{ optionId: String(hit.option_id), content: roundsName }] });
|
|
3541
|
+
else roundsWarning = "\u6570\u636E\u5B57\u5178\u672A\u627E\u5230\u8F6E\u6B21\u300C" + roundsName + "\u300D\uFF08browserKey one/two/three/four\uFF09\uFF0C\u5DF2\u8DF3\u8FC7\u8BE5\u5B57\u6BB5\uFF0C\u4E0D\u81C6\u9020";
|
|
3542
|
+
}
|
|
3086
3543
|
return {
|
|
3087
3544
|
host: ctx.host,
|
|
3088
3545
|
objId,
|
|
@@ -3109,6 +3566,9 @@ async function buildPlan(opts) {
|
|
|
3109
3566
|
mobile: cand.mobile + "\uFF08\u6765\u6E90\uFF1A" + (mobileSource === "user" ? "\u672C\u6B21\u6307\u5B9A" : "\u4EBA\u624D\u8D44\u6599") + "\uFF09",
|
|
3110
3567
|
email: (cand.email || "\uFF08\u672A\u63D0\u4F9B\uFF09") + "\uFF08\u6765\u6E90\uFF1A" + (emailSource === "user" ? "\u672C\u6B21\u6307\u5B9A" : emailSource === "talent" ? "\u4EBA\u624D\u8D44\u6599" : "\u7F3A\u5931") + "\uFF09",
|
|
3111
3568
|
aiPlan: isAI ? aiPlanPicked ? aiPlanPicked.name + "\uFF08id=" + aiPlanPicked.id + "\uFF09" : "\u672A\u9009\u62E9\uFF08AI\u9762\u8BD5\u5FC5\u586B\uFF0C\u9700\u7528\u6237\u6307\u5B9A\uFF09" : "\uFF08\u975E AI \u9762\u8BD5\uFF0C\u4E0D\u9002\u7528\uFF09",
|
|
3569
|
+
rounds: roundsName,
|
|
3570
|
+
defaultsApplied: defaultsApplied.length ? defaultsApplied : void 0,
|
|
3571
|
+
roundsWarning: roundsWarning || void 0,
|
|
3112
3572
|
isAIInterview: isAI
|
|
3113
3573
|
}
|
|
3114
3574
|
};
|
|
@@ -3178,7 +3638,11 @@ async function resolveRequiredHint(plan, ctx) {
|
|
|
3178
3638
|
}
|
|
3179
3639
|
function resolveTalentCardUrl2(ctx, talentId) {
|
|
3180
3640
|
const pid = ctx.cache.ebdDetailPageId;
|
|
3181
|
-
if (!pid)
|
|
3641
|
+
if (!pid || !talentId) {
|
|
3642
|
+
const forms = ctx.cache.forms || {};
|
|
3643
|
+
const tobj = String(forms.talent_pool?.objId || forms.talent?.objId || "");
|
|
3644
|
+
return tobj && talentId ? buildCardUrl(ctx.baseUrl, tobj, String(talentId)) : null;
|
|
3645
|
+
}
|
|
3182
3646
|
return `${ctx.baseUrl}/sp/ebdpage/view/${pid}?talentId=${talentId}${talentLinkExtra(ctx.cache)}`;
|
|
3183
3647
|
}
|
|
3184
3648
|
async function resolveInterviewListUrl(ctx) {
|
|
@@ -3246,7 +3710,8 @@ var baseInput3 = {
|
|
|
3246
3710
|
positionId: { type: "string", description: "\u5E94\u8058\u804C\u4F4D id\uFF08\u7B80\u5386\u6C60\u4EBA\u624D\u5FC5\u586B\uFF09" },
|
|
3247
3711
|
interviewer: { type: "string", description: "\u9762\u8BD5\u5B98\u59D3\u540D\uFF08\u7F3A\u7701=\u5F53\u524D\u767B\u5F55\u7528\u6237\uFF09" },
|
|
3248
3712
|
type: { type: "string", description: "\u9762\u8BD5\u65B9\u5F0F\uFF08\u73B0\u573A\u9762\u8BD5/\u89C6\u9891\u9762\u8BD5/\u7535\u8BDD\u9762\u8BD5/AI\u9762\u8BD5\uFF1B\u542B AI \u65F6\u90AE\u7BB1\u4E0E\u65B9\u6848\u5FC5\u586B\uFF09" },
|
|
3249
|
-
session: { type: "string", description: "\u9762\u8BD5\
|
|
3713
|
+
session: { type: "string", description: "\u9762\u8BD5\u9636\u6BB5\uFF08\u521D\u8BD5/\u590D\u8BD5/\u2026\uFF09" },
|
|
3714
|
+
rounds: { type: "string", description: "\u9762\u8BD5\u8F6E\u6B21\uFF08\u7B2C\u4E00\u8F6E/\u7B2C\u4E8C\u8F6E/\u7B2C\u4E09\u8F6E/\u7B2C\u56DB\u8F6E\uFF1B\u7F3A\u7701=\u9875\u9762\u9ED8\u8BA4\u503C\u6216\u7B2C\u4E00\u8F6E\uFF0C\u6309\u6570\u636E\u5B57\u5178\u8FD0\u884C\u65F6\u89E3\u6790\uFF09" },
|
|
3250
3715
|
start: { type: "string", pattern: "^\\d{4}-\\d{1,2}-\\d{1,2}[ T]\\d{1,2}:\\d{2}$", description: "\u5F00\u59CB\u65F6\u95F4 YYYY-MM-DD HH:mm\uFF08\u7F3A\u7701=\u5F53\u524D\u65F6\u95F4\uFF09" },
|
|
3251
3716
|
end: { type: "string", pattern: "^\\d{4}-\\d{1,2}-\\d{1,2}[ T]\\d{1,2}:\\d{2}$", description: "\u7ED3\u675F\u65F6\u95F4\uFF08\u7F3A\u7701=AI +7\u5929 / \u5176\u5B83 +1\u5C0F\u65F6\uFF09" },
|
|
3252
3717
|
email: { type: "string", description: "\u5019\u9009\u4EBA\u90AE\u7BB1\uFF08AI \u9762\u8BD5\u5FC5\u586B\uFF1B\u8865\u5F55\u503C\u4F18\u5148\u4E8E\u4EBA\u624D\u8D44\u6599\uFF09" },
|
|
@@ -3254,6 +3719,8 @@ var baseInput3 = {
|
|
|
3254
3719
|
};
|
|
3255
3720
|
async function prepare3(args, env) {
|
|
3256
3721
|
const ctx = await makeCtx(env);
|
|
3722
|
+
const perm = await probeCreatePermission(ctx.host, objIdOf(ctx.cache, "interview_plan"));
|
|
3723
|
+
if (perm === "denied") throw rsFail("\u5F53\u524D\u8D26\u53F7\u6CA1\u6709\u300C\u9762\u8BD5\u8BA1\u5212\u300D\u8868\u5355\u7684\u521B\u5EFA\u6743\u9650\uFF0C\u5DF2\u963B\u65AD\uFF08\u672A\u5199\u5165\u4EFB\u4F55\u6570\u636E\uFF09");
|
|
3257
3724
|
const talentId = await locateTalentId(ctx, args);
|
|
3258
3725
|
const auto = nowAndEnd(args.type || "\u73B0\u573A\u9762\u8BD5");
|
|
3259
3726
|
const startTime = args.start || auto.s;
|
|
@@ -3269,7 +3736,8 @@ async function prepare3(args, env) {
|
|
|
3269
3736
|
end: String(endTime),
|
|
3270
3737
|
email: args.email ? String(args.email) : void 0,
|
|
3271
3738
|
mobile: args.mobile ? String(args.mobile) : void 0,
|
|
3272
|
-
aiPlan: args.aiPlan ? String(args.aiPlan) : void 0
|
|
3739
|
+
aiPlan: args.aiPlan ? String(args.aiPlan) : void 0,
|
|
3740
|
+
rounds: args.rounds ? String(args.rounds) : void 0
|
|
3273
3741
|
});
|
|
3274
3742
|
plan.host = ctx.host;
|
|
3275
3743
|
const aiPlanCandidates = plan.isAI ? (plan.aiPlanOptions.items || []).map((x) => ({ id: x.id, name: x.name, position: x.position })) : [];
|
|
@@ -3283,7 +3751,12 @@ async function prepare3(args, env) {
|
|
|
3283
3751
|
const willSubmit = { formId: plan.formId, objId: plan.objId, dataDetails: plan.dataDetails };
|
|
3284
3752
|
const { createHash: createHash3 } = await import("node:crypto");
|
|
3285
3753
|
const fp = createHash3("sha256").update(JSON.stringify(willSubmit)).digest("hex");
|
|
3286
|
-
const continuation = await env.continuation.issue({
|
|
3754
|
+
const continuation = await env.continuation.issue({
|
|
3755
|
+
operation: "recruit-stage.interview.arrange.apply",
|
|
3756
|
+
fingerprint: fp,
|
|
3757
|
+
enumMaps: await dsOptionsSnapshot(),
|
|
3758
|
+
timeWindow: { start: String(startTime), end: String(endTime) }
|
|
3759
|
+
});
|
|
3287
3760
|
return rsSuccess("recruit-stage.interview.arrange.prepare", {
|
|
3288
3761
|
mode: "prepare",
|
|
3289
3762
|
...plan.summary,
|
|
@@ -3303,11 +3776,12 @@ async function apply3(args, env) {
|
|
|
3303
3776
|
if (args.confirm !== true) throw rsConfirmationError("recruit-stage.interview.arrange.apply", { hint: "\u5199\u64CD\u4F5C\u5FC5\u987B\u663E\u5F0F confirm:true" });
|
|
3304
3777
|
if (!args.continuation) throw rsValidationError("continuation_required", "\u7F3A\u5C11 continuation\uFF08\u6765\u81EA prepare \u7684 meta\uFF09");
|
|
3305
3778
|
const payload = await env.continuation.verify(String(args.continuation), "recruit-stage.interview.arrange.apply");
|
|
3779
|
+
restoreDsOptions(payload.enumMaps);
|
|
3306
3780
|
const ctx = await makeCtx(env);
|
|
3307
3781
|
const talentId = await locateTalentId(ctx, args);
|
|
3308
3782
|
const auto = nowAndEnd(args.type || "\u73B0\u573A\u9762\u8BD5");
|
|
3309
|
-
const startTime = args.start || auto.s;
|
|
3310
|
-
const endTime = args.end || (args.start ? shiftTime(String(args.start), auto.isAI ? 7 * 24 * 3600 * 1e3 : 3600 * 1e3) || auto.e : auto.e);
|
|
3783
|
+
const startTime = args.start || payload.timeWindow?.start || auto.s;
|
|
3784
|
+
const endTime = args.end || (args.start ? shiftTime(String(args.start), auto.isAI ? 7 * 24 * 3600 * 1e3 : 3600 * 1e3) || auto.e : payload.timeWindow?.end || auto.e);
|
|
3311
3785
|
const plan = await buildPlan({
|
|
3312
3786
|
ctx,
|
|
3313
3787
|
talentId,
|
|
@@ -3319,7 +3793,8 @@ async function apply3(args, env) {
|
|
|
3319
3793
|
end: String(endTime),
|
|
3320
3794
|
email: args.email ? String(args.email) : void 0,
|
|
3321
3795
|
mobile: args.mobile ? String(args.mobile) : void 0,
|
|
3322
|
-
aiPlan: args.aiPlan ? String(args.aiPlan) : void 0
|
|
3796
|
+
aiPlan: args.aiPlan ? String(args.aiPlan) : void 0,
|
|
3797
|
+
rounds: args.rounds ? String(args.rounds) : void 0
|
|
3323
3798
|
});
|
|
3324
3799
|
plan.host = ctx.host;
|
|
3325
3800
|
if (plan.isAI && !plan.aiPlanPicked) {
|
|
@@ -3338,19 +3813,36 @@ async function apply3(args, env) {
|
|
|
3338
3813
|
dataDetails: plan.dataDetails
|
|
3339
3814
|
});
|
|
3340
3815
|
const actionsRun = await execSaveActions(plan, formDataId);
|
|
3816
|
+
const verification = await verifySubmitted({
|
|
3817
|
+
host: ctx.host,
|
|
3818
|
+
formId: plan.formId,
|
|
3819
|
+
objId: plan.objId,
|
|
3820
|
+
dataId: formDataId,
|
|
3821
|
+
expected: expectedFields(
|
|
3822
|
+
plan.dataDetails,
|
|
3823
|
+
ctx.cache.fields[plan.objId] || {},
|
|
3824
|
+
["interview_type", "interview_session", "interview_rounds", "digital_id", "email", "union_status"],
|
|
3825
|
+
["union_status"]
|
|
3826
|
+
)
|
|
3827
|
+
});
|
|
3828
|
+
if (verification.mismatches.length) invalidateEnvCache(ctx.baseUrl, ctx.appId);
|
|
3829
|
+
const verifyWarnings = verification.mismatches.map(
|
|
3830
|
+
(m) => "\u843D\u5E93\u56DE\u67E5\u4E0D\u4E00\u81F4\uFF1A" + m.label + " \u671F\u671B " + m.expected + "\uFF0C\u5B9E\u9645 " + m.actual + "\uFF08\u8BE5\u5B57\u6BB5\u53EF\u80FD\u672A\u5199\u5165\uFF09"
|
|
3831
|
+
);
|
|
3341
3832
|
const detailUrl = buildCardUrl(ctx.baseUrl, plan.objId, formDataId);
|
|
3342
|
-
const listLocateUrl =
|
|
3833
|
+
const listLocateUrl = buildListUrl(ctx.baseUrl, ctx.cache.lists?.interview?.listId || "");
|
|
3343
3834
|
return rsSuccess("recruit-stage.interview.arrange.apply", {
|
|
3344
3835
|
mode: "apply",
|
|
3345
|
-
result: "success",
|
|
3836
|
+
result: verification.mismatches.length ? "partial" : "success",
|
|
3346
3837
|
interviewFormId: formDataId,
|
|
3347
3838
|
interviewCardUrl: detailUrl,
|
|
3348
3839
|
viewLink: detailUrl ? `[\u67E5\u770B ${plan.cand.name || ""} \u7684\u9762\u8BD5\u5B89\u6392\u8BE6\u60C5](${detailUrl})` : null,
|
|
3349
|
-
listLocateLink: listLocateUrl ? `[\u6253\u5F00\u9762\u8BD5\u7BA1\u7406\u5217\u8868
|
|
3350
|
-
agentNote: "\u4EA7\u7269 = \u4E24\u4E2A Markdown \u94FE\u63A5\uFF08\u5E73\u53F0\u5B9E\u8BC1\u53EF\u70B9\u51FB\uFF09\uFF1A\u2460 viewLink \u9762\u8BD5\u5B89\u6392\u8BE6\u60C5\u9875 \u2461 listLocateLink \u9762\u8BD5\u7BA1\u7406\u5217\u8868\
|
|
3840
|
+
listLocateLink: listLocateUrl ? `[\u6253\u5F00\u9762\u8BD5\u7BA1\u7406\u5217\u8868](${listLocateUrl})` : null,
|
|
3841
|
+
agentNote: "\u4EA7\u7269 = \u4E24\u4E2A Markdown \u94FE\u63A5\uFF08\u5E73\u53F0\u5B9E\u8BC1\u53EF\u70B9\u51FB\uFF09\uFF1A\u2460 viewLink \u9762\u8BD5\u5B89\u6392\u8BE6\u60C5\u5355\u9875 \u2461 listLocateLink \u9762\u8BD5\u7BA1\u7406\u5217\u8868\uFF08\u53EA\u6253\u5F00\u5217\u8868\uFF0C\u4E0D\u6253\u5F00\u8BE6\u60C5\uFF09\u3002\u6309\u987A\u5E8F\u539F\u6837\u653E\u56DE\u7B54\u6B63\u6587\uFF0C\u7F3A\u54EA\u4E2A\u53EA\u7ED9\u53E6\u4E00\u4E2A\u3001\u4E0D\u8F93\u51FA\u534A\u622A\u3002\u4E0D\u8981\u5305 browsertool / <artifact> \u6807\u7B7E\u3002",
|
|
3351
3842
|
aiPlan: plan.isAI && plan.aiPlanPicked ? { id: plan.aiPlanPicked.id, name: plan.aiPlanPicked.name } : void 0,
|
|
3352
3843
|
saveActions: actionsRun.executed,
|
|
3353
|
-
|
|
3844
|
+
verification: { checked: verification.checked, mismatches: verification.mismatches, unavailable: verification.unavailable || null },
|
|
3845
|
+
warnings: [...actionsRun.warnings || [], ...verifyWarnings],
|
|
3354
3846
|
assigned: actionsRun.assigned || {}
|
|
3355
3847
|
});
|
|
3356
3848
|
}
|
|
@@ -3363,7 +3855,7 @@ async function prefill2(args, env) {
|
|
|
3363
3855
|
const typeKey = String(args.type || "AI\u9762\u8BD5");
|
|
3364
3856
|
const typeFid = fields.interview_type;
|
|
3365
3857
|
if (!typeFid) throw rsFail("\u9762\u8BD5\u8BA1\u5212\u7F3A\u5C11\u5B57\u6BB5 interview_type\uFF08ds/fields \u89E3\u6790\u4E0D\u5230\uFF09");
|
|
3366
|
-
const typeMap =
|
|
3858
|
+
const typeMap = await getDsOptions(ctx.host, objId, typeFid);
|
|
3367
3859
|
const typeId = typeMap[typeKey];
|
|
3368
3860
|
if (!typeId) throw rsFail("\u9762\u8BD5\u65B9\u5F0F\u300C" + typeKey + "\u300D\u4E0D\u5728\u679A\u4E3E\u4E2D\uFF08" + Object.keys(typeMap).join("/") + "\uFF09");
|
|
3369
3861
|
const cardUrl = resolveTalentCardUrl2(ctx, talentId);
|
|
@@ -3526,7 +4018,7 @@ async function prepare4(args, env) {
|
|
|
3526
4018
|
const analysis = submitBtn ? analyzeButtonActions(submitBtn) : null;
|
|
3527
4019
|
let newOptionId = null;
|
|
3528
4020
|
if (args.result) {
|
|
3529
|
-
const opts =
|
|
4021
|
+
const opts = await getDsOptions(t.host, t.objId, t.resultFid);
|
|
3530
4022
|
newOptionId = opts[String(args.result)];
|
|
3531
4023
|
if (!newOptionId) throw rsFail("\u672A\u8BC6\u522B\u7684\u9762\u8BD5\u7ED3\u679C\u300C" + args.result + "\u300D\uFF0C\u53EF\u9009\uFF1A" + Object.keys(opts).join("/"));
|
|
3532
4024
|
}
|
|
@@ -3535,7 +4027,11 @@ async function prepare4(args, env) {
|
|
|
3535
4027
|
const willSubmit = { feedbackId: String(t.target.feedbackId), result: newResultName, comment: newComment };
|
|
3536
4028
|
const { createHash: createHash3 } = await import("node:crypto");
|
|
3537
4029
|
const fp = createHash3("sha256").update(JSON.stringify(willSubmit)).digest("hex");
|
|
3538
|
-
const continuation = await env.continuation.issue({
|
|
4030
|
+
const continuation = await env.continuation.issue({
|
|
4031
|
+
operation: "recruit-stage.interview.feedback.edit.apply",
|
|
4032
|
+
fingerprint: fp,
|
|
4033
|
+
enumMaps: await dsOptionsSnapshot()
|
|
4034
|
+
});
|
|
3539
4035
|
return rsSuccess("recruit-stage.interview.feedback.edit.prepare", {
|
|
3540
4036
|
mode: "prepare",
|
|
3541
4037
|
talentId: t.talentId,
|
|
@@ -3557,12 +4053,13 @@ async function apply4(args, env) {
|
|
|
3557
4053
|
if (args.confirm !== true) throw rsConfirmationError("recruit-stage.interview.feedback.edit.apply", { hint: "\u5199\u64CD\u4F5C\u5FC5\u987B\u663E\u5F0F confirm:true" });
|
|
3558
4054
|
if (!args.continuation) throw rsValidationError("continuation_required", "\u7F3A\u5C11 continuation\uFF08\u6765\u81EA prepare \u7684 meta\uFF09");
|
|
3559
4055
|
const payload = await env.continuation.verify(String(args.continuation), "recruit-stage.interview.feedback.edit.apply");
|
|
4056
|
+
restoreDsOptions(payload.enumMaps);
|
|
3560
4057
|
const t = await buildTarget(env, args);
|
|
3561
4058
|
const rec2 = await getFormDataRecord(t.host, t.formId, String(t.target.feedbackId), t.objId);
|
|
3562
4059
|
const details2 = toSubmitDetails(rec2.dataDetails);
|
|
3563
4060
|
let newOptionId = null;
|
|
3564
4061
|
if (args.result) {
|
|
3565
|
-
const opts =
|
|
4062
|
+
const opts = await getDsOptions(t.host, t.objId, t.resultFid);
|
|
3566
4063
|
newOptionId = opts[String(args.result)];
|
|
3567
4064
|
if (!newOptionId) throw rsFail("\u672A\u8BC6\u522B\u7684\u9762\u8BD5\u7ED3\u679C\u300C" + args.result + "\u300D\uFF0C\u53EF\u9009\uFF1A" + Object.keys(opts).join("/"));
|
|
3568
4065
|
}
|
|
@@ -4314,40 +4811,75 @@ var recruitStageManifest = {
|
|
|
4314
4811
|
};
|
|
4315
4812
|
|
|
4316
4813
|
// src/shortcuts/recruit-stage/context.ts
|
|
4317
|
-
import { join, resolve as resolve2 } from "node:path";
|
|
4814
|
+
import { join as join2, resolve as resolve2 } from "node:path";
|
|
4318
4815
|
import { existsSync as existsSync2 } from "node:fs";
|
|
4319
4816
|
import { readFile as readFile2 } from "node:fs/promises";
|
|
4320
|
-
import { homedir as
|
|
4817
|
+
import { homedir as homedir3 } from "node:os";
|
|
4321
4818
|
var flowMemo = /* @__PURE__ */ new Map();
|
|
4819
|
+
var SELFUSE_DEFAULT_FLOW = {
|
|
4820
|
+
selfUseHost: "www.e-cology.com.cn",
|
|
4821
|
+
id: "874896524979806209",
|
|
4822
|
+
name: "\u521D\u7B5B+\u9762\u8BD5+offer\u9636\u6BB5"
|
|
4823
|
+
};
|
|
4322
4824
|
var digitalMenuMemo = /* @__PURE__ */ new Map();
|
|
4323
4825
|
function cacheDirFor(baseUrl) {
|
|
4324
4826
|
const url = new URL(baseUrl);
|
|
4325
4827
|
const host = url.hostname + (url.port ? `_${url.port}` : "");
|
|
4326
4828
|
const envRoot = process.env.E10_SKILL_CACHE_DIR;
|
|
4327
|
-
if (envRoot) return
|
|
4328
|
-
const home = process.env.WEAVER_WORK_CLI_HOME || process.env.WORK_CLI_HOME || resolve2(
|
|
4329
|
-
return
|
|
4829
|
+
if (envRoot) return join2(envRoot, host);
|
|
4830
|
+
const home = process.env.WEAVER_WORK_CLI_HOME || process.env.WORK_CLI_HOME || resolve2(homedir3(), ".weaver-work-cli");
|
|
4831
|
+
return join2(home, "env-cache", "recruit-ops", host);
|
|
4330
4832
|
}
|
|
4331
4833
|
async function readLegacyCacheExtra(baseUrl) {
|
|
4332
4834
|
try {
|
|
4333
4835
|
const dir = cacheDirFor(baseUrl);
|
|
4334
4836
|
if (!existsSync2(dir)) return { defaultRecruitFlow: null, digitalHumanMenu: null };
|
|
4335
|
-
const files = (await import("node:fs/promises")).readdir(dir);
|
|
4336
|
-
const jsonFiles =
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4837
|
+
const files = await (await import("node:fs/promises")).readdir(dir);
|
|
4838
|
+
const jsonFiles = files.filter((f) => f.endsWith(".json"));
|
|
4839
|
+
let flow = null;
|
|
4840
|
+
let dh = null;
|
|
4841
|
+
for (const f of jsonFiles) {
|
|
4842
|
+
let raw;
|
|
4843
|
+
try {
|
|
4844
|
+
raw = JSON.parse(await readFile2(join2(dir, f), "utf8"));
|
|
4845
|
+
} catch {
|
|
4846
|
+
continue;
|
|
4847
|
+
}
|
|
4848
|
+
if (!flow && raw?.defaultRecruitFlow && raw.defaultRecruitFlow.id) {
|
|
4849
|
+
flow = { id: String(raw.defaultRecruitFlow.id), name: String(raw.defaultRecruitFlow.name || "") };
|
|
4850
|
+
}
|
|
4851
|
+
if (!dh && raw?.lists?.digital_human?.listId) {
|
|
4852
|
+
dh = {
|
|
4853
|
+
menuName: String(raw.lists.digital_human.menuName || "\u9762\u8BD5\u6570\u5B57\u4EBA\u914D\u7F6E"),
|
|
4854
|
+
listId: String(raw.lists.digital_human.listId),
|
|
4855
|
+
cusMenuId: String(raw.lists.digital_human.cusMenuId || "")
|
|
4856
|
+
};
|
|
4857
|
+
}
|
|
4858
|
+
if (flow && dh) break;
|
|
4859
|
+
}
|
|
4345
4860
|
return { defaultRecruitFlow: flow, digitalHumanMenu: dh };
|
|
4346
4861
|
} catch {
|
|
4347
4862
|
return { defaultRecruitFlow: null, digitalHumanMenu: null };
|
|
4348
4863
|
}
|
|
4349
4864
|
}
|
|
4350
|
-
|
|
4865
|
+
function findFlowMenu(cache) {
|
|
4866
|
+
const all = (cache.lists || {}).all_search || [];
|
|
4867
|
+
const hit = all.find((m) => m && m.listId && /招聘流程/.test(String(m.menuName || "")));
|
|
4868
|
+
if (hit) {
|
|
4869
|
+
return { listId: String(hit.listId), cusMenuId: String(hit.cusMenuId || ""), menuName: String(hit.menuName || "\u62DB\u8058\u6D41\u7A0B") };
|
|
4870
|
+
}
|
|
4871
|
+
return null;
|
|
4872
|
+
}
|
|
4873
|
+
function isDefaultFlowRow(x) {
|
|
4874
|
+
if (!x) return false;
|
|
4875
|
+
const cands = [x.is_default, x.isDefault, x.default_flow, x.defaultFlow, x.is_enable, x.enabled, x.status];
|
|
4876
|
+
for (const v of cands) {
|
|
4877
|
+
if (v === true || v === 1 || v === "1") return true;
|
|
4878
|
+
if (String(v) === "\u662F" || String(v) === "\u542F\u7528" || String(v) === "\u9ED8\u8BA4") return true;
|
|
4879
|
+
}
|
|
4880
|
+
return false;
|
|
4881
|
+
}
|
|
4882
|
+
async function resolveDefaultRecruitFlow(host, baseUrl, appId, cache) {
|
|
4351
4883
|
const memoKey = baseUrl;
|
|
4352
4884
|
if (flowMemo.has(memoKey)) return flowMemo.get(memoKey) ?? null;
|
|
4353
4885
|
const legacy = await readLegacyCacheExtra(baseUrl);
|
|
@@ -4356,22 +4888,86 @@ async function resolveDefaultRecruitFlow(host, baseUrl, appId) {
|
|
|
4356
4888
|
return legacy.defaultRecruitFlow;
|
|
4357
4889
|
}
|
|
4358
4890
|
let result = null;
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4891
|
+
const menu = findFlowMenu(cache);
|
|
4892
|
+
if (menu) {
|
|
4893
|
+
try {
|
|
4894
|
+
let flowObjId = "";
|
|
4895
|
+
try {
|
|
4896
|
+
const liBody = {
|
|
4897
|
+
cusMenuId: menu.cusMenuId,
|
|
4898
|
+
listId: menu.listId,
|
|
4899
|
+
urlPageTitle: menu.menuName
|
|
4900
|
+
};
|
|
4901
|
+
liBody["appId_" + menu.listId] = appId;
|
|
4902
|
+
const li = await host.request({ path: "/api/ebuilder/form/list/listInit", body: liBody });
|
|
4903
|
+
flowObjId = String(li?.data?.objid || "");
|
|
4904
|
+
} catch {
|
|
4905
|
+
}
|
|
4906
|
+
if (flowObjId) {
|
|
4907
|
+
const body = {
|
|
4908
|
+
current: 1,
|
|
4909
|
+
pageSize: 50,
|
|
4910
|
+
tableuid: Math.random().toString(16).slice(2, 34),
|
|
4911
|
+
listId: menu.listId,
|
|
4912
|
+
searchParamData: { searchType: "3", type: "and" },
|
|
4913
|
+
terminal: "PC",
|
|
4914
|
+
browser: "Chrome",
|
|
4915
|
+
requiredMatch: 1,
|
|
4916
|
+
mapResult: 1,
|
|
4917
|
+
recheckQuery: 1,
|
|
4918
|
+
isFollow: 0,
|
|
4919
|
+
isShareToMe: 0,
|
|
4920
|
+
filterCondition: {},
|
|
4921
|
+
cusMenuId: menu.cusMenuId,
|
|
4922
|
+
urlPageTitle: menu.menuName,
|
|
4923
|
+
menuName: menu.menuName
|
|
4924
|
+
};
|
|
4925
|
+
const r = await host.request({
|
|
4926
|
+
path: `/api/ebuilder/form/list/getListDatas?passid=${flowObjId}&cid=${flowObjId}`,
|
|
4927
|
+
body,
|
|
4928
|
+
headers: { ebBusinessId: menu.listId }
|
|
4929
|
+
});
|
|
4930
|
+
const rows = r?.data?.data || r?.data?.displayData || [];
|
|
4931
|
+
const pick = rows.find(isDefaultFlowRow) || (rows.length === 1 ? rows[0] : null);
|
|
4932
|
+
if (pick) {
|
|
4933
|
+
const id = String(pick.form_data_id || pick.id || "");
|
|
4934
|
+
const name = String(pick.name || pick.flow_name || pick.content || "");
|
|
4935
|
+
if (id && name) result = { id, name };
|
|
4936
|
+
}
|
|
4937
|
+
}
|
|
4938
|
+
} catch {
|
|
4939
|
+
}
|
|
4940
|
+
}
|
|
4941
|
+
if (!result) {
|
|
4942
|
+
try {
|
|
4943
|
+
const r = await host.request({
|
|
4944
|
+
path: "/api/recruit/position/recruitFlow/list",
|
|
4945
|
+
method: "POST",
|
|
4946
|
+
body: { appId, current: 1, pageSize: 50 },
|
|
4947
|
+
operation: "context.defaultRecruitFlow"
|
|
4948
|
+
});
|
|
4949
|
+
const rows = r?.data?.list || r?.data?.rows || r?.data || [];
|
|
4950
|
+
const list = Array.isArray(rows) ? rows : [];
|
|
4951
|
+
const enabled = list.find(isDefaultFlowRow) || null;
|
|
4952
|
+
if (enabled?.id) {
|
|
4953
|
+
result = { id: String(enabled.id), name: String(enabled.name || enabled.flow_name || "") };
|
|
4954
|
+
}
|
|
4955
|
+
} catch {
|
|
4956
|
+
}
|
|
4957
|
+
}
|
|
4958
|
+
if (!result) {
|
|
4959
|
+
const isSelfUse = String(cache?.selfUse || "") === "1";
|
|
4960
|
+
let host2 = "";
|
|
4961
|
+
try {
|
|
4962
|
+
host2 = new URL(baseUrl).hostname;
|
|
4963
|
+
} catch {
|
|
4964
|
+
host2 = "";
|
|
4965
|
+
}
|
|
4966
|
+
if (isSelfUse && host2 === SELFUSE_DEFAULT_FLOW.selfUseHost) {
|
|
4967
|
+
result = { id: SELFUSE_DEFAULT_FLOW.id, name: SELFUSE_DEFAULT_FLOW.name };
|
|
4371
4968
|
}
|
|
4372
|
-
} catch {
|
|
4373
4969
|
}
|
|
4374
|
-
flowMemo.set(memoKey, result);
|
|
4970
|
+
if (result) flowMemo.set(memoKey, result);
|
|
4375
4971
|
return result;
|
|
4376
4972
|
}
|
|
4377
4973
|
async function resolveDigitalHumanMenu(host, baseUrl, cache) {
|
|
@@ -4396,7 +4992,7 @@ function createRecruitStageContext() {
|
|
|
4396
4992
|
const cache = await loaders.get(loaderKey).load(host);
|
|
4397
4993
|
const baseUrl = (await host.getSession()).baseUrl.replace(/\/+$/, "");
|
|
4398
4994
|
const [defaultRecruitFlow, digitalHumanMenu] = await Promise.all([
|
|
4399
|
-
resolveDefaultRecruitFlow(host, baseUrl, cache.appId),
|
|
4995
|
+
resolveDefaultRecruitFlow(host, baseUrl, cache.appId, cache),
|
|
4400
4996
|
resolveDigitalHumanMenu(host, baseUrl, cache)
|
|
4401
4997
|
]);
|
|
4402
4998
|
return { ...cache, defaultRecruitFlow, digitalHumanMenu };
|