deepline 0.3.479 → 0.3.481
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/bundling-sources/sdk/src/client-core.ts +35 -1
- package/dist/bundling-sources/sdk/src/http-core.ts +2 -0
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +54 -31
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/monitors/legacy-radar-forward-routes.ts +569 -0
- package/dist/bundling-sources/shared_libs/monitors/legacy-radar-retirement.ts +451 -0
- package/dist/bundling-sources/shared_libs/monitors/package.json +5 -1
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +18 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-array-input-receipts.ts +13 -6
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +125 -22
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-shared.ts +16 -53
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +34 -48
- package/dist/bundling-sources/shared_libs/security/receipt-admission-token.ts +44 -0
- package/dist/cli/auth-EQWYBNIE.js +43 -0
- package/dist/cli/{auth-D7DYB57R.mjs → auth-FYY65LYD.mjs} +7 -5
- package/dist/cli/{billing-DT4JT4QN.mjs → billing-3MELYUTI.mjs} +7 -7
- package/dist/cli/{billing-DHGSNM6E.js → billing-TROHWBSE.js} +80 -80
- package/dist/cli/{chunk-GQCH6Y7W.js → chunk-27BYXQU4.js} +1 -1
- package/dist/cli/{chunk-CK2Q6AWR.js → chunk-4CIVXXSU.js} +26 -26
- package/dist/cli/{chunk-G6V34EQ5.js → chunk-5ONCPLWC.js} +16 -16
- package/dist/cli/{chunk-27GSBTWD.js → chunk-6VKDKATO.js} +96 -65
- package/dist/cli/{chunk-LXYDN5FE.js → chunk-6WWBVWFQ.js} +7 -7
- package/dist/cli/{chunk-JNFNNJ75.mjs → chunk-6ZMUAASO.mjs} +4 -4
- package/dist/cli/{chunk-6C3QY5JS.mjs → chunk-75LUK4E5.mjs} +1 -1
- package/dist/cli/{chunk-JKUFOP7M.mjs → chunk-7VVC4RZX.mjs} +1 -1
- package/dist/cli/{chunk-N7E25EU2.mjs → chunk-ASQJUUGB.mjs} +5 -5
- package/dist/cli/{chunk-FKEZ5DIJ.mjs → chunk-BJ5UFTWL.mjs} +28 -7
- package/dist/cli/{chunk-W4HIOBQQ.js → chunk-BJMEXKZY.js} +2 -2
- package/dist/cli/{chunk-YC2QBF2W.mjs → chunk-C7UIUKW6.mjs} +2 -2
- package/dist/cli/{chunk-AKVNUNL7.js → chunk-CM3KC74A.js} +3 -3
- package/dist/cli/{chunk-JFGOMQW6.mjs → chunk-CS2P3EQS.mjs} +2 -2
- package/dist/cli/{chunk-VKBLXJCK.js → chunk-CUSWZTS7.js} +8 -8
- package/dist/cli/{chunk-GSULE54L.js → chunk-D3UHG54V.js} +199 -178
- package/dist/cli/{chunk-3PHOAUU4.mjs → chunk-EJTU6X6C.mjs} +41 -10
- package/dist/cli/{chunk-AFHFZU5V.js → chunk-EPEAQA6O.js} +37 -37
- package/dist/cli/{chunk-K5RRY7DJ.mjs → chunk-EPZSX7FZ.mjs} +4 -4
- package/dist/cli/{chunk-27PXHD2P.mjs → chunk-FXLMDAAY.mjs} +1 -1
- package/dist/cli/chunk-GBAT5NMI.mjs +789 -0
- package/dist/cli/{chunk-Y2MVDYV6.js → chunk-GJOKFJ2Y.js} +10 -10
- package/dist/cli/{chunk-JDMR33HS.js → chunk-GVAENVIG.js} +28 -19
- package/dist/cli/{chunk-NELMCOWK.mjs → chunk-HNRELVCS.mjs} +27 -18
- package/dist/cli/{chunk-GICSDK72.mjs → chunk-HXG7TYRS.mjs} +2 -2
- package/dist/cli/{chunk-EMVWC5LP.js → chunk-J4D3PCQ2.js} +5 -5
- package/dist/cli/{chunk-6QIXWFPO.mjs → chunk-JE27DTQM.mjs} +3 -3
- package/dist/cli/{chunk-3GIM7XRH.js → chunk-KDU6TSGE.js} +2 -2
- package/dist/cli/{chunk-JMCTNS6S.js → chunk-KPXP2DIY.js} +7 -9
- package/dist/cli/chunk-KQSTV4MW.js +789 -0
- package/dist/cli/{chunk-RJVUILW4.mjs → chunk-LISZBUA7.mjs} +2 -2
- package/dist/cli/{chunk-D6MLXRMQ.mjs → chunk-LTOY2GUJ.mjs} +10 -10
- package/dist/cli/{chunk-FBEXJVQL.js → chunk-MKDWU3ZI.js} +93 -93
- package/dist/cli/{chunk-UOYA35OT.mjs → chunk-N5267HEH.mjs} +1 -1
- package/dist/cli/{chunk-XDFARN7U.mjs → chunk-PDJS6LFI.mjs} +2 -1
- package/dist/cli/{chunk-J5VDE42G.js → chunk-R4EFW2I2.js} +3 -3
- package/dist/cli/{chunk-GONL4EFT.mjs → chunk-RV2GB7KW.mjs} +2 -2
- package/dist/cli/{chunk-GZ43YXHT.mjs → chunk-S5BM6NPJ.mjs} +3 -5
- package/dist/cli/{chunk-PUOKABQF.mjs → chunk-S5WXSC3P.mjs} +5 -5
- package/dist/cli/{chunk-ZJRVHQSZ.mjs → chunk-SOGLBLMH.mjs} +4 -4
- package/dist/cli/{chunk-FV7WGK5X.js → chunk-SVPM2E2U.js} +5 -5
- package/dist/cli/{chunk-XBYW5EHY.mjs → chunk-UUGSZZZH.mjs} +1 -1
- package/dist/cli/{chunk-3SGA53DX.js → chunk-VBDR2DP6.js} +3 -3
- package/dist/cli/{chunk-O5BUFQ2P.mjs → chunk-VRAOWHXJ.mjs} +1 -1
- package/dist/cli/{chunk-TZCHXF4R.mjs → chunk-VTKAIGW6.mjs} +3 -3
- package/dist/cli/{chunk-33O2JGHE.js → chunk-WF5QE2IW.js} +17 -16
- package/dist/cli/{chunk-OVFCPV24.js → chunk-WICQQ7GY.js} +53 -53
- package/dist/cli/{chunk-W6N2S5N7.js → chunk-WTWRZ5ZI.js} +8 -8
- package/dist/cli/{chunk-N4M6CO5H.js → chunk-X4XZFIK6.js} +14 -14
- package/dist/cli/{chunk-VRZXGJXH.js → chunk-X6MEQBAT.js} +21 -21
- package/dist/cli/{csv-JXFOD7DJ.mjs → csv-2EG7JW7V.mjs} +4 -4
- package/dist/cli/{csv-DQWOZ2BL.js → csv-OUALOZBF.js} +13 -13
- package/dist/cli/{db-Q2OAAXRX.js → db-7BTOI6YB.js} +28 -28
- package/dist/cli/{db-NOGMZAQE.mjs → db-ECDQWI2Y.mjs} +7 -7
- package/dist/cli/describe-EXSH6OZD.js +48 -0
- package/dist/cli/{describe-VKZTZLX6.mjs → describe-KO6WKQIB.mjs} +18 -18
- package/dist/cli/describe-core.d.mts +2 -2
- package/dist/cli/describe-core.d.ts +2 -2
- package/dist/cli/{executions-XU3JMNI3.mjs → executions-3VMFBZT4.mjs} +7 -7
- package/dist/cli/{executions-B3GDZ4GQ.js → executions-VZSG3F3E.js} +9 -9
- package/dist/cli/{feedback-5IW3ZKRP.js → feedback-ASKBWRXR.js} +8 -8
- package/dist/cli/{feedback-R5UQXINE.mjs → feedback-SN7AVALN.mjs} +4 -4
- package/dist/cli/{git-7B4H7VEL.mjs → git-W2DZXEAY.mjs} +5 -5
- package/dist/cli/git-X2XUKYYX.js +25 -0
- package/dist/cli/index.js +167 -144
- package/dist/cli/index.mjs +73 -50
- package/dist/cli/{legacy-noops-AVT6T5QI.js → legacy-noops-6KOC6LV7.js} +8 -8
- package/dist/cli/{legacy-noops-KY7JAALE.mjs → legacy-noops-R2SML7ED.mjs} +5 -5
- package/dist/cli/{monitors-G7L7AFXR.mjs → monitors-4VGZGJBT.mjs} +8 -8
- package/dist/cli/{monitors-GZB6CWK2.js → monitors-OJXDYU4G.js} +92 -92
- package/dist/cli/{org-ZHHKAPCE.js → org-AELMZFUT.js} +73 -73
- package/dist/cli/{org-QDUBOQTH.mjs → org-UGN5ZG2Y.mjs} +7 -7
- package/dist/cli/{pages-5P3SPMN5.js → pages-L26N7MK3.js} +18 -18
- package/dist/cli/{pages-Q4WGQCST.mjs → pages-ZYPAAYSS.mjs} +7 -7
- package/dist/cli/{play-WRSHD4RE.mjs → play-ENYB7X4S.mjs} +125 -53
- package/dist/cli/{play-IRLKESZB.js → play-VTZWB3N5.js} +620 -548
- package/dist/cli/{providers-7CQUHS57.mjs → providers-BZQTVAQG.mjs} +7 -7
- package/dist/cli/{providers-LKEYLN6D.js → providers-HWBY6MGQ.js} +10 -10
- package/dist/cli/{quickstart-KS45M5SR.js → quickstart-D54IJ3PX.js} +6 -6
- package/dist/cli/{quickstart-I6NYGMEE.mjs → quickstart-SSQJDWPB.mjs} +4 -4
- package/dist/cli/{run-BLMOBNAN.js → run-45NKE7UY.js} +37 -37
- package/dist/cli/{run-AZETCL7R.mjs → run-FR3TPYT3.mjs} +23 -23
- package/dist/cli/{search-EEKEP67Y.mjs → search-CZCWSR5L.mjs} +8 -8
- package/dist/cli/search-V2GJKQQQ.js +32 -0
- package/dist/cli/{secrets-M6NU3TD2.js → secrets-KJ5ZEDWT.js} +16 -16
- package/dist/cli/{secrets-HAULG2EW.mjs → secrets-KKK55B4Y.mjs} +7 -7
- package/dist/cli/{sessions-5MB4XKOK.mjs → sessions-2YKA54PH.mjs} +5 -5
- package/dist/cli/{sessions-DSR5AHIA.js → sessions-QCNPUTDZ.js} +6 -6
- package/dist/cli/{settings-JUQP4HYQ.mjs → settings-4NI2AS5V.mjs} +12 -12
- package/dist/cli/{settings-6US327NQ.js → settings-KM3LCPWD.js} +79 -79
- package/dist/cli/{setup-JRH4UC47.mjs → setup-BZF3M54I.mjs} +33 -18
- package/dist/cli/{setup-5ZRSEQUD.js → setup-V5MTS2AA.js} +67 -52
- package/dist/cli/skills-CRFYW767.js +33 -0
- package/dist/cli/{skills-HFOZ5WDH.mjs → skills-NXYNB3LP.mjs} +7 -7
- package/dist/cli/{tools-CJEBZNPB.mjs → tools-57MWFRIZ.mjs} +17 -17
- package/dist/cli/tools-Q662HPVJ.js +55 -0
- package/dist/cli/{update-VQJEPAAK.mjs → update-QM6H677U.mjs} +9 -9
- package/dist/cli/update-TYHKF7F5.js +33 -0
- package/dist/cli/{workflow-EYWE3T75.mjs → workflow-NHYDIUWY.mjs} +8 -8
- package/dist/cli/{workflow-NKPDRZOP.js → workflow-TGEC4ITO.js} +18 -18
- package/dist/{client-B9N1bcGc.d.mts → client-DJ3r8VQJ.d.mts} +1 -1
- package/dist/{client-Btw075Hq.d.ts → client-JPSNljtj.d.ts} +1 -1
- package/dist/{client-core-TulbIeRB.d.mts → client-core-3SJlNsKU.d.mts} +21 -2
- package/dist/{client-core-DvGWlwtX.d.ts → client-core-rCoQ5Xz3.d.ts} +21 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +10 -10
- package/dist/index.mjs +7 -7
- package/dist/install-integrity.json +106 -104
- package/dist/plays/bundle-play-file.mjs +5426 -12
- package/dist/plays/play-description.d.mts +1 -1
- package/dist/plays/play-description.d.ts +1 -1
- package/dist/plays/run-request.d.mts +1 -1
- package/dist/plays/run-request.d.ts +1 -1
- package/dist/plays/run-request.js +4 -2
- package/dist/plays/run-request.mjs +3 -1
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +6 -6
- package/dist/server.mjs +4 -4
- package/package.json +1 -1
- package/dist/cli/auth-MZDFNRPG.js +0 -41
- package/dist/cli/chunk-7UFFWPQ2.js +0 -6188
- package/dist/cli/chunk-ZBSUXXZS.mjs +0 -6188
- package/dist/cli/describe-THHHNUEA.js +0 -48
- package/dist/cli/git-BX27JAW4.js +0 -25
- package/dist/cli/search-PEQXXY2B.js +0 -32
- package/dist/cli/skills-P67KCVDR.js +0 -33
- package/dist/cli/tools-PDBEAI22.js +0 -55
- package/dist/cli/update-G6DI3BQW.js +0 -33
|
@@ -15,7 +15,9 @@ var _chunkE4CABWXLjs = require('./chunk-E4CABWXL.js');
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
var _chunkGVAENVIGjs = require('./chunk-GVAENVIG.js');
|
|
19
21
|
|
|
20
22
|
|
|
21
23
|
|
|
@@ -26,7 +28,7 @@ var _chunkNMU3VR5Ujs = require('./chunk-NMU3VR5U.js');
|
|
|
26
28
|
|
|
27
29
|
|
|
28
30
|
|
|
29
|
-
var
|
|
31
|
+
var _chunkWF5QE2IWjs = require('./chunk-WF5QE2IW.js');
|
|
30
32
|
|
|
31
33
|
|
|
32
34
|
var _chunkALJJRZNJjs = require('./chunk-ALJJRZNJ.js');
|
|
@@ -647,7 +649,7 @@ var ToolCalls = class {
|
|
|
647
649
|
idempotencyKey,
|
|
648
650
|
onResponse: (response2) => {
|
|
649
651
|
lastResponse = null;
|
|
650
|
-
atomicToolsSupported = response2.headers.get(
|
|
652
|
+
atomicToolsSupported = response2.headers.get(_chunkWF5QE2IWjs.ATOMIC_TOOL_EXECUTE_SUPPORTED_HEADER) === "true";
|
|
651
653
|
recoverySupported = response2.headers.get("X-Deepline-Idempotency-Supported") === "true";
|
|
652
654
|
if (_optionalChain([options, 'optionalAccess', _30 => _30.onServerTiming])) {
|
|
653
655
|
try {
|
|
@@ -1026,8 +1028,8 @@ function runtimeSelectionHeaders(runtime, env) {
|
|
|
1026
1028
|
}
|
|
1027
1029
|
const receivers = _optionalChain([env, 'access', _52 => _52.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _53 => _53.trim, 'call', _54 => _54()]);
|
|
1028
1030
|
return {
|
|
1029
|
-
[
|
|
1030
|
-
...receivers ? { [
|
|
1031
|
+
[_chunkWF5QE2IWjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
|
|
1032
|
+
...receivers ? { [_chunkWF5QE2IWjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
|
|
1031
1033
|
};
|
|
1032
1034
|
}
|
|
1033
1035
|
function normalizeTestPolicyOverrides(value, source) {
|
|
@@ -1061,10 +1063,10 @@ function isRecord2(value) {
|
|
|
1061
1063
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
1062
1064
|
}
|
|
1063
1065
|
function normalizePlayStatus(raw) {
|
|
1064
|
-
const runPackage =
|
|
1066
|
+
const runPackage = _chunkGVAENVIGjs.isPlayRunPackage.call(void 0, raw) ? raw : _chunkGVAENVIGjs.isPlayRunPackage.call(void 0, raw.package) ? raw.package : null;
|
|
1065
1067
|
const packageRun = _optionalChain([runPackage, 'optionalAccess', _57 => _57.run]);
|
|
1066
1068
|
const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess', _58 => _58.status]) === "string" ? packageRun.status : null;
|
|
1067
|
-
const status =
|
|
1069
|
+
const status = _chunkGVAENVIGjs.decodePlayRunPublicStatus.call(void 0, rawStatus);
|
|
1068
1070
|
if (!status) {
|
|
1069
1071
|
throw new Error(
|
|
1070
1072
|
`Invalid play run lifecycle status in API response: ${JSON.stringify(rawStatus)}.`
|
|
@@ -1095,10 +1097,10 @@ var PlayClient = class {
|
|
|
1095
1097
|
async startPlayRun(request, options) {
|
|
1096
1098
|
const resolved = resolveStartPlayRunRequest(request, this.environment);
|
|
1097
1099
|
const headers = runtimeSelectionHeaders(resolved.runtime, this.environment);
|
|
1098
|
-
return
|
|
1100
|
+
return _chunkGVAENVIGjs.startPlayRun.call(void 0,
|
|
1099
1101
|
this.http,
|
|
1100
1102
|
resolved.request,
|
|
1101
|
-
_optionalChain([options, 'optionalAccess', _62 => _62.cliAdmission]) ? { ...headers, "X-Deepline-API-Major": String(
|
|
1103
|
+
_optionalChain([options, 'optionalAccess', _62 => _62.cliAdmission]) ? { ...headers, "X-Deepline-API-Major": String(_chunkWF5QE2IWjs.SDK_API_MAJOR) } : headers,
|
|
1102
1104
|
options
|
|
1103
1105
|
);
|
|
1104
1106
|
}
|
|
@@ -2663,7 +2665,7 @@ var TERMINAL_STATUS_BY_EVENT_TYPE = {
|
|
|
2663
2665
|
|
|
2664
2666
|
// ../play-runtime/run-snapshot-stream.ts
|
|
2665
2667
|
function isTerminalPlayRunLiveStatus(status) {
|
|
2666
|
-
return
|
|
2668
|
+
return _chunkGVAENVIGjs.isTerminalPlayRunLifecycleStatus.call(void 0, status);
|
|
2667
2669
|
}
|
|
2668
2670
|
function makeRunStreamEvent(input) {
|
|
2669
2671
|
return {
|
|
@@ -3175,7 +3177,7 @@ function isolatedCiRuntimeEventReadHeaders(env) {
|
|
|
3175
3177
|
"RUNTIME_EVENT_INTERNAL_TOKEN_REQUIRED"
|
|
3176
3178
|
);
|
|
3177
3179
|
}
|
|
3178
|
-
return { [
|
|
3180
|
+
return { [_chunkWF5QE2IWjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
|
|
3179
3181
|
}
|
|
3180
3182
|
function sleep(ms) {
|
|
3181
3183
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -3306,7 +3308,7 @@ function playLiveRunStatus(event) {
|
|
|
3306
3308
|
return null;
|
|
3307
3309
|
}
|
|
3308
3310
|
const payload = getPlayLiveEventPayload(event);
|
|
3309
|
-
return _nullishCoalesce(
|
|
3311
|
+
return _nullishCoalesce(_chunkGVAENVIGjs.decodePlayRunPublicStatus.call(void 0, payload.status), () => ( (_chunkGVAENVIGjs.isPlayRunPackage.call(void 0, payload) ? _chunkGVAENVIGjs.decodePlayRunPublicStatus.call(void 0, payload.run.status) : null)));
|
|
3310
3312
|
}
|
|
3311
3313
|
function appendPlayLiveLogLines(state, payload) {
|
|
3312
3314
|
const lines = readStringArray(payload.lines);
|
|
@@ -3338,7 +3340,7 @@ function updatePlayLiveStatusState(state, event) {
|
|
|
3338
3340
|
if (event.type !== "play.run.snapshot" && event.type !== "play.run.status" && event.type !== "play.run.final_status") {
|
|
3339
3341
|
return null;
|
|
3340
3342
|
}
|
|
3341
|
-
const runId = typeof payload.runId === "string" && payload.runId ? payload.runId :
|
|
3343
|
+
const runId = typeof payload.runId === "string" && payload.runId ? payload.runId : _chunkGVAENVIGjs.isPlayRunPackage.call(void 0, payload) ? payload.run.id : state.runId;
|
|
3342
3344
|
const status = _nullishCoalesce(playLiveRunStatus(event), () => ( state.status));
|
|
3343
3345
|
const progressPayload = isRecord3(payload.progress) ? payload.progress : {};
|
|
3344
3346
|
if (event.type === "play.run.final_status" && state.logs.length === 0 && state.lastLogSeq === 0) {
|
|
@@ -3351,7 +3353,7 @@ function updatePlayLiveStatusState(state, event) {
|
|
|
3351
3353
|
}
|
|
3352
3354
|
if ("result" in payload) {
|
|
3353
3355
|
state.result = payload.result;
|
|
3354
|
-
} else if (
|
|
3356
|
+
} else if (_chunkGVAENVIGjs.isPlayRunPackage.call(void 0, payload)) {
|
|
3355
3357
|
state.result = payload;
|
|
3356
3358
|
}
|
|
3357
3359
|
if (typeof payload.error === "string" && payload.error.trim()) {
|
|
@@ -3364,7 +3366,7 @@ function updatePlayLiveStatusState(state, event) {
|
|
|
3364
3366
|
...payload,
|
|
3365
3367
|
runId,
|
|
3366
3368
|
status,
|
|
3367
|
-
...
|
|
3369
|
+
..._chunkGVAENVIGjs.isPlayRunPackage.call(void 0, payload) ? { package: payload, outputs: payload.outputs } : {},
|
|
3368
3370
|
progress: {
|
|
3369
3371
|
...progressRecord,
|
|
3370
3372
|
status: typeof progressRecord.status === "string" ? progressRecord.status : status,
|
|
@@ -3905,7 +3907,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3905
3907
|
/**
|
|
3906
3908
|
* Re-establish this workspace's tenant storage contract: role/DB connect
|
|
3907
3909
|
* grants plus materialized table grants. Org-admin only. Use when a run fails
|
|
3908
|
-
* with WORKSPACE_STORAGE_NOT_READY
|
|
3910
|
+
* with `WORKSPACE_STORAGE_NOT_READY`.
|
|
3909
3911
|
*/
|
|
3910
3912
|
async repairIngestionStorage(input) {
|
|
3911
3913
|
return this.http.post(
|
|
@@ -3963,10 +3965,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3963
3965
|
*/
|
|
3964
3966
|
async preparePlayRunAdmission(request, options) {
|
|
3965
3967
|
const resolved = resolveStartPlayRunRequest(request, this.environment);
|
|
3966
|
-
const prepared = await
|
|
3968
|
+
const prepared = await _chunkGVAENVIGjs.preparePlayRunAdmission.call(void 0,
|
|
3967
3969
|
this.http,
|
|
3968
3970
|
resolved.request,
|
|
3969
|
-
_optionalChain([options, 'optionalAccess', _177 => _177.onSubmission])
|
|
3971
|
+
_optionalChain([options, 'optionalAccess', _177 => _177.onSubmission]),
|
|
3972
|
+
{
|
|
3973
|
+
...options && Object.hasOwn(options, "admissionCapability") ? { admissionCapability: options.admissionCapability } : {}
|
|
3974
|
+
}
|
|
3970
3975
|
);
|
|
3971
3976
|
const bodyJson = JSON.stringify(prepared.body);
|
|
3972
3977
|
const headers = runtimeSelectionHeaders(resolved.runtime, this.environment);
|
|
@@ -3983,32 +3988,48 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3983
3988
|
);
|
|
3984
3989
|
}
|
|
3985
3990
|
if (submitted) {
|
|
3986
|
-
await
|
|
3991
|
+
await _chunkGVAENVIGjs.preparePlayRunAdmission.call(void 0,
|
|
3987
3992
|
http,
|
|
3988
|
-
JSON.parse(bodyJson)
|
|
3993
|
+
JSON.parse(bodyJson),
|
|
3994
|
+
void 0,
|
|
3995
|
+
{ signal: _optionalChain([streamOptions, 'optionalAccess', _178 => _178.signal]) }
|
|
3989
3996
|
);
|
|
3990
3997
|
}
|
|
3991
3998
|
submitted = true;
|
|
3992
|
-
const streamPath = _optionalChain([options, 'optionalAccess',
|
|
3999
|
+
const streamPath = _optionalChain([options, 'optionalAccess', _179 => _179.cliAdmission]) ? _chunkGVAENVIGjs.CLI_PLAY_RUN_START_STREAM_PATH : _chunkGVAENVIGjs.PLAY_RUN_START_STREAM_PATH;
|
|
4000
|
+
let cliAdmissionSupported = false;
|
|
3993
4001
|
try {
|
|
3994
4002
|
for await (const event of http.streamSse(streamPath, {
|
|
3995
4003
|
method: "POST",
|
|
3996
4004
|
body: JSON.parse(bodyJson),
|
|
3997
4005
|
headers,
|
|
3998
|
-
signal: _optionalChain([streamOptions, 'optionalAccess',
|
|
3999
|
-
exactUrlOnly: true
|
|
4006
|
+
signal: _optionalChain([streamOptions, 'optionalAccess', _180 => _180.signal]),
|
|
4007
|
+
exactUrlOnly: true,
|
|
4008
|
+
..._optionalChain([options, 'optionalAccess', _181 => _181.cliAdmission]) ? {
|
|
4009
|
+
onResponse: (response) => {
|
|
4010
|
+
cliAdmissionSupported = response.headers.get(_chunkGVAENVIGjs.CLI_PLAY_RUN_SUPPORTED_HEADER) === "true";
|
|
4011
|
+
}
|
|
4012
|
+
} : {}
|
|
4000
4013
|
})) {
|
|
4001
4014
|
if (event.scope === "play") yield event;
|
|
4002
4015
|
}
|
|
4003
4016
|
} catch (error) {
|
|
4004
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4005
|
-
throw new (0,
|
|
4017
|
+
if (_optionalChain([options, 'optionalAccess', _182 => _182.cliAdmission]) && !cliAdmissionSupported && error instanceof _chunkDIAWYWT5js.DeeplineError && (error.statusCode === 404 || error.statusCode === 405)) {
|
|
4018
|
+
throw new (0, _chunkGVAENVIGjs.CliPlayAdmissionUnsupportedError)(error.statusCode);
|
|
4006
4019
|
}
|
|
4007
4020
|
throw error;
|
|
4008
4021
|
}
|
|
4009
4022
|
}
|
|
4010
4023
|
};
|
|
4011
4024
|
}
|
|
4025
|
+
/**
|
|
4026
|
+
* Internal CLI helper. Reads the server's admission contract before local
|
|
4027
|
+
* preparation so the network round trip can overlap with compilation.
|
|
4028
|
+
* @internal
|
|
4029
|
+
*/
|
|
4030
|
+
async prefetchPlayRunAdmissionCapability() {
|
|
4031
|
+
return _chunkGVAENVIGjs.readPlayRunAdmissionCapability.call(void 0, this.http);
|
|
4032
|
+
}
|
|
4012
4033
|
/**
|
|
4013
4034
|
* Submit a play run through the legacy event response.
|
|
4014
4035
|
*
|
|
@@ -4024,7 +4045,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4024
4045
|
*/
|
|
4025
4046
|
async *startPlayRunStream(request, options) {
|
|
4026
4047
|
const prepared = await this.preparePlayRunAdmission(request, options);
|
|
4027
|
-
yield* prepared.startStream({ signal: _optionalChain([options, 'optionalAccess',
|
|
4048
|
+
yield* prepared.startStream({ signal: _optionalChain([options, 'optionalAccess', _183 => _183.signal]) });
|
|
4028
4049
|
}
|
|
4029
4050
|
/**
|
|
4030
4051
|
* Register a bundled play artifact.
|
|
@@ -4177,7 +4198,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4177
4198
|
compilerManifest,
|
|
4178
4199
|
...input.input ? { input: input.input } : {},
|
|
4179
4200
|
...input.inputFile ? { inputFile: input.inputFile } : {},
|
|
4180
|
-
..._optionalChain([input, 'access',
|
|
4201
|
+
..._optionalChain([input, 'access', _184 => _184.packagedFiles, 'optionalAccess', _185 => _185.length]) ? { packagedFiles: input.packagedFiles } : {},
|
|
4181
4202
|
...input.force ? { force: true } : {},
|
|
4182
4203
|
...input.forceToolRefresh ? { forceToolRefresh: true } : {}
|
|
4183
4204
|
});
|
|
@@ -4207,29 +4228,29 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4207
4228
|
* ```
|
|
4208
4229
|
*/
|
|
4209
4230
|
async submitPlay(code, csvPath, name, options) {
|
|
4210
|
-
const runtimeInput = _optionalChain([options, 'optionalAccess',
|
|
4231
|
+
const runtimeInput = _optionalChain([options, 'optionalAccess', _186 => _186.input]) ? { ...options.input } : {};
|
|
4211
4232
|
if (csvPath) {
|
|
4212
4233
|
runtimeInput.file = csvPath;
|
|
4213
4234
|
}
|
|
4214
|
-
const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4215
|
-
const artifact = _optionalChain([options, 'optionalAccess',
|
|
4216
|
-
if (!_optionalChain([name, 'optionalAccess',
|
|
4235
|
+
const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _187 => _187.sourceCode]), () => ( code));
|
|
4236
|
+
const artifact = _optionalChain([options, 'optionalAccess', _188 => _188.artifact]);
|
|
4237
|
+
if (!_optionalChain([name, 'optionalAccess', _189 => _189.trim, 'call', _190 => _190()])) {
|
|
4217
4238
|
throw new Error("submitPlay requires a play name.");
|
|
4218
4239
|
}
|
|
4219
4240
|
if (!artifact) {
|
|
4220
4241
|
throw new Error("submitPlay requires a bundled play artifact.");
|
|
4221
4242
|
}
|
|
4222
|
-
const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async
|
|
4243
|
+
const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _191 => _191.compilerManifest]), async () => ( await this.compilePlayManifest({
|
|
4223
4244
|
name,
|
|
4224
4245
|
sourceCode,
|
|
4225
|
-
sourceFiles: _optionalChain([options, 'optionalAccess',
|
|
4246
|
+
sourceFiles: _optionalChain([options, 'optionalAccess', _192 => _192.sourceFiles]),
|
|
4226
4247
|
artifact
|
|
4227
4248
|
})));
|
|
4228
4249
|
const registeredArtifact = await this.registerPlayArtifact({
|
|
4229
4250
|
name,
|
|
4230
4251
|
sourceCode,
|
|
4231
|
-
sourceFiles: _optionalChain([options, 'optionalAccess',
|
|
4232
|
-
description: _optionalChain([options, 'optionalAccess',
|
|
4252
|
+
sourceFiles: _optionalChain([options, 'optionalAccess', _193 => _193.sourceFiles]),
|
|
4253
|
+
description: _optionalChain([options, 'optionalAccess', _194 => _194.description]),
|
|
4233
4254
|
artifact,
|
|
4234
4255
|
compilerManifest,
|
|
4235
4256
|
publish: false
|
|
@@ -4243,17 +4264,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4243
4264
|
name,
|
|
4244
4265
|
artifactStorageKey: registeredArtifact.artifactStorageKey,
|
|
4245
4266
|
sourceCode,
|
|
4246
|
-
description: _optionalChain([options, 'optionalAccess',
|
|
4267
|
+
description: _optionalChain([options, 'optionalAccess', _195 => _195.description]),
|
|
4247
4268
|
staticPipeline: _nullishCoalesce(registeredArtifact.staticPipeline, () => ( null)),
|
|
4248
4269
|
artifactHash: typeof artifact.artifactHash === "string" ? artifact.artifactHash : void 0,
|
|
4249
4270
|
graphHash: typeof artifact.graphHash === "string" ? artifact.graphHash : void 0,
|
|
4250
4271
|
runtimeArtifact: artifact,
|
|
4251
4272
|
compilerManifest,
|
|
4252
4273
|
...Object.keys(runtimeInput).length > 0 ? { input: runtimeInput } : {},
|
|
4253
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4254
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4255
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4256
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4274
|
+
..._optionalChain([options, 'optionalAccess', _196 => _196.inputFile]) ? { inputFile: options.inputFile } : {},
|
|
4275
|
+
..._optionalChain([options, 'optionalAccess', _197 => _197.packagedFiles, 'optionalAccess', _198 => _198.length]) ? { packagedFiles: options.packagedFiles } : {},
|
|
4276
|
+
..._optionalChain([options, 'optionalAccess', _199 => _199.force]) ? { force: true } : {},
|
|
4277
|
+
..._optionalChain([options, 'optionalAccess', _200 => _200.forceToolRefresh]) ? { forceToolRefresh: true } : {}
|
|
4257
4278
|
});
|
|
4258
4279
|
}
|
|
4259
4280
|
/**
|
|
@@ -4281,7 +4302,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4281
4302
|
* ```
|
|
4282
4303
|
*/
|
|
4283
4304
|
async stagePlayFiles(files) {
|
|
4284
|
-
return
|
|
4305
|
+
return _chunkGVAENVIGjs.stagePlayFiles.call(void 0, this.http, files);
|
|
4285
4306
|
}
|
|
4286
4307
|
/**
|
|
4287
4308
|
* Mint short-lived presigned upload targets for staged play files.
|
|
@@ -4290,7 +4311,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4290
4311
|
* For other files, the server returns a presigned PUT URL. Upload the file body to that URL.
|
|
4291
4312
|
*/
|
|
4292
4313
|
async mintStagedPlayFileUploads(files) {
|
|
4293
|
-
return
|
|
4314
|
+
return _chunkGVAENVIGjs.mintStagedPlayFileUploads.call(void 0, this.http, files);
|
|
4294
4315
|
}
|
|
4295
4316
|
/**
|
|
4296
4317
|
* Resolve staged play files by content hash without uploading bytes.
|
|
@@ -4329,13 +4350,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4329
4350
|
for await (const event of watchRunEvents({
|
|
4330
4351
|
http: this.http,
|
|
4331
4352
|
runId: workflowId,
|
|
4332
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
4333
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
4334
|
-
onRetry: _optionalChain([options, 'optionalAccess',
|
|
4335
|
-
deferLogs: _optionalChain([options, 'optionalAccess',
|
|
4336
|
-
omitTerminalLogs: _optionalChain([options, 'optionalAccess',
|
|
4337
|
-
onPoll: _optionalChain([options, 'optionalAccess',
|
|
4338
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4353
|
+
signal: _optionalChain([options, 'optionalAccess', _201 => _201.signal]),
|
|
4354
|
+
onNotice: _optionalChain([options, 'optionalAccess', _202 => _202.onNotice]),
|
|
4355
|
+
onRetry: _optionalChain([options, 'optionalAccess', _203 => _203.onRetry]),
|
|
4356
|
+
deferLogs: _optionalChain([options, 'optionalAccess', _204 => _204.deferLogs]),
|
|
4357
|
+
omitTerminalLogs: _optionalChain([options, 'optionalAccess', _205 => _205.omitTerminalLogs]),
|
|
4358
|
+
onPoll: _optionalChain([options, 'optionalAccess', _206 => _206.onPoll]),
|
|
4359
|
+
..._optionalChain([options, 'optionalAccess', _207 => _207.terminalStatus]) ? {
|
|
4339
4360
|
terminalStatus: {
|
|
4340
4361
|
...options.terminalStatus,
|
|
4341
4362
|
onStatus: async (raw, expectedStatus) => {
|
|
@@ -4345,7 +4366,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4345
4366
|
`Run watch returned a mismatched terminal status for ${workflowId}.`
|
|
4346
4367
|
);
|
|
4347
4368
|
}
|
|
4348
|
-
await _optionalChain([options, 'access',
|
|
4369
|
+
await _optionalChain([options, 'access', _208 => _208.terminalStatus, 'optionalAccess', _209 => _209.onStatus, 'call', _210 => _210(status)]);
|
|
4349
4370
|
}
|
|
4350
4371
|
}
|
|
4351
4372
|
} : {}
|
|
@@ -4360,12 +4381,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4360
4381
|
* @deprecated Use `watchRunEvents` for ordinary run watching.
|
|
4361
4382
|
*/
|
|
4362
4383
|
async *streamPlayRunEvents(workflowId, options) {
|
|
4363
|
-
const headers = _optionalChain([options, 'optionalAccess',
|
|
4384
|
+
const headers = _optionalChain([options, 'optionalAccess', _211 => _211.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
|
|
4364
4385
|
const params = new URLSearchParams();
|
|
4365
|
-
params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4386
|
+
params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _212 => _212.mode]), () => ( "cli")));
|
|
4366
4387
|
for await (const event of this.http.streamSse(
|
|
4367
4388
|
`/api/v2/runs/${encodeURIComponent(workflowId)}/tail?${params.toString()}`,
|
|
4368
|
-
{ signal: _optionalChain([options, 'optionalAccess',
|
|
4389
|
+
{ signal: _optionalChain([options, 'optionalAccess', _213 => _213.signal]), headers }
|
|
4369
4390
|
)) {
|
|
4370
4391
|
if (event.scope === "play") {
|
|
4371
4392
|
yield event;
|
|
@@ -4381,8 +4402,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4381
4402
|
*/
|
|
4382
4403
|
async *observeRunEvents(runId, options) {
|
|
4383
4404
|
yield* this.watchRunEvents(runId, {
|
|
4384
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
4385
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
4405
|
+
signal: _optionalChain([options, 'optionalAccess', _214 => _214.signal]),
|
|
4406
|
+
onNotice: _optionalChain([options, 'optionalAccess', _215 => _215.onNotice])
|
|
4386
4407
|
});
|
|
4387
4408
|
}
|
|
4388
4409
|
/** Poll snapshots to terminal status and return the durable package. */
|
|
@@ -4390,9 +4411,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4390
4411
|
let terminalObserved = false;
|
|
4391
4412
|
let terminalStatus = null;
|
|
4392
4413
|
for await (const event of this.watchRunEvents(runId, {
|
|
4393
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
4394
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
4395
|
-
onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4414
|
+
signal: _optionalChain([options, 'optionalAccess', _216 => _216.signal]),
|
|
4415
|
+
onNotice: _optionalChain([options, 'optionalAccess', _217 => _217.onNotice]),
|
|
4416
|
+
onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _218 => _218.onRetry]), () => ( _optionalChain([options, 'optionalAccess', _219 => _219.onReconnect]))),
|
|
4396
4417
|
terminalStatus: {
|
|
4397
4418
|
runStatus: true,
|
|
4398
4419
|
onStatus: (status) => {
|
|
@@ -4400,16 +4421,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4400
4421
|
}
|
|
4401
4422
|
}
|
|
4402
4423
|
})) {
|
|
4403
|
-
_optionalChain([options, 'optionalAccess',
|
|
4404
|
-
if (
|
|
4424
|
+
_optionalChain([options, 'optionalAccess', _220 => _220.onEvent, 'optionalCall', _221 => _221(event)]);
|
|
4425
|
+
if (_chunkGVAENVIGjs.isTerminalPlayRunLifecycleStatus.call(void 0, playLiveRunStatus(event))) {
|
|
4405
4426
|
terminalObserved = true;
|
|
4406
4427
|
}
|
|
4407
4428
|
}
|
|
4408
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4429
|
+
if (_optionalChain([options, 'optionalAccess', _222 => _222.signal, 'optionalAccess', _223 => _223.aborted])) {
|
|
4409
4430
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)("Run watch aborted.", void 0, "ABORTED");
|
|
4410
4431
|
}
|
|
4411
4432
|
const refreshed = await _asyncNullishCoalesce(terminalStatus, async () => ( await this.getRunStatus(runId)));
|
|
4412
|
-
if (terminalObserved ||
|
|
4433
|
+
if (terminalObserved || _chunkGVAENVIGjs.isTerminalPlayRunLifecycleStatus.call(void 0, refreshed.status)) {
|
|
4413
4434
|
return refreshed;
|
|
4414
4435
|
}
|
|
4415
4436
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)(
|
|
@@ -4485,7 +4506,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4485
4506
|
/** List the org's workflows. `GET /api/v2/workflows`. */
|
|
4486
4507
|
async listWorkflows(options) {
|
|
4487
4508
|
const params = new URLSearchParams();
|
|
4488
|
-
if (typeof _optionalChain([options, 'optionalAccess',
|
|
4509
|
+
if (typeof _optionalChain([options, 'optionalAccess', _224 => _224.limit]) === "number") {
|
|
4489
4510
|
params.set("limit", String(options.limit));
|
|
4490
4511
|
}
|
|
4491
4512
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4538,7 +4559,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4538
4559
|
/** List a workflow's runs. `GET /api/v2/workflows/:id/runs`. */
|
|
4539
4560
|
async listWorkflowRuns(id, options) {
|
|
4540
4561
|
const params = new URLSearchParams();
|
|
4541
|
-
if (typeof _optionalChain([options, 'optionalAccess',
|
|
4562
|
+
if (typeof _optionalChain([options, 'optionalAccess', _225 => _225.limit]) === "number") {
|
|
4542
4563
|
params.set("limit", String(options.limit));
|
|
4543
4564
|
}
|
|
4544
4565
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4574,10 +4595,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4574
4595
|
*/
|
|
4575
4596
|
async getRunStatus(runId, options) {
|
|
4576
4597
|
const params = new URLSearchParams();
|
|
4577
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4598
|
+
if (_optionalChain([options, 'optionalAccess', _226 => _226.full]) === true) {
|
|
4578
4599
|
params.set("full", "true");
|
|
4579
4600
|
}
|
|
4580
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4601
|
+
if (_optionalChain([options, 'optionalAccess', _227 => _227.configuration]) === true) {
|
|
4581
4602
|
params.set("include", "configuration");
|
|
4582
4603
|
}
|
|
4583
4604
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4585,7 +4606,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4585
4606
|
`/api/v2/runs/${encodeURIComponent(runId)}${query}`,
|
|
4586
4607
|
{ headers: { "x-deepline-run-status": "1" } }
|
|
4587
4608
|
);
|
|
4588
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4609
|
+
if (_optionalChain([options, 'optionalAccess', _228 => _228.configuration]) === true && !Object.hasOwn(response, "contract")) {
|
|
4589
4610
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)(
|
|
4590
4611
|
"This server does not support recorded configuration reads.",
|
|
4591
4612
|
void 0,
|
|
@@ -4593,7 +4614,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4593
4614
|
);
|
|
4594
4615
|
}
|
|
4595
4616
|
const status = normalizePlayStatus(response);
|
|
4596
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4617
|
+
if (_optionalChain([options, 'optionalAccess', _229 => _229.failedLogs]) !== true || status.status !== "failed") {
|
|
4597
4618
|
return status;
|
|
4598
4619
|
}
|
|
4599
4620
|
const requestedFailedLogLimit = typeof options.failedLogLimit === "number" && Number.isFinite(options.failedLogLimit) ? Math.max(1, Math.floor(options.failedLogLimit)) : RUNS_FAILED_LOG_LIMIT;
|
|
@@ -4682,7 +4703,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4682
4703
|
/** The same tenant-scoped run history searched by the dashboard and CLI. */
|
|
4683
4704
|
async getRunsHistory(options = {}) {
|
|
4684
4705
|
const params = new URLSearchParams();
|
|
4685
|
-
const search = _optionalChain([options, 'access',
|
|
4706
|
+
const search = _optionalChain([options, 'access', _230 => _230.search, 'optionalAccess', _231 => _231.trim, 'call', _232 => _232()]);
|
|
4686
4707
|
if (search && search.length > 200) {
|
|
4687
4708
|
throw new Error("Run search must be at most 200 characters.");
|
|
4688
4709
|
}
|
|
@@ -4708,16 +4729,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4708
4729
|
}
|
|
4709
4730
|
/** Read one run page without discarding server pagination metadata. */
|
|
4710
4731
|
async listRunsPage(options) {
|
|
4711
|
-
const playName = _optionalChain([options, 'access',
|
|
4732
|
+
const playName = _optionalChain([options, 'access', _233 => _233.play, 'optionalAccess', _234 => _234.trim, 'call', _235 => _235()]);
|
|
4712
4733
|
const params = new URLSearchParams();
|
|
4713
4734
|
if (playName) {
|
|
4714
4735
|
params.set("play", playName);
|
|
4715
4736
|
}
|
|
4716
|
-
const status = _optionalChain([options, 'access',
|
|
4737
|
+
const status = _optionalChain([options, 'access', _236 => _236.status, 'optionalAccess', _237 => _237.trim, 'call', _238 => _238()]);
|
|
4717
4738
|
if (status) {
|
|
4718
4739
|
params.set("status", status);
|
|
4719
4740
|
}
|
|
4720
|
-
const node = _optionalChain([options, 'access',
|
|
4741
|
+
const node = _optionalChain([options, 'access', _239 => _239.node, 'optionalAccess', _240 => _240.trim, 'call', _241 => _241()]);
|
|
4721
4742
|
if (node) {
|
|
4722
4743
|
if (!playName)
|
|
4723
4744
|
throw new Error("runs.list options.node requires options.play.");
|
|
@@ -4791,8 +4812,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4791
4812
|
* A different key starts another rerun.
|
|
4792
4813
|
*/
|
|
4793
4814
|
async rerun(runId, options) {
|
|
4794
|
-
const idempotencyKey = _optionalChain([options, 'optionalAccess',
|
|
4795
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4815
|
+
const idempotencyKey = _optionalChain([options, 'optionalAccess', _242 => _242.idempotencyKey, 'optionalAccess', _243 => _243.trim, 'call', _244 => _244()]);
|
|
4816
|
+
if (_optionalChain([options, 'optionalAccess', _245 => _245.idempotencyKey]) !== void 0 && !idempotencyKey) {
|
|
4796
4817
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)(
|
|
4797
4818
|
"runs.rerun idempotencyKey must not be empty.",
|
|
4798
4819
|
void 0,
|
|
@@ -4801,7 +4822,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4801
4822
|
}
|
|
4802
4823
|
return this.http.post(
|
|
4803
4824
|
`/api/v2/runs/${encodeURIComponent(runId)}/rerun`,
|
|
4804
|
-
_optionalChain([options, 'optionalAccess',
|
|
4825
|
+
_optionalChain([options, 'optionalAccess', _246 => _246.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
|
|
4805
4826
|
{ "Idempotency-Key": idempotencyKey || globalThis.crypto.randomUUID() }
|
|
4806
4827
|
);
|
|
4807
4828
|
}
|
|
@@ -4815,21 +4836,21 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4815
4836
|
* ```
|
|
4816
4837
|
*/
|
|
4817
4838
|
async getRunLogs(runId, options) {
|
|
4818
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4839
|
+
if (_optionalChain([options, 'optionalAccess', _247 => _247.all]) === true && options.failed === true) {
|
|
4819
4840
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)(
|
|
4820
4841
|
"runs.logs cannot combine all and failed views.",
|
|
4821
4842
|
void 0,
|
|
4822
4843
|
"INVALID_RUN_LOG_VIEW"
|
|
4823
4844
|
);
|
|
4824
4845
|
}
|
|
4825
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4846
|
+
if (_optionalChain([options, 'optionalAccess', _248 => _248.cursor]) !== void 0 && options.failed === true) {
|
|
4826
4847
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)(
|
|
4827
4848
|
"runs.logs cannot combine failed with cursor.",
|
|
4828
4849
|
void 0,
|
|
4829
4850
|
"INVALID_RUN_LOG_VIEW"
|
|
4830
4851
|
);
|
|
4831
4852
|
}
|
|
4832
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4853
|
+
if (_optionalChain([options, 'optionalAccess', _249 => _249.failed]) === true) {
|
|
4833
4854
|
const requestedLimit = typeof options.limit === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : RUNS_FAILED_LOG_LIMIT;
|
|
4834
4855
|
const failedLimit = Math.min(RUNS_FAILED_LOG_LIMIT, requestedLimit);
|
|
4835
4856
|
const page = await this.http.get(
|
|
@@ -4854,18 +4875,18 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4854
4875
|
...page.logsTruncated ? { logsTruncated: true } : {}
|
|
4855
4876
|
};
|
|
4856
4877
|
}
|
|
4857
|
-
const beforeSequence = _optionalChain([options, 'optionalAccess',
|
|
4858
|
-
const limit = _optionalChain([options, 'optionalAccess',
|
|
4878
|
+
const beforeSequence = _optionalChain([options, 'optionalAccess', _250 => _250.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
|
|
4879
|
+
const limit = _optionalChain([options, 'optionalAccess', _251 => _251.all]) ? Number.MAX_SAFE_INTEGER : typeof _optionalChain([options, 'optionalAccess', _252 => _252.limit]) === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
|
|
4859
4880
|
const fetchPage = (afterSeq2, pageLimit) => this.http.get(
|
|
4860
4881
|
`/api/v2/runs/${encodeURIComponent(runId)}/logs?afterSeq=${afterSeq2}&limit=${pageLimit}`,
|
|
4861
4882
|
{ retryApiErrors: true }
|
|
4862
4883
|
);
|
|
4863
4884
|
const probe = await fetchPage(0, 1);
|
|
4864
4885
|
const lastStoredSeq = probe.lastStoredSeq;
|
|
4865
|
-
const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access',
|
|
4886
|
+
const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _253 => _253.entries, 'access', _254 => _254[0], 'optionalAccess', _255 => _255.seq]), () => ( null));
|
|
4866
4887
|
const upperSeq = beforeSequence === null ? lastStoredSeq : Math.min(beforeSequence - 1, lastStoredSeq);
|
|
4867
4888
|
const windowEndSeq = Math.min(upperSeq, lastStoredSeq);
|
|
4868
|
-
let afterSeq = _optionalChain([options, 'optionalAccess',
|
|
4889
|
+
let afterSeq = _optionalChain([options, 'optionalAccess', _256 => _256.all]) ? 0 : Math.max(0, windowEndSeq - limit);
|
|
4869
4890
|
const entries = [];
|
|
4870
4891
|
while (entries.length < limit && afterSeq < upperSeq) {
|
|
4871
4892
|
const page = await fetchPage(
|
|
@@ -4899,7 +4920,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4899
4920
|
hasMore: olderLinesExist,
|
|
4900
4921
|
nextCursor: olderLinesExist ? encodeRunLogsCursor(firstSequence) : null,
|
|
4901
4922
|
entries: entries.map((entry) => entry.line),
|
|
4902
|
-
view: _optionalChain([options, 'optionalAccess',
|
|
4923
|
+
view: _optionalChain([options, 'optionalAccess', _257 => _257.all]) ? "all" : "tail",
|
|
4903
4924
|
...probe.logsTruncated ? { logsTruncated: true } : {}
|
|
4904
4925
|
};
|
|
4905
4926
|
}
|
|
@@ -5075,7 +5096,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5075
5096
|
limit: String(_nullishCoalesce(input.limit, () => ( 5e3))),
|
|
5076
5097
|
offset: String(_nullishCoalesce(input.offset, () => ( 0)))
|
|
5077
5098
|
});
|
|
5078
|
-
if (_optionalChain([input, 'access',
|
|
5099
|
+
if (_optionalChain([input, 'access', _258 => _258.runId, 'optionalAccess', _259 => _259.trim, 'call', _260 => _260()])) {
|
|
5079
5100
|
params.set("runId", input.runId.trim());
|
|
5080
5101
|
}
|
|
5081
5102
|
if (input.rowMode === "all" || input.rowMode === "live") {
|
|
@@ -5088,9 +5109,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5088
5109
|
`/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`,
|
|
5089
5110
|
{ signal: input.signal }
|
|
5090
5111
|
);
|
|
5091
|
-
const requestedRunId = _optionalChain([input, 'access',
|
|
5112
|
+
const requestedRunId = _optionalChain([input, 'access', _261 => _261.runId, 'optionalAccess', _262 => _262.trim, 'call', _263 => _263()]) || "";
|
|
5092
5113
|
if (requestedRunId) {
|
|
5093
|
-
const confirmedRunId = _optionalChain([result, 'access',
|
|
5114
|
+
const confirmedRunId = _optionalChain([result, 'access', _264 => _264.scope, 'optionalAccess', _265 => _265.kind]) === "run" ? result.scope.runId.trim() : "";
|
|
5094
5115
|
const foreignRowRunIds = [
|
|
5095
5116
|
...new Set(
|
|
5096
5117
|
result.rows.map(
|
|
@@ -5098,7 +5119,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5098
5119
|
).filter((runId) => runId && runId !== requestedRunId)
|
|
5099
5120
|
)
|
|
5100
5121
|
];
|
|
5101
|
-
if (_optionalChain([result, 'access',
|
|
5122
|
+
if (_optionalChain([result, 'access', _266 => _266.scope, 'optionalAccess', _267 => _267.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
|
|
5102
5123
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)(
|
|
5103
5124
|
`Run-scoped dataset export was not confirmed for ${requestedRunId}; no rows were returned to the caller. Update Deepline, then retry the same export command. Do not rerun the play.`,
|
|
5104
5125
|
void 0,
|
|
@@ -5127,7 +5148,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5127
5148
|
async stopRun(runId, options) {
|
|
5128
5149
|
return this.http.post(
|
|
5129
5150
|
`/api/v2/runs/${encodeURIComponent(runId)}/stop`,
|
|
5130
|
-
_optionalChain([options, 'optionalAccess',
|
|
5151
|
+
_optionalChain([options, 'optionalAccess', _268 => _268.reason]) ? { reason: options.reason } : {}
|
|
5131
5152
|
);
|
|
5132
5153
|
}
|
|
5133
5154
|
/**
|
|
@@ -5145,11 +5166,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5145
5166
|
* The method clears workspace run-slot state without requiring each run ID.
|
|
5146
5167
|
*/
|
|
5147
5168
|
async stopAllRuns(options) {
|
|
5148
|
-
const dryRun = _optionalChain([options, 'optionalAccess',
|
|
5169
|
+
const dryRun = _optionalChain([options, 'optionalAccess', _269 => _269.dryRun]) === true;
|
|
5149
5170
|
const result = await this.http.post(
|
|
5150
5171
|
"/api/v2/runs/stop-all",
|
|
5151
5172
|
{
|
|
5152
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5173
|
+
..._optionalChain([options, 'optionalAccess', _270 => _270.reason]) ? { reason: options.reason } : {},
|
|
5153
5174
|
...dryRun ? { dryRun: true } : {}
|
|
5154
5175
|
}
|
|
5155
5176
|
);
|
|
@@ -5170,7 +5191,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5170
5191
|
* `origin: "owned"` for org-owned plays.
|
|
5171
5192
|
*/
|
|
5172
5193
|
async listPlays(options) {
|
|
5173
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
5194
|
+
if (!_optionalChain([options, 'optionalAccess', _271 => _271.grep, 'optionalAccess', _272 => _272.trim, 'call', _273 => _273()])) {
|
|
5174
5195
|
return (await this.requestPlaysPage(options, false)).plays;
|
|
5175
5196
|
}
|
|
5176
5197
|
const plays = [];
|
|
@@ -5192,46 +5213,46 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5192
5213
|
}
|
|
5193
5214
|
async requestPlaysPage(options, paginateInventory = true) {
|
|
5194
5215
|
const params = new URLSearchParams();
|
|
5195
|
-
if (paginateInventory && !_optionalChain([options, 'optionalAccess',
|
|
5216
|
+
if (paginateInventory && !_optionalChain([options, 'optionalAccess', _274 => _274.grep, 'optionalAccess', _275 => _275.trim, 'call', _276 => _276()]))
|
|
5196
5217
|
params.set("inventory_paginated", "1");
|
|
5197
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5198
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5199
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5218
|
+
if (_optionalChain([options, 'optionalAccess', _277 => _277.origin])) params.set("origin", options.origin);
|
|
5219
|
+
if (_optionalChain([options, 'optionalAccess', _278 => _278.summaryOnly])) params.set("summary_only", "1");
|
|
5220
|
+
if (_optionalChain([options, 'optionalAccess', _279 => _279.categories])) {
|
|
5200
5221
|
params.set(
|
|
5201
5222
|
"categories",
|
|
5202
5223
|
Array.isArray(options.categories) ? options.categories.join(",") : options.categories
|
|
5203
5224
|
);
|
|
5204
5225
|
}
|
|
5205
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5226
|
+
if (_optionalChain([options, 'optionalAccess', _280 => _280.categories]) || _optionalChain([options, 'optionalAccess', _281 => _281.includeToolCategories])) {
|
|
5206
5227
|
params.set("include_tool_categories", "1");
|
|
5207
5228
|
}
|
|
5208
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5229
|
+
if (_optionalChain([options, 'optionalAccess', _282 => _282.tags])) {
|
|
5209
5230
|
params.set(
|
|
5210
5231
|
"tags",
|
|
5211
5232
|
Array.isArray(options.tags) ? options.tags.join(",") : options.tags
|
|
5212
5233
|
);
|
|
5213
5234
|
}
|
|
5214
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5215
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5235
|
+
if (_optionalChain([options, 'optionalAccess', _283 => _283.includeArchived])) params.set("include_archived", "1");
|
|
5236
|
+
if (_optionalChain([options, 'optionalAccess', _284 => _284.includeCostEstimates])) {
|
|
5216
5237
|
params.set("include_cost_estimates", "1");
|
|
5217
5238
|
}
|
|
5218
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5239
|
+
if (_optionalChain([options, 'optionalAccess', _285 => _285.grep, 'optionalAccess', _286 => _286.trim, 'call', _287 => _287()])) {
|
|
5219
5240
|
params.set("grep", options.grep.trim());
|
|
5220
5241
|
params.set("limit", "60");
|
|
5221
5242
|
}
|
|
5222
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5243
|
+
if (_optionalChain([options, 'optionalAccess', _288 => _288.limit]) !== void 0) {
|
|
5223
5244
|
if (!Number.isSafeInteger(options.limit) || options.limit < 1) {
|
|
5224
5245
|
throw new Error("Play page limit must be a positive integer");
|
|
5225
5246
|
}
|
|
5226
5247
|
params.set("limit", String(options.limit));
|
|
5227
5248
|
}
|
|
5228
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5249
|
+
if (_optionalChain([options, 'optionalAccess', _289 => _289.cursor])) params.set("cursor", options.cursor);
|
|
5229
5250
|
const suffix = params.size ? `?${params.toString()}` : "";
|
|
5230
5251
|
const response = await this.http.get(`/api/v2/plays${suffix}`);
|
|
5231
5252
|
return {
|
|
5232
5253
|
plays: _nullishCoalesce(response.plays, () => ( [])),
|
|
5233
|
-
cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access',
|
|
5234
|
-
hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access',
|
|
5254
|
+
cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _290 => _290.pagination, 'optionalAccess', _291 => _291.cursor]), () => ( response.cursor)), () => ( null)),
|
|
5255
|
+
hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _292 => _292.pagination, 'optionalAccess', _293 => _293.hasMore]), () => ( response.hasMore)))
|
|
5235
5256
|
};
|
|
5236
5257
|
}
|
|
5237
5258
|
/** Read definition-level settings, independently of code revisions. */
|
|
@@ -5285,7 +5306,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5285
5306
|
}
|
|
5286
5307
|
/** Start provider OAuth and return the URL to open in a browser. */
|
|
5287
5308
|
async startIntegrationOAuth(provider, options = {}) {
|
|
5288
|
-
const scopes = _optionalChain([options, 'access',
|
|
5309
|
+
const scopes = _optionalChain([options, 'access', _294 => _294.scopes, 'optionalAccess', _295 => _295.map, 'call', _296 => _296((scope) => scope.trim()), 'access', _297 => _297.filter, 'call', _298 => _298(Boolean)]);
|
|
5289
5310
|
if (scopes !== void 0 && scopes.length === 0) {
|
|
5290
5311
|
throw new Error("scopes must contain at least one OAuth scope.");
|
|
5291
5312
|
}
|
|
@@ -5301,8 +5322,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5301
5322
|
return this.http.post("/api/v2/integrations/connect", {
|
|
5302
5323
|
provider: "slack",
|
|
5303
5324
|
scopes: [...PRODUCT_NOTIFICATION_SLACK_OAUTH_SCOPES],
|
|
5304
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5305
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5325
|
+
..._optionalChain([options, 'optionalAccess', _299 => _299.successUrl]) ? { success_url: options.successUrl } : {},
|
|
5326
|
+
..._optionalChain([options, 'optionalAccess', _300 => _300.failureUrl]) ? { failure_url: options.failureUrl } : {}
|
|
5306
5327
|
});
|
|
5307
5328
|
}
|
|
5308
5329
|
/** List Slack channels visible to the connected Deepline Slack app. */
|
|
@@ -5377,7 +5398,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5377
5398
|
}
|
|
5378
5399
|
const targets = input.targets.map(parseNotificationGroupTarget);
|
|
5379
5400
|
const legacyEvents = _nullishCoalesce(input.legacyEvents, () => ( []));
|
|
5380
|
-
const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access',
|
|
5401
|
+
const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _301 => _301[0], 'optionalAccess', _302 => _302.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
|
|
5381
5402
|
if (legacyEvents.length > 0 && !legacyTarget) {
|
|
5382
5403
|
throw new Error(
|
|
5383
5404
|
"--for is supported only by the legacy one-Slack-target form. Create the group first, then add rules in notification configuration."
|
|
@@ -5413,7 +5434,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5413
5434
|
const existingGroup = current.configuration.groups.find(
|
|
5414
5435
|
(candidate) => candidate.name.toLowerCase() === name.toLowerCase()
|
|
5415
5436
|
);
|
|
5416
|
-
const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess',
|
|
5437
|
+
const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _303 => _303.groupKey]), () => ( notificationObjectKey("group")));
|
|
5417
5438
|
const group = _nullishCoalesce(existingGroup, () => ( {
|
|
5418
5439
|
groupKey,
|
|
5419
5440
|
name,
|
|
@@ -5641,7 +5662,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5641
5662
|
/** Read one trigger inventory page without loading run histories. */
|
|
5642
5663
|
async listPlayTriggerInventory(options) {
|
|
5643
5664
|
const params = new URLSearchParams({ view: "inventory" });
|
|
5644
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5665
|
+
if (_optionalChain([options, 'optionalAccess', _304 => _304.cursor])) params.set("cursor", options.cursor);
|
|
5645
5666
|
return this.http.get(`/api/v2/plays/triggers?${params}`);
|
|
5646
5667
|
}
|
|
5647
5668
|
/** Read one trigger's recent runs, with an explicit partial-history flag. */
|
|
@@ -5650,7 +5671,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5650
5671
|
view: "history",
|
|
5651
5672
|
binding_id: bindingId
|
|
5652
5673
|
});
|
|
5653
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5674
|
+
if (_optionalChain([options, 'optionalAccess', _305 => _305.limit]) !== void 0)
|
|
5654
5675
|
params.set("history_limit", String(options.limit));
|
|
5655
5676
|
return this.http.get(`/api/v2/plays/triggers?${params}`);
|
|
5656
5677
|
}
|
|
@@ -5838,14 +5859,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5838
5859
|
*/
|
|
5839
5860
|
async runPlay(code, csvPath, name, options) {
|
|
5840
5861
|
const { workflowId } = await this.submitPlay(code, csvPath, name, {
|
|
5841
|
-
input: _optionalChain([options, 'optionalAccess',
|
|
5842
|
-
sourceCode: _optionalChain([options, 'optionalAccess',
|
|
5843
|
-
artifact: _optionalChain([options, 'optionalAccess',
|
|
5844
|
-
compilerManifest: _optionalChain([options, 'optionalAccess',
|
|
5845
|
-
inputFile: _optionalChain([options, 'optionalAccess',
|
|
5846
|
-
packagedFiles: _optionalChain([options, 'optionalAccess',
|
|
5847
|
-
force: _optionalChain([options, 'optionalAccess',
|
|
5848
|
-
forceToolRefresh: _optionalChain([options, 'optionalAccess',
|
|
5862
|
+
input: _optionalChain([options, 'optionalAccess', _306 => _306.input]),
|
|
5863
|
+
sourceCode: _optionalChain([options, 'optionalAccess', _307 => _307.sourceCode]),
|
|
5864
|
+
artifact: _optionalChain([options, 'optionalAccess', _308 => _308.artifact]),
|
|
5865
|
+
compilerManifest: _optionalChain([options, 'optionalAccess', _309 => _309.compilerManifest]),
|
|
5866
|
+
inputFile: _optionalChain([options, 'optionalAccess', _310 => _310.inputFile]),
|
|
5867
|
+
packagedFiles: _optionalChain([options, 'optionalAccess', _311 => _311.packagedFiles]),
|
|
5868
|
+
force: _optionalChain([options, 'optionalAccess', _312 => _312.force]),
|
|
5869
|
+
forceToolRefresh: _optionalChain([options, 'optionalAccess', _313 => _313.forceToolRefresh])
|
|
5849
5870
|
});
|
|
5850
5871
|
const start = Date.now();
|
|
5851
5872
|
const state = {
|
|
@@ -5856,7 +5877,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5856
5877
|
latest: null
|
|
5857
5878
|
};
|
|
5858
5879
|
let terminalObserved = null;
|
|
5859
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5880
|
+
if (_optionalChain([options, 'optionalAccess', _314 => _314.signal, 'optionalAccess', _315 => _315.aborted])) {
|
|
5860
5881
|
await this.cancelPlay(workflowId);
|
|
5861
5882
|
return {
|
|
5862
5883
|
success: false,
|
|
@@ -5867,9 +5888,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5867
5888
|
};
|
|
5868
5889
|
}
|
|
5869
5890
|
for await (const event of this.watchRunEvents(workflowId, {
|
|
5870
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
5891
|
+
signal: _optionalChain([options, 'optionalAccess', _316 => _316.signal])
|
|
5871
5892
|
})) {
|
|
5872
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5893
|
+
if (_optionalChain([options, 'optionalAccess', _317 => _317.signal, 'optionalAccess', _318 => _318.aborted])) {
|
|
5873
5894
|
await this.cancelPlay(workflowId);
|
|
5874
5895
|
return {
|
|
5875
5896
|
success: false,
|
|
@@ -5879,19 +5900,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5879
5900
|
error: "Cancelled by user"
|
|
5880
5901
|
};
|
|
5881
5902
|
}
|
|
5882
|
-
const previousStatus = _optionalChain([state, 'access',
|
|
5903
|
+
const previousStatus = _optionalChain([state, 'access', _319 => _319.latest, 'optionalAccess', _320 => _320.status]);
|
|
5883
5904
|
const status = updatePlayLiveStatusState(state, event);
|
|
5884
5905
|
if (!status) {
|
|
5885
5906
|
continue;
|
|
5886
5907
|
}
|
|
5887
5908
|
if (event.type !== "play.run.status" || status.status !== previousStatus) {
|
|
5888
|
-
_optionalChain([options, 'optionalAccess',
|
|
5909
|
+
_optionalChain([options, 'optionalAccess', _321 => _321.onProgress, 'optionalCall', _322 => _322(status)]);
|
|
5889
5910
|
}
|
|
5890
|
-
if (
|
|
5911
|
+
if (_chunkGVAENVIGjs.isTerminalPlayRunLifecycleStatus.call(void 0, status.status)) {
|
|
5891
5912
|
terminalObserved = status;
|
|
5892
5913
|
}
|
|
5893
5914
|
}
|
|
5894
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5915
|
+
if (_optionalChain([options, 'optionalAccess', _323 => _323.signal, 'optionalAccess', _324 => _324.aborted])) {
|
|
5895
5916
|
await this.cancelPlay(workflowId);
|
|
5896
5917
|
return {
|
|
5897
5918
|
success: false,
|
|
@@ -5944,7 +5965,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5944
5965
|
const response = await this.http.get(
|
|
5945
5966
|
`/api/v2/usage/events?request_id=${encodeURIComponent(normalizedRequestId)}`
|
|
5946
5967
|
);
|
|
5947
|
-
const event = _optionalChain([response, 'access',
|
|
5968
|
+
const event = _optionalChain([response, 'access', _325 => _325.entries, 'optionalAccess', _326 => _326[0]]);
|
|
5948
5969
|
if (!event) {
|
|
5949
5970
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)(
|
|
5950
5971
|
"No usage event was found for this request_id.",
|
|
@@ -6119,7 +6140,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6119
6140
|
async cancelBillingSubscription(options) {
|
|
6120
6141
|
return this.http.post(
|
|
6121
6142
|
"/api/v2/billing/subscription/cancel",
|
|
6122
|
-
{ action: _optionalChain([options, 'optionalAccess',
|
|
6143
|
+
{ action: _optionalChain([options, 'optionalAccess', _327 => _327.undo]) ? "undo_cancel" : "cancel" }
|
|
6123
6144
|
);
|
|
6124
6145
|
}
|
|
6125
6146
|
/**
|
|
@@ -6131,7 +6152,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6131
6152
|
*/
|
|
6132
6153
|
async listBillingInvoices(options) {
|
|
6133
6154
|
const params = new URLSearchParams();
|
|
6134
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6155
|
+
if (_optionalChain([options, 'optionalAccess', _328 => _328.limit]) !== void 0) {
|
|
6135
6156
|
params.set("limit", String(options.limit));
|
|
6136
6157
|
}
|
|
6137
6158
|
const suffix = Array.from(params).length > 0 ? `?${params.toString()}` : "";
|
|
@@ -6241,7 +6262,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6241
6262
|
/** Create a Stripe-hosted portal session for payment recovery and invoices. */
|
|
6242
6263
|
async createTargetBillingPortalSession(options) {
|
|
6243
6264
|
const response = await this.http.post(
|
|
6244
|
-
_optionalChain([options, 'optionalAccess',
|
|
6265
|
+
_optionalChain([options, 'optionalAccess', _329 => _329.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
|
|
6245
6266
|
{}
|
|
6246
6267
|
);
|
|
6247
6268
|
return response.data;
|
|
@@ -6291,8 +6312,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6291
6312
|
return this.http.request("/api/v2/monitors/audit", {
|
|
6292
6313
|
method: "POST",
|
|
6293
6314
|
body: {
|
|
6294
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6295
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6315
|
+
..._optionalChain([options, 'optionalAccess', _330 => _330.fleetId]) ? { fleet_id: options.fleetId } : {},
|
|
6316
|
+
..._optionalChain([options, 'optionalAccess', _331 => _331.cursor]) ? { cursor: options.cursor } : {}
|
|
6296
6317
|
},
|
|
6297
6318
|
maxRetries: 0
|
|
6298
6319
|
});
|
|
@@ -6302,8 +6323,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6302
6323
|
return this.http.request("/api/v2/monitors/repair", {
|
|
6303
6324
|
method: "POST",
|
|
6304
6325
|
body: {
|
|
6305
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6306
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6326
|
+
..._optionalChain([options, 'optionalAccess', _332 => _332.fleetId]) ? { fleet_id: options.fleetId } : {},
|
|
6327
|
+
..._optionalChain([options, 'optionalAccess', _333 => _333.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
|
|
6307
6328
|
},
|
|
6308
6329
|
maxRetries: 0
|
|
6309
6330
|
});
|
|
@@ -6311,7 +6332,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6311
6332
|
/** Delivery and convergence health. Prefer `client.monitors.health(...)`. */
|
|
6312
6333
|
async readMonitorsHealth(options) {
|
|
6313
6334
|
const params = new URLSearchParams();
|
|
6314
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6335
|
+
if (_optionalChain([options, 'optionalAccess', _334 => _334.fleetId])) params.set("fleet_id", options.fleetId);
|
|
6315
6336
|
const query = params.toString();
|
|
6316
6337
|
const suffix = query ? `?${query}` : "";
|
|
6317
6338
|
return this.http.request(
|
|
@@ -6384,7 +6405,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6384
6405
|
);
|
|
6385
6406
|
}
|
|
6386
6407
|
const params = new URLSearchParams();
|
|
6387
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6408
|
+
if (_optionalChain([options, 'optionalAccess', _335 => _335.cursor])) params.set("cursor", options.cursor);
|
|
6388
6409
|
const suffix = params.size > 0 ? `?${params}` : "";
|
|
6389
6410
|
return this.http.request(
|
|
6390
6411
|
`/api/v2/monitors/batch/${encodeURIComponent(runId)}${suffix}`,
|
|
@@ -6431,7 +6452,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6431
6452
|
* a second charge. The submission is never replayed automatically.
|
|
6432
6453
|
*/
|
|
6433
6454
|
async previewMonitor(definition, options) {
|
|
6434
|
-
const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6455
|
+
const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _336 => _336.idempotencyKey]), () => ( `monitor-preview-${_nullishCoalesce(_optionalChain([globalThis, 'access', _337 => _337.crypto, 'optionalAccess', _338 => _338.randomUUID, 'optionalCall', _339 => _339()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`));
|
|
6435
6456
|
try {
|
|
6436
6457
|
const result = await this.http.request(
|
|
6437
6458
|
"/api/v2/monitors/preview",
|
|
@@ -6439,7 +6460,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6439
6460
|
method: "POST",
|
|
6440
6461
|
body: {
|
|
6441
6462
|
...definition,
|
|
6442
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6463
|
+
..._optionalChain([options, 'optionalAccess', _340 => _340.limit]) === void 0 ? {} : { limit: options.limit }
|
|
6443
6464
|
},
|
|
6444
6465
|
headers: { "Idempotency-Key": idempotencyKey },
|
|
6445
6466
|
maxRetries: 0,
|
|
@@ -6461,7 +6482,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6461
6482
|
* `client.monitors.deploy(...)`.
|
|
6462
6483
|
*/
|
|
6463
6484
|
async deployMonitor(definition, options) {
|
|
6464
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6485
|
+
if (_optionalChain([options, 'optionalAccess', _341 => _341.dryRun])) {
|
|
6465
6486
|
return this.http.request("/api/v2/monitors/check", {
|
|
6466
6487
|
method: "POST",
|
|
6467
6488
|
body: definition
|
|
@@ -6497,12 +6518,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6497
6518
|
/** List deployed monitors. Prefer `client.monitors.list(...)`. */
|
|
6498
6519
|
async listMonitors(options) {
|
|
6499
6520
|
const params = new URLSearchParams();
|
|
6500
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6501
|
-
else if (_optionalChain([options, 'optionalAccess',
|
|
6502
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6521
|
+
if (_optionalChain([options, 'optionalAccess', _342 => _342.state])) params.set("state", options.state);
|
|
6522
|
+
else if (_optionalChain([options, 'optionalAccess', _343 => _343.status])) params.set("status", options.status);
|
|
6523
|
+
if (_optionalChain([options, 'optionalAccess', _344 => _344.limit]) !== void 0)
|
|
6503
6524
|
params.set("limit", String(options.limit));
|
|
6504
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6505
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6525
|
+
if (_optionalChain([options, 'optionalAccess', _345 => _345.cursor])) params.set("cursor", options.cursor);
|
|
6526
|
+
if (_optionalChain([options, 'optionalAccess', _346 => _346.includeConsumers])) params.set("include_consumers", "true");
|
|
6506
6527
|
const query = params.toString();
|
|
6507
6528
|
const suffix = query ? `?${query}` : "";
|
|
6508
6529
|
return this.http.request(
|
|
@@ -6518,7 +6539,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6518
6539
|
);
|
|
6519
6540
|
}
|
|
6520
6541
|
async testMonitorWebhook(key, payload, options) {
|
|
6521
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6542
|
+
if (_optionalChain([options, 'optionalAccess', _347 => _347.dispatch]) === true || _optionalChain([options, 'optionalAccess', _348 => _348.validationOnly]) === false) {
|
|
6522
6543
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)(
|
|
6523
6544
|
"Monitor tests are validation-only and cannot dispatch events.",
|
|
6524
6545
|
void 0,
|
|
@@ -6573,7 +6594,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6573
6594
|
}
|
|
6574
6595
|
/** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
|
|
6575
6596
|
async deleteMonitor(key, options) {
|
|
6576
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6597
|
+
if (_optionalChain([options, 'optionalAccess', _349 => _349.localOnly]) === true) {
|
|
6577
6598
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)(
|
|
6578
6599
|
"localOnly monitor deletion is no longer supported. Monitor deletion always deprovisions the upstream provider resource.",
|
|
6579
6600
|
void 0,
|
|
@@ -6581,11 +6602,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6581
6602
|
);
|
|
6582
6603
|
}
|
|
6583
6604
|
const params = new URLSearchParams();
|
|
6584
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6605
|
+
if (_optionalChain([options, 'optionalAccess', _350 => _350.dryRun])) params.set("dry_run", "true");
|
|
6585
6606
|
const query = params.toString();
|
|
6586
6607
|
return this.http.request(
|
|
6587
6608
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
|
|
6588
|
-
_optionalChain([options, 'optionalAccess',
|
|
6609
|
+
_optionalChain([options, 'optionalAccess', _351 => _351.dryRun]) ? { method: "DELETE" } : {
|
|
6589
6610
|
method: "DELETE",
|
|
6590
6611
|
// Deletion is a provider lifecycle operation. A timeout is an
|
|
6591
6612
|
// unknown outcome, not authority to begin another delete attempt.
|
|
@@ -6598,10 +6619,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6598
6619
|
* Prefer `client.monitors.reactivate(...)`.
|
|
6599
6620
|
*/
|
|
6600
6621
|
async reactivateMonitor(key, options) {
|
|
6601
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
6622
|
+
const query = _optionalChain([options, 'optionalAccess', _352 => _352.dryRun]) ? "?dry_run=true" : "";
|
|
6602
6623
|
return this.http.request(
|
|
6603
6624
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
|
|
6604
|
-
_optionalChain([options, 'optionalAccess',
|
|
6625
|
+
_optionalChain([options, 'optionalAccess', _353 => _353.dryRun]) ? { method: "POST", body: {} } : {
|
|
6605
6626
|
method: "POST",
|
|
6606
6627
|
body: {},
|
|
6607
6628
|
// Reactivation can create an upstream resource, so it must not use
|
|
@@ -6615,7 +6636,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6615
6636
|
// ——————————————————————————————————————————————————————————
|
|
6616
6637
|
static __initStatic() {this.MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH = 96}
|
|
6617
6638
|
monitorJobIdempotencyKey(operation) {
|
|
6618
|
-
const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access',
|
|
6639
|
+
const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _354 => _354.crypto, 'optionalAccess', _355 => _355.randomUUID, 'optionalCall', _356 => _356()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
|
|
6619
6640
|
const prefix = "monitor-job-";
|
|
6620
6641
|
const safeOperation = operation.replace(/[^A-Za-z0-9._-]/g, "-");
|
|
6621
6642
|
const maxOperationLength = Math.max(
|
|
@@ -6626,7 +6647,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6626
6647
|
}
|
|
6627
6648
|
monitorJobHeaders(operation, idempotencyKey) {
|
|
6628
6649
|
return {
|
|
6629
|
-
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess',
|
|
6650
|
+
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _357 => _357.trim, 'call', _358 => _358()]) || this.monitorJobIdempotencyKey(operation)
|
|
6630
6651
|
};
|
|
6631
6652
|
}
|
|
6632
6653
|
async deployMonitorBatch(definitions, options) {
|
|
@@ -6637,7 +6658,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6637
6658
|
body: { version: 1, kind: "batch", monitors: definitions },
|
|
6638
6659
|
headers: this.monitorJobHeaders(
|
|
6639
6660
|
"batch-deploy",
|
|
6640
|
-
_optionalChain([options, 'optionalAccess',
|
|
6661
|
+
_optionalChain([options, 'optionalAccess', _359 => _359.idempotencyKey])
|
|
6641
6662
|
),
|
|
6642
6663
|
maxRetries: 0,
|
|
6643
6664
|
exactUrlOnly: true
|
|
@@ -6656,11 +6677,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6656
6677
|
version: 1,
|
|
6657
6678
|
kind: "batch",
|
|
6658
6679
|
monitors: definitions,
|
|
6659
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6680
|
+
..._optionalChain([options, 'optionalAccess', _360 => _360.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
|
|
6660
6681
|
},
|
|
6661
6682
|
headers: this.monitorJobHeaders(
|
|
6662
6683
|
`batch-sync-${batchId}`,
|
|
6663
|
-
_optionalChain([options, 'optionalAccess',
|
|
6684
|
+
_optionalChain([options, 'optionalAccess', _361 => _361.idempotencyKey])
|
|
6664
6685
|
),
|
|
6665
6686
|
maxRetries: 0,
|
|
6666
6687
|
exactUrlOnly: true
|
|
@@ -6675,7 +6696,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6675
6696
|
body: {},
|
|
6676
6697
|
headers: this.monitorJobHeaders(
|
|
6677
6698
|
`batch-start-${batchId}`,
|
|
6678
|
-
_optionalChain([options, 'optionalAccess',
|
|
6699
|
+
_optionalChain([options, 'optionalAccess', _362 => _362.idempotencyKey])
|
|
6679
6700
|
),
|
|
6680
6701
|
maxRetries: 0,
|
|
6681
6702
|
exactUrlOnly: true
|
|
@@ -6690,7 +6711,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6690
6711
|
body: {},
|
|
6691
6712
|
headers: this.monitorJobHeaders(
|
|
6692
6713
|
`batch-stop-${batchId}`,
|
|
6693
|
-
_optionalChain([options, 'optionalAccess',
|
|
6714
|
+
_optionalChain([options, 'optionalAccess', _363 => _363.idempotencyKey])
|
|
6694
6715
|
),
|
|
6695
6716
|
maxRetries: 0,
|
|
6696
6717
|
exactUrlOnly: true
|
|
@@ -6711,7 +6732,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6711
6732
|
body: {},
|
|
6712
6733
|
headers: this.monitorJobHeaders(
|
|
6713
6734
|
`${action}-${monitorKey}`,
|
|
6714
|
-
_optionalChain([options, 'optionalAccess',
|
|
6735
|
+
_optionalChain([options, 'optionalAccess', _364 => _364.idempotencyKey])
|
|
6715
6736
|
),
|
|
6716
6737
|
maxRetries: 0,
|
|
6717
6738
|
exactUrlOnly: true
|
|
@@ -6724,7 +6745,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6724
6745
|
body: definition,
|
|
6725
6746
|
headers: this.monitorJobHeaders(
|
|
6726
6747
|
`sync-${definition.key}`,
|
|
6727
|
-
_optionalChain([options, 'optionalAccess',
|
|
6748
|
+
_optionalChain([options, 'optionalAccess', _365 => _365.idempotencyKey])
|
|
6728
6749
|
),
|
|
6729
6750
|
maxRetries: 0,
|
|
6730
6751
|
exactUrlOnly: true
|
|
@@ -6737,7 +6758,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6737
6758
|
);
|
|
6738
6759
|
}
|
|
6739
6760
|
async getMonitorJobLogs(jobId, options) {
|
|
6740
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
6761
|
+
const query = _optionalChain([options, 'optionalAccess', _366 => _366.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
|
|
6741
6762
|
return this.http.request(
|
|
6742
6763
|
`/api/v2/monitors/jobs/${encodeURIComponent(jobId)}/logs${query}`,
|
|
6743
6764
|
{ method: "GET" }
|
|
@@ -6750,15 +6771,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6750
6771
|
);
|
|
6751
6772
|
}
|
|
6752
6773
|
async waitForMonitorJob(jobId, options) {
|
|
6753
|
-
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6754
|
-
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6774
|
+
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _367 => _367.timeoutMs]), () => ( 10 * 6e4)));
|
|
6775
|
+
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _368 => _368.pollIntervalMs]), () => ( 2e3)));
|
|
6755
6776
|
const terminal = /* @__PURE__ */ new Set(["succeeded", "failed", "cancelled"]);
|
|
6756
6777
|
const startedAt = Date.now();
|
|
6757
6778
|
let latest = await this.getMonitorJob(jobId);
|
|
6758
6779
|
while (true) {
|
|
6759
|
-
_optionalChain([options, 'optionalAccess',
|
|
6780
|
+
_optionalChain([options, 'optionalAccess', _369 => _369.onProgress, 'optionalCall', _370 => _370(latest)]);
|
|
6760
6781
|
const job = latest.job;
|
|
6761
|
-
const state = typeof _optionalChain([job, 'optionalAccess',
|
|
6782
|
+
const state = typeof _optionalChain([job, 'optionalAccess', _371 => _371.state]) === "string" ? job.state : void 0;
|
|
6762
6783
|
if (state && terminal.has(state)) return latest;
|
|
6763
6784
|
if (Date.now() - startedAt >= timeoutMs) return latest;
|
|
6764
6785
|
await sleep(pollIntervalMs);
|
|
@@ -6769,12 +6790,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6769
6790
|
// Monitor Fleets
|
|
6770
6791
|
// ——————————————————————————————————————————————————————————
|
|
6771
6792
|
monitorFleetIdempotencyKey(operation) {
|
|
6772
|
-
const uuid = _optionalChain([globalThis, 'access',
|
|
6793
|
+
const uuid = _optionalChain([globalThis, 'access', _372 => _372.crypto, 'optionalAccess', _373 => _373.randomUUID, 'optionalCall', _374 => _374()]);
|
|
6773
6794
|
return `monitor-fleet-${operation}-${_nullishCoalesce(uuid, () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`;
|
|
6774
6795
|
}
|
|
6775
6796
|
monitorFleetHeaders(operation, idempotencyKey) {
|
|
6776
6797
|
return {
|
|
6777
|
-
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess',
|
|
6798
|
+
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _375 => _375.trim, 'call', _376 => _376()]) || this.monitorFleetIdempotencyKey(operation)
|
|
6778
6799
|
};
|
|
6779
6800
|
}
|
|
6780
6801
|
monitorFleetPath(fleetId) {
|
|
@@ -6794,15 +6815,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6794
6815
|
const fleetId = typeof definitionOrId === "string" ? definitionOrId : definitionOrId.id;
|
|
6795
6816
|
const body = {
|
|
6796
6817
|
...typeof definitionOrId === "string" ? {} : { definition: definitionOrId },
|
|
6797
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6798
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6818
|
+
..._optionalChain([options, 'optionalAccess', _377 => _377.dryRun]) ? { dry_run: true } : {},
|
|
6819
|
+
..._optionalChain([options, 'optionalAccess', _378 => _378.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
|
|
6799
6820
|
};
|
|
6800
6821
|
return this.http.request(
|
|
6801
6822
|
this.monitorFleetPath(fleetId),
|
|
6802
6823
|
{
|
|
6803
6824
|
method: "PUT",
|
|
6804
6825
|
body,
|
|
6805
|
-
headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess',
|
|
6826
|
+
headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _379 => _379.idempotencyKey])),
|
|
6806
6827
|
maxRetries: 0,
|
|
6807
6828
|
exactUrlOnly: true
|
|
6808
6829
|
}
|
|
@@ -6815,8 +6836,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6815
6836
|
}
|
|
6816
6837
|
async getMonitorFleet(fleetId, options) {
|
|
6817
6838
|
const params = new URLSearchParams();
|
|
6818
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6819
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6839
|
+
if (_optionalChain([options, 'optionalAccess', _380 => _380.drift])) params.set("drift", "1");
|
|
6840
|
+
if (_optionalChain([options, 'optionalAccess', _381 => _381.limit]) !== void 0)
|
|
6820
6841
|
params.set("limit", String(options.limit));
|
|
6821
6842
|
const query = params.toString();
|
|
6822
6843
|
return this.http.request(
|
|
@@ -6829,10 +6850,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6829
6850
|
this.monitorFleetPath(fleetId),
|
|
6830
6851
|
{
|
|
6831
6852
|
method: "DELETE",
|
|
6832
|
-
body: _optionalChain([options, 'optionalAccess',
|
|
6853
|
+
body: _optionalChain([options, 'optionalAccess', _382 => _382.dryRun]) ? { dry_run: true } : {},
|
|
6833
6854
|
headers: this.monitorFleetHeaders(
|
|
6834
6855
|
"deactivate",
|
|
6835
|
-
_optionalChain([options, 'optionalAccess',
|
|
6856
|
+
_optionalChain([options, 'optionalAccess', _383 => _383.idempotencyKey])
|
|
6836
6857
|
),
|
|
6837
6858
|
maxRetries: 0,
|
|
6838
6859
|
exactUrlOnly: true
|
|
@@ -6847,7 +6868,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6847
6868
|
body: {},
|
|
6848
6869
|
headers: this.monitorFleetHeaders(
|
|
6849
6870
|
"reactivate",
|
|
6850
|
-
_optionalChain([options, 'optionalAccess',
|
|
6871
|
+
_optionalChain([options, 'optionalAccess', _384 => _384.idempotencyKey])
|
|
6851
6872
|
),
|
|
6852
6873
|
maxRetries: 0,
|
|
6853
6874
|
exactUrlOnly: true
|
|
@@ -6864,13 +6885,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6864
6885
|
* identical to "the request failed".
|
|
6865
6886
|
*/
|
|
6866
6887
|
async waitForMonitorFleetConvergence(fleetId, options) {
|
|
6867
|
-
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6868
|
-
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6869
|
-
const terminal = _optionalChain([options, 'optionalAccess',
|
|
6888
|
+
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _385 => _385.timeoutMs]), () => ( 10 * 6e4)));
|
|
6889
|
+
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _386 => _386.pollIntervalMs]), () => ( 2e3)));
|
|
6890
|
+
const terminal = _optionalChain([options, 'optionalAccess', _387 => _387.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded"]) : /* @__PURE__ */ new Set(["converged", "degraded", "deactivated"]);
|
|
6870
6891
|
const startedAt = Date.now();
|
|
6871
6892
|
let latest = await this.getMonitorFleet(fleetId);
|
|
6872
6893
|
while (true) {
|
|
6873
|
-
_optionalChain([options, 'optionalAccess',
|
|
6894
|
+
_optionalChain([options, 'optionalAccess', _388 => _388.onProgress, 'optionalCall', _389 => _389(latest)]);
|
|
6874
6895
|
const status = typeof latest.status === "string" ? latest.status : void 0;
|
|
6875
6896
|
if (status && terminal.has(status)) return latest;
|
|
6876
6897
|
if (Date.now() - startedAt >= timeoutMs) return latest;
|