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.
- package/README.md +176 -78
- package/dist/cmd/setup/index.js +5 -5
- package/dist/cmd/skills/index.js +1 -1
- package/dist/core/hooks.js +7 -0
- package/dist/index.js +0 -0
- package/dist/internal/e10/auth/commands.js +159 -54
- package/dist/internal/e10/auth/xiaoe.js +268 -0
- package/dist/internal/e10/context.js +16 -2
- package/dist/internal/e10/index.js +1 -0
- package/dist/internal/e10/request-runtime.js +345 -0
- package/dist/internal/skills/install.js +48 -6
- package/dist/internal/skills/reader.js +27 -0
- package/dist/shortcuts/archive/continuation.js +70 -0
- package/dist/shortcuts/archive/errors.js +53 -0
- package/dist/shortcuts/archive/host.js +197 -0
- package/dist/shortcuts/archive/index.js +363 -0
- package/dist/shortcuts/archive/manifest.js +45 -0
- package/dist/shortcuts/archive/operations/archive-info.js +55 -0
- package/dist/shortcuts/archive/operations/borrow-car.js +146 -0
- package/dist/shortcuts/archive/operations/borrow-list.js +200 -0
- package/dist/shortcuts/archive/operations/confirm.js +46 -0
- package/dist/shortcuts/archive/operations/download.js +238 -0
- package/dist/shortcuts/archive/operations/flow-url.js +240 -0
- package/dist/shortcuts/archive/operations/fonds.js +95 -0
- package/dist/shortcuts/archive/operations/getPageUrl.js +137 -0
- package/dist/shortcuts/archive/operations/registry.js +43 -0
- package/dist/shortcuts/archive/operations/search.js +88 -0
- package/dist/shortcuts/archive/operations/shared.js +120 -0
- package/dist/shortcuts/archive/operations/types.js +23 -0
- package/dist/shortcuts/archive/operations/upload.js +182 -0
- package/dist/shortcuts/archive/operations.js +13 -0
- package/dist/shortcuts/archive/render/search-format.js +276 -0
- package/dist/shortcuts/archive/render/search-view.js +125 -0
- package/dist/shortcuts/asset/continuation.js +70 -0
- package/dist/shortcuts/asset/errors.js +67 -0
- package/dist/shortcuts/asset/host.js +438 -0
- package/dist/shortcuts/asset/index.js +255 -0
- package/dist/shortcuts/asset/manifest.js +471 -0
- package/dist/shortcuts/asset/operations/query.js +249 -0
- package/dist/shortcuts/asset/operations/registry.js +85 -0
- package/dist/shortcuts/asset/operations/shared.js +100 -0
- package/dist/shortcuts/asset/operations/type-cache.js +49 -0
- package/dist/shortcuts/asset/operations/types.js +1 -0
- package/dist/shortcuts/asset/operations/viewlink.js +117 -0
- package/dist/shortcuts/asset/operations/write.js +435 -0
- package/dist/shortcuts/asset/operations.js +9 -0
- package/dist/shortcuts/calendar/continuation.js +70 -0
- package/dist/shortcuts/calendar/errors.js +53 -0
- package/dist/shortcuts/calendar/host.js +148 -0
- package/dist/shortcuts/calendar/index.js +125 -0
- package/dist/shortcuts/calendar/manifest.js +26 -0
- package/dist/shortcuts/calendar/operations/read.js +259 -0
- package/dist/shortcuts/calendar/operations/registry.js +31 -0
- package/dist/shortcuts/calendar/operations/shared.js +132 -0
- package/dist/shortcuts/calendar/operations/types.js +25 -0
- package/dist/shortcuts/calendar/operations/write.js +439 -0
- package/dist/shortcuts/calendar/operations.js +8 -0
- package/dist/shortcuts/ehr/continuation.js +70 -0
- package/dist/shortcuts/ehr/errors.js +53 -0
- package/dist/shortcuts/ehr/host.js +213 -0
- package/dist/shortcuts/ehr/index.js +205 -0
- package/dist/shortcuts/ehr/manifest.js +47 -0
- package/dist/shortcuts/ehr/operations/attend-read.js +373 -0
- package/dist/shortcuts/ehr/operations/attend-write.js +514 -0
- package/dist/shortcuts/ehr/operations/hr-contact.js +363 -0
- package/dist/shortcuts/ehr/operations/hr-ds.js +298 -0
- package/dist/shortcuts/ehr/operations/hr-report.js +386 -0
- package/dist/shortcuts/ehr/operations/recruit-write.js +1629 -0
- package/dist/shortcuts/ehr/operations/recruit.js +803 -0
- package/dist/shortcuts/ehr/operations/registry.js +43 -0
- package/dist/shortcuts/ehr/operations/salary.js +319 -0
- package/dist/shortcuts/ehr/operations/shared.js +246 -0
- package/dist/shortcuts/ehr/operations/types.js +25 -0
- package/dist/shortcuts/ehr/operations.js +25 -0
- package/dist/shortcuts/esb/continuation.js +70 -0
- package/dist/shortcuts/esb/errors.js +65 -0
- package/dist/shortcuts/esb/host.js +187 -0
- package/dist/shortcuts/esb/index.js +112 -0
- package/dist/shortcuts/esb/manifest.js +91 -0
- package/dist/shortcuts/esb/operations/input-format.js +31 -0
- package/dist/shortcuts/esb/operations/registry.js +48 -0
- package/dist/shortcuts/esb/operations/shared.js +152 -0
- package/dist/shortcuts/esb/operations/trigger.js +76 -0
- package/dist/shortcuts/esb/operations/types.js +21 -0
- package/dist/shortcuts/esb/operations.js +15 -0
- package/dist/shortcuts/fna/continuation.js +70 -0
- package/dist/shortcuts/fna/errors.js +59 -0
- package/dist/shortcuts/fna/host.js +146 -0
- package/dist/shortcuts/fna/index.js +111 -0
- package/dist/shortcuts/fna/manifest.js +41 -0
- package/dist/shortcuts/fna/operations/budget.js +124 -0
- package/dist/shortcuts/fna/operations/expense-center.js +148 -0
- package/dist/shortcuts/fna/operations/invoice-writeoff.js +212 -0
- package/dist/shortcuts/fna/operations/loan.js +195 -0
- package/dist/shortcuts/fna/operations/registry.js +35 -0
- package/dist/shortcuts/fna/operations/shared.js +210 -0
- package/dist/shortcuts/fna/operations/types.js +25 -0
- package/dist/shortcuts/fna/operations.js +19 -0
- package/dist/shortcuts/hrm/errors.js +38 -0
- package/dist/shortcuts/hrm/host.js +156 -0
- package/dist/shortcuts/hrm/index.js +111 -0
- package/dist/shortcuts/hrm/manifest.js +32 -0
- package/dist/shortcuts/hrm/operations/employee.js +338 -0
- package/dist/shortcuts/hrm/operations/org.js +110 -0
- package/dist/shortcuts/hrm/operations/position.js +176 -0
- package/dist/shortcuts/hrm/operations/registry.js +33 -0
- package/dist/shortcuts/hrm/operations/shared.js +143 -0
- package/dist/shortcuts/hrm/operations/types.js +23 -0
- package/dist/shortcuts/hrm/operations.js +19 -0
- package/dist/shortcuts/index.js +24 -0
- package/dist/shortcuts/invoice/host.js +99 -94
- package/dist/shortcuts/invoice/index.js +58 -59
- package/dist/shortcuts/invoice/manifest.js +200 -3
- package/dist/shortcuts/invoice/operations/browse-field.js +17 -0
- package/dist/shortcuts/invoice/operations/issuing.js +198 -0
- package/dist/shortcuts/invoice/operations/registry.js +17 -0
- package/dist/shortcuts/invoice/operations/reim.js +401 -0
- package/dist/shortcuts/invoice/operations/shared.js +247 -0
- package/dist/shortcuts/jiuchuanhui/cache.js +441 -0
- package/dist/shortcuts/jiuchuanhui/continuation.js +70 -0
- package/dist/shortcuts/jiuchuanhui/errors.js +59 -0
- package/dist/shortcuts/jiuchuanhui/host.js +159 -0
- package/dist/shortcuts/jiuchuanhui/index.js +109 -0
- package/dist/shortcuts/jiuchuanhui/manifest.js +469 -0
- package/dist/shortcuts/jiuchuanhui/operations/datajson.js +214 -0
- package/dist/shortcuts/jiuchuanhui/operations/esb.js +157 -0
- package/dist/shortcuts/jiuchuanhui/operations/generic.js +146 -0
- package/dist/shortcuts/jiuchuanhui/operations/registry.js +133 -0
- package/dist/shortcuts/jiuchuanhui/operations/shared.js +158 -0
- package/dist/shortcuts/jiuchuanhui/operations/types.js +1 -0
- package/dist/shortcuts/jiuchuanhui/operations.js +8 -0
- package/dist/shortcuts/mail/continuation.js +70 -0
- package/dist/shortcuts/mail/errors.js +53 -0
- package/dist/shortcuts/mail/host.js +182 -0
- package/dist/shortcuts/mail/index.js +519 -0
- package/dist/shortcuts/mail/manifest.js +38 -0
- package/dist/shortcuts/mail/operations/mail-blacklist.js +79 -0
- package/dist/shortcuts/mail/operations/mail-contacts.js +195 -0
- package/dist/shortcuts/mail/operations/mail-manage.js +335 -0
- package/dist/shortcuts/mail/operations/mail-read.js +508 -0
- package/dist/shortcuts/mail/operations/mail-send.js +474 -0
- package/dist/shortcuts/mail/operations/mail-sign.js +203 -0
- package/dist/shortcuts/mail/operations/mail-template.js +170 -0
- package/dist/shortcuts/mail/operations/registry.js +41 -0
- package/dist/shortcuts/mail/operations/shared.js +64 -0
- package/dist/shortcuts/mail/operations/types.js +27 -0
- package/dist/shortcuts/mail/operations.js +19 -0
- package/dist/shortcuts/meeting/continuation.js +70 -0
- package/dist/shortcuts/meeting/errors.js +63 -0
- package/dist/shortcuts/meeting/host.js +167 -0
- package/dist/shortcuts/meeting/index.js +123 -0
- package/dist/shortcuts/meeting/manifest.js +64 -0
- package/dist/shortcuts/meeting/operations/catalogs.js +58 -0
- package/dist/shortcuts/meeting/operations/change.js +242 -0
- package/dist/shortcuts/meeting/operations/conflicts.js +142 -0
- package/dist/shortcuts/meeting/operations/create.js +349 -0
- package/dist/shortcuts/meeting/operations/env.js +191 -0
- package/dist/shortcuts/meeting/operations/lifecycle.js +139 -0
- package/dist/shortcuts/meeting/operations/meetings.js +73 -0
- package/dist/shortcuts/meeting/operations/receipts.js +195 -0
- package/dist/shortcuts/meeting/operations/registry.js +47 -0
- package/dist/shortcuts/meeting/operations/rooms.js +132 -0
- package/dist/shortcuts/meeting/operations/shared.js +112 -0
- package/dist/shortcuts/meeting/operations/signs.js +41 -0
- package/dist/shortcuts/meeting/operations/types.js +25 -0
- package/dist/shortcuts/meeting/operations.js +19 -0
- package/dist/shortcuts/plan/continuation.js +70 -0
- package/dist/shortcuts/plan/errors.js +70 -0
- package/dist/shortcuts/plan/host.js +180 -0
- package/dist/shortcuts/plan/index.js +150 -0
- package/dist/shortcuts/plan/manifest.js +53 -0
- package/dist/shortcuts/plan/operations/link.js +256 -0
- package/dist/shortcuts/plan/operations/read.js +259 -0
- package/dist/shortcuts/plan/operations/registry.js +33 -0
- package/dist/shortcuts/plan/operations/shared.js +246 -0
- package/dist/shortcuts/plan/operations/types.js +49 -0
- package/dist/shortcuts/plan/operations/version.js +49 -0
- package/dist/shortcuts/plan/operations/write.js +710 -0
- package/dist/shortcuts/plan/operations.js +8 -0
- package/dist/shortcuts/yimiaoban/continuation.js +70 -0
- package/dist/shortcuts/yimiaoban/errors.js +61 -0
- package/dist/shortcuts/yimiaoban/host.js +469 -0
- package/dist/shortcuts/yimiaoban/index.js +271 -0
- package/dist/shortcuts/yimiaoban/manifest.js +28 -0
- package/dist/shortcuts/yimiaoban/operations/file-user.js +288 -0
- package/dist/shortcuts/yimiaoban/operations/group-read.js +477 -0
- package/dist/shortcuts/yimiaoban/operations/group-write.js +591 -0
- package/dist/shortcuts/yimiaoban/operations/msg-parse.js +429 -0
- package/dist/shortcuts/yimiaoban/operations/msg-sync.js +519 -0
- package/dist/shortcuts/yimiaoban/operations/msg-write.js +593 -0
- package/dist/shortcuts/yimiaoban/operations/person.js +102 -0
- package/dist/shortcuts/yimiaoban/operations/registry.js +38 -0
- package/dist/shortcuts/yimiaoban/operations/session.js +437 -0
- package/dist/shortcuts/yimiaoban/operations/shared.js +236 -0
- package/dist/shortcuts/yimiaoban/operations/types.js +27 -0
- package/dist/shortcuts/yimiaoban/operations/write-util.js +78 -0
- package/dist/shortcuts/yimiaoban/operations.js +8 -0
- package/docs/SKILL.md +11 -7
- package/docs/_catalog.md +28 -5
- package/docs/agent-invoice.md +19 -9
- package/docs/agent-skill-install.md +141 -22
- package/docs/calendar.md +87 -0
- package/docs/e10-auth.md +28 -9
- package/docs/ehr.md +186 -0
- package/docs/esb.md +64 -0
- package/docs/fna.md +72 -0
- package/docs/hrm.md +89 -0
- package/docs/invoice.md +61 -20
- package/docs/jiuchuanhui.md +131 -0
- package/docs/meeting.md +48 -0
- package/docs/operation-manual.md +443 -0
- package/docs/plan.md +82 -0
- package/docs/wenshuding.md +129 -0
- package/docs/yimiaoban.md +86 -0
- package/docs/ziguanjia.md +89 -0
- package/package.json +4 -4
- package/scripts/package-skill.mjs +127 -34
- package/scripts/postbuild.mjs +13 -0
- package/skill-template/business-info.json +16 -2
- package/skill-template/domains/calendar.md +15 -0
- package/skill-template/domains/esb.md +13 -0
- package/skill-template/domains/hrm.md +16 -0
- package/skill-template/domains/jiuchuanhui.md +23 -0
- package/skill-template/domains/jucailin.md +22 -0
- package/skill-template/domains/mail.md +21 -0
- package/skill-template/domains/meeting.md +3 -0
- package/skill-template/domains/plan.md +17 -0
- package/skill-template/domains/qiyecheng.md +17 -0
- package/skill-template/domains/shared.md +5 -3
- package/skill-template/domains/skill-maker.md +10 -0
- package/skill-template/domains/wenshuding.md +22 -0
- package/skill-template/domains/{invoice.md → yepiaotong.md} +4 -0
- package/skill-template/domains/yimiaoban.md +21 -0
- package/skill-template/domains/ziguanjia.md +21 -0
- package/skill-template/master-skill-template.md +12 -6
- package/skill-template/skill-template.md +26 -10
- package/skills/weaver-e10-calendar/SKILL.md +102 -0
- package/skills/weaver-e10-calendar/product.json +8 -0
- package/skills/weaver-e10-calendar/references/calendar-app-check.md +65 -0
- package/skills/weaver-e10-calendar/references/calendar-dict.md +55 -0
- package/skills/weaver-e10-calendar/references/calendar-query.md +70 -0
- package/skills/weaver-e10-calendar/references/calendar-write.md +97 -0
- package/skills/weaver-e10-calendar/references/source-manifest.json +54 -0
- package/skills/weaver-e10-esb/SKILL.md +103 -0
- package/skills/weaver-e10-esb/product.json +8 -0
- package/skills/weaver-e10-esb/references/input-format.md +52 -0
- package/skills/weaver-e10-esb/references/source-manifest.json +242 -0
- package/skills/weaver-e10-esb/references/trigger.md +99 -0
- package/skills/weaver-e10-hrm/SKILL.md +88 -0
- package/skills/weaver-e10-hrm/product.json +8 -0
- package/skills/weaver-e10-hrm/references/employee.md +109 -0
- package/skills/weaver-e10-hrm/references/org.md +95 -0
- package/skills/weaver-e10-hrm/references/position.md +95 -0
- package/skills/weaver-e10-hrm/references/source-manifest.json +121 -0
- package/skills/weaver-e10-jiuchuanhui/SKILL.md +175 -0
- package/skills/weaver-e10-jiuchuanhui/product.json +8 -0
- package/skills/weaver-e10-jiuchuanhui/references/cache.md +110 -0
- package/skills/weaver-e10-jiuchuanhui/references/clue.md +61 -0
- package/skills/weaver-e10-jiuchuanhui/references/contact-plan.md +56 -0
- package/skills/weaver-e10-jiuchuanhui/references/contact-records.md +48 -0
- package/skills/weaver-e10-jiuchuanhui/references/contact.md +56 -0
- package/skills/weaver-e10-jiuchuanhui/references/customer.md +69 -0
- package/skills/weaver-e10-jiuchuanhui/references/disabled-capabilities.md +24 -0
- package/skills/weaver-e10-jiuchuanhui/references/discovery-config.md +60 -0
- package/skills/weaver-e10-jiuchuanhui/references/general-helpers.md +59 -0
- package/skills/weaver-e10-jiuchuanhui/references/jiuchuanhui-entry.md +60 -0
- package/skills/weaver-e10-jiuchuanhui/references/sale.md +72 -0
- package/skills/weaver-e10-jiuchuanhui/references/source-manifest.json +2632 -0
- package/skills/weaver-e10-jucailin/SKILL.md +102 -0
- package/skills/weaver-e10-jucailin/product.json +8 -0
- package/skills/weaver-e10-jucailin/references/attend-read.md +73 -0
- package/skills/weaver-e10-jucailin/references/attend-write.md +82 -0
- package/skills/weaver-e10-jucailin/references/hr-contact.md +92 -0
- package/skills/weaver-e10-jucailin/references/hr-datasource.md +104 -0
- package/skills/weaver-e10-jucailin/references/hr-report.md +76 -0
- package/skills/weaver-e10-jucailin/references/recruit-read.md +76 -0
- package/skills/weaver-e10-jucailin/references/recruit-write.md +70 -0
- package/skills/weaver-e10-jucailin/references/safety-boundaries.md +35 -0
- package/skills/weaver-e10-jucailin/references/salary.md +110 -0
- package/skills/weaver-e10-jucailin/references/source-manifest.json +152 -0
- package/skills/weaver-e10-mail/SKILL.md +152 -0
- package/skills/weaver-e10-mail/product.json +8 -0
- package/skills/weaver-e10-mail/references/mail-agent-entry.md +47 -0
- package/skills/weaver-e10-mail/references/mail-attachment.md +30 -0
- package/skills/weaver-e10-mail/references/mail-blacklist.md +27 -0
- package/skills/weaver-e10-mail/references/mail-contacts.md +33 -0
- package/skills/weaver-e10-mail/references/mail-manage.md +44 -0
- package/skills/weaver-e10-mail/references/mail-read.md +76 -0
- package/skills/weaver-e10-mail/references/mail-send.md +43 -0
- package/skills/weaver-e10-mail/references/mail-sign.md +33 -0
- package/skills/weaver-e10-mail/references/mail-template.md +31 -0
- package/skills/weaver-e10-mail/references/safety-boundaries.md +32 -0
- package/skills/weaver-e10-meeting/SKILL.md +106 -0
- package/skills/weaver-e10-meeting/product.json +8 -0
- package/skills/weaver-e10-meeting/references/meeting-change.md +67 -0
- package/skills/weaver-e10-meeting/references/meeting-create.md +52 -0
- package/skills/weaver-e10-meeting/references/meeting-lifecycle.md +57 -0
- package/skills/weaver-e10-meeting/references/meeting-queries.md +61 -0
- package/skills/weaver-e10-meeting/references/meeting-receipts-signs.md +48 -0
- package/skills/weaver-e10-meeting/references/meeting-update.md +7 -0
- package/skills/weaver-e10-meeting/references/source-manifest.json +50 -0
- package/skills/weaver-e10-plan/SKILL.md +140 -0
- package/skills/weaver-e10-plan/product.json +8 -0
- package/skills/weaver-e10-plan/references/plan-collect-and-compose.md +123 -0
- package/skills/weaver-e10-plan/references/plan-overview-and-routing.md +138 -0
- package/skills/weaver-e10-plan/references/plan-report-query.md +154 -0
- package/skills/weaver-e10-plan/references/plan-report-remind.md +104 -0
- package/skills/weaver-e10-plan/references/plan-report-write.md +162 -0
- package/skills/weaver-e10-plan/references/source-manifest.json +858 -0
- package/skills/weaver-e10-qiyecheng/SKILL.md +119 -0
- package/skills/weaver-e10-qiyecheng/product.json +8 -0
- package/skills/weaver-e10-qiyecheng/references/budget.md +65 -0
- package/skills/weaver-e10-qiyecheng/references/catalog.md +56 -0
- package/skills/weaver-e10-qiyecheng/references/expense-center.md +51 -0
- package/skills/weaver-e10-qiyecheng/references/invoice-writeoff.md +57 -0
- package/skills/weaver-e10-qiyecheng/references/loan-management.md +59 -0
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +698 -0
- package/skills/weaver-e10-shared/SKILL.md +90 -0
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +127 -0
- package/skills/{weaver-work-cli-shared → weaver-e10-shared}/references/json-output-contract.md +34 -0
- package/skills/weaver-e10-shared/references/weaver-e10-installation.md +110 -0
- package/skills/weaver-e10-skill-maker/SKILL.md +78 -0
- package/skills/weaver-e10-skill-maker/product.json +8 -0
- package/skills/weaver-e10-skill-maker/references/business-skill-generation.md +124 -0
- package/skills/weaver-e10-skill-maker/references/detector-validation.md +101 -0
- package/skills/weaver-e10-skill-maker/references/module-cli-generation.md +230 -0
- package/skills/weaver-e10-skill-maker/references/post-generation-install.md +105 -0
- package/skills/weaver-e10-skill-maker/references/source-update-detection.md +261 -0
- package/skills/weaver-e10-skill-maker/references/weaver-skill-style.md +141 -0
- package/skills/weaver-e10-wenshuding/SKILL.md +158 -0
- package/skills/weaver-e10-wenshuding/product.json +8 -0
- package/skills/weaver-e10-wenshuding/references/archive-agent-entry.md +63 -0
- package/skills/weaver-e10-wenshuding/references/archive-borrow-car.md +52 -0
- package/skills/weaver-e10-wenshuding/references/archive-borrow-list.md +52 -0
- package/skills/weaver-e10-wenshuding/references/archive-disabled-capabilities.md +22 -0
- package/skills/weaver-e10-wenshuding/references/archive-download.md +48 -0
- package/skills/weaver-e10-wenshuding/references/archive-flow.md +46 -0
- package/skills/weaver-e10-wenshuding/references/archive-fonds.md +34 -0
- package/skills/weaver-e10-wenshuding/references/archive-info.md +33 -0
- package/skills/weaver-e10-wenshuding/references/archive-search.md +52 -0
- package/skills/weaver-e10-wenshuding/references/archive-upload.md +41 -0
- package/skills/weaver-e10-wenshuding/references/source-manifest.json +517 -0
- package/skills/weaver-e10-yepiaotong/SKILL.md +184 -0
- package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-add.md +1 -1
- package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-agent-entry.md +16 -9
- package/skills/weaver-e10-yepiaotong/references/invoice-browse-field-data.md +204 -0
- package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-delete.md +1 -1
- package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-detail.md +13 -5
- package/skills/weaver-e10-yepiaotong/references/invoice-disabled-capabilities.md +28 -0
- package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-download.md +9 -2
- package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-enterprise-list.md +12 -4
- package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-file-upload.md +9 -2
- package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-import.md +16 -7
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-examples.md +120 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-field-rules.md +161 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing.md +99 -0
- package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-ocr-preview.md +12 -4
- package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-personal-list.md +12 -4
- package/skills/weaver-e10-yepiaotong/references/invoice-red.md +261 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +97 -0
- package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-update.md +1 -1
- package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-validation-preview.md +9 -2
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +1340 -0
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +845 -0
- package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +94 -0
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +449 -0
- package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +266 -0
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +494 -0
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +1103 -0
- package/skills/weaver-e10-yimiaoban/SKILL.md +104 -0
- package/skills/weaver-e10-yimiaoban/product.json +8 -0
- package/skills/weaver-e10-yimiaoban/references/ding-write.md +68 -0
- package/skills/weaver-e10-yimiaoban/references/error-codes.md +85 -0
- package/skills/weaver-e10-yimiaoban/references/field-resolution.md +46 -0
- package/skills/weaver-e10-yimiaoban/references/file-user-i18n.md +54 -0
- package/skills/weaver-e10-yimiaoban/references/group-read.md +55 -0
- package/skills/weaver-e10-yimiaoban/references/group-write.md +72 -0
- package/skills/weaver-e10-yimiaoban/references/msg-read.md +59 -0
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +64 -0
- package/skills/weaver-e10-yimiaoban/references/person.md +44 -0
- package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +61 -0
- package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +47 -0
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +485 -0
- package/skills/weaver-e10-ziguanjia/SKILL.md +163 -0
- package/skills/weaver-e10-ziguanjia/product.json +8 -0
- package/skills/weaver-e10-ziguanjia/references/source-manifest.json +147 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-agent-entry.md +65 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-create.md +45 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-depre.md +48 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-disabled-capabilities.md +22 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-purch.md +57 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-query.md +62 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-repair.md +83 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-resolve.md +49 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-return.md +70 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-update.md +45 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-use.md +60 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-viewlink.md +81 -0
- package/skills/weaver-work-cli-invoice/SKILL.md +0 -122
- package/skills/weaver-work-cli-invoice/references/invoice-disabled-capabilities.md +0 -26
- package/skills/weaver-work-cli-shared/SKILL.md +0 -63
- package/skills/weaver-work-cli-shared/references/e10-auth-and-session.md +0 -90
- package/skills/weaver-work-cli-shared/references/weaver-work-cli-installation.md +0 -73
- /package/skills/{weaver-work-cli-shared → weaver-e10-shared}/references/high-risk-write.md +0 -0
- /package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/product.json +0 -0
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import { ehrValidationError } from '../errors.js';
|
|
2
|
+
import { READ, SCHEMA_DATE, SCHEMA_ID, SCHEMA_ID_LIST, ehrSuccess, schemaOf, } from './types.js';
|
|
3
|
+
import { assertDateRange, assertEnum, compact, normalizePaged, pickDefined, toIdList, toNumber, toPositiveInt, } from './shared.js';
|
|
4
|
+
const BROWSER_TYPES = ['department', 'subcompany', 'position', 'resource', 'jobsetid', 'grade'];
|
|
5
|
+
const USERNAME_OPERATORS = ['in', 'notIn', 'eq', 'notEq'];
|
|
6
|
+
const PERSONNEL_STATUS = ['all', 'normal', '1', '2', '3', '4', '5', '6', '7', '9', '10'];
|
|
7
|
+
const CHANGE_TYPES = [
|
|
8
|
+
'trial',
|
|
9
|
+
'hire',
|
|
10
|
+
'extend',
|
|
11
|
+
'redeploy',
|
|
12
|
+
'dismiss',
|
|
13
|
+
'retire',
|
|
14
|
+
'quit',
|
|
15
|
+
'rehire',
|
|
16
|
+
'custom',
|
|
17
|
+
];
|
|
18
|
+
const CHANGE_STATUSES = ['ineffective', 'effective', 'disuse'];
|
|
19
|
+
const pageSchema = { current: SCHEMA_ID, pageSize: SCHEMA_ID };
|
|
20
|
+
/**
|
|
21
|
+
* 通讯录高级搜索条件(saCondition)。
|
|
22
|
+
* 结构由 /api/bs/hr/contact/main/sa 动态返回,此处不固化字段集合,
|
|
23
|
+
* 只要求「对象 -> 条件对象数组」的形状。
|
|
24
|
+
*/
|
|
25
|
+
function normalizeSaCondition(value) {
|
|
26
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
27
|
+
return undefined;
|
|
28
|
+
const result = {};
|
|
29
|
+
for (const [key, list] of Object.entries(value)) {
|
|
30
|
+
if (!Array.isArray(list)) {
|
|
31
|
+
throw ehrValidationError('sa_condition_invalid', `saCondition.${key} 必须是条件对象数组`);
|
|
32
|
+
}
|
|
33
|
+
result[key] = list;
|
|
34
|
+
}
|
|
35
|
+
return Object.keys(result).length > 0 ? result : undefined;
|
|
36
|
+
}
|
|
37
|
+
function buildSaCondition(args) {
|
|
38
|
+
const explicit = normalizeSaCondition(args.saCondition);
|
|
39
|
+
if (explicit)
|
|
40
|
+
return explicit;
|
|
41
|
+
const sa = {};
|
|
42
|
+
if (args.username) {
|
|
43
|
+
// 姓名必须按「数组包对象」结构传并带条件操作符,扁平传文本会返回 500。
|
|
44
|
+
const operator = args.usernameOperator
|
|
45
|
+
? assertEnum(args.usernameOperator, USERNAME_OPERATORS, 'usernameOperator')
|
|
46
|
+
: 'in';
|
|
47
|
+
sa.username = [{ username_condition: operator, username: args.username }];
|
|
48
|
+
}
|
|
49
|
+
if (args.jobNum) {
|
|
50
|
+
sa.job_num = [{ job_num_condition: 'in', job_num: args.jobNum }];
|
|
51
|
+
}
|
|
52
|
+
if (args.sex) {
|
|
53
|
+
sa.sex = [{ sex: assertEnum(args.sex, ['all', 'male', 'female'], 'sex') }];
|
|
54
|
+
}
|
|
55
|
+
// 通讯录默认只查在职,这是与 empchange(默认含离职)相反的关键差异。
|
|
56
|
+
const status = Array.isArray(args.personnelStatus) ? args.personnelStatus : ['normal'];
|
|
57
|
+
for (const item of status)
|
|
58
|
+
assertEnum(item, PERSONNEL_STATUS, 'personnelStatus');
|
|
59
|
+
sa.personnel_status = [{ personnel_status: status }];
|
|
60
|
+
return sa;
|
|
61
|
+
}
|
|
62
|
+
const contactFields = {
|
|
63
|
+
name: 'ehr.hr.contact.fields',
|
|
64
|
+
resource: 'hr',
|
|
65
|
+
method: 'contact.fields',
|
|
66
|
+
action: 'ehr.hr.contact.fields',
|
|
67
|
+
summary: '获取通讯录全部可展示字段及 key(按基本信息/个人信息/账号信息分组),是 contact.search 的前置步骤',
|
|
68
|
+
capability: 'hr',
|
|
69
|
+
risk: READ,
|
|
70
|
+
inputSchema: schemaOf({}),
|
|
71
|
+
handler: async (_args, { host }) => {
|
|
72
|
+
const response = await host.request({
|
|
73
|
+
method: 'POST',
|
|
74
|
+
path: '/api/bs/hr/contact/col/list',
|
|
75
|
+
body: { formEnable: true },
|
|
76
|
+
});
|
|
77
|
+
return ehrSuccess('ehr.hr.contact.fields', normalizePaged(response).data);
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
const contactSa = {
|
|
81
|
+
name: 'ehr.hr.contact.sa',
|
|
82
|
+
resource: 'hr',
|
|
83
|
+
method: 'contact.sa',
|
|
84
|
+
action: 'ehr.hr.contact.sa',
|
|
85
|
+
summary: '获取通讯录高级搜索条件定义与可选项,用于确认 saCondition 的字段 id、itemType 与 browserBean.type',
|
|
86
|
+
capability: 'hr',
|
|
87
|
+
risk: READ,
|
|
88
|
+
inputSchema: schemaOf({}),
|
|
89
|
+
handler: async (_args, { host }) => {
|
|
90
|
+
const response = await host.request({
|
|
91
|
+
method: 'POST',
|
|
92
|
+
path: '/api/bs/hr/contact/main/sa',
|
|
93
|
+
body: { formEnable: true },
|
|
94
|
+
});
|
|
95
|
+
return ehrSuccess('ehr.hr.contact.sa', normalizePaged(response).data);
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
const contactSearchProperties = {
|
|
99
|
+
username: { type: 'string', description: '姓名,按「包含」模糊匹配;重名返回多条时必须让用户选择,不得自动取第一条' },
|
|
100
|
+
usernameOperator: { type: 'string', enum: [...USERNAME_OPERATORS], description: 'in 包含 / notIn 不包含 / eq 等于 / notEq 不等于' },
|
|
101
|
+
jobNum: { type: 'string' },
|
|
102
|
+
sex: { type: 'string', enum: ['all', 'male', 'female'] },
|
|
103
|
+
personnelStatus: {
|
|
104
|
+
type: 'array',
|
|
105
|
+
items: { type: 'string', enum: [...PERSONNEL_STATUS] },
|
|
106
|
+
description: '默认 ["normal"] 在职;["all"] 不限状态。不要用 ["normal","6"] 这类组合,实测无法覆盖离职人员',
|
|
107
|
+
},
|
|
108
|
+
saCondition: { type: 'object', description: '完整高级搜索条件;传入后将忽略上面的便捷字段' },
|
|
109
|
+
onlyFieldList: { type: 'array', items: { type: 'string' }, description: '只返回这些字段,key 以 contact.fields 返回的 fieldList[].id 为准' },
|
|
110
|
+
keyword: { type: 'string' },
|
|
111
|
+
saMatchType: { type: 'string', enum: ['and', 'or'] },
|
|
112
|
+
queryType: { type: 'string', enum: ['nomarl', 'monthActive', 'monthDimission', 'monthRetire'] },
|
|
113
|
+
};
|
|
114
|
+
const contactSearch = {
|
|
115
|
+
name: 'ehr.hr.contact.search',
|
|
116
|
+
resource: 'hr',
|
|
117
|
+
method: 'contact.search',
|
|
118
|
+
action: 'ehr.hr.contact.search',
|
|
119
|
+
summary: '按高级搜索条件分页查询通讯录在职人员;pageSize 被页面配置固定为 100,全量需递增 current 翻页',
|
|
120
|
+
capability: 'hr',
|
|
121
|
+
risk: READ,
|
|
122
|
+
inputSchema: schemaOf({ ...contactSearchProperties, ...pageSchema }),
|
|
123
|
+
handler: async (args, { host }) => {
|
|
124
|
+
const body = {
|
|
125
|
+
formEnable: true,
|
|
126
|
+
searchCount: true,
|
|
127
|
+
...pickDefined(args, ['onlyFieldList', 'keyword', 'saMatchType', 'queryType']),
|
|
128
|
+
saCondition: buildSaCondition(args),
|
|
129
|
+
};
|
|
130
|
+
const current = toPositiveInt(args.current, 'current');
|
|
131
|
+
const pageSize = toNumber(args.pageSize, 'pageSize');
|
|
132
|
+
if (current !== undefined)
|
|
133
|
+
body.current = current;
|
|
134
|
+
if (pageSize !== undefined)
|
|
135
|
+
body.pageSize = pageSize;
|
|
136
|
+
const response = await host.request({
|
|
137
|
+
method: 'POST',
|
|
138
|
+
path: '/api/bs/hr/contact/main/table',
|
|
139
|
+
body: compact(body),
|
|
140
|
+
});
|
|
141
|
+
const { data, page } = normalizePaged(response);
|
|
142
|
+
return ehrSuccess('ehr.hr.contact.search', data, { page });
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
const contactCount = {
|
|
146
|
+
name: 'ehr.hr.contact.count',
|
|
147
|
+
resource: 'hr',
|
|
148
|
+
method: 'contact.count',
|
|
149
|
+
action: 'ehr.hr.contact.count',
|
|
150
|
+
summary: '只统计符合高级搜索条件的通讯录人员数量,不返回列表',
|
|
151
|
+
capability: 'hr',
|
|
152
|
+
risk: READ,
|
|
153
|
+
inputSchema: schemaOf(contactSearchProperties),
|
|
154
|
+
handler: async (args, { host }) => {
|
|
155
|
+
const response = await host.request({
|
|
156
|
+
method: 'POST',
|
|
157
|
+
path: '/api/bs/hr/contact/main/count',
|
|
158
|
+
body: {
|
|
159
|
+
formEnable: true,
|
|
160
|
+
...pickDefined(args, ['keyword', 'saMatchType', 'queryType']),
|
|
161
|
+
saCondition: buildSaCondition(args),
|
|
162
|
+
},
|
|
163
|
+
});
|
|
164
|
+
return ehrSuccess('ehr.hr.contact.count', normalizePaged(response).data);
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
const browserComplete = {
|
|
168
|
+
name: 'ehr.hr.browser.complete',
|
|
169
|
+
resource: 'hr',
|
|
170
|
+
method: 'browser.complete',
|
|
171
|
+
action: 'ehr.hr.browser.complete',
|
|
172
|
+
summary: '按名称查询浏览器选择器条目取 id(部门/分部/岗位/职级/职务/上级等),供 saCondition 构造使用',
|
|
173
|
+
capability: 'hr',
|
|
174
|
+
risk: READ,
|
|
175
|
+
inputSchema: schemaOf({
|
|
176
|
+
type: { type: 'string', enum: [...BROWSER_TYPES], description: 'browserBean.type,取自 contact.sa 返回的字段定义' },
|
|
177
|
+
searchValue: { type: 'string', minLength: 1 },
|
|
178
|
+
}, { required: ['type', 'searchValue'] }),
|
|
179
|
+
handler: async (args, { host }) => {
|
|
180
|
+
const type = assertEnum(args.type, BROWSER_TYPES, 'type');
|
|
181
|
+
if (!args.searchValue || !String(args.searchValue).trim()) {
|
|
182
|
+
throw ehrValidationError('search_value_required', 'searchValue 必填');
|
|
183
|
+
}
|
|
184
|
+
const response = await host.request({
|
|
185
|
+
method: 'POST',
|
|
186
|
+
path: `/api/hrm/common/browser/complete/${type}`,
|
|
187
|
+
body: { browserMultiple: true, newly: 0, searchValue: String(args.searchValue) },
|
|
188
|
+
});
|
|
189
|
+
const data = normalizePaged(response).data;
|
|
190
|
+
const candidates = Array.isArray(data?.data) ? data.data : [];
|
|
191
|
+
return ehrSuccess('ehr.hr.browser.complete', {
|
|
192
|
+
candidates,
|
|
193
|
+
total: candidates.length,
|
|
194
|
+
// 多条命中时严禁自动取第一条,必须列候选让用户选择。
|
|
195
|
+
requiresDisambiguation: candidates.length > 1,
|
|
196
|
+
hint: candidates.length > 1
|
|
197
|
+
? '存在多个匹配项,必须列出候选让用户确认选择哪一个,不得自动取第一条'
|
|
198
|
+
: undefined,
|
|
199
|
+
});
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
const birthdayConditions = {
|
|
203
|
+
name: 'ehr.hr.birthday.conditions',
|
|
204
|
+
resource: 'hr',
|
|
205
|
+
method: 'birthday.conditions',
|
|
206
|
+
action: 'ehr.hr.birthday.conditions',
|
|
207
|
+
summary: '获取过生日人员查询的高级搜索条件定义;该接口只能用 GET,POST 会返回 405',
|
|
208
|
+
capability: 'hr',
|
|
209
|
+
risk: READ,
|
|
210
|
+
inputSchema: schemaOf({}),
|
|
211
|
+
handler: async (_args, { host }) => {
|
|
212
|
+
const response = await host.request({
|
|
213
|
+
method: 'GET',
|
|
214
|
+
path: '/api/hr/birthday/getSearchCondition',
|
|
215
|
+
});
|
|
216
|
+
return ehrSuccess('ehr.hr.birthday.conditions', normalizePaged(response).data);
|
|
217
|
+
},
|
|
218
|
+
};
|
|
219
|
+
const birthdayList = {
|
|
220
|
+
name: 'ehr.hr.birthday.list',
|
|
221
|
+
resource: 'hr',
|
|
222
|
+
method: 'birthday.list',
|
|
223
|
+
action: 'ehr.hr.birthday.list',
|
|
224
|
+
summary: '按生日月/日、姓名、工号、部门、分部查询过生日人员;pageSize 被页面配置固定为 100',
|
|
225
|
+
capability: 'hr',
|
|
226
|
+
risk: READ,
|
|
227
|
+
inputSchema: schemaOf({
|
|
228
|
+
birthdayM: { type: 'string', pattern: '^(0[1-9]|1[0-2])$', description: '生日月 01-12,缺省取当前月' },
|
|
229
|
+
birthdayD: { type: 'string', pattern: '^(0[1-9]|[12][0-9]|3[01])$', description: '生日日 01-31;与 birthdayM 组合为单日' },
|
|
230
|
+
username: { type: 'string' },
|
|
231
|
+
jobNum: { type: 'string' },
|
|
232
|
+
departmentIds: SCHEMA_ID_LIST,
|
|
233
|
+
subcompanyIds: SCHEMA_ID_LIST,
|
|
234
|
+
...pageSchema,
|
|
235
|
+
}),
|
|
236
|
+
handler: async (args, { host }) => {
|
|
237
|
+
const params = {};
|
|
238
|
+
if (args.birthdayM)
|
|
239
|
+
params.birthdayM = [{ birthdayM: args.birthdayM }];
|
|
240
|
+
if (args.birthdayD)
|
|
241
|
+
params.birthdayD = [{ birthdayD: args.birthdayD }];
|
|
242
|
+
if (args.username)
|
|
243
|
+
params.username = [{ username: args.username }];
|
|
244
|
+
if (args.jobNum)
|
|
245
|
+
params.jobNum = [{ jobNum: args.jobNum }];
|
|
246
|
+
const departmentIds = toIdList(args.departmentIds, 'departmentIds');
|
|
247
|
+
const subcompanyIds = toIdList(args.subcompanyIds, 'subcompanyIds');
|
|
248
|
+
if (departmentIds?.length) {
|
|
249
|
+
params.department = [{ department: departmentIds.map((id) => ({ id: String(id) })) }];
|
|
250
|
+
}
|
|
251
|
+
if (subcompanyIds?.length) {
|
|
252
|
+
params.subcompany = [{ subcompany: subcompanyIds.map((id) => ({ id: String(id) })) }];
|
|
253
|
+
}
|
|
254
|
+
const body = {
|
|
255
|
+
// menuCode 固定,来源文档明确可直接调 tableData。
|
|
256
|
+
menuCode: 'birthdaylist',
|
|
257
|
+
params,
|
|
258
|
+
};
|
|
259
|
+
const current = toPositiveInt(args.current, 'current');
|
|
260
|
+
const pageSize = toNumber(args.pageSize, 'pageSize');
|
|
261
|
+
if (current !== undefined)
|
|
262
|
+
body.current = current;
|
|
263
|
+
if (pageSize !== undefined)
|
|
264
|
+
body.pageSize = pageSize;
|
|
265
|
+
const response = await host.request({
|
|
266
|
+
method: 'POST',
|
|
267
|
+
path: '/api/hr/birthday/tableData',
|
|
268
|
+
body,
|
|
269
|
+
});
|
|
270
|
+
const { data, page } = normalizePaged(response);
|
|
271
|
+
return ehrSuccess('ehr.hr.birthday.list', data, { page });
|
|
272
|
+
},
|
|
273
|
+
};
|
|
274
|
+
const empchangeConditions = {
|
|
275
|
+
name: 'ehr.hr.empchange.conditions',
|
|
276
|
+
resource: 'hr',
|
|
277
|
+
method: 'empchange.conditions',
|
|
278
|
+
action: 'ehr.hr.empchange.conditions',
|
|
279
|
+
summary: '获取人员状态变更记录的筛选字段定义与枚举;该接口只能用 GET,POST 实测返回 405',
|
|
280
|
+
capability: 'hr',
|
|
281
|
+
risk: READ,
|
|
282
|
+
inputSchema: schemaOf({}),
|
|
283
|
+
handler: async (_args, { host }) => {
|
|
284
|
+
const response = await host.request({
|
|
285
|
+
method: 'GET',
|
|
286
|
+
path: '/api/bs/hrm/empchange/record/searchCondition',
|
|
287
|
+
});
|
|
288
|
+
return ehrSuccess('ehr.hr.empchange.conditions', normalizePaged(response).data);
|
|
289
|
+
},
|
|
290
|
+
};
|
|
291
|
+
const empchangeList = {
|
|
292
|
+
name: 'ehr.hr.empchange.list',
|
|
293
|
+
resource: 'hr',
|
|
294
|
+
method: 'empchange.list',
|
|
295
|
+
action: 'ehr.hr.empchange.list',
|
|
296
|
+
summary: '查询人员状态变更台账(试用/转正/续签/调动/离职/退休/解聘/返聘);默认包含离职人员,与通讯录默认在职相反',
|
|
297
|
+
capability: 'hr',
|
|
298
|
+
risk: READ,
|
|
299
|
+
inputSchema: schemaOf({
|
|
300
|
+
userName: { type: 'string', description: '姓名模糊匹配;可能重名,查个人建议用 resourceId' },
|
|
301
|
+
jobNum: { type: 'string' },
|
|
302
|
+
keySearch: { type: 'string' },
|
|
303
|
+
resourceId: SCHEMA_ID,
|
|
304
|
+
resource: SCHEMA_ID_LIST,
|
|
305
|
+
department: { ...SCHEMA_ID_LIST, description: '部门 id 数组;过滤的是人员当前所在部门' },
|
|
306
|
+
position: { ...SCHEMA_ID_LIST, description: '岗位 id 数组' },
|
|
307
|
+
changeDateStart: SCHEMA_DATE,
|
|
308
|
+
changeDateEnd: SCHEMA_DATE,
|
|
309
|
+
changeType: { type: 'array', items: { type: 'string', enum: [...CHANGE_TYPES] } },
|
|
310
|
+
changeStatuses: { type: 'array', items: { type: 'string', enum: [...CHANGE_STATUSES] } },
|
|
311
|
+
containUnavailable: { type: 'boolean', description: '是否包含离职人员,默认 true。注意:2026-09-04 实测该字段对服务端无效(true/false 均返回相同 total),已透传但被忽略,不要依赖它过滤离职人员' },
|
|
312
|
+
containPartTimeJob: { type: 'boolean' },
|
|
313
|
+
...pageSchema,
|
|
314
|
+
}),
|
|
315
|
+
handler: async (args, { host }) => {
|
|
316
|
+
// 变更日期必须用两个独立字段传起止,传 changeDate 数组格式实测无效。
|
|
317
|
+
assertDateRange(args, 'changeDateStart', 'changeDateEnd');
|
|
318
|
+
const body = {
|
|
319
|
+
...pickDefined(args, [
|
|
320
|
+
'userName',
|
|
321
|
+
'jobNum',
|
|
322
|
+
'keySearch',
|
|
323
|
+
'changeDateStart',
|
|
324
|
+
'changeDateEnd',
|
|
325
|
+
'changeType',
|
|
326
|
+
'changeStatuses',
|
|
327
|
+
'containUnavailable',
|
|
328
|
+
'containPartTimeJob',
|
|
329
|
+
]),
|
|
330
|
+
};
|
|
331
|
+
const current = toPositiveInt(args.current, 'current');
|
|
332
|
+
const pageSize = toNumber(args.pageSize, 'pageSize');
|
|
333
|
+
if (current !== undefined)
|
|
334
|
+
body.current = current;
|
|
335
|
+
if (pageSize !== undefined)
|
|
336
|
+
body.pageSize = pageSize;
|
|
337
|
+
if (args.resourceId !== undefined)
|
|
338
|
+
body.resourceId = Number(args.resourceId);
|
|
339
|
+
for (const key of ['department', 'position', 'resource']) {
|
|
340
|
+
const list = toIdList(args[key], key);
|
|
341
|
+
if (list?.length)
|
|
342
|
+
body[key] = list;
|
|
343
|
+
}
|
|
344
|
+
const response = await host.request({
|
|
345
|
+
method: 'POST',
|
|
346
|
+
path: '/api/bs/hrm/empchange/getTable',
|
|
347
|
+
body: compact(body),
|
|
348
|
+
});
|
|
349
|
+
const { data, page } = normalizePaged(response);
|
|
350
|
+
return ehrSuccess('ehr.hr.empchange.list', data, { page });
|
|
351
|
+
},
|
|
352
|
+
};
|
|
353
|
+
export const hrContactOperations = [
|
|
354
|
+
contactFields,
|
|
355
|
+
contactSa,
|
|
356
|
+
contactSearch,
|
|
357
|
+
contactCount,
|
|
358
|
+
browserComplete,
|
|
359
|
+
birthdayConditions,
|
|
360
|
+
birthdayList,
|
|
361
|
+
empchangeConditions,
|
|
362
|
+
empchangeList,
|
|
363
|
+
];
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { ehrValidationError } from '../errors.js';
|
|
2
|
+
import { READ, SCHEMA_ID, ehrSuccess, schemaOf, } from './types.js';
|
|
3
|
+
import { assertEnum, compact, normalizePaged, toNumber, toPositiveInt } from './shared.js';
|
|
4
|
+
/**
|
|
5
|
+
* 聚才林数据源(HR 报表)固定 formId 对照表。
|
|
6
|
+
* 文档明确:formId 固定、不区分租户,groupId 恒为 weaver-hr-service。
|
|
7
|
+
*/
|
|
8
|
+
export const HR_DATA_SOURCE_IDS = {
|
|
9
|
+
// 历史时点(必填 timePoint,eq)
|
|
10
|
+
tp: '754217732232708651',
|
|
11
|
+
// 编制
|
|
12
|
+
estCalc: '754217732232708751',
|
|
13
|
+
estDcCalc: '754217732232709056',
|
|
14
|
+
// 基本状况分析
|
|
15
|
+
basicAge: '754217732232708200',
|
|
16
|
+
basicSex: '754217732232708188',
|
|
17
|
+
basicWorkYear: '754217732232708201',
|
|
18
|
+
basicEdu: '754217732232708202',
|
|
19
|
+
basicMarry: '754217732232708203',
|
|
20
|
+
basicJobCall: '754217732232708204',
|
|
21
|
+
basicJobLevel: '754217732232708205',
|
|
22
|
+
basicStatus: '754217732232708207',
|
|
23
|
+
basicSecLevel: '754217732232708208',
|
|
24
|
+
// 流失统计
|
|
25
|
+
changeLossPersonCount: '754217732232708374',
|
|
26
|
+
changeLossDeptCount: '754217732232708375',
|
|
27
|
+
changeLossPer: '754217732232708376',
|
|
28
|
+
changeDismissPersonCount: '754217732232708378',
|
|
29
|
+
changeDismissDeptCount: '754217732232708379',
|
|
30
|
+
changeDismissPer: '754217732232708380',
|
|
31
|
+
changeQuitPersonCount: '754217732232708382',
|
|
32
|
+
changeQuitDeptCount: '754217732232708383',
|
|
33
|
+
changeQuitPer: '754217732232708384',
|
|
34
|
+
changeRetirePersonCount: '754217732232708386',
|
|
35
|
+
changeRetireDeptCount: '754217732232708387',
|
|
36
|
+
changeRetirePer: '754217732232708388',
|
|
37
|
+
// 部门人数
|
|
38
|
+
deptPanelDeptCount: '754217732232708426',
|
|
39
|
+
deptPanelPersonCount: '754217732232708427',
|
|
40
|
+
deptPanelMaxPersonCount: '754217732232708428',
|
|
41
|
+
deptPanelMinPersonCount: '754217732232708429',
|
|
42
|
+
// 离职名册(过滤字段 dismissDate 可选)
|
|
43
|
+
dismiss: '754217732232708654',
|
|
44
|
+
// 历史曾在职(必填 dutyDate)
|
|
45
|
+
hw: '754217732232708653',
|
|
46
|
+
// 职务状况
|
|
47
|
+
jobPanelPersonCount: '754217732232708445',
|
|
48
|
+
jobPanelJobTypeCount: '754217732232708446',
|
|
49
|
+
jobPanelJobCount: '754217732232708447',
|
|
50
|
+
// 岗位人数
|
|
51
|
+
posiPanelPosiCount: '754217732232708440',
|
|
52
|
+
posiPanelPersonCount: '754217732232708441',
|
|
53
|
+
posiPanelMaxPersonCount: '754217732232708442',
|
|
54
|
+
posiPanelMinPersonCount: '754217732232708443',
|
|
55
|
+
// 人员流动分析(必填 dateRange)
|
|
56
|
+
turn: '754217732232708655',
|
|
57
|
+
// 人员情况合计(必填 month)
|
|
58
|
+
v2DeptEmpMove: '754217732232709010',
|
|
59
|
+
};
|
|
60
|
+
const HR_GROUP_ID = 'weaver-hr-service';
|
|
61
|
+
/**
|
|
62
|
+
* 数据源条件操作符白名单。不同字段支持的操作符不同,以 ehr.hr.ds.fields 返回的
|
|
63
|
+
* conditionType 为准;此处只做兜底,避免误拦截(真正决定成败的是传法,见下)。
|
|
64
|
+
*
|
|
65
|
+
* 两类易混操作符在源资料中都存在,必须都保留:
|
|
66
|
+
* - `gtAndEq` / `ltAndEq`:见 tp(历史时点)文档
|
|
67
|
+
* - `gte` / `lte`:见 hw / turn / v2DeptEmpMove / dismiss 文档
|
|
68
|
+
*
|
|
69
|
+
* 日期范围条件的正确传法(2026-09-04 依源资料修正,此前判错):
|
|
70
|
+
* hw 的 dutyDate、turn 的 dateRange、v2DeptEmpMove 的 month、dismiss 的 dismissDate
|
|
71
|
+
* **必须拆成 2 个条件**——`gte` 起 + `lte` 止,引擎取前 2 个 conditionValue 作为起止日期。
|
|
72
|
+
* 用单个 between 传 "起,止" 会报 500「日期范围过滤条件错误」。
|
|
73
|
+
* 只有 tp 的 timePoint 是单条件,用 `eq`。
|
|
74
|
+
*/
|
|
75
|
+
const COMPARE_TYPES = [
|
|
76
|
+
'eq',
|
|
77
|
+
'in',
|
|
78
|
+
'like',
|
|
79
|
+
'gtAndEq',
|
|
80
|
+
'ltAndEq',
|
|
81
|
+
'gte',
|
|
82
|
+
'lte',
|
|
83
|
+
'between',
|
|
84
|
+
];
|
|
85
|
+
const PERMISSION_TYPE_KEYS = [
|
|
86
|
+
'hiredate',
|
|
87
|
+
'location',
|
|
88
|
+
'personnelStatus',
|
|
89
|
+
'subcompany',
|
|
90
|
+
'department',
|
|
91
|
+
'baseAgeSplit',
|
|
92
|
+
'baseWorkYearSplit',
|
|
93
|
+
];
|
|
94
|
+
function buildPermissionType(value) {
|
|
95
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
96
|
+
return undefined;
|
|
97
|
+
const raw = value;
|
|
98
|
+
if (Object.keys(raw).length === 0)
|
|
99
|
+
return undefined;
|
|
100
|
+
const payload = {
|
|
101
|
+
hiredate: Array.isArray(raw.hiredate) ? raw.hiredate : [],
|
|
102
|
+
location: Array.isArray(raw.location) ? raw.location.map(String) : [],
|
|
103
|
+
// personnelStatus 未提供时按 normal(在职)处理,这是报表类的默认语义。
|
|
104
|
+
personnelStatus: Array.isArray(raw.personnelStatus) ? raw.personnelStatus : ['normal'],
|
|
105
|
+
subcompany: Array.isArray(raw.subcompany) ? raw.subcompany.map(String) : [],
|
|
106
|
+
department: Array.isArray(raw.department) ? raw.department.map(String) : [],
|
|
107
|
+
};
|
|
108
|
+
if (raw.baseAgeSplit !== undefined)
|
|
109
|
+
payload.baseAgeSplit = String(raw.baseAgeSplit);
|
|
110
|
+
if (raw.baseWorkYearSplit !== undefined)
|
|
111
|
+
payload.baseWorkYearSplit = String(raw.baseWorkYearSplit);
|
|
112
|
+
return JSON.stringify(payload);
|
|
113
|
+
}
|
|
114
|
+
function buildQueryFields(formId, fields) {
|
|
115
|
+
if (!Array.isArray(fields) || fields.length === 0)
|
|
116
|
+
return undefined;
|
|
117
|
+
return fields.map((name, index) => ({
|
|
118
|
+
objId: formId,
|
|
119
|
+
fieldId: String(name),
|
|
120
|
+
fieldName: String(name),
|
|
121
|
+
...(index === 0 ? { mainPrimaryKey: true } : {}),
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
function buildConditionTrees(conditions) {
|
|
125
|
+
if (!Array.isArray(conditions) || conditions.length === 0)
|
|
126
|
+
return undefined;
|
|
127
|
+
return {
|
|
128
|
+
isParent: true,
|
|
129
|
+
relationship: '1',
|
|
130
|
+
conditionList: conditions.map((item, index) => {
|
|
131
|
+
if (!item || typeof item !== 'object' || Array.isArray(item)) {
|
|
132
|
+
throw ehrValidationError('condition_invalid', `conditions[${index}] 必须是对象`);
|
|
133
|
+
}
|
|
134
|
+
const record = item;
|
|
135
|
+
if (!record.field) {
|
|
136
|
+
throw ehrValidationError('condition_invalid', `conditions[${index}].field 必填`);
|
|
137
|
+
}
|
|
138
|
+
return {
|
|
139
|
+
isParent: false,
|
|
140
|
+
conditionId: String(record.field),
|
|
141
|
+
conditionValue: String(record.value ?? ''),
|
|
142
|
+
compareType: assertEnum(record.compareType, COMPARE_TYPES, `conditions[${index}].compareType`),
|
|
143
|
+
};
|
|
144
|
+
}),
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
const dsQueryProperties = {
|
|
148
|
+
formId: { oneOf: [{ type: 'string', minLength: 1 }, { type: 'integer' }], description: '数据源 formId,见 schema 中的 dataSourceIds' },
|
|
149
|
+
conditions: {
|
|
150
|
+
type: 'array',
|
|
151
|
+
description: '条件列表。日期范围条件必须拆成 2 项:{field,value:起始,compareType:"gte"} + {field,value:截止,compareType:"lte"};不要用单个 between 传 "起,止"。可用操作符以 ehr.hr.ds.fields 返回的 conditionType 为准',
|
|
152
|
+
items: {
|
|
153
|
+
type: 'object',
|
|
154
|
+
additionalProperties: false,
|
|
155
|
+
properties: {
|
|
156
|
+
field: { type: 'string', minLength: 1, description: '字段 name,来自 ds.fields' },
|
|
157
|
+
value: { oneOf: [{ type: 'string' }, { type: 'number' }, { type: 'boolean' }], description: '条件值;日期范围 gte 传起始、lte 传截止' },
|
|
158
|
+
compareType: { type: 'string', enum: [...COMPARE_TYPES] },
|
|
159
|
+
},
|
|
160
|
+
required: ['field', 'value', 'compareType'],
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
queryFields: { type: 'array', items: { type: 'string' }, description: '查询字段 name 列表,来自 ds.fields' },
|
|
164
|
+
permissionType: {
|
|
165
|
+
type: 'object',
|
|
166
|
+
additionalProperties: false,
|
|
167
|
+
description: '人员范围过滤,JSON 字符串化后内嵌到 queryDto',
|
|
168
|
+
properties: {
|
|
169
|
+
hiredate: { type: 'array', items: { type: 'string' }, minItems: 2, maxItems: 2 },
|
|
170
|
+
location: { type: 'array', items: { type: 'string' } },
|
|
171
|
+
personnelStatus: { type: 'array', items: { type: 'string' }, description: '默认 ["normal"];["all"] 不限状态' },
|
|
172
|
+
subcompany: { type: 'array', items: { type: 'string' } },
|
|
173
|
+
department: { type: 'array', items: { type: 'string' } },
|
|
174
|
+
baseAgeSplit: { type: 'string' },
|
|
175
|
+
baseWorkYearSplit: { type: 'string' },
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
pageNo: SCHEMA_ID,
|
|
179
|
+
pageSize: SCHEMA_ID,
|
|
180
|
+
queryCount: { type: 'boolean' },
|
|
181
|
+
rawQueryDto: {
|
|
182
|
+
type: 'object',
|
|
183
|
+
description: '逃生舱:直接传完整 queryDto 对象,将覆盖上面的结构化构造结果',
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
function buildQueryDto(args, queryType) {
|
|
187
|
+
if (args.formId === undefined || args.formId === null || args.formId === '') {
|
|
188
|
+
throw ehrValidationError('form_id_required', 'formId 必填');
|
|
189
|
+
}
|
|
190
|
+
const formId = String(args.formId);
|
|
191
|
+
if (args.rawQueryDto && typeof args.rawQueryDto === 'object' && !Array.isArray(args.rawQueryDto)) {
|
|
192
|
+
return { ...args.rawQueryDto, tableId: formId, groupId: HR_GROUP_ID };
|
|
193
|
+
}
|
|
194
|
+
const queryDto = {
|
|
195
|
+
tableId: formId,
|
|
196
|
+
groupId: HR_GROUP_ID,
|
|
197
|
+
queryType,
|
|
198
|
+
pageNo: toPositiveInt(args.pageNo, 'pageNo') ?? 1,
|
|
199
|
+
pageSize: toNumber(args.pageSize, 'pageSize') ?? 100,
|
|
200
|
+
queryCount: args.queryCount !== false,
|
|
201
|
+
};
|
|
202
|
+
const conditionTrees = buildConditionTrees(args.conditions);
|
|
203
|
+
if (conditionTrees)
|
|
204
|
+
queryDto.conditionTrees = conditionTrees;
|
|
205
|
+
const queryFields = buildQueryFields(formId, args.queryFields);
|
|
206
|
+
if (queryFields)
|
|
207
|
+
queryDto.queryFields = queryFields;
|
|
208
|
+
const permissionType = buildPermissionType(args.permissionType);
|
|
209
|
+
if (permissionType)
|
|
210
|
+
queryDto.permissionType = permissionType;
|
|
211
|
+
return queryDto;
|
|
212
|
+
}
|
|
213
|
+
const dsFields = {
|
|
214
|
+
name: 'ehr.hr.ds.fields',
|
|
215
|
+
resource: 'hr',
|
|
216
|
+
method: 'ds.fields',
|
|
217
|
+
action: 'ehr.hr.ds.fields',
|
|
218
|
+
summary: '获取 HR 数据源的字段结构(哪些字段可作查询条件、支持的操作符),是构造 ds.list/ds.count/ds.chart 的唯一依据',
|
|
219
|
+
capability: 'hr',
|
|
220
|
+
risk: READ,
|
|
221
|
+
inputSchema: schemaOf({ formId: { oneOf: [{ type: 'string', minLength: 1 }, { type: 'integer' }] } }, { required: ['formId'] }),
|
|
222
|
+
handler: async (args, { host }) => {
|
|
223
|
+
if (args.formId === undefined || args.formId === null || args.formId === '') {
|
|
224
|
+
throw ehrValidationError('form_id_required', 'formId 必填');
|
|
225
|
+
}
|
|
226
|
+
// 数据源接口全部是 form-urlencoded 提交,不是 JSON body。
|
|
227
|
+
const response = await host.request({
|
|
228
|
+
method: 'POST',
|
|
229
|
+
path: '/api/bs/hr/ds/fields',
|
|
230
|
+
form: {
|
|
231
|
+
sourceType: 'LOGIC',
|
|
232
|
+
sourceId: String(args.formId),
|
|
233
|
+
groupId: HR_GROUP_ID,
|
|
234
|
+
},
|
|
235
|
+
});
|
|
236
|
+
return ehrSuccess('ehr.hr.ds.fields', normalizePaged(response).data);
|
|
237
|
+
},
|
|
238
|
+
};
|
|
239
|
+
const dsList = {
|
|
240
|
+
name: 'ehr.hr.ds.list',
|
|
241
|
+
resource: 'hr',
|
|
242
|
+
method: 'ds.list',
|
|
243
|
+
action: 'ehr.hr.ds.list',
|
|
244
|
+
summary: '查询 HR 数据源列表数据(历史时点名册、离职名册、历史曾在职、编制、流动分析、人员情况合计等)',
|
|
245
|
+
capability: 'hr',
|
|
246
|
+
risk: READ,
|
|
247
|
+
inputSchema: schemaOf({ ...dsQueryProperties }, { required: ['formId'] }),
|
|
248
|
+
handler: async (args, { host }) => {
|
|
249
|
+
const response = await host.request({
|
|
250
|
+
method: 'POST',
|
|
251
|
+
// /api/bs/hr/ds/getListData 已废弃 404,必须走 /ai/ 路径。
|
|
252
|
+
path: '/api/bs/hr/ai/ds/getListData',
|
|
253
|
+
form: { sourceType: 'LOGIC', queryDto: buildQueryDto(args, 'list') },
|
|
254
|
+
});
|
|
255
|
+
const { data, page } = normalizePaged(response);
|
|
256
|
+
return ehrSuccess('ehr.hr.ds.list', data, { page });
|
|
257
|
+
},
|
|
258
|
+
};
|
|
259
|
+
const dsCount = {
|
|
260
|
+
name: 'ehr.hr.ds.count',
|
|
261
|
+
resource: 'hr',
|
|
262
|
+
method: 'ds.count',
|
|
263
|
+
action: 'ehr.hr.ds.count',
|
|
264
|
+
summary: '查询 HR 数据源数量统计,返回 totalCount/totalPage/pageSize/tableId(不是 count 字段)',
|
|
265
|
+
capability: 'hr',
|
|
266
|
+
risk: READ,
|
|
267
|
+
inputSchema: schemaOf({ ...dsQueryProperties }, { required: ['formId'] }),
|
|
268
|
+
handler: async (args, { host }) => {
|
|
269
|
+
const response = await host.request({
|
|
270
|
+
method: 'POST',
|
|
271
|
+
path: '/api/bs/hr/ai/ds/getCountData',
|
|
272
|
+
form: { sourceType: 'LOGIC', queryDto: buildQueryDto(args, 'count') },
|
|
273
|
+
});
|
|
274
|
+
const { data, page } = normalizePaged(response);
|
|
275
|
+
return ehrSuccess('ehr.hr.ds.count', data, { page });
|
|
276
|
+
},
|
|
277
|
+
};
|
|
278
|
+
const dsChart = {
|
|
279
|
+
name: 'ehr.hr.ds.chart',
|
|
280
|
+
resource: 'hr',
|
|
281
|
+
method: 'ds.chart',
|
|
282
|
+
action: 'ehr.hr.ds.chart',
|
|
283
|
+
summary: '查询 HR 数据源图表分布数据(基本状况分析:年龄/性别/工龄/学历/婚姻/职称/职级/状态/安全级别)',
|
|
284
|
+
capability: 'hr',
|
|
285
|
+
risk: READ,
|
|
286
|
+
inputSchema: schemaOf({ ...dsQueryProperties }, { required: ['formId'] }),
|
|
287
|
+
handler: async (args, { host }) => {
|
|
288
|
+
const response = await host.request({
|
|
289
|
+
method: 'POST',
|
|
290
|
+
path: '/api/bs/hr/ai/ds/getChartData',
|
|
291
|
+
form: { sourceType: 'LOGIC', queryDto: buildQueryDto(args, 'chart') },
|
|
292
|
+
});
|
|
293
|
+
const { data, page } = normalizePaged(response);
|
|
294
|
+
return ehrSuccess('ehr.hr.ds.chart', data, { page });
|
|
295
|
+
},
|
|
296
|
+
};
|
|
297
|
+
export const hrDataSourceOperations = [dsFields, dsList, dsCount, dsChart];
|
|
298
|
+
export { compact, PERMISSION_TYPE_KEYS };
|