deepline 0.3.394 → 0.3.396
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundling-sources/sdk/src/client.ts +30 -162
- package/dist/bundling-sources/sdk/src/index.ts +1 -0
- package/dist/bundling-sources/sdk/src/plays/play-description.ts +167 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +1 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +1 -1
- package/dist/cli/{auth-OSXDAVCF.mjs → auth-3LTD62VL.mjs} +4 -4
- package/dist/cli/auth-562JPKOM.js +39 -0
- package/dist/cli/{billing-ZNNKX3UR.mjs → billing-DP7ZAJBO.mjs} +5 -4
- package/dist/cli/{billing-EKLYOXUY.js → billing-PA5OXEM5.js} +76 -75
- package/dist/cli/{chunk-BP33SIZF.mjs → chunk-23GAA3YO.mjs} +1 -1
- package/dist/cli/{chunk-KI635JN4.js → chunk-2VOLOWYZ.js} +1087 -1056
- package/dist/cli/{chunk-XXUDVEXK.mjs → chunk-3T4MCB5R.mjs} +1026 -995
- package/dist/cli/{chunk-VB6KECLU.mjs → chunk-5WNJF2T3.mjs} +102 -36
- package/dist/cli/{chunk-KIUMEOM5.js → chunk-772W2SAU.js} +8 -8
- package/dist/cli/{chunk-2MDDA7A4.js → chunk-7Z66NHUC.js} +26 -26
- package/dist/cli/{chunk-M57J2SK4.mjs → chunk-AUYXWELC.mjs} +2 -2
- package/dist/cli/{chunk-354JCXA2.js → chunk-AVHLATII.js} +50 -50
- package/dist/cli/{chunk-MLPU5SMZ.js → chunk-DC6LTULT.js} +2 -2
- package/dist/cli/chunk-EIMG75BT.mjs +130 -0
- package/dist/cli/{chunk-6YAUMG27.js → chunk-GNN4MY5X.js} +1 -1
- package/dist/cli/{chunk-UXFSWG3Q.mjs → chunk-I4T4XAA2.mjs} +4 -4
- package/dist/cli/{chunk-MFB2VKBO.mjs → chunk-JCN4DHF7.mjs} +2 -2
- package/dist/cli/{chunk-VK6FYZLP.js → chunk-KAEZNPUM.js} +23 -8
- package/dist/cli/chunk-KXMNM4AQ.js +130 -0
- package/dist/cli/{chunk-XRQ2AQL7.mjs → chunk-LOGGNW4H.mjs} +2 -2
- package/dist/cli/{chunk-RDXFGPJU.js → chunk-LWERJUKN.js} +218 -218
- package/dist/cli/{chunk-QIQBYKLB.js → chunk-ME6XRFLY.js} +15 -15
- package/dist/cli/{chunk-JHIJIHFB.mjs → chunk-MR6XCBQJ.mjs} +23 -131
- package/dist/cli/{chunk-TJI2EN6K.mjs → chunk-NHB5YUCS.mjs} +1 -1
- package/dist/cli/{chunk-ZMVJSS6N.js → chunk-NSOTASOP.js} +101 -35
- package/dist/cli/{chunk-ZYBGA4AR.mjs → chunk-QHGPA362.mjs} +18 -3
- package/dist/cli/{chunk-4P27AXEA.js → chunk-RMTASUAK.js} +65 -65
- package/dist/cli/{chunk-KGNTKMRG.js → chunk-RTO5QZWT.js} +6 -6
- package/dist/cli/{chunk-X63FDZJZ.mjs → chunk-TLQ3FZOC.mjs} +3 -3
- package/dist/cli/{chunk-CS6RAIVY.js → chunk-V7UP2F4U.js} +4 -4
- package/dist/cli/{chunk-FJGW5GXU.mjs → chunk-VE3U3SQC.mjs} +1 -1
- package/dist/cli/{chunk-E23BQ5SC.js → chunk-WQJJNIMQ.js} +241 -349
- package/dist/cli/{chunk-NR3DFKNF.mjs → chunk-XKZXO7D3.mjs} +1 -1
- package/dist/cli/{csv-5AXRB35H.mjs → csv-RLRR74RQ.mjs} +3 -3
- package/dist/cli/{csv-LU7O75WE.js → csv-TF576S77.js} +12 -12
- package/dist/cli/{db-F7YTFKVM.js → db-FDBJUTFO.js} +30 -29
- package/dist/cli/{db-7XP5UWEW.mjs → db-XORGNBIC.mjs} +5 -4
- package/dist/cli/{describe-K4ES5LIL.mjs → describe-6O2ENKTP.mjs} +86 -67
- package/dist/cli/{describe-FRH32RDV.js → describe-EFWNECHI.js} +100 -81
- package/dist/cli/{executions-RZV5XPT2.js → executions-SFYAXPF4.js} +7 -6
- package/dist/cli/{executions-IEHEHJUO.mjs → executions-YPP7WR77.mjs} +5 -4
- package/dist/cli/{feedback-3P65QTX3.js → feedback-5UZFYMGB.js} +7 -7
- package/dist/cli/{feedback-FPUVZBAN.mjs → feedback-RBGA5ARU.mjs} +3 -3
- package/dist/cli/git-5LDY5ZID.js +23 -0
- package/dist/cli/{git-GLVVP7TY.mjs → git-IRSAJEK2.mjs} +4 -4
- package/dist/cli/index.js +93 -93
- package/dist/cli/index.mjs +42 -42
- package/dist/cli/{legacy-noops-XKSGZR7Q.js → legacy-noops-CVAOQY2F.js} +7 -7
- package/dist/cli/{legacy-noops-3MOI6NBM.mjs → legacy-noops-NA7N6ZOU.mjs} +4 -4
- package/dist/cli/{monitors-NZ2DYNST.js → monitors-4OMRXCXP.js} +86 -85
- package/dist/cli/{monitors-FTBGNEFG.mjs → monitors-ILZ2XHYG.mjs} +5 -4
- package/dist/cli/{org-V2J5RBCN.mjs → org-QDDXAE3J.mjs} +5 -4
- package/dist/cli/{org-MCKDQXIV.js → org-YGNJDD2X.js} +65 -64
- package/dist/cli/{chunk-RBJYWRCF.js → play-L535H26U.js} +270 -325
- package/dist/cli/{chunk-5BB2RGAX.mjs → play-VT6OHB2D.mjs} +77 -132
- package/dist/cli/{providers-2JEZ2264.js → providers-GPZ6PQAL.js} +8 -7
- package/dist/cli/{providers-I6RQJZFZ.mjs → providers-KG4W5MPK.mjs} +5 -4
- package/dist/cli/{quickstart-BIDQDMO4.mjs → quickstart-2JDGTXIG.mjs} +3 -3
- package/dist/cli/{quickstart-GJ2RPDU3.js → quickstart-UI27S5LO.js} +5 -5
- package/dist/cli/search-MGWROZ33.js +28 -0
- package/dist/cli/{search-ELRXFWG5.mjs → search-PW3RAUX7.mjs} +6 -5
- package/dist/cli/{secrets-SQXGZXIC.mjs → secrets-HNOMK5A2.mjs} +5 -4
- package/dist/cli/{secrets-53IT6VXD.js → secrets-WFAXOUZE.js} +14 -13
- package/dist/cli/{sessions-CAV5M77Y.js → sessions-366KROUA.js} +5 -5
- package/dist/cli/{sessions-2X5QF7SL.mjs → sessions-XLX3E5UO.mjs} +4 -4
- package/dist/cli/{settings-532WNAZO.js → settings-GADAG2UK.js} +75 -74
- package/dist/cli/{settings-7P67VGCJ.mjs → settings-YNZ4YKCH.mjs} +8 -7
- package/dist/cli/{setup-QGGBV2LE.mjs → setup-PSEHIUXO.mjs} +6 -6
- package/dist/cli/{setup-6L2VSUWJ.js → setup-R5YO7GT6.js} +41 -41
- package/dist/cli/skills-JF2LPEGM.js +28 -0
- package/dist/cli/{skills-3FE62WBG.mjs → skills-LTQBP6CZ.mjs} +4 -4
- package/dist/cli/tools-CP2PEFRN.js +34 -0
- package/dist/cli/{tools-DMR25DEF.mjs → tools-UAXDWU63.mjs} +11 -18
- package/dist/cli/update-HZHZOU6C.js +28 -0
- package/dist/cli/{update-6RZMHJZP.mjs → update-SMNIBIMS.mjs} +6 -6
- package/dist/cli/{workflow-TX4F2PIX.js → workflow-AOQVZHMD.js} +16 -15
- package/dist/cli/{workflow-L2DQRE6R.mjs → workflow-IKGMBGF6.mjs} +6 -5
- package/dist/{client-C3O1Ipf3.d.ts → client-Bgis7F6-.d.ts} +22 -12
- package/dist/{client-BktIPdIj.d.mts → client-DiGl8ska.d.mts} +22 -12
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +11 -10
- package/dist/index.mjs +9 -8
- package/dist/install-integrity.json +83 -78
- package/dist/plays/play-description.d.mts +6 -0
- package/dist/plays/play-description.d.ts +6 -0
- package/dist/plays/play-description.js +11 -0
- package/dist/plays/play-description.mjs +11 -0
- 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 +6 -1
- package/dist/cli/auth-IHKISLJQ.js +0 -39
- package/dist/cli/git-MFFAWVVX.js +0 -23
- package/dist/cli/play-AJFGME3B.mjs +0 -158
- package/dist/cli/play-WLSN2EO2.js +0 -158
- package/dist/cli/search-5VN4YD4I.js +0 -27
- package/dist/cli/skills-S6NPZAN7.js +0 -28
- package/dist/cli/tools-647RLXQS.js +0 -41
- package/dist/cli/update-WVTSC3EM.js +0 -28
- package/dist/cli/{chunk-KZZC33PY.mjs → chunk-H5KLUGY7.mjs} +214 -214
|
@@ -17,20 +17,21 @@ var _chunkUHNDVD3Pjs = require('./chunk-UHNDVD3P.js');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
+
var _chunkKXMNM4AQjs = require('./chunk-KXMNM4AQ.js');
|
|
20
21
|
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
|
|
24
|
-
var _chunkCS6RAIVYjs = require('./chunk-CS6RAIVY.js');
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
+
var _chunkV7UP2F4Ujs = require('./chunk-V7UP2F4U.js');
|
|
29
|
+
|
|
28
30
|
|
|
29
31
|
|
|
30
|
-
var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
var
|
|
33
|
+
|
|
34
|
+
var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
|
|
34
35
|
|
|
35
36
|
// src/pagination.ts
|
|
36
37
|
async function* iterateCursorPages(fetchPage) {
|
|
@@ -137,7 +138,7 @@ async function queryCustomerDatabase(http, input) {
|
|
|
137
138
|
if (error instanceof _chunk7P5AA3SNjs.DeeplineError && (_optionalChain([error, 'access', _ => _.code, 'optionalAccess', _2 => _2.startsWith, 'call', _3 => _3("NETWORK_")]) || // Older API readers return PostgreSQL errors as HTTP 400, including
|
|
138
139
|
// lost connections and explicitly unknown transaction resolution.
|
|
139
140
|
/^08[A-Z0-9]{3}$/.test(_nullishCoalesce(error.code, () => ( ""))) || ["57P01", "57P02", "57P03"].includes(_nullishCoalesce(error.code, () => ( ""))) || error.statusCode === 408 || (_nullishCoalesce(error.statusCode, () => ( 0))) >= 500)) {
|
|
140
|
-
throw new (0,
|
|
141
|
+
throw new (0, _chunkV7UP2F4Ujs.CustomerDbQueryOutcomeUnknownError)(
|
|
141
142
|
error,
|
|
142
143
|
plan.request.body.operation_key
|
|
143
144
|
);
|
|
@@ -145,7 +146,7 @@ async function queryCustomerDatabase(http, input) {
|
|
|
145
146
|
throw error;
|
|
146
147
|
}
|
|
147
148
|
if (!result || typeof result !== "object" || Array.isArray(result) || typeof result.command !== "string" || !Array.isArray(result.columns) || !Array.isArray(result.rows) || typeof result.truncated !== "boolean" || result.row_count !== null && (!Number.isSafeInteger(result.row_count) || result.row_count < 0) || !Number.isSafeInteger(result.row_count_returned) || result.row_count_returned < 0) {
|
|
148
|
-
throw new (0,
|
|
149
|
+
throw new (0, _chunkV7UP2F4Ujs.CustomerDbQueryOutcomeUnknownError)(
|
|
149
150
|
new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
150
151
|
"The SQL response did not contain a valid result.",
|
|
151
152
|
200,
|
|
@@ -156,7 +157,7 @@ async function queryCustomerDatabase(http, input) {
|
|
|
156
157
|
}
|
|
157
158
|
const operation = result.operation;
|
|
158
159
|
if (input.operationKey !== void 0 && (!operation || operation.operation_key !== input.operationKey || !Number.isSafeInteger(operation.completed_at_ms) || operation.completed_at_ms < 0 || !["executed", "operation_recovery"].includes(operation.source))) {
|
|
159
|
-
throw new (0,
|
|
160
|
+
throw new (0, _chunkV7UP2F4Ujs.CustomerDbQueryOutcomeUnknownError)(
|
|
160
161
|
new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
161
162
|
"The server did not confirm the original atomic SQL operation.",
|
|
162
163
|
200,
|
|
@@ -1835,31 +1836,6 @@ function playTriggerConfigPath(playName) {
|
|
|
1835
1836
|
return `/api/v2/plays/${encodeURIComponent(playName)}/triggers`;
|
|
1836
1837
|
}
|
|
1837
1838
|
|
|
1838
|
-
// src/plays/input-example.ts
|
|
1839
|
-
function playInputExampleArgs(schema) {
|
|
1840
|
-
if (!schema) return " --input '@<input.json>'";
|
|
1841
|
-
if (schema.$ref || schema.allOf) return " --input '@<input.json>'";
|
|
1842
|
-
const csv = schema.csvInput;
|
|
1843
|
-
const csvField = typeof _optionalChain([csv, 'optionalAccess', _32 => _32.inputField]) === "string" ? csv.inputField : null;
|
|
1844
|
-
const required = Array.isArray(schema.required) ? schema.required : [];
|
|
1845
|
-
const csvOnlyRequired = required.every((key) => key === csvField);
|
|
1846
|
-
const alternatives = _nullishCoalesce(schema.oneOf, () => ( schema.anyOf));
|
|
1847
|
-
const hasCsvAlternative = Array.isArray(alternatives) && alternatives.some((branch) => {
|
|
1848
|
-
if (!branch || typeof branch !== "object") return false;
|
|
1849
|
-
const keys = branch.required;
|
|
1850
|
-
return Array.isArray(keys) && keys.includes(csvField) && keys.every((key) => key === csvField);
|
|
1851
|
-
});
|
|
1852
|
-
if (csvField && csvOnlyRequired && (!alternatives || hasCsvAlternative)) {
|
|
1853
|
-
if (csvField === "csv") return " --csv '<contacts.csv>'";
|
|
1854
|
-
const value = JSON.stringify({ [csvField]: "<contacts.csv>" });
|
|
1855
|
-
return ` --input '${value.replace(/'/g, "'\\''")}'`;
|
|
1856
|
-
}
|
|
1857
|
-
if (Array.isArray(schema.required) && !required.length && !csv && !alternatives) {
|
|
1858
|
-
return "";
|
|
1859
|
-
}
|
|
1860
|
-
return " --input '@<input.json>'";
|
|
1861
|
-
}
|
|
1862
|
-
|
|
1863
1839
|
// ../product-notifications/configuration.ts
|
|
1864
1840
|
var PRODUCT_NOTIFICATION_EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
1865
1841
|
function normalizeProductNotificationEmail(value) {
|
|
@@ -2371,10 +2347,10 @@ function getStepStatusSignature(snapshot) {
|
|
|
2371
2347
|
_nullishCoalesce(state.artifactTableNamespace, () => ( "")),
|
|
2372
2348
|
_nullishCoalesce(state.startedAt, () => ( "")),
|
|
2373
2349
|
_nullishCoalesce(state.completedAt, () => ( "")),
|
|
2374
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
2375
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
2350
|
+
_nullishCoalesce(_optionalChain([state, 'access', _32 => _32.progress, 'optionalAccess', _33 => _33.startedAt]), () => ( "")),
|
|
2351
|
+
_nullishCoalesce(_optionalChain([state, 'access', _34 => _34.progress, 'optionalAccess', _35 => _35.completedAt]), () => ( "")),
|
|
2376
2352
|
_nullishCoalesce(state.updatedAt, () => ( "")),
|
|
2377
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
2353
|
+
_nullishCoalesce(_optionalChain([state, 'access', _36 => _36.progress, 'optionalAccess', _37 => _37.updatedAt]), () => ( ""))
|
|
2378
2354
|
].join(":")
|
|
2379
2355
|
).join("|");
|
|
2380
2356
|
}
|
|
@@ -2383,11 +2359,11 @@ function getStepProgressSignature(snapshot) {
|
|
|
2383
2359
|
snapshot.nodeStates.map((state) => [
|
|
2384
2360
|
state.nodeId,
|
|
2385
2361
|
projectPlayStepProgressCounters(_nullishCoalesce(state.progress, () => ( {}))),
|
|
2386
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
2387
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
2388
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
2389
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
2390
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
2362
|
+
_nullishCoalesce(_optionalChain([state, 'access', _38 => _38.progress, 'optionalAccess', _39 => _39.artifactTableNamespace]), () => ( "")),
|
|
2363
|
+
_nullishCoalesce(_optionalChain([state, 'access', _40 => _40.progress, 'optionalAccess', _41 => _41.startedAt]), () => ( "")),
|
|
2364
|
+
_nullishCoalesce(_optionalChain([state, 'access', _42 => _42.progress, 'optionalAccess', _43 => _43.completedAt]), () => ( "")),
|
|
2365
|
+
_nullishCoalesce(_optionalChain([state, 'access', _44 => _44.progress, 'optionalAccess', _45 => _45.updatedAt]), () => ( "")),
|
|
2366
|
+
_nullishCoalesce(_optionalChain([state, 'access', _46 => _46.progress, 'optionalAccess', _47 => _47.message]), () => ( ""))
|
|
2391
2367
|
])
|
|
2392
2368
|
);
|
|
2393
2369
|
}
|
|
@@ -2457,8 +2433,8 @@ function diffPlayRunStreamEvents(input) {
|
|
|
2457
2433
|
if (state.status === "idle") {
|
|
2458
2434
|
continue;
|
|
2459
2435
|
}
|
|
2460
|
-
const persistedStartedAt = _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access',
|
|
2461
|
-
const persistedCompletedAt = _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access',
|
|
2436
|
+
const persistedStartedAt = _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _48 => _48.progress, 'optionalAccess', _49 => _49.startedAt]))), () => ( null));
|
|
2437
|
+
const persistedCompletedAt = _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _50 => _50.progress, 'optionalAccess', _51 => _51.completedAt]))), () => ( null));
|
|
2462
2438
|
events.push(
|
|
2463
2439
|
makeRunStreamEvent({
|
|
2464
2440
|
cursor,
|
|
@@ -2472,7 +2448,7 @@ function diffPlayRunStreamEvents(input) {
|
|
|
2472
2448
|
...resolveTimingWindow({
|
|
2473
2449
|
startedAt: persistedStartedAt,
|
|
2474
2450
|
completedAt: persistedCompletedAt,
|
|
2475
|
-
updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access',
|
|
2451
|
+
updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _52 => _52.progress, 'optionalAccess', _53 => _53.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
|
|
2476
2452
|
})
|
|
2477
2453
|
}
|
|
2478
2454
|
})
|
|
@@ -2526,9 +2502,9 @@ function diffPlayRunStreamEvents(input) {
|
|
|
2526
2502
|
if (next.snapshotSignature !== previous.snapshotSignature) {
|
|
2527
2503
|
const enrichedNodeStates = snapshot.nodeStates.map((state) => {
|
|
2528
2504
|
const timing = resolveTimingWindow({
|
|
2529
|
-
startedAt: _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access',
|
|
2530
|
-
completedAt: _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access',
|
|
2531
|
-
updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access',
|
|
2505
|
+
startedAt: _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _54 => _54.progress, 'optionalAccess', _55 => _55.startedAt]))), () => ( null)),
|
|
2506
|
+
completedAt: _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _56 => _56.progress, 'optionalAccess', _57 => _57.completedAt]))), () => ( null)),
|
|
2507
|
+
updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _58 => _58.progress, 'optionalAccess', _59 => _59.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
|
|
2532
2508
|
});
|
|
2533
2509
|
return {
|
|
2534
2510
|
...state,
|
|
@@ -2573,18 +2549,18 @@ function diffPlayRunStreamEvents(input) {
|
|
|
2573
2549
|
// src/runs/watch-polling.ts
|
|
2574
2550
|
var RUN_WATCH_POLL_INTERVAL_MS = 2e3;
|
|
2575
2551
|
function waitForNextPoll(ms, signal) {
|
|
2576
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
2552
|
+
if (_optionalChain([signal, 'optionalAccess', _60 => _60.aborted])) {
|
|
2577
2553
|
return Promise.resolve(false);
|
|
2578
2554
|
}
|
|
2579
2555
|
return new Promise((resolve) => {
|
|
2580
2556
|
const finish = (elapsed) => {
|
|
2581
2557
|
clearTimeout(timeout);
|
|
2582
|
-
_optionalChain([signal, 'optionalAccess',
|
|
2558
|
+
_optionalChain([signal, 'optionalAccess', _61 => _61.removeEventListener, 'call', _62 => _62("abort", onAbort)]);
|
|
2583
2559
|
resolve(elapsed);
|
|
2584
2560
|
};
|
|
2585
2561
|
const onAbort = () => finish(false);
|
|
2586
2562
|
const timeout = setTimeout(() => finish(true), ms);
|
|
2587
|
-
_optionalChain([signal, 'optionalAccess',
|
|
2563
|
+
_optionalChain([signal, 'optionalAccess', _63 => _63.addEventListener, 'call', _64 => _64("abort", onAbort, { once: true })]);
|
|
2588
2564
|
});
|
|
2589
2565
|
}
|
|
2590
2566
|
function readSnapshotResponse(response, runId) {
|
|
@@ -2641,7 +2617,7 @@ async function* watchRunEvents(options) {
|
|
|
2641
2617
|
let previous = EMPTY_PLAY_RUN_STREAM_DIFF_STATE;
|
|
2642
2618
|
let consecutiveFailures = 0;
|
|
2643
2619
|
let outageNoticeSent = false;
|
|
2644
|
-
while (!_optionalChain([signal, 'optionalAccess',
|
|
2620
|
+
while (!_optionalChain([signal, 'optionalAccess', _65 => _65.aborted])) {
|
|
2645
2621
|
const pollStartedAt = Date.now();
|
|
2646
2622
|
let snapshot;
|
|
2647
2623
|
try {
|
|
@@ -2654,7 +2630,7 @@ async function* watchRunEvents(options) {
|
|
|
2654
2630
|
signal
|
|
2655
2631
|
});
|
|
2656
2632
|
} catch (error) {
|
|
2657
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
2633
|
+
if (_optionalChain([signal, 'optionalAccess', _66 => _66.aborted])) {
|
|
2658
2634
|
return;
|
|
2659
2635
|
}
|
|
2660
2636
|
if (!isTransientPlayRunReadError(error)) {
|
|
@@ -2663,12 +2639,12 @@ async function* watchRunEvents(options) {
|
|
|
2663
2639
|
consecutiveFailures += 1;
|
|
2664
2640
|
const reason = error instanceof Error ? error.message : String(error);
|
|
2665
2641
|
if (!outageNoticeSent) {
|
|
2666
|
-
_optionalChain([options, 'access',
|
|
2642
|
+
_optionalChain([options, 'access', _67 => _67.onRetry, 'optionalCall', _68 => _68({
|
|
2667
2643
|
attempt: consecutiveFailures,
|
|
2668
2644
|
delayMs: pollIntervalMs,
|
|
2669
2645
|
reason
|
|
2670
2646
|
})]);
|
|
2671
|
-
_optionalChain([options, 'access',
|
|
2647
|
+
_optionalChain([options, 'access', _69 => _69.onNotice, 'optionalCall', _70 => _70(
|
|
2672
2648
|
`[watch] run snapshot request failed; retrying every ${pollIntervalMs / 1e3}s (${reason})`
|
|
2673
2649
|
)]);
|
|
2674
2650
|
outageNoticeSent = true;
|
|
@@ -2683,7 +2659,7 @@ async function* watchRunEvents(options) {
|
|
|
2683
2659
|
continue;
|
|
2684
2660
|
}
|
|
2685
2661
|
if (outageNoticeSent) {
|
|
2686
|
-
_optionalChain([options, 'access',
|
|
2662
|
+
_optionalChain([options, 'access', _71 => _71.onNotice, 'optionalCall', _72 => _72("[watch] run snapshot polling recovered")]);
|
|
2687
2663
|
outageNoticeSent = false;
|
|
2688
2664
|
}
|
|
2689
2665
|
consecutiveFailures = 0;
|
|
@@ -2766,7 +2742,7 @@ function parseNotificationGroupTarget(value) {
|
|
|
2766
2742
|
}
|
|
2767
2743
|
return { kind: "email", email };
|
|
2768
2744
|
}
|
|
2769
|
-
const slack = _optionalChain([/^slack:(.+)$/i, 'access',
|
|
2745
|
+
const slack = _optionalChain([/^slack:(.+)$/i, 'access', _73 => _73.exec, 'call', _74 => _74(normalized), 'optionalAccess', _75 => _75[1], 'optionalAccess', _76 => _76.trim, 'call', _77 => _77()]);
|
|
2770
2746
|
if (!slack) {
|
|
2771
2747
|
const provider = normalized.split(":", 1)[0] || normalized;
|
|
2772
2748
|
throw new Error(
|
|
@@ -2774,7 +2750,7 @@ function parseNotificationGroupTarget(value) {
|
|
|
2774
2750
|
);
|
|
2775
2751
|
}
|
|
2776
2752
|
const member = /^member:([UW][A-Z0-9]{8,})$/i.exec(slack);
|
|
2777
|
-
if (_optionalChain([member, 'optionalAccess',
|
|
2753
|
+
if (_optionalChain([member, 'optionalAccess', _78 => _78[1]])) {
|
|
2778
2754
|
return { kind: "slack", memberId: member[1].toUpperCase() };
|
|
2779
2755
|
}
|
|
2780
2756
|
if (slack.toLowerCase().startsWith("member:")) {
|
|
@@ -2821,10 +2797,10 @@ function resolvePlayRunRuntimeSelection(request, env) {
|
|
|
2821
2797
|
}
|
|
2822
2798
|
return runtime;
|
|
2823
2799
|
}
|
|
2824
|
-
const configured = _optionalChain([env, 'access',
|
|
2825
|
-
const configuredNamespace = _optionalChain([env, 'access',
|
|
2826
|
-
const configuredToken = _optionalChain([env, 'access',
|
|
2827
|
-
const configuredPlacementPolicy = _optionalChain([env, 'access',
|
|
2800
|
+
const configured = _optionalChain([env, 'access', _79 => _79.DEEPLINE_RUNTIME_ENVIRONMENT, 'optionalAccess', _80 => _80.trim, 'call', _81 => _81()]);
|
|
2801
|
+
const configuredNamespace = _optionalChain([env, 'access', _82 => _82.DEEPLINE_RUNTIME_NAMESPACE, 'optionalAccess', _83 => _83.trim, 'call', _84 => _84()]);
|
|
2802
|
+
const configuredToken = _optionalChain([env, 'access', _85 => _85.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _86 => _86.trim, 'call', _87 => _87()]);
|
|
2803
|
+
const configuredPlacementPolicy = _optionalChain([env, 'access', _88 => _88.DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY, 'optionalAccess', _89 => _89.trim, 'call', _90 => _90()]);
|
|
2828
2804
|
if (!configured) {
|
|
2829
2805
|
if (configuredNamespace || configuredToken || configuredPlacementPolicy) {
|
|
2830
2806
|
const present = [];
|
|
@@ -2863,7 +2839,7 @@ function resolvePlayRunRuntimeSelection(request, env) {
|
|
|
2863
2839
|
"INVALID_RUNTIME_NAMESPACE"
|
|
2864
2840
|
);
|
|
2865
2841
|
}
|
|
2866
|
-
const configuredBackendValue = _optionalChain([env, 'access',
|
|
2842
|
+
const configuredBackendValue = _optionalChain([env, 'access', _91 => _91.DEEPLINE_PLAY_RUNNER_BACKEND, 'optionalAccess', _92 => _92.trim, 'call', _93 => _93()]);
|
|
2867
2843
|
const configuredBackend = configuredBackendValue === "daytona" || configuredBackendValue === "modal" ? configuredBackendValue : void 0;
|
|
2868
2844
|
if (configuredBackendValue && !configuredBackend) {
|
|
2869
2845
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
@@ -2901,7 +2877,7 @@ function resolveStartPlayRunRequest(request, env) {
|
|
|
2901
2877
|
}
|
|
2902
2878
|
function runtimeSelectionHeaders(runtime, env) {
|
|
2903
2879
|
if (!runtime) return void 0;
|
|
2904
|
-
const token = _optionalChain([env, 'access',
|
|
2880
|
+
const token = _optionalChain([env, 'access', _94 => _94.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _95 => _95.trim, 'call', _96 => _96()]);
|
|
2905
2881
|
if (!token) {
|
|
2906
2882
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
2907
2883
|
"DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN is required for explicit preview runtime selection.",
|
|
@@ -2909,18 +2885,18 @@ function runtimeSelectionHeaders(runtime, env) {
|
|
|
2909
2885
|
"RUNTIME_ENVIRONMENT_TOKEN_REQUIRED"
|
|
2910
2886
|
);
|
|
2911
2887
|
}
|
|
2912
|
-
const receivers = _optionalChain([env, 'access',
|
|
2888
|
+
const receivers = _optionalChain([env, 'access', _97 => _97.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _98 => _98.trim, 'call', _99 => _99()]);
|
|
2913
2889
|
return {
|
|
2914
|
-
[
|
|
2915
|
-
...receivers ? { [
|
|
2890
|
+
[_chunkV7UP2F4Ujs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
|
|
2891
|
+
...receivers ? { [_chunkV7UP2F4Ujs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
|
|
2916
2892
|
};
|
|
2917
2893
|
}
|
|
2918
2894
|
function isolatedCiRuntimeEventReadHeaders(env) {
|
|
2919
|
-
const schema = _optionalChain([env, 'access',
|
|
2920
|
-
if (_optionalChain([env, 'access',
|
|
2895
|
+
const schema = _optionalChain([env, 'access', _100 => _100.DEEPLINE_RUNTIME_SCHEDULER_SCHEMA, 'optionalAccess', _101 => _101.trim, 'call', _102 => _102()]);
|
|
2896
|
+
if (_optionalChain([env, 'access', _103 => _103.DEEPLINE_SYNTHETIC_RUN, 'optionalAccess', _104 => _104.trim, 'call', _105 => _105()]) !== "1" || !schema || !/^fly_absurd_pr_\d+_\d+(?:_\d+)?$/.test(schema)) {
|
|
2921
2897
|
return void 0;
|
|
2922
2898
|
}
|
|
2923
|
-
const token = _optionalChain([env, 'access',
|
|
2899
|
+
const token = _optionalChain([env, 'access', _106 => _106.DEEPLINE_INTERNAL_TOKEN, 'optionalAccess', _107 => _107.trim, 'call', _108 => _108()]);
|
|
2924
2900
|
if (!token) {
|
|
2925
2901
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
2926
2902
|
"DEEPLINE_INTERNAL_TOKEN is required for isolated CI runtime event reads.",
|
|
@@ -2928,7 +2904,7 @@ function isolatedCiRuntimeEventReadHeaders(env) {
|
|
|
2928
2904
|
"RUNTIME_EVENT_INTERNAL_TOKEN_REQUIRED"
|
|
2929
2905
|
);
|
|
2930
2906
|
}
|
|
2931
|
-
return { [
|
|
2907
|
+
return { [_chunkV7UP2F4Ujs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
|
|
2932
2908
|
}
|
|
2933
2909
|
function normalizeTestPolicyOverrides(value, source) {
|
|
2934
2910
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
@@ -2942,7 +2918,7 @@ function normalizeTestPolicyOverrides(value, source) {
|
|
|
2942
2918
|
}
|
|
2943
2919
|
function parseEnvTestPolicyOverrides(env) {
|
|
2944
2920
|
const raw = env.DEEPLINE_TEST_POLICY_OVERRIDES;
|
|
2945
|
-
const trimmed = _optionalChain([raw, 'optionalAccess',
|
|
2921
|
+
const trimmed = _optionalChain([raw, 'optionalAccess', _109 => _109.trim, 'call', _110 => _110()]);
|
|
2946
2922
|
if (!trimmed) return void 0;
|
|
2947
2923
|
let parsed;
|
|
2948
2924
|
try {
|
|
@@ -2970,7 +2946,7 @@ function isTransientCompileManifestError(error) {
|
|
|
2970
2946
|
);
|
|
2971
2947
|
}
|
|
2972
2948
|
function requireCompileManifestResponse(response, playName) {
|
|
2973
|
-
const compilerManifest = _optionalChain([response, 'optionalAccess',
|
|
2949
|
+
const compilerManifest = _optionalChain([response, 'optionalAccess', _111 => _111.compilerManifest]);
|
|
2974
2950
|
if (!compilerManifest || typeof compilerManifest !== "object" || Array.isArray(compilerManifest)) {
|
|
2975
2951
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
2976
2952
|
`Compile manifest response did not include compilerManifest for ${playName}.`,
|
|
@@ -3022,7 +2998,7 @@ function chunkRegisterPlayArtifacts(artifacts) {
|
|
|
3022
2998
|
}
|
|
3023
2999
|
function searchParams(options) {
|
|
3024
3000
|
const params = new URLSearchParams();
|
|
3025
|
-
params.set("q", _nullishCoalesce(_optionalChain([options, 'access',
|
|
3001
|
+
params.set("q", _nullishCoalesce(_optionalChain([options, 'access', _112 => _112.query, 'optionalAccess', _113 => _113.trim, 'call', _114 => _114()]), () => ( "")));
|
|
3026
3002
|
params.set(
|
|
3027
3003
|
"include_search_debug",
|
|
3028
3004
|
options.includeSearchDebug ? "true" : "false"
|
|
@@ -3032,13 +3008,13 @@ function searchParams(options) {
|
|
|
3032
3008
|
if (options.offset !== void 0) {
|
|
3033
3009
|
params.set("offset", String(options.offset));
|
|
3034
3010
|
}
|
|
3035
|
-
if (_optionalChain([options, 'access',
|
|
3011
|
+
if (_optionalChain([options, 'access', _115 => _115.categories, 'optionalAccess', _116 => _116.trim, 'call', _117 => _117()])) {
|
|
3036
3012
|
params.set("categories", options.categories.trim());
|
|
3037
3013
|
}
|
|
3038
|
-
if (_optionalChain([options, 'access',
|
|
3014
|
+
if (_optionalChain([options, 'access', _118 => _118.searchTerms, 'optionalAccess', _119 => _119.trim, 'call', _120 => _120()])) {
|
|
3039
3015
|
params.set("search_terms", options.searchTerms.trim());
|
|
3040
3016
|
}
|
|
3041
|
-
if (_optionalChain([options, 'access',
|
|
3017
|
+
if (_optionalChain([options, 'access', _121 => _121.task, 'optionalAccess', _122 => _122.trim, 'call', _123 => _123()])) params.set("task", options.task.trim());
|
|
3042
3018
|
return params;
|
|
3043
3019
|
}
|
|
3044
3020
|
var RUNS_FAILED_LOG_LIMIT = 20;
|
|
@@ -3077,17 +3053,17 @@ function preferPrebuiltPlayDescriptions(plays) {
|
|
|
3077
3053
|
}
|
|
3078
3054
|
function normalizePlayStatus(raw) {
|
|
3079
3055
|
const runPackage = _chunkUHNDVD3Pjs.isPlayRunPackage.call(void 0, raw) ? raw : _chunkUHNDVD3Pjs.isPlayRunPackage.call(void 0, raw.package) ? raw.package : null;
|
|
3080
|
-
const packageRun = _optionalChain([runPackage, 'optionalAccess',
|
|
3081
|
-
const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess',
|
|
3056
|
+
const packageRun = _optionalChain([runPackage, 'optionalAccess', _124 => _124.run]);
|
|
3057
|
+
const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess', _125 => _125.status]) === "string" ? packageRun.status : null;
|
|
3082
3058
|
const status = _chunkUHNDVD3Pjs.decodePlayRunPublicStatus.call(void 0, rawStatus);
|
|
3083
3059
|
if (!status) {
|
|
3084
3060
|
throw new Error(
|
|
3085
3061
|
`Invalid play run lifecycle status in API response: ${JSON.stringify(rawStatus)}.`
|
|
3086
3062
|
);
|
|
3087
3063
|
}
|
|
3088
|
-
const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess',
|
|
3089
|
-
const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess',
|
|
3090
|
-
const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess',
|
|
3064
|
+
const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess', _126 => _126.id]), () => ( ""));
|
|
3065
|
+
const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _127 => _127.overview]), () => ( raw.overview));
|
|
3066
|
+
const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _128 => _128.runStatus]), () => ( raw.runStatus));
|
|
3091
3067
|
return {
|
|
3092
3068
|
...raw,
|
|
3093
3069
|
runId,
|
|
@@ -3189,9 +3165,9 @@ function playRunResultFromStatus(status, startedAt, fallbackRunId) {
|
|
|
3189
3165
|
runId: status.runId || fallbackRunId,
|
|
3190
3166
|
result: _nullishCoalesce(status.package, () => ( status.result)),
|
|
3191
3167
|
...status.package ? { package: status.package } : {},
|
|
3192
|
-
logs: _nullishCoalesce(_optionalChain([status, 'access',
|
|
3168
|
+
logs: _nullishCoalesce(_optionalChain([status, 'access', _129 => _129.progress, 'optionalAccess', _130 => _130.logs]), () => ( [])),
|
|
3193
3169
|
durationMs: Date.now() - startedAt,
|
|
3194
|
-
error: _nullishCoalesce(_optionalChain([status, 'access',
|
|
3170
|
+
error: _nullishCoalesce(_optionalChain([status, 'access', _131 => _131.progress, 'optionalAccess', _132 => _132.error]), () => ( (status.status !== "completed" ? status.status : void 0)))
|
|
3195
3171
|
};
|
|
3196
3172
|
}
|
|
3197
3173
|
var DeeplineClient = (_class = class _DeeplineClient {
|
|
@@ -3219,13 +3195,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3219
3195
|
* @throws {@link ConfigError} if no API key can be resolved from any source.
|
|
3220
3196
|
*/
|
|
3221
3197
|
constructor(options) {
|
|
3222
|
-
this.config =
|
|
3198
|
+
this.config = _chunkV7UP2F4Ujs.resolveConfig.call(void 0, options);
|
|
3223
3199
|
this.environment = _nullishCoalesce(this.config.environment, () => ( process.env));
|
|
3224
|
-
this.http = new (0,
|
|
3200
|
+
this.http = new (0, _chunkV7UP2F4Ujs.HttpClient)(this.config);
|
|
3225
3201
|
this.toolCalls = new ToolCalls(
|
|
3226
3202
|
this.http,
|
|
3227
3203
|
this.config.timeout,
|
|
3228
|
-
_optionalChain([options, 'optionalAccess',
|
|
3204
|
+
_optionalChain([options, 'optionalAccess', _133 => _133.timeout])
|
|
3229
3205
|
);
|
|
3230
3206
|
this.runs = {
|
|
3231
3207
|
getReceipts: (runId, options2) => this.getRunReceipts(runId, options2),
|
|
@@ -3288,7 +3264,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3288
3264
|
{},
|
|
3289
3265
|
{
|
|
3290
3266
|
"Idempotency-Key": requireBillingIdempotencyKey(
|
|
3291
|
-
_nullishCoalesce(_optionalChain([options2, 'optionalAccess',
|
|
3267
|
+
_nullishCoalesce(_optionalChain([options2, 'optionalAccess', _134 => _134.idempotencyKey]), () => ( globalThis.crypto.randomUUID()))
|
|
3292
3268
|
)
|
|
3293
3269
|
}
|
|
3294
3270
|
),
|
|
@@ -3307,7 +3283,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3307
3283
|
available: (toolIdOrOptions, options2) => this.getMonitorsAvailable(toolIdOrOptions, options2),
|
|
3308
3284
|
check: (definition) => this.checkMonitor(definition),
|
|
3309
3285
|
deploy: (definition, options2) => this.deployMonitor(definition, options2),
|
|
3310
|
-
sync: (definition, options2) => _optionalChain([options2, 'optionalAccess',
|
|
3286
|
+
sync: (definition, options2) => _optionalChain([options2, 'optionalAccess', _135 => _135.dryRun]) ? this.deployMonitor(definition, { dryRun: true }) : this.syncScalarMonitor(definition, options2),
|
|
3311
3287
|
list: (options2) => this.listMonitors(options2),
|
|
3312
3288
|
get: (key) => this.getMonitor(key),
|
|
3313
3289
|
test: (key, payload, options2) => this.testMonitorWebhook(key, payload, options2),
|
|
@@ -3316,13 +3292,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3316
3292
|
update: (key, patch) => this.updateMonitor(key, patch),
|
|
3317
3293
|
delete: (key, options2) => this.deleteMonitor(key, options2),
|
|
3318
3294
|
reactivate: (key, options2) => this.reactivateMonitor(key, options2),
|
|
3319
|
-
start: (key, options2) => _optionalChain([options2, 'optionalAccess',
|
|
3295
|
+
start: (key, options2) => _optionalChain([options2, 'optionalAccess', _136 => _136.dryRun]) ? this.submitMonitorBatch({
|
|
3320
3296
|
kind: "reactivate",
|
|
3321
3297
|
scope: { kind: "keys", monitorKeys: [key] },
|
|
3322
3298
|
dryRun: true,
|
|
3323
3299
|
idempotencyKey: _nullishCoalesce(options2.idempotencyKey, () => ( this.monitorJobIdempotencyKey(`start-${key}`)))
|
|
3324
3300
|
}) : this.submitScalarMonitorLifecycle(key, "start", options2),
|
|
3325
|
-
stop: (key, options2) => _optionalChain([options2, 'optionalAccess',
|
|
3301
|
+
stop: (key, options2) => _optionalChain([options2, 'optionalAccess', _137 => _137.dryRun]) ? this.submitMonitorBatch({
|
|
3326
3302
|
kind: "deactivate",
|
|
3327
3303
|
scope: { kind: "keys", monitorKeys: [key] },
|
|
3328
3304
|
dryRun: true,
|
|
@@ -3365,101 +3341,6 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3365
3341
|
get baseUrl() {
|
|
3366
3342
|
return this.config.baseUrl;
|
|
3367
3343
|
}
|
|
3368
|
-
compactSchema(schema) {
|
|
3369
|
-
if (!schema) return null;
|
|
3370
|
-
const fields = Array.isArray(schema.fields) ? schema.fields.map(
|
|
3371
|
-
(field) => field && typeof field === "object" ? {
|
|
3372
|
-
name: String(_nullishCoalesce(field.name, () => ( ""))),
|
|
3373
|
-
type: _nullishCoalesce(field.type, () => ( void 0)),
|
|
3374
|
-
required: _nullishCoalesce(field.required, () => ( void 0))
|
|
3375
|
-
} : null
|
|
3376
|
-
).filter((field) => Boolean(_optionalChain([field, 'optionalAccess', _139 => _139.name]))) : [];
|
|
3377
|
-
return fields.length > 0 ? { fields } : schema;
|
|
3378
|
-
}
|
|
3379
|
-
schemaMetadata(schema, key) {
|
|
3380
|
-
if (!isRecord2(schema)) return null;
|
|
3381
|
-
const value = schema[key];
|
|
3382
|
-
return isRecord2(value) ? value : null;
|
|
3383
|
-
}
|
|
3384
|
-
playRunCommand(play) {
|
|
3385
|
-
const target = play.reference || play.name;
|
|
3386
|
-
return `deepline plays run ${target}${playInputExampleArgs(play.inputSchema)}`;
|
|
3387
|
-
}
|
|
3388
|
-
starterPlayPath(play) {
|
|
3389
|
-
const target = play.reference || play.name;
|
|
3390
|
-
const unqualifiedName = target.split("/").pop() || play.name;
|
|
3391
|
-
const safeName = unqualifiedName.trim().toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
3392
|
-
return `./${safeName || "play"}.play.ts`;
|
|
3393
|
-
}
|
|
3394
|
-
playCloneEditStarter(play) {
|
|
3395
|
-
const readonlyPrebuilt = (play.origin === "prebuilt" || play.ownerType === "deepline") && !play.canEdit;
|
|
3396
|
-
if (!play.canClone && !readonlyPrebuilt) return void 0;
|
|
3397
|
-
const target = play.reference || play.name;
|
|
3398
|
-
const path = this.starterPlayPath(play);
|
|
3399
|
-
return {
|
|
3400
|
-
path,
|
|
3401
|
-
command: `deepline plays get ${target} --source --out ${path}`,
|
|
3402
|
-
checkCommand: `deepline plays check ${path}`
|
|
3403
|
-
};
|
|
3404
|
-
}
|
|
3405
|
-
summarizePlayListItem(play, options) {
|
|
3406
|
-
const aliases = _optionalChain([play, 'access', _140 => _140.aliases, 'optionalAccess', _141 => _141.length]) ? play.aliases : [play.name];
|
|
3407
|
-
const csvInput = this.schemaMetadata(play.inputSchema, "csvInput");
|
|
3408
|
-
const rowOutputSchema = this.schemaMetadata(
|
|
3409
|
-
play.outputSchema,
|
|
3410
|
-
"rowOutputSchema"
|
|
3411
|
-
);
|
|
3412
|
-
const description = _optionalChain([play, 'access', _142 => _142.description, 'optionalAccess', _143 => _143.trim, 'call', _144 => _144()]) || _optionalChain([play, 'access', _145 => _145.currentRevision, 'optionalAccess', _146 => _146.description, 'optionalAccess', _147 => _147.trim, 'call', _148 => _148()]) || _optionalChain([play, 'access', _149 => _149.liveRevision, 'optionalAccess', _150 => _150.description, 'optionalAccess', _151 => _151.trim, 'call', _152 => _152()]) || null;
|
|
3413
|
-
const runCommand = this.playRunCommand(play);
|
|
3414
|
-
const cloneEditStarter = this.playCloneEditStarter(play);
|
|
3415
|
-
return {
|
|
3416
|
-
name: play.name,
|
|
3417
|
-
// playKey and triggerStatus were projected away here, so `describe`
|
|
3418
|
-
// was strictly less informative than `plays list` for the same play — no
|
|
3419
|
-
// stable key, and no way to see that a cron was armed.
|
|
3420
|
-
...play.playKey ? { playKey: play.playKey } : {},
|
|
3421
|
-
...play.reference ? { reference: play.reference } : {},
|
|
3422
|
-
...play.displayName ? { displayName: play.displayName } : {},
|
|
3423
|
-
...description ? { description } : {},
|
|
3424
|
-
...play.guidance ? { guidance: play.guidance } : {},
|
|
3425
|
-
pinned: Boolean(play.pinned),
|
|
3426
|
-
toolCategories: _nullishCoalesce(play.toolCategories, () => ( [])),
|
|
3427
|
-
origin: play.origin,
|
|
3428
|
-
ownerType: play.ownerType,
|
|
3429
|
-
canEdit: play.canEdit,
|
|
3430
|
-
canClone: play.canClone,
|
|
3431
|
-
aliases,
|
|
3432
|
-
inputSchema: _optionalChain([options, 'optionalAccess', _153 => _153.compact]) ? this.compactSchema(play.inputSchema) : _nullishCoalesce(play.inputSchema, () => ( null)),
|
|
3433
|
-
outputSchema: _optionalChain([options, 'optionalAccess', _154 => _154.compact]) ? this.compactSchema(play.outputSchema) : _nullishCoalesce(play.outputSchema, () => ( null)),
|
|
3434
|
-
staticPipeline: isRecord2(play.staticPipeline) ? play.staticPipeline : isRecord2(_optionalChain([play, 'access', _155 => _155.currentRevision, 'optionalAccess', _156 => _156.staticPipeline])) ? play.currentRevision.staticPipeline : isRecord2(_optionalChain([play, 'access', _157 => _157.liveRevision, 'optionalAccess', _158 => _158.staticPipeline])) ? play.liveRevision.staticPipeline : null,
|
|
3435
|
-
...csvInput ? {
|
|
3436
|
-
csvInput: { ...csvInput, headerMatching: CSV_HEADER_MATCHING_NOTE }
|
|
3437
|
-
} : {},
|
|
3438
|
-
...rowOutputSchema ? { rowOutputSchema } : {},
|
|
3439
|
-
runCommand,
|
|
3440
|
-
examples: [runCommand],
|
|
3441
|
-
...cloneEditStarter ? { cloneEditStarter } : {},
|
|
3442
|
-
currentPublishedVersion: _nullishCoalesce(play.currentPublishedVersion, () => ( null)),
|
|
3443
|
-
// Read the live version off the live revision. It was previously only
|
|
3444
|
-
// ever written by the publish/live routes, so every list and describe
|
|
3445
|
-
// payload reported liveVersion: null even for an actively serving play.
|
|
3446
|
-
liveVersion: _nullishCoalesce(_optionalChain([play, 'access', _159 => _159.liveRevision, 'optionalAccess', _160 => _160.version]), () => ( null)),
|
|
3447
|
-
...play.triggerStatus ? { triggerStatus: play.triggerStatus } : {},
|
|
3448
|
-
isDraftDirty: play.isDraftDirty
|
|
3449
|
-
};
|
|
3450
|
-
}
|
|
3451
|
-
summarizePlayDetail(detail, options) {
|
|
3452
|
-
const play = detail.play;
|
|
3453
|
-
return {
|
|
3454
|
-
...this.summarizePlayListItem(play, options),
|
|
3455
|
-
currentPublishedVersion: _nullishCoalesce(_nullishCoalesce(play.currentPublishedVersion, () => ( _optionalChain([play, 'access', _161 => _161.liveRevision, 'optionalAccess', _162 => _162.version]))), () => ( null)),
|
|
3456
|
-
latestRunId: _nullishCoalesce(_nullishCoalesce(play.latestRunId, () => ( _optionalChain([detail, 'access', _163 => _163.latestRuns, 'access', _164 => _164[0], 'optionalAccess', _165 => _165.workflowId]))), () => ( null)),
|
|
3457
|
-
...play.triggerMetadata ? { triggerMetadata: play.triggerMetadata } : {},
|
|
3458
|
-
...play.runtimeLimit ? { runtimeLimit: play.runtimeLimit } : {},
|
|
3459
|
-
...play.activeScheduledPlays ? { activeScheduledPlays: play.activeScheduledPlays } : {},
|
|
3460
|
-
...play.observedCost ? { observedCost: play.observedCost } : {}
|
|
3461
|
-
};
|
|
3462
|
-
}
|
|
3463
3344
|
// ——————————————————————————————————————————————————————————
|
|
3464
3345
|
// Secrets
|
|
3465
3346
|
// ——————————————————————————————————————————————————————————
|
|
@@ -3521,17 +3402,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3521
3402
|
*/
|
|
3522
3403
|
async listTools(options) {
|
|
3523
3404
|
const params = new URLSearchParams();
|
|
3524
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3405
|
+
if (_optionalChain([options, 'optionalAccess', _138 => _138.categories, 'optionalAccess', _139 => _139.trim, 'call', _140 => _140()])) {
|
|
3525
3406
|
params.set("categories", options.categories.trim());
|
|
3526
3407
|
}
|
|
3527
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3408
|
+
if (_optionalChain([options, 'optionalAccess', _141 => _141.tags, 'optionalAccess', _142 => _142.trim, 'call', _143 => _143()])) {
|
|
3528
3409
|
params.set("tags", options.tags.trim());
|
|
3529
3410
|
}
|
|
3530
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3411
|
+
if (_optionalChain([options, 'optionalAccess', _144 => _144.grep, 'optionalAccess', _145 => _145.trim, 'call', _146 => _146()])) {
|
|
3531
3412
|
params.set("grep", options.grep.trim());
|
|
3532
3413
|
params.set("grep_mode", _nullishCoalesce(options.grepMode, () => ( "all")));
|
|
3533
3414
|
}
|
|
3534
|
-
params.set("compact", _optionalChain([options, 'optionalAccess',
|
|
3415
|
+
params.set("compact", _optionalChain([options, 'optionalAccess', _147 => _147.compact]) === true ? "true" : "false");
|
|
3535
3416
|
const suffix = params.toString() ? `?${params.toString()}` : "";
|
|
3536
3417
|
const res = await this.http.get(
|
|
3537
3418
|
`/api/v2/tools${suffix}`
|
|
@@ -3540,7 +3421,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3540
3421
|
}
|
|
3541
3422
|
/** List discoverable providers without requiring a local plugin catalog. */
|
|
3542
3423
|
async listProviders(options) {
|
|
3543
|
-
const suffix = _optionalChain([options, 'optionalAccess',
|
|
3424
|
+
const suffix = _optionalChain([options, 'optionalAccess', _148 => _148.changed]) ? "?changed=true" : "";
|
|
3544
3425
|
const res = await this.http.get(
|
|
3545
3426
|
`/api/v2/tools/providers${suffix}`
|
|
3546
3427
|
);
|
|
@@ -3571,8 +3452,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3571
3452
|
*/
|
|
3572
3453
|
async search(options = {}) {
|
|
3573
3454
|
const params = searchParams(options);
|
|
3574
|
-
if (_optionalChain([options, 'access',
|
|
3575
|
-
if (_optionalChain([options, 'access',
|
|
3455
|
+
if (_optionalChain([options, 'access', _149 => _149.types, 'optionalAccess', _150 => _150.length])) params.set("types", options.types.join(","));
|
|
3456
|
+
if (_optionalChain([options, 'access', _151 => _151.exclude, 'optionalAccess', _152 => _152.length])) {
|
|
3576
3457
|
params.set("exclude", options.exclude.join(","));
|
|
3577
3458
|
}
|
|
3578
3459
|
return this.http.get(`/api/v2/search?${params.toString()}`);
|
|
@@ -3594,7 +3475,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3594
3475
|
* ```
|
|
3595
3476
|
*/
|
|
3596
3477
|
async getTool(toolId, options) {
|
|
3597
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3478
|
+
if (_optionalChain([options, 'optionalAccess', _153 => _153.cliInvocationId]) !== void 0) {
|
|
3598
3479
|
validateCliInvocationId(options.cliInvocationId);
|
|
3599
3480
|
}
|
|
3600
3481
|
return this.http.request(
|
|
@@ -3607,7 +3488,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3607
3488
|
retryApiErrors: true,
|
|
3608
3489
|
headers: {
|
|
3609
3490
|
"x-deepline-tool-meta-only": "1",
|
|
3610
|
-
..._optionalChain([options, 'optionalAccess',
|
|
3491
|
+
..._optionalChain([options, 'optionalAccess', _154 => _154.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
|
|
3611
3492
|
}
|
|
3612
3493
|
}
|
|
3613
3494
|
);
|
|
@@ -3699,7 +3580,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3699
3580
|
return this.http.post(
|
|
3700
3581
|
"/api/v2/ingestion/repair",
|
|
3701
3582
|
{
|
|
3702
|
-
..._optionalChain([input, 'optionalAccess',
|
|
3583
|
+
..._optionalChain([input, 'optionalAccess', _155 => _155.provider]) ? { provider: input.provider } : {}
|
|
3703
3584
|
}
|
|
3704
3585
|
);
|
|
3705
3586
|
}
|
|
@@ -3745,7 +3626,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3745
3626
|
this.http,
|
|
3746
3627
|
resolved.request,
|
|
3747
3628
|
runtimeSelectionHeaders(resolved.runtime, this.environment),
|
|
3748
|
-
_optionalChain([options, 'optionalAccess',
|
|
3629
|
+
_optionalChain([options, 'optionalAccess', _156 => _156.onSubmission])
|
|
3749
3630
|
);
|
|
3750
3631
|
}
|
|
3751
3632
|
/**
|
|
@@ -3757,7 +3638,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3757
3638
|
const prepared = await _chunkUHNDVD3Pjs.preparePlayRunAdmission.call(void 0,
|
|
3758
3639
|
this.http,
|
|
3759
3640
|
resolved.request,
|
|
3760
|
-
_optionalChain([options, 'optionalAccess',
|
|
3641
|
+
_optionalChain([options, 'optionalAccess', _157 => _157.onSubmission])
|
|
3761
3642
|
);
|
|
3762
3643
|
const bodyJson = JSON.stringify(prepared.body);
|
|
3763
3644
|
const headers = runtimeSelectionHeaders(resolved.runtime, this.environment);
|
|
@@ -3786,7 +3667,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3786
3667
|
method: "POST",
|
|
3787
3668
|
body: JSON.parse(bodyJson),
|
|
3788
3669
|
headers,
|
|
3789
|
-
signal: _optionalChain([streamOptions, 'optionalAccess',
|
|
3670
|
+
signal: _optionalChain([streamOptions, 'optionalAccess', _158 => _158.signal]),
|
|
3790
3671
|
exactUrlOnly: true
|
|
3791
3672
|
}
|
|
3792
3673
|
)) {
|
|
@@ -3810,7 +3691,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3810
3691
|
*/
|
|
3811
3692
|
async *startPlayRunStream(request, options) {
|
|
3812
3693
|
const prepared = await this.preparePlayRunAdmission(request, options);
|
|
3813
|
-
yield* prepared.startStream({ signal: _optionalChain([options, 'optionalAccess',
|
|
3694
|
+
yield* prepared.startStream({ signal: _optionalChain([options, 'optionalAccess', _159 => _159.signal]) });
|
|
3814
3695
|
}
|
|
3815
3696
|
/**
|
|
3816
3697
|
* Register a bundled play artifact.
|
|
@@ -3964,7 +3845,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3964
3845
|
compilerManifest,
|
|
3965
3846
|
...input.input ? { input: input.input } : {},
|
|
3966
3847
|
...input.inputFile ? { inputFile: input.inputFile } : {},
|
|
3967
|
-
..._optionalChain([input, 'access',
|
|
3848
|
+
..._optionalChain([input, 'access', _160 => _160.packagedFiles, 'optionalAccess', _161 => _161.length]) ? { packagedFiles: input.packagedFiles } : {},
|
|
3968
3849
|
...input.force ? { force: true } : {},
|
|
3969
3850
|
...input.forceToolRefresh ? { forceToolRefresh: true } : {}
|
|
3970
3851
|
});
|
|
@@ -3994,29 +3875,29 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3994
3875
|
* ```
|
|
3995
3876
|
*/
|
|
3996
3877
|
async submitPlay(code, csvPath, name, options) {
|
|
3997
|
-
const runtimeInput = _optionalChain([options, 'optionalAccess',
|
|
3878
|
+
const runtimeInput = _optionalChain([options, 'optionalAccess', _162 => _162.input]) ? { ...options.input } : {};
|
|
3998
3879
|
if (csvPath) {
|
|
3999
3880
|
runtimeInput.file = csvPath;
|
|
4000
3881
|
}
|
|
4001
|
-
const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4002
|
-
const artifact = _optionalChain([options, 'optionalAccess',
|
|
4003
|
-
if (!_optionalChain([name, 'optionalAccess',
|
|
3882
|
+
const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _163 => _163.sourceCode]), () => ( code));
|
|
3883
|
+
const artifact = _optionalChain([options, 'optionalAccess', _164 => _164.artifact]);
|
|
3884
|
+
if (!_optionalChain([name, 'optionalAccess', _165 => _165.trim, 'call', _166 => _166()])) {
|
|
4004
3885
|
throw new Error("submitPlay requires a play name.");
|
|
4005
3886
|
}
|
|
4006
3887
|
if (!artifact) {
|
|
4007
3888
|
throw new Error("submitPlay requires a bundled play artifact.");
|
|
4008
3889
|
}
|
|
4009
|
-
const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async
|
|
3890
|
+
const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _167 => _167.compilerManifest]), async () => ( await this.compilePlayManifest({
|
|
4010
3891
|
name,
|
|
4011
3892
|
sourceCode,
|
|
4012
|
-
sourceFiles: _optionalChain([options, 'optionalAccess',
|
|
3893
|
+
sourceFiles: _optionalChain([options, 'optionalAccess', _168 => _168.sourceFiles]),
|
|
4013
3894
|
artifact
|
|
4014
3895
|
})));
|
|
4015
3896
|
const registeredArtifact = await this.registerPlayArtifact({
|
|
4016
3897
|
name,
|
|
4017
3898
|
sourceCode,
|
|
4018
|
-
sourceFiles: _optionalChain([options, 'optionalAccess',
|
|
4019
|
-
description: _optionalChain([options, 'optionalAccess',
|
|
3899
|
+
sourceFiles: _optionalChain([options, 'optionalAccess', _169 => _169.sourceFiles]),
|
|
3900
|
+
description: _optionalChain([options, 'optionalAccess', _170 => _170.description]),
|
|
4020
3901
|
artifact,
|
|
4021
3902
|
compilerManifest,
|
|
4022
3903
|
publish: false
|
|
@@ -4030,17 +3911,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4030
3911
|
name,
|
|
4031
3912
|
artifactStorageKey: registeredArtifact.artifactStorageKey,
|
|
4032
3913
|
sourceCode,
|
|
4033
|
-
description: _optionalChain([options, 'optionalAccess',
|
|
3914
|
+
description: _optionalChain([options, 'optionalAccess', _171 => _171.description]),
|
|
4034
3915
|
staticPipeline: _nullishCoalesce(registeredArtifact.staticPipeline, () => ( null)),
|
|
4035
3916
|
artifactHash: typeof artifact.artifactHash === "string" ? artifact.artifactHash : void 0,
|
|
4036
3917
|
graphHash: typeof artifact.graphHash === "string" ? artifact.graphHash : void 0,
|
|
4037
3918
|
runtimeArtifact: artifact,
|
|
4038
3919
|
compilerManifest,
|
|
4039
3920
|
...Object.keys(runtimeInput).length > 0 ? { input: runtimeInput } : {},
|
|
4040
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4041
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4042
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4043
|
-
..._optionalChain([options, 'optionalAccess',
|
|
3921
|
+
..._optionalChain([options, 'optionalAccess', _172 => _172.inputFile]) ? { inputFile: options.inputFile } : {},
|
|
3922
|
+
..._optionalChain([options, 'optionalAccess', _173 => _173.packagedFiles, 'optionalAccess', _174 => _174.length]) ? { packagedFiles: options.packagedFiles } : {},
|
|
3923
|
+
..._optionalChain([options, 'optionalAccess', _175 => _175.force]) ? { force: true } : {},
|
|
3924
|
+
..._optionalChain([options, 'optionalAccess', _176 => _176.forceToolRefresh]) ? { forceToolRefresh: true } : {}
|
|
4044
3925
|
});
|
|
4045
3926
|
}
|
|
4046
3927
|
/**
|
|
@@ -4110,10 +3991,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4110
3991
|
*/
|
|
4111
3992
|
async getPlayStatus(workflowId, options) {
|
|
4112
3993
|
const params = new URLSearchParams();
|
|
4113
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3994
|
+
if (_optionalChain([options, 'optionalAccess', _177 => _177.billing]) === false) {
|
|
4114
3995
|
params.set("billing", "false");
|
|
4115
3996
|
}
|
|
4116
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3997
|
+
if (_optionalChain([options, 'optionalAccess', _178 => _178.full]) === true) {
|
|
4117
3998
|
params.set("full", "true");
|
|
4118
3999
|
}
|
|
4119
4000
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4127,9 +4008,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4127
4008
|
for await (const event of watchRunEvents({
|
|
4128
4009
|
http: this.http,
|
|
4129
4010
|
runId: workflowId,
|
|
4130
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
4131
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
4132
|
-
onRetry: _optionalChain([options, 'optionalAccess',
|
|
4011
|
+
signal: _optionalChain([options, 'optionalAccess', _179 => _179.signal]),
|
|
4012
|
+
onNotice: _optionalChain([options, 'optionalAccess', _180 => _180.onNotice]),
|
|
4013
|
+
onRetry: _optionalChain([options, 'optionalAccess', _181 => _181.onRetry])
|
|
4133
4014
|
})) {
|
|
4134
4015
|
yield event;
|
|
4135
4016
|
}
|
|
@@ -4141,12 +4022,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4141
4022
|
* @deprecated Use `watchRunEvents` for ordinary run watching.
|
|
4142
4023
|
*/
|
|
4143
4024
|
async *streamPlayRunEvents(workflowId, options) {
|
|
4144
|
-
const headers = _optionalChain([options, 'optionalAccess',
|
|
4025
|
+
const headers = _optionalChain([options, 'optionalAccess', _182 => _182.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
|
|
4145
4026
|
const params = new URLSearchParams();
|
|
4146
|
-
params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4027
|
+
params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _183 => _183.mode]), () => ( "cli")));
|
|
4147
4028
|
for await (const event of this.http.streamSse(
|
|
4148
4029
|
`/api/v2/runs/${encodeURIComponent(workflowId)}/tail?${params.toString()}`,
|
|
4149
|
-
{ signal: _optionalChain([options, 'optionalAccess',
|
|
4030
|
+
{ signal: _optionalChain([options, 'optionalAccess', _184 => _184.signal]), headers }
|
|
4150
4031
|
)) {
|
|
4151
4032
|
if (event.scope === "play") {
|
|
4152
4033
|
yield event;
|
|
@@ -4162,24 +4043,24 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4162
4043
|
*/
|
|
4163
4044
|
async *observeRunEvents(runId, options) {
|
|
4164
4045
|
yield* this.watchRunEvents(runId, {
|
|
4165
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
4166
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
4046
|
+
signal: _optionalChain([options, 'optionalAccess', _185 => _185.signal]),
|
|
4047
|
+
onNotice: _optionalChain([options, 'optionalAccess', _186 => _186.onNotice])
|
|
4167
4048
|
});
|
|
4168
4049
|
}
|
|
4169
4050
|
/** Poll snapshots to terminal status and return the durable package. */
|
|
4170
4051
|
async watchRunToTerminal(runId, options) {
|
|
4171
4052
|
let terminalObserved = false;
|
|
4172
4053
|
for await (const event of this.watchRunEvents(runId, {
|
|
4173
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
4174
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
4175
|
-
onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4054
|
+
signal: _optionalChain([options, 'optionalAccess', _187 => _187.signal]),
|
|
4055
|
+
onNotice: _optionalChain([options, 'optionalAccess', _188 => _188.onNotice]),
|
|
4056
|
+
onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _189 => _189.onRetry]), () => ( _optionalChain([options, 'optionalAccess', _190 => _190.onReconnect])))
|
|
4176
4057
|
})) {
|
|
4177
|
-
_optionalChain([options, 'optionalAccess',
|
|
4058
|
+
_optionalChain([options, 'optionalAccess', _191 => _191.onEvent, 'optionalCall', _192 => _192(event)]);
|
|
4178
4059
|
if (_chunkUHNDVD3Pjs.isTerminalPlayRunLifecycleStatus.call(void 0, playLiveRunStatus(event))) {
|
|
4179
4060
|
terminalObserved = true;
|
|
4180
4061
|
}
|
|
4181
4062
|
}
|
|
4182
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4063
|
+
if (_optionalChain([options, 'optionalAccess', _193 => _193.signal, 'optionalAccess', _194 => _194.aborted])) {
|
|
4183
4064
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)("Run watch aborted.", void 0, "ABORTED");
|
|
4184
4065
|
}
|
|
4185
4066
|
const refreshed = await this.getRunStatus(runId);
|
|
@@ -4233,7 +4114,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4233
4114
|
async stopPlay(workflowId, options) {
|
|
4234
4115
|
return this.http.post(
|
|
4235
4116
|
`/api/v2/runs/${encodeURIComponent(workflowId)}/stop`,
|
|
4236
|
-
_optionalChain([options, 'optionalAccess',
|
|
4117
|
+
_optionalChain([options, 'optionalAccess', _195 => _195.reason]) ? { reason: options.reason } : {}
|
|
4237
4118
|
);
|
|
4238
4119
|
}
|
|
4239
4120
|
/**
|
|
@@ -4269,7 +4150,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4269
4150
|
/** List the org's workflows. `GET /api/v2/workflows`. */
|
|
4270
4151
|
async listWorkflows(options) {
|
|
4271
4152
|
const params = new URLSearchParams();
|
|
4272
|
-
if (typeof _optionalChain([options, 'optionalAccess',
|
|
4153
|
+
if (typeof _optionalChain([options, 'optionalAccess', _196 => _196.limit]) === "number") {
|
|
4273
4154
|
params.set("limit", String(options.limit));
|
|
4274
4155
|
}
|
|
4275
4156
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4322,7 +4203,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4322
4203
|
/** List a workflow's runs. `GET /api/v2/workflows/:id/runs`. */
|
|
4323
4204
|
async listWorkflowRuns(id, options) {
|
|
4324
4205
|
const params = new URLSearchParams();
|
|
4325
|
-
if (typeof _optionalChain([options, 'optionalAccess',
|
|
4206
|
+
if (typeof _optionalChain([options, 'optionalAccess', _197 => _197.limit]) === "number") {
|
|
4326
4207
|
params.set("limit", String(options.limit));
|
|
4327
4208
|
}
|
|
4328
4209
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4358,10 +4239,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4358
4239
|
*/
|
|
4359
4240
|
async getRunStatus(runId, options) {
|
|
4360
4241
|
const params = new URLSearchParams();
|
|
4361
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4242
|
+
if (_optionalChain([options, 'optionalAccess', _198 => _198.full]) === true) {
|
|
4362
4243
|
params.set("full", "true");
|
|
4363
4244
|
}
|
|
4364
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4245
|
+
if (_optionalChain([options, 'optionalAccess', _199 => _199.configuration]) === true) {
|
|
4365
4246
|
params.set("include", "configuration");
|
|
4366
4247
|
}
|
|
4367
4248
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4369,7 +4250,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4369
4250
|
`/api/v2/runs/${encodeURIComponent(runId)}${query}`,
|
|
4370
4251
|
{ headers: { "x-deepline-run-status": "1" } }
|
|
4371
4252
|
);
|
|
4372
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4253
|
+
if (_optionalChain([options, 'optionalAccess', _200 => _200.configuration]) === true && !Object.hasOwn(response, "contract")) {
|
|
4373
4254
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4374
4255
|
"This server does not support recorded configuration reads.",
|
|
4375
4256
|
void 0,
|
|
@@ -4377,7 +4258,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4377
4258
|
);
|
|
4378
4259
|
}
|
|
4379
4260
|
const status = normalizePlayStatus(response);
|
|
4380
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4261
|
+
if (_optionalChain([options, 'optionalAccess', _201 => _201.failedLogs]) !== true || status.status !== "failed") {
|
|
4381
4262
|
return status;
|
|
4382
4263
|
}
|
|
4383
4264
|
const requestedFailedLogLimit = typeof options.failedLogLimit === "number" && Number.isFinite(options.failedLogLimit) ? Math.max(1, Math.floor(options.failedLogLimit)) : RUNS_FAILED_LOG_LIMIT;
|
|
@@ -4466,7 +4347,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4466
4347
|
/** The same tenant-scoped run history searched by the dashboard and CLI. */
|
|
4467
4348
|
async getRunsHistory(options = {}) {
|
|
4468
4349
|
const params = new URLSearchParams();
|
|
4469
|
-
const search = _optionalChain([options, 'access',
|
|
4350
|
+
const search = _optionalChain([options, 'access', _202 => _202.search, 'optionalAccess', _203 => _203.trim, 'call', _204 => _204()]);
|
|
4470
4351
|
if (search && search.length > 200) {
|
|
4471
4352
|
throw new Error("Run search must be at most 200 characters.");
|
|
4472
4353
|
}
|
|
@@ -4492,16 +4373,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4492
4373
|
}
|
|
4493
4374
|
/** Read one run page without discarding server pagination metadata. */
|
|
4494
4375
|
async listRunsPage(options) {
|
|
4495
|
-
const playName = _optionalChain([options, 'access',
|
|
4376
|
+
const playName = _optionalChain([options, 'access', _205 => _205.play, 'optionalAccess', _206 => _206.trim, 'call', _207 => _207()]);
|
|
4496
4377
|
const params = new URLSearchParams();
|
|
4497
4378
|
if (playName) {
|
|
4498
4379
|
params.set("play", playName);
|
|
4499
4380
|
}
|
|
4500
|
-
const status = _optionalChain([options, 'access',
|
|
4381
|
+
const status = _optionalChain([options, 'access', _208 => _208.status, 'optionalAccess', _209 => _209.trim, 'call', _210 => _210()]);
|
|
4501
4382
|
if (status) {
|
|
4502
4383
|
params.set("status", status);
|
|
4503
4384
|
}
|
|
4504
|
-
const node = _optionalChain([options, 'access',
|
|
4385
|
+
const node = _optionalChain([options, 'access', _211 => _211.node, 'optionalAccess', _212 => _212.trim, 'call', _213 => _213()]);
|
|
4505
4386
|
if (node) {
|
|
4506
4387
|
if (!playName)
|
|
4507
4388
|
throw new Error("runs.list options.node requires options.play.");
|
|
@@ -4575,8 +4456,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4575
4456
|
* different key intentionally starts another rerun.
|
|
4576
4457
|
*/
|
|
4577
4458
|
async rerun(runId, options) {
|
|
4578
|
-
const idempotencyKey = _optionalChain([options, 'optionalAccess',
|
|
4579
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4459
|
+
const idempotencyKey = _optionalChain([options, 'optionalAccess', _214 => _214.idempotencyKey, 'optionalAccess', _215 => _215.trim, 'call', _216 => _216()]);
|
|
4460
|
+
if (_optionalChain([options, 'optionalAccess', _217 => _217.idempotencyKey]) !== void 0 && !idempotencyKey) {
|
|
4580
4461
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4581
4462
|
"runs.rerun idempotencyKey must not be empty.",
|
|
4582
4463
|
void 0,
|
|
@@ -4585,7 +4466,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4585
4466
|
}
|
|
4586
4467
|
return this.http.post(
|
|
4587
4468
|
`/api/v2/runs/${encodeURIComponent(runId)}/rerun`,
|
|
4588
|
-
_optionalChain([options, 'optionalAccess',
|
|
4469
|
+
_optionalChain([options, 'optionalAccess', _218 => _218.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
|
|
4589
4470
|
{ "Idempotency-Key": idempotencyKey || globalThis.crypto.randomUUID() }
|
|
4590
4471
|
);
|
|
4591
4472
|
}
|
|
@@ -4599,21 +4480,21 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4599
4480
|
* ```
|
|
4600
4481
|
*/
|
|
4601
4482
|
async getRunLogs(runId, options) {
|
|
4602
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4483
|
+
if (_optionalChain([options, 'optionalAccess', _219 => _219.all]) === true && options.failed === true) {
|
|
4603
4484
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4604
4485
|
"runs.logs cannot combine all and failed views.",
|
|
4605
4486
|
void 0,
|
|
4606
4487
|
"INVALID_RUN_LOG_VIEW"
|
|
4607
4488
|
);
|
|
4608
4489
|
}
|
|
4609
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4490
|
+
if (_optionalChain([options, 'optionalAccess', _220 => _220.cursor]) !== void 0 && options.failed === true) {
|
|
4610
4491
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4611
4492
|
"runs.logs cannot combine failed with cursor.",
|
|
4612
4493
|
void 0,
|
|
4613
4494
|
"INVALID_RUN_LOG_VIEW"
|
|
4614
4495
|
);
|
|
4615
4496
|
}
|
|
4616
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4497
|
+
if (_optionalChain([options, 'optionalAccess', _221 => _221.failed]) === true) {
|
|
4617
4498
|
const requestedLimit = typeof options.limit === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : RUNS_FAILED_LOG_LIMIT;
|
|
4618
4499
|
const failedLimit = Math.min(RUNS_FAILED_LOG_LIMIT, requestedLimit);
|
|
4619
4500
|
const page = await this.http.get(
|
|
@@ -4638,18 +4519,18 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4638
4519
|
...page.logsTruncated ? { logsTruncated: true } : {}
|
|
4639
4520
|
};
|
|
4640
4521
|
}
|
|
4641
|
-
const beforeSequence = _optionalChain([options, 'optionalAccess',
|
|
4642
|
-
const limit = _optionalChain([options, 'optionalAccess',
|
|
4522
|
+
const beforeSequence = _optionalChain([options, 'optionalAccess', _222 => _222.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
|
|
4523
|
+
const limit = _optionalChain([options, 'optionalAccess', _223 => _223.all]) ? Number.MAX_SAFE_INTEGER : typeof _optionalChain([options, 'optionalAccess', _224 => _224.limit]) === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
|
|
4643
4524
|
const fetchPage = (afterSeq2, pageLimit) => this.http.get(
|
|
4644
4525
|
`/api/v2/runs/${encodeURIComponent(runId)}/logs?afterSeq=${afterSeq2}&limit=${pageLimit}`,
|
|
4645
4526
|
{ retryApiErrors: true }
|
|
4646
4527
|
);
|
|
4647
4528
|
const probe = await fetchPage(0, 1);
|
|
4648
4529
|
const lastStoredSeq = probe.lastStoredSeq;
|
|
4649
|
-
const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access',
|
|
4530
|
+
const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _225 => _225.entries, 'access', _226 => _226[0], 'optionalAccess', _227 => _227.seq]), () => ( null));
|
|
4650
4531
|
const upperSeq = beforeSequence === null ? Number.POSITIVE_INFINITY : Math.min(beforeSequence - 1, lastStoredSeq);
|
|
4651
4532
|
const windowEndSeq = Math.min(upperSeq, lastStoredSeq);
|
|
4652
|
-
let afterSeq = _optionalChain([options, 'optionalAccess',
|
|
4533
|
+
let afterSeq = _optionalChain([options, 'optionalAccess', _228 => _228.all]) ? 0 : Math.max(0, windowEndSeq - limit);
|
|
4653
4534
|
const entries = [];
|
|
4654
4535
|
while (entries.length < limit && afterSeq < upperSeq) {
|
|
4655
4536
|
const page = await fetchPage(
|
|
@@ -4683,7 +4564,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4683
4564
|
hasMore: olderLinesExist,
|
|
4684
4565
|
nextCursor: olderLinesExist ? encodeRunLogsCursor(firstSequence) : null,
|
|
4685
4566
|
entries: entries.map((entry) => entry.line),
|
|
4686
|
-
view: _optionalChain([options, 'optionalAccess',
|
|
4567
|
+
view: _optionalChain([options, 'optionalAccess', _229 => _229.all]) ? "all" : "tail",
|
|
4687
4568
|
...probe.logsTruncated ? { logsTruncated: true } : {}
|
|
4688
4569
|
};
|
|
4689
4570
|
}
|
|
@@ -4859,7 +4740,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4859
4740
|
limit: String(_nullishCoalesce(input.limit, () => ( 5e3))),
|
|
4860
4741
|
offset: String(_nullishCoalesce(input.offset, () => ( 0)))
|
|
4861
4742
|
});
|
|
4862
|
-
if (_optionalChain([input, 'access',
|
|
4743
|
+
if (_optionalChain([input, 'access', _230 => _230.runId, 'optionalAccess', _231 => _231.trim, 'call', _232 => _232()])) {
|
|
4863
4744
|
params.set("runId", input.runId.trim());
|
|
4864
4745
|
}
|
|
4865
4746
|
if (input.rowMode === "all" || input.rowMode === "live") {
|
|
@@ -4869,9 +4750,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4869
4750
|
`/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`,
|
|
4870
4751
|
{ signal: input.signal }
|
|
4871
4752
|
);
|
|
4872
|
-
const requestedRunId = _optionalChain([input, 'access',
|
|
4753
|
+
const requestedRunId = _optionalChain([input, 'access', _233 => _233.runId, 'optionalAccess', _234 => _234.trim, 'call', _235 => _235()]) || "";
|
|
4873
4754
|
if (requestedRunId) {
|
|
4874
|
-
const confirmedRunId = _optionalChain([result, 'access',
|
|
4755
|
+
const confirmedRunId = _optionalChain([result, 'access', _236 => _236.scope, 'optionalAccess', _237 => _237.kind]) === "run" ? result.scope.runId.trim() : "";
|
|
4875
4756
|
const foreignRowRunIds = [
|
|
4876
4757
|
...new Set(
|
|
4877
4758
|
result.rows.map(
|
|
@@ -4879,7 +4760,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4879
4760
|
).filter((runId) => runId && runId !== requestedRunId)
|
|
4880
4761
|
)
|
|
4881
4762
|
];
|
|
4882
|
-
if (_optionalChain([result, 'access',
|
|
4763
|
+
if (_optionalChain([result, 'access', _238 => _238.scope, 'optionalAccess', _239 => _239.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
|
|
4883
4764
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4884
4765
|
`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.`,
|
|
4885
4766
|
void 0,
|
|
@@ -4908,7 +4789,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4908
4789
|
async stopRun(runId, options) {
|
|
4909
4790
|
return this.http.post(
|
|
4910
4791
|
`/api/v2/runs/${encodeURIComponent(runId)}/stop`,
|
|
4911
|
-
_optionalChain([options, 'optionalAccess',
|
|
4792
|
+
_optionalChain([options, 'optionalAccess', _240 => _240.reason]) ? { reason: options.reason } : {}
|
|
4912
4793
|
);
|
|
4913
4794
|
}
|
|
4914
4795
|
/**
|
|
@@ -4926,11 +4807,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4926
4807
|
* need to clear the workspace run-slot state without knowing each run id.
|
|
4927
4808
|
*/
|
|
4928
4809
|
async stopAllRuns(options) {
|
|
4929
|
-
const dryRun = _optionalChain([options, 'optionalAccess',
|
|
4810
|
+
const dryRun = _optionalChain([options, 'optionalAccess', _241 => _241.dryRun]) === true;
|
|
4930
4811
|
const result = await this.http.post(
|
|
4931
4812
|
"/api/v2/runs/stop-all",
|
|
4932
4813
|
{
|
|
4933
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4814
|
+
..._optionalChain([options, 'optionalAccess', _242 => _242.reason]) ? { reason: options.reason } : {},
|
|
4934
4815
|
...dryRun ? { dryRun: true } : {}
|
|
4935
4816
|
}
|
|
4936
4817
|
);
|
|
@@ -4951,7 +4832,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4951
4832
|
* `origin: "owned"` for org-owned plays.
|
|
4952
4833
|
*/
|
|
4953
4834
|
async listPlays(options) {
|
|
4954
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
4835
|
+
if (!_optionalChain([options, 'optionalAccess', _243 => _243.grep, 'optionalAccess', _244 => _244.trim, 'call', _245 => _245()])) {
|
|
4955
4836
|
return (await this.requestPlaysPage(options, false)).plays;
|
|
4956
4837
|
}
|
|
4957
4838
|
const plays = [];
|
|
@@ -4973,45 +4854,45 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4973
4854
|
}
|
|
4974
4855
|
async requestPlaysPage(options, paginateInventory = true) {
|
|
4975
4856
|
const params = new URLSearchParams();
|
|
4976
|
-
if (paginateInventory && !_optionalChain([options, 'optionalAccess',
|
|
4857
|
+
if (paginateInventory && !_optionalChain([options, 'optionalAccess', _246 => _246.grep, 'optionalAccess', _247 => _247.trim, 'call', _248 => _248()]))
|
|
4977
4858
|
params.set("inventory_paginated", "1");
|
|
4978
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4979
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4859
|
+
if (_optionalChain([options, 'optionalAccess', _249 => _249.origin])) params.set("origin", options.origin);
|
|
4860
|
+
if (_optionalChain([options, 'optionalAccess', _250 => _250.categories])) {
|
|
4980
4861
|
params.set(
|
|
4981
4862
|
"categories",
|
|
4982
4863
|
Array.isArray(options.categories) ? options.categories.join(",") : options.categories
|
|
4983
4864
|
);
|
|
4984
4865
|
}
|
|
4985
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4866
|
+
if (_optionalChain([options, 'optionalAccess', _251 => _251.categories]) || _optionalChain([options, 'optionalAccess', _252 => _252.includeToolCategories])) {
|
|
4986
4867
|
params.set("include_tool_categories", "1");
|
|
4987
4868
|
}
|
|
4988
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4869
|
+
if (_optionalChain([options, 'optionalAccess', _253 => _253.tags])) {
|
|
4989
4870
|
params.set(
|
|
4990
4871
|
"tags",
|
|
4991
4872
|
Array.isArray(options.tags) ? options.tags.join(",") : options.tags
|
|
4992
4873
|
);
|
|
4993
4874
|
}
|
|
4994
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4995
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4875
|
+
if (_optionalChain([options, 'optionalAccess', _254 => _254.includeArchived])) params.set("include_archived", "1");
|
|
4876
|
+
if (_optionalChain([options, 'optionalAccess', _255 => _255.includeCostEstimates])) {
|
|
4996
4877
|
params.set("include_cost_estimates", "1");
|
|
4997
4878
|
}
|
|
4998
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4879
|
+
if (_optionalChain([options, 'optionalAccess', _256 => _256.grep, 'optionalAccess', _257 => _257.trim, 'call', _258 => _258()])) {
|
|
4999
4880
|
params.set("grep", options.grep.trim());
|
|
5000
4881
|
params.set("limit", "60");
|
|
5001
4882
|
}
|
|
5002
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4883
|
+
if (_optionalChain([options, 'optionalAccess', _259 => _259.limit]) !== void 0) {
|
|
5003
4884
|
if (!Number.isSafeInteger(options.limit) || options.limit < 1) {
|
|
5004
4885
|
throw new Error("Play page limit must be a positive integer");
|
|
5005
4886
|
}
|
|
5006
4887
|
params.set("limit", String(options.limit));
|
|
5007
4888
|
}
|
|
5008
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4889
|
+
if (_optionalChain([options, 'optionalAccess', _260 => _260.cursor])) params.set("cursor", options.cursor);
|
|
5009
4890
|
const suffix = params.size ? `?${params.toString()}` : "";
|
|
5010
4891
|
const response = await this.http.get(`/api/v2/plays${suffix}`);
|
|
5011
4892
|
return {
|
|
5012
4893
|
plays: _nullishCoalesce(response.plays, () => ( [])),
|
|
5013
|
-
cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access',
|
|
5014
|
-
hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access',
|
|
4894
|
+
cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _261 => _261.pagination, 'optionalAccess', _262 => _262.cursor]), () => ( response.cursor)), () => ( null)),
|
|
4895
|
+
hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _263 => _263.pagination, 'optionalAccess', _264 => _264.hasMore]), () => ( response.hasMore)))
|
|
5015
4896
|
};
|
|
5016
4897
|
}
|
|
5017
4898
|
/** Read definition-level settings, independently of code revisions. */
|
|
@@ -5068,8 +4949,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5068
4949
|
return this.http.post("/api/v2/integrations/connect", {
|
|
5069
4950
|
provider: "slack",
|
|
5070
4951
|
scopes: [...PRODUCT_NOTIFICATION_SLACK_OAUTH_SCOPES],
|
|
5071
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5072
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4952
|
+
..._optionalChain([options, 'optionalAccess', _265 => _265.successUrl]) ? { success_url: options.successUrl } : {},
|
|
4953
|
+
..._optionalChain([options, 'optionalAccess', _266 => _266.failureUrl]) ? { failure_url: options.failureUrl } : {}
|
|
5073
4954
|
});
|
|
5074
4955
|
}
|
|
5075
4956
|
/** List Slack channels visible to the connected Deepline Slack app. */
|
|
@@ -5144,7 +5025,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5144
5025
|
}
|
|
5145
5026
|
const targets = input.targets.map(parseNotificationGroupTarget);
|
|
5146
5027
|
const legacyEvents = _nullishCoalesce(input.legacyEvents, () => ( []));
|
|
5147
|
-
const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access',
|
|
5028
|
+
const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _267 => _267[0], 'optionalAccess', _268 => _268.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
|
|
5148
5029
|
if (legacyEvents.length > 0 && !legacyTarget) {
|
|
5149
5030
|
throw new Error(
|
|
5150
5031
|
"--for is supported only by the legacy one-Slack-target form. Create the group first, then add rules in notification configuration."
|
|
@@ -5180,7 +5061,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5180
5061
|
const existingGroup = current.configuration.groups.find(
|
|
5181
5062
|
(candidate) => candidate.name.toLowerCase() === name.toLowerCase()
|
|
5182
5063
|
);
|
|
5183
|
-
const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess',
|
|
5064
|
+
const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _269 => _269.groupKey]), () => ( notificationObjectKey("group")));
|
|
5184
5065
|
const group = _nullishCoalesce(existingGroup, () => ( {
|
|
5185
5066
|
groupKey,
|
|
5186
5067
|
name,
|
|
@@ -5369,7 +5250,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5369
5250
|
}
|
|
5370
5251
|
);
|
|
5371
5252
|
const plays = (_nullishCoalesce(response.plays, () => ( []))).map(
|
|
5372
|
-
(play) =>
|
|
5253
|
+
(play) => _chunkKXMNM4AQjs.describePlayListItem.call(void 0, play, { ...options, pipeline: true })
|
|
5373
5254
|
);
|
|
5374
5255
|
if (scope === "prebuilt") {
|
|
5375
5256
|
return plays.filter(isPrebuiltPlayDescription);
|
|
@@ -5398,13 +5279,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5398
5279
|
*/
|
|
5399
5280
|
async getPlay(name, options) {
|
|
5400
5281
|
const encodedName = encodeURIComponent(name);
|
|
5401
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
5282
|
+
const query = _optionalChain([options, 'optionalAccess', _270 => _270.source]) ? `?include=source&revision=${encodeURIComponent(options.source)}` : _optionalChain([options, 'optionalAccess', _271 => _271.guidance]) ? "?include=guidance" : "";
|
|
5402
5283
|
return this.http.get(`/api/v2/plays/${encodedName}${query}`);
|
|
5403
5284
|
}
|
|
5404
5285
|
/** Read one trigger inventory page without loading run histories. */
|
|
5405
5286
|
async listPlayTriggerInventory(options) {
|
|
5406
5287
|
const params = new URLSearchParams({ view: "inventory" });
|
|
5407
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5288
|
+
if (_optionalChain([options, 'optionalAccess', _272 => _272.cursor])) params.set("cursor", options.cursor);
|
|
5408
5289
|
return this.http.get(`/api/v2/plays/triggers?${params}`);
|
|
5409
5290
|
}
|
|
5410
5291
|
/** Read one trigger's recent runs, with an explicit partial-history flag. */
|
|
@@ -5413,7 +5294,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5413
5294
|
view: "history",
|
|
5414
5295
|
binding_id: bindingId
|
|
5415
5296
|
});
|
|
5416
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5297
|
+
if (_optionalChain([options, 'optionalAccess', _273 => _273.limit]) !== void 0)
|
|
5417
5298
|
params.set("history_limit", String(options.limit));
|
|
5418
5299
|
return this.http.get(`/api/v2/plays/triggers?${params}`);
|
|
5419
5300
|
}
|
|
@@ -5421,11 +5302,24 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5421
5302
|
* Get a normalized play description suitable for agents and CLIs.
|
|
5422
5303
|
*
|
|
5423
5304
|
* The description includes runnable examples, input/output summaries, clone
|
|
5424
|
-
* guidance, revision state, and latest run metadata when available.
|
|
5305
|
+
* guidance, revision state, and latest run metadata when available. Pass
|
|
5306
|
+
* `{ pipeline: true }` to include the compiled pipeline, which can be
|
|
5307
|
+
* hundreds of kilobytes and is otherwise left out.
|
|
5425
5308
|
*/
|
|
5426
|
-
async describePlay(name, options) {
|
|
5427
|
-
|
|
5428
|
-
|
|
5309
|
+
async describePlay(name, options = {}) {
|
|
5310
|
+
if (options.pipeline) {
|
|
5311
|
+
return _chunkKXMNM4AQjs.describePlayDetail.call(void 0,
|
|
5312
|
+
await this.getPlay(name, { guidance: true }),
|
|
5313
|
+
options
|
|
5314
|
+
);
|
|
5315
|
+
}
|
|
5316
|
+
const params = new URLSearchParams({
|
|
5317
|
+
include: "guidance",
|
|
5318
|
+
view: "description",
|
|
5319
|
+
...options.compact ? { compact: "1" } : {}
|
|
5320
|
+
});
|
|
5321
|
+
const body = await this.http.get(`/api/v2/plays/${encodeURIComponent(name)}?${params.toString()}`);
|
|
5322
|
+
return "description" in body ? body.description : _chunkKXMNM4AQjs.describePlayDetail.call(void 0, body, options);
|
|
5429
5323
|
}
|
|
5430
5324
|
/**
|
|
5431
5325
|
* Clear run history and durable sheet/result data for a play without deleting
|
|
@@ -5449,7 +5343,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5449
5343
|
*/
|
|
5450
5344
|
async listPlayVersions(name, options) {
|
|
5451
5345
|
const encodedName = encodeURIComponent(name);
|
|
5452
|
-
const suffix = _optionalChain([options, 'optionalAccess',
|
|
5346
|
+
const suffix = _optionalChain([options, 'optionalAccess', _274 => _274.full]) ? "?full=true" : "";
|
|
5453
5347
|
const response = await this.http.get(
|
|
5454
5348
|
`/api/v2/plays/${encodedName}/versions${suffix}`
|
|
5455
5349
|
);
|
|
@@ -5602,14 +5496,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5602
5496
|
*/
|
|
5603
5497
|
async runPlay(code, csvPath, name, options) {
|
|
5604
5498
|
const { workflowId } = await this.submitPlay(code, csvPath, name, {
|
|
5605
|
-
input: _optionalChain([options, 'optionalAccess',
|
|
5606
|
-
sourceCode: _optionalChain([options, 'optionalAccess',
|
|
5607
|
-
artifact: _optionalChain([options, 'optionalAccess',
|
|
5608
|
-
compilerManifest: _optionalChain([options, 'optionalAccess',
|
|
5609
|
-
inputFile: _optionalChain([options, 'optionalAccess',
|
|
5610
|
-
packagedFiles: _optionalChain([options, 'optionalAccess',
|
|
5611
|
-
force: _optionalChain([options, 'optionalAccess',
|
|
5612
|
-
forceToolRefresh: _optionalChain([options, 'optionalAccess',
|
|
5499
|
+
input: _optionalChain([options, 'optionalAccess', _275 => _275.input]),
|
|
5500
|
+
sourceCode: _optionalChain([options, 'optionalAccess', _276 => _276.sourceCode]),
|
|
5501
|
+
artifact: _optionalChain([options, 'optionalAccess', _277 => _277.artifact]),
|
|
5502
|
+
compilerManifest: _optionalChain([options, 'optionalAccess', _278 => _278.compilerManifest]),
|
|
5503
|
+
inputFile: _optionalChain([options, 'optionalAccess', _279 => _279.inputFile]),
|
|
5504
|
+
packagedFiles: _optionalChain([options, 'optionalAccess', _280 => _280.packagedFiles]),
|
|
5505
|
+
force: _optionalChain([options, 'optionalAccess', _281 => _281.force]),
|
|
5506
|
+
forceToolRefresh: _optionalChain([options, 'optionalAccess', _282 => _282.forceToolRefresh])
|
|
5613
5507
|
});
|
|
5614
5508
|
const start = Date.now();
|
|
5615
5509
|
const state = {
|
|
@@ -5620,7 +5514,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5620
5514
|
latest: null
|
|
5621
5515
|
};
|
|
5622
5516
|
let terminalObserved = null;
|
|
5623
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5517
|
+
if (_optionalChain([options, 'optionalAccess', _283 => _283.signal, 'optionalAccess', _284 => _284.aborted])) {
|
|
5624
5518
|
await this.cancelPlay(workflowId);
|
|
5625
5519
|
return {
|
|
5626
5520
|
success: false,
|
|
@@ -5631,9 +5525,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5631
5525
|
};
|
|
5632
5526
|
}
|
|
5633
5527
|
for await (const event of this.watchRunEvents(workflowId, {
|
|
5634
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
5528
|
+
signal: _optionalChain([options, 'optionalAccess', _285 => _285.signal])
|
|
5635
5529
|
})) {
|
|
5636
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5530
|
+
if (_optionalChain([options, 'optionalAccess', _286 => _286.signal, 'optionalAccess', _287 => _287.aborted])) {
|
|
5637
5531
|
await this.cancelPlay(workflowId);
|
|
5638
5532
|
return {
|
|
5639
5533
|
success: false,
|
|
@@ -5643,19 +5537,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5643
5537
|
error: "Cancelled by user"
|
|
5644
5538
|
};
|
|
5645
5539
|
}
|
|
5646
|
-
const previousStatus = _optionalChain([state, 'access',
|
|
5540
|
+
const previousStatus = _optionalChain([state, 'access', _288 => _288.latest, 'optionalAccess', _289 => _289.status]);
|
|
5647
5541
|
const status = updatePlayLiveStatusState(state, event);
|
|
5648
5542
|
if (!status) {
|
|
5649
5543
|
continue;
|
|
5650
5544
|
}
|
|
5651
5545
|
if (event.type !== "play.run.status" || status.status !== previousStatus) {
|
|
5652
|
-
_optionalChain([options, 'optionalAccess',
|
|
5546
|
+
_optionalChain([options, 'optionalAccess', _290 => _290.onProgress, 'optionalCall', _291 => _291(status)]);
|
|
5653
5547
|
}
|
|
5654
5548
|
if (_chunkUHNDVD3Pjs.isTerminalPlayRunLifecycleStatus.call(void 0, status.status)) {
|
|
5655
5549
|
terminalObserved = status;
|
|
5656
5550
|
}
|
|
5657
5551
|
}
|
|
5658
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5552
|
+
if (_optionalChain([options, 'optionalAccess', _292 => _292.signal, 'optionalAccess', _293 => _293.aborted])) {
|
|
5659
5553
|
await this.cancelPlay(workflowId);
|
|
5660
5554
|
return {
|
|
5661
5555
|
success: false,
|
|
@@ -5708,7 +5602,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5708
5602
|
const response = await this.http.get(
|
|
5709
5603
|
`/api/v2/usage/events?request_id=${encodeURIComponent(normalizedRequestId)}`
|
|
5710
5604
|
);
|
|
5711
|
-
const event = _optionalChain([response, 'access',
|
|
5605
|
+
const event = _optionalChain([response, 'access', _294 => _294.entries, 'optionalAccess', _295 => _295[0]]);
|
|
5712
5606
|
if (!event) {
|
|
5713
5607
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
5714
5608
|
"No usage event was found for this request_id.",
|
|
@@ -5839,7 +5733,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5839
5733
|
async cancelBillingSubscription(options) {
|
|
5840
5734
|
return this.http.post(
|
|
5841
5735
|
"/api/v2/billing/subscription/cancel",
|
|
5842
|
-
{ action: _optionalChain([options, 'optionalAccess',
|
|
5736
|
+
{ action: _optionalChain([options, 'optionalAccess', _296 => _296.undo]) ? "undo_cancel" : "cancel" }
|
|
5843
5737
|
);
|
|
5844
5738
|
}
|
|
5845
5739
|
/**
|
|
@@ -5851,7 +5745,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5851
5745
|
*/
|
|
5852
5746
|
async listBillingInvoices(options) {
|
|
5853
5747
|
const params = new URLSearchParams();
|
|
5854
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5748
|
+
if (_optionalChain([options, 'optionalAccess', _297 => _297.limit]) !== void 0) {
|
|
5855
5749
|
params.set("limit", String(options.limit));
|
|
5856
5750
|
}
|
|
5857
5751
|
const suffix = Array.from(params).length > 0 ? `?${params.toString()}` : "";
|
|
@@ -5961,7 +5855,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5961
5855
|
/** Create a Stripe-hosted portal session for payment recovery and invoices. */
|
|
5962
5856
|
async createTargetBillingPortalSession(options) {
|
|
5963
5857
|
const response = await this.http.post(
|
|
5964
|
-
_optionalChain([options, 'optionalAccess',
|
|
5858
|
+
_optionalChain([options, 'optionalAccess', _298 => _298.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
|
|
5965
5859
|
{}
|
|
5966
5860
|
);
|
|
5967
5861
|
return response.data;
|
|
@@ -6011,8 +5905,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6011
5905
|
return this.http.request("/api/v2/monitors/audit", {
|
|
6012
5906
|
method: "POST",
|
|
6013
5907
|
body: {
|
|
6014
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6015
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5908
|
+
..._optionalChain([options, 'optionalAccess', _299 => _299.fleetId]) ? { fleet_id: options.fleetId } : {},
|
|
5909
|
+
..._optionalChain([options, 'optionalAccess', _300 => _300.cursor]) ? { cursor: options.cursor } : {}
|
|
6016
5910
|
},
|
|
6017
5911
|
maxRetries: 0
|
|
6018
5912
|
});
|
|
@@ -6022,8 +5916,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6022
5916
|
return this.http.request("/api/v2/monitors/repair", {
|
|
6023
5917
|
method: "POST",
|
|
6024
5918
|
body: {
|
|
6025
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6026
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5919
|
+
..._optionalChain([options, 'optionalAccess', _301 => _301.fleetId]) ? { fleet_id: options.fleetId } : {},
|
|
5920
|
+
..._optionalChain([options, 'optionalAccess', _302 => _302.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
|
|
6027
5921
|
},
|
|
6028
5922
|
maxRetries: 0
|
|
6029
5923
|
});
|
|
@@ -6031,7 +5925,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6031
5925
|
/** Delivery and convergence health. Prefer `client.monitors.health(...)`. */
|
|
6032
5926
|
async readMonitorsHealth(options) {
|
|
6033
5927
|
const params = new URLSearchParams();
|
|
6034
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5928
|
+
if (_optionalChain([options, 'optionalAccess', _303 => _303.fleetId])) params.set("fleet_id", options.fleetId);
|
|
6035
5929
|
const query = params.toString();
|
|
6036
5930
|
const suffix = query ? `?${query}` : "";
|
|
6037
5931
|
return this.http.request(
|
|
@@ -6104,7 +5998,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6104
5998
|
);
|
|
6105
5999
|
}
|
|
6106
6000
|
const params = new URLSearchParams();
|
|
6107
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6001
|
+
if (_optionalChain([options, 'optionalAccess', _304 => _304.cursor])) params.set("cursor", options.cursor);
|
|
6108
6002
|
const suffix = params.size > 0 ? `?${params}` : "";
|
|
6109
6003
|
return this.http.request(
|
|
6110
6004
|
`/api/v2/monitors/batch/${encodeURIComponent(runId)}${suffix}`,
|
|
@@ -6148,7 +6042,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6148
6042
|
* `client.monitors.deploy(...)`.
|
|
6149
6043
|
*/
|
|
6150
6044
|
async deployMonitor(definition, options) {
|
|
6151
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6045
|
+
if (_optionalChain([options, 'optionalAccess', _305 => _305.dryRun])) {
|
|
6152
6046
|
return this.http.request("/api/v2/monitors/check", {
|
|
6153
6047
|
method: "POST",
|
|
6154
6048
|
body: definition
|
|
@@ -6184,12 +6078,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6184
6078
|
/** List deployed monitors. Prefer `client.monitors.list(...)`. */
|
|
6185
6079
|
async listMonitors(options) {
|
|
6186
6080
|
const params = new URLSearchParams();
|
|
6187
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6188
|
-
else if (_optionalChain([options, 'optionalAccess',
|
|
6189
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6081
|
+
if (_optionalChain([options, 'optionalAccess', _306 => _306.state])) params.set("state", options.state);
|
|
6082
|
+
else if (_optionalChain([options, 'optionalAccess', _307 => _307.status])) params.set("status", options.status);
|
|
6083
|
+
if (_optionalChain([options, 'optionalAccess', _308 => _308.limit]) !== void 0)
|
|
6190
6084
|
params.set("limit", String(options.limit));
|
|
6191
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6192
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6085
|
+
if (_optionalChain([options, 'optionalAccess', _309 => _309.cursor])) params.set("cursor", options.cursor);
|
|
6086
|
+
if (_optionalChain([options, 'optionalAccess', _310 => _310.includeConsumers])) params.set("include_consumers", "true");
|
|
6193
6087
|
const query = params.toString();
|
|
6194
6088
|
const suffix = query ? `?${query}` : "";
|
|
6195
6089
|
return this.http.request(
|
|
@@ -6205,7 +6099,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6205
6099
|
);
|
|
6206
6100
|
}
|
|
6207
6101
|
async testMonitorWebhook(key, payload, options) {
|
|
6208
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6102
|
+
if (_optionalChain([options, 'optionalAccess', _311 => _311.dispatch]) === true || _optionalChain([options, 'optionalAccess', _312 => _312.validationOnly]) === false) {
|
|
6209
6103
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
6210
6104
|
"Monitor tests are validation-only and cannot dispatch events.",
|
|
6211
6105
|
void 0,
|
|
@@ -6260,7 +6154,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6260
6154
|
}
|
|
6261
6155
|
/** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
|
|
6262
6156
|
async deleteMonitor(key, options) {
|
|
6263
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6157
|
+
if (_optionalChain([options, 'optionalAccess', _313 => _313.localOnly]) === true) {
|
|
6264
6158
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
6265
6159
|
"localOnly monitor deletion is no longer supported. Monitor deletion always deprovisions the upstream provider resource.",
|
|
6266
6160
|
void 0,
|
|
@@ -6268,11 +6162,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6268
6162
|
);
|
|
6269
6163
|
}
|
|
6270
6164
|
const params = new URLSearchParams();
|
|
6271
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6165
|
+
if (_optionalChain([options, 'optionalAccess', _314 => _314.dryRun])) params.set("dry_run", "true");
|
|
6272
6166
|
const query = params.toString();
|
|
6273
6167
|
return this.http.request(
|
|
6274
6168
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
|
|
6275
|
-
_optionalChain([options, 'optionalAccess',
|
|
6169
|
+
_optionalChain([options, 'optionalAccess', _315 => _315.dryRun]) ? { method: "DELETE" } : {
|
|
6276
6170
|
method: "DELETE",
|
|
6277
6171
|
// Deletion is a provider lifecycle operation. A timeout is an
|
|
6278
6172
|
// unknown outcome, not authority to begin another delete attempt.
|
|
@@ -6285,10 +6179,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6285
6179
|
* Prefer `client.monitors.reactivate(...)`.
|
|
6286
6180
|
*/
|
|
6287
6181
|
async reactivateMonitor(key, options) {
|
|
6288
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
6182
|
+
const query = _optionalChain([options, 'optionalAccess', _316 => _316.dryRun]) ? "?dry_run=true" : "";
|
|
6289
6183
|
return this.http.request(
|
|
6290
6184
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
|
|
6291
|
-
_optionalChain([options, 'optionalAccess',
|
|
6185
|
+
_optionalChain([options, 'optionalAccess', _317 => _317.dryRun]) ? { method: "POST", body: {} } : {
|
|
6292
6186
|
method: "POST",
|
|
6293
6187
|
body: {},
|
|
6294
6188
|
// Reactivation can create an upstream resource, so it must not use
|
|
@@ -6302,7 +6196,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6302
6196
|
// ——————————————————————————————————————————————————————————
|
|
6303
6197
|
static __initStatic() {this.MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH = 96}
|
|
6304
6198
|
monitorJobIdempotencyKey(operation) {
|
|
6305
|
-
const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access',
|
|
6199
|
+
const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _318 => _318.crypto, 'optionalAccess', _319 => _319.randomUUID, 'optionalCall', _320 => _320()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
|
|
6306
6200
|
const prefix = "monitor-job-";
|
|
6307
6201
|
const safeOperation = operation.replace(/[^A-Za-z0-9._-]/g, "-");
|
|
6308
6202
|
const maxOperationLength = Math.max(
|
|
@@ -6313,7 +6207,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6313
6207
|
}
|
|
6314
6208
|
monitorJobHeaders(operation, idempotencyKey) {
|
|
6315
6209
|
return {
|
|
6316
|
-
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess',
|
|
6210
|
+
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _321 => _321.trim, 'call', _322 => _322()]) || this.monitorJobIdempotencyKey(operation)
|
|
6317
6211
|
};
|
|
6318
6212
|
}
|
|
6319
6213
|
async deployMonitorBatch(definitions, options) {
|
|
@@ -6324,7 +6218,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6324
6218
|
body: { version: 1, kind: "batch", monitors: definitions },
|
|
6325
6219
|
headers: this.monitorJobHeaders(
|
|
6326
6220
|
"batch-deploy",
|
|
6327
|
-
_optionalChain([options, 'optionalAccess',
|
|
6221
|
+
_optionalChain([options, 'optionalAccess', _323 => _323.idempotencyKey])
|
|
6328
6222
|
),
|
|
6329
6223
|
maxRetries: 0,
|
|
6330
6224
|
exactUrlOnly: true
|
|
@@ -6343,11 +6237,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6343
6237
|
version: 1,
|
|
6344
6238
|
kind: "batch",
|
|
6345
6239
|
monitors: definitions,
|
|
6346
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6240
|
+
..._optionalChain([options, 'optionalAccess', _324 => _324.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
|
|
6347
6241
|
},
|
|
6348
6242
|
headers: this.monitorJobHeaders(
|
|
6349
6243
|
`batch-sync-${batchId}`,
|
|
6350
|
-
_optionalChain([options, 'optionalAccess',
|
|
6244
|
+
_optionalChain([options, 'optionalAccess', _325 => _325.idempotencyKey])
|
|
6351
6245
|
),
|
|
6352
6246
|
maxRetries: 0,
|
|
6353
6247
|
exactUrlOnly: true
|
|
@@ -6362,7 +6256,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6362
6256
|
body: {},
|
|
6363
6257
|
headers: this.monitorJobHeaders(
|
|
6364
6258
|
`batch-start-${batchId}`,
|
|
6365
|
-
_optionalChain([options, 'optionalAccess',
|
|
6259
|
+
_optionalChain([options, 'optionalAccess', _326 => _326.idempotencyKey])
|
|
6366
6260
|
),
|
|
6367
6261
|
maxRetries: 0,
|
|
6368
6262
|
exactUrlOnly: true
|
|
@@ -6377,7 +6271,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6377
6271
|
body: {},
|
|
6378
6272
|
headers: this.monitorJobHeaders(
|
|
6379
6273
|
`batch-stop-${batchId}`,
|
|
6380
|
-
_optionalChain([options, 'optionalAccess',
|
|
6274
|
+
_optionalChain([options, 'optionalAccess', _327 => _327.idempotencyKey])
|
|
6381
6275
|
),
|
|
6382
6276
|
maxRetries: 0,
|
|
6383
6277
|
exactUrlOnly: true
|
|
@@ -6398,7 +6292,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6398
6292
|
body: {},
|
|
6399
6293
|
headers: this.monitorJobHeaders(
|
|
6400
6294
|
`${action}-${monitorKey}`,
|
|
6401
|
-
_optionalChain([options, 'optionalAccess',
|
|
6295
|
+
_optionalChain([options, 'optionalAccess', _328 => _328.idempotencyKey])
|
|
6402
6296
|
),
|
|
6403
6297
|
maxRetries: 0,
|
|
6404
6298
|
exactUrlOnly: true
|
|
@@ -6411,7 +6305,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6411
6305
|
body: definition,
|
|
6412
6306
|
headers: this.monitorJobHeaders(
|
|
6413
6307
|
`sync-${definition.key}`,
|
|
6414
|
-
_optionalChain([options, 'optionalAccess',
|
|
6308
|
+
_optionalChain([options, 'optionalAccess', _329 => _329.idempotencyKey])
|
|
6415
6309
|
),
|
|
6416
6310
|
maxRetries: 0,
|
|
6417
6311
|
exactUrlOnly: true
|
|
@@ -6424,7 +6318,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6424
6318
|
);
|
|
6425
6319
|
}
|
|
6426
6320
|
async getMonitorJobLogs(jobId, options) {
|
|
6427
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
6321
|
+
const query = _optionalChain([options, 'optionalAccess', _330 => _330.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
|
|
6428
6322
|
return this.http.request(
|
|
6429
6323
|
`/api/v2/monitors/jobs/${encodeURIComponent(jobId)}/logs${query}`,
|
|
6430
6324
|
{ method: "GET" }
|
|
@@ -6437,15 +6331,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6437
6331
|
);
|
|
6438
6332
|
}
|
|
6439
6333
|
async waitForMonitorJob(jobId, options) {
|
|
6440
|
-
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6441
|
-
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6334
|
+
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _331 => _331.timeoutMs]), () => ( 10 * 6e4)));
|
|
6335
|
+
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _332 => _332.pollIntervalMs]), () => ( 2e3)));
|
|
6442
6336
|
const terminal = /* @__PURE__ */ new Set(["succeeded", "failed", "cancelled"]);
|
|
6443
6337
|
const startedAt = Date.now();
|
|
6444
6338
|
let latest = await this.getMonitorJob(jobId);
|
|
6445
6339
|
while (true) {
|
|
6446
|
-
_optionalChain([options, 'optionalAccess',
|
|
6340
|
+
_optionalChain([options, 'optionalAccess', _333 => _333.onProgress, 'optionalCall', _334 => _334(latest)]);
|
|
6447
6341
|
const job = latest.job;
|
|
6448
|
-
const state = typeof _optionalChain([job, 'optionalAccess',
|
|
6342
|
+
const state = typeof _optionalChain([job, 'optionalAccess', _335 => _335.state]) === "string" ? job.state : void 0;
|
|
6449
6343
|
if (state && terminal.has(state)) return latest;
|
|
6450
6344
|
if (Date.now() - startedAt >= timeoutMs) return latest;
|
|
6451
6345
|
await sleep(pollIntervalMs);
|
|
@@ -6456,12 +6350,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6456
6350
|
// Monitor Fleets
|
|
6457
6351
|
// ——————————————————————————————————————————————————————————
|
|
6458
6352
|
monitorFleetIdempotencyKey(operation) {
|
|
6459
|
-
const uuid = _optionalChain([globalThis, 'access',
|
|
6353
|
+
const uuid = _optionalChain([globalThis, 'access', _336 => _336.crypto, 'optionalAccess', _337 => _337.randomUUID, 'optionalCall', _338 => _338()]);
|
|
6460
6354
|
return `monitor-fleet-${operation}-${_nullishCoalesce(uuid, () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`;
|
|
6461
6355
|
}
|
|
6462
6356
|
monitorFleetHeaders(operation, idempotencyKey) {
|
|
6463
6357
|
return {
|
|
6464
|
-
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess',
|
|
6358
|
+
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _339 => _339.trim, 'call', _340 => _340()]) || this.monitorFleetIdempotencyKey(operation)
|
|
6465
6359
|
};
|
|
6466
6360
|
}
|
|
6467
6361
|
monitorFleetPath(fleetId) {
|
|
@@ -6481,15 +6375,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6481
6375
|
const fleetId = typeof definitionOrId === "string" ? definitionOrId : definitionOrId.id;
|
|
6482
6376
|
const body = {
|
|
6483
6377
|
...typeof definitionOrId === "string" ? {} : { definition: definitionOrId },
|
|
6484
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6485
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6378
|
+
..._optionalChain([options, 'optionalAccess', _341 => _341.dryRun]) ? { dry_run: true } : {},
|
|
6379
|
+
..._optionalChain([options, 'optionalAccess', _342 => _342.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
|
|
6486
6380
|
};
|
|
6487
6381
|
return this.http.request(
|
|
6488
6382
|
this.monitorFleetPath(fleetId),
|
|
6489
6383
|
{
|
|
6490
6384
|
method: "PUT",
|
|
6491
6385
|
body,
|
|
6492
|
-
headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess',
|
|
6386
|
+
headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _343 => _343.idempotencyKey])),
|
|
6493
6387
|
maxRetries: 0,
|
|
6494
6388
|
exactUrlOnly: true
|
|
6495
6389
|
}
|
|
@@ -6502,8 +6396,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6502
6396
|
}
|
|
6503
6397
|
async getMonitorFleet(fleetId, options) {
|
|
6504
6398
|
const params = new URLSearchParams();
|
|
6505
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6506
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6399
|
+
if (_optionalChain([options, 'optionalAccess', _344 => _344.drift])) params.set("drift", "1");
|
|
6400
|
+
if (_optionalChain([options, 'optionalAccess', _345 => _345.limit]) !== void 0)
|
|
6507
6401
|
params.set("limit", String(options.limit));
|
|
6508
6402
|
const query = params.toString();
|
|
6509
6403
|
return this.http.request(
|
|
@@ -6516,10 +6410,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6516
6410
|
this.monitorFleetPath(fleetId),
|
|
6517
6411
|
{
|
|
6518
6412
|
method: "DELETE",
|
|
6519
|
-
body: _optionalChain([options, 'optionalAccess',
|
|
6413
|
+
body: _optionalChain([options, 'optionalAccess', _346 => _346.dryRun]) ? { dry_run: true } : {},
|
|
6520
6414
|
headers: this.monitorFleetHeaders(
|
|
6521
6415
|
"deactivate",
|
|
6522
|
-
_optionalChain([options, 'optionalAccess',
|
|
6416
|
+
_optionalChain([options, 'optionalAccess', _347 => _347.idempotencyKey])
|
|
6523
6417
|
),
|
|
6524
6418
|
maxRetries: 0,
|
|
6525
6419
|
exactUrlOnly: true
|
|
@@ -6534,7 +6428,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6534
6428
|
body: {},
|
|
6535
6429
|
headers: this.monitorFleetHeaders(
|
|
6536
6430
|
"reactivate",
|
|
6537
|
-
_optionalChain([options, 'optionalAccess',
|
|
6431
|
+
_optionalChain([options, 'optionalAccess', _348 => _348.idempotencyKey])
|
|
6538
6432
|
),
|
|
6539
6433
|
maxRetries: 0,
|
|
6540
6434
|
exactUrlOnly: true
|
|
@@ -6551,13 +6445,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6551
6445
|
* identical to "the request failed".
|
|
6552
6446
|
*/
|
|
6553
6447
|
async waitForMonitorFleetConvergence(fleetId, options) {
|
|
6554
|
-
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6555
|
-
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6556
|
-
const terminal = _optionalChain([options, 'optionalAccess',
|
|
6448
|
+
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _349 => _349.timeoutMs]), () => ( 10 * 6e4)));
|
|
6449
|
+
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _350 => _350.pollIntervalMs]), () => ( 2e3)));
|
|
6450
|
+
const terminal = _optionalChain([options, 'optionalAccess', _351 => _351.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded"]) : /* @__PURE__ */ new Set(["converged", "degraded", "deactivated"]);
|
|
6557
6451
|
const startedAt = Date.now();
|
|
6558
6452
|
let latest = await this.getMonitorFleet(fleetId);
|
|
6559
6453
|
while (true) {
|
|
6560
|
-
_optionalChain([options, 'optionalAccess',
|
|
6454
|
+
_optionalChain([options, 'optionalAccess', _352 => _352.onProgress, 'optionalCall', _353 => _353(latest)]);
|
|
6561
6455
|
const status = typeof latest.status === "string" ? latest.status : void 0;
|
|
6562
6456
|
if (status && terminal.has(status)) return latest;
|
|
6563
6457
|
if (Date.now() - startedAt >= timeoutMs) return latest;
|
|
@@ -6617,6 +6511,4 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6617
6511
|
|
|
6618
6512
|
|
|
6619
6513
|
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
exports.CSV_HEADER_MATCHING_NOTE = CSV_HEADER_MATCHING_NOTE; exports.iterateCursorPages = iterateCursorPages; exports.playInputExampleArgs = playInputExampleArgs; exports.requireBillingIdempotencyKey = requireBillingIdempotencyKey; exports.planCustomerDbQuery = planCustomerDbQuery; exports.validateExecutionIdempotencyKey = validateExecutionIdempotencyKey; exports.PRODUCT_NOTIFICATION_EVENT_CATALOG = PRODUCT_NOTIFICATION_EVENT_CATALOG; exports.resolveLegacySlackNotification = resolveLegacySlackNotification; exports.RUN_EVENT_SEARCH_KIND_VALUES = RUN_EVENT_SEARCH_KIND_VALUES; exports.logProvenanceReaches = logProvenanceReaches; exports.logLevelReaches = logLevelReaches; exports.parseLogLevel = parseLogLevel; exports.classifyLogLine = classifyLogLine; exports.isTransientPlayRunReadError = isTransientPlayRunReadError; exports.encodeRunLogsCursor = encodeRunLogsCursor; exports.isRunLogsCursor = isRunLogsCursor; exports.RunEventQueryInputError = RunEventQueryInputError; exports.normalizeRunEventOperationRequest = normalizeRunEventOperationRequest; exports.isStopAllPlayRunsDryRunResult = isStopAllPlayRunsDryRunResult; exports.MONITOR_JOB_STATES = MONITOR_JOB_STATES; exports.MONITOR_JOB_PHASES = MONITOR_JOB_PHASES; exports.MONITOR_JOB_RECONCILIATION_STATES = MONITOR_JOB_RECONCILIATION_STATES; exports.DeeplineClient = DeeplineClient;
|
|
6514
|
+
exports.iterateCursorPages = iterateCursorPages; exports.requireBillingIdempotencyKey = requireBillingIdempotencyKey; exports.planCustomerDbQuery = planCustomerDbQuery; exports.validateExecutionIdempotencyKey = validateExecutionIdempotencyKey; exports.PRODUCT_NOTIFICATION_EVENT_CATALOG = PRODUCT_NOTIFICATION_EVENT_CATALOG; exports.resolveLegacySlackNotification = resolveLegacySlackNotification; exports.RUN_EVENT_SEARCH_KIND_VALUES = RUN_EVENT_SEARCH_KIND_VALUES; exports.logProvenanceReaches = logProvenanceReaches; exports.logLevelReaches = logLevelReaches; exports.parseLogLevel = parseLogLevel; exports.classifyLogLine = classifyLogLine; exports.isTransientPlayRunReadError = isTransientPlayRunReadError; exports.encodeRunLogsCursor = encodeRunLogsCursor; exports.isRunLogsCursor = isRunLogsCursor; exports.RunEventQueryInputError = RunEventQueryInputError; exports.normalizeRunEventOperationRequest = normalizeRunEventOperationRequest; exports.isStopAllPlayRunsDryRunResult = isStopAllPlayRunsDryRunResult; exports.MONITOR_JOB_STATES = MONITOR_JOB_STATES; exports.MONITOR_JOB_PHASES = MONITOR_JOB_PHASES; exports.MONITOR_JOB_RECONCILIATION_STATES = MONITOR_JOB_RECONCILIATION_STATES; exports.DeeplineClient = DeeplineClient;
|