deepline 0.3.312 → 0.3.314
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/release.ts +1 -1
- 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 +126 -51
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +11 -6
- package/dist/cli/{auth-ACDTPM3M.mjs → auth-GWF55S3N.mjs} +4 -4
- package/dist/cli/auth-QX2L4LPM.js +31 -0
- package/dist/cli/{billing-YTJFHEGU.js → billing-2YU6E2IF.js} +70 -70
- package/dist/cli/{billing-FVBBJ77L.mjs → billing-WWOJN7GV.mjs} +4 -4
- package/dist/cli/{chunk-WPTUKXIF.mjs → chunk-25SPKKF2.mjs} +1 -1
- package/dist/cli/{chunk-MK4K5MQU.mjs → chunk-2Q2IKUL5.mjs} +3 -3
- package/dist/cli/{chunk-EHVJ7XXD.mjs → chunk-3A4LJUX6.mjs} +2 -2
- package/dist/cli/{chunk-ENSDO4SG.mjs → chunk-3CKNUJVZ.mjs} +4 -4
- package/dist/cli/{chunk-AA66YTS7.mjs → chunk-3K6QD7Z3.mjs} +1 -1
- package/dist/cli/{chunk-TID5XLTZ.js → chunk-B5LUKLKH.js} +4 -4
- package/dist/cli/{chunk-I25C4KL7.mjs → chunk-CPN2N6EZ.mjs} +7 -6
- package/dist/cli/{chunk-GTEDCRKC.mjs → chunk-DR3S76BG.mjs} +1 -1
- package/dist/cli/{chunk-QFSLMI42.js → chunk-ENQZV7NR.js} +221 -220
- package/dist/cli/{chunk-BRJOVSTH.js → chunk-GSRDZD7R.js} +2 -2
- package/dist/cli/{chunk-6OGNRAS7.mjs → chunk-HTXZLCSP.mjs} +2 -2
- package/dist/cli/{chunk-NWFE4PGX.mjs → chunk-IZTIBG7A.mjs} +13 -3
- package/dist/cli/{chunk-V7N6BJQD.js → chunk-JNUHGWB2.js} +50 -50
- package/dist/cli/{chunk-OV6IFAXH.mjs → chunk-JZZT4GAY.mjs} +5 -5
- package/dist/cli/{chunk-ULI6UVV6.js → chunk-MLEJ2FYH.js} +212 -202
- package/dist/cli/{chunk-6KKETQSI.js → chunk-NG4WDOGN.js} +6 -6
- package/dist/cli/{chunk-6LLJWMYH.js → chunk-ODEWOXWW.js} +6 -6
- package/dist/cli/{chunk-NMZPK7LM.mjs → chunk-OUHCJL5B.mjs} +1 -1
- package/dist/cli/{chunk-ZH7KTVAB.mjs → chunk-QB5MAFCU.mjs} +1 -1
- package/dist/cli/{chunk-VJDKV5RU.js → chunk-UZTTPEG2.js} +6 -6
- package/dist/cli/{chunk-FQVTHBEH.js → chunk-VBRO5QCI.js} +15 -15
- package/dist/cli/{chunk-ZQJDRSR5.js → chunk-VFRZG4OW.js} +1 -1
- package/dist/cli/{chunk-7SW43OAX.js → chunk-VWW6VHQX.js} +60 -60
- package/dist/cli/{chunk-YYU3PYVK.js → chunk-WDPRE6DU.js} +48 -48
- package/dist/cli/{chunk-NJNYWVEF.mjs → chunk-WTO3ITBC.mjs} +2 -2
- package/dist/cli/{chunk-T4IJQKRE.js → chunk-YVMJTXEG.js} +26 -26
- package/dist/cli/{client-ENGOMTTU.mjs → client-EYGNDORT.mjs} +3 -3
- package/dist/cli/client-Z4VFNTUB.js +20 -0
- package/dist/cli/{csv-ENKTPYAJ.mjs → csv-NZCN7SVV.mjs} +3 -3
- package/dist/cli/{csv-6WOJC6NZ.js → csv-YOW5JMOH.js} +12 -12
- package/dist/cli/{db-BAEVP4QK.js → db-6BIYLZ6F.js} +20 -20
- package/dist/cli/{db-DSCJZYJU.mjs → db-HALJV3KY.mjs} +4 -4
- package/dist/cli/{describe-PAUHJF7H.mjs → describe-KY2ZYGBR.mjs} +8 -8
- package/dist/cli/{describe-X2AFAC4B.js → describe-WA6R2JSH.js} +15 -15
- package/dist/cli/{executions-R6JOR67D.mjs → executions-CBOAN6KI.mjs} +4 -4
- package/dist/cli/{executions-LXS6NLCV.js → executions-NMCTN7XM.js} +6 -6
- package/dist/cli/{feedback-CYRVNCGT.mjs → feedback-FOMPE3DJ.mjs} +3 -3
- package/dist/cli/{feedback-HXP2D7K6.js → feedback-ZZFDSCWS.js} +6 -6
- package/dist/cli/git-AC2ATBDK.js +23 -0
- package/dist/cli/{git-XBYBZB4R.mjs → git-YQR2NBCO.mjs} +4 -4
- package/dist/cli/index.js +74 -74
- package/dist/cli/index.mjs +31 -31
- package/dist/cli/{legacy-noops-OQP6VZKE.mjs → legacy-noops-KMU6P3K4.mjs} +4 -4
- package/dist/cli/{legacy-noops-AUNAFEZP.js → legacy-noops-XH2TFFI6.js} +7 -7
- package/dist/cli/{monitors-L2HAAPAL.mjs → monitors-2ONK5L3I.mjs} +4 -4
- package/dist/cli/{monitors-QSIZG3CJ.js → monitors-5M3BZ5OR.js} +85 -85
- package/dist/cli/{org-JUHQGBQE.js → org-6MKULUZI.js} +60 -60
- package/dist/cli/{org-UCSN5XRC.mjs → org-LR5BMCGL.mjs} +4 -4
- package/dist/cli/{play-5AT2RB3M.mjs → play-4NOSD7DW.mjs} +7 -7
- package/dist/cli/play-U3CZ4F2W.js +152 -0
- package/dist/cli/{providers-GVPAPZ4L.mjs → providers-UBGIKGCA.mjs} +4 -4
- package/dist/cli/{providers-CVG4L3VR.js → providers-UFJD3VKF.js} +7 -7
- package/dist/cli/{quickstart-Y6ZU27LE.mjs → quickstart-KDUKQRUH.mjs} +3 -3
- package/dist/cli/{quickstart-7OIFIQG3.js → quickstart-KQZHZE6C.js} +5 -5
- package/dist/cli/{search-4I2Y2NKK.mjs → search-4BVOOS5Q.mjs} +5 -5
- package/dist/cli/search-Y7OTFRCI.js +26 -0
- package/dist/cli/{secrets-O2UFLU52.js → secrets-TVXZ3WJ3.js} +13 -13
- package/dist/cli/{secrets-3Z4IUEBA.mjs → secrets-YGV23N3N.mjs} +4 -4
- package/dist/cli/{sessions-OMAXRY5I.mjs → sessions-G7ROUW35.mjs} +4 -4
- package/dist/cli/{sessions-T6MWWQRH.js → sessions-RWIQWDFD.js} +5 -5
- package/dist/cli/{settings-C47WXZY5.mjs → settings-QZEVGCXE.mjs} +7 -7
- package/dist/cli/{settings-R4LO5NMY.js → settings-TG3E2NR7.js} +74 -74
- package/dist/cli/{setup-FIUTV4DD.js → setup-3KDUNEEE.js} +41 -41
- package/dist/cli/{setup-JPJVTIQ6.mjs → setup-HUXINKOH.mjs} +6 -6
- package/dist/cli/skills-CO5YUWBK.js +28 -0
- package/dist/cli/{skills-6WVTMKP5.mjs → skills-LHU3DB7J.mjs} +4 -4
- package/dist/cli/{tools-TKS77TNU.mjs → tools-J5WQ33BB.mjs} +6 -6
- package/dist/cli/tools-MWPT5X47.js +38 -0
- package/dist/cli/{update-GD754XMA.mjs → update-T6744RM7.mjs} +6 -6
- package/dist/cli/update-VVIJW7ZJ.js +28 -0
- package/dist/cli/{workflow-YKQSPXQZ.mjs → workflow-CG2B65HD.mjs} +5 -5
- package/dist/cli/{workflow-OCUQCNXA.js → workflow-YF5SQJLG.js} +15 -15
- package/dist/index.js +6 -6
- package/dist/index.mjs +3 -3
- package/dist/install-integrity.json +74 -74
- 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-TFDGA24W.js +0 -31
- package/dist/cli/client-T6YGH6TT.js +0 -20
- package/dist/cli/git-JOE2RM3Q.js +0 -23
- package/dist/cli/play-2SNMTZGK.js +0 -152
- package/dist/cli/search-DS36UHOX.js +0 -26
- package/dist/cli/skills-GLPKPF7R.js +0 -28
- package/dist/cli/tools-L3YLQ7BR.js +0 -38
- package/dist/cli/update-HXI35NME.js +0 -28
|
@@ -14,7 +14,7 @@ var _chunkLA46MMTLjs = require('./chunk-LA46MMTL.js');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkB5LUKLKHjs = require('./chunk-B5LUKLKH.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
|
+
[_chunkB5LUKLKHjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
|
|
2757
|
+
...receivers ? { [_chunkB5LUKLKHjs.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 { [_chunkB5LUKLKHjs.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 = _chunkB5LUKLKHjs.resolveConfig.call(void 0, options);
|
|
3075
|
+
this.http = new (0, _chunkB5LUKLKHjs.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,12 +4313,12 @@ 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
|
}
|
|
@@ -4376,8 +4386,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4376
4386
|
* different key intentionally starts another rerun.
|
|
4377
4387
|
*/
|
|
4378
4388
|
async rerun(runId, options) {
|
|
4379
|
-
const idempotencyKey = _optionalChain([options, 'optionalAccess',
|
|
4380
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4389
|
+
const idempotencyKey = _optionalChain([options, 'optionalAccess', _249 => _249.idempotencyKey, 'optionalAccess', _250 => _250.trim, 'call', _251 => _251()]);
|
|
4390
|
+
if (_optionalChain([options, 'optionalAccess', _252 => _252.idempotencyKey]) !== void 0 && !idempotencyKey) {
|
|
4381
4391
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4382
4392
|
"runs.rerun idempotencyKey must not be empty.",
|
|
4383
4393
|
void 0,
|
|
@@ -4386,7 +4396,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4386
4396
|
}
|
|
4387
4397
|
return this.http.post(
|
|
4388
4398
|
`/api/v2/runs/${encodeURIComponent(runId)}/rerun`,
|
|
4389
|
-
_optionalChain([options, 'optionalAccess',
|
|
4399
|
+
_optionalChain([options, 'optionalAccess', _253 => _253.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
|
|
4390
4400
|
{ "Idempotency-Key": idempotencyKey || globalThis.crypto.randomUUID() }
|
|
4391
4401
|
);
|
|
4392
4402
|
}
|
|
@@ -4400,21 +4410,21 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4400
4410
|
* ```
|
|
4401
4411
|
*/
|
|
4402
4412
|
async getRunLogs(runId, options) {
|
|
4403
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4413
|
+
if (_optionalChain([options, 'optionalAccess', _254 => _254.all]) === true && options.failed === true) {
|
|
4404
4414
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4405
4415
|
"runs.logs cannot combine all and failed views.",
|
|
4406
4416
|
void 0,
|
|
4407
4417
|
"INVALID_RUN_LOG_VIEW"
|
|
4408
4418
|
);
|
|
4409
4419
|
}
|
|
4410
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4420
|
+
if (_optionalChain([options, 'optionalAccess', _255 => _255.cursor]) !== void 0 && options.failed === true) {
|
|
4411
4421
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4412
4422
|
"runs.logs cannot combine failed with cursor.",
|
|
4413
4423
|
void 0,
|
|
4414
4424
|
"INVALID_RUN_LOG_VIEW"
|
|
4415
4425
|
);
|
|
4416
4426
|
}
|
|
4417
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4427
|
+
if (_optionalChain([options, 'optionalAccess', _256 => _256.failed]) === true) {
|
|
4418
4428
|
const requestedLimit = typeof options.limit === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : RUNS_FAILED_LOG_LIMIT;
|
|
4419
4429
|
const failedLimit = Math.min(RUNS_FAILED_LOG_LIMIT, requestedLimit);
|
|
4420
4430
|
const page = await this.http.get(
|
|
@@ -4439,18 +4449,18 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4439
4449
|
...page.logsTruncated ? { logsTruncated: true } : {}
|
|
4440
4450
|
};
|
|
4441
4451
|
}
|
|
4442
|
-
const beforeSequence = _optionalChain([options, 'optionalAccess',
|
|
4443
|
-
const limit = _optionalChain([options, 'optionalAccess',
|
|
4452
|
+
const beforeSequence = _optionalChain([options, 'optionalAccess', _257 => _257.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
|
|
4453
|
+
const limit = _optionalChain([options, 'optionalAccess', _258 => _258.all]) ? Number.MAX_SAFE_INTEGER : typeof _optionalChain([options, 'optionalAccess', _259 => _259.limit]) === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
|
|
4444
4454
|
const fetchPage = (afterSeq2, pageLimit) => this.http.get(
|
|
4445
4455
|
`/api/v2/runs/${encodeURIComponent(runId)}/logs?afterSeq=${afterSeq2}&limit=${pageLimit}`,
|
|
4446
4456
|
{ retryApiErrors: true }
|
|
4447
4457
|
);
|
|
4448
4458
|
const probe = await fetchPage(0, 1);
|
|
4449
4459
|
const lastStoredSeq = probe.lastStoredSeq;
|
|
4450
|
-
const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access',
|
|
4460
|
+
const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _260 => _260.entries, 'access', _261 => _261[0], 'optionalAccess', _262 => _262.seq]), () => ( null));
|
|
4451
4461
|
const upperSeq = beforeSequence === null ? Number.POSITIVE_INFINITY : Math.min(beforeSequence - 1, lastStoredSeq);
|
|
4452
4462
|
const windowEndSeq = Math.min(upperSeq, lastStoredSeq);
|
|
4453
|
-
let afterSeq = _optionalChain([options, 'optionalAccess',
|
|
4463
|
+
let afterSeq = _optionalChain([options, 'optionalAccess', _263 => _263.all]) ? 0 : Math.max(0, windowEndSeq - limit);
|
|
4454
4464
|
const entries = [];
|
|
4455
4465
|
while (entries.length < limit && afterSeq < upperSeq) {
|
|
4456
4466
|
const page = await fetchPage(
|
|
@@ -4484,7 +4494,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4484
4494
|
hasMore: olderLinesExist,
|
|
4485
4495
|
nextCursor: olderLinesExist ? encodeRunLogsCursor(firstSequence) : null,
|
|
4486
4496
|
entries: entries.map((entry) => entry.line),
|
|
4487
|
-
view: _optionalChain([options, 'optionalAccess',
|
|
4497
|
+
view: _optionalChain([options, 'optionalAccess', _264 => _264.all]) ? "all" : "tail",
|
|
4488
4498
|
...probe.logsTruncated ? { logsTruncated: true } : {}
|
|
4489
4499
|
};
|
|
4490
4500
|
}
|
|
@@ -4645,7 +4655,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4645
4655
|
limit: String(_nullishCoalesce(input.limit, () => ( 5e3))),
|
|
4646
4656
|
offset: String(_nullishCoalesce(input.offset, () => ( 0)))
|
|
4647
4657
|
});
|
|
4648
|
-
if (_optionalChain([input, 'access',
|
|
4658
|
+
if (_optionalChain([input, 'access', _265 => _265.runId, 'optionalAccess', _266 => _266.trim, 'call', _267 => _267()])) {
|
|
4649
4659
|
params.set("runId", input.runId.trim());
|
|
4650
4660
|
}
|
|
4651
4661
|
if (input.rowMode === "all" || input.rowMode === "live") {
|
|
@@ -4655,9 +4665,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4655
4665
|
`/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`,
|
|
4656
4666
|
{ signal: input.signal }
|
|
4657
4667
|
);
|
|
4658
|
-
const requestedRunId = _optionalChain([input, 'access',
|
|
4668
|
+
const requestedRunId = _optionalChain([input, 'access', _268 => _268.runId, 'optionalAccess', _269 => _269.trim, 'call', _270 => _270()]) || "";
|
|
4659
4669
|
if (requestedRunId) {
|
|
4660
|
-
const confirmedRunId = _optionalChain([result, 'access',
|
|
4670
|
+
const confirmedRunId = _optionalChain([result, 'access', _271 => _271.scope, 'optionalAccess', _272 => _272.kind]) === "run" ? result.scope.runId.trim() : "";
|
|
4661
4671
|
const foreignRowRunIds = [
|
|
4662
4672
|
...new Set(
|
|
4663
4673
|
result.rows.map(
|
|
@@ -4665,7 +4675,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4665
4675
|
).filter((runId) => runId && runId !== requestedRunId)
|
|
4666
4676
|
)
|
|
4667
4677
|
];
|
|
4668
|
-
if (_optionalChain([result, 'access',
|
|
4678
|
+
if (_optionalChain([result, 'access', _273 => _273.scope, 'optionalAccess', _274 => _274.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
|
|
4669
4679
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
4670
4680
|
`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
4681
|
void 0,
|
|
@@ -4694,7 +4704,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4694
4704
|
async stopRun(runId, options) {
|
|
4695
4705
|
return this.http.post(
|
|
4696
4706
|
`/api/v2/runs/${encodeURIComponent(runId)}/stop`,
|
|
4697
|
-
_optionalChain([options, 'optionalAccess',
|
|
4707
|
+
_optionalChain([options, 'optionalAccess', _275 => _275.reason]) ? { reason: options.reason } : {}
|
|
4698
4708
|
);
|
|
4699
4709
|
}
|
|
4700
4710
|
/**
|
|
@@ -4712,11 +4722,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4712
4722
|
* need to clear the workspace run-slot state without knowing each run id.
|
|
4713
4723
|
*/
|
|
4714
4724
|
async stopAllRuns(options) {
|
|
4715
|
-
const dryRun = _optionalChain([options, 'optionalAccess',
|
|
4725
|
+
const dryRun = _optionalChain([options, 'optionalAccess', _276 => _276.dryRun]) === true;
|
|
4716
4726
|
const result = await this.http.post(
|
|
4717
4727
|
"/api/v2/runs/stop-all",
|
|
4718
4728
|
{
|
|
4719
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4729
|
+
..._optionalChain([options, 'optionalAccess', _277 => _277.reason]) ? { reason: options.reason } : {},
|
|
4720
4730
|
...dryRun ? { dryRun: true } : {}
|
|
4721
4731
|
}
|
|
4722
4732
|
);
|
|
@@ -4737,7 +4747,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4737
4747
|
* `origin: "owned"` for org-owned plays.
|
|
4738
4748
|
*/
|
|
4739
4749
|
async listPlays(options) {
|
|
4740
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
4750
|
+
if (!_optionalChain([options, 'optionalAccess', _278 => _278.grep, 'optionalAccess', _279 => _279.trim, 'call', _280 => _280()])) {
|
|
4741
4751
|
return (await this.requestPlaysPage(options, false)).plays;
|
|
4742
4752
|
}
|
|
4743
4753
|
const plays = [];
|
|
@@ -4759,45 +4769,45 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4759
4769
|
}
|
|
4760
4770
|
async requestPlaysPage(options, paginateInventory = true) {
|
|
4761
4771
|
const params = new URLSearchParams();
|
|
4762
|
-
if (paginateInventory && !_optionalChain([options, 'optionalAccess',
|
|
4772
|
+
if (paginateInventory && !_optionalChain([options, 'optionalAccess', _281 => _281.grep, 'optionalAccess', _282 => _282.trim, 'call', _283 => _283()]))
|
|
4763
4773
|
params.set("inventory_paginated", "1");
|
|
4764
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4765
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4774
|
+
if (_optionalChain([options, 'optionalAccess', _284 => _284.origin])) params.set("origin", options.origin);
|
|
4775
|
+
if (_optionalChain([options, 'optionalAccess', _285 => _285.categories])) {
|
|
4766
4776
|
params.set(
|
|
4767
4777
|
"categories",
|
|
4768
4778
|
Array.isArray(options.categories) ? options.categories.join(",") : options.categories
|
|
4769
4779
|
);
|
|
4770
4780
|
}
|
|
4771
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4781
|
+
if (_optionalChain([options, 'optionalAccess', _286 => _286.categories]) || _optionalChain([options, 'optionalAccess', _287 => _287.includeToolCategories])) {
|
|
4772
4782
|
params.set("include_tool_categories", "1");
|
|
4773
4783
|
}
|
|
4774
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4784
|
+
if (_optionalChain([options, 'optionalAccess', _288 => _288.tags])) {
|
|
4775
4785
|
params.set(
|
|
4776
4786
|
"tags",
|
|
4777
4787
|
Array.isArray(options.tags) ? options.tags.join(",") : options.tags
|
|
4778
4788
|
);
|
|
4779
4789
|
}
|
|
4780
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4781
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4790
|
+
if (_optionalChain([options, 'optionalAccess', _289 => _289.includeArchived])) params.set("include_archived", "1");
|
|
4791
|
+
if (_optionalChain([options, 'optionalAccess', _290 => _290.includeCostEstimates])) {
|
|
4782
4792
|
params.set("include_cost_estimates", "1");
|
|
4783
4793
|
}
|
|
4784
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4794
|
+
if (_optionalChain([options, 'optionalAccess', _291 => _291.grep, 'optionalAccess', _292 => _292.trim, 'call', _293 => _293()])) {
|
|
4785
4795
|
params.set("grep", options.grep.trim());
|
|
4786
4796
|
params.set("limit", "60");
|
|
4787
4797
|
}
|
|
4788
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4798
|
+
if (_optionalChain([options, 'optionalAccess', _294 => _294.limit]) !== void 0) {
|
|
4789
4799
|
if (!Number.isSafeInteger(options.limit) || options.limit < 1) {
|
|
4790
4800
|
throw new Error("Play page limit must be a positive integer");
|
|
4791
4801
|
}
|
|
4792
4802
|
params.set("limit", String(options.limit));
|
|
4793
4803
|
}
|
|
4794
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4804
|
+
if (_optionalChain([options, 'optionalAccess', _295 => _295.cursor])) params.set("cursor", options.cursor);
|
|
4795
4805
|
const suffix = params.size ? `?${params.toString()}` : "";
|
|
4796
4806
|
const response = await this.http.get(`/api/v2/plays${suffix}`);
|
|
4797
4807
|
return {
|
|
4798
4808
|
plays: _nullishCoalesce(response.plays, () => ( [])),
|
|
4799
|
-
cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access',
|
|
4800
|
-
hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access',
|
|
4809
|
+
cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _296 => _296.pagination, 'optionalAccess', _297 => _297.cursor]), () => ( response.cursor)), () => ( null)),
|
|
4810
|
+
hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _298 => _298.pagination, 'optionalAccess', _299 => _299.hasMore]), () => ( response.hasMore)))
|
|
4801
4811
|
};
|
|
4802
4812
|
}
|
|
4803
4813
|
/** Read definition-level settings, independently of code revisions. */
|
|
@@ -4847,8 +4857,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4847
4857
|
return this.http.post("/api/v2/integrations/connect", {
|
|
4848
4858
|
provider: "slack",
|
|
4849
4859
|
scopes: [...PRODUCT_NOTIFICATION_SLACK_OAUTH_SCOPES],
|
|
4850
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4851
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4860
|
+
..._optionalChain([options, 'optionalAccess', _300 => _300.successUrl]) ? { success_url: options.successUrl } : {},
|
|
4861
|
+
..._optionalChain([options, 'optionalAccess', _301 => _301.failureUrl]) ? { failure_url: options.failureUrl } : {}
|
|
4852
4862
|
});
|
|
4853
4863
|
}
|
|
4854
4864
|
/** List Slack channels visible to the connected Deepline Slack app. */
|
|
@@ -4923,7 +4933,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4923
4933
|
}
|
|
4924
4934
|
const targets = input.targets.map(parseNotificationGroupTarget);
|
|
4925
4935
|
const legacyEvents = _nullishCoalesce(input.legacyEvents, () => ( []));
|
|
4926
|
-
const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access',
|
|
4936
|
+
const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _302 => _302[0], 'optionalAccess', _303 => _303.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
|
|
4927
4937
|
if (legacyEvents.length > 0 && !legacyTarget) {
|
|
4928
4938
|
throw new Error(
|
|
4929
4939
|
"--for is supported only by the legacy one-Slack-target form. Create the group first, then add rules in notification configuration."
|
|
@@ -4959,7 +4969,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4959
4969
|
const existingGroup = current.configuration.groups.find(
|
|
4960
4970
|
(candidate) => candidate.name.toLowerCase() === name.toLowerCase()
|
|
4961
4971
|
);
|
|
4962
|
-
const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess',
|
|
4972
|
+
const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _304 => _304.groupKey]), () => ( notificationObjectKey("group")));
|
|
4963
4973
|
const group = _nullishCoalesce(existingGroup, () => ( {
|
|
4964
4974
|
groupKey,
|
|
4965
4975
|
name,
|
|
@@ -5177,13 +5187,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5177
5187
|
*/
|
|
5178
5188
|
async getPlay(name, options) {
|
|
5179
5189
|
const encodedName = encodeURIComponent(name);
|
|
5180
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
5190
|
+
const query = _optionalChain([options, 'optionalAccess', _305 => _305.source]) ? `?include=source&revision=${encodeURIComponent(options.source)}` : _optionalChain([options, 'optionalAccess', _306 => _306.guidance]) ? "?include=guidance" : "";
|
|
5181
5191
|
return this.http.get(`/api/v2/plays/${encodedName}${query}`);
|
|
5182
5192
|
}
|
|
5183
5193
|
/** Read one trigger inventory page without loading run histories. */
|
|
5184
5194
|
async listPlayTriggerInventory(options) {
|
|
5185
5195
|
const params = new URLSearchParams({ view: "inventory" });
|
|
5186
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5196
|
+
if (_optionalChain([options, 'optionalAccess', _307 => _307.cursor])) params.set("cursor", options.cursor);
|
|
5187
5197
|
return this.http.get(`/api/v2/plays/triggers?${params}`);
|
|
5188
5198
|
}
|
|
5189
5199
|
/** Read one trigger's recent runs, with an explicit partial-history flag. */
|
|
@@ -5192,7 +5202,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5192
5202
|
view: "history",
|
|
5193
5203
|
binding_id: bindingId
|
|
5194
5204
|
});
|
|
5195
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5205
|
+
if (_optionalChain([options, 'optionalAccess', _308 => _308.limit]) !== void 0)
|
|
5196
5206
|
params.set("history_limit", String(options.limit));
|
|
5197
5207
|
return this.http.get(`/api/v2/plays/triggers?${params}`);
|
|
5198
5208
|
}
|
|
@@ -5228,7 +5238,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5228
5238
|
*/
|
|
5229
5239
|
async listPlayVersions(name, options) {
|
|
5230
5240
|
const encodedName = encodeURIComponent(name);
|
|
5231
|
-
const suffix = _optionalChain([options, 'optionalAccess',
|
|
5241
|
+
const suffix = _optionalChain([options, 'optionalAccess', _309 => _309.full]) ? "?full=true" : "";
|
|
5232
5242
|
const response = await this.http.get(
|
|
5233
5243
|
`/api/v2/plays/${encodedName}/versions${suffix}`
|
|
5234
5244
|
);
|
|
@@ -5381,14 +5391,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5381
5391
|
*/
|
|
5382
5392
|
async runPlay(code, csvPath, name, options) {
|
|
5383
5393
|
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',
|
|
5394
|
+
input: _optionalChain([options, 'optionalAccess', _310 => _310.input]),
|
|
5395
|
+
sourceCode: _optionalChain([options, 'optionalAccess', _311 => _311.sourceCode]),
|
|
5396
|
+
artifact: _optionalChain([options, 'optionalAccess', _312 => _312.artifact]),
|
|
5397
|
+
compilerManifest: _optionalChain([options, 'optionalAccess', _313 => _313.compilerManifest]),
|
|
5398
|
+
inputFile: _optionalChain([options, 'optionalAccess', _314 => _314.inputFile]),
|
|
5399
|
+
packagedFiles: _optionalChain([options, 'optionalAccess', _315 => _315.packagedFiles]),
|
|
5400
|
+
force: _optionalChain([options, 'optionalAccess', _316 => _316.force]),
|
|
5401
|
+
forceToolRefresh: _optionalChain([options, 'optionalAccess', _317 => _317.forceToolRefresh])
|
|
5392
5402
|
});
|
|
5393
5403
|
const start = Date.now();
|
|
5394
5404
|
const state = {
|
|
@@ -5399,7 +5409,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5399
5409
|
latest: null
|
|
5400
5410
|
};
|
|
5401
5411
|
let terminalObserved = null;
|
|
5402
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5412
|
+
if (_optionalChain([options, 'optionalAccess', _318 => _318.signal, 'optionalAccess', _319 => _319.aborted])) {
|
|
5403
5413
|
await this.cancelPlay(workflowId);
|
|
5404
5414
|
return {
|
|
5405
5415
|
success: false,
|
|
@@ -5410,9 +5420,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5410
5420
|
};
|
|
5411
5421
|
}
|
|
5412
5422
|
for await (const event of this.watchRunEvents(workflowId, {
|
|
5413
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
5423
|
+
signal: _optionalChain([options, 'optionalAccess', _320 => _320.signal])
|
|
5414
5424
|
})) {
|
|
5415
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5425
|
+
if (_optionalChain([options, 'optionalAccess', _321 => _321.signal, 'optionalAccess', _322 => _322.aborted])) {
|
|
5416
5426
|
await this.cancelPlay(workflowId);
|
|
5417
5427
|
return {
|
|
5418
5428
|
success: false,
|
|
@@ -5422,19 +5432,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5422
5432
|
error: "Cancelled by user"
|
|
5423
5433
|
};
|
|
5424
5434
|
}
|
|
5425
|
-
const previousStatus = _optionalChain([state, 'access',
|
|
5435
|
+
const previousStatus = _optionalChain([state, 'access', _323 => _323.latest, 'optionalAccess', _324 => _324.status]);
|
|
5426
5436
|
const status = updatePlayLiveStatusState(state, event);
|
|
5427
5437
|
if (!status) {
|
|
5428
5438
|
continue;
|
|
5429
5439
|
}
|
|
5430
5440
|
if (event.type !== "play.run.status" || status.status !== previousStatus) {
|
|
5431
|
-
_optionalChain([options, 'optionalAccess',
|
|
5441
|
+
_optionalChain([options, 'optionalAccess', _325 => _325.onProgress, 'optionalCall', _326 => _326(status)]);
|
|
5432
5442
|
}
|
|
5433
5443
|
if (_chunkLA46MMTLjs.isTerminalPlayRunLifecycleStatus.call(void 0, status.status)) {
|
|
5434
5444
|
terminalObserved = status;
|
|
5435
5445
|
}
|
|
5436
5446
|
}
|
|
5437
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5447
|
+
if (_optionalChain([options, 'optionalAccess', _327 => _327.signal, 'optionalAccess', _328 => _328.aborted])) {
|
|
5438
5448
|
await this.cancelPlay(workflowId);
|
|
5439
5449
|
return {
|
|
5440
5450
|
success: false,
|
|
@@ -5487,7 +5497,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5487
5497
|
const response = await this.http.get(
|
|
5488
5498
|
`/api/v2/usage/events?request_id=${encodeURIComponent(normalizedRequestId)}`
|
|
5489
5499
|
);
|
|
5490
|
-
const event = _optionalChain([response, 'access',
|
|
5500
|
+
const event = _optionalChain([response, 'access', _329 => _329.entries, 'optionalAccess', _330 => _330[0]]);
|
|
5491
5501
|
if (!event) {
|
|
5492
5502
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
5493
5503
|
"No usage event was found for this request_id.",
|
|
@@ -5613,7 +5623,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5613
5623
|
async cancelBillingSubscription(options) {
|
|
5614
5624
|
return this.http.post(
|
|
5615
5625
|
"/api/v2/billing/subscription/cancel",
|
|
5616
|
-
{ action: _optionalChain([options, 'optionalAccess',
|
|
5626
|
+
{ action: _optionalChain([options, 'optionalAccess', _331 => _331.undo]) ? "undo_cancel" : "cancel" }
|
|
5617
5627
|
);
|
|
5618
5628
|
}
|
|
5619
5629
|
/**
|
|
@@ -5625,7 +5635,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5625
5635
|
*/
|
|
5626
5636
|
async listBillingInvoices(options) {
|
|
5627
5637
|
const params = new URLSearchParams();
|
|
5628
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5638
|
+
if (_optionalChain([options, 'optionalAccess', _332 => _332.limit]) !== void 0) {
|
|
5629
5639
|
params.set("limit", String(options.limit));
|
|
5630
5640
|
}
|
|
5631
5641
|
const suffix = Array.from(params).length > 0 ? `?${params.toString()}` : "";
|
|
@@ -5735,7 +5745,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5735
5745
|
/** Create a Stripe-hosted portal session for payment recovery and invoices. */
|
|
5736
5746
|
async createTargetBillingPortalSession(options) {
|
|
5737
5747
|
const response = await this.http.post(
|
|
5738
|
-
_optionalChain([options, 'optionalAccess',
|
|
5748
|
+
_optionalChain([options, 'optionalAccess', _333 => _333.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
|
|
5739
5749
|
{}
|
|
5740
5750
|
);
|
|
5741
5751
|
return response.data;
|
|
@@ -5785,8 +5795,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5785
5795
|
return this.http.request("/api/v2/monitors/audit", {
|
|
5786
5796
|
method: "POST",
|
|
5787
5797
|
body: {
|
|
5788
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5789
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5798
|
+
..._optionalChain([options, 'optionalAccess', _334 => _334.fleetId]) ? { fleet_id: options.fleetId } : {},
|
|
5799
|
+
..._optionalChain([options, 'optionalAccess', _335 => _335.cursor]) ? { cursor: options.cursor } : {}
|
|
5790
5800
|
},
|
|
5791
5801
|
maxRetries: 0
|
|
5792
5802
|
});
|
|
@@ -5796,8 +5806,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5796
5806
|
return this.http.request("/api/v2/monitors/repair", {
|
|
5797
5807
|
method: "POST",
|
|
5798
5808
|
body: {
|
|
5799
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5800
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5809
|
+
..._optionalChain([options, 'optionalAccess', _336 => _336.fleetId]) ? { fleet_id: options.fleetId } : {},
|
|
5810
|
+
..._optionalChain([options, 'optionalAccess', _337 => _337.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
|
|
5801
5811
|
},
|
|
5802
5812
|
maxRetries: 0
|
|
5803
5813
|
});
|
|
@@ -5805,7 +5815,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5805
5815
|
/** Delivery and convergence health. Prefer `client.monitors.health(...)`. */
|
|
5806
5816
|
async readMonitorsHealth(options) {
|
|
5807
5817
|
const params = new URLSearchParams();
|
|
5808
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5818
|
+
if (_optionalChain([options, 'optionalAccess', _338 => _338.fleetId])) params.set("fleet_id", options.fleetId);
|
|
5809
5819
|
const query = params.toString();
|
|
5810
5820
|
const suffix = query ? `?${query}` : "";
|
|
5811
5821
|
return this.http.request(
|
|
@@ -5878,7 +5888,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5878
5888
|
);
|
|
5879
5889
|
}
|
|
5880
5890
|
const params = new URLSearchParams();
|
|
5881
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5891
|
+
if (_optionalChain([options, 'optionalAccess', _339 => _339.cursor])) params.set("cursor", options.cursor);
|
|
5882
5892
|
const suffix = params.size > 0 ? `?${params}` : "";
|
|
5883
5893
|
return this.http.request(
|
|
5884
5894
|
`/api/v2/monitors/batch/${encodeURIComponent(runId)}${suffix}`,
|
|
@@ -5922,7 +5932,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5922
5932
|
* `client.monitors.deploy(...)`.
|
|
5923
5933
|
*/
|
|
5924
5934
|
async deployMonitor(definition, options) {
|
|
5925
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5935
|
+
if (_optionalChain([options, 'optionalAccess', _340 => _340.dryRun])) {
|
|
5926
5936
|
return this.http.request("/api/v2/monitors/check", {
|
|
5927
5937
|
method: "POST",
|
|
5928
5938
|
body: definition
|
|
@@ -5958,12 +5968,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5958
5968
|
/** List deployed monitors. Prefer `client.monitors.list(...)`. */
|
|
5959
5969
|
async listMonitors(options) {
|
|
5960
5970
|
const params = new URLSearchParams();
|
|
5961
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5962
|
-
else if (_optionalChain([options, 'optionalAccess',
|
|
5963
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5971
|
+
if (_optionalChain([options, 'optionalAccess', _341 => _341.state])) params.set("state", options.state);
|
|
5972
|
+
else if (_optionalChain([options, 'optionalAccess', _342 => _342.status])) params.set("status", options.status);
|
|
5973
|
+
if (_optionalChain([options, 'optionalAccess', _343 => _343.limit]) !== void 0)
|
|
5964
5974
|
params.set("limit", String(options.limit));
|
|
5965
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5966
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5975
|
+
if (_optionalChain([options, 'optionalAccess', _344 => _344.cursor])) params.set("cursor", options.cursor);
|
|
5976
|
+
if (_optionalChain([options, 'optionalAccess', _345 => _345.includeConsumers])) params.set("include_consumers", "true");
|
|
5967
5977
|
const query = params.toString();
|
|
5968
5978
|
const suffix = query ? `?${query}` : "";
|
|
5969
5979
|
return this.http.request(
|
|
@@ -5979,7 +5989,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5979
5989
|
);
|
|
5980
5990
|
}
|
|
5981
5991
|
async testMonitorWebhook(key, payload, options) {
|
|
5982
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5992
|
+
if (_optionalChain([options, 'optionalAccess', _346 => _346.dispatch]) === true || _optionalChain([options, 'optionalAccess', _347 => _347.validationOnly]) === false) {
|
|
5983
5993
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
5984
5994
|
"Monitor tests are validation-only and cannot dispatch events.",
|
|
5985
5995
|
void 0,
|
|
@@ -6034,7 +6044,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6034
6044
|
}
|
|
6035
6045
|
/** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
|
|
6036
6046
|
async deleteMonitor(key, options) {
|
|
6037
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6047
|
+
if (_optionalChain([options, 'optionalAccess', _348 => _348.localOnly]) === true) {
|
|
6038
6048
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
6039
6049
|
"localOnly monitor deletion is no longer supported. Monitor deletion always deprovisions the upstream provider resource.",
|
|
6040
6050
|
void 0,
|
|
@@ -6042,11 +6052,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6042
6052
|
);
|
|
6043
6053
|
}
|
|
6044
6054
|
const params = new URLSearchParams();
|
|
6045
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6055
|
+
if (_optionalChain([options, 'optionalAccess', _349 => _349.dryRun])) params.set("dry_run", "true");
|
|
6046
6056
|
const query = params.toString();
|
|
6047
6057
|
return this.http.request(
|
|
6048
6058
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
|
|
6049
|
-
_optionalChain([options, 'optionalAccess',
|
|
6059
|
+
_optionalChain([options, 'optionalAccess', _350 => _350.dryRun]) ? { method: "DELETE" } : {
|
|
6050
6060
|
method: "DELETE",
|
|
6051
6061
|
// Deletion is a provider lifecycle operation. A timeout is an
|
|
6052
6062
|
// unknown outcome, not authority to begin another delete attempt.
|
|
@@ -6059,10 +6069,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6059
6069
|
* Prefer `client.monitors.reactivate(...)`.
|
|
6060
6070
|
*/
|
|
6061
6071
|
async reactivateMonitor(key, options) {
|
|
6062
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
6072
|
+
const query = _optionalChain([options, 'optionalAccess', _351 => _351.dryRun]) ? "?dry_run=true" : "";
|
|
6063
6073
|
return this.http.request(
|
|
6064
6074
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
|
|
6065
|
-
_optionalChain([options, 'optionalAccess',
|
|
6075
|
+
_optionalChain([options, 'optionalAccess', _352 => _352.dryRun]) ? { method: "POST", body: {} } : {
|
|
6066
6076
|
method: "POST",
|
|
6067
6077
|
body: {},
|
|
6068
6078
|
// Reactivation can create an upstream resource, so it must not use
|
|
@@ -6076,7 +6086,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6076
6086
|
// ——————————————————————————————————————————————————————————
|
|
6077
6087
|
static __initStatic() {this.MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH = 96}
|
|
6078
6088
|
monitorJobIdempotencyKey(operation) {
|
|
6079
|
-
const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access',
|
|
6089
|
+
const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _353 => _353.crypto, 'optionalAccess', _354 => _354.randomUUID, 'optionalCall', _355 => _355()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
|
|
6080
6090
|
const prefix = "monitor-job-";
|
|
6081
6091
|
const safeOperation = operation.replace(/[^A-Za-z0-9._-]/g, "-");
|
|
6082
6092
|
const maxOperationLength = Math.max(
|
|
@@ -6087,7 +6097,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6087
6097
|
}
|
|
6088
6098
|
monitorJobHeaders(operation, idempotencyKey) {
|
|
6089
6099
|
return {
|
|
6090
|
-
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess',
|
|
6100
|
+
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _356 => _356.trim, 'call', _357 => _357()]) || this.monitorJobIdempotencyKey(operation)
|
|
6091
6101
|
};
|
|
6092
6102
|
}
|
|
6093
6103
|
async deployMonitorBatch(definitions, options) {
|
|
@@ -6098,7 +6108,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6098
6108
|
body: { version: 1, kind: "batch", monitors: definitions },
|
|
6099
6109
|
headers: this.monitorJobHeaders(
|
|
6100
6110
|
"batch-deploy",
|
|
6101
|
-
_optionalChain([options, 'optionalAccess',
|
|
6111
|
+
_optionalChain([options, 'optionalAccess', _358 => _358.idempotencyKey])
|
|
6102
6112
|
),
|
|
6103
6113
|
maxRetries: 0,
|
|
6104
6114
|
exactUrlOnly: true
|
|
@@ -6117,11 +6127,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6117
6127
|
version: 1,
|
|
6118
6128
|
kind: "batch",
|
|
6119
6129
|
monitors: definitions,
|
|
6120
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6130
|
+
..._optionalChain([options, 'optionalAccess', _359 => _359.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
|
|
6121
6131
|
},
|
|
6122
6132
|
headers: this.monitorJobHeaders(
|
|
6123
6133
|
`batch-sync-${batchId}`,
|
|
6124
|
-
_optionalChain([options, 'optionalAccess',
|
|
6134
|
+
_optionalChain([options, 'optionalAccess', _360 => _360.idempotencyKey])
|
|
6125
6135
|
),
|
|
6126
6136
|
maxRetries: 0,
|
|
6127
6137
|
exactUrlOnly: true
|
|
@@ -6136,7 +6146,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6136
6146
|
body: {},
|
|
6137
6147
|
headers: this.monitorJobHeaders(
|
|
6138
6148
|
`batch-start-${batchId}`,
|
|
6139
|
-
_optionalChain([options, 'optionalAccess',
|
|
6149
|
+
_optionalChain([options, 'optionalAccess', _361 => _361.idempotencyKey])
|
|
6140
6150
|
),
|
|
6141
6151
|
maxRetries: 0,
|
|
6142
6152
|
exactUrlOnly: true
|
|
@@ -6151,7 +6161,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6151
6161
|
body: {},
|
|
6152
6162
|
headers: this.monitorJobHeaders(
|
|
6153
6163
|
`batch-stop-${batchId}`,
|
|
6154
|
-
_optionalChain([options, 'optionalAccess',
|
|
6164
|
+
_optionalChain([options, 'optionalAccess', _362 => _362.idempotencyKey])
|
|
6155
6165
|
),
|
|
6156
6166
|
maxRetries: 0,
|
|
6157
6167
|
exactUrlOnly: true
|
|
@@ -6172,7 +6182,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6172
6182
|
body: {},
|
|
6173
6183
|
headers: this.monitorJobHeaders(
|
|
6174
6184
|
`${action}-${monitorKey}`,
|
|
6175
|
-
_optionalChain([options, 'optionalAccess',
|
|
6185
|
+
_optionalChain([options, 'optionalAccess', _363 => _363.idempotencyKey])
|
|
6176
6186
|
),
|
|
6177
6187
|
maxRetries: 0,
|
|
6178
6188
|
exactUrlOnly: true
|
|
@@ -6185,7 +6195,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6185
6195
|
body: definition,
|
|
6186
6196
|
headers: this.monitorJobHeaders(
|
|
6187
6197
|
`sync-${definition.key}`,
|
|
6188
|
-
_optionalChain([options, 'optionalAccess',
|
|
6198
|
+
_optionalChain([options, 'optionalAccess', _364 => _364.idempotencyKey])
|
|
6189
6199
|
),
|
|
6190
6200
|
maxRetries: 0,
|
|
6191
6201
|
exactUrlOnly: true
|
|
@@ -6198,7 +6208,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6198
6208
|
);
|
|
6199
6209
|
}
|
|
6200
6210
|
async getMonitorJobLogs(jobId, options) {
|
|
6201
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
6211
|
+
const query = _optionalChain([options, 'optionalAccess', _365 => _365.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
|
|
6202
6212
|
return this.http.request(
|
|
6203
6213
|
`/api/v2/monitors/jobs/${encodeURIComponent(jobId)}/logs${query}`,
|
|
6204
6214
|
{ method: "GET" }
|
|
@@ -6211,15 +6221,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6211
6221
|
);
|
|
6212
6222
|
}
|
|
6213
6223
|
async waitForMonitorJob(jobId, options) {
|
|
6214
|
-
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6215
|
-
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6224
|
+
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _366 => _366.timeoutMs]), () => ( 10 * 6e4)));
|
|
6225
|
+
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _367 => _367.pollIntervalMs]), () => ( 2e3)));
|
|
6216
6226
|
const terminal = /* @__PURE__ */ new Set(["succeeded", "failed", "cancelled"]);
|
|
6217
6227
|
const startedAt = Date.now();
|
|
6218
6228
|
let latest = await this.getMonitorJob(jobId);
|
|
6219
6229
|
while (true) {
|
|
6220
|
-
_optionalChain([options, 'optionalAccess',
|
|
6230
|
+
_optionalChain([options, 'optionalAccess', _368 => _368.onProgress, 'optionalCall', _369 => _369(latest)]);
|
|
6221
6231
|
const job = latest.job;
|
|
6222
|
-
const state = typeof _optionalChain([job, 'optionalAccess',
|
|
6232
|
+
const state = typeof _optionalChain([job, 'optionalAccess', _370 => _370.state]) === "string" ? job.state : void 0;
|
|
6223
6233
|
if (state && terminal.has(state)) return latest;
|
|
6224
6234
|
if (Date.now() - startedAt >= timeoutMs) return latest;
|
|
6225
6235
|
await sleep(pollIntervalMs);
|
|
@@ -6230,12 +6240,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6230
6240
|
// Monitor Fleets
|
|
6231
6241
|
// ——————————————————————————————————————————————————————————
|
|
6232
6242
|
monitorFleetIdempotencyKey(operation) {
|
|
6233
|
-
const uuid = _optionalChain([globalThis, 'access',
|
|
6243
|
+
const uuid = _optionalChain([globalThis, 'access', _371 => _371.crypto, 'optionalAccess', _372 => _372.randomUUID, 'optionalCall', _373 => _373()]);
|
|
6234
6244
|
return `monitor-fleet-${operation}-${_nullishCoalesce(uuid, () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`;
|
|
6235
6245
|
}
|
|
6236
6246
|
monitorFleetHeaders(operation, idempotencyKey) {
|
|
6237
6247
|
return {
|
|
6238
|
-
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess',
|
|
6248
|
+
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _374 => _374.trim, 'call', _375 => _375()]) || this.monitorFleetIdempotencyKey(operation)
|
|
6239
6249
|
};
|
|
6240
6250
|
}
|
|
6241
6251
|
monitorFleetPath(fleetId) {
|
|
@@ -6255,15 +6265,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6255
6265
|
const fleetId = typeof definitionOrId === "string" ? definitionOrId : definitionOrId.id;
|
|
6256
6266
|
const body = {
|
|
6257
6267
|
...typeof definitionOrId === "string" ? {} : { definition: definitionOrId },
|
|
6258
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6259
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6268
|
+
..._optionalChain([options, 'optionalAccess', _376 => _376.dryRun]) ? { dry_run: true } : {},
|
|
6269
|
+
..._optionalChain([options, 'optionalAccess', _377 => _377.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
|
|
6260
6270
|
};
|
|
6261
6271
|
return this.http.request(
|
|
6262
6272
|
this.monitorFleetPath(fleetId),
|
|
6263
6273
|
{
|
|
6264
6274
|
method: "PUT",
|
|
6265
6275
|
body,
|
|
6266
|
-
headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess',
|
|
6276
|
+
headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _378 => _378.idempotencyKey])),
|
|
6267
6277
|
maxRetries: 0,
|
|
6268
6278
|
exactUrlOnly: true
|
|
6269
6279
|
}
|
|
@@ -6276,8 +6286,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6276
6286
|
}
|
|
6277
6287
|
async getMonitorFleet(fleetId, options) {
|
|
6278
6288
|
const params = new URLSearchParams();
|
|
6279
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6280
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6289
|
+
if (_optionalChain([options, 'optionalAccess', _379 => _379.drift])) params.set("drift", "1");
|
|
6290
|
+
if (_optionalChain([options, 'optionalAccess', _380 => _380.limit]) !== void 0)
|
|
6281
6291
|
params.set("limit", String(options.limit));
|
|
6282
6292
|
const query = params.toString();
|
|
6283
6293
|
return this.http.request(
|
|
@@ -6290,10 +6300,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6290
6300
|
this.monitorFleetPath(fleetId),
|
|
6291
6301
|
{
|
|
6292
6302
|
method: "DELETE",
|
|
6293
|
-
body: _optionalChain([options, 'optionalAccess',
|
|
6303
|
+
body: _optionalChain([options, 'optionalAccess', _381 => _381.dryRun]) ? { dry_run: true } : {},
|
|
6294
6304
|
headers: this.monitorFleetHeaders(
|
|
6295
6305
|
"deactivate",
|
|
6296
|
-
_optionalChain([options, 'optionalAccess',
|
|
6306
|
+
_optionalChain([options, 'optionalAccess', _382 => _382.idempotencyKey])
|
|
6297
6307
|
),
|
|
6298
6308
|
maxRetries: 0,
|
|
6299
6309
|
exactUrlOnly: true
|
|
@@ -6308,7 +6318,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6308
6318
|
body: {},
|
|
6309
6319
|
headers: this.monitorFleetHeaders(
|
|
6310
6320
|
"reactivate",
|
|
6311
|
-
_optionalChain([options, 'optionalAccess',
|
|
6321
|
+
_optionalChain([options, 'optionalAccess', _383 => _383.idempotencyKey])
|
|
6312
6322
|
),
|
|
6313
6323
|
maxRetries: 0,
|
|
6314
6324
|
exactUrlOnly: true
|
|
@@ -6325,13 +6335,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6325
6335
|
* identical to "the request failed".
|
|
6326
6336
|
*/
|
|
6327
6337
|
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',
|
|
6338
|
+
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _384 => _384.timeoutMs]), () => ( 10 * 6e4)));
|
|
6339
|
+
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _385 => _385.pollIntervalMs]), () => ( 2e3)));
|
|
6340
|
+
const terminal = _optionalChain([options, 'optionalAccess', _386 => _386.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded"]) : /* @__PURE__ */ new Set(["converged", "degraded", "deactivated"]);
|
|
6331
6341
|
const startedAt = Date.now();
|
|
6332
6342
|
let latest = await this.getMonitorFleet(fleetId);
|
|
6333
6343
|
while (true) {
|
|
6334
|
-
_optionalChain([options, 'optionalAccess',
|
|
6344
|
+
_optionalChain([options, 'optionalAccess', _387 => _387.onProgress, 'optionalCall', _388 => _388(latest)]);
|
|
6335
6345
|
const status = typeof latest.status === "string" ? latest.status : void 0;
|
|
6336
6346
|
if (status && terminal.has(status)) return latest;
|
|
6337
6347
|
if (Date.now() - startedAt >= timeoutMs) return latest;
|