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,123 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
|
|
3
|
+
import { createMeetingContinuationSigner } from './continuation.js';
|
|
4
|
+
import { createMeetingHost } from './host.js';
|
|
5
|
+
import { meetingManifest } from './manifest.js';
|
|
6
|
+
import { executeMeetingOperation } from './operations.js';
|
|
7
|
+
import { meetingValidationError } from './errors.js';
|
|
8
|
+
function asOptions(value) {
|
|
9
|
+
return value && typeof value === 'object' && !Array.isArray(value) ? value : {};
|
|
10
|
+
}
|
|
11
|
+
async function readStdin() {
|
|
12
|
+
const chunks = [];
|
|
13
|
+
for await (const chunk of process.stdin) {
|
|
14
|
+
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
15
|
+
}
|
|
16
|
+
return Buffer.concat(chunks).toString('utf8');
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Windows PowerShell 的管道与 Set-Content -Encoding utf8 会在内容前写入 UTF-8 BOM,
|
|
20
|
+
* 且可能重复写入多次;JSON.parse 不接受前导 BOM,必须先剥离。
|
|
21
|
+
*/
|
|
22
|
+
function stripBom(value) {
|
|
23
|
+
return value.replace(/^\uFEFF+/, '');
|
|
24
|
+
}
|
|
25
|
+
export async function inputFrom(options, extra = {}) {
|
|
26
|
+
const opts = asOptions(options);
|
|
27
|
+
let input = {};
|
|
28
|
+
if (opts.input && opts.inputJson) {
|
|
29
|
+
throw meetingValidationError('input_conflict', '不能同时传 --input 和 --input-json');
|
|
30
|
+
}
|
|
31
|
+
if (opts.inputJson) {
|
|
32
|
+
input = parseJsonInput(String(opts.inputJson), '--input-json');
|
|
33
|
+
}
|
|
34
|
+
if (opts.input) {
|
|
35
|
+
let raw;
|
|
36
|
+
try {
|
|
37
|
+
raw = stripBom(opts.input === '-' ? await readStdin() : await readFile(String(opts.input), 'utf8'));
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
throw meetingValidationError('input_unreadable', `无法读取 --input:${String(opts.input)}`);
|
|
41
|
+
}
|
|
42
|
+
input = parseJsonInput(raw, '--input');
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
...input,
|
|
46
|
+
...Object.fromEntries(Object.entries(extra).filter(([, value]) => value !== undefined && value !== '')),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function parseJsonInput(raw, label) {
|
|
50
|
+
try {
|
|
51
|
+
const parsed = JSON.parse(stripBom(raw));
|
|
52
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
53
|
+
throw new Error('input must be an object');
|
|
54
|
+
}
|
|
55
|
+
return parsed;
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
throw meetingValidationError('input_invalid', `${label} 不是合法 JSON 对象`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
export function successEnvelope(operation, result) {
|
|
62
|
+
return {
|
|
63
|
+
schemaVersion: 1,
|
|
64
|
+
ok: true,
|
|
65
|
+
operation,
|
|
66
|
+
data: result.data === undefined ? null : result.data,
|
|
67
|
+
...(result.meta ? { meta: result.meta } : {}),
|
|
68
|
+
...(result.warnings && result.warnings.length > 0 ? { warnings: result.warnings } : { warnings: [] }),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function failureEnvelope(error) {
|
|
72
|
+
const structured = error;
|
|
73
|
+
return {
|
|
74
|
+
schemaVersion: 1,
|
|
75
|
+
ok: false,
|
|
76
|
+
...(structured?.partialData === undefined ? {} : { data: structured.partialData }),
|
|
77
|
+
error: toErrorEnvelope(error),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
async function executeAndPrint(ctx, operation, input) {
|
|
81
|
+
try {
|
|
82
|
+
const result = await executeMeetingOperation(operation, input, {
|
|
83
|
+
ctx,
|
|
84
|
+
host: createMeetingHost(ctx),
|
|
85
|
+
continuation: createMeetingContinuationSigner(ctx),
|
|
86
|
+
});
|
|
87
|
+
ctx.output.write(successEnvelope(operation, result), { json: true });
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
console.error(JSON.stringify(failureEnvelope(error), null, 2));
|
|
91
|
+
process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
export const meetingShortcut = {
|
|
95
|
+
name: 'meeting',
|
|
96
|
+
description: '泛微E10会议管理 CLI(标准版:查询/冲突/预约/回执/签到)',
|
|
97
|
+
category: 'shortcut',
|
|
98
|
+
register({ program, action }) {
|
|
99
|
+
const meeting = program.command('meeting').description('泛微E10会议管理(模式探测/会议列表/会议室/类型/冲突检测/预约/回执/签到)');
|
|
100
|
+
meeting.command('schema')
|
|
101
|
+
.description('Print meeting operation manifest for agents')
|
|
102
|
+
.action(action((ctx) => {
|
|
103
|
+
ctx.output.write(meetingManifest, { json: true });
|
|
104
|
+
}));
|
|
105
|
+
meeting.command('run')
|
|
106
|
+
.description('Run a meeting operation with JSON input')
|
|
107
|
+
.argument('<operation>', 'operation name, e.g. meeting.room.list')
|
|
108
|
+
.option('--input <path>', 'JSON input file, or - for stdin')
|
|
109
|
+
.option('--input-json <json>', 'inline JSON input object')
|
|
110
|
+
.action(action(async (ctx, operation, options) => {
|
|
111
|
+
await executeAndPrint(ctx, String(operation), await inputFrom(options));
|
|
112
|
+
}));
|
|
113
|
+
// 高频便捷命令(薄包装,最终调用同一 operation 执行器)
|
|
114
|
+
meeting.command('today')
|
|
115
|
+
.description('查询今天的会议(meeting.list 薄包装)')
|
|
116
|
+
.action(action(async (ctx) => {
|
|
117
|
+
const today = new Date();
|
|
118
|
+
const pad = (value) => String(value).padStart(2, '0');
|
|
119
|
+
const date = `${today.getFullYear()}-${pad(today.getMonth() + 1)}-${pad(today.getDate())}`;
|
|
120
|
+
await executeAndPrint(ctx, 'meeting.list', { filterDate: date });
|
|
121
|
+
}));
|
|
122
|
+
},
|
|
123
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { meetingOperationDefinitions } from './operations/registry.js';
|
|
2
|
+
/**
|
|
3
|
+
* 未实现能力(禁用边界,不得编造或绕过):
|
|
4
|
+
* - EB 版业务链路(query_mtDetail_list / create_meeting / 三件套 / 议题 / 纪要 / 报表):
|
|
5
|
+
* 依赖 eBuilder formdata 动态字段与工作流集成,未随 v1 实现。
|
|
6
|
+
* - 周期会议走工作流(repeatWorkFlowBaseIds 非空)与 onlyFlowCreate=1 的流程建会:
|
|
7
|
+
* 需要 workflow 集成,create.prepare 会主动拒绝并提示。
|
|
8
|
+
* - 提前结束会议(meeting.over):服务端为空实现(假成功),CLI 不提供。
|
|
9
|
+
* - 签到二维码(getQrCode 入参契约未确认)、签到写操作(signMeeting 等)、
|
|
10
|
+
* 会议室/会议类型管理(add/update/delete/lock/详情):待后续版本评估。
|
|
11
|
+
*
|
|
12
|
+
* 已实现的生命周期写操作:meeting.change(变更:按会议状态自动选 operateType,
|
|
13
|
+
* 草稿=UPDATE / 正常=CHANGE)、meeting.cancel(取消)、meeting.delete(彻底删除),
|
|
14
|
+
* 均走 prepare→apply 确认链。权限由服务端按会议状态判定并返回原文提示,CLI 原样透传。
|
|
15
|
+
*/
|
|
16
|
+
const WITHHELD = [
|
|
17
|
+
{
|
|
18
|
+
name: 'meeting.eb.*',
|
|
19
|
+
reason: 'EB 版业务链路依赖 eBuilder formdata 动态字段结构与工作流集成,v1 未实现;请使用 EB 版独立流程或后续版本。',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'meeting.create.workflow',
|
|
23
|
+
reason: 'onlyFlowCreate=1 或周期会议配置工作流时必须走流程建会;CLI v1 未集成工作流发起,create.prepare 会主动拒绝。',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'meeting.over',
|
|
27
|
+
reason: '服务端提前结束会议(overMeeting)为空实现:MeetingDetailController.overMeetingDetail 中 service 调用被注释,接口直接返回成功但不生效;CLI 不提供该能力,禁止绕过(调用只会得到“假成功”)。',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'meeting.sign.qrcode',
|
|
31
|
+
reason: '签到二维码接口(getQrCode)入参契约未在源资料中确认,未实现,不得猜测参数。',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'meeting.sign.submit',
|
|
35
|
+
reason: '签到写操作(signMeeting 等)未实现,不得绕过确认链直接调用。',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'meeting.room.admin / meeting.type.admin',
|
|
39
|
+
reason: '会议室/会议类型管理(add/update/delete/lock/详情)未实现,待后续版本评估。',
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
function buildOperations() {
|
|
43
|
+
return meetingOperationDefinitions().map((definition) => ({
|
|
44
|
+
name: definition.name,
|
|
45
|
+
resource: definition.resource,
|
|
46
|
+
summary: definition.summary,
|
|
47
|
+
capability: definition.capability,
|
|
48
|
+
risk: definition.risk,
|
|
49
|
+
...(definition.requiresConfirmation ? { requiresConfirmation: true } : {}),
|
|
50
|
+
inputSchema: definition.inputSchema,
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
export const meetingManifest = {
|
|
54
|
+
schemaVersion: 1,
|
|
55
|
+
name: 'meeting',
|
|
56
|
+
title: '泛微E10会议管理(标准版:查询/冲突/预约/取消/回执/签到)',
|
|
57
|
+
version: '1.0.0',
|
|
58
|
+
host: 'e10-meeting',
|
|
59
|
+
status: 'builtin',
|
|
60
|
+
sourceSkill: 'weaver-e10-meeting',
|
|
61
|
+
capabilities: ['env', 'meeting', 'room', 'type', 'conflict', 'lifecycle', 'receipt', 'sign'],
|
|
62
|
+
operations: buildOperations(),
|
|
63
|
+
withheldOperations: WITHHELD,
|
|
64
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { meetingSuccess } from './types.js';
|
|
2
|
+
import { extractRows } from './shared.js';
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
// 会议类型列表(mt_type browser 组件;总数走 count 接口)
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
const meetingTypeList = {
|
|
7
|
+
name: 'meeting.type.list',
|
|
8
|
+
resource: 'type',
|
|
9
|
+
method: 'type.list',
|
|
10
|
+
action: 'meeting.type.list',
|
|
11
|
+
summary: '查询会议类型列表(mt_type browser 组件,权限友好;includeCount=true 时再调 count/mt_type 取总数)',
|
|
12
|
+
capability: 'type',
|
|
13
|
+
risk: 'read',
|
|
14
|
+
inputSchema: {
|
|
15
|
+
type: 'object',
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
properties: {
|
|
18
|
+
name: { type: 'string', description: '按类型名称过滤' },
|
|
19
|
+
current: { type: 'integer', description: '页码,默认 1' },
|
|
20
|
+
pageSize: { type: 'integer', description: '页大小,默认 100' },
|
|
21
|
+
includeCount: { type: 'boolean', description: '是否调用 count/mt_type 返回总数' },
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
handler: async (args, { host }) => {
|
|
25
|
+
const body = {
|
|
26
|
+
browserMultiple: false,
|
|
27
|
+
current: typeof args.current === 'number' && args.current > 0 ? args.current : 1,
|
|
28
|
+
pageSize: typeof args.pageSize === 'number' && args.pageSize > 0 ? args.pageSize : 100,
|
|
29
|
+
formDatas: typeof args.name === 'string' && args.name.trim()
|
|
30
|
+
? { name: [{ nameCondition: 'in', name: args.name.trim() }] }
|
|
31
|
+
: {},
|
|
32
|
+
quickSearchDatas: {},
|
|
33
|
+
type: 'and',
|
|
34
|
+
};
|
|
35
|
+
const response = await host.request({
|
|
36
|
+
method: 'POST',
|
|
37
|
+
path: '/api/meeting/common/browser/data/mt_type',
|
|
38
|
+
operation: 'meeting.type.list',
|
|
39
|
+
body,
|
|
40
|
+
});
|
|
41
|
+
const { rows } = extractRows(response);
|
|
42
|
+
let total;
|
|
43
|
+
if (args.includeCount === true) {
|
|
44
|
+
const countResponse = await host.request({
|
|
45
|
+
method: 'POST',
|
|
46
|
+
path: '/api/meeting/common/browser/count/mt_type',
|
|
47
|
+
operation: 'meeting.type.list',
|
|
48
|
+
body: { ...body, formDatas: typeof args.name === 'string' && args.name.trim() ? body.formDatas : {} },
|
|
49
|
+
});
|
|
50
|
+
total = countResponse?.data?.total;
|
|
51
|
+
}
|
|
52
|
+
return meetingSuccess('meeting.type.list', {
|
|
53
|
+
...(total !== undefined ? { total } : {}),
|
|
54
|
+
types: rows,
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
export const meetingCatalogOperations = [meetingTypeList];
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { meetingConfirmationError, meetingPartialError, meetingValidationError } from '../errors.js';
|
|
3
|
+
import { meetingSuccess, SCHEMA_DATETIME_MINUTE, SCHEMA_ID } from './types.js';
|
|
4
|
+
import { assertDateTimeMinute, extractRows, toIdCsv, toIdString } from './shared.js';
|
|
5
|
+
const CONTINUATION_TTL_SECONDS = 600;
|
|
6
|
+
const LIST_PATH = '/api/meeting/search/getMeetingList';
|
|
7
|
+
function fingerprint(value) {
|
|
8
|
+
return createHash('sha256').update(JSON.stringify(value ?? null)).digest('hex').slice(0, 32);
|
|
9
|
+
}
|
|
10
|
+
function requireConfirm(args, action) {
|
|
11
|
+
if (args.confirm !== true) {
|
|
12
|
+
throw meetingConfirmationError(action, { hint: '重新调用时传入 confirm=true 与 prepare 返回的 continuation' });
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
async function verifyLease(args, action, env) {
|
|
16
|
+
const lease = await env.continuation.verify(args.continuation, action);
|
|
17
|
+
const session = await env.host.getSession();
|
|
18
|
+
if (lease.baseUrl !== session.baseUrl || lease.profile !== session.profile || lease.userId !== session.userId) {
|
|
19
|
+
throw meetingValidationError('context_mismatch', '确认上下文已变化(租户或登录账号不同),请重新执行 prepare');
|
|
20
|
+
}
|
|
21
|
+
return lease;
|
|
22
|
+
}
|
|
23
|
+
function isNetworkError(error) {
|
|
24
|
+
return error instanceof Error && error.type === 'network';
|
|
25
|
+
}
|
|
26
|
+
/** 可变更的主表字段(与 MeetingDetailBean 对齐)。 */
|
|
27
|
+
const CHANGABLE_FIELDS = [
|
|
28
|
+
'name',
|
|
29
|
+
'beginDatetime',
|
|
30
|
+
'endDatetime',
|
|
31
|
+
'address',
|
|
32
|
+
'customizeAddress',
|
|
33
|
+
'mtType',
|
|
34
|
+
'hrmMembers',
|
|
35
|
+
'orgMembers',
|
|
36
|
+
'otherMembers',
|
|
37
|
+
'crmMembers',
|
|
38
|
+
'totalMember',
|
|
39
|
+
'caller',
|
|
40
|
+
'contacter',
|
|
41
|
+
];
|
|
42
|
+
const DATE_FIELDS = new Set(['beginDatetime', 'endDatetime']);
|
|
43
|
+
const ID_FIELDS = new Set(['address', 'mtType', 'caller', 'contacter']);
|
|
44
|
+
const CSV_FIELDS = new Set(['hrmMembers', 'orgMembers', 'crmMembers']);
|
|
45
|
+
/** 归一化变更输入:只提交调用方显式给出的字段。 */
|
|
46
|
+
export function normalizeChangeInput(args) {
|
|
47
|
+
const id = toIdString(args.id, 'id');
|
|
48
|
+
const body = { id };
|
|
49
|
+
for (const field of CHANGABLE_FIELDS) {
|
|
50
|
+
const value = args[field];
|
|
51
|
+
if (value === undefined)
|
|
52
|
+
continue;
|
|
53
|
+
if (DATE_FIELDS.has(field)) {
|
|
54
|
+
body[field] = assertDateTimeMinute(value, field);
|
|
55
|
+
}
|
|
56
|
+
else if (ID_FIELDS.has(field)) {
|
|
57
|
+
body[field] = toIdString(value, field);
|
|
58
|
+
}
|
|
59
|
+
else if (CSV_FIELDS.has(field)) {
|
|
60
|
+
const csv = toIdCsv(value, field);
|
|
61
|
+
if (csv !== undefined)
|
|
62
|
+
body[field] = csv;
|
|
63
|
+
}
|
|
64
|
+
else if (field === 'name') {
|
|
65
|
+
const name = typeof value === 'string' ? value.trim() : '';
|
|
66
|
+
if (!name)
|
|
67
|
+
throw meetingValidationError('name_invalid', 'name 不能为空字符串');
|
|
68
|
+
body[field] = name;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
body[field] = value;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (Object.keys(body).length <= 1) {
|
|
75
|
+
throw meetingValidationError('no_changes', '未提供任何要修改的字段:请至少提供 name / beginDatetime / endDatetime / address 等其中之一');
|
|
76
|
+
}
|
|
77
|
+
return body;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* 按会议当前状态确定 operateType。源码依据(MeetingBaseServiceUtils.getShowButtons):
|
|
81
|
+
* - mtStatus==0(草稿)→ 按钮 do_edit(编辑)→ operateMeetingByType(operateType=UPDATE)
|
|
82
|
+
* - mtStatus 正常(2/8/9,未结束)→ 按钮 do_change → operateMeetingByType(operateType=CHANGE)
|
|
83
|
+
* 实测列表字段:草稿会议 mtStatus="草稿"/status="0",正常会议 mtStatus="未开始"/status="notStart"。
|
|
84
|
+
*/
|
|
85
|
+
function isDraftRow(row) {
|
|
86
|
+
const text = `${row?.mtStatus ?? ''}`;
|
|
87
|
+
if (text.includes('草稿'))
|
|
88
|
+
return true;
|
|
89
|
+
return row?.status !== undefined && String(row?.status) === '0';
|
|
90
|
+
}
|
|
91
|
+
async function resolveOperateType(id, env, operation) {
|
|
92
|
+
const pageSize = 50;
|
|
93
|
+
for (let current = 1; current <= 10; current++) {
|
|
94
|
+
const response = await env.host.request({
|
|
95
|
+
method: 'POST',
|
|
96
|
+
path: LIST_PATH,
|
|
97
|
+
operation,
|
|
98
|
+
body: { current, pageSize },
|
|
99
|
+
});
|
|
100
|
+
const { rows, total } = extractRows(response);
|
|
101
|
+
const row = rows.find((item) => String(item?.id ?? '') === id);
|
|
102
|
+
if (row) {
|
|
103
|
+
return {
|
|
104
|
+
operateType: isDraftRow(row) ? 'UPDATE' : 'CHANGE',
|
|
105
|
+
mtStatus: `${row?.mtStatus ?? ''}`,
|
|
106
|
+
name: `${row?.name ?? ''}`,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
if (rows.length === 0 || (total !== undefined && current * pageSize >= total))
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
throw meetingValidationError('meeting_not_found', `未在会议列表中定位到会议 ${id}:请确认 id 正确且当前账号可见(草稿走 UPDATE、正常会议走 CHANGE,二者都要求会议在列表中可见)`);
|
|
113
|
+
}
|
|
114
|
+
const meetingChangePrepare = {
|
|
115
|
+
name: 'meeting.change.prepare',
|
|
116
|
+
resource: 'meeting',
|
|
117
|
+
method: 'change.prepare',
|
|
118
|
+
action: 'meeting.change.prepare',
|
|
119
|
+
summary: '准备会议变更(改期/改地点/改参会人):按会议状态自动选择 operateType(草稿=UPDATE、正常=CHANGE),生成确认预览,不写入',
|
|
120
|
+
capability: 'lifecycle',
|
|
121
|
+
risk: 'read-before-write',
|
|
122
|
+
requiresConfirmation: true,
|
|
123
|
+
inputSchema: {
|
|
124
|
+
type: 'object',
|
|
125
|
+
additionalProperties: false,
|
|
126
|
+
properties: {
|
|
127
|
+
id: { ...SCHEMA_ID, description: '会议 id(必填)' },
|
|
128
|
+
name: { type: 'string', minLength: 1, description: '会议名称' },
|
|
129
|
+
beginDatetime: { ...SCHEMA_DATETIME_MINUTE, description: '开始时间' },
|
|
130
|
+
endDatetime: { ...SCHEMA_DATETIME_MINUTE, description: '结束时间' },
|
|
131
|
+
address: { ...SCHEMA_ID, description: '会议室 id' },
|
|
132
|
+
customizeAddress: { type: 'string', description: '自定义地点' },
|
|
133
|
+
mtType: { ...SCHEMA_ID, description: '会议类型 id' },
|
|
134
|
+
hrmMembers: { type: 'string', description: '参会人员 id,逗号分隔字符串' },
|
|
135
|
+
orgMembers: { type: 'string', description: '参会部门 id,逗号分隔字符串' },
|
|
136
|
+
otherMembers: { type: 'string', description: '其他参会人员(文本)' },
|
|
137
|
+
crmMembers: { type: 'string', description: '参会客户 id,逗号分隔字符串' },
|
|
138
|
+
totalMember: { type: 'integer', description: '参会人数' },
|
|
139
|
+
caller: { ...SCHEMA_ID, description: '召集人 id' },
|
|
140
|
+
contacter: { ...SCHEMA_ID, description: '联系人 id' },
|
|
141
|
+
},
|
|
142
|
+
required: ['id'],
|
|
143
|
+
},
|
|
144
|
+
handler: async (args, env) => {
|
|
145
|
+
const body = normalizeChangeInput(args);
|
|
146
|
+
const id = String(body.id);
|
|
147
|
+
const { operateType, mtStatus, name } = await resolveOperateType(id, env, 'meeting.change.prepare');
|
|
148
|
+
const payload = { ...body, operateType };
|
|
149
|
+
const session = await env.host.getSession();
|
|
150
|
+
const token = await env.continuation.issue({
|
|
151
|
+
operation: 'meeting.change.apply',
|
|
152
|
+
baseUrl: session.baseUrl,
|
|
153
|
+
profile: session.profile,
|
|
154
|
+
userId: session.userId,
|
|
155
|
+
payload,
|
|
156
|
+
fingerprint: fingerprint(payload),
|
|
157
|
+
}, CONTINUATION_TTL_SECONDS * 1000);
|
|
158
|
+
return meetingSuccess('meeting.change.prepare', {
|
|
159
|
+
status: 'AWAITING_CONFIRMATION',
|
|
160
|
+
preview: {
|
|
161
|
+
id,
|
|
162
|
+
name,
|
|
163
|
+
currentStatus: mtStatus,
|
|
164
|
+
operateType,
|
|
165
|
+
operateTypeReason: operateType === 'UPDATE' ? '草稿会议走更新(UPDATE)' : '正常会议走变更(CHANGE)',
|
|
166
|
+
changedFields: Object.keys(body).filter((key) => key !== 'id'),
|
|
167
|
+
body: payload,
|
|
168
|
+
note: '本 operation 只提交上面列出的字段;权限由服务端按会议状态判定,若无权限会返回“您没有变更权限!”等原文提示,请原样转达用户。',
|
|
169
|
+
},
|
|
170
|
+
continuation: token,
|
|
171
|
+
expiresInSeconds: CONTINUATION_TTL_SECONDS,
|
|
172
|
+
});
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
const meetingChangeApply = {
|
|
176
|
+
name: 'meeting.change.apply',
|
|
177
|
+
resource: 'meeting',
|
|
178
|
+
method: 'change.apply',
|
|
179
|
+
action: 'meeting.change.apply',
|
|
180
|
+
summary: '提交会议变更(operateMeetingByType,草稿 UPDATE / 正常 CHANGE,body 传参);必须在用户明确确认后调用',
|
|
181
|
+
capability: 'lifecycle',
|
|
182
|
+
risk: 'high-risk-write',
|
|
183
|
+
requiresConfirmation: true,
|
|
184
|
+
inputSchema: {
|
|
185
|
+
type: 'object',
|
|
186
|
+
additionalProperties: false,
|
|
187
|
+
properties: {
|
|
188
|
+
confirm: { const: true },
|
|
189
|
+
continuation: { type: 'string', minLength: 1 },
|
|
190
|
+
id: SCHEMA_ID,
|
|
191
|
+
name: { type: 'string' },
|
|
192
|
+
beginDatetime: SCHEMA_DATETIME_MINUTE,
|
|
193
|
+
endDatetime: SCHEMA_DATETIME_MINUTE,
|
|
194
|
+
address: SCHEMA_ID,
|
|
195
|
+
customizeAddress: { type: 'string' },
|
|
196
|
+
mtType: SCHEMA_ID,
|
|
197
|
+
hrmMembers: { type: 'string' },
|
|
198
|
+
orgMembers: { type: 'string' },
|
|
199
|
+
otherMembers: { type: 'string' },
|
|
200
|
+
crmMembers: { type: 'string' },
|
|
201
|
+
totalMember: { type: 'integer' },
|
|
202
|
+
caller: SCHEMA_ID,
|
|
203
|
+
contacter: SCHEMA_ID,
|
|
204
|
+
},
|
|
205
|
+
required: ['confirm', 'continuation', 'id'],
|
|
206
|
+
},
|
|
207
|
+
handler: async (args, env) => {
|
|
208
|
+
requireConfirm(args, 'meeting.change.apply');
|
|
209
|
+
const lease = await verifyLease(args, 'meeting.change.apply', env);
|
|
210
|
+
const body = normalizeChangeInput(args);
|
|
211
|
+
const id = String(body.id);
|
|
212
|
+
const { operateType, mtStatus } = await resolveOperateType(id, env, 'meeting.change.apply');
|
|
213
|
+
const leaseOperateType = lease.payload?.operateType;
|
|
214
|
+
if (leaseOperateType && leaseOperateType !== operateType) {
|
|
215
|
+
throw meetingValidationError('target_changed', `会议状态已变化(prepare 时按 ${leaseOperateType}、当前按 ${operateType},当前状态:${mtStatus}),请重新执行 prepare 并向用户确认`);
|
|
216
|
+
}
|
|
217
|
+
const payload = { ...body, operateType };
|
|
218
|
+
if (lease.fingerprint !== fingerprint(payload)) {
|
|
219
|
+
throw meetingValidationError('target_changed', '变更内容与 prepare 时的快照不一致,请重新执行 prepare');
|
|
220
|
+
}
|
|
221
|
+
let response;
|
|
222
|
+
try {
|
|
223
|
+
response = await env.host.request({
|
|
224
|
+
method: 'POST',
|
|
225
|
+
path: '/api/meeting/detail/operateMeetingByType',
|
|
226
|
+
operation: 'meeting.change.apply',
|
|
227
|
+
body: payload,
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
catch (error) {
|
|
231
|
+
if (isNetworkError(error)) {
|
|
232
|
+
throw meetingPartialError('变更请求发送后连接中断,是否已生效不确定,禁止自动重试,请通过 meeting.list 或会议详情回查确认', { attempted: { id, operateType } }, { stage: 'change' });
|
|
233
|
+
}
|
|
234
|
+
throw error;
|
|
235
|
+
}
|
|
236
|
+
return meetingSuccess('meeting.change.apply', { status: 'COMPLETE', id, operateType, result: response });
|
|
237
|
+
},
|
|
238
|
+
};
|
|
239
|
+
export const meetingChangeOperations = [
|
|
240
|
+
meetingChangePrepare,
|
|
241
|
+
meetingChangeApply,
|
|
242
|
+
];
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { meetingSuccess, SCHEMA_DATETIME_MINUTE, SCHEMA_ID } from './types.js';
|
|
2
|
+
import { assertDateTimeMinute, extractConflict, toIdCsv, toIdString } from './shared.js';
|
|
3
|
+
/**
|
|
4
|
+
* MeetingCheckBean 公共输入(标准版三个冲突接口共用)。
|
|
5
|
+
* 返回 verdict 归一化:ok(cansub=true 且无冲突描述)/ warn(cansub=true 但有冲突描述)
|
|
6
|
+
* / rejected(cansub=false)/ unknown(接口未返回 cansub,需人工复核)。
|
|
7
|
+
*/
|
|
8
|
+
function conflictProperties() {
|
|
9
|
+
return {
|
|
10
|
+
beginDatetime: { ...SCHEMA_DATETIME_MINUTE, description: '开始时间(必填)' },
|
|
11
|
+
endDatetime: { ...SCHEMA_DATETIME_MINUTE, description: '结束时间(必填)' },
|
|
12
|
+
address: { ...SCHEMA_ID, description: '会议室 id(会议室冲突目标)' },
|
|
13
|
+
hrmids: { type: 'string', description: '参会人员 id,逗号分隔字符串' },
|
|
14
|
+
crmids: { type: 'string', description: '参会客户 id,逗号分隔字符串' },
|
|
15
|
+
mtId: { ...SCHEMA_ID, description: '会议 id(变更检测时排除自身)' },
|
|
16
|
+
caller: SCHEMA_ID,
|
|
17
|
+
contacter: SCHEMA_ID,
|
|
18
|
+
requestid: { type: 'string', description: '流程 id' },
|
|
19
|
+
totalmember: { type: 'integer', description: '应到人数' },
|
|
20
|
+
frequent: { type: 'integer', enum: [1, 2, 3, 4], description: '周期频率:1=天 2=周 3=月 4=年' },
|
|
21
|
+
repeatRuleEx: { type: 'string', description: '周期规则(RRULE)' },
|
|
22
|
+
serviceItems: { type: 'string', description: '会议服务' },
|
|
23
|
+
creator: SCHEMA_ID,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function verdictOf(cansub, message) {
|
|
27
|
+
if (cansub === false)
|
|
28
|
+
return 'rejected';
|
|
29
|
+
if (cansub === true)
|
|
30
|
+
return message ? 'warn' : 'ok';
|
|
31
|
+
return message ? 'warn' : 'unknown';
|
|
32
|
+
}
|
|
33
|
+
async function runConflictCheck(operation, path, args, host) {
|
|
34
|
+
const body = {
|
|
35
|
+
beginDatetime: assertDateTimeMinute(args.beginDatetime, 'beginDatetime'),
|
|
36
|
+
endDatetime: assertDateTimeMinute(args.endDatetime, 'endDatetime'),
|
|
37
|
+
};
|
|
38
|
+
if (args.address !== undefined)
|
|
39
|
+
body.address = toIdString(args.address, 'address');
|
|
40
|
+
if (args.hrmids !== undefined)
|
|
41
|
+
body.hrmids = toIdCsv(args.hrmids, 'hrmids');
|
|
42
|
+
if (args.crmids !== undefined)
|
|
43
|
+
body.crmids = toIdCsv(args.crmids, 'crmids');
|
|
44
|
+
if (args.mtId !== undefined)
|
|
45
|
+
body.mtId = toIdString(args.mtId, 'mtId');
|
|
46
|
+
if (args.caller !== undefined)
|
|
47
|
+
body.caller = toIdString(args.caller, 'caller');
|
|
48
|
+
if (args.contacter !== undefined)
|
|
49
|
+
body.contacter = toIdString(args.contacter, 'contacter');
|
|
50
|
+
if (args.requestid !== undefined)
|
|
51
|
+
body.requestid = args.requestid;
|
|
52
|
+
if (args.totalmember !== undefined)
|
|
53
|
+
body.totalmember = args.totalmember;
|
|
54
|
+
if (args.frequent !== undefined)
|
|
55
|
+
body.frequent = args.frequent;
|
|
56
|
+
if (args.repeatRuleEx !== undefined)
|
|
57
|
+
body.repeatRuleEx = args.repeatRuleEx;
|
|
58
|
+
if (args.serviceItems !== undefined)
|
|
59
|
+
body.serviceItems = args.serviceItems;
|
|
60
|
+
if (args.creator !== undefined)
|
|
61
|
+
body.creator = toIdString(args.creator, 'creator');
|
|
62
|
+
const response = await host.request({ method: 'POST', path, operation, body });
|
|
63
|
+
const conflict = extractConflict(response);
|
|
64
|
+
return { ...conflict, verdict: verdictOf(conflict.cansub, conflict.message), raw: response };
|
|
65
|
+
}
|
|
66
|
+
const meetingConflictRoom = {
|
|
67
|
+
name: 'meeting.conflict.room',
|
|
68
|
+
resource: 'conflict',
|
|
69
|
+
method: 'conflict.room',
|
|
70
|
+
action: 'meeting.conflict.room',
|
|
71
|
+
summary: '会议室冲突检测(meetingChkRoom):verdict=rejected 禁止提交 / warn 仅提醒 / ok 无冲突',
|
|
72
|
+
capability: 'conflict',
|
|
73
|
+
risk: 'read',
|
|
74
|
+
inputSchema: {
|
|
75
|
+
type: 'object',
|
|
76
|
+
additionalProperties: false,
|
|
77
|
+
properties: conflictProperties(),
|
|
78
|
+
required: ['beginDatetime', 'endDatetime', 'address'],
|
|
79
|
+
},
|
|
80
|
+
handler: async (args, { host }) => {
|
|
81
|
+
const result = await runConflictCheck('meeting.conflict.room', '/api/meeting/detail/meetingChkRoom', args, host);
|
|
82
|
+
return meetingSuccess('meeting.conflict.room', {
|
|
83
|
+
verdict: result.verdict,
|
|
84
|
+
cansub: result.cansub,
|
|
85
|
+
message: result.message,
|
|
86
|
+
raw: result.raw,
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
const meetingConflictMember = {
|
|
91
|
+
name: 'meeting.conflict.member',
|
|
92
|
+
resource: 'conflict',
|
|
93
|
+
method: 'conflict.member',
|
|
94
|
+
action: 'meeting.conflict.member',
|
|
95
|
+
summary: '参会人员冲突检测(meetingChkMember):verdict=rejected 禁止提交 / warn 仅提醒 / ok 无冲突',
|
|
96
|
+
capability: 'conflict',
|
|
97
|
+
risk: 'read',
|
|
98
|
+
inputSchema: {
|
|
99
|
+
type: 'object',
|
|
100
|
+
additionalProperties: false,
|
|
101
|
+
properties: conflictProperties(),
|
|
102
|
+
required: ['beginDatetime', 'endDatetime', 'hrmids'],
|
|
103
|
+
},
|
|
104
|
+
handler: async (args, { host }) => {
|
|
105
|
+
const result = await runConflictCheck('meeting.conflict.member', '/api/meeting/detail/meetingChkMember', args, host);
|
|
106
|
+
return meetingSuccess('meeting.conflict.member', {
|
|
107
|
+
verdict: result.verdict,
|
|
108
|
+
cansub: result.cansub,
|
|
109
|
+
message: result.message,
|
|
110
|
+
raw: result.raw,
|
|
111
|
+
});
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
const meetingConflictRoomAttribute = {
|
|
115
|
+
name: 'meeting.conflict.roomAttribute',
|
|
116
|
+
resource: 'conflict',
|
|
117
|
+
method: 'conflict.roomAttribute',
|
|
118
|
+
action: 'meeting.conflict.roomAttribute',
|
|
119
|
+
summary: '会议室属性冲突检测(meetingChkRoomAttribute):比对需求属性与会议室实际属性',
|
|
120
|
+
capability: 'conflict',
|
|
121
|
+
risk: 'read',
|
|
122
|
+
inputSchema: {
|
|
123
|
+
type: 'object',
|
|
124
|
+
additionalProperties: false,
|
|
125
|
+
properties: conflictProperties(),
|
|
126
|
+
required: ['beginDatetime', 'endDatetime', 'address'],
|
|
127
|
+
},
|
|
128
|
+
handler: async (args, { host }) => {
|
|
129
|
+
const result = await runConflictCheck('meeting.conflict.roomAttribute', '/api/meeting/detail/meetingChkRoomAttribute', args, host);
|
|
130
|
+
return meetingSuccess('meeting.conflict.roomAttribute', {
|
|
131
|
+
verdict: result.verdict,
|
|
132
|
+
cansub: result.cansub,
|
|
133
|
+
message: result.message,
|
|
134
|
+
raw: result.raw,
|
|
135
|
+
});
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
export const meetingConflictOperations = [
|
|
139
|
+
meetingConflictRoom,
|
|
140
|
+
meetingConflictMember,
|
|
141
|
+
meetingConflictRoomAttribute,
|
|
142
|
+
];
|