weaver-work-cli 0.1.70 → 0.1.73
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-VUTREF3P.js → archive-THZV4ND4.js} +22 -5
- package/dist/chunks/{archive-oa-VXXO4RTB.js → archive-oa-PQ23OLEV.js} +17 -5
- package/dist/chunks/{asset-45U6TY7I.js → asset-RGPROZYH.js} +22 -5
- package/dist/chunks/{asset-idle-YCRBMTIT.js → asset-idle-Z2PDX7NA.js} +15 -5
- package/dist/chunks/{attachment-content-DMU7KNZ7.js → attachment-content-R3RPVOYE.js} +3 -3
- package/dist/chunks/{blog-5AML4WMG.js → blog-7U3QZPIF.js} +25 -5
- package/dist/chunks/{caizhilian-3P7BUNHT.js → caizhilian-3AB42GCV.js} +22 -8
- package/dist/chunks/{calendar-2HUXM3CZ.js → calendar-KINM64E4.js} +15 -5
- package/dist/chunks/{chunk-EHH363SP.js → chunk-2CHGUYMG.js} +4 -4
- package/dist/chunks/{chunk-GWM5TLIK.js → chunk-2XED2FKY.js} +34 -34
- package/dist/chunks/{chunk-DVFA3ODS.js → chunk-35A56FJ7.js} +12 -0
- package/dist/chunks/{chunk-QYDSTYGG.js → chunk-4BXR6CNB.js} +3 -3
- package/dist/chunks/{chunk-KDOJW5LH.js → chunk-4I26YMBY.js} +1 -1
- package/dist/chunks/{chunk-X6PMJQGO.js → chunk-4YXAK6OA.js} +19 -8
- package/dist/chunks/{chunk-HG6INLH6.js → chunk-54ST55IJ.js} +28 -7
- package/dist/chunks/{chunk-DSBV4GRK.js → chunk-6HT73VOI.js} +3 -3
- package/dist/chunks/{chunk-4W6BSNIL.js → chunk-7QFVXP2X.js} +6 -6
- package/dist/chunks/{chunk-I5XB4MZT.js → chunk-AMAPQVBT.js} +95 -65
- package/dist/chunks/{chunk-L2A3COWV.js → chunk-BWYVS62Z.js} +4 -4
- package/dist/chunks/{chunk-UPVAQJKS.js → chunk-DRUND2PJ.js} +130 -79
- package/dist/chunks/{chunk-LJE7RZNC.js → chunk-F4HM25K4.js} +1 -1
- package/dist/chunks/{chunk-T24EBWAZ.js → chunk-GAMGDNTF.js} +48 -21
- package/dist/chunks/{chunk-H2NRTGZR.js → chunk-GWJLAF6B.js} +3 -3
- package/dist/chunks/{chunk-XIBMZEDB.js → chunk-IBSJJGXL.js} +2 -2
- package/dist/chunks/{chunk-VZUH3LKI.js → chunk-ICP53R52.js} +167 -157
- package/dist/chunks/{chunk-LRKKKO5A.js → chunk-IU6UB2TD.js} +3 -4
- package/dist/chunks/{chunk-GTAFCAVP.js → chunk-IZCQU5D5.js} +1 -1
- package/dist/chunks/{chunk-727VKJQK.js → chunk-JMJBPP4B.js} +2 -2
- package/dist/chunks/{chunk-UVWW5ABZ.js → chunk-L7TYG5SN.js} +3 -3
- package/dist/chunks/{chunk-HAORST2G.js → chunk-LLCMOZ5L.js} +11 -11
- package/dist/chunks/{chunk-U3OO3IZF.js → chunk-NUP4RYZK.js} +20 -7
- package/dist/chunks/{chunk-IVCOZCAW.js → chunk-PAFOLIYQ.js} +1 -1
- package/dist/chunks/{chunk-LSVA7QA6.js → chunk-R3MK2RBN.js} +3 -1
- package/dist/chunks/{chunk-GFOFUH6O.js → chunk-TV46Q4NY.js} +52 -51
- package/dist/chunks/chunk-WM33BSIL.js +136 -0
- package/dist/chunks/{chunk-7CINV2BU.js → chunk-XZBYRYWX.js} +2 -2
- package/dist/chunks/{chunk-E7VWE2XI.js → chunk-ZWLWXHJC.js} +3 -3
- package/dist/chunks/{conflict-YW5BULJ3.js → conflict-VPAR7E6F.js} +2 -2
- package/dist/chunks/{contract-3PMHUASH.js → contract-DDXAO2DZ.js} +48 -5
- package/dist/chunks/{cowork-FZBTTBYX.js → cowork-34QCHMDD.js} +37 -8
- package/dist/chunks/{create-flow-5OBS3B3V.js → create-flow-52PU2OBI.js} +6 -6
- package/dist/chunks/{data-2YZ6A6TL.js → data-CLQ62QGD.js} +99 -184
- package/dist/chunks/{ebuilder-form-AWPTMZBZ.js → ebuilder-form-W5R7Q22S.js} +17 -7
- package/dist/chunks/{ehr-MNPR4TE5.js → ehr-LCNAVMK5.js} +67 -17
- package/dist/chunks/{entry-mode-L65OWPFM.js → entry-mode-6Z3ZV3DE.js} +3 -3
- package/dist/chunks/{env-XW7LYIME.js → env-RDKWAARB.js} +2 -2
- package/dist/chunks/{esb-GSB5QCEX.js → esb-ANKPUU65.js} +17 -7
- package/dist/chunks/{factory-MHFZZAGH.js → factory-434B7RAT.js} +1 -1
- package/dist/chunks/{fna-XBSNUS2V.js → fna-AKBSG5HI.js} +15 -5
- package/dist/chunks/{group-chat-EEOLO5NM.js → group-chat-PROTW22R.js} +3 -3
- package/dist/chunks/{host-NVDG3NC6.js → host-5R2SNFWD.js} +4 -4
- package/dist/chunks/{host-2UMNXX5H.js → host-7FJW4E7R.js} +4 -4
- package/dist/chunks/{host-XVWBOSEN.js → host-CGXUFQO4.js} +4 -4
- package/dist/chunks/{host-R7BP3CTI.js → host-PDJAKCT7.js} +6 -4
- package/dist/chunks/{host-SYPCA63D.js → host-WO4L5G5I.js} +4 -4
- package/dist/chunks/{host-BD44ASOD.js → host-XIYG4F4B.js} +4 -4
- package/dist/chunks/{hrm-FZUDJAND.js → hrm-WGODDTEH.js} +15 -6
- package/dist/chunks/{im-F5NENPD7.js → im-YKTKAJU3.js} +16 -6
- package/dist/chunks/{invoice-DS6FLU55.js → invoice-PVYCCCVM.js} +27 -6
- package/dist/chunks/{jiuchuanhui-JCBUR563.js → jiuchuanhui-RKOQW7BY.js} +19 -6
- package/dist/chunks/{lazy-dispatch-F6O2EPGR.js → lazy-dispatch-DW45AFQ5.js} +6 -6
- package/dist/chunks/{mail-ZEOSANEJ.js → mail-BNB5S4NW.js} +116 -97
- package/dist/chunks/{meeting-PCD5EPBF.js → meeting-O2KDJH66.js} +29 -16
- package/dist/chunks/{minute-doc-WTZJVCHG.js → minute-doc-JUCG56GY.js} +4 -4
- package/dist/chunks/{okr-OZUMTMCL.js → okr-LWFGWOE7.js} +15 -5
- package/dist/chunks/{operations-LQY3FTPH.js → operations-2WHIF5WV.js} +1 -1
- package/dist/chunks/{operations-UTUWFJTX.js → operations-532PN5OB.js} +5 -5
- package/dist/chunks/{performance-SMVTPK6T.js → performance-7W5COCFU.js} +92 -7
- package/dist/chunks/{plan-C2NENH42.js → plan-ZVY3IYTL.js} +15 -5
- package/dist/chunks/{project-FAJ2P3UR.js → project-SA62B7MH.js} +18 -5
- package/dist/chunks/{reception-NH6MJFPR.js → reception-NGIONPQ3.js} +128 -49
- package/dist/chunks/{recruit-stage-DPEFHLSE.js → recruit-stage-WOSN6MGP.js} +1264 -197
- package/dist/chunks/{registry-FTPUUHWC.js → registry-N7P3W2RD.js} +5 -5
- package/dist/chunks/{registry-3B3OAJYX.js → registry-R72GWXOG.js} +4 -4
- package/dist/chunks/{registry-ZQ7OONCB.js → registry-RIQ67ZT7.js} +12 -12
- package/dist/chunks/{room-recommend-73NBN3RU.js → room-recommend-KCGIVUFR.js} +4 -4
- package/dist/chunks/{schedule-SDBOBBUQ.js → schedule-6UP27HQ4.js} +4 -4
- package/dist/chunks/{smart-extract-GTYKF5TJ.js → smart-extract-DDOQSPRB.js} +19 -6
- package/dist/chunks/{workflow-OWHWLAOX.js → workflow-V5ALD6QZ.js} +22 -8
- package/dist/cmd/auth/index.js +23 -0
- package/dist/cmd/e10/index.js +2 -1
- package/dist/cmd/index.js +2 -0
- package/dist/core/manifest-view.js +207 -0
- package/dist/core/output.js +42 -8
- package/dist/index.js +35 -35
- package/dist/internal/e10/auth/crypto.js +18 -8
- package/dist/internal/e10/auth/error-log.js +1 -2
- package/dist/internal/e10/auth/messages.js +2 -3
- package/dist/internal/e10/auth/xiaoe.js +1 -1
- package/dist/internal/e10/tls-policy.js +61 -13
- package/dist/shortcuts/archive/index.js +11 -2
- package/dist/shortcuts/archive/operations/download.js +1 -0
- package/dist/shortcuts/archive/operations/flow-url.js +3 -0
- package/dist/shortcuts/archive/operations/prelib.js +2 -0
- package/dist/shortcuts/archive/operations/upload.js +1 -0
- package/dist/shortcuts/archive-oa/index.js +11 -2
- package/dist/shortcuts/archive-oa/operations/borrow-car.js +2 -0
- package/dist/shortcuts/asset/index.js +11 -2
- package/dist/shortcuts/asset/manifest.js +7 -0
- package/dist/shortcuts/asset-idle/index.js +11 -2
- package/dist/shortcuts/blog/index.js +11 -2
- package/dist/shortcuts/blog/manifest.js +10 -0
- package/dist/shortcuts/caizhilian/host.js +20 -4
- package/dist/shortcuts/caizhilian/index.js +12 -2
- package/dist/shortcuts/caizhilian/manifest.js +4 -25
- package/dist/shortcuts/caizhilian/operations/handlers/search.js +34 -0
- package/dist/shortcuts/caizhilian/operations/registry.js +25 -1
- package/dist/shortcuts/calendar/index.js +11 -2
- package/dist/shortcuts/contract/index.js +11 -2
- package/dist/shortcuts/contract/manifest.js +32 -0
- package/dist/shortcuts/contract/operations/write.js +3 -0
- package/dist/shortcuts/cowork/index.js +21 -5
- package/dist/shortcuts/cowork/manifest.js +3 -0
- package/dist/shortcuts/cowork/operations/discuss-write.js +2 -0
- package/dist/shortcuts/cowork/operations/item-write.js +3 -0
- package/dist/shortcuts/cowork/operations/member-write.js +2 -0
- package/dist/shortcuts/cowork/operations/permission-write.js +2 -0
- package/dist/shortcuts/cowork/operations/review-write.js +1 -0
- package/dist/shortcuts/data/errors.js +16 -29
- package/dist/shortcuts/data/host.js +16 -7
- package/dist/shortcuts/data/index.js +12 -41
- package/dist/shortcuts/data/manifest.js +5 -44
- package/dist/shortcuts/data/operations/attend.js +2 -2
- package/dist/shortcuts/data/operations/conf.js +0 -88
- package/dist/shortcuts/data/operations/ds.js +4 -4
- package/dist/shortcuts/data/operations/index.js +1 -5
- package/dist/shortcuts/data/operations/module.js +40 -14
- package/dist/shortcuts/data/operations/query.js +2 -2
- package/dist/shortcuts/ebuilder-form/index.js +11 -2
- package/dist/shortcuts/ebuilder-form/manifest.js +12 -0
- package/dist/shortcuts/ehr/index.js +11 -2
- package/dist/shortcuts/ehr/operations/attend-write.js +51 -8
- package/dist/shortcuts/ehr/operations/recruit-position.js +4 -3
- package/dist/shortcuts/ehr/operations/recruit-short-cache.js +6 -2
- package/dist/shortcuts/ehr/operations/recruit-write.js +3 -3
- package/dist/shortcuts/ehr/operations/recruit.js +206 -82
- package/dist/shortcuts/ehr/operations/shared.js +31 -0
- package/dist/shortcuts/esb/index.js +11 -2
- package/dist/shortcuts/esb/manifest.js +2 -0
- package/dist/shortcuts/fna/index.js +11 -2
- package/dist/shortcuts/hrm/index.js +11 -1
- package/dist/shortcuts/im/index.js +11 -2
- package/dist/shortcuts/invoice/index.js +11 -2
- package/dist/shortcuts/invoice/manifest.js +8 -0
- package/dist/shortcuts/jiuchuanhui/index.js +15 -1
- package/dist/shortcuts/jiuchuanhui/manifest.js +2 -0
- package/dist/shortcuts/mail/errors.js +14 -0
- package/dist/shortcuts/mail/index.js +23 -6
- package/dist/shortcuts/mail/manifest.js +11 -4
- package/dist/shortcuts/mail/operations/mail-blacklist.js +6 -6
- package/dist/shortcuts/mail/operations/mail-contacts.js +10 -10
- package/dist/shortcuts/mail/operations/mail-manage.js +15 -14
- package/dist/shortcuts/mail/operations/mail-read.js +7 -25
- package/dist/shortcuts/mail/operations/mail-send.js +12 -12
- package/dist/shortcuts/mail/operations/mail-sign.js +10 -10
- package/dist/shortcuts/mail/operations/mail-template.js +10 -10
- package/dist/shortcuts/meeting/index.js +11 -2
- package/dist/shortcuts/meeting/operations/invitation-publish.js +1 -0
- package/dist/shortcuts/okr/index.js +11 -2
- package/dist/shortcuts/performance/index.js +62 -3
- package/dist/shortcuts/performance/scheme-validate.js +7 -0
- package/dist/shortcuts/performance/shared.js +40 -2
- package/dist/shortcuts/plan/index.js +11 -2
- package/dist/shortcuts/project/index.js +11 -2
- package/dist/shortcuts/project/operations/write.js +3 -0
- package/dist/shortcuts/reception/constants.js +22 -0
- package/dist/shortcuts/reception/index.js +15 -2
- package/dist/shortcuts/reception/manifest.js +17 -3
- package/dist/shortcuts/reception/operations/ask.js +3 -0
- package/dist/shortcuts/reception/operations/doc.js +24 -11
- package/dist/shortcuts/reception/operations/docrender.js +18 -1
- package/dist/shortcuts/reception/operations/render-assets.js +93 -22
- package/dist/shortcuts/recruit-stage/context.js +12 -6
- package/dist/shortcuts/recruit-stage/index.js +22 -3
- package/dist/shortcuts/recruit-stage/manifest.js +2 -0
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +19 -10
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +487 -38
- package/dist/shortcuts/recruit-stage/operations/list.js +72 -1
- package/dist/shortcuts/recruit-stage/operations/profile.js +194 -0
- package/dist/shortcuts/recruit-stage/operations/registry.js +20 -2
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +258 -63
- package/dist/shortcuts/recruit-stage/operations/search.js +226 -27
- package/dist/shortcuts/recruit-stage/operations/shortlist.js +122 -0
- package/dist/shortcuts/recruit-stage/operations/tag.js +17 -3
- package/dist/shortcuts/recruit-stage/shared.js +158 -4
- package/dist/shortcuts/smart-extract/index.js +11 -2
- package/dist/shortcuts/smart-extract/manifest.js +1 -0
- package/dist/shortcuts/smart-extract/operations/save.js +2 -0
- package/dist/shortcuts/workflow/index.js +21 -1
- package/dist/shortcuts/workflow/operations/form.js +36 -2
- package/dist/shortcuts/workflow/operations/read.js +2 -2
- package/dist/shortcuts/workflow/operations/write.js +1 -1
- package/docs/caizhilian.md +1 -1
- package/docs/contract.md +1 -0
- package/docs/data.md +22 -22
- package/docs/e10-auth.md +41 -33
- package/docs/ehr.md +2 -0
- package/docs/reception.md +4 -3
- package/package.json +1 -1
- package/scripts/pysite/__pycache__/sitecustomize.cpython-312.pyc +0 -0
- package/scripts/pysite/__pycache__/sitecustomize.cpython-313.pyc +0 -0
- package/scripts/pysite/sitecustomize.py +41 -0
- package/skill-template/domains/data.md +4 -4
- package/skills/weaver-e10-caizhilian/SKILL.md +1 -1
- package/skills/weaver-e10-caizhilian/references/org-browser.md +1 -0
- package/skills/weaver-e10-cowork/SKILL.md +3 -1
- package/skills/weaver-e10-data/SKILL.md +12 -16
- package/skills/weaver-e10-data/references/config-center.md +6 -7
- package/skills/weaver-e10-data/references/datasource.md +1 -1
- package/skills/weaver-e10-data/references/scene-and-misc.md +2 -2
- package/skills/weaver-e10-jiuchuanhui/SKILL.md +6 -4
- package/skills/weaver-e10-jiuchuanhui/references/clue.md +2 -2
- package/skills/weaver-e10-jiuchuanhui/references/customer.md +18 -8
- package/skills/weaver-e10-jiuchuanhui/references/sale.md +2 -2
- package/skills/weaver-e10-jucailin/SKILL.md +7 -3
- package/skills/weaver-e10-jucailin/references/attend-write.md +1 -1
- package/skills/weaver-e10-jucailin/references/recruit-output-links.md +33 -0
- package/skills/weaver-e10-jucailin/references/recruit-write.md +2 -0
- package/skills/weaver-e10-mail/SKILL.md +4 -1
- package/skills/weaver-e10-mail/references/mail-read.md +4 -2
- package/skills/weaver-e10-mail/references/safety-boundaries.md +1 -0
- package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
- package/skills/weaver-e10-performance/SKILL.md +8 -6
- package/skills/weaver-e10-reception-flow/SKILL.md +97 -41
- package/skills/weaver-e10-reception-flow/references/guide.md +3 -1
- package/skills/weaver-e10-recruit-stage/SKILL.md +557 -75
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +67 -44
- package/skills/weaver-e10-recruit-stage/lib/interview-conflict.mjs +279 -0
- package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +198 -0
- package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +697 -0
- package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +507 -0
- package/skills/weaver-e10-recruit-stage/references/env-fixed-values.md +87 -0
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +19 -18
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +19 -18
- package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-detail-process.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +15 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-failure-fallback.md +37 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +4 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +64 -28
- package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +43 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-maint.md +41 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +4 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-my-positions.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +25 -7
- package/skills/weaver-e10-recruit-stage/references/recruit-platform-compat.md +51 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +63 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +4 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +58 -33
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +4 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +5 -5
- package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +11 -10
- package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +2 -2
- package/skills/weaver-e10-recruit-stage/templates/candidate-evidence.html +106 -0
- package/skills/weaver-e10-recruit-stage/templates/interview-summary.html +325 -0
- package/skills/weaver-e10-recruit-stage/templates/match-report.html +265 -0
- package/skills/weaver-e10-shared/SKILL.md +22 -1
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +2 -2
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +3 -3
- package/skills/weaver-e10-jucailin/references/source-manifest.json +0 -152
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
2
2
|
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
MANIFEST_LIST_COMPACT_PATHS,
|
|
5
|
+
manifestView,
|
|
6
|
+
schemaOptionsOf
|
|
7
|
+
} from "./chunk-WM33BSIL.js";
|
|
3
8
|
import {
|
|
4
9
|
E10ApiError,
|
|
5
10
|
createE10RequestRuntime,
|
|
6
11
|
isE10SessionExpiredResponse,
|
|
7
12
|
requireE10Session
|
|
8
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-IU6UB2TD.js";
|
|
9
14
|
import {
|
|
10
15
|
E10_SESSION_EXPIRED_MESSAGE
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-IZCQU5D5.js";
|
|
17
|
+
import "./chunk-AMAPQVBT.js";
|
|
13
18
|
import {
|
|
14
19
|
CliError
|
|
15
20
|
} from "./chunk-UG5G54VL.js";
|
|
@@ -19,15 +24,6 @@ import "./chunk-BUSC6UAE.js";
|
|
|
19
24
|
import { readFile } from "node:fs/promises";
|
|
20
25
|
|
|
21
26
|
// src/shortcuts/data/errors.ts
|
|
22
|
-
var DataExit = {
|
|
23
|
-
OK: 0,
|
|
24
|
-
AUTH: 2,
|
|
25
|
-
JSON: 3,
|
|
26
|
-
PERM: 4,
|
|
27
|
-
HRM: 6,
|
|
28
|
-
HTTP: 7,
|
|
29
|
-
USAGE: 8
|
|
30
|
-
};
|
|
31
27
|
var DataCliError = class extends CliError {
|
|
32
28
|
type;
|
|
33
29
|
subtype;
|
|
@@ -36,7 +32,7 @@ var DataCliError = class extends CliError {
|
|
|
36
32
|
stage;
|
|
37
33
|
details;
|
|
38
34
|
constructor(type, subtype, message, options = {}) {
|
|
39
|
-
super(message, options.exitCode ??
|
|
35
|
+
super(message, options.exitCode ?? 5 /* InternalError */);
|
|
40
36
|
this.name = "DataCliError";
|
|
41
37
|
this.type = type;
|
|
42
38
|
this.subtype = subtype;
|
|
@@ -46,31 +42,39 @@ var DataCliError = class extends CliError {
|
|
|
46
42
|
this.details = options.details;
|
|
47
43
|
}
|
|
48
44
|
};
|
|
49
|
-
function dataValidationError(subtype, message,
|
|
50
|
-
return new DataCliError("validation", subtype, message, { exitCode });
|
|
45
|
+
function dataValidationError(subtype, message, details) {
|
|
46
|
+
return new DataCliError("validation", subtype, message, { exitCode: 2 /* UsageError */, details });
|
|
51
47
|
}
|
|
52
48
|
function dataAuthError(subtype, message, details) {
|
|
53
|
-
return new DataCliError("authentication", subtype, message, { exitCode:
|
|
49
|
+
return new DataCliError("authentication", subtype, message, { exitCode: 3 /* AuthError */, details });
|
|
54
50
|
}
|
|
55
|
-
function dataNetworkError(subtype, message,
|
|
56
|
-
return new DataCliError("network", subtype, message, {
|
|
51
|
+
function dataNetworkError(subtype, message, options = {}) {
|
|
52
|
+
return new DataCliError("network", subtype, message, {
|
|
53
|
+
...options,
|
|
54
|
+
retryable: options.retryable ?? true,
|
|
55
|
+
exitCode: 4 /* NetworkError */
|
|
56
|
+
});
|
|
57
57
|
}
|
|
58
58
|
function dataApiError(subtype, message, options = {}) {
|
|
59
59
|
return new DataCliError("api", subtype, message, {
|
|
60
60
|
code: options.code,
|
|
61
61
|
details: options.details,
|
|
62
|
-
|
|
62
|
+
stage: options.stage,
|
|
63
|
+
exitCode: 1 /* GeneralError */
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
|
-
function
|
|
66
|
-
return new DataCliError("policy",
|
|
66
|
+
function dataPolicyError(subtype, message, details) {
|
|
67
|
+
return new DataCliError("policy", subtype, message, { exitCode: 6 /* PolicyError */, details });
|
|
68
|
+
}
|
|
69
|
+
function dataPermissionBlocked(message, details) {
|
|
70
|
+
return dataPolicyError("permission_restricted", message, details);
|
|
67
71
|
}
|
|
68
72
|
function dataHrmBlocked(apiPath) {
|
|
69
73
|
return new DataCliError(
|
|
70
74
|
"policy",
|
|
71
75
|
"hrm_path_blocked",
|
|
72
76
|
`\u8BE5\u63A5\u53E3\u547D\u4E2D HRM \u8DEF\u5F84\u9ED1\u540D\u5355\uFF08${apiPath}\uFF09\u2192 \u4EBA\u5458/\u90E8\u95E8/\u5C97\u4F4D\u4E00\u5F8B\u8D70 weaver-work-cli \u7684 hrm \u5B50\u547D\u4EE4\uFF0C\u7981\u6B62\u76F4\u8C03`,
|
|
73
|
-
{ exitCode:
|
|
77
|
+
{ exitCode: 6 /* PolicyError */, details: { apiPath } }
|
|
74
78
|
);
|
|
75
79
|
}
|
|
76
80
|
|
|
@@ -153,7 +157,12 @@ function createDataHost(ctx, dependencies = {}) {
|
|
|
153
157
|
} catch (error) {
|
|
154
158
|
if (error instanceof E10ApiError) {
|
|
155
159
|
if (error.type === "authentication") throw dataAuthError("session_expired", error.message);
|
|
156
|
-
if (error.type === "network")
|
|
160
|
+
if (error.type === "network") {
|
|
161
|
+
throw dataNetworkError(error.subtype, error.message, {
|
|
162
|
+
retryable: error.retryable,
|
|
163
|
+
details: error.details
|
|
164
|
+
});
|
|
165
|
+
}
|
|
157
166
|
}
|
|
158
167
|
throw error;
|
|
159
168
|
}
|
|
@@ -165,7 +174,7 @@ function createDataHost(ctx, dependencies = {}) {
|
|
|
165
174
|
return { status: response.status, text: response.text, value: null };
|
|
166
175
|
}
|
|
167
176
|
throw dataNetworkError("non_json", `HTTP ${response.status} \u975E JSON \u54CD\u5E94: ${response.text.slice(0, 300)}`, {
|
|
168
|
-
status: response.
|
|
177
|
+
details: { httpStatus: response.status, preview: response.text.slice(0, 300) }
|
|
169
178
|
});
|
|
170
179
|
}
|
|
171
180
|
return { status: response.status, text: response.text, value: response.value };
|
|
@@ -173,10 +182,15 @@ function createDataHost(ctx, dependencies = {}) {
|
|
|
173
182
|
async function request(request2) {
|
|
174
183
|
const { status, value, text: text2 } = await requestText(request2);
|
|
175
184
|
if (status < 200 || status >= 300) {
|
|
176
|
-
throw
|
|
185
|
+
throw dataNetworkError("http_error", `\u63A5\u53E3 HTTP ${status}`, {
|
|
186
|
+
retryable: status >= 500,
|
|
177
187
|
code: status,
|
|
178
|
-
details: { status, body: String(text2 ?? "").slice(0, 500) }
|
|
179
|
-
|
|
188
|
+
details: { httpStatus: status, body: String(text2 ?? "").slice(0, 500) }
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
if (value === null) {
|
|
192
|
+
throw dataApiError("non_json", `HTTP ${status} \u8FD4\u56DE\u975E JSON \u54CD\u5E94`, {
|
|
193
|
+
details: { httpStatus: status, preview: String(text2 ?? "").slice(0, 500) }
|
|
180
194
|
});
|
|
181
195
|
}
|
|
182
196
|
return value;
|
|
@@ -501,10 +515,9 @@ async function executeQuery(input, host) {
|
|
|
501
515
|
if (code !== void 0 && String(code) !== "200" && String(code) !== "0") {
|
|
502
516
|
const message = String(response?.msg || "");
|
|
503
517
|
if (/没有权限|无权限|权限不足|未授权|无权访问|无查询权限/i.test(message)) {
|
|
504
|
-
throw
|
|
518
|
+
throw dataPolicyError(
|
|
505
519
|
"permission_denied",
|
|
506
|
-
"\u5F53\u524D\u7528\u6237\u5BF9\u8BE5\u6570\u636E\u65E0\u67E5\u8BE2\u6743\u9650\uFF0C\u8BF7\u68C0\u67E5\u767B\u5F55\u6001\u662F\u5426\u6709\u6548\u6216\u8054\u7CFB\u7BA1\u7406\u5458\u5F00\u901A"
|
|
507
|
-
4
|
|
520
|
+
"\u5F53\u524D\u7528\u6237\u5BF9\u8BE5\u6570\u636E\u65E0\u67E5\u8BE2\u6743\u9650\uFF0C\u8BF7\u68C0\u67E5\u767B\u5F55\u6001\u662F\u5426\u6709\u6548\u6216\u8054\u7CFB\u7BA1\u7406\u5458\u5F00\u901A"
|
|
508
521
|
);
|
|
509
522
|
}
|
|
510
523
|
}
|
|
@@ -941,10 +954,9 @@ async function dsFind(input, host) {
|
|
|
941
954
|
const okScan = scan.filter((result) => !result.error);
|
|
942
955
|
const errs = scan.filter((result) => result.error);
|
|
943
956
|
if (!okScan.length && errs.length && errs.some((result) => /登录态失效|401/.test(String(result.error)))) {
|
|
944
|
-
throw
|
|
957
|
+
throw dataAuthError(
|
|
945
958
|
"session_expired",
|
|
946
|
-
"\u767B\u5F55\u6001\u5931\u6548\uFF1A\u8BF7\u91CD\u65B0\u767B\u5F55 weaver-work-cli\uFF08`weaver-work-cli auth login --base-url <\u57DF\u540D>`\uFF09\u540E\u91CD\u8BD5\uFF08\u672C\u6B21\u672A\u53D6\u5230\u4EFB\u4F55\u5206\u7EC4\uFF09"
|
|
947
|
-
2
|
|
959
|
+
"\u767B\u5F55\u6001\u5931\u6548\uFF1A\u8BF7\u91CD\u65B0\u767B\u5F55 weaver-work-cli\uFF08`weaver-work-cli auth login --base-url <\u57DF\u540D>`\uFF09\u540E\u91CD\u8BD5\uFF08\u672C\u6B21\u672A\u53D6\u5230\u4EFB\u4F55\u5206\u7EC4\uFF09"
|
|
948
960
|
);
|
|
949
961
|
}
|
|
950
962
|
const candidates = mergeCandidates(scan, input.limit);
|
|
@@ -1128,7 +1140,7 @@ async function dsDescribe(input, host) {
|
|
|
1128
1140
|
data.permissionNote = groupId === "weaver-ebuilder-form-service" ? "\u8BE5\u5206\u7EC4\u662F EB \u5EFA\u6A21\u8868\u5355\uFF1A\u53D6\u6570\u4E0D\u518D\u505A\u6743\u9650\u524D\u7F6E\u6821\u9A8C\uFF0C--app-id \u76F4\u63A5\u53D6 ebdf_obj.app_id\uFF08obj_id = ebdf_obj.id = \u6570\u636E\u6E90 tableId\uFF09" : "\u975E EB \u5206\u7EC4\uFF0C\u6570\u636E\u6E90\u901A\u9053\u65E0\u9700 appId";
|
|
1129
1141
|
data.elapsedMs = Date.now() - startedAt;
|
|
1130
1142
|
if (errors.length && input.require) {
|
|
1131
|
-
throw
|
|
1143
|
+
throw dataApiError("describe_failed", `describe \u5B58\u5728\u5931\u8D25\u5206\u652F\uFF0C--require \u4E0B\u4E0D\u7EE7\u7EED\uFF1A${JSON.stringify(errors)}`, { details: { errors } });
|
|
1132
1144
|
}
|
|
1133
1145
|
const fields = data.fields || {};
|
|
1134
1146
|
const lexicon = data.lexicon || {};
|
|
@@ -1171,10 +1183,9 @@ async function attendStatis(input, host) {
|
|
|
1171
1183
|
if (String(response?.code) !== "200") {
|
|
1172
1184
|
const message = String(response?.msg || "");
|
|
1173
1185
|
if (/没有权限|无权限|权限不足|未授权|无权访问|无查询权限/i.test(message)) {
|
|
1174
|
-
throw
|
|
1186
|
+
throw dataPolicyError(
|
|
1175
1187
|
"permission_denied",
|
|
1176
|
-
"\u5F53\u524D\u7528\u6237\u5BF9\u8BE5\u4EBA\u5458\u8003\u52E4\u6570\u636E\u65E0\u67E5\u8BE2\u6743\u9650\uFF0C\u8BF7\u68C0\u67E5\u767B\u5F55\u6001\u6216\u8054\u7CFB\u7BA1\u7406\u5458\u5F00\u901A"
|
|
1177
|
-
4
|
|
1188
|
+
"\u5F53\u524D\u7528\u6237\u5BF9\u8BE5\u4EBA\u5458\u8003\u52E4\u6570\u636E\u65E0\u67E5\u8BE2\u6743\u9650\uFF0C\u8BF7\u68C0\u67E5\u767B\u5F55\u6001\u6216\u8054\u7CFB\u7BA1\u7406\u5458\u5F00\u901A"
|
|
1178
1189
|
);
|
|
1179
1190
|
}
|
|
1180
1191
|
return { data: response, text: `code=${response?.code} msg=${message}` };
|
|
@@ -1490,9 +1501,6 @@ var CONF_PREFIX_TYPE = [["CONN_", "conn"], ["DS_", "ds"], ["WF_", "wf"], ["API_"
|
|
|
1490
1501
|
var CONF_GET_PATH = "/api/dw/newetl/chatBi/getChatBiConfigMap";
|
|
1491
1502
|
var CONF_BATCH_PATH = "/api/dw/newetl/chatBi/batchGetChatBiConfigMap";
|
|
1492
1503
|
var CONF_BATCH_GROUP_PATH = "/api/dw/newetl/chatBi/batchGetChatBiConfigMapByTypeAndGroup";
|
|
1493
|
-
var CONF_ADD_PATH = "/api/dw/newetl/chatBi/batchAddChatBiConfigMap";
|
|
1494
|
-
var CONF_UPDATE_PATH = "/api/dw/newetl/chatBi/updateChatBiConfigMap";
|
|
1495
|
-
var CONF_DELETE_PATH = "/api/dw/newetl/chatBi/deleteChatBiConfigMap";
|
|
1496
1504
|
var CONF_TOKEN_RE = /#\{([A-Z][A-Z0-9_]{2,})\}/g;
|
|
1497
1505
|
function confKeyType(key, explicitType) {
|
|
1498
1506
|
if (typeof explicitType === "string" && explicitType) return explicitType;
|
|
@@ -1738,85 +1746,6 @@ async function confResolveFile(input, host) {
|
|
|
1738
1746
|
const result = await resolveText(host, text2, input.group);
|
|
1739
1747
|
return { data: result, text: result.output };
|
|
1740
1748
|
}
|
|
1741
|
-
async function confAdd(input, host) {
|
|
1742
|
-
const key = positionals(input, "keys")[0] || (typeof input.key === "string" ? input.key : "");
|
|
1743
|
-
if (!key || input.value === void 0) {
|
|
1744
|
-
throw dataValidationError("missing_argument", "conf add \u7F3A\u5C11 confKey/confValue\uFF08\u7528\u6CD5: conf add <key> --value <\u771F\u5B9E\u503C>\uFF09");
|
|
1745
|
-
}
|
|
1746
|
-
const confType = confKeyType(key, input.type);
|
|
1747
|
-
if (!input.force && await confGetData(host, confType, key, true, input.group)) {
|
|
1748
|
-
process.stderr.write(`[config-resolve] \u914D\u7F6E\u5DF2\u5B58\u5728\uFF0C\u8DF3\u8FC7\u65B0\u589E\uFF08\u5982\u9700\u4FEE\u6539\u8BF7\u7528 conf update\uFF09: ${key}
|
|
1749
|
-
`);
|
|
1750
|
-
return { data: null, text: `\u5DF2\u5B58\u5728\uFF0C\u8DF3\u8FC7: ${key}` };
|
|
1751
|
-
}
|
|
1752
|
-
const item = putGroup({
|
|
1753
|
-
confType,
|
|
1754
|
-
confKey: key,
|
|
1755
|
-
confValue: String(input.value),
|
|
1756
|
-
confAttrs: input.attrs || "",
|
|
1757
|
-
confName: input.name || ""
|
|
1758
|
-
}, confType, input.group);
|
|
1759
|
-
const response = await host.request({ method: "POST", path: CONF_ADD_PATH, body: [item], operation: "conf.add" });
|
|
1760
|
-
return {
|
|
1761
|
-
data: response,
|
|
1762
|
-
text: `\u65B0\u589E\u6210\u529F: ${item.confGroup ? `${item.confGroup}/` : ""}${key} = ${item.confValue}`
|
|
1763
|
-
};
|
|
1764
|
-
}
|
|
1765
|
-
async function confAddFile(input, host) {
|
|
1766
|
-
const raw = input.add_file ?? positionals(input, "keys")[0];
|
|
1767
|
-
if (raw === void 0) throw dataValidationError("missing_argument", "conf add-file \u7F3A\u5C11\u53C2\u6570\uFF08\u7528\u6CD5: conf add-file @items.json\uFF09");
|
|
1768
|
-
const parsed = readJsonArg(String(raw), "--add-file");
|
|
1769
|
-
const list = Array.isArray(parsed) ? parsed : [parsed];
|
|
1770
|
-
const toAdd = [];
|
|
1771
|
-
for (const item of list) {
|
|
1772
|
-
if (!item.confKey || item.confValue === void 0) continue;
|
|
1773
|
-
const confType = item.confType || confKeyType(item.confKey, input.type);
|
|
1774
|
-
const group = item.confGroup !== void 0 ? item.confGroup : input.group;
|
|
1775
|
-
if (await confGetData(host, confType, item.confKey, true, group)) {
|
|
1776
|
-
process.stderr.write(`[config-resolve] \u5DF2\u5B58\u5728\u8DF3\u8FC7: ${item.confKey}
|
|
1777
|
-
`);
|
|
1778
|
-
continue;
|
|
1779
|
-
}
|
|
1780
|
-
toAdd.push(putGroup({
|
|
1781
|
-
confType,
|
|
1782
|
-
confKey: item.confKey,
|
|
1783
|
-
confValue: String(item.confValue),
|
|
1784
|
-
confAttrs: item.confAttrs || "",
|
|
1785
|
-
confName: item.confName || ""
|
|
1786
|
-
}, confType, group));
|
|
1787
|
-
}
|
|
1788
|
-
if (!toAdd.length) return { data: null, text: "\u5168\u90E8\u5DF2\u5B58\u5728\uFF0C\u65E0\u65B0\u589E" };
|
|
1789
|
-
const response = await host.request({ method: "POST", path: CONF_ADD_PATH, body: toAdd, operation: "conf.add-file" });
|
|
1790
|
-
return { data: response, text: `\u6279\u91CF\u65B0\u589E ${toAdd.length} \u6761\u6210\u529F` };
|
|
1791
|
-
}
|
|
1792
|
-
async function confUpdate(input, host) {
|
|
1793
|
-
const key = positionals(input, "keys")[0] || (typeof input.key === "string" ? input.key : "");
|
|
1794
|
-
if (!key) throw dataValidationError("missing_argument", "conf update \u7F3A\u5C11 confKey");
|
|
1795
|
-
if (input.value === void 0 && input.name === void 0 && input.attrs === void 0) {
|
|
1796
|
-
throw dataValidationError("nothing_to_update", "conf update \u81F3\u5C11\u9700\u63D0\u4F9B --value / --name / --attrs \u4E4B\u4E00");
|
|
1797
|
-
}
|
|
1798
|
-
const confType = confKeyType(key, input.type);
|
|
1799
|
-
const body = putGroup({ confType, confKey: key }, confType, input.group);
|
|
1800
|
-
if (input.value !== void 0) body.confValue = String(input.value);
|
|
1801
|
-
if (input.name !== void 0) body.confName = input.name;
|
|
1802
|
-
if (input.attrs !== void 0) body.confAttrs = input.attrs;
|
|
1803
|
-
const response = await host.request({ method: "POST", path: CONF_UPDATE_PATH, body, operation: "conf.update" });
|
|
1804
|
-
return { data: response, text: `\u66F4\u65B0\u6210\u529F: ${body.confGroup ? `${body.confGroup}/` : ""}${key}` };
|
|
1805
|
-
}
|
|
1806
|
-
async function confDelete(input, host) {
|
|
1807
|
-
const key = positionals(input, "keys")[0] || (typeof input.key === "string" ? input.key : "");
|
|
1808
|
-
if (!key) throw dataValidationError("missing_argument", "conf delete \u7F3A\u5C11 confKey");
|
|
1809
|
-
const confType = confKeyType(key, input.type);
|
|
1810
|
-
const response = await host.request({
|
|
1811
|
-
method: "DELETE",
|
|
1812
|
-
path: `${CONF_DELETE_PATH}?confType=${encodeURIComponent(confType)}&confKey=${encodeURIComponent(key)}${groupSuffix(confType, input.group)}`,
|
|
1813
|
-
operation: "conf.delete"
|
|
1814
|
-
});
|
|
1815
|
-
return {
|
|
1816
|
-
data: response,
|
|
1817
|
-
text: `\u5220\u9664\u6210\u529F: ${useGroup(confType, input.group) && input.group ? `${input.group}/` : ""}${key}`
|
|
1818
|
-
};
|
|
1819
|
-
}
|
|
1820
1749
|
function attributesOf(record) {
|
|
1821
1750
|
const attrs = record?.confAttrs;
|
|
1822
1751
|
if (!attrs) return {};
|
|
@@ -1833,6 +1762,26 @@ import { readFileSync as readFileSync3 } from "node:fs";
|
|
|
1833
1762
|
var HRM_PATTERNS = ["/api/hrm/", "/api/bs/hrm/", "/api/app/hrm/"];
|
|
1834
1763
|
var PERM_WORDS = ["\u6CA1\u6709\u6743\u9650", "\u65E0\u6743\u9650", "\u6743\u9650\u4E0D\u8DB3", "\u672A\u6388\u6743", "\u65E0\u6743\u8BBF\u95EE", "\u65E0\u67E5\u8BE2\u6743\u9650"];
|
|
1835
1764
|
var INVOICE_TOKEN_PATH = "/api/inc/proxy/getToken?appType=1";
|
|
1765
|
+
var READ_NAME_RE = /查询|获取|取得|读取|列表|清单|明细|详情|统计|计数|搜索|检索|查找|查看|分页|报表|query|get|list|count|search|find|fetch|read|detail|stat|report|page|info/i;
|
|
1766
|
+
var WRITE_NAME_RE = /新增|创建|添加|修改|更新|删除|保存|提交|审批|审核|发布|撤回|撤销|驳回|拒绝|发送|通知|提醒|导入|上传|下载|同步|执行|启动|停止|关闭|启用|禁用|绑定|解绑|分配|转交|归档|清空|create|add|insert|update|delete|remove|save|submit|approve|audit|publish|withdraw|revoke|reject|send|notify|remind|import|upload|download|sync|execute|start|stop|close|enable|disable|bind|unbind|assign|transfer|archive|clear/i;
|
|
1767
|
+
function assertReadOnlyApiName(apiName, confKey) {
|
|
1768
|
+
const name = String(apiName || "").trim();
|
|
1769
|
+
const details = { apiName: name || null, confKey };
|
|
1770
|
+
if (WRITE_NAME_RE.test(name)) {
|
|
1771
|
+
throw dataPolicyError(
|
|
1772
|
+
"module_write_interface_blocked",
|
|
1773
|
+
`\u5DF2\u963B\u65AD\u7591\u4F3C\u5199\u64CD\u4F5C\u63A5\u53E3\uFF1A${name || confKey}\uFF08module call \u4EC5\u5141\u8BB8\u540D\u79F0\u53EF\u660E\u786E\u8BC6\u522B\u4E3A\u8BFB\u53D6\u7684\u63A5\u53E3\uFF09`,
|
|
1774
|
+
details
|
|
1775
|
+
);
|
|
1776
|
+
}
|
|
1777
|
+
if (!READ_NAME_RE.test(name)) {
|
|
1778
|
+
throw dataPolicyError(
|
|
1779
|
+
"module_read_interface_unverified",
|
|
1780
|
+
`\u5DF2\u963B\u65AD\u63A5\u53E3\uFF1A${name || confKey}\uFF08\u63A5\u53E3\u540D\u79F0\u65E0\u6CD5\u660E\u786E\u5224\u5B9A\u4E3A\u8BFB\u53D6\u64CD\u4F5C\uFF1B\u4EC5\u53EF\u7528 --show-params \u6216 --dry-run \u9884\u89C8\uFF09`,
|
|
1781
|
+
details
|
|
1782
|
+
);
|
|
1783
|
+
}
|
|
1784
|
+
}
|
|
1836
1785
|
function queryStringOf2(obj) {
|
|
1837
1786
|
const params = new URLSearchParams();
|
|
1838
1787
|
for (const [key, value] of Object.entries(obj || {})) {
|
|
@@ -1896,17 +1845,17 @@ function loadConfFile(path) {
|
|
|
1896
1845
|
try {
|
|
1897
1846
|
raw = readFileSync3(path, "utf-8");
|
|
1898
1847
|
} catch (error) {
|
|
1899
|
-
throw
|
|
1848
|
+
throw dataValidationError("conf_file_unreadable", `\u8BFB --conf-file \u5931\u8D25\uFF1A${error.message}\uFF08${path}\uFF09`);
|
|
1900
1849
|
}
|
|
1901
1850
|
let parsed;
|
|
1902
1851
|
try {
|
|
1903
1852
|
parsed = JSON.parse(raw.replace(/^\uFEFF/, "").trim());
|
|
1904
1853
|
} catch {
|
|
1905
|
-
throw
|
|
1854
|
+
throw dataValidationError("conf_file_invalid", `--conf-file \u4E0D\u662F\u5408\u6CD5 JSON\uFF1A${path}`);
|
|
1906
1855
|
}
|
|
1907
1856
|
if (Array.isArray(parsed)) parsed = parsed[0] || {};
|
|
1908
1857
|
if (!parsed || typeof parsed !== "object") {
|
|
1909
|
-
throw
|
|
1858
|
+
throw dataValidationError("conf_file_invalid", `--conf-file \u5F62\u6001\u5F02\u5E38\uFF08\u671F\u671B\u5BF9\u8C61\uFF09\uFF1A${path}`);
|
|
1910
1859
|
}
|
|
1911
1860
|
if (parsed.confAttrs !== void 0 || parsed.confValue !== void 0 && parsed.api_path === void 0) {
|
|
1912
1861
|
const attrs = attributesOf(parsed);
|
|
@@ -1954,11 +1903,11 @@ async function moduleCall(input, host) {
|
|
|
1954
1903
|
try {
|
|
1955
1904
|
record = await confGetData(host, confType, confKey, false, group);
|
|
1956
1905
|
} catch (error) {
|
|
1906
|
+
if (error instanceof DataCliError) throw error;
|
|
1957
1907
|
const message = String(error?.message || error);
|
|
1958
1908
|
throw dataApiError(
|
|
1959
1909
|
"conf_get_failed",
|
|
1960
|
-
`conf get \u5931\u8D25\uFF1A${message}\uFF08\u5148\u6838\u5BF9 confType / confGroup / confKey\uFF1B\u81EA\u5B9A\u4E49 confType \u987B\u663E\u5F0F --type\uFF1B\u767B\u5F55\u6001\u95EE\u9898\u8BF7\u91CD\u65B0\u767B\u5F55\uFF09
|
|
1961
|
-
{ code: /登录态失效/.test(message) ? 2 : 3 }
|
|
1910
|
+
`conf get \u5931\u8D25\uFF1A${message}\uFF08\u5148\u6838\u5BF9 confType / confGroup / confKey\uFF1B\u81EA\u5B9A\u4E49 confType \u987B\u663E\u5F0F --type\uFF1B\u767B\u5F55\u6001\u95EE\u9898\u8BF7\u91CD\u65B0\u767B\u5F55\uFF09`
|
|
1962
1911
|
);
|
|
1963
1912
|
}
|
|
1964
1913
|
attrs = attributesOf(record);
|
|
@@ -2061,6 +2010,7 @@ async function moduleCall(input, host) {
|
|
|
2061
2010
|
};
|
|
2062
2011
|
return { data: out2, text: JSON.stringify(out2, null, 1) };
|
|
2063
2012
|
}
|
|
2013
|
+
assertReadOnlyApiName(apiName, confKey);
|
|
2064
2014
|
const headers = { ...extraHeaders };
|
|
2065
2015
|
const trustedHeaders = {};
|
|
2066
2016
|
if (effMethod === "POST") headers["Content-Type"] = isForm ? "application/x-www-form-urlencoded;charset=UTF-8" : "application/json;charset=UTF-8";
|
|
@@ -2073,7 +2023,9 @@ async function moduleCall(input, host) {
|
|
|
2073
2023
|
token = null;
|
|
2074
2024
|
}
|
|
2075
2025
|
if (!token) {
|
|
2076
|
-
throw dataApiError("invoice_token_missing", `\u672A\u53D6\u5230\u53D1\u7968\u4E91 Token\uFF08INVOICE \u4E1A\u52A1\u63A5\u53E3\u5FC5\u9700\uFF1BHTTP ${tokenResponse.status}\uFF09`, {
|
|
2026
|
+
throw dataApiError("invoice_token_missing", `\u672A\u53D6\u5230\u53D1\u7968\u4E91 Token\uFF08INVOICE \u4E1A\u52A1\u63A5\u53E3\u5FC5\u9700\uFF1BHTTP ${tokenResponse.status}\uFF09`, {
|
|
2027
|
+
details: { httpStatus: tokenResponse.status }
|
|
2028
|
+
});
|
|
2077
2029
|
}
|
|
2078
2030
|
trustedHeaders.token = token;
|
|
2079
2031
|
}
|
|
@@ -2091,7 +2043,11 @@ async function moduleCall(input, host) {
|
|
|
2091
2043
|
operation: `module.call:${confKey}`
|
|
2092
2044
|
});
|
|
2093
2045
|
if (status === 401) {
|
|
2094
|
-
throw
|
|
2046
|
+
throw dataAuthError(
|
|
2047
|
+
"login_required",
|
|
2048
|
+
"\u767B\u5F55\u6001\u5931\u6548(HTTP 401)\uFF1A\u8BF7\u6267\u884C `weaver-work-cli auth login --base-url <\u57DF\u540D>` \u91CD\u65B0\u767B\u5F55",
|
|
2049
|
+
{ httpStatus: 401 }
|
|
2050
|
+
);
|
|
2095
2051
|
}
|
|
2096
2052
|
let obj = null;
|
|
2097
2053
|
try {
|
|
@@ -2102,7 +2058,10 @@ async function moduleCall(input, host) {
|
|
|
2102
2058
|
if (obj === null) {
|
|
2103
2059
|
const out2 = { ok: status >= 200 && status < 300, api_name: apiName, http: status, nonJson: text2.slice(0, 2e3) };
|
|
2104
2060
|
if (status < 200 || status >= 300) {
|
|
2105
|
-
throw
|
|
2061
|
+
throw dataNetworkError("non_json", `HTTP ${status} \u4E14\u54CD\u5E94\u975E JSON\uFF08\u5DF2\u539F\u6837\u8F93\u51FA\u524D 2000 \u5B57\u7B26\uFF09`, {
|
|
2062
|
+
retryable: false,
|
|
2063
|
+
details: { httpStatus: status, ...out2 }
|
|
2064
|
+
});
|
|
2106
2065
|
}
|
|
2107
2066
|
return { data: out2, text: text2.slice(0, 2e3) };
|
|
2108
2067
|
}
|
|
@@ -2140,9 +2099,10 @@ async function moduleCall(input, host) {
|
|
|
2140
2099
|
for (const flag of flags) lines.push(`[!] ${flag}`);
|
|
2141
2100
|
lines.push(...tipsLines(tips));
|
|
2142
2101
|
if (flags.some((flag) => flag.startsWith("hasSearchRight=false"))) {
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2102
|
+
throw dataPermissionBlocked(
|
|
2103
|
+
"\u6743\u9650\u53D7\u9650\uFF1AhasSearchRight=false\uFF08\u7ACB\u5373\u7EC8\u6B62\uFF0C\u4E0D\u91CD\u8BD5\u3001\u4E0D\u6362\u53C2\u3001\u4E0D\u4EA4\u4ED8\u4E3A\u300C\u65E0\u6570\u636E\u300D\uFF09",
|
|
2104
|
+
{ result: out }
|
|
2105
|
+
);
|
|
2146
2106
|
}
|
|
2147
2107
|
return { data: out, text: lines.join("\n") };
|
|
2148
2108
|
}
|
|
@@ -2362,10 +2322,6 @@ var DEFINITIONS = [
|
|
|
2362
2322
|
{ name: "data.conf.group-file", summary: "\u6309\u6587\u4EF6\u6279\u91CF\u53D6\u591A\u4E2A\u5206\u7EC4\u7684\u914D\u7F6E", capability: "config", handler: confGroupFile, command: "conf group-file" },
|
|
2363
2323
|
{ name: "data.conf.resolve", summary: "\u628A\u6587\u672C\u91CC\u7684 #{KEY} \u5360\u4F4D\u7B26\u66FF\u6362\u4E3A\u914D\u7F6E\u503C", capability: "config", handler: confResolve, command: "conf resolve" },
|
|
2364
2324
|
{ name: "data.conf.resolve-file", summary: "\u6309\u6587\u4EF6\u66FF\u6362 #{KEY} \u5360\u4F4D\u7B26", capability: "config", handler: confResolveFile, command: "conf resolve-file" },
|
|
2365
|
-
{ name: "data.conf.add", summary: "\u65B0\u589E\u914D\u7F6E\uFF08\u5DF2\u5B58\u5728\u9ED8\u8BA4\u8DF3\u8FC7\uFF0C--force \u91CD\u5EFA\uFF09", capability: "config", handler: confAdd, command: "conf add" },
|
|
2366
|
-
{ name: "data.conf.add-file", summary: "\u6309\u6587\u4EF6\u6279\u91CF\u65B0\u589E\u914D\u7F6E\uFF08\u5DF2\u5B58\u5728\u7684\u8DF3\u8FC7\uFF09", capability: "config", handler: confAddFile, command: "conf add-file" },
|
|
2367
|
-
{ name: "data.conf.update", summary: "\u66F4\u65B0\u914D\u7F6E\u7684 value / name / attrs", capability: "config", handler: confUpdate, command: "conf update" },
|
|
2368
|
-
{ name: "data.conf.delete", summary: "\u5220\u9664\u914D\u7F6E", capability: "config", handler: confDelete, command: "conf delete" },
|
|
2369
2325
|
{ name: "data.scene.groups", summary: "\u573A\u666F\u5206\u7EC4\u9AA8\u67B6\uFF08getSceneGroups\uFF09", capability: "scene", handler: sceneGroups, command: "scene groups" },
|
|
2370
2326
|
{ name: "data.scene.items", summary: "\u7EC4\u5185\u6761\u76EE\uFF08\u63A5\u53E3 / \u6570\u636E\u6E90\uFF0C\u542B\u53D6\u6570\u901A\u9053\u53C2\u6570\uFF09", capability: "scene", handler: sceneItems, command: "scene items" },
|
|
2371
2327
|
{ name: "data.scene.search", summary: "\u5173\u952E\u8BCD\u5019\u9009\u53EC\u56DE\uFF08\u540E\u7AEF keyword \u4F18\u5148\uFF0C\u672C\u5730\u6253\u5206\u515C\u5E95\uFF09", capability: "scene", handler: sceneSearch, command: "scene search" },
|
|
@@ -2432,10 +2388,6 @@ var INPUT_SCHEMAS = {
|
|
|
2432
2388
|
"data.conf.group-file": { required: ["group_file"], optional: [] },
|
|
2433
2389
|
"data.conf.resolve": { required: ["text"], optional: ["group"] },
|
|
2434
2390
|
"data.conf.resolve-file": { required: ["path"], optional: ["group"] },
|
|
2435
|
-
"data.conf.add": { required: ["key", "value"], optional: ["name", "attrs", "type", "group", "force"] },
|
|
2436
|
-
"data.conf.add-file": { required: ["add_file"], optional: ["type", "group"] },
|
|
2437
|
-
"data.conf.update": { required: ["key"], optional: ["value", "name", "attrs", "type", "group"] },
|
|
2438
|
-
"data.conf.delete": { required: ["key"], optional: ["type", "group"] },
|
|
2439
2391
|
"data.scene.groups": { required: [], optional: ["client"] },
|
|
2440
2392
|
"data.scene.items": { required: ["group"], optional: ["client"] },
|
|
2441
2393
|
"data.scene.search": {
|
|
@@ -2494,10 +2446,6 @@ function inputSchemaOf(name) {
|
|
|
2494
2446
|
};
|
|
2495
2447
|
}
|
|
2496
2448
|
var WRITE_RISK = /* @__PURE__ */ new Set([
|
|
2497
|
-
"data.conf.add",
|
|
2498
|
-
"data.conf.add-file",
|
|
2499
|
-
"data.conf.update",
|
|
2500
|
-
"data.conf.delete",
|
|
2501
2449
|
"data.module.call"
|
|
2502
2450
|
]);
|
|
2503
2451
|
var dataOperations = operationDefinitions().map((definition) => ({
|
|
@@ -2528,37 +2476,12 @@ var dataManifest = {
|
|
|
2528
2476
|
"`ds.find` \u7684 `/ds/listByPage` \u7AEF\u70B9\u5F53\u524D\u5FFD\u7565 name \u21D2 \u672A\u547D\u4E2D\u53EA\u4EE3\u8868\u672A\u843D\u5728\u6293\u53D6\u7A97\u53E3\u5185\uFF0C\u4E0D\u7B49\u4E8E\u8868\u4E0D\u5B58\u5728\u3002",
|
|
2529
2477
|
"`module call` \u7684 `token` \u5934\u5728\u8FD0\u884C\u65F6\u5C5E\u4FDD\u7559\u5934\uFF0C\u5FC5\u987B\u8D70 trustedHeaders\uFF08INVOICE \u5DF2\u5185\u7F6E\u6362\u53D6\u903B\u8F91\uFF09\u3002",
|
|
2530
2478
|
"\u4EBA\u5458 / \u90E8\u95E8 / \u5C97\u4F4D\u4E00\u5F8B\u8D70 `weaver-work-cli hrm`\uFF1Bdata \u901A\u9053\u5BF9 /api/hrm/ \u8DEF\u5F84\u6709\u9ED1\u540D\u5355\uFF08\u9000\u51FA\u7801 6\uFF09\u3002",
|
|
2531
|
-
"`hasSearchRight=false` \u662F\u6743\u9650\u53D7\u9650\uFF08\u7EC8\u7AEF\u6001\uFF09\uFF1A\u7ED3\u679C\u7167\u5E38\u7ED9\u51FA\u4F46\u9000\u51FA\u7801
|
|
2532
|
-
"`field name2id`\uFF08\u540D\u79F0\u2192\u5B57\u6BB5\u503C id\uFF09\u4E0E `ds fields`\uFF08\u5B57\u6BB5\u5143\u6570\u636E\uFF09\u662F\u4E24\u4EF6\u4E8B\uFF1B
|
|
2479
|
+
"`hasSearchRight=false` \u662F\u6743\u9650\u53D7\u9650\uFF08\u7EC8\u7AEF\u6001\uFF09\uFF1A\u7ED3\u679C\u7167\u5E38\u7ED9\u51FA\u4F46\u9000\u51FA\u7801 6\uFF0C\u4E0D\u5F97\u4EA4\u4ED8\u4E3A\u300C\u65E0\u6570\u636E\u300D\u3002",
|
|
2480
|
+
"`field name2id`\uFF08\u540D\u79F0\u2192\u5B57\u6BB5\u503C id\uFF09\u4E0E `ds fields`\uFF08\u5B57\u6BB5\u5143\u6570\u636E\uFF09\u662F\u4E24\u4EF6\u4E8B\uFF1B\u9009\u9879\u503C\u663E\u793A\u6620\u5C04\u4F7F\u7528 `field options`\u3002",
|
|
2533
2481
|
"`attribution metric` \u53D6\u7684\u662F**\u5F52\u56E0\u5206\u6790\u8BBE\u7F6E**\uFF08\u6307\u6807\u53E3\u5F84 / \u53EF\u5173\u8054\u7EF4\u5EA6 / \u4E0B\u94BB\u8DEF\u5F84\uFF09\uFF0C\u4E0E `noun scope` \u7684\u8BCD\u5E93\u89E3\u91CA\u4E0D\u540C\uFF1B\u5F52\u56E0\u5206\u6790\u4F18\u5148\u7528\u8FD9\u91CC\u7684\u8BBE\u7F6E\uFF0C\u672A\u914D\u7F6E\u65F6\u624D\u56DE\u9000\u901A\u7528\u6D41\u7A0B\u3002"
|
|
2534
2482
|
],
|
|
2535
2483
|
operations: dataOperations,
|
|
2536
|
-
withheldOperations: [
|
|
2537
|
-
{
|
|
2538
|
-
name: "data.doc.count",
|
|
2539
|
-
reason: "\u6587\u6863\u6570\u91CF\u7531\u914D\u7F6E\u4E2D\u5FC3 DOCUMENT.POST_DOCUMENT_DOCUMENT_LIST_COUNT \u8986\u76D6\uFF08conf group api DOCUMENT \u2192 module call\uFF09\uFF0C\u4E0D\u5728 data \u6A21\u5757\u91CD\u590D\u5C01\u88C5\u3002"
|
|
2540
|
-
},
|
|
2541
|
-
{
|
|
2542
|
-
name: "data.doc.list",
|
|
2543
|
-
reason: "\u540C\u4E0A\uFF1ADOCUMENT.POST_DOCUMENT_DOCUMENT_LIST\u3002\u6CE8\u610F documentList \u7684 data.total \u5B9E\u6D4B\u6052\u4E3A 0\uFF0C\u603B\u91CF\u5FC5\u987B\u53D6 count \u63A5\u53E3\u3002"
|
|
2544
|
-
},
|
|
2545
|
-
{
|
|
2546
|
-
name: "data.field.id2name",
|
|
2547
|
-
reason: "\u5DF2\u505C\u7528\uFF1A\u6280\u80FD\u91CC 19 \u5904\u5747\u4E3A\u7981\u4EE4\uFF1B\u8BE5\u5B9E\u73B0\u6253\u7684\u662F /api/bcw/test/testRemoteBrowser \u63A2\u9488\u63A5\u53E3\u3002\u9009\u9879\u503C\u663E\u793A\u6620\u5C04\u6539\u8D70 field options\u3002"
|
|
2548
|
-
},
|
|
2549
|
-
{
|
|
2550
|
-
name: "data.refusal.get",
|
|
2551
|
-
reason: "\u62D2\u7B54\u8BDD\u672F\u5C5E\u667A\u80FD\u95EE\u6570\u5BBF\u4E3B\u5E73\u53F0\u804C\u8D23\uFF1B\u573A\u666F\u6280\u80FD\u660E\u786E\u300C\u4E0D\u505A\u62D2\u7B54 / \u8BDD\u672F\u5224\u5B9A\u300D\uFF0C\u8FC1\u5165\u53EA\u4F1A\u6269\u51FA\u4E00\u4E2A\u88AB\u7981\u6B62\u8C03\u7528\u7684\u5165\u53E3\u3002"
|
|
2552
|
-
},
|
|
2553
|
-
{
|
|
2554
|
-
name: "data.refusal.rules",
|
|
2555
|
-
reason: "\u540C\u4E0A\uFF1AgetRefusalSpeechRules \u7531\u5E73\u53F0\u5728\u52A0\u8F7D\u5B8C\u6210 / \u53D6\u6570\u524D / \u4EA4\u4ED8\u524D\u81EA\u884C\u62C9\u53D6\u5E76\u66FF\u6362\u8BDD\u672F\u3002"
|
|
2556
|
-
},
|
|
2557
|
-
{
|
|
2558
|
-
name: "data.exp.*",
|
|
2559
|
-
reason: "\u4E13\u5BB6\u5305\u8FDC\u7AEF\u7248\u672C\u7BA1\u7406\u5C5E `weaver-work-cli skills repo \u2026` \u8D44\u6E90\u57DF\uFF0C\u4E0D\u8FDB data\u3002"
|
|
2560
|
-
}
|
|
2561
|
-
]
|
|
2484
|
+
withheldOperations: []
|
|
2562
2485
|
};
|
|
2563
2486
|
|
|
2564
2487
|
// src/shortcuts/data/index.ts
|
|
@@ -2629,8 +2552,12 @@ var dataShortcut = {
|
|
|
2629
2552
|
category: "shortcut",
|
|
2630
2553
|
register({ program, action }) {
|
|
2631
2554
|
const data = program.command("data").description("\u6CDB\u5FAEE10\u6570\u636E\u52A9\u624B\uFF08DSL \u67E5\u8BE2 / \u6570\u636E\u6E90\u53D1\u73B0 / \u914D\u7F6E\u4E2D\u5FC3 / \u573A\u666F\u5B9A\u4F4D\uFF09");
|
|
2632
|
-
data.command("schema").description("Print data operation manifest for agents").action(action((ctx) => {
|
|
2633
|
-
|
|
2555
|
+
data.command("schema").description("Print data operation manifest for agents").option("--list", '\u53EA\u5217\u64CD\u4F5C\u6E05\u5355\uFF08name/summary/risk\uFF09\uFF0C\u5168\u91CF\u4E0D\u622A\u65AD\uFF1B\u5224\u65AD"\u6709\u6CA1\u6709\u67D0\u64CD\u4F5C"\u7528\u8FD9\u4E2A').option("--operation <name>", "\u53EA\u8F93\u51FA\u5355\u4E2A\u64CD\u4F5C\u7684\u5B8C\u6574\u5951\u7EA6\uFF08\u542B inputSchema\uFF0C\u4F53\u79EF\u8FDC\u4F4E\u4E8E\u9884\u7B97\uFF09").option("--full", "\u6253\u5370\u5B8C\u6574 manifest\uFF08\u8D85 stdout \u9884\u7B97\u4F1A\u843D\u672C\u5730 ref\uFF0C\u7528 refs get \u5206\u9875\u53D6\uFF09").action(action((ctx, options) => {
|
|
2556
|
+
const schema = schemaOptionsOf(options);
|
|
2557
|
+
ctx.output.write(manifestView(dataManifest, schema), {
|
|
2558
|
+
json: true,
|
|
2559
|
+
...schema.list === true ? { compactPaths: MANIFEST_LIST_COMPACT_PATHS } : {}
|
|
2560
|
+
});
|
|
2634
2561
|
}));
|
|
2635
2562
|
data.command("run").description("Run a data operation with JSON input").argument("<operation>", `operation name, e.g. data.ds.count\uFF08\u5171 ${operationNames().length} \u4E2A\uFF09`).option("--input <path>", "JSON input file, or - for stdin").option("--input-json <json>", "inline JSON input object").action(action(async (ctx, operation, options) => {
|
|
2636
2563
|
await run(ctx, String(operation), await inputFrom(options), true);
|
|
@@ -2709,18 +2636,6 @@ var dataShortcut = {
|
|
|
2709
2636
|
conf.command("resolve-file").description("\u6309\u6587\u4EF6\u66FF\u6362 #{KEY} \u5360\u4F4D\u7B26").argument("<path>", "\u6587\u672C\u6587\u4EF6\u8DEF\u5F84").option("--group <confGroup>", "confGroup").action(action(async (ctx, path, options) => {
|
|
2710
2637
|
await run(ctx, "data.conf.resolve-file", { ...toInput(options), path }, false);
|
|
2711
2638
|
}));
|
|
2712
|
-
conf.command("add").description("\u65B0\u589E\u914D\u7F6E\uFF08\u5DF2\u5B58\u5728\u9ED8\u8BA4\u8DF3\u8FC7\uFF09").argument("<key>", "confKey").option("--value <v>", "\u914D\u7F6E\u503C").option("--name <n>", "\u914D\u7F6E\u540D\u79F0").option("--attrs <json>", "confAttrs").option("--type <confType>", "confType").option("--group <confGroup>", "confGroup").option("--force", "\u5DF2\u5B58\u5728\u65F6\u4E5F\u91CD\u5EFA").action(action(async (ctx, key, options) => {
|
|
2713
|
-
await run(ctx, "data.conf.add", { ...toInput(options), keys: [key] }, false);
|
|
2714
|
-
}));
|
|
2715
|
-
conf.command("add-file").description("\u6309\u6587\u4EF6\u6279\u91CF\u65B0\u589E\u914D\u7F6E").argument("<file>", "JSON \u6587\u4EF6").option("--type <confType>", "confType").option("--group <confGroup>", "confGroup").action(action(async (ctx, file, options) => {
|
|
2716
|
-
await run(ctx, "data.conf.add-file", { ...toInput(options), add_file: file }, false);
|
|
2717
|
-
}));
|
|
2718
|
-
conf.command("update").description("\u66F4\u65B0\u914D\u7F6E\u7684 value / name / attrs").argument("<key>", "confKey").option("--value <v>", "\u914D\u7F6E\u503C").option("--name <n>", "\u914D\u7F6E\u540D\u79F0").option("--attrs <json>", "confAttrs").option("--type <confType>", "confType").option("--group <confGroup>", "confGroup").action(action(async (ctx, key, options) => {
|
|
2719
|
-
await run(ctx, "data.conf.update", { ...toInput(options), keys: [key] }, false);
|
|
2720
|
-
}));
|
|
2721
|
-
conf.command("delete").description("\u5220\u9664\u914D\u7F6E").argument("<key>", "confKey").option("--type <confType>", "confType").option("--group <confGroup>", "confGroup").action(action(async (ctx, key, options) => {
|
|
2722
|
-
await run(ctx, "data.conf.delete", { ...toInput(options), keys: [key] }, false);
|
|
2723
|
-
}));
|
|
2724
2639
|
const scene = data.command("scene").description("\u573A\u666F\u5B9A\u4F4D\u5143\u6570\u636E\uFF08getSceneGroups\uFF09");
|
|
2725
2640
|
scene.command("groups").description("\u573A\u666F\u5206\u7EC4\u9AA8\u67B6").option("--client <client>", "agent / all / connector\uFF0C\u9ED8\u8BA4 agent").action(action(async (ctx, options) => {
|
|
2726
2641
|
await run(ctx, "data.scene.groups", toInput(options), false);
|
|
@@ -2,24 +2,29 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
createEbuilderFormHost
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-JMJBPP4B.js";
|
|
6
6
|
import {
|
|
7
7
|
createEbuilderFormContinuationSigner
|
|
8
8
|
} from "./chunk-YWX377BY.js";
|
|
9
9
|
import {
|
|
10
10
|
ebuilderFormManifest,
|
|
11
11
|
executeEbuilderFormOperation
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-35A56FJ7.js";
|
|
13
13
|
import {
|
|
14
14
|
ebuilderValidationError
|
|
15
15
|
} from "./chunk-Z3GDFVJR.js";
|
|
16
|
+
import {
|
|
17
|
+
MANIFEST_LIST_COMPACT_PATHS,
|
|
18
|
+
manifestView,
|
|
19
|
+
schemaOptionsOf
|
|
20
|
+
} from "./chunk-WM33BSIL.js";
|
|
16
21
|
import {
|
|
17
22
|
reportPlatformError
|
|
18
23
|
} from "./chunk-MD5CW4B6.js";
|
|
19
24
|
import "./chunk-7BDPM5ST.js";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-IU6UB2TD.js";
|
|
26
|
+
import "./chunk-IZCQU5D5.js";
|
|
27
|
+
import "./chunk-AMAPQVBT.js";
|
|
23
28
|
import {
|
|
24
29
|
isCliError,
|
|
25
30
|
toErrorEnvelope
|
|
@@ -112,8 +117,13 @@ var ebuilderFormShortcut = {
|
|
|
112
117
|
category: "shortcut",
|
|
113
118
|
register({ program, action }) {
|
|
114
119
|
const ebuilder = program.command("ebuilder-form").description("\u6CDB\u5FAEE10 eBuilder \u8868\u5355\u83DC\u5355\u3001List/NList\u3001OpenAPI \u4E0E\u81EA\u5B9A\u4E49\u63A5\u53E3\u80FD\u529B");
|
|
115
|
-
ebuilder.command("schema").description("Print ebuilder-form operation manifest for agents").action(action((ctx) => {
|
|
116
|
-
|
|
120
|
+
ebuilder.command("schema").description("Print ebuilder-form operation manifest for agents").option("--list", '\u53EA\u5217\u64CD\u4F5C\u6E05\u5355\uFF08name/summary/risk\uFF09\uFF0C\u5168\u91CF\u4E0D\u622A\u65AD\uFF1B\u5224\u65AD"\u6709\u6CA1\u6709\u67D0\u64CD\u4F5C"\u7528\u8FD9\u4E2A').option("--full", "\u6253\u5370\u5B8C\u6574 manifest\uFF08\u8D85 stdout \u9884\u7B97\u4F1A\u843D\u672C\u5730 ref\uFF0C\u7528 refs get \u5206\u9875\u53D6\uFF09").option("--operation <name>", "\u53EA\u8F93\u51FA\u5355\u4E2A\u64CD\u4F5C\u7684\u5B8C\u6574\u5951\u7EA6\uFF08\u542B inputSchema\uFF0C\u4F53\u79EF\u8FDC\u4F4E\u4E8E\u9884\u7B97\uFF09").action(action((ctx, options) => {
|
|
121
|
+
const schema = schemaOptionsOf(options);
|
|
122
|
+
ctx.output.write(manifestView(ebuilderFormManifest, schema), {
|
|
123
|
+
json: true,
|
|
124
|
+
// 只有 --list 单行化:条目多、缩进空白能吃掉近一半体积,且对读模型无收益。
|
|
125
|
+
...schema.list === true ? { compactPaths: MANIFEST_LIST_COMPACT_PATHS } : {}
|
|
126
|
+
});
|
|
117
127
|
}));
|
|
118
128
|
ebuilder.command("run").description("Run an ebuilder-form operation with JSON input").argument("<operation>", "operation name, e.g. ebuilder-form.context.resolve").option("--input <path>", "JSON input file, or - for stdin").option("--input-json <json>", "inline JSON input object").action(action(async (ctx, operation, options) => {
|
|
119
129
|
await executeAndPrint(ctx, String(operation), await inputFrom(options));
|