weaver-work-cli 0.1.47 → 0.1.49
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-57R2FYHV.js} +565 -17
- package/dist/chunks/{attachment-content-MCXQBD6N.js → attachment-content-MU2LPI5P.js} +3 -3
- package/dist/chunks/{chunk-J2VEB5K3.js → chunk-2BQESR2U.js} +2 -2
- package/dist/chunks/{chunk-727FH2NI.js → chunk-2IGZUMNG.js} +15 -2
- package/dist/chunks/{chunk-IP4CWQCF.js → chunk-3NV2ETZR.js} +8 -8
- package/dist/chunks/{chunk-OXHHJWNC.js → chunk-3X7VOSBA.js} +1 -1
- package/dist/chunks/chunk-5QYE52LG.js +223 -0
- package/dist/chunks/{chunk-IRMIEDXN.js → chunk-6GWU63YF.js} +1 -1
- package/dist/chunks/{chunk-3YV7PKRL.js → chunk-6QYNE6HE.js} +12 -212
- package/dist/chunks/{chunk-Q4OYAQYH.js → chunk-72MI3MBX.js} +4 -0
- package/dist/chunks/{chunk-AD46OMQK.js → chunk-BRRW7CWA.js} +121 -46
- package/dist/chunks/{chunk-76H3IKH6.js → chunk-D2QRZUW4.js} +221 -37
- package/dist/chunks/{chunk-GSZTA43P.js → chunk-EJVA5ZVB.js} +2 -2
- package/dist/chunks/{chunk-4RWS2YYL.js → chunk-GEOMANP7.js} +3 -3
- package/dist/chunks/{chunk-LIEQJIGM.js → chunk-GR76ZDDX.js} +0 -3
- package/dist/chunks/{chunk-O6CMPO65.js → chunk-IW7A2IQY.js} +16 -146
- package/dist/chunks/chunk-JEQHNNSS.js +158 -0
- package/dist/chunks/{chunk-6V5ZPKHV.js → chunk-K3BT54CU.js} +4 -4
- package/dist/chunks/{chunk-6AXKWFKG.js → chunk-KV5SOWMS.js} +4 -4
- package/dist/chunks/{chunk-JB34OE7R.js → chunk-NBEWUR7L.js} +1 -1
- package/dist/chunks/{chunk-PSOMGA3U.js → chunk-ZKEUGS2U.js} +36 -7
- package/dist/chunks/{conflict-H7EHQXYY.js → conflict-6347A7YK.js} +2 -2
- package/dist/chunks/{contract-3QLAGYQL.js → contract-N6P2HIIE.js} +425 -187
- package/dist/chunks/{create-flow-VRVJEOBX.js → create-flow-7WG7LVX5.js} +6 -6
- package/dist/chunks/data-QO7QWOIV.js +2525 -0
- package/dist/chunks/{ehr-SH2LM3NK.js → ehr-XI4BIVR2.js} +16 -5
- package/dist/chunks/{employee-NOHNXC46.js → employee-DR5Y64TI.js} +2 -1
- package/dist/chunks/{env-66FPSJDV.js → env-LHRKSLG6.js} +2 -2
- package/dist/chunks/{factory-UH2TZBVA.js → factory-2H7Z4RWJ.js} +1 -1
- package/dist/chunks/{group-chat-CAKMMV7K.js → group-chat-EW6PNDDT.js} +3 -3
- package/dist/chunks/{hrm-UNKCCCGP.js → hrm-YGIR3HGF.js} +4 -2
- package/dist/chunks/{im-NJB7ZYMH.js → im-3RCNL5GT.js} +107 -1
- package/dist/chunks/{invoice-UEAHSYAE.js → invoice-FXWH5GPO.js} +2 -71
- package/dist/chunks/{lazy-dispatch-25XGTXLM.js → lazy-dispatch-XSAHDK6Z.js} +3 -3
- package/dist/chunks/{meeting-VTBFW4HI.js → meeting-N2FQBHXI.js} +10 -10
- package/dist/chunks/org-NFE7X7FK.js +12 -0
- package/dist/chunks/{reception-5WITA44R.js → reception-MYOKJULO.js} +905 -116
- package/dist/chunks/{recruit-stage-CAKZTUA7.js → recruit-stage-FKWS5UQF.js} +118 -29
- package/dist/chunks/{registry-VWXWPVAG.js → registry-3UGIWH53.js} +4 -2
- 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/{registry-JVQBLFQ5.js → registry-CKUVBS53.js} +10 -10
- package/dist/chunks/{room-recommend-5U55FMXZ.js → room-recommend-MBCYENQ2.js} +4 -4
- package/dist/chunks/{schedule-IDETODCA.js → schedule-5IFMCXME.js} +4 -4
- package/dist/chunks/{workflow-BSYT5TGL.js → workflow-2TRU2ZSP.js} +5 -5
- package/dist/core/refs.js +19 -2
- package/dist/index.js +20 -15
- 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/contract-modules.js +57 -0
- package/dist/shortcuts/archive-oa/operations/contract.js +23 -8
- package/dist/shortcuts/archive-oa/operations/my-borrow-contract.js +271 -0
- package/dist/shortcuts/archive-oa/operations/registry.js +9 -4
- package/dist/shortcuts/archive-oa/operations/shared.js +41 -5
- 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/data/errors.js +64 -0
- package/dist/shortcuts/data/host.js +140 -0
- package/dist/shortcuts/data/index.js +429 -0
- package/dist/shortcuts/data/manifest.js +133 -0
- package/dist/shortcuts/data/operations/attend.js +62 -0
- package/dist/shortcuts/data/operations/conf.js +384 -0
- package/dist/shortcuts/data/operations/ds.js +686 -0
- package/dist/shortcuts/data/operations/field.js +68 -0
- package/dist/shortcuts/data/operations/index.js +65 -0
- package/dist/shortcuts/data/operations/module.js +383 -0
- package/dist/shortcuts/data/operations/noun.js +102 -0
- package/dist/shortcuts/data/operations/query.js +85 -0
- package/dist/shortcuts/data/operations/scene.js +235 -0
- package/dist/shortcuts/data/operations/shared.js +279 -0
- package/dist/shortcuts/ehr/operations/recruit-write.js +22 -5
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +28 -12
- package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +21 -13
- package/dist/shortcuts/ehr/recruit-stage/shared.js +90 -8
- package/dist/shortcuts/im/index.js +128 -0
- package/dist/shortcuts/im/operations/session.js +6 -0
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/invoice/host.js +0 -3
- package/dist/shortcuts/invoice/manifest.js +0 -1
- package/dist/shortcuts/invoice/operations/reim-subsidy.js +1 -71
- 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/meeting/operations/eb/member-expand.js +200 -0
- package/dist/shortcuts/meeting/operations/registry.js +2 -0
- package/dist/shortcuts/reception/constants.js +11 -0
- package/dist/shortcuts/reception/host.js +33 -1
- package/dist/shortcuts/reception/index.js +22 -1
- package/dist/shortcuts/reception/manifest.js +55 -2
- package/dist/shortcuts/reception/operations/ask.js +37 -1
- package/dist/shortcuts/reception/operations/compose.js +124 -3
- package/dist/shortcuts/reception/operations/doc.js +59 -0
- package/dist/shortcuts/reception/operations/docrender.js +25 -1
- package/dist/shortcuts/reception/operations/leads.js +245 -0
- package/dist/shortcuts/reception/operations/markdown.js +22 -0
- package/dist/shortcuts/reception/operations/panels.js +84 -21
- package/dist/shortcuts/reception/operations/registry.js +2 -0
- package/dist/shortcuts/reception/operations/render.js +76 -3
- package/dist/shortcuts/reception/operations/restaurant-rooms.js +118 -0
- package/dist/shortcuts/reception/operations/restaurant.js +264 -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 +28 -12
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +21 -13
- package/dist/shortcuts/recruit-stage/shared.js +99 -14
- package/docs/SKILL.md +1 -0
- package/docs/_catalog.md +3 -0
- package/docs/archive-oa.md +4 -2
- package/docs/data.md +149 -0
- package/docs/reception.md +59 -5
- package/package.json +1 -1
- package/scripts/check-skill-sync.mjs +188 -0
- package/scripts/package-skill.mjs +17 -3
- package/skill-template/business-info.json +23 -0
- package/skill-template/domains/archive-oa.md +2 -1
- package/skill-template/domains/data.md +15 -0
- 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 +35 -7
- package/skills/weaver-e10-archive-oa/references/borrow-car.md +32 -7
- package/skills/weaver-e10-archive-oa/references/contract-search.md +105 -4
- package/skills/weaver-e10-archive-oa/references/disabled-capabilities.md +2 -2
- 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 +48 -2
- 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-data/SKILL.md +118 -0
- package/skills/weaver-e10-data/references/config-center.md +90 -0
- package/skills/weaver-e10-data/references/datasource.md +136 -0
- package/skills/weaver-e10-data/references/scene-and-misc.md +82 -0
- 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 +129 -412
- 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 +77 -19
- 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/references/guide.md +4 -3
- package/skills/weaver-e10-reception-flow/scripts/render.py +84 -3
- package/skills/weaver-e10-recruit-stage/SKILL.md +45 -12
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +78 -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 +169 -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 +8 -4
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +2 -2
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +1 -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-CBYI6CQ6.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
|
@@ -240,6 +240,7 @@ function createArchiveOaHost(ctx, dependencies = {}) {
|
|
|
240
240
|
path,
|
|
241
241
|
query,
|
|
242
242
|
body,
|
|
243
|
+
formData,
|
|
243
244
|
operation,
|
|
244
245
|
headers: extraHeaders = {},
|
|
245
246
|
timeoutMs = 6e4,
|
|
@@ -257,7 +258,7 @@ function createArchiveOaHost(ctx, dependencies = {}) {
|
|
|
257
258
|
method: resolvedMethod,
|
|
258
259
|
path,
|
|
259
260
|
query: omitEmptyQueryValues(query),
|
|
260
|
-
body,
|
|
261
|
+
...formData ? { formData } : { body },
|
|
261
262
|
headers: { "X-Requested-With": "XMLHttpRequest", ...extraHeaders },
|
|
262
263
|
timeoutMs
|
|
263
264
|
}).catch((error) => mapRuntimeNetworkError(error));
|
|
@@ -348,8 +349,43 @@ var QYS_ESB_ADD = {
|
|
|
348
349
|
listId: "1190611964371984450",
|
|
349
350
|
successText: "\u3010\u5951\u7EA6\u9501\u52A0\u5165\u501F\u9605\u8F66\u3011\u6267\u884C\u6210\u529F\uFF01"
|
|
350
351
|
};
|
|
352
|
+
var WEAVER_ESB_REMOVE = {
|
|
353
|
+
source: "weaver",
|
|
354
|
+
esbActionIds: "882413705640943619",
|
|
355
|
+
objId: "882393476189437952",
|
|
356
|
+
listId: "882393480417296390",
|
|
357
|
+
successText: "\u3010\u79FB\u51FA\u501F\u9605\u8F66\u3011\u6267\u884C\u6210\u529F\uFF01"
|
|
358
|
+
};
|
|
359
|
+
var QYS_ESB_REMOVE = {
|
|
360
|
+
source: "qys",
|
|
361
|
+
esbActionIds: "882413705640943619",
|
|
362
|
+
objId: "882393476189437952",
|
|
363
|
+
listId: "883819516961857839",
|
|
364
|
+
successText: "\u3010\u5951\u7EA6\u9501\u79FB\u51FA\u501F\u9605\u8F66\u3011\u6267\u884C\u6210\u529F\uFF01"
|
|
365
|
+
};
|
|
351
366
|
var QYS_DEFAULT_ARCHIVED_FIELD = "cljd";
|
|
352
367
|
var QYS_DEFAULT_ARCHIVED_VALUE = "\u5DF2\u5F52\u6863";
|
|
368
|
+
var MY_BORROW_CONTRACT = {
|
|
369
|
+
source: "weaver",
|
|
370
|
+
pageAppId: "100002780000000542",
|
|
371
|
+
pageId: "1335759383610105964",
|
|
372
|
+
compId: "c922aecea25d4f538d8cb4d89320e916",
|
|
373
|
+
refPluginPackageId: "933846626099339271",
|
|
374
|
+
objId: "1335759383610105884",
|
|
375
|
+
archiveAppId: "2c109885898d48c19e49edd4cfd2bf2f",
|
|
376
|
+
fields: {
|
|
377
|
+
applyDate: "11738424152292925447525441107052728320",
|
|
378
|
+
requestId: "11738424152292925447525434968495886336",
|
|
379
|
+
customer: "11738424152292925447525437940097355783",
|
|
380
|
+
contractNo: "11738424152292925447525437940101550081",
|
|
381
|
+
archiveId: "11738424152292925447525437940101550084",
|
|
382
|
+
applicant: "11738424152292925447525436635463290880",
|
|
383
|
+
expireDate: "11738424152292925447525436280084107264"
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
var MY_BORROW_ARCHIVE_OPEN_PATH = "/sp/integration/loginSingle";
|
|
387
|
+
var MY_BORROW_FLOW_VIEW_PATH = "/sp/workflow/flowpage/view";
|
|
388
|
+
var MY_BORROW_EXPIRE_MAX = "2099-12-31";
|
|
353
389
|
|
|
354
390
|
// src/shortcuts/archive-oa/operations/types.ts
|
|
355
391
|
var READ = "read";
|
|
@@ -480,26 +516,54 @@ function buildCommonSearchFields(fields, extra = []) {
|
|
|
480
516
|
}
|
|
481
517
|
for (const item of items) {
|
|
482
518
|
const value = normalizeConditionValue(item.conditionType, item.value, item.field);
|
|
483
|
-
|
|
519
|
+
const entry = {
|
|
520
|
+
[`${item.field}_condition_type`]: item.conditionType,
|
|
521
|
+
[item.field]: value
|
|
522
|
+
};
|
|
523
|
+
if (item.conditionType === "between" && Array.isArray(value)) {
|
|
524
|
+
const [min, max] = value;
|
|
525
|
+
entry[`${item.field}_obj`] = { value, ...dateRangePreset(min, max) };
|
|
526
|
+
entry[`${item.field}_selectedKeyPrior`] = false;
|
|
527
|
+
}
|
|
528
|
+
result[item.field] = [entry];
|
|
484
529
|
}
|
|
485
530
|
return result;
|
|
486
531
|
}
|
|
532
|
+
var DATE_TEXT = /^\d{4}-\d{2}-\d{2}$/u;
|
|
533
|
+
function dateRangePreset(min, max) {
|
|
534
|
+
const year = (/* @__PURE__ */ new Date()).getFullYear();
|
|
535
|
+
if (min === `${year}-01-01` && max === `${year}-06-30`) {
|
|
536
|
+
return { selectedKey: "firstHalfYear", selectedName: "\u4E0A\u534A\u5E74" };
|
|
537
|
+
}
|
|
538
|
+
if (min === `${year}-07-01` && max === `${year}-12-31`) {
|
|
539
|
+
return { selectedKey: "secondHalfYear", selectedName: "\u4E0B\u534A\u5E74" };
|
|
540
|
+
}
|
|
541
|
+
if (min === `${year}-01-01` && max === `${year}-12-31`) {
|
|
542
|
+
return { selectedKey: "currentYear", selectedName: "\u4ECA\u5E74" };
|
|
543
|
+
}
|
|
544
|
+
return { selectedKey: "", selectedName: "" };
|
|
545
|
+
}
|
|
487
546
|
function normalizeConditionValue(conditionType, value, field) {
|
|
488
547
|
if (conditionType === "between") {
|
|
548
|
+
let min;
|
|
549
|
+
let max;
|
|
489
550
|
if (Array.isArray(value)) {
|
|
490
551
|
if (value.length !== 2) {
|
|
491
552
|
throw archiveOaValidationError("search_value_invalid", `${field} \u7684 between \u6761\u4EF6\u9700\u8981\u4E24\u4E2A\u503C`);
|
|
492
553
|
}
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
if (value && typeof value === "object") {
|
|
554
|
+
min = String(value[0]);
|
|
555
|
+
max = String(value[1]);
|
|
556
|
+
} else if (value && typeof value === "object") {
|
|
496
557
|
const range = value;
|
|
497
558
|
if (range.min === void 0 || range.max === void 0) {
|
|
498
559
|
throw archiveOaValidationError("search_value_invalid", `${field} \u7684 between \u6761\u4EF6\u9700\u8981 min / max`);
|
|
499
560
|
}
|
|
500
|
-
|
|
561
|
+
min = String(range.min);
|
|
562
|
+
max = String(range.max);
|
|
563
|
+
} else {
|
|
564
|
+
throw archiveOaValidationError("search_value_invalid", `${field} \u7684 between \u6761\u4EF6\u5FC5\u987B\u662F {min,max} \u6216 [\u8D77,\u6B62]`);
|
|
501
565
|
}
|
|
502
|
-
|
|
566
|
+
return DATE_TEXT.test(min) && DATE_TEXT.test(max) ? [min, max] : { min, max };
|
|
503
567
|
}
|
|
504
568
|
if (conditionType === "in" || conditionType === "inC") {
|
|
505
569
|
if (!Array.isArray(value)) {
|
|
@@ -751,8 +815,139 @@ function makeAddOperations(carProfile, esb) {
|
|
|
751
815
|
};
|
|
752
816
|
return [prepare, apply];
|
|
753
817
|
}
|
|
754
|
-
function
|
|
755
|
-
|
|
818
|
+
function makeRemoveOperations(carProfile, esb) {
|
|
819
|
+
const prepareName = `${prefix(carProfile.source)}.remove.prepare`;
|
|
820
|
+
const applyName = `${prefix(carProfile.source)}.remove.apply`;
|
|
821
|
+
const prepare = {
|
|
822
|
+
name: prepareName,
|
|
823
|
+
resource: "borrow-car",
|
|
824
|
+
method: "remove",
|
|
825
|
+
action: prepareName,
|
|
826
|
+
summary: `\u628A${esb.source === "qys" ? "\u5951\u7EA6\u9501" : "\u6CDB\u5FAE"}\u501F\u9605\u8F66\u8BB0\u5F55\u79FB\u51FA\u501F\u9605\u8F66\uFF1A\u6821\u9A8C\u6761\u6570\u5E76\u56DE\u67E5\u501F\u9605\u8F66\u73B0\u72B6\uFF08\u4E0D\u5199\u6570\u636E\uFF09`,
|
|
827
|
+
capability: "borrow-car",
|
|
828
|
+
risk: READ_BEFORE_WRITE,
|
|
829
|
+
inputSchema: schemaOf(
|
|
830
|
+
{
|
|
831
|
+
dataIds: {
|
|
832
|
+
...SCHEMA_ID_LIST,
|
|
833
|
+
maxItems: MAX_BORROW_ITEMS,
|
|
834
|
+
description: `\u501F\u9605\u8F66\u884C id \u6570\u7EC4\uFF0C\u6765\u81EA borrow-car.list \u7684 rows[].id\uFF0C\u6700\u591A ${MAX_BORROW_ITEMS} \u6761`
|
|
835
|
+
}
|
|
836
|
+
},
|
|
837
|
+
{ required: ["dataIds"], description: "\u79FB\u51FA\u501F\u9605\u8F66\u9884\u68C0" }
|
|
838
|
+
),
|
|
839
|
+
handler: async (args, env) => {
|
|
840
|
+
const dataIds = requireIdList(args.dataIds, "dataIds", MAX_BORROW_ITEMS);
|
|
841
|
+
const current = await env.host.request({
|
|
842
|
+
method: "POST",
|
|
843
|
+
path: CONTRACT_LIST_PATH,
|
|
844
|
+
operation: prepareName,
|
|
845
|
+
query: { passid: carProfile.passId, cid: carProfile.passId, sf_request_type: "ajax" },
|
|
846
|
+
body: {
|
|
847
|
+
current: 1,
|
|
848
|
+
requiredMatch: 1,
|
|
849
|
+
mapResult: "1",
|
|
850
|
+
recheckQuery: "1",
|
|
851
|
+
cusMenuId: carProfile.cusMenuId,
|
|
852
|
+
urlPageTitle: carProfile.urlPageTitle,
|
|
853
|
+
searchParamData: { searchType: "2", type: "and", commonSearchFields: {}, groupFields: {} },
|
|
854
|
+
listId: carProfile.listId,
|
|
855
|
+
isFollow: 0,
|
|
856
|
+
isShareToMe: 0,
|
|
857
|
+
filterCondition: {},
|
|
858
|
+
browser: "Chrome"
|
|
859
|
+
}
|
|
860
|
+
});
|
|
861
|
+
const { rows } = normalizeListResult(prepareName, current, carProfile.source);
|
|
862
|
+
const existing = new Set(rows.map((row) => String(row.id ?? row.form_data_id ?? "")));
|
|
863
|
+
const notInBorrowCar = dataIds.filter((id) => !existing.has(id));
|
|
864
|
+
const { continuation, expiresInMs } = await issueLease(env, applyName, {
|
|
865
|
+
dataIds,
|
|
866
|
+
esbActionIds: esb.esbActionIds,
|
|
867
|
+
objId: esb.objId,
|
|
868
|
+
listId: esb.listId
|
|
869
|
+
});
|
|
870
|
+
return archiveOaSuccess(
|
|
871
|
+
prepareName,
|
|
872
|
+
{
|
|
873
|
+
preview: {
|
|
874
|
+
source: carProfile.source,
|
|
875
|
+
count: dataIds.length,
|
|
876
|
+
dataIds,
|
|
877
|
+
borrowCarBefore: rows.length,
|
|
878
|
+
notInBorrowCar
|
|
879
|
+
},
|
|
880
|
+
hint: `\u786E\u8BA4\u540E\u8C03\u7528 ${applyName}\uFF08CLI\uFF1Aarchive-oa borrow-car remove-apply --continuation <token> --yes\uFF09`,
|
|
881
|
+
continuation
|
|
882
|
+
},
|
|
883
|
+
{ requiresConfirmation: true, expiresInMs }
|
|
884
|
+
);
|
|
885
|
+
}
|
|
886
|
+
};
|
|
887
|
+
const apply = {
|
|
888
|
+
name: applyName,
|
|
889
|
+
resource: "borrow-car",
|
|
890
|
+
method: "remove",
|
|
891
|
+
action: applyName,
|
|
892
|
+
summary: `\u628A${esb.source === "qys" ? "\u5951\u7EA6\u9501" : "\u6CDB\u5FAE"}\u501F\u9605\u8F66\u8BB0\u5F55\u79FB\u51FA\u501F\u9605\u8F66\uFF08\u5199\u64CD\u4F5C\uFF09\uFF1A\u6267\u884C ESB \u52A8\u4F5C`,
|
|
893
|
+
capability: "borrow-car",
|
|
894
|
+
risk: HIGH_RISK_WRITE,
|
|
895
|
+
requiresConfirmation: true,
|
|
896
|
+
inputSchema: schemaOf(
|
|
897
|
+
{
|
|
898
|
+
continuation: { type: "string", description: "prepare \u8FD4\u56DE\u7684\u786E\u8BA4\u7968\u636E" },
|
|
899
|
+
confirm: { type: "boolean", description: "\u5FC5\u987B\u4E3A true\uFF08CLI --yes\uFF09" }
|
|
900
|
+
},
|
|
901
|
+
{ required: ["continuation", "confirm"], description: "\u79FB\u51FA\u501F\u9605\u8F66" }
|
|
902
|
+
),
|
|
903
|
+
handler: async (args, env) => {
|
|
904
|
+
const lease = await verifyLease(args, applyName, env);
|
|
905
|
+
assertLeaseTarget(lease, args, ["dataIds"], applyName);
|
|
906
|
+
const dataIds = Array.isArray(lease.dataIds) ? lease.dataIds.map(String) : [];
|
|
907
|
+
if (dataIds.length === 0 || dataIds.length > MAX_BORROW_ITEMS) {
|
|
908
|
+
throw new Error("continuation \u7F3A\u5C11\u5408\u6CD5\u7684 dataIds");
|
|
909
|
+
}
|
|
910
|
+
const response = await env.host.request({
|
|
911
|
+
method: "POST",
|
|
912
|
+
path: RUN_ESB_PATH,
|
|
913
|
+
operation: applyName,
|
|
914
|
+
query: { sf_request_type: "ajax" },
|
|
915
|
+
body: {
|
|
916
|
+
dataIds: dataIds.join(","),
|
|
917
|
+
esbActionIds: String(lease.esbActionIds ?? esb.esbActionIds),
|
|
918
|
+
objId: String(lease.objId ?? esb.objId),
|
|
919
|
+
listId: String(lease.listId ?? esb.listId)
|
|
920
|
+
}
|
|
921
|
+
});
|
|
922
|
+
const data = unwrapData(response) ?? {};
|
|
923
|
+
const failNum = Number(data.failNum ?? 0);
|
|
924
|
+
if (failNum > 0) {
|
|
925
|
+
throw archiveOaPartialError(
|
|
926
|
+
`\u79FB\u51FA\u501F\u9605\u8F66\u90E8\u5206\u5931\u8D25\uFF1A\u6210\u529F ${data.successNum ?? 0} \u6761\uFF0C\u5931\u8D25 ${failNum} \u6761`,
|
|
927
|
+
{ successNum: data.successNum ?? 0, failNum, failIds: data.failIds ?? [] },
|
|
928
|
+
{ dataIds, needRefresh: data.needRefresh === true }
|
|
929
|
+
);
|
|
930
|
+
}
|
|
931
|
+
return archiveOaSuccess(
|
|
932
|
+
applyName,
|
|
933
|
+
{
|
|
934
|
+
message: String(data.successMsg ?? esb.successText),
|
|
935
|
+
successNum: data.successNum ?? dataIds.length,
|
|
936
|
+
failNum,
|
|
937
|
+
needRefresh: data.needRefresh === true
|
|
938
|
+
},
|
|
939
|
+
{ wrote: true, source: carProfile.source, count: dataIds.length }
|
|
940
|
+
);
|
|
941
|
+
}
|
|
942
|
+
};
|
|
943
|
+
return [prepare, apply];
|
|
944
|
+
}
|
|
945
|
+
function createBorrowCarOperations(carProfile, esb, esbRemove) {
|
|
946
|
+
return [
|
|
947
|
+
makeListOperation(carProfile),
|
|
948
|
+
...makeAddOperations(carProfile, esb),
|
|
949
|
+
...makeRemoveOperations(carProfile, esbRemove)
|
|
950
|
+
];
|
|
756
951
|
}
|
|
757
952
|
|
|
758
953
|
// src/shortcuts/archive-oa/operations/borrow-url.ts
|
|
@@ -872,8 +1067,8 @@ function createBorrowStartUrlOperation(profile) {
|
|
|
872
1067
|
|
|
873
1068
|
// src/shortcuts/archive-oa/operations/contract.ts
|
|
874
1069
|
var CONTRACT_LIST_PATH3 = "/api/ebuilder/form/list/getListDatas";
|
|
875
|
-
function
|
|
876
|
-
return `/api/ebuilder/form/
|
|
1070
|
+
function searchFieldsPath(profile) {
|
|
1071
|
+
return `/api/ebuilder/form/listSearch/getListSearch/${profile.listId}`;
|
|
877
1072
|
}
|
|
878
1073
|
function operationName(profile, action) {
|
|
879
1074
|
return profile.source === "qys" ? `archive-oa.qys.contract.${action}` : `archive-oa.contract.${action}`;
|
|
@@ -913,16 +1108,31 @@ function makeFieldsOperation(profile) {
|
|
|
913
1108
|
handler: async (_args, env) => {
|
|
914
1109
|
const response = await env.host.request({
|
|
915
1110
|
method: "GET",
|
|
916
|
-
path:
|
|
1111
|
+
path: searchFieldsPath(profile),
|
|
917
1112
|
operation: name,
|
|
918
|
-
query: { passid: profile.passId
|
|
1113
|
+
query: { passid: profile.passId }
|
|
919
1114
|
});
|
|
920
1115
|
const data = unwrapData(response) ?? {};
|
|
921
|
-
const
|
|
1116
|
+
const layout = Array.isArray(data.layout) ? data.layout : [];
|
|
1117
|
+
const groups = Array.isArray(data.groups) ? data.groups : [];
|
|
1118
|
+
const groupTitle = new Map(
|
|
1119
|
+
groups.map((group) => [String(group.id), String(group.title ?? "")])
|
|
1120
|
+
);
|
|
1121
|
+
const fields = layout.flat().map((item) => {
|
|
1122
|
+
const id = String(item?.id ?? "");
|
|
1123
|
+
const groupId = String(item?.groupId ?? "");
|
|
1124
|
+
return {
|
|
1125
|
+
fieldName: id,
|
|
1126
|
+
showName: String(item?.label ?? ""),
|
|
1127
|
+
groupId,
|
|
1128
|
+
groupName: groupTitle.get(groupId) ?? "",
|
|
1129
|
+
hidden: item?.hide === true
|
|
1130
|
+
};
|
|
1131
|
+
}).filter((item) => item.fieldName.length > 0);
|
|
922
1132
|
return archiveOaSuccess(
|
|
923
1133
|
name,
|
|
924
1134
|
{ fields },
|
|
925
|
-
{ source: profile.source, listId: profile.listId, count:
|
|
1135
|
+
{ source: profile.source, listId: profile.listId, count: fields.length }
|
|
926
1136
|
);
|
|
927
1137
|
}
|
|
928
1138
|
};
|
|
@@ -986,6 +1196,7 @@ function makeListOperation2(profile) {
|
|
|
986
1196
|
};
|
|
987
1197
|
}
|
|
988
1198
|
var weaverContractFieldsOperation = makeFieldsOperation(WEAVER_CONTRACT);
|
|
1199
|
+
var qysContractFieldsOperation = makeFieldsOperation(QYS_CONTRACT);
|
|
989
1200
|
var weaverContractListOperation = makeListOperation2(WEAVER_CONTRACT);
|
|
990
1201
|
var qysContractListOperation = makeListOperation2(QYS_CONTRACT);
|
|
991
1202
|
|
|
@@ -1039,16 +1250,329 @@ var archiveLocateOperation = {
|
|
|
1039
1250
|
}
|
|
1040
1251
|
};
|
|
1041
1252
|
|
|
1253
|
+
// src/shortcuts/archive-oa/operations/contract-modules.ts
|
|
1254
|
+
var MODULE_BROWSER_PATH = "/api/bcw/common/browser/complete/customBrowser_sw_htzxmk";
|
|
1255
|
+
var MODULE_CONTROL_ID = "3753081";
|
|
1256
|
+
var contractModuleOptionsOperation = {
|
|
1257
|
+
name: "archive-oa.contract.module-options",
|
|
1258
|
+
resource: "contract",
|
|
1259
|
+
method: "module-options",
|
|
1260
|
+
action: "archive-oa.contract.module-options",
|
|
1261
|
+
summary: "\u67E5\u8BE2\u5408\u540C\u4E13\u9879\u6A21\u5757\uFF08zxfa\uFF09\u7684\u5019\u9009\u503C\uFF0C\u7528\u4E8E\u628A\u300C\u6587\u4E66\u5B9A\u300D\u7B49\u6A21\u5757\u540D\u8F6C\u6210 inC \u9700\u8981\u7684\u5BF9\u8C61",
|
|
1262
|
+
capability: "contract",
|
|
1263
|
+
risk: READ,
|
|
1264
|
+
inputSchema: schemaOf(
|
|
1265
|
+
{
|
|
1266
|
+
keyword: { type: "string", description: "\u5173\u952E\u5B57\uFF0C\u5982\u300C\u6587\u4E66\u5B9A\u300D\uFF0C\u7F3A\u7701\u8FD4\u56DE\u524D N \u9879" },
|
|
1267
|
+
pageSize: { type: "integer", minimum: 1, maximum: 100, description: "\u8FD4\u56DE\u6761\u6570\uFF0C\u7F3A\u7701 50" }
|
|
1268
|
+
},
|
|
1269
|
+
{ description: "\u67E5\u8BE2\u5408\u540C\u4E13\u9879\u6A21\u5757\u5019\u9009\u503C" }
|
|
1270
|
+
),
|
|
1271
|
+
handler: async (args, env) => {
|
|
1272
|
+
const keyword = typeof args.keyword === "string" ? args.keyword.trim() : "";
|
|
1273
|
+
const pageSize = positiveInt(args.pageSize, "pageSize", 50);
|
|
1274
|
+
if (pageSize > 100) {
|
|
1275
|
+
throw archiveOaValidationError("number_invalid", "pageSize \u6700\u591A 100");
|
|
1276
|
+
}
|
|
1277
|
+
const response = await env.host.request({
|
|
1278
|
+
method: "POST",
|
|
1279
|
+
path: MODULE_BROWSER_PATH,
|
|
1280
|
+
operation: "archive-oa.contract.module-options",
|
|
1281
|
+
body: {
|
|
1282
|
+
browserMultiple: true,
|
|
1283
|
+
fromSearch: "1",
|
|
1284
|
+
controlId: MODULE_CONTROL_ID,
|
|
1285
|
+
formParam: JSON.stringify({ filterItems: [], module: "ebuilderform", dataDetails: [] }),
|
|
1286
|
+
notFromLayout: true,
|
|
1287
|
+
newly: 0,
|
|
1288
|
+
searchValue: keyword
|
|
1289
|
+
}
|
|
1290
|
+
});
|
|
1291
|
+
const data = unwrapData(response);
|
|
1292
|
+
const list = Array.isArray(data?.data) ? data.data : [];
|
|
1293
|
+
const options = list.map((item) => ({
|
|
1294
|
+
id: String(item?.id ?? ""),
|
|
1295
|
+
name: String(item?.name ?? "")
|
|
1296
|
+
})).filter((item) => item.id.length > 0 && item.name.length > 0).slice(0, pageSize);
|
|
1297
|
+
const matched = keyword ? options.filter((item) => item.name.includes(keyword)) : options;
|
|
1298
|
+
return archiveOaSuccess("archive-oa.contract.module-options", {
|
|
1299
|
+
keyword,
|
|
1300
|
+
total: matched.length,
|
|
1301
|
+
options: matched
|
|
1302
|
+
});
|
|
1303
|
+
}
|
|
1304
|
+
};
|
|
1305
|
+
|
|
1306
|
+
// src/shortcuts/archive-oa/operations/my-borrow-contract.ts
|
|
1307
|
+
import { randomBytes as randomBytes2 } from "node:crypto";
|
|
1308
|
+
var GET_DATA_PATH = "/api/ebuilder/form/eblist/getData";
|
|
1309
|
+
var GET_COUNT_PATH = "/api/ebuilder/form/eblist/getCount";
|
|
1310
|
+
var DEFAULT_PAGE_SIZE = 10;
|
|
1311
|
+
var MAX_PAGE_SIZE = 50;
|
|
1312
|
+
function filterableFields(profile) {
|
|
1313
|
+
return {
|
|
1314
|
+
customer: { id: profile.fields.customer, name: "qyf", kind: "text" },
|
|
1315
|
+
contractNo: { id: profile.fields.contractNo, name: "hth", kind: "text" },
|
|
1316
|
+
expireDate: { id: profile.fields.expireDate, name: "sqjsrq", kind: "date" }
|
|
1317
|
+
};
|
|
1318
|
+
}
|
|
1319
|
+
function today() {
|
|
1320
|
+
const now = /* @__PURE__ */ new Date();
|
|
1321
|
+
const pad = (value) => String(value).padStart(2, "0");
|
|
1322
|
+
return `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`;
|
|
1323
|
+
}
|
|
1324
|
+
function randomHex(byteLength = 16) {
|
|
1325
|
+
return randomBytes2(byteLength).toString("hex");
|
|
1326
|
+
}
|
|
1327
|
+
function assertDateText(value, field) {
|
|
1328
|
+
if (!/^\d{4}-\d{2}-\d{2}$/u.test(value)) {
|
|
1329
|
+
throw archiveOaValidationError("date_invalid", `${field} \u5FC5\u987B\u662F YYYY-MM-DD`);
|
|
1330
|
+
}
|
|
1331
|
+
return value;
|
|
1332
|
+
}
|
|
1333
|
+
function buildCondition(profile, field, funcType, value) {
|
|
1334
|
+
const isDate = field.kind === "date";
|
|
1335
|
+
return {
|
|
1336
|
+
conditionType: "and",
|
|
1337
|
+
dataType: "field",
|
|
1338
|
+
id: randomHex(),
|
|
1339
|
+
conditionComId: `${profile.compId}_advance_EXCLUDECACHE`,
|
|
1340
|
+
filterFields: [
|
|
1341
|
+
{
|
|
1342
|
+
compId: profile.compId,
|
|
1343
|
+
compType: isDate ? "DateComponent" : "Text",
|
|
1344
|
+
dataset: {
|
|
1345
|
+
isPhysical: true,
|
|
1346
|
+
relationDataset: {
|
|
1347
|
+
groupId: "690514401801175040",
|
|
1348
|
+
id: "1173842415229292544",
|
|
1349
|
+
type: "ETEAMS"
|
|
1350
|
+
},
|
|
1351
|
+
ebuilderDataConfig: { dataSetup: {}, datasetType: "sql", type: "FORM" },
|
|
1352
|
+
detailTable: false,
|
|
1353
|
+
groupId: "weaver-ebuilder-form-service",
|
|
1354
|
+
usage: "all",
|
|
1355
|
+
appId: profile.pageAppId,
|
|
1356
|
+
id: profile.objId,
|
|
1357
|
+
text: "\u6211\u501F\u9605\u7684\u5408\u540C\u6863\u6848",
|
|
1358
|
+
type: "LOGIC",
|
|
1359
|
+
objType: "vform"
|
|
1360
|
+
},
|
|
1361
|
+
fieldName: field.name,
|
|
1362
|
+
...isDate ? { formatType: "4" } : {},
|
|
1363
|
+
id: field.id,
|
|
1364
|
+
objId: profile.objId,
|
|
1365
|
+
type: isDate ? "Date" : "String",
|
|
1366
|
+
text: field.name
|
|
1367
|
+
}
|
|
1368
|
+
],
|
|
1369
|
+
funcType,
|
|
1370
|
+
value,
|
|
1371
|
+
customSelect: null
|
|
1372
|
+
};
|
|
1373
|
+
}
|
|
1374
|
+
function parseConditions(profile, fields, defaultCondition) {
|
|
1375
|
+
const aliases = filterableFields(profile);
|
|
1376
|
+
const conditions = [];
|
|
1377
|
+
let expireRange = null;
|
|
1378
|
+
if (fields !== void 0 && fields !== null) {
|
|
1379
|
+
if (!Array.isArray(fields)) {
|
|
1380
|
+
throw archiveOaValidationError("search_fields_invalid", "fields \u5FC5\u987B\u662F\u6570\u7EC4");
|
|
1381
|
+
}
|
|
1382
|
+
for (const [index, raw] of fields.entries()) {
|
|
1383
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
|
|
1384
|
+
throw archiveOaValidationError("search_fields_invalid", `fields[${index}] \u5FC5\u987B\u662F\u5BF9\u8C61`);
|
|
1385
|
+
}
|
|
1386
|
+
const item = raw;
|
|
1387
|
+
const name = String(item.field ?? "").trim();
|
|
1388
|
+
const meta = aliases[name];
|
|
1389
|
+
if (!meta) {
|
|
1390
|
+
throw archiveOaValidationError(
|
|
1391
|
+
"search_field_unknown",
|
|
1392
|
+
`fields[${index}].field \u53EA\u652F\u6301 ${Object.keys(aliases).join(" / ")}`
|
|
1393
|
+
);
|
|
1394
|
+
}
|
|
1395
|
+
if (item.value === void 0 || item.value === null || item.value === "") {
|
|
1396
|
+
throw archiveOaValidationError("search_value_required", `fields[${index}].value \u5FC5\u586B`);
|
|
1397
|
+
}
|
|
1398
|
+
if (meta.kind === "date") {
|
|
1399
|
+
if (Array.isArray(item.value) || typeof item.value === "object") {
|
|
1400
|
+
const range = Array.isArray(item.value) ? { min: String(item.value[0] ?? ""), max: String(item.value[1] ?? "") } : { min: String(item.value.min ?? ""), max: String(item.value.max ?? "") };
|
|
1401
|
+
const min = assertDateText(range.min, `fields[${index}].value.min`);
|
|
1402
|
+
const max = assertDateText(range.max, `fields[${index}].value.max`);
|
|
1403
|
+
conditions.push({ field: meta, funcType: "between", value: `${min},${max}` });
|
|
1404
|
+
if (name === "expireDate") expireRange = { min, max };
|
|
1405
|
+
continue;
|
|
1406
|
+
}
|
|
1407
|
+
const text = assertDateText(String(item.value).trim(), `fields[${index}].value`);
|
|
1408
|
+
conditions.push({ field: meta, funcType: "between", value: `${text},${text}` });
|
|
1409
|
+
if (name === "expireDate") expireRange = { min: text, max: text };
|
|
1410
|
+
continue;
|
|
1411
|
+
}
|
|
1412
|
+
if (typeof item.value !== "string") {
|
|
1413
|
+
throw archiveOaValidationError("search_value_invalid", `fields[${index}].value \u5FC5\u987B\u662F\u5B57\u7B26\u4E32`);
|
|
1414
|
+
}
|
|
1415
|
+
conditions.push({ field: meta, funcType: "like", value: item.value.trim() });
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
if (defaultCondition && !expireRange) {
|
|
1419
|
+
const min = today();
|
|
1420
|
+
conditions.push({
|
|
1421
|
+
field: { id: profile.fields.expireDate, name: "sqjsrq", kind: "date" },
|
|
1422
|
+
funcType: "between",
|
|
1423
|
+
value: `${min},${MY_BORROW_EXPIRE_MAX}`
|
|
1424
|
+
});
|
|
1425
|
+
expireRange = { min, max: MY_BORROW_EXPIRE_MAX };
|
|
1426
|
+
}
|
|
1427
|
+
return { conditions, expireRange: expireRange ?? { min: "", max: "" } };
|
|
1428
|
+
}
|
|
1429
|
+
function buildFormData(profile, values) {
|
|
1430
|
+
const form = new FormData();
|
|
1431
|
+
for (const [key, value] of Object.entries(values)) form.append(key, value);
|
|
1432
|
+
return form;
|
|
1433
|
+
}
|
|
1434
|
+
var PAGE_FILTER = JSON.stringify({ filter: {}, filterIsNull: true, esbFilter: [] });
|
|
1435
|
+
function hasArchiveFile(raw) {
|
|
1436
|
+
const text = String(raw ?? "").trim();
|
|
1437
|
+
if (!text) return false;
|
|
1438
|
+
if (text === "0" || text === "-1") return false;
|
|
1439
|
+
if (text.toLowerCase() === "null" || text.toLowerCase() === "undefined") return false;
|
|
1440
|
+
if (text === "0_0") return false;
|
|
1441
|
+
return true;
|
|
1442
|
+
}
|
|
1443
|
+
function applicantName(value) {
|
|
1444
|
+
if (Array.isArray(value)) {
|
|
1445
|
+
return value.map((item) => item && typeof item === "object" ? String(item.name ?? "") : "").filter((name) => name.length > 0).join("\u3001");
|
|
1446
|
+
}
|
|
1447
|
+
return typeof value === "string" ? value : "";
|
|
1448
|
+
}
|
|
1449
|
+
var myBorrowListOperation = {
|
|
1450
|
+
name: "archive-oa.my-borrow.list",
|
|
1451
|
+
resource: "my-borrow",
|
|
1452
|
+
method: "list",
|
|
1453
|
+
action: "archive-oa.my-borrow.list",
|
|
1454
|
+
summary: "\u67E5\u8BE2\u300C\u6211\u501F\u9605\u7684\u5408\u540C\u6863\u6848\u300D\u53F0\u8D26\uFF08eBuilder \u5217\u8868\uFF09\uFF0C\u9ED8\u8BA4\u53EA\u770B\u672A\u8FC7\u671F",
|
|
1455
|
+
capability: "my-borrow",
|
|
1456
|
+
risk: READ,
|
|
1457
|
+
inputSchema: schemaOf(
|
|
1458
|
+
{
|
|
1459
|
+
pageNo: { ...SCHEMA_PAGE_NO, description: "\u9875\u7801\uFF0C\u4ECE 1 \u5F00\u59CB\uFF0C\u7F3A\u7701 1" },
|
|
1460
|
+
pageSize: {
|
|
1461
|
+
type: "integer",
|
|
1462
|
+
minimum: 1,
|
|
1463
|
+
maximum: MAX_PAGE_SIZE,
|
|
1464
|
+
description: `\u6BCF\u9875\u6761\u6570\uFF0C\u7F3A\u7701 ${DEFAULT_PAGE_SIZE}\uFF0C\u6700\u591A ${MAX_PAGE_SIZE}`
|
|
1465
|
+
},
|
|
1466
|
+
includeExpired: {
|
|
1467
|
+
type: "boolean",
|
|
1468
|
+
description: "\u4E3A true \u65F6\u53BB\u6389\u300C\u6388\u6743\u5230\u671F\u65E5\u671F\u300D\u65F6\u95F4\u6761\u4EF6\uFF0C\u8FD4\u56DE\u5168\u90E8\uFF08\u542B\u5DF2\u8FC7\u671F\uFF09\uFF1B\u7F3A\u7701 false"
|
|
1469
|
+
},
|
|
1470
|
+
fields: {
|
|
1471
|
+
...SCHEMA_SEARCH_FIELDS,
|
|
1472
|
+
description: "\u9644\u52A0\u7B5B\u9009\uFF1Afield \u652F\u6301 customer\uFF08\u7B7E\u7EA6\u65B9 qyf\uFF0Clike\uFF09/ contractNo\uFF08\u5408\u540C\u53F7 hth\uFF0Clike\uFF09/ expireDate\uFF08\u6388\u6743\u5230\u671F\u65E5\u671F sqjsrq\uFF0Cbetween\uFF09"
|
|
1473
|
+
}
|
|
1474
|
+
},
|
|
1475
|
+
{ description: "\u67E5\u8BE2\u6211\u501F\u9605\u7684\u5408\u540C\u6863\u6848" }
|
|
1476
|
+
),
|
|
1477
|
+
handler: async (args, env) => {
|
|
1478
|
+
const profile = MY_BORROW_CONTRACT;
|
|
1479
|
+
const pageNo = positiveInt(args.pageNo, "pageNo", 1);
|
|
1480
|
+
const pageSize = positiveInt(args.pageSize, "pageSize", DEFAULT_PAGE_SIZE);
|
|
1481
|
+
if (pageSize > MAX_PAGE_SIZE) {
|
|
1482
|
+
throw archiveOaValidationError("number_invalid", `pageSize \u6700\u591A ${MAX_PAGE_SIZE}`);
|
|
1483
|
+
}
|
|
1484
|
+
const includeExpired = args.includeExpired === true;
|
|
1485
|
+
const { conditions, expireRange } = parseConditions(profile, args.fields, !includeExpired);
|
|
1486
|
+
const filter = conditions.map(
|
|
1487
|
+
(condition) => buildCondition(profile, condition.field, condition.funcType, condition.value)
|
|
1488
|
+
);
|
|
1489
|
+
const tableuid = randomHex();
|
|
1490
|
+
const session = await env.host.getSession();
|
|
1491
|
+
const dataResponse = await env.host.request({
|
|
1492
|
+
method: "POST",
|
|
1493
|
+
path: GET_DATA_PATH,
|
|
1494
|
+
operation: "archive-oa.my-borrow.list",
|
|
1495
|
+
formData: buildFormData(profile, {
|
|
1496
|
+
filter: JSON.stringify(filter),
|
|
1497
|
+
fieldFilter: "{}",
|
|
1498
|
+
pageFilter: PAGE_FILTER,
|
|
1499
|
+
pageAppId: profile.pageAppId,
|
|
1500
|
+
compId: profile.compId,
|
|
1501
|
+
pageId: profile.pageId,
|
|
1502
|
+
pageNo: String(pageNo),
|
|
1503
|
+
pageSize: String(pageSize),
|
|
1504
|
+
tableuid,
|
|
1505
|
+
refPluginPackageId: profile.refPluginPackageId
|
|
1506
|
+
})
|
|
1507
|
+
});
|
|
1508
|
+
const data = unwrapData(dataResponse) ?? {};
|
|
1509
|
+
const list = Array.isArray(data.list) ? data.list : [];
|
|
1510
|
+
const baseUrl = session.baseUrl.replace(/\/+$/u, "");
|
|
1511
|
+
const rows = list.map((row, index) => {
|
|
1512
|
+
const archiveId = String(row[profile.fields.archiveId] ?? "").trim();
|
|
1513
|
+
const available = hasArchiveFile(archiveId);
|
|
1514
|
+
const requestId = String(row[profile.fields.requestId] ?? "").trim();
|
|
1515
|
+
return {
|
|
1516
|
+
index: index + 1,
|
|
1517
|
+
applyDate: String(row[profile.fields.applyDate] ?? ""),
|
|
1518
|
+
requestId,
|
|
1519
|
+
flowUrl: requestId ? `${baseUrl}${MY_BORROW_FLOW_VIEW_PATH}/${encodeURIComponent(requestId)}` : "",
|
|
1520
|
+
customer: String(row[profile.fields.customer] ?? ""),
|
|
1521
|
+
contractNo: String(row[profile.fields.contractNo] ?? ""),
|
|
1522
|
+
archiveId,
|
|
1523
|
+
hasArchive: available,
|
|
1524
|
+
archiveUrl: available ? `${baseUrl}${MY_BORROW_ARCHIVE_OPEN_PATH}?appId=${profile.archiveAppId}&archiveId=${encodeURIComponent(archiveId)}` : "",
|
|
1525
|
+
expireDate: String(row[profile.fields.expireDate] ?? ""),
|
|
1526
|
+
applicant: applicantName(row[profile.fields.applicant])
|
|
1527
|
+
};
|
|
1528
|
+
});
|
|
1529
|
+
let total;
|
|
1530
|
+
try {
|
|
1531
|
+
const countResponse = await env.host.request({
|
|
1532
|
+
method: "POST",
|
|
1533
|
+
path: GET_COUNT_PATH,
|
|
1534
|
+
operation: "archive-oa.my-borrow.list",
|
|
1535
|
+
query: { passid: profile.objId },
|
|
1536
|
+
formData: buildFormData(profile, {
|
|
1537
|
+
tableuid,
|
|
1538
|
+
pageId: profile.pageId,
|
|
1539
|
+
compId: profile.compId,
|
|
1540
|
+
refPluginPackageId: profile.refPluginPackageId
|
|
1541
|
+
})
|
|
1542
|
+
});
|
|
1543
|
+
const countData = unwrapData(countResponse) ?? {};
|
|
1544
|
+
const parsed = Number(countData.total);
|
|
1545
|
+
if (Number.isFinite(parsed)) total = parsed;
|
|
1546
|
+
} catch {
|
|
1547
|
+
}
|
|
1548
|
+
return archiveOaSuccess(
|
|
1549
|
+
"archive-oa.my-borrow.list",
|
|
1550
|
+
{ rows },
|
|
1551
|
+
{
|
|
1552
|
+
source: profile.source,
|
|
1553
|
+
pageNo,
|
|
1554
|
+
pageSize,
|
|
1555
|
+
total,
|
|
1556
|
+
includeExpired,
|
|
1557
|
+
expireRange: includeExpired ? void 0 : expireRange
|
|
1558
|
+
}
|
|
1559
|
+
);
|
|
1560
|
+
}
|
|
1561
|
+
};
|
|
1562
|
+
|
|
1042
1563
|
// src/shortcuts/archive-oa/operations/registry.ts
|
|
1043
1564
|
function buildRegistry() {
|
|
1044
1565
|
const registry = /* @__PURE__ */ new Map();
|
|
1045
1566
|
const definitions = [
|
|
1046
1567
|
archiveLocateOperation,
|
|
1568
|
+
myBorrowListOperation,
|
|
1569
|
+
contractModuleOptionsOperation,
|
|
1047
1570
|
weaverContractFieldsOperation,
|
|
1571
|
+
qysContractFieldsOperation,
|
|
1048
1572
|
weaverContractListOperation,
|
|
1049
1573
|
qysContractListOperation,
|
|
1050
|
-
...createBorrowCarOperations(WEAVER_BORROW_CAR, WEAVER_ESB_ADD),
|
|
1051
|
-
...createBorrowCarOperations(QYS_BORROW_CAR, QYS_ESB_ADD),
|
|
1574
|
+
...createBorrowCarOperations(WEAVER_BORROW_CAR, WEAVER_ESB_ADD, WEAVER_ESB_REMOVE),
|
|
1575
|
+
...createBorrowCarOperations(QYS_BORROW_CAR, QYS_ESB_ADD, QYS_ESB_REMOVE),
|
|
1052
1576
|
createBorrowStartUrlOperation(WEAVER_BORROW_CAR),
|
|
1053
1577
|
createBorrowStartUrlOperation(QYS_BORROW_CAR)
|
|
1054
1578
|
];
|
|
@@ -1275,6 +1799,15 @@ var archiveOaShortcut = {
|
|
|
1275
1799
|
contract.command("fields").description("List searchable fields of Weaver business contracts").action(action(async (ctx) => {
|
|
1276
1800
|
await executeAndPrint(ctx, "archive-oa.contract.fields", {});
|
|
1277
1801
|
}));
|
|
1802
|
+
const myBorrow = command.command("my-borrow").description("My borrowed contract archives (eBuilder list)");
|
|
1803
|
+
withJsonInputOptions(myBorrow.command("list").description("List contract archives I borrowed (default: not expired)").option("--page-no <page>", "page number, starts from 1").option("--page-size <size>", "page size, default 10, max 50").option("--include-expired", "include expired borrows (drop the expire-date filter)")).action(action(async (ctx, options) => {
|
|
1804
|
+
const opts = asOptions(options);
|
|
1805
|
+
await executeAndPrint(ctx, "archive-oa.my-borrow.list", await archiveOaInputFrom(options, {
|
|
1806
|
+
pageNo: intOption(opts.pageNo),
|
|
1807
|
+
pageSize: intOption(opts.pageSize),
|
|
1808
|
+
includeExpired: opts.includeExpired === true ? true : void 0
|
|
1809
|
+
}));
|
|
1810
|
+
}));
|
|
1278
1811
|
const qys = command.command("qys").description("Qiyuesuo (case) contract commands");
|
|
1279
1812
|
withJsonInputOptions(qys.command("list").description("Query Qiyuesuo collaboration contracts (default archived only)").option("--page-no <page>", "page number, starts from 1")).action(action(async (ctx, options) => {
|
|
1280
1813
|
const opts = asOptions(options);
|
|
@@ -1305,6 +1838,21 @@ var archiveOaShortcut = {
|
|
|
1305
1838
|
confirm: opts.yes === true ? true : void 0
|
|
1306
1839
|
}));
|
|
1307
1840
|
}));
|
|
1841
|
+
withJsonInputOptions(borrowCar.command("remove-prepare").description("Prepare removing entries from the borrow car (max 6)").option("--source <source>", "weaver or qys, default weaver").option("--data-ids <ids>", "comma separated borrow car row ids")).action(action(async (ctx, options) => {
|
|
1842
|
+
const opts = asOptions(options);
|
|
1843
|
+
const source = resolveSource(opts.source);
|
|
1844
|
+
await executeAndPrint(ctx, borrowCarOperation("remove.prepare", source), await archiveOaInputFrom(options, {
|
|
1845
|
+
dataIds: stringListOption(opts.dataIds)
|
|
1846
|
+
}));
|
|
1847
|
+
}));
|
|
1848
|
+
withJsonInputOptions(borrowCar.command("remove-apply").description("Apply removing entries from the borrow car").option("--continuation <token>", "continuation token from prepare").option("--source <source>", "weaver or qys, default weaver").option("--yes", "confirm the write operation")).action(action(async (ctx, options) => {
|
|
1849
|
+
const opts = asOptions(options);
|
|
1850
|
+
const source = resolveSource(opts.source);
|
|
1851
|
+
await executeAndPrint(ctx, borrowCarOperation("remove.apply", source), await archiveOaInputFrom(options, {
|
|
1852
|
+
continuation: stringOption(opts.continuation),
|
|
1853
|
+
confirm: opts.yes === true ? true : void 0
|
|
1854
|
+
}));
|
|
1855
|
+
}));
|
|
1308
1856
|
const borrow = command.command("borrow").description("Borrow workflow commands");
|
|
1309
1857
|
withJsonInputOptions(borrow.command("start-url").description("Build the borrow workflow page URL from borrow car entries").option("--source <source>", "weaver or qys, default weaver").option("--contract-nos <nos>", "comma separated contract numbers from borrow car, max 6")).action(action(async (ctx, options) => {
|
|
1310
1858
|
const opts = asOptions(options);
|