deepline 0.3.313 → 0.3.315
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 +12 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +10 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts +50 -0
- package/dist/bundling-sources/shared_libs/play-runtime/run-event-query.ts +15 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-launch-transport.ts +210 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +226 -14
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +4 -18
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +5 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +94 -14
- package/dist/bundling-sources/shared_libs/plays/docflow-binding-owner.ts +61 -11
- package/dist/cli/{auth-LNA6WCQA.mjs → auth-OVWOO5NP.mjs} +4 -4
- package/dist/cli/auth-P2TTZU36.js +31 -0
- package/dist/cli/{billing-GJJUUCOZ.js → billing-SRZL7UOH.js} +70 -70
- package/dist/cli/{billing-D37QNIE3.mjs → billing-W3OXKWNE.mjs} +4 -4
- package/dist/cli/{chunk-HY2SSFRI.js → chunk-6BJACIVK.js} +1 -1
- package/dist/cli/{chunk-BS4GAUMH.mjs → chunk-AO4IWPP7.mjs} +33 -8
- package/dist/cli/{chunk-DOI3UBGV.mjs → chunk-AZWQJAQF.mjs} +1 -1
- package/dist/cli/{chunk-XFEPRIW7.mjs → chunk-B473QUQU.mjs} +4 -4
- package/dist/cli/{chunk-P4N7233B.js → chunk-C5WSTXUB.js} +247 -222
- package/dist/cli/{chunk-4UXNEC5C.js → chunk-FGAK6FET.js} +26 -26
- package/dist/cli/{chunk-3ZC4PHJ6.mjs → chunk-FTJQO757.mjs} +1 -1
- package/dist/cli/{chunk-UQBMMN4U.mjs → chunk-GK67FYMS.mjs} +5 -5
- package/dist/cli/{chunk-CSH4PKPJ.mjs → chunk-HNKHMHJ7.mjs} +1 -1
- package/dist/cli/{chunk-YZ5PP6TX.mjs → chunk-IGE7EJJY.mjs} +23 -3
- package/dist/cli/{chunk-HM2TSTCT.mjs → chunk-JF4O5OMH.mjs} +1 -1
- package/dist/cli/{chunk-N2DXWS6W.mjs → chunk-L5TSFCJ6.mjs} +2 -2
- package/dist/cli/{chunk-6G7ZYA6E.js → chunk-LOWURQMF.js} +50 -50
- package/dist/cli/{chunk-FJUIXWZF.js → chunk-OJP4FCCX.js} +48 -48
- package/dist/cli/{chunk-BLMO3JMZ.mjs → chunk-OUIIYFG3.mjs} +2 -2
- package/dist/cli/{chunk-MHETTUWR.js → chunk-OYJCNCUW.js} +2 -2
- package/dist/cli/{chunk-JG2ZTDZV.js → chunk-PPONZ6IE.js} +15 -15
- package/dist/cli/{chunk-QCXDLOGA.mjs → chunk-R3IFZDJL.mjs} +2 -2
- package/dist/cli/{chunk-KNGTN7NE.js → chunk-SNFSO2AN.js} +6 -6
- package/dist/cli/{chunk-RDUS2EDE.mjs → chunk-TQ3F77AC.mjs} +3 -3
- package/dist/cli/{chunk-I4FHFGMA.js → chunk-TQK662WG.js} +60 -60
- package/dist/cli/{chunk-OTA5C7DD.mjs → chunk-TZ5KUDPP.mjs} +1 -1
- package/dist/cli/{chunk-FSZTWQFK.js → chunk-URVZGYGG.js} +4 -4
- package/dist/cli/{chunk-VSAYSOVC.js → chunk-VYK23G2C.js} +222 -202
- package/dist/cli/{chunk-GQXEHX5X.js → chunk-Y42UERUY.js} +6 -6
- package/dist/cli/{chunk-QQMKX7JW.js → chunk-YL42TF53.js} +6 -6
- package/dist/cli/client-CXFPFCIG.js +20 -0
- package/dist/cli/{client-6RVRZ4OY.mjs → client-WQ3J5BSH.mjs} +3 -3
- package/dist/cli/{csv-SBOHBKEG.mjs → csv-36ARCBNQ.mjs} +3 -3
- package/dist/cli/{csv-2UHRG67O.js → csv-CENMEWDH.js} +12 -12
- package/dist/cli/{db-VRE7CLIQ.js → db-6DQZG6NB.js} +20 -20
- package/dist/cli/{db-TUFTPYEA.mjs → db-JU7XLKQM.mjs} +4 -4
- package/dist/cli/{describe-WCBZTSOF.mjs → describe-34ALEEFO.mjs} +8 -8
- package/dist/cli/{describe-GS5A2XH4.js → describe-VUD4AFBY.js} +15 -15
- package/dist/cli/{executions-ENMOOKWH.js → executions-H2UXS6FP.js} +6 -6
- package/dist/cli/{executions-UTN3O372.mjs → executions-H66BMN6N.mjs} +4 -4
- package/dist/cli/{feedback-PXBA3AG7.mjs → feedback-Q7LXXLSH.mjs} +3 -3
- package/dist/cli/{feedback-BLN6SIRG.js → feedback-YSYFQSAB.js} +6 -6
- package/dist/cli/git-SYFCYIFP.js +23 -0
- package/dist/cli/{git-YDMIRW3Q.mjs → git-XV43NSWN.mjs} +4 -4
- package/dist/cli/index.js +74 -74
- package/dist/cli/index.mjs +31 -31
- package/dist/cli/{legacy-noops-CWTUWTDB.js → legacy-noops-RGDW6SCA.js} +7 -7
- package/dist/cli/{legacy-noops-OVG2SICQ.mjs → legacy-noops-Z2DTZQN3.mjs} +4 -4
- package/dist/cli/{monitors-T63OPBTY.js → monitors-I75KZ2BP.js} +85 -85
- package/dist/cli/{monitors-ATIDXJA4.mjs → monitors-OFQ56O4S.mjs} +4 -4
- package/dist/cli/{org-7RVAPMRN.js → org-75AH6RIB.js} +60 -60
- package/dist/cli/{org-NXKNIM3H.mjs → org-ZYMCU6XO.mjs} +4 -4
- package/dist/cli/{play-B62OVHD4.mjs → play-BKXM76DV.mjs} +7 -7
- package/dist/cli/play-OKXUWPMO.js +152 -0
- package/dist/cli/{providers-U7B7JEYY.mjs → providers-GWG2WFIY.mjs} +4 -4
- package/dist/cli/{providers-EITVEGXD.js → providers-Z77MM7ID.js} +7 -7
- package/dist/cli/{quickstart-VSWTYNJM.mjs → quickstart-BGVIV374.mjs} +3 -3
- package/dist/cli/{quickstart-G64F2XRU.js → quickstart-I4RECIQC.js} +5 -5
- package/dist/cli/search-3KISUDDT.js +26 -0
- package/dist/cli/{search-SKYTFKKF.mjs → search-TIKBP3RE.mjs} +5 -5
- package/dist/cli/{secrets-JSFHSCGM.js → secrets-SNGRI4KS.js} +13 -13
- package/dist/cli/{secrets-4DNS7KWS.mjs → secrets-YCHKLWKC.mjs} +4 -4
- package/dist/cli/{sessions-HB7RQ4XN.mjs → sessions-IRDG6ZRX.mjs} +4 -4
- package/dist/cli/{sessions-MLTYPPCG.js → sessions-WXLADGDX.js} +5 -5
- package/dist/cli/{settings-3PCKNBPU.js → settings-72J4BVF6.js} +74 -74
- package/dist/cli/{settings-BT5WCU65.mjs → settings-KZALJDXW.mjs} +7 -7
- package/dist/cli/{setup-EIWDTMCK.mjs → setup-4KCA7ESV.mjs} +6 -6
- package/dist/cli/{setup-EYZWTDJI.js → setup-FFB3KLFD.js} +41 -41
- package/dist/cli/{skills-AQ3ORN2C.mjs → skills-MQZPYUQ3.mjs} +4 -4
- package/dist/cli/skills-XGOK4GRW.js +28 -0
- package/dist/cli/tools-LEAJ7EPW.js +38 -0
- package/dist/cli/{tools-OFTB2BGP.mjs → tools-M3WKRZ5T.mjs} +6 -6
- package/dist/cli/{update-ERQTFSAR.mjs → update-QJMNYGNF.mjs} +6 -6
- package/dist/cli/update-ZN6LDUHS.js +28 -0
- package/dist/cli/{workflow-6D6NHUH4.js → workflow-35UUOZ5E.js} +15 -15
- package/dist/cli/{workflow-SRLWGGBM.mjs → workflow-6T2EUFCN.mjs} +5 -5
- package/dist/{client-CtVdLZux.d.mts → client-CvpZsBqt.d.mts} +12 -0
- package/dist/{client-OBwghxPC.d.ts → client-Dh_4Ph1R.d.ts} +12 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -6
- package/dist/index.mjs +3 -3
- package/dist/install-integrity.json +76 -76
- package/dist/plays/run-request.d.mts +1 -1
- package/dist/plays/run-request.d.ts +1 -1
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/package.json +1 -1
- package/dist/cli/auth-56NYRTQK.js +0 -31
- package/dist/cli/client-XUTMYJDL.js +0 -20
- package/dist/cli/git-26D3VD2I.js +0 -23
- package/dist/cli/play-WM3NZVE7.js +0 -152
- package/dist/cli/search-TXQJJQWY.js +0 -26
- package/dist/cli/skills-73T4BSDE.js +0 -28
- package/dist/cli/tools-ZGSOHWBY.js +0 -38
- package/dist/cli/update-L4V5TF7I.js +0 -28
|
@@ -14,7 +14,7 @@ var _chunkLA46MMTLjs = require('./chunk-LA46MMTL.js');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkURVZGYGGjs = require('./chunk-URVZGYGG.js');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
@@ -2295,8 +2295,18 @@ function parseDsl(input) {
|
|
|
2295
2295
|
const operation = /^(==|!=|>=|<=|>|<|\b(?:eq|ne|gte|gt|lte|lt|in|exists)\b)/.exec(
|
|
2296
2296
|
input.slice(position)
|
|
2297
2297
|
);
|
|
2298
|
-
if (!operation)
|
|
2299
|
-
|
|
2298
|
+
if (!operation) {
|
|
2299
|
+
const token = _nullishCoalesce(_nullishCoalesce(_optionalChain([/^(?:[=!<>~]+|[A-Za-z_]+)/, 'access', _69 => _69.exec, 'call', _70 => _70(input.slice(position)), 'optionalAccess', _71 => _71[0]]), () => ( input[position])), () => ( "<end>"));
|
|
2300
|
+
if (token === "=") {
|
|
2301
|
+
const corrected = `${input.slice(0, position)}==${input.slice(position + 1)}`;
|
|
2302
|
+
fail(
|
|
2303
|
+
`Run event DSL does not support "=" at character ${position + 1}. For equality, replace this "=" with "==": ${JSON.stringify(corrected)}.`
|
|
2304
|
+
);
|
|
2305
|
+
}
|
|
2306
|
+
fail(
|
|
2307
|
+
`Run event DSL does not support ${JSON.stringify(token)} after ${JSON.stringify(match[0])} at character ${position + 1}. Use ==, !=, >, >=, <, <=, in or exists.`
|
|
2308
|
+
);
|
|
2309
|
+
}
|
|
2300
2310
|
position += operation[0].length;
|
|
2301
2311
|
const symbols = {
|
|
2302
2312
|
"==": "eq",
|
|
@@ -2365,7 +2375,7 @@ function normalizeRunEventQueryTimestamp(value) {
|
|
|
2365
2375
|
return /[1-9]/.test(extraMicros) ? canonical2.replace(/Z$/, `${extraMicros}Z`) : canonical2;
|
|
2366
2376
|
}
|
|
2367
2377
|
function timestampMicros(value) {
|
|
2368
|
-
const fraction = _nullishCoalesce(_optionalChain([/\.(\d+)Z$/, 'access',
|
|
2378
|
+
const fraction = _nullishCoalesce(_optionalChain([/\.(\d+)Z$/, 'access', _72 => _72.exec, 'call', _73 => _73(value), 'optionalAccess', _74 => _74[1]]), () => ( ""));
|
|
2369
2379
|
return BigInt(Date.parse(value)) * BigInt(1e3) + BigInt(fraction.padEnd(6, "0").slice(3));
|
|
2370
2380
|
}
|
|
2371
2381
|
function time(value, nowMs, fallback) {
|
|
@@ -2598,7 +2608,7 @@ function parseNotificationGroupTarget(value) {
|
|
|
2598
2608
|
}
|
|
2599
2609
|
return { kind: "email", email };
|
|
2600
2610
|
}
|
|
2601
|
-
const slack = _optionalChain([/^slack:(.+)$/i, 'access',
|
|
2611
|
+
const slack = _optionalChain([/^slack:(.+)$/i, 'access', _75 => _75.exec, 'call', _76 => _76(normalized), 'optionalAccess', _77 => _77[1], 'optionalAccess', _78 => _78.trim, 'call', _79 => _79()]);
|
|
2602
2612
|
if (!slack) {
|
|
2603
2613
|
const provider = normalized.split(":", 1)[0] || normalized;
|
|
2604
2614
|
throw new Error(
|
|
@@ -2606,7 +2616,7 @@ function parseNotificationGroupTarget(value) {
|
|
|
2606
2616
|
);
|
|
2607
2617
|
}
|
|
2608
2618
|
const member = /^member:([UW][A-Z0-9]{8,})$/i.exec(slack);
|
|
2609
|
-
if (_optionalChain([member, 'optionalAccess',
|
|
2619
|
+
if (_optionalChain([member, 'optionalAccess', _80 => _80[1]])) {
|
|
2610
2620
|
return { kind: "slack", memberId: member[1].toUpperCase() };
|
|
2611
2621
|
}
|
|
2612
2622
|
if (slack.toLowerCase().startsWith("member:")) {
|
|
@@ -2653,10 +2663,10 @@ function resolvePlayRunRuntimeSelection(request) {
|
|
|
2653
2663
|
}
|
|
2654
2664
|
return runtime;
|
|
2655
2665
|
}
|
|
2656
|
-
const configured = _optionalChain([process, 'access',
|
|
2657
|
-
const configuredNamespace = _optionalChain([process, 'access',
|
|
2658
|
-
const configuredToken = _optionalChain([process, 'access',
|
|
2659
|
-
const configuredPlacementPolicy = _optionalChain([process, 'access',
|
|
2666
|
+
const configured = _optionalChain([process, 'access', _81 => _81.env, 'access', _82 => _82.DEEPLINE_RUNTIME_ENVIRONMENT, 'optionalAccess', _83 => _83.trim, 'call', _84 => _84()]);
|
|
2667
|
+
const configuredNamespace = _optionalChain([process, 'access', _85 => _85.env, 'access', _86 => _86.DEEPLINE_RUNTIME_NAMESPACE, 'optionalAccess', _87 => _87.trim, 'call', _88 => _88()]);
|
|
2668
|
+
const configuredToken = _optionalChain([process, 'access', _89 => _89.env, 'access', _90 => _90.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _91 => _91.trim, 'call', _92 => _92()]);
|
|
2669
|
+
const configuredPlacementPolicy = _optionalChain([process, 'access', _93 => _93.env, 'access', _94 => _94.DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY, 'optionalAccess', _95 => _95.trim, 'call', _96 => _96()]);
|
|
2660
2670
|
if (!configured) {
|
|
2661
2671
|
if (configuredNamespace || configuredToken || configuredPlacementPolicy) {
|
|
2662
2672
|
const present = [];
|
|
@@ -2695,7 +2705,7 @@ function resolvePlayRunRuntimeSelection(request) {
|
|
|
2695
2705
|
"INVALID_RUNTIME_NAMESPACE"
|
|
2696
2706
|
);
|
|
2697
2707
|
}
|
|
2698
|
-
const configuredBackendValue = _optionalChain([process, 'access',
|
|
2708
|
+
const configuredBackendValue = _optionalChain([process, 'access', _97 => _97.env, 'access', _98 => _98.DEEPLINE_PLAY_RUNNER_BACKEND, 'optionalAccess', _99 => _99.trim, 'call', _100 => _100()]);
|
|
2699
2709
|
const configuredBackend = configuredBackendValue === "daytona" || configuredBackendValue === "modal" ? configuredBackendValue : void 0;
|
|
2700
2710
|
if (configuredBackendValue && !configuredBackend) {
|
|
2701
2711
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
@@ -2733,7 +2743,7 @@ function resolveStartPlayRunRequest(request) {
|
|
|
2733
2743
|
}
|
|
2734
2744
|
function runtimeSelectionHeaders(runtime) {
|
|
2735
2745
|
if (!runtime) return void 0;
|
|
2736
|
-
const token = _optionalChain([process, 'access',
|
|
2746
|
+
const token = _optionalChain([process, 'access', _101 => _101.env, 'access', _102 => _102.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _103 => _103.trim, 'call', _104 => _104()]);
|
|
2737
2747
|
if (!token) {
|
|
2738
2748
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
2739
2749
|
"DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN is required for explicit preview runtime selection.",
|
|
@@ -2741,18 +2751,18 @@ function runtimeSelectionHeaders(runtime) {
|
|
|
2741
2751
|
"RUNTIME_ENVIRONMENT_TOKEN_REQUIRED"
|
|
2742
2752
|
);
|
|
2743
2753
|
}
|
|
2744
|
-
const receivers = _optionalChain([process, 'access',
|
|
2754
|
+
const receivers = _optionalChain([process, 'access', _105 => _105.env, 'access', _106 => _106.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _107 => _107.trim, 'call', _108 => _108()]);
|
|
2745
2755
|
return {
|
|
2746
|
-
[
|
|
2747
|
-
...receivers ? { [
|
|
2756
|
+
[_chunkURVZGYGGjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
|
|
2757
|
+
...receivers ? { [_chunkURVZGYGGjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
|
|
2748
2758
|
};
|
|
2749
2759
|
}
|
|
2750
2760
|
function isolatedCiRuntimeEventReadHeaders() {
|
|
2751
|
-
const schema = _optionalChain([process, 'access',
|
|
2752
|
-
if (_optionalChain([process, 'access',
|
|
2761
|
+
const schema = _optionalChain([process, 'access', _109 => _109.env, 'access', _110 => _110.DEEPLINE_RUNTIME_SCHEDULER_SCHEMA, 'optionalAccess', _111 => _111.trim, 'call', _112 => _112()]);
|
|
2762
|
+
if (_optionalChain([process, 'access', _113 => _113.env, 'access', _114 => _114.DEEPLINE_SYNTHETIC_RUN, 'optionalAccess', _115 => _115.trim, 'call', _116 => _116()]) !== "1" || !schema || !/^fly_absurd_pr_\d+_\d+(?:_\d+)?$/.test(schema)) {
|
|
2753
2763
|
return void 0;
|
|
2754
2764
|
}
|
|
2755
|
-
const token = _optionalChain([process, 'access',
|
|
2765
|
+
const token = _optionalChain([process, 'access', _117 => _117.env, 'access', _118 => _118.DEEPLINE_INTERNAL_TOKEN, 'optionalAccess', _119 => _119.trim, 'call', _120 => _120()]);
|
|
2756
2766
|
if (!token) {
|
|
2757
2767
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
2758
2768
|
"DEEPLINE_INTERNAL_TOKEN is required for isolated CI runtime event reads.",
|
|
@@ -2760,7 +2770,7 @@ function isolatedCiRuntimeEventReadHeaders() {
|
|
|
2760
2770
|
"RUNTIME_EVENT_INTERNAL_TOKEN_REQUIRED"
|
|
2761
2771
|
);
|
|
2762
2772
|
}
|
|
2763
|
-
return { [
|
|
2773
|
+
return { [_chunkURVZGYGGjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
|
|
2764
2774
|
}
|
|
2765
2775
|
function normalizeTestPolicyOverrides(value, source) {
|
|
2766
2776
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
@@ -2773,8 +2783,8 @@ function normalizeTestPolicyOverrides(value, source) {
|
|
|
2773
2783
|
);
|
|
2774
2784
|
}
|
|
2775
2785
|
function parseEnvTestPolicyOverrides() {
|
|
2776
|
-
const raw = typeof process !== "undefined" ? _optionalChain([process, 'access',
|
|
2777
|
-
const trimmed = _optionalChain([raw, 'optionalAccess',
|
|
2786
|
+
const raw = typeof process !== "undefined" ? _optionalChain([process, 'access', _121 => _121.env, 'optionalAccess', _122 => _122.DEEPLINE_TEST_POLICY_OVERRIDES]) : void 0;
|
|
2787
|
+
const trimmed = _optionalChain([raw, 'optionalAccess', _123 => _123.trim, 'call', _124 => _124()]);
|
|
2778
2788
|
if (!trimmed) return void 0;
|
|
2779
2789
|
let parsed;
|
|
2780
2790
|
try {
|
|
@@ -2802,7 +2812,7 @@ function isTransientCompileManifestError(error) {
|
|
|
2802
2812
|
);
|
|
2803
2813
|
}
|
|
2804
2814
|
function requireCompileManifestResponse(response, playName) {
|
|
2805
|
-
const compilerManifest = _optionalChain([response, 'optionalAccess',
|
|
2815
|
+
const compilerManifest = _optionalChain([response, 'optionalAccess', _125 => _125.compilerManifest]);
|
|
2806
2816
|
if (!compilerManifest || typeof compilerManifest !== "object" || Array.isArray(compilerManifest)) {
|
|
2807
2817
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
2808
2818
|
`Compile manifest response did not include compilerManifest for ${playName}.`,
|
|
@@ -2854,7 +2864,7 @@ function chunkRegisterPlayArtifacts(artifacts) {
|
|
|
2854
2864
|
}
|
|
2855
2865
|
function searchParams(options) {
|
|
2856
2866
|
const params = new URLSearchParams();
|
|
2857
|
-
params.set("q", _nullishCoalesce(_optionalChain([options, 'access',
|
|
2867
|
+
params.set("q", _nullishCoalesce(_optionalChain([options, 'access', _126 => _126.query, 'optionalAccess', _127 => _127.trim, 'call', _128 => _128()]), () => ( "")));
|
|
2858
2868
|
params.set(
|
|
2859
2869
|
"include_search_debug",
|
|
2860
2870
|
options.includeSearchDebug ? "true" : "false"
|
|
@@ -2864,13 +2874,13 @@ function searchParams(options) {
|
|
|
2864
2874
|
if (options.offset !== void 0) {
|
|
2865
2875
|
params.set("offset", String(options.offset));
|
|
2866
2876
|
}
|
|
2867
|
-
if (_optionalChain([options, 'access',
|
|
2877
|
+
if (_optionalChain([options, 'access', _129 => _129.categories, 'optionalAccess', _130 => _130.trim, 'call', _131 => _131()])) {
|
|
2868
2878
|
params.set("categories", options.categories.trim());
|
|
2869
2879
|
}
|
|
2870
|
-
if (_optionalChain([options, 'access',
|
|
2880
|
+
if (_optionalChain([options, 'access', _132 => _132.searchTerms, 'optionalAccess', _133 => _133.trim, 'call', _134 => _134()])) {
|
|
2871
2881
|
params.set("search_terms", options.searchTerms.trim());
|
|
2872
2882
|
}
|
|
2873
|
-
if (_optionalChain([options, 'access',
|
|
2883
|
+
if (_optionalChain([options, 'access', _135 => _135.task, 'optionalAccess', _136 => _136.trim, 'call', _137 => _137()])) params.set("task", options.task.trim());
|
|
2874
2884
|
return params;
|
|
2875
2885
|
}
|
|
2876
2886
|
var RUNS_FAILED_LOG_LIMIT = 20;
|
|
@@ -2920,17 +2930,17 @@ function preferPrebuiltPlayDescriptions(plays) {
|
|
|
2920
2930
|
}
|
|
2921
2931
|
function normalizePlayStatus(raw) {
|
|
2922
2932
|
const runPackage = _chunkLA46MMTLjs.isPlayRunPackage.call(void 0, raw) ? raw : _chunkLA46MMTLjs.isPlayRunPackage.call(void 0, raw.package) ? raw.package : null;
|
|
2923
|
-
const packageRun = _optionalChain([runPackage, 'optionalAccess',
|
|
2924
|
-
const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess',
|
|
2933
|
+
const packageRun = _optionalChain([runPackage, 'optionalAccess', _138 => _138.run]);
|
|
2934
|
+
const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess', _139 => _139.status]) === "string" ? packageRun.status : null;
|
|
2925
2935
|
const status = _chunkLA46MMTLjs.decodePlayRunPublicStatus.call(void 0, rawStatus);
|
|
2926
2936
|
if (!status) {
|
|
2927
2937
|
throw new Error(
|
|
2928
2938
|
`Invalid play run lifecycle status in API response: ${JSON.stringify(rawStatus)}.`
|
|
2929
2939
|
);
|
|
2930
2940
|
}
|
|
2931
|
-
const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess',
|
|
2932
|
-
const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess',
|
|
2933
|
-
const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess',
|
|
2941
|
+
const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess', _140 => _140.id]), () => ( ""));
|
|
2942
|
+
const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _141 => _141.overview]), () => ( raw.overview));
|
|
2943
|
+
const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _142 => _142.runStatus]), () => ( raw.runStatus));
|
|
2934
2944
|
return {
|
|
2935
2945
|
...raw,
|
|
2936
2946
|
runId,
|
|
@@ -3032,9 +3042,9 @@ function playRunResultFromStatus(status, startedAt, fallbackRunId) {
|
|
|
3032
3042
|
runId: status.runId || fallbackRunId,
|
|
3033
3043
|
result: _nullishCoalesce(status.package, () => ( status.result)),
|
|
3034
3044
|
...status.package ? { package: status.package } : {},
|
|
3035
|
-
logs: _nullishCoalesce(_optionalChain([status, 'access',
|
|
3045
|
+
logs: _nullishCoalesce(_optionalChain([status, 'access', _143 => _143.progress, 'optionalAccess', _144 => _144.logs]), () => ( [])),
|
|
3036
3046
|
durationMs: Date.now() - startedAt,
|
|
3037
|
-
error: _nullishCoalesce(_optionalChain([status, 'access',
|
|
3047
|
+
error: _nullishCoalesce(_optionalChain([status, 'access', _145 => _145.progress, 'optionalAccess', _146 => _146.error]), () => ( (status.status !== "completed" ? status.status : void 0)))
|
|
3038
3048
|
};
|
|
3039
3049
|
}
|
|
3040
3050
|
var DeeplineClient = (_class = class _DeeplineClient {
|
|
@@ -3061,12 +3071,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3061
3071
|
* @throws {@link ConfigError} if no API key can be resolved from any source.
|
|
3062
3072
|
*/
|
|
3063
3073
|
constructor(options) {
|
|
3064
|
-
this.config =
|
|
3065
|
-
this.http = new (0,
|
|
3074
|
+
this.config = _chunkURVZGYGGjs.resolveConfig.call(void 0, options);
|
|
3075
|
+
this.http = new (0, _chunkURVZGYGGjs.HttpClient)(this.config);
|
|
3066
3076
|
this.toolCalls = new ToolCalls(
|
|
3067
3077
|
this.http,
|
|
3068
3078
|
this.config.timeout,
|
|
3069
|
-
_optionalChain([options, 'optionalAccess',
|
|
3079
|
+
_optionalChain([options, 'optionalAccess', _147 => _147.timeout])
|
|
3070
3080
|
);
|
|
3071
3081
|
this.runs = {
|
|
3072
3082
|
getReceipts: (runId, options2) => this.getRunReceipts(runId, options2),
|
|
@@ -3125,7 +3135,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3125
3135
|
{},
|
|
3126
3136
|
{
|
|
3127
3137
|
"Idempotency-Key": requireTargetBillingIdempotencyKey(
|
|
3128
|
-
_nullishCoalesce(_optionalChain([options2, 'optionalAccess',
|
|
3138
|
+
_nullishCoalesce(_optionalChain([options2, 'optionalAccess', _148 => _148.idempotencyKey]), () => ( globalThis.crypto.randomUUID()))
|
|
3129
3139
|
)
|
|
3130
3140
|
}
|
|
3131
3141
|
),
|
|
@@ -3144,7 +3154,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3144
3154
|
available: (toolIdOrOptions, options2) => this.getMonitorsAvailable(toolIdOrOptions, options2),
|
|
3145
3155
|
check: (definition) => this.checkMonitor(definition),
|
|
3146
3156
|
deploy: (definition, options2) => this.deployMonitor(definition, options2),
|
|
3147
|
-
sync: (definition, options2) => _optionalChain([options2, 'optionalAccess',
|
|
3157
|
+
sync: (definition, options2) => _optionalChain([options2, 'optionalAccess', _149 => _149.dryRun]) ? this.deployMonitor(definition, { dryRun: true }) : this.syncScalarMonitor(definition, options2),
|
|
3148
3158
|
list: (options2) => this.listMonitors(options2),
|
|
3149
3159
|
get: (key) => this.getMonitor(key),
|
|
3150
3160
|
test: (key, payload, options2) => this.testMonitorWebhook(key, payload, options2),
|
|
@@ -3153,13 +3163,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3153
3163
|
update: (key, patch) => this.updateMonitor(key, patch),
|
|
3154
3164
|
delete: (key, options2) => this.deleteMonitor(key, options2),
|
|
3155
3165
|
reactivate: (key, options2) => this.reactivateMonitor(key, options2),
|
|
3156
|
-
start: (key, options2) => _optionalChain([options2, 'optionalAccess',
|
|
3166
|
+
start: (key, options2) => _optionalChain([options2, 'optionalAccess', _150 => _150.dryRun]) ? this.submitMonitorBatch({
|
|
3157
3167
|
kind: "reactivate",
|
|
3158
3168
|
scope: { kind: "keys", monitorKeys: [key] },
|
|
3159
3169
|
dryRun: true,
|
|
3160
3170
|
idempotencyKey: _nullishCoalesce(options2.idempotencyKey, () => ( this.monitorJobIdempotencyKey(`start-${key}`)))
|
|
3161
3171
|
}) : this.submitScalarMonitorLifecycle(key, "start", options2),
|
|
3162
|
-
stop: (key, options2) => _optionalChain([options2, 'optionalAccess',
|
|
3172
|
+
stop: (key, options2) => _optionalChain([options2, 'optionalAccess', _151 => _151.dryRun]) ? this.submitMonitorBatch({
|
|
3163
3173
|
kind: "deactivate",
|
|
3164
3174
|
scope: { kind: "keys", monitorKeys: [key] },
|
|
3165
3175
|
dryRun: true,
|
|
@@ -3210,7 +3220,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3210
3220
|
type: _nullishCoalesce(field.type, () => ( void 0)),
|
|
3211
3221
|
required: _nullishCoalesce(field.required, () => ( void 0))
|
|
3212
3222
|
} : null
|
|
3213
|
-
).filter((field) => Boolean(_optionalChain([field, 'optionalAccess',
|
|
3223
|
+
).filter((field) => Boolean(_optionalChain([field, 'optionalAccess', _152 => _152.name]))) : [];
|
|
3214
3224
|
return fields.length > 0 ? { fields } : schema;
|
|
3215
3225
|
}
|
|
3216
3226
|
schemaMetadata(schema, key) {
|
|
@@ -3240,13 +3250,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3240
3250
|
};
|
|
3241
3251
|
}
|
|
3242
3252
|
summarizePlayListItem(play, options) {
|
|
3243
|
-
const aliases = _optionalChain([play, 'access',
|
|
3253
|
+
const aliases = _optionalChain([play, 'access', _153 => _153.aliases, 'optionalAccess', _154 => _154.length]) ? play.aliases : [play.name];
|
|
3244
3254
|
const csvInput = this.schemaMetadata(play.inputSchema, "csvInput");
|
|
3245
3255
|
const rowOutputSchema = this.schemaMetadata(
|
|
3246
3256
|
play.outputSchema,
|
|
3247
3257
|
"rowOutputSchema"
|
|
3248
3258
|
);
|
|
3249
|
-
const description = _optionalChain([play, 'access',
|
|
3259
|
+
const description = _optionalChain([play, 'access', _155 => _155.description, 'optionalAccess', _156 => _156.trim, 'call', _157 => _157()]) || _optionalChain([play, 'access', _158 => _158.currentRevision, 'optionalAccess', _159 => _159.description, 'optionalAccess', _160 => _160.trim, 'call', _161 => _161()]) || _optionalChain([play, 'access', _162 => _162.liveRevision, 'optionalAccess', _163 => _163.description, 'optionalAccess', _164 => _164.trim, 'call', _165 => _165()]) || null;
|
|
3250
3260
|
const runCommand = this.playRunCommand(play);
|
|
3251
3261
|
const cloneEditStarter = this.playCloneEditStarter(play);
|
|
3252
3262
|
return {
|
|
@@ -3266,9 +3276,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3266
3276
|
canEdit: play.canEdit,
|
|
3267
3277
|
canClone: play.canClone,
|
|
3268
3278
|
aliases,
|
|
3269
|
-
inputSchema: _optionalChain([options, 'optionalAccess',
|
|
3270
|
-
outputSchema: _optionalChain([options, 'optionalAccess',
|
|
3271
|
-
staticPipeline: isRecord2(play.staticPipeline) ? play.staticPipeline : isRecord2(_optionalChain([play, 'access',
|
|
3279
|
+
inputSchema: _optionalChain([options, 'optionalAccess', _166 => _166.compact]) ? this.compactSchema(play.inputSchema) : _nullishCoalesce(play.inputSchema, () => ( null)),
|
|
3280
|
+
outputSchema: _optionalChain([options, 'optionalAccess', _167 => _167.compact]) ? this.compactSchema(play.outputSchema) : _nullishCoalesce(play.outputSchema, () => ( null)),
|
|
3281
|
+
staticPipeline: isRecord2(play.staticPipeline) ? play.staticPipeline : isRecord2(_optionalChain([play, 'access', _168 => _168.currentRevision, 'optionalAccess', _169 => _169.staticPipeline])) ? play.currentRevision.staticPipeline : isRecord2(_optionalChain([play, 'access', _170 => _170.liveRevision, 'optionalAccess', _171 => _171.staticPipeline])) ? play.liveRevision.staticPipeline : null,
|
|
3272
3282
|
...csvInput ? {
|
|
3273
3283
|
csvInput: { ...csvInput, headerMatching: CSV_HEADER_MATCHING_NOTE }
|
|
3274
3284
|
} : {},
|
|
@@ -3280,7 +3290,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3280
3290
|
// Read the live version off the live revision. It was previously only
|
|
3281
3291
|
// ever written by the publish/live routes, so every list and describe
|
|
3282
3292
|
// payload reported liveVersion: null even for an actively serving play.
|
|
3283
|
-
liveVersion: _nullishCoalesce(_optionalChain([play, 'access',
|
|
3293
|
+
liveVersion: _nullishCoalesce(_optionalChain([play, 'access', _172 => _172.liveRevision, 'optionalAccess', _173 => _173.version]), () => ( null)),
|
|
3284
3294
|
...play.triggerStatus ? { triggerStatus: play.triggerStatus } : {},
|
|
3285
3295
|
isDraftDirty: play.isDraftDirty
|
|
3286
3296
|
};
|
|
@@ -3289,8 +3299,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3289
3299
|
const play = detail.play;
|
|
3290
3300
|
return {
|
|
3291
3301
|
...this.summarizePlayListItem(play, options),
|
|
3292
|
-
currentPublishedVersion: _nullishCoalesce(_nullishCoalesce(play.currentPublishedVersion, () => ( _optionalChain([play, 'access',
|
|
3293
|
-
latestRunId: _nullishCoalesce(_nullishCoalesce(play.latestRunId, () => ( _optionalChain([detail, 'access',
|
|
3302
|
+
currentPublishedVersion: _nullishCoalesce(_nullishCoalesce(play.currentPublishedVersion, () => ( _optionalChain([play, 'access', _174 => _174.liveRevision, 'optionalAccess', _175 => _175.version]))), () => ( null)),
|
|
3303
|
+
latestRunId: _nullishCoalesce(_nullishCoalesce(play.latestRunId, () => ( _optionalChain([detail, 'access', _176 => _176.latestRuns, 'access', _177 => _177[0], 'optionalAccess', _178 => _178.workflowId]))), () => ( null)),
|
|
3294
3304
|
...play.triggerMetadata ? { triggerMetadata: play.triggerMetadata } : {},
|
|
3295
3305
|
...play.runtimeLimit ? { runtimeLimit: play.runtimeLimit } : {},
|
|
3296
3306
|
...play.activeScheduledPlays ? { activeScheduledPlays: play.activeScheduledPlays } : {}
|
|
@@ -3357,17 +3367,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3357
3367
|
*/
|
|
3358
3368
|
async listTools(options) {
|
|
3359
3369
|
const params = new URLSearchParams();
|
|
3360
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3370
|
+
if (_optionalChain([options, 'optionalAccess', _179 => _179.categories, 'optionalAccess', _180 => _180.trim, 'call', _181 => _181()])) {
|
|
3361
3371
|
params.set("categories", options.categories.trim());
|
|
3362
3372
|
}
|
|
3363
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3373
|
+
if (_optionalChain([options, 'optionalAccess', _182 => _182.tags, 'optionalAccess', _183 => _183.trim, 'call', _184 => _184()])) {
|
|
3364
3374
|
params.set("tags", options.tags.trim());
|
|
3365
3375
|
}
|
|
3366
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3376
|
+
if (_optionalChain([options, 'optionalAccess', _185 => _185.grep, 'optionalAccess', _186 => _186.trim, 'call', _187 => _187()])) {
|
|
3367
3377
|
params.set("grep", options.grep.trim());
|
|
3368
3378
|
params.set("grep_mode", _nullishCoalesce(options.grepMode, () => ( "all")));
|
|
3369
3379
|
}
|
|
3370
|
-
params.set("compact", _optionalChain([options, 'optionalAccess',
|
|
3380
|
+
params.set("compact", _optionalChain([options, 'optionalAccess', _188 => _188.compact]) === true ? "true" : "false");
|
|
3371
3381
|
const suffix = params.toString() ? `?${params.toString()}` : "";
|
|
3372
3382
|
const res = await this.http.get(
|
|
3373
3383
|
`/api/v2/tools${suffix}`
|
|
@@ -3376,7 +3386,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3376
3386
|
}
|
|
3377
3387
|
/** List discoverable providers without requiring a local plugin catalog. */
|
|
3378
3388
|
async listProviders(options) {
|
|
3379
|
-
const suffix = _optionalChain([options, 'optionalAccess',
|
|
3389
|
+
const suffix = _optionalChain([options, 'optionalAccess', _189 => _189.changed]) ? "?changed=true" : "";
|
|
3380
3390
|
const res = await this.http.get(
|
|
3381
3391
|
`/api/v2/tools/providers${suffix}`
|
|
3382
3392
|
);
|
|
@@ -3407,8 +3417,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3407
3417
|
*/
|
|
3408
3418
|
async search(options = {}) {
|
|
3409
3419
|
const params = searchParams(options);
|
|
3410
|
-
if (_optionalChain([options, 'access',
|
|
3411
|
-
if (_optionalChain([options, 'access',
|
|
3420
|
+
if (_optionalChain([options, 'access', _190 => _190.types, 'optionalAccess', _191 => _191.length])) params.set("types", options.types.join(","));
|
|
3421
|
+
if (_optionalChain([options, 'access', _192 => _192.exclude, 'optionalAccess', _193 => _193.length])) {
|
|
3412
3422
|
params.set("exclude", options.exclude.join(","));
|
|
3413
3423
|
}
|
|
3414
3424
|
return this.http.get(`/api/v2/search?${params.toString()}`);
|
|
@@ -3430,7 +3440,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3430
3440
|
* ```
|
|
3431
3441
|
*/
|
|
3432
3442
|
async getTool(toolId, options) {
|
|
3433
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3443
|
+
if (_optionalChain([options, 'optionalAccess', _194 => _194.cliInvocationId]) !== void 0) {
|
|
3434
3444
|
validateCliInvocationId(options.cliInvocationId);
|
|
3435
3445
|
}
|
|
3436
3446
|
return this.http.request(
|
|
@@ -3443,7 +3453,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3443
3453
|
retryApiErrors: true,
|
|
3444
3454
|
headers: {
|
|
3445
3455
|
"x-deepline-tool-meta-only": "1",
|
|
3446
|
-
..._optionalChain([options, 'optionalAccess',
|
|
3456
|
+
..._optionalChain([options, 'optionalAccess', _195 => _195.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
|
|
3447
3457
|
}
|
|
3448
3458
|
}
|
|
3449
3459
|
);
|
|
@@ -3545,7 +3555,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3545
3555
|
return this.http.post(
|
|
3546
3556
|
"/api/v2/ingestion/repair",
|
|
3547
3557
|
{
|
|
3548
|
-
..._optionalChain([input, 'optionalAccess',
|
|
3558
|
+
..._optionalChain([input, 'optionalAccess', _196 => _196.provider]) ? { provider: input.provider } : {}
|
|
3549
3559
|
}
|
|
3550
3560
|
);
|
|
3551
3561
|
}
|
|
@@ -3615,7 +3625,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3615
3625
|
method: "POST",
|
|
3616
3626
|
body,
|
|
3617
3627
|
headers: runtimeSelectionHeaders(resolved.runtime),
|
|
3618
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
3628
|
+
signal: _optionalChain([options, 'optionalAccess', _197 => _197.signal])
|
|
3619
3629
|
}
|
|
3620
3630
|
)) {
|
|
3621
3631
|
if (event.scope === "play") {
|
|
@@ -3775,7 +3785,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3775
3785
|
compilerManifest,
|
|
3776
3786
|
...input.input ? { input: input.input } : {},
|
|
3777
3787
|
...input.inputFile ? { inputFile: input.inputFile } : {},
|
|
3778
|
-
..._optionalChain([input, 'access',
|
|
3788
|
+
..._optionalChain([input, 'access', _198 => _198.packagedFiles, 'optionalAccess', _199 => _199.length]) ? { packagedFiles: input.packagedFiles } : {},
|
|
3779
3789
|
...input.force ? { force: true } : {},
|
|
3780
3790
|
...input.forceToolRefresh ? { forceToolRefresh: true } : {}
|
|
3781
3791
|
});
|
|
@@ -3805,29 +3815,29 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3805
3815
|
* ```
|
|
3806
3816
|
*/
|
|
3807
3817
|
async submitPlay(code, csvPath, name, options) {
|
|
3808
|
-
const runtimeInput = _optionalChain([options, 'optionalAccess',
|
|
3818
|
+
const runtimeInput = _optionalChain([options, 'optionalAccess', _200 => _200.input]) ? { ...options.input } : {};
|
|
3809
3819
|
if (csvPath) {
|
|
3810
3820
|
runtimeInput.file = csvPath;
|
|
3811
3821
|
}
|
|
3812
|
-
const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3813
|
-
const artifact = _optionalChain([options, 'optionalAccess',
|
|
3814
|
-
if (!_optionalChain([name, 'optionalAccess',
|
|
3822
|
+
const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _201 => _201.sourceCode]), () => ( code));
|
|
3823
|
+
const artifact = _optionalChain([options, 'optionalAccess', _202 => _202.artifact]);
|
|
3824
|
+
if (!_optionalChain([name, 'optionalAccess', _203 => _203.trim, 'call', _204 => _204()])) {
|
|
3815
3825
|
throw new Error("submitPlay requires a play name.");
|
|
3816
3826
|
}
|
|
3817
3827
|
if (!artifact) {
|
|
3818
3828
|
throw new Error("submitPlay requires a bundled play artifact.");
|
|
3819
3829
|
}
|
|
3820
|
-
const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async
|
|
3830
|
+
const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _205 => _205.compilerManifest]), async () => ( await this.compilePlayManifest({
|
|
3821
3831
|
name,
|
|
3822
3832
|
sourceCode,
|
|
3823
|
-
sourceFiles: _optionalChain([options, 'optionalAccess',
|
|
3833
|
+
sourceFiles: _optionalChain([options, 'optionalAccess', _206 => _206.sourceFiles]),
|
|
3824
3834
|
artifact
|
|
3825
3835
|
})));
|
|
3826
3836
|
const registeredArtifact = await this.registerPlayArtifact({
|
|
3827
3837
|
name,
|
|
3828
3838
|
sourceCode,
|
|
3829
|
-
sourceFiles: _optionalChain([options, 'optionalAccess',
|
|
3830
|
-
description: _optionalChain([options, 'optionalAccess',
|
|
3839
|
+
sourceFiles: _optionalChain([options, 'optionalAccess', _207 => _207.sourceFiles]),
|
|
3840
|
+
description: _optionalChain([options, 'optionalAccess', _208 => _208.description]),
|
|
3831
3841
|
artifact,
|
|
3832
3842
|
compilerManifest,
|
|
3833
3843
|
publish: false
|
|
@@ -3841,17 +3851,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3841
3851
|
name,
|
|
3842
3852
|
artifactStorageKey: registeredArtifact.artifactStorageKey,
|
|
3843
3853
|
sourceCode,
|
|
3844
|
-
description: _optionalChain([options, 'optionalAccess',
|
|
3854
|
+
description: _optionalChain([options, 'optionalAccess', _209 => _209.description]),
|
|
3845
3855
|
staticPipeline: _nullishCoalesce(registeredArtifact.staticPipeline, () => ( null)),
|
|
3846
3856
|
artifactHash: typeof artifact.artifactHash === "string" ? artifact.artifactHash : void 0,
|
|
3847
3857
|
graphHash: typeof artifact.graphHash === "string" ? artifact.graphHash : void 0,
|
|
3848
3858
|
runtimeArtifact: artifact,
|
|
3849
3859
|
compilerManifest,
|
|
3850
3860
|
...Object.keys(runtimeInput).length > 0 ? { input: runtimeInput } : {},
|
|
3851
|
-
..._optionalChain([options, 'optionalAccess',
|
|
3852
|
-
..._optionalChain([options, 'optionalAccess',
|
|
3853
|
-
..._optionalChain([options, 'optionalAccess',
|
|
3854
|
-
..._optionalChain([options, 'optionalAccess',
|
|
3861
|
+
..._optionalChain([options, 'optionalAccess', _210 => _210.inputFile]) ? { inputFile: options.inputFile } : {},
|
|
3862
|
+
..._optionalChain([options, 'optionalAccess', _211 => _211.packagedFiles, 'optionalAccess', _212 => _212.length]) ? { packagedFiles: options.packagedFiles } : {},
|
|
3863
|
+
..._optionalChain([options, 'optionalAccess', _213 => _213.force]) ? { force: true } : {},
|
|
3864
|
+
..._optionalChain([options, 'optionalAccess', _214 => _214.forceToolRefresh]) ? { forceToolRefresh: true } : {}
|
|
3855
3865
|
});
|
|
3856
3866
|
}
|
|
3857
3867
|
/**
|
|
@@ -3921,10 +3931,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3921
3931
|
*/
|
|
3922
3932
|
async getPlayStatus(workflowId, options) {
|
|
3923
3933
|
const params = new URLSearchParams();
|
|
3924
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3934
|
+
if (_optionalChain([options, 'optionalAccess', _215 => _215.billing]) === false) {
|
|
3925
3935
|
params.set("billing", "false");
|
|
3926
3936
|
}
|
|
3927
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3937
|
+
if (_optionalChain([options, 'optionalAccess', _216 => _216.full]) === true) {
|
|
3928
3938
|
params.set("full", "true");
|
|
3929
3939
|
}
|
|
3930
3940
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -3938,9 +3948,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3938
3948
|
for await (const event of watchRunEvents({
|
|
3939
3949
|
http: this.http,
|
|
3940
3950
|
runId: workflowId,
|
|
3941
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
3942
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
3943
|
-
onRetry: _optionalChain([options, 'optionalAccess',
|
|
3951
|
+
signal: _optionalChain([options, 'optionalAccess', _217 => _217.signal]),
|
|
3952
|
+
onNotice: _optionalChain([options, 'optionalAccess', _218 => _218.onNotice]),
|
|
3953
|
+
onRetry: _optionalChain([options, 'optionalAccess', _219 => _219.onRetry])
|
|
3944
3954
|
})) {
|
|
3945
3955
|
yield event;
|
|
3946
3956
|
}
|
|
@@ -3952,12 +3962,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3952
3962
|
* @deprecated Use `watchRunEvents` for ordinary run watching.
|
|
3953
3963
|
*/
|
|
3954
3964
|
async *streamPlayRunEvents(workflowId, options) {
|
|
3955
|
-
const headers = _optionalChain([options, 'optionalAccess',
|
|
3965
|
+
const headers = _optionalChain([options, 'optionalAccess', _220 => _220.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
|
|
3956
3966
|
const params = new URLSearchParams();
|
|
3957
|
-
params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3967
|
+
params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _221 => _221.mode]), () => ( "cli")));
|
|
3958
3968
|
for await (const event of this.http.streamSse(
|
|
3959
3969
|
`/api/v2/runs/${encodeURIComponent(workflowId)}/tail?${params.toString()}`,
|
|
3960
|
-
{ signal: _optionalChain([options, 'optionalAccess',
|
|
3970
|
+
{ signal: _optionalChain([options, 'optionalAccess', _222 => _222.signal]), headers }
|
|
3961
3971
|
)) {
|
|
3962
3972
|
if (event.scope === "play") {
|
|
3963
3973
|
yield event;
|
|
@@ -3973,24 +3983,24 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3973
3983
|
*/
|
|
3974
3984
|
async *observeRunEvents(runId, options) {
|
|
3975
3985
|
yield* this.watchRunEvents(runId, {
|
|
3976
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
3977
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
3986
|
+
signal: _optionalChain([options, 'optionalAccess', _223 => _223.signal]),
|
|
3987
|
+
onNotice: _optionalChain([options, 'optionalAccess', _224 => _224.onNotice])
|
|
3978
3988
|
});
|
|
3979
3989
|
}
|
|
3980
3990
|
/** Poll snapshots to terminal status and return the durable package. */
|
|
3981
3991
|
async watchRunToTerminal(runId, options) {
|
|
3982
3992
|
let terminalObserved = false;
|
|
3983
3993
|
for await (const event of this.watchRunEvents(runId, {
|
|
3984
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
3985
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
3986
|
-
onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3994
|
+
signal: _optionalChain([options, 'optionalAccess', _225 => _225.signal]),
|
|
3995
|
+
onNotice: _optionalChain([options, 'optionalAccess', _226 => _226.onNotice]),
|
|
3996
|
+
onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _227 => _227.onRetry]), () => ( _optionalChain([options, 'optionalAccess', _228 => _228.onReconnect])))
|
|
3987
3997
|
})) {
|
|
3988
|
-
_optionalChain([options, 'optionalAccess',
|
|
3998
|
+
_optionalChain([options, 'optionalAccess', _229 => _229.onEvent, 'optionalCall', _230 => _230(event)]);
|
|
3989
3999
|
if (_chunkLA46MMTLjs.isTerminalPlayRunLifecycleStatus.call(void 0, playLiveRunStatus(event))) {
|
|
3990
4000
|
terminalObserved = true;
|
|
3991
4001
|
}
|
|
3992
4002
|
}
|
|
3993
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4003
|
+
if (_optionalChain([options, 'optionalAccess', _231 => _231.signal, 'optionalAccess', _232 => _232.aborted])) {
|
|
3994
4004
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)("Run watch aborted.", void 0, "ABORTED");
|
|
3995
4005
|
}
|
|
3996
4006
|
const refreshed = await this.getRunStatus(runId);
|
|
@@ -4044,7 +4054,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4044
4054
|
async stopPlay(workflowId, options) {
|
|
4045
4055
|
return this.http.post(
|
|
4046
4056
|
`/api/v2/runs/${encodeURIComponent(workflowId)}/stop`,
|
|
4047
|
-
_optionalChain([options, 'optionalAccess',
|
|
4057
|
+
_optionalChain([options, 'optionalAccess', _233 => _233.reason]) ? { reason: options.reason } : {}
|
|
4048
4058
|
);
|
|
4049
4059
|
}
|
|
4050
4060
|
/**
|
|
@@ -4080,7 +4090,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4080
4090
|
/** List the org's workflows. `GET /api/v2/workflows`. */
|
|
4081
4091
|
async listWorkflows(options) {
|
|
4082
4092
|
const params = new URLSearchParams();
|
|
4083
|
-
if (typeof _optionalChain([options, 'optionalAccess',
|
|
4093
|
+
if (typeof _optionalChain([options, 'optionalAccess', _234 => _234.limit]) === "number") {
|
|
4084
4094
|
params.set("limit", String(options.limit));
|
|
4085
4095
|
}
|
|
4086
4096
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4133,7 +4143,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4133
4143
|
/** List a workflow's runs. `GET /api/v2/workflows/:id/runs`. */
|
|
4134
4144
|
async listWorkflowRuns(id, options) {
|
|
4135
4145
|
const params = new URLSearchParams();
|
|
4136
|
-
if (typeof _optionalChain([options, 'optionalAccess',
|
|
4146
|
+
if (typeof _optionalChain([options, 'optionalAccess', _235 => _235.limit]) === "number") {
|
|
4137
4147
|
params.set("limit", String(options.limit));
|
|
4138
4148
|
}
|
|
4139
4149
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4169,10 +4179,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4169
4179
|
*/
|
|
4170
4180
|
async getRunStatus(runId, options) {
|
|
4171
4181
|
const params = new URLSearchParams();
|
|
4172
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4182
|
+
if (_optionalChain([options, 'optionalAccess', _236 => _236.full]) === true) {
|
|
4173
4183
|
params.set("full", "true");
|
|
4174
4184
|
}
|
|
4175
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4185
|
+
if (_optionalChain([options, 'optionalAccess', _237 => _237.configuration]) === true) {
|
|
4176
4186
|
params.set("include", "configuration");
|
|
4177
4187
|
}
|
|
4178
4188
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4180,7 +4190,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4180
4190
|
`/api/v2/runs/${encodeURIComponent(runId)}${query}`,
|
|
4181
4191
|
{ headers: { "x-deepline-run-status": "1" } }
|
|
4182
4192
|
);
|
|
4183
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4193
|
+
if (_optionalChain([options, 'optionalAccess', _238 => _238.configuration]) === true && !Object.hasOwn(response, "contract")) {
|
|
4184
4194
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4185
4195
|
"This server does not support recorded configuration reads.",
|
|
4186
4196
|
void 0,
|
|
@@ -4188,7 +4198,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4188
4198
|
);
|
|
4189
4199
|
}
|
|
4190
4200
|
const status = normalizePlayStatus(response);
|
|
4191
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4201
|
+
if (_optionalChain([options, 'optionalAccess', _239 => _239.failedLogs]) !== true || status.status !== "failed") {
|
|
4192
4202
|
return status;
|
|
4193
4203
|
}
|
|
4194
4204
|
const requestedFailedLogLimit = typeof options.failedLogLimit === "number" && Number.isFinite(options.failedLogLimit) ? Math.max(1, Math.floor(options.failedLogLimit)) : RUNS_FAILED_LOG_LIMIT;
|
|
@@ -4277,7 +4287,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4277
4287
|
/** The same tenant-scoped run history searched by the dashboard and CLI. */
|
|
4278
4288
|
async getRunsHistory(options = {}) {
|
|
4279
4289
|
const params = new URLSearchParams();
|
|
4280
|
-
const search = _optionalChain([options, 'access',
|
|
4290
|
+
const search = _optionalChain([options, 'access', _240 => _240.search, 'optionalAccess', _241 => _241.trim, 'call', _242 => _242()]);
|
|
4281
4291
|
if (search && search.length > 200) {
|
|
4282
4292
|
throw new Error("Run search must be at most 200 characters.");
|
|
4283
4293
|
}
|
|
@@ -4303,15 +4313,25 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4303
4313
|
}
|
|
4304
4314
|
/** Read one run page without discarding server pagination metadata. */
|
|
4305
4315
|
async listRunsPage(options) {
|
|
4306
|
-
const playName = _optionalChain([options, 'access',
|
|
4316
|
+
const playName = _optionalChain([options, 'access', _243 => _243.play, 'optionalAccess', _244 => _244.trim, 'call', _245 => _245()]);
|
|
4307
4317
|
const params = new URLSearchParams();
|
|
4308
4318
|
if (playName) {
|
|
4309
4319
|
params.set("play", playName);
|
|
4310
4320
|
}
|
|
4311
|
-
const status = _optionalChain([options, 'access',
|
|
4321
|
+
const status = _optionalChain([options, 'access', _246 => _246.status, 'optionalAccess', _247 => _247.trim, 'call', _248 => _248()]);
|
|
4312
4322
|
if (status) {
|
|
4313
4323
|
params.set("status", status);
|
|
4314
4324
|
}
|
|
4325
|
+
const node = _optionalChain([options, 'access', _249 => _249.node, 'optionalAccess', _250 => _250.trim, 'call', _251 => _251()]);
|
|
4326
|
+
if (node) {
|
|
4327
|
+
if (!playName)
|
|
4328
|
+
throw new Error("runs.list options.node requires options.play.");
|
|
4329
|
+
if (node.length > 300)
|
|
4330
|
+
throw new Error(
|
|
4331
|
+
"runs.list options.node must be at most 300 characters."
|
|
4332
|
+
);
|
|
4333
|
+
params.set("node", node);
|
|
4334
|
+
}
|
|
4315
4335
|
if (typeof options.limit === "number" && Number.isFinite(options.limit)) {
|
|
4316
4336
|
params.set("limit", String(Math.max(1, Math.floor(options.limit))));
|
|
4317
4337
|
}
|
|
@@ -4376,8 +4396,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4376
4396
|
* different key intentionally starts another rerun.
|
|
4377
4397
|
*/
|
|
4378
4398
|
async rerun(runId, options) {
|
|
4379
|
-
const idempotencyKey = _optionalChain([options, 'optionalAccess',
|
|
4380
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4399
|
+
const idempotencyKey = _optionalChain([options, 'optionalAccess', _252 => _252.idempotencyKey, 'optionalAccess', _253 => _253.trim, 'call', _254 => _254()]);
|
|
4400
|
+
if (_optionalChain([options, 'optionalAccess', _255 => _255.idempotencyKey]) !== void 0 && !idempotencyKey) {
|
|
4381
4401
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4382
4402
|
"runs.rerun idempotencyKey must not be empty.",
|
|
4383
4403
|
void 0,
|
|
@@ -4386,7 +4406,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4386
4406
|
}
|
|
4387
4407
|
return this.http.post(
|
|
4388
4408
|
`/api/v2/runs/${encodeURIComponent(runId)}/rerun`,
|
|
4389
|
-
_optionalChain([options, 'optionalAccess',
|
|
4409
|
+
_optionalChain([options, 'optionalAccess', _256 => _256.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
|
|
4390
4410
|
{ "Idempotency-Key": idempotencyKey || globalThis.crypto.randomUUID() }
|
|
4391
4411
|
);
|
|
4392
4412
|
}
|
|
@@ -4400,21 +4420,21 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4400
4420
|
* ```
|
|
4401
4421
|
*/
|
|
4402
4422
|
async getRunLogs(runId, options) {
|
|
4403
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4423
|
+
if (_optionalChain([options, 'optionalAccess', _257 => _257.all]) === true && options.failed === true) {
|
|
4404
4424
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4405
4425
|
"runs.logs cannot combine all and failed views.",
|
|
4406
4426
|
void 0,
|
|
4407
4427
|
"INVALID_RUN_LOG_VIEW"
|
|
4408
4428
|
);
|
|
4409
4429
|
}
|
|
4410
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4430
|
+
if (_optionalChain([options, 'optionalAccess', _258 => _258.cursor]) !== void 0 && options.failed === true) {
|
|
4411
4431
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4412
4432
|
"runs.logs cannot combine failed with cursor.",
|
|
4413
4433
|
void 0,
|
|
4414
4434
|
"INVALID_RUN_LOG_VIEW"
|
|
4415
4435
|
);
|
|
4416
4436
|
}
|
|
4417
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4437
|
+
if (_optionalChain([options, 'optionalAccess', _259 => _259.failed]) === true) {
|
|
4418
4438
|
const requestedLimit = typeof options.limit === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : RUNS_FAILED_LOG_LIMIT;
|
|
4419
4439
|
const failedLimit = Math.min(RUNS_FAILED_LOG_LIMIT, requestedLimit);
|
|
4420
4440
|
const page = await this.http.get(
|
|
@@ -4439,18 +4459,18 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4439
4459
|
...page.logsTruncated ? { logsTruncated: true } : {}
|
|
4440
4460
|
};
|
|
4441
4461
|
}
|
|
4442
|
-
const beforeSequence = _optionalChain([options, 'optionalAccess',
|
|
4443
|
-
const limit = _optionalChain([options, 'optionalAccess',
|
|
4462
|
+
const beforeSequence = _optionalChain([options, 'optionalAccess', _260 => _260.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
|
|
4463
|
+
const limit = _optionalChain([options, 'optionalAccess', _261 => _261.all]) ? Number.MAX_SAFE_INTEGER : typeof _optionalChain([options, 'optionalAccess', _262 => _262.limit]) === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
|
|
4444
4464
|
const fetchPage = (afterSeq2, pageLimit) => this.http.get(
|
|
4445
4465
|
`/api/v2/runs/${encodeURIComponent(runId)}/logs?afterSeq=${afterSeq2}&limit=${pageLimit}`,
|
|
4446
4466
|
{ retryApiErrors: true }
|
|
4447
4467
|
);
|
|
4448
4468
|
const probe = await fetchPage(0, 1);
|
|
4449
4469
|
const lastStoredSeq = probe.lastStoredSeq;
|
|
4450
|
-
const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access',
|
|
4470
|
+
const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _263 => _263.entries, 'access', _264 => _264[0], 'optionalAccess', _265 => _265.seq]), () => ( null));
|
|
4451
4471
|
const upperSeq = beforeSequence === null ? Number.POSITIVE_INFINITY : Math.min(beforeSequence - 1, lastStoredSeq);
|
|
4452
4472
|
const windowEndSeq = Math.min(upperSeq, lastStoredSeq);
|
|
4453
|
-
let afterSeq = _optionalChain([options, 'optionalAccess',
|
|
4473
|
+
let afterSeq = _optionalChain([options, 'optionalAccess', _266 => _266.all]) ? 0 : Math.max(0, windowEndSeq - limit);
|
|
4454
4474
|
const entries = [];
|
|
4455
4475
|
while (entries.length < limit && afterSeq < upperSeq) {
|
|
4456
4476
|
const page = await fetchPage(
|
|
@@ -4484,7 +4504,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4484
4504
|
hasMore: olderLinesExist,
|
|
4485
4505
|
nextCursor: olderLinesExist ? encodeRunLogsCursor(firstSequence) : null,
|
|
4486
4506
|
entries: entries.map((entry) => entry.line),
|
|
4487
|
-
view: _optionalChain([options, 'optionalAccess',
|
|
4507
|
+
view: _optionalChain([options, 'optionalAccess', _267 => _267.all]) ? "all" : "tail",
|
|
4488
4508
|
...probe.logsTruncated ? { logsTruncated: true } : {}
|
|
4489
4509
|
};
|
|
4490
4510
|
}
|
|
@@ -4645,7 +4665,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4645
4665
|
limit: String(_nullishCoalesce(input.limit, () => ( 5e3))),
|
|
4646
4666
|
offset: String(_nullishCoalesce(input.offset, () => ( 0)))
|
|
4647
4667
|
});
|
|
4648
|
-
if (_optionalChain([input, 'access',
|
|
4668
|
+
if (_optionalChain([input, 'access', _268 => _268.runId, 'optionalAccess', _269 => _269.trim, 'call', _270 => _270()])) {
|
|
4649
4669
|
params.set("runId", input.runId.trim());
|
|
4650
4670
|
}
|
|
4651
4671
|
if (input.rowMode === "all" || input.rowMode === "live") {
|
|
@@ -4655,9 +4675,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4655
4675
|
`/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`,
|
|
4656
4676
|
{ signal: input.signal }
|
|
4657
4677
|
);
|
|
4658
|
-
const requestedRunId = _optionalChain([input, 'access',
|
|
4678
|
+
const requestedRunId = _optionalChain([input, 'access', _271 => _271.runId, 'optionalAccess', _272 => _272.trim, 'call', _273 => _273()]) || "";
|
|
4659
4679
|
if (requestedRunId) {
|
|
4660
|
-
const confirmedRunId = _optionalChain([result, 'access',
|
|
4680
|
+
const confirmedRunId = _optionalChain([result, 'access', _274 => _274.scope, 'optionalAccess', _275 => _275.kind]) === "run" ? result.scope.runId.trim() : "";
|
|
4661
4681
|
const foreignRowRunIds = [
|
|
4662
4682
|
...new Set(
|
|
4663
4683
|
result.rows.map(
|
|
@@ -4665,7 +4685,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4665
4685
|
).filter((runId) => runId && runId !== requestedRunId)
|
|
4666
4686
|
)
|
|
4667
4687
|
];
|
|
4668
|
-
if (_optionalChain([result, 'access',
|
|
4688
|
+
if (_optionalChain([result, 'access', _276 => _276.scope, 'optionalAccess', _277 => _277.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
|
|
4669
4689
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4670
4690
|
`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.`,
|
|
4671
4691
|
void 0,
|
|
@@ -4694,7 +4714,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4694
4714
|
async stopRun(runId, options) {
|
|
4695
4715
|
return this.http.post(
|
|
4696
4716
|
`/api/v2/runs/${encodeURIComponent(runId)}/stop`,
|
|
4697
|
-
_optionalChain([options, 'optionalAccess',
|
|
4717
|
+
_optionalChain([options, 'optionalAccess', _278 => _278.reason]) ? { reason: options.reason } : {}
|
|
4698
4718
|
);
|
|
4699
4719
|
}
|
|
4700
4720
|
/**
|
|
@@ -4712,11 +4732,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4712
4732
|
* need to clear the workspace run-slot state without knowing each run id.
|
|
4713
4733
|
*/
|
|
4714
4734
|
async stopAllRuns(options) {
|
|
4715
|
-
const dryRun = _optionalChain([options, 'optionalAccess',
|
|
4735
|
+
const dryRun = _optionalChain([options, 'optionalAccess', _279 => _279.dryRun]) === true;
|
|
4716
4736
|
const result = await this.http.post(
|
|
4717
4737
|
"/api/v2/runs/stop-all",
|
|
4718
4738
|
{
|
|
4719
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4739
|
+
..._optionalChain([options, 'optionalAccess', _280 => _280.reason]) ? { reason: options.reason } : {},
|
|
4720
4740
|
...dryRun ? { dryRun: true } : {}
|
|
4721
4741
|
}
|
|
4722
4742
|
);
|
|
@@ -4737,7 +4757,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4737
4757
|
* `origin: "owned"` for org-owned plays.
|
|
4738
4758
|
*/
|
|
4739
4759
|
async listPlays(options) {
|
|
4740
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
4760
|
+
if (!_optionalChain([options, 'optionalAccess', _281 => _281.grep, 'optionalAccess', _282 => _282.trim, 'call', _283 => _283()])) {
|
|
4741
4761
|
return (await this.requestPlaysPage(options, false)).plays;
|
|
4742
4762
|
}
|
|
4743
4763
|
const plays = [];
|
|
@@ -4759,45 +4779,45 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4759
4779
|
}
|
|
4760
4780
|
async requestPlaysPage(options, paginateInventory = true) {
|
|
4761
4781
|
const params = new URLSearchParams();
|
|
4762
|
-
if (paginateInventory && !_optionalChain([options, 'optionalAccess',
|
|
4782
|
+
if (paginateInventory && !_optionalChain([options, 'optionalAccess', _284 => _284.grep, 'optionalAccess', _285 => _285.trim, 'call', _286 => _286()]))
|
|
4763
4783
|
params.set("inventory_paginated", "1");
|
|
4764
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4765
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4784
|
+
if (_optionalChain([options, 'optionalAccess', _287 => _287.origin])) params.set("origin", options.origin);
|
|
4785
|
+
if (_optionalChain([options, 'optionalAccess', _288 => _288.categories])) {
|
|
4766
4786
|
params.set(
|
|
4767
4787
|
"categories",
|
|
4768
4788
|
Array.isArray(options.categories) ? options.categories.join(",") : options.categories
|
|
4769
4789
|
);
|
|
4770
4790
|
}
|
|
4771
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4791
|
+
if (_optionalChain([options, 'optionalAccess', _289 => _289.categories]) || _optionalChain([options, 'optionalAccess', _290 => _290.includeToolCategories])) {
|
|
4772
4792
|
params.set("include_tool_categories", "1");
|
|
4773
4793
|
}
|
|
4774
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4794
|
+
if (_optionalChain([options, 'optionalAccess', _291 => _291.tags])) {
|
|
4775
4795
|
params.set(
|
|
4776
4796
|
"tags",
|
|
4777
4797
|
Array.isArray(options.tags) ? options.tags.join(",") : options.tags
|
|
4778
4798
|
);
|
|
4779
4799
|
}
|
|
4780
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4781
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4800
|
+
if (_optionalChain([options, 'optionalAccess', _292 => _292.includeArchived])) params.set("include_archived", "1");
|
|
4801
|
+
if (_optionalChain([options, 'optionalAccess', _293 => _293.includeCostEstimates])) {
|
|
4782
4802
|
params.set("include_cost_estimates", "1");
|
|
4783
4803
|
}
|
|
4784
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4804
|
+
if (_optionalChain([options, 'optionalAccess', _294 => _294.grep, 'optionalAccess', _295 => _295.trim, 'call', _296 => _296()])) {
|
|
4785
4805
|
params.set("grep", options.grep.trim());
|
|
4786
4806
|
params.set("limit", "60");
|
|
4787
4807
|
}
|
|
4788
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4808
|
+
if (_optionalChain([options, 'optionalAccess', _297 => _297.limit]) !== void 0) {
|
|
4789
4809
|
if (!Number.isSafeInteger(options.limit) || options.limit < 1) {
|
|
4790
4810
|
throw new Error("Play page limit must be a positive integer");
|
|
4791
4811
|
}
|
|
4792
4812
|
params.set("limit", String(options.limit));
|
|
4793
4813
|
}
|
|
4794
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4814
|
+
if (_optionalChain([options, 'optionalAccess', _298 => _298.cursor])) params.set("cursor", options.cursor);
|
|
4795
4815
|
const suffix = params.size ? `?${params.toString()}` : "";
|
|
4796
4816
|
const response = await this.http.get(`/api/v2/plays${suffix}`);
|
|
4797
4817
|
return {
|
|
4798
4818
|
plays: _nullishCoalesce(response.plays, () => ( [])),
|
|
4799
|
-
cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access',
|
|
4800
|
-
hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access',
|
|
4819
|
+
cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _299 => _299.pagination, 'optionalAccess', _300 => _300.cursor]), () => ( response.cursor)), () => ( null)),
|
|
4820
|
+
hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _301 => _301.pagination, 'optionalAccess', _302 => _302.hasMore]), () => ( response.hasMore)))
|
|
4801
4821
|
};
|
|
4802
4822
|
}
|
|
4803
4823
|
/** Read definition-level settings, independently of code revisions. */
|
|
@@ -4847,8 +4867,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4847
4867
|
return this.http.post("/api/v2/integrations/connect", {
|
|
4848
4868
|
provider: "slack",
|
|
4849
4869
|
scopes: [...PRODUCT_NOTIFICATION_SLACK_OAUTH_SCOPES],
|
|
4850
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4851
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4870
|
+
..._optionalChain([options, 'optionalAccess', _303 => _303.successUrl]) ? { success_url: options.successUrl } : {},
|
|
4871
|
+
..._optionalChain([options, 'optionalAccess', _304 => _304.failureUrl]) ? { failure_url: options.failureUrl } : {}
|
|
4852
4872
|
});
|
|
4853
4873
|
}
|
|
4854
4874
|
/** List Slack channels visible to the connected Deepline Slack app. */
|
|
@@ -4923,7 +4943,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4923
4943
|
}
|
|
4924
4944
|
const targets = input.targets.map(parseNotificationGroupTarget);
|
|
4925
4945
|
const legacyEvents = _nullishCoalesce(input.legacyEvents, () => ( []));
|
|
4926
|
-
const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access',
|
|
4946
|
+
const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _305 => _305[0], 'optionalAccess', _306 => _306.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
|
|
4927
4947
|
if (legacyEvents.length > 0 && !legacyTarget) {
|
|
4928
4948
|
throw new Error(
|
|
4929
4949
|
"--for is supported only by the legacy one-Slack-target form. Create the group first, then add rules in notification configuration."
|
|
@@ -4959,7 +4979,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4959
4979
|
const existingGroup = current.configuration.groups.find(
|
|
4960
4980
|
(candidate) => candidate.name.toLowerCase() === name.toLowerCase()
|
|
4961
4981
|
);
|
|
4962
|
-
const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess',
|
|
4982
|
+
const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _307 => _307.groupKey]), () => ( notificationObjectKey("group")));
|
|
4963
4983
|
const group = _nullishCoalesce(existingGroup, () => ( {
|
|
4964
4984
|
groupKey,
|
|
4965
4985
|
name,
|
|
@@ -5177,13 +5197,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5177
5197
|
*/
|
|
5178
5198
|
async getPlay(name, options) {
|
|
5179
5199
|
const encodedName = encodeURIComponent(name);
|
|
5180
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
5200
|
+
const query = _optionalChain([options, 'optionalAccess', _308 => _308.source]) ? `?include=source&revision=${encodeURIComponent(options.source)}` : _optionalChain([options, 'optionalAccess', _309 => _309.guidance]) ? "?include=guidance" : "";
|
|
5181
5201
|
return this.http.get(`/api/v2/plays/${encodedName}${query}`);
|
|
5182
5202
|
}
|
|
5183
5203
|
/** Read one trigger inventory page without loading run histories. */
|
|
5184
5204
|
async listPlayTriggerInventory(options) {
|
|
5185
5205
|
const params = new URLSearchParams({ view: "inventory" });
|
|
5186
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5206
|
+
if (_optionalChain([options, 'optionalAccess', _310 => _310.cursor])) params.set("cursor", options.cursor);
|
|
5187
5207
|
return this.http.get(`/api/v2/plays/triggers?${params}`);
|
|
5188
5208
|
}
|
|
5189
5209
|
/** Read one trigger's recent runs, with an explicit partial-history flag. */
|
|
@@ -5192,7 +5212,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5192
5212
|
view: "history",
|
|
5193
5213
|
binding_id: bindingId
|
|
5194
5214
|
});
|
|
5195
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5215
|
+
if (_optionalChain([options, 'optionalAccess', _311 => _311.limit]) !== void 0)
|
|
5196
5216
|
params.set("history_limit", String(options.limit));
|
|
5197
5217
|
return this.http.get(`/api/v2/plays/triggers?${params}`);
|
|
5198
5218
|
}
|
|
@@ -5228,7 +5248,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5228
5248
|
*/
|
|
5229
5249
|
async listPlayVersions(name, options) {
|
|
5230
5250
|
const encodedName = encodeURIComponent(name);
|
|
5231
|
-
const suffix = _optionalChain([options, 'optionalAccess',
|
|
5251
|
+
const suffix = _optionalChain([options, 'optionalAccess', _312 => _312.full]) ? "?full=true" : "";
|
|
5232
5252
|
const response = await this.http.get(
|
|
5233
5253
|
`/api/v2/plays/${encodedName}/versions${suffix}`
|
|
5234
5254
|
);
|
|
@@ -5381,14 +5401,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5381
5401
|
*/
|
|
5382
5402
|
async runPlay(code, csvPath, name, options) {
|
|
5383
5403
|
const { workflowId } = await this.submitPlay(code, csvPath, name, {
|
|
5384
|
-
input: _optionalChain([options, 'optionalAccess',
|
|
5385
|
-
sourceCode: _optionalChain([options, 'optionalAccess',
|
|
5386
|
-
artifact: _optionalChain([options, 'optionalAccess',
|
|
5387
|
-
compilerManifest: _optionalChain([options, 'optionalAccess',
|
|
5388
|
-
inputFile: _optionalChain([options, 'optionalAccess',
|
|
5389
|
-
packagedFiles: _optionalChain([options, 'optionalAccess',
|
|
5390
|
-
force: _optionalChain([options, 'optionalAccess',
|
|
5391
|
-
forceToolRefresh: _optionalChain([options, 'optionalAccess',
|
|
5404
|
+
input: _optionalChain([options, 'optionalAccess', _313 => _313.input]),
|
|
5405
|
+
sourceCode: _optionalChain([options, 'optionalAccess', _314 => _314.sourceCode]),
|
|
5406
|
+
artifact: _optionalChain([options, 'optionalAccess', _315 => _315.artifact]),
|
|
5407
|
+
compilerManifest: _optionalChain([options, 'optionalAccess', _316 => _316.compilerManifest]),
|
|
5408
|
+
inputFile: _optionalChain([options, 'optionalAccess', _317 => _317.inputFile]),
|
|
5409
|
+
packagedFiles: _optionalChain([options, 'optionalAccess', _318 => _318.packagedFiles]),
|
|
5410
|
+
force: _optionalChain([options, 'optionalAccess', _319 => _319.force]),
|
|
5411
|
+
forceToolRefresh: _optionalChain([options, 'optionalAccess', _320 => _320.forceToolRefresh])
|
|
5392
5412
|
});
|
|
5393
5413
|
const start = Date.now();
|
|
5394
5414
|
const state = {
|
|
@@ -5399,7 +5419,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5399
5419
|
latest: null
|
|
5400
5420
|
};
|
|
5401
5421
|
let terminalObserved = null;
|
|
5402
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5422
|
+
if (_optionalChain([options, 'optionalAccess', _321 => _321.signal, 'optionalAccess', _322 => _322.aborted])) {
|
|
5403
5423
|
await this.cancelPlay(workflowId);
|
|
5404
5424
|
return {
|
|
5405
5425
|
success: false,
|
|
@@ -5410,9 +5430,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5410
5430
|
};
|
|
5411
5431
|
}
|
|
5412
5432
|
for await (const event of this.watchRunEvents(workflowId, {
|
|
5413
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
5433
|
+
signal: _optionalChain([options, 'optionalAccess', _323 => _323.signal])
|
|
5414
5434
|
})) {
|
|
5415
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5435
|
+
if (_optionalChain([options, 'optionalAccess', _324 => _324.signal, 'optionalAccess', _325 => _325.aborted])) {
|
|
5416
5436
|
await this.cancelPlay(workflowId);
|
|
5417
5437
|
return {
|
|
5418
5438
|
success: false,
|
|
@@ -5422,19 +5442,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5422
5442
|
error: "Cancelled by user"
|
|
5423
5443
|
};
|
|
5424
5444
|
}
|
|
5425
|
-
const previousStatus = _optionalChain([state, 'access',
|
|
5445
|
+
const previousStatus = _optionalChain([state, 'access', _326 => _326.latest, 'optionalAccess', _327 => _327.status]);
|
|
5426
5446
|
const status = updatePlayLiveStatusState(state, event);
|
|
5427
5447
|
if (!status) {
|
|
5428
5448
|
continue;
|
|
5429
5449
|
}
|
|
5430
5450
|
if (event.type !== "play.run.status" || status.status !== previousStatus) {
|
|
5431
|
-
_optionalChain([options, 'optionalAccess',
|
|
5451
|
+
_optionalChain([options, 'optionalAccess', _328 => _328.onProgress, 'optionalCall', _329 => _329(status)]);
|
|
5432
5452
|
}
|
|
5433
5453
|
if (_chunkLA46MMTLjs.isTerminalPlayRunLifecycleStatus.call(void 0, status.status)) {
|
|
5434
5454
|
terminalObserved = status;
|
|
5435
5455
|
}
|
|
5436
5456
|
}
|
|
5437
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5457
|
+
if (_optionalChain([options, 'optionalAccess', _330 => _330.signal, 'optionalAccess', _331 => _331.aborted])) {
|
|
5438
5458
|
await this.cancelPlay(workflowId);
|
|
5439
5459
|
return {
|
|
5440
5460
|
success: false,
|
|
@@ -5487,7 +5507,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5487
5507
|
const response = await this.http.get(
|
|
5488
5508
|
`/api/v2/usage/events?request_id=${encodeURIComponent(normalizedRequestId)}`
|
|
5489
5509
|
);
|
|
5490
|
-
const event = _optionalChain([response, 'access',
|
|
5510
|
+
const event = _optionalChain([response, 'access', _332 => _332.entries, 'optionalAccess', _333 => _333[0]]);
|
|
5491
5511
|
if (!event) {
|
|
5492
5512
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
5493
5513
|
"No usage event was found for this request_id.",
|
|
@@ -5613,7 +5633,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5613
5633
|
async cancelBillingSubscription(options) {
|
|
5614
5634
|
return this.http.post(
|
|
5615
5635
|
"/api/v2/billing/subscription/cancel",
|
|
5616
|
-
{ action: _optionalChain([options, 'optionalAccess',
|
|
5636
|
+
{ action: _optionalChain([options, 'optionalAccess', _334 => _334.undo]) ? "undo_cancel" : "cancel" }
|
|
5617
5637
|
);
|
|
5618
5638
|
}
|
|
5619
5639
|
/**
|
|
@@ -5625,7 +5645,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5625
5645
|
*/
|
|
5626
5646
|
async listBillingInvoices(options) {
|
|
5627
5647
|
const params = new URLSearchParams();
|
|
5628
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5648
|
+
if (_optionalChain([options, 'optionalAccess', _335 => _335.limit]) !== void 0) {
|
|
5629
5649
|
params.set("limit", String(options.limit));
|
|
5630
5650
|
}
|
|
5631
5651
|
const suffix = Array.from(params).length > 0 ? `?${params.toString()}` : "";
|
|
@@ -5735,7 +5755,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5735
5755
|
/** Create a Stripe-hosted portal session for payment recovery and invoices. */
|
|
5736
5756
|
async createTargetBillingPortalSession(options) {
|
|
5737
5757
|
const response = await this.http.post(
|
|
5738
|
-
_optionalChain([options, 'optionalAccess',
|
|
5758
|
+
_optionalChain([options, 'optionalAccess', _336 => _336.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
|
|
5739
5759
|
{}
|
|
5740
5760
|
);
|
|
5741
5761
|
return response.data;
|
|
@@ -5785,8 +5805,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5785
5805
|
return this.http.request("/api/v2/monitors/audit", {
|
|
5786
5806
|
method: "POST",
|
|
5787
5807
|
body: {
|
|
5788
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5789
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5808
|
+
..._optionalChain([options, 'optionalAccess', _337 => _337.fleetId]) ? { fleet_id: options.fleetId } : {},
|
|
5809
|
+
..._optionalChain([options, 'optionalAccess', _338 => _338.cursor]) ? { cursor: options.cursor } : {}
|
|
5790
5810
|
},
|
|
5791
5811
|
maxRetries: 0
|
|
5792
5812
|
});
|
|
@@ -5796,8 +5816,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5796
5816
|
return this.http.request("/api/v2/monitors/repair", {
|
|
5797
5817
|
method: "POST",
|
|
5798
5818
|
body: {
|
|
5799
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5800
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5819
|
+
..._optionalChain([options, 'optionalAccess', _339 => _339.fleetId]) ? { fleet_id: options.fleetId } : {},
|
|
5820
|
+
..._optionalChain([options, 'optionalAccess', _340 => _340.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
|
|
5801
5821
|
},
|
|
5802
5822
|
maxRetries: 0
|
|
5803
5823
|
});
|
|
@@ -5805,7 +5825,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5805
5825
|
/** Delivery and convergence health. Prefer `client.monitors.health(...)`. */
|
|
5806
5826
|
async readMonitorsHealth(options) {
|
|
5807
5827
|
const params = new URLSearchParams();
|
|
5808
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5828
|
+
if (_optionalChain([options, 'optionalAccess', _341 => _341.fleetId])) params.set("fleet_id", options.fleetId);
|
|
5809
5829
|
const query = params.toString();
|
|
5810
5830
|
const suffix = query ? `?${query}` : "";
|
|
5811
5831
|
return this.http.request(
|
|
@@ -5878,7 +5898,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5878
5898
|
);
|
|
5879
5899
|
}
|
|
5880
5900
|
const params = new URLSearchParams();
|
|
5881
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5901
|
+
if (_optionalChain([options, 'optionalAccess', _342 => _342.cursor])) params.set("cursor", options.cursor);
|
|
5882
5902
|
const suffix = params.size > 0 ? `?${params}` : "";
|
|
5883
5903
|
return this.http.request(
|
|
5884
5904
|
`/api/v2/monitors/batch/${encodeURIComponent(runId)}${suffix}`,
|
|
@@ -5922,7 +5942,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5922
5942
|
* `client.monitors.deploy(...)`.
|
|
5923
5943
|
*/
|
|
5924
5944
|
async deployMonitor(definition, options) {
|
|
5925
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5945
|
+
if (_optionalChain([options, 'optionalAccess', _343 => _343.dryRun])) {
|
|
5926
5946
|
return this.http.request("/api/v2/monitors/check", {
|
|
5927
5947
|
method: "POST",
|
|
5928
5948
|
body: definition
|
|
@@ -5958,12 +5978,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5958
5978
|
/** List deployed monitors. Prefer `client.monitors.list(...)`. */
|
|
5959
5979
|
async listMonitors(options) {
|
|
5960
5980
|
const params = new URLSearchParams();
|
|
5961
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5962
|
-
else if (_optionalChain([options, 'optionalAccess',
|
|
5963
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5981
|
+
if (_optionalChain([options, 'optionalAccess', _344 => _344.state])) params.set("state", options.state);
|
|
5982
|
+
else if (_optionalChain([options, 'optionalAccess', _345 => _345.status])) params.set("status", options.status);
|
|
5983
|
+
if (_optionalChain([options, 'optionalAccess', _346 => _346.limit]) !== void 0)
|
|
5964
5984
|
params.set("limit", String(options.limit));
|
|
5965
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5966
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5985
|
+
if (_optionalChain([options, 'optionalAccess', _347 => _347.cursor])) params.set("cursor", options.cursor);
|
|
5986
|
+
if (_optionalChain([options, 'optionalAccess', _348 => _348.includeConsumers])) params.set("include_consumers", "true");
|
|
5967
5987
|
const query = params.toString();
|
|
5968
5988
|
const suffix = query ? `?${query}` : "";
|
|
5969
5989
|
return this.http.request(
|
|
@@ -5979,7 +5999,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5979
5999
|
);
|
|
5980
6000
|
}
|
|
5981
6001
|
async testMonitorWebhook(key, payload, options) {
|
|
5982
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6002
|
+
if (_optionalChain([options, 'optionalAccess', _349 => _349.dispatch]) === true || _optionalChain([options, 'optionalAccess', _350 => _350.validationOnly]) === false) {
|
|
5983
6003
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
5984
6004
|
"Monitor tests are validation-only and cannot dispatch events.",
|
|
5985
6005
|
void 0,
|
|
@@ -6034,7 +6054,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6034
6054
|
}
|
|
6035
6055
|
/** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
|
|
6036
6056
|
async deleteMonitor(key, options) {
|
|
6037
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6057
|
+
if (_optionalChain([options, 'optionalAccess', _351 => _351.localOnly]) === true) {
|
|
6038
6058
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
6039
6059
|
"localOnly monitor deletion is no longer supported. Monitor deletion always deprovisions the upstream provider resource.",
|
|
6040
6060
|
void 0,
|
|
@@ -6042,11 +6062,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6042
6062
|
);
|
|
6043
6063
|
}
|
|
6044
6064
|
const params = new URLSearchParams();
|
|
6045
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6065
|
+
if (_optionalChain([options, 'optionalAccess', _352 => _352.dryRun])) params.set("dry_run", "true");
|
|
6046
6066
|
const query = params.toString();
|
|
6047
6067
|
return this.http.request(
|
|
6048
6068
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
|
|
6049
|
-
_optionalChain([options, 'optionalAccess',
|
|
6069
|
+
_optionalChain([options, 'optionalAccess', _353 => _353.dryRun]) ? { method: "DELETE" } : {
|
|
6050
6070
|
method: "DELETE",
|
|
6051
6071
|
// Deletion is a provider lifecycle operation. A timeout is an
|
|
6052
6072
|
// unknown outcome, not authority to begin another delete attempt.
|
|
@@ -6059,10 +6079,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6059
6079
|
* Prefer `client.monitors.reactivate(...)`.
|
|
6060
6080
|
*/
|
|
6061
6081
|
async reactivateMonitor(key, options) {
|
|
6062
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
6082
|
+
const query = _optionalChain([options, 'optionalAccess', _354 => _354.dryRun]) ? "?dry_run=true" : "";
|
|
6063
6083
|
return this.http.request(
|
|
6064
6084
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
|
|
6065
|
-
_optionalChain([options, 'optionalAccess',
|
|
6085
|
+
_optionalChain([options, 'optionalAccess', _355 => _355.dryRun]) ? { method: "POST", body: {} } : {
|
|
6066
6086
|
method: "POST",
|
|
6067
6087
|
body: {},
|
|
6068
6088
|
// Reactivation can create an upstream resource, so it must not use
|
|
@@ -6076,7 +6096,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6076
6096
|
// ——————————————————————————————————————————————————————————
|
|
6077
6097
|
static __initStatic() {this.MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH = 96}
|
|
6078
6098
|
monitorJobIdempotencyKey(operation) {
|
|
6079
|
-
const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access',
|
|
6099
|
+
const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _356 => _356.crypto, 'optionalAccess', _357 => _357.randomUUID, 'optionalCall', _358 => _358()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
|
|
6080
6100
|
const prefix = "monitor-job-";
|
|
6081
6101
|
const safeOperation = operation.replace(/[^A-Za-z0-9._-]/g, "-");
|
|
6082
6102
|
const maxOperationLength = Math.max(
|
|
@@ -6087,7 +6107,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6087
6107
|
}
|
|
6088
6108
|
monitorJobHeaders(operation, idempotencyKey) {
|
|
6089
6109
|
return {
|
|
6090
|
-
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess',
|
|
6110
|
+
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _359 => _359.trim, 'call', _360 => _360()]) || this.monitorJobIdempotencyKey(operation)
|
|
6091
6111
|
};
|
|
6092
6112
|
}
|
|
6093
6113
|
async deployMonitorBatch(definitions, options) {
|
|
@@ -6098,7 +6118,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6098
6118
|
body: { version: 1, kind: "batch", monitors: definitions },
|
|
6099
6119
|
headers: this.monitorJobHeaders(
|
|
6100
6120
|
"batch-deploy",
|
|
6101
|
-
_optionalChain([options, 'optionalAccess',
|
|
6121
|
+
_optionalChain([options, 'optionalAccess', _361 => _361.idempotencyKey])
|
|
6102
6122
|
),
|
|
6103
6123
|
maxRetries: 0,
|
|
6104
6124
|
exactUrlOnly: true
|
|
@@ -6117,11 +6137,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6117
6137
|
version: 1,
|
|
6118
6138
|
kind: "batch",
|
|
6119
6139
|
monitors: definitions,
|
|
6120
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6140
|
+
..._optionalChain([options, 'optionalAccess', _362 => _362.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
|
|
6121
6141
|
},
|
|
6122
6142
|
headers: this.monitorJobHeaders(
|
|
6123
6143
|
`batch-sync-${batchId}`,
|
|
6124
|
-
_optionalChain([options, 'optionalAccess',
|
|
6144
|
+
_optionalChain([options, 'optionalAccess', _363 => _363.idempotencyKey])
|
|
6125
6145
|
),
|
|
6126
6146
|
maxRetries: 0,
|
|
6127
6147
|
exactUrlOnly: true
|
|
@@ -6136,7 +6156,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6136
6156
|
body: {},
|
|
6137
6157
|
headers: this.monitorJobHeaders(
|
|
6138
6158
|
`batch-start-${batchId}`,
|
|
6139
|
-
_optionalChain([options, 'optionalAccess',
|
|
6159
|
+
_optionalChain([options, 'optionalAccess', _364 => _364.idempotencyKey])
|
|
6140
6160
|
),
|
|
6141
6161
|
maxRetries: 0,
|
|
6142
6162
|
exactUrlOnly: true
|
|
@@ -6151,7 +6171,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6151
6171
|
body: {},
|
|
6152
6172
|
headers: this.monitorJobHeaders(
|
|
6153
6173
|
`batch-stop-${batchId}`,
|
|
6154
|
-
_optionalChain([options, 'optionalAccess',
|
|
6174
|
+
_optionalChain([options, 'optionalAccess', _365 => _365.idempotencyKey])
|
|
6155
6175
|
),
|
|
6156
6176
|
maxRetries: 0,
|
|
6157
6177
|
exactUrlOnly: true
|
|
@@ -6172,7 +6192,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6172
6192
|
body: {},
|
|
6173
6193
|
headers: this.monitorJobHeaders(
|
|
6174
6194
|
`${action}-${monitorKey}`,
|
|
6175
|
-
_optionalChain([options, 'optionalAccess',
|
|
6195
|
+
_optionalChain([options, 'optionalAccess', _366 => _366.idempotencyKey])
|
|
6176
6196
|
),
|
|
6177
6197
|
maxRetries: 0,
|
|
6178
6198
|
exactUrlOnly: true
|
|
@@ -6185,7 +6205,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6185
6205
|
body: definition,
|
|
6186
6206
|
headers: this.monitorJobHeaders(
|
|
6187
6207
|
`sync-${definition.key}`,
|
|
6188
|
-
_optionalChain([options, 'optionalAccess',
|
|
6208
|
+
_optionalChain([options, 'optionalAccess', _367 => _367.idempotencyKey])
|
|
6189
6209
|
),
|
|
6190
6210
|
maxRetries: 0,
|
|
6191
6211
|
exactUrlOnly: true
|
|
@@ -6198,7 +6218,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6198
6218
|
);
|
|
6199
6219
|
}
|
|
6200
6220
|
async getMonitorJobLogs(jobId, options) {
|
|
6201
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
6221
|
+
const query = _optionalChain([options, 'optionalAccess', _368 => _368.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
|
|
6202
6222
|
return this.http.request(
|
|
6203
6223
|
`/api/v2/monitors/jobs/${encodeURIComponent(jobId)}/logs${query}`,
|
|
6204
6224
|
{ method: "GET" }
|
|
@@ -6211,15 +6231,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6211
6231
|
);
|
|
6212
6232
|
}
|
|
6213
6233
|
async waitForMonitorJob(jobId, options) {
|
|
6214
|
-
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6215
|
-
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6234
|
+
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _369 => _369.timeoutMs]), () => ( 10 * 6e4)));
|
|
6235
|
+
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _370 => _370.pollIntervalMs]), () => ( 2e3)));
|
|
6216
6236
|
const terminal = /* @__PURE__ */ new Set(["succeeded", "failed", "cancelled"]);
|
|
6217
6237
|
const startedAt = Date.now();
|
|
6218
6238
|
let latest = await this.getMonitorJob(jobId);
|
|
6219
6239
|
while (true) {
|
|
6220
|
-
_optionalChain([options, 'optionalAccess',
|
|
6240
|
+
_optionalChain([options, 'optionalAccess', _371 => _371.onProgress, 'optionalCall', _372 => _372(latest)]);
|
|
6221
6241
|
const job = latest.job;
|
|
6222
|
-
const state = typeof _optionalChain([job, 'optionalAccess',
|
|
6242
|
+
const state = typeof _optionalChain([job, 'optionalAccess', _373 => _373.state]) === "string" ? job.state : void 0;
|
|
6223
6243
|
if (state && terminal.has(state)) return latest;
|
|
6224
6244
|
if (Date.now() - startedAt >= timeoutMs) return latest;
|
|
6225
6245
|
await sleep(pollIntervalMs);
|
|
@@ -6230,12 +6250,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6230
6250
|
// Monitor Fleets
|
|
6231
6251
|
// ——————————————————————————————————————————————————————————
|
|
6232
6252
|
monitorFleetIdempotencyKey(operation) {
|
|
6233
|
-
const uuid = _optionalChain([globalThis, 'access',
|
|
6253
|
+
const uuid = _optionalChain([globalThis, 'access', _374 => _374.crypto, 'optionalAccess', _375 => _375.randomUUID, 'optionalCall', _376 => _376()]);
|
|
6234
6254
|
return `monitor-fleet-${operation}-${_nullishCoalesce(uuid, () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`;
|
|
6235
6255
|
}
|
|
6236
6256
|
monitorFleetHeaders(operation, idempotencyKey) {
|
|
6237
6257
|
return {
|
|
6238
|
-
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess',
|
|
6258
|
+
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _377 => _377.trim, 'call', _378 => _378()]) || this.monitorFleetIdempotencyKey(operation)
|
|
6239
6259
|
};
|
|
6240
6260
|
}
|
|
6241
6261
|
monitorFleetPath(fleetId) {
|
|
@@ -6255,15 +6275,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6255
6275
|
const fleetId = typeof definitionOrId === "string" ? definitionOrId : definitionOrId.id;
|
|
6256
6276
|
const body = {
|
|
6257
6277
|
...typeof definitionOrId === "string" ? {} : { definition: definitionOrId },
|
|
6258
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6259
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6278
|
+
..._optionalChain([options, 'optionalAccess', _379 => _379.dryRun]) ? { dry_run: true } : {},
|
|
6279
|
+
..._optionalChain([options, 'optionalAccess', _380 => _380.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
|
|
6260
6280
|
};
|
|
6261
6281
|
return this.http.request(
|
|
6262
6282
|
this.monitorFleetPath(fleetId),
|
|
6263
6283
|
{
|
|
6264
6284
|
method: "PUT",
|
|
6265
6285
|
body,
|
|
6266
|
-
headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess',
|
|
6286
|
+
headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _381 => _381.idempotencyKey])),
|
|
6267
6287
|
maxRetries: 0,
|
|
6268
6288
|
exactUrlOnly: true
|
|
6269
6289
|
}
|
|
@@ -6276,8 +6296,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6276
6296
|
}
|
|
6277
6297
|
async getMonitorFleet(fleetId, options) {
|
|
6278
6298
|
const params = new URLSearchParams();
|
|
6279
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6280
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6299
|
+
if (_optionalChain([options, 'optionalAccess', _382 => _382.drift])) params.set("drift", "1");
|
|
6300
|
+
if (_optionalChain([options, 'optionalAccess', _383 => _383.limit]) !== void 0)
|
|
6281
6301
|
params.set("limit", String(options.limit));
|
|
6282
6302
|
const query = params.toString();
|
|
6283
6303
|
return this.http.request(
|
|
@@ -6290,10 +6310,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6290
6310
|
this.monitorFleetPath(fleetId),
|
|
6291
6311
|
{
|
|
6292
6312
|
method: "DELETE",
|
|
6293
|
-
body: _optionalChain([options, 'optionalAccess',
|
|
6313
|
+
body: _optionalChain([options, 'optionalAccess', _384 => _384.dryRun]) ? { dry_run: true } : {},
|
|
6294
6314
|
headers: this.monitorFleetHeaders(
|
|
6295
6315
|
"deactivate",
|
|
6296
|
-
_optionalChain([options, 'optionalAccess',
|
|
6316
|
+
_optionalChain([options, 'optionalAccess', _385 => _385.idempotencyKey])
|
|
6297
6317
|
),
|
|
6298
6318
|
maxRetries: 0,
|
|
6299
6319
|
exactUrlOnly: true
|
|
@@ -6308,7 +6328,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6308
6328
|
body: {},
|
|
6309
6329
|
headers: this.monitorFleetHeaders(
|
|
6310
6330
|
"reactivate",
|
|
6311
|
-
_optionalChain([options, 'optionalAccess',
|
|
6331
|
+
_optionalChain([options, 'optionalAccess', _386 => _386.idempotencyKey])
|
|
6312
6332
|
),
|
|
6313
6333
|
maxRetries: 0,
|
|
6314
6334
|
exactUrlOnly: true
|
|
@@ -6325,13 +6345,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6325
6345
|
* identical to "the request failed".
|
|
6326
6346
|
*/
|
|
6327
6347
|
async waitForMonitorFleetConvergence(fleetId, options) {
|
|
6328
|
-
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6329
|
-
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6330
|
-
const terminal = _optionalChain([options, 'optionalAccess',
|
|
6348
|
+
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _387 => _387.timeoutMs]), () => ( 10 * 6e4)));
|
|
6349
|
+
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _388 => _388.pollIntervalMs]), () => ( 2e3)));
|
|
6350
|
+
const terminal = _optionalChain([options, 'optionalAccess', _389 => _389.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded"]) : /* @__PURE__ */ new Set(["converged", "degraded", "deactivated"]);
|
|
6331
6351
|
const startedAt = Date.now();
|
|
6332
6352
|
let latest = await this.getMonitorFleet(fleetId);
|
|
6333
6353
|
while (true) {
|
|
6334
|
-
_optionalChain([options, 'optionalAccess',
|
|
6354
|
+
_optionalChain([options, 'optionalAccess', _390 => _390.onProgress, 'optionalCall', _391 => _391(latest)]);
|
|
6335
6355
|
const status = typeof latest.status === "string" ? latest.status : void 0;
|
|
6336
6356
|
if (status && terminal.has(status)) return latest;
|
|
6337
6357
|
if (Date.now() - startedAt >= timeoutMs) return latest;
|