weaver-work-cli 0.1.29 → 0.1.32
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-UMGX72K6.js +2537 -0
- package/dist/chunks/archive-oa-N2IYBLF3.js +1317 -0
- package/dist/chunks/asset-GLEGKFG5.js +2109 -0
- package/dist/chunks/attachment-content-AQNX5N3S.js +23 -0
- package/dist/chunks/blog-E44OTVDA.js +2157 -0
- package/dist/chunks/caizhilian-DQUFZXZL.js +10087 -0
- package/dist/chunks/calendar-JKPIRKFD.js +1195 -0
- package/dist/chunks/chunk-2GA5ZIQL.js +1615 -0
- package/dist/chunks/chunk-4YC43QQ4.js +403 -0
- package/dist/chunks/chunk-6EFWDL7Y.js +161 -0
- package/dist/chunks/chunk-6RKD4DRZ.js +5556 -0
- package/dist/chunks/chunk-AJ62BGAW.js +29 -0
- package/dist/chunks/chunk-BUSC6UAE.js +43 -0
- package/dist/chunks/chunk-C6R3B2ML.js +358 -0
- package/dist/chunks/chunk-CVZ2JOSW.js +62 -0
- package/dist/chunks/chunk-DW6AUUKS.js +508 -0
- package/dist/chunks/chunk-E4Z23GHM.js +6962 -0
- package/dist/chunks/chunk-EG6ZU444.js +654 -0
- package/dist/chunks/chunk-EZALDOQH.js +383 -0
- package/dist/chunks/chunk-FMPJJYYI.js +106 -0
- package/dist/chunks/chunk-G2JSIUWF.js +769 -0
- package/dist/chunks/chunk-G3QJULO2.js +387 -0
- package/dist/chunks/chunk-GCG2NMWR.js +703 -0
- package/dist/chunks/chunk-GPMFD4RD.js +75 -0
- package/dist/chunks/chunk-H6XSTSLM.js +2357 -0
- package/dist/chunks/chunk-H7J4DC5R.js +464 -0
- package/dist/chunks/chunk-IURUFGZK.js +477 -0
- package/dist/chunks/chunk-LUSPKZKY.js +53 -0
- package/dist/chunks/chunk-NIAJ5ZCG.js +73 -0
- package/dist/chunks/chunk-NOODWMCL.js +584 -0
- package/dist/chunks/chunk-OOUTBLZ4.js +51 -0
- package/dist/chunks/chunk-P26ZWSKU.js +73 -0
- package/dist/chunks/chunk-QWY6PGL6.js +3472 -0
- package/dist/chunks/chunk-WKI2FBIQ.js +15606 -0
- package/dist/chunks/chunk-WSKBSQ2U.js +231 -0
- package/dist/chunks/chunk-YLCYX7LE.js +371 -0
- package/dist/chunks/chunk-YRVDW4WN.js +205 -0
- package/dist/chunks/chunk-ZEDWSH32.js +68 -0
- package/dist/chunks/continuation-2CKSBLA6.js +11 -0
- package/dist/chunks/continuation-HZIZRZBX.js +13 -0
- package/dist/chunks/continuation-NLECEJPX.js +11 -0
- package/dist/chunks/ebuilder-form-V5FG2EHC.js +2276 -0
- package/dist/chunks/ehr-HMFY6VIL.js +5241 -0
- package/dist/chunks/employee-SAK2QYXX.js +11 -0
- package/dist/chunks/esb-ZYSVB7SG.js +141 -0
- package/dist/chunks/fna-B7RKPAZD.js +1444 -0
- package/dist/chunks/host-45WED2KK.js +21 -0
- package/dist/chunks/host-I4Z6BFYX.js +23 -0
- package/dist/chunks/host-KNZ52LJZ.js +17 -0
- package/dist/chunks/host-OCH2BCCV.js +19 -0
- package/dist/chunks/hrm-2KAZGUHI.js +244 -0
- package/dist/chunks/im-ACJJWH4U.js +252 -0
- package/dist/chunks/invoice-ZK3WCX2U.js +5179 -0
- package/dist/chunks/jiuchuanhui-5PQD3IL2.js +1940 -0
- package/dist/chunks/lazy-dispatch-JQXBW3GM.js +28 -0
- package/dist/chunks/mail-S2HDDXO2.js +2695 -0
- package/dist/chunks/meeting-QVN3I37L.js +504 -0
- package/dist/chunks/msg-parse-4GSQ2WTO.js +41 -0
- package/dist/chunks/okr-QNG4VC2Q.js +2482 -0
- package/dist/chunks/plan-A25EMW6U.js +2025 -0
- package/dist/chunks/project-G6XV66DZ.js +1361 -0
- package/dist/chunks/registry-2VLUAESA.js +14 -0
- package/dist/chunks/registry-7C5UMIPL.js +19 -0
- package/dist/chunks/registry-DC6KR3NH.js +18 -0
- package/dist/chunks/registry-NYPYMZXG.js +16 -0
- package/dist/chunks/registry-TI3CIUXF.js +19 -0
- package/dist/chunks/room-recommend-WRTHO6Y2.js +20 -0
- package/dist/chunks/schedule-KFIITGSK.js +24 -0
- package/dist/chunks/state-Y2XBP6YE.js +15 -0
- package/dist/chunks/workflow-DJ7SYWAF.js +245 -0
- package/dist/cmd/argv.js +45 -0
- package/dist/cmd/docs/index.js +3 -3
- package/dist/cmd/lazy-dispatch.js +20 -0
- package/dist/cmd/root.js +2 -4
- package/dist/cmd/setup/index.js +2 -2
- package/dist/cmd/skills/index.js +2 -2
- package/dist/core/package-paths.js +61 -0
- package/dist/index.js +163 -7
- package/dist/internal/e10/auth/xiaoe.js +3 -3
- package/dist/internal/e10/request-runtime.js +18 -62
- package/dist/internal/skills/detector.js +2 -2
- package/dist/shortcuts/contract/data/performance-catalog.js +1306 -0
- package/dist/shortcuts/contract/host.js +91 -35
- package/dist/shortcuts/contract/index.js +213 -0
- package/dist/shortcuts/contract/manifest.js +928 -0
- package/dist/shortcuts/contract/ooxml/docx.js +295 -0
- package/dist/shortcuts/contract/ooxml/xlsx.js +221 -0
- package/dist/shortcuts/contract/ooxml/zip.js +158 -0
- package/dist/shortcuts/contract/operations/assistant.js +1156 -0
- package/dist/shortcuts/contract/operations/clause-library.js +522 -0
- package/dist/shortcuts/contract/operations/compare.js +193 -0
- package/dist/shortcuts/contract/operations/credit-page.js +34 -0
- package/dist/shortcuts/contract/operations/flow.js +98 -0
- package/dist/shortcuts/contract/operations/page.js +66 -0
- package/dist/shortcuts/contract/operations/performance.js +733 -0
- package/dist/shortcuts/contract/operations/quote.js +557 -0
- package/dist/shortcuts/contract/operations/recommend.js +78 -0
- package/dist/shortcuts/contract/operations/registry.js +18 -0
- package/dist/shortcuts/contract/operations/review.js +83 -0
- package/dist/shortcuts/contract/operations/shared.js +37 -0
- package/dist/shortcuts/contract/operations/upload.js +108 -0
- package/dist/shortcuts/contract/operations/write.js +3 -2
- package/dist/shortcuts/index.js +140 -40
- package/dist/shortcuts/invoice/manifest.js +34 -11
- package/dist/shortcuts/invoice/operations/reim-auto.js +9 -0
- package/dist/shortcuts/invoice/operations/reim.js +81 -5
- package/dist/shortcuts/invoice/operations/shared.js +12 -5
- package/dist/shortcuts/meeting/host.js +45 -3
- package/dist/shortcuts/meeting/invitation/docx.js +442 -0
- package/dist/shortcuts/meeting/operations/attachment-content.js +418 -0
- package/dist/shortcuts/meeting/operations/attachment.js +442 -0
- package/dist/shortcuts/meeting/operations/eb/cache.js +57 -0
- package/dist/shortcuts/meeting/operations/eb/catalog.js +343 -28
- package/dist/shortcuts/meeting/operations/eb/conflict.js +372 -11
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +710 -0
- package/dist/shortcuts/meeting/operations/eb/decision.js +47 -1
- package/dist/shortcuts/meeting/operations/eb/factory.js +129 -11
- package/dist/shortcuts/meeting/operations/eb/index.js +122 -2
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +378 -0
- package/dist/shortcuts/meeting/operations/eb/room-summary.js +84 -0
- package/dist/shortcuts/meeting/operations/eb/schedule.js +450 -0
- package/dist/shortcuts/meeting/operations/from-group-chat.js +576 -0
- package/dist/shortcuts/meeting/operations/invitation.js +458 -0
- package/dist/shortcuts/meeting/operations/minute-content.js +266 -0
- package/dist/shortcuts/meeting/operations/pipeline.js +489 -0
- package/dist/shortcuts/meeting/operations/qrcode.js +131 -0
- package/dist/shortcuts/meeting/operations/receipts.js +1 -1
- package/dist/shortcuts/meeting/operations/registry.js +18 -0
- package/dist/shortcuts/meeting/operations/summary.js +276 -0
- package/dist/shortcuts/meeting/operations/task-notify.js +325 -0
- package/dist/shortcuts/meeting/operations.js +42 -1
- package/dist/shortcuts/meeting/qr/encoder.js +427 -0
- package/dist/shortcuts/meeting/qr/render.js +103 -0
- package/dist/shortcuts/workflow/operations/form.js +17 -5
- package/docs/contract.md +39 -4
- package/docs/invoice.md +5 -5
- package/package.json +3 -2
- package/scripts/bundle.mjs +63 -0
- package/skill-template/business-info.json +25 -4
- package/skill-template/domains/jinchengda.md +16 -3
- package/skill-template/domains/yepiaotong.md +1 -1
- package/skills/weaver-e10-jinchengda/SKILL.md +111 -31
- package/skills/weaver-e10-jinchengda/references/contract-agent-entry.md +7 -13
- package/skills/weaver-e10-jinchengda/references/contract-ai-assistant.md +150 -0
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +87 -0
- package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +111 -0
- package/skills/weaver-e10-jinchengda/references/contract-clause-recommender.md +0 -15
- package/skills/weaver-e10-jinchengda/references/contract-clause-reference-save.md +0 -13
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +50 -0
- package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +4 -2
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +74 -0
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +84 -0
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +29 -0
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +28 -0
- package/skills/weaver-e10-jinchengda/references/contract-request-status.md +2 -21
- package/skills/weaver-e10-jinchengda/references/contract-request-write.md +0 -24
- package/skills/weaver-e10-jinchengda/references/contract-signing-subjects.md +0 -15
- package/skills/weaver-e10-jinchengda/references/contract-subject-create.md +0 -17
- package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +70 -0
- package/skills/weaver-e10-jinchengda/references/contract-template-selector.md +0 -15
- package/skills/weaver-e10-jinchengda/references/contract-workflow-discovery.md +0 -15
- package/skills/weaver-e10-jinchengda/references/source-manifest.json +1168 -152
- package/skills/weaver-e10-meeting/SKILL.md +493 -17
- package/skills/weaver-e10-meeting/references/meeting-change.md +4 -4
- package/skills/weaver-e10-meeting/references/meeting-create.md +6 -6
- package/skills/weaver-e10-meeting/references/meeting-eb.md +503 -27
- package/skills/weaver-e10-meeting/references/meeting-invitation.md +113 -0
- package/skills/weaver-e10-meeting/references/meeting-lifecycle.md +6 -6
- package/skills/weaver-e10-meeting/references/meeting-minute-file.md +425 -0
- package/skills/weaver-e10-meeting/references/meeting-queries.md +4 -4
- package/skills/weaver-e10-meeting/references/meeting-receipts-signs.md +15 -15
- package/skills/weaver-e10-meeting/references/meeting-verification.md +19 -11
- package/skills/weaver-e10-meeting.zip +0 -0
- package/skills/weaver-e10-yepiaotong/SKILL.md +9 -5
- package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +6 -5
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +14 -11
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +97 -56
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +84 -60
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +142 -105
- package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +53 -194
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +7 -7
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +164 -72
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +6 -0
- package/templates/meeting/invitation.docx +0 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
2
|
+
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
EsbCliError,
|
|
5
|
+
esbApiError,
|
|
6
|
+
esbAuthError,
|
|
7
|
+
esbNetworkError,
|
|
8
|
+
esbPermissionError,
|
|
9
|
+
esbValidationError,
|
|
10
|
+
esbWriteUncertain
|
|
11
|
+
} from "./chunk-GPMFD4RD.js";
|
|
12
|
+
import {
|
|
13
|
+
E10ApiError,
|
|
14
|
+
createE10RequestRuntime,
|
|
15
|
+
requireE10Session
|
|
16
|
+
} from "./chunk-DW6AUUKS.js";
|
|
17
|
+
import {
|
|
18
|
+
E10_SESSION_EXPIRED_MESSAGE,
|
|
19
|
+
getActiveProfile
|
|
20
|
+
} from "./chunk-2GA5ZIQL.js";
|
|
21
|
+
|
|
22
|
+
// src/shortcuts/esb/host.ts
|
|
23
|
+
var ESB_PATHS = {
|
|
24
|
+
inputFormat: "/api/bs/esb/setting/customData/application/copyCustomData",
|
|
25
|
+
trigger: "/api/esb/server/event/triggerActionFlow"
|
|
26
|
+
};
|
|
27
|
+
var TRIGGER_RESULT_CODES = {
|
|
28
|
+
100: { subtype: "parameter_invalid" },
|
|
29
|
+
101: { subtype: "batch_key_invalid" },
|
|
30
|
+
201: { subtype: "flow_not_bound" },
|
|
31
|
+
202: { subtype: "execute_failed" },
|
|
32
|
+
203: { subtype: "execute_timeout", retryable: true },
|
|
33
|
+
204: { subtype: "permission_denied", permission: true },
|
|
34
|
+
400: { subtype: "license_required" },
|
|
35
|
+
401: { subtype: "tenant_permission_denied", permission: true },
|
|
36
|
+
402: { subtype: "flow_disabled" },
|
|
37
|
+
403: { subtype: "tenant_missing", permission: true },
|
|
38
|
+
404: { subtype: "flow_not_found" },
|
|
39
|
+
500: { subtype: "execute_failed" },
|
|
40
|
+
501: { subtype: "result_fetch_failed", retryable: true },
|
|
41
|
+
502: { subtype: "result_fetch_timeout", retryable: true },
|
|
42
|
+
505: { subtype: "flow_running", retryable: true },
|
|
43
|
+
506: { subtype: "execution_loop_conflict" },
|
|
44
|
+
507: { subtype: "throttled", retryable: true },
|
|
45
|
+
508: { subtype: "throttled", retryable: true },
|
|
46
|
+
509: { subtype: "execution_terminated" },
|
|
47
|
+
510: { subtype: "memory_exceeded" },
|
|
48
|
+
511: { subtype: "throttled", retryable: true },
|
|
49
|
+
512: { subtype: "flow_in_recycle_bin" }
|
|
50
|
+
};
|
|
51
|
+
var TARGET_FATAL_SUBTYPES = /* @__PURE__ */ new Set([
|
|
52
|
+
"flow_not_found",
|
|
53
|
+
"flow_not_bound",
|
|
54
|
+
"flow_disabled",
|
|
55
|
+
"flow_in_recycle_bin",
|
|
56
|
+
"parameter_invalid"
|
|
57
|
+
]);
|
|
58
|
+
function isEsbFlowUnavailable(error) {
|
|
59
|
+
return error instanceof EsbCliError && TARGET_FATAL_SUBTYPES.has(error.subtype);
|
|
60
|
+
}
|
|
61
|
+
function triggerResultCode(value) {
|
|
62
|
+
if (!value || typeof value !== "object") return void 0;
|
|
63
|
+
const raw = value.resultCode;
|
|
64
|
+
if (raw === void 0 || raw === null || raw === "") return void 0;
|
|
65
|
+
const numeric = Number(raw);
|
|
66
|
+
return Number.isFinite(numeric) ? numeric : void 0;
|
|
67
|
+
}
|
|
68
|
+
function assertPath(requestPath) {
|
|
69
|
+
if (typeof requestPath !== "string" || !requestPath.startsWith("/") || requestPath.startsWith("//")) {
|
|
70
|
+
throw esbValidationError("path_invalid", "\u8BF7\u6C42\u8DEF\u5F84\u5FC5\u987B\u662F\u76F8\u5BF9\u7EDD\u5BF9\u8DEF\u5F84");
|
|
71
|
+
}
|
|
72
|
+
if (/^https?:/i.test(requestPath) || /[\r\n]/.test(requestPath) || requestPath.includes("/../")) {
|
|
73
|
+
throw esbValidationError("path_invalid", "\u8BF7\u6C42\u8DEF\u5F84\u4E0D\u5141\u8BB8\u8DE8\u57DF\u6216\u8DEF\u5F84\u9003\u9038");
|
|
74
|
+
}
|
|
75
|
+
if (!requestPath.startsWith("/api/")) {
|
|
76
|
+
throw esbValidationError("path_not_allowed", "ESB \u52A8\u4F5C\u6D41\u53EA\u80FD\u8C03\u7528 /api/ \u8DEF\u5F84");
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function mapRuntimeNetworkError(error) {
|
|
80
|
+
if (error instanceof E10ApiError && error.type === "network") {
|
|
81
|
+
throw esbNetworkError(error.subtype, error.message, {
|
|
82
|
+
retryable: error.retryable,
|
|
83
|
+
details: error.details
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
throw error;
|
|
87
|
+
}
|
|
88
|
+
function createEsbHost(ctx, dependencies = {}) {
|
|
89
|
+
let e10Session = null;
|
|
90
|
+
let sessionContext = null;
|
|
91
|
+
const requireSession = dependencies.requireSession || requireE10Session;
|
|
92
|
+
async function ensureSession() {
|
|
93
|
+
if (!e10Session) {
|
|
94
|
+
e10Session = await requireSession(ctx);
|
|
95
|
+
sessionContext = {
|
|
96
|
+
baseUrl: e10Session.getBaseUrl(),
|
|
97
|
+
profile: ctx.getGlobalOptions().profile || getActiveProfile(),
|
|
98
|
+
userId: e10Session.userId,
|
|
99
|
+
tenantKey: e10Session.tenantKey,
|
|
100
|
+
eteamsId: e10Session.eteamsId
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
return e10Session;
|
|
104
|
+
}
|
|
105
|
+
async function getSession() {
|
|
106
|
+
await ensureSession();
|
|
107
|
+
return sessionContext;
|
|
108
|
+
}
|
|
109
|
+
async function runtime() {
|
|
110
|
+
return createE10RequestRuntime(ctx, await ensureSession(), { fetch: dependencies.fetch });
|
|
111
|
+
}
|
|
112
|
+
async function send(operation, path, body) {
|
|
113
|
+
assertPath(path);
|
|
114
|
+
let response;
|
|
115
|
+
try {
|
|
116
|
+
response = await (await runtime()).requestJson({
|
|
117
|
+
module: "esb",
|
|
118
|
+
operation,
|
|
119
|
+
method: "POST",
|
|
120
|
+
path,
|
|
121
|
+
body,
|
|
122
|
+
headers: { "X-Requested-With": "XMLHttpRequest" },
|
|
123
|
+
timeoutMs: 6e4
|
|
124
|
+
});
|
|
125
|
+
} catch (error) {
|
|
126
|
+
mapRuntimeNetworkError(error);
|
|
127
|
+
}
|
|
128
|
+
if (response.status === 401 || response.status === 302) {
|
|
129
|
+
throw esbAuthError(
|
|
130
|
+
"session_expired",
|
|
131
|
+
E10_SESSION_EXPIRED_MESSAGE,
|
|
132
|
+
{ httpStatus: response.status }
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
if (response.parseError) {
|
|
136
|
+
if (response.status < 200 || response.status >= 300) {
|
|
137
|
+
throw esbApiError("http_error", `\u6CDB\u5FAE\u63A5\u53E3 HTTP ${response.status}`, {
|
|
138
|
+
code: response.status,
|
|
139
|
+
details: { status: response.status }
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
throw esbNetworkError("protocol", `\u63A5\u53E3\u8FD4\u56DE\u4E0D\u662F\u5408\u6CD5 JSON\uFF08HTTP ${response.status}\uFF09`, { retryable: false });
|
|
143
|
+
}
|
|
144
|
+
if (response.status < 200 || response.status >= 300) {
|
|
145
|
+
throw esbApiError("http_error", `\u6CDB\u5FAE\u63A5\u53E3 HTTP ${response.status}`, {
|
|
146
|
+
code: response.status,
|
|
147
|
+
details: { status: response.status }
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
return response.value;
|
|
151
|
+
}
|
|
152
|
+
function assertTriggerSuccess(value, operation) {
|
|
153
|
+
const code = triggerResultCode(value);
|
|
154
|
+
const record = value && typeof value === "object" ? value : {};
|
|
155
|
+
const serverMessage = typeof record.resultMsg === "string" ? record.resultMsg.trim() : "";
|
|
156
|
+
if (code === void 0) {
|
|
157
|
+
throw esbNetworkError("protocol", "\u89E6\u53D1\u63A5\u53E3\u672A\u8FD4\u56DE resultCode\uFF0C\u65E0\u6CD5\u5224\u5B9A\u6267\u884C\u7ED3\u679C", {
|
|
158
|
+
retryable: false,
|
|
159
|
+
details: { operation }
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
if (code === 200) return value;
|
|
163
|
+
const rule = TRIGGER_RESULT_CODES[code] || { subtype: "business_error" };
|
|
164
|
+
const message = serverMessage || `\u52A8\u4F5C\u6D41\u6267\u884C\u5931\u8D25\uFF08resultCode=${code}\uFF09`;
|
|
165
|
+
const options = {
|
|
166
|
+
code,
|
|
167
|
+
retryable: rule.retryable ?? false,
|
|
168
|
+
details: { operation, resultCode: code, resultMsg: serverMessage }
|
|
169
|
+
};
|
|
170
|
+
if (rule.permission) throw esbPermissionError(rule.subtype, message, options);
|
|
171
|
+
throw esbApiError(rule.subtype, message, options);
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
async inputFormat(applicationId) {
|
|
175
|
+
const value = await send("esb.input-format", ESB_PATHS.inputFormat, { applicationId });
|
|
176
|
+
const code = triggerResultCode(value);
|
|
177
|
+
if (code !== void 0 && code !== 200) assertTriggerSuccess(value, "esb.input-format");
|
|
178
|
+
return value;
|
|
179
|
+
},
|
|
180
|
+
async trigger(payload) {
|
|
181
|
+
let value;
|
|
182
|
+
try {
|
|
183
|
+
value = await send("esb.trigger.apply", ESB_PATHS.trigger, payload);
|
|
184
|
+
} catch (error) {
|
|
185
|
+
if (error instanceof EsbCliError && error.type === "network") {
|
|
186
|
+
throw esbWriteUncertain(
|
|
187
|
+
`\u89E6\u53D1\u8BF7\u6C42\u5DF2\u53D1\u51FA\u4F46\u672A\u53D6\u5F97\u7ED3\u679C\uFF08${error.subtype}\uFF09\uFF1A\u65E0\u6CD5\u786E\u8BA4\u52A8\u4F5C\u6D41\u662F\u5426\u5DF2\u6267\u884C\uFF0C\u8BF7\u5148\u5728 ESB \u4E2D\u5FC3\u67E5\u770B\u52A8\u4F5C\u6D41\u8FD0\u884C\u65E5\u5FD7\u540E\u518D\u51B3\u5B9A\u662F\u5426\u91CD\u8BD5`,
|
|
188
|
+
{ cause: error.message }
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
throw error;
|
|
192
|
+
}
|
|
193
|
+
return assertTriggerSuccess(value, "esb.trigger.apply");
|
|
194
|
+
},
|
|
195
|
+
getSession
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export {
|
|
200
|
+
ESB_PATHS,
|
|
201
|
+
TARGET_FATAL_SUBTYPES,
|
|
202
|
+
isEsbFlowUnavailable,
|
|
203
|
+
triggerResultCode,
|
|
204
|
+
createEsbHost
|
|
205
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
2
|
+
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
CliError
|
|
5
|
+
} from "./chunk-LUSPKZKY.js";
|
|
6
|
+
|
|
7
|
+
// src/shortcuts/im/errors.ts
|
|
8
|
+
var ImCliError = class extends CliError {
|
|
9
|
+
type;
|
|
10
|
+
subtype;
|
|
11
|
+
code;
|
|
12
|
+
retryable;
|
|
13
|
+
stage;
|
|
14
|
+
details;
|
|
15
|
+
partialData;
|
|
16
|
+
constructor(type, subtype, message, options = {}) {
|
|
17
|
+
super(message, options.exitCode ?? 5 /* InternalError */);
|
|
18
|
+
this.name = "ImCliError";
|
|
19
|
+
this.type = type;
|
|
20
|
+
this.subtype = subtype;
|
|
21
|
+
this.code = options.code;
|
|
22
|
+
this.retryable = options.retryable ?? false;
|
|
23
|
+
this.stage = options.stage;
|
|
24
|
+
this.details = options.details;
|
|
25
|
+
this.partialData = options.partialData;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
function imValidationError(subtype, message, details) {
|
|
29
|
+
return new ImCliError("validation", subtype, message, {
|
|
30
|
+
details,
|
|
31
|
+
exitCode: 2 /* UsageError */
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function imAuthError(subtype, message, details) {
|
|
35
|
+
return new ImCliError("authentication", subtype, message, {
|
|
36
|
+
details,
|
|
37
|
+
exitCode: 3 /* AuthError */
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function imNetworkError(subtype, message, options = {}) {
|
|
41
|
+
return new ImCliError("network", subtype, message, {
|
|
42
|
+
...options,
|
|
43
|
+
retryable: options.retryable ?? true,
|
|
44
|
+
exitCode: 4 /* NetworkError */
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function imConfirmationError(action, details) {
|
|
48
|
+
return new ImCliError("confirmation", "required", "\u8BE5\u64CD\u4F5C\u9700\u8981\u660E\u786E\u786E\u8BA4", {
|
|
49
|
+
details: { action, ...details },
|
|
50
|
+
exitCode: 10 /* ConfirmationRequired */
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function imBusinessError(subtype, message, options = {}) {
|
|
54
|
+
return new ImCliError("api", subtype, message, {
|
|
55
|
+
...options,
|
|
56
|
+
code: options.code,
|
|
57
|
+
exitCode: 1
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export {
|
|
62
|
+
ImCliError,
|
|
63
|
+
imValidationError,
|
|
64
|
+
imAuthError,
|
|
65
|
+
imNetworkError,
|
|
66
|
+
imConfirmationError,
|
|
67
|
+
imBusinessError
|
|
68
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
2
|
+
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
createImContinuationSigner
|
|
5
|
+
} from "./chunk-P26ZWSKU.js";
|
|
6
|
+
import "./chunk-ZEDWSH32.js";
|
|
7
|
+
import "./chunk-LUSPKZKY.js";
|
|
8
|
+
import "./chunk-BUSC6UAE.js";
|
|
9
|
+
export {
|
|
10
|
+
createImContinuationSigner
|
|
11
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
2
|
+
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
continuationReplayError,
|
|
5
|
+
createWorkflowContinuationSigner
|
|
6
|
+
} from "./chunk-EZALDOQH.js";
|
|
7
|
+
import "./chunk-FMPJJYYI.js";
|
|
8
|
+
import "./chunk-LUSPKZKY.js";
|
|
9
|
+
import "./chunk-BUSC6UAE.js";
|
|
10
|
+
export {
|
|
11
|
+
continuationReplayError,
|
|
12
|
+
createWorkflowContinuationSigner
|
|
13
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
2
|
+
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
createEsbContinuationSigner
|
|
5
|
+
} from "./chunk-NIAJ5ZCG.js";
|
|
6
|
+
import "./chunk-GPMFD4RD.js";
|
|
7
|
+
import "./chunk-LUSPKZKY.js";
|
|
8
|
+
import "./chunk-BUSC6UAE.js";
|
|
9
|
+
export {
|
|
10
|
+
createEsbContinuationSigner
|
|
11
|
+
};
|