deepline 0.3.392 → 0.3.394
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 +156 -24
- package/dist/bundling-sources/sdk/src/compat.ts +9 -0
- package/dist/bundling-sources/sdk/src/http.ts +5 -1
- package/dist/bundling-sources/sdk/src/index.ts +5 -0
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +182 -6
- package/dist/bundling-sources/sdk/src/release.ts +4 -1
- package/dist/bundling-sources/sdk/src/types.ts +13 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/request-warnings.ts +64 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/runtime-sheet-storage-contract.ts +315 -0
- package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +41 -8
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +895 -54
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +41 -4
- package/dist/bundling-sources/shared_libs/play-runtime/durable-call-policy.ts +28 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durable-invocation-fence.ts +36 -0
- package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +251 -0
- package/dist/bundling-sources/shared_libs/play-runtime/map-execution-frame.ts +11 -3
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/gateway-adapter.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-semantics.ts +30 -1
- package/dist/bundling-sources/shared_libs/play-runtime/run-identity.ts +26 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +168 -10
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +252 -10
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +92 -58
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-pool.ts +7 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +30 -7
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +1161 -316
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +28 -15
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +24 -3
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +32 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +103 -23
- package/dist/bundling-sources/shared_libs/plays/core.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/dataset.ts +172 -79
- package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +173 -1
- package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +18 -0
- package/dist/cli/auth-IHKISLJQ.js +39 -0
- package/dist/cli/{auth-6JSA2ZCW.mjs → auth-OSXDAVCF.mjs} +4 -4
- package/dist/cli/{billing-Q5BLQHIU.js → billing-EKLYOXUY.js} +101 -74
- package/dist/cli/{billing-MRRO643H.mjs → billing-ZNNKX3UR.mjs} +32 -5
- package/dist/cli/{chunk-4SFPVW7A.js → chunk-2MDDA7A4.js} +26 -26
- package/dist/cli/{chunk-JOFPQGXW.js → chunk-354JCXA2.js} +50 -50
- package/dist/cli/{chunk-7E66A24V.mjs → chunk-3HU47EGZ.mjs} +71 -9
- package/dist/cli/{chunk-DSWSEHRX.mjs → chunk-3HWALOL2.mjs} +1 -1
- package/dist/cli/{chunk-T7OKJ2T6.js → chunk-4P27AXEA.js} +73 -63
- package/dist/cli/{chunk-24VEN5PQ.mjs → chunk-5BB2RGAX.mjs} +190 -18
- package/dist/cli/{chunk-JSLPHFP7.js → chunk-6YAUMG27.js} +3 -2
- package/dist/cli/{chunk-MU6M3URX.mjs → chunk-BP33SIZF.mjs} +1 -1
- package/dist/cli/{chunk-WMS5U6YB.js → chunk-CS6RAIVY.js} +20 -19
- package/dist/cli/{chunk-CVLM3WMJ.js → chunk-E23BQ5SC.js} +242 -183
- package/dist/cli/{chunk-2GAHHSLB.mjs → chunk-FJGW5GXU.mjs} +3 -2
- package/dist/cli/{chunk-YN6YA7ZZ.mjs → chunk-JHIJIHFB.mjs} +79 -20
- package/dist/cli/{chunk-Q6EOHNRH.mjs → chunk-JI2B4RZP.mjs} +119 -6
- package/dist/cli/{chunk-5O4B6AUN.js → chunk-KB4SDX5S.js} +71 -9
- package/dist/cli/{chunk-RV6ALZIX.js → chunk-KGNTKMRG.js} +32 -7
- package/dist/cli/{chunk-6DBOU7UH.js → chunk-KI635JN4.js} +176 -87
- package/dist/cli/{chunk-2FQG2HU4.js → chunk-KIUMEOM5.js} +8 -8
- package/dist/cli/{chunk-Y6VOGHF2.mjs → chunk-KZZC33PY.mjs} +0 -181
- package/dist/cli/{chunk-2Q3GEFL4.mjs → chunk-M57J2SK4.mjs} +2 -2
- package/dist/cli/{chunk-R3O2CZ4H.mjs → chunk-MFB2VKBO.mjs} +2 -2
- package/dist/cli/{chunk-QGKPTBRR.js → chunk-MH73HMPV.js} +3 -3
- package/dist/cli/{chunk-BB3FNYFY.js → chunk-MLPU5SMZ.js} +2 -2
- package/dist/cli/{chunk-2G7DXFHI.mjs → chunk-NR3DFKNF.mjs} +27 -2
- package/dist/cli/{chunk-EY7RFC6A.js → chunk-QIQBYKLB.js} +15 -15
- package/dist/cli/{chunk-RIV2GS5E.js → chunk-RBJYWRCF.js} +638 -466
- package/dist/cli/{chunk-3VN4FTE3.js → chunk-RDXFGPJU.js} +1 -182
- package/dist/cli/{chunk-YAZCDBXX.mjs → chunk-TJI2EN6K.mjs} +3 -2
- package/dist/cli/chunk-UBKA33KY.mjs +310 -0
- package/dist/cli/{chunk-PAIMOGCM.js → chunk-UHNDVD3P.js} +125 -12
- package/dist/cli/{chunk-4TCT77UF.js → chunk-URWF7NGQ.js} +6 -1
- package/dist/cli/{chunk-2QLML6G4.mjs → chunk-UXFSWG3Q.mjs} +4 -4
- package/dist/cli/{chunk-UCKJQG25.js → chunk-VK6FYZLP.js} +8 -8
- package/dist/cli/{chunk-ZTACINO5.mjs → chunk-X63FDZJZ.mjs} +13 -3
- package/dist/cli/chunk-XDVT3GOM.js +310 -0
- package/dist/cli/{chunk-A3APGZFP.mjs → chunk-XRQ2AQL7.mjs} +2 -2
- package/dist/cli/{chunk-3FV4GBRK.mjs → chunk-XXUDVEXK.mjs} +97 -8
- package/dist/cli/{chunk-PQSA443V.mjs → chunk-ZI2ZNDJK.mjs} +6 -1
- package/dist/cli/{chunk-HGYBEAQP.mjs → chunk-ZYBGA4AR.mjs} +3 -3
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-E4QGUIGI.mjs → csv-5AXRB35H.mjs} +3 -3
- package/dist/cli/{csv-26U5T24Z.js → csv-LU7O75WE.js} +12 -12
- package/dist/cli/{db-JTRJIAQW.mjs → db-7XP5UWEW.mjs} +6 -5
- package/dist/cli/{db-QHBFLMVL.js → db-F7YTFKVM.js} +31 -30
- package/dist/cli/{describe-FDV2V74F.js → describe-FRH32RDV.js} +24 -23
- package/dist/cli/{describe-E3DE3ZK3.mjs → describe-K4ES5LIL.mjs} +17 -16
- package/dist/cli/{executions-B3GTNPRE.mjs → executions-IEHEHJUO.mjs} +6 -5
- package/dist/cli/{executions-VZYOGVQY.js → executions-RZV5XPT2.js} +8 -7
- package/dist/cli/{feedback-CR55FJA2.js → feedback-3P65QTX3.js} +7 -7
- package/dist/cli/{feedback-4CEBR3OV.mjs → feedback-FPUVZBAN.mjs} +3 -3
- package/dist/cli/{git-NM2PHHZ4.mjs → git-GLVVP7TY.mjs} +4 -4
- package/dist/cli/git-MFFAWVVX.js +23 -0
- package/dist/cli/index.js +100 -96
- package/dist/cli/index.mjs +47 -43
- package/dist/cli/{legacy-noops-A7MSW5ND.mjs → legacy-noops-3MOI6NBM.mjs} +4 -4
- package/dist/cli/{legacy-noops-ZUA4YFIH.js → legacy-noops-XKSGZR7Q.js} +7 -7
- package/dist/cli/{monitors-NVPRQYP3.mjs → monitors-FTBGNEFG.mjs} +6 -5
- package/dist/cli/{monitors-ZE3TLZ4H.js → monitors-NZ2DYNST.js} +87 -86
- package/dist/cli/{org-U7A6DV5D.js → org-MCKDQXIV.js} +66 -65
- package/dist/cli/{org-KUBILNQV.mjs → org-V2J5RBCN.mjs} +6 -5
- package/dist/cli/{play-HRDXQ4QE.mjs → play-AJFGME3B.mjs} +11 -10
- package/dist/cli/play-WLSN2EO2.js +158 -0
- package/dist/cli/{providers-VD6YTVQZ.js → providers-2JEZ2264.js} +9 -8
- package/dist/cli/{providers-OHIWI453.mjs → providers-I6RQJZFZ.mjs} +6 -5
- package/dist/cli/{quickstart-UBV2FONF.mjs → quickstart-BIDQDMO4.mjs} +3 -3
- package/dist/cli/{quickstart-ETTCWPA4.js → quickstart-GJ2RPDU3.js} +5 -5
- package/dist/cli/run-identity-G257GQED.js +25 -0
- package/dist/cli/run-identity-MRNCEGV2.mjs +25 -0
- package/dist/cli/search-5VN4YD4I.js +27 -0
- package/dist/cli/{search-F44IZRT7.mjs → search-ELRXFWG5.mjs} +7 -6
- package/dist/cli/{secrets-CAEMRORF.js → secrets-53IT6VXD.js} +15 -14
- package/dist/cli/{secrets-R6XOJZKU.mjs → secrets-SQXGZXIC.mjs} +6 -5
- package/dist/cli/{sessions-RLN6UQS3.mjs → sessions-2X5QF7SL.mjs} +4 -4
- package/dist/cli/{sessions-6GC7OFTT.js → sessions-CAV5M77Y.js} +5 -5
- package/dist/cli/{settings-DPNVUAV2.js → settings-532WNAZO.js} +76 -75
- package/dist/cli/{settings-KIPAMRPP.mjs → settings-7P67VGCJ.mjs} +9 -8
- package/dist/cli/{setup-DTL3L5SG.js → setup-6L2VSUWJ.js} +41 -41
- package/dist/cli/{setup-TU2F7PU5.mjs → setup-QGGBV2LE.mjs} +6 -6
- package/dist/cli/{skills-UV5MYJ46.mjs → skills-3FE62WBG.mjs} +4 -4
- package/dist/cli/skills-S6NPZAN7.js +28 -0
- package/dist/cli/tools-647RLXQS.js +41 -0
- package/dist/cli/{tools-QRRNDCQ7.mjs → tools-DMR25DEF.mjs} +10 -9
- package/dist/cli/{update-4426TF35.mjs → update-6RZMHJZP.mjs} +6 -6
- package/dist/cli/update-WVTSC3EM.js +28 -0
- package/dist/cli/{workflow-N4U5VLZ3.mjs → workflow-L2DQRE6R.mjs} +7 -6
- package/dist/cli/{workflow-HNLOVISB.js → workflow-TX4F2PIX.js} +17 -16
- package/dist/{client-e6Qh5ZIg.d.mts → client-BktIPdIj.d.mts} +153 -4
- package/dist/{client-Uxuy-xQ2.d.ts → client-C3O1Ipf3.d.ts} +153 -4
- package/dist/{compiler-manifest-CY2v8ab0.d.ts → compiler-manifest-DLxUY5kI.d.mts} +124 -10
- package/dist/{compiler-manifest-CY2v8ab0.d.mts → compiler-manifest-DLxUY5kI.d.ts} +124 -10
- package/dist/{index-BZ6uzZJl.d.ts → index-B_GM9E3q.d.ts} +1 -1
- package/dist/{index-B9fBZH1g.d.mts → index-SCb0NvDb.d.mts} +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +120 -29
- package/dist/index.mjs +111 -20
- package/dist/install-integrity.json +94 -88
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/bundle-play-file.mjs +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/plays/run-request.js +5 -2
- package/dist/plays/run-request.mjs +4 -1
- package/dist/release.d.mts +4 -1
- package/dist/release.d.ts +4 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/package.json +1 -1
- package/dist/cli/auth-67TAELQL.js +0 -39
- package/dist/cli/git-I5JTK6YU.js +0 -23
- package/dist/cli/play-A2V7YDU7.js +0 -157
- package/dist/cli/search-WWXMBVPH.js +0 -26
- package/dist/cli/skills-SWOSEZLB.js +0 -28
- package/dist/cli/tools-IL2YCDQ6.js +0 -40
- package/dist/cli/update-BERDPEYR.js +0 -28
|
@@ -13,7 +13,7 @@ var _chunkS6R3OX7Bjs = require('./chunk-S6R3OX7B.js');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkUHNDVD3Pjs = require('./chunk-UHNDVD3P.js');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
@@ -21,7 +21,7 @@ var _chunkPAIMOGCMjs = require('./chunk-PAIMOGCM.js');
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _chunkCS6RAIVYjs = require('./chunk-CS6RAIVY.js');
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
@@ -137,7 +137,7 @@ async function queryCustomerDatabase(http, input) {
|
|
|
137
137
|
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
138
|
// lost connections and explicitly unknown transaction resolution.
|
|
139
139
|
/^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,
|
|
140
|
+
throw new (0, _chunkCS6RAIVYjs.CustomerDbQueryOutcomeUnknownError)(
|
|
141
141
|
error,
|
|
142
142
|
plan.request.body.operation_key
|
|
143
143
|
);
|
|
@@ -145,7 +145,7 @@ async function queryCustomerDatabase(http, input) {
|
|
|
145
145
|
throw error;
|
|
146
146
|
}
|
|
147
147
|
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,
|
|
148
|
+
throw new (0, _chunkCS6RAIVYjs.CustomerDbQueryOutcomeUnknownError)(
|
|
149
149
|
new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
150
150
|
"The SQL response did not contain a valid result.",
|
|
151
151
|
200,
|
|
@@ -156,7 +156,7 @@ async function queryCustomerDatabase(http, input) {
|
|
|
156
156
|
}
|
|
157
157
|
const operation = result.operation;
|
|
158
158
|
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,
|
|
159
|
+
throw new (0, _chunkCS6RAIVYjs.CustomerDbQueryOutcomeUnknownError)(
|
|
160
160
|
new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
161
161
|
"The server did not confirm the original atomic SQL operation.",
|
|
162
162
|
200,
|
|
@@ -2341,7 +2341,7 @@ var TERMINAL_STATUS_BY_EVENT_TYPE = {
|
|
|
2341
2341
|
|
|
2342
2342
|
// ../play-runtime/run-snapshot-stream.ts
|
|
2343
2343
|
function isTerminalPlayRunLiveStatus(status) {
|
|
2344
|
-
return
|
|
2344
|
+
return _chunkUHNDVD3Pjs.isTerminalPlayRunLifecycleStatus.call(void 0, status);
|
|
2345
2345
|
}
|
|
2346
2346
|
function makeRunStreamEvent(input) {
|
|
2347
2347
|
return {
|
|
@@ -2911,8 +2911,8 @@ function runtimeSelectionHeaders(runtime, env) {
|
|
|
2911
2911
|
}
|
|
2912
2912
|
const receivers = _optionalChain([env, 'access', _98 => _98.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _99 => _99.trim, 'call', _100 => _100()]);
|
|
2913
2913
|
return {
|
|
2914
|
-
[
|
|
2915
|
-
...receivers ? { [
|
|
2914
|
+
[_chunkCS6RAIVYjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
|
|
2915
|
+
...receivers ? { [_chunkCS6RAIVYjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
|
|
2916
2916
|
};
|
|
2917
2917
|
}
|
|
2918
2918
|
function isolatedCiRuntimeEventReadHeaders(env) {
|
|
@@ -2928,7 +2928,7 @@ function isolatedCiRuntimeEventReadHeaders(env) {
|
|
|
2928
2928
|
"RUNTIME_EVENT_INTERNAL_TOKEN_REQUIRED"
|
|
2929
2929
|
);
|
|
2930
2930
|
}
|
|
2931
|
-
return { [
|
|
2931
|
+
return { [_chunkCS6RAIVYjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
|
|
2932
2932
|
}
|
|
2933
2933
|
function normalizeTestPolicyOverrides(value, source) {
|
|
2934
2934
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
@@ -3076,10 +3076,10 @@ function preferPrebuiltPlayDescriptions(plays) {
|
|
|
3076
3076
|
).map(({ play }) => play);
|
|
3077
3077
|
}
|
|
3078
3078
|
function normalizePlayStatus(raw) {
|
|
3079
|
-
const runPackage =
|
|
3079
|
+
const runPackage = _chunkUHNDVD3Pjs.isPlayRunPackage.call(void 0, raw) ? raw : _chunkUHNDVD3Pjs.isPlayRunPackage.call(void 0, raw.package) ? raw.package : null;
|
|
3080
3080
|
const packageRun = _optionalChain([runPackage, 'optionalAccess', _125 => _125.run]);
|
|
3081
3081
|
const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess', _126 => _126.status]) === "string" ? packageRun.status : null;
|
|
3082
|
-
const status =
|
|
3082
|
+
const status = _chunkUHNDVD3Pjs.decodePlayRunPublicStatus.call(void 0, rawStatus);
|
|
3083
3083
|
if (!status) {
|
|
3084
3084
|
throw new Error(
|
|
3085
3085
|
`Invalid play run lifecycle status in API response: ${JSON.stringify(rawStatus)}.`
|
|
@@ -3113,7 +3113,7 @@ function playLiveRunStatus(event) {
|
|
|
3113
3113
|
return null;
|
|
3114
3114
|
}
|
|
3115
3115
|
const payload = getPlayLiveEventPayload(event);
|
|
3116
|
-
return _nullishCoalesce(
|
|
3116
|
+
return _nullishCoalesce(_chunkUHNDVD3Pjs.decodePlayRunPublicStatus.call(void 0, payload.status), () => ( (_chunkUHNDVD3Pjs.isPlayRunPackage.call(void 0, payload) ? _chunkUHNDVD3Pjs.decodePlayRunPublicStatus.call(void 0, payload.run.status) : null)));
|
|
3117
3117
|
}
|
|
3118
3118
|
function appendPlayLiveLogLines(state, payload) {
|
|
3119
3119
|
const lines = readStringArray(payload.lines);
|
|
@@ -3145,7 +3145,7 @@ function updatePlayLiveStatusState(state, event) {
|
|
|
3145
3145
|
if (event.type !== "play.run.snapshot" && event.type !== "play.run.status" && event.type !== "play.run.final_status") {
|
|
3146
3146
|
return null;
|
|
3147
3147
|
}
|
|
3148
|
-
const runId = typeof payload.runId === "string" && payload.runId ? payload.runId :
|
|
3148
|
+
const runId = typeof payload.runId === "string" && payload.runId ? payload.runId : _chunkUHNDVD3Pjs.isPlayRunPackage.call(void 0, payload) ? payload.run.id : state.runId;
|
|
3149
3149
|
const status = _nullishCoalesce(playLiveRunStatus(event), () => ( state.status));
|
|
3150
3150
|
const progressPayload = isRecord2(payload.progress) ? payload.progress : {};
|
|
3151
3151
|
if (event.type === "play.run.final_status" && state.logs.length === 0 && state.lastLogSeq === 0) {
|
|
@@ -3158,7 +3158,7 @@ function updatePlayLiveStatusState(state, event) {
|
|
|
3158
3158
|
}
|
|
3159
3159
|
if ("result" in payload) {
|
|
3160
3160
|
state.result = payload.result;
|
|
3161
|
-
} else if (
|
|
3161
|
+
} else if (_chunkUHNDVD3Pjs.isPlayRunPackage.call(void 0, payload)) {
|
|
3162
3162
|
state.result = payload;
|
|
3163
3163
|
}
|
|
3164
3164
|
if (typeof payload.error === "string" && payload.error.trim()) {
|
|
@@ -3171,7 +3171,7 @@ function updatePlayLiveStatusState(state, event) {
|
|
|
3171
3171
|
...payload,
|
|
3172
3172
|
runId,
|
|
3173
3173
|
status,
|
|
3174
|
-
...
|
|
3174
|
+
..._chunkUHNDVD3Pjs.isPlayRunPackage.call(void 0, payload) ? { package: payload, outputs: payload.outputs } : {},
|
|
3175
3175
|
progress: {
|
|
3176
3176
|
...progressRecord,
|
|
3177
3177
|
status: typeof progressRecord.status === "string" ? progressRecord.status : status,
|
|
@@ -3219,9 +3219,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3219
3219
|
* @throws {@link ConfigError} if no API key can be resolved from any source.
|
|
3220
3220
|
*/
|
|
3221
3221
|
constructor(options) {
|
|
3222
|
-
this.config =
|
|
3222
|
+
this.config = _chunkCS6RAIVYjs.resolveConfig.call(void 0, options);
|
|
3223
3223
|
this.environment = _nullishCoalesce(this.config.environment, () => ( process.env));
|
|
3224
|
-
this.http = new (0,
|
|
3224
|
+
this.http = new (0, _chunkCS6RAIVYjs.HttpClient)(this.config);
|
|
3225
3225
|
this.toolCalls = new ToolCalls(
|
|
3226
3226
|
this.http,
|
|
3227
3227
|
this.config.timeout,
|
|
@@ -3256,6 +3256,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3256
3256
|
input: (runId) => this.getRunInput(runId),
|
|
3257
3257
|
rerun: (runId, options2) => this.rerun(runId, options2),
|
|
3258
3258
|
exportDatasetRows: (input) => this.getPlaySheetRows(input),
|
|
3259
|
+
rowHistory: (input) => this.getPlayRunRowHistory(input),
|
|
3259
3260
|
stop: (runId, options2) => this.stopRun(runId, options2),
|
|
3260
3261
|
stopAll: ((options2) => this.stopAllRuns(options2))
|
|
3261
3262
|
};
|
|
@@ -3264,6 +3265,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3264
3265
|
planQuery: (input) => planCustomerDbQuery(input)
|
|
3265
3266
|
};
|
|
3266
3267
|
this.billing = {
|
|
3268
|
+
quote: (input) => this.http.post("/api/v2/billing/quote", input),
|
|
3267
3269
|
entitlements: () => this.http.get("/api/v2/billing/entitlements"),
|
|
3268
3270
|
topUp: (options2) => this.topUpBillingBalance(options2),
|
|
3269
3271
|
topUpWithReceipt: (options2) => this.topUpBillingBalanceWithReceipt(options2),
|
|
@@ -3737,14 +3739,62 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3737
3739
|
* });
|
|
3738
3740
|
* ```
|
|
3739
3741
|
*/
|
|
3740
|
-
async startPlayRun(request) {
|
|
3742
|
+
async startPlayRun(request, options) {
|
|
3741
3743
|
const resolved = resolveStartPlayRunRequest(request, this.environment);
|
|
3742
|
-
return
|
|
3744
|
+
return _chunkUHNDVD3Pjs.startPlayRun.call(void 0,
|
|
3743
3745
|
this.http,
|
|
3744
3746
|
resolved.request,
|
|
3745
|
-
runtimeSelectionHeaders(resolved.runtime, this.environment)
|
|
3747
|
+
runtimeSelectionHeaders(resolved.runtime, this.environment),
|
|
3748
|
+
_optionalChain([options, 'optionalAccess', _184 => _184.onSubmission])
|
|
3746
3749
|
);
|
|
3747
3750
|
}
|
|
3751
|
+
/**
|
|
3752
|
+
* Prepare a tenant-scoped start intent without executing it. Its stream
|
|
3753
|
+
* sender retains the exact body and transport selected during preparation.
|
|
3754
|
+
*/
|
|
3755
|
+
async preparePlayRunAdmission(request, options) {
|
|
3756
|
+
const resolved = resolveStartPlayRunRequest(request, this.environment);
|
|
3757
|
+
const prepared = await _chunkUHNDVD3Pjs.preparePlayRunAdmission.call(void 0,
|
|
3758
|
+
this.http,
|
|
3759
|
+
resolved.request,
|
|
3760
|
+
_optionalChain([options, 'optionalAccess', _185 => _185.onSubmission])
|
|
3761
|
+
);
|
|
3762
|
+
const bodyJson = JSON.stringify(prepared.body);
|
|
3763
|
+
const headers = runtimeSelectionHeaders(resolved.runtime, this.environment);
|
|
3764
|
+
const http = this.http;
|
|
3765
|
+
let submitted = false;
|
|
3766
|
+
return {
|
|
3767
|
+
...prepared,
|
|
3768
|
+
async *startStream(streamOptions) {
|
|
3769
|
+
if (submitted && !prepared.supportsCallerIntent) {
|
|
3770
|
+
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
3771
|
+
"This server has not enabled caller-owned admission recovery. Do not retry an ambiguous start.",
|
|
3772
|
+
409,
|
|
3773
|
+
"PLAY_RUN_ADMISSION_RECOVERY_UNSUPPORTED"
|
|
3774
|
+
);
|
|
3775
|
+
}
|
|
3776
|
+
if (submitted) {
|
|
3777
|
+
await _chunkUHNDVD3Pjs.preparePlayRunAdmission.call(void 0,
|
|
3778
|
+
http,
|
|
3779
|
+
JSON.parse(bodyJson)
|
|
3780
|
+
);
|
|
3781
|
+
}
|
|
3782
|
+
submitted = true;
|
|
3783
|
+
for await (const event of http.streamSse(
|
|
3784
|
+
_chunkUHNDVD3Pjs.PLAY_RUN_START_STREAM_PATH,
|
|
3785
|
+
{
|
|
3786
|
+
method: "POST",
|
|
3787
|
+
body: JSON.parse(bodyJson),
|
|
3788
|
+
headers,
|
|
3789
|
+
signal: _optionalChain([streamOptions, 'optionalAccess', _186 => _186.signal]),
|
|
3790
|
+
exactUrlOnly: true
|
|
3791
|
+
}
|
|
3792
|
+
)) {
|
|
3793
|
+
if (event.scope === "play") yield event;
|
|
3794
|
+
}
|
|
3795
|
+
}
|
|
3796
|
+
};
|
|
3797
|
+
}
|
|
3748
3798
|
/**
|
|
3749
3799
|
* Submit a play run through the legacy event response.
|
|
3750
3800
|
*
|
|
@@ -3759,21 +3809,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3759
3809
|
* @returns Async generator of play-scoped live events.
|
|
3760
3810
|
*/
|
|
3761
3811
|
async *startPlayRunStream(request, options) {
|
|
3762
|
-
const
|
|
3763
|
-
|
|
3764
|
-
for await (const event of this.http.streamSse(
|
|
3765
|
-
_chunkPAIMOGCMjs.PLAY_RUN_START_STREAM_PATH,
|
|
3766
|
-
{
|
|
3767
|
-
method: "POST",
|
|
3768
|
-
body,
|
|
3769
|
-
headers: runtimeSelectionHeaders(resolved.runtime, this.environment),
|
|
3770
|
-
signal: _optionalChain([options, 'optionalAccess', _184 => _184.signal])
|
|
3771
|
-
}
|
|
3772
|
-
)) {
|
|
3773
|
-
if (event.scope === "play") {
|
|
3774
|
-
yield event;
|
|
3775
|
-
}
|
|
3776
|
-
}
|
|
3812
|
+
const prepared = await this.preparePlayRunAdmission(request, options);
|
|
3813
|
+
yield* prepared.startStream({ signal: _optionalChain([options, 'optionalAccess', _187 => _187.signal]) });
|
|
3777
3814
|
}
|
|
3778
3815
|
/**
|
|
3779
3816
|
* Register a bundled play artifact.
|
|
@@ -3927,7 +3964,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3927
3964
|
compilerManifest,
|
|
3928
3965
|
...input.input ? { input: input.input } : {},
|
|
3929
3966
|
...input.inputFile ? { inputFile: input.inputFile } : {},
|
|
3930
|
-
..._optionalChain([input, 'access',
|
|
3967
|
+
..._optionalChain([input, 'access', _188 => _188.packagedFiles, 'optionalAccess', _189 => _189.length]) ? { packagedFiles: input.packagedFiles } : {},
|
|
3931
3968
|
...input.force ? { force: true } : {},
|
|
3932
3969
|
...input.forceToolRefresh ? { forceToolRefresh: true } : {}
|
|
3933
3970
|
});
|
|
@@ -3957,29 +3994,29 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3957
3994
|
* ```
|
|
3958
3995
|
*/
|
|
3959
3996
|
async submitPlay(code, csvPath, name, options) {
|
|
3960
|
-
const runtimeInput = _optionalChain([options, 'optionalAccess',
|
|
3997
|
+
const runtimeInput = _optionalChain([options, 'optionalAccess', _190 => _190.input]) ? { ...options.input } : {};
|
|
3961
3998
|
if (csvPath) {
|
|
3962
3999
|
runtimeInput.file = csvPath;
|
|
3963
4000
|
}
|
|
3964
|
-
const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3965
|
-
const artifact = _optionalChain([options, 'optionalAccess',
|
|
3966
|
-
if (!_optionalChain([name, 'optionalAccess',
|
|
4001
|
+
const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _191 => _191.sourceCode]), () => ( code));
|
|
4002
|
+
const artifact = _optionalChain([options, 'optionalAccess', _192 => _192.artifact]);
|
|
4003
|
+
if (!_optionalChain([name, 'optionalAccess', _193 => _193.trim, 'call', _194 => _194()])) {
|
|
3967
4004
|
throw new Error("submitPlay requires a play name.");
|
|
3968
4005
|
}
|
|
3969
4006
|
if (!artifact) {
|
|
3970
4007
|
throw new Error("submitPlay requires a bundled play artifact.");
|
|
3971
4008
|
}
|
|
3972
|
-
const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async
|
|
4009
|
+
const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _195 => _195.compilerManifest]), async () => ( await this.compilePlayManifest({
|
|
3973
4010
|
name,
|
|
3974
4011
|
sourceCode,
|
|
3975
|
-
sourceFiles: _optionalChain([options, 'optionalAccess',
|
|
4012
|
+
sourceFiles: _optionalChain([options, 'optionalAccess', _196 => _196.sourceFiles]),
|
|
3976
4013
|
artifact
|
|
3977
4014
|
})));
|
|
3978
4015
|
const registeredArtifact = await this.registerPlayArtifact({
|
|
3979
4016
|
name,
|
|
3980
4017
|
sourceCode,
|
|
3981
|
-
sourceFiles: _optionalChain([options, 'optionalAccess',
|
|
3982
|
-
description: _optionalChain([options, 'optionalAccess',
|
|
4018
|
+
sourceFiles: _optionalChain([options, 'optionalAccess', _197 => _197.sourceFiles]),
|
|
4019
|
+
description: _optionalChain([options, 'optionalAccess', _198 => _198.description]),
|
|
3983
4020
|
artifact,
|
|
3984
4021
|
compilerManifest,
|
|
3985
4022
|
publish: false
|
|
@@ -3993,17 +4030,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3993
4030
|
name,
|
|
3994
4031
|
artifactStorageKey: registeredArtifact.artifactStorageKey,
|
|
3995
4032
|
sourceCode,
|
|
3996
|
-
description: _optionalChain([options, 'optionalAccess',
|
|
4033
|
+
description: _optionalChain([options, 'optionalAccess', _199 => _199.description]),
|
|
3997
4034
|
staticPipeline: _nullishCoalesce(registeredArtifact.staticPipeline, () => ( null)),
|
|
3998
4035
|
artifactHash: typeof artifact.artifactHash === "string" ? artifact.artifactHash : void 0,
|
|
3999
4036
|
graphHash: typeof artifact.graphHash === "string" ? artifact.graphHash : void 0,
|
|
4000
4037
|
runtimeArtifact: artifact,
|
|
4001
4038
|
compilerManifest,
|
|
4002
4039
|
...Object.keys(runtimeInput).length > 0 ? { input: runtimeInput } : {},
|
|
4003
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4004
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4005
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4006
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4040
|
+
..._optionalChain([options, 'optionalAccess', _200 => _200.inputFile]) ? { inputFile: options.inputFile } : {},
|
|
4041
|
+
..._optionalChain([options, 'optionalAccess', _201 => _201.packagedFiles, 'optionalAccess', _202 => _202.length]) ? { packagedFiles: options.packagedFiles } : {},
|
|
4042
|
+
..._optionalChain([options, 'optionalAccess', _203 => _203.force]) ? { force: true } : {},
|
|
4043
|
+
..._optionalChain([options, 'optionalAccess', _204 => _204.forceToolRefresh]) ? { forceToolRefresh: true } : {}
|
|
4007
4044
|
});
|
|
4008
4045
|
}
|
|
4009
4046
|
/**
|
|
@@ -4031,7 +4068,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4031
4068
|
* ```
|
|
4032
4069
|
*/
|
|
4033
4070
|
async stagePlayFiles(files) {
|
|
4034
|
-
return
|
|
4071
|
+
return _chunkUHNDVD3Pjs.stagePlayFiles.call(void 0, this.http, files);
|
|
4035
4072
|
}
|
|
4036
4073
|
/**
|
|
4037
4074
|
* Mint short-lived presigned upload targets for staged play files.
|
|
@@ -4041,7 +4078,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4041
4078
|
* already holds, or a presigned PUT URL the caller uploads the body to.
|
|
4042
4079
|
*/
|
|
4043
4080
|
async mintStagedPlayFileUploads(files) {
|
|
4044
|
-
return
|
|
4081
|
+
return _chunkUHNDVD3Pjs.mintStagedPlayFileUploads.call(void 0, this.http, files);
|
|
4045
4082
|
}
|
|
4046
4083
|
/**
|
|
4047
4084
|
* Resolve staged play files by content hash without uploading bytes.
|
|
@@ -4073,10 +4110,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4073
4110
|
*/
|
|
4074
4111
|
async getPlayStatus(workflowId, options) {
|
|
4075
4112
|
const params = new URLSearchParams();
|
|
4076
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4113
|
+
if (_optionalChain([options, 'optionalAccess', _205 => _205.billing]) === false) {
|
|
4077
4114
|
params.set("billing", "false");
|
|
4078
4115
|
}
|
|
4079
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4116
|
+
if (_optionalChain([options, 'optionalAccess', _206 => _206.full]) === true) {
|
|
4080
4117
|
params.set("full", "true");
|
|
4081
4118
|
}
|
|
4082
4119
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4090,9 +4127,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4090
4127
|
for await (const event of watchRunEvents({
|
|
4091
4128
|
http: this.http,
|
|
4092
4129
|
runId: workflowId,
|
|
4093
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
4094
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
4095
|
-
onRetry: _optionalChain([options, 'optionalAccess',
|
|
4130
|
+
signal: _optionalChain([options, 'optionalAccess', _207 => _207.signal]),
|
|
4131
|
+
onNotice: _optionalChain([options, 'optionalAccess', _208 => _208.onNotice]),
|
|
4132
|
+
onRetry: _optionalChain([options, 'optionalAccess', _209 => _209.onRetry])
|
|
4096
4133
|
})) {
|
|
4097
4134
|
yield event;
|
|
4098
4135
|
}
|
|
@@ -4104,12 +4141,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4104
4141
|
* @deprecated Use `watchRunEvents` for ordinary run watching.
|
|
4105
4142
|
*/
|
|
4106
4143
|
async *streamPlayRunEvents(workflowId, options) {
|
|
4107
|
-
const headers = _optionalChain([options, 'optionalAccess',
|
|
4144
|
+
const headers = _optionalChain([options, 'optionalAccess', _210 => _210.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
|
|
4108
4145
|
const params = new URLSearchParams();
|
|
4109
|
-
params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4146
|
+
params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _211 => _211.mode]), () => ( "cli")));
|
|
4110
4147
|
for await (const event of this.http.streamSse(
|
|
4111
4148
|
`/api/v2/runs/${encodeURIComponent(workflowId)}/tail?${params.toString()}`,
|
|
4112
|
-
{ signal: _optionalChain([options, 'optionalAccess',
|
|
4149
|
+
{ signal: _optionalChain([options, 'optionalAccess', _212 => _212.signal]), headers }
|
|
4113
4150
|
)) {
|
|
4114
4151
|
if (event.scope === "play") {
|
|
4115
4152
|
yield event;
|
|
@@ -4125,28 +4162,28 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4125
4162
|
*/
|
|
4126
4163
|
async *observeRunEvents(runId, options) {
|
|
4127
4164
|
yield* this.watchRunEvents(runId, {
|
|
4128
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
4129
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
4165
|
+
signal: _optionalChain([options, 'optionalAccess', _213 => _213.signal]),
|
|
4166
|
+
onNotice: _optionalChain([options, 'optionalAccess', _214 => _214.onNotice])
|
|
4130
4167
|
});
|
|
4131
4168
|
}
|
|
4132
4169
|
/** Poll snapshots to terminal status and return the durable package. */
|
|
4133
4170
|
async watchRunToTerminal(runId, options) {
|
|
4134
4171
|
let terminalObserved = false;
|
|
4135
4172
|
for await (const event of this.watchRunEvents(runId, {
|
|
4136
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
4137
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
4138
|
-
onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4173
|
+
signal: _optionalChain([options, 'optionalAccess', _215 => _215.signal]),
|
|
4174
|
+
onNotice: _optionalChain([options, 'optionalAccess', _216 => _216.onNotice]),
|
|
4175
|
+
onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _217 => _217.onRetry]), () => ( _optionalChain([options, 'optionalAccess', _218 => _218.onReconnect])))
|
|
4139
4176
|
})) {
|
|
4140
|
-
_optionalChain([options, 'optionalAccess',
|
|
4141
|
-
if (
|
|
4177
|
+
_optionalChain([options, 'optionalAccess', _219 => _219.onEvent, 'optionalCall', _220 => _220(event)]);
|
|
4178
|
+
if (_chunkUHNDVD3Pjs.isTerminalPlayRunLifecycleStatus.call(void 0, playLiveRunStatus(event))) {
|
|
4142
4179
|
terminalObserved = true;
|
|
4143
4180
|
}
|
|
4144
4181
|
}
|
|
4145
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4182
|
+
if (_optionalChain([options, 'optionalAccess', _221 => _221.signal, 'optionalAccess', _222 => _222.aborted])) {
|
|
4146
4183
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)("Run watch aborted.", void 0, "ABORTED");
|
|
4147
4184
|
}
|
|
4148
4185
|
const refreshed = await this.getRunStatus(runId);
|
|
4149
|
-
if (terminalObserved ||
|
|
4186
|
+
if (terminalObserved || _chunkUHNDVD3Pjs.isTerminalPlayRunLifecycleStatus.call(void 0, refreshed.status)) {
|
|
4150
4187
|
return refreshed;
|
|
4151
4188
|
}
|
|
4152
4189
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
@@ -4196,7 +4233,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4196
4233
|
async stopPlay(workflowId, options) {
|
|
4197
4234
|
return this.http.post(
|
|
4198
4235
|
`/api/v2/runs/${encodeURIComponent(workflowId)}/stop`,
|
|
4199
|
-
_optionalChain([options, 'optionalAccess',
|
|
4236
|
+
_optionalChain([options, 'optionalAccess', _223 => _223.reason]) ? { reason: options.reason } : {}
|
|
4200
4237
|
);
|
|
4201
4238
|
}
|
|
4202
4239
|
/**
|
|
@@ -4232,7 +4269,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4232
4269
|
/** List the org's workflows. `GET /api/v2/workflows`. */
|
|
4233
4270
|
async listWorkflows(options) {
|
|
4234
4271
|
const params = new URLSearchParams();
|
|
4235
|
-
if (typeof _optionalChain([options, 'optionalAccess',
|
|
4272
|
+
if (typeof _optionalChain([options, 'optionalAccess', _224 => _224.limit]) === "number") {
|
|
4236
4273
|
params.set("limit", String(options.limit));
|
|
4237
4274
|
}
|
|
4238
4275
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4285,7 +4322,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4285
4322
|
/** List a workflow's runs. `GET /api/v2/workflows/:id/runs`. */
|
|
4286
4323
|
async listWorkflowRuns(id, options) {
|
|
4287
4324
|
const params = new URLSearchParams();
|
|
4288
|
-
if (typeof _optionalChain([options, 'optionalAccess',
|
|
4325
|
+
if (typeof _optionalChain([options, 'optionalAccess', _225 => _225.limit]) === "number") {
|
|
4289
4326
|
params.set("limit", String(options.limit));
|
|
4290
4327
|
}
|
|
4291
4328
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4321,10 +4358,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4321
4358
|
*/
|
|
4322
4359
|
async getRunStatus(runId, options) {
|
|
4323
4360
|
const params = new URLSearchParams();
|
|
4324
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4361
|
+
if (_optionalChain([options, 'optionalAccess', _226 => _226.full]) === true) {
|
|
4325
4362
|
params.set("full", "true");
|
|
4326
4363
|
}
|
|
4327
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4364
|
+
if (_optionalChain([options, 'optionalAccess', _227 => _227.configuration]) === true) {
|
|
4328
4365
|
params.set("include", "configuration");
|
|
4329
4366
|
}
|
|
4330
4367
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4332,7 +4369,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4332
4369
|
`/api/v2/runs/${encodeURIComponent(runId)}${query}`,
|
|
4333
4370
|
{ headers: { "x-deepline-run-status": "1" } }
|
|
4334
4371
|
);
|
|
4335
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4372
|
+
if (_optionalChain([options, 'optionalAccess', _228 => _228.configuration]) === true && !Object.hasOwn(response, "contract")) {
|
|
4336
4373
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4337
4374
|
"This server does not support recorded configuration reads.",
|
|
4338
4375
|
void 0,
|
|
@@ -4340,7 +4377,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4340
4377
|
);
|
|
4341
4378
|
}
|
|
4342
4379
|
const status = normalizePlayStatus(response);
|
|
4343
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4380
|
+
if (_optionalChain([options, 'optionalAccess', _229 => _229.failedLogs]) !== true || status.status !== "failed") {
|
|
4344
4381
|
return status;
|
|
4345
4382
|
}
|
|
4346
4383
|
const requestedFailedLogLimit = typeof options.failedLogLimit === "number" && Number.isFinite(options.failedLogLimit) ? Math.max(1, Math.floor(options.failedLogLimit)) : RUNS_FAILED_LOG_LIMIT;
|
|
@@ -4429,7 +4466,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4429
4466
|
/** The same tenant-scoped run history searched by the dashboard and CLI. */
|
|
4430
4467
|
async getRunsHistory(options = {}) {
|
|
4431
4468
|
const params = new URLSearchParams();
|
|
4432
|
-
const search = _optionalChain([options, 'access',
|
|
4469
|
+
const search = _optionalChain([options, 'access', _230 => _230.search, 'optionalAccess', _231 => _231.trim, 'call', _232 => _232()]);
|
|
4433
4470
|
if (search && search.length > 200) {
|
|
4434
4471
|
throw new Error("Run search must be at most 200 characters.");
|
|
4435
4472
|
}
|
|
@@ -4455,16 +4492,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4455
4492
|
}
|
|
4456
4493
|
/** Read one run page without discarding server pagination metadata. */
|
|
4457
4494
|
async listRunsPage(options) {
|
|
4458
|
-
const playName = _optionalChain([options, 'access',
|
|
4495
|
+
const playName = _optionalChain([options, 'access', _233 => _233.play, 'optionalAccess', _234 => _234.trim, 'call', _235 => _235()]);
|
|
4459
4496
|
const params = new URLSearchParams();
|
|
4460
4497
|
if (playName) {
|
|
4461
4498
|
params.set("play", playName);
|
|
4462
4499
|
}
|
|
4463
|
-
const status = _optionalChain([options, 'access',
|
|
4500
|
+
const status = _optionalChain([options, 'access', _236 => _236.status, 'optionalAccess', _237 => _237.trim, 'call', _238 => _238()]);
|
|
4464
4501
|
if (status) {
|
|
4465
4502
|
params.set("status", status);
|
|
4466
4503
|
}
|
|
4467
|
-
const node = _optionalChain([options, 'access',
|
|
4504
|
+
const node = _optionalChain([options, 'access', _239 => _239.node, 'optionalAccess', _240 => _240.trim, 'call', _241 => _241()]);
|
|
4468
4505
|
if (node) {
|
|
4469
4506
|
if (!playName)
|
|
4470
4507
|
throw new Error("runs.list options.node requires options.play.");
|
|
@@ -4538,8 +4575,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4538
4575
|
* different key intentionally starts another rerun.
|
|
4539
4576
|
*/
|
|
4540
4577
|
async rerun(runId, options) {
|
|
4541
|
-
const idempotencyKey = _optionalChain([options, 'optionalAccess',
|
|
4542
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4578
|
+
const idempotencyKey = _optionalChain([options, 'optionalAccess', _242 => _242.idempotencyKey, 'optionalAccess', _243 => _243.trim, 'call', _244 => _244()]);
|
|
4579
|
+
if (_optionalChain([options, 'optionalAccess', _245 => _245.idempotencyKey]) !== void 0 && !idempotencyKey) {
|
|
4543
4580
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4544
4581
|
"runs.rerun idempotencyKey must not be empty.",
|
|
4545
4582
|
void 0,
|
|
@@ -4548,7 +4585,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4548
4585
|
}
|
|
4549
4586
|
return this.http.post(
|
|
4550
4587
|
`/api/v2/runs/${encodeURIComponent(runId)}/rerun`,
|
|
4551
|
-
_optionalChain([options, 'optionalAccess',
|
|
4588
|
+
_optionalChain([options, 'optionalAccess', _246 => _246.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
|
|
4552
4589
|
{ "Idempotency-Key": idempotencyKey || globalThis.crypto.randomUUID() }
|
|
4553
4590
|
);
|
|
4554
4591
|
}
|
|
@@ -4562,21 +4599,21 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4562
4599
|
* ```
|
|
4563
4600
|
*/
|
|
4564
4601
|
async getRunLogs(runId, options) {
|
|
4565
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4602
|
+
if (_optionalChain([options, 'optionalAccess', _247 => _247.all]) === true && options.failed === true) {
|
|
4566
4603
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4567
4604
|
"runs.logs cannot combine all and failed views.",
|
|
4568
4605
|
void 0,
|
|
4569
4606
|
"INVALID_RUN_LOG_VIEW"
|
|
4570
4607
|
);
|
|
4571
4608
|
}
|
|
4572
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4609
|
+
if (_optionalChain([options, 'optionalAccess', _248 => _248.cursor]) !== void 0 && options.failed === true) {
|
|
4573
4610
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4574
4611
|
"runs.logs cannot combine failed with cursor.",
|
|
4575
4612
|
void 0,
|
|
4576
4613
|
"INVALID_RUN_LOG_VIEW"
|
|
4577
4614
|
);
|
|
4578
4615
|
}
|
|
4579
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4616
|
+
if (_optionalChain([options, 'optionalAccess', _249 => _249.failed]) === true) {
|
|
4580
4617
|
const requestedLimit = typeof options.limit === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : RUNS_FAILED_LOG_LIMIT;
|
|
4581
4618
|
const failedLimit = Math.min(RUNS_FAILED_LOG_LIMIT, requestedLimit);
|
|
4582
4619
|
const page = await this.http.get(
|
|
@@ -4601,18 +4638,18 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4601
4638
|
...page.logsTruncated ? { logsTruncated: true } : {}
|
|
4602
4639
|
};
|
|
4603
4640
|
}
|
|
4604
|
-
const beforeSequence = _optionalChain([options, 'optionalAccess',
|
|
4605
|
-
const limit = _optionalChain([options, 'optionalAccess',
|
|
4641
|
+
const beforeSequence = _optionalChain([options, 'optionalAccess', _250 => _250.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
|
|
4642
|
+
const limit = _optionalChain([options, 'optionalAccess', _251 => _251.all]) ? Number.MAX_SAFE_INTEGER : typeof _optionalChain([options, 'optionalAccess', _252 => _252.limit]) === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
|
|
4606
4643
|
const fetchPage = (afterSeq2, pageLimit) => this.http.get(
|
|
4607
4644
|
`/api/v2/runs/${encodeURIComponent(runId)}/logs?afterSeq=${afterSeq2}&limit=${pageLimit}`,
|
|
4608
4645
|
{ retryApiErrors: true }
|
|
4609
4646
|
);
|
|
4610
4647
|
const probe = await fetchPage(0, 1);
|
|
4611
4648
|
const lastStoredSeq = probe.lastStoredSeq;
|
|
4612
|
-
const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access',
|
|
4649
|
+
const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _253 => _253.entries, 'access', _254 => _254[0], 'optionalAccess', _255 => _255.seq]), () => ( null));
|
|
4613
4650
|
const upperSeq = beforeSequence === null ? Number.POSITIVE_INFINITY : Math.min(beforeSequence - 1, lastStoredSeq);
|
|
4614
4651
|
const windowEndSeq = Math.min(upperSeq, lastStoredSeq);
|
|
4615
|
-
let afterSeq = _optionalChain([options, 'optionalAccess',
|
|
4652
|
+
let afterSeq = _optionalChain([options, 'optionalAccess', _256 => _256.all]) ? 0 : Math.max(0, windowEndSeq - limit);
|
|
4616
4653
|
const entries = [];
|
|
4617
4654
|
while (entries.length < limit && afterSeq < upperSeq) {
|
|
4618
4655
|
const page = await fetchPage(
|
|
@@ -4646,7 +4683,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4646
4683
|
hasMore: olderLinesExist,
|
|
4647
4684
|
nextCursor: olderLinesExist ? encodeRunLogsCursor(firstSequence) : null,
|
|
4648
4685
|
entries: entries.map((entry) => entry.line),
|
|
4649
|
-
view: _optionalChain([options, 'optionalAccess',
|
|
4686
|
+
view: _optionalChain([options, 'optionalAccess', _257 => _257.all]) ? "all" : "tail",
|
|
4650
4687
|
...probe.logsTruncated ? { logsTruncated: true } : {}
|
|
4651
4688
|
};
|
|
4652
4689
|
}
|
|
@@ -4795,6 +4832,21 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4795
4832
|
{ headers, retryApiErrors: true }
|
|
4796
4833
|
);
|
|
4797
4834
|
}
|
|
4835
|
+
/**
|
|
4836
|
+
* Read one page of immutable admitted and terminal rows for a Play Run dataset.
|
|
4837
|
+
* Follow nextCursor; coverage explicitly identifies unavailable or incomplete history.
|
|
4838
|
+
*/
|
|
4839
|
+
async getPlayRunRowHistory(input) {
|
|
4840
|
+
const params = new URLSearchParams({
|
|
4841
|
+
runId: input.runId,
|
|
4842
|
+
tableNamespace: input.tableNamespace
|
|
4843
|
+
});
|
|
4844
|
+
if (input.limit !== void 0) params.set("limit", String(input.limit));
|
|
4845
|
+
if (input.cursor !== void 0) params.set("cursor", input.cursor);
|
|
4846
|
+
return this.http.get(
|
|
4847
|
+
`/api/v2/plays/${encodeURIComponent(input.playName)}/sheet/history?${params}`
|
|
4848
|
+
);
|
|
4849
|
+
}
|
|
4798
4850
|
/**
|
|
4799
4851
|
* Export persisted runtime-sheet rows for a play dataset/table namespace.
|
|
4800
4852
|
*
|
|
@@ -4807,7 +4859,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4807
4859
|
limit: String(_nullishCoalesce(input.limit, () => ( 5e3))),
|
|
4808
4860
|
offset: String(_nullishCoalesce(input.offset, () => ( 0)))
|
|
4809
4861
|
});
|
|
4810
|
-
if (_optionalChain([input, 'access',
|
|
4862
|
+
if (_optionalChain([input, 'access', _258 => _258.runId, 'optionalAccess', _259 => _259.trim, 'call', _260 => _260()])) {
|
|
4811
4863
|
params.set("runId", input.runId.trim());
|
|
4812
4864
|
}
|
|
4813
4865
|
if (input.rowMode === "all" || input.rowMode === "live") {
|
|
@@ -4817,9 +4869,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4817
4869
|
`/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`,
|
|
4818
4870
|
{ signal: input.signal }
|
|
4819
4871
|
);
|
|
4820
|
-
const requestedRunId = _optionalChain([input, 'access',
|
|
4872
|
+
const requestedRunId = _optionalChain([input, 'access', _261 => _261.runId, 'optionalAccess', _262 => _262.trim, 'call', _263 => _263()]) || "";
|
|
4821
4873
|
if (requestedRunId) {
|
|
4822
|
-
const confirmedRunId = _optionalChain([result, 'access',
|
|
4874
|
+
const confirmedRunId = _optionalChain([result, 'access', _264 => _264.scope, 'optionalAccess', _265 => _265.kind]) === "run" ? result.scope.runId.trim() : "";
|
|
4823
4875
|
const foreignRowRunIds = [
|
|
4824
4876
|
...new Set(
|
|
4825
4877
|
result.rows.map(
|
|
@@ -4827,7 +4879,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4827
4879
|
).filter((runId) => runId && runId !== requestedRunId)
|
|
4828
4880
|
)
|
|
4829
4881
|
];
|
|
4830
|
-
if (_optionalChain([result, 'access',
|
|
4882
|
+
if (_optionalChain([result, 'access', _266 => _266.scope, 'optionalAccess', _267 => _267.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
|
|
4831
4883
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4832
4884
|
`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.`,
|
|
4833
4885
|
void 0,
|
|
@@ -4856,7 +4908,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4856
4908
|
async stopRun(runId, options) {
|
|
4857
4909
|
return this.http.post(
|
|
4858
4910
|
`/api/v2/runs/${encodeURIComponent(runId)}/stop`,
|
|
4859
|
-
_optionalChain([options, 'optionalAccess',
|
|
4911
|
+
_optionalChain([options, 'optionalAccess', _268 => _268.reason]) ? { reason: options.reason } : {}
|
|
4860
4912
|
);
|
|
4861
4913
|
}
|
|
4862
4914
|
/**
|
|
@@ -4874,11 +4926,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4874
4926
|
* need to clear the workspace run-slot state without knowing each run id.
|
|
4875
4927
|
*/
|
|
4876
4928
|
async stopAllRuns(options) {
|
|
4877
|
-
const dryRun = _optionalChain([options, 'optionalAccess',
|
|
4929
|
+
const dryRun = _optionalChain([options, 'optionalAccess', _269 => _269.dryRun]) === true;
|
|
4878
4930
|
const result = await this.http.post(
|
|
4879
4931
|
"/api/v2/runs/stop-all",
|
|
4880
4932
|
{
|
|
4881
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4933
|
+
..._optionalChain([options, 'optionalAccess', _270 => _270.reason]) ? { reason: options.reason } : {},
|
|
4882
4934
|
...dryRun ? { dryRun: true } : {}
|
|
4883
4935
|
}
|
|
4884
4936
|
);
|
|
@@ -4899,7 +4951,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4899
4951
|
* `origin: "owned"` for org-owned plays.
|
|
4900
4952
|
*/
|
|
4901
4953
|
async listPlays(options) {
|
|
4902
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
4954
|
+
if (!_optionalChain([options, 'optionalAccess', _271 => _271.grep, 'optionalAccess', _272 => _272.trim, 'call', _273 => _273()])) {
|
|
4903
4955
|
return (await this.requestPlaysPage(options, false)).plays;
|
|
4904
4956
|
}
|
|
4905
4957
|
const plays = [];
|
|
@@ -4921,45 +4973,45 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4921
4973
|
}
|
|
4922
4974
|
async requestPlaysPage(options, paginateInventory = true) {
|
|
4923
4975
|
const params = new URLSearchParams();
|
|
4924
|
-
if (paginateInventory && !_optionalChain([options, 'optionalAccess',
|
|
4976
|
+
if (paginateInventory && !_optionalChain([options, 'optionalAccess', _274 => _274.grep, 'optionalAccess', _275 => _275.trim, 'call', _276 => _276()]))
|
|
4925
4977
|
params.set("inventory_paginated", "1");
|
|
4926
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4927
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4978
|
+
if (_optionalChain([options, 'optionalAccess', _277 => _277.origin])) params.set("origin", options.origin);
|
|
4979
|
+
if (_optionalChain([options, 'optionalAccess', _278 => _278.categories])) {
|
|
4928
4980
|
params.set(
|
|
4929
4981
|
"categories",
|
|
4930
4982
|
Array.isArray(options.categories) ? options.categories.join(",") : options.categories
|
|
4931
4983
|
);
|
|
4932
4984
|
}
|
|
4933
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4985
|
+
if (_optionalChain([options, 'optionalAccess', _279 => _279.categories]) || _optionalChain([options, 'optionalAccess', _280 => _280.includeToolCategories])) {
|
|
4934
4986
|
params.set("include_tool_categories", "1");
|
|
4935
4987
|
}
|
|
4936
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4988
|
+
if (_optionalChain([options, 'optionalAccess', _281 => _281.tags])) {
|
|
4937
4989
|
params.set(
|
|
4938
4990
|
"tags",
|
|
4939
4991
|
Array.isArray(options.tags) ? options.tags.join(",") : options.tags
|
|
4940
4992
|
);
|
|
4941
4993
|
}
|
|
4942
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4943
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4994
|
+
if (_optionalChain([options, 'optionalAccess', _282 => _282.includeArchived])) params.set("include_archived", "1");
|
|
4995
|
+
if (_optionalChain([options, 'optionalAccess', _283 => _283.includeCostEstimates])) {
|
|
4944
4996
|
params.set("include_cost_estimates", "1");
|
|
4945
4997
|
}
|
|
4946
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4998
|
+
if (_optionalChain([options, 'optionalAccess', _284 => _284.grep, 'optionalAccess', _285 => _285.trim, 'call', _286 => _286()])) {
|
|
4947
4999
|
params.set("grep", options.grep.trim());
|
|
4948
5000
|
params.set("limit", "60");
|
|
4949
5001
|
}
|
|
4950
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5002
|
+
if (_optionalChain([options, 'optionalAccess', _287 => _287.limit]) !== void 0) {
|
|
4951
5003
|
if (!Number.isSafeInteger(options.limit) || options.limit < 1) {
|
|
4952
5004
|
throw new Error("Play page limit must be a positive integer");
|
|
4953
5005
|
}
|
|
4954
5006
|
params.set("limit", String(options.limit));
|
|
4955
5007
|
}
|
|
4956
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5008
|
+
if (_optionalChain([options, 'optionalAccess', _288 => _288.cursor])) params.set("cursor", options.cursor);
|
|
4957
5009
|
const suffix = params.size ? `?${params.toString()}` : "";
|
|
4958
5010
|
const response = await this.http.get(`/api/v2/plays${suffix}`);
|
|
4959
5011
|
return {
|
|
4960
5012
|
plays: _nullishCoalesce(response.plays, () => ( [])),
|
|
4961
|
-
cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access',
|
|
4962
|
-
hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access',
|
|
5013
|
+
cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _289 => _289.pagination, 'optionalAccess', _290 => _290.cursor]), () => ( response.cursor)), () => ( null)),
|
|
5014
|
+
hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _291 => _291.pagination, 'optionalAccess', _292 => _292.hasMore]), () => ( response.hasMore)))
|
|
4963
5015
|
};
|
|
4964
5016
|
}
|
|
4965
5017
|
/** Read definition-level settings, independently of code revisions. */
|
|
@@ -5004,13 +5056,20 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5004
5056
|
async getNotificationSettings() {
|
|
5005
5057
|
return this.http.get("/api/v2/settings/notifications");
|
|
5006
5058
|
}
|
|
5059
|
+
/** Save provider-owned credential fields without starting an OAuth browser flow. */
|
|
5060
|
+
async setIntegrationCredentials(provider, credentials) {
|
|
5061
|
+
return this.http.post("/api/v2/integrations/connect", {
|
|
5062
|
+
provider,
|
|
5063
|
+
credentials
|
|
5064
|
+
});
|
|
5065
|
+
}
|
|
5007
5066
|
/** Start the Slack OAuth flow required by product notifications. */
|
|
5008
5067
|
async connectNotificationSlack(options) {
|
|
5009
5068
|
return this.http.post("/api/v2/integrations/connect", {
|
|
5010
5069
|
provider: "slack",
|
|
5011
5070
|
scopes: [...PRODUCT_NOTIFICATION_SLACK_OAUTH_SCOPES],
|
|
5012
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5013
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5071
|
+
..._optionalChain([options, 'optionalAccess', _293 => _293.successUrl]) ? { success_url: options.successUrl } : {},
|
|
5072
|
+
..._optionalChain([options, 'optionalAccess', _294 => _294.failureUrl]) ? { failure_url: options.failureUrl } : {}
|
|
5014
5073
|
});
|
|
5015
5074
|
}
|
|
5016
5075
|
/** List Slack channels visible to the connected Deepline Slack app. */
|
|
@@ -5085,7 +5144,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5085
5144
|
}
|
|
5086
5145
|
const targets = input.targets.map(parseNotificationGroupTarget);
|
|
5087
5146
|
const legacyEvents = _nullishCoalesce(input.legacyEvents, () => ( []));
|
|
5088
|
-
const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access',
|
|
5147
|
+
const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _295 => _295[0], 'optionalAccess', _296 => _296.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
|
|
5089
5148
|
if (legacyEvents.length > 0 && !legacyTarget) {
|
|
5090
5149
|
throw new Error(
|
|
5091
5150
|
"--for is supported only by the legacy one-Slack-target form. Create the group first, then add rules in notification configuration."
|
|
@@ -5121,7 +5180,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5121
5180
|
const existingGroup = current.configuration.groups.find(
|
|
5122
5181
|
(candidate) => candidate.name.toLowerCase() === name.toLowerCase()
|
|
5123
5182
|
);
|
|
5124
|
-
const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess',
|
|
5183
|
+
const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _297 => _297.groupKey]), () => ( notificationObjectKey("group")));
|
|
5125
5184
|
const group = _nullishCoalesce(existingGroup, () => ( {
|
|
5126
5185
|
groupKey,
|
|
5127
5186
|
name,
|
|
@@ -5339,13 +5398,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5339
5398
|
*/
|
|
5340
5399
|
async getPlay(name, options) {
|
|
5341
5400
|
const encodedName = encodeURIComponent(name);
|
|
5342
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
5401
|
+
const query = _optionalChain([options, 'optionalAccess', _298 => _298.source]) ? `?include=source&revision=${encodeURIComponent(options.source)}` : _optionalChain([options, 'optionalAccess', _299 => _299.guidance]) ? "?include=guidance" : "";
|
|
5343
5402
|
return this.http.get(`/api/v2/plays/${encodedName}${query}`);
|
|
5344
5403
|
}
|
|
5345
5404
|
/** Read one trigger inventory page without loading run histories. */
|
|
5346
5405
|
async listPlayTriggerInventory(options) {
|
|
5347
5406
|
const params = new URLSearchParams({ view: "inventory" });
|
|
5348
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5407
|
+
if (_optionalChain([options, 'optionalAccess', _300 => _300.cursor])) params.set("cursor", options.cursor);
|
|
5349
5408
|
return this.http.get(`/api/v2/plays/triggers?${params}`);
|
|
5350
5409
|
}
|
|
5351
5410
|
/** Read one trigger's recent runs, with an explicit partial-history flag. */
|
|
@@ -5354,7 +5413,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5354
5413
|
view: "history",
|
|
5355
5414
|
binding_id: bindingId
|
|
5356
5415
|
});
|
|
5357
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5416
|
+
if (_optionalChain([options, 'optionalAccess', _301 => _301.limit]) !== void 0)
|
|
5358
5417
|
params.set("history_limit", String(options.limit));
|
|
5359
5418
|
return this.http.get(`/api/v2/plays/triggers?${params}`);
|
|
5360
5419
|
}
|
|
@@ -5390,7 +5449,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5390
5449
|
*/
|
|
5391
5450
|
async listPlayVersions(name, options) {
|
|
5392
5451
|
const encodedName = encodeURIComponent(name);
|
|
5393
|
-
const suffix = _optionalChain([options, 'optionalAccess',
|
|
5452
|
+
const suffix = _optionalChain([options, 'optionalAccess', _302 => _302.full]) ? "?full=true" : "";
|
|
5394
5453
|
const response = await this.http.get(
|
|
5395
5454
|
`/api/v2/plays/${encodedName}/versions${suffix}`
|
|
5396
5455
|
);
|
|
@@ -5543,14 +5602,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5543
5602
|
*/
|
|
5544
5603
|
async runPlay(code, csvPath, name, options) {
|
|
5545
5604
|
const { workflowId } = await this.submitPlay(code, csvPath, name, {
|
|
5546
|
-
input: _optionalChain([options, 'optionalAccess',
|
|
5547
|
-
sourceCode: _optionalChain([options, 'optionalAccess',
|
|
5548
|
-
artifact: _optionalChain([options, 'optionalAccess',
|
|
5549
|
-
compilerManifest: _optionalChain([options, 'optionalAccess',
|
|
5550
|
-
inputFile: _optionalChain([options, 'optionalAccess',
|
|
5551
|
-
packagedFiles: _optionalChain([options, 'optionalAccess',
|
|
5552
|
-
force: _optionalChain([options, 'optionalAccess',
|
|
5553
|
-
forceToolRefresh: _optionalChain([options, 'optionalAccess',
|
|
5605
|
+
input: _optionalChain([options, 'optionalAccess', _303 => _303.input]),
|
|
5606
|
+
sourceCode: _optionalChain([options, 'optionalAccess', _304 => _304.sourceCode]),
|
|
5607
|
+
artifact: _optionalChain([options, 'optionalAccess', _305 => _305.artifact]),
|
|
5608
|
+
compilerManifest: _optionalChain([options, 'optionalAccess', _306 => _306.compilerManifest]),
|
|
5609
|
+
inputFile: _optionalChain([options, 'optionalAccess', _307 => _307.inputFile]),
|
|
5610
|
+
packagedFiles: _optionalChain([options, 'optionalAccess', _308 => _308.packagedFiles]),
|
|
5611
|
+
force: _optionalChain([options, 'optionalAccess', _309 => _309.force]),
|
|
5612
|
+
forceToolRefresh: _optionalChain([options, 'optionalAccess', _310 => _310.forceToolRefresh])
|
|
5554
5613
|
});
|
|
5555
5614
|
const start = Date.now();
|
|
5556
5615
|
const state = {
|
|
@@ -5561,7 +5620,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5561
5620
|
latest: null
|
|
5562
5621
|
};
|
|
5563
5622
|
let terminalObserved = null;
|
|
5564
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5623
|
+
if (_optionalChain([options, 'optionalAccess', _311 => _311.signal, 'optionalAccess', _312 => _312.aborted])) {
|
|
5565
5624
|
await this.cancelPlay(workflowId);
|
|
5566
5625
|
return {
|
|
5567
5626
|
success: false,
|
|
@@ -5572,9 +5631,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5572
5631
|
};
|
|
5573
5632
|
}
|
|
5574
5633
|
for await (const event of this.watchRunEvents(workflowId, {
|
|
5575
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
5634
|
+
signal: _optionalChain([options, 'optionalAccess', _313 => _313.signal])
|
|
5576
5635
|
})) {
|
|
5577
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5636
|
+
if (_optionalChain([options, 'optionalAccess', _314 => _314.signal, 'optionalAccess', _315 => _315.aborted])) {
|
|
5578
5637
|
await this.cancelPlay(workflowId);
|
|
5579
5638
|
return {
|
|
5580
5639
|
success: false,
|
|
@@ -5584,19 +5643,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5584
5643
|
error: "Cancelled by user"
|
|
5585
5644
|
};
|
|
5586
5645
|
}
|
|
5587
|
-
const previousStatus = _optionalChain([state, 'access',
|
|
5646
|
+
const previousStatus = _optionalChain([state, 'access', _316 => _316.latest, 'optionalAccess', _317 => _317.status]);
|
|
5588
5647
|
const status = updatePlayLiveStatusState(state, event);
|
|
5589
5648
|
if (!status) {
|
|
5590
5649
|
continue;
|
|
5591
5650
|
}
|
|
5592
5651
|
if (event.type !== "play.run.status" || status.status !== previousStatus) {
|
|
5593
|
-
_optionalChain([options, 'optionalAccess',
|
|
5652
|
+
_optionalChain([options, 'optionalAccess', _318 => _318.onProgress, 'optionalCall', _319 => _319(status)]);
|
|
5594
5653
|
}
|
|
5595
|
-
if (
|
|
5654
|
+
if (_chunkUHNDVD3Pjs.isTerminalPlayRunLifecycleStatus.call(void 0, status.status)) {
|
|
5596
5655
|
terminalObserved = status;
|
|
5597
5656
|
}
|
|
5598
5657
|
}
|
|
5599
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5658
|
+
if (_optionalChain([options, 'optionalAccess', _320 => _320.signal, 'optionalAccess', _321 => _321.aborted])) {
|
|
5600
5659
|
await this.cancelPlay(workflowId);
|
|
5601
5660
|
return {
|
|
5602
5661
|
success: false,
|
|
@@ -5649,7 +5708,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5649
5708
|
const response = await this.http.get(
|
|
5650
5709
|
`/api/v2/usage/events?request_id=${encodeURIComponent(normalizedRequestId)}`
|
|
5651
5710
|
);
|
|
5652
|
-
const event = _optionalChain([response, 'access',
|
|
5711
|
+
const event = _optionalChain([response, 'access', _322 => _322.entries, 'optionalAccess', _323 => _323[0]]);
|
|
5653
5712
|
if (!event) {
|
|
5654
5713
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
5655
5714
|
"No usage event was found for this request_id.",
|
|
@@ -5780,7 +5839,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5780
5839
|
async cancelBillingSubscription(options) {
|
|
5781
5840
|
return this.http.post(
|
|
5782
5841
|
"/api/v2/billing/subscription/cancel",
|
|
5783
|
-
{ action: _optionalChain([options, 'optionalAccess',
|
|
5842
|
+
{ action: _optionalChain([options, 'optionalAccess', _324 => _324.undo]) ? "undo_cancel" : "cancel" }
|
|
5784
5843
|
);
|
|
5785
5844
|
}
|
|
5786
5845
|
/**
|
|
@@ -5792,7 +5851,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5792
5851
|
*/
|
|
5793
5852
|
async listBillingInvoices(options) {
|
|
5794
5853
|
const params = new URLSearchParams();
|
|
5795
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5854
|
+
if (_optionalChain([options, 'optionalAccess', _325 => _325.limit]) !== void 0) {
|
|
5796
5855
|
params.set("limit", String(options.limit));
|
|
5797
5856
|
}
|
|
5798
5857
|
const suffix = Array.from(params).length > 0 ? `?${params.toString()}` : "";
|
|
@@ -5902,7 +5961,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5902
5961
|
/** Create a Stripe-hosted portal session for payment recovery and invoices. */
|
|
5903
5962
|
async createTargetBillingPortalSession(options) {
|
|
5904
5963
|
const response = await this.http.post(
|
|
5905
|
-
_optionalChain([options, 'optionalAccess',
|
|
5964
|
+
_optionalChain([options, 'optionalAccess', _326 => _326.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
|
|
5906
5965
|
{}
|
|
5907
5966
|
);
|
|
5908
5967
|
return response.data;
|
|
@@ -5952,8 +6011,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5952
6011
|
return this.http.request("/api/v2/monitors/audit", {
|
|
5953
6012
|
method: "POST",
|
|
5954
6013
|
body: {
|
|
5955
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5956
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6014
|
+
..._optionalChain([options, 'optionalAccess', _327 => _327.fleetId]) ? { fleet_id: options.fleetId } : {},
|
|
6015
|
+
..._optionalChain([options, 'optionalAccess', _328 => _328.cursor]) ? { cursor: options.cursor } : {}
|
|
5957
6016
|
},
|
|
5958
6017
|
maxRetries: 0
|
|
5959
6018
|
});
|
|
@@ -5963,8 +6022,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5963
6022
|
return this.http.request("/api/v2/monitors/repair", {
|
|
5964
6023
|
method: "POST",
|
|
5965
6024
|
body: {
|
|
5966
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5967
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6025
|
+
..._optionalChain([options, 'optionalAccess', _329 => _329.fleetId]) ? { fleet_id: options.fleetId } : {},
|
|
6026
|
+
..._optionalChain([options, 'optionalAccess', _330 => _330.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
|
|
5968
6027
|
},
|
|
5969
6028
|
maxRetries: 0
|
|
5970
6029
|
});
|
|
@@ -5972,7 +6031,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5972
6031
|
/** Delivery and convergence health. Prefer `client.monitors.health(...)`. */
|
|
5973
6032
|
async readMonitorsHealth(options) {
|
|
5974
6033
|
const params = new URLSearchParams();
|
|
5975
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6034
|
+
if (_optionalChain([options, 'optionalAccess', _331 => _331.fleetId])) params.set("fleet_id", options.fleetId);
|
|
5976
6035
|
const query = params.toString();
|
|
5977
6036
|
const suffix = query ? `?${query}` : "";
|
|
5978
6037
|
return this.http.request(
|
|
@@ -6045,7 +6104,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6045
6104
|
);
|
|
6046
6105
|
}
|
|
6047
6106
|
const params = new URLSearchParams();
|
|
6048
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6107
|
+
if (_optionalChain([options, 'optionalAccess', _332 => _332.cursor])) params.set("cursor", options.cursor);
|
|
6049
6108
|
const suffix = params.size > 0 ? `?${params}` : "";
|
|
6050
6109
|
return this.http.request(
|
|
6051
6110
|
`/api/v2/monitors/batch/${encodeURIComponent(runId)}${suffix}`,
|
|
@@ -6089,7 +6148,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6089
6148
|
* `client.monitors.deploy(...)`.
|
|
6090
6149
|
*/
|
|
6091
6150
|
async deployMonitor(definition, options) {
|
|
6092
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6151
|
+
if (_optionalChain([options, 'optionalAccess', _333 => _333.dryRun])) {
|
|
6093
6152
|
return this.http.request("/api/v2/monitors/check", {
|
|
6094
6153
|
method: "POST",
|
|
6095
6154
|
body: definition
|
|
@@ -6125,12 +6184,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6125
6184
|
/** List deployed monitors. Prefer `client.monitors.list(...)`. */
|
|
6126
6185
|
async listMonitors(options) {
|
|
6127
6186
|
const params = new URLSearchParams();
|
|
6128
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6129
|
-
else if (_optionalChain([options, 'optionalAccess',
|
|
6130
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6187
|
+
if (_optionalChain([options, 'optionalAccess', _334 => _334.state])) params.set("state", options.state);
|
|
6188
|
+
else if (_optionalChain([options, 'optionalAccess', _335 => _335.status])) params.set("status", options.status);
|
|
6189
|
+
if (_optionalChain([options, 'optionalAccess', _336 => _336.limit]) !== void 0)
|
|
6131
6190
|
params.set("limit", String(options.limit));
|
|
6132
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6133
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6191
|
+
if (_optionalChain([options, 'optionalAccess', _337 => _337.cursor])) params.set("cursor", options.cursor);
|
|
6192
|
+
if (_optionalChain([options, 'optionalAccess', _338 => _338.includeConsumers])) params.set("include_consumers", "true");
|
|
6134
6193
|
const query = params.toString();
|
|
6135
6194
|
const suffix = query ? `?${query}` : "";
|
|
6136
6195
|
return this.http.request(
|
|
@@ -6146,7 +6205,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6146
6205
|
);
|
|
6147
6206
|
}
|
|
6148
6207
|
async testMonitorWebhook(key, payload, options) {
|
|
6149
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6208
|
+
if (_optionalChain([options, 'optionalAccess', _339 => _339.dispatch]) === true || _optionalChain([options, 'optionalAccess', _340 => _340.validationOnly]) === false) {
|
|
6150
6209
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
6151
6210
|
"Monitor tests are validation-only and cannot dispatch events.",
|
|
6152
6211
|
void 0,
|
|
@@ -6201,7 +6260,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6201
6260
|
}
|
|
6202
6261
|
/** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
|
|
6203
6262
|
async deleteMonitor(key, options) {
|
|
6204
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6263
|
+
if (_optionalChain([options, 'optionalAccess', _341 => _341.localOnly]) === true) {
|
|
6205
6264
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
6206
6265
|
"localOnly monitor deletion is no longer supported. Monitor deletion always deprovisions the upstream provider resource.",
|
|
6207
6266
|
void 0,
|
|
@@ -6209,11 +6268,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6209
6268
|
);
|
|
6210
6269
|
}
|
|
6211
6270
|
const params = new URLSearchParams();
|
|
6212
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6271
|
+
if (_optionalChain([options, 'optionalAccess', _342 => _342.dryRun])) params.set("dry_run", "true");
|
|
6213
6272
|
const query = params.toString();
|
|
6214
6273
|
return this.http.request(
|
|
6215
6274
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
|
|
6216
|
-
_optionalChain([options, 'optionalAccess',
|
|
6275
|
+
_optionalChain([options, 'optionalAccess', _343 => _343.dryRun]) ? { method: "DELETE" } : {
|
|
6217
6276
|
method: "DELETE",
|
|
6218
6277
|
// Deletion is a provider lifecycle operation. A timeout is an
|
|
6219
6278
|
// unknown outcome, not authority to begin another delete attempt.
|
|
@@ -6226,10 +6285,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6226
6285
|
* Prefer `client.monitors.reactivate(...)`.
|
|
6227
6286
|
*/
|
|
6228
6287
|
async reactivateMonitor(key, options) {
|
|
6229
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
6288
|
+
const query = _optionalChain([options, 'optionalAccess', _344 => _344.dryRun]) ? "?dry_run=true" : "";
|
|
6230
6289
|
return this.http.request(
|
|
6231
6290
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
|
|
6232
|
-
_optionalChain([options, 'optionalAccess',
|
|
6291
|
+
_optionalChain([options, 'optionalAccess', _345 => _345.dryRun]) ? { method: "POST", body: {} } : {
|
|
6233
6292
|
method: "POST",
|
|
6234
6293
|
body: {},
|
|
6235
6294
|
// Reactivation can create an upstream resource, so it must not use
|
|
@@ -6243,7 +6302,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6243
6302
|
// ——————————————————————————————————————————————————————————
|
|
6244
6303
|
static __initStatic() {this.MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH = 96}
|
|
6245
6304
|
monitorJobIdempotencyKey(operation) {
|
|
6246
|
-
const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access',
|
|
6305
|
+
const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _346 => _346.crypto, 'optionalAccess', _347 => _347.randomUUID, 'optionalCall', _348 => _348()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
|
|
6247
6306
|
const prefix = "monitor-job-";
|
|
6248
6307
|
const safeOperation = operation.replace(/[^A-Za-z0-9._-]/g, "-");
|
|
6249
6308
|
const maxOperationLength = Math.max(
|
|
@@ -6254,7 +6313,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6254
6313
|
}
|
|
6255
6314
|
monitorJobHeaders(operation, idempotencyKey) {
|
|
6256
6315
|
return {
|
|
6257
|
-
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess',
|
|
6316
|
+
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _349 => _349.trim, 'call', _350 => _350()]) || this.monitorJobIdempotencyKey(operation)
|
|
6258
6317
|
};
|
|
6259
6318
|
}
|
|
6260
6319
|
async deployMonitorBatch(definitions, options) {
|
|
@@ -6265,7 +6324,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6265
6324
|
body: { version: 1, kind: "batch", monitors: definitions },
|
|
6266
6325
|
headers: this.monitorJobHeaders(
|
|
6267
6326
|
"batch-deploy",
|
|
6268
|
-
_optionalChain([options, 'optionalAccess',
|
|
6327
|
+
_optionalChain([options, 'optionalAccess', _351 => _351.idempotencyKey])
|
|
6269
6328
|
),
|
|
6270
6329
|
maxRetries: 0,
|
|
6271
6330
|
exactUrlOnly: true
|
|
@@ -6284,11 +6343,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6284
6343
|
version: 1,
|
|
6285
6344
|
kind: "batch",
|
|
6286
6345
|
monitors: definitions,
|
|
6287
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6346
|
+
..._optionalChain([options, 'optionalAccess', _352 => _352.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
|
|
6288
6347
|
},
|
|
6289
6348
|
headers: this.monitorJobHeaders(
|
|
6290
6349
|
`batch-sync-${batchId}`,
|
|
6291
|
-
_optionalChain([options, 'optionalAccess',
|
|
6350
|
+
_optionalChain([options, 'optionalAccess', _353 => _353.idempotencyKey])
|
|
6292
6351
|
),
|
|
6293
6352
|
maxRetries: 0,
|
|
6294
6353
|
exactUrlOnly: true
|
|
@@ -6303,7 +6362,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6303
6362
|
body: {},
|
|
6304
6363
|
headers: this.monitorJobHeaders(
|
|
6305
6364
|
`batch-start-${batchId}`,
|
|
6306
|
-
_optionalChain([options, 'optionalAccess',
|
|
6365
|
+
_optionalChain([options, 'optionalAccess', _354 => _354.idempotencyKey])
|
|
6307
6366
|
),
|
|
6308
6367
|
maxRetries: 0,
|
|
6309
6368
|
exactUrlOnly: true
|
|
@@ -6318,7 +6377,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6318
6377
|
body: {},
|
|
6319
6378
|
headers: this.monitorJobHeaders(
|
|
6320
6379
|
`batch-stop-${batchId}`,
|
|
6321
|
-
_optionalChain([options, 'optionalAccess',
|
|
6380
|
+
_optionalChain([options, 'optionalAccess', _355 => _355.idempotencyKey])
|
|
6322
6381
|
),
|
|
6323
6382
|
maxRetries: 0,
|
|
6324
6383
|
exactUrlOnly: true
|
|
@@ -6339,7 +6398,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6339
6398
|
body: {},
|
|
6340
6399
|
headers: this.monitorJobHeaders(
|
|
6341
6400
|
`${action}-${monitorKey}`,
|
|
6342
|
-
_optionalChain([options, 'optionalAccess',
|
|
6401
|
+
_optionalChain([options, 'optionalAccess', _356 => _356.idempotencyKey])
|
|
6343
6402
|
),
|
|
6344
6403
|
maxRetries: 0,
|
|
6345
6404
|
exactUrlOnly: true
|
|
@@ -6352,7 +6411,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6352
6411
|
body: definition,
|
|
6353
6412
|
headers: this.monitorJobHeaders(
|
|
6354
6413
|
`sync-${definition.key}`,
|
|
6355
|
-
_optionalChain([options, 'optionalAccess',
|
|
6414
|
+
_optionalChain([options, 'optionalAccess', _357 => _357.idempotencyKey])
|
|
6356
6415
|
),
|
|
6357
6416
|
maxRetries: 0,
|
|
6358
6417
|
exactUrlOnly: true
|
|
@@ -6365,7 +6424,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6365
6424
|
);
|
|
6366
6425
|
}
|
|
6367
6426
|
async getMonitorJobLogs(jobId, options) {
|
|
6368
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
6427
|
+
const query = _optionalChain([options, 'optionalAccess', _358 => _358.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
|
|
6369
6428
|
return this.http.request(
|
|
6370
6429
|
`/api/v2/monitors/jobs/${encodeURIComponent(jobId)}/logs${query}`,
|
|
6371
6430
|
{ method: "GET" }
|
|
@@ -6378,15 +6437,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6378
6437
|
);
|
|
6379
6438
|
}
|
|
6380
6439
|
async waitForMonitorJob(jobId, options) {
|
|
6381
|
-
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6382
|
-
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6440
|
+
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _359 => _359.timeoutMs]), () => ( 10 * 6e4)));
|
|
6441
|
+
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _360 => _360.pollIntervalMs]), () => ( 2e3)));
|
|
6383
6442
|
const terminal = /* @__PURE__ */ new Set(["succeeded", "failed", "cancelled"]);
|
|
6384
6443
|
const startedAt = Date.now();
|
|
6385
6444
|
let latest = await this.getMonitorJob(jobId);
|
|
6386
6445
|
while (true) {
|
|
6387
|
-
_optionalChain([options, 'optionalAccess',
|
|
6446
|
+
_optionalChain([options, 'optionalAccess', _361 => _361.onProgress, 'optionalCall', _362 => _362(latest)]);
|
|
6388
6447
|
const job = latest.job;
|
|
6389
|
-
const state = typeof _optionalChain([job, 'optionalAccess',
|
|
6448
|
+
const state = typeof _optionalChain([job, 'optionalAccess', _363 => _363.state]) === "string" ? job.state : void 0;
|
|
6390
6449
|
if (state && terminal.has(state)) return latest;
|
|
6391
6450
|
if (Date.now() - startedAt >= timeoutMs) return latest;
|
|
6392
6451
|
await sleep(pollIntervalMs);
|
|
@@ -6397,12 +6456,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6397
6456
|
// Monitor Fleets
|
|
6398
6457
|
// ——————————————————————————————————————————————————————————
|
|
6399
6458
|
monitorFleetIdempotencyKey(operation) {
|
|
6400
|
-
const uuid = _optionalChain([globalThis, 'access',
|
|
6459
|
+
const uuid = _optionalChain([globalThis, 'access', _364 => _364.crypto, 'optionalAccess', _365 => _365.randomUUID, 'optionalCall', _366 => _366()]);
|
|
6401
6460
|
return `monitor-fleet-${operation}-${_nullishCoalesce(uuid, () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`;
|
|
6402
6461
|
}
|
|
6403
6462
|
monitorFleetHeaders(operation, idempotencyKey) {
|
|
6404
6463
|
return {
|
|
6405
|
-
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess',
|
|
6464
|
+
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _367 => _367.trim, 'call', _368 => _368()]) || this.monitorFleetIdempotencyKey(operation)
|
|
6406
6465
|
};
|
|
6407
6466
|
}
|
|
6408
6467
|
monitorFleetPath(fleetId) {
|
|
@@ -6422,15 +6481,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6422
6481
|
const fleetId = typeof definitionOrId === "string" ? definitionOrId : definitionOrId.id;
|
|
6423
6482
|
const body = {
|
|
6424
6483
|
...typeof definitionOrId === "string" ? {} : { definition: definitionOrId },
|
|
6425
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6426
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6484
|
+
..._optionalChain([options, 'optionalAccess', _369 => _369.dryRun]) ? { dry_run: true } : {},
|
|
6485
|
+
..._optionalChain([options, 'optionalAccess', _370 => _370.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
|
|
6427
6486
|
};
|
|
6428
6487
|
return this.http.request(
|
|
6429
6488
|
this.monitorFleetPath(fleetId),
|
|
6430
6489
|
{
|
|
6431
6490
|
method: "PUT",
|
|
6432
6491
|
body,
|
|
6433
|
-
headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess',
|
|
6492
|
+
headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _371 => _371.idempotencyKey])),
|
|
6434
6493
|
maxRetries: 0,
|
|
6435
6494
|
exactUrlOnly: true
|
|
6436
6495
|
}
|
|
@@ -6443,8 +6502,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6443
6502
|
}
|
|
6444
6503
|
async getMonitorFleet(fleetId, options) {
|
|
6445
6504
|
const params = new URLSearchParams();
|
|
6446
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6447
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6505
|
+
if (_optionalChain([options, 'optionalAccess', _372 => _372.drift])) params.set("drift", "1");
|
|
6506
|
+
if (_optionalChain([options, 'optionalAccess', _373 => _373.limit]) !== void 0)
|
|
6448
6507
|
params.set("limit", String(options.limit));
|
|
6449
6508
|
const query = params.toString();
|
|
6450
6509
|
return this.http.request(
|
|
@@ -6457,10 +6516,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6457
6516
|
this.monitorFleetPath(fleetId),
|
|
6458
6517
|
{
|
|
6459
6518
|
method: "DELETE",
|
|
6460
|
-
body: _optionalChain([options, 'optionalAccess',
|
|
6519
|
+
body: _optionalChain([options, 'optionalAccess', _374 => _374.dryRun]) ? { dry_run: true } : {},
|
|
6461
6520
|
headers: this.monitorFleetHeaders(
|
|
6462
6521
|
"deactivate",
|
|
6463
|
-
_optionalChain([options, 'optionalAccess',
|
|
6522
|
+
_optionalChain([options, 'optionalAccess', _375 => _375.idempotencyKey])
|
|
6464
6523
|
),
|
|
6465
6524
|
maxRetries: 0,
|
|
6466
6525
|
exactUrlOnly: true
|
|
@@ -6475,7 +6534,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6475
6534
|
body: {},
|
|
6476
6535
|
headers: this.monitorFleetHeaders(
|
|
6477
6536
|
"reactivate",
|
|
6478
|
-
_optionalChain([options, 'optionalAccess',
|
|
6537
|
+
_optionalChain([options, 'optionalAccess', _376 => _376.idempotencyKey])
|
|
6479
6538
|
),
|
|
6480
6539
|
maxRetries: 0,
|
|
6481
6540
|
exactUrlOnly: true
|
|
@@ -6492,13 +6551,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6492
6551
|
* identical to "the request failed".
|
|
6493
6552
|
*/
|
|
6494
6553
|
async waitForMonitorFleetConvergence(fleetId, options) {
|
|
6495
|
-
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6496
|
-
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6497
|
-
const terminal = _optionalChain([options, 'optionalAccess',
|
|
6554
|
+
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _377 => _377.timeoutMs]), () => ( 10 * 6e4)));
|
|
6555
|
+
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _378 => _378.pollIntervalMs]), () => ( 2e3)));
|
|
6556
|
+
const terminal = _optionalChain([options, 'optionalAccess', _379 => _379.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded"]) : /* @__PURE__ */ new Set(["converged", "degraded", "deactivated"]);
|
|
6498
6557
|
const startedAt = Date.now();
|
|
6499
6558
|
let latest = await this.getMonitorFleet(fleetId);
|
|
6500
6559
|
while (true) {
|
|
6501
|
-
_optionalChain([options, 'optionalAccess',
|
|
6560
|
+
_optionalChain([options, 'optionalAccess', _380 => _380.onProgress, 'optionalCall', _381 => _381(latest)]);
|
|
6502
6561
|
const status = typeof latest.status === "string" ? latest.status : void 0;
|
|
6503
6562
|
if (status && terminal.has(status)) return latest;
|
|
6504
6563
|
if (Date.now() - startedAt >= timeoutMs) return latest;
|