deepline 0.3.535 → 0.3.537
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundling-sources/sdk/src/client-core.ts +232 -147
- package/dist/bundling-sources/sdk/src/index.ts +4 -0
- package/dist/bundling-sources/sdk/src/plays/local-file-discovery.ts +27 -1
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +16 -5
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +2 -23
- package/dist/bundling-sources/shared_libs/integration-contracts/monitor-fleet-contract.ts +26 -14
- package/dist/bundling-sources/shared_libs/integration-contracts/monitor-input-contract.ts +33 -8
- package/dist/bundling-sources/shared_libs/monitors/fleets/count-drift-alert.ts +121 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/limits.ts +8 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/plan.ts +14 -82
- package/dist/bundling-sources/shared_libs/monitors/package.json +1 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +22 -4
- package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +0 -26
- package/dist/bundling-sources/shared_libs/play-runtime/activity-observation.ts +36 -0
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +21 -31
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +88 -96
- package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +12 -10
- package/dist/bundling-sources/shared_libs/play-runtime/durable-summary-events.ts +3 -1
- package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +71 -2
- package/dist/bundling-sources/shared_libs/play-runtime/governor/governor.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/governor/rate-state-backend.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/map-memory-limits.ts +127 -9
- package/dist/bundling-sources/shared_libs/play-runtime/memory-ledger.ts +15 -2
- package/dist/bundling-sources/shared_libs/play-runtime/prebuilt-result-quality.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/provider-capacity/fixture-capacity-simulator.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/provider-capacity/gradient2-concurrency-controller.ts +41 -0
- package/dist/bundling-sources/shared_libs/play-runtime/provider-capacity/provider-capacity-policy.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/provider-capacity/provider-concurrency-policy.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +5 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-tool-hooks.ts +8 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-compute-usage.ts +31 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +26 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-scope.ts +11 -4
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +73 -18
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +169 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +26 -4
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +84 -49
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +37 -32
- package/dist/bundling-sources/shared_libs/plays/launch/input-contract.ts +13 -1
- package/dist/bundling-sources/shared_libs/plays/local-file-discovery.ts +68 -1
- package/dist/bundling-sources/shared_libs/product-notifications/configuration-draft.ts +57 -1
- package/dist/bundling-sources/shared_libs/product-notifications/configuration.ts +22 -9
- package/dist/cli/{auth-ZCTMB5RA.mjs → auth-4SUPGDIM.mjs} +7 -7
- package/dist/cli/auth-Y2K2ZYYA.js +43 -0
- package/dist/cli/{billing-OU2ZHL72.mjs → billing-5JUA3ZM3.mjs} +185 -24
- package/dist/cli/{billing-GVFKZQH3.js → billing-SQU726P7.js} +273 -112
- package/dist/cli/{chunk-T2N3B7IQ.js → chunk-2GJZLIKW.js} +8 -8
- package/dist/cli/{chunk-ZUVE63Y7.js → chunk-2Q7VXTMS.js} +2 -2
- package/dist/cli/{chunk-WAIBM6KX.mjs → chunk-37AZHCTP.mjs} +5 -5
- package/dist/cli/{chunk-D4MHCCIR.js → chunk-3PMCQ3LK.js} +33 -33
- package/dist/cli/{chunk-R4RG4FV5.mjs → chunk-4KWD3MX2.mjs} +13 -10
- package/dist/cli/{chunk-PI5R65OQ.js → chunk-5EOEJKSV.js} +1 -1
- package/dist/cli/{chunk-XSOTEVOB.js → chunk-6BBGUQJJ.js} +50 -141
- package/dist/cli/{chunk-OM732MGV.js → chunk-ALHKB3AE.js} +17 -17
- package/dist/cli/{chunk-6LHX33VN.js → chunk-AVQET3NR.js} +9 -6
- package/dist/cli/{chunk-W6T23EUC.mjs → chunk-AX2OAXDL.mjs} +1 -1
- package/dist/cli/{chunk-SQWET4SL.js → chunk-BBTKAASQ.js} +2 -1
- package/dist/cli/{chunk-G2DLG32W.mjs → chunk-BFHR7IC2.mjs} +40 -27
- package/dist/cli/{chunk-KWGXHPHL.js → chunk-BGXEMTIG.js} +523 -59
- package/dist/cli/{chunk-AUEUAPVS.mjs → chunk-BRRCWUOW.mjs} +1 -1
- package/dist/cli/{chunk-QYBAHYP4.mjs → chunk-C37VELBR.mjs} +7 -9
- package/dist/cli/{chunk-H6SWS5CG.mjs → chunk-C3XD2WHM.mjs} +2 -2
- package/dist/cli/{chunk-NRO3NTVO.js → chunk-CBV7AKWM.js} +5 -5
- package/dist/cli/{chunk-CIDATNTY.js → chunk-CFND2ACL.js} +16 -16
- package/dist/cli/{chunk-J75DANZY.mjs → chunk-CGDW2CRR.mjs} +2 -2
- package/dist/cli/{chunk-RFQWSH6I.js → chunk-CHIGEDAE.js} +3 -3
- package/dist/cli/{chunk-QNHHZ63P.mjs → chunk-CQBIO6HW.mjs} +1 -1
- package/dist/cli/{chunk-2KHUFWTK.js → chunk-CQDQNZGH.js} +42 -37
- package/dist/cli/{chunk-E3CLOVG5.mjs → chunk-CXTW7SRW.mjs} +50 -141
- package/dist/cli/{chunk-4NLRWKZB.js → chunk-D77W6Q67.js} +26 -26
- package/dist/cli/{chunk-JWWYLGUT.mjs → chunk-EEFSUCYP.mjs} +475 -11
- package/dist/cli/{chunk-STR5LXK4.mjs → chunk-FSIVF2SI.mjs} +1 -1
- package/dist/cli/{chunk-6TYRRNXY.mjs → chunk-GI3V4D7K.mjs} +2 -2
- package/dist/cli/{chunk-DFJODFMC.mjs → chunk-GPMS6OPX.mjs} +5 -5
- package/dist/cli/{chunk-5YAJGRWB.js → chunk-IPVRMYWT.js} +7 -7
- package/dist/cli/{chunk-DAPKLYST.js → chunk-IQOIT6E3.js} +41 -41
- package/dist/cli/{chunk-ZPGGW27Q.mjs → chunk-JL2OTMSG.mjs} +1 -0
- package/dist/cli/{chunk-FGN75ZN6.js → chunk-JMHYDDBQ.js} +390 -382
- package/dist/cli/{chunk-KA6ZERJL.js → chunk-JS2SBCWD.js} +6 -6
- package/dist/cli/{chunk-W5YJYU4G.mjs → chunk-K4WJ4BYO.mjs} +2 -2
- package/dist/cli/{chunk-LVISZFYO.mjs → chunk-KH27B2HJ.mjs} +2 -2
- package/dist/cli/{chunk-UUQ2OXMH.js → chunk-KULT6O5K.js} +18 -20
- package/dist/cli/{chunk-YFZLZNTH.mjs → chunk-L3JVGNAT.mjs} +4 -4
- package/dist/cli/{chunk-HYBZWSSH.js → chunk-L6QAIZNZ.js} +44 -44
- package/dist/cli/{chunk-TCVCFZP6.mjs → chunk-NU7B5X6J.mjs} +4 -1
- package/dist/cli/{chunk-7PXP2FQK.js → chunk-NXGLJGPB.js} +2 -2
- package/dist/cli/{chunk-BNH4Y35W.mjs → chunk-OLH2PHMC.mjs} +2 -2
- package/dist/cli/{chunk-GESIFFQX.mjs → chunk-OVX3Q5Q3.mjs} +1 -1
- package/dist/cli/{chunk-2D6SWQTK.js → chunk-PJ4ZGZAN.js} +13 -13
- package/dist/cli/{chunk-HWPOXCCK.js → chunk-PU42VOBI.js} +8 -8
- package/dist/cli/{chunk-RKY4LBX3.mjs → chunk-QDBGPRR2.mjs} +3 -3
- package/dist/cli/{chunk-KOZBZPRM.js → chunk-QPDLG7DQ.js} +55 -55
- package/dist/cli/{chunk-DWPY6ZID.mjs → chunk-R7JYG6XO.mjs} +1 -1
- package/dist/cli/{chunk-K76AEBFY.mjs → chunk-RMVZTBI5.mjs} +4 -4
- package/dist/cli/{chunk-IF75RD6U.js → chunk-U2LVWCTD.js} +18 -6
- package/dist/cli/{chunk-WNNA4L6Z.js → chunk-UGA5KI4A.js} +22 -22
- package/dist/cli/{chunk-ZS2WHWWL.js → chunk-UNDLNT3V.js} +1 -1
- package/dist/cli/{chunk-7CWSAEYS.mjs → chunk-V5IIBG2E.mjs} +1 -1
- package/dist/cli/{chunk-BF65LB7X.mjs → chunk-VP2K5B3R.mjs} +4 -4
- package/dist/cli/{chunk-DYIWDUY4.js → chunk-VRYX2BR4.js} +316 -303
- package/dist/cli/{chunk-R2KKEHJN.mjs → chunk-W3J3LT22.mjs} +5 -5
- package/dist/cli/{chunk-PHLNYBAA.js → chunk-WBFOV5HT.js} +5 -5
- package/dist/cli/{chunk-5EKNDNFQ.js → chunk-WBTYWJLN.js} +2 -2
- package/dist/cli/{chunk-C374C22Y.js → chunk-WOQO3GV4.js} +14 -11
- package/dist/cli/{chunk-K3IPGMGP.js → chunk-XDS26J7Z.js} +17 -19
- package/dist/cli/{chunk-JQQG4QL4.mjs → chunk-Y6AMMXWS.mjs} +3 -3
- package/dist/cli/{chunk-7R5DAANG.mjs → chunk-Z2PPB3IO.mjs} +1 -1
- package/dist/cli/{chunk-FKD3KL5Q.mjs → chunk-Z2XA6YU4.mjs} +10 -5
- package/dist/cli/{chunk-243O3FH5.js → chunk-ZFSB7GXF.js} +5 -5
- package/dist/cli/{chunk-MI6ZP7XI.mjs → chunk-ZG7BOECV.mjs} +18 -6
- package/dist/cli/{chunk-FZKPPB5P.mjs → chunk-ZHPSJ3LJ.mjs} +85 -77
- package/dist/cli/{chunk-K53NKWZO.mjs → chunk-ZUAMXZXC.mjs} +13 -15
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-CLPVMIRF.mjs → csv-HZP6QMG7.mjs} +6 -6
- package/dist/cli/{csv-CD55KEIO.js → csv-JITYN27L.js} +15 -15
- package/dist/cli/{db-MQKLDAEO.js → db-FYSRB7O4.js} +36 -36
- package/dist/cli/{db-AU4SMWUN.mjs → db-QRIRTOMM.mjs} +9 -9
- package/dist/cli/describe-LSOHOLFI.js +49 -0
- package/dist/cli/describe-REXJVJC3.mjs +49 -0
- package/dist/cli/describe-core.d.mts +3 -3
- package/dist/cli/describe-core.d.ts +3 -3
- package/dist/cli/describe-core.js +5 -5
- package/dist/cli/describe-core.mjs +4 -4
- package/dist/cli/{executions-TFIJPUX7.mjs → executions-53KJAFOW.mjs} +9 -9
- package/dist/cli/{executions-77GOLWRM.js → executions-BSTF4DDS.js} +11 -11
- package/dist/cli/{feedback-OV5YAL3A.js → feedback-6MW3QOXX.js} +16 -16
- package/dist/cli/{feedback-2WRSZ5WL.mjs → feedback-CWUJJF3J.mjs} +8 -8
- package/dist/cli/{git-VNS4ATLZ.mjs → git-CKVZTJFS.mjs} +7 -7
- package/dist/cli/git-S7SWUZ3T.js +25 -0
- package/dist/cli/index.js +151 -157
- package/dist/cli/index.mjs +51 -57
- package/dist/cli/{legacy-noops-HDOB5C6F.js → legacy-noops-QBL4PNGB.js} +11 -11
- package/dist/cli/{legacy-noops-C732QDCY.mjs → legacy-noops-USTBRFRX.mjs} +8 -8
- package/dist/cli/{monitors-2LYEFXOU.mjs → monitors-6UCG5D7W.mjs} +19 -16
- package/dist/cli/{monitors-5IUMHH3E.js → monitors-VCR6SUZD.js} +125 -122
- package/dist/cli/{org-G4YGZPHS.mjs → org-GSRBOJVO.mjs} +9 -9
- package/dist/cli/{org-ADW2EVAC.js → org-HPILTEG4.js} +89 -89
- package/dist/cli/{play-7GQ56C2D.mjs → play-QRTYQNG4.mjs} +123 -76
- package/dist/cli/{play-EHSOSSHT.js → play-TK7WOP5H.js} +641 -594
- package/dist/cli/{providers-PWCF6OOO.js → providers-HEXNJ5QC.js} +12 -12
- package/dist/cli/{providers-WL3YTCSV.mjs → providers-OAQJWVBS.mjs} +9 -9
- package/dist/cli/{quickstart-323XOPGI.mjs → quickstart-FFVHTPSP.mjs} +6 -6
- package/dist/cli/{quickstart-ZKI5MURA.js → quickstart-PYZTFXZX.js} +8 -8
- package/dist/cli/{run-XZPWA6JS.js → run-4DWJXJRO.js} +50 -53
- package/dist/cli/{run-ZCNZU3K2.mjs → run-HLN6YYZH.mjs} +31 -34
- package/dist/cli/search-WERQBC6V.js +32 -0
- package/dist/cli/{search-CVLVSFMJ.mjs → search-ZHRCXGEL.mjs} +10 -11
- package/dist/cli/{search-output-7HRSSRBS.js → search-output-2KY6PFDH.js} +8 -8
- package/dist/cli/{search-output-6PY6RN2R.mjs → search-output-N7QXACVK.mjs} +6 -6
- package/dist/cli/{secrets-6S2ZWDIM.mjs → secrets-FKMWBLHU.mjs} +9 -9
- package/dist/cli/{secrets-IYD5VKY4.js → secrets-WXQ7XO5C.js} +18 -18
- package/dist/cli/{sessions-GVEX5TUJ.mjs → sessions-3YDTEDA5.mjs} +8 -8
- package/dist/cli/sessions-LXQ4Q6BS.js +22 -0
- package/dist/cli/{settings-CANK4HJQ.js → settings-67TWLQ6E.js} +88 -89
- package/dist/cli/{settings-BN5MJZ3C.mjs → settings-JTPASUZN.mjs} +15 -16
- package/dist/cli/{setup-YSGKGLSJ.js → setup-KUERQJUX.js} +51 -52
- package/dist/cli/{setup-JNMSCCU4.mjs → setup-VYNGXUJ6.mjs} +11 -12
- package/dist/cli/skills-EFRLHY3F.js +36 -0
- package/dist/cli/{skills-QCQN2UM2.mjs → skills-KI4KYHH6.mjs} +9 -10
- package/dist/cli/tools-C3EIGFFP.js +56 -0
- package/dist/cli/{tools-CDPOID7V.mjs → tools-UQDJS2RS.mjs} +20 -21
- package/dist/cli/{update-D3ZERUQ3.mjs → update-7FQQUBOD.mjs} +11 -12
- package/dist/cli/update-KCY72RXH.js +34 -0
- package/dist/cli/{views-RDZRWQBQ.mjs → views-JAM4MNNV.mjs} +54 -10
- package/dist/cli/{views-4NV2KQKA.js → views-MJK7JGZG.js} +66 -22
- package/dist/cli/{workflow-RABJCAZC.js → workflow-AQPRIWQX.js} +20 -20
- package/dist/cli/{workflow-2CG3TVCG.mjs → workflow-TQRV5FGO.mjs} +10 -10
- package/dist/{client-DhSvMO3A.d.mts → client-BlLYQDNo.d.mts} +1 -1
- package/dist/{client-oGNJMQFd.d.ts → client-DSQlkIDO.d.ts} +1 -1
- package/dist/{client-core-CdWH6Sii.d.ts → client-core-CDwapXy5.d.ts} +159 -108
- package/dist/{client-core-CVG1Et-4.d.mts → client-core-rX7n2H8U.d.mts} +159 -108
- package/dist/{compiler-manifest-D2ZlBGxj.d.ts → compiler-manifest-BHNC4RL-.d.mts} +15 -22
- package/dist/{compiler-manifest-D2ZlBGxj.d.mts → compiler-manifest-BHNC4RL-.d.ts} +15 -22
- package/dist/{errors-B-gOQdj-.d.mts → errors-D7sPXrvB.d.mts} +1 -1
- package/dist/{errors-CB0KAmmV.d.ts → errors-lhtIWG5Z.d.ts} +1 -1
- package/dist/{index-c3nvUGCS.d.ts → index-CQTBHXHr.d.ts} +1 -1
- package/dist/{index-BbJADro4.d.mts → index-NaDZq2xf.d.mts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +15 -15
- package/dist/index.mjs +11 -11
- package/dist/install-integrity.json +129 -132
- package/dist/monitor-fleet-contract.d.mts +17 -11
- package/dist/monitor-fleet-contract.d.ts +17 -11
- package/dist/monitor-fleet-contract.js +3 -3
- package/dist/monitor-fleet-contract.mjs +2 -2
- package/dist/monitor-input-contract.js +2 -2
- package/dist/monitor-input-contract.mjs +1 -1
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/bundle-play-file.mjs +17 -5
- package/dist/plays/csv-data-input.js +3 -3
- package/dist/plays/csv-data-input.mjs +2 -2
- package/dist/plays/play-description.d.mts +2 -2
- package/dist/plays/play-description.d.ts +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/plays/run-request.js +3 -3
- package/dist/plays/run-request.mjs +2 -2
- 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/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +12 -12
- package/dist/server.mjs +6 -6
- package/package.json +1 -1
- package/dist/cli/auth-VDCU3T6A.js +0 -43
- package/dist/cli/chunk-4QELPWUW.mjs +0 -405
- package/dist/cli/chunk-T7RBM2WX.js +0 -405
- package/dist/cli/describe-5BFNHT5V.js +0 -50
- package/dist/cli/describe-AWJUXE2U.mjs +0 -50
- package/dist/cli/git-HGMX52XU.js +0 -25
- package/dist/cli/pages-KXKWSCEV.mjs +0 -266
- package/dist/cli/pages-VTJGAI2D.js +0 -266
- package/dist/cli/search-J6EY7DQN.js +0 -33
- package/dist/cli/sessions-7HPIVSQ4.js +0 -22
- package/dist/cli/skills-WDGSSKJZ.js +0 -37
- package/dist/cli/tools-URNVXSTZ.js +0 -57
- package/dist/cli/update-Q6JW32IA.js +0 -35
|
@@ -20,7 +20,7 @@ var _chunkE4CABWXLjs = require('./chunk-E4CABWXL.js');
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunkCQDQNZGHjs = require('./chunk-CQDQNZGH.js');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
@@ -31,16 +31,16 @@ var _chunkPMH4GLMDjs = require('./chunk-PMH4GLMD.js');
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _chunk3PMCQ3LKjs = require('./chunk-3PMCQ3LK.js');
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunk2GJZLIKWjs = require('./chunk-2GJZLIKW.js');
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
var
|
|
43
|
+
var _chunkBBTKAASQjs = require('./chunk-BBTKAASQ.js');
|
|
44
44
|
|
|
45
45
|
// src/pagination.ts
|
|
46
46
|
async function* iterateCursorPages(fetchPage) {
|
|
@@ -74,7 +74,7 @@ function requireBillingIdempotencyKey(value) {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
if (!valid) {
|
|
77
|
-
throw new (0,
|
|
77
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
78
78
|
"Billing idempotencyKey must contain 1\u2013200 characters with no leading or trailing whitespace and be valid HTTP header text.",
|
|
79
79
|
void 0,
|
|
80
80
|
"INVALID_BILLING_IDEMPOTENCY_KEY"
|
|
@@ -86,23 +86,23 @@ function requireBillingIdempotencyKey(value) {
|
|
|
86
86
|
// src/db/query.ts
|
|
87
87
|
function planCustomerDbQuery(input, maxRetries = 3) {
|
|
88
88
|
if (typeof input.sql !== "string" || !input.sql.trim())
|
|
89
|
-
throw new (0,
|
|
89
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)("sql must not be empty.", 400, "INVALID_SQL");
|
|
90
90
|
if (input.operationKey !== void 0 && typeof input.operationKey !== "string")
|
|
91
|
-
throw new (0,
|
|
91
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
92
92
|
"operationKey must be a string containing 1\u2013512 characters.",
|
|
93
93
|
400,
|
|
94
94
|
"INVALID_OPERATION_KEY"
|
|
95
95
|
);
|
|
96
96
|
const operationKey = input.operationKey;
|
|
97
97
|
if (operationKey !== void 0 && (!operationKey.trim() || operationKey.length > 512)) {
|
|
98
|
-
throw new (0,
|
|
98
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
99
99
|
"operationKey must contain 1\u2013512 characters.",
|
|
100
100
|
400,
|
|
101
101
|
"INVALID_OPERATION_KEY"
|
|
102
102
|
);
|
|
103
103
|
}
|
|
104
104
|
if (input.maxRows !== void 0 && (!Number.isSafeInteger(input.maxRows) || input.maxRows < 1 || input.maxRows > 1e3)) {
|
|
105
|
-
throw new (0,
|
|
105
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
106
106
|
"maxRows must be a whole number from 1 to 1000.",
|
|
107
107
|
400,
|
|
108
108
|
"INVALID_MAX_ROWS"
|
|
@@ -144,10 +144,10 @@ async function queryCustomerDatabase(http, input, maxRetries) {
|
|
|
144
144
|
}
|
|
145
145
|
);
|
|
146
146
|
} catch (error) {
|
|
147
|
-
if (error instanceof
|
|
147
|
+
if (error instanceof _chunkBBTKAASQjs.DeeplineError && (_optionalChain([error, 'access', _ => _.code, 'optionalAccess', _2 => _2.startsWith, 'call', _3 => _3("NETWORK_")]) || // Older API readers return PostgreSQL errors as HTTP 400, including
|
|
148
148
|
// lost connections and explicitly unknown transaction resolution.
|
|
149
149
|
/^08[A-Z0-9]{3}$/.test(_nullishCoalesce(error.code, () => ( ""))) || ["57P01", "57P02", "57P03"].includes(_nullishCoalesce(error.code, () => ( ""))) || error.statusCode === 408 || (_nullishCoalesce(error.statusCode, () => ( 0))) >= 500)) {
|
|
150
|
-
throw new (0,
|
|
150
|
+
throw new (0, _chunk2GJZLIKWjs.CustomerDbQueryOutcomeUnknownError)(
|
|
151
151
|
error,
|
|
152
152
|
plan.request.body.operation_key
|
|
153
153
|
);
|
|
@@ -155,8 +155,8 @@ async function queryCustomerDatabase(http, input, maxRetries) {
|
|
|
155
155
|
throw error;
|
|
156
156
|
}
|
|
157
157
|
if (!result || typeof result !== "object" || Array.isArray(result) || typeof result.command !== "string" || !Array.isArray(result.columns) || !Array.isArray(result.rows) || typeof result.truncated !== "boolean" || result.row_count !== null && (!Number.isSafeInteger(result.row_count) || result.row_count < 0) || !Number.isSafeInteger(result.row_count_returned) || result.row_count_returned < 0) {
|
|
158
|
-
throw new (0,
|
|
159
|
-
new (0,
|
|
158
|
+
throw new (0, _chunk2GJZLIKWjs.CustomerDbQueryOutcomeUnknownError)(
|
|
159
|
+
new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
160
160
|
"The SQL response did not contain a valid result.",
|
|
161
161
|
200,
|
|
162
162
|
"CUSTOMER_DB_QUERY_RESPONSE_INVALID"
|
|
@@ -166,8 +166,8 @@ async function queryCustomerDatabase(http, input, maxRetries) {
|
|
|
166
166
|
}
|
|
167
167
|
const operation = result.operation;
|
|
168
168
|
if (input.operationKey !== void 0 && (!operation || operation.operation_key !== input.operationKey || !Number.isSafeInteger(operation.completed_at_ms) || operation.completed_at_ms < 0 || !["executed", "operation_recovery"].includes(operation.source))) {
|
|
169
|
-
throw new (0,
|
|
170
|
-
new (0,
|
|
169
|
+
throw new (0, _chunk2GJZLIKWjs.CustomerDbQueryOutcomeUnknownError)(
|
|
170
|
+
new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
171
171
|
"The server did not confirm the original atomic SQL operation.",
|
|
172
172
|
200,
|
|
173
173
|
"CUSTOMER_DB_OPERATION_ACK_INVALID"
|
|
@@ -446,7 +446,7 @@ function usesExtendedBetterContactLauncherBudget(toolId) {
|
|
|
446
446
|
var CLI_INVOCATION_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
447
447
|
function validateCliInvocationId(value) {
|
|
448
448
|
if (!CLI_INVOCATION_ID_PATTERN.test(value)) {
|
|
449
|
-
throw new (0,
|
|
449
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
450
450
|
"CLI invocation IDs must be UUID v4 values.",
|
|
451
451
|
void 0,
|
|
452
452
|
"CLI_INVOCATION_ID_INVALID"
|
|
@@ -462,7 +462,7 @@ var RAW_V2_EXECUTE_RESPONSE_CONTRACT = _chunkE4CABWXLjs.RAW_V2_TOOL_RESPONSE_CON
|
|
|
462
462
|
var DEFAULT_EXECUTION_RECOVERY_TIMEOUT_MS = 15 * 60 * 1e3;
|
|
463
463
|
function validateExecutionIdempotencyKey(key) {
|
|
464
464
|
if (typeof key !== "string" || key.length < 1 || key.length > 200 || !/^[A-Za-z0-9._:-]+$/.test(key)) {
|
|
465
|
-
throw new (0,
|
|
465
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
466
466
|
"Execution idempotency keys must be 1\u2013200 ASCII letters, digits, dots, underscores, colons, or hyphens.",
|
|
467
467
|
void 0,
|
|
468
468
|
"IDEMPOTENCY_KEY_INVALID"
|
|
@@ -475,20 +475,20 @@ function getExecutionRecoveryState(value) {
|
|
|
475
475
|
return state === "running" || state === "completed" || state === "outcome_unknown" ? state : null;
|
|
476
476
|
}
|
|
477
477
|
function isRecoverableExecutionAttemptError(error) {
|
|
478
|
-
if (error instanceof
|
|
478
|
+
if (error instanceof _chunkBBTKAASQjs.ToolExecutionError) {
|
|
479
479
|
return error.code === "EXECUTION_IN_PROGRESS" || error.origin === "deepline" && error.category === "network" && error.networkScope === "client_to_deepline";
|
|
480
480
|
}
|
|
481
|
-
return error instanceof
|
|
481
|
+
return error instanceof _chunkBBTKAASQjs.DeeplineError && (error.code === "EXECUTION_IN_PROGRESS" || _optionalChain([error, 'access', _9 => _9.code, 'optionalAccess', _10 => _10.startsWith, 'call', _11 => _11("NETWORK_")]) === true && error.statusCode === void 0);
|
|
482
482
|
}
|
|
483
483
|
function isRecoverableExecutionLookupError(error) {
|
|
484
484
|
if (isRecoverableExecutionAttemptError(error)) return true;
|
|
485
|
-
return error instanceof
|
|
485
|
+
return error instanceof _chunkBBTKAASQjs.DeeplineError && (error.statusCode === 429 || error.statusCode !== void 0 && error.statusCode >= 500);
|
|
486
486
|
}
|
|
487
487
|
function timeoutWithinRecoveryBudget(requestTimeoutMs, defaultRequestTimeoutMs, remainingMs) {
|
|
488
488
|
return Math.min(_nullishCoalesce(requestTimeoutMs, () => ( defaultRequestTimeoutMs)), remainingMs);
|
|
489
489
|
}
|
|
490
490
|
function executionRecoveryError(input) {
|
|
491
|
-
return new (0,
|
|
491
|
+
return new (0, _chunkBBTKAASQjs.ToolExecutionError)(input.message, {
|
|
492
492
|
toolId: input.toolId,
|
|
493
493
|
provider: null,
|
|
494
494
|
operation: input.toolId,
|
|
@@ -596,7 +596,7 @@ var ToolCalls = class {
|
|
|
596
596
|
if (idempotencyKey !== void 0) {
|
|
597
597
|
validateExecutionIdempotencyKey(idempotencyKey);
|
|
598
598
|
if (_optionalChain([options, 'optionalAccess', _16 => _16.recoveryTimeoutMs]) !== void 0 && (!Number.isFinite(options.recoveryTimeoutMs) || options.recoveryTimeoutMs < 0)) {
|
|
599
|
-
throw new (0,
|
|
599
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
600
600
|
"recoveryTimeoutMs must be a finite, non-negative number.",
|
|
601
601
|
void 0,
|
|
602
602
|
"IDEMPOTENCY_KEY_INVALID"
|
|
@@ -613,8 +613,8 @@ var ToolCalls = class {
|
|
|
613
613
|
const headers = {
|
|
614
614
|
[EXECUTE_RESPONSE_CONTRACT_HEADER]: RAW_V2_EXECUTE_RESPONSE_CONTRACT,
|
|
615
615
|
...isApifySync ? { "X-Deepline-Apify-Sync-Response-Budget": "extended-v1" } : {},
|
|
616
|
-
[
|
|
617
|
-
|
|
616
|
+
[_chunkBBTKAASQjs.TOOL_EXECUTION_ERROR_SCHEMA_HEADER]: String(
|
|
617
|
+
_chunkBBTKAASQjs.TOOL_EXECUTION_ERROR_SCHEMA_VERSION
|
|
618
618
|
),
|
|
619
619
|
..._optionalChain([options, 'optionalAccess', _20 => _20.includeToolMetadata]) ? { [INCLUDE_TOOL_METADATA_HEADER]: "true" } : {},
|
|
620
620
|
[EXECUTE_RESPONSE_INTENT_HEADER]: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _21 => _21.responseIntent]), () => ( "raw")),
|
|
@@ -627,7 +627,7 @@ var ToolCalls = class {
|
|
|
627
627
|
if (!lastResponse) return;
|
|
628
628
|
if (failure) {
|
|
629
629
|
const { error } = failure;
|
|
630
|
-
if (isRecoverableExecutionAttemptError(error) || !(error instanceof
|
|
630
|
+
if (isRecoverableExecutionAttemptError(error) || !(error instanceof _chunkBBTKAASQjs.DeeplineError) || error.statusCode === void 0 || error.statusCode !== lastResponse.httpStatus || error.code === "EXECUTION_OUTCOME_UNKNOWN")
|
|
631
631
|
return;
|
|
632
632
|
}
|
|
633
633
|
const body = lastResponse.body;
|
|
@@ -674,7 +674,7 @@ var ToolCalls = class {
|
|
|
674
674
|
idempotencyKey,
|
|
675
675
|
onResponse: (response2) => {
|
|
676
676
|
lastResponse = null;
|
|
677
|
-
atomicToolsSupported = response2.headers.get(
|
|
677
|
+
atomicToolsSupported = response2.headers.get(_chunk3PMCQ3LKjs.ATOMIC_TOOL_EXECUTE_SUPPORTED_HEADER) === "true";
|
|
678
678
|
recoverySupported = response2.headers.get("X-Deepline-Idempotency-Supported") === "true";
|
|
679
679
|
if (_optionalChain([options, 'optionalAccess', _30 => _30.onServerTiming])) {
|
|
680
680
|
try {
|
|
@@ -697,8 +697,8 @@ var ToolCalls = class {
|
|
|
697
697
|
return await post();
|
|
698
698
|
} catch (error) {
|
|
699
699
|
if (atomicToolOnly) {
|
|
700
|
-
if (!atomicToolsSupported && !recoverySupported && !(error instanceof
|
|
701
|
-
throw new (0,
|
|
700
|
+
if (!atomicToolsSupported && !recoverySupported && !(error instanceof _chunkBBTKAASQjs.ToolExecutionError) && error instanceof _chunkBBTKAASQjs.DeeplineError && (error.statusCode === 404 || error.statusCode === 405)) {
|
|
701
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
702
702
|
"This server does not support atomic tool execution.",
|
|
703
703
|
error.statusCode,
|
|
704
704
|
"ATOMIC_TOOL_EXECUTE_UNSUPPORTED"
|
|
@@ -706,7 +706,7 @@ var ToolCalls = class {
|
|
|
706
706
|
}
|
|
707
707
|
throw error;
|
|
708
708
|
}
|
|
709
|
-
if (useLegacyEndpoint || recoverySupported || !(error instanceof
|
|
709
|
+
if (useLegacyEndpoint || recoverySupported || !(error instanceof _chunkBBTKAASQjs.DeeplineError) || error.statusCode !== 404 && error.statusCode !== 405)
|
|
710
710
|
throw error;
|
|
711
711
|
lastResponse = null;
|
|
712
712
|
await this.lookupExecutionByKey(
|
|
@@ -795,7 +795,7 @@ var ToolCalls = class {
|
|
|
795
795
|
recoveryDeadline = Date.now() + recoveryTimeoutMs;
|
|
796
796
|
}
|
|
797
797
|
} catch (error) {
|
|
798
|
-
if (idempotencyKey && error instanceof
|
|
798
|
+
if (idempotencyKey && error instanceof _chunkBBTKAASQjs.DeeplineError && error.code === "EXECUTION_OUTCOME_UNKNOWN") {
|
|
799
799
|
throw executionRecoveryError({
|
|
800
800
|
toolId,
|
|
801
801
|
idempotencyKey,
|
|
@@ -830,7 +830,7 @@ var ToolCalls = class {
|
|
|
830
830
|
validateExecutionIdempotencyKey(idempotencyKey);
|
|
831
831
|
const result = await this.lookupExecutionByKey(idempotencyKey);
|
|
832
832
|
if (!result) {
|
|
833
|
-
throw new (0,
|
|
833
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
834
834
|
`No execution exists for idempotency key ${idempotencyKey}.`,
|
|
835
835
|
404,
|
|
836
836
|
"EXECUTION_NOT_FOUND"
|
|
@@ -856,7 +856,7 @@ var ToolCalls = class {
|
|
|
856
856
|
}
|
|
857
857
|
);
|
|
858
858
|
if (!supported) {
|
|
859
|
-
throw new (0,
|
|
859
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
860
860
|
"This Deepline server does not support recoverable tool executions; no tool was dispatched.",
|
|
861
861
|
422,
|
|
862
862
|
"IDEMPOTENCY_NOT_SUPPORTED"
|
|
@@ -942,7 +942,7 @@ function resolvePlayRunRuntimeSelection(request, env) {
|
|
|
942
942
|
if (request.runtime !== void 0) {
|
|
943
943
|
const runtime = normalizePlayRunRuntimeSelection(request.runtime);
|
|
944
944
|
if (!runtime) {
|
|
945
|
-
throw new (0,
|
|
945
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
946
946
|
'runtime must be { environment: "preview", namespace, backend?: "daytona" | "modal", sandboxPlacementPolicy?: "policy_name@1" } with namespace matching ^[a-z][a-z0-9-]{0,30}$, or { environment: "native", sandboxPlacementPolicy: "policy_name@1" }.',
|
|
947
947
|
void 0,
|
|
948
948
|
"INVALID_RUNTIME_SELECTION"
|
|
@@ -955,7 +955,7 @@ function resolvePlayRunRuntimeSelection(request, env) {
|
|
|
955
955
|
const configuredToken = _optionalChain([env, 'access', _40 => _40.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _41 => _41.trim, 'call', _42 => _42()]);
|
|
956
956
|
const configuredPlacementPolicy = _optionalChain([env, 'access', _43 => _43.DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY, 'optionalAccess', _44 => _44.trim, 'call', _45 => _45()]);
|
|
957
957
|
if (_optionalChain([env, 'access', _46 => _46.DEEPLINE_RUNTIME_GATEWAY_PROFILE, 'optionalAccess', _47 => _47.trim, 'call', _48 => _48()])) {
|
|
958
|
-
throw new (0,
|
|
958
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
959
959
|
"DEEPLINE_RUNTIME_GATEWAY_PROFILE was removed: Runtime gateway profiles (vercel_app@1) are no longer available. Unset it to run on the default gateways.",
|
|
960
960
|
void 0,
|
|
961
961
|
"RUNTIME_GATEWAY_PROFILE_REMOVED"
|
|
@@ -970,7 +970,7 @@ function resolvePlayRunRuntimeSelection(request, env) {
|
|
|
970
970
|
present.push("DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY");
|
|
971
971
|
}
|
|
972
972
|
const isPlural = present.length > 1;
|
|
973
|
-
throw new (0,
|
|
973
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
974
974
|
[
|
|
975
975
|
`Incomplete play runtime selection: ${present.join(" and ")} ${isPlural ? "are" : "is"} set but DEEPLINE_RUNTIME_ENVIRONMENT is not.`,
|
|
976
976
|
"Preview routing requires DEEPLINE_RUNTIME_ENVIRONMENT=preview together with DEEPLINE_RUNTIME_NAMESPACE; the token alone authorizes nothing.",
|
|
@@ -988,7 +988,7 @@ function resolvePlayRunRuntimeSelection(request, env) {
|
|
|
988
988
|
configuredPlacementPolicy
|
|
989
989
|
);
|
|
990
990
|
if (configuredNamespace || !sandboxPlacementPolicy) {
|
|
991
|
-
throw new (0,
|
|
991
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
992
992
|
"DEEPLINE_RUNTIME_ENVIRONMENT=native requires DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY (such as modal_only@1) and no DEEPLINE_RUNTIME_NAMESPACE.",
|
|
993
993
|
void 0,
|
|
994
994
|
"INVALID_RUNTIME_ENVIRONMENT"
|
|
@@ -998,7 +998,7 @@ function resolvePlayRunRuntimeSelection(request, env) {
|
|
|
998
998
|
}
|
|
999
999
|
const environment = normalizePlayRuntimeEnvironment(configured);
|
|
1000
1000
|
if (!environment) {
|
|
1001
|
-
throw new (0,
|
|
1001
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
1002
1002
|
`DEEPLINE_RUNTIME_ENVIRONMENT must be preview or native. Received "${configured}". Omit it to use the app-native runtime.`,
|
|
1003
1003
|
void 0,
|
|
1004
1004
|
"INVALID_RUNTIME_ENVIRONMENT"
|
|
@@ -1006,7 +1006,7 @@ function resolvePlayRunRuntimeSelection(request, env) {
|
|
|
1006
1006
|
}
|
|
1007
1007
|
const namespace = normalizePlayRuntimeNamespace(configuredNamespace);
|
|
1008
1008
|
if (!namespace) {
|
|
1009
|
-
throw new (0,
|
|
1009
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
1010
1010
|
"DEEPLINE_RUNTIME_NAMESPACE is required for preview and must match ^[a-z][a-z0-9-]{0,30}$.",
|
|
1011
1011
|
void 0,
|
|
1012
1012
|
"INVALID_RUNTIME_NAMESPACE"
|
|
@@ -1015,14 +1015,14 @@ function resolvePlayRunRuntimeSelection(request, env) {
|
|
|
1015
1015
|
const configuredBackendValue = _optionalChain([env, 'access', _49 => _49.DEEPLINE_PLAY_RUNNER_BACKEND, 'optionalAccess', _50 => _50.trim, 'call', _51 => _51()]);
|
|
1016
1016
|
const configuredBackend = configuredBackendValue === "daytona" || configuredBackendValue === "modal" ? configuredBackendValue : void 0;
|
|
1017
1017
|
if (configuredBackendValue && !configuredBackend) {
|
|
1018
|
-
throw new (0,
|
|
1018
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
1019
1019
|
`DEEPLINE_PLAY_RUNNER_BACKEND must be daytona or modal for preview runtime selection. Received "${configuredBackendValue}".`,
|
|
1020
1020
|
void 0,
|
|
1021
1021
|
"INVALID_RUNTIME_BACKEND"
|
|
1022
1022
|
);
|
|
1023
1023
|
}
|
|
1024
1024
|
if (configuredPlacementPolicy && !normalizePlayRuntimeSandboxPlacementPolicy(configuredPlacementPolicy)) {
|
|
1025
|
-
throw new (0,
|
|
1025
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
1026
1026
|
`DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY must be a versioned placement policy id such as daytona_only@1. Received "${configuredPlacementPolicy}".`,
|
|
1027
1027
|
void 0,
|
|
1028
1028
|
"INVALID_RUNTIME_SANDBOX_PLACEMENT_POLICY"
|
|
@@ -1052,7 +1052,7 @@ function runtimeSelectionHeaders(runtime, env) {
|
|
|
1052
1052
|
if (!runtime || runtime.environment === "native") return void 0;
|
|
1053
1053
|
const token = _optionalChain([env, 'access', _52 => _52.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _53 => _53.trim, 'call', _54 => _54()]);
|
|
1054
1054
|
if (!token) {
|
|
1055
|
-
throw new (0,
|
|
1055
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
1056
1056
|
"DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN is required for explicit preview runtime selection.",
|
|
1057
1057
|
void 0,
|
|
1058
1058
|
"RUNTIME_ENVIRONMENT_TOKEN_REQUIRED"
|
|
@@ -1060,15 +1060,15 @@ function runtimeSelectionHeaders(runtime, env) {
|
|
|
1060
1060
|
}
|
|
1061
1061
|
const receivers = _optionalChain([env, 'access', _55 => _55.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _56 => _56.trim, 'call', _57 => _57()]);
|
|
1062
1062
|
return {
|
|
1063
|
-
[
|
|
1064
|
-
...receivers ? { [
|
|
1063
|
+
[_chunk3PMCQ3LKjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
|
|
1064
|
+
...receivers ? { [_chunk3PMCQ3LKjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
|
|
1065
1065
|
};
|
|
1066
1066
|
}
|
|
1067
1067
|
function normalizeTestPolicyOverrides(value, source) {
|
|
1068
1068
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
1069
1069
|
return value;
|
|
1070
1070
|
}
|
|
1071
|
-
throw new (0,
|
|
1071
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
1072
1072
|
`${source} must be a JSON object.`,
|
|
1073
1073
|
void 0,
|
|
1074
1074
|
"INVALID_TEST_POLICY_OVERRIDES"
|
|
@@ -1083,7 +1083,7 @@ function parseEnvTestPolicyOverrides(env) {
|
|
|
1083
1083
|
parsed = JSON.parse(trimmed);
|
|
1084
1084
|
} catch (error) {
|
|
1085
1085
|
const detail = error instanceof Error ? ` ${error.message}` : "";
|
|
1086
|
-
throw new (0,
|
|
1086
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
1087
1087
|
`DEEPLINE_TEST_POLICY_OVERRIDES must be valid JSON.${detail}`,
|
|
1088
1088
|
void 0,
|
|
1089
1089
|
"INVALID_TEST_POLICY_OVERRIDES"
|
|
@@ -1095,10 +1095,10 @@ function isRecord2(value) {
|
|
|
1095
1095
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
1096
1096
|
}
|
|
1097
1097
|
function normalizePlayStatus(raw) {
|
|
1098
|
-
const runPackage =
|
|
1098
|
+
const runPackage = _chunkCQDQNZGHjs.isPlayRunPackage.call(void 0, raw) ? raw : _chunkCQDQNZGHjs.isPlayRunPackage.call(void 0, raw.package) ? raw.package : null;
|
|
1099
1099
|
const packageRun = _optionalChain([runPackage, 'optionalAccess', _60 => _60.run]);
|
|
1100
1100
|
const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess', _61 => _61.status]) === "string" ? packageRun.status : null;
|
|
1101
|
-
const status =
|
|
1101
|
+
const status = _chunkCQDQNZGHjs.decodePlayRunPublicStatus.call(void 0, rawStatus);
|
|
1102
1102
|
if (!status) {
|
|
1103
1103
|
throw new Error(
|
|
1104
1104
|
`Invalid play run lifecycle status in API response: ${JSON.stringify(rawStatus)}.`
|
|
@@ -1129,10 +1129,10 @@ var PlayClient = class {
|
|
|
1129
1129
|
async startPlayRun(request, options) {
|
|
1130
1130
|
const resolved = resolveStartPlayRunRequest(request, this.environment);
|
|
1131
1131
|
const headers = runtimeSelectionHeaders(resolved.runtime, this.environment);
|
|
1132
|
-
return
|
|
1132
|
+
return _chunkCQDQNZGHjs.startPlayRun.call(void 0,
|
|
1133
1133
|
this.http,
|
|
1134
1134
|
resolved.request,
|
|
1135
|
-
_optionalChain([options, 'optionalAccess', _65 => _65.cliAdmission]) ? { ...headers, "X-Deepline-API-Major": String(
|
|
1135
|
+
_optionalChain([options, 'optionalAccess', _65 => _65.cliAdmission]) ? { ...headers, "X-Deepline-API-Major": String(_chunk3PMCQ3LKjs.SDK_API_MAJOR) } : headers,
|
|
1136
1136
|
options
|
|
1137
1137
|
);
|
|
1138
1138
|
}
|
|
@@ -1406,13 +1406,13 @@ function stripLeadingTimestamp(line) {
|
|
|
1406
1406
|
|
|
1407
1407
|
// src/runs/read-errors.ts
|
|
1408
1408
|
function isTransientPlayRunReadError(error) {
|
|
1409
|
-
if (error instanceof
|
|
1409
|
+
if (error instanceof _chunkBBTKAASQjs.DeeplineError && error.code === "PLAY_START_OUTCOME_UNKNOWN") {
|
|
1410
1410
|
return false;
|
|
1411
1411
|
}
|
|
1412
|
-
if (error instanceof
|
|
1412
|
+
if (error instanceof _chunkBBTKAASQjs.DeeplineError && error.code === "PLAY_STREAM_NETWORK_ABORTED") {
|
|
1413
1413
|
return true;
|
|
1414
1414
|
}
|
|
1415
|
-
if (error instanceof
|
|
1415
|
+
if (error instanceof _chunkBBTKAASQjs.DeeplineError && typeof error.statusCode === "number") {
|
|
1416
1416
|
return error.statusCode >= 500 && error.statusCode < 600;
|
|
1417
1417
|
}
|
|
1418
1418
|
const text = error instanceof Error ? error.message : String(error);
|
|
@@ -2698,7 +2698,7 @@ var TERMINAL_STATUS_BY_EVENT_TYPE = {
|
|
|
2698
2698
|
|
|
2699
2699
|
// ../play-runtime/run-snapshot-stream.ts
|
|
2700
2700
|
function isTerminalPlayRunLiveStatus(status) {
|
|
2701
|
-
return
|
|
2701
|
+
return _chunkCQDQNZGHjs.isTerminalPlayRunLifecycleStatus.call(void 0, status);
|
|
2702
2702
|
}
|
|
2703
2703
|
function makeRunStreamEvent(input) {
|
|
2704
2704
|
return {
|
|
@@ -3146,7 +3146,7 @@ async function* watchRunEvents(options) {
|
|
|
3146
3146
|
|
|
3147
3147
|
// src/client-core.ts
|
|
3148
3148
|
function invalidToolDiscoveryResponse() {
|
|
3149
|
-
return new (0,
|
|
3149
|
+
return new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
3150
3150
|
"The server returned an invalid tool discovery response.",
|
|
3151
3151
|
502,
|
|
3152
3152
|
"INVALID_TOOL_DISCOVERY_RESPONSE"
|
|
@@ -3223,19 +3223,19 @@ function isolatedCiRuntimeEventReadHeaders(env) {
|
|
|
3223
3223
|
}
|
|
3224
3224
|
const token = _optionalChain([env, 'access', _137 => _137.DEEPLINE_INTERNAL_TOKEN, 'optionalAccess', _138 => _138.trim, 'call', _139 => _139()]);
|
|
3225
3225
|
if (!token) {
|
|
3226
|
-
throw new (0,
|
|
3226
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
3227
3227
|
"DEEPLINE_INTERNAL_TOKEN is required for isolated CI runtime event reads.",
|
|
3228
3228
|
void 0,
|
|
3229
3229
|
"RUNTIME_EVENT_INTERNAL_TOKEN_REQUIRED"
|
|
3230
3230
|
);
|
|
3231
3231
|
}
|
|
3232
|
-
return { [
|
|
3232
|
+
return { [_chunk3PMCQ3LKjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
|
|
3233
3233
|
}
|
|
3234
3234
|
function sleep(ms) {
|
|
3235
3235
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
3236
3236
|
}
|
|
3237
3237
|
function isTransientCompileManifestError(error) {
|
|
3238
|
-
if (error instanceof
|
|
3238
|
+
if (error instanceof _chunkBBTKAASQjs.DeeplineError && typeof error.statusCode === "number") {
|
|
3239
3239
|
return error.statusCode === 408 || error.statusCode === 425 || error.statusCode === 499 || error.statusCode >= 500 && error.statusCode < 600;
|
|
3240
3240
|
}
|
|
3241
3241
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -3246,7 +3246,7 @@ function isTransientCompileManifestError(error) {
|
|
|
3246
3246
|
function requireCompileManifestResponse(response, playName) {
|
|
3247
3247
|
const compilerManifest = _optionalChain([response, 'optionalAccess', _140 => _140.compilerManifest]);
|
|
3248
3248
|
if (!compilerManifest || typeof compilerManifest !== "object" || Array.isArray(compilerManifest)) {
|
|
3249
|
-
throw new (0,
|
|
3249
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
3250
3250
|
`Compile manifest response did not include compilerManifest for ${playName}.`,
|
|
3251
3251
|
502,
|
|
3252
3252
|
"API_RESPONSE_INVALID",
|
|
@@ -3360,7 +3360,7 @@ function playLiveRunStatus(event) {
|
|
|
3360
3360
|
return null;
|
|
3361
3361
|
}
|
|
3362
3362
|
const payload = getPlayLiveEventPayload(event);
|
|
3363
|
-
return _nullishCoalesce(
|
|
3363
|
+
return _nullishCoalesce(_chunkCQDQNZGHjs.decodePlayRunPublicStatus.call(void 0, payload.status), () => ( (_chunkCQDQNZGHjs.isPlayRunPackage.call(void 0, payload) ? _chunkCQDQNZGHjs.decodePlayRunPublicStatus.call(void 0, payload.run.status) : null)));
|
|
3364
3364
|
}
|
|
3365
3365
|
function appendPlayLiveLogLines(state, payload) {
|
|
3366
3366
|
const lines = readStringArray(payload.lines);
|
|
@@ -3392,7 +3392,7 @@ function updatePlayLiveStatusState(state, event) {
|
|
|
3392
3392
|
if (event.type !== "play.run.snapshot" && event.type !== "play.run.status" && event.type !== "play.run.final_status") {
|
|
3393
3393
|
return null;
|
|
3394
3394
|
}
|
|
3395
|
-
const runId = typeof payload.runId === "string" && payload.runId ? payload.runId :
|
|
3395
|
+
const runId = typeof payload.runId === "string" && payload.runId ? payload.runId : _chunkCQDQNZGHjs.isPlayRunPackage.call(void 0, payload) ? payload.run.id : state.runId;
|
|
3396
3396
|
const status = _nullishCoalesce(playLiveRunStatus(event), () => ( state.status));
|
|
3397
3397
|
const progressPayload = isRecord3(payload.progress) ? payload.progress : {};
|
|
3398
3398
|
if (event.type === "play.run.final_status" && state.logs.length === 0 && state.lastLogSeq === 0) {
|
|
@@ -3405,7 +3405,7 @@ function updatePlayLiveStatusState(state, event) {
|
|
|
3405
3405
|
}
|
|
3406
3406
|
if ("result" in payload) {
|
|
3407
3407
|
state.result = payload.result;
|
|
3408
|
-
} else if (
|
|
3408
|
+
} else if (_chunkCQDQNZGHjs.isPlayRunPackage.call(void 0, payload)) {
|
|
3409
3409
|
state.result = payload;
|
|
3410
3410
|
}
|
|
3411
3411
|
if (typeof payload.error === "string" && payload.error.trim()) {
|
|
@@ -3418,7 +3418,7 @@ function updatePlayLiveStatusState(state, event) {
|
|
|
3418
3418
|
...payload,
|
|
3419
3419
|
runId,
|
|
3420
3420
|
status,
|
|
3421
|
-
...
|
|
3421
|
+
..._chunkCQDQNZGHjs.isPlayRunPackage.call(void 0, payload) ? { package: payload, outputs: payload.outputs } : {},
|
|
3422
3422
|
progress: {
|
|
3423
3423
|
...progressRecord,
|
|
3424
3424
|
status: typeof progressRecord.status === "string" ? progressRecord.status : status,
|
|
@@ -3537,7 +3537,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3537
3537
|
usageEvent: (requestId) => this.getBillingUsageEvent(requestId),
|
|
3538
3538
|
usageEvents: (options) => this.getBillingUsageEvents(options),
|
|
3539
3539
|
usage: (options) => this.getBillingUsage(options),
|
|
3540
|
-
targetPlans: () => this.getTargetBillingPlans(),
|
|
3540
|
+
targetPlans: (options) => this.getTargetBillingPlans(options),
|
|
3541
3541
|
targetStatus: () => this.getTargetBillingStatus(),
|
|
3542
3542
|
autoRecharge: {
|
|
3543
3543
|
get: () => this.getTargetAutoRecharge(),
|
|
@@ -3552,6 +3552,37 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3552
3552
|
),
|
|
3553
3553
|
update: (options) => this.updateTargetAutoRecharge(options)
|
|
3554
3554
|
},
|
|
3555
|
+
cards: {
|
|
3556
|
+
list: (options) => {
|
|
3557
|
+
const query = new URLSearchParams();
|
|
3558
|
+
if (_optionalChain([options, 'optionalAccess', _158 => _158.limit]) !== void 0) {
|
|
3559
|
+
query.set("limit", String(options.limit));
|
|
3560
|
+
}
|
|
3561
|
+
if (_optionalChain([options, 'optionalAccess', _159 => _159.cursor])) query.set("cursor", options.cursor);
|
|
3562
|
+
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
3563
|
+
return this.http.get(
|
|
3564
|
+
`/api/v2/billing/payment-methods${suffix}`
|
|
3565
|
+
);
|
|
3566
|
+
},
|
|
3567
|
+
add: (options) => this.http.post(
|
|
3568
|
+
"/api/v2/billing/payment-method/setup",
|
|
3569
|
+
{ make_default: _optionalChain([options, 'optionalAccess', _160 => _160.makeDefault]) === true }
|
|
3570
|
+
),
|
|
3571
|
+
setDefault: (options) => this.http.post(
|
|
3572
|
+
"/api/v2/billing/payment-methods/default",
|
|
3573
|
+
{
|
|
3574
|
+
card_id: options.cardId,
|
|
3575
|
+
change_id: _nullishCoalesce(options.changeId, () => ( globalThis.crypto.randomUUID()))
|
|
3576
|
+
}
|
|
3577
|
+
),
|
|
3578
|
+
remove: (options) => this.http.post(
|
|
3579
|
+
"/api/v2/billing/payment-methods/remove",
|
|
3580
|
+
{
|
|
3581
|
+
card_id: options.cardId,
|
|
3582
|
+
change_id: _nullishCoalesce(options.changeId, () => ( globalThis.crypto.randomUUID()))
|
|
3583
|
+
}
|
|
3584
|
+
)
|
|
3585
|
+
},
|
|
3555
3586
|
purchaseCredits: (options) => this.purchaseTargetBillingCredits(options),
|
|
3556
3587
|
recoverCreditPurchase: (options) => this.recoverTargetBillingCreditPurchase(options),
|
|
3557
3588
|
transitionPlan: (options) => this.transitionTargetBillingPlan(options),
|
|
@@ -3559,7 +3590,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3559
3590
|
};
|
|
3560
3591
|
this.workspaces = {
|
|
3561
3592
|
members: (options) => {
|
|
3562
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
3593
|
+
const query = _optionalChain([options, 'optionalAccess', _161 => _161.cursor]) ? `?cursor=${encodeURIComponent(options.cursor)}` : "";
|
|
3563
3594
|
return this.http.get(`/api/v2/auth/workspace/members${query}`);
|
|
3564
3595
|
},
|
|
3565
3596
|
setMemberGrants: (memberId, grants) => this.http.patch(
|
|
@@ -3611,7 +3642,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3611
3642
|
check: (definition) => this.checkMonitor(definition),
|
|
3612
3643
|
preview: (definition, options) => this.previewMonitor(definition, options),
|
|
3613
3644
|
deploy: (definition, options) => this.deployMonitor(definition, options),
|
|
3614
|
-
sync: (definition, options) => _optionalChain([options, 'optionalAccess',
|
|
3645
|
+
sync: (definition, options) => _optionalChain([options, 'optionalAccess', _162 => _162.dryRun]) ? this.deployMonitor(definition, { dryRun: true }) : this.syncScalarMonitor(definition, options),
|
|
3615
3646
|
list: (options) => this.listMonitors(options),
|
|
3616
3647
|
ledger: (options) => this.listMonitorLedger(options),
|
|
3617
3648
|
ledgerGet: (key) => this.getMonitorLedgerEntry(key),
|
|
@@ -3623,13 +3654,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3623
3654
|
update: (key, patch) => this.updateMonitor(key, patch),
|
|
3624
3655
|
delete: (key, options) => this.deleteMonitor(key, options),
|
|
3625
3656
|
reactivate: (key, options) => this.reactivateMonitor(key, options),
|
|
3626
|
-
start: (key, options) => _optionalChain([options, 'optionalAccess',
|
|
3657
|
+
start: (key, options) => _optionalChain([options, 'optionalAccess', _163 => _163.dryRun]) ? this.submitMonitorBatch({
|
|
3627
3658
|
kind: "reactivate",
|
|
3628
3659
|
scope: { kind: "keys", monitorKeys: [key] },
|
|
3629
3660
|
dryRun: true,
|
|
3630
3661
|
idempotencyKey: _nullishCoalesce(options.idempotencyKey, () => ( this.monitorJobIdempotencyKey(`start-${key}`)))
|
|
3631
3662
|
}) : this.submitScalarMonitorLifecycle(key, "start", options),
|
|
3632
|
-
stop: (key, options) => _optionalChain([options, 'optionalAccess',
|
|
3663
|
+
stop: (key, options) => _optionalChain([options, 'optionalAccess', _164 => _164.dryRun]) ? this.submitMonitorBatch({
|
|
3633
3664
|
kind: "deactivate",
|
|
3634
3665
|
scope: { kind: "keys", monitorKeys: [key] },
|
|
3635
3666
|
dryRun: true,
|
|
@@ -3677,83 +3708,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3677
3708
|
// ——————————————————————————————————————————————————————————
|
|
3678
3709
|
// Secrets
|
|
3679
3710
|
// ——————————————————————————————————————————————————————————
|
|
3680
|
-
/** List this workspace's hosted pages, newest update first. */
|
|
3681
|
-
async listPages(input) {
|
|
3682
|
-
const params = new URLSearchParams();
|
|
3683
|
-
if (_optionalChain([input, 'optionalAccess', _162 => _162.cursor])) params.set("cursor", input.cursor);
|
|
3684
|
-
if (_optionalChain([input, 'optionalAccess', _163 => _163.limit])) params.set("limit", String(input.limit));
|
|
3685
|
-
const query = params.size > 0 ? `?${params}` : "";
|
|
3686
|
-
return await this.http.get(`/api/v2/pages${query}`);
|
|
3687
|
-
}
|
|
3688
|
-
/** Read one hosted page's metadata. */
|
|
3689
|
-
async getPage(name) {
|
|
3690
|
-
return await this.http.get(
|
|
3691
|
-
`/api/v2/pages/${encodeURIComponent(name)}`
|
|
3692
|
-
);
|
|
3693
|
-
}
|
|
3694
|
-
/** Replace a page's whole content. `public` says who the write is for. */
|
|
3695
|
-
async writePage(name, input) {
|
|
3696
|
-
return await this.http.put(
|
|
3697
|
-
`/api/v2/pages/${encodeURIComponent(name)}`,
|
|
3698
|
-
{
|
|
3699
|
-
public: input.public,
|
|
3700
|
-
content_base64: input.contentBase64,
|
|
3701
|
-
content_type: input.contentType,
|
|
3702
|
-
description: input.description
|
|
3703
|
-
}
|
|
3704
|
-
);
|
|
3705
|
-
}
|
|
3706
|
-
/** Delete a page, its content, and its links. Safe to repeat. */
|
|
3707
|
-
async deletePage(name) {
|
|
3708
|
-
return await this.http.delete(
|
|
3709
|
-
`/api/v2/pages/${encodeURIComponent(name)}`
|
|
3710
|
-
);
|
|
3711
|
-
}
|
|
3712
|
-
/** Replace the origins allowed to read this page in a browser when public. */
|
|
3713
|
-
async setPageAllowedOrigins(name, origins) {
|
|
3714
|
-
return await this.http.put(
|
|
3715
|
-
`/api/v2/pages/${encodeURIComponent(name)}/origins`,
|
|
3716
|
-
{ allowed_origins: origins }
|
|
3717
|
-
);
|
|
3718
|
-
}
|
|
3719
|
-
/** The explicit way to change who can see an existing page. */
|
|
3720
|
-
async setPageVisibility(name, isPublic) {
|
|
3721
|
-
return await this.http.post(
|
|
3722
|
-
`/api/v2/pages/${encodeURIComponent(name)}/visibility`,
|
|
3723
|
-
{ public: isPublic }
|
|
3724
|
-
);
|
|
3725
|
-
}
|
|
3726
|
-
/** List a page's links. Their URLs cannot be shown again. */
|
|
3727
|
-
async listPageLinks(name) {
|
|
3728
|
-
return await this.http.get(
|
|
3729
|
-
`/api/v2/pages/${encodeURIComponent(name)}/links`
|
|
3730
|
-
);
|
|
3731
|
-
}
|
|
3732
|
-
/** The returned URL is shown once. Either expiry or `permanent` is required. */
|
|
3733
|
-
async createPageLink(name, input) {
|
|
3734
|
-
return await this.http.post(
|
|
3735
|
-
`/api/v2/pages/${encodeURIComponent(name)}/links`,
|
|
3736
|
-
{
|
|
3737
|
-
expires_in_seconds: input.expiresInSeconds,
|
|
3738
|
-
permanent: input.permanent,
|
|
3739
|
-
label: input.label
|
|
3740
|
-
}
|
|
3741
|
-
);
|
|
3742
|
-
}
|
|
3743
|
-
/** Stop a link working. Safe to repeat. */
|
|
3744
|
-
async revokePageLink(name, linkId) {
|
|
3745
|
-
return await this.http.delete(
|
|
3746
|
-
`/api/v2/pages/${encodeURIComponent(name)}/links/${encodeURIComponent(linkId)}`
|
|
3747
|
-
);
|
|
3748
|
-
}
|
|
3749
3711
|
// ——————————————————————————————————————————————————————————
|
|
3750
3712
|
// Views
|
|
3751
3713
|
// ——————————————————————————————————————————————————————————
|
|
3752
3714
|
/** List this workspace's views, most recently changed first. */
|
|
3753
3715
|
async listViews(input) {
|
|
3754
3716
|
const params = new URLSearchParams();
|
|
3755
|
-
if (_optionalChain([input, 'optionalAccess',
|
|
3756
|
-
if (_optionalChain([input, 'optionalAccess',
|
|
3717
|
+
if (_optionalChain([input, 'optionalAccess', _165 => _165.cursor])) params.set("cursor", input.cursor);
|
|
3718
|
+
if (_optionalChain([input, 'optionalAccess', _166 => _166.limit])) params.set("limit", String(input.limit));
|
|
3757
3719
|
const query = params.size > 0 ? `?${params}` : "";
|
|
3758
3720
|
return await this.http.get(`/api/v2/views${query}`);
|
|
3759
3721
|
}
|
|
@@ -3781,11 +3743,37 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3781
3743
|
{ access }
|
|
3782
3744
|
);
|
|
3783
3745
|
}
|
|
3746
|
+
/** The view's share links, newest first. Their tokens are never returned. */
|
|
3747
|
+
async listViewShareLinks(id) {
|
|
3748
|
+
return await this.http.get(
|
|
3749
|
+
`/api/v2/views/${encodeURIComponent(id)}/links`
|
|
3750
|
+
);
|
|
3751
|
+
}
|
|
3752
|
+
/**
|
|
3753
|
+
* Create a share link. `url` in the result is the only copy of the link;
|
|
3754
|
+
* keep it. With `emails`, Deepline also emails it to those people, except
|
|
3755
|
+
* `not_emailed` addresses that bounced or complained before. One
|
|
3756
|
+
* Idempotency-Key per call, so a retried request returns the same link
|
|
3757
|
+
* (with `url: null`) instead of making and emailing a second one.
|
|
3758
|
+
*/
|
|
3759
|
+
async createViewShareLink(id, input) {
|
|
3760
|
+
return await this.http.post(
|
|
3761
|
+
`/api/v2/views/${encodeURIComponent(id)}/links`,
|
|
3762
|
+
input,
|
|
3763
|
+
{ "Idempotency-Key": `view-link-${globalThis.crypto.randomUUID()}` }
|
|
3764
|
+
);
|
|
3765
|
+
}
|
|
3766
|
+
/** Revoke a share link. It stops opening the view at once. */
|
|
3767
|
+
async revokeViewShareLink(id, linkId) {
|
|
3768
|
+
return await this.http.delete(
|
|
3769
|
+
`/api/v2/views/${encodeURIComponent(id)}/links/${encodeURIComponent(linkId)}`
|
|
3770
|
+
);
|
|
3771
|
+
}
|
|
3784
3772
|
/** Every run of the view's Play, newest first. */
|
|
3785
3773
|
async listViewRuns(id, input) {
|
|
3786
3774
|
const params = new URLSearchParams();
|
|
3787
|
-
if (_optionalChain([input, 'optionalAccess',
|
|
3788
|
-
if (_optionalChain([input, 'optionalAccess',
|
|
3775
|
+
if (_optionalChain([input, 'optionalAccess', _167 => _167.limit])) params.set("limit", String(input.limit));
|
|
3776
|
+
if (_optionalChain([input, 'optionalAccess', _168 => _168.offset])) params.set("offset", String(input.offset));
|
|
3789
3777
|
const query = params.size > 0 ? `?${params}` : "";
|
|
3790
3778
|
return await this.http.get(
|
|
3791
3779
|
`/api/v2/views/${encodeURIComponent(id)}/runs${query}`
|
|
@@ -3873,17 +3861,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3873
3861
|
*/
|
|
3874
3862
|
async listTools(options) {
|
|
3875
3863
|
const params = new URLSearchParams();
|
|
3876
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3864
|
+
if (_optionalChain([options, 'optionalAccess', _169 => _169.categories, 'optionalAccess', _170 => _170.trim, 'call', _171 => _171()])) {
|
|
3877
3865
|
params.set("categories", options.categories.trim());
|
|
3878
3866
|
}
|
|
3879
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3867
|
+
if (_optionalChain([options, 'optionalAccess', _172 => _172.tags, 'optionalAccess', _173 => _173.trim, 'call', _174 => _174()])) {
|
|
3880
3868
|
params.set("tags", options.tags.trim());
|
|
3881
3869
|
}
|
|
3882
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3870
|
+
if (_optionalChain([options, 'optionalAccess', _175 => _175.grep, 'optionalAccess', _176 => _176.trim, 'call', _177 => _177()])) {
|
|
3883
3871
|
params.set("grep", options.grep.trim());
|
|
3884
3872
|
params.set("grep_mode", _nullishCoalesce(options.grepMode, () => ( "all")));
|
|
3885
3873
|
}
|
|
3886
|
-
params.set("compact", _optionalChain([options, 'optionalAccess',
|
|
3874
|
+
params.set("compact", _optionalChain([options, 'optionalAccess', _178 => _178.compact]) === true ? "true" : "false");
|
|
3887
3875
|
const suffix = params.toString() ? `?${params.toString()}` : "";
|
|
3888
3876
|
const res = await this.http.get(
|
|
3889
3877
|
`/api/v2/tools${suffix}`
|
|
@@ -3907,7 +3895,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3907
3895
|
async listToolsInCategory(category, options) {
|
|
3908
3896
|
const normalizedCategory = category.trim();
|
|
3909
3897
|
if (!normalizedCategory || category.includes(",")) {
|
|
3910
|
-
throw new (0,
|
|
3898
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
3911
3899
|
"Provide one non-empty tool category.",
|
|
3912
3900
|
400,
|
|
3913
3901
|
"INVALID_TOOL_CATEGORY"
|
|
@@ -3916,7 +3904,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3916
3904
|
const params = new URLSearchParams({
|
|
3917
3905
|
view: "category",
|
|
3918
3906
|
categories: normalizedCategory,
|
|
3919
|
-
compact: _optionalChain([options, 'optionalAccess',
|
|
3907
|
+
compact: _optionalChain([options, 'optionalAccess', _179 => _179.compact]) === true ? "true" : "false"
|
|
3920
3908
|
});
|
|
3921
3909
|
const response = await this.http.get(
|
|
3922
3910
|
`/api/v2/tools?${params}`
|
|
@@ -3931,7 +3919,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3931
3919
|
}
|
|
3932
3920
|
/** List discoverable providers without requiring a local plugin catalog. */
|
|
3933
3921
|
async listProviders(options) {
|
|
3934
|
-
const suffix = _optionalChain([options, 'optionalAccess',
|
|
3922
|
+
const suffix = _optionalChain([options, 'optionalAccess', _180 => _180.changed]) ? "?changed=true" : "";
|
|
3935
3923
|
const res = await this.http.get(
|
|
3936
3924
|
`/api/v2/tools/providers${suffix}`
|
|
3937
3925
|
);
|
|
@@ -3962,8 +3950,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3962
3950
|
*/
|
|
3963
3951
|
async search(options = {}) {
|
|
3964
3952
|
const params = searchParams(options);
|
|
3965
|
-
if (_optionalChain([options, 'access',
|
|
3966
|
-
if (_optionalChain([options, 'access',
|
|
3953
|
+
if (_optionalChain([options, 'access', _181 => _181.types, 'optionalAccess', _182 => _182.length])) params.set("types", options.types.join(","));
|
|
3954
|
+
if (_optionalChain([options, 'access', _183 => _183.exclude, 'optionalAccess', _184 => _184.length])) {
|
|
3967
3955
|
params.set("exclude", options.exclude.join(","));
|
|
3968
3956
|
}
|
|
3969
3957
|
return this.http.get(`/api/v2/search?${params.toString()}`);
|
|
@@ -3985,7 +3973,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3985
3973
|
* ```
|
|
3986
3974
|
*/
|
|
3987
3975
|
async getTool(toolId, options) {
|
|
3988
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3976
|
+
if (_optionalChain([options, 'optionalAccess', _185 => _185.cliInvocationId]) !== void 0) {
|
|
3989
3977
|
validateCliInvocationId(options.cliInvocationId);
|
|
3990
3978
|
}
|
|
3991
3979
|
return this.http.request(
|
|
@@ -3998,7 +3986,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3998
3986
|
retryApiErrors: true,
|
|
3999
3987
|
headers: {
|
|
4000
3988
|
"x-deepline-tool-meta-only": "1",
|
|
4001
|
-
..._optionalChain([options, 'optionalAccess',
|
|
3989
|
+
..._optionalChain([options, 'optionalAccess', _186 => _186.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
|
|
4002
3990
|
}
|
|
4003
3991
|
}
|
|
4004
3992
|
);
|
|
@@ -4089,7 +4077,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4089
4077
|
return this.http.post(
|
|
4090
4078
|
"/api/v2/ingestion/repair",
|
|
4091
4079
|
{
|
|
4092
|
-
..._optionalChain([input, 'optionalAccess',
|
|
4080
|
+
..._optionalChain([input, 'optionalAccess', _187 => _187.provider]) ? { provider: input.provider } : {}
|
|
4093
4081
|
}
|
|
4094
4082
|
);
|
|
4095
4083
|
}
|
|
@@ -4141,10 +4129,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4141
4129
|
*/
|
|
4142
4130
|
async preparePlayRunAdmission(request, options) {
|
|
4143
4131
|
const resolved = resolveStartPlayRunRequest(request, this.environment);
|
|
4144
|
-
const prepared = await
|
|
4132
|
+
const prepared = await _chunkCQDQNZGHjs.preparePlayRunAdmission.call(void 0,
|
|
4145
4133
|
this.http,
|
|
4146
4134
|
resolved.request,
|
|
4147
|
-
_optionalChain([options, 'optionalAccess',
|
|
4135
|
+
_optionalChain([options, 'optionalAccess', _188 => _188.onSubmission]),
|
|
4148
4136
|
options
|
|
4149
4137
|
);
|
|
4150
4138
|
const bodyJson = JSON.stringify(prepared.body);
|
|
@@ -4152,9 +4140,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4152
4140
|
resolved.runtime,
|
|
4153
4141
|
this.environment
|
|
4154
4142
|
);
|
|
4155
|
-
const headers = _optionalChain([options, 'optionalAccess',
|
|
4143
|
+
const headers = _optionalChain([options, 'optionalAccess', _189 => _189.cliAdmission]) ? {
|
|
4156
4144
|
...runtimeHeaders,
|
|
4157
|
-
"X-Deepline-API-Major": String(
|
|
4145
|
+
"X-Deepline-API-Major": String(_chunk3PMCQ3LKjs.SDK_API_MAJOR)
|
|
4158
4146
|
} : runtimeHeaders;
|
|
4159
4147
|
const http = this.http;
|
|
4160
4148
|
let submitted = false;
|
|
@@ -4162,38 +4150,38 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4162
4150
|
...prepared,
|
|
4163
4151
|
async start(startOptions) {
|
|
4164
4152
|
if (submitted && !prepared.supportsCallerIntent) {
|
|
4165
|
-
throw new (0,
|
|
4153
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
4166
4154
|
"This server has not enabled caller-owned admission recovery. Do not retry an ambiguous start.",
|
|
4167
4155
|
409,
|
|
4168
4156
|
"PLAY_RUN_ADMISSION_RECOVERY_UNSUPPORTED"
|
|
4169
4157
|
);
|
|
4170
4158
|
}
|
|
4171
4159
|
if (submitted) {
|
|
4172
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
4173
|
-
await
|
|
4160
|
+
if (!_optionalChain([options, 'optionalAccess', _190 => _190.callerIntentV2])) {
|
|
4161
|
+
await _chunkCQDQNZGHjs.preparePlayRunAdmission.call(void 0,
|
|
4174
4162
|
http,
|
|
4175
4163
|
JSON.parse(bodyJson),
|
|
4176
4164
|
void 0,
|
|
4177
|
-
{ signal: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess',
|
|
4165
|
+
{ signal: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _191 => _191.signal]), () => ( _optionalChain([options, 'optionalAccess', _192 => _192.signal]))) }
|
|
4178
4166
|
);
|
|
4179
4167
|
}
|
|
4180
4168
|
}
|
|
4181
4169
|
submitted = true;
|
|
4182
4170
|
try {
|
|
4183
|
-
return await
|
|
4171
|
+
return await _chunkCQDQNZGHjs.submitPreparedPlayRunAdmission.call(void 0,
|
|
4184
4172
|
http,
|
|
4185
4173
|
JSON.parse(bodyJson),
|
|
4186
4174
|
prepared.workflowId,
|
|
4187
4175
|
prepared.supportsCallerIntent,
|
|
4188
4176
|
headers,
|
|
4189
4177
|
{
|
|
4190
|
-
cliAdmission: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess',
|
|
4191
|
-
callerIntentV2: _optionalChain([options, 'optionalAccess',
|
|
4192
|
-
signal: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess',
|
|
4178
|
+
cliAdmission: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _193 => _193.cliAdmission]), () => ( _optionalChain([options, 'optionalAccess', _194 => _194.cliAdmission]))),
|
|
4179
|
+
callerIntentV2: _optionalChain([options, 'optionalAccess', _195 => _195.callerIntentV2]),
|
|
4180
|
+
signal: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _196 => _196.signal]), () => ( _optionalChain([options, 'optionalAccess', _197 => _197.signal])))
|
|
4193
4181
|
}
|
|
4194
4182
|
);
|
|
4195
4183
|
} catch (error) {
|
|
4196
|
-
if (error instanceof
|
|
4184
|
+
if (error instanceof _chunkCQDQNZGHjs.CliPlayAdmissionUnsupportedError || error instanceof _chunkCQDQNZGHjs.CliPlayAdmissionCallerIntentV2UnsupportedError) {
|
|
4197
4185
|
submitted = false;
|
|
4198
4186
|
}
|
|
4199
4187
|
throw error;
|
|
@@ -4201,50 +4189,50 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4201
4189
|
},
|
|
4202
4190
|
async *startStream(streamOptions) {
|
|
4203
4191
|
if (submitted && !prepared.supportsCallerIntent) {
|
|
4204
|
-
throw new (0,
|
|
4192
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
4205
4193
|
"This server has not enabled caller-owned admission recovery. Do not retry an ambiguous start.",
|
|
4206
4194
|
409,
|
|
4207
4195
|
"PLAY_RUN_ADMISSION_RECOVERY_UNSUPPORTED"
|
|
4208
4196
|
);
|
|
4209
4197
|
}
|
|
4210
4198
|
if (submitted) {
|
|
4211
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
4212
|
-
await
|
|
4199
|
+
if (!_optionalChain([options, 'optionalAccess', _198 => _198.callerIntentV2])) {
|
|
4200
|
+
await _chunkCQDQNZGHjs.preparePlayRunAdmission.call(void 0,
|
|
4213
4201
|
http,
|
|
4214
4202
|
JSON.parse(bodyJson),
|
|
4215
4203
|
void 0,
|
|
4216
|
-
{ signal: _optionalChain([streamOptions, 'optionalAccess',
|
|
4204
|
+
{ signal: _optionalChain([streamOptions, 'optionalAccess', _199 => _199.signal]) }
|
|
4217
4205
|
);
|
|
4218
4206
|
}
|
|
4219
4207
|
}
|
|
4220
4208
|
submitted = true;
|
|
4221
|
-
const streamPath = _optionalChain([options, 'optionalAccess',
|
|
4209
|
+
const streamPath = _optionalChain([options, 'optionalAccess', _200 => _200.callerIntentV2]) ? _chunkCQDQNZGHjs.CLI_PLAY_RUN_CALLER_INTENT_V2_START_STREAM_PATH : _optionalChain([options, 'optionalAccess', _201 => _201.cliAdmission]) ? _chunkCQDQNZGHjs.CLI_PLAY_RUN_START_STREAM_PATH : _chunkCQDQNZGHjs.PLAY_RUN_START_STREAM_PATH;
|
|
4222
4210
|
let cliAdmissionSupported = false;
|
|
4223
4211
|
try {
|
|
4224
4212
|
for await (const event of http.streamSse(streamPath, {
|
|
4225
4213
|
method: "POST",
|
|
4226
4214
|
body: JSON.parse(bodyJson),
|
|
4227
4215
|
headers,
|
|
4228
|
-
signal: _optionalChain([streamOptions, 'optionalAccess',
|
|
4216
|
+
signal: _optionalChain([streamOptions, 'optionalAccess', _202 => _202.signal]),
|
|
4229
4217
|
exactUrlOnly: true,
|
|
4230
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4218
|
+
..._optionalChain([options, 'optionalAccess', _203 => _203.cliAdmission]) ? {
|
|
4231
4219
|
onResponse: (response) => {
|
|
4232
|
-
cliAdmissionSupported = response.headers.get(
|
|
4220
|
+
cliAdmissionSupported = response.headers.get(_chunkCQDQNZGHjs.CLI_PLAY_RUN_SUPPORTED_HEADER) === "true";
|
|
4233
4221
|
}
|
|
4234
4222
|
} : {}
|
|
4235
4223
|
})) {
|
|
4236
4224
|
if (event.scope === "play") yield event;
|
|
4237
4225
|
}
|
|
4238
4226
|
} catch (error) {
|
|
4239
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4227
|
+
if (_optionalChain([options, 'optionalAccess', _204 => _204.cliAdmission]) && !cliAdmissionSupported && error instanceof _chunkBBTKAASQjs.DeeplineError && (error.statusCode === 404 || error.statusCode === 405)) {
|
|
4240
4228
|
if (options.callerIntentV2) {
|
|
4241
4229
|
submitted = false;
|
|
4242
|
-
throw new (0,
|
|
4230
|
+
throw new (0, _chunkCQDQNZGHjs.CliPlayAdmissionCallerIntentV2UnsupportedError)(
|
|
4243
4231
|
error.statusCode
|
|
4244
4232
|
);
|
|
4245
4233
|
}
|
|
4246
4234
|
submitted = false;
|
|
4247
|
-
throw new (0,
|
|
4235
|
+
throw new (0, _chunkCQDQNZGHjs.CliPlayAdmissionUnsupportedError)(error.statusCode);
|
|
4248
4236
|
}
|
|
4249
4237
|
throw error;
|
|
4250
4238
|
}
|
|
@@ -4257,7 +4245,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4257
4245
|
* @internal
|
|
4258
4246
|
*/
|
|
4259
4247
|
async prefetchPlayRunAdmissionCapability(options) {
|
|
4260
|
-
return
|
|
4248
|
+
return _chunkCQDQNZGHjs.readPlayRunAdmissionCapability.call(void 0, this.http, options);
|
|
4261
4249
|
}
|
|
4262
4250
|
/**
|
|
4263
4251
|
* Submit a play run through the legacy event response.
|
|
@@ -4274,7 +4262,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4274
4262
|
*/
|
|
4275
4263
|
async *startPlayRunStream(request, options) {
|
|
4276
4264
|
const prepared = await this.preparePlayRunAdmission(request, options);
|
|
4277
|
-
yield* prepared.startStream({ signal: _optionalChain([options, 'optionalAccess',
|
|
4265
|
+
yield* prepared.startStream({ signal: _optionalChain([options, 'optionalAccess', _205 => _205.signal]) });
|
|
4278
4266
|
}
|
|
4279
4267
|
/**
|
|
4280
4268
|
* Register a bundled play artifact.
|
|
@@ -4427,7 +4415,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4427
4415
|
compilerManifest,
|
|
4428
4416
|
...input.input ? { input: input.input } : {},
|
|
4429
4417
|
...input.inputFile ? { inputFile: input.inputFile } : {},
|
|
4430
|
-
..._optionalChain([input, 'access',
|
|
4418
|
+
..._optionalChain([input, 'access', _206 => _206.packagedFiles, 'optionalAccess', _207 => _207.length]) ? { packagedFiles: input.packagedFiles } : {},
|
|
4431
4419
|
...input.force ? { force: true } : {},
|
|
4432
4420
|
...input.forceToolRefresh ? { forceToolRefresh: true } : {}
|
|
4433
4421
|
});
|
|
@@ -4457,29 +4445,29 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4457
4445
|
* ```
|
|
4458
4446
|
*/
|
|
4459
4447
|
async submitPlay(code, csvPath, name, options) {
|
|
4460
|
-
const runtimeInput = _optionalChain([options, 'optionalAccess',
|
|
4448
|
+
const runtimeInput = _optionalChain([options, 'optionalAccess', _208 => _208.input]) ? { ...options.input } : {};
|
|
4461
4449
|
if (csvPath) {
|
|
4462
4450
|
runtimeInput.file = csvPath;
|
|
4463
4451
|
}
|
|
4464
|
-
const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4465
|
-
const artifact = _optionalChain([options, 'optionalAccess',
|
|
4466
|
-
if (!_optionalChain([name, 'optionalAccess',
|
|
4452
|
+
const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _209 => _209.sourceCode]), () => ( code));
|
|
4453
|
+
const artifact = _optionalChain([options, 'optionalAccess', _210 => _210.artifact]);
|
|
4454
|
+
if (!_optionalChain([name, 'optionalAccess', _211 => _211.trim, 'call', _212 => _212()])) {
|
|
4467
4455
|
throw new Error("submitPlay requires a play name.");
|
|
4468
4456
|
}
|
|
4469
4457
|
if (!artifact) {
|
|
4470
4458
|
throw new Error("submitPlay requires a bundled play artifact.");
|
|
4471
4459
|
}
|
|
4472
|
-
const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async
|
|
4460
|
+
const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _213 => _213.compilerManifest]), async () => ( await this.compilePlayManifest({
|
|
4473
4461
|
name,
|
|
4474
4462
|
sourceCode,
|
|
4475
|
-
sourceFiles: _optionalChain([options, 'optionalAccess',
|
|
4463
|
+
sourceFiles: _optionalChain([options, 'optionalAccess', _214 => _214.sourceFiles]),
|
|
4476
4464
|
artifact
|
|
4477
4465
|
})));
|
|
4478
4466
|
const registeredArtifact = await this.registerPlayArtifact({
|
|
4479
4467
|
name,
|
|
4480
4468
|
sourceCode,
|
|
4481
|
-
sourceFiles: _optionalChain([options, 'optionalAccess',
|
|
4482
|
-
description: _optionalChain([options, 'optionalAccess',
|
|
4469
|
+
sourceFiles: _optionalChain([options, 'optionalAccess', _215 => _215.sourceFiles]),
|
|
4470
|
+
description: _optionalChain([options, 'optionalAccess', _216 => _216.description]),
|
|
4483
4471
|
artifact,
|
|
4484
4472
|
compilerManifest,
|
|
4485
4473
|
publish: false
|
|
@@ -4493,17 +4481,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4493
4481
|
name,
|
|
4494
4482
|
artifactStorageKey: registeredArtifact.artifactStorageKey,
|
|
4495
4483
|
sourceCode,
|
|
4496
|
-
description: _optionalChain([options, 'optionalAccess',
|
|
4484
|
+
description: _optionalChain([options, 'optionalAccess', _217 => _217.description]),
|
|
4497
4485
|
staticPipeline: _nullishCoalesce(registeredArtifact.staticPipeline, () => ( null)),
|
|
4498
4486
|
artifactHash: typeof artifact.artifactHash === "string" ? artifact.artifactHash : void 0,
|
|
4499
4487
|
graphHash: typeof artifact.graphHash === "string" ? artifact.graphHash : void 0,
|
|
4500
4488
|
runtimeArtifact: artifact,
|
|
4501
4489
|
compilerManifest,
|
|
4502
4490
|
...Object.keys(runtimeInput).length > 0 ? { input: runtimeInput } : {},
|
|
4503
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4504
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4505
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4506
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4491
|
+
..._optionalChain([options, 'optionalAccess', _218 => _218.inputFile]) ? { inputFile: options.inputFile } : {},
|
|
4492
|
+
..._optionalChain([options, 'optionalAccess', _219 => _219.packagedFiles, 'optionalAccess', _220 => _220.length]) ? { packagedFiles: options.packagedFiles } : {},
|
|
4493
|
+
..._optionalChain([options, 'optionalAccess', _221 => _221.force]) ? { force: true } : {},
|
|
4494
|
+
..._optionalChain([options, 'optionalAccess', _222 => _222.forceToolRefresh]) ? { forceToolRefresh: true } : {}
|
|
4507
4495
|
});
|
|
4508
4496
|
}
|
|
4509
4497
|
/**
|
|
@@ -4531,7 +4519,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4531
4519
|
* ```
|
|
4532
4520
|
*/
|
|
4533
4521
|
async stagePlayFiles(files) {
|
|
4534
|
-
return
|
|
4522
|
+
return _chunkCQDQNZGHjs.stagePlayFiles.call(void 0, this.http, files);
|
|
4535
4523
|
}
|
|
4536
4524
|
/**
|
|
4537
4525
|
* Mint short-lived presigned upload targets for staged play files.
|
|
@@ -4540,7 +4528,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4540
4528
|
* For other files, the server returns a presigned PUT URL. Upload the file body to that URL.
|
|
4541
4529
|
*/
|
|
4542
4530
|
async mintStagedPlayFileUploads(files) {
|
|
4543
|
-
return
|
|
4531
|
+
return _chunkCQDQNZGHjs.mintStagedPlayFileUploads.call(void 0, this.http, files);
|
|
4544
4532
|
}
|
|
4545
4533
|
/**
|
|
4546
4534
|
* Resolve staged play files by content hash without uploading bytes.
|
|
@@ -4579,13 +4567,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4579
4567
|
for await (const event of watchRunEvents({
|
|
4580
4568
|
http: this.http,
|
|
4581
4569
|
runId: workflowId,
|
|
4582
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
4583
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
4584
|
-
onRetry: _optionalChain([options, 'optionalAccess',
|
|
4585
|
-
deferLogs: _optionalChain([options, 'optionalAccess',
|
|
4586
|
-
omitTerminalLogs: _optionalChain([options, 'optionalAccess',
|
|
4587
|
-
onPoll: _optionalChain([options, 'optionalAccess',
|
|
4588
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4570
|
+
signal: _optionalChain([options, 'optionalAccess', _223 => _223.signal]),
|
|
4571
|
+
onNotice: _optionalChain([options, 'optionalAccess', _224 => _224.onNotice]),
|
|
4572
|
+
onRetry: _optionalChain([options, 'optionalAccess', _225 => _225.onRetry]),
|
|
4573
|
+
deferLogs: _optionalChain([options, 'optionalAccess', _226 => _226.deferLogs]),
|
|
4574
|
+
omitTerminalLogs: _optionalChain([options, 'optionalAccess', _227 => _227.omitTerminalLogs]),
|
|
4575
|
+
onPoll: _optionalChain([options, 'optionalAccess', _228 => _228.onPoll]),
|
|
4576
|
+
..._optionalChain([options, 'optionalAccess', _229 => _229.terminalStatus]) ? {
|
|
4589
4577
|
terminalStatus: {
|
|
4590
4578
|
...options.terminalStatus,
|
|
4591
4579
|
onStatus: async (raw, expectedStatus) => {
|
|
@@ -4595,7 +4583,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4595
4583
|
`Run watch returned a mismatched terminal status for ${workflowId}.`
|
|
4596
4584
|
);
|
|
4597
4585
|
}
|
|
4598
|
-
await _optionalChain([options, 'access',
|
|
4586
|
+
await _optionalChain([options, 'access', _230 => _230.terminalStatus, 'optionalAccess', _231 => _231.onStatus, 'call', _232 => _232(status)]);
|
|
4599
4587
|
}
|
|
4600
4588
|
}
|
|
4601
4589
|
} : {}
|
|
@@ -4610,12 +4598,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4610
4598
|
* @deprecated Use `watchRunEvents` for ordinary run watching.
|
|
4611
4599
|
*/
|
|
4612
4600
|
async *streamPlayRunEvents(workflowId, options) {
|
|
4613
|
-
const headers = _optionalChain([options, 'optionalAccess',
|
|
4601
|
+
const headers = _optionalChain([options, 'optionalAccess', _233 => _233.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
|
|
4614
4602
|
const params = new URLSearchParams();
|
|
4615
|
-
params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4603
|
+
params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _234 => _234.mode]), () => ( "cli")));
|
|
4616
4604
|
for await (const event of this.http.streamSse(
|
|
4617
4605
|
`/api/v2/runs/${encodeURIComponent(workflowId)}/tail?${params.toString()}`,
|
|
4618
|
-
{ signal: _optionalChain([options, 'optionalAccess',
|
|
4606
|
+
{ signal: _optionalChain([options, 'optionalAccess', _235 => _235.signal]), headers }
|
|
4619
4607
|
)) {
|
|
4620
4608
|
if (event.scope === "play") {
|
|
4621
4609
|
yield event;
|
|
@@ -4631,8 +4619,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4631
4619
|
*/
|
|
4632
4620
|
async *observeRunEvents(runId, options) {
|
|
4633
4621
|
yield* this.watchRunEvents(runId, {
|
|
4634
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
4635
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
4622
|
+
signal: _optionalChain([options, 'optionalAccess', _236 => _236.signal]),
|
|
4623
|
+
onNotice: _optionalChain([options, 'optionalAccess', _237 => _237.onNotice])
|
|
4636
4624
|
});
|
|
4637
4625
|
}
|
|
4638
4626
|
/** Poll snapshots to terminal status and return the durable package. */
|
|
@@ -4640,9 +4628,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4640
4628
|
let terminalObserved = false;
|
|
4641
4629
|
let terminalStatus = null;
|
|
4642
4630
|
for await (const event of this.watchRunEvents(runId, {
|
|
4643
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
4644
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
4645
|
-
onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4631
|
+
signal: _optionalChain([options, 'optionalAccess', _238 => _238.signal]),
|
|
4632
|
+
onNotice: _optionalChain([options, 'optionalAccess', _239 => _239.onNotice]),
|
|
4633
|
+
onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _240 => _240.onRetry]), () => ( _optionalChain([options, 'optionalAccess', _241 => _241.onReconnect]))),
|
|
4646
4634
|
terminalStatus: {
|
|
4647
4635
|
runStatus: true,
|
|
4648
4636
|
onStatus: (status) => {
|
|
@@ -4650,19 +4638,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4650
4638
|
}
|
|
4651
4639
|
}
|
|
4652
4640
|
})) {
|
|
4653
|
-
_optionalChain([options, 'optionalAccess',
|
|
4654
|
-
if (
|
|
4641
|
+
_optionalChain([options, 'optionalAccess', _242 => _242.onEvent, 'optionalCall', _243 => _243(event)]);
|
|
4642
|
+
if (_chunkCQDQNZGHjs.isTerminalPlayRunLifecycleStatus.call(void 0, playLiveRunStatus(event))) {
|
|
4655
4643
|
terminalObserved = true;
|
|
4656
4644
|
}
|
|
4657
4645
|
}
|
|
4658
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4659
|
-
throw new (0,
|
|
4646
|
+
if (_optionalChain([options, 'optionalAccess', _244 => _244.signal, 'optionalAccess', _245 => _245.aborted])) {
|
|
4647
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)("Run watch aborted.", void 0, "ABORTED");
|
|
4660
4648
|
}
|
|
4661
4649
|
const refreshed = await _asyncNullishCoalesce(terminalStatus, async () => ( await this.getRunStatus(runId)));
|
|
4662
|
-
if (terminalObserved ||
|
|
4650
|
+
if (terminalObserved || _chunkCQDQNZGHjs.isTerminalPlayRunLifecycleStatus.call(void 0, refreshed.status)) {
|
|
4663
4651
|
return refreshed;
|
|
4664
4652
|
}
|
|
4665
|
-
throw new (0,
|
|
4653
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
4666
4654
|
`Run watch for ${runId} ended before a terminal status.`,
|
|
4667
4655
|
void 0,
|
|
4668
4656
|
"PLAY_WATCH_ENDED"
|
|
@@ -4735,7 +4723,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4735
4723
|
/** List the org's workflows. `GET /api/v2/workflows`. */
|
|
4736
4724
|
async listWorkflows(options) {
|
|
4737
4725
|
const params = new URLSearchParams();
|
|
4738
|
-
if (typeof _optionalChain([options, 'optionalAccess',
|
|
4726
|
+
if (typeof _optionalChain([options, 'optionalAccess', _246 => _246.limit]) === "number") {
|
|
4739
4727
|
params.set("limit", String(options.limit));
|
|
4740
4728
|
}
|
|
4741
4729
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4788,7 +4776,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4788
4776
|
/** List a workflow's runs. `GET /api/v2/workflows/:id/runs`. */
|
|
4789
4777
|
async listWorkflowRuns(id, options) {
|
|
4790
4778
|
const params = new URLSearchParams();
|
|
4791
|
-
if (typeof _optionalChain([options, 'optionalAccess',
|
|
4779
|
+
if (typeof _optionalChain([options, 'optionalAccess', _247 => _247.limit]) === "number") {
|
|
4792
4780
|
params.set("limit", String(options.limit));
|
|
4793
4781
|
}
|
|
4794
4782
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4824,16 +4812,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4824
4812
|
*/
|
|
4825
4813
|
async getRunStatus(runId, options) {
|
|
4826
4814
|
const params = new URLSearchParams();
|
|
4827
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4815
|
+
if (_optionalChain([options, 'optionalAccess', _248 => _248.full]) === true) {
|
|
4828
4816
|
params.set("full", "true");
|
|
4829
4817
|
}
|
|
4830
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4818
|
+
if (_optionalChain([options, 'optionalAccess', _249 => _249.configuration]) === true) {
|
|
4831
4819
|
params.append("include", "configuration");
|
|
4832
4820
|
}
|
|
4833
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4821
|
+
if (_optionalChain([options, 'optionalAccess', _250 => _250.performance]) === true) {
|
|
4834
4822
|
params.append("include", "performance");
|
|
4835
4823
|
}
|
|
4836
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4824
|
+
if (_optionalChain([options, 'optionalAccess', _251 => _251.retries]) === true) {
|
|
4837
4825
|
params.append("include", "retries");
|
|
4838
4826
|
}
|
|
4839
4827
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4841,15 +4829,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4841
4829
|
`/api/v2/runs/${encodeURIComponent(runId)}${query}`,
|
|
4842
4830
|
{ headers: { "x-deepline-run-status": "1" } }
|
|
4843
4831
|
);
|
|
4844
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4845
|
-
throw new (0,
|
|
4832
|
+
if (_optionalChain([options, 'optionalAccess', _252 => _252.configuration]) === true && !Object.hasOwn(response, "contract")) {
|
|
4833
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
4846
4834
|
"This server does not support recorded configuration reads.",
|
|
4847
4835
|
void 0,
|
|
4848
4836
|
"RUN_CONFIGURATION_UNAVAILABLE"
|
|
4849
4837
|
);
|
|
4850
4838
|
}
|
|
4851
4839
|
const status = normalizePlayStatus(response);
|
|
4852
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4840
|
+
if (_optionalChain([options, 'optionalAccess', _253 => _253.failedLogs]) !== true || status.status !== "failed") {
|
|
4853
4841
|
return status;
|
|
4854
4842
|
}
|
|
4855
4843
|
const requestedFailedLogLimit = typeof options.failedLogLimit === "number" && Number.isFinite(options.failedLogLimit) ? Math.max(1, Math.floor(options.failedLogLimit)) : RUNS_FAILED_LOG_LIMIT;
|
|
@@ -4893,14 +4881,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4893
4881
|
async getRunChildren(parentRunId, options) {
|
|
4894
4882
|
const launchKey = options.launchKey.trim();
|
|
4895
4883
|
if (!launchKey) {
|
|
4896
|
-
throw new (0,
|
|
4884
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
4897
4885
|
"runs.children requires a nonempty launchKey.",
|
|
4898
4886
|
void 0,
|
|
4899
4887
|
"INVALID_CHILD_RUN_LAUNCH_KEY"
|
|
4900
4888
|
);
|
|
4901
4889
|
}
|
|
4902
4890
|
if (options.limit !== void 0 && (!Number.isInteger(options.limit) || options.limit < 1 || options.limit > 50)) {
|
|
4903
|
-
throw new (0,
|
|
4891
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
4904
4892
|
"runs.children limit must be an integer from 1 to 50.",
|
|
4905
4893
|
void 0,
|
|
4906
4894
|
"INVALID_CHILD_RUN_PAGE_LIMIT"
|
|
@@ -4938,7 +4926,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4938
4926
|
/** The same tenant-scoped run history searched by the dashboard and CLI. */
|
|
4939
4927
|
async getRunsHistory(options = {}) {
|
|
4940
4928
|
const params = new URLSearchParams();
|
|
4941
|
-
const search = _optionalChain([options, 'access',
|
|
4929
|
+
const search = _optionalChain([options, 'access', _254 => _254.search, 'optionalAccess', _255 => _255.trim, 'call', _256 => _256()]);
|
|
4942
4930
|
if (search && search.length > 200) {
|
|
4943
4931
|
throw new Error("Run search must be at most 200 characters.");
|
|
4944
4932
|
}
|
|
@@ -4964,16 +4952,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4964
4952
|
}
|
|
4965
4953
|
/** Read one run page without discarding server pagination metadata. */
|
|
4966
4954
|
async listRunsPage(options) {
|
|
4967
|
-
const playName = _optionalChain([options, 'access',
|
|
4955
|
+
const playName = _optionalChain([options, 'access', _257 => _257.play, 'optionalAccess', _258 => _258.trim, 'call', _259 => _259()]);
|
|
4968
4956
|
const params = new URLSearchParams();
|
|
4969
4957
|
if (playName) {
|
|
4970
4958
|
params.set("play", playName);
|
|
4971
4959
|
}
|
|
4972
|
-
const status = _optionalChain([options, 'access',
|
|
4960
|
+
const status = _optionalChain([options, 'access', _260 => _260.status, 'optionalAccess', _261 => _261.trim, 'call', _262 => _262()]);
|
|
4973
4961
|
if (status) {
|
|
4974
4962
|
params.set("status", status);
|
|
4975
4963
|
}
|
|
4976
|
-
const node = _optionalChain([options, 'access',
|
|
4964
|
+
const node = _optionalChain([options, 'access', _263 => _263.node, 'optionalAccess', _264 => _264.trim, 'call', _265 => _265()]);
|
|
4977
4965
|
if (node) {
|
|
4978
4966
|
if (!playName)
|
|
4979
4967
|
throw new Error("runs.list options.node requires options.play.");
|
|
@@ -5047,9 +5035,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5047
5035
|
* A different key starts another rerun.
|
|
5048
5036
|
*/
|
|
5049
5037
|
async rerun(runId, options) {
|
|
5050
|
-
const idempotencyKey = _optionalChain([options, 'optionalAccess',
|
|
5051
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5052
|
-
throw new (0,
|
|
5038
|
+
const idempotencyKey = _optionalChain([options, 'optionalAccess', _266 => _266.idempotencyKey, 'optionalAccess', _267 => _267.trim, 'call', _268 => _268()]);
|
|
5039
|
+
if (_optionalChain([options, 'optionalAccess', _269 => _269.idempotencyKey]) !== void 0 && !idempotencyKey) {
|
|
5040
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
5053
5041
|
"runs.rerun idempotencyKey must not be empty.",
|
|
5054
5042
|
void 0,
|
|
5055
5043
|
"INVALID_IDEMPOTENCY_KEY"
|
|
@@ -5057,7 +5045,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5057
5045
|
}
|
|
5058
5046
|
return this.http.post(
|
|
5059
5047
|
`/api/v2/runs/${encodeURIComponent(runId)}/rerun`,
|
|
5060
|
-
_optionalChain([options, 'optionalAccess',
|
|
5048
|
+
_optionalChain([options, 'optionalAccess', _270 => _270.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
|
|
5061
5049
|
{ "Idempotency-Key": idempotencyKey || globalThis.crypto.randomUUID() }
|
|
5062
5050
|
);
|
|
5063
5051
|
}
|
|
@@ -5084,21 +5072,21 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5084
5072
|
* ```
|
|
5085
5073
|
*/
|
|
5086
5074
|
async getRunLogs(runId, options) {
|
|
5087
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5088
|
-
throw new (0,
|
|
5075
|
+
if (_optionalChain([options, 'optionalAccess', _271 => _271.all]) === true && options.failed === true) {
|
|
5076
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
5089
5077
|
"runs.logs cannot combine all and failed views.",
|
|
5090
5078
|
void 0,
|
|
5091
5079
|
"INVALID_RUN_LOG_VIEW"
|
|
5092
5080
|
);
|
|
5093
5081
|
}
|
|
5094
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5095
|
-
throw new (0,
|
|
5082
|
+
if (_optionalChain([options, 'optionalAccess', _272 => _272.cursor]) !== void 0 && options.failed === true) {
|
|
5083
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
5096
5084
|
"runs.logs cannot combine failed with cursor.",
|
|
5097
5085
|
void 0,
|
|
5098
5086
|
"INVALID_RUN_LOG_VIEW"
|
|
5099
5087
|
);
|
|
5100
5088
|
}
|
|
5101
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5089
|
+
if (_optionalChain([options, 'optionalAccess', _273 => _273.failed]) === true) {
|
|
5102
5090
|
const requestedLimit = typeof options.limit === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : RUNS_FAILED_LOG_LIMIT;
|
|
5103
5091
|
const failedLimit = Math.min(RUNS_FAILED_LOG_LIMIT, requestedLimit);
|
|
5104
5092
|
const page = await this.http.get(
|
|
@@ -5123,18 +5111,18 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5123
5111
|
...page.logsTruncated ? { logsTruncated: true } : {}
|
|
5124
5112
|
};
|
|
5125
5113
|
}
|
|
5126
|
-
const beforeSequence = _optionalChain([options, 'optionalAccess',
|
|
5127
|
-
const limit = _optionalChain([options, 'optionalAccess',
|
|
5114
|
+
const beforeSequence = _optionalChain([options, 'optionalAccess', _274 => _274.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
|
|
5115
|
+
const limit = _optionalChain([options, 'optionalAccess', _275 => _275.all]) ? Number.MAX_SAFE_INTEGER : typeof _optionalChain([options, 'optionalAccess', _276 => _276.limit]) === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
|
|
5128
5116
|
const fetchPage = (afterSeq2, pageLimit) => this.http.get(
|
|
5129
5117
|
`/api/v2/runs/${encodeURIComponent(runId)}/logs?afterSeq=${afterSeq2}&limit=${pageLimit}`,
|
|
5130
5118
|
{ retryApiErrors: true }
|
|
5131
5119
|
);
|
|
5132
5120
|
const probe = await fetchPage(0, 1);
|
|
5133
5121
|
const lastStoredSeq = probe.lastStoredSeq;
|
|
5134
|
-
const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access',
|
|
5122
|
+
const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _277 => _277.entries, 'access', _278 => _278[0], 'optionalAccess', _279 => _279.seq]), () => ( null));
|
|
5135
5123
|
const upperSeq = beforeSequence === null ? lastStoredSeq : Math.min(beforeSequence - 1, lastStoredSeq);
|
|
5136
5124
|
const windowEndSeq = Math.min(upperSeq, lastStoredSeq);
|
|
5137
|
-
let afterSeq = _optionalChain([options, 'optionalAccess',
|
|
5125
|
+
let afterSeq = _optionalChain([options, 'optionalAccess', _280 => _280.all]) ? 0 : Math.max(0, windowEndSeq - limit);
|
|
5138
5126
|
const entries = [];
|
|
5139
5127
|
while (entries.length < limit && afterSeq < upperSeq) {
|
|
5140
5128
|
const page = await fetchPage(
|
|
@@ -5168,7 +5156,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5168
5156
|
hasMore: olderLinesExist,
|
|
5169
5157
|
nextCursor: olderLinesExist ? encodeRunLogsCursor(firstSequence) : null,
|
|
5170
5158
|
entries: entries.map((entry) => entry.line),
|
|
5171
|
-
view: _optionalChain([options, 'optionalAccess',
|
|
5159
|
+
view: _optionalChain([options, 'optionalAccess', _281 => _281.all]) ? "all" : "tail",
|
|
5172
5160
|
...probe.logsTruncated ? { logsTruncated: true } : {}
|
|
5173
5161
|
};
|
|
5174
5162
|
}
|
|
@@ -5242,7 +5230,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5242
5230
|
if (selection !== void 0) {
|
|
5243
5231
|
const runtime = normalizePlayRuntimeSelection(selection);
|
|
5244
5232
|
if (!runtime) {
|
|
5245
|
-
throw new (0,
|
|
5233
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
5246
5234
|
"Run event queries require a valid Preview runtime selection.",
|
|
5247
5235
|
void 0,
|
|
5248
5236
|
"INVALID_RUNTIME_SELECTION"
|
|
@@ -5299,7 +5287,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5299
5287
|
if (options.runtime !== void 0) {
|
|
5300
5288
|
const runtime = normalizePlayRuntimeSelection(options.runtime);
|
|
5301
5289
|
if (!runtime) {
|
|
5302
|
-
throw new (0,
|
|
5290
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
5303
5291
|
"runs.searchEvents runtime must be a valid Preview selection.",
|
|
5304
5292
|
void 0,
|
|
5305
5293
|
"INVALID_RUNTIME_SELECTION"
|
|
@@ -5344,7 +5332,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5344
5332
|
limit: String(_nullishCoalesce(input.limit, () => ( 5e3))),
|
|
5345
5333
|
offset: String(_nullishCoalesce(input.offset, () => ( 0)))
|
|
5346
5334
|
});
|
|
5347
|
-
if (_optionalChain([input, 'access',
|
|
5335
|
+
if (_optionalChain([input, 'access', _282 => _282.runId, 'optionalAccess', _283 => _283.trim, 'call', _284 => _284()])) {
|
|
5348
5336
|
params.set("runId", input.runId.trim());
|
|
5349
5337
|
}
|
|
5350
5338
|
if (input.rowMode === "all" || input.rowMode === "live") {
|
|
@@ -5357,9 +5345,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5357
5345
|
`/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`,
|
|
5358
5346
|
{ signal: input.signal }
|
|
5359
5347
|
);
|
|
5360
|
-
const requestedRunId = _optionalChain([input, 'access',
|
|
5348
|
+
const requestedRunId = _optionalChain([input, 'access', _285 => _285.runId, 'optionalAccess', _286 => _286.trim, 'call', _287 => _287()]) || "";
|
|
5361
5349
|
if (requestedRunId) {
|
|
5362
|
-
const confirmedRunId = _optionalChain([result, 'access',
|
|
5350
|
+
const confirmedRunId = _optionalChain([result, 'access', _288 => _288.scope, 'optionalAccess', _289 => _289.kind]) === "run" ? result.scope.runId.trim() : "";
|
|
5363
5351
|
const foreignRowRunIds = [
|
|
5364
5352
|
...new Set(
|
|
5365
5353
|
result.rows.map(
|
|
@@ -5367,8 +5355,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5367
5355
|
).filter((runId) => runId && runId !== requestedRunId)
|
|
5368
5356
|
)
|
|
5369
5357
|
];
|
|
5370
|
-
if (_optionalChain([result, 'access',
|
|
5371
|
-
throw new (0,
|
|
5358
|
+
if (_optionalChain([result, 'access', _290 => _290.scope, 'optionalAccess', _291 => _291.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
|
|
5359
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
5372
5360
|
`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.`,
|
|
5373
5361
|
void 0,
|
|
5374
5362
|
"RUN_EXPORT_SCOPE_MISMATCH",
|
|
@@ -5396,7 +5384,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5396
5384
|
async stopRun(runId, options) {
|
|
5397
5385
|
return this.http.post(
|
|
5398
5386
|
`/api/v2/runs/${encodeURIComponent(runId)}/stop`,
|
|
5399
|
-
_optionalChain([options, 'optionalAccess',
|
|
5387
|
+
_optionalChain([options, 'optionalAccess', _292 => _292.reason]) ? { reason: options.reason } : {}
|
|
5400
5388
|
);
|
|
5401
5389
|
}
|
|
5402
5390
|
/**
|
|
@@ -5414,16 +5402,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5414
5402
|
* The method clears workspace run-slot state without requiring each run ID.
|
|
5415
5403
|
*/
|
|
5416
5404
|
async stopAllRuns(options) {
|
|
5417
|
-
const dryRun = _optionalChain([options, 'optionalAccess',
|
|
5405
|
+
const dryRun = _optionalChain([options, 'optionalAccess', _293 => _293.dryRun]) === true;
|
|
5418
5406
|
const result = await this.http.post(
|
|
5419
5407
|
"/api/v2/runs/stop-all",
|
|
5420
5408
|
{
|
|
5421
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5409
|
+
..._optionalChain([options, 'optionalAccess', _294 => _294.reason]) ? { reason: options.reason } : {},
|
|
5422
5410
|
...dryRun ? { dryRun: true } : {}
|
|
5423
5411
|
}
|
|
5424
5412
|
);
|
|
5425
5413
|
if (dryRun && !isStopAllPlayRunsDryRunResult(result)) {
|
|
5426
|
-
throw new (0,
|
|
5414
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
5427
5415
|
"This Deepline server does not support runs stop-all --dry-run and performed a real stop-all. Update the server before using --dry-run.",
|
|
5428
5416
|
void 0,
|
|
5429
5417
|
"STOP_ALL_DRY_RUN_UNSUPPORTED"
|
|
@@ -5439,7 +5427,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5439
5427
|
* `origin: "owned"` for org-owned plays.
|
|
5440
5428
|
*/
|
|
5441
5429
|
async listPlays(options) {
|
|
5442
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
5430
|
+
if (!_optionalChain([options, 'optionalAccess', _295 => _295.grep, 'optionalAccess', _296 => _296.trim, 'call', _297 => _297()])) {
|
|
5443
5431
|
return (await this.requestPlaysPage(options, false)).plays;
|
|
5444
5432
|
}
|
|
5445
5433
|
const plays = [];
|
|
@@ -5461,46 +5449,46 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5461
5449
|
}
|
|
5462
5450
|
async requestPlaysPage(options, paginateInventory = true) {
|
|
5463
5451
|
const params = new URLSearchParams();
|
|
5464
|
-
if (paginateInventory && !_optionalChain([options, 'optionalAccess',
|
|
5452
|
+
if (paginateInventory && !_optionalChain([options, 'optionalAccess', _298 => _298.grep, 'optionalAccess', _299 => _299.trim, 'call', _300 => _300()]))
|
|
5465
5453
|
params.set("inventory_paginated", "1");
|
|
5466
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5467
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5468
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5454
|
+
if (_optionalChain([options, 'optionalAccess', _301 => _301.origin])) params.set("origin", options.origin);
|
|
5455
|
+
if (_optionalChain([options, 'optionalAccess', _302 => _302.summaryOnly])) params.set("summary_only", "1");
|
|
5456
|
+
if (_optionalChain([options, 'optionalAccess', _303 => _303.categories])) {
|
|
5469
5457
|
params.set(
|
|
5470
5458
|
"categories",
|
|
5471
5459
|
Array.isArray(options.categories) ? options.categories.join(",") : options.categories
|
|
5472
5460
|
);
|
|
5473
5461
|
}
|
|
5474
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5462
|
+
if (_optionalChain([options, 'optionalAccess', _304 => _304.categories]) || _optionalChain([options, 'optionalAccess', _305 => _305.includeToolCategories])) {
|
|
5475
5463
|
params.set("include_tool_categories", "1");
|
|
5476
5464
|
}
|
|
5477
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5465
|
+
if (_optionalChain([options, 'optionalAccess', _306 => _306.tags])) {
|
|
5478
5466
|
params.set(
|
|
5479
5467
|
"tags",
|
|
5480
5468
|
Array.isArray(options.tags) ? options.tags.join(",") : options.tags
|
|
5481
5469
|
);
|
|
5482
5470
|
}
|
|
5483
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5484
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5471
|
+
if (_optionalChain([options, 'optionalAccess', _307 => _307.includeArchived])) params.set("include_archived", "1");
|
|
5472
|
+
if (_optionalChain([options, 'optionalAccess', _308 => _308.includeCostEstimates])) {
|
|
5485
5473
|
params.set("include_cost_estimates", "1");
|
|
5486
5474
|
}
|
|
5487
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5475
|
+
if (_optionalChain([options, 'optionalAccess', _309 => _309.grep, 'optionalAccess', _310 => _310.trim, 'call', _311 => _311()])) {
|
|
5488
5476
|
params.set("grep", options.grep.trim());
|
|
5489
5477
|
params.set("limit", "60");
|
|
5490
5478
|
}
|
|
5491
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5479
|
+
if (_optionalChain([options, 'optionalAccess', _312 => _312.limit]) !== void 0) {
|
|
5492
5480
|
if (!Number.isSafeInteger(options.limit) || options.limit < 1) {
|
|
5493
5481
|
throw new Error("Play page limit must be a positive integer");
|
|
5494
5482
|
}
|
|
5495
5483
|
params.set("limit", String(options.limit));
|
|
5496
5484
|
}
|
|
5497
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5485
|
+
if (_optionalChain([options, 'optionalAccess', _313 => _313.cursor])) params.set("cursor", options.cursor);
|
|
5498
5486
|
const suffix = params.size ? `?${params.toString()}` : "";
|
|
5499
5487
|
const response = await this.http.get(`/api/v2/plays${suffix}`);
|
|
5500
5488
|
return {
|
|
5501
5489
|
plays: _nullishCoalesce(response.plays, () => ( [])),
|
|
5502
|
-
cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access',
|
|
5503
|
-
hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access',
|
|
5490
|
+
cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _314 => _314.pagination, 'optionalAccess', _315 => _315.cursor]), () => ( response.cursor)), () => ( null)),
|
|
5491
|
+
hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _316 => _316.pagination, 'optionalAccess', _317 => _317.hasMore]), () => ( response.hasMore)))
|
|
5504
5492
|
};
|
|
5505
5493
|
}
|
|
5506
5494
|
/** Read definition-level settings, independently of code revisions. */
|
|
@@ -5570,6 +5558,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5570
5558
|
async listWorkspaceIntegrationConnections() {
|
|
5571
5559
|
return this.http.get("/api/v2/integrations/connections");
|
|
5572
5560
|
}
|
|
5561
|
+
/** List workspace members' personal HubSpot connection status as an admin. */
|
|
5562
|
+
async listPersonalHubSpotMembers(cursor) {
|
|
5563
|
+
const path = "/api/v2/integrations/connections/hubspot-members";
|
|
5564
|
+
return this.http.get(
|
|
5565
|
+
cursor ? `${path}?${new URLSearchParams({ cursor })}` : path
|
|
5566
|
+
);
|
|
5567
|
+
}
|
|
5573
5568
|
/** Manage a workspace-owned OAuth connection. Consent completes in the browser. */
|
|
5574
5569
|
async manageWorkspaceIntegrationConnection(input) {
|
|
5575
5570
|
return this.http.post("/api/v2/integrations/connections", {
|
|
@@ -5587,7 +5582,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5587
5582
|
return this.http.post("/api/v2/integrations/connect", {
|
|
5588
5583
|
provider,
|
|
5589
5584
|
credentials,
|
|
5590
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5585
|
+
..._optionalChain([options, 'optionalAccess', _318 => _318.expectedConnectionId]) ? { expected_connection_id: options.expectedConnectionId } : {}
|
|
5591
5586
|
});
|
|
5592
5587
|
}
|
|
5593
5588
|
/** Calendar discovery compatibility method. The managed pilot requires calendar IDs in tool and Play inputs. */
|
|
@@ -5600,7 +5595,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5600
5595
|
}
|
|
5601
5596
|
/** Start provider OAuth and return the URL to open in a browser. */
|
|
5602
5597
|
async startIntegrationOAuth(provider, options = {}) {
|
|
5603
|
-
const scopes = _optionalChain([options, 'access',
|
|
5598
|
+
const scopes = _optionalChain([options, 'access', _319 => _319.scopes, 'optionalAccess', _320 => _320.map, 'call', _321 => _321((scope) => scope.trim()), 'access', _322 => _322.filter, 'call', _323 => _323(Boolean)]);
|
|
5604
5599
|
if (scopes !== void 0 && scopes.length === 0) {
|
|
5605
5600
|
throw new Error("scopes must contain at least one OAuth scope.");
|
|
5606
5601
|
}
|
|
@@ -5616,8 +5611,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5616
5611
|
return this.http.post("/api/v2/integrations/connect", {
|
|
5617
5612
|
provider: "slack",
|
|
5618
5613
|
scopes: [...PRODUCT_NOTIFICATION_SLACK_OAUTH_SCOPES],
|
|
5619
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5620
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5614
|
+
..._optionalChain([options, 'optionalAccess', _324 => _324.successUrl]) ? { success_url: options.successUrl } : {},
|
|
5615
|
+
..._optionalChain([options, 'optionalAccess', _325 => _325.failureUrl]) ? { failure_url: options.failureUrl } : {}
|
|
5621
5616
|
});
|
|
5622
5617
|
}
|
|
5623
5618
|
/** List Slack channels visible to the connected Deepline Slack app. */
|
|
@@ -5692,7 +5687,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5692
5687
|
}
|
|
5693
5688
|
const targets = input.targets.map(parseNotificationGroupTarget);
|
|
5694
5689
|
const legacyEvents = _nullishCoalesce(input.legacyEvents, () => ( []));
|
|
5695
|
-
const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access',
|
|
5690
|
+
const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _326 => _326[0], 'optionalAccess', _327 => _327.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
|
|
5696
5691
|
if (legacyEvents.length > 0 && !legacyTarget) {
|
|
5697
5692
|
throw new Error(
|
|
5698
5693
|
"--for is supported only by the legacy one-Slack-target form. Create the group first, then add rules in notification configuration."
|
|
@@ -5728,7 +5723,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5728
5723
|
const existingGroup = current.configuration.groups.find(
|
|
5729
5724
|
(candidate) => candidate.name.toLowerCase() === name.toLowerCase()
|
|
5730
5725
|
);
|
|
5731
|
-
const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess',
|
|
5726
|
+
const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _328 => _328.groupKey]), () => ( notificationObjectKey("group")));
|
|
5732
5727
|
const group = _nullishCoalesce(existingGroup, () => ( {
|
|
5733
5728
|
groupKey,
|
|
5734
5729
|
name,
|
|
@@ -5956,7 +5951,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5956
5951
|
/** Read one trigger inventory page without loading run histories. */
|
|
5957
5952
|
async listPlayTriggerInventory(options) {
|
|
5958
5953
|
const params = new URLSearchParams({ view: "inventory" });
|
|
5959
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5954
|
+
if (_optionalChain([options, 'optionalAccess', _329 => _329.cursor])) params.set("cursor", options.cursor);
|
|
5960
5955
|
return this.http.get(`/api/v2/plays/triggers?${params}`);
|
|
5961
5956
|
}
|
|
5962
5957
|
/** Read one trigger's recent runs, with an explicit partial-history flag. */
|
|
@@ -5965,7 +5960,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5965
5960
|
view: "history",
|
|
5966
5961
|
binding_id: bindingId
|
|
5967
5962
|
});
|
|
5968
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5963
|
+
if (_optionalChain([options, 'optionalAccess', _330 => _330.limit]) !== void 0)
|
|
5969
5964
|
params.set("history_limit", String(options.limit));
|
|
5970
5965
|
return this.http.get(`/api/v2/plays/triggers?${params}`);
|
|
5971
5966
|
}
|
|
@@ -6153,14 +6148,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6153
6148
|
*/
|
|
6154
6149
|
async runPlay(code, csvPath, name, options) {
|
|
6155
6150
|
const { workflowId } = await this.submitPlay(code, csvPath, name, {
|
|
6156
|
-
input: _optionalChain([options, 'optionalAccess',
|
|
6157
|
-
sourceCode: _optionalChain([options, 'optionalAccess',
|
|
6158
|
-
artifact: _optionalChain([options, 'optionalAccess',
|
|
6159
|
-
compilerManifest: _optionalChain([options, 'optionalAccess',
|
|
6160
|
-
inputFile: _optionalChain([options, 'optionalAccess',
|
|
6161
|
-
packagedFiles: _optionalChain([options, 'optionalAccess',
|
|
6162
|
-
force: _optionalChain([options, 'optionalAccess',
|
|
6163
|
-
forceToolRefresh: _optionalChain([options, 'optionalAccess',
|
|
6151
|
+
input: _optionalChain([options, 'optionalAccess', _331 => _331.input]),
|
|
6152
|
+
sourceCode: _optionalChain([options, 'optionalAccess', _332 => _332.sourceCode]),
|
|
6153
|
+
artifact: _optionalChain([options, 'optionalAccess', _333 => _333.artifact]),
|
|
6154
|
+
compilerManifest: _optionalChain([options, 'optionalAccess', _334 => _334.compilerManifest]),
|
|
6155
|
+
inputFile: _optionalChain([options, 'optionalAccess', _335 => _335.inputFile]),
|
|
6156
|
+
packagedFiles: _optionalChain([options, 'optionalAccess', _336 => _336.packagedFiles]),
|
|
6157
|
+
force: _optionalChain([options, 'optionalAccess', _337 => _337.force]),
|
|
6158
|
+
forceToolRefresh: _optionalChain([options, 'optionalAccess', _338 => _338.forceToolRefresh])
|
|
6164
6159
|
});
|
|
6165
6160
|
const start = Date.now();
|
|
6166
6161
|
const state = {
|
|
@@ -6171,7 +6166,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6171
6166
|
latest: null
|
|
6172
6167
|
};
|
|
6173
6168
|
let terminalObserved = null;
|
|
6174
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6169
|
+
if (_optionalChain([options, 'optionalAccess', _339 => _339.signal, 'optionalAccess', _340 => _340.aborted])) {
|
|
6175
6170
|
await this.cancelPlay(workflowId);
|
|
6176
6171
|
return {
|
|
6177
6172
|
success: false,
|
|
@@ -6182,9 +6177,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6182
6177
|
};
|
|
6183
6178
|
}
|
|
6184
6179
|
for await (const event of this.watchRunEvents(workflowId, {
|
|
6185
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
6180
|
+
signal: _optionalChain([options, 'optionalAccess', _341 => _341.signal])
|
|
6186
6181
|
})) {
|
|
6187
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6182
|
+
if (_optionalChain([options, 'optionalAccess', _342 => _342.signal, 'optionalAccess', _343 => _343.aborted])) {
|
|
6188
6183
|
await this.cancelPlay(workflowId);
|
|
6189
6184
|
return {
|
|
6190
6185
|
success: false,
|
|
@@ -6194,19 +6189,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6194
6189
|
error: "Cancelled by user"
|
|
6195
6190
|
};
|
|
6196
6191
|
}
|
|
6197
|
-
const previousStatus = _optionalChain([state, 'access',
|
|
6192
|
+
const previousStatus = _optionalChain([state, 'access', _344 => _344.latest, 'optionalAccess', _345 => _345.status]);
|
|
6198
6193
|
const status = updatePlayLiveStatusState(state, event);
|
|
6199
6194
|
if (!status) {
|
|
6200
6195
|
continue;
|
|
6201
6196
|
}
|
|
6202
6197
|
if (event.type !== "play.run.status" || status.status !== previousStatus) {
|
|
6203
|
-
_optionalChain([options, 'optionalAccess',
|
|
6198
|
+
_optionalChain([options, 'optionalAccess', _346 => _346.onProgress, 'optionalCall', _347 => _347(status)]);
|
|
6204
6199
|
}
|
|
6205
|
-
if (
|
|
6200
|
+
if (_chunkCQDQNZGHjs.isTerminalPlayRunLifecycleStatus.call(void 0, status.status)) {
|
|
6206
6201
|
terminalObserved = status;
|
|
6207
6202
|
}
|
|
6208
6203
|
}
|
|
6209
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6204
|
+
if (_optionalChain([options, 'optionalAccess', _348 => _348.signal, 'optionalAccess', _349 => _349.aborted])) {
|
|
6210
6205
|
await this.cancelPlay(workflowId);
|
|
6211
6206
|
return {
|
|
6212
6207
|
success: false,
|
|
@@ -6222,7 +6217,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6222
6217
|
).catch(() => terminalObserved);
|
|
6223
6218
|
return playRunResultFromStatus(finalStatus, start, workflowId);
|
|
6224
6219
|
}
|
|
6225
|
-
throw new (0,
|
|
6220
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
6226
6221
|
`Run watch for ${workflowId} ended before the run reached a terminal state.`,
|
|
6227
6222
|
void 0,
|
|
6228
6223
|
"PLAY_RUN_STREAM_ENDED",
|
|
@@ -6250,7 +6245,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6250
6245
|
async getBillingUsageEvent(requestId) {
|
|
6251
6246
|
const normalizedRequestId = requestId.trim();
|
|
6252
6247
|
if (normalizedRequestId.length === 0 || normalizedRequestId.length > 200 || normalizedRequestId !== requestId) {
|
|
6253
|
-
throw new (0,
|
|
6248
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
6254
6249
|
"Usage request_id must contain 1\u2013200 characters with no leading or trailing whitespace.",
|
|
6255
6250
|
void 0,
|
|
6256
6251
|
"INVALID_USAGE_REQUEST_ID"
|
|
@@ -6259,9 +6254,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6259
6254
|
const response = await this.http.get(
|
|
6260
6255
|
`/api/v2/usage/events?request_id=${encodeURIComponent(normalizedRequestId)}`
|
|
6261
6256
|
);
|
|
6262
|
-
const event = _optionalChain([response, 'access',
|
|
6257
|
+
const event = _optionalChain([response, 'access', _350 => _350.entries, 'optionalAccess', _351 => _351[0]]);
|
|
6263
6258
|
if (!event) {
|
|
6264
|
-
throw new (0,
|
|
6259
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
6265
6260
|
"No usage event was found for this request_id.",
|
|
6266
6261
|
void 0,
|
|
6267
6262
|
"USAGE_EVENT_NOT_FOUND"
|
|
@@ -6275,7 +6270,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6275
6270
|
*/
|
|
6276
6271
|
async getBillingUsageEvents(options = {}) {
|
|
6277
6272
|
const invalid = (message) => {
|
|
6278
|
-
throw new (0,
|
|
6273
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
6279
6274
|
message,
|
|
6280
6275
|
void 0,
|
|
6281
6276
|
"INVALID_USAGE_EVENTS_OPTIONS"
|
|
@@ -6333,14 +6328,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6333
6328
|
if (options.requestId !== void 0) {
|
|
6334
6329
|
const requestId = options.requestId.trim();
|
|
6335
6330
|
if (requestId.length === 0 || requestId.length > 200 || requestId !== options.requestId) {
|
|
6336
|
-
throw new (0,
|
|
6331
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
6337
6332
|
"Usage request_id must contain 1\u2013200 characters with no leading or trailing whitespace.",
|
|
6338
6333
|
void 0,
|
|
6339
6334
|
"INVALID_USAGE_REQUEST_ID"
|
|
6340
6335
|
);
|
|
6341
6336
|
}
|
|
6342
6337
|
if (options.runId !== void 0 || options.cursor !== void 0 || options.offset !== void 0) {
|
|
6343
|
-
throw new (0,
|
|
6338
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
6344
6339
|
"requestId cannot be combined with runId, cursor, or offset.",
|
|
6345
6340
|
void 0,
|
|
6346
6341
|
"INVALID_USAGE_FILTERS"
|
|
@@ -6434,7 +6429,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6434
6429
|
async cancelBillingSubscription(options) {
|
|
6435
6430
|
return this.http.post(
|
|
6436
6431
|
"/api/v2/billing/subscription/cancel",
|
|
6437
|
-
{ action: _optionalChain([options, 'optionalAccess',
|
|
6432
|
+
{ action: _optionalChain([options, 'optionalAccess', _352 => _352.undo]) ? "undo_cancel" : "cancel" }
|
|
6438
6433
|
);
|
|
6439
6434
|
}
|
|
6440
6435
|
/**
|
|
@@ -6446,7 +6441,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6446
6441
|
*/
|
|
6447
6442
|
async listBillingInvoices(options) {
|
|
6448
6443
|
const params = new URLSearchParams();
|
|
6449
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6444
|
+
if (_optionalChain([options, 'optionalAccess', _353 => _353.limit]) !== void 0) {
|
|
6450
6445
|
params.set("limit", String(options.limit));
|
|
6451
6446
|
}
|
|
6452
6447
|
const suffix = Array.from(params).length > 0 ? `?${params.toString()}` : "";
|
|
@@ -6455,8 +6450,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6455
6450
|
);
|
|
6456
6451
|
}
|
|
6457
6452
|
/** List the reviewed target plans and whether new acquisition is enabled. */
|
|
6458
|
-
async getTargetBillingPlans() {
|
|
6459
|
-
return this.http.get(
|
|
6453
|
+
async getTargetBillingPlans(options) {
|
|
6454
|
+
return this.http.get(
|
|
6455
|
+
_optionalChain([options, 'optionalAccess', _354 => _354.promoCode]) ? `/api/v2/billing/plans?promo_code=${encodeURIComponent(options.promoCode)}` : "/api/v2/billing/plans"
|
|
6456
|
+
);
|
|
6460
6457
|
}
|
|
6461
6458
|
/** Read the workspace's normalized target plan, payment, and balance state. */
|
|
6462
6459
|
async getTargetBillingStatus() {
|
|
@@ -6504,7 +6501,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6504
6501
|
/** Recover only the original workspace, credit amount, and purchase key; never charge. */
|
|
6505
6502
|
async recoverTargetBillingCreditPurchase(options) {
|
|
6506
6503
|
if (typeof options.idempotencyKey !== "string") {
|
|
6507
|
-
throw new (0,
|
|
6504
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
6508
6505
|
"The original billing idempotencyKey is required.",
|
|
6509
6506
|
void 0,
|
|
6510
6507
|
"INVALID_BILLING_IDEMPOTENCY_KEY"
|
|
@@ -6514,14 +6511,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6514
6511
|
options.idempotencyKey
|
|
6515
6512
|
);
|
|
6516
6513
|
if (!Number.isSafeInteger(options.credits) || options.credits <= 0) {
|
|
6517
|
-
throw new (0,
|
|
6514
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
6518
6515
|
"credits must be a positive safe integer.",
|
|
6519
6516
|
void 0,
|
|
6520
6517
|
"INVALID_CREDITS"
|
|
6521
6518
|
);
|
|
6522
6519
|
}
|
|
6523
6520
|
if (typeof options.orgId !== "string" || !options.orgId.trim() || options.orgId !== options.orgId.trim()) {
|
|
6524
|
-
throw new (0,
|
|
6521
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
6525
6522
|
"The original orgId is required without surrounding whitespace.",
|
|
6526
6523
|
void 0,
|
|
6527
6524
|
"INVALID_ORG_ID"
|
|
@@ -6547,7 +6544,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6547
6544
|
{
|
|
6548
6545
|
action: options.action,
|
|
6549
6546
|
...options.action === "start_or_change" && options.billingEmail ? { billing_email: options.billingEmail } : {},
|
|
6550
|
-
...options.targetPlanSku ? { target_plan_sku: options.targetPlanSku } : {}
|
|
6547
|
+
...options.targetPlanSku ? { target_plan_sku: options.targetPlanSku } : {},
|
|
6548
|
+
...options.action === "start_or_change" && options.promoCode ? { promo_code: options.promoCode } : {}
|
|
6551
6549
|
},
|
|
6552
6550
|
{ "Idempotency-Key": idempotencyKey },
|
|
6553
6551
|
{ maxRetries: 0, exactUrlOnly: true }
|
|
@@ -6556,7 +6554,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6556
6554
|
/** Create a Stripe-hosted portal session for payment recovery and invoices. */
|
|
6557
6555
|
async createTargetBillingPortalSession(options) {
|
|
6558
6556
|
const response = await this.http.post(
|
|
6559
|
-
_optionalChain([options, 'optionalAccess',
|
|
6557
|
+
_optionalChain([options, 'optionalAccess', _355 => _355.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
|
|
6560
6558
|
{}
|
|
6561
6559
|
);
|
|
6562
6560
|
return response.data;
|
|
@@ -6606,8 +6604,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6606
6604
|
return this.http.request("/api/v2/monitors/audit", {
|
|
6607
6605
|
method: "POST",
|
|
6608
6606
|
body: {
|
|
6609
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6610
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6607
|
+
..._optionalChain([options, 'optionalAccess', _356 => _356.fleetId]) ? { fleet_id: options.fleetId } : {},
|
|
6608
|
+
..._optionalChain([options, 'optionalAccess', _357 => _357.cursor]) ? { cursor: options.cursor } : {}
|
|
6611
6609
|
},
|
|
6612
6610
|
maxRetries: 0
|
|
6613
6611
|
});
|
|
@@ -6617,8 +6615,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6617
6615
|
return this.http.request("/api/v2/monitors/repair", {
|
|
6618
6616
|
method: "POST",
|
|
6619
6617
|
body: {
|
|
6620
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6621
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6618
|
+
..._optionalChain([options, 'optionalAccess', _358 => _358.fleetId]) ? { fleet_id: options.fleetId } : {},
|
|
6619
|
+
..._optionalChain([options, 'optionalAccess', _359 => _359.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
|
|
6622
6620
|
},
|
|
6623
6621
|
maxRetries: 0
|
|
6624
6622
|
});
|
|
@@ -6626,7 +6624,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6626
6624
|
/** Delivery and convergence health. Prefer `client.monitors.health(...)`. */
|
|
6627
6625
|
async readMonitorsHealth(options) {
|
|
6628
6626
|
const params = new URLSearchParams();
|
|
6629
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6627
|
+
if (_optionalChain([options, 'optionalAccess', _360 => _360.fleetId])) params.set("fleet_id", options.fleetId);
|
|
6630
6628
|
const query = params.toString();
|
|
6631
6629
|
const suffix = query ? `?${query}` : "";
|
|
6632
6630
|
return this.http.request(
|
|
@@ -6638,7 +6636,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6638
6636
|
async submitMonitorBatch(options) {
|
|
6639
6637
|
const idempotencyKey = options.idempotencyKey.trim();
|
|
6640
6638
|
if (!idempotencyKey) {
|
|
6641
|
-
throw new (0,
|
|
6639
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
6642
6640
|
"Monitor batch idempotencyKey is required.",
|
|
6643
6641
|
void 0,
|
|
6644
6642
|
"INVALID_MONITOR_BATCH_IDEMPOTENCY_KEY"
|
|
@@ -6646,7 +6644,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6646
6644
|
}
|
|
6647
6645
|
if (options.kind === "deploy") {
|
|
6648
6646
|
if (!options.manifestNdjson.trim()) {
|
|
6649
|
-
throw new (0,
|
|
6647
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
6650
6648
|
"Monitor batch deploy requires a non-empty NDJSON manifest.",
|
|
6651
6649
|
void 0,
|
|
6652
6650
|
"INVALID_MONITOR_BATCH_MANIFEST"
|
|
@@ -6692,14 +6690,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6692
6690
|
async getMonitorBatch(operationId, options) {
|
|
6693
6691
|
const runId = operationId.trim();
|
|
6694
6692
|
if (!runId) {
|
|
6695
|
-
throw new (0,
|
|
6693
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
6696
6694
|
"Monitor batch operation id is required.",
|
|
6697
6695
|
void 0,
|
|
6698
6696
|
"INVALID_MONITOR_BATCH_OPERATION_ID"
|
|
6699
6697
|
);
|
|
6700
6698
|
}
|
|
6701
6699
|
const params = new URLSearchParams();
|
|
6702
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6700
|
+
if (_optionalChain([options, 'optionalAccess', _361 => _361.cursor])) params.set("cursor", options.cursor);
|
|
6703
6701
|
const suffix = params.size > 0 ? `?${params}` : "";
|
|
6704
6702
|
return this.http.request(
|
|
6705
6703
|
`/api/v2/monitors/batch/${encodeURIComponent(runId)}${suffix}`,
|
|
@@ -6746,7 +6744,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6746
6744
|
* a second charge. The submission is never replayed automatically.
|
|
6747
6745
|
*/
|
|
6748
6746
|
async previewMonitor(definition, options) {
|
|
6749
|
-
const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6747
|
+
const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _362 => _362.idempotencyKey]), () => ( `monitor-preview-${_nullishCoalesce(_optionalChain([globalThis, 'access', _363 => _363.crypto, 'optionalAccess', _364 => _364.randomUUID, 'optionalCall', _365 => _365()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`));
|
|
6750
6748
|
try {
|
|
6751
6749
|
const result = await this.http.request(
|
|
6752
6750
|
"/api/v2/monitors/preview",
|
|
@@ -6754,7 +6752,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6754
6752
|
method: "POST",
|
|
6755
6753
|
body: {
|
|
6756
6754
|
...definition,
|
|
6757
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6755
|
+
..._optionalChain([options, 'optionalAccess', _366 => _366.limit]) === void 0 ? {} : { limit: options.limit }
|
|
6758
6756
|
},
|
|
6759
6757
|
headers: { "Idempotency-Key": idempotencyKey },
|
|
6760
6758
|
maxRetries: 0,
|
|
@@ -6776,7 +6774,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6776
6774
|
* `client.monitors.deploy(...)`.
|
|
6777
6775
|
*/
|
|
6778
6776
|
async deployMonitor(definition, options) {
|
|
6779
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6777
|
+
if (_optionalChain([options, 'optionalAccess', _367 => _367.dryRun])) {
|
|
6780
6778
|
return this.http.request("/api/v2/monitors/check", {
|
|
6781
6779
|
method: "POST",
|
|
6782
6780
|
body: definition
|
|
@@ -6812,12 +6810,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6812
6810
|
/** List deployed monitors. Prefer `client.monitors.list(...)`. */
|
|
6813
6811
|
async listMonitors(options) {
|
|
6814
6812
|
const params = new URLSearchParams();
|
|
6815
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6816
|
-
else if (_optionalChain([options, 'optionalAccess',
|
|
6817
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6813
|
+
if (_optionalChain([options, 'optionalAccess', _368 => _368.state])) params.set("state", options.state);
|
|
6814
|
+
else if (_optionalChain([options, 'optionalAccess', _369 => _369.status])) params.set("status", options.status);
|
|
6815
|
+
if (_optionalChain([options, 'optionalAccess', _370 => _370.limit]) !== void 0)
|
|
6818
6816
|
params.set("limit", String(options.limit));
|
|
6819
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6820
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6817
|
+
if (_optionalChain([options, 'optionalAccess', _371 => _371.cursor])) params.set("cursor", options.cursor);
|
|
6818
|
+
if (_optionalChain([options, 'optionalAccess', _372 => _372.includeConsumers])) params.set("include_consumers", "true");
|
|
6821
6819
|
const query = params.toString();
|
|
6822
6820
|
const suffix = query ? `?${query}` : "";
|
|
6823
6821
|
return this.http.request(
|
|
@@ -6828,17 +6826,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6828
6826
|
/** The Monitors list. Prefer `client.monitors.ledger(...)`. */
|
|
6829
6827
|
async listMonitorLedger(options) {
|
|
6830
6828
|
const params = new URLSearchParams();
|
|
6831
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6832
|
-
for (const state of _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6833
|
-
for (const signal of _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6829
|
+
if (_optionalChain([options, 'optionalAccess', _373 => _373.search])) params.set("q", options.search);
|
|
6830
|
+
for (const state of _nullishCoalesce(_optionalChain([options, 'optionalAccess', _374 => _374.states]), () => ( []))) params.append("state", state);
|
|
6831
|
+
for (const signal of _nullishCoalesce(_optionalChain([options, 'optionalAccess', _375 => _375.signals]), () => ( [])))
|
|
6834
6832
|
params.append("signal", signal);
|
|
6835
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6836
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6837
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6838
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6839
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6833
|
+
if (_optionalChain([options, 'optionalAccess', _376 => _376.play])) params.set("play", options.play);
|
|
6834
|
+
if (_optionalChain([options, 'optionalAccess', _377 => _377.fleet])) params.set("fleet", options.fleet);
|
|
6835
|
+
if (_optionalChain([options, 'optionalAccess', _378 => _378.sort])) params.set("sort", options.sort);
|
|
6836
|
+
if (_optionalChain([options, 'optionalAccess', _379 => _379.window])) params.set("window", options.window);
|
|
6837
|
+
if (_optionalChain([options, 'optionalAccess', _380 => _380.limit]) !== void 0)
|
|
6840
6838
|
params.set("limit", String(options.limit));
|
|
6841
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6839
|
+
if (_optionalChain([options, 'optionalAccess', _381 => _381.cursor])) params.set("cursor", options.cursor);
|
|
6842
6840
|
const query = params.toString();
|
|
6843
6841
|
const suffix = query ? `?${query}` : "";
|
|
6844
6842
|
return this.http.request(
|
|
@@ -6855,7 +6853,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6855
6853
|
}
|
|
6856
6854
|
/** A monitor's recent findings. Prefer `client.monitors.ledgerFindings(...)`. */
|
|
6857
6855
|
async listMonitorLedgerFindings(key, options) {
|
|
6858
|
-
const suffix = _optionalChain([options, 'optionalAccess',
|
|
6856
|
+
const suffix = _optionalChain([options, 'optionalAccess', _382 => _382.cursor]) ? `?cursor=${encodeURIComponent(options.cursor)}` : "";
|
|
6859
6857
|
return this.http.request(
|
|
6860
6858
|
`/api/v2/monitors/ledger/${encodeURIComponent(key)}/findings${suffix}`,
|
|
6861
6859
|
{ method: "GET" }
|
|
@@ -6869,8 +6867,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6869
6867
|
);
|
|
6870
6868
|
}
|
|
6871
6869
|
async testMonitorWebhook(key, payload, options) {
|
|
6872
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6873
|
-
throw new (0,
|
|
6870
|
+
if (_optionalChain([options, 'optionalAccess', _383 => _383.dispatch]) === true || _optionalChain([options, 'optionalAccess', _384 => _384.validationOnly]) === false) {
|
|
6871
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
6874
6872
|
"Monitor tests are validation-only and cannot dispatch events.",
|
|
6875
6873
|
void 0,
|
|
6876
6874
|
"MONITOR_TEST_DISPATCH_NOT_SUPPORTED"
|
|
@@ -6924,19 +6922,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6924
6922
|
}
|
|
6925
6923
|
/** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
|
|
6926
6924
|
async deleteMonitor(key, options) {
|
|
6927
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6928
|
-
throw new (0,
|
|
6925
|
+
if (_optionalChain([options, 'optionalAccess', _385 => _385.localOnly]) === true) {
|
|
6926
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
6929
6927
|
"localOnly monitor deletion is no longer supported. Monitor deletion always deprovisions the upstream provider resource.",
|
|
6930
6928
|
void 0,
|
|
6931
6929
|
"MONITOR_LOCAL_ONLY_DELETE_NOT_SUPPORTED"
|
|
6932
6930
|
);
|
|
6933
6931
|
}
|
|
6934
6932
|
const params = new URLSearchParams();
|
|
6935
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6933
|
+
if (_optionalChain([options, 'optionalAccess', _386 => _386.dryRun])) params.set("dry_run", "true");
|
|
6936
6934
|
const query = params.toString();
|
|
6937
6935
|
return this.http.request(
|
|
6938
6936
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
|
|
6939
|
-
_optionalChain([options, 'optionalAccess',
|
|
6937
|
+
_optionalChain([options, 'optionalAccess', _387 => _387.dryRun]) ? { method: "DELETE" } : {
|
|
6940
6938
|
method: "DELETE",
|
|
6941
6939
|
// Deletion is a provider lifecycle operation. A timeout is an
|
|
6942
6940
|
// unknown outcome, not authority to begin another delete attempt.
|
|
@@ -6949,10 +6947,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6949
6947
|
* Prefer `client.monitors.reactivate(...)`.
|
|
6950
6948
|
*/
|
|
6951
6949
|
async reactivateMonitor(key, options) {
|
|
6952
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
6950
|
+
const query = _optionalChain([options, 'optionalAccess', _388 => _388.dryRun]) ? "?dry_run=true" : "";
|
|
6953
6951
|
return this.http.request(
|
|
6954
6952
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
|
|
6955
|
-
_optionalChain([options, 'optionalAccess',
|
|
6953
|
+
_optionalChain([options, 'optionalAccess', _389 => _389.dryRun]) ? { method: "POST", body: {} } : {
|
|
6956
6954
|
method: "POST",
|
|
6957
6955
|
body: {},
|
|
6958
6956
|
// Reactivation can create an upstream resource, so it must not use
|
|
@@ -6966,7 +6964,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6966
6964
|
// ——————————————————————————————————————————————————————————
|
|
6967
6965
|
static __initStatic() {this.MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH = 96}
|
|
6968
6966
|
monitorJobIdempotencyKey(operation) {
|
|
6969
|
-
const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access',
|
|
6967
|
+
const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _390 => _390.crypto, 'optionalAccess', _391 => _391.randomUUID, 'optionalCall', _392 => _392()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
|
|
6970
6968
|
const prefix = "monitor-job-";
|
|
6971
6969
|
const safeOperation = operation.replace(/[^A-Za-z0-9._-]/g, "-");
|
|
6972
6970
|
const maxOperationLength = Math.max(
|
|
@@ -6977,7 +6975,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6977
6975
|
}
|
|
6978
6976
|
monitorJobHeaders(operation, idempotencyKey) {
|
|
6979
6977
|
return {
|
|
6980
|
-
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess',
|
|
6978
|
+
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _393 => _393.trim, 'call', _394 => _394()]) || this.monitorJobIdempotencyKey(operation)
|
|
6981
6979
|
};
|
|
6982
6980
|
}
|
|
6983
6981
|
async deployMonitorBatch(definitions, options) {
|
|
@@ -6988,7 +6986,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6988
6986
|
body: { version: 1, kind: "batch", monitors: definitions },
|
|
6989
6987
|
headers: this.monitorJobHeaders(
|
|
6990
6988
|
"batch-deploy",
|
|
6991
|
-
_optionalChain([options, 'optionalAccess',
|
|
6989
|
+
_optionalChain([options, 'optionalAccess', _395 => _395.idempotencyKey])
|
|
6992
6990
|
),
|
|
6993
6991
|
maxRetries: 0,
|
|
6994
6992
|
exactUrlOnly: true
|
|
@@ -7007,11 +7005,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7007
7005
|
version: 1,
|
|
7008
7006
|
kind: "batch",
|
|
7009
7007
|
monitors: definitions,
|
|
7010
|
-
..._optionalChain([options, 'optionalAccess',
|
|
7008
|
+
..._optionalChain([options, 'optionalAccess', _396 => _396.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
|
|
7011
7009
|
},
|
|
7012
7010
|
headers: this.monitorJobHeaders(
|
|
7013
7011
|
`batch-sync-${batchId}`,
|
|
7014
|
-
_optionalChain([options, 'optionalAccess',
|
|
7012
|
+
_optionalChain([options, 'optionalAccess', _397 => _397.idempotencyKey])
|
|
7015
7013
|
),
|
|
7016
7014
|
maxRetries: 0,
|
|
7017
7015
|
exactUrlOnly: true
|
|
@@ -7026,7 +7024,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7026
7024
|
body: {},
|
|
7027
7025
|
headers: this.monitorJobHeaders(
|
|
7028
7026
|
`batch-start-${batchId}`,
|
|
7029
|
-
_optionalChain([options, 'optionalAccess',
|
|
7027
|
+
_optionalChain([options, 'optionalAccess', _398 => _398.idempotencyKey])
|
|
7030
7028
|
),
|
|
7031
7029
|
maxRetries: 0,
|
|
7032
7030
|
exactUrlOnly: true
|
|
@@ -7041,7 +7039,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7041
7039
|
body: {},
|
|
7042
7040
|
headers: this.monitorJobHeaders(
|
|
7043
7041
|
`batch-stop-${batchId}`,
|
|
7044
|
-
_optionalChain([options, 'optionalAccess',
|
|
7042
|
+
_optionalChain([options, 'optionalAccess', _399 => _399.idempotencyKey])
|
|
7045
7043
|
),
|
|
7046
7044
|
maxRetries: 0,
|
|
7047
7045
|
exactUrlOnly: true
|
|
@@ -7062,7 +7060,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7062
7060
|
body: {},
|
|
7063
7061
|
headers: this.monitorJobHeaders(
|
|
7064
7062
|
`${action}-${monitorKey}`,
|
|
7065
|
-
_optionalChain([options, 'optionalAccess',
|
|
7063
|
+
_optionalChain([options, 'optionalAccess', _400 => _400.idempotencyKey])
|
|
7066
7064
|
),
|
|
7067
7065
|
maxRetries: 0,
|
|
7068
7066
|
exactUrlOnly: true
|
|
@@ -7075,7 +7073,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7075
7073
|
body: definition,
|
|
7076
7074
|
headers: this.monitorJobHeaders(
|
|
7077
7075
|
`sync-${definition.key}`,
|
|
7078
|
-
_optionalChain([options, 'optionalAccess',
|
|
7076
|
+
_optionalChain([options, 'optionalAccess', _401 => _401.idempotencyKey])
|
|
7079
7077
|
),
|
|
7080
7078
|
maxRetries: 0,
|
|
7081
7079
|
exactUrlOnly: true
|
|
@@ -7088,7 +7086,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7088
7086
|
);
|
|
7089
7087
|
}
|
|
7090
7088
|
async getMonitorJobLogs(jobId, options) {
|
|
7091
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
7089
|
+
const query = _optionalChain([options, 'optionalAccess', _402 => _402.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
|
|
7092
7090
|
return this.http.request(
|
|
7093
7091
|
`/api/v2/monitors/jobs/${encodeURIComponent(jobId)}/logs${query}`,
|
|
7094
7092
|
{ method: "GET" }
|
|
@@ -7101,15 +7099,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7101
7099
|
);
|
|
7102
7100
|
}
|
|
7103
7101
|
async waitForMonitorJob(jobId, options) {
|
|
7104
|
-
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
7105
|
-
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
7102
|
+
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _403 => _403.timeoutMs]), () => ( 10 * 6e4)));
|
|
7103
|
+
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _404 => _404.pollIntervalMs]), () => ( 2e3)));
|
|
7106
7104
|
const terminal = /* @__PURE__ */ new Set(["succeeded", "failed", "cancelled"]);
|
|
7107
7105
|
const startedAt = Date.now();
|
|
7108
7106
|
let latest = await this.getMonitorJob(jobId);
|
|
7109
7107
|
while (true) {
|
|
7110
|
-
_optionalChain([options, 'optionalAccess',
|
|
7108
|
+
_optionalChain([options, 'optionalAccess', _405 => _405.onProgress, 'optionalCall', _406 => _406(latest)]);
|
|
7111
7109
|
const job = latest.job;
|
|
7112
|
-
const state = typeof _optionalChain([job, 'optionalAccess',
|
|
7110
|
+
const state = typeof _optionalChain([job, 'optionalAccess', _407 => _407.state]) === "string" ? job.state : void 0;
|
|
7113
7111
|
if (state && terminal.has(state)) return latest;
|
|
7114
7112
|
if (Date.now() - startedAt >= timeoutMs) return latest;
|
|
7115
7113
|
await sleep(pollIntervalMs);
|
|
@@ -7120,14 +7118,21 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7120
7118
|
// Monitor Fleets
|
|
7121
7119
|
// ——————————————————————————————————————————————————————————
|
|
7122
7120
|
monitorFleetIdempotencyKey(operation) {
|
|
7123
|
-
const uuid = _optionalChain([globalThis, 'access',
|
|
7121
|
+
const uuid = _optionalChain([globalThis, 'access', _408 => _408.crypto, 'optionalAccess', _409 => _409.randomUUID, 'optionalCall', _410 => _410()]);
|
|
7124
7122
|
return `monitor-fleet-${operation}-${_nullishCoalesce(uuid, () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`;
|
|
7125
7123
|
}
|
|
7126
7124
|
monitorFleetHeaders(operation, idempotencyKey) {
|
|
7127
7125
|
return {
|
|
7128
|
-
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess',
|
|
7126
|
+
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _411 => _411.trim, 'call', _412 => _412()]) || this.monitorFleetIdempotencyKey(operation)
|
|
7129
7127
|
};
|
|
7130
7128
|
}
|
|
7129
|
+
/**
|
|
7130
|
+
* Fleet writes plan against the whole fleet inside one request, so they
|
|
7131
|
+
* wait as long as the server lets those routes run (300 s) plus transit,
|
|
7132
|
+
* not the client's default. A ten-thousand-member deploy took 62 s; giving
|
|
7133
|
+
* up at 60 s reported a timeout for a plan the server then committed.
|
|
7134
|
+
*/
|
|
7135
|
+
static __initStatic2() {this.MONITOR_FLEET_WRITE_TIMEOUT_MS = 31e4}
|
|
7131
7136
|
monitorFleetPath(fleetId) {
|
|
7132
7137
|
return `/api/v2/monitors/fleets/${encodeURIComponent(fleetId)}`;
|
|
7133
7138
|
}
|
|
@@ -7145,15 +7150,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7145
7150
|
const fleetId = typeof definitionOrId === "string" ? definitionOrId : definitionOrId.id;
|
|
7146
7151
|
const body = {
|
|
7147
7152
|
...typeof definitionOrId === "string" ? {} : { definition: definitionOrId },
|
|
7148
|
-
..._optionalChain([options, 'optionalAccess',
|
|
7149
|
-
..._optionalChain([options, 'optionalAccess',
|
|
7153
|
+
..._optionalChain([options, 'optionalAccess', _413 => _413.dryRun]) ? { dry_run: true } : {},
|
|
7154
|
+
..._optionalChain([options, 'optionalAccess', _414 => _414.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
|
|
7150
7155
|
};
|
|
7151
7156
|
return this.http.request(
|
|
7152
7157
|
this.monitorFleetPath(fleetId),
|
|
7153
7158
|
{
|
|
7154
7159
|
method: "PUT",
|
|
7155
7160
|
body,
|
|
7156
|
-
|
|
7161
|
+
timeout: _DeeplineClient.MONITOR_FLEET_WRITE_TIMEOUT_MS,
|
|
7162
|
+
headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _415 => _415.idempotencyKey])),
|
|
7157
7163
|
maxRetries: 0,
|
|
7158
7164
|
exactUrlOnly: true
|
|
7159
7165
|
}
|
|
@@ -7167,10 +7173,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7167
7173
|
/** The Fleets list. Prefer `client.monitors.fleets.overview()`. */
|
|
7168
7174
|
async listMonitorFleetOverviews(options) {
|
|
7169
7175
|
const params = new URLSearchParams({ view: "overview" });
|
|
7170
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7171
|
-
for (const state of _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
7172
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7173
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7176
|
+
if (_optionalChain([options, 'optionalAccess', _416 => _416.q])) params.set("q", options.q);
|
|
7177
|
+
for (const state of _nullishCoalesce(_optionalChain([options, 'optionalAccess', _417 => _417.states]), () => ( []))) params.append("state", state);
|
|
7178
|
+
if (_optionalChain([options, 'optionalAccess', _418 => _418.sort])) params.set("sort", options.sort);
|
|
7179
|
+
if (_optionalChain([options, 'optionalAccess', _419 => _419.window])) params.set("window", options.window);
|
|
7174
7180
|
return this.http.request(
|
|
7175
7181
|
`/api/v2/monitors/fleets?${params.toString()}`,
|
|
7176
7182
|
{ method: "GET" }
|
|
@@ -7179,7 +7185,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7179
7185
|
/** One fleet's overview. Prefer `client.monitors.fleets.overview(fleetId)`. */
|
|
7180
7186
|
async getMonitorFleetOverview(fleetId, options) {
|
|
7181
7187
|
const params = new URLSearchParams({ view: "overview" });
|
|
7182
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7188
|
+
if (_optionalChain([options, 'optionalAccess', _420 => _420.window])) params.set("window", options.window);
|
|
7183
7189
|
return this.http.request(
|
|
7184
7190
|
`${this.monitorFleetPath(fleetId)}?${params.toString()}`,
|
|
7185
7191
|
{ method: "GET" }
|
|
@@ -7188,10 +7194,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7188
7194
|
/** A fleet's problem members. Prefer `client.monitors.fleets.issues(...)`. */
|
|
7189
7195
|
async listMonitorFleetIssues(fleetId, options) {
|
|
7190
7196
|
const params = new URLSearchParams();
|
|
7191
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7192
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7193
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7194
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7197
|
+
if (_optionalChain([options, 'optionalAccess', _421 => _421.group])) params.set("group", options.group);
|
|
7198
|
+
if (_optionalChain([options, 'optionalAccess', _422 => _422.cause])) params.set("cause", options.cause);
|
|
7199
|
+
if (_optionalChain([options, 'optionalAccess', _423 => _423.cursor])) params.set("cursor", options.cursor);
|
|
7200
|
+
if (_optionalChain([options, 'optionalAccess', _424 => _424.limit]) !== void 0)
|
|
7195
7201
|
params.set("limit", String(options.limit));
|
|
7196
7202
|
const query = params.toString();
|
|
7197
7203
|
return this.http.request(
|
|
@@ -7201,8 +7207,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7201
7207
|
}
|
|
7202
7208
|
async getMonitorFleet(fleetId, options) {
|
|
7203
7209
|
const params = new URLSearchParams();
|
|
7204
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7205
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7210
|
+
if (_optionalChain([options, 'optionalAccess', _425 => _425.drift])) params.set("drift", "1");
|
|
7211
|
+
if (_optionalChain([options, 'optionalAccess', _426 => _426.limit]) !== void 0)
|
|
7206
7212
|
params.set("limit", String(options.limit));
|
|
7207
7213
|
const query = params.toString();
|
|
7208
7214
|
return this.http.request(
|
|
@@ -7215,10 +7221,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7215
7221
|
this.monitorFleetPath(fleetId),
|
|
7216
7222
|
{
|
|
7217
7223
|
method: "DELETE",
|
|
7218
|
-
body: _optionalChain([options, 'optionalAccess',
|
|
7224
|
+
body: _optionalChain([options, 'optionalAccess', _427 => _427.dryRun]) ? { dry_run: true } : {},
|
|
7225
|
+
timeout: _DeeplineClient.MONITOR_FLEET_WRITE_TIMEOUT_MS,
|
|
7219
7226
|
headers: this.monitorFleetHeaders(
|
|
7220
7227
|
"deactivate",
|
|
7221
|
-
_optionalChain([options, 'optionalAccess',
|
|
7228
|
+
_optionalChain([options, 'optionalAccess', _428 => _428.idempotencyKey])
|
|
7222
7229
|
),
|
|
7223
7230
|
maxRetries: 0,
|
|
7224
7231
|
exactUrlOnly: true
|
|
@@ -7231,9 +7238,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7231
7238
|
{
|
|
7232
7239
|
method: "POST",
|
|
7233
7240
|
body: {},
|
|
7241
|
+
timeout: _DeeplineClient.MONITOR_FLEET_WRITE_TIMEOUT_MS,
|
|
7234
7242
|
headers: this.monitorFleetHeaders(
|
|
7235
7243
|
"reactivate",
|
|
7236
|
-
_optionalChain([options, 'optionalAccess',
|
|
7244
|
+
_optionalChain([options, 'optionalAccess', _429 => _429.idempotencyKey])
|
|
7237
7245
|
),
|
|
7238
7246
|
maxRetries: 0,
|
|
7239
7247
|
exactUrlOnly: true
|
|
@@ -7250,9 +7258,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7250
7258
|
* identical to "the request failed".
|
|
7251
7259
|
*/
|
|
7252
7260
|
async waitForMonitorFleetConvergence(fleetId, options) {
|
|
7253
|
-
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
7254
|
-
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
7255
|
-
const terminal = _optionalChain([options, 'optionalAccess',
|
|
7261
|
+
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _430 => _430.timeoutMs]), () => ( 10 * 6e4)));
|
|
7262
|
+
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _431 => _431.pollIntervalMs]), () => ( 2e3)));
|
|
7263
|
+
const terminal = _optionalChain([options, 'optionalAccess', _432 => _432.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded", "billing_suspended"]) : /* @__PURE__ */ new Set([
|
|
7256
7264
|
"converged",
|
|
7257
7265
|
"degraded",
|
|
7258
7266
|
"deactivated",
|
|
@@ -7261,7 +7269,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7261
7269
|
const startedAt = Date.now();
|
|
7262
7270
|
let latest = await this.getMonitorFleet(fleetId);
|
|
7263
7271
|
while (true) {
|
|
7264
|
-
_optionalChain([options, 'optionalAccess',
|
|
7272
|
+
_optionalChain([options, 'optionalAccess', _433 => _433.onProgress, 'optionalCall', _434 => _434(latest)]);
|
|
7265
7273
|
const status = typeof latest.status === "string" ? latest.status : void 0;
|
|
7266
7274
|
if (status && terminal.has(status)) return latest;
|
|
7267
7275
|
if (Date.now() - startedAt >= timeoutMs) return latest;
|
|
@@ -7297,7 +7305,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7297
7305
|
async health() {
|
|
7298
7306
|
return this.http.get("/api/v2/health");
|
|
7299
7307
|
}
|
|
7300
|
-
}, _class.__initStatic(), _class);
|
|
7308
|
+
}, _class.__initStatic(), _class.__initStatic2(), _class);
|
|
7301
7309
|
|
|
7302
7310
|
|
|
7303
7311
|
|