deepline 0.3.304 → 0.3.306
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/cli-invocation-id.ts +14 -0
- package/dist/bundling-sources/sdk/src/client.ts +24 -1
- package/dist/bundling-sources/sdk/src/http.ts +11 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/tool-calls.ts +19 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-pool.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +51 -25
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +10 -0
- package/dist/bundling-sources/shared_libs/product-notifications/billing-sales.ts +13 -0
- package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +69 -0
- package/dist/bundling-sources/shared_libs/product-notifications/default-policy.ts +26 -1
- package/dist/bundling-sources/shared_libs/product-notifications/events.ts +9 -1
- package/dist/cli/{auth-YKJHKHIQ.mjs → auth-WTC7LCQ6.mjs} +4 -4
- package/dist/cli/auth-ZT3UF33R.js +31 -0
- package/dist/cli/{billing-EOIKAZES.js → billing-3DYTHO32.js} +70 -70
- package/dist/cli/{billing-XEEW5SV2.mjs → billing-VQM65LVP.mjs} +4 -4
- package/dist/cli/chunk-2IKIG333.js +65 -0
- package/dist/cli/{chunk-NC4JXVVS.js → chunk-2KR56MPF.js} +2 -2
- package/dist/cli/{chunk-7QV545D7.mjs → chunk-4PSSDZQB.mjs} +7 -1
- package/dist/cli/{chunk-NW7I3LDU.mjs → chunk-5HS5EEFE.mjs} +3 -3
- package/dist/cli/{chunk-35SCWK4Y.mjs → chunk-5V56XCQN.mjs} +1 -1
- package/dist/cli/{chunk-JKY2QANB.mjs → chunk-6CRUYVU7.mjs} +4 -4
- package/dist/cli/{chunk-IHT6XITB.mjs → chunk-7XORS6WQ.mjs} +2 -2
- package/dist/cli/{chunk-7HYH533G.mjs → chunk-FJ3DANI4.mjs} +1 -1
- package/dist/cli/{chunk-KP5TOAI4.js → chunk-FZNO6B4W.js} +6 -6
- package/dist/cli/{chunk-JZWC4ES6.mjs → chunk-LLGF6V6I.mjs} +44 -8
- package/dist/cli/{chunk-DOCDA2YP.js → chunk-M6HCRRV2.js} +10 -4
- package/dist/cli/{chunk-BBXO7APG.js → chunk-MMNZ6GBT.js} +6 -6
- package/dist/cli/{chunk-INOSSTSG.js → chunk-OF7QP2XX.js} +15 -15
- package/dist/cli/{chunk-ZQSQCHG3.js → chunk-OZIFVQRY.js} +1 -1
- package/dist/cli/{chunk-FDEU7UY7.js → chunk-PHNAFCSB.js} +275 -239
- package/dist/cli/{chunk-TABL2Q6H.mjs → chunk-QDC4XTO3.mjs} +2 -2
- package/dist/cli/{chunk-DNBJRKVE.js → chunk-RODIZCGU.js} +60 -60
- package/dist/cli/{chunk-NJS3RHQO.js → chunk-SZQPJW2L.js} +6 -6
- package/dist/cli/{chunk-7NQJDQPH.js → chunk-U37SW6IK.js} +48 -48
- package/dist/cli/chunk-UABLQKTZ.mjs +65 -0
- package/dist/cli/{chunk-AOUGAM72.mjs → chunk-UT3VLSLM.mjs} +5 -5
- package/dist/cli/{chunk-USJBSNRI.js → chunk-W7ELTWDM.js} +26 -26
- package/dist/cli/{chunk-YJ2QYYB5.mjs → chunk-WV64SNDV.mjs} +1 -1
- package/dist/cli/{chunk-7OXXCRGZ.mjs → chunk-WWPI4GJI.mjs} +1 -1
- package/dist/cli/{client-FZPHVNWV.mjs → client-DCEK34D5.mjs} +3 -3
- package/dist/cli/client-UQXVU2T6.js +20 -0
- package/dist/cli/{csv-ANJ4KSHF.js → csv-H42JDJ6G.js} +12 -12
- package/dist/cli/{csv-CCHVZPRD.mjs → csv-LXBF5UIV.mjs} +3 -3
- package/dist/cli/{db-JFVR6STL.mjs → db-3O5CFLNP.mjs} +4 -4
- package/dist/cli/{db-AE3MLMRF.js → db-DP5GU4MU.js} +20 -20
- package/dist/cli/{executions-DGX53UEW.js → executions-5FFTPHEX.js} +6 -6
- package/dist/cli/{executions-WNXCURLN.mjs → executions-QC2UZKIP.mjs} +4 -4
- package/dist/cli/{feedback-L4A66OA2.mjs → feedback-JCGE6JFW.mjs} +3 -3
- package/dist/cli/{feedback-DGEFG6JI.js → feedback-XAU3FI5S.js} +6 -6
- package/dist/cli/git-CNO2UFZE.js +23 -0
- package/dist/cli/{git-LIZ3FGVR.mjs → git-S3Y3E2NL.mjs} +4 -4
- package/dist/cli/index.js +155 -121
- package/dist/cli/index.mjs +121 -87
- package/dist/cli/{legacy-noops-UCKGOSJA.mjs → legacy-noops-FQF2IRVS.mjs} +4 -4
- package/dist/cli/{legacy-noops-L7GGGAOR.js → legacy-noops-TXOUX4FX.js} +7 -7
- package/dist/cli/{monitors-NGACMMWV.js → monitors-4BQCO6B7.js} +85 -85
- package/dist/cli/{monitors-NLMFDD4C.mjs → monitors-F3PELPSH.mjs} +4 -4
- package/dist/cli/{org-2OW6TPHF.mjs → org-ER5J3ATG.mjs} +4 -4
- package/dist/cli/{org-FJSCZ6S3.js → org-VQM6OOLK.js} +60 -60
- package/dist/cli/{play-ZZ4AQLL5.mjs → play-B5H2RN4N.mjs} +6 -6
- package/dist/cli/{play-GJC4AIAX.js → play-WKZPAOW3.js} +200 -200
- package/dist/cli/{providers-D7KLXB4S.js → providers-5TEA2FJG.js} +7 -7
- package/dist/cli/{providers-6BJNJUSG.mjs → providers-6ODEAYC2.mjs} +4 -4
- package/dist/cli/{quickstart-FH4NGHEJ.mjs → quickstart-BCYT7BCY.mjs} +3 -3
- package/dist/cli/{quickstart-6WYRYZJZ.js → quickstart-GJYCNMFC.js} +5 -5
- package/dist/cli/{search-KOSJMN3U.js → search-KKJ535OX.js} +6 -6
- package/dist/cli/{search-SUT5XFI6.mjs → search-RY547KOT.mjs} +5 -5
- package/dist/cli/{secrets-Y2OI2P7O.js → secrets-RFGDXSEW.js} +13 -13
- package/dist/cli/{secrets-QK5QP4YU.mjs → secrets-U42ZEYIU.mjs} +4 -4
- package/dist/cli/{sessions-VQKZHOQJ.mjs → sessions-YWEFB62D.mjs} +4 -4
- package/dist/cli/{sessions-MLDROWXY.js → sessions-ZRTWHMIH.js} +5 -5
- package/dist/cli/{settings-SPUINZYG.mjs → settings-AS4U6NVP.mjs} +7 -7
- package/dist/cli/{settings-6WOSPHBC.js → settings-XUWFXIL7.js} +74 -74
- package/dist/cli/{setup-ZE2SDMC4.mjs → setup-2GUIV2EW.mjs} +6 -6
- package/dist/cli/{setup-E2UJV6PW.js → setup-2QPWP2FI.js} +41 -41
- package/dist/cli/skills-4E5KYW2Y.js +28 -0
- package/dist/cli/{skills-OJYRPY2N.mjs → skills-5QS7ERVF.mjs} +4 -4
- package/dist/cli/{tools-BNHRVKLA.js → tools-J47LIO2H.js} +120 -87
- package/dist/cli/{tools-O6EIDEKW.mjs → tools-PVWSGCZD.mjs} +76 -43
- package/dist/cli/update-GZKGOMKD.js +28 -0
- package/dist/cli/{update-NWESWMYF.mjs → update-KS4TRSZI.mjs} +6 -6
- package/dist/cli/{workflow-SAJAOPYE.js → workflow-HQRUUTTL.js} +15 -15
- package/dist/cli/{workflow-YJHXDD57.mjs → workflow-QCLR7GVC.mjs} +5 -5
- package/dist/{client-Me88eH3z.d.mts → client-Dj8MAkDc.d.mts} +91 -1
- package/dist/{client-DjJfoW8r.d.ts → client-DsrFGXJf.d.ts} +91 -1
- 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 +74 -70
- 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-UBWZC26A.js +0 -31
- package/dist/cli/client-IMFLPCD7.js +0 -20
- package/dist/cli/git-6QWUB6CR.js +0 -23
- package/dist/cli/skills-J3QIHO5L.js +0 -28
- package/dist/cli/update-TDOIF3C4.js +0 -28
|
@@ -14,7 +14,7 @@ var _chunkLA46MMTLjs = require('./chunk-LA46MMTL.js');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkM6HCRRV2js = require('./chunk-M6HCRRV2.js');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
@@ -172,6 +172,18 @@ function usesExtendedBetterContactLauncherBudget(toolId) {
|
|
|
172
172
|
return BETTERCONTACT_LAUNCHER_TOOL_IDS.has(toolId.trim().toLowerCase());
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
+
// src/cli-invocation-id.ts
|
|
176
|
+
var CLI_INVOCATION_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
177
|
+
function validateCliInvocationId(value) {
|
|
178
|
+
if (!CLI_INVOCATION_ID_PATTERN.test(value)) {
|
|
179
|
+
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
180
|
+
"CLI invocation IDs must be UUID v4 values.",
|
|
181
|
+
void 0,
|
|
182
|
+
"CLI_INVOCATION_ID_INVALID"
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
175
187
|
// src/tool-calls.ts
|
|
176
188
|
var INCLUDE_TOOL_METADATA_HEADER = "x-deepline-include-tool-metadata";
|
|
177
189
|
var EXECUTE_RESPONSE_CONTRACT_HEADER = "x-deepline-execute-response-contract";
|
|
@@ -305,27 +317,34 @@ var ToolCalls = class {
|
|
|
305
317
|
this.configuredRequestTimeoutMs = configuredRequestTimeoutMs;
|
|
306
318
|
}
|
|
307
319
|
async call(toolId, input, options) {
|
|
320
|
+
if (_optionalChain([options, 'optionalAccess', _5 => _5.cliInvocationId]) !== void 0) {
|
|
321
|
+
validateCliInvocationId(options.cliInvocationId);
|
|
322
|
+
}
|
|
308
323
|
const inputSnapshot = JSON.parse(JSON.stringify(input));
|
|
309
|
-
const metadataSnapshot = _optionalChain([options, 'optionalAccess',
|
|
310
|
-
const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
324
|
+
const metadataSnapshot = _optionalChain([options, 'optionalAccess', _6 => _6.metadata]) ? JSON.parse(JSON.stringify(options.metadata)) : void 0;
|
|
325
|
+
const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _7 => _7.idempotencyKey]), () => ( (_optionalChain([options, 'optionalAccess', _8 => _8.recover]) ? crypto.randomUUID() : void 0)));
|
|
311
326
|
if (idempotencyKey !== void 0) {
|
|
312
327
|
validateExecutionIdempotencyKey(idempotencyKey);
|
|
313
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
328
|
+
if (_optionalChain([options, 'optionalAccess', _9 => _9.recoveryTimeoutMs]) !== void 0 && (!Number.isFinite(options.recoveryTimeoutMs) || options.recoveryTimeoutMs < 0)) {
|
|
314
329
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
315
330
|
"recoveryTimeoutMs must be a finite, non-negative number.",
|
|
316
331
|
void 0,
|
|
317
332
|
"IDEMPOTENCY_KEY_INVALID"
|
|
318
333
|
);
|
|
319
334
|
}
|
|
320
|
-
await _optionalChain([options, 'optionalAccess',
|
|
335
|
+
await _optionalChain([options, 'optionalAccess', _10 => _10.onExecution, 'optionalCall', _11 => _11({ idempotencyKey })]);
|
|
321
336
|
}
|
|
322
|
-
const timeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
337
|
+
const timeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _12 => _12.timeout]), () => ( resolveToolExecuteTimeoutMs(
|
|
323
338
|
toolId,
|
|
324
339
|
inputSnapshot,
|
|
325
340
|
this.configuredRequestTimeoutMs
|
|
326
341
|
)));
|
|
327
342
|
if (idempotencyKey !== void 0) {
|
|
328
|
-
await this.lookupExecutionByKey(
|
|
343
|
+
await this.lookupExecutionByKey(
|
|
344
|
+
idempotencyKey,
|
|
345
|
+
timeoutMs,
|
|
346
|
+
_optionalChain([options, 'optionalAccess', _13 => _13.cliInvocationId])
|
|
347
|
+
);
|
|
329
348
|
}
|
|
330
349
|
const isApifySync = toolId.trim().toLowerCase() === "apify_run_actor_sync";
|
|
331
350
|
const headers = {
|
|
@@ -334,10 +353,11 @@ var ToolCalls = class {
|
|
|
334
353
|
[_chunk7P5AA3SNjs.TOOL_EXECUTION_ERROR_SCHEMA_HEADER]: String(
|
|
335
354
|
_chunk7P5AA3SNjs.TOOL_EXECUTION_ERROR_SCHEMA_VERSION
|
|
336
355
|
),
|
|
337
|
-
..._optionalChain([options, 'optionalAccess',
|
|
338
|
-
[EXECUTE_RESPONSE_INTENT_HEADER]: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
356
|
+
..._optionalChain([options, 'optionalAccess', _14 => _14.includeToolMetadata]) ? { [INCLUDE_TOOL_METADATA_HEADER]: "true" } : {},
|
|
357
|
+
[EXECUTE_RESPONSE_INTENT_HEADER]: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _15 => _15.responseIntent]), () => ( "raw")),
|
|
339
358
|
...idempotencyKey ? { "Idempotency-Key": idempotencyKey } : {},
|
|
340
|
-
..._optionalChain([options, 'optionalAccess',
|
|
359
|
+
..._optionalChain([options, 'optionalAccess', _16 => _16.searchRef]) ? { "x-deepline-search-ref": options.searchRef } : {},
|
|
360
|
+
..._optionalChain([options, 'optionalAccess', _17 => _17.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
|
|
341
361
|
};
|
|
342
362
|
const request = (requestTimeoutMs) => this.http.post(
|
|
343
363
|
`/api/v2/integrations/${encodeURIComponent(toolId)}/execute`,
|
|
@@ -348,8 +368,8 @@ var ToolCalls = class {
|
|
|
348
368
|
headers,
|
|
349
369
|
{
|
|
350
370
|
timeout: requestTimeoutMs,
|
|
351
|
-
maxRetries: idempotencyKey ? 0 : _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
352
|
-
retryApiErrors: _optionalChain([options, 'optionalAccess',
|
|
371
|
+
maxRetries: idempotencyKey ? 0 : _nullishCoalesce(_optionalChain([options, 'optionalAccess', _18 => _18.maxRetries]), () => ( 0)),
|
|
372
|
+
retryApiErrors: _optionalChain([options, 'optionalAccess', _19 => _19.retryApiErrors]) === true,
|
|
353
373
|
exactUrlOnly: true,
|
|
354
374
|
toolId,
|
|
355
375
|
idempotencyKey
|
|
@@ -357,7 +377,7 @@ var ToolCalls = class {
|
|
|
357
377
|
);
|
|
358
378
|
let response;
|
|
359
379
|
let recoveryDeadline = null;
|
|
360
|
-
const recoveryTimeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
380
|
+
const recoveryTimeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _20 => _20.recoveryTimeoutMs]), () => ( DEFAULT_EXECUTION_RECOVERY_TIMEOUT_MS));
|
|
361
381
|
let retryDelayMs = 1e3;
|
|
362
382
|
const recoveryTimeoutError = () => executionRecoveryError({
|
|
363
383
|
toolId,
|
|
@@ -384,7 +404,8 @@ var ToolCalls = class {
|
|
|
384
404
|
timeoutMs,
|
|
385
405
|
this.defaultRequestTimeoutMs,
|
|
386
406
|
remainingMs
|
|
387
|
-
)
|
|
407
|
+
),
|
|
408
|
+
_optionalChain([options, 'optionalAccess', _21 => _21.cliInvocationId])
|
|
388
409
|
);
|
|
389
410
|
} catch (error) {
|
|
390
411
|
if (!isRecoverableExecutionLookupError(error)) throw error;
|
|
@@ -464,7 +485,7 @@ var ToolCalls = class {
|
|
|
464
485
|
}
|
|
465
486
|
return result;
|
|
466
487
|
}
|
|
467
|
-
async lookupExecutionByKey(idempotencyKey, timeoutMs) {
|
|
488
|
+
async lookupExecutionByKey(idempotencyKey, timeoutMs, cliInvocationId) {
|
|
468
489
|
validateExecutionIdempotencyKey(idempotencyKey);
|
|
469
490
|
let supported = false;
|
|
470
491
|
const result = await this.http.get(
|
|
@@ -475,6 +496,7 @@ var ToolCalls = class {
|
|
|
475
496
|
timeout: timeoutMs,
|
|
476
497
|
idempotencyKey,
|
|
477
498
|
allowNotFound: true,
|
|
499
|
+
...cliInvocationId !== void 0 ? { headers: { "x-deepline-cli-invocation-id": cliInvocationId } } : {},
|
|
478
500
|
onResponse: (response) => {
|
|
479
501
|
supported = response.headers.get("X-Deepline-Idempotency-Supported") === "true";
|
|
480
502
|
}
|
|
@@ -1609,10 +1631,10 @@ function getStepStatusSignature(snapshot) {
|
|
|
1609
1631
|
_nullishCoalesce(state.artifactTableNamespace, () => ( "")),
|
|
1610
1632
|
_nullishCoalesce(state.startedAt, () => ( "")),
|
|
1611
1633
|
_nullishCoalesce(state.completedAt, () => ( "")),
|
|
1612
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
1613
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
1634
|
+
_nullishCoalesce(_optionalChain([state, 'access', _22 => _22.progress, 'optionalAccess', _23 => _23.startedAt]), () => ( "")),
|
|
1635
|
+
_nullishCoalesce(_optionalChain([state, 'access', _24 => _24.progress, 'optionalAccess', _25 => _25.completedAt]), () => ( "")),
|
|
1614
1636
|
_nullishCoalesce(state.updatedAt, () => ( "")),
|
|
1615
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
1637
|
+
_nullishCoalesce(_optionalChain([state, 'access', _26 => _26.progress, 'optionalAccess', _27 => _27.updatedAt]), () => ( ""))
|
|
1616
1638
|
].join(":")
|
|
1617
1639
|
).join("|");
|
|
1618
1640
|
}
|
|
@@ -1620,14 +1642,14 @@ function getStepProgressSignature(snapshot) {
|
|
|
1620
1642
|
return snapshot.nodeStates.map(
|
|
1621
1643
|
(state) => [
|
|
1622
1644
|
state.nodeId,
|
|
1623
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
1624
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
1625
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
1626
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
1627
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
1628
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
1629
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
1630
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
1645
|
+
_nullishCoalesce(_optionalChain([state, 'access', _28 => _28.progress, 'optionalAccess', _29 => _29.completed]), () => ( "")),
|
|
1646
|
+
_nullishCoalesce(_optionalChain([state, 'access', _30 => _30.progress, 'optionalAccess', _31 => _31.total]), () => ( "")),
|
|
1647
|
+
_nullishCoalesce(_optionalChain([state, 'access', _32 => _32.progress, 'optionalAccess', _33 => _33.failed]), () => ( "")),
|
|
1648
|
+
_nullishCoalesce(_optionalChain([state, 'access', _34 => _34.progress, 'optionalAccess', _35 => _35.artifactTableNamespace]), () => ( "")),
|
|
1649
|
+
_nullishCoalesce(_optionalChain([state, 'access', _36 => _36.progress, 'optionalAccess', _37 => _37.startedAt]), () => ( "")),
|
|
1650
|
+
_nullishCoalesce(_optionalChain([state, 'access', _38 => _38.progress, 'optionalAccess', _39 => _39.completedAt]), () => ( "")),
|
|
1651
|
+
_nullishCoalesce(_optionalChain([state, 'access', _40 => _40.progress, 'optionalAccess', _41 => _41.updatedAt]), () => ( "")),
|
|
1652
|
+
_nullishCoalesce(_optionalChain([state, 'access', _42 => _42.progress, 'optionalAccess', _43 => _43.message]), () => ( ""))
|
|
1631
1653
|
].join(":")
|
|
1632
1654
|
).join("|");
|
|
1633
1655
|
}
|
|
@@ -1697,8 +1719,8 @@ function diffPlayRunStreamEvents(input) {
|
|
|
1697
1719
|
if (state.status === "idle") {
|
|
1698
1720
|
continue;
|
|
1699
1721
|
}
|
|
1700
|
-
const persistedStartedAt = _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access',
|
|
1701
|
-
const persistedCompletedAt = _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access',
|
|
1722
|
+
const persistedStartedAt = _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _44 => _44.progress, 'optionalAccess', _45 => _45.startedAt]))), () => ( null));
|
|
1723
|
+
const persistedCompletedAt = _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _46 => _46.progress, 'optionalAccess', _47 => _47.completedAt]))), () => ( null));
|
|
1702
1724
|
events.push(
|
|
1703
1725
|
makeRunStreamEvent({
|
|
1704
1726
|
cursor,
|
|
@@ -1712,7 +1734,7 @@ function diffPlayRunStreamEvents(input) {
|
|
|
1712
1734
|
...resolveTimingWindow({
|
|
1713
1735
|
startedAt: persistedStartedAt,
|
|
1714
1736
|
completedAt: persistedCompletedAt,
|
|
1715
|
-
updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access',
|
|
1737
|
+
updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _48 => _48.progress, 'optionalAccess', _49 => _49.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
|
|
1716
1738
|
})
|
|
1717
1739
|
}
|
|
1718
1740
|
})
|
|
@@ -1772,9 +1794,9 @@ function diffPlayRunStreamEvents(input) {
|
|
|
1772
1794
|
if (next.snapshotSignature !== previous.snapshotSignature) {
|
|
1773
1795
|
const enrichedNodeStates = snapshot.nodeStates.map((state) => {
|
|
1774
1796
|
const timing = resolveTimingWindow({
|
|
1775
|
-
startedAt: _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access',
|
|
1776
|
-
completedAt: _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access',
|
|
1777
|
-
updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access',
|
|
1797
|
+
startedAt: _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _50 => _50.progress, 'optionalAccess', _51 => _51.startedAt]))), () => ( null)),
|
|
1798
|
+
completedAt: _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _52 => _52.progress, 'optionalAccess', _53 => _53.completedAt]))), () => ( null)),
|
|
1799
|
+
updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _54 => _54.progress, 'optionalAccess', _55 => _55.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
|
|
1778
1800
|
});
|
|
1779
1801
|
return {
|
|
1780
1802
|
...state,
|
|
@@ -1833,18 +1855,18 @@ function isTransientPlayRunReadError(error) {
|
|
|
1833
1855
|
// src/runs/watch-polling.ts
|
|
1834
1856
|
var RUN_WATCH_POLL_INTERVAL_MS = 2e3;
|
|
1835
1857
|
function waitForNextPoll(ms, signal) {
|
|
1836
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
1858
|
+
if (_optionalChain([signal, 'optionalAccess', _56 => _56.aborted])) {
|
|
1837
1859
|
return Promise.resolve(false);
|
|
1838
1860
|
}
|
|
1839
1861
|
return new Promise((resolve) => {
|
|
1840
1862
|
const finish = (elapsed) => {
|
|
1841
1863
|
clearTimeout(timeout);
|
|
1842
|
-
_optionalChain([signal, 'optionalAccess',
|
|
1864
|
+
_optionalChain([signal, 'optionalAccess', _57 => _57.removeEventListener, 'call', _58 => _58("abort", onAbort)]);
|
|
1843
1865
|
resolve(elapsed);
|
|
1844
1866
|
};
|
|
1845
1867
|
const onAbort = () => finish(false);
|
|
1846
1868
|
const timeout = setTimeout(() => finish(true), ms);
|
|
1847
|
-
_optionalChain([signal, 'optionalAccess',
|
|
1869
|
+
_optionalChain([signal, 'optionalAccess', _59 => _59.addEventListener, 'call', _60 => _60("abort", onAbort, { once: true })]);
|
|
1848
1870
|
});
|
|
1849
1871
|
}
|
|
1850
1872
|
function readSnapshotResponse(response, runId) {
|
|
@@ -1901,7 +1923,7 @@ async function* watchRunEvents(options) {
|
|
|
1901
1923
|
let previous = EMPTY_PLAY_RUN_STREAM_DIFF_STATE;
|
|
1902
1924
|
let consecutiveFailures = 0;
|
|
1903
1925
|
let outageNoticeSent = false;
|
|
1904
|
-
while (!_optionalChain([signal, 'optionalAccess',
|
|
1926
|
+
while (!_optionalChain([signal, 'optionalAccess', _61 => _61.aborted])) {
|
|
1905
1927
|
const pollStartedAt = Date.now();
|
|
1906
1928
|
let snapshot;
|
|
1907
1929
|
try {
|
|
@@ -1914,7 +1936,7 @@ async function* watchRunEvents(options) {
|
|
|
1914
1936
|
signal
|
|
1915
1937
|
});
|
|
1916
1938
|
} catch (error) {
|
|
1917
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
1939
|
+
if (_optionalChain([signal, 'optionalAccess', _62 => _62.aborted])) {
|
|
1918
1940
|
return;
|
|
1919
1941
|
}
|
|
1920
1942
|
if (!isTransientPlayRunReadError(error)) {
|
|
@@ -1923,12 +1945,12 @@ async function* watchRunEvents(options) {
|
|
|
1923
1945
|
consecutiveFailures += 1;
|
|
1924
1946
|
const reason = error instanceof Error ? error.message : String(error);
|
|
1925
1947
|
if (!outageNoticeSent) {
|
|
1926
|
-
_optionalChain([options, 'access',
|
|
1948
|
+
_optionalChain([options, 'access', _63 => _63.onRetry, 'optionalCall', _64 => _64({
|
|
1927
1949
|
attempt: consecutiveFailures,
|
|
1928
1950
|
delayMs: pollIntervalMs,
|
|
1929
1951
|
reason
|
|
1930
1952
|
})]);
|
|
1931
|
-
_optionalChain([options, 'access',
|
|
1953
|
+
_optionalChain([options, 'access', _65 => _65.onNotice, 'optionalCall', _66 => _66(
|
|
1932
1954
|
`[watch] run snapshot request failed; retrying every ${pollIntervalMs / 1e3}s (${reason})`
|
|
1933
1955
|
)]);
|
|
1934
1956
|
outageNoticeSent = true;
|
|
@@ -1943,7 +1965,7 @@ async function* watchRunEvents(options) {
|
|
|
1943
1965
|
continue;
|
|
1944
1966
|
}
|
|
1945
1967
|
if (outageNoticeSent) {
|
|
1946
|
-
_optionalChain([options, 'access',
|
|
1968
|
+
_optionalChain([options, 'access', _67 => _67.onNotice, 'optionalCall', _68 => _68("[watch] run snapshot polling recovered")]);
|
|
1947
1969
|
outageNoticeSent = false;
|
|
1948
1970
|
}
|
|
1949
1971
|
consecutiveFailures = 0;
|
|
@@ -2053,7 +2075,7 @@ function parseNotificationGroupTarget(value) {
|
|
|
2053
2075
|
}
|
|
2054
2076
|
return { kind: "email", email };
|
|
2055
2077
|
}
|
|
2056
|
-
const slack = _optionalChain([/^slack:(.+)$/i, 'access',
|
|
2078
|
+
const slack = _optionalChain([/^slack:(.+)$/i, 'access', _69 => _69.exec, 'call', _70 => _70(normalized), 'optionalAccess', _71 => _71[1], 'optionalAccess', _72 => _72.trim, 'call', _73 => _73()]);
|
|
2057
2079
|
if (!slack) {
|
|
2058
2080
|
const provider = normalized.split(":", 1)[0] || normalized;
|
|
2059
2081
|
throw new Error(
|
|
@@ -2061,7 +2083,7 @@ function parseNotificationGroupTarget(value) {
|
|
|
2061
2083
|
);
|
|
2062
2084
|
}
|
|
2063
2085
|
const member = /^member:([UW][A-Z0-9]{8,})$/i.exec(slack);
|
|
2064
|
-
if (_optionalChain([member, 'optionalAccess',
|
|
2086
|
+
if (_optionalChain([member, 'optionalAccess', _74 => _74[1]])) {
|
|
2065
2087
|
return { kind: "slack", memberId: member[1].toUpperCase() };
|
|
2066
2088
|
}
|
|
2067
2089
|
if (slack.toLowerCase().startsWith("member:")) {
|
|
@@ -2108,10 +2130,10 @@ function resolvePlayRunRuntimeSelection(request) {
|
|
|
2108
2130
|
}
|
|
2109
2131
|
return runtime;
|
|
2110
2132
|
}
|
|
2111
|
-
const configured = _optionalChain([process, 'access',
|
|
2112
|
-
const configuredNamespace = _optionalChain([process, 'access',
|
|
2113
|
-
const configuredToken = _optionalChain([process, 'access',
|
|
2114
|
-
const configuredPlacementPolicy = _optionalChain([process, 'access',
|
|
2133
|
+
const configured = _optionalChain([process, 'access', _75 => _75.env, 'access', _76 => _76.DEEPLINE_RUNTIME_ENVIRONMENT, 'optionalAccess', _77 => _77.trim, 'call', _78 => _78()]);
|
|
2134
|
+
const configuredNamespace = _optionalChain([process, 'access', _79 => _79.env, 'access', _80 => _80.DEEPLINE_RUNTIME_NAMESPACE, 'optionalAccess', _81 => _81.trim, 'call', _82 => _82()]);
|
|
2135
|
+
const configuredToken = _optionalChain([process, 'access', _83 => _83.env, 'access', _84 => _84.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _85 => _85.trim, 'call', _86 => _86()]);
|
|
2136
|
+
const configuredPlacementPolicy = _optionalChain([process, 'access', _87 => _87.env, 'access', _88 => _88.DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY, 'optionalAccess', _89 => _89.trim, 'call', _90 => _90()]);
|
|
2115
2137
|
if (!configured) {
|
|
2116
2138
|
if (configuredNamespace || configuredToken || configuredPlacementPolicy) {
|
|
2117
2139
|
const present = [];
|
|
@@ -2150,7 +2172,7 @@ function resolvePlayRunRuntimeSelection(request) {
|
|
|
2150
2172
|
"INVALID_RUNTIME_NAMESPACE"
|
|
2151
2173
|
);
|
|
2152
2174
|
}
|
|
2153
|
-
const configuredBackendValue = _optionalChain([process, 'access',
|
|
2175
|
+
const configuredBackendValue = _optionalChain([process, 'access', _91 => _91.env, 'access', _92 => _92.DEEPLINE_PLAY_RUNNER_BACKEND, 'optionalAccess', _93 => _93.trim, 'call', _94 => _94()]);
|
|
2154
2176
|
const configuredBackend = configuredBackendValue === "daytona" || configuredBackendValue === "modal" ? configuredBackendValue : void 0;
|
|
2155
2177
|
if (configuredBackendValue && !configuredBackend) {
|
|
2156
2178
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
@@ -2188,7 +2210,7 @@ function resolveStartPlayRunRequest(request) {
|
|
|
2188
2210
|
}
|
|
2189
2211
|
function runtimeSelectionHeaders(runtime) {
|
|
2190
2212
|
if (!runtime) return void 0;
|
|
2191
|
-
const token = _optionalChain([process, 'access',
|
|
2213
|
+
const token = _optionalChain([process, 'access', _95 => _95.env, 'access', _96 => _96.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _97 => _97.trim, 'call', _98 => _98()]);
|
|
2192
2214
|
if (!token) {
|
|
2193
2215
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
2194
2216
|
"DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN is required for explicit preview runtime selection.",
|
|
@@ -2196,18 +2218,18 @@ function runtimeSelectionHeaders(runtime) {
|
|
|
2196
2218
|
"RUNTIME_ENVIRONMENT_TOKEN_REQUIRED"
|
|
2197
2219
|
);
|
|
2198
2220
|
}
|
|
2199
|
-
const receivers = _optionalChain([process, 'access',
|
|
2221
|
+
const receivers = _optionalChain([process, 'access', _99 => _99.env, 'access', _100 => _100.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _101 => _101.trim, 'call', _102 => _102()]);
|
|
2200
2222
|
return {
|
|
2201
|
-
[
|
|
2202
|
-
...receivers ? { [
|
|
2223
|
+
[_chunkM6HCRRV2js.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
|
|
2224
|
+
...receivers ? { [_chunkM6HCRRV2js.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
|
|
2203
2225
|
};
|
|
2204
2226
|
}
|
|
2205
2227
|
function isolatedCiRuntimeEventReadHeaders() {
|
|
2206
|
-
const schema = _optionalChain([process, 'access',
|
|
2207
|
-
if (_optionalChain([process, 'access',
|
|
2228
|
+
const schema = _optionalChain([process, 'access', _103 => _103.env, 'access', _104 => _104.DEEPLINE_RUNTIME_SCHEDULER_SCHEMA, 'optionalAccess', _105 => _105.trim, 'call', _106 => _106()]);
|
|
2229
|
+
if (_optionalChain([process, 'access', _107 => _107.env, 'access', _108 => _108.DEEPLINE_SYNTHETIC_RUN, 'optionalAccess', _109 => _109.trim, 'call', _110 => _110()]) !== "1" || !schema || !/^fly_absurd_pr_\d+_\d+(?:_\d+)?$/.test(schema)) {
|
|
2208
2230
|
return void 0;
|
|
2209
2231
|
}
|
|
2210
|
-
const token = _optionalChain([process, 'access',
|
|
2232
|
+
const token = _optionalChain([process, 'access', _111 => _111.env, 'access', _112 => _112.DEEPLINE_INTERNAL_TOKEN, 'optionalAccess', _113 => _113.trim, 'call', _114 => _114()]);
|
|
2211
2233
|
if (!token) {
|
|
2212
2234
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
2213
2235
|
"DEEPLINE_INTERNAL_TOKEN is required for isolated CI runtime event reads.",
|
|
@@ -2215,7 +2237,7 @@ function isolatedCiRuntimeEventReadHeaders() {
|
|
|
2215
2237
|
"RUNTIME_EVENT_INTERNAL_TOKEN_REQUIRED"
|
|
2216
2238
|
);
|
|
2217
2239
|
}
|
|
2218
|
-
return { [
|
|
2240
|
+
return { [_chunkM6HCRRV2js.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
|
|
2219
2241
|
}
|
|
2220
2242
|
function normalizeTestPolicyOverrides(value, source) {
|
|
2221
2243
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
@@ -2228,8 +2250,8 @@ function normalizeTestPolicyOverrides(value, source) {
|
|
|
2228
2250
|
);
|
|
2229
2251
|
}
|
|
2230
2252
|
function parseEnvTestPolicyOverrides() {
|
|
2231
|
-
const raw = typeof process !== "undefined" ? _optionalChain([process, 'access',
|
|
2232
|
-
const trimmed = _optionalChain([raw, 'optionalAccess',
|
|
2253
|
+
const raw = typeof process !== "undefined" ? _optionalChain([process, 'access', _115 => _115.env, 'optionalAccess', _116 => _116.DEEPLINE_TEST_POLICY_OVERRIDES]) : void 0;
|
|
2254
|
+
const trimmed = _optionalChain([raw, 'optionalAccess', _117 => _117.trim, 'call', _118 => _118()]);
|
|
2233
2255
|
if (!trimmed) return void 0;
|
|
2234
2256
|
let parsed;
|
|
2235
2257
|
try {
|
|
@@ -2257,7 +2279,7 @@ function isTransientCompileManifestError(error) {
|
|
|
2257
2279
|
);
|
|
2258
2280
|
}
|
|
2259
2281
|
function requireCompileManifestResponse(response, playName) {
|
|
2260
|
-
const compilerManifest = _optionalChain([response, 'optionalAccess',
|
|
2282
|
+
const compilerManifest = _optionalChain([response, 'optionalAccess', _119 => _119.compilerManifest]);
|
|
2261
2283
|
if (!compilerManifest || typeof compilerManifest !== "object" || Array.isArray(compilerManifest)) {
|
|
2262
2284
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
2263
2285
|
`Compile manifest response did not include compilerManifest for ${playName}.`,
|
|
@@ -2309,7 +2331,7 @@ function chunkRegisterPlayArtifacts(artifacts) {
|
|
|
2309
2331
|
}
|
|
2310
2332
|
function searchParams(options) {
|
|
2311
2333
|
const params = new URLSearchParams();
|
|
2312
|
-
params.set("q", _nullishCoalesce(_optionalChain([options, 'access',
|
|
2334
|
+
params.set("q", _nullishCoalesce(_optionalChain([options, 'access', _120 => _120.query, 'optionalAccess', _121 => _121.trim, 'call', _122 => _122()]), () => ( "")));
|
|
2313
2335
|
params.set(
|
|
2314
2336
|
"include_search_debug",
|
|
2315
2337
|
options.includeSearchDebug ? "true" : "false"
|
|
@@ -2319,13 +2341,13 @@ function searchParams(options) {
|
|
|
2319
2341
|
if (options.offset !== void 0) {
|
|
2320
2342
|
params.set("offset", String(options.offset));
|
|
2321
2343
|
}
|
|
2322
|
-
if (_optionalChain([options, 'access',
|
|
2344
|
+
if (_optionalChain([options, 'access', _123 => _123.categories, 'optionalAccess', _124 => _124.trim, 'call', _125 => _125()])) {
|
|
2323
2345
|
params.set("categories", options.categories.trim());
|
|
2324
2346
|
}
|
|
2325
|
-
if (_optionalChain([options, 'access',
|
|
2347
|
+
if (_optionalChain([options, 'access', _126 => _126.searchTerms, 'optionalAccess', _127 => _127.trim, 'call', _128 => _128()])) {
|
|
2326
2348
|
params.set("search_terms", options.searchTerms.trim());
|
|
2327
2349
|
}
|
|
2328
|
-
if (_optionalChain([options, 'access',
|
|
2350
|
+
if (_optionalChain([options, 'access', _129 => _129.task, 'optionalAccess', _130 => _130.trim, 'call', _131 => _131()])) params.set("task", options.task.trim());
|
|
2329
2351
|
return params;
|
|
2330
2352
|
}
|
|
2331
2353
|
var RUNS_FAILED_LOG_LIMIT = 20;
|
|
@@ -2375,17 +2397,17 @@ function preferPrebuiltPlayDescriptions(plays) {
|
|
|
2375
2397
|
}
|
|
2376
2398
|
function normalizePlayStatus(raw) {
|
|
2377
2399
|
const runPackage = _chunkLA46MMTLjs.isPlayRunPackage.call(void 0, raw) ? raw : _chunkLA46MMTLjs.isPlayRunPackage.call(void 0, raw.package) ? raw.package : null;
|
|
2378
|
-
const packageRun = _optionalChain([runPackage, 'optionalAccess',
|
|
2379
|
-
const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess',
|
|
2400
|
+
const packageRun = _optionalChain([runPackage, 'optionalAccess', _132 => _132.run]);
|
|
2401
|
+
const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess', _133 => _133.status]) === "string" ? packageRun.status : null;
|
|
2380
2402
|
const status = _chunkLA46MMTLjs.decodePlayRunPublicStatus.call(void 0, rawStatus);
|
|
2381
2403
|
if (!status) {
|
|
2382
2404
|
throw new Error(
|
|
2383
2405
|
`Invalid play run lifecycle status in API response: ${JSON.stringify(rawStatus)}.`
|
|
2384
2406
|
);
|
|
2385
2407
|
}
|
|
2386
|
-
const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess',
|
|
2387
|
-
const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess',
|
|
2388
|
-
const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess',
|
|
2408
|
+
const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess', _134 => _134.id]), () => ( ""));
|
|
2409
|
+
const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _135 => _135.overview]), () => ( raw.overview));
|
|
2410
|
+
const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _136 => _136.runStatus]), () => ( raw.runStatus));
|
|
2389
2411
|
return {
|
|
2390
2412
|
...raw,
|
|
2391
2413
|
runId,
|
|
@@ -2487,9 +2509,9 @@ function playRunResultFromStatus(status, startedAt, fallbackRunId) {
|
|
|
2487
2509
|
runId: status.runId || fallbackRunId,
|
|
2488
2510
|
result: _nullishCoalesce(status.package, () => ( status.result)),
|
|
2489
2511
|
...status.package ? { package: status.package } : {},
|
|
2490
|
-
logs: _nullishCoalesce(_optionalChain([status, 'access',
|
|
2512
|
+
logs: _nullishCoalesce(_optionalChain([status, 'access', _137 => _137.progress, 'optionalAccess', _138 => _138.logs]), () => ( [])),
|
|
2491
2513
|
durationMs: Date.now() - startedAt,
|
|
2492
|
-
error: _nullishCoalesce(_optionalChain([status, 'access',
|
|
2514
|
+
error: _nullishCoalesce(_optionalChain([status, 'access', _139 => _139.progress, 'optionalAccess', _140 => _140.error]), () => ( (status.status !== "completed" ? status.status : void 0)))
|
|
2493
2515
|
};
|
|
2494
2516
|
}
|
|
2495
2517
|
var DeeplineClient = (_class = class _DeeplineClient {
|
|
@@ -2516,12 +2538,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
2516
2538
|
* @throws {@link ConfigError} if no API key can be resolved from any source.
|
|
2517
2539
|
*/
|
|
2518
2540
|
constructor(options) {
|
|
2519
|
-
this.config =
|
|
2520
|
-
this.http = new (0,
|
|
2541
|
+
this.config = _chunkM6HCRRV2js.resolveConfig.call(void 0, options);
|
|
2542
|
+
this.http = new (0, _chunkM6HCRRV2js.HttpClient)(this.config);
|
|
2521
2543
|
this.toolCalls = new ToolCalls(
|
|
2522
2544
|
this.http,
|
|
2523
2545
|
this.config.timeout,
|
|
2524
|
-
_optionalChain([options, 'optionalAccess',
|
|
2546
|
+
_optionalChain([options, 'optionalAccess', _141 => _141.timeout])
|
|
2525
2547
|
);
|
|
2526
2548
|
this.runs = {
|
|
2527
2549
|
getReceipts: (runId, options2) => this.getRunReceipts(runId, options2),
|
|
@@ -2566,7 +2588,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
2566
2588
|
{},
|
|
2567
2589
|
{
|
|
2568
2590
|
"Idempotency-Key": requireTargetBillingIdempotencyKey(
|
|
2569
|
-
_nullishCoalesce(_optionalChain([options2, 'optionalAccess',
|
|
2591
|
+
_nullishCoalesce(_optionalChain([options2, 'optionalAccess', _142 => _142.idempotencyKey]), () => ( globalThis.crypto.randomUUID()))
|
|
2570
2592
|
)
|
|
2571
2593
|
}
|
|
2572
2594
|
),
|
|
@@ -2585,7 +2607,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
2585
2607
|
available: (toolIdOrOptions, options2) => this.getMonitorsAvailable(toolIdOrOptions, options2),
|
|
2586
2608
|
check: (definition) => this.checkMonitor(definition),
|
|
2587
2609
|
deploy: (definition, options2) => this.deployMonitor(definition, options2),
|
|
2588
|
-
sync: (definition, options2) => _optionalChain([options2, 'optionalAccess',
|
|
2610
|
+
sync: (definition, options2) => _optionalChain([options2, 'optionalAccess', _143 => _143.dryRun]) ? this.deployMonitor(definition, { dryRun: true }) : this.syncScalarMonitor(definition, options2),
|
|
2589
2611
|
list: (options2) => this.listMonitors(options2),
|
|
2590
2612
|
get: (key) => this.getMonitor(key),
|
|
2591
2613
|
test: (key, payload, options2) => this.testMonitorWebhook(key, payload, options2),
|
|
@@ -2594,13 +2616,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
2594
2616
|
update: (key, patch) => this.updateMonitor(key, patch),
|
|
2595
2617
|
delete: (key, options2) => this.deleteMonitor(key, options2),
|
|
2596
2618
|
reactivate: (key, options2) => this.reactivateMonitor(key, options2),
|
|
2597
|
-
start: (key, options2) => _optionalChain([options2, 'optionalAccess',
|
|
2619
|
+
start: (key, options2) => _optionalChain([options2, 'optionalAccess', _144 => _144.dryRun]) ? this.submitMonitorBatch({
|
|
2598
2620
|
kind: "reactivate",
|
|
2599
2621
|
scope: { kind: "keys", monitorKeys: [key] },
|
|
2600
2622
|
dryRun: true,
|
|
2601
2623
|
idempotencyKey: _nullishCoalesce(options2.idempotencyKey, () => ( this.monitorJobIdempotencyKey(`start-${key}`)))
|
|
2602
2624
|
}) : this.submitScalarMonitorLifecycle(key, "start", options2),
|
|
2603
|
-
stop: (key, options2) => _optionalChain([options2, 'optionalAccess',
|
|
2625
|
+
stop: (key, options2) => _optionalChain([options2, 'optionalAccess', _145 => _145.dryRun]) ? this.submitMonitorBatch({
|
|
2604
2626
|
kind: "deactivate",
|
|
2605
2627
|
scope: { kind: "keys", monitorKeys: [key] },
|
|
2606
2628
|
dryRun: true,
|
|
@@ -2651,7 +2673,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
2651
2673
|
type: _nullishCoalesce(field.type, () => ( void 0)),
|
|
2652
2674
|
required: _nullishCoalesce(field.required, () => ( void 0))
|
|
2653
2675
|
} : null
|
|
2654
|
-
).filter((field) => Boolean(_optionalChain([field, 'optionalAccess',
|
|
2676
|
+
).filter((field) => Boolean(_optionalChain([field, 'optionalAccess', _146 => _146.name]))) : [];
|
|
2655
2677
|
return fields.length > 0 ? { fields } : schema;
|
|
2656
2678
|
}
|
|
2657
2679
|
schemaMetadata(schema, key) {
|
|
@@ -2681,13 +2703,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
2681
2703
|
};
|
|
2682
2704
|
}
|
|
2683
2705
|
summarizePlayListItem(play, options) {
|
|
2684
|
-
const aliases = _optionalChain([play, 'access',
|
|
2706
|
+
const aliases = _optionalChain([play, 'access', _147 => _147.aliases, 'optionalAccess', _148 => _148.length]) ? play.aliases : [play.name];
|
|
2685
2707
|
const csvInput = this.schemaMetadata(play.inputSchema, "csvInput");
|
|
2686
2708
|
const rowOutputSchema = this.schemaMetadata(
|
|
2687
2709
|
play.outputSchema,
|
|
2688
2710
|
"rowOutputSchema"
|
|
2689
2711
|
);
|
|
2690
|
-
const description = _optionalChain([play, 'access',
|
|
2712
|
+
const description = _optionalChain([play, 'access', _149 => _149.description, 'optionalAccess', _150 => _150.trim, 'call', _151 => _151()]) || _optionalChain([play, 'access', _152 => _152.currentRevision, 'optionalAccess', _153 => _153.description, 'optionalAccess', _154 => _154.trim, 'call', _155 => _155()]) || _optionalChain([play, 'access', _156 => _156.liveRevision, 'optionalAccess', _157 => _157.description, 'optionalAccess', _158 => _158.trim, 'call', _159 => _159()]) || null;
|
|
2691
2713
|
const runCommand = this.playRunCommand(play);
|
|
2692
2714
|
const cloneEditStarter = this.playCloneEditStarter(play);
|
|
2693
2715
|
return {
|
|
@@ -2707,9 +2729,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
2707
2729
|
canEdit: play.canEdit,
|
|
2708
2730
|
canClone: play.canClone,
|
|
2709
2731
|
aliases,
|
|
2710
|
-
inputSchema: _optionalChain([options, 'optionalAccess',
|
|
2711
|
-
outputSchema: _optionalChain([options, 'optionalAccess',
|
|
2712
|
-
staticPipeline: isRecord2(play.staticPipeline) ? play.staticPipeline : isRecord2(_optionalChain([play, 'access',
|
|
2732
|
+
inputSchema: _optionalChain([options, 'optionalAccess', _160 => _160.compact]) ? this.compactSchema(play.inputSchema) : _nullishCoalesce(play.inputSchema, () => ( null)),
|
|
2733
|
+
outputSchema: _optionalChain([options, 'optionalAccess', _161 => _161.compact]) ? this.compactSchema(play.outputSchema) : _nullishCoalesce(play.outputSchema, () => ( null)),
|
|
2734
|
+
staticPipeline: isRecord2(play.staticPipeline) ? play.staticPipeline : isRecord2(_optionalChain([play, 'access', _162 => _162.currentRevision, 'optionalAccess', _163 => _163.staticPipeline])) ? play.currentRevision.staticPipeline : isRecord2(_optionalChain([play, 'access', _164 => _164.liveRevision, 'optionalAccess', _165 => _165.staticPipeline])) ? play.liveRevision.staticPipeline : null,
|
|
2713
2735
|
...csvInput ? {
|
|
2714
2736
|
csvInput: { ...csvInput, headerMatching: CSV_HEADER_MATCHING_NOTE }
|
|
2715
2737
|
} : {},
|
|
@@ -2721,7 +2743,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
2721
2743
|
// Read the live version off the live revision. It was previously only
|
|
2722
2744
|
// ever written by the publish/live routes, so every list and describe
|
|
2723
2745
|
// payload reported liveVersion: null even for an actively serving play.
|
|
2724
|
-
liveVersion: _nullishCoalesce(_optionalChain([play, 'access',
|
|
2746
|
+
liveVersion: _nullishCoalesce(_optionalChain([play, 'access', _166 => _166.liveRevision, 'optionalAccess', _167 => _167.version]), () => ( null)),
|
|
2725
2747
|
...play.triggerStatus ? { triggerStatus: play.triggerStatus } : {},
|
|
2726
2748
|
isDraftDirty: play.isDraftDirty
|
|
2727
2749
|
};
|
|
@@ -2730,8 +2752,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
2730
2752
|
const play = detail.play;
|
|
2731
2753
|
return {
|
|
2732
2754
|
...this.summarizePlayListItem(play, options),
|
|
2733
|
-
currentPublishedVersion: _nullishCoalesce(_nullishCoalesce(play.currentPublishedVersion, () => ( _optionalChain([play, 'access',
|
|
2734
|
-
latestRunId: _nullishCoalesce(_nullishCoalesce(play.latestRunId, () => ( _optionalChain([detail, 'access',
|
|
2755
|
+
currentPublishedVersion: _nullishCoalesce(_nullishCoalesce(play.currentPublishedVersion, () => ( _optionalChain([play, 'access', _168 => _168.liveRevision, 'optionalAccess', _169 => _169.version]))), () => ( null)),
|
|
2756
|
+
latestRunId: _nullishCoalesce(_nullishCoalesce(play.latestRunId, () => ( _optionalChain([detail, 'access', _170 => _170.latestRuns, 'access', _171 => _171[0], 'optionalAccess', _172 => _172.workflowId]))), () => ( null)),
|
|
2735
2757
|
...play.triggerMetadata ? { triggerMetadata: play.triggerMetadata } : {},
|
|
2736
2758
|
...play.runtimeLimit ? { runtimeLimit: play.runtimeLimit } : {},
|
|
2737
2759
|
...play.activeScheduledPlays ? { activeScheduledPlays: play.activeScheduledPlays } : {}
|
|
@@ -2798,17 +2820,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
2798
2820
|
*/
|
|
2799
2821
|
async listTools(options) {
|
|
2800
2822
|
const params = new URLSearchParams();
|
|
2801
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
2823
|
+
if (_optionalChain([options, 'optionalAccess', _173 => _173.categories, 'optionalAccess', _174 => _174.trim, 'call', _175 => _175()])) {
|
|
2802
2824
|
params.set("categories", options.categories.trim());
|
|
2803
2825
|
}
|
|
2804
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
2826
|
+
if (_optionalChain([options, 'optionalAccess', _176 => _176.tags, 'optionalAccess', _177 => _177.trim, 'call', _178 => _178()])) {
|
|
2805
2827
|
params.set("tags", options.tags.trim());
|
|
2806
2828
|
}
|
|
2807
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
2829
|
+
if (_optionalChain([options, 'optionalAccess', _179 => _179.grep, 'optionalAccess', _180 => _180.trim, 'call', _181 => _181()])) {
|
|
2808
2830
|
params.set("grep", options.grep.trim());
|
|
2809
2831
|
params.set("grep_mode", _nullishCoalesce(options.grepMode, () => ( "all")));
|
|
2810
2832
|
}
|
|
2811
|
-
params.set("compact", _optionalChain([options, 'optionalAccess',
|
|
2833
|
+
params.set("compact", _optionalChain([options, 'optionalAccess', _182 => _182.compact]) === true ? "true" : "false");
|
|
2812
2834
|
const suffix = params.toString() ? `?${params.toString()}` : "";
|
|
2813
2835
|
const res = await this.http.get(
|
|
2814
2836
|
`/api/v2/tools${suffix}`
|
|
@@ -2817,7 +2839,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
2817
2839
|
}
|
|
2818
2840
|
/** List discoverable providers without requiring a local plugin catalog. */
|
|
2819
2841
|
async listProviders(options) {
|
|
2820
|
-
const suffix = _optionalChain([options, 'optionalAccess',
|
|
2842
|
+
const suffix = _optionalChain([options, 'optionalAccess', _183 => _183.changed]) ? "?changed=true" : "";
|
|
2821
2843
|
const res = await this.http.get(
|
|
2822
2844
|
`/api/v2/tools/providers${suffix}`
|
|
2823
2845
|
);
|
|
@@ -2848,8 +2870,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
2848
2870
|
*/
|
|
2849
2871
|
async search(options = {}) {
|
|
2850
2872
|
const params = searchParams(options);
|
|
2851
|
-
if (_optionalChain([options, 'access',
|
|
2852
|
-
if (_optionalChain([options, 'access',
|
|
2873
|
+
if (_optionalChain([options, 'access', _184 => _184.types, 'optionalAccess', _185 => _185.length])) params.set("types", options.types.join(","));
|
|
2874
|
+
if (_optionalChain([options, 'access', _186 => _186.exclude, 'optionalAccess', _187 => _187.length])) {
|
|
2853
2875
|
params.set("exclude", options.exclude.join(","));
|
|
2854
2876
|
}
|
|
2855
2877
|
return this.http.get(`/api/v2/search?${params.toString()}`);
|
|
@@ -2870,7 +2892,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
2870
2892
|
* console.log(`Input schema:`, meta.inputSchema);
|
|
2871
2893
|
* ```
|
|
2872
2894
|
*/
|
|
2873
|
-
async getTool(toolId) {
|
|
2895
|
+
async getTool(toolId, options) {
|
|
2896
|
+
if (_optionalChain([options, 'optionalAccess', _188 => _188.cliInvocationId]) !== void 0) {
|
|
2897
|
+
validateCliInvocationId(options.cliInvocationId);
|
|
2898
|
+
}
|
|
2874
2899
|
return this.http.request(
|
|
2875
2900
|
`/api/v2/integrations/${encodeURIComponent(toolId)}/get`,
|
|
2876
2901
|
{
|
|
@@ -2880,7 +2905,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
2880
2905
|
// other GET catalog methods such as searchTools().
|
|
2881
2906
|
retryApiErrors: true,
|
|
2882
2907
|
headers: {
|
|
2883
|
-
"x-deepline-tool-meta-only": "1"
|
|
2908
|
+
"x-deepline-tool-meta-only": "1",
|
|
2909
|
+
..._optionalChain([options, 'optionalAccess', _189 => _189.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
|
|
2884
2910
|
}
|
|
2885
2911
|
}
|
|
2886
2912
|
);
|
|
@@ -2982,7 +3008,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
2982
3008
|
return this.http.post(
|
|
2983
3009
|
"/api/v2/ingestion/repair",
|
|
2984
3010
|
{
|
|
2985
|
-
..._optionalChain([input, 'optionalAccess',
|
|
3011
|
+
..._optionalChain([input, 'optionalAccess', _190 => _190.provider]) ? { provider: input.provider } : {}
|
|
2986
3012
|
}
|
|
2987
3013
|
);
|
|
2988
3014
|
}
|
|
@@ -3052,7 +3078,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3052
3078
|
method: "POST",
|
|
3053
3079
|
body,
|
|
3054
3080
|
headers: runtimeSelectionHeaders(resolved.runtime),
|
|
3055
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
3081
|
+
signal: _optionalChain([options, 'optionalAccess', _191 => _191.signal])
|
|
3056
3082
|
}
|
|
3057
3083
|
)) {
|
|
3058
3084
|
if (event.scope === "play") {
|
|
@@ -3212,7 +3238,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3212
3238
|
compilerManifest,
|
|
3213
3239
|
...input.input ? { input: input.input } : {},
|
|
3214
3240
|
...input.inputFile ? { inputFile: input.inputFile } : {},
|
|
3215
|
-
..._optionalChain([input, 'access',
|
|
3241
|
+
..._optionalChain([input, 'access', _192 => _192.packagedFiles, 'optionalAccess', _193 => _193.length]) ? { packagedFiles: input.packagedFiles } : {},
|
|
3216
3242
|
...input.force ? { force: true } : {},
|
|
3217
3243
|
...input.forceToolRefresh ? { forceToolRefresh: true } : {}
|
|
3218
3244
|
});
|
|
@@ -3242,29 +3268,29 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3242
3268
|
* ```
|
|
3243
3269
|
*/
|
|
3244
3270
|
async submitPlay(code, csvPath, name, options) {
|
|
3245
|
-
const runtimeInput = _optionalChain([options, 'optionalAccess',
|
|
3271
|
+
const runtimeInput = _optionalChain([options, 'optionalAccess', _194 => _194.input]) ? { ...options.input } : {};
|
|
3246
3272
|
if (csvPath) {
|
|
3247
3273
|
runtimeInput.file = csvPath;
|
|
3248
3274
|
}
|
|
3249
|
-
const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3250
|
-
const artifact = _optionalChain([options, 'optionalAccess',
|
|
3251
|
-
if (!_optionalChain([name, 'optionalAccess',
|
|
3275
|
+
const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _195 => _195.sourceCode]), () => ( code));
|
|
3276
|
+
const artifact = _optionalChain([options, 'optionalAccess', _196 => _196.artifact]);
|
|
3277
|
+
if (!_optionalChain([name, 'optionalAccess', _197 => _197.trim, 'call', _198 => _198()])) {
|
|
3252
3278
|
throw new Error("submitPlay requires a play name.");
|
|
3253
3279
|
}
|
|
3254
3280
|
if (!artifact) {
|
|
3255
3281
|
throw new Error("submitPlay requires a bundled play artifact.");
|
|
3256
3282
|
}
|
|
3257
|
-
const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async
|
|
3283
|
+
const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _199 => _199.compilerManifest]), async () => ( await this.compilePlayManifest({
|
|
3258
3284
|
name,
|
|
3259
3285
|
sourceCode,
|
|
3260
|
-
sourceFiles: _optionalChain([options, 'optionalAccess',
|
|
3286
|
+
sourceFiles: _optionalChain([options, 'optionalAccess', _200 => _200.sourceFiles]),
|
|
3261
3287
|
artifact
|
|
3262
3288
|
})));
|
|
3263
3289
|
const registeredArtifact = await this.registerPlayArtifact({
|
|
3264
3290
|
name,
|
|
3265
3291
|
sourceCode,
|
|
3266
|
-
sourceFiles: _optionalChain([options, 'optionalAccess',
|
|
3267
|
-
description: _optionalChain([options, 'optionalAccess',
|
|
3292
|
+
sourceFiles: _optionalChain([options, 'optionalAccess', _201 => _201.sourceFiles]),
|
|
3293
|
+
description: _optionalChain([options, 'optionalAccess', _202 => _202.description]),
|
|
3268
3294
|
artifact,
|
|
3269
3295
|
compilerManifest,
|
|
3270
3296
|
publish: false
|
|
@@ -3278,17 +3304,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3278
3304
|
name,
|
|
3279
3305
|
artifactStorageKey: registeredArtifact.artifactStorageKey,
|
|
3280
3306
|
sourceCode,
|
|
3281
|
-
description: _optionalChain([options, 'optionalAccess',
|
|
3307
|
+
description: _optionalChain([options, 'optionalAccess', _203 => _203.description]),
|
|
3282
3308
|
staticPipeline: _nullishCoalesce(registeredArtifact.staticPipeline, () => ( null)),
|
|
3283
3309
|
artifactHash: typeof artifact.artifactHash === "string" ? artifact.artifactHash : void 0,
|
|
3284
3310
|
graphHash: typeof artifact.graphHash === "string" ? artifact.graphHash : void 0,
|
|
3285
3311
|
runtimeArtifact: artifact,
|
|
3286
3312
|
compilerManifest,
|
|
3287
3313
|
...Object.keys(runtimeInput).length > 0 ? { input: runtimeInput } : {},
|
|
3288
|
-
..._optionalChain([options, 'optionalAccess',
|
|
3289
|
-
..._optionalChain([options, 'optionalAccess',
|
|
3290
|
-
..._optionalChain([options, 'optionalAccess',
|
|
3291
|
-
..._optionalChain([options, 'optionalAccess',
|
|
3314
|
+
..._optionalChain([options, 'optionalAccess', _204 => _204.inputFile]) ? { inputFile: options.inputFile } : {},
|
|
3315
|
+
..._optionalChain([options, 'optionalAccess', _205 => _205.packagedFiles, 'optionalAccess', _206 => _206.length]) ? { packagedFiles: options.packagedFiles } : {},
|
|
3316
|
+
..._optionalChain([options, 'optionalAccess', _207 => _207.force]) ? { force: true } : {},
|
|
3317
|
+
..._optionalChain([options, 'optionalAccess', _208 => _208.forceToolRefresh]) ? { forceToolRefresh: true } : {}
|
|
3292
3318
|
});
|
|
3293
3319
|
}
|
|
3294
3320
|
/**
|
|
@@ -3358,10 +3384,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3358
3384
|
*/
|
|
3359
3385
|
async getPlayStatus(workflowId, options) {
|
|
3360
3386
|
const params = new URLSearchParams();
|
|
3361
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3387
|
+
if (_optionalChain([options, 'optionalAccess', _209 => _209.billing]) === false) {
|
|
3362
3388
|
params.set("billing", "false");
|
|
3363
3389
|
}
|
|
3364
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3390
|
+
if (_optionalChain([options, 'optionalAccess', _210 => _210.full]) === true) {
|
|
3365
3391
|
params.set("full", "true");
|
|
3366
3392
|
}
|
|
3367
3393
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -3375,9 +3401,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3375
3401
|
for await (const event of watchRunEvents({
|
|
3376
3402
|
http: this.http,
|
|
3377
3403
|
runId: workflowId,
|
|
3378
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
3379
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
3380
|
-
onRetry: _optionalChain([options, 'optionalAccess',
|
|
3404
|
+
signal: _optionalChain([options, 'optionalAccess', _211 => _211.signal]),
|
|
3405
|
+
onNotice: _optionalChain([options, 'optionalAccess', _212 => _212.onNotice]),
|
|
3406
|
+
onRetry: _optionalChain([options, 'optionalAccess', _213 => _213.onRetry])
|
|
3381
3407
|
})) {
|
|
3382
3408
|
yield event;
|
|
3383
3409
|
}
|
|
@@ -3389,12 +3415,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3389
3415
|
* @deprecated Use `watchRunEvents` for ordinary run watching.
|
|
3390
3416
|
*/
|
|
3391
3417
|
async *streamPlayRunEvents(workflowId, options) {
|
|
3392
|
-
const headers = _optionalChain([options, 'optionalAccess',
|
|
3418
|
+
const headers = _optionalChain([options, 'optionalAccess', _214 => _214.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
|
|
3393
3419
|
const params = new URLSearchParams();
|
|
3394
|
-
params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3420
|
+
params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _215 => _215.mode]), () => ( "cli")));
|
|
3395
3421
|
for await (const event of this.http.streamSse(
|
|
3396
3422
|
`/api/v2/runs/${encodeURIComponent(workflowId)}/tail?${params.toString()}`,
|
|
3397
|
-
{ signal: _optionalChain([options, 'optionalAccess',
|
|
3423
|
+
{ signal: _optionalChain([options, 'optionalAccess', _216 => _216.signal]), headers }
|
|
3398
3424
|
)) {
|
|
3399
3425
|
if (event.scope === "play") {
|
|
3400
3426
|
yield event;
|
|
@@ -3410,24 +3436,24 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3410
3436
|
*/
|
|
3411
3437
|
async *observeRunEvents(runId, options) {
|
|
3412
3438
|
yield* this.watchRunEvents(runId, {
|
|
3413
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
3414
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
3439
|
+
signal: _optionalChain([options, 'optionalAccess', _217 => _217.signal]),
|
|
3440
|
+
onNotice: _optionalChain([options, 'optionalAccess', _218 => _218.onNotice])
|
|
3415
3441
|
});
|
|
3416
3442
|
}
|
|
3417
3443
|
/** Poll snapshots to terminal status and return the durable package. */
|
|
3418
3444
|
async watchRunToTerminal(runId, options) {
|
|
3419
3445
|
let terminalObserved = false;
|
|
3420
3446
|
for await (const event of this.watchRunEvents(runId, {
|
|
3421
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
3422
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
3423
|
-
onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3447
|
+
signal: _optionalChain([options, 'optionalAccess', _219 => _219.signal]),
|
|
3448
|
+
onNotice: _optionalChain([options, 'optionalAccess', _220 => _220.onNotice]),
|
|
3449
|
+
onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _221 => _221.onRetry]), () => ( _optionalChain([options, 'optionalAccess', _222 => _222.onReconnect])))
|
|
3424
3450
|
})) {
|
|
3425
|
-
_optionalChain([options, 'optionalAccess',
|
|
3451
|
+
_optionalChain([options, 'optionalAccess', _223 => _223.onEvent, 'optionalCall', _224 => _224(event)]);
|
|
3426
3452
|
if (_chunkLA46MMTLjs.isTerminalPlayRunLifecycleStatus.call(void 0, playLiveRunStatus(event))) {
|
|
3427
3453
|
terminalObserved = true;
|
|
3428
3454
|
}
|
|
3429
3455
|
}
|
|
3430
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3456
|
+
if (_optionalChain([options, 'optionalAccess', _225 => _225.signal, 'optionalAccess', _226 => _226.aborted])) {
|
|
3431
3457
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)("Run watch aborted.", void 0, "ABORTED");
|
|
3432
3458
|
}
|
|
3433
3459
|
const refreshed = await this.getRunStatus(runId);
|
|
@@ -3481,7 +3507,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3481
3507
|
async stopPlay(workflowId, options) {
|
|
3482
3508
|
return this.http.post(
|
|
3483
3509
|
`/api/v2/runs/${encodeURIComponent(workflowId)}/stop`,
|
|
3484
|
-
_optionalChain([options, 'optionalAccess',
|
|
3510
|
+
_optionalChain([options, 'optionalAccess', _227 => _227.reason]) ? { reason: options.reason } : {}
|
|
3485
3511
|
);
|
|
3486
3512
|
}
|
|
3487
3513
|
/**
|
|
@@ -3517,7 +3543,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3517
3543
|
/** List the org's workflows. `GET /api/v2/workflows`. */
|
|
3518
3544
|
async listWorkflows(options) {
|
|
3519
3545
|
const params = new URLSearchParams();
|
|
3520
|
-
if (typeof _optionalChain([options, 'optionalAccess',
|
|
3546
|
+
if (typeof _optionalChain([options, 'optionalAccess', _228 => _228.limit]) === "number") {
|
|
3521
3547
|
params.set("limit", String(options.limit));
|
|
3522
3548
|
}
|
|
3523
3549
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -3570,7 +3596,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3570
3596
|
/** List a workflow's runs. `GET /api/v2/workflows/:id/runs`. */
|
|
3571
3597
|
async listWorkflowRuns(id, options) {
|
|
3572
3598
|
const params = new URLSearchParams();
|
|
3573
|
-
if (typeof _optionalChain([options, 'optionalAccess',
|
|
3599
|
+
if (typeof _optionalChain([options, 'optionalAccess', _229 => _229.limit]) === "number") {
|
|
3574
3600
|
params.set("limit", String(options.limit));
|
|
3575
3601
|
}
|
|
3576
3602
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -3606,10 +3632,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3606
3632
|
*/
|
|
3607
3633
|
async getRunStatus(runId, options) {
|
|
3608
3634
|
const params = new URLSearchParams();
|
|
3609
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3635
|
+
if (_optionalChain([options, 'optionalAccess', _230 => _230.full]) === true) {
|
|
3610
3636
|
params.set("full", "true");
|
|
3611
3637
|
}
|
|
3612
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3638
|
+
if (_optionalChain([options, 'optionalAccess', _231 => _231.configuration]) === true) {
|
|
3613
3639
|
params.set("include", "configuration");
|
|
3614
3640
|
}
|
|
3615
3641
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -3617,7 +3643,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3617
3643
|
`/api/v2/runs/${encodeURIComponent(runId)}${query}`,
|
|
3618
3644
|
{ headers: { "x-deepline-run-status": "1" } }
|
|
3619
3645
|
);
|
|
3620
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3646
|
+
if (_optionalChain([options, 'optionalAccess', _232 => _232.configuration]) === true && !Object.hasOwn(response, "contract")) {
|
|
3621
3647
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
3622
3648
|
"This server does not support recorded configuration reads.",
|
|
3623
3649
|
void 0,
|
|
@@ -3625,7 +3651,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3625
3651
|
);
|
|
3626
3652
|
}
|
|
3627
3653
|
const status = normalizePlayStatus(response);
|
|
3628
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3654
|
+
if (_optionalChain([options, 'optionalAccess', _233 => _233.failedLogs]) !== true || status.status !== "failed") {
|
|
3629
3655
|
return status;
|
|
3630
3656
|
}
|
|
3631
3657
|
const requestedFailedLogLimit = typeof options.failedLogLimit === "number" && Number.isFinite(options.failedLogLimit) ? Math.max(1, Math.floor(options.failedLogLimit)) : RUNS_FAILED_LOG_LIMIT;
|
|
@@ -3714,7 +3740,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3714
3740
|
/** The same tenant-scoped run history searched by the dashboard and CLI. */
|
|
3715
3741
|
async getRunsHistory(options = {}) {
|
|
3716
3742
|
const params = new URLSearchParams();
|
|
3717
|
-
const search = _optionalChain([options, 'access',
|
|
3743
|
+
const search = _optionalChain([options, 'access', _234 => _234.search, 'optionalAccess', _235 => _235.trim, 'call', _236 => _236()]);
|
|
3718
3744
|
if (search && search.length > 200) {
|
|
3719
3745
|
throw new Error("Run search must be at most 200 characters.");
|
|
3720
3746
|
}
|
|
@@ -3740,12 +3766,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3740
3766
|
}
|
|
3741
3767
|
/** Read one run page without discarding server pagination metadata. */
|
|
3742
3768
|
async listRunsPage(options) {
|
|
3743
|
-
const playName = _optionalChain([options, 'access',
|
|
3769
|
+
const playName = _optionalChain([options, 'access', _237 => _237.play, 'optionalAccess', _238 => _238.trim, 'call', _239 => _239()]);
|
|
3744
3770
|
const params = new URLSearchParams();
|
|
3745
3771
|
if (playName) {
|
|
3746
3772
|
params.set("play", playName);
|
|
3747
3773
|
}
|
|
3748
|
-
const status = _optionalChain([options, 'access',
|
|
3774
|
+
const status = _optionalChain([options, 'access', _240 => _240.status, 'optionalAccess', _241 => _241.trim, 'call', _242 => _242()]);
|
|
3749
3775
|
if (status) {
|
|
3750
3776
|
params.set("status", status);
|
|
3751
3777
|
}
|
|
@@ -3813,8 +3839,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3813
3839
|
* different key intentionally starts another rerun.
|
|
3814
3840
|
*/
|
|
3815
3841
|
async rerun(runId, options) {
|
|
3816
|
-
const idempotencyKey = _optionalChain([options, 'optionalAccess',
|
|
3817
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3842
|
+
const idempotencyKey = _optionalChain([options, 'optionalAccess', _243 => _243.idempotencyKey, 'optionalAccess', _244 => _244.trim, 'call', _245 => _245()]);
|
|
3843
|
+
if (_optionalChain([options, 'optionalAccess', _246 => _246.idempotencyKey]) !== void 0 && !idempotencyKey) {
|
|
3818
3844
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
3819
3845
|
"runs.rerun idempotencyKey must not be empty.",
|
|
3820
3846
|
void 0,
|
|
@@ -3823,7 +3849,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3823
3849
|
}
|
|
3824
3850
|
return this.http.post(
|
|
3825
3851
|
`/api/v2/runs/${encodeURIComponent(runId)}/rerun`,
|
|
3826
|
-
_optionalChain([options, 'optionalAccess',
|
|
3852
|
+
_optionalChain([options, 'optionalAccess', _247 => _247.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
|
|
3827
3853
|
{ "Idempotency-Key": idempotencyKey || globalThis.crypto.randomUUID() }
|
|
3828
3854
|
);
|
|
3829
3855
|
}
|
|
@@ -3837,21 +3863,21 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3837
3863
|
* ```
|
|
3838
3864
|
*/
|
|
3839
3865
|
async getRunLogs(runId, options) {
|
|
3840
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3866
|
+
if (_optionalChain([options, 'optionalAccess', _248 => _248.all]) === true && options.failed === true) {
|
|
3841
3867
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
3842
3868
|
"runs.logs cannot combine all and failed views.",
|
|
3843
3869
|
void 0,
|
|
3844
3870
|
"INVALID_RUN_LOG_VIEW"
|
|
3845
3871
|
);
|
|
3846
3872
|
}
|
|
3847
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3873
|
+
if (_optionalChain([options, 'optionalAccess', _249 => _249.cursor]) !== void 0 && options.failed === true) {
|
|
3848
3874
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
3849
3875
|
"runs.logs cannot combine failed with cursor.",
|
|
3850
3876
|
void 0,
|
|
3851
3877
|
"INVALID_RUN_LOG_VIEW"
|
|
3852
3878
|
);
|
|
3853
3879
|
}
|
|
3854
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3880
|
+
if (_optionalChain([options, 'optionalAccess', _250 => _250.failed]) === true) {
|
|
3855
3881
|
const requestedLimit = typeof options.limit === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : RUNS_FAILED_LOG_LIMIT;
|
|
3856
3882
|
const failedLimit = Math.min(RUNS_FAILED_LOG_LIMIT, requestedLimit);
|
|
3857
3883
|
const page = await this.http.get(
|
|
@@ -3876,18 +3902,18 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3876
3902
|
...page.logsTruncated ? { logsTruncated: true } : {}
|
|
3877
3903
|
};
|
|
3878
3904
|
}
|
|
3879
|
-
const beforeSequence = _optionalChain([options, 'optionalAccess',
|
|
3880
|
-
const limit = _optionalChain([options, 'optionalAccess',
|
|
3905
|
+
const beforeSequence = _optionalChain([options, 'optionalAccess', _251 => _251.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
|
|
3906
|
+
const limit = _optionalChain([options, 'optionalAccess', _252 => _252.all]) ? Number.MAX_SAFE_INTEGER : typeof _optionalChain([options, 'optionalAccess', _253 => _253.limit]) === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
|
|
3881
3907
|
const fetchPage = (afterSeq2, pageLimit) => this.http.get(
|
|
3882
3908
|
`/api/v2/runs/${encodeURIComponent(runId)}/logs?afterSeq=${afterSeq2}&limit=${pageLimit}`,
|
|
3883
3909
|
{ retryApiErrors: true }
|
|
3884
3910
|
);
|
|
3885
3911
|
const probe = await fetchPage(0, 1);
|
|
3886
3912
|
const lastStoredSeq = probe.lastStoredSeq;
|
|
3887
|
-
const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access',
|
|
3913
|
+
const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _254 => _254.entries, 'access', _255 => _255[0], 'optionalAccess', _256 => _256.seq]), () => ( null));
|
|
3888
3914
|
const upperSeq = beforeSequence === null ? Number.POSITIVE_INFINITY : Math.min(beforeSequence - 1, lastStoredSeq);
|
|
3889
3915
|
const windowEndSeq = Math.min(upperSeq, lastStoredSeq);
|
|
3890
|
-
let afterSeq = _optionalChain([options, 'optionalAccess',
|
|
3916
|
+
let afterSeq = _optionalChain([options, 'optionalAccess', _257 => _257.all]) ? 0 : Math.max(0, windowEndSeq - limit);
|
|
3891
3917
|
const entries = [];
|
|
3892
3918
|
while (entries.length < limit && afterSeq < upperSeq) {
|
|
3893
3919
|
const page = await fetchPage(
|
|
@@ -3921,7 +3947,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3921
3947
|
hasMore: olderLinesExist,
|
|
3922
3948
|
nextCursor: olderLinesExist ? encodeRunLogsCursor(firstSequence) : null,
|
|
3923
3949
|
entries: entries.map((entry) => entry.line),
|
|
3924
|
-
view: _optionalChain([options, 'optionalAccess',
|
|
3950
|
+
view: _optionalChain([options, 'optionalAccess', _258 => _258.all]) ? "all" : "tail",
|
|
3925
3951
|
...probe.logsTruncated ? { logsTruncated: true } : {}
|
|
3926
3952
|
};
|
|
3927
3953
|
}
|
|
@@ -3973,7 +3999,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3973
3999
|
limit: String(_nullishCoalesce(input.limit, () => ( 5e3))),
|
|
3974
4000
|
offset: String(_nullishCoalesce(input.offset, () => ( 0)))
|
|
3975
4001
|
});
|
|
3976
|
-
if (_optionalChain([input, 'access',
|
|
4002
|
+
if (_optionalChain([input, 'access', _259 => _259.runId, 'optionalAccess', _260 => _260.trim, 'call', _261 => _261()])) {
|
|
3977
4003
|
params.set("runId", input.runId.trim());
|
|
3978
4004
|
}
|
|
3979
4005
|
if (input.rowMode === "all" || input.rowMode === "live") {
|
|
@@ -3983,9 +4009,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3983
4009
|
`/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`,
|
|
3984
4010
|
{ signal: input.signal }
|
|
3985
4011
|
);
|
|
3986
|
-
const requestedRunId = _optionalChain([input, 'access',
|
|
4012
|
+
const requestedRunId = _optionalChain([input, 'access', _262 => _262.runId, 'optionalAccess', _263 => _263.trim, 'call', _264 => _264()]) || "";
|
|
3987
4013
|
if (requestedRunId) {
|
|
3988
|
-
const confirmedRunId = _optionalChain([result, 'access',
|
|
4014
|
+
const confirmedRunId = _optionalChain([result, 'access', _265 => _265.scope, 'optionalAccess', _266 => _266.kind]) === "run" ? result.scope.runId.trim() : "";
|
|
3989
4015
|
const foreignRowRunIds = [
|
|
3990
4016
|
...new Set(
|
|
3991
4017
|
result.rows.map(
|
|
@@ -3993,7 +4019,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3993
4019
|
).filter((runId) => runId && runId !== requestedRunId)
|
|
3994
4020
|
)
|
|
3995
4021
|
];
|
|
3996
|
-
if (_optionalChain([result, 'access',
|
|
4022
|
+
if (_optionalChain([result, 'access', _267 => _267.scope, 'optionalAccess', _268 => _268.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
|
|
3997
4023
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
3998
4024
|
`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.`,
|
|
3999
4025
|
void 0,
|
|
@@ -4022,7 +4048,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4022
4048
|
async stopRun(runId, options) {
|
|
4023
4049
|
return this.http.post(
|
|
4024
4050
|
`/api/v2/runs/${encodeURIComponent(runId)}/stop`,
|
|
4025
|
-
_optionalChain([options, 'optionalAccess',
|
|
4051
|
+
_optionalChain([options, 'optionalAccess', _269 => _269.reason]) ? { reason: options.reason } : {}
|
|
4026
4052
|
);
|
|
4027
4053
|
}
|
|
4028
4054
|
/**
|
|
@@ -4040,11 +4066,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4040
4066
|
* need to clear the workspace run-slot state without knowing each run id.
|
|
4041
4067
|
*/
|
|
4042
4068
|
async stopAllRuns(options) {
|
|
4043
|
-
const dryRun = _optionalChain([options, 'optionalAccess',
|
|
4069
|
+
const dryRun = _optionalChain([options, 'optionalAccess', _270 => _270.dryRun]) === true;
|
|
4044
4070
|
const result = await this.http.post(
|
|
4045
4071
|
"/api/v2/runs/stop-all",
|
|
4046
4072
|
{
|
|
4047
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4073
|
+
..._optionalChain([options, 'optionalAccess', _271 => _271.reason]) ? { reason: options.reason } : {},
|
|
4048
4074
|
...dryRun ? { dryRun: true } : {}
|
|
4049
4075
|
}
|
|
4050
4076
|
);
|
|
@@ -4065,7 +4091,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4065
4091
|
* `origin: "owned"` for org-owned plays.
|
|
4066
4092
|
*/
|
|
4067
4093
|
async listPlays(options) {
|
|
4068
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
4094
|
+
if (!_optionalChain([options, 'optionalAccess', _272 => _272.grep, 'optionalAccess', _273 => _273.trim, 'call', _274 => _274()])) {
|
|
4069
4095
|
return (await this.requestPlaysPage(options, false)).plays;
|
|
4070
4096
|
}
|
|
4071
4097
|
const plays = [];
|
|
@@ -4087,45 +4113,45 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4087
4113
|
}
|
|
4088
4114
|
async requestPlaysPage(options, paginateInventory = true) {
|
|
4089
4115
|
const params = new URLSearchParams();
|
|
4090
|
-
if (paginateInventory && !_optionalChain([options, 'optionalAccess',
|
|
4116
|
+
if (paginateInventory && !_optionalChain([options, 'optionalAccess', _275 => _275.grep, 'optionalAccess', _276 => _276.trim, 'call', _277 => _277()]))
|
|
4091
4117
|
params.set("inventory_paginated", "1");
|
|
4092
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4093
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4118
|
+
if (_optionalChain([options, 'optionalAccess', _278 => _278.origin])) params.set("origin", options.origin);
|
|
4119
|
+
if (_optionalChain([options, 'optionalAccess', _279 => _279.categories])) {
|
|
4094
4120
|
params.set(
|
|
4095
4121
|
"categories",
|
|
4096
4122
|
Array.isArray(options.categories) ? options.categories.join(",") : options.categories
|
|
4097
4123
|
);
|
|
4098
4124
|
}
|
|
4099
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4125
|
+
if (_optionalChain([options, 'optionalAccess', _280 => _280.categories]) || _optionalChain([options, 'optionalAccess', _281 => _281.includeToolCategories])) {
|
|
4100
4126
|
params.set("include_tool_categories", "1");
|
|
4101
4127
|
}
|
|
4102
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4128
|
+
if (_optionalChain([options, 'optionalAccess', _282 => _282.tags])) {
|
|
4103
4129
|
params.set(
|
|
4104
4130
|
"tags",
|
|
4105
4131
|
Array.isArray(options.tags) ? options.tags.join(",") : options.tags
|
|
4106
4132
|
);
|
|
4107
4133
|
}
|
|
4108
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4109
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4134
|
+
if (_optionalChain([options, 'optionalAccess', _283 => _283.includeArchived])) params.set("include_archived", "1");
|
|
4135
|
+
if (_optionalChain([options, 'optionalAccess', _284 => _284.includeCostEstimates])) {
|
|
4110
4136
|
params.set("include_cost_estimates", "1");
|
|
4111
4137
|
}
|
|
4112
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4138
|
+
if (_optionalChain([options, 'optionalAccess', _285 => _285.grep, 'optionalAccess', _286 => _286.trim, 'call', _287 => _287()])) {
|
|
4113
4139
|
params.set("grep", options.grep.trim());
|
|
4114
4140
|
params.set("limit", "60");
|
|
4115
4141
|
}
|
|
4116
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4142
|
+
if (_optionalChain([options, 'optionalAccess', _288 => _288.limit]) !== void 0) {
|
|
4117
4143
|
if (!Number.isSafeInteger(options.limit) || options.limit < 1) {
|
|
4118
4144
|
throw new Error("Play page limit must be a positive integer");
|
|
4119
4145
|
}
|
|
4120
4146
|
params.set("limit", String(options.limit));
|
|
4121
4147
|
}
|
|
4122
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4148
|
+
if (_optionalChain([options, 'optionalAccess', _289 => _289.cursor])) params.set("cursor", options.cursor);
|
|
4123
4149
|
const suffix = params.size ? `?${params.toString()}` : "";
|
|
4124
4150
|
const response = await this.http.get(`/api/v2/plays${suffix}`);
|
|
4125
4151
|
return {
|
|
4126
4152
|
plays: _nullishCoalesce(response.plays, () => ( [])),
|
|
4127
|
-
cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access',
|
|
4128
|
-
hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access',
|
|
4153
|
+
cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _290 => _290.pagination, 'optionalAccess', _291 => _291.cursor]), () => ( response.cursor)), () => ( null)),
|
|
4154
|
+
hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _292 => _292.pagination, 'optionalAccess', _293 => _293.hasMore]), () => ( response.hasMore)))
|
|
4129
4155
|
};
|
|
4130
4156
|
}
|
|
4131
4157
|
/** Read definition-level settings, independently of code revisions. */
|
|
@@ -4175,8 +4201,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4175
4201
|
return this.http.post("/api/v2/integrations/connect", {
|
|
4176
4202
|
provider: "slack",
|
|
4177
4203
|
scopes: [...PRODUCT_NOTIFICATION_SLACK_OAUTH_SCOPES],
|
|
4178
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4179
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4204
|
+
..._optionalChain([options, 'optionalAccess', _294 => _294.successUrl]) ? { success_url: options.successUrl } : {},
|
|
4205
|
+
..._optionalChain([options, 'optionalAccess', _295 => _295.failureUrl]) ? { failure_url: options.failureUrl } : {}
|
|
4180
4206
|
});
|
|
4181
4207
|
}
|
|
4182
4208
|
/** List Slack channels visible to the connected Deepline Slack app. */
|
|
@@ -4251,7 +4277,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4251
4277
|
}
|
|
4252
4278
|
const targets = input.targets.map(parseNotificationGroupTarget);
|
|
4253
4279
|
const legacyEvents = _nullishCoalesce(input.legacyEvents, () => ( []));
|
|
4254
|
-
const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access',
|
|
4280
|
+
const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _296 => _296[0], 'optionalAccess', _297 => _297.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
|
|
4255
4281
|
if (legacyEvents.length > 0 && !legacyTarget) {
|
|
4256
4282
|
throw new Error(
|
|
4257
4283
|
"--for is supported only by the legacy one-Slack-target form. Create the group first, then add rules in notification configuration."
|
|
@@ -4287,7 +4313,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4287
4313
|
const existingGroup = current.configuration.groups.find(
|
|
4288
4314
|
(candidate) => candidate.name.toLowerCase() === name.toLowerCase()
|
|
4289
4315
|
);
|
|
4290
|
-
const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess',
|
|
4316
|
+
const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _298 => _298.groupKey]), () => ( notificationObjectKey("group")));
|
|
4291
4317
|
const group = _nullishCoalesce(existingGroup, () => ( {
|
|
4292
4318
|
groupKey,
|
|
4293
4319
|
name,
|
|
@@ -4456,6 +4482,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4456
4482
|
* contracts and stable run behavior.
|
|
4457
4483
|
*/
|
|
4458
4484
|
async searchPlays(options) {
|
|
4485
|
+
if (options.cliInvocationId !== void 0) {
|
|
4486
|
+
validateCliInvocationId(options.cliInvocationId);
|
|
4487
|
+
}
|
|
4459
4488
|
const params = new URLSearchParams();
|
|
4460
4489
|
params.set("search", options.query.trim());
|
|
4461
4490
|
const scope = _nullishCoalesce(options.scope, () => ( "prebuilt"));
|
|
@@ -4463,7 +4492,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4463
4492
|
params.set("origin", scope);
|
|
4464
4493
|
}
|
|
4465
4494
|
const response = await this.http.get(
|
|
4466
|
-
`/api/v2/plays?${params.toString()}
|
|
4495
|
+
`/api/v2/plays?${params.toString()}`,
|
|
4496
|
+
{
|
|
4497
|
+
...options.cliInvocationId !== void 0 ? {
|
|
4498
|
+
headers: {
|
|
4499
|
+
"x-deepline-cli-invocation-id": options.cliInvocationId
|
|
4500
|
+
}
|
|
4501
|
+
} : {}
|
|
4502
|
+
}
|
|
4467
4503
|
);
|
|
4468
4504
|
const plays = (_nullishCoalesce(response.plays, () => ( []))).map(
|
|
4469
4505
|
(play) => this.summarizePlayListItem(play, options)
|
|
@@ -4495,13 +4531,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4495
4531
|
*/
|
|
4496
4532
|
async getPlay(name, options) {
|
|
4497
4533
|
const encodedName = encodeURIComponent(name);
|
|
4498
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
4534
|
+
const query = _optionalChain([options, 'optionalAccess', _299 => _299.source]) ? `?include=source&revision=${encodeURIComponent(options.source)}` : _optionalChain([options, 'optionalAccess', _300 => _300.guidance]) ? "?include=guidance" : "";
|
|
4499
4535
|
return this.http.get(`/api/v2/plays/${encodedName}${query}`);
|
|
4500
4536
|
}
|
|
4501
4537
|
/** Read one trigger inventory page without loading run histories. */
|
|
4502
4538
|
async listPlayTriggerInventory(options) {
|
|
4503
4539
|
const params = new URLSearchParams({ view: "inventory" });
|
|
4504
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4540
|
+
if (_optionalChain([options, 'optionalAccess', _301 => _301.cursor])) params.set("cursor", options.cursor);
|
|
4505
4541
|
return this.http.get(`/api/v2/plays/triggers?${params}`);
|
|
4506
4542
|
}
|
|
4507
4543
|
/** Read one trigger's recent runs, with an explicit partial-history flag. */
|
|
@@ -4510,7 +4546,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4510
4546
|
view: "history",
|
|
4511
4547
|
binding_id: bindingId
|
|
4512
4548
|
});
|
|
4513
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4549
|
+
if (_optionalChain([options, 'optionalAccess', _302 => _302.limit]) !== void 0)
|
|
4514
4550
|
params.set("history_limit", String(options.limit));
|
|
4515
4551
|
return this.http.get(`/api/v2/plays/triggers?${params}`);
|
|
4516
4552
|
}
|
|
@@ -4546,7 +4582,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4546
4582
|
*/
|
|
4547
4583
|
async listPlayVersions(name, options) {
|
|
4548
4584
|
const encodedName = encodeURIComponent(name);
|
|
4549
|
-
const suffix = _optionalChain([options, 'optionalAccess',
|
|
4585
|
+
const suffix = _optionalChain([options, 'optionalAccess', _303 => _303.full]) ? "?full=true" : "";
|
|
4550
4586
|
const response = await this.http.get(
|
|
4551
4587
|
`/api/v2/plays/${encodedName}/versions${suffix}`
|
|
4552
4588
|
);
|
|
@@ -4699,14 +4735,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4699
4735
|
*/
|
|
4700
4736
|
async runPlay(code, csvPath, name, options) {
|
|
4701
4737
|
const { workflowId } = await this.submitPlay(code, csvPath, name, {
|
|
4702
|
-
input: _optionalChain([options, 'optionalAccess',
|
|
4703
|
-
sourceCode: _optionalChain([options, 'optionalAccess',
|
|
4704
|
-
artifact: _optionalChain([options, 'optionalAccess',
|
|
4705
|
-
compilerManifest: _optionalChain([options, 'optionalAccess',
|
|
4706
|
-
inputFile: _optionalChain([options, 'optionalAccess',
|
|
4707
|
-
packagedFiles: _optionalChain([options, 'optionalAccess',
|
|
4708
|
-
force: _optionalChain([options, 'optionalAccess',
|
|
4709
|
-
forceToolRefresh: _optionalChain([options, 'optionalAccess',
|
|
4738
|
+
input: _optionalChain([options, 'optionalAccess', _304 => _304.input]),
|
|
4739
|
+
sourceCode: _optionalChain([options, 'optionalAccess', _305 => _305.sourceCode]),
|
|
4740
|
+
artifact: _optionalChain([options, 'optionalAccess', _306 => _306.artifact]),
|
|
4741
|
+
compilerManifest: _optionalChain([options, 'optionalAccess', _307 => _307.compilerManifest]),
|
|
4742
|
+
inputFile: _optionalChain([options, 'optionalAccess', _308 => _308.inputFile]),
|
|
4743
|
+
packagedFiles: _optionalChain([options, 'optionalAccess', _309 => _309.packagedFiles]),
|
|
4744
|
+
force: _optionalChain([options, 'optionalAccess', _310 => _310.force]),
|
|
4745
|
+
forceToolRefresh: _optionalChain([options, 'optionalAccess', _311 => _311.forceToolRefresh])
|
|
4710
4746
|
});
|
|
4711
4747
|
const start = Date.now();
|
|
4712
4748
|
const state = {
|
|
@@ -4717,7 +4753,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4717
4753
|
latest: null
|
|
4718
4754
|
};
|
|
4719
4755
|
let terminalObserved = null;
|
|
4720
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4756
|
+
if (_optionalChain([options, 'optionalAccess', _312 => _312.signal, 'optionalAccess', _313 => _313.aborted])) {
|
|
4721
4757
|
await this.cancelPlay(workflowId);
|
|
4722
4758
|
return {
|
|
4723
4759
|
success: false,
|
|
@@ -4728,9 +4764,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4728
4764
|
};
|
|
4729
4765
|
}
|
|
4730
4766
|
for await (const event of this.watchRunEvents(workflowId, {
|
|
4731
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
4767
|
+
signal: _optionalChain([options, 'optionalAccess', _314 => _314.signal])
|
|
4732
4768
|
})) {
|
|
4733
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4769
|
+
if (_optionalChain([options, 'optionalAccess', _315 => _315.signal, 'optionalAccess', _316 => _316.aborted])) {
|
|
4734
4770
|
await this.cancelPlay(workflowId);
|
|
4735
4771
|
return {
|
|
4736
4772
|
success: false,
|
|
@@ -4740,19 +4776,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4740
4776
|
error: "Cancelled by user"
|
|
4741
4777
|
};
|
|
4742
4778
|
}
|
|
4743
|
-
const previousStatus = _optionalChain([state, 'access',
|
|
4779
|
+
const previousStatus = _optionalChain([state, 'access', _317 => _317.latest, 'optionalAccess', _318 => _318.status]);
|
|
4744
4780
|
const status = updatePlayLiveStatusState(state, event);
|
|
4745
4781
|
if (!status) {
|
|
4746
4782
|
continue;
|
|
4747
4783
|
}
|
|
4748
4784
|
if (event.type !== "play.run.status" || status.status !== previousStatus) {
|
|
4749
|
-
_optionalChain([options, 'optionalAccess',
|
|
4785
|
+
_optionalChain([options, 'optionalAccess', _319 => _319.onProgress, 'optionalCall', _320 => _320(status)]);
|
|
4750
4786
|
}
|
|
4751
4787
|
if (_chunkLA46MMTLjs.isTerminalPlayRunLifecycleStatus.call(void 0, status.status)) {
|
|
4752
4788
|
terminalObserved = status;
|
|
4753
4789
|
}
|
|
4754
4790
|
}
|
|
4755
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4791
|
+
if (_optionalChain([options, 'optionalAccess', _321 => _321.signal, 'optionalAccess', _322 => _322.aborted])) {
|
|
4756
4792
|
await this.cancelPlay(workflowId);
|
|
4757
4793
|
return {
|
|
4758
4794
|
success: false,
|
|
@@ -4805,7 +4841,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4805
4841
|
const response = await this.http.get(
|
|
4806
4842
|
`/api/v2/usage/events?request_id=${encodeURIComponent(normalizedRequestId)}`
|
|
4807
4843
|
);
|
|
4808
|
-
const event = _optionalChain([response, 'access',
|
|
4844
|
+
const event = _optionalChain([response, 'access', _323 => _323.entries, 'optionalAccess', _324 => _324[0]]);
|
|
4809
4845
|
if (!event) {
|
|
4810
4846
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4811
4847
|
"No usage event was found for this request_id.",
|
|
@@ -4931,7 +4967,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4931
4967
|
async cancelBillingSubscription(options) {
|
|
4932
4968
|
return this.http.post(
|
|
4933
4969
|
"/api/v2/billing/subscription/cancel",
|
|
4934
|
-
{ action: _optionalChain([options, 'optionalAccess',
|
|
4970
|
+
{ action: _optionalChain([options, 'optionalAccess', _325 => _325.undo]) ? "undo_cancel" : "cancel" }
|
|
4935
4971
|
);
|
|
4936
4972
|
}
|
|
4937
4973
|
/**
|
|
@@ -4943,7 +4979,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4943
4979
|
*/
|
|
4944
4980
|
async listBillingInvoices(options) {
|
|
4945
4981
|
const params = new URLSearchParams();
|
|
4946
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4982
|
+
if (_optionalChain([options, 'optionalAccess', _326 => _326.limit]) !== void 0) {
|
|
4947
4983
|
params.set("limit", String(options.limit));
|
|
4948
4984
|
}
|
|
4949
4985
|
const suffix = Array.from(params).length > 0 ? `?${params.toString()}` : "";
|
|
@@ -5053,7 +5089,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5053
5089
|
/** Create a Stripe-hosted portal session for payment recovery and invoices. */
|
|
5054
5090
|
async createTargetBillingPortalSession(options) {
|
|
5055
5091
|
const response = await this.http.post(
|
|
5056
|
-
_optionalChain([options, 'optionalAccess',
|
|
5092
|
+
_optionalChain([options, 'optionalAccess', _327 => _327.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
|
|
5057
5093
|
{}
|
|
5058
5094
|
);
|
|
5059
5095
|
return response.data;
|
|
@@ -5103,8 +5139,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5103
5139
|
return this.http.request("/api/v2/monitors/audit", {
|
|
5104
5140
|
method: "POST",
|
|
5105
5141
|
body: {
|
|
5106
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5107
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5142
|
+
..._optionalChain([options, 'optionalAccess', _328 => _328.fleetId]) ? { fleet_id: options.fleetId } : {},
|
|
5143
|
+
..._optionalChain([options, 'optionalAccess', _329 => _329.cursor]) ? { cursor: options.cursor } : {}
|
|
5108
5144
|
},
|
|
5109
5145
|
maxRetries: 0
|
|
5110
5146
|
});
|
|
@@ -5114,8 +5150,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5114
5150
|
return this.http.request("/api/v2/monitors/repair", {
|
|
5115
5151
|
method: "POST",
|
|
5116
5152
|
body: {
|
|
5117
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5118
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5153
|
+
..._optionalChain([options, 'optionalAccess', _330 => _330.fleetId]) ? { fleet_id: options.fleetId } : {},
|
|
5154
|
+
..._optionalChain([options, 'optionalAccess', _331 => _331.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
|
|
5119
5155
|
},
|
|
5120
5156
|
maxRetries: 0
|
|
5121
5157
|
});
|
|
@@ -5123,7 +5159,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5123
5159
|
/** Delivery and convergence health. Prefer `client.monitors.health(...)`. */
|
|
5124
5160
|
async readMonitorsHealth(options) {
|
|
5125
5161
|
const params = new URLSearchParams();
|
|
5126
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5162
|
+
if (_optionalChain([options, 'optionalAccess', _332 => _332.fleetId])) params.set("fleet_id", options.fleetId);
|
|
5127
5163
|
const query = params.toString();
|
|
5128
5164
|
const suffix = query ? `?${query}` : "";
|
|
5129
5165
|
return this.http.request(
|
|
@@ -5196,7 +5232,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5196
5232
|
);
|
|
5197
5233
|
}
|
|
5198
5234
|
const params = new URLSearchParams();
|
|
5199
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5235
|
+
if (_optionalChain([options, 'optionalAccess', _333 => _333.cursor])) params.set("cursor", options.cursor);
|
|
5200
5236
|
const suffix = params.size > 0 ? `?${params}` : "";
|
|
5201
5237
|
return this.http.request(
|
|
5202
5238
|
`/api/v2/monitors/batch/${encodeURIComponent(runId)}${suffix}`,
|
|
@@ -5240,7 +5276,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5240
5276
|
* `client.monitors.deploy(...)`.
|
|
5241
5277
|
*/
|
|
5242
5278
|
async deployMonitor(definition, options) {
|
|
5243
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5279
|
+
if (_optionalChain([options, 'optionalAccess', _334 => _334.dryRun])) {
|
|
5244
5280
|
return this.http.request("/api/v2/monitors/check", {
|
|
5245
5281
|
method: "POST",
|
|
5246
5282
|
body: definition
|
|
@@ -5276,12 +5312,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5276
5312
|
/** List deployed monitors. Prefer `client.monitors.list(...)`. */
|
|
5277
5313
|
async listMonitors(options) {
|
|
5278
5314
|
const params = new URLSearchParams();
|
|
5279
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5280
|
-
else if (_optionalChain([options, 'optionalAccess',
|
|
5281
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5315
|
+
if (_optionalChain([options, 'optionalAccess', _335 => _335.state])) params.set("state", options.state);
|
|
5316
|
+
else if (_optionalChain([options, 'optionalAccess', _336 => _336.status])) params.set("status", options.status);
|
|
5317
|
+
if (_optionalChain([options, 'optionalAccess', _337 => _337.limit]) !== void 0)
|
|
5282
5318
|
params.set("limit", String(options.limit));
|
|
5283
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5284
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5319
|
+
if (_optionalChain([options, 'optionalAccess', _338 => _338.cursor])) params.set("cursor", options.cursor);
|
|
5320
|
+
if (_optionalChain([options, 'optionalAccess', _339 => _339.includeConsumers])) params.set("include_consumers", "true");
|
|
5285
5321
|
const query = params.toString();
|
|
5286
5322
|
const suffix = query ? `?${query}` : "";
|
|
5287
5323
|
return this.http.request(
|
|
@@ -5297,7 +5333,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5297
5333
|
);
|
|
5298
5334
|
}
|
|
5299
5335
|
async testMonitorWebhook(key, payload, options) {
|
|
5300
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5336
|
+
if (_optionalChain([options, 'optionalAccess', _340 => _340.dispatch]) === true || _optionalChain([options, 'optionalAccess', _341 => _341.validationOnly]) === false) {
|
|
5301
5337
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
5302
5338
|
"Monitor tests are validation-only and cannot dispatch events.",
|
|
5303
5339
|
void 0,
|
|
@@ -5352,7 +5388,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5352
5388
|
}
|
|
5353
5389
|
/** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
|
|
5354
5390
|
async deleteMonitor(key, options) {
|
|
5355
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5391
|
+
if (_optionalChain([options, 'optionalAccess', _342 => _342.localOnly]) === true) {
|
|
5356
5392
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
5357
5393
|
"localOnly monitor deletion is no longer supported. Monitor deletion always deprovisions the upstream provider resource.",
|
|
5358
5394
|
void 0,
|
|
@@ -5360,11 +5396,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5360
5396
|
);
|
|
5361
5397
|
}
|
|
5362
5398
|
const params = new URLSearchParams();
|
|
5363
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5399
|
+
if (_optionalChain([options, 'optionalAccess', _343 => _343.dryRun])) params.set("dry_run", "true");
|
|
5364
5400
|
const query = params.toString();
|
|
5365
5401
|
return this.http.request(
|
|
5366
5402
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
|
|
5367
|
-
_optionalChain([options, 'optionalAccess',
|
|
5403
|
+
_optionalChain([options, 'optionalAccess', _344 => _344.dryRun]) ? { method: "DELETE" } : {
|
|
5368
5404
|
method: "DELETE",
|
|
5369
5405
|
// Deletion is a provider lifecycle operation. A timeout is an
|
|
5370
5406
|
// unknown outcome, not authority to begin another delete attempt.
|
|
@@ -5377,10 +5413,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5377
5413
|
* Prefer `client.monitors.reactivate(...)`.
|
|
5378
5414
|
*/
|
|
5379
5415
|
async reactivateMonitor(key, options) {
|
|
5380
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
5416
|
+
const query = _optionalChain([options, 'optionalAccess', _345 => _345.dryRun]) ? "?dry_run=true" : "";
|
|
5381
5417
|
return this.http.request(
|
|
5382
5418
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
|
|
5383
|
-
_optionalChain([options, 'optionalAccess',
|
|
5419
|
+
_optionalChain([options, 'optionalAccess', _346 => _346.dryRun]) ? { method: "POST", body: {} } : {
|
|
5384
5420
|
method: "POST",
|
|
5385
5421
|
body: {},
|
|
5386
5422
|
// Reactivation can create an upstream resource, so it must not use
|
|
@@ -5394,7 +5430,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5394
5430
|
// ——————————————————————————————————————————————————————————
|
|
5395
5431
|
static __initStatic() {this.MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH = 96}
|
|
5396
5432
|
monitorJobIdempotencyKey(operation) {
|
|
5397
|
-
const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access',
|
|
5433
|
+
const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _347 => _347.crypto, 'optionalAccess', _348 => _348.randomUUID, 'optionalCall', _349 => _349()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
|
|
5398
5434
|
const prefix = "monitor-job-";
|
|
5399
5435
|
const safeOperation = operation.replace(/[^A-Za-z0-9._-]/g, "-");
|
|
5400
5436
|
const maxOperationLength = Math.max(
|
|
@@ -5405,7 +5441,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5405
5441
|
}
|
|
5406
5442
|
monitorJobHeaders(operation, idempotencyKey) {
|
|
5407
5443
|
return {
|
|
5408
|
-
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess',
|
|
5444
|
+
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _350 => _350.trim, 'call', _351 => _351()]) || this.monitorJobIdempotencyKey(operation)
|
|
5409
5445
|
};
|
|
5410
5446
|
}
|
|
5411
5447
|
async deployMonitorBatch(definitions, options) {
|
|
@@ -5416,7 +5452,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5416
5452
|
body: { version: 1, kind: "batch", monitors: definitions },
|
|
5417
5453
|
headers: this.monitorJobHeaders(
|
|
5418
5454
|
"batch-deploy",
|
|
5419
|
-
_optionalChain([options, 'optionalAccess',
|
|
5455
|
+
_optionalChain([options, 'optionalAccess', _352 => _352.idempotencyKey])
|
|
5420
5456
|
),
|
|
5421
5457
|
maxRetries: 0,
|
|
5422
5458
|
exactUrlOnly: true
|
|
@@ -5435,11 +5471,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5435
5471
|
version: 1,
|
|
5436
5472
|
kind: "batch",
|
|
5437
5473
|
monitors: definitions,
|
|
5438
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5474
|
+
..._optionalChain([options, 'optionalAccess', _353 => _353.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
|
|
5439
5475
|
},
|
|
5440
5476
|
headers: this.monitorJobHeaders(
|
|
5441
5477
|
`batch-sync-${batchId}`,
|
|
5442
|
-
_optionalChain([options, 'optionalAccess',
|
|
5478
|
+
_optionalChain([options, 'optionalAccess', _354 => _354.idempotencyKey])
|
|
5443
5479
|
),
|
|
5444
5480
|
maxRetries: 0,
|
|
5445
5481
|
exactUrlOnly: true
|
|
@@ -5454,7 +5490,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5454
5490
|
body: {},
|
|
5455
5491
|
headers: this.monitorJobHeaders(
|
|
5456
5492
|
`batch-start-${batchId}`,
|
|
5457
|
-
_optionalChain([options, 'optionalAccess',
|
|
5493
|
+
_optionalChain([options, 'optionalAccess', _355 => _355.idempotencyKey])
|
|
5458
5494
|
),
|
|
5459
5495
|
maxRetries: 0,
|
|
5460
5496
|
exactUrlOnly: true
|
|
@@ -5469,7 +5505,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5469
5505
|
body: {},
|
|
5470
5506
|
headers: this.monitorJobHeaders(
|
|
5471
5507
|
`batch-stop-${batchId}`,
|
|
5472
|
-
_optionalChain([options, 'optionalAccess',
|
|
5508
|
+
_optionalChain([options, 'optionalAccess', _356 => _356.idempotencyKey])
|
|
5473
5509
|
),
|
|
5474
5510
|
maxRetries: 0,
|
|
5475
5511
|
exactUrlOnly: true
|
|
@@ -5490,7 +5526,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5490
5526
|
body: {},
|
|
5491
5527
|
headers: this.monitorJobHeaders(
|
|
5492
5528
|
`${action}-${monitorKey}`,
|
|
5493
|
-
_optionalChain([options, 'optionalAccess',
|
|
5529
|
+
_optionalChain([options, 'optionalAccess', _357 => _357.idempotencyKey])
|
|
5494
5530
|
),
|
|
5495
5531
|
maxRetries: 0,
|
|
5496
5532
|
exactUrlOnly: true
|
|
@@ -5503,7 +5539,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5503
5539
|
body: definition,
|
|
5504
5540
|
headers: this.monitorJobHeaders(
|
|
5505
5541
|
`sync-${definition.key}`,
|
|
5506
|
-
_optionalChain([options, 'optionalAccess',
|
|
5542
|
+
_optionalChain([options, 'optionalAccess', _358 => _358.idempotencyKey])
|
|
5507
5543
|
),
|
|
5508
5544
|
maxRetries: 0,
|
|
5509
5545
|
exactUrlOnly: true
|
|
@@ -5516,7 +5552,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5516
5552
|
);
|
|
5517
5553
|
}
|
|
5518
5554
|
async getMonitorJobLogs(jobId, options) {
|
|
5519
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
5555
|
+
const query = _optionalChain([options, 'optionalAccess', _359 => _359.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
|
|
5520
5556
|
return this.http.request(
|
|
5521
5557
|
`/api/v2/monitors/jobs/${encodeURIComponent(jobId)}/logs${query}`,
|
|
5522
5558
|
{ method: "GET" }
|
|
@@ -5529,15 +5565,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5529
5565
|
);
|
|
5530
5566
|
}
|
|
5531
5567
|
async waitForMonitorJob(jobId, options) {
|
|
5532
|
-
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
5533
|
-
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
5568
|
+
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _360 => _360.timeoutMs]), () => ( 10 * 6e4)));
|
|
5569
|
+
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _361 => _361.pollIntervalMs]), () => ( 2e3)));
|
|
5534
5570
|
const terminal = /* @__PURE__ */ new Set(["succeeded", "failed", "cancelled"]);
|
|
5535
5571
|
const startedAt = Date.now();
|
|
5536
5572
|
let latest = await this.getMonitorJob(jobId);
|
|
5537
5573
|
while (true) {
|
|
5538
|
-
_optionalChain([options, 'optionalAccess',
|
|
5574
|
+
_optionalChain([options, 'optionalAccess', _362 => _362.onProgress, 'optionalCall', _363 => _363(latest)]);
|
|
5539
5575
|
const job = latest.job;
|
|
5540
|
-
const state = typeof _optionalChain([job, 'optionalAccess',
|
|
5576
|
+
const state = typeof _optionalChain([job, 'optionalAccess', _364 => _364.state]) === "string" ? job.state : void 0;
|
|
5541
5577
|
if (state && terminal.has(state)) return latest;
|
|
5542
5578
|
if (Date.now() - startedAt >= timeoutMs) return latest;
|
|
5543
5579
|
await sleep(pollIntervalMs);
|
|
@@ -5548,12 +5584,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5548
5584
|
// Monitor Fleets
|
|
5549
5585
|
// ——————————————————————————————————————————————————————————
|
|
5550
5586
|
monitorFleetIdempotencyKey(operation) {
|
|
5551
|
-
const uuid = _optionalChain([globalThis, 'access',
|
|
5587
|
+
const uuid = _optionalChain([globalThis, 'access', _365 => _365.crypto, 'optionalAccess', _366 => _366.randomUUID, 'optionalCall', _367 => _367()]);
|
|
5552
5588
|
return `monitor-fleet-${operation}-${_nullishCoalesce(uuid, () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`;
|
|
5553
5589
|
}
|
|
5554
5590
|
monitorFleetHeaders(operation, idempotencyKey) {
|
|
5555
5591
|
return {
|
|
5556
|
-
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess',
|
|
5592
|
+
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _368 => _368.trim, 'call', _369 => _369()]) || this.monitorFleetIdempotencyKey(operation)
|
|
5557
5593
|
};
|
|
5558
5594
|
}
|
|
5559
5595
|
monitorFleetPath(fleetId) {
|
|
@@ -5573,15 +5609,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5573
5609
|
const fleetId = typeof definitionOrId === "string" ? definitionOrId : definitionOrId.id;
|
|
5574
5610
|
const body = {
|
|
5575
5611
|
...typeof definitionOrId === "string" ? {} : { definition: definitionOrId },
|
|
5576
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5577
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5612
|
+
..._optionalChain([options, 'optionalAccess', _370 => _370.dryRun]) ? { dry_run: true } : {},
|
|
5613
|
+
..._optionalChain([options, 'optionalAccess', _371 => _371.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
|
|
5578
5614
|
};
|
|
5579
5615
|
return this.http.request(
|
|
5580
5616
|
this.monitorFleetPath(fleetId),
|
|
5581
5617
|
{
|
|
5582
5618
|
method: "PUT",
|
|
5583
5619
|
body,
|
|
5584
|
-
headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess',
|
|
5620
|
+
headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _372 => _372.idempotencyKey])),
|
|
5585
5621
|
maxRetries: 0,
|
|
5586
5622
|
exactUrlOnly: true
|
|
5587
5623
|
}
|
|
@@ -5594,8 +5630,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5594
5630
|
}
|
|
5595
5631
|
async getMonitorFleet(fleetId, options) {
|
|
5596
5632
|
const params = new URLSearchParams();
|
|
5597
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5598
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5633
|
+
if (_optionalChain([options, 'optionalAccess', _373 => _373.drift])) params.set("drift", "1");
|
|
5634
|
+
if (_optionalChain([options, 'optionalAccess', _374 => _374.limit]) !== void 0)
|
|
5599
5635
|
params.set("limit", String(options.limit));
|
|
5600
5636
|
const query = params.toString();
|
|
5601
5637
|
return this.http.request(
|
|
@@ -5608,10 +5644,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5608
5644
|
this.monitorFleetPath(fleetId),
|
|
5609
5645
|
{
|
|
5610
5646
|
method: "DELETE",
|
|
5611
|
-
body: _optionalChain([options, 'optionalAccess',
|
|
5647
|
+
body: _optionalChain([options, 'optionalAccess', _375 => _375.dryRun]) ? { dry_run: true } : {},
|
|
5612
5648
|
headers: this.monitorFleetHeaders(
|
|
5613
5649
|
"deactivate",
|
|
5614
|
-
_optionalChain([options, 'optionalAccess',
|
|
5650
|
+
_optionalChain([options, 'optionalAccess', _376 => _376.idempotencyKey])
|
|
5615
5651
|
),
|
|
5616
5652
|
maxRetries: 0,
|
|
5617
5653
|
exactUrlOnly: true
|
|
@@ -5626,7 +5662,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5626
5662
|
body: {},
|
|
5627
5663
|
headers: this.monitorFleetHeaders(
|
|
5628
5664
|
"reactivate",
|
|
5629
|
-
_optionalChain([options, 'optionalAccess',
|
|
5665
|
+
_optionalChain([options, 'optionalAccess', _377 => _377.idempotencyKey])
|
|
5630
5666
|
),
|
|
5631
5667
|
maxRetries: 0,
|
|
5632
5668
|
exactUrlOnly: true
|
|
@@ -5643,13 +5679,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5643
5679
|
* identical to "the request failed".
|
|
5644
5680
|
*/
|
|
5645
5681
|
async waitForMonitorFleetConvergence(fleetId, options) {
|
|
5646
|
-
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
5647
|
-
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
5648
|
-
const terminal = _optionalChain([options, 'optionalAccess',
|
|
5682
|
+
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _378 => _378.timeoutMs]), () => ( 10 * 6e4)));
|
|
5683
|
+
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _379 => _379.pollIntervalMs]), () => ( 2e3)));
|
|
5684
|
+
const terminal = _optionalChain([options, 'optionalAccess', _380 => _380.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded"]) : /* @__PURE__ */ new Set(["converged", "degraded", "deactivated"]);
|
|
5649
5685
|
const startedAt = Date.now();
|
|
5650
5686
|
let latest = await this.getMonitorFleet(fleetId);
|
|
5651
5687
|
while (true) {
|
|
5652
|
-
_optionalChain([options, 'optionalAccess',
|
|
5688
|
+
_optionalChain([options, 'optionalAccess', _381 => _381.onProgress, 'optionalCall', _382 => _382(latest)]);
|
|
5653
5689
|
const status = typeof latest.status === "string" ? latest.status : void 0;
|
|
5654
5690
|
if (status && terminal.has(status)) return latest;
|
|
5655
5691
|
if (Date.now() - startedAt >= timeoutMs) return latest;
|