weaver-work-cli 0.1.46 → 0.1.48
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/dist/chunks/{archive-oa-BBDP7AKJ.js → archive-oa-EDJDU3V4.js} +454 -5
- package/dist/chunks/{attachment-content-MCXQBD6N.js → attachment-content-4KSNBPRO.js} +3 -3
- package/dist/chunks/{chunk-UFIFZ4YC.js → chunk-2BQESR2U.js} +1 -1
- package/dist/chunks/{chunk-727FH2NI.js → chunk-2IGZUMNG.js} +15 -2
- package/dist/chunks/{chunk-76H3IKH6.js → chunk-5B5JXTY2.js} +35 -35
- package/dist/chunks/{chunk-Q4OYAQYH.js → chunk-72MI3MBX.js} +4 -0
- package/dist/chunks/{chunk-4RWS2YYL.js → chunk-BCACE6VV.js} +2 -2
- package/dist/chunks/{chunk-AD46OMQK.js → chunk-EFOUMXIX.js} +119 -44
- package/dist/chunks/{chunk-IRMIEDXN.js → chunk-FEP6ELMR.js} +1 -1
- package/dist/chunks/{chunk-JB34OE7R.js → chunk-NBEWUR7L.js} +1 -1
- package/dist/chunks/{chunk-6V5ZPKHV.js → chunk-NK74RE5F.js} +2 -2
- package/dist/chunks/{chunk-GSZTA43P.js → chunk-OCYRVZGN.js} +2 -2
- package/dist/chunks/{chunk-OXHHJWNC.js → chunk-PSPOFLSU.js} +1 -1
- package/dist/chunks/{chunk-6AXKWFKG.js → chunk-R2HHLJNN.js} +4 -4
- package/dist/chunks/{chunk-PSOMGA3U.js → chunk-SVFG6EMV.js} +35 -6
- package/dist/chunks/{chunk-IP4CWQCF.js → chunk-WMSAWAWZ.js} +8 -8
- package/dist/chunks/{conflict-H7EHQXYY.js → conflict-APGSD5E7.js} +2 -2
- package/dist/chunks/{contract-3QLAGYQL.js → contract-N6P2HIIE.js} +425 -187
- package/dist/chunks/{create-flow-VRVJEOBX.js → create-flow-5TXFOC7X.js} +6 -6
- package/dist/chunks/{ehr-SH2LM3NK.js → ehr-XI4BIVR2.js} +16 -5
- package/dist/chunks/{env-66FPSJDV.js → env-B6GKA2J3.js} +2 -2
- package/dist/chunks/{factory-UH2TZBVA.js → factory-MFCKLUT6.js} +1 -1
- package/dist/chunks/{group-chat-CAKMMV7K.js → group-chat-YE7WIBFO.js} +3 -3
- package/dist/chunks/{im-NJB7ZYMH.js → im-3RCNL5GT.js} +107 -1
- package/dist/chunks/{invoice-OQP3TMKQ.js → invoice-FXWH5GPO.js} +209 -0
- package/dist/chunks/{lazy-dispatch-DD6ULZ3I.js → lazy-dispatch-XSAHDK6Z.js} +2 -2
- package/dist/chunks/{meeting-VTBFW4HI.js → meeting-RYZV2JTQ.js} +10 -10
- package/dist/chunks/{reception-5WITA44R.js → reception-VL6TKVAW.js} +480 -26
- package/dist/chunks/{recruit-stage-CAKZTUA7.js → recruit-stage-ERZD3ZNB.js} +52 -16
- package/dist/chunks/{registry-JVQBLFQ5.js → registry-22O6UG4I.js} +10 -10
- package/dist/chunks/{registry-AQVGHUM6.js → registry-7VZ6YJUF.js} +2 -2
- package/dist/chunks/{registry-PVUZQDDQ.js → registry-BUTEDK3C.js} +1 -1
- package/dist/chunks/{room-recommend-5U55FMXZ.js → room-recommend-IMZPJMYB.js} +4 -4
- package/dist/chunks/{schedule-IDETODCA.js → schedule-SPPAHER2.js} +4 -4
- package/dist/chunks/{workflow-BSYT5TGL.js → workflow-WVEFJ6KC.js} +2 -2
- package/dist/core/refs.js +19 -2
- package/dist/index.js +13 -13
- package/dist/shortcuts/archive-oa/constants.js +42 -0
- package/dist/shortcuts/archive-oa/host.js +2 -2
- package/dist/shortcuts/archive-oa/index.js +38 -0
- package/dist/shortcuts/archive-oa/operations/borrow-car.js +117 -3
- package/dist/shortcuts/archive-oa/operations/my-borrow-contract.js +271 -0
- package/dist/shortcuts/archive-oa/operations/registry.js +5 -3
- package/dist/shortcuts/contract/index.js +9 -1
- package/dist/shortcuts/contract/manifest.js +14 -2
- package/dist/shortcuts/contract/operations/card.js +231 -0
- package/dist/shortcuts/contract/operations/registry.js +2 -0
- package/dist/shortcuts/contract/operations/review.js +16 -5
- package/dist/shortcuts/contract/operations/summary.js +25 -17
- package/dist/shortcuts/ehr/operations/recruit-write.js +22 -5
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +17 -8
- package/dist/shortcuts/ehr/recruit-stage/shared.js +33 -8
- package/dist/shortcuts/im/index.js +128 -0
- package/dist/shortcuts/im/operations/session.js +6 -0
- package/dist/shortcuts/invoice/manifest.js +60 -0
- package/dist/shortcuts/invoice/operations/registry.js +2 -0
- package/dist/shortcuts/invoice/operations/reim-subsidy.js +163 -0
- package/dist/shortcuts/meeting/operations/eb/conflict.js +26 -3
- package/dist/shortcuts/meeting/operations/eb/continuation-alias.js +63 -0
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +71 -12
- package/dist/shortcuts/meeting/operations/eb/factory.js +5 -3
- package/dist/shortcuts/reception/host.js +33 -1
- package/dist/shortcuts/reception/index.js +19 -0
- package/dist/shortcuts/reception/manifest.js +53 -1
- package/dist/shortcuts/reception/operations/ask.js +18 -0
- package/dist/shortcuts/reception/operations/compose.js +113 -3
- package/dist/shortcuts/reception/operations/leads.js +245 -0
- package/dist/shortcuts/reception/operations/markdown.js +22 -0
- package/dist/shortcuts/reception/operations/registry.js +2 -0
- package/dist/shortcuts/reception/operations/render.js +36 -3
- package/dist/shortcuts/reception/operations/restaurant-rooms.js +118 -0
- package/dist/shortcuts/reception/operations/restaurant.js +251 -0
- package/dist/shortcuts/reception/operations/restaurantrooms.js +42 -0
- package/dist/shortcuts/reception/operations/schedule.js +7 -1
- package/dist/shortcuts/reception/upload.js +22 -6
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +17 -8
- package/dist/shortcuts/recruit-stage/shared.js +42 -14
- package/docs/archive-oa.md +4 -2
- package/docs/invoice.md +1 -0
- package/package.json +1 -1
- package/skill-template/domains/archive-oa.md +2 -1
- package/skill-template/master-skill-template.md +1 -0
- package/skill-template/skill-template.md +1 -0
- package/skills/weaver-e10-archive-oa/SKILL.md +33 -6
- package/skills/weaver-e10-archive-oa/references/borrow-car.md +32 -7
- package/skills/weaver-e10-archive-oa/references/contract-search.md +32 -0
- package/skills/weaver-e10-archive-oa/references/disabled-capabilities.md +1 -1
- package/skills/weaver-e10-archive-oa/references/my-borrow-contract.md +97 -0
- package/skills/weaver-e10-archive-oa/references/my-borrow.md +6 -1
- package/skills/weaver-e10-archive-oa/references/qys-contract-search.md +22 -0
- package/skills/weaver-e10-calendar/SKILL.md +1 -1
- package/skills/weaver-e10-calendar/references/calendar-query.md +1 -1
- package/skills/weaver-e10-calendar/references/calendar-write.md +9 -9
- package/skills/weaver-e10-cowork/SKILL.md +9 -6
- package/skills/weaver-e10-jinchengda/SKILL.md +10 -7
- package/skills/weaver-e10-jinchengda/references/contract-action-card-template.html +17 -0
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +263 -35
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +8 -5
- package/skills/weaver-e10-jinchengda/references/contract-ai-assistant.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +175 -22
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +124 -19
- package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +6 -0
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-risk-report-template.html +178 -0
- package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +1 -1
- package/skills/weaver-e10-jinchengda/references/orchestration.md +7 -7
- package/skills/weaver-e10-jinchengda/scripts/plan_actions.py +279 -0
- package/skills/weaver-e10-jinchengda/scripts/render_action_card.py +450 -0
- package/skills/weaver-e10-jinchengda/scripts/render_risk_report.py +358 -0
- package/skills/weaver-e10-jinchengda/scripts/validate_action_card.py +505 -0
- package/skills/weaver-e10-jucailin/SKILL.md +7 -4
- package/skills/weaver-e10-jucailin/references/recruit-create.md +3 -2
- package/skills/weaver-e10-jucailin/references/recruit-read.md +2 -1
- package/skills/weaver-e10-jucailin/references/recruit-stage-ops.md +3 -3
- package/skills/weaver-e10-jucailin/references/safety-boundaries.md +30 -2
- package/skills/weaver-e10-mail/SKILL.md +17 -4
- package/skills/weaver-e10-meeting/SKILL.md +94 -409
- package/skills/weaver-e10-meeting/references/create-flow.md +188 -0
- package/skills/weaver-e10-meeting/references/create-guardrails.md +234 -0
- package/skills/weaver-e10-meeting/references/pitfalls.md +40 -0
- package/skills/weaver-e10-reception-flow/SKILL.md +62 -18
- package/skills/weaver-e10-reception-flow/data/fields-snapshot.json +628 -26
- package/skills/weaver-e10-reception-flow/references/fields-snapshot.md +96 -26
- package/skills/weaver-e10-reception-flow/scripts/render.py +81 -2
- package/skills/weaver-e10-recruit-stage/SKILL.md +45 -12
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +58 -8
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +5 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +40 -11
- package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +16 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +127 -0
- package/skills/weaver-e10-shijingran/SKILL.md +6 -2
- package/skills/weaver-e10-shijingran/references/source-manifest.json +5 -4
- package/skills/weaver-e10-workflow/SKILL.md +1 -1
- package/skills/weaver-e10-yepiaotong/SKILL.md +14 -8
- package/skills/weaver-e10-yepiaotong/references/invoice-import.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +10 -3
- package/skills/weaver-e10-yepiaotong/references/invoice-upload-and-validate.md +2 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-validation-preview.md +2 -0
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +69 -7
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +3 -3
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +9 -16
- package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +6 -5
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +206 -92
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +27 -21
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +35 -0
- package/skills/weaver-e10-yimiaoban/SKILL.md +2 -1
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +32 -0
- package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +3 -0
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +11 -11
- package/dist/chunks/{ebuilder-form-GWDTKEI2.js → ebuilder-form-I5ZIX4WO.js} +3 -3
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-README.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-SKILL.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-openai.yaml +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-position-templates.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-arrange-interview.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-capability-check.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-check-install.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-detail-process.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-edit-interview-feedback.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-jd-create.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-jd-template.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-list-candidate.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-list-interview.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-match-candidates.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-output-links.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-creator.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-metadata.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resume-import.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resume-parse.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-search-candidate.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-urge-feedback.md +0 -0
|
@@ -22,12 +22,12 @@ import {
|
|
|
22
22
|
resolveWorkflowId,
|
|
23
23
|
shapeBrowserValues,
|
|
24
24
|
shouldAutoPickFlow
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-EFOUMXIX.js";
|
|
26
|
+
import "./chunk-SVFG6EMV.js";
|
|
27
|
+
import "./chunk-R2HHLJNN.js";
|
|
28
|
+
import "./chunk-PSPOFLSU.js";
|
|
29
|
+
import "./chunk-FEP6ELMR.js";
|
|
30
|
+
import "./chunk-NK74RE5F.js";
|
|
31
31
|
import "./chunk-7BDPM5ST.js";
|
|
32
32
|
import "./chunk-UG5G54VL.js";
|
|
33
33
|
import "./chunk-BUSC6UAE.js";
|
|
@@ -2451,15 +2451,22 @@ async function runEsb(host, objId, dataIds, esbActionIds) {
|
|
|
2451
2451
|
return response?.data || {};
|
|
2452
2452
|
}
|
|
2453
2453
|
async function getDsOptions(host, objId, fieldId, groupId) {
|
|
2454
|
+
const { map } = await getDsOptionsFull(host, objId, fieldId, groupId);
|
|
2455
|
+
return map;
|
|
2456
|
+
}
|
|
2457
|
+
async function getDsOptionsFull(host, objId, fieldId, groupId) {
|
|
2454
2458
|
const response = await host.request({
|
|
2455
2459
|
path: "/api/ebuilder/common/ds/options",
|
|
2456
2460
|
query: { fieldName: fieldId, objId, sourceType: "FORM", groupId }
|
|
2457
2461
|
});
|
|
2458
2462
|
const map = {};
|
|
2463
|
+
const disabled = [];
|
|
2459
2464
|
for (const option of response?.data || []) {
|
|
2460
|
-
if (option?.name
|
|
2465
|
+
if (!option?.name || !option?.id) continue;
|
|
2466
|
+
if (String(option.archive) === "1") disabled.push({ name: String(option.name), id: String(option.id) });
|
|
2467
|
+
else map[option.name] = String(option.id);
|
|
2461
2468
|
}
|
|
2462
|
-
return map;
|
|
2469
|
+
return { map, disabled };
|
|
2463
2470
|
}
|
|
2464
2471
|
async function resolvePersonId(host, _fieldId, keyword) {
|
|
2465
2472
|
const kw = String(keyword || "").trim();
|
|
@@ -3029,10 +3036,13 @@ async function buildInterviewPlan(env, cache, args) {
|
|
|
3029
3036
|
throw ehrValidationError("recruit_field_missing", `\u9762\u8BD5\u8BA1\u5212\u8868\u5355\u7F3A\u5C11\u5B57\u6BB5 ${key}\uFF08\u73AF\u5883\u7F13\u5B58 ds/fields \u672A\u89E3\u6790\u5230\uFF0C\u8BF7\u91CD\u5EFA\u73AF\u5883\u7F13\u5B58\u540E\u91CD\u8BD5\uFF09`);
|
|
3030
3037
|
}
|
|
3031
3038
|
}
|
|
3032
|
-
const
|
|
3033
|
-
const typeOptionId =
|
|
3039
|
+
const typeFull = await getDsOptionsFull(host, objId, fieldIdOf("interview_type"), cache.appId);
|
|
3040
|
+
const typeOptionId = typeFull.map[type];
|
|
3034
3041
|
if (!typeOptionId) {
|
|
3035
|
-
|
|
3042
|
+
if (typeFull.disabled.some((d) => d.name === type)) {
|
|
3043
|
+
throw ehrValidationError("enum_disabled", `\u9762\u8BD5\u65B9\u5F0F\u300C${type}\u300D\u5DF2\u7981\u7528\uFF08\u8BE5\u679A\u4E3E\u9879 archive=1\uFF09\uFF0C\u8BF7\u6539\u7528\u5176\u5B83\u9762\u8BD5\u65B9\u5F0F`);
|
|
3044
|
+
}
|
|
3045
|
+
throw ehrValidationError("enum_invalid", `\u9762\u8BD5\u65B9\u5F0F\u300C${type}\u300D\u4E0D\u5728\u679A\u4E3E\u4E2D\uFF08${Object.keys(typeFull.map).join(" / ")}\uFF09`);
|
|
3036
3046
|
}
|
|
3037
3047
|
const sessionMap = await getDsOptions(host, objId, fieldIdOf("interview_session"), cache.appId);
|
|
3038
3048
|
const sessionOptionId = sessionMap[session];
|
|
@@ -3196,6 +3206,7 @@ var interviewArrangePrepare = {
|
|
|
3196
3206
|
} : {},
|
|
3197
3207
|
notify: notify ? "\u5C06\u89E6\u53D1\u300C\u65B0\u5EFA\u65E5\u7A0B\u300D\u9762\u8BD5\u901A\u77E5\u52A8\u4F5C\u6D41\uFF08\u5916\u90E8\u901A\u77E5\uFF09" : "\u9762\u8BD5\u901A\u77E5\u9ED8\u8BA4\u4E0D\u89E6\u53D1"
|
|
3198
3208
|
},
|
|
3209
|
+
deprecated: "\u672C\u5165\u53E3\u526F\u4F5C\u7528\u4E0D\u542B\u9875\u9762\u6309\u94AE\u52A8\u4F5C\u6D41\uFF08\u65E0\u65B0\u5EFAEB\u65E5\u7A0B/\u521B\u5EFA\u89C6\u9891\u4F1A\u8BAE/AI\u9762\u8BD5\u63D0\u9192\uFF09\u4E14\u4E0D\u5E76\u5165\u9875\u9762\u9ED8\u8BA4\u503C\uFF0C\u5EFA\u8BAE\u6539\u7528 recruit-stage.interview.arrange.*\uFF08\u80FD\u529B\u76F8\u540C\u3001\u526F\u4F5C\u7528\u5B8C\u6574\uFF09",
|
|
3199
3210
|
willSubmit: { formId: plan.formId, objId: plan.objId, dataDetails: plan.dataDetails },
|
|
3200
3211
|
continuation: token,
|
|
3201
3212
|
expiresInSeconds: CONTINUATION_TTL_SECONDS
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
meetingStateDir,
|
|
7
7
|
readCache,
|
|
8
8
|
resolveMeetingEnvMode
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-FEP6ELMR.js";
|
|
10
|
+
import "./chunk-NK74RE5F.js";
|
|
11
11
|
import "./chunk-7BDPM5ST.js";
|
|
12
12
|
import "./chunk-UG5G54VL.js";
|
|
13
13
|
import "./chunk-BUSC6UAE.js";
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
ensureMeetingGroupChat,
|
|
7
7
|
meetingEbGroupChatOperations,
|
|
8
8
|
savePendingForm
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-WMSAWAWZ.js";
|
|
10
|
+
import "./chunk-FEP6ELMR.js";
|
|
11
|
+
import "./chunk-NK74RE5F.js";
|
|
12
12
|
import "./chunk-7BDPM5ST.js";
|
|
13
13
|
import "./chunk-UG5G54VL.js";
|
|
14
14
|
import "./chunk-BUSC6UAE.js";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
assertNoForbiddenKeys,
|
|
12
12
|
getImOperation,
|
|
13
13
|
imOperationDefinitions
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-72MI3MBX.js";
|
|
15
15
|
import {
|
|
16
16
|
imValidationError
|
|
17
17
|
} from "./chunk-IC62NFM5.js";
|
|
@@ -226,6 +226,108 @@ function boolOption(value) {
|
|
|
226
226
|
if (value === void 0 || value === null || value === "") return void 0;
|
|
227
227
|
return value === true || value === "true" || value === "1";
|
|
228
228
|
}
|
|
229
|
+
var BATCH_MAX_ITEMS = 1e3;
|
|
230
|
+
function resolvePrevRefs(input, prevData) {
|
|
231
|
+
const resolved = {};
|
|
232
|
+
for (const [key, value] of Object.entries(input)) {
|
|
233
|
+
if (typeof value === "string" && value.startsWith("$prev.")) {
|
|
234
|
+
if (!prevData) {
|
|
235
|
+
throw imValidationError("prev_unavailable", `${key}\uFF1A$prev \u5F15\u7528\u4E0D\u53EF\u7528\uFF08\u4E0A\u4E00\u9879\u5931\u8D25\u6216\u4E0D\u5B58\u5728\uFF09`);
|
|
236
|
+
}
|
|
237
|
+
let cursor = prevData;
|
|
238
|
+
for (const seg of value.slice(6).split(".")) {
|
|
239
|
+
if (cursor && typeof cursor === "object" && seg in cursor) {
|
|
240
|
+
cursor = cursor[seg];
|
|
241
|
+
} else {
|
|
242
|
+
throw imValidationError("prev_ref_missing", `${key}\uFF1A$prev \u8DEF\u5F84 "${value.slice(6)}" \u5728\u4E0A\u4E00\u9879\u7ED3\u679C\u4E2D\u4E0D\u5B58\u5728`);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
resolved[key] = cursor;
|
|
246
|
+
} else {
|
|
247
|
+
resolved[key] = value;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return resolved;
|
|
251
|
+
}
|
|
252
|
+
async function executeBatchAndPrint(ctx, input, stopOnFailure) {
|
|
253
|
+
const rawItems = input.items;
|
|
254
|
+
if (!Array.isArray(rawItems) || rawItems.length === 0) {
|
|
255
|
+
throw imValidationError("batch_items_required", "batch \u8F93\u5165\u5FC5\u987B\u5305\u542B\u975E\u7A7A items \u6570\u7EC4");
|
|
256
|
+
}
|
|
257
|
+
if (rawItems.length > BATCH_MAX_ITEMS) {
|
|
258
|
+
throw imValidationError("batch_items_too_many", `items \u8D85\u8FC7\u4E0A\u9650 ${BATCH_MAX_ITEMS}`);
|
|
259
|
+
}
|
|
260
|
+
const items = [];
|
|
261
|
+
rawItems.forEach((raw, i) => {
|
|
262
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw) || typeof raw.operation !== "string") {
|
|
263
|
+
throw imValidationError("batch_item_invalid", `items[${i}] \u5FC5\u987B\u662F\u542B operation \u5B57\u7B26\u4E32\u5B57\u6BB5\u7684\u5BF9\u8C61`);
|
|
264
|
+
}
|
|
265
|
+
const item = raw;
|
|
266
|
+
items.push({
|
|
267
|
+
operation: String(item.operation),
|
|
268
|
+
input: item.input && typeof item.input === "object" && !Array.isArray(item.input) ? { ...item.input } : {}
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
const results = [];
|
|
272
|
+
let prevData = null;
|
|
273
|
+
let prevFailed = false;
|
|
274
|
+
let okCount = 0;
|
|
275
|
+
let failCount = 0;
|
|
276
|
+
const started = Date.now();
|
|
277
|
+
for (let i = 0; i < items.length; i++) {
|
|
278
|
+
const { operation, input: rawInput } = items[i];
|
|
279
|
+
let itemError = prevFailed && Object.values(rawInput ?? {}).some(
|
|
280
|
+
(v) => typeof v === "string" && v.startsWith("$prev.")
|
|
281
|
+
) ? imValidationError("prev_failed_skipped", "\u4E0A\u4E00\u9879\u5931\u8D25\uFF0C\u672C\u9879\u4F9D\u8D56 $prev \u5F15\u7528\u88AB\u8DF3\u8FC7") : null;
|
|
282
|
+
let envelope;
|
|
283
|
+
if (!itemError) {
|
|
284
|
+
try {
|
|
285
|
+
const merged = resolvePrevRefs(rawInput ?? {}, prevData);
|
|
286
|
+
const result = await executeImOperation(operation, merged, {
|
|
287
|
+
ctx,
|
|
288
|
+
host: createImHost(ctx),
|
|
289
|
+
continuation: createImContinuationSigner(ctx)
|
|
290
|
+
});
|
|
291
|
+
envelope = successEnvelope(operation, result);
|
|
292
|
+
prevData = result.data === void 0 ? null : result.data;
|
|
293
|
+
prevFailed = false;
|
|
294
|
+
okCount++;
|
|
295
|
+
} catch (error) {
|
|
296
|
+
envelope = failureEnvelope(error);
|
|
297
|
+
prevData = null;
|
|
298
|
+
prevFailed = true;
|
|
299
|
+
failCount++;
|
|
300
|
+
}
|
|
301
|
+
} else {
|
|
302
|
+
envelope = failureEnvelope(itemError);
|
|
303
|
+
prevData = null;
|
|
304
|
+
prevFailed = true;
|
|
305
|
+
failCount++;
|
|
306
|
+
}
|
|
307
|
+
results.push({ index: i, operation, ...envelope });
|
|
308
|
+
process.stderr.write(`[batch ${i + 1}/${items.length}] ${operation} ${envelope.ok ? "ok" : "failed"}
|
|
309
|
+
`);
|
|
310
|
+
if (stopOnFailure && !envelope.ok) {
|
|
311
|
+
for (let j = i + 1; j < items.length; j++) {
|
|
312
|
+
results.push({ index: j, operation: items[j].operation, ok: false, error: { type: "batch", subtype: "skipped_stop_on_failure" } });
|
|
313
|
+
}
|
|
314
|
+
failCount += items.length - 1 - i;
|
|
315
|
+
break;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
const ok = failCount === 0;
|
|
319
|
+
ctx.output.write({
|
|
320
|
+
schemaVersion: 1,
|
|
321
|
+
ok,
|
|
322
|
+
operation: "im.run-batch",
|
|
323
|
+
data: {
|
|
324
|
+
results,
|
|
325
|
+
summary: { total: items.length, ok: okCount, failed: failCount, elapsedMs: Date.now() - started }
|
|
326
|
+
},
|
|
327
|
+
warnings: []
|
|
328
|
+
}, { json: true });
|
|
329
|
+
if (!ok) process.exitCode = 1 /* GeneralError */;
|
|
330
|
+
}
|
|
229
331
|
var imShortcut = {
|
|
230
332
|
name: "im",
|
|
231
333
|
description: "\u6CDB\u5FAEE10\u6613\u79D2\u529E\uFF08\u5373\u65F6\u901A\u8BAF\uFF09CLI",
|
|
@@ -238,6 +340,10 @@ var imShortcut = {
|
|
|
238
340
|
withJsonInputOptions(im.command("run").description("Run an im operation with JSON input").argument("<operation>", "operation name, e.g. im.msg.sync.group")).action(action(async (ctx, operation, options) => {
|
|
239
341
|
await executeAndPrint(ctx, String(operation), await inputFrom(options));
|
|
240
342
|
}));
|
|
343
|
+
withJsonInputOptions(im.command("run-batch").description("Run multiple im operations sequentially in one process (strictly serial, no concurrency)").option("--stop-on-failure", "skip all remaining items after the first failure")).action(action(async (ctx, options) => {
|
|
344
|
+
const opts = asOptions(options);
|
|
345
|
+
await executeBatchAndPrint(ctx, await inputFrom(opts), boolOption(opts.stopOnFailure) === true);
|
|
346
|
+
}));
|
|
241
347
|
const session = im.command("session").description("Session commands");
|
|
242
348
|
withJsonInputOptions(session.command("list").description("\u62C9\u53D6\u5F53\u524D\u7528\u6237\u4F1A\u8BDD\u5217\u8868").option("--num <n>", "\u5355\u9875\u6761\u6570\uFF08\u9ED8\u8BA4 20\uFF0C\u6700\u591A 50\uFF1B\u4F1A\u8BDD\u5217\u8868\u4E0D\u81EA\u52A8\u7FFB\u9875\uFF09").option("--msgid <id>", "\u951A\u70B9\u6D88\u606F id").option("--flag <0|1|2>", "0 up+down / 1 up / 2 down\uFF08\u9ED8\u8BA4 2\uFF09").option("--type <type>", "\u4EC5\u5C55\u793A\u8BE5 session_type")).action(action(async (ctx, options) => {
|
|
243
349
|
const opts = asOptions(options);
|
|
@@ -1311,6 +1311,66 @@ var invoiceOperations = [
|
|
|
1311
1311
|
},
|
|
1312
1312
|
outputSchema: reimCandidatesOutputSchema
|
|
1313
1313
|
},
|
|
1314
|
+
{
|
|
1315
|
+
name: "invoice.reim.subsidy.submit",
|
|
1316
|
+
risk: "high-risk-write",
|
|
1317
|
+
fixed: {
|
|
1318
|
+
path: "/api/secondev/fna/expense/reimbursement/aiCreateWf",
|
|
1319
|
+
autoCommit: "1",
|
|
1320
|
+
currentEmpId: "session.userId",
|
|
1321
|
+
detailList: "invoices \u6BCF\u5F20\u4E00\u884C {relatedProcessId, relatedInvoiceId, reimbursedAmount}\uFF0CrelatedProcessId \u5168\u90E8\u76F8\u540C\uFF1BreimbursedAmount \u53D6\u8BE5\u53D1\u7968 total\uFF0C\u5408\u8BA1\u4E0D\u8D85\u8FC7 monthlyAllowance\uFF0C\u8D85\u989D\u90A3\u884C\u62A5\u300C\u989D\u5EA6 \u2212 \u524D\u9762\u884C\u7D2F\u52A0\u300D\uFF0C\u989D\u5EA6\u7528\u5B8C\u540E\u5269\u4E0B\u7684\u53D1\u7968\u4E0D\u8FDB\u660E\u7EC6"
|
|
1322
|
+
},
|
|
1323
|
+
inputSchema: {
|
|
1324
|
+
type: "object",
|
|
1325
|
+
additionalProperties: false,
|
|
1326
|
+
required: ["processTitle", "reason", "relatedProcessId", "invoices"],
|
|
1327
|
+
properties: {
|
|
1328
|
+
processTitle: { type: "string", minLength: 1, description: "\u62A5\u9500\u6D41\u7A0B\u6807\u9898\uFF0C\u5982\u300C\u9F9A\u4E3A\u660E10\u6708\u8BDD\u8D39\u62A5\u9500\u300D" },
|
|
1329
|
+
reason: { type: "string", minLength: 1, description: "\u62A5\u9500\u4E8B\u7531\uFF0C\u5982\u300C10\u6708\u8BDD\u8D39\u300D" },
|
|
1330
|
+
relatedProcessId: { ...positiveId, description: "\u8BDD\u8D39 / \u6CB9\u8D39\u4E8B\u524D\u7533\u8BF7\u7684 requestId" },
|
|
1331
|
+
invoices: {
|
|
1332
|
+
type: "array",
|
|
1333
|
+
minItems: 1,
|
|
1334
|
+
maxItems: 100,
|
|
1335
|
+
description: "\u672C\u6B21\u62A5\u9500\u7684\u53D1\u7968\uFF0C\u6BCF\u5F20\u751F\u6210\u4E00\u884C\u660E\u7EC6\uFF1B\u987A\u5E8F\u5373\u989D\u5EA6\u6263\u51CF\u987A\u5E8F",
|
|
1336
|
+
items: {
|
|
1337
|
+
type: "object",
|
|
1338
|
+
additionalProperties: false,
|
|
1339
|
+
required: ["fid", "total"],
|
|
1340
|
+
properties: {
|
|
1341
|
+
fid: { ...positiveId, description: "\u7968\u5939\u53D1\u7968 fid" },
|
|
1342
|
+
total: { type: "string", pattern: "^\\d+(\\.\\d{1,2})?$", description: "\u8FD9\u5F20\u53D1\u7968\u7684\u4EF7\u7A0E\u5408\u8BA1\uFF08invoice.list \u7684 total\uFF09" }
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
},
|
|
1346
|
+
monthlyAllowance: { type: "string", pattern: "^\\d+(\\.\\d{1,2})?$", description: "\u4E8B\u524D\u7533\u8BF7\u7684\u300C\u6708\u8865\u8D34\u989D\u5EA6\u300D\uFF1B\u4E0D\u4F20\u8868\u793A\u4E0D\u5C01\u9876" },
|
|
1347
|
+
customerId: { ...positiveId, default: "100504500000311504", description: "\u76F8\u5173\u5BA2\u6237 ID\uFF1B\u4E0D\u4F20\u9ED8\u8BA4\u6CDB\u5FAE\u4E0A\u6D77 100504500000311504" },
|
|
1348
|
+
projectId: { type: "string", pattern: "^([1-9]\\d*)?$", default: "", description: "\u76F8\u5173\u9879\u76EE ID\uFF1B\u6CA1\u6709\u6307\u5B9A\u65F6\u4E0D\u4F20\u6216\u4F20\u7A7A\u5B57\u7B26\u4E32" }
|
|
1349
|
+
}
|
|
1350
|
+
},
|
|
1351
|
+
outputSchema: objectSchema({
|
|
1352
|
+
requestId: { type: "string", description: "\u521B\u5EFA\u5E76\u63D0\u4EA4\u6210\u529F\u7684\u62A5\u9500\u6D41\u7A0B requestId" },
|
|
1353
|
+
url: { type: "string", description: "\u62A5\u9500\u6D41\u7A0B\u8BE6\u60C5\u9875\uFF1A{baseUrl}/sp/workflow/flowpage/view/{requestId}" },
|
|
1354
|
+
processTitle: { type: "string" },
|
|
1355
|
+
invoiceCount: { type: "integer", description: "\u5B9E\u9645\u8FDB\u5165\u660E\u7EC6\u7684\u53D1\u7968\u5F20\u6570" },
|
|
1356
|
+
reimbursedAmount: { type: "string", description: "\u5404\u884C reimbursedAmount \u4E4B\u548C" },
|
|
1357
|
+
invoiceTotal: { type: "string", description: "\u4F20\u5165\u7684\u5168\u90E8\u53D1\u7968 total \u4E4B\u548C\uFF08\u542B\u6CA1\u8FDB\u660E\u7EC6\u7684\uFF09" },
|
|
1358
|
+
monthlyAllowance: { type: ["string", "null"] },
|
|
1359
|
+
capped: { type: "boolean", description: "\u662F\u5426\u6309\u6708\u8865\u8D34\u989D\u5EA6\u5C01\u9876" },
|
|
1360
|
+
details: arrayOf(objectSchema({
|
|
1361
|
+
relatedInvoiceId: { type: "string" },
|
|
1362
|
+
invoiceTotal: { type: "string" },
|
|
1363
|
+
reimbursedAmount: { type: "string" }
|
|
1364
|
+
}, ["relatedInvoiceId", "invoiceTotal", "reimbursedAmount"])),
|
|
1365
|
+
skippedInvoices: arrayOf(objectSchema({
|
|
1366
|
+
relatedInvoiceId: { type: "string" },
|
|
1367
|
+
invoiceTotal: { type: "string" }
|
|
1368
|
+
}, ["relatedInvoiceId", "invoiceTotal"]), { description: "\u989D\u5EA6\u7528\u5B8C\u540E\u6CA1\u8FDB\u660E\u7EC6\u3001\u7559\u5728\u7968\u5939\u7684\u53D1\u7968" }),
|
|
1369
|
+
finalMarkdown: { type: "string", description: "[processTitle](url)\uFF0C\u76F4\u63A5\u5C55\u793A\u7ED9\u7528\u6237" },
|
|
1370
|
+
result: rawObject,
|
|
1371
|
+
workflow: workflowSchema
|
|
1372
|
+
}, ["requestId", "url", "processTitle", "invoiceCount", "reimbursedAmount", "invoiceTotal", "monthlyAllowance", "capped", "details", "skippedInvoices", "finalMarkdown", "result", "workflow"])
|
|
1373
|
+
},
|
|
1314
1374
|
{
|
|
1315
1375
|
name: "invoice.issuing.contracts.list",
|
|
1316
1376
|
risk: "read",
|
|
@@ -3498,6 +3558,154 @@ var InvoiceReimCandidatesListOperation = class {
|
|
|
3498
3558
|
}
|
|
3499
3559
|
};
|
|
3500
3560
|
|
|
3561
|
+
// src/shortcuts/invoice/operations/reim-subsidy.ts
|
|
3562
|
+
var SUBSIDY_SUBMIT_PATH = "/api/secondev/fna/expense/reimbursement/aiCreateWf";
|
|
3563
|
+
var DEFAULT_CUSTOMER_ID = "100504500000311504";
|
|
3564
|
+
function longId(id) {
|
|
3565
|
+
const rawJSON = JSON.rawJSON;
|
|
3566
|
+
return typeof rawJSON === "function" ? rawJSON(id) : id;
|
|
3567
|
+
}
|
|
3568
|
+
function optionalId(value, name) {
|
|
3569
|
+
return value === void 0 || value === null || value === "" ? "" : asPositiveString(value, name);
|
|
3570
|
+
}
|
|
3571
|
+
function amountCents2(value, name) {
|
|
3572
|
+
if (value === void 0 || value === null || value === "") return null;
|
|
3573
|
+
const text3 = typeof value === "number" ? String(value) : value;
|
|
3574
|
+
const match = typeof text3 === "string" ? /^(\d+)(?:\.(\d{1,2}))?$/u.exec(text3.trim()) : null;
|
|
3575
|
+
const cents2 = match ? Number(match[1]) * 100 + Number((match[2] ?? "").padEnd(2, "0")) : NaN;
|
|
3576
|
+
if (!Number.isSafeInteger(cents2) || cents2 <= 0) {
|
|
3577
|
+
throw invoiceValidationError("input_invalid", `${name} \u5FC5\u987B\u662F\u5927\u4E8E 0\u3001\u6700\u591A\u4E24\u4F4D\u5C0F\u6570\u7684\u91D1\u989D`);
|
|
3578
|
+
}
|
|
3579
|
+
return cents2;
|
|
3580
|
+
}
|
|
3581
|
+
function formatCents2(cents2) {
|
|
3582
|
+
return cents2 % 100 === 0 ? String(cents2 / 100) : (cents2 / 100).toFixed(2);
|
|
3583
|
+
}
|
|
3584
|
+
function normalizeInvoices(value) {
|
|
3585
|
+
if (!Array.isArray(value) || value.length === 0) throw invoiceValidationError("input_invalid", "invoices \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4");
|
|
3586
|
+
if (value.length > 100) throw invoiceValidationError("input_invalid", "invoices \u5355\u6B21\u6700\u591A\u652F\u6301 100 \u5F20");
|
|
3587
|
+
const invoices = value.map((item, index) => {
|
|
3588
|
+
if (!item || typeof item !== "object") throw invoiceValidationError("input_invalid", `invoices[${index}] \u5FC5\u987B\u662F {fid,total}`);
|
|
3589
|
+
const fid = asPositiveString(String(item.fid ?? ""), `invoices[${index}].fid`);
|
|
3590
|
+
const cents2 = amountCents2(item.total, `invoices[${index}].total`);
|
|
3591
|
+
if (cents2 === null) throw invoiceValidationError("input_invalid", `invoices[${index}].total \u5FC5\u586B\uFF1A\u8FD9\u5F20\u53D1\u7968\u7684\u4EF7\u7A0E\u5408\u8BA1`);
|
|
3592
|
+
return { fid, cents: cents2 };
|
|
3593
|
+
});
|
|
3594
|
+
if (new Set(invoices.map((item) => item.fid)).size !== invoices.length) {
|
|
3595
|
+
throw invoiceValidationError("input_invalid", "invoices \u4E0D\u80FD\u5305\u542B\u91CD\u590D fid");
|
|
3596
|
+
}
|
|
3597
|
+
return invoices;
|
|
3598
|
+
}
|
|
3599
|
+
function workflowViewUrl(baseUrl, requestId) {
|
|
3600
|
+
return `${baseUrl.replace(/\/+$/, "")}/sp/workflow/flowpage/view/${requestId}`;
|
|
3601
|
+
}
|
|
3602
|
+
var InvoiceReimSubsidySubmitOperation = class {
|
|
3603
|
+
name = "invoice.reim.subsidy.submit";
|
|
3604
|
+
async execute(input, { host }) {
|
|
3605
|
+
const processTitle = asNonEmptyString(input.processTitle, "processTitle");
|
|
3606
|
+
const reason = asNonEmptyString(input.reason, "reason");
|
|
3607
|
+
const relatedProcessId = asPositiveString(input.relatedProcessId, "relatedProcessId");
|
|
3608
|
+
const invoices = normalizeInvoices(input.invoices);
|
|
3609
|
+
const customerId = optionalId(input.customerId, "customerId") || DEFAULT_CUSTOMER_ID;
|
|
3610
|
+
const projectId = optionalId(input.projectId, "projectId");
|
|
3611
|
+
const allowanceCents = amountCents2(input.monthlyAllowance, "monthlyAllowance");
|
|
3612
|
+
let remainingCents = allowanceCents ?? Number.POSITIVE_INFINITY;
|
|
3613
|
+
const details = [];
|
|
3614
|
+
const skipped = [];
|
|
3615
|
+
for (const item of invoices) {
|
|
3616
|
+
if (remainingCents <= 0) {
|
|
3617
|
+
skipped.push(item);
|
|
3618
|
+
continue;
|
|
3619
|
+
}
|
|
3620
|
+
const reimbursedCents = Math.min(item.cents, remainingCents);
|
|
3621
|
+
remainingCents -= reimbursedCents;
|
|
3622
|
+
details.push({ ...item, reimbursedCents });
|
|
3623
|
+
}
|
|
3624
|
+
const relatedInvoiceIds = details.map((item) => item.fid);
|
|
3625
|
+
const invoiceTotalCents = invoices.reduce((sum, item) => sum + item.cents, 0);
|
|
3626
|
+
const reimbursedTotalCents = details.reduce((sum, item) => sum + item.reimbursedCents, 0);
|
|
3627
|
+
const capped = reimbursedTotalCents < invoiceTotalCents;
|
|
3628
|
+
const session = await host.getSession();
|
|
3629
|
+
const currentEmpId = asPositiveString(session.userId, "\u5F53\u524D\u4EBA\u5458 ID");
|
|
3630
|
+
const body = {
|
|
3631
|
+
autoCommit: "1",
|
|
3632
|
+
projectId: projectId ? longId(projectId) : "",
|
|
3633
|
+
customerId: longId(customerId),
|
|
3634
|
+
currentEmpId: longId(currentEmpId),
|
|
3635
|
+
processTitle,
|
|
3636
|
+
reason,
|
|
3637
|
+
detailList: details.map((item) => ({
|
|
3638
|
+
relatedProcessId: longId(relatedProcessId),
|
|
3639
|
+
relatedInvoiceId: longId(item.fid),
|
|
3640
|
+
reimbursedAmount: formatCents2(item.reimbursedCents)
|
|
3641
|
+
}))
|
|
3642
|
+
};
|
|
3643
|
+
let result;
|
|
3644
|
+
try {
|
|
3645
|
+
result = await host.invoiceRequest({
|
|
3646
|
+
path: SUBSIDY_SUBMIT_PATH,
|
|
3647
|
+
method: "POST",
|
|
3648
|
+
body,
|
|
3649
|
+
operation: this.name,
|
|
3650
|
+
timeoutMs: 9e4
|
|
3651
|
+
});
|
|
3652
|
+
} catch (error) {
|
|
3653
|
+
if (isInvoiceNetworkError(error)) {
|
|
3654
|
+
throw invoicePartialError("\u62A5\u9500\u63D0\u4EA4\u8BF7\u6C42\u53D1\u51FA\u540E\u8FDE\u63A5\u4E2D\u65AD\uFF0C\u7ED3\u679C\u4E0D\u786E\u5B9A\uFF0C\u7981\u6B62\u81EA\u52A8\u91CD\u8BD5", {
|
|
3655
|
+
processTitle,
|
|
3656
|
+
relatedProcessId,
|
|
3657
|
+
relatedInvoiceIds,
|
|
3658
|
+
workflow: workflow(this.name, "EXECUTING")
|
|
3659
|
+
}, { stage: "submit" });
|
|
3660
|
+
}
|
|
3661
|
+
throw error;
|
|
3662
|
+
}
|
|
3663
|
+
const data = result?.data && typeof result.data === "object" ? result.data : {};
|
|
3664
|
+
const dataCode = data.code;
|
|
3665
|
+
if (result?.status === false || result?.fail === true || dataCode !== void 0 && Number(dataCode) !== 0) {
|
|
3666
|
+
throw new InvoiceCliError("api", "reim_subsidy_submit_failed", data.msg || result?.msg || "\u8BDD\u8D39 / \u6CB9\u8D39\u62A5\u9500\u63D0\u4EA4\u5931\u8D25", {
|
|
3667
|
+
code: dataCode ?? result?.code,
|
|
3668
|
+
details: { result },
|
|
3669
|
+
exitCode: 1
|
|
3670
|
+
});
|
|
3671
|
+
}
|
|
3672
|
+
const requestId = String(data.requestId ?? "").trim();
|
|
3673
|
+
if (!/^\d+$/u.test(requestId)) {
|
|
3674
|
+
throw invoicePartialError("\u62A5\u9500\u63D0\u4EA4\u63A5\u53E3\u8FD4\u56DE\u6210\u529F\u4F46\u6CA1\u6709\u6D41\u7A0B ID\uFF0C\u7ED3\u679C\u4E0D\u786E\u5B9A\uFF0C\u7981\u6B62\u81EA\u52A8\u91CD\u8BD5", {
|
|
3675
|
+
processTitle,
|
|
3676
|
+
result,
|
|
3677
|
+
workflow: workflow(this.name, "VERIFYING")
|
|
3678
|
+
}, { stage: "submit-response" });
|
|
3679
|
+
}
|
|
3680
|
+
const url = workflowViewUrl(session.baseUrl, requestId);
|
|
3681
|
+
return {
|
|
3682
|
+
status: "COMPLETE",
|
|
3683
|
+
data: {
|
|
3684
|
+
requestId,
|
|
3685
|
+
url,
|
|
3686
|
+
processTitle,
|
|
3687
|
+
invoiceCount: relatedInvoiceIds.length,
|
|
3688
|
+
reimbursedAmount: formatCents2(reimbursedTotalCents),
|
|
3689
|
+
invoiceTotal: formatCents2(invoiceTotalCents),
|
|
3690
|
+
monthlyAllowance: allowanceCents === null ? null : formatCents2(allowanceCents),
|
|
3691
|
+
capped,
|
|
3692
|
+
details: details.map((item) => ({
|
|
3693
|
+
relatedInvoiceId: item.fid,
|
|
3694
|
+
invoiceTotal: formatCents2(item.cents),
|
|
3695
|
+
reimbursedAmount: formatCents2(item.reimbursedCents)
|
|
3696
|
+
})),
|
|
3697
|
+
skippedInvoices: skipped.map((item) => ({
|
|
3698
|
+
relatedInvoiceId: item.fid,
|
|
3699
|
+
invoiceTotal: formatCents2(item.cents)
|
|
3700
|
+
})),
|
|
3701
|
+
finalMarkdown: `[${processTitle}](${url})`,
|
|
3702
|
+
result,
|
|
3703
|
+
workflow: workflow(this.name, "COMPLETE")
|
|
3704
|
+
}
|
|
3705
|
+
};
|
|
3706
|
+
}
|
|
3707
|
+
};
|
|
3708
|
+
|
|
3501
3709
|
// src/shortcuts/invoice/operations/update.ts
|
|
3502
3710
|
var InvoiceUpdatePrepareOperation = class {
|
|
3503
3711
|
name = "invoice.update.prepare";
|
|
@@ -3757,6 +3965,7 @@ function buildRegistry() {
|
|
|
3757
3965
|
new InvoiceReimCandidatesListOperation(),
|
|
3758
3966
|
new InvoiceReimEmployeeSuperiorsOperation(),
|
|
3759
3967
|
new InvoiceReimFieldSearchOperation(),
|
|
3968
|
+
new InvoiceReimSubsidySubmitOperation(),
|
|
3760
3969
|
new InvoiceIssuingContractsListOperation(),
|
|
3761
3970
|
new InvoiceIssuingContractDetailOperation()
|
|
3762
3971
|
];
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
createProgram,
|
|
6
6
|
registerCommands,
|
|
7
7
|
toCommandMetadata
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-2BQESR2U.js";
|
|
9
|
+
import "./chunk-2IGZUMNG.js";
|
|
10
10
|
import "./chunk-GR76ZDDX.js";
|
|
11
11
|
import "./chunk-AJ62BGAW.js";
|
|
12
12
|
import "./chunk-6N4JPNFL.js";
|
|
@@ -3,19 +3,19 @@ const require = __esbuildCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
getMeetingOperation,
|
|
5
5
|
meetingOperationDefinitions
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-5B5JXTY2.js";
|
|
7
|
+
import "./chunk-OCYRVZGN.js";
|
|
8
|
+
import "./chunk-WMSAWAWZ.js";
|
|
9
|
+
import "./chunk-EFOUMXIX.js";
|
|
10
|
+
import "./chunk-SVFG6EMV.js";
|
|
11
|
+
import "./chunk-BCACE6VV.js";
|
|
12
|
+
import "./chunk-R2HHLJNN.js";
|
|
13
|
+
import "./chunk-PSPOFLSU.js";
|
|
14
14
|
import {
|
|
15
15
|
degradeMeetingEnvToStandard,
|
|
16
16
|
meetingStateDir,
|
|
17
17
|
readCache
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-FEP6ELMR.js";
|
|
19
19
|
import {
|
|
20
20
|
MeetingCliError,
|
|
21
21
|
asObject,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
meetingAuthError,
|
|
24
24
|
meetingNetworkError,
|
|
25
25
|
meetingValidationError
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-NK74RE5F.js";
|
|
27
27
|
import {
|
|
28
28
|
reportPlatformError
|
|
29
29
|
} from "./chunk-6N4JPNFL.js";
|