deepline 0.3.454 → 0.3.455
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/http.ts +17 -3
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/tool-calls.ts +13 -1
- package/dist/bundling-sources/sdk/src/types.ts +2 -0
- package/dist/cli/{auth-YNPT3IER.mjs → auth-BGPCPVHW.mjs} +4 -4
- package/dist/cli/auth-SRR4DW75.js +40 -0
- package/dist/cli/{billing-TLRVAOXB.mjs → billing-6BLEXHCR.mjs} +4 -4
- package/dist/cli/{billing-VXIIND6T.js → billing-FCC2YOKB.js} +73 -73
- package/dist/cli/{chunk-VXBEHDM6.js → chunk-2R7JD2NY.js} +8 -6
- package/dist/cli/{chunk-KPPL2WNH.js → chunk-2SN2EEQW.js} +16 -16
- package/dist/cli/{chunk-THJ7ORNM.mjs → chunk-2VHR5DXQ.mjs} +3 -3
- package/dist/cli/{chunk-5OQMUDPM.mjs → chunk-3E4WSS35.mjs} +1 -1
- package/dist/cli/{chunk-5GJH2BYN.mjs → chunk-3RQY2OG7.mjs} +2 -2
- package/dist/cli/{chunk-EXWKHMMP.mjs → chunk-4BZFRLKU.mjs} +5 -5
- package/dist/cli/{chunk-2I7GE7KB.mjs → chunk-4Z3X5CWI.mjs} +1 -1
- package/dist/cli/{chunk-WONLZMDF.js → chunk-6F7TD4M4.js} +6 -6
- package/dist/cli/{chunk-7V3OKSB2.js → chunk-6TOMXZX3.js} +1 -1
- package/dist/cli/{chunk-YETNOEAZ.mjs → chunk-B7K3QD5W.mjs} +10 -9
- package/dist/cli/{chunk-S2PO3X5R.js → chunk-BCB2QNG4.js} +2 -2
- package/dist/cli/{chunk-BUYQU7TB.js → chunk-CZREA5NE.js} +8 -8
- package/dist/cli/{chunk-LWYOJG66.mjs → chunk-DPTEABFU.mjs} +1 -1
- package/dist/cli/{chunk-7ICOQRW5.js → chunk-EXZOUJCD.js} +3 -3
- package/dist/cli/{chunk-DCZSJON4.mjs → chunk-FCQ52RUB.mjs} +2 -2
- package/dist/cli/{chunk-U72KDMYJ.mjs → chunk-IUSGWMGK.mjs} +2 -2
- package/dist/cli/{chunk-SJH66N73.js → chunk-J7WYWQF4.js} +6 -6
- package/dist/cli/{chunk-VHGGHRGY.js → chunk-LQH2KJ53.js} +93 -92
- package/dist/cli/{chunk-TECW24CR.mjs → chunk-LRA5YJVV.mjs} +5 -3
- package/dist/cli/{chunk-FKGXZXRP.js → chunk-MCMLQ7GD.js} +8 -8
- package/dist/cli/{chunk-YPYR4ACF.js → chunk-MFKTYIBJ.js} +51 -51
- package/dist/cli/{chunk-YXCLG3KB.mjs → chunk-PQ4JU2MV.mjs} +4 -2
- package/dist/cli/{chunk-LVHRP7XM.mjs → chunk-R5VMRVRN.mjs} +4 -4
- package/dist/cli/{chunk-P5IQ6LIK.js → chunk-RQMEYYN4.js} +35 -35
- package/dist/cli/{chunk-RDAUQGPG.mjs → chunk-RYGDM5BG.mjs} +1 -1
- package/dist/cli/{chunk-QLMQ2NAQ.js → chunk-SMZUU4NY.js} +2 -2
- package/dist/cli/{chunk-33FEF4RH.js → chunk-UVJLG5KD.js} +50 -50
- package/dist/cli/{chunk-CPXT4KPC.mjs → chunk-VIGEE67Z.mjs} +3 -3
- package/dist/cli/{chunk-IJ5WCZ32.js → chunk-VMGTYM3A.js} +20 -20
- package/dist/cli/{chunk-Z5PQSTYX.js → chunk-W3DIXRDT.js} +241 -239
- package/dist/cli/{chunk-UT6W675P.mjs → chunk-WBULEVM4.mjs} +1 -1
- package/dist/cli/{chunk-G6ZOZQXT.mjs → chunk-WVGPAP7A.mjs} +3 -3
- package/dist/cli/{chunk-27NNEBIS.mjs → chunk-YIFCV77L.mjs} +2 -2
- package/dist/cli/{chunk-6JY2NGJN.js → chunk-YKEWDVZC.js} +26 -26
- package/dist/cli/{csv-I4CAAV6A.mjs → csv-27T3L4RC.mjs} +3 -3
- package/dist/cli/{csv-BSKJR3CR.js → csv-TEAA2YV5.js} +12 -12
- package/dist/cli/{db-RA3IL6MC.js → db-J3PPU7GX.js} +25 -25
- package/dist/cli/{db-EQP24K3B.mjs → db-N3NRYYI4.mjs} +4 -4
- package/dist/cli/{describe-62KPTIFH.js → describe-PX7XBLZF.js} +17 -17
- package/dist/cli/{describe-EZDVJDPQ.mjs → describe-SJBCCTR7.mjs} +13 -13
- package/dist/cli/describe-core.d.mts +1 -1
- package/dist/cli/describe-core.d.ts +1 -1
- package/dist/cli/{executions-2HBBXRPM.js → executions-WXIL4C5M.js} +6 -6
- package/dist/cli/{executions-W5KR56KP.mjs → executions-XN376RR4.mjs} +4 -4
- package/dist/cli/{feedback-6UTOLSFP.mjs → feedback-KHJXJ2K7.mjs} +3 -3
- package/dist/cli/{feedback-CVYS7ZPV.js → feedback-LG5NWE3R.js} +7 -7
- package/dist/cli/{git-JXH64LI4.mjs → git-726A5HHA.mjs} +4 -4
- package/dist/cli/git-PXYOFDQH.js +24 -0
- package/dist/cli/index.js +132 -132
- package/dist/cli/index.mjs +37 -37
- package/dist/cli/{legacy-noops-5XTXIPU2.js → legacy-noops-QI6VN34P.js} +7 -7
- package/dist/cli/{legacy-noops-NYMLGQNX.mjs → legacy-noops-V4WS63SD.mjs} +4 -4
- package/dist/cli/{monitors-CEU6SP2B.mjs → monitors-AAWRYPHY.mjs} +5 -5
- package/dist/cli/{monitors-J6HAQLX2.js → monitors-ICQ2Q4XT.js} +89 -89
- package/dist/cli/{org-CYE3DCIT.js → org-5JV6KYY2.js} +66 -66
- package/dist/cli/{org-RRKAJM5V.mjs → org-7VJKBTZX.mjs} +4 -4
- package/dist/cli/{play-PXISXZ2P.mjs → play-2D6ZIJEV.mjs} +11 -11
- package/dist/cli/{play-NJDW74YH.js → play-HDI2MLJL.js} +284 -284
- package/dist/cli/{providers-JE3MUBYK.js → providers-GIE2W4ZG.js} +7 -7
- package/dist/cli/{providers-6QGGDOWK.mjs → providers-KSKVBQFP.mjs} +4 -4
- package/dist/cli/{quickstart-MKJ7TYQZ.mjs → quickstart-7OGLDF3M.mjs} +3 -3
- package/dist/cli/{quickstart-AQBBOFQL.js → quickstart-JKNKNDXG.js} +5 -5
- package/dist/cli/{search-6PKFZ2JD.mjs → search-CPKXOGV4.mjs} +5 -5
- package/dist/cli/search-LOWDQS5X.js +30 -0
- package/dist/cli/{secrets-IKGJYESD.js → secrets-LFQXTVIE.js} +13 -13
- package/dist/cli/{secrets-QBWRVZCT.mjs → secrets-QHGLI7O6.mjs} +4 -4
- package/dist/cli/{sessions-462I5YEQ.js → sessions-HVMTS7N5.js} +5 -5
- package/dist/cli/{sessions-SVYTBNRJ.mjs → sessions-M4OT6NPP.mjs} +4 -4
- package/dist/cli/{settings-WHLTLPXZ.js → settings-42WLEHAZ.js} +76 -76
- package/dist/cli/{settings-FH4XZ7FE.mjs → settings-BJBOMHL2.mjs} +9 -9
- package/dist/cli/{setup-IKTCP3QB.js → setup-6TZ4L5LT.js} +43 -43
- package/dist/cli/{setup-ISCNCB4W.mjs → setup-ILUF7GCP.mjs} +8 -8
- package/dist/cli/{skills-HITZS5EJ.mjs → skills-7RIWQDD6.mjs} +6 -6
- package/dist/cli/skills-I5OWZZ2Z.js +30 -0
- package/dist/cli/{tools-SQUTVLPO.mjs → tools-J3VDLDF2.mjs} +13 -13
- package/dist/cli/tools-Y4SPWXFJ.js +45 -0
- package/dist/cli/{update-AFYEREBX.mjs → update-GMXJF4WT.mjs} +8 -8
- package/dist/cli/update-HQ5WT3G6.js +32 -0
- package/dist/cli/{workflow-AAOOROIR.js → workflow-LVVK2N3T.js} +15 -15
- package/dist/cli/{workflow-VBCZPKVF.mjs → workflow-W7NQS26K.mjs} +5 -5
- package/dist/{client-Ct6OBj9Y.d.mts → client-BbU5_j7n.d.mts} +7 -0
- package/dist/{client-BV7tC6oq.d.ts → client-CYqG23K1.d.ts} +7 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -6
- package/dist/index.mjs +3 -3
- package/dist/install-integrity.json +82 -82
- 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/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/package.json +1 -1
- package/dist/cli/auth-GUZWKNXM.js +0 -40
- package/dist/cli/git-U6FMVAAM.js +0 -24
- package/dist/cli/search-EJGRNQQK.js +0 -30
- package/dist/cli/skills-LC2YKUSO.js +0 -30
- package/dist/cli/tools-Y55OXE72.js +0 -45
- package/dist/cli/update-Q3I6MSEQ.js +0 -32
|
@@ -28,7 +28,7 @@ var _chunkKXMNM4AQjs = require('./chunk-KXMNM4AQ.js');
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
var
|
|
31
|
+
var _chunk2R7JD2NYjs = require('./chunk-2R7JD2NY.js');
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
var _chunkALJJRZNJjs = require('./chunk-ALJJRZNJ.js');
|
|
@@ -626,6 +626,7 @@ var ToolCalls = class {
|
|
|
626
626
|
const legacyEndpoint = `/api/v2/integrations/${encodeURIComponent(toolId)}/execute`;
|
|
627
627
|
let useLegacyEndpoint = idempotencyKey === void 0;
|
|
628
628
|
const atomicToolOnly = _optionalChain([options, 'optionalAccess', _25 => _25.atomicToolOnly]) === true;
|
|
629
|
+
const retryAmbiguousDelivery = atomicToolOnly && !idempotencyKey && _optionalChain([options, 'optionalAccess', _26 => _26.retryAmbiguousDelivery]) === true;
|
|
629
630
|
const dispatchRequest = async (requestTimeoutMs) => {
|
|
630
631
|
let recoverySupported = false;
|
|
631
632
|
let atomicToolsSupported = false;
|
|
@@ -638,18 +639,19 @@ var ToolCalls = class {
|
|
|
638
639
|
headers,
|
|
639
640
|
{
|
|
640
641
|
timeout: requestTimeoutMs,
|
|
641
|
-
maxRetries: idempotencyKey ? 0 : _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
642
|
-
...atomicToolOnly && !idempotencyKey && _optionalChain([options, 'optionalAccess',
|
|
643
|
-
retryApiErrors: atomicToolOnly || _optionalChain([options, 'optionalAccess',
|
|
642
|
+
maxRetries: idempotencyKey ? 0 : _nullishCoalesce(_optionalChain([options, 'optionalAccess', _27 => _27.maxRetries]), () => ( (retryAmbiguousDelivery ? 2 : 0))),
|
|
643
|
+
...atomicToolOnly && !idempotencyKey && _optionalChain([options, 'optionalAccess', _28 => _28.maxRetries]) === void 0 ? { executePolicyMaxRetries: 2 } : {},
|
|
644
|
+
retryApiErrors: atomicToolOnly || _optionalChain([options, 'optionalAccess', _29 => _29.retryApiErrors]) === true,
|
|
644
645
|
retryFromExecutePolicy: atomicToolOnly,
|
|
646
|
+
retryAmbiguousDelivery,
|
|
645
647
|
exactUrlOnly: true,
|
|
646
648
|
toolId,
|
|
647
649
|
idempotencyKey,
|
|
648
650
|
onResponse: (response2) => {
|
|
649
651
|
lastResponse = null;
|
|
650
|
-
atomicToolsSupported = response2.headers.get(
|
|
652
|
+
atomicToolsSupported = response2.headers.get(_chunk2R7JD2NYjs.ATOMIC_TOOL_EXECUTE_SUPPORTED_HEADER) === "true";
|
|
651
653
|
recoverySupported = response2.headers.get("X-Deepline-Idempotency-Supported") === "true";
|
|
652
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
654
|
+
if (_optionalChain([options, 'optionalAccess', _30 => _30.onServerTiming])) {
|
|
653
655
|
try {
|
|
654
656
|
const notification = options.onServerTiming(
|
|
655
657
|
parseExecuteServerTiming(
|
|
@@ -685,7 +687,7 @@ var ToolCalls = class {
|
|
|
685
687
|
await this.lookupExecutionByKey(
|
|
686
688
|
idempotencyKey,
|
|
687
689
|
requestTimeoutMs,
|
|
688
|
-
_optionalChain([options, 'optionalAccess',
|
|
690
|
+
_optionalChain([options, 'optionalAccess', _31 => _31.cliInvocationId])
|
|
689
691
|
);
|
|
690
692
|
useLegacyEndpoint = true;
|
|
691
693
|
return post();
|
|
@@ -702,7 +704,7 @@ var ToolCalls = class {
|
|
|
702
704
|
};
|
|
703
705
|
let response;
|
|
704
706
|
let recoveryDeadline = null;
|
|
705
|
-
const recoveryTimeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
707
|
+
const recoveryTimeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _32 => _32.recoveryTimeoutMs]), () => ( DEFAULT_EXECUTION_RECOVERY_TIMEOUT_MS));
|
|
706
708
|
let retryDelayMs = 1e3;
|
|
707
709
|
const recoveryTimeoutError = () => executionRecoveryError({
|
|
708
710
|
toolId,
|
|
@@ -730,7 +732,7 @@ var ToolCalls = class {
|
|
|
730
732
|
this.defaultRequestTimeoutMs,
|
|
731
733
|
remainingMs
|
|
732
734
|
),
|
|
733
|
-
_optionalChain([options, 'optionalAccess',
|
|
735
|
+
_optionalChain([options, 'optionalAccess', _33 => _33.cliInvocationId])
|
|
734
736
|
);
|
|
735
737
|
} catch (error) {
|
|
736
738
|
if (!isRecoverableExecutionLookupError(error)) throw error;
|
|
@@ -907,10 +909,10 @@ function resolvePlayRunRuntimeSelection(request, env) {
|
|
|
907
909
|
}
|
|
908
910
|
return runtime;
|
|
909
911
|
}
|
|
910
|
-
const configured = _optionalChain([env, 'access',
|
|
911
|
-
const configuredNamespace = _optionalChain([env, 'access',
|
|
912
|
-
const configuredToken = _optionalChain([env, 'access',
|
|
913
|
-
const configuredPlacementPolicy = _optionalChain([env, 'access',
|
|
912
|
+
const configured = _optionalChain([env, 'access', _34 => _34.DEEPLINE_RUNTIME_ENVIRONMENT, 'optionalAccess', _35 => _35.trim, 'call', _36 => _36()]);
|
|
913
|
+
const configuredNamespace = _optionalChain([env, 'access', _37 => _37.DEEPLINE_RUNTIME_NAMESPACE, 'optionalAccess', _38 => _38.trim, 'call', _39 => _39()]);
|
|
914
|
+
const configuredToken = _optionalChain([env, 'access', _40 => _40.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _41 => _41.trim, 'call', _42 => _42()]);
|
|
915
|
+
const configuredPlacementPolicy = _optionalChain([env, 'access', _43 => _43.DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY, 'optionalAccess', _44 => _44.trim, 'call', _45 => _45()]);
|
|
914
916
|
if (!configured) {
|
|
915
917
|
if (configuredNamespace || configuredToken || configuredPlacementPolicy) {
|
|
916
918
|
const present = [];
|
|
@@ -949,7 +951,7 @@ function resolvePlayRunRuntimeSelection(request, env) {
|
|
|
949
951
|
"INVALID_RUNTIME_NAMESPACE"
|
|
950
952
|
);
|
|
951
953
|
}
|
|
952
|
-
const configuredBackendValue = _optionalChain([env, 'access',
|
|
954
|
+
const configuredBackendValue = _optionalChain([env, 'access', _46 => _46.DEEPLINE_PLAY_RUNNER_BACKEND, 'optionalAccess', _47 => _47.trim, 'call', _48 => _48()]);
|
|
953
955
|
const configuredBackend = configuredBackendValue === "daytona" || configuredBackendValue === "modal" ? configuredBackendValue : void 0;
|
|
954
956
|
if (configuredBackendValue && !configuredBackend) {
|
|
955
957
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)(
|
|
@@ -987,7 +989,7 @@ function resolveStartPlayRunRequest(request, env) {
|
|
|
987
989
|
}
|
|
988
990
|
function runtimeSelectionHeaders(runtime, env) {
|
|
989
991
|
if (!runtime) return void 0;
|
|
990
|
-
const token = _optionalChain([env, 'access',
|
|
992
|
+
const token = _optionalChain([env, 'access', _49 => _49.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _50 => _50.trim, 'call', _51 => _51()]);
|
|
991
993
|
if (!token) {
|
|
992
994
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)(
|
|
993
995
|
"DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN is required for explicit preview runtime selection.",
|
|
@@ -995,10 +997,10 @@ function runtimeSelectionHeaders(runtime, env) {
|
|
|
995
997
|
"RUNTIME_ENVIRONMENT_TOKEN_REQUIRED"
|
|
996
998
|
);
|
|
997
999
|
}
|
|
998
|
-
const receivers = _optionalChain([env, 'access',
|
|
1000
|
+
const receivers = _optionalChain([env, 'access', _52 => _52.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _53 => _53.trim, 'call', _54 => _54()]);
|
|
999
1001
|
return {
|
|
1000
|
-
[
|
|
1001
|
-
...receivers ? { [
|
|
1002
|
+
[_chunk2R7JD2NYjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
|
|
1003
|
+
...receivers ? { [_chunk2R7JD2NYjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
|
|
1002
1004
|
};
|
|
1003
1005
|
}
|
|
1004
1006
|
function normalizeTestPolicyOverrides(value, source) {
|
|
@@ -1013,7 +1015,7 @@ function normalizeTestPolicyOverrides(value, source) {
|
|
|
1013
1015
|
}
|
|
1014
1016
|
function parseEnvTestPolicyOverrides(env) {
|
|
1015
1017
|
const raw = env.DEEPLINE_TEST_POLICY_OVERRIDES;
|
|
1016
|
-
const trimmed = _optionalChain([raw, 'optionalAccess',
|
|
1018
|
+
const trimmed = _optionalChain([raw, 'optionalAccess', _55 => _55.trim, 'call', _56 => _56()]);
|
|
1017
1019
|
if (!trimmed) return void 0;
|
|
1018
1020
|
let parsed;
|
|
1019
1021
|
try {
|
|
@@ -1033,17 +1035,17 @@ function isRecord2(value) {
|
|
|
1033
1035
|
}
|
|
1034
1036
|
function normalizePlayStatus(raw) {
|
|
1035
1037
|
const runPackage = _chunkJKVRBCZLjs.isPlayRunPackage.call(void 0, raw) ? raw : _chunkJKVRBCZLjs.isPlayRunPackage.call(void 0, raw.package) ? raw.package : null;
|
|
1036
|
-
const packageRun = _optionalChain([runPackage, 'optionalAccess',
|
|
1037
|
-
const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess',
|
|
1038
|
+
const packageRun = _optionalChain([runPackage, 'optionalAccess', _57 => _57.run]);
|
|
1039
|
+
const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess', _58 => _58.status]) === "string" ? packageRun.status : null;
|
|
1038
1040
|
const status = _chunkJKVRBCZLjs.decodePlayRunPublicStatus.call(void 0, rawStatus);
|
|
1039
1041
|
if (!status) {
|
|
1040
1042
|
throw new Error(
|
|
1041
1043
|
`Invalid play run lifecycle status in API response: ${JSON.stringify(rawStatus)}.`
|
|
1042
1044
|
);
|
|
1043
1045
|
}
|
|
1044
|
-
const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess',
|
|
1045
|
-
const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess',
|
|
1046
|
-
const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess',
|
|
1046
|
+
const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess', _59 => _59.id]), () => ( ""));
|
|
1047
|
+
const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _60 => _60.overview]), () => ( raw.overview));
|
|
1048
|
+
const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _61 => _61.runStatus]), () => ( raw.runStatus));
|
|
1047
1049
|
return {
|
|
1048
1050
|
...raw,
|
|
1049
1051
|
runId,
|
|
@@ -1069,16 +1071,16 @@ var PlayClient = class {
|
|
|
1069
1071
|
return _chunkJKVRBCZLjs.startPlayRun.call(void 0,
|
|
1070
1072
|
this.http,
|
|
1071
1073
|
resolved.request,
|
|
1072
|
-
_optionalChain([options, 'optionalAccess',
|
|
1074
|
+
_optionalChain([options, 'optionalAccess', _62 => _62.cliAdmission]) ? { ...headers, "X-Deepline-API-Major": String(_chunk2R7JD2NYjs.SDK_API_MAJOR) } : headers,
|
|
1073
1075
|
options
|
|
1074
1076
|
);
|
|
1075
1077
|
}
|
|
1076
1078
|
async getPlayStatus(workflowId, options) {
|
|
1077
1079
|
const params = new URLSearchParams();
|
|
1078
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1080
|
+
if (_optionalChain([options, 'optionalAccess', _63 => _63.billing]) === false) {
|
|
1079
1081
|
params.set("billing", "false");
|
|
1080
1082
|
}
|
|
1081
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1083
|
+
if (_optionalChain([options, 'optionalAccess', _64 => _64.full]) === true) {
|
|
1082
1084
|
params.set("full", "true");
|
|
1083
1085
|
}
|
|
1084
1086
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -1096,7 +1098,7 @@ var PlayClient = class {
|
|
|
1096
1098
|
async stopPlay(workflowId, options) {
|
|
1097
1099
|
return this.http.post(
|
|
1098
1100
|
`/api/v2/runs/${encodeURIComponent(workflowId)}/stop`,
|
|
1099
|
-
_optionalChain([options, 'optionalAccess',
|
|
1101
|
+
_optionalChain([options, 'optionalAccess', _65 => _65.reason]) ? { reason: options.reason } : {}
|
|
1100
1102
|
);
|
|
1101
1103
|
}
|
|
1102
1104
|
async listPlayRuns(playName) {
|
|
@@ -1108,7 +1110,7 @@ var PlayClient = class {
|
|
|
1108
1110
|
}
|
|
1109
1111
|
async getPlay(name, options) {
|
|
1110
1112
|
const encodedName = encodeURIComponent(name);
|
|
1111
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
1113
|
+
const query = _optionalChain([options, 'optionalAccess', _66 => _66.source]) ? `?include=source&revision=${encodeURIComponent(options.source)}` : _optionalChain([options, 'optionalAccess', _67 => _67.guidance]) ? "?include=guidance" : "";
|
|
1112
1114
|
return this.http.get(`/api/v2/plays/${encodedName}${query}`);
|
|
1113
1115
|
}
|
|
1114
1116
|
async clearPlayHistory(name, request = {}) {
|
|
@@ -1120,7 +1122,7 @@ var PlayClient = class {
|
|
|
1120
1122
|
}
|
|
1121
1123
|
async listPlayVersions(name, options) {
|
|
1122
1124
|
const encodedName = encodeURIComponent(name);
|
|
1123
|
-
const suffix = _optionalChain([options, 'optionalAccess',
|
|
1125
|
+
const suffix = _optionalChain([options, 'optionalAccess', _68 => _68.full]) ? "?full=true" : "";
|
|
1124
1126
|
const response = await this.http.get(
|
|
1125
1127
|
`/api/v2/plays/${encodedName}/versions${suffix}`
|
|
1126
1128
|
);
|
|
@@ -1135,9 +1137,9 @@ var PlayClient = class {
|
|
|
1135
1137
|
}
|
|
1136
1138
|
};
|
|
1137
1139
|
function createPlayClient(options) {
|
|
1138
|
-
const config =
|
|
1140
|
+
const config = _chunk2R7JD2NYjs.resolveConfig.call(void 0, options);
|
|
1139
1141
|
return new PlayClient(
|
|
1140
|
-
new (0,
|
|
1142
|
+
new (0, _chunk2R7JD2NYjs.HttpClient)(config),
|
|
1141
1143
|
_nullishCoalesce(config.environment, () => ( process.env))
|
|
1142
1144
|
);
|
|
1143
1145
|
}
|
|
@@ -2084,7 +2086,7 @@ function parseDsl(input) {
|
|
|
2084
2086
|
input.slice(position)
|
|
2085
2087
|
);
|
|
2086
2088
|
if (!operation) {
|
|
2087
|
-
const token = _nullishCoalesce(_nullishCoalesce(_optionalChain([/^(?:[=!<>~]+|[A-Za-z_]+)/, 'access',
|
|
2089
|
+
const token = _nullishCoalesce(_nullishCoalesce(_optionalChain([/^(?:[=!<>~]+|[A-Za-z_]+)/, 'access', _69 => _69.exec, 'call', _70 => _70(input.slice(position)), 'optionalAccess', _71 => _71[0]]), () => ( input[position])), () => ( "<end>"));
|
|
2088
2090
|
if (token === "=") {
|
|
2089
2091
|
const corrected = `${input.slice(0, position)}==${input.slice(position + 1)}`;
|
|
2090
2092
|
fail(
|
|
@@ -2163,7 +2165,7 @@ function normalizeRunEventQueryTimestamp(value) {
|
|
|
2163
2165
|
return /[1-9]/.test(extraMicros) ? canonical2.replace(/Z$/, `${extraMicros}Z`) : canonical2;
|
|
2164
2166
|
}
|
|
2165
2167
|
function timestampMicros(value) {
|
|
2166
|
-
const fraction = _nullishCoalesce(_optionalChain([/\.(\d+)Z$/, 'access',
|
|
2168
|
+
const fraction = _nullishCoalesce(_optionalChain([/\.(\d+)Z$/, 'access', _72 => _72.exec, 'call', _73 => _73(value), 'optionalAccess', _74 => _74[1]]), () => ( ""));
|
|
2167
2169
|
return BigInt(Date.parse(value)) * BigInt(1e3) + BigInt(fraction.padEnd(6, "0").slice(3));
|
|
2168
2170
|
}
|
|
2169
2171
|
function time(value, nowMs, fallback) {
|
|
@@ -2669,10 +2671,10 @@ function getStepStatusSignature(snapshot) {
|
|
|
2669
2671
|
_nullishCoalesce(state.artifactTableNamespace, () => ( "")),
|
|
2670
2672
|
_nullishCoalesce(state.startedAt, () => ( "")),
|
|
2671
2673
|
_nullishCoalesce(state.completedAt, () => ( "")),
|
|
2672
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
2673
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
2674
|
+
_nullishCoalesce(_optionalChain([state, 'access', _75 => _75.progress, 'optionalAccess', _76 => _76.startedAt]), () => ( "")),
|
|
2675
|
+
_nullishCoalesce(_optionalChain([state, 'access', _77 => _77.progress, 'optionalAccess', _78 => _78.completedAt]), () => ( "")),
|
|
2674
2676
|
_nullishCoalesce(state.updatedAt, () => ( "")),
|
|
2675
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
2677
|
+
_nullishCoalesce(_optionalChain([state, 'access', _79 => _79.progress, 'optionalAccess', _80 => _80.updatedAt]), () => ( ""))
|
|
2676
2678
|
].join(":")
|
|
2677
2679
|
).join("|");
|
|
2678
2680
|
}
|
|
@@ -2681,11 +2683,11 @@ function getStepProgressSignature(snapshot) {
|
|
|
2681
2683
|
snapshot.nodeStates.map((state) => [
|
|
2682
2684
|
state.nodeId,
|
|
2683
2685
|
projectPlayStepProgressCounters(_nullishCoalesce(state.progress, () => ( {}))),
|
|
2684
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
2685
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
2686
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
2687
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
2688
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
2686
|
+
_nullishCoalesce(_optionalChain([state, 'access', _81 => _81.progress, 'optionalAccess', _82 => _82.artifactTableNamespace]), () => ( "")),
|
|
2687
|
+
_nullishCoalesce(_optionalChain([state, 'access', _83 => _83.progress, 'optionalAccess', _84 => _84.startedAt]), () => ( "")),
|
|
2688
|
+
_nullishCoalesce(_optionalChain([state, 'access', _85 => _85.progress, 'optionalAccess', _86 => _86.completedAt]), () => ( "")),
|
|
2689
|
+
_nullishCoalesce(_optionalChain([state, 'access', _87 => _87.progress, 'optionalAccess', _88 => _88.updatedAt]), () => ( "")),
|
|
2690
|
+
_nullishCoalesce(_optionalChain([state, 'access', _89 => _89.progress, 'optionalAccess', _90 => _90.message]), () => ( ""))
|
|
2689
2691
|
])
|
|
2690
2692
|
);
|
|
2691
2693
|
}
|
|
@@ -2755,8 +2757,8 @@ function diffPlayRunStreamEvents(input) {
|
|
|
2755
2757
|
if (state.status === "idle") {
|
|
2756
2758
|
continue;
|
|
2757
2759
|
}
|
|
2758
|
-
const persistedStartedAt = _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access',
|
|
2759
|
-
const persistedCompletedAt = _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access',
|
|
2760
|
+
const persistedStartedAt = _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _91 => _91.progress, 'optionalAccess', _92 => _92.startedAt]))), () => ( null));
|
|
2761
|
+
const persistedCompletedAt = _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _93 => _93.progress, 'optionalAccess', _94 => _94.completedAt]))), () => ( null));
|
|
2760
2762
|
events.push(
|
|
2761
2763
|
makeRunStreamEvent({
|
|
2762
2764
|
cursor,
|
|
@@ -2770,7 +2772,7 @@ function diffPlayRunStreamEvents(input) {
|
|
|
2770
2772
|
...resolveTimingWindow({
|
|
2771
2773
|
startedAt: persistedStartedAt,
|
|
2772
2774
|
completedAt: persistedCompletedAt,
|
|
2773
|
-
updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access',
|
|
2775
|
+
updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _95 => _95.progress, 'optionalAccess', _96 => _96.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
|
|
2774
2776
|
})
|
|
2775
2777
|
}
|
|
2776
2778
|
})
|
|
@@ -2824,9 +2826,9 @@ function diffPlayRunStreamEvents(input) {
|
|
|
2824
2826
|
if (next.snapshotSignature !== previous.snapshotSignature) {
|
|
2825
2827
|
const enrichedNodeStates = snapshot.nodeStates.map((state) => {
|
|
2826
2828
|
const timing = resolveTimingWindow({
|
|
2827
|
-
startedAt: _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access',
|
|
2828
|
-
completedAt: _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access',
|
|
2829
|
-
updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access',
|
|
2829
|
+
startedAt: _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _97 => _97.progress, 'optionalAccess', _98 => _98.startedAt]))), () => ( null)),
|
|
2830
|
+
completedAt: _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _99 => _99.progress, 'optionalAccess', _100 => _100.completedAt]))), () => ( null)),
|
|
2831
|
+
updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _101 => _101.progress, 'optionalAccess', _102 => _102.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
|
|
2830
2832
|
});
|
|
2831
2833
|
return {
|
|
2832
2834
|
...state,
|
|
@@ -2873,18 +2875,18 @@ var RUN_WATCH_POLL_INTERVAL_MS = 2e3;
|
|
|
2873
2875
|
var RUN_WATCH_STARTUP_POLL_INTERVAL_MS = 500;
|
|
2874
2876
|
var RUN_WATCH_STARTUP_WINDOW_MS = 6e3;
|
|
2875
2877
|
function waitForNextPoll(ms, signal) {
|
|
2876
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
2878
|
+
if (_optionalChain([signal, 'optionalAccess', _103 => _103.aborted])) {
|
|
2877
2879
|
return Promise.resolve(false);
|
|
2878
2880
|
}
|
|
2879
2881
|
return new Promise((resolve) => {
|
|
2880
2882
|
const finish = (elapsed) => {
|
|
2881
2883
|
clearTimeout(timeout);
|
|
2882
|
-
_optionalChain([signal, 'optionalAccess',
|
|
2884
|
+
_optionalChain([signal, 'optionalAccess', _104 => _104.removeEventListener, 'call', _105 => _105("abort", onAbort)]);
|
|
2883
2885
|
resolve(elapsed);
|
|
2884
2886
|
};
|
|
2885
2887
|
const onAbort = () => finish(false);
|
|
2886
2888
|
const timeout = setTimeout(() => finish(true), ms);
|
|
2887
|
-
_optionalChain([signal, 'optionalAccess',
|
|
2889
|
+
_optionalChain([signal, 'optionalAccess', _106 => _106.addEventListener, 'call', _107 => _107("abort", onAbort, { once: true })]);
|
|
2888
2890
|
});
|
|
2889
2891
|
}
|
|
2890
2892
|
function readSnapshotResponse(response, runId) {
|
|
@@ -2964,7 +2966,7 @@ async function* watchRunEvents(options) {
|
|
|
2964
2966
|
let consecutiveFailures = 0;
|
|
2965
2967
|
let outageNoticeSent = false;
|
|
2966
2968
|
let pollCount = 0;
|
|
2967
|
-
while (!_optionalChain([signal, 'optionalAccess',
|
|
2969
|
+
while (!_optionalChain([signal, 'optionalAccess', _108 => _108.aborted])) {
|
|
2968
2970
|
const pollStartedAt = Date.now();
|
|
2969
2971
|
const poll = ++pollCount;
|
|
2970
2972
|
const pollIntervalMs = _nullishCoalesce(options.pollIntervalMs, () => ( (pollStartedAt - watchStartedAt < RUN_WATCH_STARTUP_WINDOW_MS ? RUN_WATCH_STARTUP_POLL_INTERVAL_MS : RUN_WATCH_POLL_INTERVAL_MS)));
|
|
@@ -3008,7 +3010,7 @@ async function* watchRunEvents(options) {
|
|
|
3008
3010
|
reportPoll();
|
|
3009
3011
|
} catch (error) {
|
|
3010
3012
|
reportPoll();
|
|
3011
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
3013
|
+
if (_optionalChain([signal, 'optionalAccess', _109 => _109.aborted])) {
|
|
3012
3014
|
return;
|
|
3013
3015
|
}
|
|
3014
3016
|
if (!isTransientPlayRunReadError(error)) {
|
|
@@ -3017,12 +3019,12 @@ async function* watchRunEvents(options) {
|
|
|
3017
3019
|
consecutiveFailures += 1;
|
|
3018
3020
|
const reason = error instanceof Error ? error.message : String(error);
|
|
3019
3021
|
if (!outageNoticeSent) {
|
|
3020
|
-
_optionalChain([options, 'access',
|
|
3022
|
+
_optionalChain([options, 'access', _110 => _110.onRetry, 'optionalCall', _111 => _111({
|
|
3021
3023
|
attempt: consecutiveFailures,
|
|
3022
3024
|
delayMs: pollIntervalMs,
|
|
3023
3025
|
reason
|
|
3024
3026
|
})]);
|
|
3025
|
-
_optionalChain([options, 'access',
|
|
3027
|
+
_optionalChain([options, 'access', _112 => _112.onNotice, 'optionalCall', _113 => _113(
|
|
3026
3028
|
`[watch] run snapshot request failed; retrying snapshot polling (${reason})`
|
|
3027
3029
|
)]);
|
|
3028
3030
|
outageNoticeSent = true;
|
|
@@ -3037,12 +3039,12 @@ async function* watchRunEvents(options) {
|
|
|
3037
3039
|
continue;
|
|
3038
3040
|
}
|
|
3039
3041
|
if (outageNoticeSent) {
|
|
3040
|
-
_optionalChain([options, 'access',
|
|
3042
|
+
_optionalChain([options, 'access', _114 => _114.onNotice, 'optionalCall', _115 => _115("[watch] run snapshot polling recovered")]);
|
|
3041
3043
|
outageNoticeSent = false;
|
|
3042
3044
|
}
|
|
3043
3045
|
consecutiveFailures = 0;
|
|
3044
3046
|
if (terminalStatus) {
|
|
3045
|
-
await _optionalChain([options, 'access',
|
|
3047
|
+
await _optionalChain([options, 'access', _116 => _116.terminalStatus, 'optionalAccess', _117 => _117.onStatus, 'call', _118 => _118(terminalStatus, snapshot.status)]);
|
|
3046
3048
|
}
|
|
3047
3049
|
const diff = diffPlayRunStreamEvents({
|
|
3048
3050
|
streamId,
|
|
@@ -3106,7 +3108,7 @@ function parseNotificationGroupTarget(value) {
|
|
|
3106
3108
|
}
|
|
3107
3109
|
return { kind: "email", email };
|
|
3108
3110
|
}
|
|
3109
|
-
const slack = _optionalChain([/^slack:(.+)$/i, 'access',
|
|
3111
|
+
const slack = _optionalChain([/^slack:(.+)$/i, 'access', _119 => _119.exec, 'call', _120 => _120(normalized), 'optionalAccess', _121 => _121[1], 'optionalAccess', _122 => _122.trim, 'call', _123 => _123()]);
|
|
3110
3112
|
if (!slack) {
|
|
3111
3113
|
const provider = normalized.split(":", 1)[0] || normalized;
|
|
3112
3114
|
throw new Error(
|
|
@@ -3114,7 +3116,7 @@ function parseNotificationGroupTarget(value) {
|
|
|
3114
3116
|
);
|
|
3115
3117
|
}
|
|
3116
3118
|
const member = /^member:([UW][A-Z0-9]{8,})$/i.exec(slack);
|
|
3117
|
-
if (_optionalChain([member, 'optionalAccess',
|
|
3119
|
+
if (_optionalChain([member, 'optionalAccess', _124 => _124[1]])) {
|
|
3118
3120
|
return { kind: "slack", memberId: member[1].toUpperCase() };
|
|
3119
3121
|
}
|
|
3120
3122
|
if (slack.toLowerCase().startsWith("member:")) {
|
|
@@ -3139,11 +3141,11 @@ var REGISTER_PLAY_ARTIFACTS_COMPILE_CONCURRENCY = 3;
|
|
|
3139
3141
|
var REGISTER_PLAY_ARTIFACTS_MAX_BATCH_COUNT = 3;
|
|
3140
3142
|
var REGISTER_PLAY_ARTIFACTS_MAX_BATCH_BYTES = 25e5;
|
|
3141
3143
|
function isolatedCiRuntimeEventReadHeaders(env) {
|
|
3142
|
-
const schema = _optionalChain([env, 'access',
|
|
3143
|
-
if (_optionalChain([env, 'access',
|
|
3144
|
+
const schema = _optionalChain([env, 'access', _125 => _125.DEEPLINE_RUNTIME_SCHEDULER_SCHEMA, 'optionalAccess', _126 => _126.trim, 'call', _127 => _127()]);
|
|
3145
|
+
if (_optionalChain([env, 'access', _128 => _128.DEEPLINE_SYNTHETIC_RUN, 'optionalAccess', _129 => _129.trim, 'call', _130 => _130()]) !== "1" || !schema || !/^fly_absurd_pr_\d+_\d+(?:_\d+)?$/.test(schema)) {
|
|
3144
3146
|
return void 0;
|
|
3145
3147
|
}
|
|
3146
|
-
const token = _optionalChain([env, 'access',
|
|
3148
|
+
const token = _optionalChain([env, 'access', _131 => _131.DEEPLINE_INTERNAL_TOKEN, 'optionalAccess', _132 => _132.trim, 'call', _133 => _133()]);
|
|
3147
3149
|
if (!token) {
|
|
3148
3150
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)(
|
|
3149
3151
|
"DEEPLINE_INTERNAL_TOKEN is required for isolated CI runtime event reads.",
|
|
@@ -3151,7 +3153,7 @@ function isolatedCiRuntimeEventReadHeaders(env) {
|
|
|
3151
3153
|
"RUNTIME_EVENT_INTERNAL_TOKEN_REQUIRED"
|
|
3152
3154
|
);
|
|
3153
3155
|
}
|
|
3154
|
-
return { [
|
|
3156
|
+
return { [_chunk2R7JD2NYjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
|
|
3155
3157
|
}
|
|
3156
3158
|
function sleep(ms) {
|
|
3157
3159
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -3166,7 +3168,7 @@ function isTransientCompileManifestError(error) {
|
|
|
3166
3168
|
);
|
|
3167
3169
|
}
|
|
3168
3170
|
function requireCompileManifestResponse(response, playName) {
|
|
3169
|
-
const compilerManifest = _optionalChain([response, 'optionalAccess',
|
|
3171
|
+
const compilerManifest = _optionalChain([response, 'optionalAccess', _134 => _134.compilerManifest]);
|
|
3170
3172
|
if (!compilerManifest || typeof compilerManifest !== "object" || Array.isArray(compilerManifest)) {
|
|
3171
3173
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)(
|
|
3172
3174
|
`Compile manifest response did not include compilerManifest for ${playName}.`,
|
|
@@ -3218,7 +3220,7 @@ function chunkRegisterPlayArtifacts(artifacts) {
|
|
|
3218
3220
|
}
|
|
3219
3221
|
function searchParams(options) {
|
|
3220
3222
|
const params = new URLSearchParams();
|
|
3221
|
-
params.set("q", _nullishCoalesce(_optionalChain([options, 'access',
|
|
3223
|
+
params.set("q", _nullishCoalesce(_optionalChain([options, 'access', _135 => _135.query, 'optionalAccess', _136 => _136.trim, 'call', _137 => _137()]), () => ( "")));
|
|
3222
3224
|
params.set(
|
|
3223
3225
|
"include_search_debug",
|
|
3224
3226
|
options.includeSearchDebug ? "true" : "false"
|
|
@@ -3228,13 +3230,13 @@ function searchParams(options) {
|
|
|
3228
3230
|
if (options.offset !== void 0) {
|
|
3229
3231
|
params.set("offset", String(options.offset));
|
|
3230
3232
|
}
|
|
3231
|
-
if (_optionalChain([options, 'access',
|
|
3233
|
+
if (_optionalChain([options, 'access', _138 => _138.categories, 'optionalAccess', _139 => _139.trim, 'call', _140 => _140()])) {
|
|
3232
3234
|
params.set("categories", options.categories.trim());
|
|
3233
3235
|
}
|
|
3234
|
-
if (_optionalChain([options, 'access',
|
|
3236
|
+
if (_optionalChain([options, 'access', _141 => _141.searchTerms, 'optionalAccess', _142 => _142.trim, 'call', _143 => _143()])) {
|
|
3235
3237
|
params.set("search_terms", options.searchTerms.trim());
|
|
3236
3238
|
}
|
|
3237
|
-
if (_optionalChain([options, 'access',
|
|
3239
|
+
if (_optionalChain([options, 'access', _144 => _144.task, 'optionalAccess', _145 => _145.trim, 'call', _146 => _146()])) params.set("task", options.task.trim());
|
|
3238
3240
|
return params;
|
|
3239
3241
|
}
|
|
3240
3242
|
var RUNS_FAILED_LOG_LIMIT = 20;
|
|
@@ -3358,9 +3360,9 @@ function playRunResultFromStatus(status, startedAt, fallbackRunId) {
|
|
|
3358
3360
|
runId: status.runId || fallbackRunId,
|
|
3359
3361
|
result: _nullishCoalesce(status.package, () => ( status.result)),
|
|
3360
3362
|
...status.package ? { package: status.package } : {},
|
|
3361
|
-
logs: _nullishCoalesce(_optionalChain([status, 'access',
|
|
3363
|
+
logs: _nullishCoalesce(_optionalChain([status, 'access', _147 => _147.progress, 'optionalAccess', _148 => _148.logs]), () => ( [])),
|
|
3362
3364
|
durationMs: Date.now() - startedAt,
|
|
3363
|
-
error: _nullishCoalesce(_optionalChain([status, 'access',
|
|
3365
|
+
error: _nullishCoalesce(_optionalChain([status, 'access', _149 => _149.progress, 'optionalAccess', _150 => _150.error]), () => ( (status.status !== "completed" ? status.status : void 0)))
|
|
3364
3366
|
};
|
|
3365
3367
|
}
|
|
3366
3368
|
var DeeplineClient = (_class = class _DeeplineClient {
|
|
@@ -3389,14 +3391,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3389
3391
|
* @throws {@link ConfigError} if no API key can be resolved from any source.
|
|
3390
3392
|
*/
|
|
3391
3393
|
constructor(options) {
|
|
3392
|
-
this.config =
|
|
3394
|
+
this.config = _chunk2R7JD2NYjs.resolveConfig.call(void 0, options);
|
|
3393
3395
|
this.environment = _nullishCoalesce(this.config.environment, () => ( process.env));
|
|
3394
|
-
this.http = new (0,
|
|
3396
|
+
this.http = new (0, _chunk2R7JD2NYjs.HttpClient)(this.config);
|
|
3395
3397
|
this.playClient = new PlayClient(this.http, this.environment);
|
|
3396
3398
|
this.toolCalls = new ToolCalls(
|
|
3397
3399
|
this.http,
|
|
3398
3400
|
this.config.timeout,
|
|
3399
|
-
_optionalChain([options, 'optionalAccess',
|
|
3401
|
+
_optionalChain([options, 'optionalAccess', _151 => _151.timeout])
|
|
3400
3402
|
);
|
|
3401
3403
|
this.runs = {
|
|
3402
3404
|
getReceipts: (runId, options2) => this.getRunReceipts(runId, options2),
|
|
@@ -3459,7 +3461,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3459
3461
|
{},
|
|
3460
3462
|
{
|
|
3461
3463
|
"Idempotency-Key": requireBillingIdempotencyKey(
|
|
3462
|
-
_nullishCoalesce(_optionalChain([options2, 'optionalAccess',
|
|
3464
|
+
_nullishCoalesce(_optionalChain([options2, 'optionalAccess', _152 => _152.idempotencyKey]), () => ( globalThis.crypto.randomUUID()))
|
|
3463
3465
|
)
|
|
3464
3466
|
}
|
|
3465
3467
|
),
|
|
@@ -3479,7 +3481,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3479
3481
|
check: (definition) => this.checkMonitor(definition),
|
|
3480
3482
|
preview: (definition, options2) => this.previewMonitor(definition, options2),
|
|
3481
3483
|
deploy: (definition, options2) => this.deployMonitor(definition, options2),
|
|
3482
|
-
sync: (definition, options2) => _optionalChain([options2, 'optionalAccess',
|
|
3484
|
+
sync: (definition, options2) => _optionalChain([options2, 'optionalAccess', _153 => _153.dryRun]) ? this.deployMonitor(definition, { dryRun: true }) : this.syncScalarMonitor(definition, options2),
|
|
3483
3485
|
list: (options2) => this.listMonitors(options2),
|
|
3484
3486
|
get: (key) => this.getMonitor(key),
|
|
3485
3487
|
test: (key, payload, options2) => this.testMonitorWebhook(key, payload, options2),
|
|
@@ -3488,13 +3490,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3488
3490
|
update: (key, patch) => this.updateMonitor(key, patch),
|
|
3489
3491
|
delete: (key, options2) => this.deleteMonitor(key, options2),
|
|
3490
3492
|
reactivate: (key, options2) => this.reactivateMonitor(key, options2),
|
|
3491
|
-
start: (key, options2) => _optionalChain([options2, 'optionalAccess',
|
|
3493
|
+
start: (key, options2) => _optionalChain([options2, 'optionalAccess', _154 => _154.dryRun]) ? this.submitMonitorBatch({
|
|
3492
3494
|
kind: "reactivate",
|
|
3493
3495
|
scope: { kind: "keys", monitorKeys: [key] },
|
|
3494
3496
|
dryRun: true,
|
|
3495
3497
|
idempotencyKey: _nullishCoalesce(options2.idempotencyKey, () => ( this.monitorJobIdempotencyKey(`start-${key}`)))
|
|
3496
3498
|
}) : this.submitScalarMonitorLifecycle(key, "start", options2),
|
|
3497
|
-
stop: (key, options2) => _optionalChain([options2, 'optionalAccess',
|
|
3499
|
+
stop: (key, options2) => _optionalChain([options2, 'optionalAccess', _155 => _155.dryRun]) ? this.submitMonitorBatch({
|
|
3498
3500
|
kind: "deactivate",
|
|
3499
3501
|
scope: { kind: "keys", monitorKeys: [key] },
|
|
3500
3502
|
dryRun: true,
|
|
@@ -3598,17 +3600,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3598
3600
|
*/
|
|
3599
3601
|
async listTools(options) {
|
|
3600
3602
|
const params = new URLSearchParams();
|
|
3601
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3603
|
+
if (_optionalChain([options, 'optionalAccess', _156 => _156.categories, 'optionalAccess', _157 => _157.trim, 'call', _158 => _158()])) {
|
|
3602
3604
|
params.set("categories", options.categories.trim());
|
|
3603
3605
|
}
|
|
3604
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3606
|
+
if (_optionalChain([options, 'optionalAccess', _159 => _159.tags, 'optionalAccess', _160 => _160.trim, 'call', _161 => _161()])) {
|
|
3605
3607
|
params.set("tags", options.tags.trim());
|
|
3606
3608
|
}
|
|
3607
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3609
|
+
if (_optionalChain([options, 'optionalAccess', _162 => _162.grep, 'optionalAccess', _163 => _163.trim, 'call', _164 => _164()])) {
|
|
3608
3610
|
params.set("grep", options.grep.trim());
|
|
3609
3611
|
params.set("grep_mode", _nullishCoalesce(options.grepMode, () => ( "all")));
|
|
3610
3612
|
}
|
|
3611
|
-
params.set("compact", _optionalChain([options, 'optionalAccess',
|
|
3613
|
+
params.set("compact", _optionalChain([options, 'optionalAccess', _165 => _165.compact]) === true ? "true" : "false");
|
|
3612
3614
|
const suffix = params.toString() ? `?${params.toString()}` : "";
|
|
3613
3615
|
const res = await this.http.get(
|
|
3614
3616
|
`/api/v2/tools${suffix}`
|
|
@@ -3641,7 +3643,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3641
3643
|
const params = new URLSearchParams({
|
|
3642
3644
|
view: "category",
|
|
3643
3645
|
categories: normalizedCategory,
|
|
3644
|
-
compact: _optionalChain([options, 'optionalAccess',
|
|
3646
|
+
compact: _optionalChain([options, 'optionalAccess', _166 => _166.compact]) === true ? "true" : "false"
|
|
3645
3647
|
});
|
|
3646
3648
|
const response = await this.http.get(
|
|
3647
3649
|
`/api/v2/tools?${params}`
|
|
@@ -3656,7 +3658,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3656
3658
|
}
|
|
3657
3659
|
/** List discoverable providers without requiring a local plugin catalog. */
|
|
3658
3660
|
async listProviders(options) {
|
|
3659
|
-
const suffix = _optionalChain([options, 'optionalAccess',
|
|
3661
|
+
const suffix = _optionalChain([options, 'optionalAccess', _167 => _167.changed]) ? "?changed=true" : "";
|
|
3660
3662
|
const res = await this.http.get(
|
|
3661
3663
|
`/api/v2/tools/providers${suffix}`
|
|
3662
3664
|
);
|
|
@@ -3687,8 +3689,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3687
3689
|
*/
|
|
3688
3690
|
async search(options = {}) {
|
|
3689
3691
|
const params = searchParams(options);
|
|
3690
|
-
if (_optionalChain([options, 'access',
|
|
3691
|
-
if (_optionalChain([options, 'access',
|
|
3692
|
+
if (_optionalChain([options, 'access', _168 => _168.types, 'optionalAccess', _169 => _169.length])) params.set("types", options.types.join(","));
|
|
3693
|
+
if (_optionalChain([options, 'access', _170 => _170.exclude, 'optionalAccess', _171 => _171.length])) {
|
|
3692
3694
|
params.set("exclude", options.exclude.join(","));
|
|
3693
3695
|
}
|
|
3694
3696
|
return this.http.get(`/api/v2/search?${params.toString()}`);
|
|
@@ -3710,7 +3712,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3710
3712
|
* ```
|
|
3711
3713
|
*/
|
|
3712
3714
|
async getTool(toolId, options) {
|
|
3713
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3715
|
+
if (_optionalChain([options, 'optionalAccess', _172 => _172.cliInvocationId]) !== void 0) {
|
|
3714
3716
|
validateCliInvocationId(options.cliInvocationId);
|
|
3715
3717
|
}
|
|
3716
3718
|
return this.http.request(
|
|
@@ -3723,7 +3725,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3723
3725
|
retryApiErrors: true,
|
|
3724
3726
|
headers: {
|
|
3725
3727
|
"x-deepline-tool-meta-only": "1",
|
|
3726
|
-
..._optionalChain([options, 'optionalAccess',
|
|
3728
|
+
..._optionalChain([options, 'optionalAccess', _173 => _173.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
|
|
3727
3729
|
}
|
|
3728
3730
|
}
|
|
3729
3731
|
);
|
|
@@ -3814,7 +3816,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3814
3816
|
return this.http.post(
|
|
3815
3817
|
"/api/v2/ingestion/repair",
|
|
3816
3818
|
{
|
|
3817
|
-
..._optionalChain([input, 'optionalAccess',
|
|
3819
|
+
..._optionalChain([input, 'optionalAccess', _174 => _174.provider]) ? { provider: input.provider } : {}
|
|
3818
3820
|
}
|
|
3819
3821
|
);
|
|
3820
3822
|
}
|
|
@@ -3869,7 +3871,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3869
3871
|
const prepared = await _chunkJKVRBCZLjs.preparePlayRunAdmission.call(void 0,
|
|
3870
3872
|
this.http,
|
|
3871
3873
|
resolved.request,
|
|
3872
|
-
_optionalChain([options, 'optionalAccess',
|
|
3874
|
+
_optionalChain([options, 'optionalAccess', _175 => _175.onSubmission])
|
|
3873
3875
|
);
|
|
3874
3876
|
const bodyJson = JSON.stringify(prepared.body);
|
|
3875
3877
|
const headers = runtimeSelectionHeaders(resolved.runtime, this.environment);
|
|
@@ -3892,19 +3894,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3892
3894
|
);
|
|
3893
3895
|
}
|
|
3894
3896
|
submitted = true;
|
|
3895
|
-
const streamPath = _optionalChain([options, 'optionalAccess',
|
|
3897
|
+
const streamPath = _optionalChain([options, 'optionalAccess', _176 => _176.cliAdmission]) ? _chunkJKVRBCZLjs.CLI_PLAY_RUN_START_STREAM_PATH : _chunkJKVRBCZLjs.PLAY_RUN_START_STREAM_PATH;
|
|
3896
3898
|
try {
|
|
3897
3899
|
for await (const event of http.streamSse(streamPath, {
|
|
3898
3900
|
method: "POST",
|
|
3899
3901
|
body: JSON.parse(bodyJson),
|
|
3900
3902
|
headers,
|
|
3901
|
-
signal: _optionalChain([streamOptions, 'optionalAccess',
|
|
3903
|
+
signal: _optionalChain([streamOptions, 'optionalAccess', _177 => _177.signal]),
|
|
3902
3904
|
exactUrlOnly: true
|
|
3903
3905
|
})) {
|
|
3904
3906
|
if (event.scope === "play") yield event;
|
|
3905
3907
|
}
|
|
3906
3908
|
} catch (error) {
|
|
3907
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3909
|
+
if (_optionalChain([options, 'optionalAccess', _178 => _178.cliAdmission]) && error instanceof _chunkDIAWYWT5js.DeeplineError && (error.statusCode === 404 || error.statusCode === 405)) {
|
|
3908
3910
|
throw new (0, _chunkJKVRBCZLjs.CliPlayAdmissionUnsupportedError)(error.statusCode);
|
|
3909
3911
|
}
|
|
3910
3912
|
throw error;
|
|
@@ -3927,7 +3929,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3927
3929
|
*/
|
|
3928
3930
|
async *startPlayRunStream(request, options) {
|
|
3929
3931
|
const prepared = await this.preparePlayRunAdmission(request, options);
|
|
3930
|
-
yield* prepared.startStream({ signal: _optionalChain([options, 'optionalAccess',
|
|
3932
|
+
yield* prepared.startStream({ signal: _optionalChain([options, 'optionalAccess', _179 => _179.signal]) });
|
|
3931
3933
|
}
|
|
3932
3934
|
/**
|
|
3933
3935
|
* Register a bundled play artifact.
|
|
@@ -4080,7 +4082,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4080
4082
|
compilerManifest,
|
|
4081
4083
|
...input.input ? { input: input.input } : {},
|
|
4082
4084
|
...input.inputFile ? { inputFile: input.inputFile } : {},
|
|
4083
|
-
..._optionalChain([input, 'access',
|
|
4085
|
+
..._optionalChain([input, 'access', _180 => _180.packagedFiles, 'optionalAccess', _181 => _181.length]) ? { packagedFiles: input.packagedFiles } : {},
|
|
4084
4086
|
...input.force ? { force: true } : {},
|
|
4085
4087
|
...input.forceToolRefresh ? { forceToolRefresh: true } : {}
|
|
4086
4088
|
});
|
|
@@ -4110,29 +4112,29 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4110
4112
|
* ```
|
|
4111
4113
|
*/
|
|
4112
4114
|
async submitPlay(code, csvPath, name, options) {
|
|
4113
|
-
const runtimeInput = _optionalChain([options, 'optionalAccess',
|
|
4115
|
+
const runtimeInput = _optionalChain([options, 'optionalAccess', _182 => _182.input]) ? { ...options.input } : {};
|
|
4114
4116
|
if (csvPath) {
|
|
4115
4117
|
runtimeInput.file = csvPath;
|
|
4116
4118
|
}
|
|
4117
|
-
const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4118
|
-
const artifact = _optionalChain([options, 'optionalAccess',
|
|
4119
|
-
if (!_optionalChain([name, 'optionalAccess',
|
|
4119
|
+
const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _183 => _183.sourceCode]), () => ( code));
|
|
4120
|
+
const artifact = _optionalChain([options, 'optionalAccess', _184 => _184.artifact]);
|
|
4121
|
+
if (!_optionalChain([name, 'optionalAccess', _185 => _185.trim, 'call', _186 => _186()])) {
|
|
4120
4122
|
throw new Error("submitPlay requires a play name.");
|
|
4121
4123
|
}
|
|
4122
4124
|
if (!artifact) {
|
|
4123
4125
|
throw new Error("submitPlay requires a bundled play artifact.");
|
|
4124
4126
|
}
|
|
4125
|
-
const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async
|
|
4127
|
+
const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _187 => _187.compilerManifest]), async () => ( await this.compilePlayManifest({
|
|
4126
4128
|
name,
|
|
4127
4129
|
sourceCode,
|
|
4128
|
-
sourceFiles: _optionalChain([options, 'optionalAccess',
|
|
4130
|
+
sourceFiles: _optionalChain([options, 'optionalAccess', _188 => _188.sourceFiles]),
|
|
4129
4131
|
artifact
|
|
4130
4132
|
})));
|
|
4131
4133
|
const registeredArtifact = await this.registerPlayArtifact({
|
|
4132
4134
|
name,
|
|
4133
4135
|
sourceCode,
|
|
4134
|
-
sourceFiles: _optionalChain([options, 'optionalAccess',
|
|
4135
|
-
description: _optionalChain([options, 'optionalAccess',
|
|
4136
|
+
sourceFiles: _optionalChain([options, 'optionalAccess', _189 => _189.sourceFiles]),
|
|
4137
|
+
description: _optionalChain([options, 'optionalAccess', _190 => _190.description]),
|
|
4136
4138
|
artifact,
|
|
4137
4139
|
compilerManifest,
|
|
4138
4140
|
publish: false
|
|
@@ -4146,17 +4148,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4146
4148
|
name,
|
|
4147
4149
|
artifactStorageKey: registeredArtifact.artifactStorageKey,
|
|
4148
4150
|
sourceCode,
|
|
4149
|
-
description: _optionalChain([options, 'optionalAccess',
|
|
4151
|
+
description: _optionalChain([options, 'optionalAccess', _191 => _191.description]),
|
|
4150
4152
|
staticPipeline: _nullishCoalesce(registeredArtifact.staticPipeline, () => ( null)),
|
|
4151
4153
|
artifactHash: typeof artifact.artifactHash === "string" ? artifact.artifactHash : void 0,
|
|
4152
4154
|
graphHash: typeof artifact.graphHash === "string" ? artifact.graphHash : void 0,
|
|
4153
4155
|
runtimeArtifact: artifact,
|
|
4154
4156
|
compilerManifest,
|
|
4155
4157
|
...Object.keys(runtimeInput).length > 0 ? { input: runtimeInput } : {},
|
|
4156
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4157
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4158
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4159
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4158
|
+
..._optionalChain([options, 'optionalAccess', _192 => _192.inputFile]) ? { inputFile: options.inputFile } : {},
|
|
4159
|
+
..._optionalChain([options, 'optionalAccess', _193 => _193.packagedFiles, 'optionalAccess', _194 => _194.length]) ? { packagedFiles: options.packagedFiles } : {},
|
|
4160
|
+
..._optionalChain([options, 'optionalAccess', _195 => _195.force]) ? { force: true } : {},
|
|
4161
|
+
..._optionalChain([options, 'optionalAccess', _196 => _196.forceToolRefresh]) ? { forceToolRefresh: true } : {}
|
|
4160
4162
|
});
|
|
4161
4163
|
}
|
|
4162
4164
|
/**
|
|
@@ -4232,13 +4234,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4232
4234
|
for await (const event of watchRunEvents({
|
|
4233
4235
|
http: this.http,
|
|
4234
4236
|
runId: workflowId,
|
|
4235
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
4236
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
4237
|
-
onRetry: _optionalChain([options, 'optionalAccess',
|
|
4238
|
-
deferLogs: _optionalChain([options, 'optionalAccess',
|
|
4239
|
-
omitTerminalLogs: _optionalChain([options, 'optionalAccess',
|
|
4240
|
-
onPoll: _optionalChain([options, 'optionalAccess',
|
|
4241
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4237
|
+
signal: _optionalChain([options, 'optionalAccess', _197 => _197.signal]),
|
|
4238
|
+
onNotice: _optionalChain([options, 'optionalAccess', _198 => _198.onNotice]),
|
|
4239
|
+
onRetry: _optionalChain([options, 'optionalAccess', _199 => _199.onRetry]),
|
|
4240
|
+
deferLogs: _optionalChain([options, 'optionalAccess', _200 => _200.deferLogs]),
|
|
4241
|
+
omitTerminalLogs: _optionalChain([options, 'optionalAccess', _201 => _201.omitTerminalLogs]),
|
|
4242
|
+
onPoll: _optionalChain([options, 'optionalAccess', _202 => _202.onPoll]),
|
|
4243
|
+
..._optionalChain([options, 'optionalAccess', _203 => _203.terminalStatus]) ? {
|
|
4242
4244
|
terminalStatus: {
|
|
4243
4245
|
...options.terminalStatus,
|
|
4244
4246
|
onStatus: async (raw, expectedStatus) => {
|
|
@@ -4248,7 +4250,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4248
4250
|
`Run watch returned a mismatched terminal status for ${workflowId}.`
|
|
4249
4251
|
);
|
|
4250
4252
|
}
|
|
4251
|
-
await _optionalChain([options, 'access',
|
|
4253
|
+
await _optionalChain([options, 'access', _204 => _204.terminalStatus, 'optionalAccess', _205 => _205.onStatus, 'call', _206 => _206(status)]);
|
|
4252
4254
|
}
|
|
4253
4255
|
}
|
|
4254
4256
|
} : {}
|
|
@@ -4263,12 +4265,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4263
4265
|
* @deprecated Use `watchRunEvents` for ordinary run watching.
|
|
4264
4266
|
*/
|
|
4265
4267
|
async *streamPlayRunEvents(workflowId, options) {
|
|
4266
|
-
const headers = _optionalChain([options, 'optionalAccess',
|
|
4268
|
+
const headers = _optionalChain([options, 'optionalAccess', _207 => _207.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
|
|
4267
4269
|
const params = new URLSearchParams();
|
|
4268
|
-
params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4270
|
+
params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _208 => _208.mode]), () => ( "cli")));
|
|
4269
4271
|
for await (const event of this.http.streamSse(
|
|
4270
4272
|
`/api/v2/runs/${encodeURIComponent(workflowId)}/tail?${params.toString()}`,
|
|
4271
|
-
{ signal: _optionalChain([options, 'optionalAccess',
|
|
4273
|
+
{ signal: _optionalChain([options, 'optionalAccess', _209 => _209.signal]), headers }
|
|
4272
4274
|
)) {
|
|
4273
4275
|
if (event.scope === "play") {
|
|
4274
4276
|
yield event;
|
|
@@ -4284,8 +4286,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4284
4286
|
*/
|
|
4285
4287
|
async *observeRunEvents(runId, options) {
|
|
4286
4288
|
yield* this.watchRunEvents(runId, {
|
|
4287
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
4288
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
4289
|
+
signal: _optionalChain([options, 'optionalAccess', _210 => _210.signal]),
|
|
4290
|
+
onNotice: _optionalChain([options, 'optionalAccess', _211 => _211.onNotice])
|
|
4289
4291
|
});
|
|
4290
4292
|
}
|
|
4291
4293
|
/** Poll snapshots to terminal status and return the durable package. */
|
|
@@ -4293,9 +4295,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4293
4295
|
let terminalObserved = false;
|
|
4294
4296
|
let terminalStatus = null;
|
|
4295
4297
|
for await (const event of this.watchRunEvents(runId, {
|
|
4296
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
4297
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
4298
|
-
onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4298
|
+
signal: _optionalChain([options, 'optionalAccess', _212 => _212.signal]),
|
|
4299
|
+
onNotice: _optionalChain([options, 'optionalAccess', _213 => _213.onNotice]),
|
|
4300
|
+
onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _214 => _214.onRetry]), () => ( _optionalChain([options, 'optionalAccess', _215 => _215.onReconnect]))),
|
|
4299
4301
|
terminalStatus: {
|
|
4300
4302
|
runStatus: true,
|
|
4301
4303
|
onStatus: (status) => {
|
|
@@ -4303,12 +4305,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4303
4305
|
}
|
|
4304
4306
|
}
|
|
4305
4307
|
})) {
|
|
4306
|
-
_optionalChain([options, 'optionalAccess',
|
|
4308
|
+
_optionalChain([options, 'optionalAccess', _216 => _216.onEvent, 'optionalCall', _217 => _217(event)]);
|
|
4307
4309
|
if (_chunkJKVRBCZLjs.isTerminalPlayRunLifecycleStatus.call(void 0, playLiveRunStatus(event))) {
|
|
4308
4310
|
terminalObserved = true;
|
|
4309
4311
|
}
|
|
4310
4312
|
}
|
|
4311
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4313
|
+
if (_optionalChain([options, 'optionalAccess', _218 => _218.signal, 'optionalAccess', _219 => _219.aborted])) {
|
|
4312
4314
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)("Run watch aborted.", void 0, "ABORTED");
|
|
4313
4315
|
}
|
|
4314
4316
|
const refreshed = await _asyncNullishCoalesce(terminalStatus, async () => ( await this.getRunStatus(runId)));
|
|
@@ -4388,7 +4390,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4388
4390
|
/** List the org's workflows. `GET /api/v2/workflows`. */
|
|
4389
4391
|
async listWorkflows(options) {
|
|
4390
4392
|
const params = new URLSearchParams();
|
|
4391
|
-
if (typeof _optionalChain([options, 'optionalAccess',
|
|
4393
|
+
if (typeof _optionalChain([options, 'optionalAccess', _220 => _220.limit]) === "number") {
|
|
4392
4394
|
params.set("limit", String(options.limit));
|
|
4393
4395
|
}
|
|
4394
4396
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4441,7 +4443,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4441
4443
|
/** List a workflow's runs. `GET /api/v2/workflows/:id/runs`. */
|
|
4442
4444
|
async listWorkflowRuns(id, options) {
|
|
4443
4445
|
const params = new URLSearchParams();
|
|
4444
|
-
if (typeof _optionalChain([options, 'optionalAccess',
|
|
4446
|
+
if (typeof _optionalChain([options, 'optionalAccess', _221 => _221.limit]) === "number") {
|
|
4445
4447
|
params.set("limit", String(options.limit));
|
|
4446
4448
|
}
|
|
4447
4449
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4477,10 +4479,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4477
4479
|
*/
|
|
4478
4480
|
async getRunStatus(runId, options) {
|
|
4479
4481
|
const params = new URLSearchParams();
|
|
4480
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4482
|
+
if (_optionalChain([options, 'optionalAccess', _222 => _222.full]) === true) {
|
|
4481
4483
|
params.set("full", "true");
|
|
4482
4484
|
}
|
|
4483
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4485
|
+
if (_optionalChain([options, 'optionalAccess', _223 => _223.configuration]) === true) {
|
|
4484
4486
|
params.set("include", "configuration");
|
|
4485
4487
|
}
|
|
4486
4488
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4488,7 +4490,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4488
4490
|
`/api/v2/runs/${encodeURIComponent(runId)}${query}`,
|
|
4489
4491
|
{ headers: { "x-deepline-run-status": "1" } }
|
|
4490
4492
|
);
|
|
4491
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4493
|
+
if (_optionalChain([options, 'optionalAccess', _224 => _224.configuration]) === true && !Object.hasOwn(response, "contract")) {
|
|
4492
4494
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)(
|
|
4493
4495
|
"This server does not support recorded configuration reads.",
|
|
4494
4496
|
void 0,
|
|
@@ -4496,7 +4498,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4496
4498
|
);
|
|
4497
4499
|
}
|
|
4498
4500
|
const status = normalizePlayStatus(response);
|
|
4499
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4501
|
+
if (_optionalChain([options, 'optionalAccess', _225 => _225.failedLogs]) !== true || status.status !== "failed") {
|
|
4500
4502
|
return status;
|
|
4501
4503
|
}
|
|
4502
4504
|
const requestedFailedLogLimit = typeof options.failedLogLimit === "number" && Number.isFinite(options.failedLogLimit) ? Math.max(1, Math.floor(options.failedLogLimit)) : RUNS_FAILED_LOG_LIMIT;
|
|
@@ -4585,7 +4587,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4585
4587
|
/** The same tenant-scoped run history searched by the dashboard and CLI. */
|
|
4586
4588
|
async getRunsHistory(options = {}) {
|
|
4587
4589
|
const params = new URLSearchParams();
|
|
4588
|
-
const search = _optionalChain([options, 'access',
|
|
4590
|
+
const search = _optionalChain([options, 'access', _226 => _226.search, 'optionalAccess', _227 => _227.trim, 'call', _228 => _228()]);
|
|
4589
4591
|
if (search && search.length > 200) {
|
|
4590
4592
|
throw new Error("Run search must be at most 200 characters.");
|
|
4591
4593
|
}
|
|
@@ -4611,16 +4613,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4611
4613
|
}
|
|
4612
4614
|
/** Read one run page without discarding server pagination metadata. */
|
|
4613
4615
|
async listRunsPage(options) {
|
|
4614
|
-
const playName = _optionalChain([options, 'access',
|
|
4616
|
+
const playName = _optionalChain([options, 'access', _229 => _229.play, 'optionalAccess', _230 => _230.trim, 'call', _231 => _231()]);
|
|
4615
4617
|
const params = new URLSearchParams();
|
|
4616
4618
|
if (playName) {
|
|
4617
4619
|
params.set("play", playName);
|
|
4618
4620
|
}
|
|
4619
|
-
const status = _optionalChain([options, 'access',
|
|
4621
|
+
const status = _optionalChain([options, 'access', _232 => _232.status, 'optionalAccess', _233 => _233.trim, 'call', _234 => _234()]);
|
|
4620
4622
|
if (status) {
|
|
4621
4623
|
params.set("status", status);
|
|
4622
4624
|
}
|
|
4623
|
-
const node = _optionalChain([options, 'access',
|
|
4625
|
+
const node = _optionalChain([options, 'access', _235 => _235.node, 'optionalAccess', _236 => _236.trim, 'call', _237 => _237()]);
|
|
4624
4626
|
if (node) {
|
|
4625
4627
|
if (!playName)
|
|
4626
4628
|
throw new Error("runs.list options.node requires options.play.");
|
|
@@ -4694,8 +4696,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4694
4696
|
* A different key starts another rerun.
|
|
4695
4697
|
*/
|
|
4696
4698
|
async rerun(runId, options) {
|
|
4697
|
-
const idempotencyKey = _optionalChain([options, 'optionalAccess',
|
|
4698
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4699
|
+
const idempotencyKey = _optionalChain([options, 'optionalAccess', _238 => _238.idempotencyKey, 'optionalAccess', _239 => _239.trim, 'call', _240 => _240()]);
|
|
4700
|
+
if (_optionalChain([options, 'optionalAccess', _241 => _241.idempotencyKey]) !== void 0 && !idempotencyKey) {
|
|
4699
4701
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)(
|
|
4700
4702
|
"runs.rerun idempotencyKey must not be empty.",
|
|
4701
4703
|
void 0,
|
|
@@ -4704,7 +4706,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4704
4706
|
}
|
|
4705
4707
|
return this.http.post(
|
|
4706
4708
|
`/api/v2/runs/${encodeURIComponent(runId)}/rerun`,
|
|
4707
|
-
_optionalChain([options, 'optionalAccess',
|
|
4709
|
+
_optionalChain([options, 'optionalAccess', _242 => _242.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
|
|
4708
4710
|
{ "Idempotency-Key": idempotencyKey || globalThis.crypto.randomUUID() }
|
|
4709
4711
|
);
|
|
4710
4712
|
}
|
|
@@ -4718,21 +4720,21 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4718
4720
|
* ```
|
|
4719
4721
|
*/
|
|
4720
4722
|
async getRunLogs(runId, options) {
|
|
4721
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4723
|
+
if (_optionalChain([options, 'optionalAccess', _243 => _243.all]) === true && options.failed === true) {
|
|
4722
4724
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)(
|
|
4723
4725
|
"runs.logs cannot combine all and failed views.",
|
|
4724
4726
|
void 0,
|
|
4725
4727
|
"INVALID_RUN_LOG_VIEW"
|
|
4726
4728
|
);
|
|
4727
4729
|
}
|
|
4728
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4730
|
+
if (_optionalChain([options, 'optionalAccess', _244 => _244.cursor]) !== void 0 && options.failed === true) {
|
|
4729
4731
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)(
|
|
4730
4732
|
"runs.logs cannot combine failed with cursor.",
|
|
4731
4733
|
void 0,
|
|
4732
4734
|
"INVALID_RUN_LOG_VIEW"
|
|
4733
4735
|
);
|
|
4734
4736
|
}
|
|
4735
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4737
|
+
if (_optionalChain([options, 'optionalAccess', _245 => _245.failed]) === true) {
|
|
4736
4738
|
const requestedLimit = typeof options.limit === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : RUNS_FAILED_LOG_LIMIT;
|
|
4737
4739
|
const failedLimit = Math.min(RUNS_FAILED_LOG_LIMIT, requestedLimit);
|
|
4738
4740
|
const page = await this.http.get(
|
|
@@ -4757,18 +4759,18 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4757
4759
|
...page.logsTruncated ? { logsTruncated: true } : {}
|
|
4758
4760
|
};
|
|
4759
4761
|
}
|
|
4760
|
-
const beforeSequence = _optionalChain([options, 'optionalAccess',
|
|
4761
|
-
const limit = _optionalChain([options, 'optionalAccess',
|
|
4762
|
+
const beforeSequence = _optionalChain([options, 'optionalAccess', _246 => _246.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
|
|
4763
|
+
const limit = _optionalChain([options, 'optionalAccess', _247 => _247.all]) ? Number.MAX_SAFE_INTEGER : typeof _optionalChain([options, 'optionalAccess', _248 => _248.limit]) === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
|
|
4762
4764
|
const fetchPage = (afterSeq2, pageLimit) => this.http.get(
|
|
4763
4765
|
`/api/v2/runs/${encodeURIComponent(runId)}/logs?afterSeq=${afterSeq2}&limit=${pageLimit}`,
|
|
4764
4766
|
{ retryApiErrors: true }
|
|
4765
4767
|
);
|
|
4766
4768
|
const probe = await fetchPage(0, 1);
|
|
4767
4769
|
const lastStoredSeq = probe.lastStoredSeq;
|
|
4768
|
-
const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access',
|
|
4770
|
+
const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _249 => _249.entries, 'access', _250 => _250[0], 'optionalAccess', _251 => _251.seq]), () => ( null));
|
|
4769
4771
|
const upperSeq = beforeSequence === null ? Number.POSITIVE_INFINITY : Math.min(beforeSequence - 1, lastStoredSeq);
|
|
4770
4772
|
const windowEndSeq = Math.min(upperSeq, lastStoredSeq);
|
|
4771
|
-
let afterSeq = _optionalChain([options, 'optionalAccess',
|
|
4773
|
+
let afterSeq = _optionalChain([options, 'optionalAccess', _252 => _252.all]) ? 0 : Math.max(0, windowEndSeq - limit);
|
|
4772
4774
|
const entries = [];
|
|
4773
4775
|
while (entries.length < limit && afterSeq < upperSeq) {
|
|
4774
4776
|
const page = await fetchPage(
|
|
@@ -4802,7 +4804,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4802
4804
|
hasMore: olderLinesExist,
|
|
4803
4805
|
nextCursor: olderLinesExist ? encodeRunLogsCursor(firstSequence) : null,
|
|
4804
4806
|
entries: entries.map((entry) => entry.line),
|
|
4805
|
-
view: _optionalChain([options, 'optionalAccess',
|
|
4807
|
+
view: _optionalChain([options, 'optionalAccess', _253 => _253.all]) ? "all" : "tail",
|
|
4806
4808
|
...probe.logsTruncated ? { logsTruncated: true } : {}
|
|
4807
4809
|
};
|
|
4808
4810
|
}
|
|
@@ -4978,7 +4980,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4978
4980
|
limit: String(_nullishCoalesce(input.limit, () => ( 5e3))),
|
|
4979
4981
|
offset: String(_nullishCoalesce(input.offset, () => ( 0)))
|
|
4980
4982
|
});
|
|
4981
|
-
if (_optionalChain([input, 'access',
|
|
4983
|
+
if (_optionalChain([input, 'access', _254 => _254.runId, 'optionalAccess', _255 => _255.trim, 'call', _256 => _256()])) {
|
|
4982
4984
|
params.set("runId", input.runId.trim());
|
|
4983
4985
|
}
|
|
4984
4986
|
if (input.rowMode === "all" || input.rowMode === "live") {
|
|
@@ -4988,9 +4990,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4988
4990
|
`/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`,
|
|
4989
4991
|
{ signal: input.signal }
|
|
4990
4992
|
);
|
|
4991
|
-
const requestedRunId = _optionalChain([input, 'access',
|
|
4993
|
+
const requestedRunId = _optionalChain([input, 'access', _257 => _257.runId, 'optionalAccess', _258 => _258.trim, 'call', _259 => _259()]) || "";
|
|
4992
4994
|
if (requestedRunId) {
|
|
4993
|
-
const confirmedRunId = _optionalChain([result, 'access',
|
|
4995
|
+
const confirmedRunId = _optionalChain([result, 'access', _260 => _260.scope, 'optionalAccess', _261 => _261.kind]) === "run" ? result.scope.runId.trim() : "";
|
|
4994
4996
|
const foreignRowRunIds = [
|
|
4995
4997
|
...new Set(
|
|
4996
4998
|
result.rows.map(
|
|
@@ -4998,7 +5000,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4998
5000
|
).filter((runId) => runId && runId !== requestedRunId)
|
|
4999
5001
|
)
|
|
5000
5002
|
];
|
|
5001
|
-
if (_optionalChain([result, 'access',
|
|
5003
|
+
if (_optionalChain([result, 'access', _262 => _262.scope, 'optionalAccess', _263 => _263.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
|
|
5002
5004
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)(
|
|
5003
5005
|
`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.`,
|
|
5004
5006
|
void 0,
|
|
@@ -5027,7 +5029,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5027
5029
|
async stopRun(runId, options) {
|
|
5028
5030
|
return this.http.post(
|
|
5029
5031
|
`/api/v2/runs/${encodeURIComponent(runId)}/stop`,
|
|
5030
|
-
_optionalChain([options, 'optionalAccess',
|
|
5032
|
+
_optionalChain([options, 'optionalAccess', _264 => _264.reason]) ? { reason: options.reason } : {}
|
|
5031
5033
|
);
|
|
5032
5034
|
}
|
|
5033
5035
|
/**
|
|
@@ -5045,11 +5047,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5045
5047
|
* The method clears workspace run-slot state without requiring each run ID.
|
|
5046
5048
|
*/
|
|
5047
5049
|
async stopAllRuns(options) {
|
|
5048
|
-
const dryRun = _optionalChain([options, 'optionalAccess',
|
|
5050
|
+
const dryRun = _optionalChain([options, 'optionalAccess', _265 => _265.dryRun]) === true;
|
|
5049
5051
|
const result = await this.http.post(
|
|
5050
5052
|
"/api/v2/runs/stop-all",
|
|
5051
5053
|
{
|
|
5052
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5054
|
+
..._optionalChain([options, 'optionalAccess', _266 => _266.reason]) ? { reason: options.reason } : {},
|
|
5053
5055
|
...dryRun ? { dryRun: true } : {}
|
|
5054
5056
|
}
|
|
5055
5057
|
);
|
|
@@ -5070,7 +5072,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5070
5072
|
* `origin: "owned"` for org-owned plays.
|
|
5071
5073
|
*/
|
|
5072
5074
|
async listPlays(options) {
|
|
5073
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
5075
|
+
if (!_optionalChain([options, 'optionalAccess', _267 => _267.grep, 'optionalAccess', _268 => _268.trim, 'call', _269 => _269()])) {
|
|
5074
5076
|
return (await this.requestPlaysPage(options, false)).plays;
|
|
5075
5077
|
}
|
|
5076
5078
|
const plays = [];
|
|
@@ -5092,45 +5094,45 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5092
5094
|
}
|
|
5093
5095
|
async requestPlaysPage(options, paginateInventory = true) {
|
|
5094
5096
|
const params = new URLSearchParams();
|
|
5095
|
-
if (paginateInventory && !_optionalChain([options, 'optionalAccess',
|
|
5097
|
+
if (paginateInventory && !_optionalChain([options, 'optionalAccess', _270 => _270.grep, 'optionalAccess', _271 => _271.trim, 'call', _272 => _272()]))
|
|
5096
5098
|
params.set("inventory_paginated", "1");
|
|
5097
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5098
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5099
|
+
if (_optionalChain([options, 'optionalAccess', _273 => _273.origin])) params.set("origin", options.origin);
|
|
5100
|
+
if (_optionalChain([options, 'optionalAccess', _274 => _274.categories])) {
|
|
5099
5101
|
params.set(
|
|
5100
5102
|
"categories",
|
|
5101
5103
|
Array.isArray(options.categories) ? options.categories.join(",") : options.categories
|
|
5102
5104
|
);
|
|
5103
5105
|
}
|
|
5104
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5106
|
+
if (_optionalChain([options, 'optionalAccess', _275 => _275.categories]) || _optionalChain([options, 'optionalAccess', _276 => _276.includeToolCategories])) {
|
|
5105
5107
|
params.set("include_tool_categories", "1");
|
|
5106
5108
|
}
|
|
5107
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5109
|
+
if (_optionalChain([options, 'optionalAccess', _277 => _277.tags])) {
|
|
5108
5110
|
params.set(
|
|
5109
5111
|
"tags",
|
|
5110
5112
|
Array.isArray(options.tags) ? options.tags.join(",") : options.tags
|
|
5111
5113
|
);
|
|
5112
5114
|
}
|
|
5113
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5114
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5115
|
+
if (_optionalChain([options, 'optionalAccess', _278 => _278.includeArchived])) params.set("include_archived", "1");
|
|
5116
|
+
if (_optionalChain([options, 'optionalAccess', _279 => _279.includeCostEstimates])) {
|
|
5115
5117
|
params.set("include_cost_estimates", "1");
|
|
5116
5118
|
}
|
|
5117
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5119
|
+
if (_optionalChain([options, 'optionalAccess', _280 => _280.grep, 'optionalAccess', _281 => _281.trim, 'call', _282 => _282()])) {
|
|
5118
5120
|
params.set("grep", options.grep.trim());
|
|
5119
5121
|
params.set("limit", "60");
|
|
5120
5122
|
}
|
|
5121
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5123
|
+
if (_optionalChain([options, 'optionalAccess', _283 => _283.limit]) !== void 0) {
|
|
5122
5124
|
if (!Number.isSafeInteger(options.limit) || options.limit < 1) {
|
|
5123
5125
|
throw new Error("Play page limit must be a positive integer");
|
|
5124
5126
|
}
|
|
5125
5127
|
params.set("limit", String(options.limit));
|
|
5126
5128
|
}
|
|
5127
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5129
|
+
if (_optionalChain([options, 'optionalAccess', _284 => _284.cursor])) params.set("cursor", options.cursor);
|
|
5128
5130
|
const suffix = params.size ? `?${params.toString()}` : "";
|
|
5129
5131
|
const response = await this.http.get(`/api/v2/plays${suffix}`);
|
|
5130
5132
|
return {
|
|
5131
5133
|
plays: _nullishCoalesce(response.plays, () => ( [])),
|
|
5132
|
-
cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access',
|
|
5133
|
-
hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access',
|
|
5134
|
+
cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _285 => _285.pagination, 'optionalAccess', _286 => _286.cursor]), () => ( response.cursor)), () => ( null)),
|
|
5135
|
+
hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _287 => _287.pagination, 'optionalAccess', _288 => _288.hasMore]), () => ( response.hasMore)))
|
|
5134
5136
|
};
|
|
5135
5137
|
}
|
|
5136
5138
|
/** Read definition-level settings, independently of code revisions. */
|
|
@@ -5184,7 +5186,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5184
5186
|
}
|
|
5185
5187
|
/** Start provider OAuth and return the URL to open in a browser. */
|
|
5186
5188
|
async startIntegrationOAuth(provider, options = {}) {
|
|
5187
|
-
const scopes = _optionalChain([options, 'access',
|
|
5189
|
+
const scopes = _optionalChain([options, 'access', _289 => _289.scopes, 'optionalAccess', _290 => _290.map, 'call', _291 => _291((scope) => scope.trim()), 'access', _292 => _292.filter, 'call', _293 => _293(Boolean)]);
|
|
5188
5190
|
if (scopes !== void 0 && scopes.length === 0) {
|
|
5189
5191
|
throw new Error("scopes must contain at least one OAuth scope.");
|
|
5190
5192
|
}
|
|
@@ -5200,8 +5202,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5200
5202
|
return this.http.post("/api/v2/integrations/connect", {
|
|
5201
5203
|
provider: "slack",
|
|
5202
5204
|
scopes: [...PRODUCT_NOTIFICATION_SLACK_OAUTH_SCOPES],
|
|
5203
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5204
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5205
|
+
..._optionalChain([options, 'optionalAccess', _294 => _294.successUrl]) ? { success_url: options.successUrl } : {},
|
|
5206
|
+
..._optionalChain([options, 'optionalAccess', _295 => _295.failureUrl]) ? { failure_url: options.failureUrl } : {}
|
|
5205
5207
|
});
|
|
5206
5208
|
}
|
|
5207
5209
|
/** List Slack channels visible to the connected Deepline Slack app. */
|
|
@@ -5276,7 +5278,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5276
5278
|
}
|
|
5277
5279
|
const targets = input.targets.map(parseNotificationGroupTarget);
|
|
5278
5280
|
const legacyEvents = _nullishCoalesce(input.legacyEvents, () => ( []));
|
|
5279
|
-
const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access',
|
|
5281
|
+
const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _296 => _296[0], 'optionalAccess', _297 => _297.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
|
|
5280
5282
|
if (legacyEvents.length > 0 && !legacyTarget) {
|
|
5281
5283
|
throw new Error(
|
|
5282
5284
|
"--for is supported only by the legacy one-Slack-target form. Create the group first, then add rules in notification configuration."
|
|
@@ -5312,7 +5314,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5312
5314
|
const existingGroup = current.configuration.groups.find(
|
|
5313
5315
|
(candidate) => candidate.name.toLowerCase() === name.toLowerCase()
|
|
5314
5316
|
);
|
|
5315
|
-
const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess',
|
|
5317
|
+
const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _298 => _298.groupKey]), () => ( notificationObjectKey("group")));
|
|
5316
5318
|
const group = _nullishCoalesce(existingGroup, () => ( {
|
|
5317
5319
|
groupKey,
|
|
5318
5320
|
name,
|
|
@@ -5536,7 +5538,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5536
5538
|
/** Read one trigger inventory page without loading run histories. */
|
|
5537
5539
|
async listPlayTriggerInventory(options) {
|
|
5538
5540
|
const params = new URLSearchParams({ view: "inventory" });
|
|
5539
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5541
|
+
if (_optionalChain([options, 'optionalAccess', _299 => _299.cursor])) params.set("cursor", options.cursor);
|
|
5540
5542
|
return this.http.get(`/api/v2/plays/triggers?${params}`);
|
|
5541
5543
|
}
|
|
5542
5544
|
/** Read one trigger's recent runs, with an explicit partial-history flag. */
|
|
@@ -5545,7 +5547,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5545
5547
|
view: "history",
|
|
5546
5548
|
binding_id: bindingId
|
|
5547
5549
|
});
|
|
5548
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5550
|
+
if (_optionalChain([options, 'optionalAccess', _300 => _300.limit]) !== void 0)
|
|
5549
5551
|
params.set("history_limit", String(options.limit));
|
|
5550
5552
|
return this.http.get(`/api/v2/plays/triggers?${params}`);
|
|
5551
5553
|
}
|
|
@@ -5733,14 +5735,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5733
5735
|
*/
|
|
5734
5736
|
async runPlay(code, csvPath, name, options) {
|
|
5735
5737
|
const { workflowId } = await this.submitPlay(code, csvPath, name, {
|
|
5736
|
-
input: _optionalChain([options, 'optionalAccess',
|
|
5737
|
-
sourceCode: _optionalChain([options, 'optionalAccess',
|
|
5738
|
-
artifact: _optionalChain([options, 'optionalAccess',
|
|
5739
|
-
compilerManifest: _optionalChain([options, 'optionalAccess',
|
|
5740
|
-
inputFile: _optionalChain([options, 'optionalAccess',
|
|
5741
|
-
packagedFiles: _optionalChain([options, 'optionalAccess',
|
|
5742
|
-
force: _optionalChain([options, 'optionalAccess',
|
|
5743
|
-
forceToolRefresh: _optionalChain([options, 'optionalAccess',
|
|
5738
|
+
input: _optionalChain([options, 'optionalAccess', _301 => _301.input]),
|
|
5739
|
+
sourceCode: _optionalChain([options, 'optionalAccess', _302 => _302.sourceCode]),
|
|
5740
|
+
artifact: _optionalChain([options, 'optionalAccess', _303 => _303.artifact]),
|
|
5741
|
+
compilerManifest: _optionalChain([options, 'optionalAccess', _304 => _304.compilerManifest]),
|
|
5742
|
+
inputFile: _optionalChain([options, 'optionalAccess', _305 => _305.inputFile]),
|
|
5743
|
+
packagedFiles: _optionalChain([options, 'optionalAccess', _306 => _306.packagedFiles]),
|
|
5744
|
+
force: _optionalChain([options, 'optionalAccess', _307 => _307.force]),
|
|
5745
|
+
forceToolRefresh: _optionalChain([options, 'optionalAccess', _308 => _308.forceToolRefresh])
|
|
5744
5746
|
});
|
|
5745
5747
|
const start = Date.now();
|
|
5746
5748
|
const state = {
|
|
@@ -5751,7 +5753,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5751
5753
|
latest: null
|
|
5752
5754
|
};
|
|
5753
5755
|
let terminalObserved = null;
|
|
5754
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5756
|
+
if (_optionalChain([options, 'optionalAccess', _309 => _309.signal, 'optionalAccess', _310 => _310.aborted])) {
|
|
5755
5757
|
await this.cancelPlay(workflowId);
|
|
5756
5758
|
return {
|
|
5757
5759
|
success: false,
|
|
@@ -5762,9 +5764,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5762
5764
|
};
|
|
5763
5765
|
}
|
|
5764
5766
|
for await (const event of this.watchRunEvents(workflowId, {
|
|
5765
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
5767
|
+
signal: _optionalChain([options, 'optionalAccess', _311 => _311.signal])
|
|
5766
5768
|
})) {
|
|
5767
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5769
|
+
if (_optionalChain([options, 'optionalAccess', _312 => _312.signal, 'optionalAccess', _313 => _313.aborted])) {
|
|
5768
5770
|
await this.cancelPlay(workflowId);
|
|
5769
5771
|
return {
|
|
5770
5772
|
success: false,
|
|
@@ -5774,19 +5776,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5774
5776
|
error: "Cancelled by user"
|
|
5775
5777
|
};
|
|
5776
5778
|
}
|
|
5777
|
-
const previousStatus = _optionalChain([state, 'access',
|
|
5779
|
+
const previousStatus = _optionalChain([state, 'access', _314 => _314.latest, 'optionalAccess', _315 => _315.status]);
|
|
5778
5780
|
const status = updatePlayLiveStatusState(state, event);
|
|
5779
5781
|
if (!status) {
|
|
5780
5782
|
continue;
|
|
5781
5783
|
}
|
|
5782
5784
|
if (event.type !== "play.run.status" || status.status !== previousStatus) {
|
|
5783
|
-
_optionalChain([options, 'optionalAccess',
|
|
5785
|
+
_optionalChain([options, 'optionalAccess', _316 => _316.onProgress, 'optionalCall', _317 => _317(status)]);
|
|
5784
5786
|
}
|
|
5785
5787
|
if (_chunkJKVRBCZLjs.isTerminalPlayRunLifecycleStatus.call(void 0, status.status)) {
|
|
5786
5788
|
terminalObserved = status;
|
|
5787
5789
|
}
|
|
5788
5790
|
}
|
|
5789
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5791
|
+
if (_optionalChain([options, 'optionalAccess', _318 => _318.signal, 'optionalAccess', _319 => _319.aborted])) {
|
|
5790
5792
|
await this.cancelPlay(workflowId);
|
|
5791
5793
|
return {
|
|
5792
5794
|
success: false,
|
|
@@ -5839,7 +5841,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5839
5841
|
const response = await this.http.get(
|
|
5840
5842
|
`/api/v2/usage/events?request_id=${encodeURIComponent(normalizedRequestId)}`
|
|
5841
5843
|
);
|
|
5842
|
-
const event = _optionalChain([response, 'access',
|
|
5844
|
+
const event = _optionalChain([response, 'access', _320 => _320.entries, 'optionalAccess', _321 => _321[0]]);
|
|
5843
5845
|
if (!event) {
|
|
5844
5846
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)(
|
|
5845
5847
|
"No usage event was found for this request_id.",
|
|
@@ -5970,7 +5972,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5970
5972
|
async cancelBillingSubscription(options) {
|
|
5971
5973
|
return this.http.post(
|
|
5972
5974
|
"/api/v2/billing/subscription/cancel",
|
|
5973
|
-
{ action: _optionalChain([options, 'optionalAccess',
|
|
5975
|
+
{ action: _optionalChain([options, 'optionalAccess', _322 => _322.undo]) ? "undo_cancel" : "cancel" }
|
|
5974
5976
|
);
|
|
5975
5977
|
}
|
|
5976
5978
|
/**
|
|
@@ -5982,7 +5984,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5982
5984
|
*/
|
|
5983
5985
|
async listBillingInvoices(options) {
|
|
5984
5986
|
const params = new URLSearchParams();
|
|
5985
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5987
|
+
if (_optionalChain([options, 'optionalAccess', _323 => _323.limit]) !== void 0) {
|
|
5986
5988
|
params.set("limit", String(options.limit));
|
|
5987
5989
|
}
|
|
5988
5990
|
const suffix = Array.from(params).length > 0 ? `?${params.toString()}` : "";
|
|
@@ -6092,7 +6094,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6092
6094
|
/** Create a Stripe-hosted portal session for payment recovery and invoices. */
|
|
6093
6095
|
async createTargetBillingPortalSession(options) {
|
|
6094
6096
|
const response = await this.http.post(
|
|
6095
|
-
_optionalChain([options, 'optionalAccess',
|
|
6097
|
+
_optionalChain([options, 'optionalAccess', _324 => _324.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
|
|
6096
6098
|
{}
|
|
6097
6099
|
);
|
|
6098
6100
|
return response.data;
|
|
@@ -6142,8 +6144,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6142
6144
|
return this.http.request("/api/v2/monitors/audit", {
|
|
6143
6145
|
method: "POST",
|
|
6144
6146
|
body: {
|
|
6145
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6146
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6147
|
+
..._optionalChain([options, 'optionalAccess', _325 => _325.fleetId]) ? { fleet_id: options.fleetId } : {},
|
|
6148
|
+
..._optionalChain([options, 'optionalAccess', _326 => _326.cursor]) ? { cursor: options.cursor } : {}
|
|
6147
6149
|
},
|
|
6148
6150
|
maxRetries: 0
|
|
6149
6151
|
});
|
|
@@ -6153,8 +6155,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6153
6155
|
return this.http.request("/api/v2/monitors/repair", {
|
|
6154
6156
|
method: "POST",
|
|
6155
6157
|
body: {
|
|
6156
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6157
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6158
|
+
..._optionalChain([options, 'optionalAccess', _327 => _327.fleetId]) ? { fleet_id: options.fleetId } : {},
|
|
6159
|
+
..._optionalChain([options, 'optionalAccess', _328 => _328.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
|
|
6158
6160
|
},
|
|
6159
6161
|
maxRetries: 0
|
|
6160
6162
|
});
|
|
@@ -6162,7 +6164,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6162
6164
|
/** Delivery and convergence health. Prefer `client.monitors.health(...)`. */
|
|
6163
6165
|
async readMonitorsHealth(options) {
|
|
6164
6166
|
const params = new URLSearchParams();
|
|
6165
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6167
|
+
if (_optionalChain([options, 'optionalAccess', _329 => _329.fleetId])) params.set("fleet_id", options.fleetId);
|
|
6166
6168
|
const query = params.toString();
|
|
6167
6169
|
const suffix = query ? `?${query}` : "";
|
|
6168
6170
|
return this.http.request(
|
|
@@ -6235,7 +6237,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6235
6237
|
);
|
|
6236
6238
|
}
|
|
6237
6239
|
const params = new URLSearchParams();
|
|
6238
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6240
|
+
if (_optionalChain([options, 'optionalAccess', _330 => _330.cursor])) params.set("cursor", options.cursor);
|
|
6239
6241
|
const suffix = params.size > 0 ? `?${params}` : "";
|
|
6240
6242
|
return this.http.request(
|
|
6241
6243
|
`/api/v2/monitors/batch/${encodeURIComponent(runId)}${suffix}`,
|
|
@@ -6282,7 +6284,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6282
6284
|
* a second charge. The submission is never replayed automatically.
|
|
6283
6285
|
*/
|
|
6284
6286
|
async previewMonitor(definition, options) {
|
|
6285
|
-
const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6287
|
+
const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _331 => _331.idempotencyKey]), () => ( `monitor-preview-${_nullishCoalesce(_optionalChain([globalThis, 'access', _332 => _332.crypto, 'optionalAccess', _333 => _333.randomUUID, 'optionalCall', _334 => _334()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`));
|
|
6286
6288
|
try {
|
|
6287
6289
|
const result = await this.http.request(
|
|
6288
6290
|
"/api/v2/monitors/preview",
|
|
@@ -6290,7 +6292,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6290
6292
|
method: "POST",
|
|
6291
6293
|
body: {
|
|
6292
6294
|
...definition,
|
|
6293
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6295
|
+
..._optionalChain([options, 'optionalAccess', _335 => _335.limit]) === void 0 ? {} : { limit: options.limit }
|
|
6294
6296
|
},
|
|
6295
6297
|
headers: { "Idempotency-Key": idempotencyKey },
|
|
6296
6298
|
maxRetries: 0,
|
|
@@ -6312,7 +6314,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6312
6314
|
* `client.monitors.deploy(...)`.
|
|
6313
6315
|
*/
|
|
6314
6316
|
async deployMonitor(definition, options) {
|
|
6315
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6317
|
+
if (_optionalChain([options, 'optionalAccess', _336 => _336.dryRun])) {
|
|
6316
6318
|
return this.http.request("/api/v2/monitors/check", {
|
|
6317
6319
|
method: "POST",
|
|
6318
6320
|
body: definition
|
|
@@ -6348,12 +6350,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6348
6350
|
/** List deployed monitors. Prefer `client.monitors.list(...)`. */
|
|
6349
6351
|
async listMonitors(options) {
|
|
6350
6352
|
const params = new URLSearchParams();
|
|
6351
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6352
|
-
else if (_optionalChain([options, 'optionalAccess',
|
|
6353
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6353
|
+
if (_optionalChain([options, 'optionalAccess', _337 => _337.state])) params.set("state", options.state);
|
|
6354
|
+
else if (_optionalChain([options, 'optionalAccess', _338 => _338.status])) params.set("status", options.status);
|
|
6355
|
+
if (_optionalChain([options, 'optionalAccess', _339 => _339.limit]) !== void 0)
|
|
6354
6356
|
params.set("limit", String(options.limit));
|
|
6355
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6356
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6357
|
+
if (_optionalChain([options, 'optionalAccess', _340 => _340.cursor])) params.set("cursor", options.cursor);
|
|
6358
|
+
if (_optionalChain([options, 'optionalAccess', _341 => _341.includeConsumers])) params.set("include_consumers", "true");
|
|
6357
6359
|
const query = params.toString();
|
|
6358
6360
|
const suffix = query ? `?${query}` : "";
|
|
6359
6361
|
return this.http.request(
|
|
@@ -6369,7 +6371,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6369
6371
|
);
|
|
6370
6372
|
}
|
|
6371
6373
|
async testMonitorWebhook(key, payload, options) {
|
|
6372
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6374
|
+
if (_optionalChain([options, 'optionalAccess', _342 => _342.dispatch]) === true || _optionalChain([options, 'optionalAccess', _343 => _343.validationOnly]) === false) {
|
|
6373
6375
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)(
|
|
6374
6376
|
"Monitor tests are validation-only and cannot dispatch events.",
|
|
6375
6377
|
void 0,
|
|
@@ -6424,7 +6426,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6424
6426
|
}
|
|
6425
6427
|
/** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
|
|
6426
6428
|
async deleteMonitor(key, options) {
|
|
6427
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6429
|
+
if (_optionalChain([options, 'optionalAccess', _344 => _344.localOnly]) === true) {
|
|
6428
6430
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)(
|
|
6429
6431
|
"localOnly monitor deletion is no longer supported. Monitor deletion always deprovisions the upstream provider resource.",
|
|
6430
6432
|
void 0,
|
|
@@ -6432,11 +6434,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6432
6434
|
);
|
|
6433
6435
|
}
|
|
6434
6436
|
const params = new URLSearchParams();
|
|
6435
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6437
|
+
if (_optionalChain([options, 'optionalAccess', _345 => _345.dryRun])) params.set("dry_run", "true");
|
|
6436
6438
|
const query = params.toString();
|
|
6437
6439
|
return this.http.request(
|
|
6438
6440
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
|
|
6439
|
-
_optionalChain([options, 'optionalAccess',
|
|
6441
|
+
_optionalChain([options, 'optionalAccess', _346 => _346.dryRun]) ? { method: "DELETE" } : {
|
|
6440
6442
|
method: "DELETE",
|
|
6441
6443
|
// Deletion is a provider lifecycle operation. A timeout is an
|
|
6442
6444
|
// unknown outcome, not authority to begin another delete attempt.
|
|
@@ -6449,10 +6451,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6449
6451
|
* Prefer `client.monitors.reactivate(...)`.
|
|
6450
6452
|
*/
|
|
6451
6453
|
async reactivateMonitor(key, options) {
|
|
6452
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
6454
|
+
const query = _optionalChain([options, 'optionalAccess', _347 => _347.dryRun]) ? "?dry_run=true" : "";
|
|
6453
6455
|
return this.http.request(
|
|
6454
6456
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
|
|
6455
|
-
_optionalChain([options, 'optionalAccess',
|
|
6457
|
+
_optionalChain([options, 'optionalAccess', _348 => _348.dryRun]) ? { method: "POST", body: {} } : {
|
|
6456
6458
|
method: "POST",
|
|
6457
6459
|
body: {},
|
|
6458
6460
|
// Reactivation can create an upstream resource, so it must not use
|
|
@@ -6466,7 +6468,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6466
6468
|
// ——————————————————————————————————————————————————————————
|
|
6467
6469
|
static __initStatic() {this.MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH = 96}
|
|
6468
6470
|
monitorJobIdempotencyKey(operation) {
|
|
6469
|
-
const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access',
|
|
6471
|
+
const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _349 => _349.crypto, 'optionalAccess', _350 => _350.randomUUID, 'optionalCall', _351 => _351()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
|
|
6470
6472
|
const prefix = "monitor-job-";
|
|
6471
6473
|
const safeOperation = operation.replace(/[^A-Za-z0-9._-]/g, "-");
|
|
6472
6474
|
const maxOperationLength = Math.max(
|
|
@@ -6477,7 +6479,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6477
6479
|
}
|
|
6478
6480
|
monitorJobHeaders(operation, idempotencyKey) {
|
|
6479
6481
|
return {
|
|
6480
|
-
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess',
|
|
6482
|
+
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _352 => _352.trim, 'call', _353 => _353()]) || this.monitorJobIdempotencyKey(operation)
|
|
6481
6483
|
};
|
|
6482
6484
|
}
|
|
6483
6485
|
async deployMonitorBatch(definitions, options) {
|
|
@@ -6488,7 +6490,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6488
6490
|
body: { version: 1, kind: "batch", monitors: definitions },
|
|
6489
6491
|
headers: this.monitorJobHeaders(
|
|
6490
6492
|
"batch-deploy",
|
|
6491
|
-
_optionalChain([options, 'optionalAccess',
|
|
6493
|
+
_optionalChain([options, 'optionalAccess', _354 => _354.idempotencyKey])
|
|
6492
6494
|
),
|
|
6493
6495
|
maxRetries: 0,
|
|
6494
6496
|
exactUrlOnly: true
|
|
@@ -6507,11 +6509,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6507
6509
|
version: 1,
|
|
6508
6510
|
kind: "batch",
|
|
6509
6511
|
monitors: definitions,
|
|
6510
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6512
|
+
..._optionalChain([options, 'optionalAccess', _355 => _355.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
|
|
6511
6513
|
},
|
|
6512
6514
|
headers: this.monitorJobHeaders(
|
|
6513
6515
|
`batch-sync-${batchId}`,
|
|
6514
|
-
_optionalChain([options, 'optionalAccess',
|
|
6516
|
+
_optionalChain([options, 'optionalAccess', _356 => _356.idempotencyKey])
|
|
6515
6517
|
),
|
|
6516
6518
|
maxRetries: 0,
|
|
6517
6519
|
exactUrlOnly: true
|
|
@@ -6526,7 +6528,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6526
6528
|
body: {},
|
|
6527
6529
|
headers: this.monitorJobHeaders(
|
|
6528
6530
|
`batch-start-${batchId}`,
|
|
6529
|
-
_optionalChain([options, 'optionalAccess',
|
|
6531
|
+
_optionalChain([options, 'optionalAccess', _357 => _357.idempotencyKey])
|
|
6530
6532
|
),
|
|
6531
6533
|
maxRetries: 0,
|
|
6532
6534
|
exactUrlOnly: true
|
|
@@ -6541,7 +6543,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6541
6543
|
body: {},
|
|
6542
6544
|
headers: this.monitorJobHeaders(
|
|
6543
6545
|
`batch-stop-${batchId}`,
|
|
6544
|
-
_optionalChain([options, 'optionalAccess',
|
|
6546
|
+
_optionalChain([options, 'optionalAccess', _358 => _358.idempotencyKey])
|
|
6545
6547
|
),
|
|
6546
6548
|
maxRetries: 0,
|
|
6547
6549
|
exactUrlOnly: true
|
|
@@ -6562,7 +6564,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6562
6564
|
body: {},
|
|
6563
6565
|
headers: this.monitorJobHeaders(
|
|
6564
6566
|
`${action}-${monitorKey}`,
|
|
6565
|
-
_optionalChain([options, 'optionalAccess',
|
|
6567
|
+
_optionalChain([options, 'optionalAccess', _359 => _359.idempotencyKey])
|
|
6566
6568
|
),
|
|
6567
6569
|
maxRetries: 0,
|
|
6568
6570
|
exactUrlOnly: true
|
|
@@ -6575,7 +6577,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6575
6577
|
body: definition,
|
|
6576
6578
|
headers: this.monitorJobHeaders(
|
|
6577
6579
|
`sync-${definition.key}`,
|
|
6578
|
-
_optionalChain([options, 'optionalAccess',
|
|
6580
|
+
_optionalChain([options, 'optionalAccess', _360 => _360.idempotencyKey])
|
|
6579
6581
|
),
|
|
6580
6582
|
maxRetries: 0,
|
|
6581
6583
|
exactUrlOnly: true
|
|
@@ -6588,7 +6590,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6588
6590
|
);
|
|
6589
6591
|
}
|
|
6590
6592
|
async getMonitorJobLogs(jobId, options) {
|
|
6591
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
6593
|
+
const query = _optionalChain([options, 'optionalAccess', _361 => _361.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
|
|
6592
6594
|
return this.http.request(
|
|
6593
6595
|
`/api/v2/monitors/jobs/${encodeURIComponent(jobId)}/logs${query}`,
|
|
6594
6596
|
{ method: "GET" }
|
|
@@ -6601,15 +6603,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6601
6603
|
);
|
|
6602
6604
|
}
|
|
6603
6605
|
async waitForMonitorJob(jobId, options) {
|
|
6604
|
-
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6605
|
-
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6606
|
+
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _362 => _362.timeoutMs]), () => ( 10 * 6e4)));
|
|
6607
|
+
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _363 => _363.pollIntervalMs]), () => ( 2e3)));
|
|
6606
6608
|
const terminal = /* @__PURE__ */ new Set(["succeeded", "failed", "cancelled"]);
|
|
6607
6609
|
const startedAt = Date.now();
|
|
6608
6610
|
let latest = await this.getMonitorJob(jobId);
|
|
6609
6611
|
while (true) {
|
|
6610
|
-
_optionalChain([options, 'optionalAccess',
|
|
6612
|
+
_optionalChain([options, 'optionalAccess', _364 => _364.onProgress, 'optionalCall', _365 => _365(latest)]);
|
|
6611
6613
|
const job = latest.job;
|
|
6612
|
-
const state = typeof _optionalChain([job, 'optionalAccess',
|
|
6614
|
+
const state = typeof _optionalChain([job, 'optionalAccess', _366 => _366.state]) === "string" ? job.state : void 0;
|
|
6613
6615
|
if (state && terminal.has(state)) return latest;
|
|
6614
6616
|
if (Date.now() - startedAt >= timeoutMs) return latest;
|
|
6615
6617
|
await sleep(pollIntervalMs);
|
|
@@ -6620,12 +6622,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6620
6622
|
// Monitor Fleets
|
|
6621
6623
|
// ——————————————————————————————————————————————————————————
|
|
6622
6624
|
monitorFleetIdempotencyKey(operation) {
|
|
6623
|
-
const uuid = _optionalChain([globalThis, 'access',
|
|
6625
|
+
const uuid = _optionalChain([globalThis, 'access', _367 => _367.crypto, 'optionalAccess', _368 => _368.randomUUID, 'optionalCall', _369 => _369()]);
|
|
6624
6626
|
return `monitor-fleet-${operation}-${_nullishCoalesce(uuid, () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`;
|
|
6625
6627
|
}
|
|
6626
6628
|
monitorFleetHeaders(operation, idempotencyKey) {
|
|
6627
6629
|
return {
|
|
6628
|
-
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess',
|
|
6630
|
+
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _370 => _370.trim, 'call', _371 => _371()]) || this.monitorFleetIdempotencyKey(operation)
|
|
6629
6631
|
};
|
|
6630
6632
|
}
|
|
6631
6633
|
monitorFleetPath(fleetId) {
|
|
@@ -6645,15 +6647,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6645
6647
|
const fleetId = typeof definitionOrId === "string" ? definitionOrId : definitionOrId.id;
|
|
6646
6648
|
const body = {
|
|
6647
6649
|
...typeof definitionOrId === "string" ? {} : { definition: definitionOrId },
|
|
6648
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6649
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6650
|
+
..._optionalChain([options, 'optionalAccess', _372 => _372.dryRun]) ? { dry_run: true } : {},
|
|
6651
|
+
..._optionalChain([options, 'optionalAccess', _373 => _373.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
|
|
6650
6652
|
};
|
|
6651
6653
|
return this.http.request(
|
|
6652
6654
|
this.monitorFleetPath(fleetId),
|
|
6653
6655
|
{
|
|
6654
6656
|
method: "PUT",
|
|
6655
6657
|
body,
|
|
6656
|
-
headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess',
|
|
6658
|
+
headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _374 => _374.idempotencyKey])),
|
|
6657
6659
|
maxRetries: 0,
|
|
6658
6660
|
exactUrlOnly: true
|
|
6659
6661
|
}
|
|
@@ -6666,8 +6668,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6666
6668
|
}
|
|
6667
6669
|
async getMonitorFleet(fleetId, options) {
|
|
6668
6670
|
const params = new URLSearchParams();
|
|
6669
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6670
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6671
|
+
if (_optionalChain([options, 'optionalAccess', _375 => _375.drift])) params.set("drift", "1");
|
|
6672
|
+
if (_optionalChain([options, 'optionalAccess', _376 => _376.limit]) !== void 0)
|
|
6671
6673
|
params.set("limit", String(options.limit));
|
|
6672
6674
|
const query = params.toString();
|
|
6673
6675
|
return this.http.request(
|
|
@@ -6680,10 +6682,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6680
6682
|
this.monitorFleetPath(fleetId),
|
|
6681
6683
|
{
|
|
6682
6684
|
method: "DELETE",
|
|
6683
|
-
body: _optionalChain([options, 'optionalAccess',
|
|
6685
|
+
body: _optionalChain([options, 'optionalAccess', _377 => _377.dryRun]) ? { dry_run: true } : {},
|
|
6684
6686
|
headers: this.monitorFleetHeaders(
|
|
6685
6687
|
"deactivate",
|
|
6686
|
-
_optionalChain([options, 'optionalAccess',
|
|
6688
|
+
_optionalChain([options, 'optionalAccess', _378 => _378.idempotencyKey])
|
|
6687
6689
|
),
|
|
6688
6690
|
maxRetries: 0,
|
|
6689
6691
|
exactUrlOnly: true
|
|
@@ -6698,7 +6700,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6698
6700
|
body: {},
|
|
6699
6701
|
headers: this.monitorFleetHeaders(
|
|
6700
6702
|
"reactivate",
|
|
6701
|
-
_optionalChain([options, 'optionalAccess',
|
|
6703
|
+
_optionalChain([options, 'optionalAccess', _379 => _379.idempotencyKey])
|
|
6702
6704
|
),
|
|
6703
6705
|
maxRetries: 0,
|
|
6704
6706
|
exactUrlOnly: true
|
|
@@ -6715,13 +6717,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6715
6717
|
* identical to "the request failed".
|
|
6716
6718
|
*/
|
|
6717
6719
|
async waitForMonitorFleetConvergence(fleetId, options) {
|
|
6718
|
-
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6719
|
-
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6720
|
-
const terminal = _optionalChain([options, 'optionalAccess',
|
|
6720
|
+
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _380 => _380.timeoutMs]), () => ( 10 * 6e4)));
|
|
6721
|
+
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _381 => _381.pollIntervalMs]), () => ( 2e3)));
|
|
6722
|
+
const terminal = _optionalChain([options, 'optionalAccess', _382 => _382.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded"]) : /* @__PURE__ */ new Set(["converged", "degraded", "deactivated"]);
|
|
6721
6723
|
const startedAt = Date.now();
|
|
6722
6724
|
let latest = await this.getMonitorFleet(fleetId);
|
|
6723
6725
|
while (true) {
|
|
6724
|
-
_optionalChain([options, 'optionalAccess',
|
|
6726
|
+
_optionalChain([options, 'optionalAccess', _383 => _383.onProgress, 'optionalCall', _384 => _384(latest)]);
|
|
6725
6727
|
const status = typeof latest.status === "string" ? latest.status : void 0;
|
|
6726
6728
|
if (status && terminal.has(status)) return latest;
|
|
6727
6729
|
if (Date.now() - startedAt >= timeoutMs) return latest;
|