weaver-work-cli 0.1.2 → 0.1.5

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 (405) hide show
  1. package/README.md +176 -78
  2. package/dist/cmd/setup/index.js +5 -5
  3. package/dist/cmd/skills/index.js +1 -1
  4. package/dist/core/hooks.js +7 -0
  5. package/dist/index.js +0 -0
  6. package/dist/internal/e10/auth/commands.js +159 -54
  7. package/dist/internal/e10/auth/xiaoe.js +268 -0
  8. package/dist/internal/e10/context.js +16 -2
  9. package/dist/internal/e10/index.js +1 -0
  10. package/dist/internal/e10/request-runtime.js +345 -0
  11. package/dist/internal/skills/install.js +48 -6
  12. package/dist/internal/skills/reader.js +27 -0
  13. package/dist/shortcuts/archive/continuation.js +70 -0
  14. package/dist/shortcuts/archive/errors.js +53 -0
  15. package/dist/shortcuts/archive/host.js +197 -0
  16. package/dist/shortcuts/archive/index.js +363 -0
  17. package/dist/shortcuts/archive/manifest.js +45 -0
  18. package/dist/shortcuts/archive/operations/archive-info.js +55 -0
  19. package/dist/shortcuts/archive/operations/borrow-car.js +146 -0
  20. package/dist/shortcuts/archive/operations/borrow-list.js +200 -0
  21. package/dist/shortcuts/archive/operations/confirm.js +46 -0
  22. package/dist/shortcuts/archive/operations/download.js +238 -0
  23. package/dist/shortcuts/archive/operations/flow-url.js +240 -0
  24. package/dist/shortcuts/archive/operations/fonds.js +95 -0
  25. package/dist/shortcuts/archive/operations/getPageUrl.js +137 -0
  26. package/dist/shortcuts/archive/operations/registry.js +43 -0
  27. package/dist/shortcuts/archive/operations/search.js +88 -0
  28. package/dist/shortcuts/archive/operations/shared.js +120 -0
  29. package/dist/shortcuts/archive/operations/types.js +23 -0
  30. package/dist/shortcuts/archive/operations/upload.js +182 -0
  31. package/dist/shortcuts/archive/operations.js +13 -0
  32. package/dist/shortcuts/archive/render/search-format.js +276 -0
  33. package/dist/shortcuts/archive/render/search-view.js +125 -0
  34. package/dist/shortcuts/asset/continuation.js +70 -0
  35. package/dist/shortcuts/asset/errors.js +67 -0
  36. package/dist/shortcuts/asset/host.js +438 -0
  37. package/dist/shortcuts/asset/index.js +255 -0
  38. package/dist/shortcuts/asset/manifest.js +471 -0
  39. package/dist/shortcuts/asset/operations/query.js +249 -0
  40. package/dist/shortcuts/asset/operations/registry.js +85 -0
  41. package/dist/shortcuts/asset/operations/shared.js +100 -0
  42. package/dist/shortcuts/asset/operations/type-cache.js +49 -0
  43. package/dist/shortcuts/asset/operations/types.js +1 -0
  44. package/dist/shortcuts/asset/operations/viewlink.js +117 -0
  45. package/dist/shortcuts/asset/operations/write.js +435 -0
  46. package/dist/shortcuts/asset/operations.js +9 -0
  47. package/dist/shortcuts/calendar/continuation.js +70 -0
  48. package/dist/shortcuts/calendar/errors.js +53 -0
  49. package/dist/shortcuts/calendar/host.js +148 -0
  50. package/dist/shortcuts/calendar/index.js +125 -0
  51. package/dist/shortcuts/calendar/manifest.js +26 -0
  52. package/dist/shortcuts/calendar/operations/read.js +259 -0
  53. package/dist/shortcuts/calendar/operations/registry.js +31 -0
  54. package/dist/shortcuts/calendar/operations/shared.js +132 -0
  55. package/dist/shortcuts/calendar/operations/types.js +25 -0
  56. package/dist/shortcuts/calendar/operations/write.js +439 -0
  57. package/dist/shortcuts/calendar/operations.js +8 -0
  58. package/dist/shortcuts/ehr/continuation.js +70 -0
  59. package/dist/shortcuts/ehr/errors.js +53 -0
  60. package/dist/shortcuts/ehr/host.js +213 -0
  61. package/dist/shortcuts/ehr/index.js +205 -0
  62. package/dist/shortcuts/ehr/manifest.js +47 -0
  63. package/dist/shortcuts/ehr/operations/attend-read.js +373 -0
  64. package/dist/shortcuts/ehr/operations/attend-write.js +514 -0
  65. package/dist/shortcuts/ehr/operations/hr-contact.js +363 -0
  66. package/dist/shortcuts/ehr/operations/hr-ds.js +298 -0
  67. package/dist/shortcuts/ehr/operations/hr-report.js +386 -0
  68. package/dist/shortcuts/ehr/operations/recruit-write.js +1629 -0
  69. package/dist/shortcuts/ehr/operations/recruit.js +803 -0
  70. package/dist/shortcuts/ehr/operations/registry.js +43 -0
  71. package/dist/shortcuts/ehr/operations/salary.js +319 -0
  72. package/dist/shortcuts/ehr/operations/shared.js +246 -0
  73. package/dist/shortcuts/ehr/operations/types.js +25 -0
  74. package/dist/shortcuts/ehr/operations.js +25 -0
  75. package/dist/shortcuts/esb/continuation.js +70 -0
  76. package/dist/shortcuts/esb/errors.js +65 -0
  77. package/dist/shortcuts/esb/host.js +187 -0
  78. package/dist/shortcuts/esb/index.js +112 -0
  79. package/dist/shortcuts/esb/manifest.js +91 -0
  80. package/dist/shortcuts/esb/operations/input-format.js +31 -0
  81. package/dist/shortcuts/esb/operations/registry.js +48 -0
  82. package/dist/shortcuts/esb/operations/shared.js +152 -0
  83. package/dist/shortcuts/esb/operations/trigger.js +76 -0
  84. package/dist/shortcuts/esb/operations/types.js +21 -0
  85. package/dist/shortcuts/esb/operations.js +15 -0
  86. package/dist/shortcuts/fna/continuation.js +70 -0
  87. package/dist/shortcuts/fna/errors.js +59 -0
  88. package/dist/shortcuts/fna/host.js +146 -0
  89. package/dist/shortcuts/fna/index.js +111 -0
  90. package/dist/shortcuts/fna/manifest.js +41 -0
  91. package/dist/shortcuts/fna/operations/budget.js +124 -0
  92. package/dist/shortcuts/fna/operations/expense-center.js +148 -0
  93. package/dist/shortcuts/fna/operations/invoice-writeoff.js +212 -0
  94. package/dist/shortcuts/fna/operations/loan.js +195 -0
  95. package/dist/shortcuts/fna/operations/registry.js +35 -0
  96. package/dist/shortcuts/fna/operations/shared.js +210 -0
  97. package/dist/shortcuts/fna/operations/types.js +25 -0
  98. package/dist/shortcuts/fna/operations.js +19 -0
  99. package/dist/shortcuts/hrm/errors.js +38 -0
  100. package/dist/shortcuts/hrm/host.js +156 -0
  101. package/dist/shortcuts/hrm/index.js +111 -0
  102. package/dist/shortcuts/hrm/manifest.js +32 -0
  103. package/dist/shortcuts/hrm/operations/employee.js +338 -0
  104. package/dist/shortcuts/hrm/operations/org.js +110 -0
  105. package/dist/shortcuts/hrm/operations/position.js +176 -0
  106. package/dist/shortcuts/hrm/operations/registry.js +33 -0
  107. package/dist/shortcuts/hrm/operations/shared.js +143 -0
  108. package/dist/shortcuts/hrm/operations/types.js +23 -0
  109. package/dist/shortcuts/hrm/operations.js +19 -0
  110. package/dist/shortcuts/index.js +24 -0
  111. package/dist/shortcuts/invoice/host.js +99 -94
  112. package/dist/shortcuts/invoice/index.js +58 -59
  113. package/dist/shortcuts/invoice/manifest.js +200 -3
  114. package/dist/shortcuts/invoice/operations/browse-field.js +17 -0
  115. package/dist/shortcuts/invoice/operations/issuing.js +198 -0
  116. package/dist/shortcuts/invoice/operations/registry.js +17 -0
  117. package/dist/shortcuts/invoice/operations/reim.js +401 -0
  118. package/dist/shortcuts/invoice/operations/shared.js +247 -0
  119. package/dist/shortcuts/jiuchuanhui/cache.js +441 -0
  120. package/dist/shortcuts/jiuchuanhui/continuation.js +70 -0
  121. package/dist/shortcuts/jiuchuanhui/errors.js +59 -0
  122. package/dist/shortcuts/jiuchuanhui/host.js +159 -0
  123. package/dist/shortcuts/jiuchuanhui/index.js +109 -0
  124. package/dist/shortcuts/jiuchuanhui/manifest.js +469 -0
  125. package/dist/shortcuts/jiuchuanhui/operations/datajson.js +214 -0
  126. package/dist/shortcuts/jiuchuanhui/operations/esb.js +157 -0
  127. package/dist/shortcuts/jiuchuanhui/operations/generic.js +146 -0
  128. package/dist/shortcuts/jiuchuanhui/operations/registry.js +133 -0
  129. package/dist/shortcuts/jiuchuanhui/operations/shared.js +158 -0
  130. package/dist/shortcuts/jiuchuanhui/operations/types.js +1 -0
  131. package/dist/shortcuts/jiuchuanhui/operations.js +8 -0
  132. package/dist/shortcuts/mail/continuation.js +70 -0
  133. package/dist/shortcuts/mail/errors.js +53 -0
  134. package/dist/shortcuts/mail/host.js +182 -0
  135. package/dist/shortcuts/mail/index.js +519 -0
  136. package/dist/shortcuts/mail/manifest.js +38 -0
  137. package/dist/shortcuts/mail/operations/mail-blacklist.js +79 -0
  138. package/dist/shortcuts/mail/operations/mail-contacts.js +195 -0
  139. package/dist/shortcuts/mail/operations/mail-manage.js +335 -0
  140. package/dist/shortcuts/mail/operations/mail-read.js +508 -0
  141. package/dist/shortcuts/mail/operations/mail-send.js +474 -0
  142. package/dist/shortcuts/mail/operations/mail-sign.js +203 -0
  143. package/dist/shortcuts/mail/operations/mail-template.js +170 -0
  144. package/dist/shortcuts/mail/operations/registry.js +41 -0
  145. package/dist/shortcuts/mail/operations/shared.js +64 -0
  146. package/dist/shortcuts/mail/operations/types.js +27 -0
  147. package/dist/shortcuts/mail/operations.js +19 -0
  148. package/dist/shortcuts/meeting/continuation.js +70 -0
  149. package/dist/shortcuts/meeting/errors.js +63 -0
  150. package/dist/shortcuts/meeting/host.js +167 -0
  151. package/dist/shortcuts/meeting/index.js +123 -0
  152. package/dist/shortcuts/meeting/manifest.js +64 -0
  153. package/dist/shortcuts/meeting/operations/catalogs.js +58 -0
  154. package/dist/shortcuts/meeting/operations/change.js +242 -0
  155. package/dist/shortcuts/meeting/operations/conflicts.js +142 -0
  156. package/dist/shortcuts/meeting/operations/create.js +349 -0
  157. package/dist/shortcuts/meeting/operations/env.js +191 -0
  158. package/dist/shortcuts/meeting/operations/lifecycle.js +139 -0
  159. package/dist/shortcuts/meeting/operations/meetings.js +73 -0
  160. package/dist/shortcuts/meeting/operations/receipts.js +195 -0
  161. package/dist/shortcuts/meeting/operations/registry.js +47 -0
  162. package/dist/shortcuts/meeting/operations/rooms.js +132 -0
  163. package/dist/shortcuts/meeting/operations/shared.js +112 -0
  164. package/dist/shortcuts/meeting/operations/signs.js +41 -0
  165. package/dist/shortcuts/meeting/operations/types.js +25 -0
  166. package/dist/shortcuts/meeting/operations.js +19 -0
  167. package/dist/shortcuts/plan/continuation.js +70 -0
  168. package/dist/shortcuts/plan/errors.js +70 -0
  169. package/dist/shortcuts/plan/host.js +180 -0
  170. package/dist/shortcuts/plan/index.js +150 -0
  171. package/dist/shortcuts/plan/manifest.js +53 -0
  172. package/dist/shortcuts/plan/operations/link.js +256 -0
  173. package/dist/shortcuts/plan/operations/read.js +259 -0
  174. package/dist/shortcuts/plan/operations/registry.js +33 -0
  175. package/dist/shortcuts/plan/operations/shared.js +246 -0
  176. package/dist/shortcuts/plan/operations/types.js +49 -0
  177. package/dist/shortcuts/plan/operations/version.js +49 -0
  178. package/dist/shortcuts/plan/operations/write.js +710 -0
  179. package/dist/shortcuts/plan/operations.js +8 -0
  180. package/dist/shortcuts/yimiaoban/continuation.js +70 -0
  181. package/dist/shortcuts/yimiaoban/errors.js +61 -0
  182. package/dist/shortcuts/yimiaoban/host.js +469 -0
  183. package/dist/shortcuts/yimiaoban/index.js +271 -0
  184. package/dist/shortcuts/yimiaoban/manifest.js +28 -0
  185. package/dist/shortcuts/yimiaoban/operations/file-user.js +288 -0
  186. package/dist/shortcuts/yimiaoban/operations/group-read.js +477 -0
  187. package/dist/shortcuts/yimiaoban/operations/group-write.js +591 -0
  188. package/dist/shortcuts/yimiaoban/operations/msg-parse.js +429 -0
  189. package/dist/shortcuts/yimiaoban/operations/msg-sync.js +519 -0
  190. package/dist/shortcuts/yimiaoban/operations/msg-write.js +593 -0
  191. package/dist/shortcuts/yimiaoban/operations/person.js +102 -0
  192. package/dist/shortcuts/yimiaoban/operations/registry.js +38 -0
  193. package/dist/shortcuts/yimiaoban/operations/session.js +437 -0
  194. package/dist/shortcuts/yimiaoban/operations/shared.js +236 -0
  195. package/dist/shortcuts/yimiaoban/operations/types.js +27 -0
  196. package/dist/shortcuts/yimiaoban/operations/write-util.js +78 -0
  197. package/dist/shortcuts/yimiaoban/operations.js +8 -0
  198. package/docs/SKILL.md +11 -7
  199. package/docs/_catalog.md +28 -5
  200. package/docs/agent-invoice.md +19 -9
  201. package/docs/agent-skill-install.md +141 -22
  202. package/docs/calendar.md +87 -0
  203. package/docs/e10-auth.md +28 -9
  204. package/docs/ehr.md +186 -0
  205. package/docs/esb.md +64 -0
  206. package/docs/fna.md +72 -0
  207. package/docs/hrm.md +89 -0
  208. package/docs/invoice.md +61 -20
  209. package/docs/jiuchuanhui.md +131 -0
  210. package/docs/meeting.md +48 -0
  211. package/docs/operation-manual.md +443 -0
  212. package/docs/plan.md +82 -0
  213. package/docs/wenshuding.md +129 -0
  214. package/docs/yimiaoban.md +86 -0
  215. package/docs/ziguanjia.md +89 -0
  216. package/package.json +4 -4
  217. package/scripts/package-skill.mjs +127 -34
  218. package/scripts/postbuild.mjs +13 -0
  219. package/skill-template/business-info.json +16 -2
  220. package/skill-template/domains/calendar.md +15 -0
  221. package/skill-template/domains/esb.md +13 -0
  222. package/skill-template/domains/hrm.md +16 -0
  223. package/skill-template/domains/jiuchuanhui.md +23 -0
  224. package/skill-template/domains/jucailin.md +22 -0
  225. package/skill-template/domains/mail.md +21 -0
  226. package/skill-template/domains/meeting.md +3 -0
  227. package/skill-template/domains/plan.md +17 -0
  228. package/skill-template/domains/qiyecheng.md +17 -0
  229. package/skill-template/domains/shared.md +5 -3
  230. package/skill-template/domains/skill-maker.md +10 -0
  231. package/skill-template/domains/wenshuding.md +22 -0
  232. package/skill-template/domains/{invoice.md → yepiaotong.md} +4 -0
  233. package/skill-template/domains/yimiaoban.md +21 -0
  234. package/skill-template/domains/ziguanjia.md +21 -0
  235. package/skill-template/master-skill-template.md +12 -6
  236. package/skill-template/skill-template.md +26 -10
  237. package/skills/weaver-e10-calendar/SKILL.md +102 -0
  238. package/skills/weaver-e10-calendar/product.json +8 -0
  239. package/skills/weaver-e10-calendar/references/calendar-app-check.md +65 -0
  240. package/skills/weaver-e10-calendar/references/calendar-dict.md +55 -0
  241. package/skills/weaver-e10-calendar/references/calendar-query.md +70 -0
  242. package/skills/weaver-e10-calendar/references/calendar-write.md +97 -0
  243. package/skills/weaver-e10-calendar/references/source-manifest.json +54 -0
  244. package/skills/weaver-e10-esb/SKILL.md +103 -0
  245. package/skills/weaver-e10-esb/product.json +8 -0
  246. package/skills/weaver-e10-esb/references/input-format.md +52 -0
  247. package/skills/weaver-e10-esb/references/source-manifest.json +242 -0
  248. package/skills/weaver-e10-esb/references/trigger.md +99 -0
  249. package/skills/weaver-e10-hrm/SKILL.md +88 -0
  250. package/skills/weaver-e10-hrm/product.json +8 -0
  251. package/skills/weaver-e10-hrm/references/employee.md +109 -0
  252. package/skills/weaver-e10-hrm/references/org.md +95 -0
  253. package/skills/weaver-e10-hrm/references/position.md +95 -0
  254. package/skills/weaver-e10-hrm/references/source-manifest.json +121 -0
  255. package/skills/weaver-e10-jiuchuanhui/SKILL.md +175 -0
  256. package/skills/weaver-e10-jiuchuanhui/product.json +8 -0
  257. package/skills/weaver-e10-jiuchuanhui/references/cache.md +110 -0
  258. package/skills/weaver-e10-jiuchuanhui/references/clue.md +61 -0
  259. package/skills/weaver-e10-jiuchuanhui/references/contact-plan.md +56 -0
  260. package/skills/weaver-e10-jiuchuanhui/references/contact-records.md +48 -0
  261. package/skills/weaver-e10-jiuchuanhui/references/contact.md +56 -0
  262. package/skills/weaver-e10-jiuchuanhui/references/customer.md +69 -0
  263. package/skills/weaver-e10-jiuchuanhui/references/disabled-capabilities.md +24 -0
  264. package/skills/weaver-e10-jiuchuanhui/references/discovery-config.md +60 -0
  265. package/skills/weaver-e10-jiuchuanhui/references/general-helpers.md +59 -0
  266. package/skills/weaver-e10-jiuchuanhui/references/jiuchuanhui-entry.md +60 -0
  267. package/skills/weaver-e10-jiuchuanhui/references/sale.md +72 -0
  268. package/skills/weaver-e10-jiuchuanhui/references/source-manifest.json +2632 -0
  269. package/skills/weaver-e10-jucailin/SKILL.md +102 -0
  270. package/skills/weaver-e10-jucailin/product.json +8 -0
  271. package/skills/weaver-e10-jucailin/references/attend-read.md +73 -0
  272. package/skills/weaver-e10-jucailin/references/attend-write.md +82 -0
  273. package/skills/weaver-e10-jucailin/references/hr-contact.md +92 -0
  274. package/skills/weaver-e10-jucailin/references/hr-datasource.md +104 -0
  275. package/skills/weaver-e10-jucailin/references/hr-report.md +76 -0
  276. package/skills/weaver-e10-jucailin/references/recruit-read.md +76 -0
  277. package/skills/weaver-e10-jucailin/references/recruit-write.md +70 -0
  278. package/skills/weaver-e10-jucailin/references/safety-boundaries.md +35 -0
  279. package/skills/weaver-e10-jucailin/references/salary.md +110 -0
  280. package/skills/weaver-e10-jucailin/references/source-manifest.json +152 -0
  281. package/skills/weaver-e10-mail/SKILL.md +152 -0
  282. package/skills/weaver-e10-mail/product.json +8 -0
  283. package/skills/weaver-e10-mail/references/mail-agent-entry.md +47 -0
  284. package/skills/weaver-e10-mail/references/mail-attachment.md +30 -0
  285. package/skills/weaver-e10-mail/references/mail-blacklist.md +27 -0
  286. package/skills/weaver-e10-mail/references/mail-contacts.md +33 -0
  287. package/skills/weaver-e10-mail/references/mail-manage.md +44 -0
  288. package/skills/weaver-e10-mail/references/mail-read.md +76 -0
  289. package/skills/weaver-e10-mail/references/mail-send.md +43 -0
  290. package/skills/weaver-e10-mail/references/mail-sign.md +33 -0
  291. package/skills/weaver-e10-mail/references/mail-template.md +31 -0
  292. package/skills/weaver-e10-mail/references/safety-boundaries.md +32 -0
  293. package/skills/weaver-e10-meeting/SKILL.md +106 -0
  294. package/skills/weaver-e10-meeting/product.json +8 -0
  295. package/skills/weaver-e10-meeting/references/meeting-change.md +67 -0
  296. package/skills/weaver-e10-meeting/references/meeting-create.md +52 -0
  297. package/skills/weaver-e10-meeting/references/meeting-lifecycle.md +57 -0
  298. package/skills/weaver-e10-meeting/references/meeting-queries.md +61 -0
  299. package/skills/weaver-e10-meeting/references/meeting-receipts-signs.md +48 -0
  300. package/skills/weaver-e10-meeting/references/meeting-update.md +7 -0
  301. package/skills/weaver-e10-meeting/references/source-manifest.json +50 -0
  302. package/skills/weaver-e10-plan/SKILL.md +140 -0
  303. package/skills/weaver-e10-plan/product.json +8 -0
  304. package/skills/weaver-e10-plan/references/plan-collect-and-compose.md +123 -0
  305. package/skills/weaver-e10-plan/references/plan-overview-and-routing.md +138 -0
  306. package/skills/weaver-e10-plan/references/plan-report-query.md +154 -0
  307. package/skills/weaver-e10-plan/references/plan-report-remind.md +104 -0
  308. package/skills/weaver-e10-plan/references/plan-report-write.md +162 -0
  309. package/skills/weaver-e10-plan/references/source-manifest.json +858 -0
  310. package/skills/weaver-e10-qiyecheng/SKILL.md +119 -0
  311. package/skills/weaver-e10-qiyecheng/product.json +8 -0
  312. package/skills/weaver-e10-qiyecheng/references/budget.md +65 -0
  313. package/skills/weaver-e10-qiyecheng/references/catalog.md +56 -0
  314. package/skills/weaver-e10-qiyecheng/references/expense-center.md +51 -0
  315. package/skills/weaver-e10-qiyecheng/references/invoice-writeoff.md +57 -0
  316. package/skills/weaver-e10-qiyecheng/references/loan-management.md +59 -0
  317. package/skills/weaver-e10-qiyecheng/references/source-manifest.json +698 -0
  318. package/skills/weaver-e10-shared/SKILL.md +90 -0
  319. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +127 -0
  320. package/skills/{weaver-work-cli-shared → weaver-e10-shared}/references/json-output-contract.md +34 -0
  321. package/skills/weaver-e10-shared/references/weaver-e10-installation.md +110 -0
  322. package/skills/weaver-e10-skill-maker/SKILL.md +78 -0
  323. package/skills/weaver-e10-skill-maker/product.json +8 -0
  324. package/skills/weaver-e10-skill-maker/references/business-skill-generation.md +124 -0
  325. package/skills/weaver-e10-skill-maker/references/detector-validation.md +101 -0
  326. package/skills/weaver-e10-skill-maker/references/module-cli-generation.md +230 -0
  327. package/skills/weaver-e10-skill-maker/references/post-generation-install.md +105 -0
  328. package/skills/weaver-e10-skill-maker/references/source-update-detection.md +261 -0
  329. package/skills/weaver-e10-skill-maker/references/weaver-skill-style.md +141 -0
  330. package/skills/weaver-e10-wenshuding/SKILL.md +158 -0
  331. package/skills/weaver-e10-wenshuding/product.json +8 -0
  332. package/skills/weaver-e10-wenshuding/references/archive-agent-entry.md +63 -0
  333. package/skills/weaver-e10-wenshuding/references/archive-borrow-car.md +52 -0
  334. package/skills/weaver-e10-wenshuding/references/archive-borrow-list.md +52 -0
  335. package/skills/weaver-e10-wenshuding/references/archive-disabled-capabilities.md +22 -0
  336. package/skills/weaver-e10-wenshuding/references/archive-download.md +48 -0
  337. package/skills/weaver-e10-wenshuding/references/archive-flow.md +46 -0
  338. package/skills/weaver-e10-wenshuding/references/archive-fonds.md +34 -0
  339. package/skills/weaver-e10-wenshuding/references/archive-info.md +33 -0
  340. package/skills/weaver-e10-wenshuding/references/archive-search.md +52 -0
  341. package/skills/weaver-e10-wenshuding/references/archive-upload.md +41 -0
  342. package/skills/weaver-e10-wenshuding/references/source-manifest.json +517 -0
  343. package/skills/weaver-e10-yepiaotong/SKILL.md +184 -0
  344. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-add.md +1 -1
  345. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-agent-entry.md +16 -9
  346. package/skills/weaver-e10-yepiaotong/references/invoice-browse-field-data.md +204 -0
  347. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-delete.md +1 -1
  348. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-detail.md +13 -5
  349. package/skills/weaver-e10-yepiaotong/references/invoice-disabled-capabilities.md +28 -0
  350. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-download.md +9 -2
  351. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-enterprise-list.md +12 -4
  352. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-file-upload.md +9 -2
  353. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-import.md +16 -7
  354. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-examples.md +120 -0
  355. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-field-rules.md +161 -0
  356. package/skills/weaver-e10-yepiaotong/references/invoice-issuing.md +99 -0
  357. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-ocr-preview.md +12 -4
  358. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-personal-list.md +12 -4
  359. package/skills/weaver-e10-yepiaotong/references/invoice-red.md +261 -0
  360. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +97 -0
  361. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-update.md +1 -1
  362. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-validation-preview.md +9 -2
  363. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +1340 -0
  364. package/skills/weaver-e10-yepiaotong/references/reim-examples.md +845 -0
  365. package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +94 -0
  366. package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +449 -0
  367. package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +266 -0
  368. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +494 -0
  369. package/skills/weaver-e10-yepiaotong/references/source-manifest.json +1103 -0
  370. package/skills/weaver-e10-yimiaoban/SKILL.md +104 -0
  371. package/skills/weaver-e10-yimiaoban/product.json +8 -0
  372. package/skills/weaver-e10-yimiaoban/references/ding-write.md +68 -0
  373. package/skills/weaver-e10-yimiaoban/references/error-codes.md +85 -0
  374. package/skills/weaver-e10-yimiaoban/references/field-resolution.md +46 -0
  375. package/skills/weaver-e10-yimiaoban/references/file-user-i18n.md +54 -0
  376. package/skills/weaver-e10-yimiaoban/references/group-read.md +55 -0
  377. package/skills/weaver-e10-yimiaoban/references/group-write.md +72 -0
  378. package/skills/weaver-e10-yimiaoban/references/msg-read.md +59 -0
  379. package/skills/weaver-e10-yimiaoban/references/msg-write.md +64 -0
  380. package/skills/weaver-e10-yimiaoban/references/person.md +44 -0
  381. package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +61 -0
  382. package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +47 -0
  383. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +485 -0
  384. package/skills/weaver-e10-ziguanjia/SKILL.md +163 -0
  385. package/skills/weaver-e10-ziguanjia/product.json +8 -0
  386. package/skills/weaver-e10-ziguanjia/references/source-manifest.json +147 -0
  387. package/skills/weaver-e10-ziguanjia/references/ziguanjia-agent-entry.md +65 -0
  388. package/skills/weaver-e10-ziguanjia/references/ziguanjia-create.md +45 -0
  389. package/skills/weaver-e10-ziguanjia/references/ziguanjia-depre.md +48 -0
  390. package/skills/weaver-e10-ziguanjia/references/ziguanjia-disabled-capabilities.md +22 -0
  391. package/skills/weaver-e10-ziguanjia/references/ziguanjia-purch.md +57 -0
  392. package/skills/weaver-e10-ziguanjia/references/ziguanjia-query.md +62 -0
  393. package/skills/weaver-e10-ziguanjia/references/ziguanjia-repair.md +83 -0
  394. package/skills/weaver-e10-ziguanjia/references/ziguanjia-resolve.md +49 -0
  395. package/skills/weaver-e10-ziguanjia/references/ziguanjia-return.md +70 -0
  396. package/skills/weaver-e10-ziguanjia/references/ziguanjia-update.md +45 -0
  397. package/skills/weaver-e10-ziguanjia/references/ziguanjia-use.md +60 -0
  398. package/skills/weaver-e10-ziguanjia/references/ziguanjia-viewlink.md +81 -0
  399. package/skills/weaver-work-cli-invoice/SKILL.md +0 -122
  400. package/skills/weaver-work-cli-invoice/references/invoice-disabled-capabilities.md +0 -26
  401. package/skills/weaver-work-cli-shared/SKILL.md +0 -63
  402. package/skills/weaver-work-cli-shared/references/e10-auth-and-session.md +0 -90
  403. package/skills/weaver-work-cli-shared/references/weaver-work-cli-installation.md +0 -73
  404. /package/skills/{weaver-work-cli-shared → weaver-e10-shared}/references/high-risk-write.md +0 -0
  405. /package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/product.json +0 -0
@@ -0,0 +1,214 @@
1
+ import { jiuchuanhuiConfirmationError, jiuchuanhuiPartialError, jiuchuanhuiValidationError, isJiuchuanhuiNetworkError, } from '../errors.js';
2
+ import { asObject, asPositiveString, byIdBody, datasBody, listBody, listRecords, pagingFrom, resultDataIds, sessionMatches, stripForbiddenKeys, workflow, } from './shared.js';
3
+ /**
4
+ * datajson 创建/更新写操作(saveFormData / updateFormData)。
5
+ * prepare -> apply 确认链;apply 校验 confirm + continuation + 会话一致后提交。
6
+ */
7
+ export class DatajsonWritePrepareOperation {
8
+ name;
9
+ applyOperation;
10
+ constructor(name, applyOperation) {
11
+ this.name = name;
12
+ this.applyOperation = applyOperation;
13
+ }
14
+ async execute(input, { host, continuation }) {
15
+ const form = asObject(input.form, 'form');
16
+ const session = await host.getSession();
17
+ const preview = {
18
+ datas: form.datas !== undefined ? form.datas : [stripForbiddenKeys(form)],
19
+ operator: session.userId,
20
+ };
21
+ const continuationToken = await continuation.issue({
22
+ operation: this.applyOperation,
23
+ workflow: workflow(this.applyOperation, 'AWAITING_CONFIRMATION'),
24
+ baseUrl: session.baseUrl,
25
+ profile: session.profile,
26
+ userId: session.userId,
27
+ form,
28
+ preview,
29
+ });
30
+ return {
31
+ status: 'AWAITING_CONFIRMATION',
32
+ data: {
33
+ preview,
34
+ continuation: continuationToken,
35
+ expiresInSeconds: 600,
36
+ workflow: workflow(this.applyOperation, 'AWAITING_CONFIRMATION'),
37
+ },
38
+ };
39
+ }
40
+ }
41
+ export class DatajsonWriteApplyOperation {
42
+ name;
43
+ path;
44
+ constructor(name, path) {
45
+ this.name = name;
46
+ this.path = path;
47
+ }
48
+ async execute(input, { host, continuation }) {
49
+ if (input.confirm !== true)
50
+ throw jiuchuanhuiConfirmationError(this.name, { hint: '重新调用时传入 confirm=true' });
51
+ if (typeof input.continuation !== 'string' || !input.continuation) {
52
+ throw jiuchuanhuiValidationError('continuation_required', 'apply 必须携带 prepare 返回的 continuation');
53
+ }
54
+ const lease = await continuation.verify(input.continuation, this.name);
55
+ if (!lease.form || typeof lease.form !== 'object') {
56
+ throw jiuchuanhuiValidationError('continuation_invalid', `${this.name} continuation 缺少表单数据`);
57
+ }
58
+ const session = await host.getSession();
59
+ if (!sessionMatches(lease, session))
60
+ throw jiuchuanhuiValidationError('context_mismatch', '确认上下文已变化,请重新准备操作');
61
+ let result;
62
+ try {
63
+ result = await host.request({
64
+ path: this.path,
65
+ body: datasBody(lease.form, session.userId),
66
+ operation: this.name,
67
+ });
68
+ }
69
+ catch (error) {
70
+ if (isJiuchuanhuiNetworkError(error)) {
71
+ throw jiuchuanhuiPartialError('写请求发送后连接中断,结果不确定,禁止自动重试', {
72
+ preview: lease.preview,
73
+ workflow: workflow(this.name, 'EXECUTING'),
74
+ }, { stage: 'datajson-apply' });
75
+ }
76
+ throw error;
77
+ }
78
+ const dataIds = resultDataIds(result);
79
+ if (!dataIds.length) {
80
+ throw jiuchuanhuiPartialError('保存接口返回成功但没有 dataIds,结果不确定', {
81
+ preview: lease.preview,
82
+ result,
83
+ workflow: workflow(this.name, 'EXECUTING'),
84
+ }, { stage: 'datajson-response' });
85
+ }
86
+ return {
87
+ status: 'COMPLETE',
88
+ data: {
89
+ dataIds,
90
+ applied: lease.preview,
91
+ result,
92
+ workflow: workflow(this.name, 'COMPLETE'),
93
+ },
94
+ };
95
+ }
96
+ }
97
+ /** datajson 详情查询(getFormDataByPk)。 */
98
+ export class DatajsonDetailOperation {
99
+ name;
100
+ path;
101
+ constructor(name, path) {
102
+ this.name = name;
103
+ this.path = path;
104
+ }
105
+ async execute(input, { host }) {
106
+ const id = asPositiveString(String(input.id ?? input.dataId), 'id');
107
+ const session = await host.getSession();
108
+ const result = await host.request({
109
+ path: this.path,
110
+ body: byIdBody(id, session.userId),
111
+ operation: this.name,
112
+ });
113
+ return {
114
+ status: 'COMPLETE',
115
+ data: {
116
+ id,
117
+ ...(result && typeof result === 'object' ? { raw: result } : {}),
118
+ mainTable: extractMainTable(result),
119
+ detail: result,
120
+ },
121
+ };
122
+ }
123
+ }
124
+ /**
125
+ * datajson 列表搜索。搜索条件走 query(透传),body 固定 datajson.mainTable/pageInfo/header。
126
+ * 需要总数时,与列表接口并行调用 countPath。
127
+ */
128
+ export class DatajsonSearchOperation {
129
+ name;
130
+ path;
131
+ countPath;
132
+ constructor(name, path, countPath) {
133
+ this.name = name;
134
+ this.path = path;
135
+ this.countPath = countPath;
136
+ }
137
+ async execute(input, { host }) {
138
+ const { pageNo, pageSize } = pagingFrom(input);
139
+ const session = await host.getSession();
140
+ const query = buildSearchQuery(input, pageNo, pageSize);
141
+ const main = listBody(session.userId, pageNo, pageSize, {});
142
+ const listPromise = host.request({ path: this.path, query, body: main, operation: this.name });
143
+ const countPromise = input.count === true && this.countPath
144
+ ? host.request({ path: this.countPath, query: withoutPaging(query), body: listBody(session.userId, 1, 1, {}), operation: `${this.name}.count` })
145
+ : undefined;
146
+ const [listResult, countResult] = countPromise
147
+ ? await Promise.all([listPromise, countPromise])
148
+ : [await listPromise, undefined];
149
+ const records = listRecords(listResult);
150
+ const total = extractCount(countResult);
151
+ return {
152
+ status: 'COMPLETE',
153
+ data: {
154
+ items: records,
155
+ total,
156
+ pageNo,
157
+ pageSize,
158
+ hasMore: total === undefined ? records.length >= pageSize : pageNo * pageSize < total,
159
+ query,
160
+ },
161
+ };
162
+ }
163
+ }
164
+ function buildSearchQuery(input, pageNo, pageSize) {
165
+ const query = {};
166
+ for (const [key, value] of Object.entries(input)) {
167
+ if (key === 'pageNo' || key === 'pageSize' || key === 'count' || value === undefined || value === null)
168
+ continue;
169
+ if (Array.isArray(value)) {
170
+ query[key] = value.join(',');
171
+ }
172
+ else if (typeof value === 'boolean') {
173
+ query[key] = value ? 'true' : 'false';
174
+ }
175
+ else {
176
+ query[key] = String(value);
177
+ }
178
+ }
179
+ // 事项范围参数:mine / all / customerSea,调用方传入,默认不加(业务 Skill 负责补默认值)
180
+ query.pageNo = pageNo;
181
+ query.pageSize = pageSize;
182
+ return query;
183
+ }
184
+ function withoutPaging(query) {
185
+ const next = { ...query };
186
+ delete next.pageNo;
187
+ delete next.pageSize;
188
+ return next;
189
+ }
190
+ function extractCount(value) {
191
+ if (!value || typeof value !== 'object')
192
+ return undefined;
193
+ const root = value;
194
+ const datas = root.datajson?.datas;
195
+ const raw = Array.isArray(datas) ? datas[0] : datas;
196
+ const num = Number(raw ?? root.total ?? root.count);
197
+ return Number.isFinite(num) ? num : undefined;
198
+ }
199
+ function extractMainTable(value) {
200
+ if (!value || typeof value !== 'object')
201
+ return undefined;
202
+ const root = value;
203
+ const mt = root.datajson?.mainTable;
204
+ if (mt && typeof mt === 'object' && !Array.isArray(mt))
205
+ return mt;
206
+ const datas = root.datajson?.datas;
207
+ if (Array.isArray(datas) && datas[0] && typeof datas[0] === 'object') {
208
+ const first = datas[0];
209
+ if (first.mainTable && typeof first.mainTable === 'object')
210
+ return first.mainTable;
211
+ return first;
212
+ }
213
+ return undefined;
214
+ }
@@ -0,0 +1,157 @@
1
+ import { jiuchuanhuiConfirmationError, jiuchuanhuiPartialError, jiuchuanhuiValidationError, isJiuchuanhuiNetworkError, } from '../errors.js';
2
+ import { asObject, asNonEmptyString, esbBody, esbOutcome, sessionMatches, workflow } from './shared.js';
3
+ /**
4
+ * ESB 写操作模板。所有 ESB 动作流写操作(新建/修改/转移/释放/领取/状态变更/赢单/输单/无效/暂停/重启/完成计划)
5
+ * 采用 prepare -> apply 两段式确认链:
6
+ * - prepare 只校验入参、签发 continuation,不触发动作流;
7
+ * - apply 必须 confirm:true + 有效 continuation,且校验会话上下文一致后才触发动作流。
8
+ */
9
+ export class EsbWritePrepareOperation {
10
+ name;
11
+ applyOperation;
12
+ uniqueIndent;
13
+ mainTableKeys;
14
+ constructor(name, applyOperation, uniqueIndent, mainTableKeys) {
15
+ this.name = name;
16
+ this.applyOperation = applyOperation;
17
+ this.uniqueIndent = uniqueIndent;
18
+ this.mainTableKeys = mainTableKeys;
19
+ }
20
+ async execute(input, { host, continuation }) {
21
+ const mainTable = normalizeMainTable(input.mainTable, this.mainTableKeys);
22
+ const preview = summaryOf(mainTable);
23
+ const session = await host.getSession();
24
+ const continuationToken = await continuation.issue({
25
+ operation: this.applyOperation,
26
+ workflow: workflow(this.applyOperation, 'AWAITING_CONFIRMATION'),
27
+ baseUrl: session.baseUrl,
28
+ profile: session.profile,
29
+ userId: session.userId,
30
+ uniqueIndent: this.uniqueIndent,
31
+ mainTable,
32
+ preview,
33
+ });
34
+ return {
35
+ status: 'AWAITING_CONFIRMATION',
36
+ data: {
37
+ preview,
38
+ continuation: continuationToken,
39
+ expiresInSeconds: 600,
40
+ workflow: workflow(this.applyOperation, 'AWAITING_CONFIRMATION'),
41
+ },
42
+ };
43
+ }
44
+ }
45
+ export class EsbWriteApplyOperation {
46
+ name;
47
+ uniqueIndent;
48
+ constructor(name, uniqueIndent) {
49
+ this.name = name;
50
+ this.uniqueIndent = uniqueIndent;
51
+ }
52
+ async execute(input, { host, continuation }) {
53
+ if (input.confirm !== true)
54
+ throw jiuchuanhuiConfirmationError(this.name, { hint: '重新调用时传入 confirm=true' });
55
+ if (typeof input.continuation !== 'string' || !input.continuation) {
56
+ throw jiuchuanhuiValidationError('continuation_required', 'apply 必须携带 prepare 返回的 continuation');
57
+ }
58
+ const lease = await continuation.verify(input.continuation, this.name);
59
+ if (!lease.uniqueIndent || !lease.mainTable || typeof lease.mainTable !== 'object') {
60
+ throw jiuchuanhuiValidationError('continuation_invalid', `${this.name} continuation 缺少动作流标识或业务参数`);
61
+ }
62
+ const session = await host.getSession();
63
+ if (!sessionMatches(lease, session))
64
+ throw jiuchuanhuiValidationError('context_mismatch', '确认上下文已变化,请重新准备操作');
65
+ if (lease.uniqueIndent !== this.uniqueIndent) {
66
+ throw jiuchuanhuiValidationError('continuation_mismatch', 'continuation 与当前操作的动作流标识不一致');
67
+ }
68
+ let result;
69
+ try {
70
+ result = await host.request({
71
+ path: '/api/esb/server/event/triggerActionFlow',
72
+ body: esbBody(lease.mainTable, this.uniqueIndent, session.userId),
73
+ operation: this.name,
74
+ });
75
+ }
76
+ catch (error) {
77
+ if (isJiuchuanhuiNetworkError(error)) {
78
+ throw jiuchuanhuiPartialError('写请求发送后连接中断,结果不确定,禁止自动重试', {
79
+ preview: lease.preview,
80
+ workflow: workflow(this.name, 'EXECUTING'),
81
+ }, { stage: 'esb-apply' });
82
+ }
83
+ throw error;
84
+ }
85
+ const { resultCode, resultMsg } = esbOutcome(result);
86
+ if (resultCode !== 200) {
87
+ throw jiuchuanhuiPartialError(`动作流返回非成功结果(resultCode=${resultCode}),结果不确定`, {
88
+ preview: lease.preview,
89
+ result,
90
+ workflow: workflow(this.name, 'EXECUTING'),
91
+ }, { stage: 'esb-response', resultCode, resultMsg });
92
+ }
93
+ return {
94
+ status: 'COMPLETE',
95
+ data: {
96
+ applied: lease.preview,
97
+ result: { resultCode, resultMsg },
98
+ workflow: workflow(this.name, 'COMPLETE'),
99
+ },
100
+ };
101
+ }
102
+ }
103
+ /**
104
+ * ESB 只读动作流(查询/搜索类,如按名称查 ID、查人员 ID、查联系记录等)。
105
+ * 不触发写入确认链。
106
+ */
107
+ export class EsbReadOperation {
108
+ name;
109
+ uniqueIndent;
110
+ mainTableKeys;
111
+ constructor(name, uniqueIndent, mainTableKeys) {
112
+ this.name = name;
113
+ this.uniqueIndent = uniqueIndent;
114
+ this.mainTableKeys = mainTableKeys;
115
+ }
116
+ async execute(input, { host }) {
117
+ const mainTable = normalizeMainTable(input.mainTable ?? input, this.mainTableKeys);
118
+ const session = await host.getSession();
119
+ const result = await host.request({
120
+ path: '/api/esb/server/event/triggerActionFlow',
121
+ body: esbBody(mainTable, this.uniqueIndent, session.userId),
122
+ operation: this.name,
123
+ });
124
+ const { resultCode, resultMsg } = esbOutcome(result);
125
+ if (resultCode !== 200) {
126
+ throw jiuchuanhuiValidationError('esb_read_failed', `动作流查询失败(resultCode=${resultCode}):${resultMsg}`);
127
+ }
128
+ const customData = result?.actionData?.responseData?.customData;
129
+ return {
130
+ status: 'COMPLETE',
131
+ data: {
132
+ resultCode,
133
+ resultMsg,
134
+ ...(customData && typeof customData === 'object' ? { customData } : {}),
135
+ mainTable: customData?.mainTable,
136
+ raw: result,
137
+ },
138
+ };
139
+ }
140
+ }
141
+ function normalizeMainTable(raw, allowedKeys) {
142
+ const mainTable = asObject(raw, 'mainTable');
143
+ if (!allowedKeys.length)
144
+ return { ...mainTable };
145
+ for (const key of Object.keys(mainTable)) {
146
+ if (!allowedKeys.includes(key)) {
147
+ throw jiuchuanhuiValidationError('field_unsupported', `${key} 不是该操作支持的字段`);
148
+ }
149
+ }
150
+ if (!allowedKeys.some((key) => mainTable[key] !== undefined && mainTable[key] !== null && mainTable[key] !== '')) {
151
+ throw jiuchuanhuiValidationError('field_required', `至少需要提供以下字段之一:${allowedKeys.join('、')}`);
152
+ }
153
+ return { ...mainTable };
154
+ }
155
+ function summaryOf(mainTable) {
156
+ return Object.fromEntries(Object.entries(mainTable).map(([key, value]) => [key, asNonEmptyString(value, key)]));
157
+ }
@@ -0,0 +1,146 @@
1
+ import { jiuchuanhuiValidationError } from '../errors.js';
2
+ import { asNonEmptyString, asObject } from './shared.js';
3
+ /** GET 接口(bodyMode=get):query 透传,可带 save 保存文件流。 */
4
+ export class GetQueryOperation {
5
+ name;
6
+ path;
7
+ requiredKeys;
8
+ constructor(name, path, requiredKeys = []) {
9
+ this.name = name;
10
+ this.path = path;
11
+ this.requiredKeys = requiredKeys;
12
+ }
13
+ async execute(input, { host }) {
14
+ const query = {};
15
+ for (const key of this.requiredKeys) {
16
+ const value = input[key];
17
+ if (value === undefined || value === null || value === '') {
18
+ throw jiuchuanhuiValidationError('field_required', `缺少必填参数:${key}`);
19
+ }
20
+ query[key] = String(value);
21
+ }
22
+ for (const [key, value] of Object.entries(input)) {
23
+ if (value === undefined || value === null || key === 'save')
24
+ continue;
25
+ query[key] = Array.isArray(value) ? value.join(',') : value;
26
+ }
27
+ const result = await host.request({
28
+ method: 'GET',
29
+ path: this.path,
30
+ query,
31
+ operation: this.name,
32
+ });
33
+ return {
34
+ status: 'COMPLETE',
35
+ data: {
36
+ ...(result && typeof result === 'object' ? { raw: result } : { raw: result }),
37
+ query,
38
+ },
39
+ };
40
+ }
41
+ }
42
+ /** POST raw body 接口(bodyMode=raw):params 原样透传。 */
43
+ export class RawPostOperation {
44
+ name;
45
+ path;
46
+ requiredKeys;
47
+ constructor(name, path, requiredKeys = []) {
48
+ this.name = name;
49
+ this.path = path;
50
+ this.requiredKeys = requiredKeys;
51
+ }
52
+ async execute(input, { host }) {
53
+ const body = asObject(input.params, 'params');
54
+ for (const key of this.requiredKeys) {
55
+ if (body[key] === undefined || body[key] === null || body[key] === '') {
56
+ throw jiuchuanhuiValidationError('field_required', `缺少必填参数:${key}`);
57
+ }
58
+ }
59
+ const query = {};
60
+ if (input.pathParams && typeof input.pathParams === 'object') {
61
+ for (const [key, value] of Object.entries(input.pathParams)) {
62
+ query[key] = String(value);
63
+ }
64
+ }
65
+ const result = await host.request({
66
+ path: this.path,
67
+ query,
68
+ body,
69
+ operation: this.name,
70
+ });
71
+ return {
72
+ status: 'COMPLETE',
73
+ data: {
74
+ ...(result && typeof result === 'object' ? { raw: result } : { raw: result }),
75
+ },
76
+ };
77
+ }
78
+ }
79
+ /** 占位符路径 raw POST(browser-option-search:path 含 {customBrowserType})。 */
80
+ export class PathParamsPostOperation {
81
+ name;
82
+ pathTemplate;
83
+ constructor(name, pathTemplate) {
84
+ this.name = name;
85
+ this.pathTemplate = pathTemplate;
86
+ }
87
+ async execute(input, { host }) {
88
+ const pathParams = asObject(input.pathParams ?? input.pathParamsRaw, 'pathParams');
89
+ const names = [...this.pathTemplate.matchAll(/\{(\w+)\}/g)].map((m) => m[1]);
90
+ let path = this.pathTemplate;
91
+ for (const name of names) {
92
+ const value = pathParams[name];
93
+ if (value === undefined || value === null || value === '') {
94
+ throw jiuchuanhuiValidationError('path_param_missing', `路径占位符 {${name}} 缺失,请通过 pathParams 传入`);
95
+ }
96
+ path = path.replace(`{${name}}`, encodeURIComponent(String(value)));
97
+ }
98
+ const body = input.params && typeof input.params === 'object' ? input.params : {};
99
+ const result = await host.request({
100
+ path,
101
+ body,
102
+ operation: this.name,
103
+ });
104
+ return {
105
+ status: 'COMPLETE',
106
+ data: {
107
+ ...(result && typeof result === 'object' ? { raw: result } : { raw: result }),
108
+ },
109
+ };
110
+ }
111
+ }
112
+ /** GET 文件预览/下载(get-file-preview):fileId 等 query,save 输出到本地。 */
113
+ export class FilePreviewOperation {
114
+ name;
115
+ constructor(name) {
116
+ this.name = name;
117
+ }
118
+ async execute(input, { host }) {
119
+ const fileId = asNonEmptyString(input.fileId, 'fileId');
120
+ const query = {
121
+ fileId,
122
+ module: input.module ?? 'ebuilderform',
123
+ authModule: input.authModule ?? 'ebuilderform',
124
+ source: input.source ?? 'form',
125
+ };
126
+ if (input.fieldId !== undefined)
127
+ query.fieldId = input.fieldId;
128
+ if (input.appId !== undefined)
129
+ query.appId = input.appId;
130
+ if (input.customParam !== undefined)
131
+ query.customParam = typeof input.customParam === 'string' ? input.customParam : JSON.stringify(input.customParam);
132
+ const result = await host.request({
133
+ method: 'GET',
134
+ path: '/api/file/preview',
135
+ query,
136
+ operation: this.name,
137
+ });
138
+ return {
139
+ status: 'COMPLETE',
140
+ data: {
141
+ ...(result && typeof result === 'object' ? { raw: result } : { raw: result }),
142
+ fileId,
143
+ },
144
+ };
145
+ }
146
+ }
@@ -0,0 +1,133 @@
1
+ import { jiuchuanhuiValidationError } from '../errors.js';
2
+ import { jiuchuanhuiOperations } from '../manifest.js';
3
+ import { CacheInitOperation } from '../cache.js';
4
+ import { DatajsonDetailOperation, DatajsonSearchOperation, DatajsonWriteApplyOperation, DatajsonWritePrepareOperation, } from './datajson.js';
5
+ import { EsbReadOperation, EsbWriteApplyOperation, EsbWritePrepareOperation, } from './esb.js';
6
+ import { FilePreviewOperation, GetQueryOperation, PathParamsPostOperation, } from './generic.js';
7
+ /**
8
+ * 九氚汇 operation -> handler 注册表。
9
+ *
10
+ * ESB 写操作 fixed.uniqueIndent 从 manifest 读取:registry 与 manifest 一一对应,
11
+ * 测试据此断言"每个 operation 有 handler / 每个 handler 在 schema 中暴露"。
12
+ */
13
+ function buildRegistry() {
14
+ const registry = new Map();
15
+ const handlers = [
16
+ // ===== 发现与缓存 =====
17
+ new CacheInitOperation(),
18
+ new GetQueryOperation('jiuchuanhui.app.discovery', '/api/bs/ebuilder/app/tags/getAppIds', ['tag']),
19
+ new GetQueryOperation('jiuchuanhui.form.discovery', '/api/ebuilder/form/obj/getObjsByTag', ['tag', 'appId']),
20
+ new GetQueryOperation('jiuchuanhui.field.options', '/api/ebuilder/common/ds/options', ['fieldName', 'sourceType']),
21
+ new GetQueryOperation('jiuchuanhui.rest.cfg.detail', '/api/bs/ebuilder/form/formdata/getRestCfgById', ['apid', 'id']),
22
+ new EsbReadOperation('jiuchuanhui.config.id.by.pk', '4F6E1A9702864666803CCA6B77B86227', ['interface_pk']),
23
+ new FilePreviewOperation('jiuchuanhui.file.preview'),
24
+ // ===== 客户 =====
25
+ new DatajsonWritePrepareOperation('jiuchuanhui.customer.create.prepare', 'jiuchuanhui.customer.create.apply'),
26
+ new DatajsonWriteApplyOperation('jiuchuanhui.customer.create.apply', '/api/ebuilder/form/formdata/v2/saveFormData/customer_create_api'),
27
+ new DatajsonDetailOperation('jiuchuanhui.customer.get', '/api/ebuilder/form/formdata/v2/getFormDataByPk/customer_get_api'),
28
+ new DatajsonSearchOperation('jiuchuanhui.customer.search', '/api/ebuilder/form/formdata/v2/getFormDataList/ebcustomer_search_api', '/api/ebuilder/form/formdata/v2/getFormDataCount/ebcustomer_search_count_api'),
29
+ new DatajsonSearchOperation('jiuchuanhui.customer.type.search', '/api/ebuilder/form/formdata/v2/getFormDataList/ebcustomer_type_search_api'),
30
+ new DatajsonSearchOperation('jiuchuanhui.customer.status.search', '/api/ebuilder/form/formdata/v2/getFormDataList/ebcustomer_status_search_api'),
31
+ new DatajsonSearchOperation('jiuchuanhui.customer.industry.search', '/api/ebuilder/form/formdata/v2/getFormDataList/ebcustomer_industry_search_api'),
32
+ new DatajsonSearchOperation('jiuchuanhui.customer.open-sea.search', '/api/ebuilder/form/formdata/v2/getFormDataList/customer_open_sea_search_api'),
33
+ new DatajsonWritePrepareOperation('jiuchuanhui.customer.update.prepare', 'jiuchuanhui.customer.update.apply'),
34
+ new DatajsonWriteApplyOperation('jiuchuanhui.customer.update.apply', '/api/ebuilder/form/formdata/v2/updateFormData/customer_update_api'),
35
+ // ===== 客户 ESB 写操作 =====
36
+ new EsbWritePrepareOperation('jiuchuanhui.customer.transfer.prepare', 'jiuchuanhui.customer.transfer.apply', '1E44ED7DA9EB46329818E682C2914928', ['customerId', 'toUserId', 'remark']),
37
+ new EsbWriteApplyOperation('jiuchuanhui.customer.transfer.apply', '1E44ED7DA9EB46329818E682C2914928'),
38
+ new EsbWritePrepareOperation('jiuchuanhui.customer.open-sea.release.prepare', 'jiuchuanhui.customer.open-sea.release.apply', '0E29AD0E708D4964B071D293288B92D7', ['customerId', 'openSeaId', 'remark']),
39
+ new EsbWriteApplyOperation('jiuchuanhui.customer.open-sea.release.apply', '0E29AD0E708D4964B071D293288B92D7'),
40
+ new EsbWritePrepareOperation('jiuchuanhui.customer.open-sea.claim.prepare', 'jiuchuanhui.customer.open-sea.claim.apply', 'D587CDC892FE41118DD073475C01A2CE', ['customer_id']),
41
+ new EsbWriteApplyOperation('jiuchuanhui.customer.open-sea.claim.apply', 'D587CDC892FE41118DD073475C01A2CE'),
42
+ new EsbReadOperation('jiuchuanhui.customer.duplicate.check', 'D5D0A1C30E7B404B842987C0AD3B749D', ['name', 'simpleName']),
43
+ new EsbWritePrepareOperation('jiuchuanhui.customer.contact-record.create.prepare', 'jiuchuanhui.customer.contact-record.create.apply', 'C7A226EEE1324FF3B6E5BD18AF923DE7', ['customerId', 'comment_content', 'type', 'rating', 'contact_information', 'contacts', 'next_time', 'next_content', 'next_contact_information', 'next_contacts', 'sync_salechance', 'rel_remind']),
44
+ new EsbWriteApplyOperation('jiuchuanhui.customer.contact-record.create.apply', 'C7A226EEE1324FF3B6E5BD18AF923DE7'),
45
+ new EsbWritePrepareOperation('jiuchuanhui.customer.contact-record.batch.prepare', 'jiuchuanhui.customer.contact-record.batch.apply', 'D0F315619FE34C669AE738ED68329FAB', ['entityList', 'content']),
46
+ new EsbWriteApplyOperation('jiuchuanhui.customer.contact-record.batch.apply', 'D0F315619FE34C669AE738ED68329FAB'),
47
+ // ===== 联系人 =====
48
+ new DatajsonWritePrepareOperation('jiuchuanhui.contact.create.prepare', 'jiuchuanhui.contact.create.apply'),
49
+ new DatajsonWriteApplyOperation('jiuchuanhui.contact.create.apply', '/api/ebuilder/form/formdata/v2/saveFormData/contact_create_api'),
50
+ new DatajsonDetailOperation('jiuchuanhui.contact.get', '/api/ebuilder/form/formdata/v2/getFormDataByPk/contact_get_api'),
51
+ new DatajsonWritePrepareOperation('jiuchuanhui.contact.update.prepare', 'jiuchuanhui.contact.update.apply'),
52
+ new DatajsonWriteApplyOperation('jiuchuanhui.contact.update.apply', '/api/ebuilder/form/formdata/v2/updateFormData/contact_update_api'),
53
+ new DatajsonSearchOperation('jiuchuanhui.contact.by-entity.search', '/api/ebuilder/form/formdata/v2/getFormDataList/ebcontact_search_by_entity_api'),
54
+ // ===== 商机 =====
55
+ new DatajsonWritePrepareOperation('jiuchuanhui.sale.create.prepare', 'jiuchuanhui.sale.create.apply'),
56
+ new DatajsonWriteApplyOperation('jiuchuanhui.sale.create.apply', '/api/ebuilder/form/formdata/v2/saveFormData/sale_create_api'),
57
+ new DatajsonDetailOperation('jiuchuanhui.sale.get', '/api/ebuilder/form/formdata/v2/getFormDataByPk/sale_get_api'),
58
+ new DatajsonSearchOperation('jiuchuanhui.sale.search', '/api/ebuilder/form/formdata/v2/getFormDataList/ebsale_search_api', '/api/ebuilder/form/formdata/v2/getFormDataCount/ebsale_search_count_api'),
59
+ new DatajsonWritePrepareOperation('jiuchuanhui.sale.update.prepare', 'jiuchuanhui.sale.update.apply'),
60
+ new DatajsonWriteApplyOperation('jiuchuanhui.sale.update.apply', '/api/ebuilder/form/formdata/v2/updateFormData/sale_update_api'),
61
+ new DatajsonSearchOperation('jiuchuanhui.sale.stage.search', '/api/ebuilder/form/formdata/v2/getFormDataList/sale_stage_search_api'),
62
+ new DatajsonSearchOperation('jiuchuanhui.sale.process.search', '/api/ebuilder/form/formdata/v2/getFormDataList/sale_process_sear_api'),
63
+ new DatajsonSearchOperation('jiuchuanhui.sale.lose-reason.search', '/api/ebuilder/form/formdata/v2/getFormDataList/sale_lose_reason'),
64
+ new DatajsonSearchOperation('jiuchuanhui.rival.search', '/api/ebuilder/form/formdata/v2/getFormDataList/ebrival_search_api'),
65
+ // ===== 商机 ESB 写操作 =====
66
+ new EsbWritePrepareOperation('jiuchuanhui.sale.win.prepare', 'jiuchuanhui.sale.win.apply', '3B23E782E5084F18A904E895BBD61A96', ['saleId']),
67
+ new EsbWriteApplyOperation('jiuchuanhui.sale.win.apply', '3B23E782E5084F18A904E895BBD61A96'),
68
+ new EsbWritePrepareOperation('jiuchuanhui.sale.lose.prepare', 'jiuchuanhui.sale.lose.apply', 'DE35D926F82F49FDBA26B48B0CA1CB53', ['saleid', 'money', 'reasonids', 'rivals', 'desc']),
69
+ new EsbWriteApplyOperation('jiuchuanhui.sale.lose.apply', 'DE35D926F82F49FDBA26B48B0CA1CB53'),
70
+ new EsbWritePrepareOperation('jiuchuanhui.sale.invalid.prepare', 'jiuchuanhui.sale.invalid.apply', '4D88AB8677D84BAC90B63137E7FA1FF9', ['saleId']),
71
+ new EsbWriteApplyOperation('jiuchuanhui.sale.invalid.apply', '4D88AB8677D84BAC90B63137E7FA1FF9'),
72
+ new EsbWritePrepareOperation('jiuchuanhui.sale.pause.prepare', 'jiuchuanhui.sale.pause.apply', '859C73403DCC4F01B02329571BDBD9F3', ['saleId', 'pauseReason', 'restartDate']),
73
+ new EsbWriteApplyOperation('jiuchuanhui.sale.pause.apply', '859C73403DCC4F01B02329571BDBD9F3'),
74
+ new EsbWritePrepareOperation('jiuchuanhui.sale.restart.prepare', 'jiuchuanhui.sale.restart.apply', 'F3004CDCA8A548B5A0DACD3CDE62387A', ['saleChanceId']),
75
+ new EsbWriteApplyOperation('jiuchuanhui.sale.restart.apply', 'F3004CDCA8A548B5A0DACD3CDE62387A'),
76
+ new EsbWritePrepareOperation('jiuchuanhui.sale.manager-change.prepare', 'jiuchuanhui.sale.manager-change.apply', '595F9C6F1C4248929B83086F71363BA7', ['saleChanceId', 'managerId']),
77
+ new EsbWriteApplyOperation('jiuchuanhui.sale.manager-change.apply', '595F9C6F1C4248929B83086F71363BA7'),
78
+ new EsbWritePrepareOperation('jiuchuanhui.sale.link-contacts.prepare', 'jiuchuanhui.sale.link-contacts.apply', '1114A713A62F4CA9899CC24ED5902D93', ['salechanceId', 'contactIds']),
79
+ new EsbWriteApplyOperation('jiuchuanhui.sale.link-contacts.apply', '1114A713A62F4CA9899CC24ED5902D93'),
80
+ new EsbWritePrepareOperation('jiuchuanhui.sale.contact-record.create.prepare', 'jiuchuanhui.sale.contact-record.create.apply', '7BB3A1918186445F9E770862EFA7EDA9', ['saleId', 'comment_content', 'type', 'rating', 'contact_information', 'contacts', 'next_time', 'next_content', 'next_contact_information', 'next_contacts', 'rel_remind']),
81
+ new EsbWriteApplyOperation('jiuchuanhui.sale.contact-record.create.apply', '7BB3A1918186445F9E770862EFA7EDA9'),
82
+ // ===== 线索 =====
83
+ new DatajsonWritePrepareOperation('jiuchuanhui.clue.create.prepare', 'jiuchuanhui.clue.create.apply'),
84
+ new DatajsonWriteApplyOperation('jiuchuanhui.clue.create.apply', '/api/ebuilder/form/formdata/v2/saveFormData/ebclue_ai_create_api'),
85
+ new DatajsonDetailOperation('jiuchuanhui.clue.get', '/api/ebuilder/form/formdata/v2/getFormDataByPk/ebcluepool_ai_get_api'),
86
+ new DatajsonSearchOperation('jiuchuanhui.clue.search', '/api/ebuilder/form/formdata/v2/getFormDataList/ebclue_ai_search_api', '/api/ebuilder/form/formdata/v2/getFormDataCount/ebclue_ai_search_count_api'),
87
+ new DatajsonSearchOperation('jiuchuanhui.clue.pool.search', '/api/ebuilder/form/formdata/v2/getFormDataList/ebcluepool_ai_search_api'),
88
+ new DatajsonWritePrepareOperation('jiuchuanhui.clue.update.prepare', 'jiuchuanhui.clue.update.apply'),
89
+ new DatajsonWriteApplyOperation('jiuchuanhui.clue.update.apply', '/api/ebuilder/form/formdata/v2/updateFormData/ebclue_ai_update_api'),
90
+ // ===== 线索 ESB 写操作 =====
91
+ new EsbWritePrepareOperation('jiuchuanhui.clue.status-change.prepare', 'jiuchuanhui.clue.status-change.apply', '257CC8DE42234F9191439B229839B8A7', ['clueid', 'type', 'newmanager', 'desc']),
92
+ new EsbWriteApplyOperation('jiuchuanhui.clue.status-change.apply', '257CC8DE42234F9191439B229839B8A7'),
93
+ new EsbWritePrepareOperation('jiuchuanhui.clue.to-customer.prepare', 'jiuchuanhui.clue.to-customer.apply', '00914C6415EB455DB7FCCC32DBE6E0C3', ['clueId', 'customerId']),
94
+ new EsbWriteApplyOperation('jiuchuanhui.clue.to-customer.apply', '00914C6415EB455DB7FCCC32DBE6E0C3'),
95
+ new EsbWritePrepareOperation('jiuchuanhui.clue.contact-record.create.prepare', 'jiuchuanhui.clue.contact-record.create.apply', 'B3DD120601344320A2B50A042B450681', ['clueId', 'content', 'clueStatus_MappingId']),
96
+ new EsbWriteApplyOperation('jiuchuanhui.clue.contact-record.create.apply', 'B3DD120601344320A2B50A042B450681'),
97
+ // ===== 联系计划 =====
98
+ new DatajsonWritePrepareOperation('jiuchuanhui.contact-plan.create.prepare', 'jiuchuanhui.contact-plan.create.apply'),
99
+ new DatajsonWriteApplyOperation('jiuchuanhui.contact-plan.create.apply', '/api/ebuilder/form/formdata/v2/saveFormData/ebcontact_plan_create_api'),
100
+ new EsbWritePrepareOperation('jiuchuanhui.contact-plan.complete.prepare', 'jiuchuanhui.contact-plan.complete.apply', '2595D3556CFC414F85B1A4A8D806EFE5', ['planId']),
101
+ new EsbWriteApplyOperation('jiuchuanhui.contact-plan.complete.apply', '2595D3556CFC414F85B1A4A8D806EFE5'),
102
+ // ===== 联系记录 =====
103
+ new EsbReadOperation('jiuchuanhui.entity.contact-records.list', '364A9713D10C4997AF6EDCAA5296968E', ['moduleType', 'entityId']),
104
+ new EsbReadOperation('jiuchuanhui.contact-records.by-person-time.list', 'D01DD00978524525AD8728BE1BF9FE79', ['employeeId', 'startData', 'endData']),
105
+ // ===== 通用辅助 =====
106
+ new EsbReadOperation('jiuchuanhui.entity.id.by-name', '7EC1639D5AC24B4DBCEE8D2CB85D4025', ['moduleType', 'name']),
107
+ new EsbReadOperation('jiuchuanhui.user.id.by-name', '911C17207E2C4BD29379B5A4001B246E', ['employeeName']),
108
+ new EsbReadOperation('jiuchuanhui.user.current-profile', 'B8F7597190FF419FB9127D6C8272C4FE', []),
109
+ new EsbReadOperation('jiuchuanhui.entity.permission.judge', '6D369F0A84764051A5D7B5AA1245F49A', ['moduleType', 'entityId', 'opType']),
110
+ new EsbReadOperation('jiuchuanhui.company.business-profile.query', 'BAB4DBE204214BB395BA161620A4A1CD', ['companyName']),
111
+ new EsbReadOperation('jiuchuanhui.field.info.by-ids', '10351A4DC8D4454A9F1957FBE647CD9F', ['fieldids']),
112
+ new PathParamsPostOperation('jiuchuanhui.browser-option.search', '/api/bcw/common/browser/complete/{customBrowserType}'),
113
+ new GetQueryOperation('jiuchuanhui.get-rest-cfg-detail', '/api/bs/ebuilder/form/formdata/getRestCfgById', ['apid', 'id']),
114
+ ];
115
+ for (const handler of handlers) {
116
+ if (registry.has(handler.name))
117
+ throw new Error(`duplicate jiuchuanhui operation handler: ${handler.name}`);
118
+ registry.set(handler.name, handler);
119
+ }
120
+ for (const contract of jiuchuanhuiOperations) {
121
+ if (!registry.has(contract.name))
122
+ throw new Error(`missing jiuchuanhui operation handler: ${contract.name}`);
123
+ }
124
+ return registry;
125
+ }
126
+ const jiuchuanhuiOperationRegistry = buildRegistry();
127
+ export function getJiuchuanhuiOperation(operation) {
128
+ const handler = jiuchuanhuiOperationRegistry.get(operation);
129
+ if (!handler) {
130
+ throw jiuchuanhuiValidationError('operation_unknown', `九氚汇不支持操作:${operation}`);
131
+ }
132
+ return handler;
133
+ }