weaver-work-cli 0.1.32 → 0.1.36

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 (211) hide show
  1. package/README.md +2 -2
  2. package/dist/chunks/{archive-UMGX72K6.js → archive-XBVH7JU7.js} +2 -2
  3. package/dist/chunks/{archive-oa-N2IYBLF3.js → archive-oa-MZM3EKFQ.js} +2 -2
  4. package/dist/chunks/{asset-GLEGKFG5.js → asset-4XO7UOUW.js} +2 -2
  5. package/dist/chunks/{attachment-content-AQNX5N3S.js → attachment-content-VXSWANAC.js} +3 -2
  6. package/dist/chunks/{blog-E44OTVDA.js → blog-PGZKOPSC.js} +2 -2
  7. package/dist/chunks/{caizhilian-DQUFZXZL.js → caizhilian-BH4ZVGUN.js} +2 -2
  8. package/dist/chunks/{calendar-JKPIRKFD.js → calendar-MXEMTIO4.js} +2 -2
  9. package/dist/chunks/{chunk-QWY6PGL6.js → chunk-2LV74IWP.js} +361 -56
  10. package/dist/chunks/chunk-3SO6QL6U.js +73 -0
  11. package/dist/chunks/chunk-5DQEEGCC.js +229 -0
  12. package/dist/chunks/{chunk-G3QJULO2.js → chunk-6LLJFKJE.js} +1 -1
  13. package/dist/chunks/{chunk-C6R3B2ML.js → chunk-BPE37FPB.js} +35 -7
  14. package/dist/chunks/chunk-BYATLLEF.js +68 -0
  15. package/dist/chunks/chunk-BYBSCN4X.js +932 -0
  16. package/dist/chunks/{chunk-CVZ2JOSW.js → chunk-F746NKNF.js} +1 -1
  17. package/dist/chunks/{chunk-GCG2NMWR.js → chunk-HXJQI5NM.js} +4 -2
  18. package/dist/chunks/{chunk-YRVDW4WN.js → chunk-I6QGIBDM.js} +2 -2
  19. package/dist/chunks/{chunk-H7J4DC5R.js → chunk-JCSN3JGM.js} +2 -2
  20. package/dist/chunks/{chunk-2GA5ZIQL.js → chunk-JNG42JKG.js} +30 -1
  21. package/dist/chunks/{chunk-DW6AUUKS.js → chunk-JUXVYKII.js} +9 -4
  22. package/dist/chunks/{chunk-6RKD4DRZ.js → chunk-JYKABYCV.js} +2 -2
  23. package/dist/chunks/{chunk-6EFWDL7Y.js → chunk-NCOVUAZK.js} +2 -2
  24. package/dist/chunks/{chunk-E4Z23GHM.js → chunk-QHFANTX7.js} +1114 -904
  25. package/dist/chunks/{ebuilder-form-V5FG2EHC.js → chunk-QYGO5EE2.js} +22 -1148
  26. package/dist/chunks/{chunk-IURUFGZK.js → chunk-T72N74ZT.js} +50 -33
  27. package/dist/chunks/{chunk-H6XSTSLM.js → chunk-TC6MZAO3.js} +137 -204
  28. package/dist/chunks/{chunk-WKI2FBIQ.js → chunk-VPUTVEMC.js} +737 -341
  29. package/dist/chunks/{chunk-WSKBSQ2U.js → chunk-VPXOPQJI.js} +2 -2
  30. package/dist/chunks/chunk-WXFPWCXG.js +774 -0
  31. package/dist/chunks/{chunk-4YC43QQ4.js → chunk-XMGSYD6S.js} +4 -4
  32. package/dist/chunks/conflict-JAB2LJEZ.js +21 -0
  33. package/dist/chunks/continuation-RN6PZN2M.js +11 -0
  34. package/dist/chunks/contract-XI2EEIZU.js +9110 -0
  35. package/dist/chunks/cowork-SCPGLBA4.js +2527 -0
  36. package/dist/chunks/ebuilder-form-EYLHNOTA.js +121 -0
  37. package/dist/chunks/{ehr-HMFY6VIL.js → ehr-EAP77IMT.js} +1344 -27
  38. package/dist/chunks/{esb-ZYSVB7SG.js → esb-2TGGXEE7.js} +4 -4
  39. package/dist/chunks/{fna-B7RKPAZD.js → fna-2X7ZE7BU.js} +13 -8
  40. package/dist/chunks/{host-OCH2BCCV.js → host-C6EL2RKL.js} +3 -3
  41. package/dist/chunks/{host-45WED2KK.js → host-I4NRK4MX.js} +3 -3
  42. package/dist/chunks/{host-I4Z6BFYX.js → host-Q4LZGCRU.js} +3 -3
  43. package/dist/chunks/host-UEI5FGDM.js +23 -0
  44. package/dist/chunks/{host-KNZ52LJZ.js → host-XCLDDXKQ.js} +3 -3
  45. package/dist/chunks/{hrm-2KAZGUHI.js → hrm-YXERJM76.js} +3 -3
  46. package/dist/chunks/{im-ACJJWH4U.js → im-A4VZN2TQ.js} +88 -12
  47. package/dist/chunks/{invoice-ZK3WCX2U.js → invoice-2Z6YPMIS.js} +3 -3
  48. package/dist/chunks/{jiuchuanhui-5PQD3IL2.js → jiuchuanhui-AR5GMKZB.js} +2 -2
  49. package/dist/chunks/{lazy-dispatch-JQXBW3GM.js → lazy-dispatch-QXW7P4X3.js} +4 -4
  50. package/dist/chunks/{mail-S2HDDXO2.js → mail-7GZ6CPBJ.js} +45 -24
  51. package/dist/chunks/{meeting-QVN3I37L.js → meeting-3NMGA3MB.js} +278 -43
  52. package/dist/chunks/{okr-QNG4VC2Q.js → okr-BZ6XUOAG.js} +2 -2
  53. package/dist/chunks/operations-5QL3AECO.js +11 -0
  54. package/dist/chunks/{plan-A25EMW6U.js → plan-DR5CMUYP.js} +2 -2
  55. package/dist/chunks/{project-G6XV66DZ.js → project-6J63MK33.js} +2 -2
  56. package/dist/chunks/{registry-DC6KR3NH.js → registry-KDD7DHNK.js} +4 -4
  57. package/dist/chunks/{registry-2VLUAESA.js → registry-OZSMDVPP.js} +2 -2
  58. package/dist/chunks/{registry-7C5UMIPL.js → registry-TKX2E7C7.js} +2 -2
  59. package/dist/chunks/{registry-TI3CIUXF.js → registry-VRTNC6UR.js} +8 -6
  60. package/dist/chunks/{room-recommend-WRTHO6Y2.js → room-recommend-XCWRMB5P.js} +4 -3
  61. package/dist/chunks/{schedule-KFIITGSK.js → schedule-IVBICP32.js} +4 -3
  62. package/dist/chunks/{workflow-DJ7SYWAF.js → workflow-D74NFK3C.js} +179 -6
  63. package/dist/index.js +35 -25
  64. package/dist/internal/e10/auth-recovery.js +14 -4
  65. package/dist/internal/e10/fetch-timing.js +31 -0
  66. package/dist/internal/e10/request-runtime.js +5 -0
  67. package/dist/shortcuts/contract/host.js +34 -59
  68. package/dist/shortcuts/cowork/continuation.js +70 -0
  69. package/dist/shortcuts/cowork/errors.js +59 -0
  70. package/dist/shortcuts/cowork/host.js +180 -0
  71. package/dist/shortcuts/cowork/index.js +166 -0
  72. package/dist/shortcuts/cowork/manifest.js +65 -0
  73. package/dist/shortcuts/cowork/operations/discuss-write.js +277 -0
  74. package/dist/shortcuts/cowork/operations/item-write.js +380 -0
  75. package/dist/shortcuts/cowork/operations/member-write.js +283 -0
  76. package/dist/shortcuts/cowork/operations/permission-write.js +286 -0
  77. package/dist/shortcuts/cowork/operations/read.js +423 -0
  78. package/dist/shortcuts/cowork/operations/registry.js +39 -0
  79. package/dist/shortcuts/cowork/operations/review-write.js +157 -0
  80. package/dist/shortcuts/cowork/operations/shared.js +215 -0
  81. package/dist/shortcuts/cowork/operations/types.js +39 -0
  82. package/dist/shortcuts/cowork/operations.js +19 -0
  83. package/dist/shortcuts/ehr/host.js +4 -1
  84. package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +757 -0
  85. package/dist/shortcuts/ehr/operations/recruit-position.js +367 -0
  86. package/dist/shortcuts/ehr/operations/recruit-stats.js +133 -0
  87. package/dist/shortcuts/ehr/operations/recruit-write.js +43 -16
  88. package/dist/shortcuts/ehr/operations/recruit.js +182 -10
  89. package/dist/shortcuts/ehr/operations/registry.js +6 -0
  90. package/dist/shortcuts/fna/operations/expense-chart.js +19 -7
  91. package/dist/shortcuts/im/diagnostics.js +97 -0
  92. package/dist/shortcuts/im/host.js +58 -31
  93. package/dist/shortcuts/im/index.js +7 -2
  94. package/dist/shortcuts/im/operations/at-mention.js +127 -0
  95. package/dist/shortcuts/im/operations/file-user.js +10 -2
  96. package/dist/shortcuts/im/operations/group-read.js +26 -5
  97. package/dist/shortcuts/im/operations/group-write.js +35 -28
  98. package/dist/shortcuts/im/operations/msg-sync.js +7 -2
  99. package/dist/shortcuts/im/operations/msg-write.js +76 -10
  100. package/dist/shortcuts/im/operations/quote-mention.js +119 -0
  101. package/dist/shortcuts/im/operations/session.js +1 -1
  102. package/dist/shortcuts/im/operations/shared.js +10 -0
  103. package/dist/shortcuts/im/operations/types.js +13 -0
  104. package/dist/shortcuts/index.js +10 -0
  105. package/dist/shortcuts/mail/host.js +12 -1
  106. package/dist/shortcuts/mail/operations/types.js +17 -2
  107. package/dist/shortcuts/meeting/host.js +27 -34
  108. package/dist/shortcuts/meeting/index.js +79 -1
  109. package/dist/shortcuts/meeting/manifest.js +10 -0
  110. package/dist/shortcuts/meeting/operations/create.js +4 -1
  111. package/dist/shortcuts/meeting/operations/eb/catalog.js +10 -0
  112. package/dist/shortcuts/meeting/operations/eb/conflict.js +84 -8
  113. package/dist/shortcuts/meeting/operations/eb/create-flow.js +1195 -140
  114. package/dist/shortcuts/meeting/operations/eb/factory.js +170 -8
  115. package/dist/shortcuts/meeting/operations/eb/index.js +16 -3
  116. package/dist/shortcuts/meeting/operations/eb/room-recommend.js +50 -5
  117. package/dist/shortcuts/meeting/operations/eb-fallback.js +163 -0
  118. package/dist/shortcuts/meeting/operations/env.js +99 -46
  119. package/dist/shortcuts/meeting/operations/form-fields.js +110 -0
  120. package/dist/shortcuts/meeting/operations/invitation.js +79 -20
  121. package/dist/shortcuts/meeting/operations/registry.js +2 -0
  122. package/dist/shortcuts/meeting/operations/standard-guard.js +71 -0
  123. package/dist/shortcuts/meeting/operations.js +16 -0
  124. package/dist/shortcuts/workflow/endpoints.js +8 -3
  125. package/dist/shortcuts/workflow/index.js +110 -1
  126. package/dist/shortcuts/workflow/operations/form.js +204 -36
  127. package/dist/shortcuts/workflow/operations/read.js +104 -23
  128. package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupRules.js +448 -0
  129. package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupStore.js +106 -0
  130. package/dist/shortcuts/workflow/operations/todoSmartConvert/businessRules.js +47 -0
  131. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +30 -23
  132. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +1 -0
  133. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +1 -0
  134. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.groupSummary.js +2 -1
  135. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +2 -4
  136. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +138 -181
  137. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.summary.js +12 -7
  138. package/dist/shortcuts/workflow/operations.js +23 -1
  139. package/docs/e10-auth.md +1 -1
  140. package/docs/ehr.md +1 -1
  141. package/docs/fna.md +2 -1
  142. package/docs/im.md +8 -1
  143. package/docs/todo-smart-convert/README.md +1 -1
  144. package/docs/todo-smart-convert/data-contract.md +2 -2
  145. package/docs/todo-smart-convert/subgroup-rules.md +6 -0
  146. package/package.json +1 -1
  147. package/skill-template/business-info.json +18 -0
  148. package/skill-template/domains/cowork.md +14 -0
  149. package/skill-template/domains/yimiaoban.md +3 -3
  150. package/skill-template/skill-template.md +1 -1
  151. package/skills/weaver-e10-blog/SKILL.md +5 -5
  152. package/skills/weaver-e10-caizhilian/SKILL.md +5 -5
  153. package/skills/weaver-e10-calendar/SKILL.md +5 -5
  154. package/skills/weaver-e10-cowork/SKILL.md +101 -0
  155. package/skills/weaver-e10-cowork/references/cowork-read.md +90 -0
  156. package/skills/weaver-e10-cowork/references/cowork-write.md +131 -0
  157. package/skills/weaver-e10-cowork/references/safety-boundaries.md +45 -0
  158. package/skills/weaver-e10-esb/SKILL.md +5 -5
  159. package/skills/weaver-e10-hrm/SKILL.md +5 -5
  160. package/skills/weaver-e10-jinchengda/SKILL.md +2 -2
  161. package/skills/weaver-e10-jiuchuanhui/SKILL.md +5 -5
  162. package/skills/weaver-e10-jucailin/SKILL.md +38 -14
  163. package/skills/weaver-e10-jucailin/references/recruit-create.md +104 -0
  164. package/skills/weaver-e10-jucailin/references/recruit-read.md +25 -0
  165. package/skills/weaver-e10-jucailin/references/recruit-write.md +13 -0
  166. package/skills/weaver-e10-jucailin/references/salary.md +15 -11
  167. package/skills/weaver-e10-mail/SKILL.md +17 -14
  168. package/skills/weaver-e10-meeting/SKILL.md +442 -46
  169. package/skills/weaver-e10-meeting/references/meeting-eb.md +135 -3
  170. package/skills/weaver-e10-meeting/references/meeting-invitation.md +28 -2
  171. package/skills/weaver-e10-meeting/references/meeting-queries.md +9 -6
  172. package/skills/weaver-e10-meeting/references/meeting-verification.md +8 -6
  173. package/skills/weaver-e10-meeting.zip +0 -0
  174. package/skills/weaver-e10-okr/SKILL.md +5 -5
  175. package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
  176. package/skills/weaver-e10-plan/SKILL.md +5 -5
  177. package/skills/weaver-e10-qiyecheng/SKILL.md +5 -2
  178. package/skills/weaver-e10-qiyecheng/references/catalog.md +2 -2
  179. package/skills/weaver-e10-qiyecheng/references/expense-chart.md +15 -1
  180. package/skills/weaver-e10-qiyecheng/references/source-manifest.json +22 -21
  181. package/skills/weaver-e10-shared/SKILL.md +12 -12
  182. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +4 -4
  183. package/skills/weaver-e10-wenshuding/SKILL.md +5 -5
  184. package/skills/weaver-e10-workflow/SKILL.md +29 -5
  185. package/skills/weaver-e10-workflow/aigroup/default.json +88 -0
  186. package/skills/weaver-e10-workflow/references/todo-smart-convert.md +66 -14
  187. package/skills/weaver-e10-workflow/references/workflow-agent-entry.md +1 -1
  188. package/skills/weaver-e10-workflow/references/workflow-memory.md +1 -1
  189. package/skills/weaver-e10-workflow/references/workflow-query.md +12 -10
  190. package/skills/weaver-e10-workflow/references/workflow-view.md +2 -2
  191. package/skills/weaver-e10-workflow/tools/todo-serve.cjs +239 -0
  192. package/skills/weaver-e10-workflow/{scripts → tools}/todo-summary.cjs +218 -28
  193. package/skills/weaver-e10-yepiaotong/SKILL.md +10 -8
  194. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +7 -7
  195. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +10 -10
  196. package/skills/weaver-e10-yepiaotong/references/reim-examples.md +40 -37
  197. package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +4 -4
  198. package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +27 -38
  199. package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +4 -4
  200. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +37 -29
  201. package/skills/weaver-e10-yimiaoban/SKILL.md +156 -33
  202. package/skills/weaver-e10-yimiaoban/references/ding-write.md +1 -1
  203. package/skills/weaver-e10-yimiaoban/references/error-codes.md +5 -1
  204. package/skills/weaver-e10-yimiaoban/references/group-read.md +5 -1
  205. package/skills/weaver-e10-yimiaoban/references/group-write.md +6 -4
  206. package/skills/weaver-e10-yimiaoban/references/msg-read.md +1 -0
  207. package/skills/weaver-e10-yimiaoban/references/msg-write.md +34 -2
  208. package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +5 -2
  209. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +79 -58
  210. package/skills/weaver-e10-yimiaoban/references/user-remind.md +2 -2
  211. package/skills/weaver-e10-ziguanjia/SKILL.md +5 -5
@@ -0,0 +1,932 @@
1
+ import { createRequire as __esbuildCreateRequire } from 'node:module';
2
+ const require = __esbuildCreateRequire(import.meta.url);
3
+ import {
4
+ ebuilderConfirmationError,
5
+ ebuilderValidationError
6
+ } from "./chunk-BYATLLEF.js";
7
+
8
+ // src/shortcuts/ebuilder-form/manifest.ts
9
+ var contextProperties = {
10
+ context: { type: "object", description: "\u5DF2\u89E3\u6790\u7684 eBuilder \u4E0A\u4E0B\u6587\uFF0C\u53EF\u7531 ebuilder-form.context.resolve \u8FD4\u56DE" },
11
+ menuKeywords: { type: "array", items: { type: "string" }, minItems: 1, maxItems: 5 },
12
+ menu: { type: "string" },
13
+ menuId: { type: "string", pattern: "^\\d+$" },
14
+ url: { type: "string", description: "E10 \u5217\u8868\u9875\u9762 URL\uFF1B\u652F\u6301 /sp/ebdfpage/list\u3001viewport \u548C /ebdapp/view" },
15
+ appId: { type: "string", pattern: "^\\d+$" },
16
+ apiPrefix: { type: "string", pattern: "^/api/ebuilder\\d*$" },
17
+ objId: { type: "string", pattern: "^\\d+$" },
18
+ listId: { type: "string", pattern: "^\\d+$" },
19
+ hostPageId: { type: "string", pattern: "^\\d+$" },
20
+ listKind: { type: "string", enum: ["List", "NList"] },
21
+ menuUrl: { type: "string" },
22
+ entryUrl: { type: "string" }
23
+ };
24
+ var preparedWriteProperties = {
25
+ confirm: { const: true },
26
+ continuation: { type: "string", minLength: 1 }
27
+ };
28
+ function schema(properties, options = {}) {
29
+ return {
30
+ type: "object",
31
+ additionalProperties: false,
32
+ properties,
33
+ ...options.required?.length ? { required: options.required } : {},
34
+ ...options.anyOf ? { anyOf: options.anyOf } : {},
35
+ ...options.oneOf ? { oneOf: options.oneOf } : {},
36
+ ...options.description ? { description: options.description } : {}
37
+ };
38
+ }
39
+ var ebuilderFormOperations = [
40
+ {
41
+ name: "ebuilder-form.menu.search",
42
+ summary: "\u6309\u4E1A\u52A1\u5173\u952E\u8BCD\u67E5\u8BE2\u5F53\u524D\u8D26\u53F7\u6709\u6743\u9650\u8BBF\u95EE\u7684 eBuilder \u8868\u683C/\u6570\u636E\u5217\u8868\u83DC\u5355",
43
+ risk: "read",
44
+ inputSchema: schema({
45
+ menuKeywords: { type: "array", items: { type: "string" }, minItems: 1, maxItems: 5 }
46
+ }, { required: ["menuKeywords"] })
47
+ },
48
+ {
49
+ name: "ebuilder-form.context.resolve",
50
+ summary: "\u4ECE\u83DC\u5355\u5173\u952E\u8BCD\u3001\u9875\u9762 URL\u3001objId \u6216\u73B0\u6709 context \u89E3\u6790 appId\u3001apiPrefix\u3001listId\u3001objId \u548C\u9875\u9762\u5730\u5740\u4E0A\u4E0B\u6587",
51
+ risk: "read",
52
+ inputSchema: schema(contextProperties, {
53
+ anyOf: [
54
+ { required: ["context"] },
55
+ { required: ["url"] },
56
+ { required: ["menuKeywords"] },
57
+ { required: ["menu"] },
58
+ { required: ["objId"] },
59
+ { required: ["listId", "appId", "listKind"] }
60
+ ]
61
+ })
62
+ },
63
+ {
64
+ name: "ebuilder-form.views.list",
65
+ summary: "\u679A\u4E3E\u67D0\u4E2A\u8868\u5355\u5BF9\u8C61\u4E0B\u7684 List/NList \u89C6\u56FE",
66
+ risk: "read",
67
+ inputSchema: schema(contextProperties, { required: ["objId"] })
68
+ },
69
+ {
70
+ name: "ebuilder-form.list.config",
71
+ summary: "\u8BFB\u53D6\u4F20\u7EDF\u8868\u683C List \u7684\u57FA\u7840\u8BBE\u7F6E\u3001\u663E\u793A\u5217\u3001\u6392\u5E8F\u3001\u641C\u7D22\u3001\u7EDF\u8BA1\u548C\u56FA\u5B9A\u6761\u4EF6\u914D\u7F6E",
72
+ risk: "read",
73
+ inputSchema: schema(contextProperties, {
74
+ anyOf: [{ required: ["context"] }, { required: ["listId", "appId"] }, { required: ["menuKeywords"] }, { required: ["url"] }]
75
+ })
76
+ },
77
+ {
78
+ name: "ebuilder-form.list.query",
79
+ summary: "\u6309 List \u8FD0\u884C\u65F6\u63A5\u53E3\u67E5\u8BE2\u5206\u9875\u6570\u636E\u548C\u771F\u5B9E\u603B\u6570\uFF0C\u4FDD\u7559\u660E\u7EC6\u5C55\u5F00\u91CD\u590D\u884C",
80
+ risk: "read",
81
+ inputSchema: schema({
82
+ ...contextProperties,
83
+ pageNo: { type: "integer", minimum: 1, default: 1 },
84
+ pageSize: { type: "integer", minimum: 1, maximum: 200 },
85
+ allPages: { type: "boolean", default: false },
86
+ tableuid: { type: "string" },
87
+ searchParamData: { type: "object" },
88
+ filterCondition: { type: "object" },
89
+ orderParams: { type: "array" },
90
+ passid: { type: "string" },
91
+ cid: { type: "string" }
92
+ })
93
+ },
94
+ {
95
+ name: "ebuilder-form.nlist.config",
96
+ summary: "\u8BFB\u53D6\u6570\u636E\u5217\u8868 NList \u7684\u9875\u9762\u3001\u7EC4\u4EF6\u4E0E comps[1].config \u8FD0\u884C\u65F6\u914D\u7F6E",
97
+ risk: "read",
98
+ inputSchema: schema(contextProperties, {
99
+ anyOf: [{ required: ["context"] }, { required: ["hostPageId", "appId"] }, { required: ["menuKeywords"] }, { required: ["url"] }]
100
+ })
101
+ },
102
+ {
103
+ name: "ebuilder-form.nlist.query",
104
+ summary: "\u6309 NList eblist \u8FD0\u884C\u65F6\u63A5\u53E3\u67E5\u8BE2\u5206\u9875\u6570\u636E\u548C\u771F\u5B9E\u603B\u6570\uFF0C\u4F7F\u7528 customConfig LZW \u6570\u5B57\u4E32\u7F16\u7801",
105
+ risk: "read",
106
+ inputSchema: schema({
107
+ ...contextProperties,
108
+ pageNo: { type: "integer", minimum: 1, default: 1 },
109
+ pageSize: { type: "integer", minimum: 1, maximum: 200 },
110
+ allPages: { type: "boolean", default: false },
111
+ compId: { type: "string" },
112
+ tableuid: { type: "string" },
113
+ filter: {},
114
+ fieldFilter: {},
115
+ pageFilter: {},
116
+ customConfig: { type: "object" },
117
+ refPluginPackageId: { type: "string" }
118
+ })
119
+ },
120
+ {
121
+ name: "ebuilder-form.fields.get",
122
+ summary: "\u8BFB\u53D6 eBuilder \u5B57\u6BB5\u5B9A\u4E49\uFF0C\u8FD4\u56DE\u4E3B\u8868\u4E0E\u660E\u7EC6\u8868\u5B57\u6BB5\u3001config.dataKey\u3001browserParams \u548C\u7EC4\u4EF6\u7C7B\u578B",
123
+ risk: "read",
124
+ fixed: { path: "/api/ebuilder/common/ds/fields" },
125
+ inputSchema: schema({
126
+ ...contextProperties,
127
+ groupId: { type: "string" },
128
+ sourceId: { type: "string" },
129
+ sourceType: { type: "string", default: "FORM" },
130
+ detailFieldsGroup: { type: ["boolean", "string"], default: true },
131
+ enableMerge: { type: ["boolean", "string"], default: true },
132
+ customParam: {},
133
+ params: {}
134
+ })
135
+ },
136
+ {
137
+ name: "ebuilder-form.options.get",
138
+ summary: "\u6309\u5B57\u6BB5\u5143\u6570\u636E ID \u8BFB\u53D6\u9009\u62E9\u7C7B\u5B57\u6BB5\u9009\u9879",
139
+ risk: "read",
140
+ fixed: { path: "/api/ebuilder/common/ds/options" },
141
+ inputSchema: schema({
142
+ ...contextProperties,
143
+ fieldName: { type: "string", pattern: "^\\d+$" },
144
+ fieldId: { type: "string", pattern: "^\\d+$" },
145
+ sourceType: { type: "string", default: "FORM" },
146
+ groupId: { type: "string" },
147
+ optionLevel: { type: ["integer", "string"], default: 1 }
148
+ }, {
149
+ anyOf: [{ required: ["fieldName"] }, { required: ["fieldId"] }]
150
+ })
151
+ },
152
+ {
153
+ name: "ebuilder-form.mapping.get",
154
+ summary: "\u8BFB\u53D6 objId \u7684 mainTable/detailN \u4E0E\u4E3B\u8868/\u660E\u7EC6\u8868\u6807\u8BC6\u6620\u5C04",
155
+ risk: "read",
156
+ fixed: { path: "/api/ebuilder/form/dataset/v1/getTableMapping" },
157
+ inputSchema: schema({
158
+ ...contextProperties,
159
+ reverse: { type: "boolean", default: false }
160
+ }, { required: ["objId"] })
161
+ },
162
+ {
163
+ name: "ebuilder-form.browser.resolve",
164
+ summary: "\u8C03\u7528\u5B57\u6BB5\u914D\u7F6E\u6216\u5DF2\u77E5\u6A21\u5757\u5BF9\u5E94\u7684\u901A\u7528\u6D4F\u89C8 complete \u63A5\u53E3\uFF0C\u5C06\u540D\u79F0\u89E3\u6790\u4E3A\u53EF\u9009\u9879 ID",
165
+ risk: "read",
166
+ inputSchema: schema({
167
+ module: { type: "string", description: "\u6D4F\u89C8\u63A5\u53E3\u6A21\u5757\uFF0C\u4F8B\u5982 hrm\u3001workflow/core\u3001doc\u3001task" },
168
+ browserType: { type: "string", description: "\u6D4F\u89C8\u7C7B\u578B\uFF0C\u4F8B\u5982 resource\u3001department\u3001wfcRequest" },
169
+ query: { type: "string", minLength: 1 },
170
+ multiple: { type: "boolean", default: false },
171
+ limit: { type: "integer", minimum: 1, maximum: 50, default: 20 },
172
+ extra: { type: "object" }
173
+ }, { required: ["module", "browserType", "query"] })
174
+ },
175
+ {
176
+ name: "ebuilder-form.openapi.detail",
177
+ summary: "OpenAPI getDataById \u83B7\u53D6\u5355\u6761\u8868\u5355\u6570\u636E\u8BE6\u60C5",
178
+ risk: "read",
179
+ fixed: { path: "/api/ebuilder/form/dataset/v2/getDataById" },
180
+ inputSchema: schema({
181
+ ...contextProperties,
182
+ dataId: { type: "string", pattern: "^\\d+$" },
183
+ isReturnDetail: { type: ["boolean", "string"], default: "y" },
184
+ fieldNoFindIgnore: { type: ["boolean", "string"], default: "false" }
185
+ }, { required: ["objId", "dataId"] })
186
+ },
187
+ {
188
+ name: "ebuilder-form.openapi.query",
189
+ summary: "OpenAPI getAllData \u8868\u5355\u7EA7\u5206\u9875\u67E5\u8BE2",
190
+ risk: "read",
191
+ fixed: { path: "/api/ebuilder/form/dataset/v2/getAllData" },
192
+ inputSchema: schema({
193
+ ...contextProperties,
194
+ mainTable: { type: "object" },
195
+ pageNo: { type: "integer", minimum: 1, default: 1 },
196
+ pageSize: { type: "integer", minimum: 1, maximum: 1e3, default: 10 },
197
+ isReturnDetail: { type: ["boolean", "string"], default: "n" },
198
+ fieldNoFindIgnore: { type: ["boolean", "string"], default: "false" }
199
+ }, { required: ["objId"] })
200
+ },
201
+ {
202
+ name: "ebuilder-form.openapi.count",
203
+ summary: "OpenAPI getAllDataCount \u8868\u5355\u7EA7\u603B\u6570\u67E5\u8BE2",
204
+ risk: "read",
205
+ fixed: { path: "/api/ebuilder/form/dataset/v2/getAllDataCount" },
206
+ inputSchema: schema({
207
+ ...contextProperties,
208
+ mainTable: { type: "object" },
209
+ fieldNoFindIgnore: { type: ["boolean", "string"], default: "false" }
210
+ }, { required: ["objId"] })
211
+ },
212
+ {
213
+ name: "ebuilder-form.openapi.add.prepare",
214
+ summary: "\u51C6\u5907 OpenAPI saveFormData \u65B0\u589E\u8BF7\u6C42\uFF0C\u7B7E\u53D1 continuation\uFF0C\u4E0D\u5199\u5165",
215
+ risk: "read-before-write",
216
+ inputSchema: schema({
217
+ ...contextProperties,
218
+ datas: { type: "array", minItems: 1 },
219
+ operationinfo: { type: "object" }
220
+ }, { required: ["objId", "datas"] })
221
+ },
222
+ {
223
+ name: "ebuilder-form.openapi.add.apply",
224
+ summary: "\u786E\u8BA4\u540E\u6267\u884C OpenAPI saveFormData \u65B0\u589E\u8BF7\u6C42",
225
+ risk: "high-risk-write",
226
+ inputSchema: schema(preparedWriteProperties, { required: ["confirm", "continuation"] })
227
+ },
228
+ {
229
+ name: "ebuilder-form.openapi.update.prepare",
230
+ summary: "\u51C6\u5907 OpenAPI updateFormData \u4FEE\u6539\u8BF7\u6C42\uFF0C\u7B7E\u53D1 continuation\uFF0C\u4E0D\u5199\u5165",
231
+ risk: "read-before-write",
232
+ inputSchema: schema({
233
+ ...contextProperties,
234
+ datas: { type: "array", minItems: 1 },
235
+ operationinfo: { type: "object" }
236
+ }, { required: ["objId", "datas"] })
237
+ },
238
+ {
239
+ name: "ebuilder-form.openapi.update.apply",
240
+ summary: "\u786E\u8BA4\u540E\u6267\u884C OpenAPI updateFormData \u4FEE\u6539\u8BF7\u6C42",
241
+ risk: "high-risk-write",
242
+ inputSchema: schema(preparedWriteProperties, { required: ["confirm", "continuation"] })
243
+ },
244
+ {
245
+ name: "ebuilder-form.openapi.delete.prepare",
246
+ summary: "\u51C6\u5907 OpenAPI deleteData \u5220\u9664\u8BF7\u6C42\uFF0C\u7B7E\u53D1 continuation\uFF0C\u4E0D\u5199\u5165",
247
+ risk: "read-before-write",
248
+ inputSchema: schema({
249
+ ...contextProperties,
250
+ mainTable: { type: "object", description: '\u5220\u9664\u6761\u4EF6\uFF1B\u6309\u6570\u636E ID \u5220\u9664\u65F6\u4F20 {"id":"..."}' },
251
+ dataId: { type: "string", pattern: "^\\d+$" },
252
+ operationinfo: { type: "object" }
253
+ }, {
254
+ required: ["objId"],
255
+ anyOf: [{ required: ["dataId"] }, { required: ["mainTable"] }]
256
+ })
257
+ },
258
+ {
259
+ name: "ebuilder-form.openapi.delete.apply",
260
+ summary: "\u786E\u8BA4\u540E\u6267\u884C OpenAPI deleteData \u5220\u9664\u8BF7\u6C42",
261
+ risk: "high-risk-write",
262
+ inputSchema: schema(preparedWriteProperties, { required: ["confirm", "continuation"] })
263
+ },
264
+ {
265
+ name: "ebuilder-form.custom.detail",
266
+ summary: "\u5DF2\u53D1\u5E03\u81EA\u5B9A\u4E49\u63A5\u53E3 getFormDataByPk \u6839\u636E\u4E3B\u952E\u67E5\u8BE2\u8BE6\u60C5",
267
+ risk: "read",
268
+ fixed: { path: "/api/ebuilder/form/formdata/v2/getFormDataByPk/{interfacePk}" },
269
+ inputSchema: schema({
270
+ ...contextProperties,
271
+ interfacePk: { type: "string", minLength: 1 },
272
+ dataId: { type: "string", pattern: "^\\d+$" }
273
+ }, { required: ["interfacePk", "dataId"] })
274
+ },
275
+ {
276
+ name: "ebuilder-form.custom.query",
277
+ summary: "\u5DF2\u53D1\u5E03\u81EA\u5B9A\u4E49\u63A5\u53E3 getFormDataList \u5206\u9875\u67E5\u8BE2",
278
+ risk: "read",
279
+ fixed: { path: "/api/ebuilder/form/formdata/v2/getFormDataList/{interfacePk}" },
280
+ inputSchema: schema({
281
+ ...contextProperties,
282
+ interfacePk: { type: "string", minLength: 1 },
283
+ mainTable: { type: "object" },
284
+ pageNo: { type: "integer", minimum: 1, default: 1 },
285
+ pageSize: { type: "integer", minimum: 1, maximum: 1e3, default: 10 }
286
+ }, { required: ["interfacePk"] })
287
+ },
288
+ {
289
+ name: "ebuilder-form.custom.count",
290
+ summary: "\u5DF2\u53D1\u5E03\u81EA\u5B9A\u4E49\u63A5\u53E3 getFormDataCount \u67E5\u8BE2\u603B\u6570",
291
+ risk: "read",
292
+ fixed: { path: "/api/ebuilder/form/formdata/v2/getFormDataCount/{interfacePk}" },
293
+ inputSchema: schema({
294
+ ...contextProperties,
295
+ interfacePk: { type: "string", minLength: 1 },
296
+ mainTable: { type: "object" }
297
+ }, { required: ["interfacePk"] })
298
+ },
299
+ {
300
+ name: "ebuilder-form.custom.add.prepare",
301
+ summary: "\u51C6\u5907\u5DF2\u53D1\u5E03\u81EA\u5B9A\u4E49\u63A5\u53E3 saveFormData \u65B0\u589E\u8BF7\u6C42\uFF0C\u7B7E\u53D1 continuation",
302
+ risk: "read-before-write",
303
+ inputSchema: schema({
304
+ ...contextProperties,
305
+ interfacePk: { type: "string", minLength: 1 },
306
+ datas: { type: "array", minItems: 1 },
307
+ operationinfo: { type: "object" }
308
+ }, { required: ["interfacePk", "datas"] })
309
+ },
310
+ {
311
+ name: "ebuilder-form.custom.add.apply",
312
+ summary: "\u786E\u8BA4\u540E\u6267\u884C\u5DF2\u53D1\u5E03\u81EA\u5B9A\u4E49\u63A5\u53E3 saveFormData \u65B0\u589E\u8BF7\u6C42",
313
+ risk: "high-risk-write",
314
+ inputSchema: schema(preparedWriteProperties, { required: ["confirm", "continuation"] })
315
+ },
316
+ {
317
+ name: "ebuilder-form.custom.update.prepare",
318
+ summary: "\u51C6\u5907\u5DF2\u53D1\u5E03\u81EA\u5B9A\u4E49\u63A5\u53E3 updateFormData \u4FEE\u6539\u8BF7\u6C42\uFF0C\u7B7E\u53D1 continuation",
319
+ risk: "read-before-write",
320
+ inputSchema: schema({
321
+ ...contextProperties,
322
+ interfacePk: { type: "string", minLength: 1 },
323
+ datas: { type: "array", minItems: 1 },
324
+ operationinfo: { type: "object" }
325
+ }, { required: ["interfacePk", "datas"] })
326
+ },
327
+ {
328
+ name: "ebuilder-form.custom.update.apply",
329
+ summary: "\u786E\u8BA4\u540E\u6267\u884C\u5DF2\u53D1\u5E03\u81EA\u5B9A\u4E49\u63A5\u53E3 updateFormData \u4FEE\u6539\u8BF7\u6C42",
330
+ risk: "high-risk-write",
331
+ inputSchema: schema(preparedWriteProperties, { required: ["confirm", "continuation"] })
332
+ },
333
+ {
334
+ name: "ebuilder-form.custom.delete.prepare",
335
+ summary: "\u51C6\u5907\u5DF2\u53D1\u5E03\u81EA\u5B9A\u4E49\u63A5\u53E3 deleteFormData \u5220\u9664\u8BF7\u6C42\uFF0C\u7B7E\u53D1 continuation",
336
+ risk: "read-before-write",
337
+ inputSchema: schema({
338
+ ...contextProperties,
339
+ interfacePk: { type: "string", minLength: 1 },
340
+ dataIds: { type: "array", items: { type: "string", pattern: "^\\d+$" }, minItems: 1 },
341
+ operationinfo: { type: "object" }
342
+ }, { required: ["interfacePk", "dataIds"] })
343
+ },
344
+ {
345
+ name: "ebuilder-form.custom.delete.apply",
346
+ summary: "\u786E\u8BA4\u540E\u6267\u884C\u5DF2\u53D1\u5E03\u81EA\u5B9A\u4E49\u63A5\u53E3 deleteFormData \u5220\u9664\u8BF7\u6C42",
347
+ risk: "high-risk-write",
348
+ inputSchema: schema(preparedWriteProperties, { required: ["confirm", "continuation"] })
349
+ }
350
+ ];
351
+ var ebuilderFormManifest = {
352
+ module: "ebuilder-form",
353
+ version: 1,
354
+ operations: ebuilderFormOperations
355
+ };
356
+
357
+ // src/shortcuts/ebuilder-form/operations/types.ts
358
+ function ebuilderSuccess(action, data, meta, warnings = []) {
359
+ const payload = { ok: true, action, data };
360
+ if (meta && Object.keys(meta).length > 0) payload.meta = meta;
361
+ if (warnings.length > 0) payload.warnings = warnings;
362
+ return payload;
363
+ }
364
+
365
+ // src/shortcuts/ebuilder-form/operations/shared.ts
366
+ var FORBIDDEN_KEYS = /* @__PURE__ */ new Set([
367
+ "__proto__",
368
+ "constructor",
369
+ "prototype",
370
+ "access_token",
371
+ "app_key",
372
+ "app_secret",
373
+ "authorization",
374
+ "cookie",
375
+ "eteamsid",
376
+ "sedit",
377
+ "token"
378
+ ]);
379
+ function asObject(value, field = "input") {
380
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
381
+ throw ebuilderValidationError("input_not_object", `${field} \u5FC5\u987B\u662F JSON \u5BF9\u8C61`);
382
+ }
383
+ return value;
384
+ }
385
+ function optionalObject(value, field) {
386
+ if (value === void 0 || value === null) return void 0;
387
+ return asObject(value, field);
388
+ }
389
+ function requiredArray(value, field) {
390
+ if (!Array.isArray(value)) throw ebuilderValidationError("field_invalid", `${field} \u5FC5\u987B\u662F\u6570\u7EC4`);
391
+ return value;
392
+ }
393
+ function optionalArray(value, field) {
394
+ if (value === void 0 || value === null) return void 0;
395
+ return requiredArray(value, field);
396
+ }
397
+ function requiredString(value, field) {
398
+ if (value === void 0 || value === null || value === "") {
399
+ throw ebuilderValidationError("field_required", `${field} \u5FC5\u586B`);
400
+ }
401
+ if (typeof value === "object") throw ebuilderValidationError("field_invalid", `${field} \u5FC5\u987B\u662F\u5B57\u7B26\u4E32`);
402
+ return String(value);
403
+ }
404
+ function optionalString(value, field) {
405
+ if (value === void 0 || value === null || value === "") return void 0;
406
+ if (typeof value === "object") throw ebuilderValidationError("field_invalid", `${field} \u5FC5\u987B\u662F\u5B57\u7B26\u4E32`);
407
+ return String(value);
408
+ }
409
+ function assertKnownKeys(input, allowed, operation) {
410
+ const unknown = Object.keys(input).filter((key) => !allowed.includes(key));
411
+ if (unknown.length > 0) {
412
+ throw ebuilderValidationError("unknown_field", `${operation} \u4E0D\u652F\u6301\u5B57\u6BB5\uFF1A${unknown.join("\u3001")}`, { unknown });
413
+ }
414
+ }
415
+ function assertNoForbiddenKeys(value, location = "input") {
416
+ if (!value || typeof value !== "object") return;
417
+ if (Array.isArray(value)) {
418
+ value.forEach((item, index) => assertNoForbiddenKeys(item, `${location}[${index}]`));
419
+ return;
420
+ }
421
+ for (const [key, child] of Object.entries(value)) {
422
+ if (FORBIDDEN_KEYS.has(key) || FORBIDDEN_KEYS.has(key.toLowerCase())) {
423
+ throw ebuilderValidationError("field_forbidden", `\u7981\u6B62\u4E1A\u52A1\u8F93\u5165\u5B57\u6BB5\uFF1A${location}.${key}`);
424
+ }
425
+ assertNoForbiddenKeys(child, `${location}.${key}`);
426
+ }
427
+ }
428
+ function compactJson(value) {
429
+ return JSON.stringify(value);
430
+ }
431
+ function sha256VisibleFingerprint(value) {
432
+ const json = compactJson(value);
433
+ let hash = 0;
434
+ for (let index = 0; index < json.length; index += 1) {
435
+ hash = (hash << 5) - hash + json.charCodeAt(index) | 0;
436
+ }
437
+ return `len:${json.length}:h:${(hash >>> 0).toString(16)}`;
438
+ }
439
+
440
+ // src/shortcuts/ebuilder-form/operations/read.ts
441
+ var CONTEXT_KEYS = [
442
+ "context",
443
+ "menuKeywords",
444
+ "menu",
445
+ "menuId",
446
+ "url",
447
+ "appId",
448
+ "apiPrefix",
449
+ "objId",
450
+ "listId",
451
+ "hostPageId",
452
+ "listKind",
453
+ "menuUrl",
454
+ "entryUrl"
455
+ ];
456
+ var EbuilderMenuSearchOperation = class {
457
+ name = "ebuilder-form.menu.search";
458
+ async execute(input, { host }) {
459
+ assertKnownKeys(input, ["menuKeywords"], this.name);
460
+ const keywords = requiredArray(input.menuKeywords, "menuKeywords").map((item) => String(item));
461
+ const menus = await host.searchMenus(keywords);
462
+ return ebuilderSuccess(this.name, { menus, count: menus.length }, { status: "COMPLETE" });
463
+ }
464
+ };
465
+ var EbuilderContextResolveOperation = class {
466
+ name = "ebuilder-form.context.resolve";
467
+ async execute(input, { host }) {
468
+ const context = await host.resolveContext(input);
469
+ return ebuilderSuccess(this.name, {
470
+ context,
471
+ listUrl: host.buildListUrl(context)
472
+ }, { status: "COMPLETE" });
473
+ }
474
+ };
475
+ var EbuilderViewsListOperation = class {
476
+ name = "ebuilder-form.views.list";
477
+ async execute(input, { host }) {
478
+ const result = await host.formViews(input);
479
+ return ebuilderSuccess(this.name, result, { status: "COMPLETE" });
480
+ }
481
+ };
482
+ var EbuilderListConfigOperation = class {
483
+ name = "ebuilder-form.list.config";
484
+ async execute(input, { host }) {
485
+ const context = await host.resolveContext({ ...input, listKind: input.listKind || input.context?.listKind || "List" });
486
+ const result = await host.listConfig(context, this.name);
487
+ return ebuilderSuccess(this.name, result, { status: "COMPLETE" });
488
+ }
489
+ };
490
+ var EbuilderListQueryOperation = class {
491
+ name = "ebuilder-form.list.query";
492
+ async execute(input, { host }) {
493
+ const result = await host.listQuery(input, this.name);
494
+ return ebuilderSuccess(this.name, result, { status: "COMPLETE" });
495
+ }
496
+ };
497
+ var EbuilderNlistConfigOperation = class {
498
+ name = "ebuilder-form.nlist.config";
499
+ async execute(input, { host }) {
500
+ const context = await host.resolveContext({ ...input, listKind: input.listKind || input.context?.listKind || "NList" });
501
+ const result = await host.nlistConfig(context, this.name);
502
+ return ebuilderSuccess(this.name, result, { status: "COMPLETE" });
503
+ }
504
+ };
505
+ var EbuilderNlistQueryOperation = class {
506
+ name = "ebuilder-form.nlist.query";
507
+ async execute(input, { host }) {
508
+ const result = await host.nlistQuery(input, this.name);
509
+ return ebuilderSuccess(this.name, result, { status: "COMPLETE" });
510
+ }
511
+ };
512
+ var EbuilderFieldsGetOperation = class {
513
+ name = "ebuilder-form.fields.get";
514
+ async execute(input, { host }) {
515
+ const result = await host.fields(input, this.name);
516
+ return ebuilderSuccess(this.name, { result }, { status: "COMPLETE" });
517
+ }
518
+ };
519
+ var EbuilderOptionsGetOperation = class {
520
+ name = "ebuilder-form.options.get";
521
+ async execute(input, { host }) {
522
+ const result = await host.options(input, this.name);
523
+ return ebuilderSuccess(this.name, { result }, { status: "COMPLETE" });
524
+ }
525
+ };
526
+ var EbuilderMappingGetOperation = class {
527
+ name = "ebuilder-form.mapping.get";
528
+ async execute(input, { host }) {
529
+ const result = await host.mapping(input, this.name);
530
+ return ebuilderSuccess(this.name, { result }, { status: "COMPLETE" });
531
+ }
532
+ };
533
+ var EbuilderBrowserResolveOperation = class {
534
+ name = "ebuilder-form.browser.resolve";
535
+ async execute(input, { host }) {
536
+ assertKnownKeys(input, ["module", "browserType", "query", "multiple", "limit", "extra"], this.name);
537
+ const result = await host.browserResolve(input, this.name);
538
+ return ebuilderSuccess(this.name, result, { status: "COMPLETE" });
539
+ }
540
+ };
541
+ var EbuilderOpenapiReadOperation = class {
542
+ constructor(endpoint) {
543
+ this.endpoint = endpoint;
544
+ this.name = `ebuilder-form.openapi.${endpoint}`;
545
+ }
546
+ endpoint;
547
+ name;
548
+ async execute(input, { host }) {
549
+ const allowed = [
550
+ ...CONTEXT_KEYS,
551
+ "dataId",
552
+ "mainTable",
553
+ "pageNo",
554
+ "pageSize",
555
+ "isReturnDetail",
556
+ "fieldNoFindIgnore"
557
+ ];
558
+ assertKnownKeys(input, allowed, this.name);
559
+ const result = await host.openapiRead(this.endpoint, input, this.name);
560
+ const data = addLinks(result, host, this.endpoint === "detail" ? optionalString(input.dataId, "dataId") : void 0);
561
+ return ebuilderSuccess(this.name, data, { status: "COMPLETE" });
562
+ }
563
+ };
564
+ var EbuilderCustomReadOperation = class {
565
+ constructor(endpoint) {
566
+ this.endpoint = endpoint;
567
+ this.name = `ebuilder-form.custom.${endpoint}`;
568
+ }
569
+ endpoint;
570
+ name;
571
+ async execute(input, { host }) {
572
+ const allowed = [
573
+ ...CONTEXT_KEYS,
574
+ "interfacePk",
575
+ "dataId",
576
+ "mainTable",
577
+ "pageNo",
578
+ "pageSize"
579
+ ];
580
+ assertKnownKeys(input, allowed, this.name);
581
+ const result = await host.customRead(this.endpoint, input, this.name);
582
+ const data = addLinks(result, host, this.endpoint === "detail" ? optionalString(input.dataId, "dataId") : void 0);
583
+ return ebuilderSuccess(this.name, data, { status: "COMPLETE" });
584
+ }
585
+ };
586
+ function addLinks(result, host, dataId) {
587
+ const context = asObject(result.context || {}, "context");
588
+ const payload = asObject(result.result || {}, "result");
589
+ return {
590
+ context,
591
+ result: payload,
592
+ ...dataId ? { dataUrl: host.buildDataUrl(context, dataId) } : {},
593
+ listUrl: host.buildListUrl(context)
594
+ };
595
+ }
596
+
597
+ // src/shortcuts/ebuilder-form/operations/write.ts
598
+ var CONTEXT_KEYS2 = [
599
+ "context",
600
+ "menuKeywords",
601
+ "menu",
602
+ "menuId",
603
+ "url",
604
+ "appId",
605
+ "apiPrefix",
606
+ "objId",
607
+ "listId",
608
+ "hostPageId",
609
+ "listKind",
610
+ "menuUrl",
611
+ "entryUrl"
612
+ ];
613
+ var EbuilderOpenapiPrepareOperation = class {
614
+ constructor(endpoint) {
615
+ this.endpoint = endpoint;
616
+ this.name = `ebuilder-form.openapi.${endpoint}.prepare`;
617
+ this.applyName = `ebuilder-form.openapi.${endpoint}.apply`;
618
+ }
619
+ endpoint;
620
+ name;
621
+ applyName;
622
+ async execute(input, env) {
623
+ const allowed = [
624
+ ...CONTEXT_KEYS2,
625
+ "dataId",
626
+ "mainTable",
627
+ "datas",
628
+ "operationinfo"
629
+ ];
630
+ assertKnownKeys(input, allowed, this.name);
631
+ assertNoForbiddenKeys(input);
632
+ const prepared = await prepareOpenapi(this.endpoint, input, env.host);
633
+ const session = await env.host.getSession();
634
+ const continuation = await env.continuation.issue({
635
+ operation: this.applyName,
636
+ actor: { userId: session.userId, baseUrl: session.baseUrl, profile: session.profile },
637
+ kind: "openapi",
638
+ endpoint: this.endpoint,
639
+ datajson: { ...prepared.datajson, __context: prepared.context },
640
+ target: prepared.target,
641
+ fingerprint: sha256VisibleFingerprint(prepared.datajson)
642
+ });
643
+ return ebuilderSuccess(this.name, {
644
+ context: prepared.context,
645
+ target: prepared.target,
646
+ requestPreview: { datajson: prepared.datajson },
647
+ continuation,
648
+ expiresInSeconds: 600
649
+ }, { status: "PREPARED" }, prepared.warnings);
650
+ }
651
+ };
652
+ var EbuilderOpenapiApplyOperation = class {
653
+ constructor(endpoint) {
654
+ this.endpoint = endpoint;
655
+ this.name = `ebuilder-form.openapi.${endpoint}.apply`;
656
+ }
657
+ endpoint;
658
+ name;
659
+ async execute(input, env) {
660
+ assertKnownKeys(input, ["confirm", "continuation"], this.name);
661
+ if (input.confirm !== true) throw ebuilderConfirmationError(this.name);
662
+ const record = await env.continuation.verify(requiredString(input.continuation, "continuation"), this.name);
663
+ assertContinuation(record, await env.host.getSession(), "openapi", this.endpoint);
664
+ const datajson = asObject(record.datajson, "continuation.datajson");
665
+ const result = await env.host.openapiWrite(this.endpoint, datajson, this.name);
666
+ return ebuilderSuccess(this.name, summarizeWriteResult(result, env.host, this.endpoint === "delete"), { status: "COMPLETE" });
667
+ }
668
+ };
669
+ var EbuilderCustomPrepareOperation = class {
670
+ constructor(endpoint) {
671
+ this.endpoint = endpoint;
672
+ this.name = `ebuilder-form.custom.${endpoint}.prepare`;
673
+ this.applyName = `ebuilder-form.custom.${endpoint}.apply`;
674
+ }
675
+ endpoint;
676
+ name;
677
+ applyName;
678
+ async execute(input, env) {
679
+ const allowed = [
680
+ ...CONTEXT_KEYS2,
681
+ "interfacePk",
682
+ "dataIds",
683
+ "datas",
684
+ "operationinfo"
685
+ ];
686
+ assertKnownKeys(input, allowed, this.name);
687
+ assertNoForbiddenKeys(input);
688
+ const prepared = await prepareCustom(this.endpoint, input, env.host);
689
+ const session = await env.host.getSession();
690
+ const continuation = await env.continuation.issue({
691
+ operation: this.applyName,
692
+ actor: { userId: session.userId, baseUrl: session.baseUrl, profile: session.profile },
693
+ kind: "custom",
694
+ endpoint: this.endpoint,
695
+ interfacePk: prepared.interfacePk,
696
+ datajson: { ...prepared.datajson, __context: prepared.context },
697
+ target: prepared.target,
698
+ fingerprint: sha256VisibleFingerprint(prepared.datajson)
699
+ });
700
+ return ebuilderSuccess(this.name, {
701
+ context: prepared.context,
702
+ interfacePk: prepared.interfacePk,
703
+ target: prepared.target,
704
+ requestPreview: { datajson: prepared.datajson },
705
+ continuation,
706
+ expiresInSeconds: 600
707
+ }, { status: "PREPARED" }, prepared.warnings);
708
+ }
709
+ };
710
+ var EbuilderCustomApplyOperation = class {
711
+ constructor(endpoint) {
712
+ this.endpoint = endpoint;
713
+ this.name = `ebuilder-form.custom.${endpoint}.apply`;
714
+ }
715
+ endpoint;
716
+ name;
717
+ async execute(input, env) {
718
+ assertKnownKeys(input, ["confirm", "continuation"], this.name);
719
+ if (input.confirm !== true) throw ebuilderConfirmationError(this.name);
720
+ const record = await env.continuation.verify(requiredString(input.continuation, "continuation"), this.name);
721
+ assertContinuation(record, await env.host.getSession(), "custom", this.endpoint);
722
+ const datajson = asObject(record.datajson, "continuation.datajson");
723
+ const interfacePk = requiredString(record.interfacePk, "continuation.interfacePk");
724
+ const result = await env.host.customWrite(this.endpoint, interfacePk, datajson, this.name);
725
+ return ebuilderSuccess(this.name, summarizeWriteResult(result, env.host, this.endpoint === "delete"), { status: "COMPLETE" });
726
+ }
727
+ };
728
+ async function prepareOpenapi(endpoint, input, host) {
729
+ const context = await host.resolveContext(input);
730
+ const operationinfo = optionalObject(input.operationinfo, "operationinfo") || {};
731
+ if (endpoint === "add") {
732
+ const datas = requiredArray(input.datas, "datas");
733
+ return {
734
+ context,
735
+ datajson: {
736
+ datas,
737
+ header: { objId: context.objId },
738
+ operationinfo: {
739
+ fieldNoFindIgnore: "false",
740
+ checkRight: "true",
741
+ doAction: "false",
742
+ printCost: "true",
743
+ ...operationinfo
744
+ }
745
+ },
746
+ target: { endpoint, objId: context.objId, count: datas.length },
747
+ warnings: fieldKeyWarnings(datas)
748
+ };
749
+ }
750
+ if (endpoint === "update") {
751
+ const datas = requiredArray(input.datas, "datas");
752
+ return {
753
+ context,
754
+ datajson: {
755
+ datas,
756
+ header: { objId: context.objId },
757
+ operationinfo: {
758
+ updateType: "ids",
759
+ needAdd: "false",
760
+ fieldNoFindIgnore: "false",
761
+ checkRight: "true",
762
+ doAction: "false",
763
+ printCost: "true",
764
+ ...operationinfo
765
+ }
766
+ },
767
+ target: { endpoint, objId: context.objId, dataIds: collectDataIds(datas) },
768
+ warnings: fieldKeyWarnings(datas)
769
+ };
770
+ }
771
+ const mainTable = {
772
+ ...optionalObject(input.mainTable, "mainTable") || {},
773
+ ...input.dataId ? { id: requiredString(input.dataId, "dataId") } : {}
774
+ };
775
+ if (Object.keys(mainTable).length === 0) {
776
+ throw ebuilderValidationError("delete_target_required", "\u5220\u9664\u5FC5\u987B\u63D0\u4F9B dataId \u6216 mainTable \u6761\u4EF6");
777
+ }
778
+ return {
779
+ context,
780
+ datajson: {
781
+ header: { objId: context.objId },
782
+ mainTable,
783
+ operationinfo: {
784
+ fieldNoFindIgnore: "false",
785
+ checkRight: "true",
786
+ doAction: "false",
787
+ printCost: "true",
788
+ ...operationinfo
789
+ }
790
+ },
791
+ target: { endpoint, objId: context.objId, mainTable },
792
+ warnings: ["\u5220\u9664\u4E0D\u53EF\u9006\uFF1Bapply \u524D\u5FC5\u987B\u786E\u8BA4 objId\u3001\u5220\u9664\u6761\u4EF6\u548C\u5F53\u524D\u64CD\u4F5C\u4EBA\u5747\u6B63\u786E"]
793
+ };
794
+ }
795
+ async function prepareCustom(endpoint, input, host) {
796
+ const context = await host.resolveContext(input);
797
+ const interfacePk = requiredString(input.interfacePk, "interfacePk");
798
+ const operationinfo = {
799
+ printCost: false,
800
+ asyncPostProcess: false,
801
+ asyncMark: false,
802
+ ...optionalObject(input.operationinfo, "operationinfo") || {}
803
+ };
804
+ const session = await host.getSession();
805
+ if (endpoint === "delete") {
806
+ const dataIds = requiredArray(input.dataIds, "dataIds").map((item) => requiredString(item, "dataIds[]"));
807
+ return {
808
+ context,
809
+ interfacePk,
810
+ datajson: {
811
+ datas: dataIds.map((id) => ({ mainTable: { id } })),
812
+ header: { operator: session.userId }
813
+ },
814
+ target: { endpoint, interfacePk, dataIds },
815
+ warnings: ["\u5220\u9664\u4E0D\u53EF\u9006\uFF1Bapply \u524D\u5FC5\u987B\u786E\u8BA4 interfacePk\u3001\u76EE\u6807 dataId \u548C\u5F53\u524D\u64CD\u4F5C\u4EBA\u5747\u6B63\u786E"]
816
+ };
817
+ }
818
+ const datas = requiredArray(input.datas, "datas");
819
+ return {
820
+ context,
821
+ interfacePk,
822
+ datajson: {
823
+ operationinfo,
824
+ datas,
825
+ header: { operator: session.userId }
826
+ },
827
+ target: { endpoint, interfacePk, count: datas.length, dataIds: collectDataIds(datas) },
828
+ warnings: fieldKeyWarnings(datas)
829
+ };
830
+ }
831
+ function assertContinuation(record, session, kind, endpoint) {
832
+ if (record.kind !== kind || record.endpoint !== endpoint) {
833
+ throw ebuilderValidationError("continuation_mismatch", "continuation \u7684\u63A5\u53E3\u65CF\u6216 operation \u4E0E\u5F53\u524D apply \u4E0D\u4E00\u81F4");
834
+ }
835
+ const actor = asObject(record.actor, "continuation.actor");
836
+ if (actor.userId !== session.userId || actor.baseUrl !== session.baseUrl) {
837
+ throw ebuilderValidationError("continuation_actor_changed", "continuation \u7B7E\u53D1\u65F6\u7684\u767B\u5F55\u73AF\u5883\u6216\u7528\u6237\u4E0E\u5F53\u524D\u4F1A\u8BDD\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u91CD\u65B0\u6267\u884C prepare");
838
+ }
839
+ }
840
+ function summarizeWriteResult(result, host, deleted) {
841
+ const context = asObject(result.context || {}, "context");
842
+ const payload = asObject(result.result || {}, "result");
843
+ const dataIds = Array.isArray(payload.dataIds) ? payload.dataIds : [];
844
+ return {
845
+ context,
846
+ result: payload,
847
+ records: dataIds.map((dataId) => ({
848
+ dataId,
849
+ url: host.buildDataUrl(context, dataId, deleted)
850
+ })),
851
+ listUrl: host.buildListUrl(context)
852
+ };
853
+ }
854
+ function collectDataIds(datas) {
855
+ return datas.map((item) => optionalString(asObject(item, "datas[]").mainTable?.id, "mainTable.id")).filter((item) => Boolean(item));
856
+ }
857
+ function fieldKeyWarnings(datas) {
858
+ const warnings = [];
859
+ const text = JSON.stringify(datas);
860
+ if (/"\d{16,}"/u.test(text)) {
861
+ warnings.push("\u68C0\u6D4B\u5230\u957F\u6570\u5B57\u5B57\u6BB5\u952E\uFF1B\u5982\u679C\u5B57\u6BB5\u5B9A\u4E49\u4E2D name \u7B49\u4E8E id\uFF0C\u8BF7\u786E\u8BA4\u5199\u5165\u952E\u5DF2\u6539\u7528 config.dataKey\uFF0C\u5426\u5219 eBuilder \u53EF\u80FD\u8FD4\u56DE\u6210\u529F\u4F46\u5B57\u6BB5\u503C\u4E3A\u7A7A");
862
+ }
863
+ if (optionalArray(datas, "datas")?.some((item) => JSON.stringify(item).includes('"fieldNoFindIgnore"'))) {
864
+ warnings.push("fieldNoFindIgnore \u5E94\u653E\u5728 operationinfo\uFF1B\u5B57\u6BB5\u540D\u9519\u8BEF\u4E0D\u80FD\u901A\u8FC7\u5FFD\u7565\u5B57\u6BB5\u7ED5\u8FC7");
865
+ }
866
+ return warnings;
867
+ }
868
+
869
+ // src/shortcuts/ebuilder-form/operations/registry.ts
870
+ function buildRegistry() {
871
+ const handlers = [
872
+ new EbuilderMenuSearchOperation(),
873
+ new EbuilderContextResolveOperation(),
874
+ new EbuilderViewsListOperation(),
875
+ new EbuilderListConfigOperation(),
876
+ new EbuilderListQueryOperation(),
877
+ new EbuilderNlistConfigOperation(),
878
+ new EbuilderNlistQueryOperation(),
879
+ new EbuilderFieldsGetOperation(),
880
+ new EbuilderOptionsGetOperation(),
881
+ new EbuilderMappingGetOperation(),
882
+ new EbuilderBrowserResolveOperation(),
883
+ new EbuilderOpenapiReadOperation("detail"),
884
+ new EbuilderOpenapiReadOperation("query"),
885
+ new EbuilderOpenapiReadOperation("count"),
886
+ new EbuilderOpenapiPrepareOperation("add"),
887
+ new EbuilderOpenapiApplyOperation("add"),
888
+ new EbuilderOpenapiPrepareOperation("update"),
889
+ new EbuilderOpenapiApplyOperation("update"),
890
+ new EbuilderOpenapiPrepareOperation("delete"),
891
+ new EbuilderOpenapiApplyOperation("delete"),
892
+ new EbuilderCustomReadOperation("detail"),
893
+ new EbuilderCustomReadOperation("query"),
894
+ new EbuilderCustomReadOperation("count"),
895
+ new EbuilderCustomPrepareOperation("add"),
896
+ new EbuilderCustomApplyOperation("add"),
897
+ new EbuilderCustomPrepareOperation("update"),
898
+ new EbuilderCustomApplyOperation("update"),
899
+ new EbuilderCustomPrepareOperation("delete"),
900
+ new EbuilderCustomApplyOperation("delete")
901
+ ];
902
+ const registry2 = /* @__PURE__ */ new Map();
903
+ for (const handler of handlers) {
904
+ if (registry2.has(handler.name)) throw new Error(`duplicate ebuilder-form operation handler: ${handler.name}`);
905
+ registry2.set(handler.name, handler);
906
+ }
907
+ for (const contract of ebuilderFormOperations) {
908
+ if (!registry2.has(contract.name)) throw new Error(`missing ebuilder-form operation handler: ${contract.name}`);
909
+ }
910
+ return registry2;
911
+ }
912
+ var registry = buildRegistry();
913
+ function getEbuilderFormOperation(operation) {
914
+ const handler = registry.get(operation);
915
+ if (!handler) {
916
+ throw ebuilderValidationError("operation_unknown", `eBuilder \u8868\u5355\u4E0D\u652F\u6301\u64CD\u4F5C\uFF1A${operation}`);
917
+ }
918
+ return handler;
919
+ }
920
+
921
+ // src/shortcuts/ebuilder-form/operations.ts
922
+ async function executeEbuilderFormOperation(operation, rawInput, context) {
923
+ const handler = getEbuilderFormOperation(operation);
924
+ const input = asObject(rawInput);
925
+ assertNoForbiddenKeys(input);
926
+ return handler.execute(input, context);
927
+ }
928
+
929
+ export {
930
+ ebuilderFormManifest,
931
+ executeEbuilderFormOperation
932
+ };