weaver-work-cli 0.1.47 → 0.1.48

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.
Files changed (181) hide show
  1. package/dist/chunks/{archive-oa-BBDP7AKJ.js → archive-oa-EDJDU3V4.js} +454 -5
  2. package/dist/chunks/{attachment-content-MCXQBD6N.js → attachment-content-4KSNBPRO.js} +3 -3
  3. package/dist/chunks/{chunk-J2VEB5K3.js → chunk-2BQESR2U.js} +2 -2
  4. package/dist/chunks/{chunk-727FH2NI.js → chunk-2IGZUMNG.js} +15 -2
  5. package/dist/chunks/{chunk-76H3IKH6.js → chunk-5B5JXTY2.js} +35 -35
  6. package/dist/chunks/{chunk-Q4OYAQYH.js → chunk-72MI3MBX.js} +4 -0
  7. package/dist/chunks/{chunk-4RWS2YYL.js → chunk-BCACE6VV.js} +2 -2
  8. package/dist/chunks/{chunk-AD46OMQK.js → chunk-EFOUMXIX.js} +119 -44
  9. package/dist/chunks/{chunk-IRMIEDXN.js → chunk-FEP6ELMR.js} +1 -1
  10. package/dist/chunks/{chunk-LIEQJIGM.js → chunk-GR76ZDDX.js} +0 -3
  11. package/dist/chunks/{chunk-JB34OE7R.js → chunk-NBEWUR7L.js} +1 -1
  12. package/dist/chunks/{chunk-6V5ZPKHV.js → chunk-NK74RE5F.js} +2 -2
  13. package/dist/chunks/{chunk-GSZTA43P.js → chunk-OCYRVZGN.js} +2 -2
  14. package/dist/chunks/{chunk-OXHHJWNC.js → chunk-PSPOFLSU.js} +1 -1
  15. package/dist/chunks/{chunk-6AXKWFKG.js → chunk-R2HHLJNN.js} +4 -4
  16. package/dist/chunks/{chunk-PSOMGA3U.js → chunk-SVFG6EMV.js} +35 -6
  17. package/dist/chunks/{chunk-IP4CWQCF.js → chunk-WMSAWAWZ.js} +8 -8
  18. package/dist/chunks/{conflict-H7EHQXYY.js → conflict-APGSD5E7.js} +2 -2
  19. package/dist/chunks/{contract-3QLAGYQL.js → contract-N6P2HIIE.js} +425 -187
  20. package/dist/chunks/{create-flow-VRVJEOBX.js → create-flow-5TXFOC7X.js} +6 -6
  21. package/dist/chunks/{ehr-SH2LM3NK.js → ehr-XI4BIVR2.js} +16 -5
  22. package/dist/chunks/{env-66FPSJDV.js → env-B6GKA2J3.js} +2 -2
  23. package/dist/chunks/{factory-UH2TZBVA.js → factory-MFCKLUT6.js} +1 -1
  24. package/dist/chunks/{group-chat-CAKMMV7K.js → group-chat-YE7WIBFO.js} +3 -3
  25. package/dist/chunks/{im-NJB7ZYMH.js → im-3RCNL5GT.js} +107 -1
  26. package/dist/chunks/{invoice-UEAHSYAE.js → invoice-FXWH5GPO.js} +2 -71
  27. package/dist/chunks/{lazy-dispatch-25XGTXLM.js → lazy-dispatch-XSAHDK6Z.js} +3 -3
  28. package/dist/chunks/{meeting-VTBFW4HI.js → meeting-RYZV2JTQ.js} +10 -10
  29. package/dist/chunks/{reception-5WITA44R.js → reception-VL6TKVAW.js} +480 -26
  30. package/dist/chunks/{recruit-stage-CAKZTUA7.js → recruit-stage-ERZD3ZNB.js} +52 -16
  31. package/dist/chunks/{registry-JVQBLFQ5.js → registry-22O6UG4I.js} +10 -10
  32. package/dist/chunks/{registry-AQVGHUM6.js → registry-7VZ6YJUF.js} +2 -2
  33. package/dist/chunks/{registry-PVUZQDDQ.js → registry-BUTEDK3C.js} +1 -1
  34. package/dist/chunks/{room-recommend-5U55FMXZ.js → room-recommend-IMZPJMYB.js} +4 -4
  35. package/dist/chunks/{schedule-IDETODCA.js → schedule-SPPAHER2.js} +4 -4
  36. package/dist/chunks/{workflow-BSYT5TGL.js → workflow-WVEFJ6KC.js} +2 -2
  37. package/dist/core/refs.js +19 -2
  38. package/dist/index.js +14 -14
  39. package/dist/shortcuts/archive-oa/constants.js +42 -0
  40. package/dist/shortcuts/archive-oa/host.js +2 -2
  41. package/dist/shortcuts/archive-oa/index.js +38 -0
  42. package/dist/shortcuts/archive-oa/operations/borrow-car.js +117 -3
  43. package/dist/shortcuts/archive-oa/operations/my-borrow-contract.js +271 -0
  44. package/dist/shortcuts/archive-oa/operations/registry.js +5 -3
  45. package/dist/shortcuts/contract/index.js +9 -1
  46. package/dist/shortcuts/contract/manifest.js +14 -2
  47. package/dist/shortcuts/contract/operations/card.js +231 -0
  48. package/dist/shortcuts/contract/operations/registry.js +2 -0
  49. package/dist/shortcuts/contract/operations/review.js +16 -5
  50. package/dist/shortcuts/contract/operations/summary.js +25 -17
  51. package/dist/shortcuts/ehr/operations/recruit-write.js +22 -5
  52. package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +17 -8
  53. package/dist/shortcuts/ehr/recruit-stage/shared.js +33 -8
  54. package/dist/shortcuts/im/index.js +128 -0
  55. package/dist/shortcuts/im/operations/session.js +6 -0
  56. package/dist/shortcuts/invoice/host.js +0 -3
  57. package/dist/shortcuts/invoice/manifest.js +0 -1
  58. package/dist/shortcuts/invoice/operations/reim-subsidy.js +1 -71
  59. package/dist/shortcuts/meeting/operations/eb/conflict.js +26 -3
  60. package/dist/shortcuts/meeting/operations/eb/continuation-alias.js +63 -0
  61. package/dist/shortcuts/meeting/operations/eb/create-flow.js +71 -12
  62. package/dist/shortcuts/meeting/operations/eb/factory.js +5 -3
  63. package/dist/shortcuts/reception/host.js +33 -1
  64. package/dist/shortcuts/reception/index.js +19 -0
  65. package/dist/shortcuts/reception/manifest.js +53 -1
  66. package/dist/shortcuts/reception/operations/ask.js +18 -0
  67. package/dist/shortcuts/reception/operations/compose.js +113 -3
  68. package/dist/shortcuts/reception/operations/leads.js +245 -0
  69. package/dist/shortcuts/reception/operations/markdown.js +22 -0
  70. package/dist/shortcuts/reception/operations/registry.js +2 -0
  71. package/dist/shortcuts/reception/operations/render.js +36 -3
  72. package/dist/shortcuts/reception/operations/restaurant-rooms.js +118 -0
  73. package/dist/shortcuts/reception/operations/restaurant.js +251 -0
  74. package/dist/shortcuts/reception/operations/restaurantrooms.js +42 -0
  75. package/dist/shortcuts/reception/operations/schedule.js +7 -1
  76. package/dist/shortcuts/reception/upload.js +22 -6
  77. package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +17 -8
  78. package/dist/shortcuts/recruit-stage/shared.js +42 -14
  79. package/docs/archive-oa.md +4 -2
  80. package/package.json +1 -1
  81. package/skill-template/domains/archive-oa.md +2 -1
  82. package/skill-template/master-skill-template.md +1 -0
  83. package/skill-template/skill-template.md +1 -0
  84. package/skills/weaver-e10-archive-oa/SKILL.md +33 -6
  85. package/skills/weaver-e10-archive-oa/references/borrow-car.md +32 -7
  86. package/skills/weaver-e10-archive-oa/references/contract-search.md +32 -0
  87. package/skills/weaver-e10-archive-oa/references/disabled-capabilities.md +1 -1
  88. package/skills/weaver-e10-archive-oa/references/my-borrow-contract.md +97 -0
  89. package/skills/weaver-e10-archive-oa/references/my-borrow.md +6 -1
  90. package/skills/weaver-e10-archive-oa/references/qys-contract-search.md +22 -0
  91. package/skills/weaver-e10-calendar/SKILL.md +1 -1
  92. package/skills/weaver-e10-calendar/references/calendar-query.md +1 -1
  93. package/skills/weaver-e10-calendar/references/calendar-write.md +9 -9
  94. package/skills/weaver-e10-cowork/SKILL.md +9 -6
  95. package/skills/weaver-e10-jinchengda/SKILL.md +10 -7
  96. package/skills/weaver-e10-jinchengda/references/contract-action-card-template.html +17 -0
  97. package/skills/weaver-e10-jinchengda/references/contract-action-card.md +263 -35
  98. package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +8 -5
  99. package/skills/weaver-e10-jinchengda/references/contract-ai-assistant.md +1 -1
  100. package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +175 -22
  101. package/skills/weaver-e10-jinchengda/references/contract-command-index.md +2 -2
  102. package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +1 -1
  103. package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +1 -1
  104. package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +124 -19
  105. package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +2 -2
  106. package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +4 -4
  107. package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +6 -0
  108. package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +1 -1
  109. package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +1 -1
  110. package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +1 -1
  111. package/skills/weaver-e10-jinchengda/references/contract-risk-report-template.html +178 -0
  112. package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +1 -1
  113. package/skills/weaver-e10-jinchengda/references/orchestration.md +7 -7
  114. package/skills/weaver-e10-jinchengda/scripts/plan_actions.py +279 -0
  115. package/skills/weaver-e10-jinchengda/scripts/render_action_card.py +450 -0
  116. package/skills/weaver-e10-jinchengda/scripts/render_risk_report.py +358 -0
  117. package/skills/weaver-e10-jinchengda/scripts/validate_action_card.py +505 -0
  118. package/skills/weaver-e10-jucailin/SKILL.md +7 -4
  119. package/skills/weaver-e10-jucailin/references/recruit-create.md +3 -2
  120. package/skills/weaver-e10-jucailin/references/recruit-read.md +2 -1
  121. package/skills/weaver-e10-jucailin/references/recruit-stage-ops.md +3 -3
  122. package/skills/weaver-e10-jucailin/references/safety-boundaries.md +30 -2
  123. package/skills/weaver-e10-mail/SKILL.md +17 -4
  124. package/skills/weaver-e10-meeting/SKILL.md +94 -409
  125. package/skills/weaver-e10-meeting/references/create-flow.md +188 -0
  126. package/skills/weaver-e10-meeting/references/create-guardrails.md +234 -0
  127. package/skills/weaver-e10-meeting/references/pitfalls.md +40 -0
  128. package/skills/weaver-e10-reception-flow/SKILL.md +62 -18
  129. package/skills/weaver-e10-reception-flow/data/fields-snapshot.json +628 -26
  130. package/skills/weaver-e10-reception-flow/references/fields-snapshot.md +96 -26
  131. package/skills/weaver-e10-reception-flow/scripts/render.py +81 -2
  132. package/skills/weaver-e10-recruit-stage/SKILL.md +45 -12
  133. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +58 -8
  134. package/skills/weaver-e10-recruit-stage/references/position-templates.md +5 -0
  135. package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +1 -1
  136. package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +1 -1
  137. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +40 -11
  138. package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +1 -1
  139. package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +1 -1
  140. package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +1 -1
  141. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +16 -0
  142. package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +1 -1
  143. package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +1 -1
  144. package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +1 -1
  145. package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +127 -0
  146. package/skills/weaver-e10-shijingran/SKILL.md +6 -2
  147. package/skills/weaver-e10-shijingran/references/source-manifest.json +5 -4
  148. package/skills/weaver-e10-workflow/SKILL.md +1 -1
  149. package/skills/weaver-e10-yepiaotong/SKILL.md +8 -4
  150. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +1 -1
  151. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +1 -1
  152. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +2 -2
  153. package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +1 -1
  154. package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +1 -1
  155. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +1 -0
  156. package/skills/weaver-e10-yimiaoban/SKILL.md +2 -1
  157. package/skills/weaver-e10-yimiaoban/references/msg-write.md +32 -0
  158. package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +3 -0
  159. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +11 -11
  160. package/dist/chunks/{ebuilder-form-GWDTKEI2.js → ebuilder-form-I5ZIX4WO.js} +3 -3
  161. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-README.md +0 -0
  162. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-SKILL.md +0 -0
  163. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-openai.yaml +0 -0
  164. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-position-templates.md +0 -0
  165. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-arrange-interview.md +0 -0
  166. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-capability-check.md +0 -0
  167. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-check-install.md +0 -0
  168. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-detail-process.md +0 -0
  169. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-edit-interview-feedback.md +0 -0
  170. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-jd-create.md +0 -0
  171. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-jd-template.md +0 -0
  172. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-list-candidate.md +0 -0
  173. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-list-interview.md +0 -0
  174. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-match-candidates.md +0 -0
  175. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-output-links.md +0 -0
  176. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-creator.md +0 -0
  177. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-metadata.md +0 -0
  178. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resume-import.md +0 -0
  179. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resume-parse.md +0 -0
  180. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-search-candidate.md +0 -0
  181. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-urge-feedback.md +0 -0
@@ -618,6 +618,7 @@ function ambiguousPerson(keyword, rows) {
618
618
  );
619
619
  }
620
620
  var dsOptionsMemo = /* @__PURE__ */ new Map();
621
+ var dsOptionsFullMemo = /* @__PURE__ */ new Map();
621
622
  function restoreDsOptions(snapshot) {
622
623
  for (const [key, value] of Object.entries(snapshot || {})) {
623
624
  if (value && typeof value === "object" && Object.keys(value).length) {
@@ -696,6 +697,7 @@ async function verifySubmitted(opts) {
696
697
  }
697
698
  function invalidateEnvCache(baseUrl, appId) {
698
699
  dsOptionsMemo.clear();
700
+ dsOptionsFullMemo.clear();
699
701
  if (!baseUrl || !appId) return;
700
702
  try {
701
703
  const host = baseUrl.replace(/^https?:\/\//, "").replace(/\/+$/, "").replace(/:/g, "_");
@@ -705,21 +707,40 @@ function invalidateEnvCache(baseUrl, appId) {
705
707
  } catch {
706
708
  }
707
709
  }
708
- async function getDsOptions(host, objId, fieldId, groupId = "") {
709
- const key = objId + ":" + fieldId;
710
- const hit = dsOptionsMemo.get(key);
710
+ async function fetchDsOptionsRaw(host, objId, fieldId, groupId) {
711
+ const r = await host.request({
712
+ path: "/api/ebuilder/common/ds/options?fieldName=" + fieldId + "&objId=" + objId + "&sourceType=FORM" + (groupId ? "&groupId=" + groupId : ""),
713
+ method: "GET"
714
+ });
715
+ return r?.data || [];
716
+ }
717
+ async function getDsOptionsFull(host, objId, fieldId, groupId = "") {
718
+ const key = objId + ":" + fieldId + (groupId ? ":" + groupId : "") + ":full";
719
+ const hit = dsOptionsFullMemo.get(key);
711
720
  if (hit) return hit;
712
721
  const task = (async () => {
713
- const r = await host.request({
714
- path: "/api/ebuilder/common/ds/options?fieldName=" + fieldId + "&objId=" + objId + "&sourceType=FORM" + (groupId ? "&groupId=" + groupId : ""),
715
- method: "GET"
716
- });
717
- const list = r?.data || [];
722
+ const list = await fetchDsOptionsRaw(host, objId, fieldId, groupId);
718
723
  const map = {};
719
- for (const x of list) if (x?.name && x?.id) map[String(x.name)] = String(x.id);
720
- if (!Object.keys(map).length) dsOptionsMemo.delete(key);
721
- return map;
724
+ const disabled = [];
725
+ for (const x of list) {
726
+ if (!x?.name || !x?.id) continue;
727
+ if (String(x.archive) === "1") disabled.push({ name: String(x.name), id: String(x.id) });
728
+ else map[String(x.name)] = String(x.id);
729
+ }
730
+ if (!Object.keys(map).length && !disabled.length) dsOptionsFullMemo.delete(key);
731
+ return { map, disabled };
722
732
  })();
733
+ dsOptionsFullMemo.set(key, task);
734
+ task.catch(() => {
735
+ dsOptionsFullMemo.delete(key);
736
+ });
737
+ return task;
738
+ }
739
+ async function getDsOptions(host, objId, fieldId, groupId = "") {
740
+ const key = objId + ":" + fieldId;
741
+ const hit = dsOptionsMemo.get(key);
742
+ if (hit) return hit;
743
+ const task = getDsOptionsFull(host, objId, fieldId, groupId).then((r) => r.map);
723
744
  dsOptionsMemo.set(key, task);
724
745
  task.catch(() => {
725
746
  dsOptionsMemo.delete(key);
@@ -3995,8 +4016,16 @@ async function buildPlan(opts) {
3995
4016
  getDsOptions(host, objId, fid("interview_type")),
3996
4017
  getDsOptions(host, objId, fid("interview_session"))
3997
4018
  ]);
3998
- const typeId = typeMap[type];
3999
- if (!typeId) throw rsFail("\u9762\u8BD5\u65B9\u5F0F\u300C" + type + "\u300D\u4E0D\u5728\u679A\u4E3E\u4E2D\uFF08" + Object.keys(typeMap).join("/") + "\uFF09");
4019
+ const typeFull = await getDsOptionsFull(host, objId, fid("interview_type"));
4020
+ const typeId = typeFull.map[type];
4021
+ if (!typeId) {
4022
+ if (typeFull.disabled.some(function(d) {
4023
+ return d.name === type;
4024
+ })) {
4025
+ throw rsFail("\u9762\u8BD5\u65B9\u5F0F\u300C" + type + "\u300D\u5DF2\u7981\u7528\uFF08\u8BE5\u679A\u4E3E\u9879 archive=1\uFF09\uFF0C\u8BF7\u6539\u7528\u5176\u5B83\u9762\u8BD5\u65B9\u5F0F");
4026
+ }
4027
+ throw rsFail("\u9762\u8BD5\u65B9\u5F0F\u300C" + type + "\u300D\u4E0D\u5728\u679A\u4E3E\u4E2D\uFF08" + Object.keys(typeFull.map).join("/") + "\uFF09");
4028
+ }
4000
4029
  const sessionId = sessionMap[session];
4001
4030
  if (!sessionId) throw rsFail("\u9762\u8BD5\u8F6E\u6B21\u300C" + session + "\u300D\u4E0D\u5728\u679A\u4E3E\u4E2D\uFF08" + Object.keys(sessionMap).join("/") + "\uFF09");
4002
4031
  const emailFromTalent = String(cand.email || "").trim();
@@ -4466,9 +4495,16 @@ async function prefill2(args, env) {
4466
4495
  const typeKey = String(args.type || DEFAULT_INTERVIEW_TYPE);
4467
4496
  const typeFid = fields.interview_type;
4468
4497
  if (!typeFid) throw rsFail("\u9762\u8BD5\u8BA1\u5212\u7F3A\u5C11\u5B57\u6BB5 interview_type\uFF08ds/fields \u89E3\u6790\u4E0D\u5230\uFF09");
4469
- const typeMap = await getDsOptions(ctx.host, objId, typeFid);
4470
- const typeId = typeMap[typeKey];
4471
- if (!typeId) throw rsFail("\u9762\u8BD5\u65B9\u5F0F\u300C" + typeKey + "\u300D\u4E0D\u5728\u679A\u4E3E\u4E2D\uFF08" + Object.keys(typeMap).join("/") + "\uFF09");
4498
+ const typeFull = await getDsOptionsFull(ctx.host, objId, typeFid);
4499
+ const typeId = typeFull.map[typeKey];
4500
+ if (!typeId) {
4501
+ if (typeFull.disabled.some(function(d) {
4502
+ return d.name === typeKey;
4503
+ })) {
4504
+ throw rsFail("\u9762\u8BD5\u65B9\u5F0F\u300C" + typeKey + "\u300D\u5DF2\u7981\u7528\uFF08\u8BE5\u679A\u4E3E\u9879 archive=1\uFF09\uFF0C\u8BF7\u6539\u7528\u5176\u5B83\u9762\u8BD5\u65B9\u5F0F");
4505
+ }
4506
+ throw rsFail("\u9762\u8BD5\u65B9\u5F0F\u300C" + typeKey + "\u300D\u4E0D\u5728\u679A\u4E3E\u4E2D\uFF08" + Object.keys(typeFull.map).join("/") + "\uFF09");
4507
+ }
4472
4508
  const cardUrl = resolveTalentCardUrl2(ctx, talentId);
4473
4509
  const listUrl = await resolveInterviewListUrl(ctx).catch(() => null);
4474
4510
  const jsExpr = `(() => { const W = window.WeFormSDK; const i = W && W.getWeFormInstance('ebuilderform', '${formId}'); if (!i) return 'no-form-instance(\u8BF7\u5148\u5728\u4EBA\u624D\u5361\u7247\u70B9\u300C\u5B89\u6392\u9762\u8BD5\u300D\u6253\u5F00\u9762\u8BD5\u5B89\u6392\u8868\u5355)'; try { i.changeFieldValue('field${typeFid}', { value: '${typeId}' }); return 'ok \u9762\u8BD5\u65B9\u5F0F=${typeKey}'; } catch (e) { return 'err:' + e.message; } })()`;
@@ -4,16 +4,16 @@ import {
4
4
  getMeetingOperation,
5
5
  hasMeetingOperation,
6
6
  meetingOperationDefinitions
7
- } from "./chunk-76H3IKH6.js";
8
- import "./chunk-IP4CWQCF.js";
9
- import "./chunk-AD46OMQK.js";
10
- import "./chunk-6AXKWFKG.js";
11
- import "./chunk-4RWS2YYL.js";
12
- import "./chunk-OXHHJWNC.js";
13
- import "./chunk-PSOMGA3U.js";
14
- import "./chunk-GSZTA43P.js";
15
- import "./chunk-IRMIEDXN.js";
16
- import "./chunk-6V5ZPKHV.js";
7
+ } from "./chunk-5B5JXTY2.js";
8
+ import "./chunk-OCYRVZGN.js";
9
+ import "./chunk-WMSAWAWZ.js";
10
+ import "./chunk-EFOUMXIX.js";
11
+ import "./chunk-SVFG6EMV.js";
12
+ import "./chunk-BCACE6VV.js";
13
+ import "./chunk-R2HHLJNN.js";
14
+ import "./chunk-PSPOFLSU.js";
15
+ import "./chunk-FEP6ELMR.js";
16
+ import "./chunk-NK74RE5F.js";
17
17
  import "./chunk-7BDPM5ST.js";
18
18
  import "./chunk-UG5G54VL.js";
19
19
  import "./chunk-BUSC6UAE.js";
@@ -4,10 +4,10 @@ import {
4
4
  getWorkflowOperation,
5
5
  hasWorkflowOperation,
6
6
  workflowOperationDefinitions
7
- } from "./chunk-JB34OE7R.js";
7
+ } from "./chunk-NBEWUR7L.js";
8
8
  import "./chunk-HP7JIYMT.js";
9
9
  import "./chunk-WRXSAVKO.js";
10
- import "./chunk-727FH2NI.js";
10
+ import "./chunk-2IGZUMNG.js";
11
11
  import "./chunk-AJ62BGAW.js";
12
12
  import "./chunk-7BDPM5ST.js";
13
13
  import "./chunk-U6R6FZHD.js";
@@ -3,7 +3,7 @@ const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  getImOperation,
5
5
  imOperationDefinitions
6
- } from "./chunk-Q4OYAQYH.js";
6
+ } from "./chunk-72MI3MBX.js";
7
7
  import "./chunk-IC62NFM5.js";
8
8
  import "./chunk-YLCYX7LE.js";
9
9
  import "./chunk-UG5G54VL.js";
@@ -7,10 +7,10 @@ import {
7
7
  loadRooms,
8
8
  recommendRooms,
9
9
  rememberFrequentRoom
10
- } from "./chunk-6AXKWFKG.js";
11
- import "./chunk-OXHHJWNC.js";
12
- import "./chunk-IRMIEDXN.js";
13
- import "./chunk-6V5ZPKHV.js";
10
+ } from "./chunk-R2HHLJNN.js";
11
+ import "./chunk-PSPOFLSU.js";
12
+ import "./chunk-FEP6ELMR.js";
13
+ import "./chunk-NK74RE5F.js";
14
14
  import "./chunk-7BDPM5ST.js";
15
15
  import "./chunk-UG5G54VL.js";
16
16
  import "./chunk-BUSC6UAE.js";
@@ -8,10 +8,10 @@ import {
8
8
  resolveMeetingScheduleTypeIds,
9
9
  resolveMemberIdsByName,
10
10
  runScheduleConflictFlow
11
- } from "./chunk-4RWS2YYL.js";
12
- import "./chunk-OXHHJWNC.js";
13
- import "./chunk-IRMIEDXN.js";
14
- import "./chunk-6V5ZPKHV.js";
11
+ } from "./chunk-BCACE6VV.js";
12
+ import "./chunk-PSPOFLSU.js";
13
+ import "./chunk-FEP6ELMR.js";
14
+ import "./chunk-NK74RE5F.js";
15
15
  import "./chunk-7BDPM5ST.js";
16
16
  import "./chunk-UG5G54VL.js";
17
17
  import "./chunk-BUSC6UAE.js";
@@ -17,7 +17,7 @@ import {
17
17
  validateRuleFile,
18
18
  workflowOperationDefinitions,
19
19
  workflowSuccess
20
- } from "./chunk-JB34OE7R.js";
20
+ } from "./chunk-NBEWUR7L.js";
21
21
  import {
22
22
  createWorkflowContinuationSigner
23
23
  } from "./chunk-HP7JIYMT.js";
@@ -26,7 +26,7 @@ import {
26
26
  WorkflowCliError,
27
27
  workflowValidationError
28
28
  } from "./chunk-WRXSAVKO.js";
29
- import "./chunk-727FH2NI.js";
29
+ import "./chunk-2IGZUMNG.js";
30
30
  import "./chunk-AJ62BGAW.js";
31
31
  import {
32
32
  reportPlatformError
package/dist/core/refs.js CHANGED
@@ -377,7 +377,24 @@ export function pruneRefs(ctx, options = {}) {
377
377
  /** 轻量 JSON 路径取值,支持 `a.b[0].c`、`$.data.items[0].fid`,并允许省略 `data.` 前缀。 */
378
378
  export function pickValue(value, path) {
379
379
  let cursor = value;
380
- for (const token of tokenizePath(path)) {
380
+ let tokens = tokenizePath(path);
381
+ const rootIsObject = cursor !== null && typeof cursor === 'object' && !Array.isArray(cursor);
382
+ if (rootIsObject && typeof tokens[0] === 'string' && !(tokens[0] in cursor)) {
383
+ const root = cursor;
384
+ if (tokens[0] === 'data' && root.data === undefined) {
385
+ // 兼容以 data 对象为根直接取值的老写法(`data.items` ⇒ `items`)。
386
+ tokens = tokens.slice(1);
387
+ }
388
+ else {
389
+ // 省略 `data.` 前缀的写法(如 `summary` / `items[0].fid`):首段在根对象上不存在时,
390
+ // 自动下钻到 envelope.data 再取一次;显式写了 `data.xxx` 的路径保持原样。
391
+ const data = root.data;
392
+ if (data !== null && typeof data === 'object' && tokens[0] in data) {
393
+ cursor = data;
394
+ }
395
+ }
396
+ }
397
+ for (const token of tokens) {
381
398
  if (cursor === null || cursor === undefined) {
382
399
  throw new RefError('ref_pick_failed', `--pick 路径 ${path} 在 ${token} 处无法继续`);
383
400
  }
@@ -400,7 +417,7 @@ export function pickValue(value, path) {
400
417
  return cursor;
401
418
  }
402
419
  function tokenizePath(path) {
403
- let cursor = path.trim().replace(/^\$/, '').replace(/^data\./, '');
420
+ const cursor = path.trim().replace(/^\$/, '');
404
421
  const tokens = [];
405
422
  const pattern = /([^.[\]]+)|\[(\d+)\]/g;
406
423
  let match;
package/dist/index.js CHANGED
@@ -7,9 +7,9 @@ import {
7
7
  firstPositionalToken,
8
8
  registerCommands,
9
9
  toCommandMetadata
10
- } from "./chunks/chunk-J2VEB5K3.js";
11
- import "./chunks/chunk-727FH2NI.js";
12
- import "./chunks/chunk-LIEQJIGM.js";
10
+ } from "./chunks/chunk-2BQESR2U.js";
11
+ import "./chunks/chunk-2IGZUMNG.js";
12
+ import "./chunks/chunk-GR76ZDDX.js";
13
13
  import "./chunks/chunk-AJ62BGAW.js";
14
14
  import "./chunks/chunk-6N4JPNFL.js";
15
15
  import "./chunks/chunk-6NXT4ICB.js";
@@ -30,7 +30,7 @@ function lazyShortcut(definition) {
30
30
  placeholder.allowExcessArguments(true);
31
31
  placeholder.helpOption(false);
32
32
  placeholder.action(async () => {
33
- const { dispatchLazyShortcut } = await import("./chunks/lazy-dispatch-25XGTXLM.js");
33
+ const { dispatchLazyShortcut } = await import("./chunks/lazy-dispatch-XSAHDK6Z.js");
34
34
  await dispatchLazyShortcut(definition, shortcutMetadata());
35
35
  });
36
36
  }
@@ -40,17 +40,17 @@ var builtinShortcuts = [
40
40
  lazyShortcut({
41
41
  name: "invoice",
42
42
  description: "E10 \u4E1A\u7968\u901A\u53D1\u7968\u7BA1\u7406 CLI",
43
- load: async () => (await import("./chunks/invoice-UEAHSYAE.js")).invoiceShortcut
43
+ load: async () => (await import("./chunks/invoice-FXWH5GPO.js")).invoiceShortcut
44
44
  }),
45
45
  lazyShortcut({
46
46
  name: "ehr",
47
47
  description: "\u6CDB\u5FAEE10\u805A\u624D\u6797\uFF08\u4EBA\u4E8B/\u51FA\u52E4/\u85AA\u916C\uFF09CLI",
48
- load: async () => (await import("./chunks/ehr-SH2LM3NK.js")).ehrShortcut
48
+ load: async () => (await import("./chunks/ehr-XI4BIVR2.js")).ehrShortcut
49
49
  }),
50
50
  lazyShortcut({
51
51
  name: "recruit-stage",
52
52
  description: "\u6CDB\u5FAEE10\u62DB\u8058\u52A9\u624B\uFF08JD\u751F\u6210/\u7B80\u5386\u5EFA\u6863/AI\u9762\u8BD5\u9080\u7EA6\uFF09CLI",
53
- load: async () => (await import("./chunks/recruit-stage-CAKZTUA7.js")).recruitStageShortcut
53
+ load: async () => (await import("./chunks/recruit-stage-ERZD3ZNB.js")).recruitStageShortcut
54
54
  }),
55
55
  lazyShortcut({
56
56
  name: "cowork",
@@ -65,7 +65,7 @@ var builtinShortcuts = [
65
65
  lazyShortcut({
66
66
  name: "archive-oa",
67
67
  description: "E10 \u6863\u6848\u5B9A\u4F4D\u4E0E OA \u5546\u52A1\u5408\u540C\u501F\u9605 CLI",
68
- load: async () => (await import("./chunks/archive-oa-BBDP7AKJ.js")).archiveOaShortcut
68
+ load: async () => (await import("./chunks/archive-oa-EDJDU3V4.js")).archiveOaShortcut
69
69
  }),
70
70
  lazyShortcut({
71
71
  name: "calendar",
@@ -90,7 +90,7 @@ var builtinShortcuts = [
90
90
  lazyShortcut({
91
91
  name: "meeting",
92
92
  description: "\u6CDB\u5FAEE10\u4F1A\u8BAE\u7BA1\u7406 CLI\uFF08\u6807\u51C6\u7248\uFF1A\u67E5\u8BE2/\u51B2\u7A81/\u9884\u7EA6/\u56DE\u6267/\u7B7E\u5230\uFF09",
93
- load: async () => (await import("./chunks/meeting-VTBFW4HI.js")).meetingShortcut
93
+ load: async () => (await import("./chunks/meeting-RYZV2JTQ.js")).meetingShortcut
94
94
  }),
95
95
  lazyShortcut({
96
96
  name: "okr",
@@ -110,7 +110,7 @@ var builtinShortcuts = [
110
110
  lazyShortcut({
111
111
  name: "ebuilder-form",
112
112
  description: "\u6CDB\u5FAEE10 eBuilder \u8868\u5355\u83DC\u5355\u3001\u5217\u8868\u548C\u8868\u5355\u6570\u636E CLI",
113
- load: async () => (await import("./chunks/ebuilder-form-GWDTKEI2.js")).ebuilderFormShortcut
113
+ load: async () => (await import("./chunks/ebuilder-form-I5ZIX4WO.js")).ebuilderFormShortcut
114
114
  }),
115
115
  lazyShortcut({
116
116
  name: "jiuchuanhui",
@@ -130,7 +130,7 @@ var builtinShortcuts = [
130
130
  lazyShortcut({
131
131
  name: "im",
132
132
  description: "\u6CDB\u5FAEE10\u6613\u79D2\u529E\uFF08\u5373\u65F6\u901A\u8BAF\uFF09CLI",
133
- load: async () => (await import("./chunks/im-NJB7ZYMH.js")).imShortcut
133
+ load: async () => (await import("./chunks/im-3RCNL5GT.js")).imShortcut
134
134
  }),
135
135
  lazyShortcut({
136
136
  name: "project",
@@ -140,7 +140,7 @@ var builtinShortcuts = [
140
140
  lazyShortcut({
141
141
  name: "workflow",
142
142
  description: "\u6CDB\u5FAEE10\u6D41\u7A0B\u667A\u80FD\u52A9\u624B CLI\uFF08\u67E5\u8BE2/\u67E5\u770B/\u64CD\u4F5C/\u6279\u91CF/\u53D1\u8D77/\u4FEE\u6539\uFF09",
143
- load: async () => (await import("./chunks/workflow-BSYT5TGL.js")).workflowShortcut
143
+ load: async () => (await import("./chunks/workflow-WVEFJ6KC.js")).workflowShortcut
144
144
  }),
145
145
  lazyShortcut({
146
146
  name: "blog",
@@ -155,12 +155,12 @@ var builtinShortcuts = [
155
155
  lazyShortcut({
156
156
  name: "contract",
157
157
  description: "\u6CDB\u5FAEE10\u4ECA\u627F\u8FBE\u5408\u540C\u7BA1\u7406 CLI",
158
- load: async () => (await import("./chunks/contract-3QLAGYQL.js")).contractShortcut
158
+ load: async () => (await import("./chunks/contract-N6P2HIIE.js")).contractShortcut
159
159
  }),
160
160
  lazyShortcut({
161
161
  name: "reception",
162
162
  description: "\u6CDB\u5FAE\u5BA2\u6237\u53C2\u89C2\u63A5\u5F85\u6D41\u7A0B CLI\uFF08\u9762\u677F/\u884C\u7A0B\u5355\u4E0E\u5185\u90E8\u65B9\u6848/\u586B\u5355\u9875\u9884\u586B\uFF09",
163
- load: async () => (await import("./chunks/reception-5WITA44R.js")).receptionShortcut
163
+ load: async () => (await import("./chunks/reception-VL6TKVAW.js")).receptionShortcut
164
164
  })
165
165
  ];
166
166
  function shortcutMetadata() {
@@ -61,6 +61,48 @@ export const QYS_ESB_ADD = {
61
61
  listId: '1190611964371984450',
62
62
  successText: '【契约锁加入借阅车】执行成功!',
63
63
  };
64
+ /**
65
+ * 移出借阅车:`dataIds` 传借阅车行 ID(`borrow-car.list` 的 `rows[].id`),
66
+ * 与加入借阅车传合同行 ID 不同,禁止混用。
67
+ */
68
+ export const WEAVER_ESB_REMOVE = {
69
+ source: 'weaver',
70
+ esbActionIds: '882413705640943619',
71
+ objId: '882393476189437952',
72
+ listId: '882393480417296390',
73
+ successText: '【移出借阅车】执行成功!',
74
+ };
75
+ export const QYS_ESB_REMOVE = {
76
+ source: 'qys',
77
+ esbActionIds: '882413705640943619',
78
+ objId: '882393476189437952',
79
+ listId: '883819516961857839',
80
+ successText: '【契约锁移出借阅车】执行成功!',
81
+ };
64
82
  /** 契约锁默认过滤「处理进度 = 已归档」。 */
65
83
  export const QYS_DEFAULT_ARCHIVED_FIELD = 'cljd';
66
84
  export const QYS_DEFAULT_ARCHIVED_VALUE = '已归档';
85
+ export const MY_BORROW_CONTRACT = {
86
+ source: 'weaver',
87
+ pageAppId: '100002780000000542',
88
+ pageId: '1335759383610105964',
89
+ compId: 'c922aecea25d4f538d8cb4d89320e916',
90
+ refPluginPackageId: '933846626099339271',
91
+ objId: '1335759383610105884',
92
+ archiveAppId: '2c109885898d48c19e49edd4cfd2bf2f',
93
+ fields: {
94
+ applyDate: '11738424152292925447525441107052728320',
95
+ requestId: '11738424152292925447525434968495886336',
96
+ customer: '11738424152292925447525437940097355783',
97
+ contractNo: '11738424152292925447525437940101550081',
98
+ archiveId: '11738424152292925447525437940101550084',
99
+ applicant: '11738424152292925447525436635463290880',
100
+ expireDate: '11738424152292925447525436280084107264',
101
+ },
102
+ };
103
+ /** 电子档案打开链接(与界面一致):`/sp/integration/loginSingle?appId=...&archiveId=...`。 */
104
+ export const MY_BORROW_ARCHIVE_OPEN_PATH = '/sp/integration/loginSingle';
105
+ /** 关联流程查看页:`/sp/workflow/flowpage/view/{requestId}`。 */
106
+ export const MY_BORROW_FLOW_VIEW_PATH = '/sp/workflow/flowpage/view';
107
+ /** 授权到期日期的默认上限:查询「未过期」时用「今天 ~ 2099-12-31」。 */
108
+ export const MY_BORROW_EXPIRE_MAX = '2099-12-31';
@@ -106,7 +106,7 @@ export function createArchiveOaHost(ctx, dependencies = {}) {
106
106
  return sessionContext;
107
107
  }
108
108
  async function request(request) {
109
- const { method, path, query, body, operation, headers: extraHeaders = {}, timeoutMs = 60_000, skipBusinessCheck = false, } = request;
109
+ const { method, path, query, body, formData, operation, headers: extraHeaders = {}, timeoutMs = 60_000, skipBusinessCheck = false, } = request;
110
110
  assertArchiveOaPath(path);
111
111
  const resolvedMethod = method || (body === undefined ? 'GET' : 'POST');
112
112
  const runtime = createE10RequestRuntime(ctx, await ensureSession(), {
@@ -119,7 +119,7 @@ export function createArchiveOaHost(ctx, dependencies = {}) {
119
119
  method: resolvedMethod,
120
120
  path,
121
121
  query: omitEmptyQueryValues(query),
122
- body,
122
+ ...(formData ? { formData } : { body }),
123
123
  headers: { 'X-Requested-With': 'XMLHttpRequest', ...extraHeaders },
124
124
  timeoutMs,
125
125
  }).catch((error) => mapRuntimeNetworkError(error));
@@ -165,6 +165,20 @@ export const archiveOaShortcut = {
165
165
  .action(action(async (ctx) => {
166
166
  await executeAndPrint(ctx, 'archive-oa.contract.fields', {});
167
167
  }));
168
+ const myBorrow = command.command('my-borrow').description('My borrowed contract archives (eBuilder list)');
169
+ withJsonInputOptions(myBorrow.command('list')
170
+ .description('List contract archives I borrowed (default: not expired)')
171
+ .option('--page-no <page>', 'page number, starts from 1')
172
+ .option('--page-size <size>', 'page size, default 10, max 50')
173
+ .option('--include-expired', 'include expired borrows (drop the expire-date filter)'))
174
+ .action(action(async (ctx, options) => {
175
+ const opts = asOptions(options);
176
+ await executeAndPrint(ctx, 'archive-oa.my-borrow.list', await archiveOaInputFrom(options, {
177
+ pageNo: intOption(opts.pageNo),
178
+ pageSize: intOption(opts.pageSize),
179
+ includeExpired: opts.includeExpired === true ? true : undefined,
180
+ }));
181
+ }));
168
182
  const qys = command.command('qys').description('Qiyuesuo (case) contract commands');
169
183
  withJsonInputOptions(qys.command('list')
170
184
  .description('Query Qiyuesuo collaboration contracts (default archived only)')
@@ -211,6 +225,30 @@ export const archiveOaShortcut = {
211
225
  confirm: opts.yes === true ? true : undefined,
212
226
  }));
213
227
  }));
228
+ withJsonInputOptions(borrowCar.command('remove-prepare')
229
+ .description('Prepare removing entries from the borrow car (max 6)')
230
+ .option('--source <source>', 'weaver or qys, default weaver')
231
+ .option('--data-ids <ids>', 'comma separated borrow car row ids'))
232
+ .action(action(async (ctx, options) => {
233
+ const opts = asOptions(options);
234
+ const source = resolveSource(opts.source);
235
+ await executeAndPrint(ctx, borrowCarOperation('remove.prepare', source), await archiveOaInputFrom(options, {
236
+ dataIds: stringListOption(opts.dataIds),
237
+ }));
238
+ }));
239
+ withJsonInputOptions(borrowCar.command('remove-apply')
240
+ .description('Apply removing entries from the borrow car')
241
+ .option('--continuation <token>', 'continuation token from prepare')
242
+ .option('--source <source>', 'weaver or qys, default weaver')
243
+ .option('--yes', 'confirm the write operation'))
244
+ .action(action(async (ctx, options) => {
245
+ const opts = asOptions(options);
246
+ const source = resolveSource(opts.source);
247
+ await executeAndPrint(ctx, borrowCarOperation('remove.apply', source), await archiveOaInputFrom(options, {
248
+ continuation: stringOption(opts.continuation),
249
+ confirm: opts.yes === true ? true : undefined,
250
+ }));
251
+ }));
214
252
  const borrow = command.command('borrow').description('Borrow workflow commands');
215
253
  withJsonInputOptions(borrow.command('start-url')
216
254
  .description('Build the borrow workflow page URL from borrow car entries')
@@ -1,4 +1,4 @@
1
- import { MAX_BORROW_ITEMS } from '../constants.js';
1
+ import { MAX_BORROW_ITEMS, } from '../constants.js';
2
2
  import { HIGH_RISK_WRITE, READ, READ_BEFORE_WRITE, archiveOaSuccess, schemaOf, SCHEMA_ID_LIST, SCHEMA_PAGE_NO, } from './types.js';
3
3
  import { normalizeListResult, positiveInt, requireIdList, unwrapData, } from './shared.js';
4
4
  import { archiveOaPartialError } from '../errors.js';
@@ -154,6 +154,120 @@ function makeAddOperations(carProfile, esb) {
154
154
  };
155
155
  return [prepare, apply];
156
156
  }
157
- export function createBorrowCarOperations(carProfile, esb) {
158
- return [makeListOperation(carProfile), ...makeAddOperations(carProfile, esb)];
157
+ /** 移出借阅车(ESB 删除动作)prepare + apply。`dataIds` 是借阅车行 ID,不是合同行 ID。 */
158
+ function makeRemoveOperations(carProfile, esb) {
159
+ const prepareName = `${prefix(carProfile.source)}.remove.prepare`;
160
+ const applyName = `${prefix(carProfile.source)}.remove.apply`;
161
+ const prepare = {
162
+ name: prepareName,
163
+ resource: 'borrow-car',
164
+ method: 'remove',
165
+ action: prepareName,
166
+ summary: `把${esb.source === 'qys' ? '契约锁' : '泛微'}借阅车记录移出借阅车:校验条数并回查借阅车现状(不写数据)`,
167
+ capability: 'borrow-car',
168
+ risk: READ_BEFORE_WRITE,
169
+ inputSchema: schemaOf({
170
+ dataIds: {
171
+ ...SCHEMA_ID_LIST,
172
+ maxItems: MAX_BORROW_ITEMS,
173
+ description: `借阅车行 id 数组,来自 borrow-car.list 的 rows[].id,最多 ${MAX_BORROW_ITEMS} 条`,
174
+ },
175
+ }, { required: ['dataIds'], description: '移出借阅车预检' }),
176
+ handler: async (args, env) => {
177
+ const dataIds = requireIdList(args.dataIds, 'dataIds', MAX_BORROW_ITEMS);
178
+ const current = await env.host.request({
179
+ method: 'POST',
180
+ path: CONTRACT_LIST_PATH,
181
+ operation: prepareName,
182
+ query: { passid: carProfile.passId, cid: carProfile.passId, sf_request_type: 'ajax' },
183
+ body: {
184
+ current: 1,
185
+ requiredMatch: 1,
186
+ mapResult: '1',
187
+ recheckQuery: '1',
188
+ cusMenuId: carProfile.cusMenuId,
189
+ urlPageTitle: carProfile.urlPageTitle,
190
+ searchParamData: { searchType: '2', type: 'and', commonSearchFields: {}, groupFields: {} },
191
+ listId: carProfile.listId,
192
+ isFollow: 0,
193
+ isShareToMe: 0,
194
+ filterCondition: {},
195
+ browser: 'Chrome',
196
+ },
197
+ });
198
+ const { rows } = normalizeListResult(prepareName, current, carProfile.source);
199
+ const existing = new Set(rows.map((row) => String(row.id ?? row.form_data_id ?? '')));
200
+ const notInBorrowCar = dataIds.filter((id) => !existing.has(id));
201
+ const { continuation, expiresInMs } = await issueLease(env, applyName, {
202
+ dataIds,
203
+ esbActionIds: esb.esbActionIds,
204
+ objId: esb.objId,
205
+ listId: esb.listId,
206
+ });
207
+ return archiveOaSuccess(prepareName, {
208
+ preview: {
209
+ source: carProfile.source,
210
+ count: dataIds.length,
211
+ dataIds,
212
+ borrowCarBefore: rows.length,
213
+ notInBorrowCar,
214
+ },
215
+ hint: `确认后调用 ${applyName}(CLI:archive-oa borrow-car remove-apply --continuation <token> --yes)`,
216
+ continuation,
217
+ }, { requiresConfirmation: true, expiresInMs });
218
+ },
219
+ };
220
+ const apply = {
221
+ name: applyName,
222
+ resource: 'borrow-car',
223
+ method: 'remove',
224
+ action: applyName,
225
+ summary: `把${esb.source === 'qys' ? '契约锁' : '泛微'}借阅车记录移出借阅车(写操作):执行 ESB 动作`,
226
+ capability: 'borrow-car',
227
+ risk: HIGH_RISK_WRITE,
228
+ requiresConfirmation: true,
229
+ inputSchema: schemaOf({
230
+ continuation: { type: 'string', description: 'prepare 返回的确认票据' },
231
+ confirm: { type: 'boolean', description: '必须为 true(CLI --yes)' },
232
+ }, { required: ['continuation', 'confirm'], description: '移出借阅车' }),
233
+ handler: async (args, env) => {
234
+ const lease = await verifyLease(args, applyName, env);
235
+ assertLeaseTarget(lease, args, ['dataIds'], applyName);
236
+ const dataIds = Array.isArray(lease.dataIds) ? lease.dataIds.map(String) : [];
237
+ if (dataIds.length === 0 || dataIds.length > MAX_BORROW_ITEMS) {
238
+ throw new Error('continuation 缺少合法的 dataIds');
239
+ }
240
+ const response = await env.host.request({
241
+ method: 'POST',
242
+ path: RUN_ESB_PATH,
243
+ operation: applyName,
244
+ query: { sf_request_type: 'ajax' },
245
+ body: {
246
+ dataIds: dataIds.join(','),
247
+ esbActionIds: String(lease.esbActionIds ?? esb.esbActionIds),
248
+ objId: String(lease.objId ?? esb.objId),
249
+ listId: String(lease.listId ?? esb.listId),
250
+ },
251
+ });
252
+ const data = (unwrapData(response) ?? {});
253
+ const failNum = Number(data.failNum ?? 0);
254
+ if (failNum > 0) {
255
+ throw archiveOaPartialError(`移出借阅车部分失败:成功 ${data.successNum ?? 0} 条,失败 ${failNum} 条`, { successNum: data.successNum ?? 0, failNum, failIds: data.failIds ?? [] }, { dataIds, needRefresh: data.needRefresh === true });
256
+ }
257
+ return archiveOaSuccess(applyName, {
258
+ message: String(data.successMsg ?? esb.successText),
259
+ successNum: data.successNum ?? dataIds.length,
260
+ failNum,
261
+ needRefresh: data.needRefresh === true,
262
+ }, { wrote: true, source: carProfile.source, count: dataIds.length });
263
+ },
264
+ };
265
+ return [prepare, apply];
266
+ }
267
+ export function createBorrowCarOperations(carProfile, esb, esbRemove) {
268
+ return [
269
+ makeListOperation(carProfile),
270
+ ...makeAddOperations(carProfile, esb),
271
+ ...makeRemoveOperations(carProfile, esbRemove),
272
+ ];
159
273
  }