deepline 0.3.346 → 0.3.347
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 +14 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/tool-calls.ts +78 -17
- package/dist/cli/auth-PSMCNXBC.js +31 -0
- package/dist/cli/{auth-HTWHQNMY.mjs → auth-RWP45MJX.mjs} +4 -4
- package/dist/cli/{billing-4DCHVGO5.js → billing-F6RNSQWW.js} +71 -71
- package/dist/cli/{billing-X56CVZWC.mjs → billing-XPKHI4LF.mjs} +4 -4
- package/dist/cli/{chunk-NVNHV73C.mjs → chunk-3JJLQQLW.mjs} +2 -2
- package/dist/cli/{chunk-ZEUFYRUR.js → chunk-3PRBUTJK.js} +240 -231
- package/dist/cli/{chunk-22GXXUTB.js → chunk-5UJOJKPW.js} +33 -27
- package/dist/cli/{chunk-5NNSJTJ3.js → chunk-723POEH5.js} +279 -244
- package/dist/cli/{chunk-SGBSQHXS.js → chunk-AGV2VS4U.js} +55 -53
- package/dist/cli/{chunk-MOVEHSNM.mjs → chunk-AOKWJJLP.mjs} +1 -1
- package/dist/cli/{chunk-KQCTQGUU.mjs → chunk-AYR45POY.mjs} +51 -16
- package/dist/cli/{chunk-YUKZHAFW.js → chunk-BUXJSW26.js} +26 -26
- package/dist/cli/{chunk-L2R72RQJ.js → chunk-EOS73ZCP.js} +8 -8
- package/dist/cli/{chunk-5QG2UAYH.js → chunk-GS2ZSOAQ.js} +2 -2
- package/dist/cli/{chunk-EJ2NVO5K.js → chunk-GT7OCAWV.js} +48 -48
- package/dist/cli/{chunk-4Q572AVS.js → chunk-JB4UKD3B.js} +6 -6
- package/dist/cli/{chunk-GGSLHWTB.js → chunk-L4TXOCCC.js} +1 -1
- package/dist/cli/{chunk-WKZTHHJI.mjs → chunk-LH4VHCN5.mjs} +9 -7
- package/dist/cli/{chunk-2RJ7RMRM.js → chunk-LPKV6IBM.js} +8 -8
- package/dist/cli/{chunk-GCBLVWDQ.mjs → chunk-LTJOC47W.mjs} +16 -7
- package/dist/cli/{chunk-AFNEQ43J.js → chunk-MX53GIOB.js} +40 -1
- package/dist/cli/{chunk-P4IKGWYF.mjs → chunk-NU5EU2SH.mjs} +4 -4
- package/dist/cli/{chunk-62TKYGY6.mjs → chunk-OS6CZRJE.mjs} +3 -3
- package/dist/cli/{chunk-VC7M2QR7.mjs → chunk-PQGDU7B5.mjs} +7 -1
- package/dist/cli/{chunk-YEKAGC52.js → chunk-ROEN4NXY.js} +60 -60
- package/dist/cli/{chunk-2GRMXCLZ.mjs → chunk-SFJEAK54.mjs} +1 -1
- package/dist/cli/{chunk-3GLIYDIF.mjs → chunk-U2GPF4SB.mjs} +2 -2
- package/dist/cli/{chunk-O4SXVVNQ.mjs → chunk-VRYRVD3F.mjs} +1 -1
- package/dist/cli/{chunk-T7EVEXHS.js → chunk-WX7W76U7.js} +15 -15
- package/dist/cli/{chunk-ZR4EHO62.mjs → chunk-X32ZLEUU.mjs} +2 -2
- package/dist/cli/{chunk-XAM3XOUA.mjs → chunk-Y6D2JYBR.mjs} +2 -2
- package/dist/cli/{chunk-JOA6IKDE.mjs → chunk-Z6B4UPM4.mjs} +39 -0
- package/dist/cli/{client-C2KUT452.mjs → client-FZJ3RSO3.mjs} +3 -3
- package/dist/cli/client-J4QGSQ6Y.js +20 -0
- package/dist/cli/{csv-SLACAH4F.mjs → csv-HPBPBU3I.mjs} +3 -3
- package/dist/cli/{csv-3TAA2MTR.js → csv-QSMT5HZS.js} +12 -12
- package/dist/cli/{db-IN4I6KJ5.mjs → db-2KAUAVVC.mjs} +4 -4
- package/dist/cli/{db-BT6Q3FE6.js → db-IKZKICP3.js} +29 -29
- package/dist/cli/{describe-EDXTYMOF.mjs → describe-EW4GZMUK.mjs} +9 -9
- package/dist/cli/{describe-FJZXYKFH.js → describe-QM7Q5Y2H.js} +25 -25
- package/dist/cli/{executions-YYQC2TVR.js → executions-5ICONLFX.js} +6 -6
- package/dist/cli/{executions-X36QA5NY.mjs → executions-U5WWUFEZ.mjs} +4 -4
- package/dist/cli/{feedback-BS3S46O3.js → feedback-N2KGAK4V.js} +7 -7
- package/dist/cli/{feedback-KTEPHZ4S.mjs → feedback-ZBQPQPFG.mjs} +3 -3
- package/dist/cli/git-2N5LS25H.js +23 -0
- package/dist/cli/{git-3ZVYB63W.mjs → git-M5YEP57H.mjs} +4 -4
- package/dist/cli/index.js +79 -79
- package/dist/cli/index.mjs +31 -31
- package/dist/cli/{legacy-noops-VVBJXM2K.mjs → legacy-noops-GJUYBH2F.mjs} +4 -4
- package/dist/cli/{legacy-noops-V5R7ITER.js → legacy-noops-IQIPPJF7.js} +7 -7
- package/dist/cli/{monitors-J6XDE76B.js → monitors-DQUCHISX.js} +85 -85
- package/dist/cli/{monitors-KYTMBNUQ.mjs → monitors-XJAJNMG4.mjs} +4 -4
- package/dist/cli/{org-RGABGQKP.mjs → org-DFWDN4EJ.mjs} +4 -4
- package/dist/cli/{org-MHF2NGDV.js → org-G45CXUJV.js} +60 -60
- package/dist/cli/{play-UII4SSA7.mjs → play-URTZW2Q4.mjs} +8 -8
- package/dist/cli/play-WWMUYKWS.js +153 -0
- package/dist/cli/{providers-LQOSKPUH.mjs → providers-CCKMRCXU.mjs} +4 -4
- package/dist/cli/{providers-3GDMD7T6.js → providers-IVUWWGFP.js} +7 -7
- package/dist/cli/{quickstart-GAMYLCLJ.mjs → quickstart-CRHIA3PZ.mjs} +3 -3
- package/dist/cli/{quickstart-R34Z7EMU.js → quickstart-MMIVNRV4.js} +5 -5
- package/dist/cli/{search-AOOMDVF5.mjs → search-NDRDOINX.mjs} +5 -5
- package/dist/cli/search-YZL2QRIF.js +26 -0
- package/dist/cli/{secrets-T4XXIASK.js → secrets-GQUBMJGM.js} +13 -13
- package/dist/cli/{secrets-U7YGLUSX.mjs → secrets-SUC3KLLH.mjs} +4 -4
- package/dist/cli/{sessions-VPXR4DSZ.mjs → sessions-7CAU6JL5.mjs} +4 -4
- package/dist/cli/{sessions-JQGKWKJS.js → sessions-AQCRVLHW.js} +5 -5
- package/dist/cli/{settings-LXF45R7X.js → settings-4SDI73XW.js} +74 -74
- package/dist/cli/{settings-LP55G43L.mjs → settings-LFFOFAU6.mjs} +7 -7
- package/dist/cli/{setup-36QA4JI3.mjs → setup-BKCQOJBD.mjs} +6 -6
- package/dist/cli/{setup-MA2GLU4N.js → setup-FQ3E7U7G.js} +41 -41
- package/dist/cli/skills-7BPEGDIA.js +28 -0
- package/dist/cli/{skills-HB6PARLZ.mjs → skills-USGJ5MF7.mjs} +4 -4
- package/dist/cli/{tools-E7K7R4AO.mjs → tools-5HTXLDZ4.mjs} +7 -7
- package/dist/cli/tools-5VEZ4QR4.js +40 -0
- package/dist/cli/{update-IT63P3NV.mjs → update-F7TIJEIV.mjs} +6 -6
- package/dist/cli/update-YFPMWKI4.js +28 -0
- package/dist/cli/{workflow-UO3PMX7R.mjs → workflow-FXJ2D2MG.mjs} +5 -5
- package/dist/cli/{workflow-SJHASZ5C.js → workflow-J5JVOUIL.js} +15 -15
- package/dist/{client-BHReRdWK.d.mts → client-D20uyRYB.d.mts} +6 -0
- package/dist/{client-DW3zASj8.d.ts → client-rHyf5s_Y.d.ts} +6 -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 +78 -78
- 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-5YTC2XH2.js +0 -31
- package/dist/cli/client-4RKYHB7Z.js +0 -20
- package/dist/cli/git-ZHAD5TJN.js +0 -23
- package/dist/cli/play-ZWAH3U44.js +0 -153
- package/dist/cli/search-FVB7ZNCO.js +0 -26
- package/dist/cli/skills-GUWC4FV7.js +0 -28
- package/dist/cli/tools-T5WIAD5Z.js +0 -40
- package/dist/cli/update-QY6RY3A6.js +0 -28
|
@@ -15,7 +15,7 @@ var _chunkLA46MMTLjs = require('./chunk-LA46MMTL.js');
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunk5UJOJKPWjs = require('./chunk-5UJOJKPW.js');
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
@@ -167,7 +167,7 @@ async function queryCustomerDatabase(http, input) {
|
|
|
167
167
|
if (error instanceof _chunk7P5AA3SNjs.DeeplineError && (_optionalChain([error, 'access', _2 => _2.code, 'optionalAccess', _3 => _3.startsWith, 'call', _4 => _4("NETWORK_")]) || // Older API readers return PostgreSQL errors as HTTP 400, including
|
|
168
168
|
// lost connections and explicitly unknown transaction resolution.
|
|
169
169
|
/^08[A-Z0-9]{3}$/.test(_nullishCoalesce(error.code, () => ( ""))) || ["57P01", "57P02", "57P03"].includes(_nullishCoalesce(error.code, () => ( ""))) || error.statusCode === 408 || (_nullishCoalesce(error.statusCode, () => ( 0))) >= 500)) {
|
|
170
|
-
throw new (0,
|
|
170
|
+
throw new (0, _chunk5UJOJKPWjs.CustomerDbQueryOutcomeUnknownError)(
|
|
171
171
|
error,
|
|
172
172
|
plan.request.body.operation_key
|
|
173
173
|
);
|
|
@@ -175,7 +175,7 @@ async function queryCustomerDatabase(http, input) {
|
|
|
175
175
|
throw error;
|
|
176
176
|
}
|
|
177
177
|
if (!result || typeof result !== "object" || Array.isArray(result) || typeof result.command !== "string" || !Array.isArray(result.columns) || !Array.isArray(result.rows) || typeof result.truncated !== "boolean" || result.row_count !== null && (!Number.isSafeInteger(result.row_count) || result.row_count < 0) || !Number.isSafeInteger(result.row_count_returned) || result.row_count_returned < 0) {
|
|
178
|
-
throw new (0,
|
|
178
|
+
throw new (0, _chunk5UJOJKPWjs.CustomerDbQueryOutcomeUnknownError)(
|
|
179
179
|
new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
180
180
|
"The SQL response did not contain a valid result.",
|
|
181
181
|
200,
|
|
@@ -186,7 +186,7 @@ async function queryCustomerDatabase(http, input) {
|
|
|
186
186
|
}
|
|
187
187
|
const operation = result.operation;
|
|
188
188
|
if (input.operationKey !== void 0 && (!operation || operation.operation_key !== input.operationKey || !Number.isSafeInteger(operation.completed_at_ms) || operation.completed_at_ms < 0 || !["executed", "operation_recovery"].includes(operation.source))) {
|
|
189
|
-
throw new (0,
|
|
189
|
+
throw new (0, _chunk5UJOJKPWjs.CustomerDbQueryOutcomeUnknownError)(
|
|
190
190
|
new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
191
191
|
"The server did not confirm the original atomic SQL operation.",
|
|
192
192
|
200,
|
|
@@ -477,25 +477,59 @@ var ToolCalls = class {
|
|
|
477
477
|
..._optionalChain([options, 'optionalAccess', _19 => _19.searchRef]) ? { "x-deepline-search-ref": options.searchRef } : {},
|
|
478
478
|
..._optionalChain([options, 'optionalAccess', _20 => _20.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
|
|
479
479
|
};
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
{
|
|
488
|
-
timeout: requestTimeoutMs,
|
|
489
|
-
maxRetries: idempotencyKey ? 0 : _nullishCoalesce(_optionalChain([options, 'optionalAccess', _21 => _21.maxRetries]), () => ( 0)),
|
|
490
|
-
retryApiErrors: _optionalChain([options, 'optionalAccess', _22 => _22.retryApiErrors]) === true,
|
|
491
|
-
exactUrlOnly: true,
|
|
492
|
-
toolId,
|
|
493
|
-
idempotencyKey
|
|
480
|
+
let lastResponse = null;
|
|
481
|
+
const observeTerminal = (failure) => {
|
|
482
|
+
if (!lastResponse) return;
|
|
483
|
+
if (failure) {
|
|
484
|
+
const { error } = failure;
|
|
485
|
+
if (isRecoverableExecutionAttemptError(error) || !(error instanceof _chunk7P5AA3SNjs.DeeplineError) || error.statusCode === void 0 || error.statusCode !== lastResponse.httpStatus || error.code === "EXECUTION_OUTCOME_UNKNOWN")
|
|
486
|
+
return;
|
|
494
487
|
}
|
|
495
|
-
|
|
488
|
+
const body = lastResponse.body;
|
|
489
|
+
const recovery = getExecutionRecoveryState(body);
|
|
490
|
+
if (recovery === "running" || recovery === "outcome_unknown") return;
|
|
491
|
+
const state = isRecord(body) ? body.status : null;
|
|
492
|
+
const terminal = state === "completed" || state === "failed" || state === "cancelled" ? state : state === "canceled" ? "cancelled" : failure ? "failed" : null;
|
|
493
|
+
if (terminal)
|
|
494
|
+
_optionalChain([options, 'optionalAccess', _21 => _21.onResponseReceived, 'optionalCall', _22 => _22({
|
|
495
|
+
receivedAtMs: lastResponse.receivedAtMs,
|
|
496
|
+
httpStatus: lastResponse.httpStatus,
|
|
497
|
+
state: terminal
|
|
498
|
+
})]);
|
|
499
|
+
};
|
|
500
|
+
const request = async (requestTimeoutMs) => {
|
|
501
|
+
lastResponse = null;
|
|
502
|
+
try {
|
|
503
|
+
return await this.http.post(
|
|
504
|
+
`/api/v2/integrations/${encodeURIComponent(toolId)}/execute`,
|
|
505
|
+
{
|
|
506
|
+
payload: inputSnapshot,
|
|
507
|
+
...metadataSnapshot ? { metadata: metadataSnapshot } : {}
|
|
508
|
+
},
|
|
509
|
+
headers,
|
|
510
|
+
{
|
|
511
|
+
timeout: requestTimeoutMs,
|
|
512
|
+
maxRetries: idempotencyKey ? 0 : _nullishCoalesce(_optionalChain([options, 'optionalAccess', _23 => _23.maxRetries]), () => ( 0)),
|
|
513
|
+
retryApiErrors: _optionalChain([options, 'optionalAccess', _24 => _24.retryApiErrors]) === true,
|
|
514
|
+
exactUrlOnly: true,
|
|
515
|
+
toolId,
|
|
516
|
+
idempotencyKey,
|
|
517
|
+
onResponse: () => {
|
|
518
|
+
lastResponse = null;
|
|
519
|
+
},
|
|
520
|
+
onResponseBody: (observation) => {
|
|
521
|
+
lastResponse = observation;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
);
|
|
525
|
+
} catch (error) {
|
|
526
|
+
observeTerminal({ error });
|
|
527
|
+
throw error;
|
|
528
|
+
}
|
|
529
|
+
};
|
|
496
530
|
let response;
|
|
497
531
|
let recoveryDeadline = null;
|
|
498
|
-
const recoveryTimeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
532
|
+
const recoveryTimeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _25 => _25.recoveryTimeoutMs]), () => ( DEFAULT_EXECUTION_RECOVERY_TIMEOUT_MS));
|
|
499
533
|
let retryDelayMs = 1e3;
|
|
500
534
|
const recoveryTimeoutError = () => executionRecoveryError({
|
|
501
535
|
toolId,
|
|
@@ -523,7 +557,7 @@ var ToolCalls = class {
|
|
|
523
557
|
this.defaultRequestTimeoutMs,
|
|
524
558
|
remainingMs
|
|
525
559
|
),
|
|
526
|
-
_optionalChain([options, 'optionalAccess',
|
|
560
|
+
_optionalChain([options, 'optionalAccess', _26 => _26.cliInvocationId])
|
|
527
561
|
);
|
|
528
562
|
} catch (error) {
|
|
529
563
|
if (!isRecoverableExecutionLookupError(error)) throw error;
|
|
@@ -587,6 +621,7 @@ var ToolCalls = class {
|
|
|
587
621
|
});
|
|
588
622
|
}
|
|
589
623
|
}
|
|
624
|
+
observeTerminal();
|
|
590
625
|
const materialized = materializeToolExecutionResponse(response);
|
|
591
626
|
return idempotencyKey ? { ...materialized, idempotencyKey } : materialized;
|
|
592
627
|
}
|
|
@@ -1762,10 +1797,10 @@ function getStepStatusSignature(snapshot) {
|
|
|
1762
1797
|
_nullishCoalesce(state.artifactTableNamespace, () => ( "")),
|
|
1763
1798
|
_nullishCoalesce(state.startedAt, () => ( "")),
|
|
1764
1799
|
_nullishCoalesce(state.completedAt, () => ( "")),
|
|
1765
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
1766
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
1800
|
+
_nullishCoalesce(_optionalChain([state, 'access', _27 => _27.progress, 'optionalAccess', _28 => _28.startedAt]), () => ( "")),
|
|
1801
|
+
_nullishCoalesce(_optionalChain([state, 'access', _29 => _29.progress, 'optionalAccess', _30 => _30.completedAt]), () => ( "")),
|
|
1767
1802
|
_nullishCoalesce(state.updatedAt, () => ( "")),
|
|
1768
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
1803
|
+
_nullishCoalesce(_optionalChain([state, 'access', _31 => _31.progress, 'optionalAccess', _32 => _32.updatedAt]), () => ( ""))
|
|
1769
1804
|
].join(":")
|
|
1770
1805
|
).join("|");
|
|
1771
1806
|
}
|
|
@@ -1774,11 +1809,11 @@ function getStepProgressSignature(snapshot) {
|
|
|
1774
1809
|
snapshot.nodeStates.map((state) => [
|
|
1775
1810
|
state.nodeId,
|
|
1776
1811
|
projectPlayStepProgressCounters(_nullishCoalesce(state.progress, () => ( {}))),
|
|
1777
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
1778
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
1779
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
1780
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
1781
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
1812
|
+
_nullishCoalesce(_optionalChain([state, 'access', _33 => _33.progress, 'optionalAccess', _34 => _34.artifactTableNamespace]), () => ( "")),
|
|
1813
|
+
_nullishCoalesce(_optionalChain([state, 'access', _35 => _35.progress, 'optionalAccess', _36 => _36.startedAt]), () => ( "")),
|
|
1814
|
+
_nullishCoalesce(_optionalChain([state, 'access', _37 => _37.progress, 'optionalAccess', _38 => _38.completedAt]), () => ( "")),
|
|
1815
|
+
_nullishCoalesce(_optionalChain([state, 'access', _39 => _39.progress, 'optionalAccess', _40 => _40.updatedAt]), () => ( "")),
|
|
1816
|
+
_nullishCoalesce(_optionalChain([state, 'access', _41 => _41.progress, 'optionalAccess', _42 => _42.message]), () => ( ""))
|
|
1782
1817
|
])
|
|
1783
1818
|
);
|
|
1784
1819
|
}
|
|
@@ -1848,8 +1883,8 @@ function diffPlayRunStreamEvents(input) {
|
|
|
1848
1883
|
if (state.status === "idle") {
|
|
1849
1884
|
continue;
|
|
1850
1885
|
}
|
|
1851
|
-
const persistedStartedAt = _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access',
|
|
1852
|
-
const persistedCompletedAt = _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access',
|
|
1886
|
+
const persistedStartedAt = _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _43 => _43.progress, 'optionalAccess', _44 => _44.startedAt]))), () => ( null));
|
|
1887
|
+
const persistedCompletedAt = _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _45 => _45.progress, 'optionalAccess', _46 => _46.completedAt]))), () => ( null));
|
|
1853
1888
|
events.push(
|
|
1854
1889
|
makeRunStreamEvent({
|
|
1855
1890
|
cursor,
|
|
@@ -1863,7 +1898,7 @@ function diffPlayRunStreamEvents(input) {
|
|
|
1863
1898
|
...resolveTimingWindow({
|
|
1864
1899
|
startedAt: persistedStartedAt,
|
|
1865
1900
|
completedAt: persistedCompletedAt,
|
|
1866
|
-
updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access',
|
|
1901
|
+
updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _47 => _47.progress, 'optionalAccess', _48 => _48.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
|
|
1867
1902
|
})
|
|
1868
1903
|
}
|
|
1869
1904
|
})
|
|
@@ -1917,9 +1952,9 @@ function diffPlayRunStreamEvents(input) {
|
|
|
1917
1952
|
if (next.snapshotSignature !== previous.snapshotSignature) {
|
|
1918
1953
|
const enrichedNodeStates = snapshot.nodeStates.map((state) => {
|
|
1919
1954
|
const timing = resolveTimingWindow({
|
|
1920
|
-
startedAt: _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access',
|
|
1921
|
-
completedAt: _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access',
|
|
1922
|
-
updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access',
|
|
1955
|
+
startedAt: _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _49 => _49.progress, 'optionalAccess', _50 => _50.startedAt]))), () => ( null)),
|
|
1956
|
+
completedAt: _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _51 => _51.progress, 'optionalAccess', _52 => _52.completedAt]))), () => ( null)),
|
|
1957
|
+
updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _53 => _53.progress, 'optionalAccess', _54 => _54.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
|
|
1923
1958
|
});
|
|
1924
1959
|
return {
|
|
1925
1960
|
...state,
|
|
@@ -1978,18 +2013,18 @@ function isTransientPlayRunReadError(error) {
|
|
|
1978
2013
|
// src/runs/watch-polling.ts
|
|
1979
2014
|
var RUN_WATCH_POLL_INTERVAL_MS = 2e3;
|
|
1980
2015
|
function waitForNextPoll(ms, signal) {
|
|
1981
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
2016
|
+
if (_optionalChain([signal, 'optionalAccess', _55 => _55.aborted])) {
|
|
1982
2017
|
return Promise.resolve(false);
|
|
1983
2018
|
}
|
|
1984
2019
|
return new Promise((resolve) => {
|
|
1985
2020
|
const finish = (elapsed) => {
|
|
1986
2021
|
clearTimeout(timeout);
|
|
1987
|
-
_optionalChain([signal, 'optionalAccess',
|
|
2022
|
+
_optionalChain([signal, 'optionalAccess', _56 => _56.removeEventListener, 'call', _57 => _57("abort", onAbort)]);
|
|
1988
2023
|
resolve(elapsed);
|
|
1989
2024
|
};
|
|
1990
2025
|
const onAbort = () => finish(false);
|
|
1991
2026
|
const timeout = setTimeout(() => finish(true), ms);
|
|
1992
|
-
_optionalChain([signal, 'optionalAccess',
|
|
2027
|
+
_optionalChain([signal, 'optionalAccess', _58 => _58.addEventListener, 'call', _59 => _59("abort", onAbort, { once: true })]);
|
|
1993
2028
|
});
|
|
1994
2029
|
}
|
|
1995
2030
|
function readSnapshotResponse(response, runId) {
|
|
@@ -2046,7 +2081,7 @@ async function* watchRunEvents(options) {
|
|
|
2046
2081
|
let previous = EMPTY_PLAY_RUN_STREAM_DIFF_STATE;
|
|
2047
2082
|
let consecutiveFailures = 0;
|
|
2048
2083
|
let outageNoticeSent = false;
|
|
2049
|
-
while (!_optionalChain([signal, 'optionalAccess',
|
|
2084
|
+
while (!_optionalChain([signal, 'optionalAccess', _60 => _60.aborted])) {
|
|
2050
2085
|
const pollStartedAt = Date.now();
|
|
2051
2086
|
let snapshot;
|
|
2052
2087
|
try {
|
|
@@ -2059,7 +2094,7 @@ async function* watchRunEvents(options) {
|
|
|
2059
2094
|
signal
|
|
2060
2095
|
});
|
|
2061
2096
|
} catch (error) {
|
|
2062
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
2097
|
+
if (_optionalChain([signal, 'optionalAccess', _61 => _61.aborted])) {
|
|
2063
2098
|
return;
|
|
2064
2099
|
}
|
|
2065
2100
|
if (!isTransientPlayRunReadError(error)) {
|
|
@@ -2068,12 +2103,12 @@ async function* watchRunEvents(options) {
|
|
|
2068
2103
|
consecutiveFailures += 1;
|
|
2069
2104
|
const reason = error instanceof Error ? error.message : String(error);
|
|
2070
2105
|
if (!outageNoticeSent) {
|
|
2071
|
-
_optionalChain([options, 'access',
|
|
2106
|
+
_optionalChain([options, 'access', _62 => _62.onRetry, 'optionalCall', _63 => _63({
|
|
2072
2107
|
attempt: consecutiveFailures,
|
|
2073
2108
|
delayMs: pollIntervalMs,
|
|
2074
2109
|
reason
|
|
2075
2110
|
})]);
|
|
2076
|
-
_optionalChain([options, 'access',
|
|
2111
|
+
_optionalChain([options, 'access', _64 => _64.onNotice, 'optionalCall', _65 => _65(
|
|
2077
2112
|
`[watch] run snapshot request failed; retrying every ${pollIntervalMs / 1e3}s (${reason})`
|
|
2078
2113
|
)]);
|
|
2079
2114
|
outageNoticeSent = true;
|
|
@@ -2088,7 +2123,7 @@ async function* watchRunEvents(options) {
|
|
|
2088
2123
|
continue;
|
|
2089
2124
|
}
|
|
2090
2125
|
if (outageNoticeSent) {
|
|
2091
|
-
_optionalChain([options, 'access',
|
|
2126
|
+
_optionalChain([options, 'access', _66 => _66.onNotice, 'optionalCall', _67 => _67("[watch] run snapshot polling recovered")]);
|
|
2092
2127
|
outageNoticeSent = false;
|
|
2093
2128
|
}
|
|
2094
2129
|
consecutiveFailures = 0;
|
|
@@ -2418,7 +2453,7 @@ function parseDsl(input) {
|
|
|
2418
2453
|
input.slice(position)
|
|
2419
2454
|
);
|
|
2420
2455
|
if (!operation) {
|
|
2421
|
-
const token = _nullishCoalesce(_nullishCoalesce(_optionalChain([/^(?:[=!<>~]+|[A-Za-z_]+)/, 'access',
|
|
2456
|
+
const token = _nullishCoalesce(_nullishCoalesce(_optionalChain([/^(?:[=!<>~]+|[A-Za-z_]+)/, 'access', _68 => _68.exec, 'call', _69 => _69(input.slice(position)), 'optionalAccess', _70 => _70[0]]), () => ( input[position])), () => ( "<end>"));
|
|
2422
2457
|
if (token === "=") {
|
|
2423
2458
|
const corrected = `${input.slice(0, position)}==${input.slice(position + 1)}`;
|
|
2424
2459
|
fail(
|
|
@@ -2497,7 +2532,7 @@ function normalizeRunEventQueryTimestamp(value) {
|
|
|
2497
2532
|
return /[1-9]/.test(extraMicros) ? canonical2.replace(/Z$/, `${extraMicros}Z`) : canonical2;
|
|
2498
2533
|
}
|
|
2499
2534
|
function timestampMicros(value) {
|
|
2500
|
-
const fraction = _nullishCoalesce(_optionalChain([/\.(\d+)Z$/, 'access',
|
|
2535
|
+
const fraction = _nullishCoalesce(_optionalChain([/\.(\d+)Z$/, 'access', _71 => _71.exec, 'call', _72 => _72(value), 'optionalAccess', _73 => _73[1]]), () => ( ""));
|
|
2501
2536
|
return BigInt(Date.parse(value)) * BigInt(1e3) + BigInt(fraction.padEnd(6, "0").slice(3));
|
|
2502
2537
|
}
|
|
2503
2538
|
function time(value, nowMs, fallback) {
|
|
@@ -2730,7 +2765,7 @@ function parseNotificationGroupTarget(value) {
|
|
|
2730
2765
|
}
|
|
2731
2766
|
return { kind: "email", email };
|
|
2732
2767
|
}
|
|
2733
|
-
const slack = _optionalChain([/^slack:(.+)$/i, 'access',
|
|
2768
|
+
const slack = _optionalChain([/^slack:(.+)$/i, 'access', _74 => _74.exec, 'call', _75 => _75(normalized), 'optionalAccess', _76 => _76[1], 'optionalAccess', _77 => _77.trim, 'call', _78 => _78()]);
|
|
2734
2769
|
if (!slack) {
|
|
2735
2770
|
const provider = normalized.split(":", 1)[0] || normalized;
|
|
2736
2771
|
throw new Error(
|
|
@@ -2738,7 +2773,7 @@ function parseNotificationGroupTarget(value) {
|
|
|
2738
2773
|
);
|
|
2739
2774
|
}
|
|
2740
2775
|
const member = /^member:([UW][A-Z0-9]{8,})$/i.exec(slack);
|
|
2741
|
-
if (_optionalChain([member, 'optionalAccess',
|
|
2776
|
+
if (_optionalChain([member, 'optionalAccess', _79 => _79[1]])) {
|
|
2742
2777
|
return { kind: "slack", memberId: member[1].toUpperCase() };
|
|
2743
2778
|
}
|
|
2744
2779
|
if (slack.toLowerCase().startsWith("member:")) {
|
|
@@ -2785,10 +2820,10 @@ function resolvePlayRunRuntimeSelection(request) {
|
|
|
2785
2820
|
}
|
|
2786
2821
|
return runtime;
|
|
2787
2822
|
}
|
|
2788
|
-
const configured = _optionalChain([process, 'access',
|
|
2789
|
-
const configuredNamespace = _optionalChain([process, 'access',
|
|
2790
|
-
const configuredToken = _optionalChain([process, 'access',
|
|
2791
|
-
const configuredPlacementPolicy = _optionalChain([process, 'access',
|
|
2823
|
+
const configured = _optionalChain([process, 'access', _80 => _80.env, 'access', _81 => _81.DEEPLINE_RUNTIME_ENVIRONMENT, 'optionalAccess', _82 => _82.trim, 'call', _83 => _83()]);
|
|
2824
|
+
const configuredNamespace = _optionalChain([process, 'access', _84 => _84.env, 'access', _85 => _85.DEEPLINE_RUNTIME_NAMESPACE, 'optionalAccess', _86 => _86.trim, 'call', _87 => _87()]);
|
|
2825
|
+
const configuredToken = _optionalChain([process, 'access', _88 => _88.env, 'access', _89 => _89.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _90 => _90.trim, 'call', _91 => _91()]);
|
|
2826
|
+
const configuredPlacementPolicy = _optionalChain([process, 'access', _92 => _92.env, 'access', _93 => _93.DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY, 'optionalAccess', _94 => _94.trim, 'call', _95 => _95()]);
|
|
2792
2827
|
if (!configured) {
|
|
2793
2828
|
if (configuredNamespace || configuredToken || configuredPlacementPolicy) {
|
|
2794
2829
|
const present = [];
|
|
@@ -2827,7 +2862,7 @@ function resolvePlayRunRuntimeSelection(request) {
|
|
|
2827
2862
|
"INVALID_RUNTIME_NAMESPACE"
|
|
2828
2863
|
);
|
|
2829
2864
|
}
|
|
2830
|
-
const configuredBackendValue = _optionalChain([process, 'access',
|
|
2865
|
+
const configuredBackendValue = _optionalChain([process, 'access', _96 => _96.env, 'access', _97 => _97.DEEPLINE_PLAY_RUNNER_BACKEND, 'optionalAccess', _98 => _98.trim, 'call', _99 => _99()]);
|
|
2831
2866
|
const configuredBackend = configuredBackendValue === "daytona" || configuredBackendValue === "modal" ? configuredBackendValue : void 0;
|
|
2832
2867
|
if (configuredBackendValue && !configuredBackend) {
|
|
2833
2868
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
@@ -2865,7 +2900,7 @@ function resolveStartPlayRunRequest(request) {
|
|
|
2865
2900
|
}
|
|
2866
2901
|
function runtimeSelectionHeaders(runtime) {
|
|
2867
2902
|
if (!runtime) return void 0;
|
|
2868
|
-
const token = _optionalChain([process, 'access',
|
|
2903
|
+
const token = _optionalChain([process, 'access', _100 => _100.env, 'access', _101 => _101.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _102 => _102.trim, 'call', _103 => _103()]);
|
|
2869
2904
|
if (!token) {
|
|
2870
2905
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
2871
2906
|
"DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN is required for explicit preview runtime selection.",
|
|
@@ -2873,18 +2908,18 @@ function runtimeSelectionHeaders(runtime) {
|
|
|
2873
2908
|
"RUNTIME_ENVIRONMENT_TOKEN_REQUIRED"
|
|
2874
2909
|
);
|
|
2875
2910
|
}
|
|
2876
|
-
const receivers = _optionalChain([process, 'access',
|
|
2911
|
+
const receivers = _optionalChain([process, 'access', _104 => _104.env, 'access', _105 => _105.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _106 => _106.trim, 'call', _107 => _107()]);
|
|
2877
2912
|
return {
|
|
2878
|
-
[
|
|
2879
|
-
...receivers ? { [
|
|
2913
|
+
[_chunk5UJOJKPWjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
|
|
2914
|
+
...receivers ? { [_chunk5UJOJKPWjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
|
|
2880
2915
|
};
|
|
2881
2916
|
}
|
|
2882
2917
|
function isolatedCiRuntimeEventReadHeaders() {
|
|
2883
|
-
const schema = _optionalChain([process, 'access',
|
|
2884
|
-
if (_optionalChain([process, 'access',
|
|
2918
|
+
const schema = _optionalChain([process, 'access', _108 => _108.env, 'access', _109 => _109.DEEPLINE_RUNTIME_SCHEDULER_SCHEMA, 'optionalAccess', _110 => _110.trim, 'call', _111 => _111()]);
|
|
2919
|
+
if (_optionalChain([process, 'access', _112 => _112.env, 'access', _113 => _113.DEEPLINE_SYNTHETIC_RUN, 'optionalAccess', _114 => _114.trim, 'call', _115 => _115()]) !== "1" || !schema || !/^fly_absurd_pr_\d+_\d+(?:_\d+)?$/.test(schema)) {
|
|
2885
2920
|
return void 0;
|
|
2886
2921
|
}
|
|
2887
|
-
const token = _optionalChain([process, 'access',
|
|
2922
|
+
const token = _optionalChain([process, 'access', _116 => _116.env, 'access', _117 => _117.DEEPLINE_INTERNAL_TOKEN, 'optionalAccess', _118 => _118.trim, 'call', _119 => _119()]);
|
|
2888
2923
|
if (!token) {
|
|
2889
2924
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
2890
2925
|
"DEEPLINE_INTERNAL_TOKEN is required for isolated CI runtime event reads.",
|
|
@@ -2892,7 +2927,7 @@ function isolatedCiRuntimeEventReadHeaders() {
|
|
|
2892
2927
|
"RUNTIME_EVENT_INTERNAL_TOKEN_REQUIRED"
|
|
2893
2928
|
);
|
|
2894
2929
|
}
|
|
2895
|
-
return { [
|
|
2930
|
+
return { [_chunk5UJOJKPWjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
|
|
2896
2931
|
}
|
|
2897
2932
|
function normalizeTestPolicyOverrides(value, source) {
|
|
2898
2933
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
@@ -2905,8 +2940,8 @@ function normalizeTestPolicyOverrides(value, source) {
|
|
|
2905
2940
|
);
|
|
2906
2941
|
}
|
|
2907
2942
|
function parseEnvTestPolicyOverrides() {
|
|
2908
|
-
const raw = typeof process !== "undefined" ? _optionalChain([process, 'access',
|
|
2909
|
-
const trimmed = _optionalChain([raw, 'optionalAccess',
|
|
2943
|
+
const raw = typeof process !== "undefined" ? _optionalChain([process, 'access', _120 => _120.env, 'optionalAccess', _121 => _121.DEEPLINE_TEST_POLICY_OVERRIDES]) : void 0;
|
|
2944
|
+
const trimmed = _optionalChain([raw, 'optionalAccess', _122 => _122.trim, 'call', _123 => _123()]);
|
|
2910
2945
|
if (!trimmed) return void 0;
|
|
2911
2946
|
let parsed;
|
|
2912
2947
|
try {
|
|
@@ -2934,7 +2969,7 @@ function isTransientCompileManifestError(error) {
|
|
|
2934
2969
|
);
|
|
2935
2970
|
}
|
|
2936
2971
|
function requireCompileManifestResponse(response, playName) {
|
|
2937
|
-
const compilerManifest = _optionalChain([response, 'optionalAccess',
|
|
2972
|
+
const compilerManifest = _optionalChain([response, 'optionalAccess', _124 => _124.compilerManifest]);
|
|
2938
2973
|
if (!compilerManifest || typeof compilerManifest !== "object" || Array.isArray(compilerManifest)) {
|
|
2939
2974
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
2940
2975
|
`Compile manifest response did not include compilerManifest for ${playName}.`,
|
|
@@ -2986,7 +3021,7 @@ function chunkRegisterPlayArtifacts(artifacts) {
|
|
|
2986
3021
|
}
|
|
2987
3022
|
function searchParams(options) {
|
|
2988
3023
|
const params = new URLSearchParams();
|
|
2989
|
-
params.set("q", _nullishCoalesce(_optionalChain([options, 'access',
|
|
3024
|
+
params.set("q", _nullishCoalesce(_optionalChain([options, 'access', _125 => _125.query, 'optionalAccess', _126 => _126.trim, 'call', _127 => _127()]), () => ( "")));
|
|
2990
3025
|
params.set(
|
|
2991
3026
|
"include_search_debug",
|
|
2992
3027
|
options.includeSearchDebug ? "true" : "false"
|
|
@@ -2996,13 +3031,13 @@ function searchParams(options) {
|
|
|
2996
3031
|
if (options.offset !== void 0) {
|
|
2997
3032
|
params.set("offset", String(options.offset));
|
|
2998
3033
|
}
|
|
2999
|
-
if (_optionalChain([options, 'access',
|
|
3034
|
+
if (_optionalChain([options, 'access', _128 => _128.categories, 'optionalAccess', _129 => _129.trim, 'call', _130 => _130()])) {
|
|
3000
3035
|
params.set("categories", options.categories.trim());
|
|
3001
3036
|
}
|
|
3002
|
-
if (_optionalChain([options, 'access',
|
|
3037
|
+
if (_optionalChain([options, 'access', _131 => _131.searchTerms, 'optionalAccess', _132 => _132.trim, 'call', _133 => _133()])) {
|
|
3003
3038
|
params.set("search_terms", options.searchTerms.trim());
|
|
3004
3039
|
}
|
|
3005
|
-
if (_optionalChain([options, 'access',
|
|
3040
|
+
if (_optionalChain([options, 'access', _134 => _134.task, 'optionalAccess', _135 => _135.trim, 'call', _136 => _136()])) params.set("task", options.task.trim());
|
|
3006
3041
|
return params;
|
|
3007
3042
|
}
|
|
3008
3043
|
var RUNS_FAILED_LOG_LIMIT = 20;
|
|
@@ -3041,17 +3076,17 @@ function preferPrebuiltPlayDescriptions(plays) {
|
|
|
3041
3076
|
}
|
|
3042
3077
|
function normalizePlayStatus(raw) {
|
|
3043
3078
|
const runPackage = _chunkLA46MMTLjs.isPlayRunPackage.call(void 0, raw) ? raw : _chunkLA46MMTLjs.isPlayRunPackage.call(void 0, raw.package) ? raw.package : null;
|
|
3044
|
-
const packageRun = _optionalChain([runPackage, 'optionalAccess',
|
|
3045
|
-
const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess',
|
|
3079
|
+
const packageRun = _optionalChain([runPackage, 'optionalAccess', _137 => _137.run]);
|
|
3080
|
+
const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess', _138 => _138.status]) === "string" ? packageRun.status : null;
|
|
3046
3081
|
const status = _chunkLA46MMTLjs.decodePlayRunPublicStatus.call(void 0, rawStatus);
|
|
3047
3082
|
if (!status) {
|
|
3048
3083
|
throw new Error(
|
|
3049
3084
|
`Invalid play run lifecycle status in API response: ${JSON.stringify(rawStatus)}.`
|
|
3050
3085
|
);
|
|
3051
3086
|
}
|
|
3052
|
-
const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess',
|
|
3053
|
-
const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess',
|
|
3054
|
-
const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess',
|
|
3087
|
+
const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess', _139 => _139.id]), () => ( ""));
|
|
3088
|
+
const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _140 => _140.overview]), () => ( raw.overview));
|
|
3089
|
+
const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _141 => _141.runStatus]), () => ( raw.runStatus));
|
|
3055
3090
|
return {
|
|
3056
3091
|
...raw,
|
|
3057
3092
|
runId,
|
|
@@ -3153,9 +3188,9 @@ function playRunResultFromStatus(status, startedAt, fallbackRunId) {
|
|
|
3153
3188
|
runId: status.runId || fallbackRunId,
|
|
3154
3189
|
result: _nullishCoalesce(status.package, () => ( status.result)),
|
|
3155
3190
|
...status.package ? { package: status.package } : {},
|
|
3156
|
-
logs: _nullishCoalesce(_optionalChain([status, 'access',
|
|
3191
|
+
logs: _nullishCoalesce(_optionalChain([status, 'access', _142 => _142.progress, 'optionalAccess', _143 => _143.logs]), () => ( [])),
|
|
3157
3192
|
durationMs: Date.now() - startedAt,
|
|
3158
|
-
error: _nullishCoalesce(_optionalChain([status, 'access',
|
|
3193
|
+
error: _nullishCoalesce(_optionalChain([status, 'access', _144 => _144.progress, 'optionalAccess', _145 => _145.error]), () => ( (status.status !== "completed" ? status.status : void 0)))
|
|
3159
3194
|
};
|
|
3160
3195
|
}
|
|
3161
3196
|
var DeeplineClient = (_class = class _DeeplineClient {
|
|
@@ -3182,12 +3217,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3182
3217
|
* @throws {@link ConfigError} if no API key can be resolved from any source.
|
|
3183
3218
|
*/
|
|
3184
3219
|
constructor(options) {
|
|
3185
|
-
this.config =
|
|
3186
|
-
this.http = new (0,
|
|
3220
|
+
this.config = _chunk5UJOJKPWjs.resolveConfig.call(void 0, options);
|
|
3221
|
+
this.http = new (0, _chunk5UJOJKPWjs.HttpClient)(this.config);
|
|
3187
3222
|
this.toolCalls = new ToolCalls(
|
|
3188
3223
|
this.http,
|
|
3189
3224
|
this.config.timeout,
|
|
3190
|
-
_optionalChain([options, 'optionalAccess',
|
|
3225
|
+
_optionalChain([options, 'optionalAccess', _146 => _146.timeout])
|
|
3191
3226
|
);
|
|
3192
3227
|
this.runs = {
|
|
3193
3228
|
getReceipts: (runId, options2) => this.getRunReceipts(runId, options2),
|
|
@@ -3247,7 +3282,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3247
3282
|
{},
|
|
3248
3283
|
{
|
|
3249
3284
|
"Idempotency-Key": requireBillingIdempotencyKey(
|
|
3250
|
-
_nullishCoalesce(_optionalChain([options2, 'optionalAccess',
|
|
3285
|
+
_nullishCoalesce(_optionalChain([options2, 'optionalAccess', _147 => _147.idempotencyKey]), () => ( globalThis.crypto.randomUUID()))
|
|
3251
3286
|
)
|
|
3252
3287
|
}
|
|
3253
3288
|
),
|
|
@@ -3266,7 +3301,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3266
3301
|
available: (toolIdOrOptions, options2) => this.getMonitorsAvailable(toolIdOrOptions, options2),
|
|
3267
3302
|
check: (definition) => this.checkMonitor(definition),
|
|
3268
3303
|
deploy: (definition, options2) => this.deployMonitor(definition, options2),
|
|
3269
|
-
sync: (definition, options2) => _optionalChain([options2, 'optionalAccess',
|
|
3304
|
+
sync: (definition, options2) => _optionalChain([options2, 'optionalAccess', _148 => _148.dryRun]) ? this.deployMonitor(definition, { dryRun: true }) : this.syncScalarMonitor(definition, options2),
|
|
3270
3305
|
list: (options2) => this.listMonitors(options2),
|
|
3271
3306
|
get: (key) => this.getMonitor(key),
|
|
3272
3307
|
test: (key, payload, options2) => this.testMonitorWebhook(key, payload, options2),
|
|
@@ -3275,13 +3310,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3275
3310
|
update: (key, patch) => this.updateMonitor(key, patch),
|
|
3276
3311
|
delete: (key, options2) => this.deleteMonitor(key, options2),
|
|
3277
3312
|
reactivate: (key, options2) => this.reactivateMonitor(key, options2),
|
|
3278
|
-
start: (key, options2) => _optionalChain([options2, 'optionalAccess',
|
|
3313
|
+
start: (key, options2) => _optionalChain([options2, 'optionalAccess', _149 => _149.dryRun]) ? this.submitMonitorBatch({
|
|
3279
3314
|
kind: "reactivate",
|
|
3280
3315
|
scope: { kind: "keys", monitorKeys: [key] },
|
|
3281
3316
|
dryRun: true,
|
|
3282
3317
|
idempotencyKey: _nullishCoalesce(options2.idempotencyKey, () => ( this.monitorJobIdempotencyKey(`start-${key}`)))
|
|
3283
3318
|
}) : this.submitScalarMonitorLifecycle(key, "start", options2),
|
|
3284
|
-
stop: (key, options2) => _optionalChain([options2, 'optionalAccess',
|
|
3319
|
+
stop: (key, options2) => _optionalChain([options2, 'optionalAccess', _150 => _150.dryRun]) ? this.submitMonitorBatch({
|
|
3285
3320
|
kind: "deactivate",
|
|
3286
3321
|
scope: { kind: "keys", monitorKeys: [key] },
|
|
3287
3322
|
dryRun: true,
|
|
@@ -3332,7 +3367,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3332
3367
|
type: _nullishCoalesce(field.type, () => ( void 0)),
|
|
3333
3368
|
required: _nullishCoalesce(field.required, () => ( void 0))
|
|
3334
3369
|
} : null
|
|
3335
|
-
).filter((field) => Boolean(_optionalChain([field, 'optionalAccess',
|
|
3370
|
+
).filter((field) => Boolean(_optionalChain([field, 'optionalAccess', _151 => _151.name]))) : [];
|
|
3336
3371
|
return fields.length > 0 ? { fields } : schema;
|
|
3337
3372
|
}
|
|
3338
3373
|
schemaMetadata(schema, key) {
|
|
@@ -3362,13 +3397,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3362
3397
|
};
|
|
3363
3398
|
}
|
|
3364
3399
|
summarizePlayListItem(play, options) {
|
|
3365
|
-
const aliases = _optionalChain([play, 'access',
|
|
3400
|
+
const aliases = _optionalChain([play, 'access', _152 => _152.aliases, 'optionalAccess', _153 => _153.length]) ? play.aliases : [play.name];
|
|
3366
3401
|
const csvInput = this.schemaMetadata(play.inputSchema, "csvInput");
|
|
3367
3402
|
const rowOutputSchema = this.schemaMetadata(
|
|
3368
3403
|
play.outputSchema,
|
|
3369
3404
|
"rowOutputSchema"
|
|
3370
3405
|
);
|
|
3371
|
-
const description = _optionalChain([play, 'access',
|
|
3406
|
+
const description = _optionalChain([play, 'access', _154 => _154.description, 'optionalAccess', _155 => _155.trim, 'call', _156 => _156()]) || _optionalChain([play, 'access', _157 => _157.currentRevision, 'optionalAccess', _158 => _158.description, 'optionalAccess', _159 => _159.trim, 'call', _160 => _160()]) || _optionalChain([play, 'access', _161 => _161.liveRevision, 'optionalAccess', _162 => _162.description, 'optionalAccess', _163 => _163.trim, 'call', _164 => _164()]) || null;
|
|
3372
3407
|
const runCommand = this.playRunCommand(play);
|
|
3373
3408
|
const cloneEditStarter = this.playCloneEditStarter(play);
|
|
3374
3409
|
return {
|
|
@@ -3388,9 +3423,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3388
3423
|
canEdit: play.canEdit,
|
|
3389
3424
|
canClone: play.canClone,
|
|
3390
3425
|
aliases,
|
|
3391
|
-
inputSchema: _optionalChain([options, 'optionalAccess',
|
|
3392
|
-
outputSchema: _optionalChain([options, 'optionalAccess',
|
|
3393
|
-
staticPipeline: isRecord2(play.staticPipeline) ? play.staticPipeline : isRecord2(_optionalChain([play, 'access',
|
|
3426
|
+
inputSchema: _optionalChain([options, 'optionalAccess', _165 => _165.compact]) ? this.compactSchema(play.inputSchema) : _nullishCoalesce(play.inputSchema, () => ( null)),
|
|
3427
|
+
outputSchema: _optionalChain([options, 'optionalAccess', _166 => _166.compact]) ? this.compactSchema(play.outputSchema) : _nullishCoalesce(play.outputSchema, () => ( null)),
|
|
3428
|
+
staticPipeline: isRecord2(play.staticPipeline) ? play.staticPipeline : isRecord2(_optionalChain([play, 'access', _167 => _167.currentRevision, 'optionalAccess', _168 => _168.staticPipeline])) ? play.currentRevision.staticPipeline : isRecord2(_optionalChain([play, 'access', _169 => _169.liveRevision, 'optionalAccess', _170 => _170.staticPipeline])) ? play.liveRevision.staticPipeline : null,
|
|
3394
3429
|
...csvInput ? {
|
|
3395
3430
|
csvInput: { ...csvInput, headerMatching: CSV_HEADER_MATCHING_NOTE }
|
|
3396
3431
|
} : {},
|
|
@@ -3402,7 +3437,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3402
3437
|
// Read the live version off the live revision. It was previously only
|
|
3403
3438
|
// ever written by the publish/live routes, so every list and describe
|
|
3404
3439
|
// payload reported liveVersion: null even for an actively serving play.
|
|
3405
|
-
liveVersion: _nullishCoalesce(_optionalChain([play, 'access',
|
|
3440
|
+
liveVersion: _nullishCoalesce(_optionalChain([play, 'access', _171 => _171.liveRevision, 'optionalAccess', _172 => _172.version]), () => ( null)),
|
|
3406
3441
|
...play.triggerStatus ? { triggerStatus: play.triggerStatus } : {},
|
|
3407
3442
|
isDraftDirty: play.isDraftDirty
|
|
3408
3443
|
};
|
|
@@ -3411,8 +3446,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3411
3446
|
const play = detail.play;
|
|
3412
3447
|
return {
|
|
3413
3448
|
...this.summarizePlayListItem(play, options),
|
|
3414
|
-
currentPublishedVersion: _nullishCoalesce(_nullishCoalesce(play.currentPublishedVersion, () => ( _optionalChain([play, 'access',
|
|
3415
|
-
latestRunId: _nullishCoalesce(_nullishCoalesce(play.latestRunId, () => ( _optionalChain([detail, 'access',
|
|
3449
|
+
currentPublishedVersion: _nullishCoalesce(_nullishCoalesce(play.currentPublishedVersion, () => ( _optionalChain([play, 'access', _173 => _173.liveRevision, 'optionalAccess', _174 => _174.version]))), () => ( null)),
|
|
3450
|
+
latestRunId: _nullishCoalesce(_nullishCoalesce(play.latestRunId, () => ( _optionalChain([detail, 'access', _175 => _175.latestRuns, 'access', _176 => _176[0], 'optionalAccess', _177 => _177.workflowId]))), () => ( null)),
|
|
3416
3451
|
...play.triggerMetadata ? { triggerMetadata: play.triggerMetadata } : {},
|
|
3417
3452
|
...play.runtimeLimit ? { runtimeLimit: play.runtimeLimit } : {},
|
|
3418
3453
|
...play.activeScheduledPlays ? { activeScheduledPlays: play.activeScheduledPlays } : {}
|
|
@@ -3479,17 +3514,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3479
3514
|
*/
|
|
3480
3515
|
async listTools(options) {
|
|
3481
3516
|
const params = new URLSearchParams();
|
|
3482
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3517
|
+
if (_optionalChain([options, 'optionalAccess', _178 => _178.categories, 'optionalAccess', _179 => _179.trim, 'call', _180 => _180()])) {
|
|
3483
3518
|
params.set("categories", options.categories.trim());
|
|
3484
3519
|
}
|
|
3485
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3520
|
+
if (_optionalChain([options, 'optionalAccess', _181 => _181.tags, 'optionalAccess', _182 => _182.trim, 'call', _183 => _183()])) {
|
|
3486
3521
|
params.set("tags", options.tags.trim());
|
|
3487
3522
|
}
|
|
3488
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3523
|
+
if (_optionalChain([options, 'optionalAccess', _184 => _184.grep, 'optionalAccess', _185 => _185.trim, 'call', _186 => _186()])) {
|
|
3489
3524
|
params.set("grep", options.grep.trim());
|
|
3490
3525
|
params.set("grep_mode", _nullishCoalesce(options.grepMode, () => ( "all")));
|
|
3491
3526
|
}
|
|
3492
|
-
params.set("compact", _optionalChain([options, 'optionalAccess',
|
|
3527
|
+
params.set("compact", _optionalChain([options, 'optionalAccess', _187 => _187.compact]) === true ? "true" : "false");
|
|
3493
3528
|
const suffix = params.toString() ? `?${params.toString()}` : "";
|
|
3494
3529
|
const res = await this.http.get(
|
|
3495
3530
|
`/api/v2/tools${suffix}`
|
|
@@ -3498,7 +3533,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3498
3533
|
}
|
|
3499
3534
|
/** List discoverable providers without requiring a local plugin catalog. */
|
|
3500
3535
|
async listProviders(options) {
|
|
3501
|
-
const suffix = _optionalChain([options, 'optionalAccess',
|
|
3536
|
+
const suffix = _optionalChain([options, 'optionalAccess', _188 => _188.changed]) ? "?changed=true" : "";
|
|
3502
3537
|
const res = await this.http.get(
|
|
3503
3538
|
`/api/v2/tools/providers${suffix}`
|
|
3504
3539
|
);
|
|
@@ -3529,8 +3564,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3529
3564
|
*/
|
|
3530
3565
|
async search(options = {}) {
|
|
3531
3566
|
const params = searchParams(options);
|
|
3532
|
-
if (_optionalChain([options, 'access',
|
|
3533
|
-
if (_optionalChain([options, 'access',
|
|
3567
|
+
if (_optionalChain([options, 'access', _189 => _189.types, 'optionalAccess', _190 => _190.length])) params.set("types", options.types.join(","));
|
|
3568
|
+
if (_optionalChain([options, 'access', _191 => _191.exclude, 'optionalAccess', _192 => _192.length])) {
|
|
3534
3569
|
params.set("exclude", options.exclude.join(","));
|
|
3535
3570
|
}
|
|
3536
3571
|
return this.http.get(`/api/v2/search?${params.toString()}`);
|
|
@@ -3552,7 +3587,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3552
3587
|
* ```
|
|
3553
3588
|
*/
|
|
3554
3589
|
async getTool(toolId, options) {
|
|
3555
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3590
|
+
if (_optionalChain([options, 'optionalAccess', _193 => _193.cliInvocationId]) !== void 0) {
|
|
3556
3591
|
validateCliInvocationId(options.cliInvocationId);
|
|
3557
3592
|
}
|
|
3558
3593
|
return this.http.request(
|
|
@@ -3565,7 +3600,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3565
3600
|
retryApiErrors: true,
|
|
3566
3601
|
headers: {
|
|
3567
3602
|
"x-deepline-tool-meta-only": "1",
|
|
3568
|
-
..._optionalChain([options, 'optionalAccess',
|
|
3603
|
+
..._optionalChain([options, 'optionalAccess', _194 => _194.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
|
|
3569
3604
|
}
|
|
3570
3605
|
}
|
|
3571
3606
|
);
|
|
@@ -3657,7 +3692,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3657
3692
|
return this.http.post(
|
|
3658
3693
|
"/api/v2/ingestion/repair",
|
|
3659
3694
|
{
|
|
3660
|
-
..._optionalChain([input, 'optionalAccess',
|
|
3695
|
+
..._optionalChain([input, 'optionalAccess', _195 => _195.provider]) ? { provider: input.provider } : {}
|
|
3661
3696
|
}
|
|
3662
3697
|
);
|
|
3663
3698
|
}
|
|
@@ -3727,7 +3762,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3727
3762
|
method: "POST",
|
|
3728
3763
|
body,
|
|
3729
3764
|
headers: runtimeSelectionHeaders(resolved.runtime),
|
|
3730
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
3765
|
+
signal: _optionalChain([options, 'optionalAccess', _196 => _196.signal])
|
|
3731
3766
|
}
|
|
3732
3767
|
)) {
|
|
3733
3768
|
if (event.scope === "play") {
|
|
@@ -3887,7 +3922,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3887
3922
|
compilerManifest,
|
|
3888
3923
|
...input.input ? { input: input.input } : {},
|
|
3889
3924
|
...input.inputFile ? { inputFile: input.inputFile } : {},
|
|
3890
|
-
..._optionalChain([input, 'access',
|
|
3925
|
+
..._optionalChain([input, 'access', _197 => _197.packagedFiles, 'optionalAccess', _198 => _198.length]) ? { packagedFiles: input.packagedFiles } : {},
|
|
3891
3926
|
...input.force ? { force: true } : {},
|
|
3892
3927
|
...input.forceToolRefresh ? { forceToolRefresh: true } : {}
|
|
3893
3928
|
});
|
|
@@ -3917,29 +3952,29 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3917
3952
|
* ```
|
|
3918
3953
|
*/
|
|
3919
3954
|
async submitPlay(code, csvPath, name, options) {
|
|
3920
|
-
const runtimeInput = _optionalChain([options, 'optionalAccess',
|
|
3955
|
+
const runtimeInput = _optionalChain([options, 'optionalAccess', _199 => _199.input]) ? { ...options.input } : {};
|
|
3921
3956
|
if (csvPath) {
|
|
3922
3957
|
runtimeInput.file = csvPath;
|
|
3923
3958
|
}
|
|
3924
|
-
const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3925
|
-
const artifact = _optionalChain([options, 'optionalAccess',
|
|
3926
|
-
if (!_optionalChain([name, 'optionalAccess',
|
|
3959
|
+
const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _200 => _200.sourceCode]), () => ( code));
|
|
3960
|
+
const artifact = _optionalChain([options, 'optionalAccess', _201 => _201.artifact]);
|
|
3961
|
+
if (!_optionalChain([name, 'optionalAccess', _202 => _202.trim, 'call', _203 => _203()])) {
|
|
3927
3962
|
throw new Error("submitPlay requires a play name.");
|
|
3928
3963
|
}
|
|
3929
3964
|
if (!artifact) {
|
|
3930
3965
|
throw new Error("submitPlay requires a bundled play artifact.");
|
|
3931
3966
|
}
|
|
3932
|
-
const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async
|
|
3967
|
+
const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _204 => _204.compilerManifest]), async () => ( await this.compilePlayManifest({
|
|
3933
3968
|
name,
|
|
3934
3969
|
sourceCode,
|
|
3935
|
-
sourceFiles: _optionalChain([options, 'optionalAccess',
|
|
3970
|
+
sourceFiles: _optionalChain([options, 'optionalAccess', _205 => _205.sourceFiles]),
|
|
3936
3971
|
artifact
|
|
3937
3972
|
})));
|
|
3938
3973
|
const registeredArtifact = await this.registerPlayArtifact({
|
|
3939
3974
|
name,
|
|
3940
3975
|
sourceCode,
|
|
3941
|
-
sourceFiles: _optionalChain([options, 'optionalAccess',
|
|
3942
|
-
description: _optionalChain([options, 'optionalAccess',
|
|
3976
|
+
sourceFiles: _optionalChain([options, 'optionalAccess', _206 => _206.sourceFiles]),
|
|
3977
|
+
description: _optionalChain([options, 'optionalAccess', _207 => _207.description]),
|
|
3943
3978
|
artifact,
|
|
3944
3979
|
compilerManifest,
|
|
3945
3980
|
publish: false
|
|
@@ -3953,17 +3988,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3953
3988
|
name,
|
|
3954
3989
|
artifactStorageKey: registeredArtifact.artifactStorageKey,
|
|
3955
3990
|
sourceCode,
|
|
3956
|
-
description: _optionalChain([options, 'optionalAccess',
|
|
3991
|
+
description: _optionalChain([options, 'optionalAccess', _208 => _208.description]),
|
|
3957
3992
|
staticPipeline: _nullishCoalesce(registeredArtifact.staticPipeline, () => ( null)),
|
|
3958
3993
|
artifactHash: typeof artifact.artifactHash === "string" ? artifact.artifactHash : void 0,
|
|
3959
3994
|
graphHash: typeof artifact.graphHash === "string" ? artifact.graphHash : void 0,
|
|
3960
3995
|
runtimeArtifact: artifact,
|
|
3961
3996
|
compilerManifest,
|
|
3962
3997
|
...Object.keys(runtimeInput).length > 0 ? { input: runtimeInput } : {},
|
|
3963
|
-
..._optionalChain([options, 'optionalAccess',
|
|
3964
|
-
..._optionalChain([options, 'optionalAccess',
|
|
3965
|
-
..._optionalChain([options, 'optionalAccess',
|
|
3966
|
-
..._optionalChain([options, 'optionalAccess',
|
|
3998
|
+
..._optionalChain([options, 'optionalAccess', _209 => _209.inputFile]) ? { inputFile: options.inputFile } : {},
|
|
3999
|
+
..._optionalChain([options, 'optionalAccess', _210 => _210.packagedFiles, 'optionalAccess', _211 => _211.length]) ? { packagedFiles: options.packagedFiles } : {},
|
|
4000
|
+
..._optionalChain([options, 'optionalAccess', _212 => _212.force]) ? { force: true } : {},
|
|
4001
|
+
..._optionalChain([options, 'optionalAccess', _213 => _213.forceToolRefresh]) ? { forceToolRefresh: true } : {}
|
|
3967
4002
|
});
|
|
3968
4003
|
}
|
|
3969
4004
|
/**
|
|
@@ -4033,10 +4068,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4033
4068
|
*/
|
|
4034
4069
|
async getPlayStatus(workflowId, options) {
|
|
4035
4070
|
const params = new URLSearchParams();
|
|
4036
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4071
|
+
if (_optionalChain([options, 'optionalAccess', _214 => _214.billing]) === false) {
|
|
4037
4072
|
params.set("billing", "false");
|
|
4038
4073
|
}
|
|
4039
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4074
|
+
if (_optionalChain([options, 'optionalAccess', _215 => _215.full]) === true) {
|
|
4040
4075
|
params.set("full", "true");
|
|
4041
4076
|
}
|
|
4042
4077
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4050,9 +4085,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4050
4085
|
for await (const event of watchRunEvents({
|
|
4051
4086
|
http: this.http,
|
|
4052
4087
|
runId: workflowId,
|
|
4053
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
4054
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
4055
|
-
onRetry: _optionalChain([options, 'optionalAccess',
|
|
4088
|
+
signal: _optionalChain([options, 'optionalAccess', _216 => _216.signal]),
|
|
4089
|
+
onNotice: _optionalChain([options, 'optionalAccess', _217 => _217.onNotice]),
|
|
4090
|
+
onRetry: _optionalChain([options, 'optionalAccess', _218 => _218.onRetry])
|
|
4056
4091
|
})) {
|
|
4057
4092
|
yield event;
|
|
4058
4093
|
}
|
|
@@ -4064,12 +4099,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4064
4099
|
* @deprecated Use `watchRunEvents` for ordinary run watching.
|
|
4065
4100
|
*/
|
|
4066
4101
|
async *streamPlayRunEvents(workflowId, options) {
|
|
4067
|
-
const headers = _optionalChain([options, 'optionalAccess',
|
|
4102
|
+
const headers = _optionalChain([options, 'optionalAccess', _219 => _219.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
|
|
4068
4103
|
const params = new URLSearchParams();
|
|
4069
|
-
params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4104
|
+
params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _220 => _220.mode]), () => ( "cli")));
|
|
4070
4105
|
for await (const event of this.http.streamSse(
|
|
4071
4106
|
`/api/v2/runs/${encodeURIComponent(workflowId)}/tail?${params.toString()}`,
|
|
4072
|
-
{ signal: _optionalChain([options, 'optionalAccess',
|
|
4107
|
+
{ signal: _optionalChain([options, 'optionalAccess', _221 => _221.signal]), headers }
|
|
4073
4108
|
)) {
|
|
4074
4109
|
if (event.scope === "play") {
|
|
4075
4110
|
yield event;
|
|
@@ -4085,24 +4120,24 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4085
4120
|
*/
|
|
4086
4121
|
async *observeRunEvents(runId, options) {
|
|
4087
4122
|
yield* this.watchRunEvents(runId, {
|
|
4088
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
4089
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
4123
|
+
signal: _optionalChain([options, 'optionalAccess', _222 => _222.signal]),
|
|
4124
|
+
onNotice: _optionalChain([options, 'optionalAccess', _223 => _223.onNotice])
|
|
4090
4125
|
});
|
|
4091
4126
|
}
|
|
4092
4127
|
/** Poll snapshots to terminal status and return the durable package. */
|
|
4093
4128
|
async watchRunToTerminal(runId, options) {
|
|
4094
4129
|
let terminalObserved = false;
|
|
4095
4130
|
for await (const event of this.watchRunEvents(runId, {
|
|
4096
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
4097
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
4098
|
-
onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4131
|
+
signal: _optionalChain([options, 'optionalAccess', _224 => _224.signal]),
|
|
4132
|
+
onNotice: _optionalChain([options, 'optionalAccess', _225 => _225.onNotice]),
|
|
4133
|
+
onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _226 => _226.onRetry]), () => ( _optionalChain([options, 'optionalAccess', _227 => _227.onReconnect])))
|
|
4099
4134
|
})) {
|
|
4100
|
-
_optionalChain([options, 'optionalAccess',
|
|
4135
|
+
_optionalChain([options, 'optionalAccess', _228 => _228.onEvent, 'optionalCall', _229 => _229(event)]);
|
|
4101
4136
|
if (_chunkLA46MMTLjs.isTerminalPlayRunLifecycleStatus.call(void 0, playLiveRunStatus(event))) {
|
|
4102
4137
|
terminalObserved = true;
|
|
4103
4138
|
}
|
|
4104
4139
|
}
|
|
4105
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4140
|
+
if (_optionalChain([options, 'optionalAccess', _230 => _230.signal, 'optionalAccess', _231 => _231.aborted])) {
|
|
4106
4141
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)("Run watch aborted.", void 0, "ABORTED");
|
|
4107
4142
|
}
|
|
4108
4143
|
const refreshed = await this.getRunStatus(runId);
|
|
@@ -4156,7 +4191,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4156
4191
|
async stopPlay(workflowId, options) {
|
|
4157
4192
|
return this.http.post(
|
|
4158
4193
|
`/api/v2/runs/${encodeURIComponent(workflowId)}/stop`,
|
|
4159
|
-
_optionalChain([options, 'optionalAccess',
|
|
4194
|
+
_optionalChain([options, 'optionalAccess', _232 => _232.reason]) ? { reason: options.reason } : {}
|
|
4160
4195
|
);
|
|
4161
4196
|
}
|
|
4162
4197
|
/**
|
|
@@ -4192,7 +4227,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4192
4227
|
/** List the org's workflows. `GET /api/v2/workflows`. */
|
|
4193
4228
|
async listWorkflows(options) {
|
|
4194
4229
|
const params = new URLSearchParams();
|
|
4195
|
-
if (typeof _optionalChain([options, 'optionalAccess',
|
|
4230
|
+
if (typeof _optionalChain([options, 'optionalAccess', _233 => _233.limit]) === "number") {
|
|
4196
4231
|
params.set("limit", String(options.limit));
|
|
4197
4232
|
}
|
|
4198
4233
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4245,7 +4280,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4245
4280
|
/** List a workflow's runs. `GET /api/v2/workflows/:id/runs`. */
|
|
4246
4281
|
async listWorkflowRuns(id, options) {
|
|
4247
4282
|
const params = new URLSearchParams();
|
|
4248
|
-
if (typeof _optionalChain([options, 'optionalAccess',
|
|
4283
|
+
if (typeof _optionalChain([options, 'optionalAccess', _234 => _234.limit]) === "number") {
|
|
4249
4284
|
params.set("limit", String(options.limit));
|
|
4250
4285
|
}
|
|
4251
4286
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4281,10 +4316,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4281
4316
|
*/
|
|
4282
4317
|
async getRunStatus(runId, options) {
|
|
4283
4318
|
const params = new URLSearchParams();
|
|
4284
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4319
|
+
if (_optionalChain([options, 'optionalAccess', _235 => _235.full]) === true) {
|
|
4285
4320
|
params.set("full", "true");
|
|
4286
4321
|
}
|
|
4287
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4322
|
+
if (_optionalChain([options, 'optionalAccess', _236 => _236.configuration]) === true) {
|
|
4288
4323
|
params.set("include", "configuration");
|
|
4289
4324
|
}
|
|
4290
4325
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4292,7 +4327,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4292
4327
|
`/api/v2/runs/${encodeURIComponent(runId)}${query}`,
|
|
4293
4328
|
{ headers: { "x-deepline-run-status": "1" } }
|
|
4294
4329
|
);
|
|
4295
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4330
|
+
if (_optionalChain([options, 'optionalAccess', _237 => _237.configuration]) === true && !Object.hasOwn(response, "contract")) {
|
|
4296
4331
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4297
4332
|
"This server does not support recorded configuration reads.",
|
|
4298
4333
|
void 0,
|
|
@@ -4300,7 +4335,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4300
4335
|
);
|
|
4301
4336
|
}
|
|
4302
4337
|
const status = normalizePlayStatus(response);
|
|
4303
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4338
|
+
if (_optionalChain([options, 'optionalAccess', _238 => _238.failedLogs]) !== true || status.status !== "failed") {
|
|
4304
4339
|
return status;
|
|
4305
4340
|
}
|
|
4306
4341
|
const requestedFailedLogLimit = typeof options.failedLogLimit === "number" && Number.isFinite(options.failedLogLimit) ? Math.max(1, Math.floor(options.failedLogLimit)) : RUNS_FAILED_LOG_LIMIT;
|
|
@@ -4389,7 +4424,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4389
4424
|
/** The same tenant-scoped run history searched by the dashboard and CLI. */
|
|
4390
4425
|
async getRunsHistory(options = {}) {
|
|
4391
4426
|
const params = new URLSearchParams();
|
|
4392
|
-
const search = _optionalChain([options, 'access',
|
|
4427
|
+
const search = _optionalChain([options, 'access', _239 => _239.search, 'optionalAccess', _240 => _240.trim, 'call', _241 => _241()]);
|
|
4393
4428
|
if (search && search.length > 200) {
|
|
4394
4429
|
throw new Error("Run search must be at most 200 characters.");
|
|
4395
4430
|
}
|
|
@@ -4415,16 +4450,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4415
4450
|
}
|
|
4416
4451
|
/** Read one run page without discarding server pagination metadata. */
|
|
4417
4452
|
async listRunsPage(options) {
|
|
4418
|
-
const playName = _optionalChain([options, 'access',
|
|
4453
|
+
const playName = _optionalChain([options, 'access', _242 => _242.play, 'optionalAccess', _243 => _243.trim, 'call', _244 => _244()]);
|
|
4419
4454
|
const params = new URLSearchParams();
|
|
4420
4455
|
if (playName) {
|
|
4421
4456
|
params.set("play", playName);
|
|
4422
4457
|
}
|
|
4423
|
-
const status = _optionalChain([options, 'access',
|
|
4458
|
+
const status = _optionalChain([options, 'access', _245 => _245.status, 'optionalAccess', _246 => _246.trim, 'call', _247 => _247()]);
|
|
4424
4459
|
if (status) {
|
|
4425
4460
|
params.set("status", status);
|
|
4426
4461
|
}
|
|
4427
|
-
const node = _optionalChain([options, 'access',
|
|
4462
|
+
const node = _optionalChain([options, 'access', _248 => _248.node, 'optionalAccess', _249 => _249.trim, 'call', _250 => _250()]);
|
|
4428
4463
|
if (node) {
|
|
4429
4464
|
if (!playName)
|
|
4430
4465
|
throw new Error("runs.list options.node requires options.play.");
|
|
@@ -4498,8 +4533,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4498
4533
|
* different key intentionally starts another rerun.
|
|
4499
4534
|
*/
|
|
4500
4535
|
async rerun(runId, options) {
|
|
4501
|
-
const idempotencyKey = _optionalChain([options, 'optionalAccess',
|
|
4502
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4536
|
+
const idempotencyKey = _optionalChain([options, 'optionalAccess', _251 => _251.idempotencyKey, 'optionalAccess', _252 => _252.trim, 'call', _253 => _253()]);
|
|
4537
|
+
if (_optionalChain([options, 'optionalAccess', _254 => _254.idempotencyKey]) !== void 0 && !idempotencyKey) {
|
|
4503
4538
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4504
4539
|
"runs.rerun idempotencyKey must not be empty.",
|
|
4505
4540
|
void 0,
|
|
@@ -4508,7 +4543,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4508
4543
|
}
|
|
4509
4544
|
return this.http.post(
|
|
4510
4545
|
`/api/v2/runs/${encodeURIComponent(runId)}/rerun`,
|
|
4511
|
-
_optionalChain([options, 'optionalAccess',
|
|
4546
|
+
_optionalChain([options, 'optionalAccess', _255 => _255.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
|
|
4512
4547
|
{ "Idempotency-Key": idempotencyKey || globalThis.crypto.randomUUID() }
|
|
4513
4548
|
);
|
|
4514
4549
|
}
|
|
@@ -4522,21 +4557,21 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4522
4557
|
* ```
|
|
4523
4558
|
*/
|
|
4524
4559
|
async getRunLogs(runId, options) {
|
|
4525
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4560
|
+
if (_optionalChain([options, 'optionalAccess', _256 => _256.all]) === true && options.failed === true) {
|
|
4526
4561
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4527
4562
|
"runs.logs cannot combine all and failed views.",
|
|
4528
4563
|
void 0,
|
|
4529
4564
|
"INVALID_RUN_LOG_VIEW"
|
|
4530
4565
|
);
|
|
4531
4566
|
}
|
|
4532
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4567
|
+
if (_optionalChain([options, 'optionalAccess', _257 => _257.cursor]) !== void 0 && options.failed === true) {
|
|
4533
4568
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4534
4569
|
"runs.logs cannot combine failed with cursor.",
|
|
4535
4570
|
void 0,
|
|
4536
4571
|
"INVALID_RUN_LOG_VIEW"
|
|
4537
4572
|
);
|
|
4538
4573
|
}
|
|
4539
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4574
|
+
if (_optionalChain([options, 'optionalAccess', _258 => _258.failed]) === true) {
|
|
4540
4575
|
const requestedLimit = typeof options.limit === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : RUNS_FAILED_LOG_LIMIT;
|
|
4541
4576
|
const failedLimit = Math.min(RUNS_FAILED_LOG_LIMIT, requestedLimit);
|
|
4542
4577
|
const page = await this.http.get(
|
|
@@ -4561,18 +4596,18 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4561
4596
|
...page.logsTruncated ? { logsTruncated: true } : {}
|
|
4562
4597
|
};
|
|
4563
4598
|
}
|
|
4564
|
-
const beforeSequence = _optionalChain([options, 'optionalAccess',
|
|
4565
|
-
const limit = _optionalChain([options, 'optionalAccess',
|
|
4599
|
+
const beforeSequence = _optionalChain([options, 'optionalAccess', _259 => _259.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
|
|
4600
|
+
const limit = _optionalChain([options, 'optionalAccess', _260 => _260.all]) ? Number.MAX_SAFE_INTEGER : typeof _optionalChain([options, 'optionalAccess', _261 => _261.limit]) === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
|
|
4566
4601
|
const fetchPage = (afterSeq2, pageLimit) => this.http.get(
|
|
4567
4602
|
`/api/v2/runs/${encodeURIComponent(runId)}/logs?afterSeq=${afterSeq2}&limit=${pageLimit}`,
|
|
4568
4603
|
{ retryApiErrors: true }
|
|
4569
4604
|
);
|
|
4570
4605
|
const probe = await fetchPage(0, 1);
|
|
4571
4606
|
const lastStoredSeq = probe.lastStoredSeq;
|
|
4572
|
-
const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access',
|
|
4607
|
+
const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _262 => _262.entries, 'access', _263 => _263[0], 'optionalAccess', _264 => _264.seq]), () => ( null));
|
|
4573
4608
|
const upperSeq = beforeSequence === null ? Number.POSITIVE_INFINITY : Math.min(beforeSequence - 1, lastStoredSeq);
|
|
4574
4609
|
const windowEndSeq = Math.min(upperSeq, lastStoredSeq);
|
|
4575
|
-
let afterSeq = _optionalChain([options, 'optionalAccess',
|
|
4610
|
+
let afterSeq = _optionalChain([options, 'optionalAccess', _265 => _265.all]) ? 0 : Math.max(0, windowEndSeq - limit);
|
|
4576
4611
|
const entries = [];
|
|
4577
4612
|
while (entries.length < limit && afterSeq < upperSeq) {
|
|
4578
4613
|
const page = await fetchPage(
|
|
@@ -4606,7 +4641,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4606
4641
|
hasMore: olderLinesExist,
|
|
4607
4642
|
nextCursor: olderLinesExist ? encodeRunLogsCursor(firstSequence) : null,
|
|
4608
4643
|
entries: entries.map((entry) => entry.line),
|
|
4609
|
-
view: _optionalChain([options, 'optionalAccess',
|
|
4644
|
+
view: _optionalChain([options, 'optionalAccess', _266 => _266.all]) ? "all" : "tail",
|
|
4610
4645
|
...probe.logsTruncated ? { logsTruncated: true } : {}
|
|
4611
4646
|
};
|
|
4612
4647
|
}
|
|
@@ -4767,7 +4802,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4767
4802
|
limit: String(_nullishCoalesce(input.limit, () => ( 5e3))),
|
|
4768
4803
|
offset: String(_nullishCoalesce(input.offset, () => ( 0)))
|
|
4769
4804
|
});
|
|
4770
|
-
if (_optionalChain([input, 'access',
|
|
4805
|
+
if (_optionalChain([input, 'access', _267 => _267.runId, 'optionalAccess', _268 => _268.trim, 'call', _269 => _269()])) {
|
|
4771
4806
|
params.set("runId", input.runId.trim());
|
|
4772
4807
|
}
|
|
4773
4808
|
if (input.rowMode === "all" || input.rowMode === "live") {
|
|
@@ -4777,9 +4812,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4777
4812
|
`/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`,
|
|
4778
4813
|
{ signal: input.signal }
|
|
4779
4814
|
);
|
|
4780
|
-
const requestedRunId = _optionalChain([input, 'access',
|
|
4815
|
+
const requestedRunId = _optionalChain([input, 'access', _270 => _270.runId, 'optionalAccess', _271 => _271.trim, 'call', _272 => _272()]) || "";
|
|
4781
4816
|
if (requestedRunId) {
|
|
4782
|
-
const confirmedRunId = _optionalChain([result, 'access',
|
|
4817
|
+
const confirmedRunId = _optionalChain([result, 'access', _273 => _273.scope, 'optionalAccess', _274 => _274.kind]) === "run" ? result.scope.runId.trim() : "";
|
|
4783
4818
|
const foreignRowRunIds = [
|
|
4784
4819
|
...new Set(
|
|
4785
4820
|
result.rows.map(
|
|
@@ -4787,7 +4822,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4787
4822
|
).filter((runId) => runId && runId !== requestedRunId)
|
|
4788
4823
|
)
|
|
4789
4824
|
];
|
|
4790
|
-
if (_optionalChain([result, 'access',
|
|
4825
|
+
if (_optionalChain([result, 'access', _275 => _275.scope, 'optionalAccess', _276 => _276.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
|
|
4791
4826
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4792
4827
|
`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.`,
|
|
4793
4828
|
void 0,
|
|
@@ -4816,7 +4851,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4816
4851
|
async stopRun(runId, options) {
|
|
4817
4852
|
return this.http.post(
|
|
4818
4853
|
`/api/v2/runs/${encodeURIComponent(runId)}/stop`,
|
|
4819
|
-
_optionalChain([options, 'optionalAccess',
|
|
4854
|
+
_optionalChain([options, 'optionalAccess', _277 => _277.reason]) ? { reason: options.reason } : {}
|
|
4820
4855
|
);
|
|
4821
4856
|
}
|
|
4822
4857
|
/**
|
|
@@ -4834,11 +4869,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4834
4869
|
* need to clear the workspace run-slot state without knowing each run id.
|
|
4835
4870
|
*/
|
|
4836
4871
|
async stopAllRuns(options) {
|
|
4837
|
-
const dryRun = _optionalChain([options, 'optionalAccess',
|
|
4872
|
+
const dryRun = _optionalChain([options, 'optionalAccess', _278 => _278.dryRun]) === true;
|
|
4838
4873
|
const result = await this.http.post(
|
|
4839
4874
|
"/api/v2/runs/stop-all",
|
|
4840
4875
|
{
|
|
4841
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4876
|
+
..._optionalChain([options, 'optionalAccess', _279 => _279.reason]) ? { reason: options.reason } : {},
|
|
4842
4877
|
...dryRun ? { dryRun: true } : {}
|
|
4843
4878
|
}
|
|
4844
4879
|
);
|
|
@@ -4859,7 +4894,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4859
4894
|
* `origin: "owned"` for org-owned plays.
|
|
4860
4895
|
*/
|
|
4861
4896
|
async listPlays(options) {
|
|
4862
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
4897
|
+
if (!_optionalChain([options, 'optionalAccess', _280 => _280.grep, 'optionalAccess', _281 => _281.trim, 'call', _282 => _282()])) {
|
|
4863
4898
|
return (await this.requestPlaysPage(options, false)).plays;
|
|
4864
4899
|
}
|
|
4865
4900
|
const plays = [];
|
|
@@ -4881,45 +4916,45 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4881
4916
|
}
|
|
4882
4917
|
async requestPlaysPage(options, paginateInventory = true) {
|
|
4883
4918
|
const params = new URLSearchParams();
|
|
4884
|
-
if (paginateInventory && !_optionalChain([options, 'optionalAccess',
|
|
4919
|
+
if (paginateInventory && !_optionalChain([options, 'optionalAccess', _283 => _283.grep, 'optionalAccess', _284 => _284.trim, 'call', _285 => _285()]))
|
|
4885
4920
|
params.set("inventory_paginated", "1");
|
|
4886
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4887
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4921
|
+
if (_optionalChain([options, 'optionalAccess', _286 => _286.origin])) params.set("origin", options.origin);
|
|
4922
|
+
if (_optionalChain([options, 'optionalAccess', _287 => _287.categories])) {
|
|
4888
4923
|
params.set(
|
|
4889
4924
|
"categories",
|
|
4890
4925
|
Array.isArray(options.categories) ? options.categories.join(",") : options.categories
|
|
4891
4926
|
);
|
|
4892
4927
|
}
|
|
4893
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4928
|
+
if (_optionalChain([options, 'optionalAccess', _288 => _288.categories]) || _optionalChain([options, 'optionalAccess', _289 => _289.includeToolCategories])) {
|
|
4894
4929
|
params.set("include_tool_categories", "1");
|
|
4895
4930
|
}
|
|
4896
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4931
|
+
if (_optionalChain([options, 'optionalAccess', _290 => _290.tags])) {
|
|
4897
4932
|
params.set(
|
|
4898
4933
|
"tags",
|
|
4899
4934
|
Array.isArray(options.tags) ? options.tags.join(",") : options.tags
|
|
4900
4935
|
);
|
|
4901
4936
|
}
|
|
4902
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4903
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4937
|
+
if (_optionalChain([options, 'optionalAccess', _291 => _291.includeArchived])) params.set("include_archived", "1");
|
|
4938
|
+
if (_optionalChain([options, 'optionalAccess', _292 => _292.includeCostEstimates])) {
|
|
4904
4939
|
params.set("include_cost_estimates", "1");
|
|
4905
4940
|
}
|
|
4906
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4941
|
+
if (_optionalChain([options, 'optionalAccess', _293 => _293.grep, 'optionalAccess', _294 => _294.trim, 'call', _295 => _295()])) {
|
|
4907
4942
|
params.set("grep", options.grep.trim());
|
|
4908
4943
|
params.set("limit", "60");
|
|
4909
4944
|
}
|
|
4910
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4945
|
+
if (_optionalChain([options, 'optionalAccess', _296 => _296.limit]) !== void 0) {
|
|
4911
4946
|
if (!Number.isSafeInteger(options.limit) || options.limit < 1) {
|
|
4912
4947
|
throw new Error("Play page limit must be a positive integer");
|
|
4913
4948
|
}
|
|
4914
4949
|
params.set("limit", String(options.limit));
|
|
4915
4950
|
}
|
|
4916
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4951
|
+
if (_optionalChain([options, 'optionalAccess', _297 => _297.cursor])) params.set("cursor", options.cursor);
|
|
4917
4952
|
const suffix = params.size ? `?${params.toString()}` : "";
|
|
4918
4953
|
const response = await this.http.get(`/api/v2/plays${suffix}`);
|
|
4919
4954
|
return {
|
|
4920
4955
|
plays: _nullishCoalesce(response.plays, () => ( [])),
|
|
4921
|
-
cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access',
|
|
4922
|
-
hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access',
|
|
4956
|
+
cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _298 => _298.pagination, 'optionalAccess', _299 => _299.cursor]), () => ( response.cursor)), () => ( null)),
|
|
4957
|
+
hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _300 => _300.pagination, 'optionalAccess', _301 => _301.hasMore]), () => ( response.hasMore)))
|
|
4923
4958
|
};
|
|
4924
4959
|
}
|
|
4925
4960
|
/** Read definition-level settings, independently of code revisions. */
|
|
@@ -4969,8 +5004,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4969
5004
|
return this.http.post("/api/v2/integrations/connect", {
|
|
4970
5005
|
provider: "slack",
|
|
4971
5006
|
scopes: [...PRODUCT_NOTIFICATION_SLACK_OAUTH_SCOPES],
|
|
4972
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4973
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5007
|
+
..._optionalChain([options, 'optionalAccess', _302 => _302.successUrl]) ? { success_url: options.successUrl } : {},
|
|
5008
|
+
..._optionalChain([options, 'optionalAccess', _303 => _303.failureUrl]) ? { failure_url: options.failureUrl } : {}
|
|
4974
5009
|
});
|
|
4975
5010
|
}
|
|
4976
5011
|
/** List Slack channels visible to the connected Deepline Slack app. */
|
|
@@ -5045,7 +5080,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5045
5080
|
}
|
|
5046
5081
|
const targets = input.targets.map(parseNotificationGroupTarget);
|
|
5047
5082
|
const legacyEvents = _nullishCoalesce(input.legacyEvents, () => ( []));
|
|
5048
|
-
const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access',
|
|
5083
|
+
const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _304 => _304[0], 'optionalAccess', _305 => _305.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
|
|
5049
5084
|
if (legacyEvents.length > 0 && !legacyTarget) {
|
|
5050
5085
|
throw new Error(
|
|
5051
5086
|
"--for is supported only by the legacy one-Slack-target form. Create the group first, then add rules in notification configuration."
|
|
@@ -5081,7 +5116,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5081
5116
|
const existingGroup = current.configuration.groups.find(
|
|
5082
5117
|
(candidate) => candidate.name.toLowerCase() === name.toLowerCase()
|
|
5083
5118
|
);
|
|
5084
|
-
const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess',
|
|
5119
|
+
const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _306 => _306.groupKey]), () => ( notificationObjectKey("group")));
|
|
5085
5120
|
const group = _nullishCoalesce(existingGroup, () => ( {
|
|
5086
5121
|
groupKey,
|
|
5087
5122
|
name,
|
|
@@ -5299,13 +5334,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5299
5334
|
*/
|
|
5300
5335
|
async getPlay(name, options) {
|
|
5301
5336
|
const encodedName = encodeURIComponent(name);
|
|
5302
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
5337
|
+
const query = _optionalChain([options, 'optionalAccess', _307 => _307.source]) ? `?include=source&revision=${encodeURIComponent(options.source)}` : _optionalChain([options, 'optionalAccess', _308 => _308.guidance]) ? "?include=guidance" : "";
|
|
5303
5338
|
return this.http.get(`/api/v2/plays/${encodedName}${query}`);
|
|
5304
5339
|
}
|
|
5305
5340
|
/** Read one trigger inventory page without loading run histories. */
|
|
5306
5341
|
async listPlayTriggerInventory(options) {
|
|
5307
5342
|
const params = new URLSearchParams({ view: "inventory" });
|
|
5308
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5343
|
+
if (_optionalChain([options, 'optionalAccess', _309 => _309.cursor])) params.set("cursor", options.cursor);
|
|
5309
5344
|
return this.http.get(`/api/v2/plays/triggers?${params}`);
|
|
5310
5345
|
}
|
|
5311
5346
|
/** Read one trigger's recent runs, with an explicit partial-history flag. */
|
|
@@ -5314,7 +5349,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5314
5349
|
view: "history",
|
|
5315
5350
|
binding_id: bindingId
|
|
5316
5351
|
});
|
|
5317
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5352
|
+
if (_optionalChain([options, 'optionalAccess', _310 => _310.limit]) !== void 0)
|
|
5318
5353
|
params.set("history_limit", String(options.limit));
|
|
5319
5354
|
return this.http.get(`/api/v2/plays/triggers?${params}`);
|
|
5320
5355
|
}
|
|
@@ -5350,7 +5385,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5350
5385
|
*/
|
|
5351
5386
|
async listPlayVersions(name, options) {
|
|
5352
5387
|
const encodedName = encodeURIComponent(name);
|
|
5353
|
-
const suffix = _optionalChain([options, 'optionalAccess',
|
|
5388
|
+
const suffix = _optionalChain([options, 'optionalAccess', _311 => _311.full]) ? "?full=true" : "";
|
|
5354
5389
|
const response = await this.http.get(
|
|
5355
5390
|
`/api/v2/plays/${encodedName}/versions${suffix}`
|
|
5356
5391
|
);
|
|
@@ -5503,14 +5538,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5503
5538
|
*/
|
|
5504
5539
|
async runPlay(code, csvPath, name, options) {
|
|
5505
5540
|
const { workflowId } = await this.submitPlay(code, csvPath, name, {
|
|
5506
|
-
input: _optionalChain([options, 'optionalAccess',
|
|
5507
|
-
sourceCode: _optionalChain([options, 'optionalAccess',
|
|
5508
|
-
artifact: _optionalChain([options, 'optionalAccess',
|
|
5509
|
-
compilerManifest: _optionalChain([options, 'optionalAccess',
|
|
5510
|
-
inputFile: _optionalChain([options, 'optionalAccess',
|
|
5511
|
-
packagedFiles: _optionalChain([options, 'optionalAccess',
|
|
5512
|
-
force: _optionalChain([options, 'optionalAccess',
|
|
5513
|
-
forceToolRefresh: _optionalChain([options, 'optionalAccess',
|
|
5541
|
+
input: _optionalChain([options, 'optionalAccess', _312 => _312.input]),
|
|
5542
|
+
sourceCode: _optionalChain([options, 'optionalAccess', _313 => _313.sourceCode]),
|
|
5543
|
+
artifact: _optionalChain([options, 'optionalAccess', _314 => _314.artifact]),
|
|
5544
|
+
compilerManifest: _optionalChain([options, 'optionalAccess', _315 => _315.compilerManifest]),
|
|
5545
|
+
inputFile: _optionalChain([options, 'optionalAccess', _316 => _316.inputFile]),
|
|
5546
|
+
packagedFiles: _optionalChain([options, 'optionalAccess', _317 => _317.packagedFiles]),
|
|
5547
|
+
force: _optionalChain([options, 'optionalAccess', _318 => _318.force]),
|
|
5548
|
+
forceToolRefresh: _optionalChain([options, 'optionalAccess', _319 => _319.forceToolRefresh])
|
|
5514
5549
|
});
|
|
5515
5550
|
const start = Date.now();
|
|
5516
5551
|
const state = {
|
|
@@ -5521,7 +5556,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5521
5556
|
latest: null
|
|
5522
5557
|
};
|
|
5523
5558
|
let terminalObserved = null;
|
|
5524
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5559
|
+
if (_optionalChain([options, 'optionalAccess', _320 => _320.signal, 'optionalAccess', _321 => _321.aborted])) {
|
|
5525
5560
|
await this.cancelPlay(workflowId);
|
|
5526
5561
|
return {
|
|
5527
5562
|
success: false,
|
|
@@ -5532,9 +5567,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5532
5567
|
};
|
|
5533
5568
|
}
|
|
5534
5569
|
for await (const event of this.watchRunEvents(workflowId, {
|
|
5535
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
5570
|
+
signal: _optionalChain([options, 'optionalAccess', _322 => _322.signal])
|
|
5536
5571
|
})) {
|
|
5537
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5572
|
+
if (_optionalChain([options, 'optionalAccess', _323 => _323.signal, 'optionalAccess', _324 => _324.aborted])) {
|
|
5538
5573
|
await this.cancelPlay(workflowId);
|
|
5539
5574
|
return {
|
|
5540
5575
|
success: false,
|
|
@@ -5544,19 +5579,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5544
5579
|
error: "Cancelled by user"
|
|
5545
5580
|
};
|
|
5546
5581
|
}
|
|
5547
|
-
const previousStatus = _optionalChain([state, 'access',
|
|
5582
|
+
const previousStatus = _optionalChain([state, 'access', _325 => _325.latest, 'optionalAccess', _326 => _326.status]);
|
|
5548
5583
|
const status = updatePlayLiveStatusState(state, event);
|
|
5549
5584
|
if (!status) {
|
|
5550
5585
|
continue;
|
|
5551
5586
|
}
|
|
5552
5587
|
if (event.type !== "play.run.status" || status.status !== previousStatus) {
|
|
5553
|
-
_optionalChain([options, 'optionalAccess',
|
|
5588
|
+
_optionalChain([options, 'optionalAccess', _327 => _327.onProgress, 'optionalCall', _328 => _328(status)]);
|
|
5554
5589
|
}
|
|
5555
5590
|
if (_chunkLA46MMTLjs.isTerminalPlayRunLifecycleStatus.call(void 0, status.status)) {
|
|
5556
5591
|
terminalObserved = status;
|
|
5557
5592
|
}
|
|
5558
5593
|
}
|
|
5559
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5594
|
+
if (_optionalChain([options, 'optionalAccess', _329 => _329.signal, 'optionalAccess', _330 => _330.aborted])) {
|
|
5560
5595
|
await this.cancelPlay(workflowId);
|
|
5561
5596
|
return {
|
|
5562
5597
|
success: false,
|
|
@@ -5609,7 +5644,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5609
5644
|
const response = await this.http.get(
|
|
5610
5645
|
`/api/v2/usage/events?request_id=${encodeURIComponent(normalizedRequestId)}`
|
|
5611
5646
|
);
|
|
5612
|
-
const event = _optionalChain([response, 'access',
|
|
5647
|
+
const event = _optionalChain([response, 'access', _331 => _331.entries, 'optionalAccess', _332 => _332[0]]);
|
|
5613
5648
|
if (!event) {
|
|
5614
5649
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
5615
5650
|
"No usage event was found for this request_id.",
|
|
@@ -5740,7 +5775,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5740
5775
|
async cancelBillingSubscription(options) {
|
|
5741
5776
|
return this.http.post(
|
|
5742
5777
|
"/api/v2/billing/subscription/cancel",
|
|
5743
|
-
{ action: _optionalChain([options, 'optionalAccess',
|
|
5778
|
+
{ action: _optionalChain([options, 'optionalAccess', _333 => _333.undo]) ? "undo_cancel" : "cancel" }
|
|
5744
5779
|
);
|
|
5745
5780
|
}
|
|
5746
5781
|
/**
|
|
@@ -5752,7 +5787,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5752
5787
|
*/
|
|
5753
5788
|
async listBillingInvoices(options) {
|
|
5754
5789
|
const params = new URLSearchParams();
|
|
5755
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5790
|
+
if (_optionalChain([options, 'optionalAccess', _334 => _334.limit]) !== void 0) {
|
|
5756
5791
|
params.set("limit", String(options.limit));
|
|
5757
5792
|
}
|
|
5758
5793
|
const suffix = Array.from(params).length > 0 ? `?${params.toString()}` : "";
|
|
@@ -5862,7 +5897,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5862
5897
|
/** Create a Stripe-hosted portal session for payment recovery and invoices. */
|
|
5863
5898
|
async createTargetBillingPortalSession(options) {
|
|
5864
5899
|
const response = await this.http.post(
|
|
5865
|
-
_optionalChain([options, 'optionalAccess',
|
|
5900
|
+
_optionalChain([options, 'optionalAccess', _335 => _335.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
|
|
5866
5901
|
{}
|
|
5867
5902
|
);
|
|
5868
5903
|
return response.data;
|
|
@@ -5912,8 +5947,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5912
5947
|
return this.http.request("/api/v2/monitors/audit", {
|
|
5913
5948
|
method: "POST",
|
|
5914
5949
|
body: {
|
|
5915
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5916
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5950
|
+
..._optionalChain([options, 'optionalAccess', _336 => _336.fleetId]) ? { fleet_id: options.fleetId } : {},
|
|
5951
|
+
..._optionalChain([options, 'optionalAccess', _337 => _337.cursor]) ? { cursor: options.cursor } : {}
|
|
5917
5952
|
},
|
|
5918
5953
|
maxRetries: 0
|
|
5919
5954
|
});
|
|
@@ -5923,8 +5958,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5923
5958
|
return this.http.request("/api/v2/monitors/repair", {
|
|
5924
5959
|
method: "POST",
|
|
5925
5960
|
body: {
|
|
5926
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5927
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5961
|
+
..._optionalChain([options, 'optionalAccess', _338 => _338.fleetId]) ? { fleet_id: options.fleetId } : {},
|
|
5962
|
+
..._optionalChain([options, 'optionalAccess', _339 => _339.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
|
|
5928
5963
|
},
|
|
5929
5964
|
maxRetries: 0
|
|
5930
5965
|
});
|
|
@@ -5932,7 +5967,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5932
5967
|
/** Delivery and convergence health. Prefer `client.monitors.health(...)`. */
|
|
5933
5968
|
async readMonitorsHealth(options) {
|
|
5934
5969
|
const params = new URLSearchParams();
|
|
5935
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5970
|
+
if (_optionalChain([options, 'optionalAccess', _340 => _340.fleetId])) params.set("fleet_id", options.fleetId);
|
|
5936
5971
|
const query = params.toString();
|
|
5937
5972
|
const suffix = query ? `?${query}` : "";
|
|
5938
5973
|
return this.http.request(
|
|
@@ -6005,7 +6040,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6005
6040
|
);
|
|
6006
6041
|
}
|
|
6007
6042
|
const params = new URLSearchParams();
|
|
6008
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6043
|
+
if (_optionalChain([options, 'optionalAccess', _341 => _341.cursor])) params.set("cursor", options.cursor);
|
|
6009
6044
|
const suffix = params.size > 0 ? `?${params}` : "";
|
|
6010
6045
|
return this.http.request(
|
|
6011
6046
|
`/api/v2/monitors/batch/${encodeURIComponent(runId)}${suffix}`,
|
|
@@ -6049,7 +6084,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6049
6084
|
* `client.monitors.deploy(...)`.
|
|
6050
6085
|
*/
|
|
6051
6086
|
async deployMonitor(definition, options) {
|
|
6052
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6087
|
+
if (_optionalChain([options, 'optionalAccess', _342 => _342.dryRun])) {
|
|
6053
6088
|
return this.http.request("/api/v2/monitors/check", {
|
|
6054
6089
|
method: "POST",
|
|
6055
6090
|
body: definition
|
|
@@ -6085,12 +6120,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6085
6120
|
/** List deployed monitors. Prefer `client.monitors.list(...)`. */
|
|
6086
6121
|
async listMonitors(options) {
|
|
6087
6122
|
const params = new URLSearchParams();
|
|
6088
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6089
|
-
else if (_optionalChain([options, 'optionalAccess',
|
|
6090
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6123
|
+
if (_optionalChain([options, 'optionalAccess', _343 => _343.state])) params.set("state", options.state);
|
|
6124
|
+
else if (_optionalChain([options, 'optionalAccess', _344 => _344.status])) params.set("status", options.status);
|
|
6125
|
+
if (_optionalChain([options, 'optionalAccess', _345 => _345.limit]) !== void 0)
|
|
6091
6126
|
params.set("limit", String(options.limit));
|
|
6092
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6093
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6127
|
+
if (_optionalChain([options, 'optionalAccess', _346 => _346.cursor])) params.set("cursor", options.cursor);
|
|
6128
|
+
if (_optionalChain([options, 'optionalAccess', _347 => _347.includeConsumers])) params.set("include_consumers", "true");
|
|
6094
6129
|
const query = params.toString();
|
|
6095
6130
|
const suffix = query ? `?${query}` : "";
|
|
6096
6131
|
return this.http.request(
|
|
@@ -6106,7 +6141,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6106
6141
|
);
|
|
6107
6142
|
}
|
|
6108
6143
|
async testMonitorWebhook(key, payload, options) {
|
|
6109
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6144
|
+
if (_optionalChain([options, 'optionalAccess', _348 => _348.dispatch]) === true || _optionalChain([options, 'optionalAccess', _349 => _349.validationOnly]) === false) {
|
|
6110
6145
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
6111
6146
|
"Monitor tests are validation-only and cannot dispatch events.",
|
|
6112
6147
|
void 0,
|
|
@@ -6161,7 +6196,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6161
6196
|
}
|
|
6162
6197
|
/** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
|
|
6163
6198
|
async deleteMonitor(key, options) {
|
|
6164
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6199
|
+
if (_optionalChain([options, 'optionalAccess', _350 => _350.localOnly]) === true) {
|
|
6165
6200
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
6166
6201
|
"localOnly monitor deletion is no longer supported. Monitor deletion always deprovisions the upstream provider resource.",
|
|
6167
6202
|
void 0,
|
|
@@ -6169,11 +6204,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6169
6204
|
);
|
|
6170
6205
|
}
|
|
6171
6206
|
const params = new URLSearchParams();
|
|
6172
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6207
|
+
if (_optionalChain([options, 'optionalAccess', _351 => _351.dryRun])) params.set("dry_run", "true");
|
|
6173
6208
|
const query = params.toString();
|
|
6174
6209
|
return this.http.request(
|
|
6175
6210
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
|
|
6176
|
-
_optionalChain([options, 'optionalAccess',
|
|
6211
|
+
_optionalChain([options, 'optionalAccess', _352 => _352.dryRun]) ? { method: "DELETE" } : {
|
|
6177
6212
|
method: "DELETE",
|
|
6178
6213
|
// Deletion is a provider lifecycle operation. A timeout is an
|
|
6179
6214
|
// unknown outcome, not authority to begin another delete attempt.
|
|
@@ -6186,10 +6221,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6186
6221
|
* Prefer `client.monitors.reactivate(...)`.
|
|
6187
6222
|
*/
|
|
6188
6223
|
async reactivateMonitor(key, options) {
|
|
6189
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
6224
|
+
const query = _optionalChain([options, 'optionalAccess', _353 => _353.dryRun]) ? "?dry_run=true" : "";
|
|
6190
6225
|
return this.http.request(
|
|
6191
6226
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
|
|
6192
|
-
_optionalChain([options, 'optionalAccess',
|
|
6227
|
+
_optionalChain([options, 'optionalAccess', _354 => _354.dryRun]) ? { method: "POST", body: {} } : {
|
|
6193
6228
|
method: "POST",
|
|
6194
6229
|
body: {},
|
|
6195
6230
|
// Reactivation can create an upstream resource, so it must not use
|
|
@@ -6203,7 +6238,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6203
6238
|
// ——————————————————————————————————————————————————————————
|
|
6204
6239
|
static __initStatic() {this.MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH = 96}
|
|
6205
6240
|
monitorJobIdempotencyKey(operation) {
|
|
6206
|
-
const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access',
|
|
6241
|
+
const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _355 => _355.crypto, 'optionalAccess', _356 => _356.randomUUID, 'optionalCall', _357 => _357()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
|
|
6207
6242
|
const prefix = "monitor-job-";
|
|
6208
6243
|
const safeOperation = operation.replace(/[^A-Za-z0-9._-]/g, "-");
|
|
6209
6244
|
const maxOperationLength = Math.max(
|
|
@@ -6214,7 +6249,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6214
6249
|
}
|
|
6215
6250
|
monitorJobHeaders(operation, idempotencyKey) {
|
|
6216
6251
|
return {
|
|
6217
|
-
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess',
|
|
6252
|
+
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _358 => _358.trim, 'call', _359 => _359()]) || this.monitorJobIdempotencyKey(operation)
|
|
6218
6253
|
};
|
|
6219
6254
|
}
|
|
6220
6255
|
async deployMonitorBatch(definitions, options) {
|
|
@@ -6225,7 +6260,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6225
6260
|
body: { version: 1, kind: "batch", monitors: definitions },
|
|
6226
6261
|
headers: this.monitorJobHeaders(
|
|
6227
6262
|
"batch-deploy",
|
|
6228
|
-
_optionalChain([options, 'optionalAccess',
|
|
6263
|
+
_optionalChain([options, 'optionalAccess', _360 => _360.idempotencyKey])
|
|
6229
6264
|
),
|
|
6230
6265
|
maxRetries: 0,
|
|
6231
6266
|
exactUrlOnly: true
|
|
@@ -6244,11 +6279,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6244
6279
|
version: 1,
|
|
6245
6280
|
kind: "batch",
|
|
6246
6281
|
monitors: definitions,
|
|
6247
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6282
|
+
..._optionalChain([options, 'optionalAccess', _361 => _361.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
|
|
6248
6283
|
},
|
|
6249
6284
|
headers: this.monitorJobHeaders(
|
|
6250
6285
|
`batch-sync-${batchId}`,
|
|
6251
|
-
_optionalChain([options, 'optionalAccess',
|
|
6286
|
+
_optionalChain([options, 'optionalAccess', _362 => _362.idempotencyKey])
|
|
6252
6287
|
),
|
|
6253
6288
|
maxRetries: 0,
|
|
6254
6289
|
exactUrlOnly: true
|
|
@@ -6263,7 +6298,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6263
6298
|
body: {},
|
|
6264
6299
|
headers: this.monitorJobHeaders(
|
|
6265
6300
|
`batch-start-${batchId}`,
|
|
6266
|
-
_optionalChain([options, 'optionalAccess',
|
|
6301
|
+
_optionalChain([options, 'optionalAccess', _363 => _363.idempotencyKey])
|
|
6267
6302
|
),
|
|
6268
6303
|
maxRetries: 0,
|
|
6269
6304
|
exactUrlOnly: true
|
|
@@ -6278,7 +6313,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6278
6313
|
body: {},
|
|
6279
6314
|
headers: this.monitorJobHeaders(
|
|
6280
6315
|
`batch-stop-${batchId}`,
|
|
6281
|
-
_optionalChain([options, 'optionalAccess',
|
|
6316
|
+
_optionalChain([options, 'optionalAccess', _364 => _364.idempotencyKey])
|
|
6282
6317
|
),
|
|
6283
6318
|
maxRetries: 0,
|
|
6284
6319
|
exactUrlOnly: true
|
|
@@ -6299,7 +6334,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6299
6334
|
body: {},
|
|
6300
6335
|
headers: this.monitorJobHeaders(
|
|
6301
6336
|
`${action}-${monitorKey}`,
|
|
6302
|
-
_optionalChain([options, 'optionalAccess',
|
|
6337
|
+
_optionalChain([options, 'optionalAccess', _365 => _365.idempotencyKey])
|
|
6303
6338
|
),
|
|
6304
6339
|
maxRetries: 0,
|
|
6305
6340
|
exactUrlOnly: true
|
|
@@ -6312,7 +6347,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6312
6347
|
body: definition,
|
|
6313
6348
|
headers: this.monitorJobHeaders(
|
|
6314
6349
|
`sync-${definition.key}`,
|
|
6315
|
-
_optionalChain([options, 'optionalAccess',
|
|
6350
|
+
_optionalChain([options, 'optionalAccess', _366 => _366.idempotencyKey])
|
|
6316
6351
|
),
|
|
6317
6352
|
maxRetries: 0,
|
|
6318
6353
|
exactUrlOnly: true
|
|
@@ -6325,7 +6360,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6325
6360
|
);
|
|
6326
6361
|
}
|
|
6327
6362
|
async getMonitorJobLogs(jobId, options) {
|
|
6328
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
6363
|
+
const query = _optionalChain([options, 'optionalAccess', _367 => _367.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
|
|
6329
6364
|
return this.http.request(
|
|
6330
6365
|
`/api/v2/monitors/jobs/${encodeURIComponent(jobId)}/logs${query}`,
|
|
6331
6366
|
{ method: "GET" }
|
|
@@ -6338,15 +6373,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6338
6373
|
);
|
|
6339
6374
|
}
|
|
6340
6375
|
async waitForMonitorJob(jobId, options) {
|
|
6341
|
-
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6342
|
-
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6376
|
+
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _368 => _368.timeoutMs]), () => ( 10 * 6e4)));
|
|
6377
|
+
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _369 => _369.pollIntervalMs]), () => ( 2e3)));
|
|
6343
6378
|
const terminal = /* @__PURE__ */ new Set(["succeeded", "failed", "cancelled"]);
|
|
6344
6379
|
const startedAt = Date.now();
|
|
6345
6380
|
let latest = await this.getMonitorJob(jobId);
|
|
6346
6381
|
while (true) {
|
|
6347
|
-
_optionalChain([options, 'optionalAccess',
|
|
6382
|
+
_optionalChain([options, 'optionalAccess', _370 => _370.onProgress, 'optionalCall', _371 => _371(latest)]);
|
|
6348
6383
|
const job = latest.job;
|
|
6349
|
-
const state = typeof _optionalChain([job, 'optionalAccess',
|
|
6384
|
+
const state = typeof _optionalChain([job, 'optionalAccess', _372 => _372.state]) === "string" ? job.state : void 0;
|
|
6350
6385
|
if (state && terminal.has(state)) return latest;
|
|
6351
6386
|
if (Date.now() - startedAt >= timeoutMs) return latest;
|
|
6352
6387
|
await sleep(pollIntervalMs);
|
|
@@ -6357,12 +6392,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6357
6392
|
// Monitor Fleets
|
|
6358
6393
|
// ——————————————————————————————————————————————————————————
|
|
6359
6394
|
monitorFleetIdempotencyKey(operation) {
|
|
6360
|
-
const uuid = _optionalChain([globalThis, 'access',
|
|
6395
|
+
const uuid = _optionalChain([globalThis, 'access', _373 => _373.crypto, 'optionalAccess', _374 => _374.randomUUID, 'optionalCall', _375 => _375()]);
|
|
6361
6396
|
return `monitor-fleet-${operation}-${_nullishCoalesce(uuid, () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`;
|
|
6362
6397
|
}
|
|
6363
6398
|
monitorFleetHeaders(operation, idempotencyKey) {
|
|
6364
6399
|
return {
|
|
6365
|
-
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess',
|
|
6400
|
+
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _376 => _376.trim, 'call', _377 => _377()]) || this.monitorFleetIdempotencyKey(operation)
|
|
6366
6401
|
};
|
|
6367
6402
|
}
|
|
6368
6403
|
monitorFleetPath(fleetId) {
|
|
@@ -6382,15 +6417,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6382
6417
|
const fleetId = typeof definitionOrId === "string" ? definitionOrId : definitionOrId.id;
|
|
6383
6418
|
const body = {
|
|
6384
6419
|
...typeof definitionOrId === "string" ? {} : { definition: definitionOrId },
|
|
6385
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6386
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6420
|
+
..._optionalChain([options, 'optionalAccess', _378 => _378.dryRun]) ? { dry_run: true } : {},
|
|
6421
|
+
..._optionalChain([options, 'optionalAccess', _379 => _379.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
|
|
6387
6422
|
};
|
|
6388
6423
|
return this.http.request(
|
|
6389
6424
|
this.monitorFleetPath(fleetId),
|
|
6390
6425
|
{
|
|
6391
6426
|
method: "PUT",
|
|
6392
6427
|
body,
|
|
6393
|
-
headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess',
|
|
6428
|
+
headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _380 => _380.idempotencyKey])),
|
|
6394
6429
|
maxRetries: 0,
|
|
6395
6430
|
exactUrlOnly: true
|
|
6396
6431
|
}
|
|
@@ -6403,8 +6438,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6403
6438
|
}
|
|
6404
6439
|
async getMonitorFleet(fleetId, options) {
|
|
6405
6440
|
const params = new URLSearchParams();
|
|
6406
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6407
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6441
|
+
if (_optionalChain([options, 'optionalAccess', _381 => _381.drift])) params.set("drift", "1");
|
|
6442
|
+
if (_optionalChain([options, 'optionalAccess', _382 => _382.limit]) !== void 0)
|
|
6408
6443
|
params.set("limit", String(options.limit));
|
|
6409
6444
|
const query = params.toString();
|
|
6410
6445
|
return this.http.request(
|
|
@@ -6417,10 +6452,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6417
6452
|
this.monitorFleetPath(fleetId),
|
|
6418
6453
|
{
|
|
6419
6454
|
method: "DELETE",
|
|
6420
|
-
body: _optionalChain([options, 'optionalAccess',
|
|
6455
|
+
body: _optionalChain([options, 'optionalAccess', _383 => _383.dryRun]) ? { dry_run: true } : {},
|
|
6421
6456
|
headers: this.monitorFleetHeaders(
|
|
6422
6457
|
"deactivate",
|
|
6423
|
-
_optionalChain([options, 'optionalAccess',
|
|
6458
|
+
_optionalChain([options, 'optionalAccess', _384 => _384.idempotencyKey])
|
|
6424
6459
|
),
|
|
6425
6460
|
maxRetries: 0,
|
|
6426
6461
|
exactUrlOnly: true
|
|
@@ -6435,7 +6470,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6435
6470
|
body: {},
|
|
6436
6471
|
headers: this.monitorFleetHeaders(
|
|
6437
6472
|
"reactivate",
|
|
6438
|
-
_optionalChain([options, 'optionalAccess',
|
|
6473
|
+
_optionalChain([options, 'optionalAccess', _385 => _385.idempotencyKey])
|
|
6439
6474
|
),
|
|
6440
6475
|
maxRetries: 0,
|
|
6441
6476
|
exactUrlOnly: true
|
|
@@ -6452,13 +6487,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6452
6487
|
* identical to "the request failed".
|
|
6453
6488
|
*/
|
|
6454
6489
|
async waitForMonitorFleetConvergence(fleetId, options) {
|
|
6455
|
-
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6456
|
-
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6457
|
-
const terminal = _optionalChain([options, 'optionalAccess',
|
|
6490
|
+
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _386 => _386.timeoutMs]), () => ( 10 * 6e4)));
|
|
6491
|
+
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _387 => _387.pollIntervalMs]), () => ( 2e3)));
|
|
6492
|
+
const terminal = _optionalChain([options, 'optionalAccess', _388 => _388.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded"]) : /* @__PURE__ */ new Set(["converged", "degraded", "deactivated"]);
|
|
6458
6493
|
const startedAt = Date.now();
|
|
6459
6494
|
let latest = await this.getMonitorFleet(fleetId);
|
|
6460
6495
|
while (true) {
|
|
6461
|
-
_optionalChain([options, 'optionalAccess',
|
|
6496
|
+
_optionalChain([options, 'optionalAccess', _389 => _389.onProgress, 'optionalCall', _390 => _390(latest)]);
|
|
6462
6497
|
const status = typeof latest.status === "string" ? latest.status : void 0;
|
|
6463
6498
|
if (status && terminal.has(status)) return latest;
|
|
6464
6499
|
if (Date.now() - startedAt >= timeoutMs) return latest;
|