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,43 @@
1
+ import { ehrValidationError } from '../errors.js';
2
+ import { attendReadOperations } from './attend-read.js';
3
+ import { attendWriteOperations } from './attend-write.js';
4
+ import { hrContactOperations } from './hr-contact.js';
5
+ import { hrDataSourceOperations } from './hr-ds.js';
6
+ import { hrReportOperations } from './hr-report.js';
7
+ import { recruitOperations } from './recruit.js';
8
+ import { recruitWriteOperations } from './recruit-write.js';
9
+ import { salaryOperations } from './salary.js';
10
+ function buildRegistry() {
11
+ const registry = new Map();
12
+ const definitions = [
13
+ ...salaryOperations,
14
+ ...attendReadOperations,
15
+ ...attendWriteOperations,
16
+ ...hrContactOperations,
17
+ ...hrDataSourceOperations,
18
+ ...hrReportOperations,
19
+ ...recruitOperations,
20
+ ...recruitWriteOperations,
21
+ ];
22
+ for (const definition of definitions) {
23
+ if (registry.has(definition.name)) {
24
+ throw new Error(`duplicate ehr operation: ${definition.name}`);
25
+ }
26
+ registry.set(definition.name, definition);
27
+ }
28
+ return registry;
29
+ }
30
+ const ehrOperationRegistry = buildRegistry();
31
+ export function ehrOperationDefinitions() {
32
+ return [...ehrOperationRegistry.values()];
33
+ }
34
+ export function getEhrOperation(operation) {
35
+ const definition = ehrOperationRegistry.get(operation);
36
+ if (!definition) {
37
+ throw ehrValidationError('operation_unknown', `聚才林不支持操作:${operation}`);
38
+ }
39
+ return definition;
40
+ }
41
+ export function hasEhrOperation(operation) {
42
+ return ehrOperationRegistry.has(operation);
43
+ }
@@ -0,0 +1,319 @@
1
+ import { ehrValidationError } from '../errors.js';
2
+ import { READ, SCHEMA_DATE, SCHEMA_ID, SCHEMA_ID_LIST, SCHEMA_MONTH, SCHEMA_STRING_LIST, ehrSuccess, schemaOf, } from './types.js';
3
+ import { assertEnum, assertMonth, assertMonthRange, compact, normalizePaged, pickDefined, resolveSecondAuthToken, toIdList, toNumber, toPageQuery, } from './shared.js';
4
+ /**
5
+ * 薪资所属月范围。页面实际传 2 个元素 [开始月, 结束月]。
6
+ * salaryMonth 超过 2 项时服务端仅保留第 1 项,因此在入口侧直接拒绝。
7
+ */
8
+ function requireMonthRange(value, field) {
9
+ if (!Array.isArray(value) || value.length === 0) {
10
+ throw ehrValidationError('month_range_invalid', `${field} 必须是 1-2 个 YYYY-MM 月份`);
11
+ }
12
+ if (value.length > 2) {
13
+ throw ehrValidationError('month_range_invalid', `${field} 最多支持 2 个月份(开始月、结束月)`);
14
+ }
15
+ const months = value.map((item, index) => assertMonth(item, `${field}[${index}]`));
16
+ if (months.length === 2 && months[0] > months[1]) {
17
+ throw ehrValidationError('month_range_invalid', `${field} 的开始月不得晚于结束月`);
18
+ }
19
+ return months;
20
+ }
21
+ function requireYearRange(args) {
22
+ const startYear = toNumber(args.startYear, 'startYear');
23
+ const endYear = toNumber(args.endYear, 'endYear');
24
+ // 文档明确:startYear 与 endYear 必须成对提供,只提供一个时服务端不会应用年份范围。
25
+ if ((startYear === undefined) !== (endYear === undefined)) {
26
+ throw ehrValidationError('year_range_incomplete', 'startYear 与 endYear 必须成对提供');
27
+ }
28
+ if (startYear !== undefined && endYear !== undefined) {
29
+ if (!Number.isInteger(startYear) || !Number.isInteger(endYear) || startYear < 1000 || startYear > 9999) {
30
+ throw ehrValidationError('year_range_invalid', 'startYear 与 endYear 必须是合法四位年份');
31
+ }
32
+ if (endYear < startYear) {
33
+ throw ehrValidationError('year_range_invalid', 'endYear 不得小于 startYear');
34
+ }
35
+ }
36
+ return { startYear, endYear };
37
+ }
38
+ const salaryBillList = {
39
+ name: 'ehr.salary.bill.list',
40
+ resource: 'salary',
41
+ method: 'bill.list',
42
+ action: 'ehr.salary.bill.list',
43
+ summary: '分页查询当前登录人的工资单,可按薪资所属月范围筛选;也用于取得详情接口的 salaryInfoId',
44
+ capability: 'salary',
45
+ risk: READ,
46
+ inputSchema: schemaOf({
47
+ current: SCHEMA_ID,
48
+ pageSize: SCHEMA_ID,
49
+ salaryYearMonth: { type: 'array', items: SCHEMA_MONTH, maxItems: 2, description: '[开始月, 结束月],格式 YYYY-MM' },
50
+ terminalType: { type: 'string' },
51
+ token: { type: 'string', description: '二次身份验证 token(SalaryBillQueryParam.token);未提供时不传,CLI 自动补 DONT_NEED' },
52
+ }),
53
+ handler: async (args, { host }) => {
54
+ const body = { ...toPageQuery(args) };
55
+ // 默认按 PC 终端查询,避免服务端按未知终端类型返回不同列集合。
56
+ body.terminalType = args.terminalType || 'PC';
57
+ // 工资单列表也走二次身份验证,token 缺失会返回 checkSecondFailNoToken。
58
+ body.token = resolveSecondAuthToken(args.token);
59
+ if (args.salaryYearMonth !== undefined) {
60
+ body.salaryYearMonth = requireMonthRange(args.salaryYearMonth, 'salaryYearMonth');
61
+ }
62
+ const response = await host.request({
63
+ method: 'POST',
64
+ path: '/api/bs/hrmsalary/salaryBill/mySalaryBillList',
65
+ body: compact(body),
66
+ });
67
+ const { data, page } = normalizePaged(response);
68
+ return ehrSuccess('ehr.salary.bill.list', data, { page });
69
+ },
70
+ };
71
+ const salaryBillGet = {
72
+ name: 'ehr.salary.bill.get',
73
+ resource: 'salary',
74
+ method: 'bill.get',
75
+ action: 'ehr.salary.bill.get',
76
+ summary: '查看当前登录人某一张已发放工资单的完整展示数据;会记录首次查看时间,不是完全无痕查询',
77
+ capability: 'salary',
78
+ risk: READ,
79
+ inputSchema: schemaOf({
80
+ salaryInfoId: { type: 'string', pattern: '^\\d+$', description: '工资单发放信息 ID,来自 bill.list 的 id' },
81
+ token: { type: 'string', description: '二次身份验证 token;用户主动提供时用原值,未提供时不传(CLI 自动补 DONT_NEED)' },
82
+ viewMac: { type: 'string' },
83
+ }, { required: ['salaryInfoId'] }),
84
+ handler: async (args, { host }) => {
85
+ const salaryInfoId = args.salaryInfoId;
86
+ if (salaryInfoId === undefined || salaryInfoId === null || salaryInfoId === '') {
87
+ throw ehrValidationError('salary_info_id_required', 'salaryInfoId 必填');
88
+ }
89
+ if (!/^\d+$/.test(String(salaryInfoId))) {
90
+ throw ehrValidationError('salary_info_id_invalid', 'salaryInfoId 必须是数字 ID 字符串');
91
+ }
92
+ const query = {
93
+ salaryInfoId: String(salaryInfoId),
94
+ // Controller 用 @RequestParam 声明 token 为必传,缺失会触发 HTTP 参数校验失败。
95
+ token: resolveSecondAuthToken(args.token),
96
+ };
97
+ if (args.viewMac !== undefined)
98
+ query.viewMac = args.viewMac;
99
+ const response = await host.request({
100
+ method: 'GET',
101
+ path: '/api/bs/hrmsalary/salaryBill/mySalaryBill',
102
+ query,
103
+ });
104
+ return ehrSuccess('ehr.salary.bill.get', normalizePaged(response).data);
105
+ },
106
+ };
107
+ const salaryWelfareList = {
108
+ name: 'ehr.salary.welfare.list',
109
+ resource: 'salary',
110
+ method: 'welfare.list',
111
+ action: 'ehr.salary.welfare.list',
112
+ summary: '按月份范围查询当前登录人的社保、公积金及其他福利缴费汇总和动态明细',
113
+ capability: 'salary',
114
+ risk: READ,
115
+ inputSchema: schemaOf({
116
+ startMonth: SCHEMA_MONTH,
117
+ endMonth: SCHEMA_MONTH,
118
+ terminalType: { type: 'string' },
119
+ token: { type: 'string', description: '二次身份验证 token;源码为空时返回 checkSecondFailNoToken。未提供时不传,CLI 自动补 DONT_NEED' },
120
+ }),
121
+ handler: async (args, { host }) => {
122
+ const query = {
123
+ terminalType: args.terminalType || 'PC',
124
+ token: resolveSecondAuthToken(args.token),
125
+ };
126
+ if (args.startMonth !== undefined)
127
+ query.startMonth = assertMonth(args.startMonth, 'startMonth');
128
+ if (args.endMonth !== undefined)
129
+ query.endMonth = assertMonth(args.endMonth, 'endMonth');
130
+ if (typeof query.startMonth === 'string' && typeof query.endMonth === 'string'
131
+ && query.startMonth > query.endMonth) {
132
+ throw ehrValidationError('month_range_invalid', 'startMonth 不得晚于 endMonth');
133
+ }
134
+ const response = await host.request({
135
+ method: 'GET',
136
+ path: '/api/bs/hrmsalary/report/welfare/list',
137
+ query,
138
+ });
139
+ const { data, page } = normalizePaged(response);
140
+ return ehrSuccess('ehr.salary.welfare.list', data, { page });
141
+ },
142
+ };
143
+ const salaryAdjustmentList = {
144
+ name: 'ehr.salary.adjustment.list',
145
+ resource: 'salary',
146
+ method: 'adjustment.list',
147
+ action: 'ehr.salary.adjustment.list',
148
+ summary: '按年份范围查询当前登录人的薪资项目调整记录;startYear 与 endYear 必须成对提供',
149
+ capability: 'salary',
150
+ risk: READ,
151
+ inputSchema: schemaOf({
152
+ startYear: { type: 'integer', minimum: 1000, maximum: 9999 },
153
+ endYear: { type: 'integer', minimum: 1000, maximum: 9999 },
154
+ terminalType: { type: 'string' },
155
+ token: { type: 'string', description: '二次身份验证 token;源码为空时返回 checkSecondFailNoToken。未提供时不传,CLI 自动补 DONT_NEED' },
156
+ }),
157
+ handler: async (args, { host }) => {
158
+ const { startYear, endYear } = requireYearRange(args);
159
+ const query = {
160
+ terminalType: args.terminalType || 'PC',
161
+ token: resolveSecondAuthToken(args.token),
162
+ };
163
+ if (startYear !== undefined)
164
+ query.startYear = startYear;
165
+ if (endYear !== undefined)
166
+ query.endYear = endYear;
167
+ const response = await host.request({
168
+ method: 'GET',
169
+ path: '/api/bs/hrmsalary/report/record/list',
170
+ query,
171
+ });
172
+ const { data, page } = normalizePaged(response);
173
+ return ehrSuccess('ehr.salary.adjustment.list', data, { page });
174
+ },
175
+ };
176
+ const salarySiaccountQuery = {
177
+ name: 'ehr.salary.siaccount.query',
178
+ resource: 'salary',
179
+ method: 'siaccount.query',
180
+ action: 'ehr.salary.siaccount.query',
181
+ summary: '社保台账详情查询(需薪酬社保台账权限);接口不分页且返回高度敏感数据,必须提供范围条件',
182
+ capability: 'salary',
183
+ risk: READ,
184
+ inputSchema: schemaOf({
185
+ startBillMonth: SCHEMA_MONTH,
186
+ endBillMonth: SCHEMA_MONTH,
187
+ paymentOrganizationIds: SCHEMA_ID_LIST,
188
+ paymentAgencyIds: SCHEMA_ID_LIST,
189
+ salaryAcctOrgIds: SCHEMA_ID_LIST,
190
+ employeeIds: SCHEMA_ID_LIST,
191
+ billStatus: { type: 'integer', enum: [0, 1], description: '0 未归档,1 已归档' },
192
+ paymentStatusList: {
193
+ type: 'array',
194
+ items: { type: 'integer', enum: [0, 1, 2, 3, 4] },
195
+ description: '0 正常缴纳,1 补缴,2 代缴,3 退差,4 补差',
196
+ },
197
+ }),
198
+ handler: async (args, { host }) => {
199
+ // 注意:这是月份区间(YYYY-MM),必须用 assertMonthRange;
200
+ // 误用 assertDateRange 会按 YYYY-MM-DD 校验而报 date_invalid。
201
+ assertMonthRange(args, 'startBillMonth', 'endBillMonth');
202
+ const employeeIds = toIdList(args.employeeIds, 'employeeIds');
203
+ const paymentOrganizationIds = toIdList(args.paymentOrganizationIds, 'paymentOrganizationIds');
204
+ const paymentAgencyIds = toIdList(args.paymentAgencyIds, 'paymentAgencyIds');
205
+ const salaryAcctOrgIds = toIdList(args.salaryAcctOrgIds, 'salaryAcctOrgIds');
206
+ // 接口不分页且返回高度敏感数据,缺少任何范围条件都可能造成大范围敏感数据返回。
207
+ const hasScope = Boolean((args.startBillMonth && args.endBillMonth)
208
+ || employeeIds?.length
209
+ || paymentOrganizationIds?.length
210
+ || paymentAgencyIds?.length
211
+ || salaryAcctOrgIds?.length);
212
+ if (!hasScope) {
213
+ throw ehrValidationError('siaccount_scope_required', '社保台账查询不分页且返回敏感数据,必须至少提供月份范围或人员/组织 ID 之一以收窄范围');
214
+ }
215
+ // 枚举必须在运行时校验:inputSchema 只是文档。
216
+ // 否则非法值(如 billStatus=9)会被服务端静默忽略并返回空数组,
217
+ // 调用方会误判为"没有数据",比直接报错更危险。
218
+ const BILL_STATUS = ['0', '1'];
219
+ const PAYMENT_STATUS = ['0', '1', '2', '3', '4'];
220
+ const billStatus = args.billStatus === undefined
221
+ ? undefined
222
+ : Number(assertEnum(args.billStatus, BILL_STATUS, 'billStatus'));
223
+ let paymentStatusList;
224
+ if (args.paymentStatusList !== undefined) {
225
+ if (!Array.isArray(args.paymentStatusList)) {
226
+ throw ehrValidationError('enum_invalid', 'paymentStatusList 必须是数组');
227
+ }
228
+ paymentStatusList = args.paymentStatusList.map((item, index) => Number(assertEnum(item, PAYMENT_STATUS, `paymentStatusList[${index}]`)));
229
+ }
230
+ const body = {
231
+ startBillMonth: args.startBillMonth,
232
+ endBillMonth: args.endBillMonth,
233
+ billStatus,
234
+ paymentStatusList,
235
+ paymentOrganizationIds,
236
+ paymentAgencyIds,
237
+ salaryAcctOrgIds,
238
+ employeeIds,
239
+ };
240
+ const response = await host.request({
241
+ method: 'POST',
242
+ path: '/api/bs/hrmsalary/siaccount/detail/query',
243
+ body: compact(body),
244
+ });
245
+ return ehrSuccess('ehr.salary.siaccount.query', normalizePaged(response).data);
246
+ },
247
+ };
248
+ const salaryEmployeeList = {
249
+ name: 'ehr.salary.employee.list',
250
+ resource: 'salary',
251
+ method: 'employee.list',
252
+ action: 'ehr.salary.employee.list',
253
+ summary: '员工薪资明细列表(需薪酬统计权限);按薪资所属月、人员、组织等条件分页查询',
254
+ capability: 'salary',
255
+ risk: READ,
256
+ inputSchema: schemaOf({
257
+ current: SCHEMA_ID,
258
+ pageSize: SCHEMA_ID,
259
+ keyword: { type: 'string' },
260
+ username: { type: 'string' },
261
+ jobNum: { type: 'string' },
262
+ idNo: { type: 'string', description: '身份证号,敏感字段' },
263
+ year: { type: 'integer', minimum: 1000, maximum: 9999 },
264
+ salaryMonth: { type: 'array', items: SCHEMA_MONTH, maxItems: 2, description: '1 项单月,2 项闭区间;超过 2 项服务端仅保留第 1 项' },
265
+ employeeType: { type: 'string', enum: ['ORGANIZATION', 'EXT_EMPLOYEE'] },
266
+ salarySendType: { type: 'string', enum: ['normal', 'import'] },
267
+ sortField: { type: 'string' },
268
+ departmentIds: SCHEMA_ID_LIST,
269
+ positionIds: SCHEMA_ID_LIST,
270
+ ids: SCHEMA_ID_LIST,
271
+ taxAgentIds: SCHEMA_ID_LIST,
272
+ salarySobIds: SCHEMA_ID_LIST,
273
+ personnelStatuss: SCHEMA_STRING_LIST,
274
+ incomeCategories: SCHEMA_STRING_LIST,
275
+ hiredate: { type: 'array', items: SCHEMA_DATE, minItems: 2, maxItems: 2, description: '入职日期闭区间,必须正好 2 项' },
276
+ }),
277
+ handler: async (args, { host }) => {
278
+ const body = {
279
+ ...toPageQuery(args),
280
+ ...pickDefined(args, [
281
+ 'keyword',
282
+ 'username',
283
+ 'jobNum',
284
+ 'idNo',
285
+ 'employeeType',
286
+ 'salarySendType',
287
+ 'sortField',
288
+ 'personnelStatuss',
289
+ 'incomeCategories',
290
+ 'hiredate',
291
+ ]),
292
+ departmentIds: toIdList(args.departmentIds, 'departmentIds'),
293
+ positionIds: toIdList(args.positionIds, 'positionIds'),
294
+ ids: toIdList(args.ids, 'ids'),
295
+ taxAgentIds: toIdList(args.taxAgentIds, 'taxAgentIds'),
296
+ salarySobIds: toIdList(args.salarySobIds, 'salarySobIds'),
297
+ };
298
+ if (args.year !== undefined)
299
+ body.year = toNumber(args.year, 'year');
300
+ if (args.salaryMonth !== undefined) {
301
+ body.salaryMonth = requireMonthRange(args.salaryMonth, 'salaryMonth');
302
+ }
303
+ const response = await host.request({
304
+ method: 'POST',
305
+ path: '/api/bs/salaryreport/salary/statistics/employee/salaryList',
306
+ body: compact(body),
307
+ });
308
+ const { data, page } = normalizePaged(response);
309
+ return ehrSuccess('ehr.salary.employee.list', data, { page });
310
+ },
311
+ };
312
+ export const salaryOperations = [
313
+ salaryBillList,
314
+ salaryBillGet,
315
+ salaryWelfareList,
316
+ salaryAdjustmentList,
317
+ salarySiaccountQuery,
318
+ salaryEmployeeList,
319
+ ];
@@ -0,0 +1,246 @@
1
+ import { ehrValidationError } from '../errors.js';
2
+ /** 原型污染防护:禁止出现在输入对象中的键。 */
3
+ const FORBIDDEN_KEYS = new Set(['__proto__', 'constructor', 'prototype']);
4
+ export function asObject(value) {
5
+ if (!value || typeof value !== 'object' || Array.isArray(value)) {
6
+ throw ehrValidationError('input_not_object', '输入必须是 JSON 对象');
7
+ }
8
+ return value;
9
+ }
10
+ export function assertNoForbiddenKeys(input) {
11
+ for (const key of Object.keys(input)) {
12
+ if (FORBIDDEN_KEYS.has(key)) {
13
+ throw ehrValidationError('forbidden_key', `输入包含非法字段:${key}`);
14
+ }
15
+ }
16
+ }
17
+ const DATE_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
18
+ const MONTH_PATTERN = /^\d{4}-\d{2}$/;
19
+ export function isDate(value) {
20
+ return typeof value === 'string' && DATE_PATTERN.test(value);
21
+ }
22
+ export function isMonth(value) {
23
+ return typeof value === 'string' && MONTH_PATTERN.test(value);
24
+ }
25
+ /**
26
+ * 语义校验:正则只能保证形如 YYYY-MM-DD,无法拒绝 2026-13-01 这类不存在的日期。
27
+ * 缺少这层校验时,非法日期会被当成合法值参与字符串比较,
28
+ * 从而抛出误导性的 date_range_invalid("开始日期不得晚于结束日期")。
29
+ */
30
+ function isRealDate(value) {
31
+ const [year, month, day] = value.split('-').map(Number);
32
+ if (month < 1 || month > 12)
33
+ return false;
34
+ // Date.UTC(year, month, 0) 取到该月最后一天,getUTCDate 即该月天数。
35
+ const daysInMonth = new Date(Date.UTC(year, month, 0)).getUTCDate();
36
+ return day >= 1 && day <= daysInMonth;
37
+ }
38
+ export function assertDate(value, field) {
39
+ if (!isDate(value))
40
+ throw ehrValidationError('date_invalid', `${field} 必须是 YYYY-MM-DD 格式`);
41
+ const text = value;
42
+ if (!isRealDate(text)) {
43
+ throw ehrValidationError('date_invalid', `${field} 不是合法日期(月份需 01-12,日期需在该月有效范围内):${text}`);
44
+ }
45
+ return text;
46
+ }
47
+ export function assertMonth(value, field) {
48
+ if (!isMonth(value))
49
+ throw ehrValidationError('month_invalid', `${field} 必须是 YYYY-MM 格式`);
50
+ const text = value;
51
+ const month = Number(text.slice(5));
52
+ if (month < 1 || month > 12) {
53
+ throw ehrValidationError('month_invalid', `${field} 的月份必须在 01-12:${text}`);
54
+ }
55
+ return text;
56
+ }
57
+ /** 通用数值转换:Mock 模式下 integer 字段可能是字符串,需按字符串数值转换。 */
58
+ export function toNumber(value, field) {
59
+ if (value === undefined || value === null || value === '')
60
+ return undefined;
61
+ const numeric = Number(value);
62
+ if (!Number.isFinite(numeric)) {
63
+ throw ehrValidationError('number_invalid', `${field} 必须是数字`);
64
+ }
65
+ return numeric;
66
+ }
67
+ export function toPositiveInt(value, field) {
68
+ if (value === undefined || value === null || value === '')
69
+ return undefined;
70
+ const numeric = Number(value);
71
+ if (!Number.isFinite(numeric)) {
72
+ throw ehrValidationError('number_invalid', `${field} 必须是数字`);
73
+ }
74
+ const truncated = Math.trunc(numeric);
75
+ if (truncated !== numeric || truncated <= 0) {
76
+ throw ehrValidationError('number_invalid', `${field} 必须是正整数`);
77
+ }
78
+ return truncated;
79
+ }
80
+ /** ID 数组归一化为 number[];兼容字符串数字(Mock 模式)。 */
81
+ export function toIdList(value, field) {
82
+ if (value === undefined || value === null)
83
+ return undefined;
84
+ if (!Array.isArray(value))
85
+ throw ehrValidationError('id_list_invalid', `${field} 必须是 ID 数组`);
86
+ return value.map((item, index) => {
87
+ if (item === undefined || item === null || item === '') {
88
+ throw ehrValidationError('id_list_invalid', `${field}[${index}] 不能为空`);
89
+ }
90
+ const numeric = Number(item);
91
+ if (!Number.isFinite(numeric)) {
92
+ throw ehrValidationError('id_list_invalid', `${field}[${index}] 必须是数字 ID`);
93
+ }
94
+ return numeric;
95
+ });
96
+ }
97
+ /** ID 数组归一化为 string[](部分接口要求字符串 id)。 */
98
+ export function toStringIdList(value, field) {
99
+ const list = toIdList(value, field);
100
+ return list === undefined ? undefined : list.map((item) => String(item));
101
+ }
102
+ export function pickDefined(value, keys) {
103
+ const result = {};
104
+ for (const key of keys) {
105
+ if (value[key] !== undefined)
106
+ result[key] = value[key];
107
+ }
108
+ return result;
109
+ }
110
+ /** 移除值为 undefined 的键,避免把空值写进请求体。 */
111
+ export function compact(body) {
112
+ for (const key of Object.keys(body)) {
113
+ if (body[key] === undefined)
114
+ delete body[key];
115
+ }
116
+ return body;
117
+ }
118
+ /** 校验日期区间成对提供且顺序正确。 */
119
+ export function assertDateRange(args, startField, endField) {
120
+ const start = args[startField];
121
+ const end = args[endField];
122
+ if ((start === undefined || start === null) !== (end === undefined || end === null)) {
123
+ throw ehrValidationError('date_range_incomplete', `${startField} 与 ${endField} 必须成对提供`);
124
+ }
125
+ if (start === undefined || start === null)
126
+ return {};
127
+ const startDate = assertDate(start, startField);
128
+ const endDate = assertDate(end, endField);
129
+ if (startDate > endDate) {
130
+ throw ehrValidationError('date_range_invalid', `${startField} 不得晚于 ${endField}`);
131
+ }
132
+ return { start: startDate, end: endDate };
133
+ }
134
+ /**
135
+ * 校验「两个独立字段」形式的月份区间(如 startBillMonth/endBillMonth),
136
+ * 与数组形式的 requireMonthRange(如 salaryMonth: ["2026-01","2026-03"])区分。
137
+ * 两者不可混用:月份是 YYYY-MM,误用 assertDateRange 会被当成 YYYY-MM-DD 而报 date_invalid。
138
+ */
139
+ export function assertMonthRange(args, startField, endField) {
140
+ const start = args[startField];
141
+ const end = args[endField];
142
+ if ((start === undefined || start === null) !== (end === undefined || end === null)) {
143
+ throw ehrValidationError('month_range_incomplete', `${startField} 与 ${endField} 必须成对提供`);
144
+ }
145
+ if (start === undefined || start === null)
146
+ return {};
147
+ const startMonth = assertMonth(start, startField);
148
+ const endMonth = assertMonth(end, endField);
149
+ if (startMonth > endMonth) {
150
+ throw ehrValidationError('month_range_invalid', `${startField} 不得晚于 ${endField}`);
151
+ }
152
+ return { start: startMonth, end: endMonth };
153
+ }
154
+ export function requireDateRange(args, startField = 'beginDate', endField = 'endDate') {
155
+ const start = args[startField];
156
+ const end = args[endField];
157
+ if (start === undefined || start === null || start === '' || end === undefined || end === null || end === '') {
158
+ throw ehrValidationError('date_range_required', `${startField} 与 ${endField} 必填,格式 YYYY-MM-DD`);
159
+ }
160
+ const range = assertDateRange(args, startField, endField);
161
+ return { beginDate: range.start, endDate: range.end };
162
+ }
163
+ /** 取出响应中的业务数据。 */
164
+ export function unwrapData(response) {
165
+ if (!response || typeof response !== 'object')
166
+ return response;
167
+ return response.data;
168
+ }
169
+ /**
170
+ * 归一化分页响应。聚才林各子系统分页结构不统一(以下均在真实 E10 环境实测确认):
171
+ * - 出勤/人事档案/薪酬的表格类接口:data{ current, pageSize, total },总数用 total
172
+ * - 数据源计数接口:totalCount/totalPage/pageSize/tableId
173
+ * - 出勤统计接口不分页,返回聚合对象
174
+ */
175
+ export function normalizePaged(response) {
176
+ const data = unwrapData(response);
177
+ const page = {};
178
+ const candidates = [data?.page, response?.page, data, response];
179
+ for (const source of candidates) {
180
+ if (!source || typeof source !== 'object')
181
+ continue;
182
+ for (const key of ['pageNo', 'current', 'pageSize', 'total', 'totalCount', 'totalPage', 'tableId']) {
183
+ if (source[key] !== undefined && page[key] === undefined)
184
+ page[key] = source[key];
185
+ }
186
+ }
187
+ return { data, page };
188
+ }
189
+ /** 归一化列表响应:输出 { items, page }。 */
190
+ export function normalizeList(response) {
191
+ const { data, page } = normalizePaged(response);
192
+ const payload = data;
193
+ const items = Array.isArray(payload?.data) ? payload.data
194
+ : Array.isArray(payload?.records) ? payload.records
195
+ : Array.isArray(payload?.list) ? payload.list
196
+ : Array.isArray(payload) ? payload
197
+ : [];
198
+ return { data: items, page };
199
+ }
200
+ /** 分页入参:聚才林各子系统字段名不统一,此处统一收敛为 current/pageSize。 */
201
+ export function toPageQuery(args) {
202
+ const page = {};
203
+ const current = toPositiveInt(args?.current, 'current');
204
+ const pageSize = toNumber(args?.pageSize, 'pageSize');
205
+ const pageNo = toNumber(args?.pageNo, 'pageNo');
206
+ if (current !== undefined)
207
+ page.current = current;
208
+ if (pageSize !== undefined)
209
+ page.pageSize = pageSize;
210
+ if (pageNo !== undefined)
211
+ page.pageNo = pageNo;
212
+ return page;
213
+ }
214
+ /**
215
+ * 二次身份验证 token 的缺省协议值。
216
+ * 三个薪酬接口(工资单列表/详情、社保福利、调薪记录)都要求携带 token:
217
+ * 源码为空时返回 `checkSecondFailNoToken`,Controller 用 @RequestParam 声明为必传。
218
+ * 该值与登录无关,也不由认证链路提供;用户未主动提供时固定传 DONT_NEED,
219
+ * 不得传空值或自行构造其他值。
220
+ */
221
+ export const SECOND_AUTH_TOKEN_DEFAULT = 'DONT_NEED';
222
+ /**
223
+ * 解析二次身份验证 token。
224
+ * - 用户显式传入时使用原值;
225
+ * - 未传或为空时回落到协议缺省值 DONT_NEED。
226
+ * 真实 token 属敏感信息,仅在此处短暂使用,不做缓存或日志输出。
227
+ */
228
+ export function resolveSecondAuthToken(value) {
229
+ if (typeof value === 'string' && value.trim())
230
+ return value.trim();
231
+ return SECOND_AUTH_TOKEN_DEFAULT;
232
+ }
233
+ /** 校验枚举取值。 */
234
+ export function assertEnum(value, allowed, field) {
235
+ const text = typeof value === 'string' ? value : String(value);
236
+ if (!allowed.includes(text)) {
237
+ throw ehrValidationError('enum_invalid', `${field} 取值必须是 ${allowed.join(' / ')} 之一`);
238
+ }
239
+ return text;
240
+ }
241
+ /** 校验数组内每个元素都在枚举内。 */
242
+ export function assertEnumArray(value, allowed, field) {
243
+ if (!Array.isArray(value))
244
+ throw ehrValidationError('enum_invalid', `${field} 必须是数组`);
245
+ return value.map((item) => assertEnum(item, allowed, field));
246
+ }
@@ -0,0 +1,25 @@
1
+ export const READ = 'read';
2
+ export const WRITE = 'write';
3
+ export function ehrSuccess(action, data, meta) {
4
+ const payload = { ok: true, action, data };
5
+ if (meta && Object.keys(meta).length > 0)
6
+ payload.meta = meta;
7
+ return payload;
8
+ }
9
+ /** 构造「对象类型 + 严格禁止额外字段」的 JSON Schema。 */
10
+ export function schemaOf(properties, options = {}) {
11
+ return {
12
+ type: 'object',
13
+ additionalProperties: false,
14
+ properties,
15
+ ...(options.required?.length ? { required: options.required } : {}),
16
+ ...(options.description ? { description: options.description } : {}),
17
+ };
18
+ }
19
+ export const SCHEMA_INTEGER_POSITIVE = { type: 'integer', minimum: 1 };
20
+ export const SCHEMA_NUMBER_POSITIVE = { type: 'number', exclusiveMinimum: 0 };
21
+ export const SCHEMA_DATE = { type: 'string', pattern: '^\\d{4}-\\d{2}-\\d{2}$' };
22
+ export const SCHEMA_MONTH = { type: 'string', pattern: '^\\d{4}-\\d{2}$' };
23
+ export const SCHEMA_ID = { oneOf: [{ type: 'integer' }, { type: 'string', pattern: '^\\d+$' }] };
24
+ export const SCHEMA_ID_LIST = { type: 'array', items: SCHEMA_ID };
25
+ export const SCHEMA_STRING_LIST = { type: 'array', items: { type: 'string' } };
@@ -0,0 +1,25 @@
1
+ import { getEhrOperation } from './operations/registry.js';
2
+ import { assertNoForbiddenKeys, asObject } from './operations/shared.js';
3
+ import { createRecruitContextLoader } from './operations/recruit.js';
4
+ export async function executeEhrOperation(operation, rawInput, context) {
5
+ const definition = getEhrOperation(operation);
6
+ const input = asObject(rawInput);
7
+ assertNoForbiddenKeys(input);
8
+ const host = {
9
+ request(request) {
10
+ return context.host.request({
11
+ ...request,
12
+ operation: request.operation || operation,
13
+ });
14
+ },
15
+ getSession() {
16
+ return context.host.getSession();
17
+ },
18
+ buildCardSign() {
19
+ return context.host.buildCardSign();
20
+ },
21
+ };
22
+ // 招聘域五层解析上下文:懒创建(首次 recruit operation 调用时才初始化),进程内复用
23
+ const recruitContext = context.recruitContext ?? createRecruitContextLoader();
24
+ return definition.handler(input, { ...context, host, recruitContext });
25
+ }