deepline 0.3.542 → 0.3.543
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 +106 -2
- package/dist/bundling-sources/sdk/src/index.ts +7 -0
- package/dist/bundling-sources/sdk/src/integrations.ts +198 -0
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +3 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/tool-calls.ts +35 -11
- package/dist/bundling-sources/sdk/src/types.ts +10 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/calendar-delegation.ts +132 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/tool-connection.ts +13 -0
- package/dist/bundling-sources/shared_libs/monitors/package.json +1 -1
- package/dist/bundling-sources/shared_libs/observability/queue-health.ts +9 -0
- package/dist/bundling-sources/shared_libs/observability/queue-item-connectors.ts +1 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +5 -5
- package/dist/bundling-sources/shared_libs/play-data-plane/sheet-contract.ts +34 -0
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +11 -5
- package/dist/bundling-sources/shared_libs/play-runtime/baked-runner-image.ts +9 -7
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +235 -12
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +20 -1
- package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-janitor.ts +39 -30
- package/dist/bundling-sources/shared_libs/play-runtime/event-wait-tools.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/experiment-switches.ts +10 -4
- package/dist/bundling-sources/shared_libs/play-runtime/fleet-sandbox-sweep.ts +209 -0
- package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts +24 -1
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/contracts.ts +2 -1
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +6 -1
- package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +37 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +42 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-tool-hooks.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-modal-fallback.ts +15 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +23 -5
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +320 -836
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/vercel-sandbox.ts +1061 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox.ts +862 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +45 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/sandbox-create-outcome.ts +3 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +11 -5
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-contract.ts +20 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-placement-policy.ts +71 -34
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-provider-profile.ts +286 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +4 -1
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +12 -3
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +46 -55
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-required-env.ts +127 -5
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd.ts +7 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-lane.ts +214 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/managed-sandbox-resource-sql.ts +118 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +226 -144
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +2 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-ledger-reconciliation.ts +11 -13
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-operation.ts +42 -7
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +2 -1
- package/dist/bundling-sources/shared_libs/play-runtime/suspension.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +17 -0
- package/dist/bundling-sources/shared_libs/play-runtime/vercel-sandbox-runtime-config.ts +217 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +23 -0
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +1 -0
- package/dist/bundling-sources/shared_libs/plays/script-entry.ts +76 -6
- package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +1 -0
- package/dist/bundling-sources/shared_libs/security/credential-revision.ts +50 -0
- package/dist/bundling-sources/shared_libs/security/internal-actor.ts +2 -1
- package/dist/bundling-sources/shared_libs/security/receipt-admission-token.ts +37 -0
- package/dist/cli/{auth-IGBGOB4E.mjs → auth-ITAELTOA.mjs} +5 -5
- package/dist/cli/auth-S6B5WUU5.js +43 -0
- package/dist/cli/{billing-IB2TWE74.js → billing-33XVFDUJ.js} +101 -101
- package/dist/cli/{billing-N37W2I62.mjs → billing-WZ7RVZW4.mjs} +12 -12
- package/dist/cli/{chunk-D44DP4KJ.js → chunk-23D224GI.js} +37 -17
- package/dist/cli/{chunk-B5NP3SHX.mjs → chunk-274WKLSY.mjs} +2 -2
- package/dist/cli/{chunk-GBAT5NMI.mjs → chunk-2HSZCQMT.mjs} +48 -6
- package/dist/cli/{chunk-VLEVVDWG.js → chunk-2JHYYB3F.js} +3 -3
- package/dist/cli/{chunk-FGGPCAGC.js → chunk-2KTGZKRE.js} +18 -18
- package/dist/cli/{chunk-AWLPERL3.js → chunk-2LNTKICO.js} +3 -3
- package/dist/cli/{chunk-5CAVURVS.js → chunk-2NCJQEZH.js} +53 -53
- package/dist/cli/{chunk-6SLEHAXX.js → chunk-3JZXU5OB.js} +5 -5
- package/dist/cli/{chunk-4I47NCRI.js → chunk-46BEBZ3M.js} +497 -328
- package/dist/cli/{chunk-V4EYJKGJ.js → chunk-4JQEAYN3.js} +156 -17
- package/dist/cli/{chunk-DADH3WPE.mjs → chunk-4SKDSSPU.mjs} +2 -2
- package/dist/cli/{chunk-FX4OWXKK.mjs → chunk-52YK3EII.mjs} +2 -2
- package/dist/cli/{chunk-HAITCPCG.js → chunk-5MN3BKNB.js} +16 -16
- package/dist/cli/{chunk-FFDZT255.mjs → chunk-5VIPTLRX.mjs} +1 -1
- package/dist/cli/{chunk-OLH2PHMC.mjs → chunk-6P7TGCHQ.mjs} +1 -1
- package/dist/cli/{chunk-YK7NNZD4.mjs → chunk-6SJZMMD5.mjs} +37 -190
- package/dist/cli/chunk-7AUQTNLB.mjs +455 -0
- package/dist/cli/{chunk-I5EAIFGO.mjs → chunk-AACKPOGA.mjs} +1 -1
- package/dist/cli/{chunk-GM73TZ2W.js → chunk-BGAUADV4.js} +41 -41
- package/dist/cli/{chunk-KQSTV4MW.js → chunk-BLYW6FFB.js} +60 -18
- package/dist/cli/{chunk-LFMQVSEI.js → chunk-C35NLLSA.js} +5 -5
- package/dist/cli/{chunk-5APOJWJF.mjs → chunk-D6YAU3CF.mjs} +182 -13
- package/dist/cli/{chunk-TT4JUUC3.mjs → chunk-DH43ECTN.mjs} +7 -3
- package/dist/cli/{chunk-TTBHOMAA.js → chunk-DI3GL3T6.js} +316 -469
- package/dist/cli/{chunk-D7GWEBMF.js → chunk-DUGTPVT7.js} +7 -7
- package/dist/cli/{chunk-UNDLNT3V.js → chunk-ECWOIXAV.js} +1 -1
- package/dist/cli/{chunk-CFZCRM6R.js → chunk-EHUG6EUT.js} +26 -26
- package/dist/cli/chunk-F6VSQ5LN.js +455 -0
- package/dist/cli/{chunk-ACVTMAW4.mjs → chunk-FNW2SGPD.mjs} +2 -2
- package/dist/cli/{chunk-EHLCWGWN.js → chunk-GRCFX2EG.js} +4 -4
- package/dist/cli/{chunk-OVX3Q5Q3.mjs → chunk-GWNYLIF7.mjs} +1 -1
- package/dist/cli/{chunk-6WQDHEVF.mjs → chunk-HKJ26NRN.mjs} +5 -5
- package/dist/cli/{chunk-L2VKAASU.mjs → chunk-HXIR3VQL.mjs} +21 -0
- package/dist/cli/{chunk-WL2GUGNZ.js → chunk-J2F6F5GL.js} +7 -7
- package/dist/cli/{chunk-2VRKBHMD.mjs → chunk-JXG7HWBA.mjs} +1 -1
- package/dist/cli/{chunk-Z2XA6YU4.mjs → chunk-LX35AXTN.mjs} +1 -0
- package/dist/cli/{chunk-DNGACHFX.js → chunk-MCBUWK5K.js} +22 -22
- package/dist/cli/{chunk-Q7WDXLYO.js → chunk-NHKP2NSU.js} +2 -2
- package/dist/cli/{chunk-FANIRW74.mjs → chunk-NIPLY25A.mjs} +0 -2
- package/dist/cli/{chunk-AKY7KZRJ.js → chunk-NLENABRU.js} +6 -6
- package/dist/cli/{chunk-ORA5TMML.mjs → chunk-NR3O56FT.mjs} +5 -5
- package/dist/cli/{chunk-3XXXMSSP.js → chunk-O2KLWUNI.js} +44 -44
- package/dist/cli/{chunk-ZVNYBQ77.mjs → chunk-OAFKUHN5.mjs} +4 -4
- package/dist/cli/{chunk-2ZGSHVZE.mjs → chunk-OELJKQOL.mjs} +24 -4
- package/dist/cli/{chunk-E7B73LGT.js → chunk-PX7XAVUC.js} +24 -20
- package/dist/cli/{chunk-VHJUH3TB.js → chunk-QFRMVI4S.js} +3 -3
- package/dist/cli/{chunk-Z5YRKX7K.mjs → chunk-R57UCXQG.mjs} +1 -1
- package/dist/cli/{chunk-IPVRMYWT.js → chunk-RKF263LR.js} +5 -5
- package/dist/cli/{chunk-CQDQNZGH.js → chunk-SL6MYJYM.js} +1 -0
- package/dist/cli/{chunk-JPT6VE54.js → chunk-STXG2LFC.js} +2 -2
- package/dist/cli/{chunk-SCLP5H4P.mjs → chunk-SU4K4SUU.mjs} +1 -1
- package/dist/cli/{chunk-NLZHLEHD.mjs → chunk-SYOPHFKB.mjs} +6 -6
- package/dist/cli/{chunk-WACIN4PR.mjs → chunk-SZNJENGT.mjs} +3 -3
- package/dist/cli/{chunk-QXNOSCYL.js → chunk-TBCNL2T5.js} +1 -1
- package/dist/cli/{chunk-E4CABWXL.js → chunk-TI6DTURF.js} +22 -1
- package/dist/cli/{chunk-NDNEARE3.js → chunk-UJ6GOV7K.js} +13 -13
- package/dist/cli/{chunk-GWHA4DAC.js → chunk-UV4RU2TE.js} +0 -2
- package/dist/cli/{chunk-P4MDTBAA.mjs → chunk-VSJEOSYL.mjs} +1 -1
- package/dist/cli/{chunk-EGOCGWCI.mjs → chunk-W2OPPSAZ.mjs} +3 -3
- package/dist/cli/{chunk-46V7QSJE.mjs → chunk-XBM3KABD.mjs} +3 -3
- package/dist/cli/{chunk-QONO7FRF.mjs → chunk-XFPVFWZR.mjs} +1 -1
- package/dist/cli/{chunk-PLIKPGOO.mjs → chunk-XSN6BAZT.mjs} +5 -5
- package/dist/cli/{chunk-IDDKNMFX.mjs → chunk-Y3T5GWYK.mjs} +153 -14
- package/dist/cli/{chunk-AUFE624T.js → chunk-YE3T73BV.js} +10 -10
- package/dist/cli/{chunk-DMXLZ57N.js → chunk-YJYKZ2U3.js} +2 -2
- package/dist/cli/{chunk-F6QV42MC.mjs → chunk-Z7SXGOIQ.mjs} +1 -1
- package/dist/cli/{chunk-SWO5QOXB.mjs → chunk-ZRT2PNYY.mjs} +1 -1
- package/dist/cli/{chunk-3LEUSRV3.mjs → chunk-ZSPBJB7I.mjs} +4 -4
- package/dist/cli/command-docs.js +3 -3
- package/dist/cli/command-docs.mjs +2 -2
- package/dist/cli/concurrent-runs-help-E4OYD3DS.js +21 -0
- package/dist/cli/{concurrent-runs-help-DIBGMEIN.mjs → concurrent-runs-help-Z6ODNL4E.mjs} +7 -7
- package/dist/cli/{csv-CAVA3EMS.mjs → csv-5QW2HPHT.mjs} +4 -4
- package/dist/cli/{csv-XZAM7EYZ.js → csv-SSOFTXHU.js} +13 -13
- package/dist/cli/{db-PPGEOBNG.js → db-4LK5AJNO.js} +29 -29
- package/dist/cli/{db-HD332QI7.mjs → db-K2JMR6EM.mjs} +8 -8
- package/dist/cli/describe-AC6PLEFP.js +50 -0
- package/dist/cli/describe-AXHQZHTT.mjs +50 -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 +3 -3
- package/dist/cli/describe-core.mjs +2 -2
- package/dist/cli/{executions-4ZKBL7IC.js → executions-AATJQQAQ.js} +10 -10
- package/dist/cli/{executions-AFEOLB4A.mjs → executions-FY2XTX2W.mjs} +8 -8
- package/dist/cli/{feedback-J2YPLKMF.mjs → feedback-MKBPRGS6.mjs} +6 -6
- package/dist/cli/{feedback-M6Y33JKT.js → feedback-QPVJER75.js} +14 -14
- package/dist/cli/{git-632RYEF6.mjs → git-AGRFZR3K.mjs} +5 -5
- package/dist/cli/git-RUYFQEJX.js +25 -0
- package/dist/cli/index.js +150 -146
- package/dist/cli/index.mjs +49 -45
- package/dist/cli/integrations-OUQ6U33M.mjs +98 -0
- package/dist/cli/integrations-R6OUFZXI.js +98 -0
- package/dist/cli/{legacy-noops-KWZMXYAU.mjs → legacy-noops-DVL2RRKL.mjs} +6 -6
- package/dist/cli/{legacy-noops-4Y62TKPC.js → legacy-noops-H7INM2QN.js} +9 -9
- package/dist/cli/{mcp-PESLHAAC.mjs → mcp-2Z2YVOLK.mjs} +72 -15
- package/dist/cli/{mcp-35QA6YG7.js → mcp-33F7D7WI.js} +89 -32
- package/dist/cli/{monitors-4DTUZLAI.js → monitors-KDUJHAKJ.js} +102 -102
- package/dist/cli/{monitors-YVBKBJBU.mjs → monitors-NZD2WIKK.mjs} +9 -9
- package/dist/cli/{org-FWCBZMER.js → org-4PQGHLEB.js} +90 -90
- package/dist/cli/{org-DJNKMFCZ.mjs → org-EJW45RUA.mjs} +8 -8
- package/dist/cli/{play-PHVQEEEZ.mjs → play-3CM5RT5J.mjs} +44 -25
- package/dist/cli/{play-FZ45M4KD.js → play-MLHMQL4G.js} +374 -355
- package/dist/cli/{providers-46E67QG7.mjs → providers-BHYBJI4R.mjs} +10 -9
- package/dist/cli/{providers-QJU6FMDD.js → providers-YBJG7277.js} +13 -12
- package/dist/cli/{quickstart-6HMJJ4RR.mjs → quickstart-LL3MR562.mjs} +4 -4
- package/dist/cli/{quickstart-HOL7H5FS.js → quickstart-O7L2NNGJ.js} +6 -6
- package/dist/cli/{run-WKSIRXEC.js → run-HJ2AR6CM.js} +49 -48
- package/dist/cli/{run-2W2TJ6QA.mjs → run-OK545H5Q.mjs} +28 -27
- package/dist/cli/search-UUNS6BCC.js +32 -0
- package/dist/cli/{search-Y2CFLSYB.mjs → search-Z5ZKMRTX.mjs} +9 -9
- package/dist/cli/{search-output-FCZ35PHF.mjs → search-output-Q5VHNUWG.mjs} +4 -4
- package/dist/cli/{search-output-2IK6ZZDY.js → search-output-SVW4DETG.js} +6 -6
- package/dist/cli/{secrets-JVJIHGU4.js → secrets-ENQWMCB5.js} +17 -17
- package/dist/cli/{secrets-PNPNUZLX.mjs → secrets-QIKIEFWB.mjs} +8 -8
- package/dist/cli/{sessions-GY5VVQGO.mjs → sessions-AETO22RF.mjs} +6 -6
- package/dist/cli/sessions-FNSUDERA.js +22 -0
- package/dist/cli/{settings-YQOPF3AI.mjs → settings-G5RGRPFV.mjs} +16 -16
- package/dist/cli/{settings-5WHMFRNQ.js → settings-OFLIFTMZ.js} +89 -89
- package/dist/cli/{setup-O5U5IEVW.mjs → setup-G4N3X6KG.mjs} +9 -9
- package/dist/cli/{setup-3VJMKDEU.js → setup-QW7Y62XD.js} +49 -49
- package/dist/cli/skills-3IXIY2IV.js +36 -0
- package/dist/cli/{skills-G6J5PF35.mjs → skills-QRFQGHNA.mjs} +7 -7
- package/dist/cli/{tools-AG7SWL5Y.mjs → tools-52BH7UTF.mjs} +20 -19
- package/dist/cli/tools-MYBUMPKH.js +57 -0
- package/dist/cli/update-GT7574UU.js +34 -0
- package/dist/cli/{update-K73DD6CR.mjs → update-SDGZLAGL.mjs} +9 -9
- package/dist/cli/{views-MO6DIOMR.mjs → views-3BIJFJMQ.mjs} +8 -8
- package/dist/cli/{views-4D2OTLIO.js → views-5QKAWYPI.js} +23 -23
- package/dist/cli/{workflow-ZEMFCS4Y.js → workflow-G67RPWVY.js} +19 -19
- package/dist/cli/{workflow-MMZMAELI.mjs → workflow-QAK773FR.mjs} +9 -9
- package/dist/{client-X-FJD5Dp.d.ts → client-D1ga52xq.d.ts} +1 -1
- package/dist/{client-DLG9mHDh.d.mts → client-bd4QQIXo.d.mts} +1 -1
- package/dist/{client-core-0jmHfFBv.d.ts → client-core-B6eMVx8h.d.ts} +334 -3
- package/dist/{client-core-WtnqyBwY.d.mts → client-core-CqfWNf2Q.d.mts} +334 -3
- package/dist/{compiler-manifest-Cys06iYg.d.mts → compiler-manifest-BWFtsQIC.d.mts} +21 -0
- package/dist/{compiler-manifest-Cys06iYg.d.ts → compiler-manifest-BWFtsQIC.d.ts} +21 -0
- package/dist/{errors-B6eMjKcr.d.mts → errors-CwKXXtuu.d.mts} +1 -1
- package/dist/{errors-rdOUqcU2.d.ts → errors-Lm9_vJHZ.d.ts} +1 -1
- package/dist/{index-ejWadAL5.d.ts → index-3vJ-V9yw.d.ts} +1 -1
- package/dist/{index-CZdYO81A.d.mts → index-DjwsAt82.d.mts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +12 -12
- package/dist/index.mjs +8 -8
- package/dist/install-integrity.json +147 -133
- 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 +23 -4
- 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 +2 -2
- package/dist/plays/run-request.mjs +1 -1
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +7 -7
- package/dist/server.mjs +5 -5
- package/package.json +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal-resource-usage.ts +0 -222
- package/dist/cli/auth-2PH6RSKL.js +0 -43
- package/dist/cli/concurrent-runs-help-BNIDBKML.js +0 -21
- package/dist/cli/describe-5TFFB2PM.js +0 -49
- package/dist/cli/describe-THQU7N47.mjs +0 -49
- package/dist/cli/git-AQLQYWRI.js +0 -25
- package/dist/cli/search-YLJFCJTK.js +0 -32
- package/dist/cli/sessions-TZ33UCPS.js +0 -22
- package/dist/cli/skills-WZY3XDT3.js +0 -36
- package/dist/cli/tools-BXQBL72Q.js +0 -56
- package/dist/cli/update-XYP5EII6.js +0 -34
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var _chunkE4CABWXLjs = require('./chunk-E4CABWXL.js');
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
|
|
10
|
+
var _chunkTI6DTURFjs = require('./chunk-TI6DTURF.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -20,7 +20,11 @@ var _chunkE4CABWXLjs = require('./chunk-E4CABWXL.js');
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
var _chunkSL6MYJYMjs = require('./chunk-SL6MYJYM.js');
|
|
24
28
|
|
|
25
29
|
|
|
26
30
|
|
|
@@ -32,7 +36,7 @@ var _chunkPMH4GLMDjs = require('./chunk-PMH4GLMD.js');
|
|
|
32
36
|
|
|
33
37
|
|
|
34
38
|
|
|
35
|
-
var
|
|
39
|
+
var _chunkGRCFX2EGjs = require('./chunk-GRCFX2EG.js');
|
|
36
40
|
|
|
37
41
|
|
|
38
42
|
var _chunk2GJZLIKWjs = require('./chunk-2GJZLIKW.js');
|
|
@@ -459,7 +463,7 @@ function validateCliInvocationId(value) {
|
|
|
459
463
|
var INCLUDE_TOOL_METADATA_HEADER = "x-deepline-include-tool-metadata";
|
|
460
464
|
var EXECUTE_RESPONSE_CONTRACT_HEADER = "x-deepline-execute-response-contract";
|
|
461
465
|
var EXECUTE_RESPONSE_INTENT_HEADER = "x-deepline-execute-response-intent";
|
|
462
|
-
var RAW_V2_EXECUTE_RESPONSE_CONTRACT =
|
|
466
|
+
var RAW_V2_EXECUTE_RESPONSE_CONTRACT = _chunkTI6DTURFjs.RAW_V2_TOOL_RESPONSE_CONTRACT;
|
|
463
467
|
var DEFAULT_EXECUTION_RECOVERY_TIMEOUT_MS = 15 * 60 * 1e3;
|
|
464
468
|
function validateExecutionIdempotencyKey(key) {
|
|
465
469
|
if (typeof key !== "string" || key.length < 1 || key.length > 200 || !/^[A-Za-z0-9._:-]+$/.test(key)) {
|
|
@@ -557,7 +561,7 @@ function materializeToolExecutionResponse(response) {
|
|
|
557
561
|
}
|
|
558
562
|
const rawV2 = toolResponse.rawV2;
|
|
559
563
|
const view = toolResponse.view;
|
|
560
|
-
const providerMeta =
|
|
564
|
+
const providerMeta = _chunkTI6DTURFjs.providerMetaFromToolResponseRawV2.call(void 0,
|
|
561
565
|
rawV2,
|
|
562
566
|
_nullishCoalesce(view, () => ( "rawV2"))
|
|
563
567
|
);
|
|
@@ -566,7 +570,7 @@ function materializeToolExecutionResponse(response) {
|
|
|
566
570
|
...response,
|
|
567
571
|
toolResponse: {
|
|
568
572
|
...toolResponse,
|
|
569
|
-
raw:
|
|
573
|
+
raw: _chunkTI6DTURFjs.legacyRawFromToolResponseRawV2.call(void 0,
|
|
570
574
|
rawV2,
|
|
571
575
|
_nullishCoalesce(view, () => ( "rawV2")),
|
|
572
576
|
responseMeta
|
|
@@ -588,24 +592,32 @@ var ToolCalls = class {
|
|
|
588
592
|
this.configuredRequestTimeoutMs = configuredRequestTimeoutMs;
|
|
589
593
|
}
|
|
590
594
|
async call(toolId, input, options) {
|
|
591
|
-
|
|
595
|
+
const connection = _optionalChain([options, 'optionalAccess', _12 => _12.connection]);
|
|
596
|
+
if (connection !== void 0 && (!_chunkTI6DTURFjs.isToolConnectionName.call(void 0, connection) || _optionalChain([options, 'optionalAccess', _13 => _13.idempotencyKey]) !== void 0 || _optionalChain([options, 'optionalAccess', _14 => _14.recover]))) {
|
|
597
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
598
|
+
"Use a valid workspace connection name without execution recovery.",
|
|
599
|
+
400,
|
|
600
|
+
"NAMED_CONNECTION_INVALID"
|
|
601
|
+
);
|
|
602
|
+
}
|
|
603
|
+
if (_optionalChain([options, 'optionalAccess', _15 => _15.cliInvocationId]) !== void 0) {
|
|
592
604
|
validateCliInvocationId(options.cliInvocationId);
|
|
593
605
|
}
|
|
594
606
|
const inputSnapshot = JSON.parse(JSON.stringify(input));
|
|
595
|
-
const metadataSnapshot = _optionalChain([options, 'optionalAccess',
|
|
596
|
-
const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
607
|
+
const metadataSnapshot = _optionalChain([options, 'optionalAccess', _16 => _16.metadata]) ? JSON.parse(JSON.stringify(options.metadata)) : void 0;
|
|
608
|
+
const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _17 => _17.idempotencyKey]), () => ( (_optionalChain([options, 'optionalAccess', _18 => _18.recover]) ? crypto.randomUUID() : void 0)));
|
|
597
609
|
if (idempotencyKey !== void 0) {
|
|
598
610
|
validateExecutionIdempotencyKey(idempotencyKey);
|
|
599
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
611
|
+
if (_optionalChain([options, 'optionalAccess', _19 => _19.recoveryTimeoutMs]) !== void 0 && (!Number.isFinite(options.recoveryTimeoutMs) || options.recoveryTimeoutMs < 0)) {
|
|
600
612
|
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
601
613
|
"recoveryTimeoutMs must be a finite, non-negative number.",
|
|
602
614
|
void 0,
|
|
603
615
|
"IDEMPOTENCY_KEY_INVALID"
|
|
604
616
|
);
|
|
605
617
|
}
|
|
606
|
-
await _optionalChain([options, 'optionalAccess',
|
|
618
|
+
await _optionalChain([options, 'optionalAccess', _20 => _20.onExecution, 'optionalCall', _21 => _21({ idempotencyKey })]);
|
|
607
619
|
}
|
|
608
|
-
const timeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
620
|
+
const timeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _22 => _22.timeout]), () => ( resolveToolExecuteTimeoutMs(
|
|
609
621
|
toolId,
|
|
610
622
|
inputSnapshot,
|
|
611
623
|
this.configuredRequestTimeoutMs
|
|
@@ -617,11 +629,11 @@ var ToolCalls = class {
|
|
|
617
629
|
[_chunkBBTKAASQjs.TOOL_EXECUTION_ERROR_SCHEMA_HEADER]: String(
|
|
618
630
|
_chunkBBTKAASQjs.TOOL_EXECUTION_ERROR_SCHEMA_VERSION
|
|
619
631
|
),
|
|
620
|
-
..._optionalChain([options, 'optionalAccess',
|
|
621
|
-
[EXECUTE_RESPONSE_INTENT_HEADER]: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
632
|
+
..._optionalChain([options, 'optionalAccess', _23 => _23.includeToolMetadata]) ? { [INCLUDE_TOOL_METADATA_HEADER]: "true" } : {},
|
|
633
|
+
[EXECUTE_RESPONSE_INTENT_HEADER]: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _24 => _24.responseIntent]), () => ( "raw")),
|
|
622
634
|
...idempotencyKey ? { "Idempotency-Key": idempotencyKey } : {},
|
|
623
|
-
..._optionalChain([options, 'optionalAccess',
|
|
624
|
-
..._optionalChain([options, 'optionalAccess',
|
|
635
|
+
..._optionalChain([options, 'optionalAccess', _25 => _25.searchRef]) ? { "x-deepline-search-ref": options.searchRef } : {},
|
|
636
|
+
..._optionalChain([options, 'optionalAccess', _26 => _26.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
|
|
625
637
|
};
|
|
626
638
|
let lastResponse = null;
|
|
627
639
|
const observeTerminal = (failure) => {
|
|
@@ -636,7 +648,7 @@ var ToolCalls = class {
|
|
|
636
648
|
if (recovery === "running" || recovery === "outcome_unknown") return;
|
|
637
649
|
const state = isRecord(body) ? body.status : null;
|
|
638
650
|
const terminal = state === "completed" || state === "failed" || state === "cancelled" ? state : state === "canceled" ? "cancelled" : failure ? "failed" : null;
|
|
639
|
-
if (!terminal || !_optionalChain([options, 'optionalAccess',
|
|
651
|
+
if (!terminal || !_optionalChain([options, 'optionalAccess', _27 => _27.onResponseReceived])) return;
|
|
640
652
|
const reportObservationFailure = () => console.error("[tools.execute] response observation failed");
|
|
641
653
|
try {
|
|
642
654
|
const notification = options.onResponseReceived({
|
|
@@ -651,33 +663,34 @@ var ToolCalls = class {
|
|
|
651
663
|
};
|
|
652
664
|
const legacyEndpoint = `/api/v2/integrations/${encodeURIComponent(toolId)}/execute`;
|
|
653
665
|
let useLegacyEndpoint = idempotencyKey === void 0;
|
|
654
|
-
const atomicToolOnly = _optionalChain([options, 'optionalAccess',
|
|
655
|
-
const retryAmbiguousDelivery = atomicToolOnly && !idempotencyKey && _optionalChain([options, 'optionalAccess',
|
|
666
|
+
const atomicToolOnly = _optionalChain([options, 'optionalAccess', _28 => _28.atomicToolOnly]) === true;
|
|
667
|
+
const retryAmbiguousDelivery = connection === void 0 && atomicToolOnly && !idempotencyKey && _optionalChain([options, 'optionalAccess', _29 => _29.retryAmbiguousDelivery]) === true;
|
|
656
668
|
const dispatchRequest = async (requestTimeoutMs) => {
|
|
657
669
|
let recoverySupported = false;
|
|
658
670
|
let atomicToolsSupported = false;
|
|
659
671
|
const post = () => this.http.post(
|
|
660
|
-
atomicToolOnly ? `/api/v2/tools/${encodeURIComponent(toolId)}/execute` : useLegacyEndpoint ? legacyEndpoint : `/api/v2/executions/by-key/${encodeURIComponent(idempotencyKey)}?tool_id=${encodeURIComponent(toolId)}`,
|
|
672
|
+
connection !== void 0 ? `/api/v2/tools/${encodeURIComponent(toolId)}/execute-with-connection` : atomicToolOnly ? `/api/v2/tools/${encodeURIComponent(toolId)}/execute` : useLegacyEndpoint ? legacyEndpoint : `/api/v2/executions/by-key/${encodeURIComponent(idempotencyKey)}?tool_id=${encodeURIComponent(toolId)}`,
|
|
661
673
|
{
|
|
662
674
|
payload: inputSnapshot,
|
|
675
|
+
...connection !== void 0 ? { connection } : {},
|
|
663
676
|
...metadataSnapshot ? { metadata: metadataSnapshot } : {}
|
|
664
677
|
},
|
|
665
678
|
headers,
|
|
666
679
|
{
|
|
667
680
|
timeout: requestTimeoutMs,
|
|
668
|
-
maxRetries: idempotencyKey ? 0 : _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
669
|
-
...atomicToolOnly && !idempotencyKey && _optionalChain([options, 'optionalAccess',
|
|
670
|
-
retryApiErrors: atomicToolOnly || _optionalChain([options, 'optionalAccess',
|
|
671
|
-
retryFromExecutePolicy: atomicToolOnly,
|
|
681
|
+
maxRetries: connection !== void 0 || idempotencyKey ? 0 : _nullishCoalesce(_optionalChain([options, 'optionalAccess', _30 => _30.maxRetries]), () => ( (retryAmbiguousDelivery ? 2 : 0))),
|
|
682
|
+
...connection === void 0 && atomicToolOnly && !idempotencyKey && _optionalChain([options, 'optionalAccess', _31 => _31.maxRetries]) === void 0 ? { executePolicyMaxRetries: 2 } : {},
|
|
683
|
+
retryApiErrors: connection === void 0 && (atomicToolOnly || _optionalChain([options, 'optionalAccess', _32 => _32.retryApiErrors]) === true),
|
|
684
|
+
retryFromExecutePolicy: connection === void 0 && atomicToolOnly,
|
|
672
685
|
retryAmbiguousDelivery,
|
|
673
686
|
exactUrlOnly: true,
|
|
674
687
|
toolId,
|
|
675
688
|
idempotencyKey,
|
|
676
689
|
onResponse: (response2) => {
|
|
677
690
|
lastResponse = null;
|
|
678
|
-
atomicToolsSupported = response2.headers.get(
|
|
691
|
+
atomicToolsSupported = response2.headers.get(_chunkGRCFX2EGjs.ATOMIC_TOOL_EXECUTE_SUPPORTED_HEADER) === "true";
|
|
679
692
|
recoverySupported = response2.headers.get("X-Deepline-Idempotency-Supported") === "true";
|
|
680
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
693
|
+
if (_optionalChain([options, 'optionalAccess', _33 => _33.onServerTiming])) {
|
|
681
694
|
try {
|
|
682
695
|
const notification = options.onServerTiming(
|
|
683
696
|
parseExecuteServerTiming(
|
|
@@ -697,6 +710,7 @@ var ToolCalls = class {
|
|
|
697
710
|
try {
|
|
698
711
|
return await post();
|
|
699
712
|
} catch (error) {
|
|
713
|
+
if (connection !== void 0) throw error;
|
|
700
714
|
if (atomicToolOnly) {
|
|
701
715
|
if (!atomicToolsSupported && !recoverySupported && !(error instanceof _chunkBBTKAASQjs.ToolExecutionError) && error instanceof _chunkBBTKAASQjs.DeeplineError && (error.statusCode === 404 || error.statusCode === 405)) {
|
|
702
716
|
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
@@ -713,7 +727,7 @@ var ToolCalls = class {
|
|
|
713
727
|
await this.lookupExecutionByKey(
|
|
714
728
|
idempotencyKey,
|
|
715
729
|
requestTimeoutMs,
|
|
716
|
-
_optionalChain([options, 'optionalAccess',
|
|
730
|
+
_optionalChain([options, 'optionalAccess', _34 => _34.cliInvocationId])
|
|
717
731
|
);
|
|
718
732
|
useLegacyEndpoint = true;
|
|
719
733
|
return post();
|
|
@@ -730,7 +744,7 @@ var ToolCalls = class {
|
|
|
730
744
|
};
|
|
731
745
|
let response;
|
|
732
746
|
let recoveryDeadline = null;
|
|
733
|
-
const recoveryTimeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
747
|
+
const recoveryTimeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _35 => _35.recoveryTimeoutMs]), () => ( DEFAULT_EXECUTION_RECOVERY_TIMEOUT_MS));
|
|
734
748
|
let retryDelayMs = 1e3;
|
|
735
749
|
const recoveryTimeoutError = () => executionRecoveryError({
|
|
736
750
|
toolId,
|
|
@@ -758,7 +772,7 @@ var ToolCalls = class {
|
|
|
758
772
|
this.defaultRequestTimeoutMs,
|
|
759
773
|
remainingMs
|
|
760
774
|
),
|
|
761
|
-
_optionalChain([options, 'optionalAccess',
|
|
775
|
+
_optionalChain([options, 'optionalAccess', _36 => _36.cliInvocationId])
|
|
762
776
|
);
|
|
763
777
|
} catch (error) {
|
|
764
778
|
if (!isRecoverableExecutionLookupError(error)) throw error;
|
|
@@ -897,7 +911,7 @@ function normalizePlayRuntimeSelection(value) {
|
|
|
897
911
|
if (record.sandboxPlacementPolicy !== void 0 && sandboxPlacementPolicy === null) {
|
|
898
912
|
return null;
|
|
899
913
|
}
|
|
900
|
-
if (record.backend !== void 0 && record.backend !==
|
|
914
|
+
if (record.backend !== void 0 && record.backend !== _chunkTI6DTURFjs.PLAY_RUNTIME_BACKENDS.daytona && record.backend !== _chunkTI6DTURFjs.PLAY_RUNTIME_BACKENDS.modal) {
|
|
901
915
|
return null;
|
|
902
916
|
}
|
|
903
917
|
return {
|
|
@@ -951,11 +965,11 @@ function resolvePlayRunRuntimeSelection(request, env) {
|
|
|
951
965
|
}
|
|
952
966
|
return runtime;
|
|
953
967
|
}
|
|
954
|
-
const configured = _optionalChain([env, 'access',
|
|
955
|
-
const configuredNamespace = _optionalChain([env, 'access',
|
|
956
|
-
const configuredToken = _optionalChain([env, 'access',
|
|
957
|
-
const configuredPlacementPolicy = _optionalChain([env, 'access',
|
|
958
|
-
if (_optionalChain([env, 'access',
|
|
968
|
+
const configured = _optionalChain([env, 'access', _37 => _37.DEEPLINE_RUNTIME_ENVIRONMENT, 'optionalAccess', _38 => _38.trim, 'call', _39 => _39()]);
|
|
969
|
+
const configuredNamespace = _optionalChain([env, 'access', _40 => _40.DEEPLINE_RUNTIME_NAMESPACE, 'optionalAccess', _41 => _41.trim, 'call', _42 => _42()]);
|
|
970
|
+
const configuredToken = _optionalChain([env, 'access', _43 => _43.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _44 => _44.trim, 'call', _45 => _45()]);
|
|
971
|
+
const configuredPlacementPolicy = _optionalChain([env, 'access', _46 => _46.DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY, 'optionalAccess', _47 => _47.trim, 'call', _48 => _48()]);
|
|
972
|
+
if (_optionalChain([env, 'access', _49 => _49.DEEPLINE_RUNTIME_GATEWAY_PROFILE, 'optionalAccess', _50 => _50.trim, 'call', _51 => _51()])) {
|
|
959
973
|
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
960
974
|
"DEEPLINE_RUNTIME_GATEWAY_PROFILE was removed: Runtime gateway profiles (vercel_app@1) are no longer available. Unset it to run on the default gateways.",
|
|
961
975
|
void 0,
|
|
@@ -1013,7 +1027,7 @@ function resolvePlayRunRuntimeSelection(request, env) {
|
|
|
1013
1027
|
"INVALID_RUNTIME_NAMESPACE"
|
|
1014
1028
|
);
|
|
1015
1029
|
}
|
|
1016
|
-
const configuredBackendValue = _optionalChain([env, 'access',
|
|
1030
|
+
const configuredBackendValue = _optionalChain([env, 'access', _52 => _52.DEEPLINE_PLAY_RUNNER_BACKEND, 'optionalAccess', _53 => _53.trim, 'call', _54 => _54()]);
|
|
1017
1031
|
const configuredBackend = configuredBackendValue === "daytona" || configuredBackendValue === "modal" ? configuredBackendValue : void 0;
|
|
1018
1032
|
if (configuredBackendValue && !configuredBackend) {
|
|
1019
1033
|
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
@@ -1051,7 +1065,7 @@ function resolveStartPlayRunRequest(request, env) {
|
|
|
1051
1065
|
}
|
|
1052
1066
|
function runtimeSelectionHeaders(runtime, env) {
|
|
1053
1067
|
if (!runtime || runtime.environment === "native") return void 0;
|
|
1054
|
-
const token = _optionalChain([env, 'access',
|
|
1068
|
+
const token = _optionalChain([env, 'access', _55 => _55.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _56 => _56.trim, 'call', _57 => _57()]);
|
|
1055
1069
|
if (!token) {
|
|
1056
1070
|
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
1057
1071
|
"DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN is required for explicit preview runtime selection.",
|
|
@@ -1059,17 +1073,17 @@ function runtimeSelectionHeaders(runtime, env) {
|
|
|
1059
1073
|
"RUNTIME_ENVIRONMENT_TOKEN_REQUIRED"
|
|
1060
1074
|
);
|
|
1061
1075
|
}
|
|
1062
|
-
const receivers = _optionalChain([env, 'access',
|
|
1076
|
+
const receivers = _optionalChain([env, 'access', _58 => _58.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _59 => _59.trim, 'call', _60 => _60()]);
|
|
1063
1077
|
return {
|
|
1064
|
-
[
|
|
1065
|
-
...receivers ? { [
|
|
1078
|
+
[_chunkGRCFX2EGjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
|
|
1079
|
+
...receivers ? { [_chunkGRCFX2EGjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
|
|
1066
1080
|
};
|
|
1067
1081
|
}
|
|
1068
1082
|
function playRunStartHeaders(runtime, env) {
|
|
1069
1083
|
const headers = runtimeSelectionHeaders(runtime, env);
|
|
1070
|
-
const experimentSwitches = _optionalChain([env, 'access',
|
|
1084
|
+
const experimentSwitches = _optionalChain([env, 'access', _61 => _61.DEEPLINE_EXPERIMENT_SWITCHES, 'optionalAccess', _62 => _62.trim, 'call', _63 => _63()]);
|
|
1071
1085
|
if (!experimentSwitches) return headers;
|
|
1072
|
-
return { ...headers, [
|
|
1086
|
+
return { ...headers, [_chunkGRCFX2EGjs.EXPERIMENT_SWITCHES_HEADER]: experimentSwitches };
|
|
1073
1087
|
}
|
|
1074
1088
|
function normalizeTestPolicyOverrides(value, source) {
|
|
1075
1089
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
@@ -1083,7 +1097,7 @@ function normalizeTestPolicyOverrides(value, source) {
|
|
|
1083
1097
|
}
|
|
1084
1098
|
function parseEnvTestPolicyOverrides(env) {
|
|
1085
1099
|
const raw = env.DEEPLINE_TEST_POLICY_OVERRIDES;
|
|
1086
|
-
const trimmed = _optionalChain([raw, 'optionalAccess',
|
|
1100
|
+
const trimmed = _optionalChain([raw, 'optionalAccess', _64 => _64.trim, 'call', _65 => _65()]);
|
|
1087
1101
|
if (!trimmed) return void 0;
|
|
1088
1102
|
let parsed;
|
|
1089
1103
|
try {
|
|
@@ -1102,18 +1116,18 @@ function isRecord2(value) {
|
|
|
1102
1116
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
1103
1117
|
}
|
|
1104
1118
|
function normalizePlayStatus(raw) {
|
|
1105
|
-
const runPackage =
|
|
1106
|
-
const packageRun = _optionalChain([runPackage, 'optionalAccess',
|
|
1107
|
-
const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess',
|
|
1108
|
-
const status =
|
|
1119
|
+
const runPackage = _chunkSL6MYJYMjs.isPlayRunPackage.call(void 0, raw) ? raw : _chunkSL6MYJYMjs.isPlayRunPackage.call(void 0, raw.package) ? raw.package : null;
|
|
1120
|
+
const packageRun = _optionalChain([runPackage, 'optionalAccess', _66 => _66.run]);
|
|
1121
|
+
const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess', _67 => _67.status]) === "string" ? packageRun.status : null;
|
|
1122
|
+
const status = _chunkSL6MYJYMjs.decodePlayRunPublicStatus.call(void 0, rawStatus);
|
|
1109
1123
|
if (!status) {
|
|
1110
1124
|
throw new Error(
|
|
1111
1125
|
`Invalid play run lifecycle status in API response: ${JSON.stringify(rawStatus)}.`
|
|
1112
1126
|
);
|
|
1113
1127
|
}
|
|
1114
|
-
const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess',
|
|
1115
|
-
const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess',
|
|
1116
|
-
const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess',
|
|
1128
|
+
const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess', _68 => _68.id]), () => ( ""));
|
|
1129
|
+
const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _69 => _69.overview]), () => ( raw.overview));
|
|
1130
|
+
const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _70 => _70.runStatus]), () => ( raw.runStatus));
|
|
1117
1131
|
return {
|
|
1118
1132
|
...raw,
|
|
1119
1133
|
runId,
|
|
@@ -1136,25 +1150,25 @@ var PlayClient = class {
|
|
|
1136
1150
|
async startPlayRun(request, options) {
|
|
1137
1151
|
const resolved = resolveStartPlayRunRequest(request, this.environment);
|
|
1138
1152
|
const headers = playRunStartHeaders(resolved.runtime, this.environment);
|
|
1139
|
-
return
|
|
1153
|
+
return _chunkSL6MYJYMjs.startPlayRun.call(void 0,
|
|
1140
1154
|
this.http,
|
|
1141
1155
|
resolved.request,
|
|
1142
|
-
_optionalChain([options, 'optionalAccess',
|
|
1156
|
+
_optionalChain([options, 'optionalAccess', _71 => _71.cliAdmission]) ? { ...headers, "X-Deepline-API-Major": String(_chunkGRCFX2EGjs.SDK_API_MAJOR) } : headers,
|
|
1143
1157
|
options
|
|
1144
1158
|
);
|
|
1145
1159
|
}
|
|
1146
1160
|
async getPlayStatus(workflowId, options) {
|
|
1147
1161
|
const params = new URLSearchParams();
|
|
1148
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1162
|
+
if (_optionalChain([options, 'optionalAccess', _72 => _72.billing]) === false) {
|
|
1149
1163
|
params.set("billing", "false");
|
|
1150
1164
|
}
|
|
1151
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1165
|
+
if (_optionalChain([options, 'optionalAccess', _73 => _73.full]) === true) {
|
|
1152
1166
|
params.set("full", "true");
|
|
1153
1167
|
}
|
|
1154
1168
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
1155
1169
|
const response = await this.http.get(
|
|
1156
1170
|
`/api/v2/runs/${encodeURIComponent(workflowId)}${query}`,
|
|
1157
|
-
_optionalChain([options, 'optionalAccess',
|
|
1171
|
+
_optionalChain([options, 'optionalAccess', _74 => _74.runStatus]) === true ? { headers: { "x-deepline-run-status": "1" } } : void 0
|
|
1158
1172
|
);
|
|
1159
1173
|
return normalizePlayStatus(response);
|
|
1160
1174
|
}
|
|
@@ -1167,7 +1181,7 @@ var PlayClient = class {
|
|
|
1167
1181
|
async stopPlay(workflowId, options) {
|
|
1168
1182
|
return this.http.post(
|
|
1169
1183
|
`/api/v2/runs/${encodeURIComponent(workflowId)}/stop`,
|
|
1170
|
-
_optionalChain([options, 'optionalAccess',
|
|
1184
|
+
_optionalChain([options, 'optionalAccess', _75 => _75.reason]) ? { reason: options.reason } : {}
|
|
1171
1185
|
);
|
|
1172
1186
|
}
|
|
1173
1187
|
async listPlayRuns(playName) {
|
|
@@ -1179,7 +1193,7 @@ var PlayClient = class {
|
|
|
1179
1193
|
}
|
|
1180
1194
|
async getPlay(name, options) {
|
|
1181
1195
|
const encodedName = encodeURIComponent(name);
|
|
1182
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
1196
|
+
const query = _optionalChain([options, 'optionalAccess', _76 => _76.source]) ? `?include=source&revision=${encodeURIComponent(options.source)}` : _optionalChain([options, 'optionalAccess', _77 => _77.guidance]) ? "?include=guidance" : "";
|
|
1183
1197
|
return this.http.get(`/api/v2/plays/${encodedName}${query}`);
|
|
1184
1198
|
}
|
|
1185
1199
|
async clearPlayHistory(name, request = {}) {
|
|
@@ -1191,7 +1205,7 @@ var PlayClient = class {
|
|
|
1191
1205
|
}
|
|
1192
1206
|
async listPlayVersions(name, options) {
|
|
1193
1207
|
const encodedName = encodeURIComponent(name);
|
|
1194
|
-
const suffix = _optionalChain([options, 'optionalAccess',
|
|
1208
|
+
const suffix = _optionalChain([options, 'optionalAccess', _78 => _78.full]) ? "?full=true" : "";
|
|
1195
1209
|
const response = await this.http.get(
|
|
1196
1210
|
`/api/v2/plays/${encodedName}/versions${suffix}`
|
|
1197
1211
|
);
|
|
@@ -2148,7 +2162,7 @@ function parseDsl(input) {
|
|
|
2148
2162
|
input.slice(position)
|
|
2149
2163
|
);
|
|
2150
2164
|
if (!operation) {
|
|
2151
|
-
const token = _nullishCoalesce(_nullishCoalesce(_optionalChain([/^(?:[=!<>~]+|[A-Za-z_]+)/, 'access',
|
|
2165
|
+
const token = _nullishCoalesce(_nullishCoalesce(_optionalChain([/^(?:[=!<>~]+|[A-Za-z_]+)/, 'access', _79 => _79.exec, 'call', _80 => _80(input.slice(position)), 'optionalAccess', _81 => _81[0]]), () => ( input[position])), () => ( "<end>"));
|
|
2152
2166
|
if (token === "=") {
|
|
2153
2167
|
const corrected = `${input.slice(0, position)}==${input.slice(position + 1)}`;
|
|
2154
2168
|
fail(
|
|
@@ -2227,7 +2241,7 @@ function normalizeRunEventQueryTimestamp(value) {
|
|
|
2227
2241
|
return /[1-9]/.test(extraMicros) ? canonical2.replace(/Z$/, `${extraMicros}Z`) : canonical2;
|
|
2228
2242
|
}
|
|
2229
2243
|
function timestampMicros(value) {
|
|
2230
|
-
const fraction = _nullishCoalesce(_optionalChain([/\.(\d+)Z$/, 'access',
|
|
2244
|
+
const fraction = _nullishCoalesce(_optionalChain([/\.(\d+)Z$/, 'access', _82 => _82.exec, 'call', _83 => _83(value), 'optionalAccess', _84 => _84[1]]), () => ( ""));
|
|
2231
2245
|
return BigInt(Date.parse(value)) * BigInt(1e3) + BigInt(fraction.padEnd(6, "0").slice(3));
|
|
2232
2246
|
}
|
|
2233
2247
|
function time(value, nowMs, fallback) {
|
|
@@ -2403,6 +2417,118 @@ function isStopAllPlayRunsDryRunResult(result) {
|
|
|
2403
2417
|
return "dryRun" in result && result.dryRun === true;
|
|
2404
2418
|
}
|
|
2405
2419
|
|
|
2420
|
+
// src/integrations.ts
|
|
2421
|
+
var CALENDAR_PROVIDER = "google_calendar_availability";
|
|
2422
|
+
function invalid(message) {
|
|
2423
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(message, 400, "INVALID_ARGUMENT");
|
|
2424
|
+
}
|
|
2425
|
+
async function findConnection(client, name, provider) {
|
|
2426
|
+
const { connections } = await client.listWorkspaceConnectionInventory(
|
|
2427
|
+
provider,
|
|
2428
|
+
{ authorizationsOnly: true }
|
|
2429
|
+
);
|
|
2430
|
+
const matches = connections.filter(
|
|
2431
|
+
(row) => row.name === name && (!provider || row.provider === provider)
|
|
2432
|
+
);
|
|
2433
|
+
if (matches.length === 0)
|
|
2434
|
+
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
2435
|
+
`No workspace connection named ${JSON.stringify(name)}. Run deepline integrations list --json.`,
|
|
2436
|
+
404,
|
|
2437
|
+
"NOT_FOUND"
|
|
2438
|
+
);
|
|
2439
|
+
if (matches.length > 1)
|
|
2440
|
+
invalid("This name exists for multiple providers. Pass --provider.");
|
|
2441
|
+
return matches[0];
|
|
2442
|
+
}
|
|
2443
|
+
async function changeConnection(client, action, name, options) {
|
|
2444
|
+
const row = await findConnection(client, name, options.provider);
|
|
2445
|
+
if (options.booking && (action !== "reconnect" || row.type !== "workspace_delegation"))
|
|
2446
|
+
invalid("Use --booking with Google Workspace verify or reconnect.");
|
|
2447
|
+
if (row.type === "workspace_delegation") {
|
|
2448
|
+
if (row.provider !== CALENDAR_PROVIDER || !row.domain)
|
|
2449
|
+
invalid("The workspace approval is missing its provider or domain.");
|
|
2450
|
+
if (row.authorizationVersion === void 0)
|
|
2451
|
+
invalid("The API did not return a workspace approval revision.");
|
|
2452
|
+
if (action === "reconnect") {
|
|
2453
|
+
return verifyWorkspace(client, row.domain, options, row);
|
|
2454
|
+
}
|
|
2455
|
+
if (options.verificationEmail)
|
|
2456
|
+
invalid("Use --verification-email with reconnect or verify.");
|
|
2457
|
+
if (action === "delete" && row.status !== "disconnected")
|
|
2458
|
+
invalid("Disconnect this approval before deleting it.");
|
|
2459
|
+
const change2 = action === "delete" ? {
|
|
2460
|
+
action: "remove_workspace",
|
|
2461
|
+
domain: row.domain,
|
|
2462
|
+
connectionId: row.id,
|
|
2463
|
+
grantRevision: row.authorizationVersion
|
|
2464
|
+
} : {
|
|
2465
|
+
action: "disable_workspace",
|
|
2466
|
+
domain: row.domain,
|
|
2467
|
+
connectionId: row.id,
|
|
2468
|
+
grantRevision: row.authorizationVersion
|
|
2469
|
+
};
|
|
2470
|
+
if (options.dryRun) return change2;
|
|
2471
|
+
return client.changeCalendarDelegation(change2);
|
|
2472
|
+
}
|
|
2473
|
+
if (options.verificationEmail)
|
|
2474
|
+
invalid("--verification-email applies to Google Workspace approvals.");
|
|
2475
|
+
if (row.type !== "oauth" || row.provider !== "hubspot" && row.provider !== CALENDAR_PROVIDER)
|
|
2476
|
+
invalid(
|
|
2477
|
+
"Manage this credential type through deepline integrations connect <provider> --link."
|
|
2478
|
+
);
|
|
2479
|
+
if (row.authorizationVersion === void 0)
|
|
2480
|
+
invalid("The API did not return a connection authorization version.");
|
|
2481
|
+
const change = {
|
|
2482
|
+
action: action === "delete" ? "remove" : action,
|
|
2483
|
+
provider: row.provider,
|
|
2484
|
+
name,
|
|
2485
|
+
connectionId: row.id,
|
|
2486
|
+
authorizationVersion: row.authorizationVersion
|
|
2487
|
+
};
|
|
2488
|
+
if (options.dryRun) return change;
|
|
2489
|
+
return client.manageWorkspaceIntegrationConnection(change);
|
|
2490
|
+
}
|
|
2491
|
+
async function verifyWorkspace(client, domain, options, existing) {
|
|
2492
|
+
domain = domain.trim().toLowerCase();
|
|
2493
|
+
if (!_chunkTI6DTURFjs.GOOGLE_WORKSPACE_DOMAIN_PATTERN.test(domain))
|
|
2494
|
+
invalid("Enter a Google Workspace domain, such as example.com.");
|
|
2495
|
+
const email = _optionalChain([options, 'access', _85 => _85.verificationEmail, 'optionalAccess', _86 => _86.trim, 'call', _87 => _87(), 'access', _88 => _88.toLowerCase, 'call', _89 => _89()]);
|
|
2496
|
+
if (!email || email.length > 254 || !/^[^\s@]+@[^\s@]+$/.test(email) || email.split("@")[1] !== domain)
|
|
2497
|
+
invalid("Pass --verification-email with a work email in this domain.");
|
|
2498
|
+
const settings = existing ? {
|
|
2499
|
+
grantRevision: existing.authorizationVersion,
|
|
2500
|
+
connectionId: existing.id,
|
|
2501
|
+
grantedScopes: existing.scopes
|
|
2502
|
+
} : await client.getCalendarDelegation(void 0, void 0, domain);
|
|
2503
|
+
if (settings.grantRevision === void 0)
|
|
2504
|
+
invalid("The API did not return a workspace approval revision.");
|
|
2505
|
+
const requestedScopes = options.booking ? [..._chunkTI6DTURFjs.GOOGLE_WORKSPACE_BOOKING_SCOPES] : settings.grantedScopes;
|
|
2506
|
+
const change = {
|
|
2507
|
+
action: "enable_workspace",
|
|
2508
|
+
domain,
|
|
2509
|
+
grantRevision: settings.grantRevision,
|
|
2510
|
+
...settings.connectionId ? { connectionId: settings.connectionId } : {},
|
|
2511
|
+
verificationEmail: email,
|
|
2512
|
+
..._optionalChain([requestedScopes, 'optionalAccess', _90 => _90.includes, 'call', _91 => _91(_chunkTI6DTURFjs.GOOGLE_WORKSPACE_BOOKING_SCOPE)]) ? { requestedScopes } : {}
|
|
2513
|
+
};
|
|
2514
|
+
if (options.dryRun) return change;
|
|
2515
|
+
return client.changeCalendarDelegation(change);
|
|
2516
|
+
}
|
|
2517
|
+
function createIntegrationsNamespace(client) {
|
|
2518
|
+
return {
|
|
2519
|
+
list: (options = {}) => client.listWorkspaceConnectionInventory(options.provider, {
|
|
2520
|
+
authorizationsOnly: true
|
|
2521
|
+
}),
|
|
2522
|
+
get: (name, options = {}) => findConnection(client, name, options.provider),
|
|
2523
|
+
connect: (provider) => client.getIntegrationConnectLink(provider),
|
|
2524
|
+
reconnect: (name, options = {}) => changeConnection(client, "reconnect", name, options),
|
|
2525
|
+
disconnect: (name, options = {}) => changeConnection(client, "disconnect", name, options),
|
|
2526
|
+
delete: (name, options = {}) => changeConnection(client, "delete", name, options),
|
|
2527
|
+
verify: (domain, options) => verifyWorkspace(client, domain, options),
|
|
2528
|
+
members: (provider, options = {}) => client.listManagedConnectionMembers(provider, options.cursor)
|
|
2529
|
+
};
|
|
2530
|
+
}
|
|
2531
|
+
|
|
2406
2532
|
// ../plays/trigger-config-route.ts
|
|
2407
2533
|
function playTriggerConfigPath(playName) {
|
|
2408
2534
|
return `/api/v2/plays/${encodeURIComponent(playName)}/triggers`;
|
|
@@ -2705,7 +2831,7 @@ var TERMINAL_STATUS_BY_EVENT_TYPE = {
|
|
|
2705
2831
|
|
|
2706
2832
|
// ../play-runtime/run-snapshot-stream.ts
|
|
2707
2833
|
function isTerminalPlayRunLiveStatus(status) {
|
|
2708
|
-
return
|
|
2834
|
+
return _chunkSL6MYJYMjs.isTerminalPlayRunLifecycleStatus.call(void 0, status);
|
|
2709
2835
|
}
|
|
2710
2836
|
function makeRunStreamEvent(input) {
|
|
2711
2837
|
return {
|
|
@@ -2735,10 +2861,10 @@ function getStepStatusSignature(snapshot) {
|
|
|
2735
2861
|
_nullishCoalesce(state.artifactTableNamespace, () => ( "")),
|
|
2736
2862
|
_nullishCoalesce(state.startedAt, () => ( "")),
|
|
2737
2863
|
_nullishCoalesce(state.completedAt, () => ( "")),
|
|
2738
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
2739
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
2864
|
+
_nullishCoalesce(_optionalChain([state, 'access', _92 => _92.progress, 'optionalAccess', _93 => _93.startedAt]), () => ( "")),
|
|
2865
|
+
_nullishCoalesce(_optionalChain([state, 'access', _94 => _94.progress, 'optionalAccess', _95 => _95.completedAt]), () => ( "")),
|
|
2740
2866
|
_nullishCoalesce(state.updatedAt, () => ( "")),
|
|
2741
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
2867
|
+
_nullishCoalesce(_optionalChain([state, 'access', _96 => _96.progress, 'optionalAccess', _97 => _97.updatedAt]), () => ( ""))
|
|
2742
2868
|
].join(":")
|
|
2743
2869
|
).join("|");
|
|
2744
2870
|
}
|
|
@@ -2747,11 +2873,11 @@ function getStepProgressSignature(snapshot) {
|
|
|
2747
2873
|
snapshot.nodeStates.map((state) => [
|
|
2748
2874
|
state.nodeId,
|
|
2749
2875
|
projectPlayStepProgressCounters(_nullishCoalesce(state.progress, () => ( {}))),
|
|
2750
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
2751
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
2752
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
2753
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
2754
|
-
_nullishCoalesce(_optionalChain([state, 'access',
|
|
2876
|
+
_nullishCoalesce(_optionalChain([state, 'access', _98 => _98.progress, 'optionalAccess', _99 => _99.artifactTableNamespace]), () => ( "")),
|
|
2877
|
+
_nullishCoalesce(_optionalChain([state, 'access', _100 => _100.progress, 'optionalAccess', _101 => _101.startedAt]), () => ( "")),
|
|
2878
|
+
_nullishCoalesce(_optionalChain([state, 'access', _102 => _102.progress, 'optionalAccess', _103 => _103.completedAt]), () => ( "")),
|
|
2879
|
+
_nullishCoalesce(_optionalChain([state, 'access', _104 => _104.progress, 'optionalAccess', _105 => _105.updatedAt]), () => ( "")),
|
|
2880
|
+
_nullishCoalesce(_optionalChain([state, 'access', _106 => _106.progress, 'optionalAccess', _107 => _107.message]), () => ( ""))
|
|
2755
2881
|
])
|
|
2756
2882
|
);
|
|
2757
2883
|
}
|
|
@@ -2821,8 +2947,8 @@ function diffPlayRunStreamEvents(input) {
|
|
|
2821
2947
|
if (state.status === "idle") {
|
|
2822
2948
|
continue;
|
|
2823
2949
|
}
|
|
2824
|
-
const persistedStartedAt = _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access',
|
|
2825
|
-
const persistedCompletedAt = _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access',
|
|
2950
|
+
const persistedStartedAt = _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _108 => _108.progress, 'optionalAccess', _109 => _109.startedAt]))), () => ( null));
|
|
2951
|
+
const persistedCompletedAt = _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _110 => _110.progress, 'optionalAccess', _111 => _111.completedAt]))), () => ( null));
|
|
2826
2952
|
events.push(
|
|
2827
2953
|
makeRunStreamEvent({
|
|
2828
2954
|
cursor,
|
|
@@ -2836,7 +2962,7 @@ function diffPlayRunStreamEvents(input) {
|
|
|
2836
2962
|
...resolveTimingWindow({
|
|
2837
2963
|
startedAt: persistedStartedAt,
|
|
2838
2964
|
completedAt: persistedCompletedAt,
|
|
2839
|
-
updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access',
|
|
2965
|
+
updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _112 => _112.progress, 'optionalAccess', _113 => _113.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
|
|
2840
2966
|
})
|
|
2841
2967
|
}
|
|
2842
2968
|
})
|
|
@@ -2890,9 +3016,9 @@ function diffPlayRunStreamEvents(input) {
|
|
|
2890
3016
|
if (next.snapshotSignature !== previous.snapshotSignature) {
|
|
2891
3017
|
const enrichedNodeStates = snapshot.nodeStates.map((state) => {
|
|
2892
3018
|
const timing = resolveTimingWindow({
|
|
2893
|
-
startedAt: _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access',
|
|
2894
|
-
completedAt: _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access',
|
|
2895
|
-
updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access',
|
|
3019
|
+
startedAt: _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _114 => _114.progress, 'optionalAccess', _115 => _115.startedAt]))), () => ( null)),
|
|
3020
|
+
completedAt: _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _116 => _116.progress, 'optionalAccess', _117 => _117.completedAt]))), () => ( null)),
|
|
3021
|
+
updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _118 => _118.progress, 'optionalAccess', _119 => _119.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
|
|
2896
3022
|
});
|
|
2897
3023
|
return {
|
|
2898
3024
|
...state,
|
|
@@ -2942,18 +3068,18 @@ var RUN_WATCH_SERVER_WAIT_MS = 0;
|
|
|
2942
3068
|
var RUN_WATCH_SERVER_WAIT_FROM_START = false;
|
|
2943
3069
|
var TERMINAL_LOG_PROJECTION_RETRY_LIMIT = 3;
|
|
2944
3070
|
function waitForNextPoll(ms, signal) {
|
|
2945
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
3071
|
+
if (_optionalChain([signal, 'optionalAccess', _120 => _120.aborted])) {
|
|
2946
3072
|
return Promise.resolve(false);
|
|
2947
3073
|
}
|
|
2948
3074
|
return new Promise((resolve) => {
|
|
2949
3075
|
const finish = (elapsed) => {
|
|
2950
3076
|
clearTimeout(timeout);
|
|
2951
|
-
_optionalChain([signal, 'optionalAccess',
|
|
3077
|
+
_optionalChain([signal, 'optionalAccess', _121 => _121.removeEventListener, 'call', _122 => _122("abort", onAbort)]);
|
|
2952
3078
|
resolve(elapsed);
|
|
2953
3079
|
};
|
|
2954
3080
|
const onAbort = () => finish(false);
|
|
2955
3081
|
const timeout = setTimeout(() => finish(true), ms);
|
|
2956
|
-
_optionalChain([signal, 'optionalAccess',
|
|
3082
|
+
_optionalChain([signal, 'optionalAccess', _123 => _123.addEventListener, 'call', _124 => _124("abort", onAbort, { once: true })]);
|
|
2957
3083
|
});
|
|
2958
3084
|
}
|
|
2959
3085
|
function readSnapshotResponse(response, runId) {
|
|
@@ -3034,7 +3160,7 @@ async function* watchRunEvents(options) {
|
|
|
3034
3160
|
let outageNoticeSent = false;
|
|
3035
3161
|
let pollCount = 0;
|
|
3036
3162
|
let terminalLogProjectionRetries = 0;
|
|
3037
|
-
while (!_optionalChain([signal, 'optionalAccess',
|
|
3163
|
+
while (!_optionalChain([signal, 'optionalAccess', _125 => _125.aborted])) {
|
|
3038
3164
|
const pollStartedAt = Date.now();
|
|
3039
3165
|
const poll = ++pollCount;
|
|
3040
3166
|
const pastStartup = pollStartedAt - watchStartedAt >= RUN_WATCH_STARTUP_WINDOW_MS;
|
|
@@ -3083,7 +3209,7 @@ async function* watchRunEvents(options) {
|
|
|
3083
3209
|
reportPoll();
|
|
3084
3210
|
} catch (error) {
|
|
3085
3211
|
reportPoll();
|
|
3086
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
3212
|
+
if (_optionalChain([signal, 'optionalAccess', _126 => _126.aborted])) {
|
|
3087
3213
|
return;
|
|
3088
3214
|
}
|
|
3089
3215
|
if (!isTransientPlayRunReadError(error)) {
|
|
@@ -3092,12 +3218,12 @@ async function* watchRunEvents(options) {
|
|
|
3092
3218
|
consecutiveFailures += 1;
|
|
3093
3219
|
const reason = error instanceof Error ? error.message : String(error);
|
|
3094
3220
|
if (!outageNoticeSent) {
|
|
3095
|
-
_optionalChain([options, 'access',
|
|
3221
|
+
_optionalChain([options, 'access', _127 => _127.onRetry, 'optionalCall', _128 => _128({
|
|
3096
3222
|
attempt: consecutiveFailures,
|
|
3097
3223
|
delayMs: pollIntervalMs,
|
|
3098
3224
|
reason
|
|
3099
3225
|
})]);
|
|
3100
|
-
_optionalChain([options, 'access',
|
|
3226
|
+
_optionalChain([options, 'access', _129 => _129.onNotice, 'optionalCall', _130 => _130(
|
|
3101
3227
|
`[watch] run snapshot request failed; retrying snapshot polling (${reason})`
|
|
3102
3228
|
)]);
|
|
3103
3229
|
outageNoticeSent = true;
|
|
@@ -3112,7 +3238,7 @@ async function* watchRunEvents(options) {
|
|
|
3112
3238
|
continue;
|
|
3113
3239
|
}
|
|
3114
3240
|
if (outageNoticeSent) {
|
|
3115
|
-
_optionalChain([options, 'access',
|
|
3241
|
+
_optionalChain([options, 'access', _131 => _131.onNotice, 'optionalCall', _132 => _132("[watch] run snapshot polling recovered")]);
|
|
3116
3242
|
outageNoticeSent = false;
|
|
3117
3243
|
}
|
|
3118
3244
|
consecutiveFailures = 0;
|
|
@@ -3127,14 +3253,14 @@ async function* watchRunEvents(options) {
|
|
|
3127
3253
|
if (!await waitForNextPoll(remaining2, signal)) return;
|
|
3128
3254
|
continue;
|
|
3129
3255
|
}
|
|
3130
|
-
_optionalChain([options, 'access',
|
|
3256
|
+
_optionalChain([options, 'access', _133 => _133.onNotice, 'optionalCall', _134 => _134(
|
|
3131
3257
|
`[watch] terminal status is complete, but final logs are unavailable in this watch; fetch retained logs with deepline runs logs ${runId}`
|
|
3132
3258
|
)]);
|
|
3133
3259
|
} else {
|
|
3134
3260
|
terminalLogProjectionRetries = 0;
|
|
3135
3261
|
}
|
|
3136
3262
|
if (terminalStatus) {
|
|
3137
|
-
await _optionalChain([options, 'access',
|
|
3263
|
+
await _optionalChain([options, 'access', _135 => _135.terminalStatus, 'optionalAccess', _136 => _136.onStatus, 'call', _137 => _137(terminalStatus, snapshot.status)]);
|
|
3138
3264
|
}
|
|
3139
3265
|
const diff = diffPlayRunStreamEvents({
|
|
3140
3266
|
streamId,
|
|
@@ -3198,7 +3324,7 @@ function parseNotificationGroupTarget(value) {
|
|
|
3198
3324
|
}
|
|
3199
3325
|
return { kind: "email", email };
|
|
3200
3326
|
}
|
|
3201
|
-
const slack = _optionalChain([/^slack:(.+)$/i, 'access',
|
|
3327
|
+
const slack = _optionalChain([/^slack:(.+)$/i, 'access', _138 => _138.exec, 'call', _139 => _139(normalized), 'optionalAccess', _140 => _140[1], 'optionalAccess', _141 => _141.trim, 'call', _142 => _142()]);
|
|
3202
3328
|
if (!slack) {
|
|
3203
3329
|
const provider = normalized.split(":", 1)[0] || normalized;
|
|
3204
3330
|
throw new Error(
|
|
@@ -3206,7 +3332,7 @@ function parseNotificationGroupTarget(value) {
|
|
|
3206
3332
|
);
|
|
3207
3333
|
}
|
|
3208
3334
|
const member = /^member:([UW][A-Z0-9]{8,})$/i.exec(slack);
|
|
3209
|
-
if (_optionalChain([member, 'optionalAccess',
|
|
3335
|
+
if (_optionalChain([member, 'optionalAccess', _143 => _143[1]])) {
|
|
3210
3336
|
return { kind: "slack", memberId: member[1].toUpperCase() };
|
|
3211
3337
|
}
|
|
3212
3338
|
if (slack.toLowerCase().startsWith("member:")) {
|
|
@@ -3231,11 +3357,11 @@ var REGISTER_PLAY_ARTIFACTS_COMPILE_CONCURRENCY = 3;
|
|
|
3231
3357
|
var REGISTER_PLAY_ARTIFACTS_MAX_BATCH_COUNT = 3;
|
|
3232
3358
|
var REGISTER_PLAY_ARTIFACTS_MAX_BATCH_BYTES = 25e5;
|
|
3233
3359
|
function isolatedCiRuntimeEventReadHeaders(env) {
|
|
3234
|
-
const schema = _optionalChain([env, 'access',
|
|
3235
|
-
if (_optionalChain([env, 'access',
|
|
3360
|
+
const schema = _optionalChain([env, 'access', _144 => _144.DEEPLINE_RUNTIME_SCHEDULER_SCHEMA, 'optionalAccess', _145 => _145.trim, 'call', _146 => _146()]);
|
|
3361
|
+
if (_optionalChain([env, 'access', _147 => _147.DEEPLINE_SYNTHETIC_RUN, 'optionalAccess', _148 => _148.trim, 'call', _149 => _149()]) !== "1" || !schema || !/^fly_absurd_pr_\d+_\d+(?:_\d+)?$/.test(schema)) {
|
|
3236
3362
|
return void 0;
|
|
3237
3363
|
}
|
|
3238
|
-
const token = _optionalChain([env, 'access',
|
|
3364
|
+
const token = _optionalChain([env, 'access', _150 => _150.DEEPLINE_INTERNAL_TOKEN, 'optionalAccess', _151 => _151.trim, 'call', _152 => _152()]);
|
|
3239
3365
|
if (!token) {
|
|
3240
3366
|
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
3241
3367
|
"DEEPLINE_INTERNAL_TOKEN is required for isolated CI runtime event reads.",
|
|
@@ -3243,7 +3369,7 @@ function isolatedCiRuntimeEventReadHeaders(env) {
|
|
|
3243
3369
|
"RUNTIME_EVENT_INTERNAL_TOKEN_REQUIRED"
|
|
3244
3370
|
);
|
|
3245
3371
|
}
|
|
3246
|
-
return { [
|
|
3372
|
+
return { [_chunkGRCFX2EGjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
|
|
3247
3373
|
}
|
|
3248
3374
|
function sleep(ms) {
|
|
3249
3375
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -3258,7 +3384,7 @@ function isTransientCompileManifestError(error) {
|
|
|
3258
3384
|
);
|
|
3259
3385
|
}
|
|
3260
3386
|
function requireCompileManifestResponse(response, playName) {
|
|
3261
|
-
const compilerManifest = _optionalChain([response, 'optionalAccess',
|
|
3387
|
+
const compilerManifest = _optionalChain([response, 'optionalAccess', _153 => _153.compilerManifest]);
|
|
3262
3388
|
if (!compilerManifest || typeof compilerManifest !== "object" || Array.isArray(compilerManifest)) {
|
|
3263
3389
|
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
3264
3390
|
`Compile manifest response did not include compilerManifest for ${playName}.`,
|
|
@@ -3310,7 +3436,7 @@ function chunkRegisterPlayArtifacts(artifacts) {
|
|
|
3310
3436
|
}
|
|
3311
3437
|
function searchParams(options) {
|
|
3312
3438
|
const params = new URLSearchParams();
|
|
3313
|
-
params.set("q", _nullishCoalesce(_optionalChain([options, 'access',
|
|
3439
|
+
params.set("q", _nullishCoalesce(_optionalChain([options, 'access', _154 => _154.query, 'optionalAccess', _155 => _155.trim, 'call', _156 => _156()]), () => ( "")));
|
|
3314
3440
|
params.set(
|
|
3315
3441
|
"include_search_debug",
|
|
3316
3442
|
options.includeSearchDebug ? "true" : "false"
|
|
@@ -3320,13 +3446,13 @@ function searchParams(options) {
|
|
|
3320
3446
|
if (options.offset !== void 0) {
|
|
3321
3447
|
params.set("offset", String(options.offset));
|
|
3322
3448
|
}
|
|
3323
|
-
if (_optionalChain([options, 'access',
|
|
3449
|
+
if (_optionalChain([options, 'access', _157 => _157.categories, 'optionalAccess', _158 => _158.trim, 'call', _159 => _159()])) {
|
|
3324
3450
|
params.set("categories", options.categories.trim());
|
|
3325
3451
|
}
|
|
3326
|
-
if (_optionalChain([options, 'access',
|
|
3452
|
+
if (_optionalChain([options, 'access', _160 => _160.searchTerms, 'optionalAccess', _161 => _161.trim, 'call', _162 => _162()])) {
|
|
3327
3453
|
params.set("search_terms", options.searchTerms.trim());
|
|
3328
3454
|
}
|
|
3329
|
-
if (_optionalChain([options, 'access',
|
|
3455
|
+
if (_optionalChain([options, 'access', _163 => _163.task, 'optionalAccess', _164 => _164.trim, 'call', _165 => _165()])) params.set("task", options.task.trim());
|
|
3330
3456
|
return params;
|
|
3331
3457
|
}
|
|
3332
3458
|
var RUNS_FAILED_LOG_LIMIT = 20;
|
|
@@ -3374,7 +3500,7 @@ function playLiveRunStatus(event) {
|
|
|
3374
3500
|
return null;
|
|
3375
3501
|
}
|
|
3376
3502
|
const payload = getPlayLiveEventPayload(event);
|
|
3377
|
-
return _nullishCoalesce(
|
|
3503
|
+
return _nullishCoalesce(_chunkSL6MYJYMjs.decodePlayRunPublicStatus.call(void 0, payload.status), () => ( (_chunkSL6MYJYMjs.isPlayRunPackage.call(void 0, payload) ? _chunkSL6MYJYMjs.decodePlayRunPublicStatus.call(void 0, payload.run.status) : null)));
|
|
3378
3504
|
}
|
|
3379
3505
|
function appendPlayLiveLogLines(state, payload) {
|
|
3380
3506
|
const lines = readStringArray(payload.lines);
|
|
@@ -3406,7 +3532,7 @@ function updatePlayLiveStatusState(state, event) {
|
|
|
3406
3532
|
if (event.type !== "play.run.snapshot" && event.type !== "play.run.status" && event.type !== "play.run.final_status") {
|
|
3407
3533
|
return null;
|
|
3408
3534
|
}
|
|
3409
|
-
const runId = typeof payload.runId === "string" && payload.runId ? payload.runId :
|
|
3535
|
+
const runId = typeof payload.runId === "string" && payload.runId ? payload.runId : _chunkSL6MYJYMjs.isPlayRunPackage.call(void 0, payload) ? payload.run.id : state.runId;
|
|
3410
3536
|
const status = _nullishCoalesce(playLiveRunStatus(event), () => ( state.status));
|
|
3411
3537
|
const progressPayload = isRecord3(payload.progress) ? payload.progress : {};
|
|
3412
3538
|
if (event.type === "play.run.final_status" && state.logs.length === 0 && state.lastLogSeq === 0) {
|
|
@@ -3419,7 +3545,7 @@ function updatePlayLiveStatusState(state, event) {
|
|
|
3419
3545
|
}
|
|
3420
3546
|
if ("result" in payload) {
|
|
3421
3547
|
state.result = payload.result;
|
|
3422
|
-
} else if (
|
|
3548
|
+
} else if (_chunkSL6MYJYMjs.isPlayRunPackage.call(void 0, payload)) {
|
|
3423
3549
|
state.result = payload;
|
|
3424
3550
|
}
|
|
3425
3551
|
if (typeof payload.error === "string" && payload.error.trim()) {
|
|
@@ -3432,7 +3558,7 @@ function updatePlayLiveStatusState(state, event) {
|
|
|
3432
3558
|
...payload,
|
|
3433
3559
|
runId,
|
|
3434
3560
|
status,
|
|
3435
|
-
...
|
|
3561
|
+
..._chunkSL6MYJYMjs.isPlayRunPackage.call(void 0, payload) ? { package: payload, outputs: payload.outputs } : {},
|
|
3436
3562
|
progress: {
|
|
3437
3563
|
...progressRecord,
|
|
3438
3564
|
status: typeof progressRecord.status === "string" ? progressRecord.status : status,
|
|
@@ -3450,9 +3576,9 @@ function playRunResultFromStatus(status, startedAt, fallbackRunId) {
|
|
|
3450
3576
|
runId: status.runId || fallbackRunId,
|
|
3451
3577
|
result: _nullishCoalesce(status.package, () => ( status.result)),
|
|
3452
3578
|
...status.package ? { package: status.package } : {},
|
|
3453
|
-
logs: _nullishCoalesce(_optionalChain([status, 'access',
|
|
3579
|
+
logs: _nullishCoalesce(_optionalChain([status, 'access', _166 => _166.progress, 'optionalAccess', _167 => _167.logs]), () => ( [])),
|
|
3454
3580
|
durationMs: Date.now() - startedAt,
|
|
3455
|
-
error: _nullishCoalesce(_optionalChain([status, 'access',
|
|
3581
|
+
error: _nullishCoalesce(_optionalChain([status, 'access', _168 => _168.progress, 'optionalAccess', _169 => _169.error]), () => ( (status.status !== "completed" ? status.status : void 0)))
|
|
3456
3582
|
};
|
|
3457
3583
|
}
|
|
3458
3584
|
var DeeplineClient = (_class = class _DeeplineClient {
|
|
@@ -3471,6 +3597,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3471
3597
|
|
|
3472
3598
|
/** Monitors namespace: access, catalog, deploy/check, and lifecycle. */
|
|
3473
3599
|
|
|
3600
|
+
/** Named workspace authorizations and provider setup wizard links. */
|
|
3601
|
+
|
|
3474
3602
|
/**
|
|
3475
3603
|
* Create a low-level SDK client.
|
|
3476
3604
|
*
|
|
@@ -3484,6 +3612,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3484
3612
|
this.config = config;
|
|
3485
3613
|
this.environment = _nullishCoalesce(this.config.environment, () => ( process.env));
|
|
3486
3614
|
this.http = http;
|
|
3615
|
+
this.integrations = createIntegrationsNamespace(this);
|
|
3487
3616
|
this.playClient = new PlayClient(this.http, this.environment);
|
|
3488
3617
|
this.toolCalls = new ToolCalls(
|
|
3489
3618
|
this.http,
|
|
@@ -3561,7 +3690,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3561
3690
|
{},
|
|
3562
3691
|
{
|
|
3563
3692
|
"Idempotency-Key": requireBillingIdempotencyKey(
|
|
3564
|
-
_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3693
|
+
_nullishCoalesce(_optionalChain([options, 'optionalAccess', _170 => _170.idempotencyKey]), () => ( globalThis.crypto.randomUUID()))
|
|
3565
3694
|
)
|
|
3566
3695
|
}
|
|
3567
3696
|
),
|
|
@@ -3570,10 +3699,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3570
3699
|
cards: {
|
|
3571
3700
|
list: (options) => {
|
|
3572
3701
|
const query = new URLSearchParams();
|
|
3573
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3702
|
+
if (_optionalChain([options, 'optionalAccess', _171 => _171.limit]) !== void 0) {
|
|
3574
3703
|
query.set("limit", String(options.limit));
|
|
3575
3704
|
}
|
|
3576
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3705
|
+
if (_optionalChain([options, 'optionalAccess', _172 => _172.cursor])) query.set("cursor", options.cursor);
|
|
3577
3706
|
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
3578
3707
|
return this.http.get(
|
|
3579
3708
|
`/api/v2/billing/payment-methods${suffix}`
|
|
@@ -3581,7 +3710,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3581
3710
|
},
|
|
3582
3711
|
add: (options) => this.http.post(
|
|
3583
3712
|
"/api/v2/billing/payment-method/setup",
|
|
3584
|
-
{ make_default: _optionalChain([options, 'optionalAccess',
|
|
3713
|
+
{ make_default: _optionalChain([options, 'optionalAccess', _173 => _173.makeDefault]) === true }
|
|
3585
3714
|
),
|
|
3586
3715
|
setDefault: (options) => this.http.post(
|
|
3587
3716
|
"/api/v2/billing/payment-methods/default",
|
|
@@ -3605,7 +3734,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3605
3734
|
};
|
|
3606
3735
|
this.workspaces = {
|
|
3607
3736
|
members: (options) => {
|
|
3608
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
3737
|
+
const query = _optionalChain([options, 'optionalAccess', _174 => _174.cursor]) ? `?cursor=${encodeURIComponent(options.cursor)}` : "";
|
|
3609
3738
|
return this.http.get(`/api/v2/auth/workspace/members${query}`);
|
|
3610
3739
|
},
|
|
3611
3740
|
setMemberGrants: (memberId, grants) => this.http.patch(
|
|
@@ -3657,7 +3786,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3657
3786
|
check: (definition) => this.checkMonitor(definition),
|
|
3658
3787
|
preview: (definition, options) => this.previewMonitor(definition, options),
|
|
3659
3788
|
deploy: (definition, options) => this.deployMonitor(definition, options),
|
|
3660
|
-
sync: (definition, options) => _optionalChain([options, 'optionalAccess',
|
|
3789
|
+
sync: (definition, options) => _optionalChain([options, 'optionalAccess', _175 => _175.dryRun]) ? this.deployMonitor(definition, { dryRun: true }) : this.syncScalarMonitor(definition, options),
|
|
3661
3790
|
list: (options) => this.listMonitors(options),
|
|
3662
3791
|
ledger: (options) => this.listMonitorLedger(options),
|
|
3663
3792
|
ledgerGet: (key) => this.getMonitorLedgerEntry(key),
|
|
@@ -3669,13 +3798,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3669
3798
|
update: (key, patch) => this.updateMonitor(key, patch),
|
|
3670
3799
|
delete: (key, options) => this.deleteMonitor(key, options),
|
|
3671
3800
|
reactivate: (key, options) => this.reactivateMonitor(key, options),
|
|
3672
|
-
start: (key, options) => _optionalChain([options, 'optionalAccess',
|
|
3801
|
+
start: (key, options) => _optionalChain([options, 'optionalAccess', _176 => _176.dryRun]) ? this.submitMonitorBatch({
|
|
3673
3802
|
kind: "reactivate",
|
|
3674
3803
|
scope: { kind: "keys", monitorKeys: [key] },
|
|
3675
3804
|
dryRun: true,
|
|
3676
3805
|
idempotencyKey: _nullishCoalesce(options.idempotencyKey, () => ( this.monitorJobIdempotencyKey(`start-${key}`)))
|
|
3677
3806
|
}) : this.submitScalarMonitorLifecycle(key, "start", options),
|
|
3678
|
-
stop: (key, options) => _optionalChain([options, 'optionalAccess',
|
|
3807
|
+
stop: (key, options) => _optionalChain([options, 'optionalAccess', _177 => _177.dryRun]) ? this.submitMonitorBatch({
|
|
3679
3808
|
kind: "deactivate",
|
|
3680
3809
|
scope: { kind: "keys", monitorKeys: [key] },
|
|
3681
3810
|
dryRun: true,
|
|
@@ -3729,8 +3858,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3729
3858
|
/** List this workspace's views, most recently changed first. */
|
|
3730
3859
|
async listViews(input) {
|
|
3731
3860
|
const params = new URLSearchParams();
|
|
3732
|
-
if (_optionalChain([input, 'optionalAccess',
|
|
3733
|
-
if (_optionalChain([input, 'optionalAccess',
|
|
3861
|
+
if (_optionalChain([input, 'optionalAccess', _178 => _178.cursor])) params.set("cursor", input.cursor);
|
|
3862
|
+
if (_optionalChain([input, 'optionalAccess', _179 => _179.limit])) params.set("limit", String(input.limit));
|
|
3734
3863
|
const query = params.size > 0 ? `?${params}` : "";
|
|
3735
3864
|
return await this.http.get(`/api/v2/views${query}`);
|
|
3736
3865
|
}
|
|
@@ -3785,8 +3914,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3785
3914
|
/** Every run of the view's Play, newest first. */
|
|
3786
3915
|
async listViewRuns(id, input) {
|
|
3787
3916
|
const params = new URLSearchParams();
|
|
3788
|
-
if (_optionalChain([input, 'optionalAccess',
|
|
3789
|
-
if (_optionalChain([input, 'optionalAccess',
|
|
3917
|
+
if (_optionalChain([input, 'optionalAccess', _180 => _180.limit])) params.set("limit", String(input.limit));
|
|
3918
|
+
if (_optionalChain([input, 'optionalAccess', _181 => _181.offset])) params.set("offset", String(input.offset));
|
|
3790
3919
|
const query = params.size > 0 ? `?${params}` : "";
|
|
3791
3920
|
return await this.http.get(
|
|
3792
3921
|
`/api/v2/views/${encodeURIComponent(id)}/runs${query}`
|
|
@@ -3874,17 +4003,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3874
4003
|
*/
|
|
3875
4004
|
async listTools(options) {
|
|
3876
4005
|
const params = new URLSearchParams();
|
|
3877
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4006
|
+
if (_optionalChain([options, 'optionalAccess', _182 => _182.categories, 'optionalAccess', _183 => _183.trim, 'call', _184 => _184()])) {
|
|
3878
4007
|
params.set("categories", options.categories.trim());
|
|
3879
4008
|
}
|
|
3880
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4009
|
+
if (_optionalChain([options, 'optionalAccess', _185 => _185.tags, 'optionalAccess', _186 => _186.trim, 'call', _187 => _187()])) {
|
|
3881
4010
|
params.set("tags", options.tags.trim());
|
|
3882
4011
|
}
|
|
3883
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4012
|
+
if (_optionalChain([options, 'optionalAccess', _188 => _188.grep, 'optionalAccess', _189 => _189.trim, 'call', _190 => _190()])) {
|
|
3884
4013
|
params.set("grep", options.grep.trim());
|
|
3885
4014
|
params.set("grep_mode", _nullishCoalesce(options.grepMode, () => ( "all")));
|
|
3886
4015
|
}
|
|
3887
|
-
params.set("compact", _optionalChain([options, 'optionalAccess',
|
|
4016
|
+
params.set("compact", _optionalChain([options, 'optionalAccess', _191 => _191.compact]) === true ? "true" : "false");
|
|
3888
4017
|
const suffix = params.toString() ? `?${params.toString()}` : "";
|
|
3889
4018
|
const res = await this.http.get(
|
|
3890
4019
|
`/api/v2/tools${suffix}`
|
|
@@ -3917,7 +4046,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3917
4046
|
const params = new URLSearchParams({
|
|
3918
4047
|
view: "category",
|
|
3919
4048
|
categories: normalizedCategory,
|
|
3920
|
-
compact: _optionalChain([options, 'optionalAccess',
|
|
4049
|
+
compact: _optionalChain([options, 'optionalAccess', _192 => _192.compact]) === true ? "true" : "false"
|
|
3921
4050
|
});
|
|
3922
4051
|
const response = await this.http.get(
|
|
3923
4052
|
`/api/v2/tools?${params}`
|
|
@@ -3932,7 +4061,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3932
4061
|
}
|
|
3933
4062
|
/** List discoverable providers without requiring a local plugin catalog. */
|
|
3934
4063
|
async listProviders(options) {
|
|
3935
|
-
const suffix = _optionalChain([options, 'optionalAccess',
|
|
4064
|
+
const suffix = _optionalChain([options, 'optionalAccess', _193 => _193.changed]) ? "?changed=true" : "";
|
|
3936
4065
|
const res = await this.http.get(
|
|
3937
4066
|
`/api/v2/tools/providers${suffix}`
|
|
3938
4067
|
);
|
|
@@ -3963,8 +4092,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3963
4092
|
*/
|
|
3964
4093
|
async search(options = {}) {
|
|
3965
4094
|
const params = searchParams(options);
|
|
3966
|
-
if (_optionalChain([options, 'access',
|
|
3967
|
-
if (_optionalChain([options, 'access',
|
|
4095
|
+
if (_optionalChain([options, 'access', _194 => _194.types, 'optionalAccess', _195 => _195.length])) params.set("types", options.types.join(","));
|
|
4096
|
+
if (_optionalChain([options, 'access', _196 => _196.exclude, 'optionalAccess', _197 => _197.length])) {
|
|
3968
4097
|
params.set("exclude", options.exclude.join(","));
|
|
3969
4098
|
}
|
|
3970
4099
|
return this.http.get(`/api/v2/search?${params.toString()}`);
|
|
@@ -3986,7 +4115,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3986
4115
|
* ```
|
|
3987
4116
|
*/
|
|
3988
4117
|
async getTool(toolId, options) {
|
|
3989
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4118
|
+
if (_optionalChain([options, 'optionalAccess', _198 => _198.cliInvocationId]) !== void 0) {
|
|
3990
4119
|
validateCliInvocationId(options.cliInvocationId);
|
|
3991
4120
|
}
|
|
3992
4121
|
return this.http.request(
|
|
@@ -3999,7 +4128,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
3999
4128
|
retryApiErrors: true,
|
|
4000
4129
|
headers: {
|
|
4001
4130
|
"x-deepline-tool-meta-only": "1",
|
|
4002
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4131
|
+
..._optionalChain([options, 'optionalAccess', _199 => _199.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
|
|
4003
4132
|
}
|
|
4004
4133
|
}
|
|
4005
4134
|
);
|
|
@@ -4090,7 +4219,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4090
4219
|
return this.http.post(
|
|
4091
4220
|
"/api/v2/ingestion/repair",
|
|
4092
4221
|
{
|
|
4093
|
-
..._optionalChain([input, 'optionalAccess',
|
|
4222
|
+
..._optionalChain([input, 'optionalAccess', _200 => _200.provider]) ? { provider: input.provider } : {}
|
|
4094
4223
|
}
|
|
4095
4224
|
);
|
|
4096
4225
|
}
|
|
@@ -4142,10 +4271,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4142
4271
|
*/
|
|
4143
4272
|
async preparePlayRunAdmission(request, options) {
|
|
4144
4273
|
const resolved = resolveStartPlayRunRequest(request, this.environment);
|
|
4145
|
-
const prepared = await
|
|
4274
|
+
const prepared = await _chunkSL6MYJYMjs.preparePlayRunAdmission.call(void 0,
|
|
4146
4275
|
this.http,
|
|
4147
4276
|
resolved.request,
|
|
4148
|
-
_optionalChain([options, 'optionalAccess',
|
|
4277
|
+
_optionalChain([options, 'optionalAccess', _201 => _201.onSubmission]),
|
|
4149
4278
|
options
|
|
4150
4279
|
);
|
|
4151
4280
|
const bodyJson = JSON.stringify(prepared.body);
|
|
@@ -4153,9 +4282,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4153
4282
|
resolved.runtime,
|
|
4154
4283
|
this.environment
|
|
4155
4284
|
);
|
|
4156
|
-
const headers = _optionalChain([options, 'optionalAccess',
|
|
4285
|
+
const headers = _optionalChain([options, 'optionalAccess', _202 => _202.cliAdmission]) ? {
|
|
4157
4286
|
...runtimeHeaders,
|
|
4158
|
-
"X-Deepline-API-Major": String(
|
|
4287
|
+
"X-Deepline-API-Major": String(_chunkGRCFX2EGjs.SDK_API_MAJOR)
|
|
4159
4288
|
} : runtimeHeaders;
|
|
4160
4289
|
const http = this.http;
|
|
4161
4290
|
let submitted = false;
|
|
@@ -4170,31 +4299,31 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4170
4299
|
);
|
|
4171
4300
|
}
|
|
4172
4301
|
if (submitted) {
|
|
4173
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
4174
|
-
await
|
|
4302
|
+
if (!_optionalChain([options, 'optionalAccess', _203 => _203.callerIntentV2])) {
|
|
4303
|
+
await _chunkSL6MYJYMjs.preparePlayRunAdmission.call(void 0,
|
|
4175
4304
|
http,
|
|
4176
4305
|
JSON.parse(bodyJson),
|
|
4177
4306
|
void 0,
|
|
4178
|
-
{ signal: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess',
|
|
4307
|
+
{ signal: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _204 => _204.signal]), () => ( _optionalChain([options, 'optionalAccess', _205 => _205.signal]))) }
|
|
4179
4308
|
);
|
|
4180
4309
|
}
|
|
4181
4310
|
}
|
|
4182
4311
|
submitted = true;
|
|
4183
4312
|
try {
|
|
4184
|
-
return await
|
|
4313
|
+
return await _chunkSL6MYJYMjs.submitPreparedPlayRunAdmission.call(void 0,
|
|
4185
4314
|
http,
|
|
4186
4315
|
JSON.parse(bodyJson),
|
|
4187
4316
|
prepared.workflowId,
|
|
4188
4317
|
prepared.supportsCallerIntent,
|
|
4189
4318
|
headers,
|
|
4190
4319
|
{
|
|
4191
|
-
cliAdmission: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess',
|
|
4192
|
-
callerIntentV2: _optionalChain([options, 'optionalAccess',
|
|
4193
|
-
signal: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess',
|
|
4320
|
+
cliAdmission: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _206 => _206.cliAdmission]), () => ( _optionalChain([options, 'optionalAccess', _207 => _207.cliAdmission]))),
|
|
4321
|
+
callerIntentV2: _optionalChain([options, 'optionalAccess', _208 => _208.callerIntentV2]),
|
|
4322
|
+
signal: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _209 => _209.signal]), () => ( _optionalChain([options, 'optionalAccess', _210 => _210.signal])))
|
|
4194
4323
|
}
|
|
4195
4324
|
);
|
|
4196
4325
|
} catch (error) {
|
|
4197
|
-
if (error instanceof
|
|
4326
|
+
if (error instanceof _chunkSL6MYJYMjs.CliPlayAdmissionUnsupportedError || error instanceof _chunkSL6MYJYMjs.CliPlayAdmissionCallerIntentV2UnsupportedError) {
|
|
4198
4327
|
submitted = false;
|
|
4199
4328
|
}
|
|
4200
4329
|
throw error;
|
|
@@ -4209,43 +4338,43 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4209
4338
|
);
|
|
4210
4339
|
}
|
|
4211
4340
|
if (submitted) {
|
|
4212
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
4213
|
-
await
|
|
4341
|
+
if (!_optionalChain([options, 'optionalAccess', _211 => _211.callerIntentV2])) {
|
|
4342
|
+
await _chunkSL6MYJYMjs.preparePlayRunAdmission.call(void 0,
|
|
4214
4343
|
http,
|
|
4215
4344
|
JSON.parse(bodyJson),
|
|
4216
4345
|
void 0,
|
|
4217
|
-
{ signal: _optionalChain([streamOptions, 'optionalAccess',
|
|
4346
|
+
{ signal: _optionalChain([streamOptions, 'optionalAccess', _212 => _212.signal]) }
|
|
4218
4347
|
);
|
|
4219
4348
|
}
|
|
4220
4349
|
}
|
|
4221
4350
|
submitted = true;
|
|
4222
|
-
const streamPath = _optionalChain([options, 'optionalAccess',
|
|
4351
|
+
const streamPath = _optionalChain([options, 'optionalAccess', _213 => _213.callerIntentV2]) ? _chunkSL6MYJYMjs.CLI_PLAY_RUN_CALLER_INTENT_V2_START_STREAM_PATH : _optionalChain([options, 'optionalAccess', _214 => _214.cliAdmission]) ? _chunkSL6MYJYMjs.CLI_PLAY_RUN_START_STREAM_PATH : _chunkSL6MYJYMjs.PLAY_RUN_START_STREAM_PATH;
|
|
4223
4352
|
let cliAdmissionSupported = false;
|
|
4224
4353
|
try {
|
|
4225
4354
|
for await (const event of http.streamSse(streamPath, {
|
|
4226
4355
|
method: "POST",
|
|
4227
4356
|
body: JSON.parse(bodyJson),
|
|
4228
4357
|
headers,
|
|
4229
|
-
signal: _optionalChain([streamOptions, 'optionalAccess',
|
|
4358
|
+
signal: _optionalChain([streamOptions, 'optionalAccess', _215 => _215.signal]),
|
|
4230
4359
|
exactUrlOnly: true,
|
|
4231
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4360
|
+
..._optionalChain([options, 'optionalAccess', _216 => _216.cliAdmission]) ? {
|
|
4232
4361
|
onResponse: (response) => {
|
|
4233
|
-
cliAdmissionSupported = response.headers.get(
|
|
4362
|
+
cliAdmissionSupported = response.headers.get(_chunkSL6MYJYMjs.CLI_PLAY_RUN_SUPPORTED_HEADER) === "true";
|
|
4234
4363
|
}
|
|
4235
4364
|
} : {}
|
|
4236
4365
|
})) {
|
|
4237
4366
|
if (event.scope === "play") yield event;
|
|
4238
4367
|
}
|
|
4239
4368
|
} catch (error) {
|
|
4240
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4369
|
+
if (_optionalChain([options, 'optionalAccess', _217 => _217.cliAdmission]) && !cliAdmissionSupported && error instanceof _chunkBBTKAASQjs.DeeplineError && (error.statusCode === 404 || error.statusCode === 405)) {
|
|
4241
4370
|
if (options.callerIntentV2) {
|
|
4242
4371
|
submitted = false;
|
|
4243
|
-
throw new (0,
|
|
4372
|
+
throw new (0, _chunkSL6MYJYMjs.CliPlayAdmissionCallerIntentV2UnsupportedError)(
|
|
4244
4373
|
error.statusCode
|
|
4245
4374
|
);
|
|
4246
4375
|
}
|
|
4247
4376
|
submitted = false;
|
|
4248
|
-
throw new (0,
|
|
4377
|
+
throw new (0, _chunkSL6MYJYMjs.CliPlayAdmissionUnsupportedError)(error.statusCode);
|
|
4249
4378
|
}
|
|
4250
4379
|
throw error;
|
|
4251
4380
|
}
|
|
@@ -4258,7 +4387,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4258
4387
|
* @internal
|
|
4259
4388
|
*/
|
|
4260
4389
|
async prefetchPlayRunAdmissionCapability(options) {
|
|
4261
|
-
return
|
|
4390
|
+
return _chunkSL6MYJYMjs.readPlayRunAdmissionCapability.call(void 0, this.http, options);
|
|
4262
4391
|
}
|
|
4263
4392
|
/**
|
|
4264
4393
|
* Submit a play run through the legacy event response.
|
|
@@ -4275,7 +4404,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4275
4404
|
*/
|
|
4276
4405
|
async *startPlayRunStream(request, options) {
|
|
4277
4406
|
const prepared = await this.preparePlayRunAdmission(request, options);
|
|
4278
|
-
yield* prepared.startStream({ signal: _optionalChain([options, 'optionalAccess',
|
|
4407
|
+
yield* prepared.startStream({ signal: _optionalChain([options, 'optionalAccess', _218 => _218.signal]) });
|
|
4279
4408
|
}
|
|
4280
4409
|
/**
|
|
4281
4410
|
* Register a bundled play artifact.
|
|
@@ -4428,7 +4557,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4428
4557
|
compilerManifest,
|
|
4429
4558
|
...input.input ? { input: input.input } : {},
|
|
4430
4559
|
...input.inputFile ? { inputFile: input.inputFile } : {},
|
|
4431
|
-
..._optionalChain([input, 'access',
|
|
4560
|
+
..._optionalChain([input, 'access', _219 => _219.packagedFiles, 'optionalAccess', _220 => _220.length]) ? { packagedFiles: input.packagedFiles } : {},
|
|
4432
4561
|
...input.force ? { force: true } : {},
|
|
4433
4562
|
...input.forceToolRefresh ? { forceToolRefresh: true } : {}
|
|
4434
4563
|
});
|
|
@@ -4458,29 +4587,29 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4458
4587
|
* ```
|
|
4459
4588
|
*/
|
|
4460
4589
|
async submitPlay(code, csvPath, name, options) {
|
|
4461
|
-
const runtimeInput = _optionalChain([options, 'optionalAccess',
|
|
4590
|
+
const runtimeInput = _optionalChain([options, 'optionalAccess', _221 => _221.input]) ? { ...options.input } : {};
|
|
4462
4591
|
if (csvPath) {
|
|
4463
4592
|
runtimeInput.file = csvPath;
|
|
4464
4593
|
}
|
|
4465
|
-
const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4466
|
-
const artifact = _optionalChain([options, 'optionalAccess',
|
|
4467
|
-
if (!_optionalChain([name, 'optionalAccess',
|
|
4594
|
+
const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _222 => _222.sourceCode]), () => ( code));
|
|
4595
|
+
const artifact = _optionalChain([options, 'optionalAccess', _223 => _223.artifact]);
|
|
4596
|
+
if (!_optionalChain([name, 'optionalAccess', _224 => _224.trim, 'call', _225 => _225()])) {
|
|
4468
4597
|
throw new Error("submitPlay requires a play name.");
|
|
4469
4598
|
}
|
|
4470
4599
|
if (!artifact) {
|
|
4471
4600
|
throw new Error("submitPlay requires a bundled play artifact.");
|
|
4472
4601
|
}
|
|
4473
|
-
const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async
|
|
4602
|
+
const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _226 => _226.compilerManifest]), async () => ( await this.compilePlayManifest({
|
|
4474
4603
|
name,
|
|
4475
4604
|
sourceCode,
|
|
4476
|
-
sourceFiles: _optionalChain([options, 'optionalAccess',
|
|
4605
|
+
sourceFiles: _optionalChain([options, 'optionalAccess', _227 => _227.sourceFiles]),
|
|
4477
4606
|
artifact
|
|
4478
4607
|
})));
|
|
4479
4608
|
const registeredArtifact = await this.registerPlayArtifact({
|
|
4480
4609
|
name,
|
|
4481
4610
|
sourceCode,
|
|
4482
|
-
sourceFiles: _optionalChain([options, 'optionalAccess',
|
|
4483
|
-
description: _optionalChain([options, 'optionalAccess',
|
|
4611
|
+
sourceFiles: _optionalChain([options, 'optionalAccess', _228 => _228.sourceFiles]),
|
|
4612
|
+
description: _optionalChain([options, 'optionalAccess', _229 => _229.description]),
|
|
4484
4613
|
artifact,
|
|
4485
4614
|
compilerManifest,
|
|
4486
4615
|
publish: false
|
|
@@ -4494,17 +4623,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4494
4623
|
name,
|
|
4495
4624
|
artifactStorageKey: registeredArtifact.artifactStorageKey,
|
|
4496
4625
|
sourceCode,
|
|
4497
|
-
description: _optionalChain([options, 'optionalAccess',
|
|
4626
|
+
description: _optionalChain([options, 'optionalAccess', _230 => _230.description]),
|
|
4498
4627
|
staticPipeline: _nullishCoalesce(registeredArtifact.staticPipeline, () => ( null)),
|
|
4499
4628
|
artifactHash: typeof artifact.artifactHash === "string" ? artifact.artifactHash : void 0,
|
|
4500
4629
|
graphHash: typeof artifact.graphHash === "string" ? artifact.graphHash : void 0,
|
|
4501
4630
|
runtimeArtifact: artifact,
|
|
4502
4631
|
compilerManifest,
|
|
4503
4632
|
...Object.keys(runtimeInput).length > 0 ? { input: runtimeInput } : {},
|
|
4504
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4505
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4506
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4507
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4633
|
+
..._optionalChain([options, 'optionalAccess', _231 => _231.inputFile]) ? { inputFile: options.inputFile } : {},
|
|
4634
|
+
..._optionalChain([options, 'optionalAccess', _232 => _232.packagedFiles, 'optionalAccess', _233 => _233.length]) ? { packagedFiles: options.packagedFiles } : {},
|
|
4635
|
+
..._optionalChain([options, 'optionalAccess', _234 => _234.force]) ? { force: true } : {},
|
|
4636
|
+
..._optionalChain([options, 'optionalAccess', _235 => _235.forceToolRefresh]) ? { forceToolRefresh: true } : {}
|
|
4508
4637
|
});
|
|
4509
4638
|
}
|
|
4510
4639
|
/**
|
|
@@ -4532,7 +4661,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4532
4661
|
* ```
|
|
4533
4662
|
*/
|
|
4534
4663
|
async stagePlayFiles(files) {
|
|
4535
|
-
return
|
|
4664
|
+
return _chunkSL6MYJYMjs.stagePlayFiles.call(void 0, this.http, files);
|
|
4536
4665
|
}
|
|
4537
4666
|
/**
|
|
4538
4667
|
* Mint short-lived presigned upload targets for staged play files.
|
|
@@ -4541,7 +4670,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4541
4670
|
* For other files, the server returns a presigned PUT URL. Upload the file body to that URL.
|
|
4542
4671
|
*/
|
|
4543
4672
|
async mintStagedPlayFileUploads(files) {
|
|
4544
|
-
return
|
|
4673
|
+
return _chunkSL6MYJYMjs.mintStagedPlayFileUploads.call(void 0, this.http, files);
|
|
4545
4674
|
}
|
|
4546
4675
|
/**
|
|
4547
4676
|
* Resolve staged play files by content hash without uploading bytes.
|
|
@@ -4580,13 +4709,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4580
4709
|
for await (const event of watchRunEvents({
|
|
4581
4710
|
http: this.http,
|
|
4582
4711
|
runId: workflowId,
|
|
4583
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
4584
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
4585
|
-
onRetry: _optionalChain([options, 'optionalAccess',
|
|
4586
|
-
deferLogs: _optionalChain([options, 'optionalAccess',
|
|
4587
|
-
omitTerminalLogs: _optionalChain([options, 'optionalAccess',
|
|
4588
|
-
onPoll: _optionalChain([options, 'optionalAccess',
|
|
4589
|
-
..._optionalChain([options, 'optionalAccess',
|
|
4712
|
+
signal: _optionalChain([options, 'optionalAccess', _236 => _236.signal]),
|
|
4713
|
+
onNotice: _optionalChain([options, 'optionalAccess', _237 => _237.onNotice]),
|
|
4714
|
+
onRetry: _optionalChain([options, 'optionalAccess', _238 => _238.onRetry]),
|
|
4715
|
+
deferLogs: _optionalChain([options, 'optionalAccess', _239 => _239.deferLogs]),
|
|
4716
|
+
omitTerminalLogs: _optionalChain([options, 'optionalAccess', _240 => _240.omitTerminalLogs]),
|
|
4717
|
+
onPoll: _optionalChain([options, 'optionalAccess', _241 => _241.onPoll]),
|
|
4718
|
+
..._optionalChain([options, 'optionalAccess', _242 => _242.terminalStatus]) ? {
|
|
4590
4719
|
terminalStatus: {
|
|
4591
4720
|
...options.terminalStatus,
|
|
4592
4721
|
onStatus: async (raw, expectedStatus) => {
|
|
@@ -4596,7 +4725,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4596
4725
|
`Run watch returned a mismatched terminal status for ${workflowId}.`
|
|
4597
4726
|
);
|
|
4598
4727
|
}
|
|
4599
|
-
await _optionalChain([options, 'access',
|
|
4728
|
+
await _optionalChain([options, 'access', _243 => _243.terminalStatus, 'optionalAccess', _244 => _244.onStatus, 'call', _245 => _245(status)]);
|
|
4600
4729
|
}
|
|
4601
4730
|
}
|
|
4602
4731
|
} : {}
|
|
@@ -4611,12 +4740,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4611
4740
|
* @deprecated Use `watchRunEvents` for ordinary run watching.
|
|
4612
4741
|
*/
|
|
4613
4742
|
async *streamPlayRunEvents(workflowId, options) {
|
|
4614
|
-
const headers = _optionalChain([options, 'optionalAccess',
|
|
4743
|
+
const headers = _optionalChain([options, 'optionalAccess', _246 => _246.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
|
|
4615
4744
|
const params = new URLSearchParams();
|
|
4616
|
-
params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4745
|
+
params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _247 => _247.mode]), () => ( "cli")));
|
|
4617
4746
|
for await (const event of this.http.streamSse(
|
|
4618
4747
|
`/api/v2/runs/${encodeURIComponent(workflowId)}/tail?${params.toString()}`,
|
|
4619
|
-
{ signal: _optionalChain([options, 'optionalAccess',
|
|
4748
|
+
{ signal: _optionalChain([options, 'optionalAccess', _248 => _248.signal]), headers }
|
|
4620
4749
|
)) {
|
|
4621
4750
|
if (event.scope === "play") {
|
|
4622
4751
|
yield event;
|
|
@@ -4632,8 +4761,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4632
4761
|
*/
|
|
4633
4762
|
async *observeRunEvents(runId, options) {
|
|
4634
4763
|
yield* this.watchRunEvents(runId, {
|
|
4635
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
4636
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
4764
|
+
signal: _optionalChain([options, 'optionalAccess', _249 => _249.signal]),
|
|
4765
|
+
onNotice: _optionalChain([options, 'optionalAccess', _250 => _250.onNotice])
|
|
4637
4766
|
});
|
|
4638
4767
|
}
|
|
4639
4768
|
/** Poll snapshots to terminal status and return the durable package. */
|
|
@@ -4641,9 +4770,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4641
4770
|
let terminalObserved = false;
|
|
4642
4771
|
let terminalStatus = null;
|
|
4643
4772
|
for await (const event of this.watchRunEvents(runId, {
|
|
4644
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
4645
|
-
onNotice: _optionalChain([options, 'optionalAccess',
|
|
4646
|
-
onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4773
|
+
signal: _optionalChain([options, 'optionalAccess', _251 => _251.signal]),
|
|
4774
|
+
onNotice: _optionalChain([options, 'optionalAccess', _252 => _252.onNotice]),
|
|
4775
|
+
onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _253 => _253.onRetry]), () => ( _optionalChain([options, 'optionalAccess', _254 => _254.onReconnect]))),
|
|
4647
4776
|
terminalStatus: {
|
|
4648
4777
|
runStatus: true,
|
|
4649
4778
|
onStatus: (status) => {
|
|
@@ -4651,16 +4780,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4651
4780
|
}
|
|
4652
4781
|
}
|
|
4653
4782
|
})) {
|
|
4654
|
-
_optionalChain([options, 'optionalAccess',
|
|
4655
|
-
if (
|
|
4783
|
+
_optionalChain([options, 'optionalAccess', _255 => _255.onEvent, 'optionalCall', _256 => _256(event)]);
|
|
4784
|
+
if (_chunkSL6MYJYMjs.isTerminalPlayRunLifecycleStatus.call(void 0, playLiveRunStatus(event))) {
|
|
4656
4785
|
terminalObserved = true;
|
|
4657
4786
|
}
|
|
4658
4787
|
}
|
|
4659
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4788
|
+
if (_optionalChain([options, 'optionalAccess', _257 => _257.signal, 'optionalAccess', _258 => _258.aborted])) {
|
|
4660
4789
|
throw new (0, _chunkBBTKAASQjs.DeeplineError)("Run watch aborted.", void 0, "ABORTED");
|
|
4661
4790
|
}
|
|
4662
4791
|
const refreshed = await _asyncNullishCoalesce(terminalStatus, async () => ( await this.getRunStatus(runId)));
|
|
4663
|
-
if (terminalObserved ||
|
|
4792
|
+
if (terminalObserved || _chunkSL6MYJYMjs.isTerminalPlayRunLifecycleStatus.call(void 0, refreshed.status)) {
|
|
4664
4793
|
return refreshed;
|
|
4665
4794
|
}
|
|
4666
4795
|
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
@@ -4736,7 +4865,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4736
4865
|
/** List the org's workflows. `GET /api/v2/workflows`. */
|
|
4737
4866
|
async listWorkflows(options) {
|
|
4738
4867
|
const params = new URLSearchParams();
|
|
4739
|
-
if (typeof _optionalChain([options, 'optionalAccess',
|
|
4868
|
+
if (typeof _optionalChain([options, 'optionalAccess', _259 => _259.limit]) === "number") {
|
|
4740
4869
|
params.set("limit", String(options.limit));
|
|
4741
4870
|
}
|
|
4742
4871
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4789,7 +4918,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4789
4918
|
/** List a workflow's runs. `GET /api/v2/workflows/:id/runs`. */
|
|
4790
4919
|
async listWorkflowRuns(id, options) {
|
|
4791
4920
|
const params = new URLSearchParams();
|
|
4792
|
-
if (typeof _optionalChain([options, 'optionalAccess',
|
|
4921
|
+
if (typeof _optionalChain([options, 'optionalAccess', _260 => _260.limit]) === "number") {
|
|
4793
4922
|
params.set("limit", String(options.limit));
|
|
4794
4923
|
}
|
|
4795
4924
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4825,16 +4954,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4825
4954
|
*/
|
|
4826
4955
|
async getRunStatus(runId, options) {
|
|
4827
4956
|
const params = new URLSearchParams();
|
|
4828
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4957
|
+
if (_optionalChain([options, 'optionalAccess', _261 => _261.full]) === true) {
|
|
4829
4958
|
params.set("full", "true");
|
|
4830
4959
|
}
|
|
4831
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4960
|
+
if (_optionalChain([options, 'optionalAccess', _262 => _262.configuration]) === true) {
|
|
4832
4961
|
params.append("include", "configuration");
|
|
4833
4962
|
}
|
|
4834
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4963
|
+
if (_optionalChain([options, 'optionalAccess', _263 => _263.performance]) === true) {
|
|
4835
4964
|
params.append("include", "performance");
|
|
4836
4965
|
}
|
|
4837
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4966
|
+
if (_optionalChain([options, 'optionalAccess', _264 => _264.retries]) === true) {
|
|
4838
4967
|
params.append("include", "retries");
|
|
4839
4968
|
}
|
|
4840
4969
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
@@ -4842,7 +4971,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4842
4971
|
`/api/v2/runs/${encodeURIComponent(runId)}${query}`,
|
|
4843
4972
|
{ headers: { "x-deepline-run-status": "1" } }
|
|
4844
4973
|
);
|
|
4845
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4974
|
+
if (_optionalChain([options, 'optionalAccess', _265 => _265.configuration]) === true && !Object.hasOwn(response, "contract")) {
|
|
4846
4975
|
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
4847
4976
|
"This server does not support recorded configuration reads.",
|
|
4848
4977
|
void 0,
|
|
@@ -4850,7 +4979,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4850
4979
|
);
|
|
4851
4980
|
}
|
|
4852
4981
|
const status = normalizePlayStatus(response);
|
|
4853
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4982
|
+
if (_optionalChain([options, 'optionalAccess', _266 => _266.failedLogs]) !== true || status.status !== "failed") {
|
|
4854
4983
|
return status;
|
|
4855
4984
|
}
|
|
4856
4985
|
const requestedFailedLogLimit = typeof options.failedLogLimit === "number" && Number.isFinite(options.failedLogLimit) ? Math.max(1, Math.floor(options.failedLogLimit)) : RUNS_FAILED_LOG_LIMIT;
|
|
@@ -4939,7 +5068,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4939
5068
|
/** The same tenant-scoped run history searched by the dashboard and CLI. */
|
|
4940
5069
|
async getRunsHistory(options = {}) {
|
|
4941
5070
|
const params = new URLSearchParams();
|
|
4942
|
-
const search = _optionalChain([options, 'access',
|
|
5071
|
+
const search = _optionalChain([options, 'access', _267 => _267.search, 'optionalAccess', _268 => _268.trim, 'call', _269 => _269()]);
|
|
4943
5072
|
if (search && search.length > 200) {
|
|
4944
5073
|
throw new Error("Run search must be at most 200 characters.");
|
|
4945
5074
|
}
|
|
@@ -4965,16 +5094,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4965
5094
|
}
|
|
4966
5095
|
/** Read one run page without discarding server pagination metadata. */
|
|
4967
5096
|
async listRunsPage(options) {
|
|
4968
|
-
const playName = _optionalChain([options, 'access',
|
|
5097
|
+
const playName = _optionalChain([options, 'access', _270 => _270.play, 'optionalAccess', _271 => _271.trim, 'call', _272 => _272()]);
|
|
4969
5098
|
const params = new URLSearchParams();
|
|
4970
5099
|
if (playName) {
|
|
4971
5100
|
params.set("play", playName);
|
|
4972
5101
|
}
|
|
4973
|
-
const status = _optionalChain([options, 'access',
|
|
5102
|
+
const status = _optionalChain([options, 'access', _273 => _273.status, 'optionalAccess', _274 => _274.trim, 'call', _275 => _275()]);
|
|
4974
5103
|
if (status) {
|
|
4975
5104
|
params.set("status", status);
|
|
4976
5105
|
}
|
|
4977
|
-
const node = _optionalChain([options, 'access',
|
|
5106
|
+
const node = _optionalChain([options, 'access', _276 => _276.node, 'optionalAccess', _277 => _277.trim, 'call', _278 => _278()]);
|
|
4978
5107
|
if (node) {
|
|
4979
5108
|
if (!playName)
|
|
4980
5109
|
throw new Error("runs.list options.node requires options.play.");
|
|
@@ -5048,8 +5177,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5048
5177
|
* A different key starts another rerun.
|
|
5049
5178
|
*/
|
|
5050
5179
|
async rerun(runId, options) {
|
|
5051
|
-
const idempotencyKey = _optionalChain([options, 'optionalAccess',
|
|
5052
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5180
|
+
const idempotencyKey = _optionalChain([options, 'optionalAccess', _279 => _279.idempotencyKey, 'optionalAccess', _280 => _280.trim, 'call', _281 => _281()]);
|
|
5181
|
+
if (_optionalChain([options, 'optionalAccess', _282 => _282.idempotencyKey]) !== void 0 && !idempotencyKey) {
|
|
5053
5182
|
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
5054
5183
|
"runs.rerun idempotencyKey must not be empty.",
|
|
5055
5184
|
void 0,
|
|
@@ -5058,7 +5187,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5058
5187
|
}
|
|
5059
5188
|
return this.http.post(
|
|
5060
5189
|
`/api/v2/runs/${encodeURIComponent(runId)}/rerun`,
|
|
5061
|
-
_optionalChain([options, 'optionalAccess',
|
|
5190
|
+
_optionalChain([options, 'optionalAccess', _283 => _283.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
|
|
5062
5191
|
{ "Idempotency-Key": idempotencyKey || globalThis.crypto.randomUUID() }
|
|
5063
5192
|
);
|
|
5064
5193
|
}
|
|
@@ -5085,21 +5214,21 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5085
5214
|
* ```
|
|
5086
5215
|
*/
|
|
5087
5216
|
async getRunLogs(runId, options) {
|
|
5088
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5217
|
+
if (_optionalChain([options, 'optionalAccess', _284 => _284.all]) === true && options.failed === true) {
|
|
5089
5218
|
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
5090
5219
|
"runs.logs cannot combine all and failed views.",
|
|
5091
5220
|
void 0,
|
|
5092
5221
|
"INVALID_RUN_LOG_VIEW"
|
|
5093
5222
|
);
|
|
5094
5223
|
}
|
|
5095
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5224
|
+
if (_optionalChain([options, 'optionalAccess', _285 => _285.cursor]) !== void 0 && options.failed === true) {
|
|
5096
5225
|
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
5097
5226
|
"runs.logs cannot combine failed with cursor.",
|
|
5098
5227
|
void 0,
|
|
5099
5228
|
"INVALID_RUN_LOG_VIEW"
|
|
5100
5229
|
);
|
|
5101
5230
|
}
|
|
5102
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5231
|
+
if (_optionalChain([options, 'optionalAccess', _286 => _286.failed]) === true) {
|
|
5103
5232
|
const requestedLimit = typeof options.limit === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : RUNS_FAILED_LOG_LIMIT;
|
|
5104
5233
|
const failedLimit = Math.min(RUNS_FAILED_LOG_LIMIT, requestedLimit);
|
|
5105
5234
|
const page = await this.http.get(
|
|
@@ -5124,18 +5253,18 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5124
5253
|
...page.logsTruncated ? { logsTruncated: true } : {}
|
|
5125
5254
|
};
|
|
5126
5255
|
}
|
|
5127
|
-
const beforeSequence = _optionalChain([options, 'optionalAccess',
|
|
5128
|
-
const limit = _optionalChain([options, 'optionalAccess',
|
|
5256
|
+
const beforeSequence = _optionalChain([options, 'optionalAccess', _287 => _287.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
|
|
5257
|
+
const limit = _optionalChain([options, 'optionalAccess', _288 => _288.all]) ? Number.MAX_SAFE_INTEGER : typeof _optionalChain([options, 'optionalAccess', _289 => _289.limit]) === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
|
|
5129
5258
|
const fetchPage = (afterSeq2, pageLimit) => this.http.get(
|
|
5130
5259
|
`/api/v2/runs/${encodeURIComponent(runId)}/logs?afterSeq=${afterSeq2}&limit=${pageLimit}`,
|
|
5131
5260
|
{ retryApiErrors: true }
|
|
5132
5261
|
);
|
|
5133
5262
|
const probe = await fetchPage(0, 1);
|
|
5134
5263
|
const lastStoredSeq = probe.lastStoredSeq;
|
|
5135
|
-
const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access',
|
|
5264
|
+
const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _290 => _290.entries, 'access', _291 => _291[0], 'optionalAccess', _292 => _292.seq]), () => ( null));
|
|
5136
5265
|
const upperSeq = beforeSequence === null ? lastStoredSeq : Math.min(beforeSequence - 1, lastStoredSeq);
|
|
5137
5266
|
const windowEndSeq = Math.min(upperSeq, lastStoredSeq);
|
|
5138
|
-
let afterSeq = _optionalChain([options, 'optionalAccess',
|
|
5267
|
+
let afterSeq = _optionalChain([options, 'optionalAccess', _293 => _293.all]) ? 0 : Math.max(0, windowEndSeq - limit);
|
|
5139
5268
|
const entries = [];
|
|
5140
5269
|
while (entries.length < limit && afterSeq < upperSeq) {
|
|
5141
5270
|
const page = await fetchPage(
|
|
@@ -5169,7 +5298,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5169
5298
|
hasMore: olderLinesExist,
|
|
5170
5299
|
nextCursor: olderLinesExist ? encodeRunLogsCursor(firstSequence) : null,
|
|
5171
5300
|
entries: entries.map((entry) => entry.line),
|
|
5172
|
-
view: _optionalChain([options, 'optionalAccess',
|
|
5301
|
+
view: _optionalChain([options, 'optionalAccess', _294 => _294.all]) ? "all" : "tail",
|
|
5173
5302
|
...probe.logsTruncated ? { logsTruncated: true } : {}
|
|
5174
5303
|
};
|
|
5175
5304
|
}
|
|
@@ -5345,7 +5474,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5345
5474
|
limit: String(_nullishCoalesce(input.limit, () => ( 5e3))),
|
|
5346
5475
|
offset: String(_nullishCoalesce(input.offset, () => ( 0)))
|
|
5347
5476
|
});
|
|
5348
|
-
if (_optionalChain([input, 'access',
|
|
5477
|
+
if (_optionalChain([input, 'access', _295 => _295.runId, 'optionalAccess', _296 => _296.trim, 'call', _297 => _297()])) {
|
|
5349
5478
|
params.set("runId", input.runId.trim());
|
|
5350
5479
|
}
|
|
5351
5480
|
if (input.rowMode === "all" || input.rowMode === "live") {
|
|
@@ -5358,9 +5487,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5358
5487
|
`/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`,
|
|
5359
5488
|
{ signal: input.signal }
|
|
5360
5489
|
);
|
|
5361
|
-
const requestedRunId = _optionalChain([input, 'access',
|
|
5490
|
+
const requestedRunId = _optionalChain([input, 'access', _298 => _298.runId, 'optionalAccess', _299 => _299.trim, 'call', _300 => _300()]) || "";
|
|
5362
5491
|
if (requestedRunId) {
|
|
5363
|
-
const confirmedRunId = _optionalChain([result, 'access',
|
|
5492
|
+
const confirmedRunId = _optionalChain([result, 'access', _301 => _301.scope, 'optionalAccess', _302 => _302.kind]) === "run" ? result.scope.runId.trim() : "";
|
|
5364
5493
|
const foreignRowRunIds = [
|
|
5365
5494
|
...new Set(
|
|
5366
5495
|
result.rows.map(
|
|
@@ -5368,7 +5497,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5368
5497
|
).filter((runId) => runId && runId !== requestedRunId)
|
|
5369
5498
|
)
|
|
5370
5499
|
];
|
|
5371
|
-
if (_optionalChain([result, 'access',
|
|
5500
|
+
if (_optionalChain([result, 'access', _303 => _303.scope, 'optionalAccess', _304 => _304.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
|
|
5372
5501
|
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
5373
5502
|
`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.`,
|
|
5374
5503
|
void 0,
|
|
@@ -5397,7 +5526,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5397
5526
|
async stopRun(runId, options) {
|
|
5398
5527
|
return this.http.post(
|
|
5399
5528
|
`/api/v2/runs/${encodeURIComponent(runId)}/stop`,
|
|
5400
|
-
_optionalChain([options, 'optionalAccess',
|
|
5529
|
+
_optionalChain([options, 'optionalAccess', _305 => _305.reason]) ? { reason: options.reason } : {}
|
|
5401
5530
|
);
|
|
5402
5531
|
}
|
|
5403
5532
|
/**
|
|
@@ -5415,11 +5544,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5415
5544
|
* The method clears workspace run-slot state without requiring each run ID.
|
|
5416
5545
|
*/
|
|
5417
5546
|
async stopAllRuns(options) {
|
|
5418
|
-
const dryRun = _optionalChain([options, 'optionalAccess',
|
|
5547
|
+
const dryRun = _optionalChain([options, 'optionalAccess', _306 => _306.dryRun]) === true;
|
|
5419
5548
|
const result = await this.http.post(
|
|
5420
5549
|
"/api/v2/runs/stop-all",
|
|
5421
5550
|
{
|
|
5422
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5551
|
+
..._optionalChain([options, 'optionalAccess', _307 => _307.reason]) ? { reason: options.reason } : {},
|
|
5423
5552
|
...dryRun ? { dryRun: true } : {}
|
|
5424
5553
|
}
|
|
5425
5554
|
);
|
|
@@ -5440,7 +5569,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5440
5569
|
* `origin: "owned"` for org-owned plays.
|
|
5441
5570
|
*/
|
|
5442
5571
|
async listPlays(options) {
|
|
5443
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
5572
|
+
if (!_optionalChain([options, 'optionalAccess', _308 => _308.grep, 'optionalAccess', _309 => _309.trim, 'call', _310 => _310()])) {
|
|
5444
5573
|
return (await this.requestPlaysPage(options, false)).plays;
|
|
5445
5574
|
}
|
|
5446
5575
|
const plays = [];
|
|
@@ -5462,46 +5591,46 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5462
5591
|
}
|
|
5463
5592
|
async requestPlaysPage(options, paginateInventory = true) {
|
|
5464
5593
|
const params = new URLSearchParams();
|
|
5465
|
-
if (paginateInventory && !_optionalChain([options, 'optionalAccess',
|
|
5594
|
+
if (paginateInventory && !_optionalChain([options, 'optionalAccess', _311 => _311.grep, 'optionalAccess', _312 => _312.trim, 'call', _313 => _313()]))
|
|
5466
5595
|
params.set("inventory_paginated", "1");
|
|
5467
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5468
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5469
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5596
|
+
if (_optionalChain([options, 'optionalAccess', _314 => _314.origin])) params.set("origin", options.origin);
|
|
5597
|
+
if (_optionalChain([options, 'optionalAccess', _315 => _315.summaryOnly])) params.set("summary_only", "1");
|
|
5598
|
+
if (_optionalChain([options, 'optionalAccess', _316 => _316.categories])) {
|
|
5470
5599
|
params.set(
|
|
5471
5600
|
"categories",
|
|
5472
5601
|
Array.isArray(options.categories) ? options.categories.join(",") : options.categories
|
|
5473
5602
|
);
|
|
5474
5603
|
}
|
|
5475
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5604
|
+
if (_optionalChain([options, 'optionalAccess', _317 => _317.categories]) || _optionalChain([options, 'optionalAccess', _318 => _318.includeToolCategories])) {
|
|
5476
5605
|
params.set("include_tool_categories", "1");
|
|
5477
5606
|
}
|
|
5478
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5607
|
+
if (_optionalChain([options, 'optionalAccess', _319 => _319.tags])) {
|
|
5479
5608
|
params.set(
|
|
5480
5609
|
"tags",
|
|
5481
5610
|
Array.isArray(options.tags) ? options.tags.join(",") : options.tags
|
|
5482
5611
|
);
|
|
5483
5612
|
}
|
|
5484
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5485
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5613
|
+
if (_optionalChain([options, 'optionalAccess', _320 => _320.includeArchived])) params.set("include_archived", "1");
|
|
5614
|
+
if (_optionalChain([options, 'optionalAccess', _321 => _321.includeCostEstimates])) {
|
|
5486
5615
|
params.set("include_cost_estimates", "1");
|
|
5487
5616
|
}
|
|
5488
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5617
|
+
if (_optionalChain([options, 'optionalAccess', _322 => _322.grep, 'optionalAccess', _323 => _323.trim, 'call', _324 => _324()])) {
|
|
5489
5618
|
params.set("grep", options.grep.trim());
|
|
5490
5619
|
params.set("limit", "60");
|
|
5491
5620
|
}
|
|
5492
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5621
|
+
if (_optionalChain([options, 'optionalAccess', _325 => _325.limit]) !== void 0) {
|
|
5493
5622
|
if (!Number.isSafeInteger(options.limit) || options.limit < 1) {
|
|
5494
5623
|
throw new Error("Play page limit must be a positive integer");
|
|
5495
5624
|
}
|
|
5496
5625
|
params.set("limit", String(options.limit));
|
|
5497
5626
|
}
|
|
5498
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5627
|
+
if (_optionalChain([options, 'optionalAccess', _326 => _326.cursor])) params.set("cursor", options.cursor);
|
|
5499
5628
|
const suffix = params.size ? `?${params.toString()}` : "";
|
|
5500
5629
|
const response = await this.http.get(`/api/v2/plays${suffix}`);
|
|
5501
5630
|
return {
|
|
5502
5631
|
plays: _nullishCoalesce(response.plays, () => ( [])),
|
|
5503
|
-
cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access',
|
|
5504
|
-
hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access',
|
|
5632
|
+
cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _327 => _327.pagination, 'optionalAccess', _328 => _328.cursor]), () => ( response.cursor)), () => ( null)),
|
|
5633
|
+
hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _329 => _329.pagination, 'optionalAccess', _330 => _330.hasMore]), () => ( response.hasMore)))
|
|
5505
5634
|
};
|
|
5506
5635
|
}
|
|
5507
5636
|
/** Read definition-level settings, independently of code revisions. */
|
|
@@ -5571,6 +5700,25 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5571
5700
|
async listWorkspaceIntegrationConnections() {
|
|
5572
5701
|
return this.http.get("/api/v2/integrations/connections");
|
|
5573
5702
|
}
|
|
5703
|
+
async listWorkspaceConnectionInventory(provider, options) {
|
|
5704
|
+
const params = new URLSearchParams({
|
|
5705
|
+
view: _optionalChain([options, 'optionalAccess', _331 => _331.authorizationsOnly]) ? "authorizations" : "inventory"
|
|
5706
|
+
});
|
|
5707
|
+
if (provider) params.set("provider", provider);
|
|
5708
|
+
return this.http.get(`/api/v2/integrations/connections?${params}`);
|
|
5709
|
+
}
|
|
5710
|
+
async saveWorkspaceApiKeyConnection(input) {
|
|
5711
|
+
return this.http.post("/api/v2/integrations/connections", {
|
|
5712
|
+
...input,
|
|
5713
|
+
owner: "workspace",
|
|
5714
|
+
type: "api_key"
|
|
5715
|
+
});
|
|
5716
|
+
}
|
|
5717
|
+
async listManagedConnectionMembers(provider, cursor) {
|
|
5718
|
+
const params = new URLSearchParams({ view: "members", provider });
|
|
5719
|
+
if (cursor) params.set("cursor", cursor);
|
|
5720
|
+
return this.http.get(`/api/v2/integrations/connections?${params}`);
|
|
5721
|
+
}
|
|
5574
5722
|
/** List workspace members' personal HubSpot connection status as an admin. */
|
|
5575
5723
|
async listPersonalHubSpotMembers(cursor) {
|
|
5576
5724
|
const path = "/api/v2/integrations/connections/hubspot-members";
|
|
@@ -5578,6 +5726,27 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5578
5726
|
cursor ? `${path}?${new URLSearchParams({ cursor })}` : path
|
|
5579
5727
|
);
|
|
5580
5728
|
}
|
|
5729
|
+
/** Read the Google Workspace delegate grant and a page of selectable members. */
|
|
5730
|
+
async getCalendarDelegation(cursor, name, domain) {
|
|
5731
|
+
const path = "/api/v2/integrations/calendar-availability/delegation";
|
|
5732
|
+
const params = new URLSearchParams();
|
|
5733
|
+
if (cursor) params.set("cursor", cursor);
|
|
5734
|
+
if (name) params.set("name", name);
|
|
5735
|
+
if (domain) params.set("domain", domain);
|
|
5736
|
+
return this.http.get(params.size ? `${path}?${params}` : path);
|
|
5737
|
+
}
|
|
5738
|
+
async listCalendarAvailabilityConnections() {
|
|
5739
|
+
return this.http.get(
|
|
5740
|
+
"/api/v2/integrations/calendar-availability/delegation?view=inventory"
|
|
5741
|
+
);
|
|
5742
|
+
}
|
|
5743
|
+
/** Verify, disconnect, or remove a Workspace approval. Legacy roster inputs remain supported. */
|
|
5744
|
+
async changeCalendarDelegation(change) {
|
|
5745
|
+
return this.http.post(
|
|
5746
|
+
"/api/v2/integrations/calendar-availability/delegation",
|
|
5747
|
+
change
|
|
5748
|
+
);
|
|
5749
|
+
}
|
|
5581
5750
|
/** Manage a workspace-owned OAuth connection. Consent completes in the browser. */
|
|
5582
5751
|
async manageWorkspaceIntegrationConnection(input) {
|
|
5583
5752
|
return this.http.post("/api/v2/integrations/connections", {
|
|
@@ -5595,7 +5764,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5595
5764
|
return this.http.post("/api/v2/integrations/connect", {
|
|
5596
5765
|
provider,
|
|
5597
5766
|
credentials,
|
|
5598
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5767
|
+
..._optionalChain([options, 'optionalAccess', _332 => _332.expectedConnectionId]) ? { expected_connection_id: options.expectedConnectionId } : {}
|
|
5599
5768
|
});
|
|
5600
5769
|
}
|
|
5601
5770
|
/** Calendar discovery compatibility method. The managed pilot requires calendar IDs in tool and Play inputs. */
|
|
@@ -5608,7 +5777,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5608
5777
|
}
|
|
5609
5778
|
/** Start provider OAuth and return the URL to open in a browser. */
|
|
5610
5779
|
async startIntegrationOAuth(provider, options = {}) {
|
|
5611
|
-
const scopes = _optionalChain([options, 'access',
|
|
5780
|
+
const scopes = _optionalChain([options, 'access', _333 => _333.scopes, 'optionalAccess', _334 => _334.map, 'call', _335 => _335((scope) => scope.trim()), 'access', _336 => _336.filter, 'call', _337 => _337(Boolean)]);
|
|
5612
5781
|
if (scopes !== void 0 && scopes.length === 0) {
|
|
5613
5782
|
throw new Error("scopes must contain at least one OAuth scope.");
|
|
5614
5783
|
}
|
|
@@ -5624,8 +5793,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5624
5793
|
return this.http.post("/api/v2/integrations/connect", {
|
|
5625
5794
|
provider: "slack",
|
|
5626
5795
|
scopes: [...PRODUCT_NOTIFICATION_SLACK_OAUTH_SCOPES],
|
|
5627
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5628
|
-
..._optionalChain([options, 'optionalAccess',
|
|
5796
|
+
..._optionalChain([options, 'optionalAccess', _338 => _338.successUrl]) ? { success_url: options.successUrl } : {},
|
|
5797
|
+
..._optionalChain([options, 'optionalAccess', _339 => _339.failureUrl]) ? { failure_url: options.failureUrl } : {}
|
|
5629
5798
|
});
|
|
5630
5799
|
}
|
|
5631
5800
|
/** List Slack channels visible to the connected Deepline Slack app. */
|
|
@@ -5700,7 +5869,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5700
5869
|
}
|
|
5701
5870
|
const targets = input.targets.map(parseNotificationGroupTarget);
|
|
5702
5871
|
const legacyEvents = _nullishCoalesce(input.legacyEvents, () => ( []));
|
|
5703
|
-
const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access',
|
|
5872
|
+
const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _340 => _340[0], 'optionalAccess', _341 => _341.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
|
|
5704
5873
|
if (legacyEvents.length > 0 && !legacyTarget) {
|
|
5705
5874
|
throw new Error(
|
|
5706
5875
|
"--for is supported only by the legacy one-Slack-target form. Create the group first, then add rules in notification configuration."
|
|
@@ -5736,7 +5905,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5736
5905
|
const existingGroup = current.configuration.groups.find(
|
|
5737
5906
|
(candidate) => candidate.name.toLowerCase() === name.toLowerCase()
|
|
5738
5907
|
);
|
|
5739
|
-
const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess',
|
|
5908
|
+
const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _342 => _342.groupKey]), () => ( notificationObjectKey("group")));
|
|
5740
5909
|
const group = _nullishCoalesce(existingGroup, () => ( {
|
|
5741
5910
|
groupKey,
|
|
5742
5911
|
name,
|
|
@@ -5964,7 +6133,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5964
6133
|
/** Read one trigger inventory page without loading run histories. */
|
|
5965
6134
|
async listPlayTriggerInventory(options) {
|
|
5966
6135
|
const params = new URLSearchParams({ view: "inventory" });
|
|
5967
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6136
|
+
if (_optionalChain([options, 'optionalAccess', _343 => _343.cursor])) params.set("cursor", options.cursor);
|
|
5968
6137
|
return this.http.get(`/api/v2/plays/triggers?${params}`);
|
|
5969
6138
|
}
|
|
5970
6139
|
/** Read one trigger's recent runs, with an explicit partial-history flag. */
|
|
@@ -5973,7 +6142,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5973
6142
|
view: "history",
|
|
5974
6143
|
binding_id: bindingId
|
|
5975
6144
|
});
|
|
5976
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6145
|
+
if (_optionalChain([options, 'optionalAccess', _344 => _344.limit]) !== void 0)
|
|
5977
6146
|
params.set("history_limit", String(options.limit));
|
|
5978
6147
|
return this.http.get(`/api/v2/plays/triggers?${params}`);
|
|
5979
6148
|
}
|
|
@@ -6161,14 +6330,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6161
6330
|
*/
|
|
6162
6331
|
async runPlay(code, csvPath, name, options) {
|
|
6163
6332
|
const { workflowId } = await this.submitPlay(code, csvPath, name, {
|
|
6164
|
-
input: _optionalChain([options, 'optionalAccess',
|
|
6165
|
-
sourceCode: _optionalChain([options, 'optionalAccess',
|
|
6166
|
-
artifact: _optionalChain([options, 'optionalAccess',
|
|
6167
|
-
compilerManifest: _optionalChain([options, 'optionalAccess',
|
|
6168
|
-
inputFile: _optionalChain([options, 'optionalAccess',
|
|
6169
|
-
packagedFiles: _optionalChain([options, 'optionalAccess',
|
|
6170
|
-
force: _optionalChain([options, 'optionalAccess',
|
|
6171
|
-
forceToolRefresh: _optionalChain([options, 'optionalAccess',
|
|
6333
|
+
input: _optionalChain([options, 'optionalAccess', _345 => _345.input]),
|
|
6334
|
+
sourceCode: _optionalChain([options, 'optionalAccess', _346 => _346.sourceCode]),
|
|
6335
|
+
artifact: _optionalChain([options, 'optionalAccess', _347 => _347.artifact]),
|
|
6336
|
+
compilerManifest: _optionalChain([options, 'optionalAccess', _348 => _348.compilerManifest]),
|
|
6337
|
+
inputFile: _optionalChain([options, 'optionalAccess', _349 => _349.inputFile]),
|
|
6338
|
+
packagedFiles: _optionalChain([options, 'optionalAccess', _350 => _350.packagedFiles]),
|
|
6339
|
+
force: _optionalChain([options, 'optionalAccess', _351 => _351.force]),
|
|
6340
|
+
forceToolRefresh: _optionalChain([options, 'optionalAccess', _352 => _352.forceToolRefresh])
|
|
6172
6341
|
});
|
|
6173
6342
|
const start = Date.now();
|
|
6174
6343
|
const state = {
|
|
@@ -6179,7 +6348,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6179
6348
|
latest: null
|
|
6180
6349
|
};
|
|
6181
6350
|
let terminalObserved = null;
|
|
6182
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6351
|
+
if (_optionalChain([options, 'optionalAccess', _353 => _353.signal, 'optionalAccess', _354 => _354.aborted])) {
|
|
6183
6352
|
await this.cancelPlay(workflowId);
|
|
6184
6353
|
return {
|
|
6185
6354
|
success: false,
|
|
@@ -6190,9 +6359,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6190
6359
|
};
|
|
6191
6360
|
}
|
|
6192
6361
|
for await (const event of this.watchRunEvents(workflowId, {
|
|
6193
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
6362
|
+
signal: _optionalChain([options, 'optionalAccess', _355 => _355.signal])
|
|
6194
6363
|
})) {
|
|
6195
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6364
|
+
if (_optionalChain([options, 'optionalAccess', _356 => _356.signal, 'optionalAccess', _357 => _357.aborted])) {
|
|
6196
6365
|
await this.cancelPlay(workflowId);
|
|
6197
6366
|
return {
|
|
6198
6367
|
success: false,
|
|
@@ -6202,19 +6371,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6202
6371
|
error: "Cancelled by user"
|
|
6203
6372
|
};
|
|
6204
6373
|
}
|
|
6205
|
-
const previousStatus = _optionalChain([state, 'access',
|
|
6374
|
+
const previousStatus = _optionalChain([state, 'access', _358 => _358.latest, 'optionalAccess', _359 => _359.status]);
|
|
6206
6375
|
const status = updatePlayLiveStatusState(state, event);
|
|
6207
6376
|
if (!status) {
|
|
6208
6377
|
continue;
|
|
6209
6378
|
}
|
|
6210
6379
|
if (event.type !== "play.run.status" || status.status !== previousStatus) {
|
|
6211
|
-
_optionalChain([options, 'optionalAccess',
|
|
6380
|
+
_optionalChain([options, 'optionalAccess', _360 => _360.onProgress, 'optionalCall', _361 => _361(status)]);
|
|
6212
6381
|
}
|
|
6213
|
-
if (
|
|
6382
|
+
if (_chunkSL6MYJYMjs.isTerminalPlayRunLifecycleStatus.call(void 0, status.status)) {
|
|
6214
6383
|
terminalObserved = status;
|
|
6215
6384
|
}
|
|
6216
6385
|
}
|
|
6217
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6386
|
+
if (_optionalChain([options, 'optionalAccess', _362 => _362.signal, 'optionalAccess', _363 => _363.aborted])) {
|
|
6218
6387
|
await this.cancelPlay(workflowId);
|
|
6219
6388
|
return {
|
|
6220
6389
|
success: false,
|
|
@@ -6267,7 +6436,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6267
6436
|
const response = await this.http.get(
|
|
6268
6437
|
`/api/v2/usage/events?request_id=${encodeURIComponent(normalizedRequestId)}`
|
|
6269
6438
|
);
|
|
6270
|
-
const event = _optionalChain([response, 'access',
|
|
6439
|
+
const event = _optionalChain([response, 'access', _364 => _364.entries, 'optionalAccess', _365 => _365[0]]);
|
|
6271
6440
|
if (!event) {
|
|
6272
6441
|
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
6273
6442
|
"No usage event was found for this request_id.",
|
|
@@ -6282,7 +6451,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6282
6451
|
* charge or settlement oracle. Empty pages may still carry a continuation.
|
|
6283
6452
|
*/
|
|
6284
6453
|
async getBillingUsageEvents(options = {}) {
|
|
6285
|
-
const
|
|
6454
|
+
const invalid2 = (message) => {
|
|
6286
6455
|
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
6287
6456
|
message,
|
|
6288
6457
|
void 0,
|
|
@@ -6290,14 +6459,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6290
6459
|
);
|
|
6291
6460
|
};
|
|
6292
6461
|
if ("offset" in options) {
|
|
6293
|
-
|
|
6462
|
+
invalid2(
|
|
6294
6463
|
"Usage events do not support offset; use the preceding next_cursor."
|
|
6295
6464
|
);
|
|
6296
6465
|
}
|
|
6297
6466
|
const params = new URLSearchParams();
|
|
6298
6467
|
if (options.limit !== void 0) {
|
|
6299
6468
|
if (!Number.isInteger(options.limit) || options.limit < 1 || options.limit > 500) {
|
|
6300
|
-
|
|
6469
|
+
invalid2("Usage events limit must be an integer from 1 to 500.");
|
|
6301
6470
|
}
|
|
6302
6471
|
params.set("limit", String(options.limit));
|
|
6303
6472
|
}
|
|
@@ -6307,7 +6476,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6307
6476
|
]) {
|
|
6308
6477
|
if (value !== void 0) {
|
|
6309
6478
|
if (typeof value !== "string" || !value || value !== value.trim()) {
|
|
6310
|
-
|
|
6479
|
+
invalid2(
|
|
6311
6480
|
`Usage events ${name} must be a non-empty string without surrounding whitespace.`
|
|
6312
6481
|
);
|
|
6313
6482
|
}
|
|
@@ -6442,7 +6611,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6442
6611
|
async cancelBillingSubscription(options) {
|
|
6443
6612
|
return this.http.post(
|
|
6444
6613
|
"/api/v2/billing/subscription/cancel",
|
|
6445
|
-
{ action: _optionalChain([options, 'optionalAccess',
|
|
6614
|
+
{ action: _optionalChain([options, 'optionalAccess', _366 => _366.undo]) ? "undo_cancel" : "cancel" }
|
|
6446
6615
|
);
|
|
6447
6616
|
}
|
|
6448
6617
|
/**
|
|
@@ -6454,7 +6623,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6454
6623
|
*/
|
|
6455
6624
|
async listBillingInvoices(options) {
|
|
6456
6625
|
const params = new URLSearchParams();
|
|
6457
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6626
|
+
if (_optionalChain([options, 'optionalAccess', _367 => _367.limit]) !== void 0) {
|
|
6458
6627
|
params.set("limit", String(options.limit));
|
|
6459
6628
|
}
|
|
6460
6629
|
const suffix = Array.from(params).length > 0 ? `?${params.toString()}` : "";
|
|
@@ -6465,7 +6634,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6465
6634
|
/** List the reviewed target plans and whether new acquisition is enabled. */
|
|
6466
6635
|
async getTargetBillingPlans(options) {
|
|
6467
6636
|
return this.http.get(
|
|
6468
|
-
_optionalChain([options, 'optionalAccess',
|
|
6637
|
+
_optionalChain([options, 'optionalAccess', _368 => _368.promoCode]) ? `/api/v2/billing/plans?promo_code=${encodeURIComponent(options.promoCode)}` : "/api/v2/billing/plans"
|
|
6469
6638
|
);
|
|
6470
6639
|
}
|
|
6471
6640
|
/** Read the workspace's normalized target plan, payment, and balance state. */
|
|
@@ -6567,7 +6736,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6567
6736
|
/** Create a Stripe-hosted portal session for payment recovery and invoices. */
|
|
6568
6737
|
async createTargetBillingPortalSession(options) {
|
|
6569
6738
|
const response = await this.http.post(
|
|
6570
|
-
_optionalChain([options, 'optionalAccess',
|
|
6739
|
+
_optionalChain([options, 'optionalAccess', _369 => _369.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
|
|
6571
6740
|
{}
|
|
6572
6741
|
);
|
|
6573
6742
|
return response.data;
|
|
@@ -6617,8 +6786,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6617
6786
|
return this.http.request("/api/v2/monitors/audit", {
|
|
6618
6787
|
method: "POST",
|
|
6619
6788
|
body: {
|
|
6620
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6621
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6789
|
+
..._optionalChain([options, 'optionalAccess', _370 => _370.fleetId]) ? { fleet_id: options.fleetId } : {},
|
|
6790
|
+
..._optionalChain([options, 'optionalAccess', _371 => _371.cursor]) ? { cursor: options.cursor } : {}
|
|
6622
6791
|
},
|
|
6623
6792
|
maxRetries: 0
|
|
6624
6793
|
});
|
|
@@ -6628,8 +6797,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6628
6797
|
return this.http.request("/api/v2/monitors/repair", {
|
|
6629
6798
|
method: "POST",
|
|
6630
6799
|
body: {
|
|
6631
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6632
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6800
|
+
..._optionalChain([options, 'optionalAccess', _372 => _372.fleetId]) ? { fleet_id: options.fleetId } : {},
|
|
6801
|
+
..._optionalChain([options, 'optionalAccess', _373 => _373.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
|
|
6633
6802
|
},
|
|
6634
6803
|
maxRetries: 0
|
|
6635
6804
|
});
|
|
@@ -6637,7 +6806,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6637
6806
|
/** Delivery and convergence health. Prefer `client.monitors.health(...)`. */
|
|
6638
6807
|
async readMonitorsHealth(options) {
|
|
6639
6808
|
const params = new URLSearchParams();
|
|
6640
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6809
|
+
if (_optionalChain([options, 'optionalAccess', _374 => _374.fleetId])) params.set("fleet_id", options.fleetId);
|
|
6641
6810
|
const query = params.toString();
|
|
6642
6811
|
const suffix = query ? `?${query}` : "";
|
|
6643
6812
|
return this.http.request(
|
|
@@ -6710,7 +6879,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6710
6879
|
);
|
|
6711
6880
|
}
|
|
6712
6881
|
const params = new URLSearchParams();
|
|
6713
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6882
|
+
if (_optionalChain([options, 'optionalAccess', _375 => _375.cursor])) params.set("cursor", options.cursor);
|
|
6714
6883
|
const suffix = params.size > 0 ? `?${params}` : "";
|
|
6715
6884
|
return this.http.request(
|
|
6716
6885
|
`/api/v2/monitors/batch/${encodeURIComponent(runId)}${suffix}`,
|
|
@@ -6757,7 +6926,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6757
6926
|
* a second charge. The submission is never replayed automatically.
|
|
6758
6927
|
*/
|
|
6759
6928
|
async previewMonitor(definition, options) {
|
|
6760
|
-
const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6929
|
+
const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _376 => _376.idempotencyKey]), () => ( `monitor-preview-${_nullishCoalesce(_optionalChain([globalThis, 'access', _377 => _377.crypto, 'optionalAccess', _378 => _378.randomUUID, 'optionalCall', _379 => _379()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`));
|
|
6761
6930
|
try {
|
|
6762
6931
|
const result = await this.http.request(
|
|
6763
6932
|
"/api/v2/monitors/preview",
|
|
@@ -6765,7 +6934,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6765
6934
|
method: "POST",
|
|
6766
6935
|
body: {
|
|
6767
6936
|
...definition,
|
|
6768
|
-
..._optionalChain([options, 'optionalAccess',
|
|
6937
|
+
..._optionalChain([options, 'optionalAccess', _380 => _380.limit]) === void 0 ? {} : { limit: options.limit }
|
|
6769
6938
|
},
|
|
6770
6939
|
headers: { "Idempotency-Key": idempotencyKey },
|
|
6771
6940
|
maxRetries: 0,
|
|
@@ -6787,7 +6956,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6787
6956
|
* `client.monitors.deploy(...)`.
|
|
6788
6957
|
*/
|
|
6789
6958
|
async deployMonitor(definition, options) {
|
|
6790
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6959
|
+
if (_optionalChain([options, 'optionalAccess', _381 => _381.dryRun])) {
|
|
6791
6960
|
return this.http.request("/api/v2/monitors/check", {
|
|
6792
6961
|
method: "POST",
|
|
6793
6962
|
body: definition
|
|
@@ -6823,12 +6992,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6823
6992
|
/** List deployed monitors. Prefer `client.monitors.list(...)`. */
|
|
6824
6993
|
async listMonitors(options) {
|
|
6825
6994
|
const params = new URLSearchParams();
|
|
6826
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6827
|
-
else if (_optionalChain([options, 'optionalAccess',
|
|
6828
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6995
|
+
if (_optionalChain([options, 'optionalAccess', _382 => _382.state])) params.set("state", options.state);
|
|
6996
|
+
else if (_optionalChain([options, 'optionalAccess', _383 => _383.status])) params.set("status", options.status);
|
|
6997
|
+
if (_optionalChain([options, 'optionalAccess', _384 => _384.limit]) !== void 0)
|
|
6829
6998
|
params.set("limit", String(options.limit));
|
|
6830
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6831
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6999
|
+
if (_optionalChain([options, 'optionalAccess', _385 => _385.cursor])) params.set("cursor", options.cursor);
|
|
7000
|
+
if (_optionalChain([options, 'optionalAccess', _386 => _386.includeConsumers])) params.set("include_consumers", "true");
|
|
6832
7001
|
const query = params.toString();
|
|
6833
7002
|
const suffix = query ? `?${query}` : "";
|
|
6834
7003
|
return this.http.request(
|
|
@@ -6839,17 +7008,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6839
7008
|
/** The Monitors list. Prefer `client.monitors.ledger(...)`. */
|
|
6840
7009
|
async listMonitorLedger(options) {
|
|
6841
7010
|
const params = new URLSearchParams();
|
|
6842
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6843
|
-
for (const state of _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6844
|
-
for (const signal of _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
7011
|
+
if (_optionalChain([options, 'optionalAccess', _387 => _387.search])) params.set("q", options.search);
|
|
7012
|
+
for (const state of _nullishCoalesce(_optionalChain([options, 'optionalAccess', _388 => _388.states]), () => ( []))) params.append("state", state);
|
|
7013
|
+
for (const signal of _nullishCoalesce(_optionalChain([options, 'optionalAccess', _389 => _389.signals]), () => ( [])))
|
|
6845
7014
|
params.append("signal", signal);
|
|
6846
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6847
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6848
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6849
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
6850
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7015
|
+
if (_optionalChain([options, 'optionalAccess', _390 => _390.play])) params.set("play", options.play);
|
|
7016
|
+
if (_optionalChain([options, 'optionalAccess', _391 => _391.fleet])) params.set("fleet", options.fleet);
|
|
7017
|
+
if (_optionalChain([options, 'optionalAccess', _392 => _392.sort])) params.set("sort", options.sort);
|
|
7018
|
+
if (_optionalChain([options, 'optionalAccess', _393 => _393.window])) params.set("window", options.window);
|
|
7019
|
+
if (_optionalChain([options, 'optionalAccess', _394 => _394.limit]) !== void 0)
|
|
6851
7020
|
params.set("limit", String(options.limit));
|
|
6852
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7021
|
+
if (_optionalChain([options, 'optionalAccess', _395 => _395.cursor])) params.set("cursor", options.cursor);
|
|
6853
7022
|
const query = params.toString();
|
|
6854
7023
|
const suffix = query ? `?${query}` : "";
|
|
6855
7024
|
return this.http.request(
|
|
@@ -6866,7 +7035,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6866
7035
|
}
|
|
6867
7036
|
/** A monitor's recent findings. Prefer `client.monitors.ledgerFindings(...)`. */
|
|
6868
7037
|
async listMonitorLedgerFindings(key, options) {
|
|
6869
|
-
const suffix = _optionalChain([options, 'optionalAccess',
|
|
7038
|
+
const suffix = _optionalChain([options, 'optionalAccess', _396 => _396.cursor]) ? `?cursor=${encodeURIComponent(options.cursor)}` : "";
|
|
6870
7039
|
return this.http.request(
|
|
6871
7040
|
`/api/v2/monitors/ledger/${encodeURIComponent(key)}/findings${suffix}`,
|
|
6872
7041
|
{ method: "GET" }
|
|
@@ -6880,7 +7049,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6880
7049
|
);
|
|
6881
7050
|
}
|
|
6882
7051
|
async testMonitorWebhook(key, payload, options) {
|
|
6883
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7052
|
+
if (_optionalChain([options, 'optionalAccess', _397 => _397.dispatch]) === true || _optionalChain([options, 'optionalAccess', _398 => _398.validationOnly]) === false) {
|
|
6884
7053
|
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
6885
7054
|
"Monitor tests are validation-only and cannot dispatch events.",
|
|
6886
7055
|
void 0,
|
|
@@ -6935,7 +7104,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6935
7104
|
}
|
|
6936
7105
|
/** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
|
|
6937
7106
|
async deleteMonitor(key, options) {
|
|
6938
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7107
|
+
if (_optionalChain([options, 'optionalAccess', _399 => _399.localOnly]) === true) {
|
|
6939
7108
|
throw new (0, _chunkBBTKAASQjs.DeeplineError)(
|
|
6940
7109
|
"localOnly monitor deletion is no longer supported. Monitor deletion always deprovisions the upstream provider resource.",
|
|
6941
7110
|
void 0,
|
|
@@ -6943,11 +7112,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6943
7112
|
);
|
|
6944
7113
|
}
|
|
6945
7114
|
const params = new URLSearchParams();
|
|
6946
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7115
|
+
if (_optionalChain([options, 'optionalAccess', _400 => _400.dryRun])) params.set("dry_run", "true");
|
|
6947
7116
|
const query = params.toString();
|
|
6948
7117
|
return this.http.request(
|
|
6949
7118
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
|
|
6950
|
-
_optionalChain([options, 'optionalAccess',
|
|
7119
|
+
_optionalChain([options, 'optionalAccess', _401 => _401.dryRun]) ? { method: "DELETE" } : {
|
|
6951
7120
|
method: "DELETE",
|
|
6952
7121
|
// Deletion is a provider lifecycle operation. A timeout is an
|
|
6953
7122
|
// unknown outcome, not authority to begin another delete attempt.
|
|
@@ -6960,10 +7129,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6960
7129
|
* Prefer `client.monitors.reactivate(...)`.
|
|
6961
7130
|
*/
|
|
6962
7131
|
async reactivateMonitor(key, options) {
|
|
6963
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
7132
|
+
const query = _optionalChain([options, 'optionalAccess', _402 => _402.dryRun]) ? "?dry_run=true" : "";
|
|
6964
7133
|
return this.http.request(
|
|
6965
7134
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
|
|
6966
|
-
_optionalChain([options, 'optionalAccess',
|
|
7135
|
+
_optionalChain([options, 'optionalAccess', _403 => _403.dryRun]) ? { method: "POST", body: {} } : {
|
|
6967
7136
|
method: "POST",
|
|
6968
7137
|
body: {},
|
|
6969
7138
|
// Reactivation can create an upstream resource, so it must not use
|
|
@@ -6977,7 +7146,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6977
7146
|
// ——————————————————————————————————————————————————————————
|
|
6978
7147
|
static __initStatic() {this.MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH = 96}
|
|
6979
7148
|
monitorJobIdempotencyKey(operation) {
|
|
6980
|
-
const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access',
|
|
7149
|
+
const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _404 => _404.crypto, 'optionalAccess', _405 => _405.randomUUID, 'optionalCall', _406 => _406()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
|
|
6981
7150
|
const prefix = "monitor-job-";
|
|
6982
7151
|
const safeOperation = operation.replace(/[^A-Za-z0-9._-]/g, "-");
|
|
6983
7152
|
const maxOperationLength = Math.max(
|
|
@@ -6988,7 +7157,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6988
7157
|
}
|
|
6989
7158
|
monitorJobHeaders(operation, idempotencyKey) {
|
|
6990
7159
|
return {
|
|
6991
|
-
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess',
|
|
7160
|
+
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _407 => _407.trim, 'call', _408 => _408()]) || this.monitorJobIdempotencyKey(operation)
|
|
6992
7161
|
};
|
|
6993
7162
|
}
|
|
6994
7163
|
async deployMonitorBatch(definitions, options) {
|
|
@@ -6999,7 +7168,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
6999
7168
|
body: { version: 1, kind: "batch", monitors: definitions },
|
|
7000
7169
|
headers: this.monitorJobHeaders(
|
|
7001
7170
|
"batch-deploy",
|
|
7002
|
-
_optionalChain([options, 'optionalAccess',
|
|
7171
|
+
_optionalChain([options, 'optionalAccess', _409 => _409.idempotencyKey])
|
|
7003
7172
|
),
|
|
7004
7173
|
maxRetries: 0,
|
|
7005
7174
|
exactUrlOnly: true
|
|
@@ -7018,11 +7187,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7018
7187
|
version: 1,
|
|
7019
7188
|
kind: "batch",
|
|
7020
7189
|
monitors: definitions,
|
|
7021
|
-
..._optionalChain([options, 'optionalAccess',
|
|
7190
|
+
..._optionalChain([options, 'optionalAccess', _410 => _410.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
|
|
7022
7191
|
},
|
|
7023
7192
|
headers: this.monitorJobHeaders(
|
|
7024
7193
|
`batch-sync-${batchId}`,
|
|
7025
|
-
_optionalChain([options, 'optionalAccess',
|
|
7194
|
+
_optionalChain([options, 'optionalAccess', _411 => _411.idempotencyKey])
|
|
7026
7195
|
),
|
|
7027
7196
|
maxRetries: 0,
|
|
7028
7197
|
exactUrlOnly: true
|
|
@@ -7037,7 +7206,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7037
7206
|
body: {},
|
|
7038
7207
|
headers: this.monitorJobHeaders(
|
|
7039
7208
|
`batch-start-${batchId}`,
|
|
7040
|
-
_optionalChain([options, 'optionalAccess',
|
|
7209
|
+
_optionalChain([options, 'optionalAccess', _412 => _412.idempotencyKey])
|
|
7041
7210
|
),
|
|
7042
7211
|
maxRetries: 0,
|
|
7043
7212
|
exactUrlOnly: true
|
|
@@ -7052,7 +7221,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7052
7221
|
body: {},
|
|
7053
7222
|
headers: this.monitorJobHeaders(
|
|
7054
7223
|
`batch-stop-${batchId}`,
|
|
7055
|
-
_optionalChain([options, 'optionalAccess',
|
|
7224
|
+
_optionalChain([options, 'optionalAccess', _413 => _413.idempotencyKey])
|
|
7056
7225
|
),
|
|
7057
7226
|
maxRetries: 0,
|
|
7058
7227
|
exactUrlOnly: true
|
|
@@ -7073,7 +7242,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7073
7242
|
body: {},
|
|
7074
7243
|
headers: this.monitorJobHeaders(
|
|
7075
7244
|
`${action}-${monitorKey}`,
|
|
7076
|
-
_optionalChain([options, 'optionalAccess',
|
|
7245
|
+
_optionalChain([options, 'optionalAccess', _414 => _414.idempotencyKey])
|
|
7077
7246
|
),
|
|
7078
7247
|
maxRetries: 0,
|
|
7079
7248
|
exactUrlOnly: true
|
|
@@ -7086,7 +7255,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7086
7255
|
body: definition,
|
|
7087
7256
|
headers: this.monitorJobHeaders(
|
|
7088
7257
|
`sync-${definition.key}`,
|
|
7089
|
-
_optionalChain([options, 'optionalAccess',
|
|
7258
|
+
_optionalChain([options, 'optionalAccess', _415 => _415.idempotencyKey])
|
|
7090
7259
|
),
|
|
7091
7260
|
maxRetries: 0,
|
|
7092
7261
|
exactUrlOnly: true
|
|
@@ -7099,7 +7268,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7099
7268
|
);
|
|
7100
7269
|
}
|
|
7101
7270
|
async getMonitorJobLogs(jobId, options) {
|
|
7102
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
7271
|
+
const query = _optionalChain([options, 'optionalAccess', _416 => _416.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
|
|
7103
7272
|
return this.http.request(
|
|
7104
7273
|
`/api/v2/monitors/jobs/${encodeURIComponent(jobId)}/logs${query}`,
|
|
7105
7274
|
{ method: "GET" }
|
|
@@ -7112,15 +7281,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7112
7281
|
);
|
|
7113
7282
|
}
|
|
7114
7283
|
async waitForMonitorJob(jobId, options) {
|
|
7115
|
-
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
7116
|
-
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
7284
|
+
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _417 => _417.timeoutMs]), () => ( 10 * 6e4)));
|
|
7285
|
+
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _418 => _418.pollIntervalMs]), () => ( 2e3)));
|
|
7117
7286
|
const terminal = /* @__PURE__ */ new Set(["succeeded", "failed", "cancelled"]);
|
|
7118
7287
|
const startedAt = Date.now();
|
|
7119
7288
|
let latest = await this.getMonitorJob(jobId);
|
|
7120
7289
|
while (true) {
|
|
7121
|
-
_optionalChain([options, 'optionalAccess',
|
|
7290
|
+
_optionalChain([options, 'optionalAccess', _419 => _419.onProgress, 'optionalCall', _420 => _420(latest)]);
|
|
7122
7291
|
const job = latest.job;
|
|
7123
|
-
const state = typeof _optionalChain([job, 'optionalAccess',
|
|
7292
|
+
const state = typeof _optionalChain([job, 'optionalAccess', _421 => _421.state]) === "string" ? job.state : void 0;
|
|
7124
7293
|
if (state && terminal.has(state)) return latest;
|
|
7125
7294
|
if (Date.now() - startedAt >= timeoutMs) return latest;
|
|
7126
7295
|
await sleep(pollIntervalMs);
|
|
@@ -7131,12 +7300,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7131
7300
|
// Monitor Fleets
|
|
7132
7301
|
// ——————————————————————————————————————————————————————————
|
|
7133
7302
|
monitorFleetIdempotencyKey(operation) {
|
|
7134
|
-
const uuid = _optionalChain([globalThis, 'access',
|
|
7303
|
+
const uuid = _optionalChain([globalThis, 'access', _422 => _422.crypto, 'optionalAccess', _423 => _423.randomUUID, 'optionalCall', _424 => _424()]);
|
|
7135
7304
|
return `monitor-fleet-${operation}-${_nullishCoalesce(uuid, () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`;
|
|
7136
7305
|
}
|
|
7137
7306
|
monitorFleetHeaders(operation, idempotencyKey) {
|
|
7138
7307
|
return {
|
|
7139
|
-
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess',
|
|
7308
|
+
"Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _425 => _425.trim, 'call', _426 => _426()]) || this.monitorFleetIdempotencyKey(operation)
|
|
7140
7309
|
};
|
|
7141
7310
|
}
|
|
7142
7311
|
/**
|
|
@@ -7163,8 +7332,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7163
7332
|
const fleetId = typeof definitionOrId === "string" ? definitionOrId : definitionOrId.id;
|
|
7164
7333
|
const body = {
|
|
7165
7334
|
...typeof definitionOrId === "string" ? {} : { definition: definitionOrId },
|
|
7166
|
-
..._optionalChain([options, 'optionalAccess',
|
|
7167
|
-
..._optionalChain([options, 'optionalAccess',
|
|
7335
|
+
..._optionalChain([options, 'optionalAccess', _427 => _427.dryRun]) ? { dry_run: true } : {},
|
|
7336
|
+
..._optionalChain([options, 'optionalAccess', _428 => _428.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
|
|
7168
7337
|
};
|
|
7169
7338
|
return this.http.request(
|
|
7170
7339
|
this.monitorFleetPath(fleetId),
|
|
@@ -7172,7 +7341,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7172
7341
|
method: "PUT",
|
|
7173
7342
|
body,
|
|
7174
7343
|
timeout: _DeeplineClient.MONITOR_FLEET_WRITE_TIMEOUT_MS,
|
|
7175
|
-
headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess',
|
|
7344
|
+
headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _429 => _429.idempotencyKey])),
|
|
7176
7345
|
maxRetries: 0,
|
|
7177
7346
|
exactUrlOnly: true
|
|
7178
7347
|
}
|
|
@@ -7186,10 +7355,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7186
7355
|
/** The Fleets list. Prefer `client.monitors.fleets.overview()`. */
|
|
7187
7356
|
async listMonitorFleetOverviews(options) {
|
|
7188
7357
|
const params = new URLSearchParams({ view: "overview" });
|
|
7189
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7190
|
-
for (const state of _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
7191
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7192
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7358
|
+
if (_optionalChain([options, 'optionalAccess', _430 => _430.q])) params.set("q", options.q);
|
|
7359
|
+
for (const state of _nullishCoalesce(_optionalChain([options, 'optionalAccess', _431 => _431.states]), () => ( []))) params.append("state", state);
|
|
7360
|
+
if (_optionalChain([options, 'optionalAccess', _432 => _432.sort])) params.set("sort", options.sort);
|
|
7361
|
+
if (_optionalChain([options, 'optionalAccess', _433 => _433.window])) params.set("window", options.window);
|
|
7193
7362
|
return this.http.request(
|
|
7194
7363
|
`/api/v2/monitors/fleets?${params.toString()}`,
|
|
7195
7364
|
{ method: "GET" }
|
|
@@ -7198,7 +7367,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7198
7367
|
/** One fleet's overview. Prefer `client.monitors.fleets.overview(fleetId)`. */
|
|
7199
7368
|
async getMonitorFleetOverview(fleetId, options) {
|
|
7200
7369
|
const params = new URLSearchParams({ view: "overview" });
|
|
7201
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7370
|
+
if (_optionalChain([options, 'optionalAccess', _434 => _434.window])) params.set("window", options.window);
|
|
7202
7371
|
return this.http.request(
|
|
7203
7372
|
`${this.monitorFleetPath(fleetId)}?${params.toString()}`,
|
|
7204
7373
|
{ method: "GET" }
|
|
@@ -7207,10 +7376,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7207
7376
|
/** A fleet's problem members. Prefer `client.monitors.fleets.issues(...)`. */
|
|
7208
7377
|
async listMonitorFleetIssues(fleetId, options) {
|
|
7209
7378
|
const params = new URLSearchParams();
|
|
7210
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7211
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7212
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7213
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7379
|
+
if (_optionalChain([options, 'optionalAccess', _435 => _435.group])) params.set("group", options.group);
|
|
7380
|
+
if (_optionalChain([options, 'optionalAccess', _436 => _436.cause])) params.set("cause", options.cause);
|
|
7381
|
+
if (_optionalChain([options, 'optionalAccess', _437 => _437.cursor])) params.set("cursor", options.cursor);
|
|
7382
|
+
if (_optionalChain([options, 'optionalAccess', _438 => _438.limit]) !== void 0)
|
|
7214
7383
|
params.set("limit", String(options.limit));
|
|
7215
7384
|
const query = params.toString();
|
|
7216
7385
|
return this.http.request(
|
|
@@ -7220,8 +7389,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7220
7389
|
}
|
|
7221
7390
|
async getMonitorFleet(fleetId, options) {
|
|
7222
7391
|
const params = new URLSearchParams();
|
|
7223
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7224
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7392
|
+
if (_optionalChain([options, 'optionalAccess', _439 => _439.drift])) params.set("drift", "1");
|
|
7393
|
+
if (_optionalChain([options, 'optionalAccess', _440 => _440.limit]) !== void 0)
|
|
7225
7394
|
params.set("limit", String(options.limit));
|
|
7226
7395
|
const query = params.toString();
|
|
7227
7396
|
return this.http.request(
|
|
@@ -7234,11 +7403,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7234
7403
|
this.monitorFleetPath(fleetId),
|
|
7235
7404
|
{
|
|
7236
7405
|
method: "DELETE",
|
|
7237
|
-
body: _optionalChain([options, 'optionalAccess',
|
|
7406
|
+
body: _optionalChain([options, 'optionalAccess', _441 => _441.dryRun]) ? { dry_run: true } : {},
|
|
7238
7407
|
timeout: _DeeplineClient.MONITOR_FLEET_WRITE_TIMEOUT_MS,
|
|
7239
7408
|
headers: this.monitorFleetHeaders(
|
|
7240
7409
|
"deactivate",
|
|
7241
|
-
_optionalChain([options, 'optionalAccess',
|
|
7410
|
+
_optionalChain([options, 'optionalAccess', _442 => _442.idempotencyKey])
|
|
7242
7411
|
),
|
|
7243
7412
|
maxRetries: 0,
|
|
7244
7413
|
exactUrlOnly: true
|
|
@@ -7254,7 +7423,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7254
7423
|
timeout: _DeeplineClient.MONITOR_FLEET_WRITE_TIMEOUT_MS,
|
|
7255
7424
|
headers: this.monitorFleetHeaders(
|
|
7256
7425
|
"reactivate",
|
|
7257
|
-
_optionalChain([options, 'optionalAccess',
|
|
7426
|
+
_optionalChain([options, 'optionalAccess', _443 => _443.idempotencyKey])
|
|
7258
7427
|
),
|
|
7259
7428
|
maxRetries: 0,
|
|
7260
7429
|
exactUrlOnly: true
|
|
@@ -7271,9 +7440,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7271
7440
|
* identical to "the request failed".
|
|
7272
7441
|
*/
|
|
7273
7442
|
async waitForMonitorFleetConvergence(fleetId, options) {
|
|
7274
|
-
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
7275
|
-
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
7276
|
-
const terminal = _optionalChain([options, 'optionalAccess',
|
|
7443
|
+
const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _444 => _444.timeoutMs]), () => ( 10 * 6e4)));
|
|
7444
|
+
const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _445 => _445.pollIntervalMs]), () => ( 2e3)));
|
|
7445
|
+
const terminal = _optionalChain([options, 'optionalAccess', _446 => _446.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded", "billing_suspended"]) : /* @__PURE__ */ new Set([
|
|
7277
7446
|
"converged",
|
|
7278
7447
|
"degraded",
|
|
7279
7448
|
"deactivated",
|
|
@@ -7282,7 +7451,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7282
7451
|
const startedAt = Date.now();
|
|
7283
7452
|
let latest = await this.getMonitorFleet(fleetId);
|
|
7284
7453
|
while (true) {
|
|
7285
|
-
_optionalChain([options, 'optionalAccess',
|
|
7454
|
+
_optionalChain([options, 'optionalAccess', _447 => _447.onProgress, 'optionalCall', _448 => _448(latest)]);
|
|
7286
7455
|
const status = typeof latest.status === "string" ? latest.status : void 0;
|
|
7287
7456
|
if (status && terminal.has(status)) return latest;
|
|
7288
7457
|
if (Date.now() - startedAt >= timeoutMs) return latest;
|