deepline 0.3.542 → 0.3.544
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 +112 -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/monitor-fleet-contract.ts +3 -1
- package/dist/bundling-sources/shared_libs/integration-contracts/tool-connection.ts +13 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/plan.ts +108 -1
- 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/durable-summary-events.ts +29 -0
- 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 +43 -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 +49 -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 +229 -144
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +2 -2
- 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-ENBXAKQS.js +43 -0
- package/dist/cli/{auth-IGBGOB4E.mjs → auth-IMWJAHPU.mjs} +5 -5
- package/dist/cli/{billing-IB2TWE74.js → billing-Y55PR2PV.js} +101 -101
- package/dist/cli/{billing-N37W2I62.mjs → billing-YQMW3QJI.mjs} +12 -12
- package/dist/cli/chunk-22OBDYHP.js +455 -0
- 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-D44DP4KJ.js → chunk-3I26HMJ7.js} +37 -17
- package/dist/cli/{chunk-B5NP3SHX.mjs → chunk-3JDA23NN.mjs} +2 -2
- package/dist/cli/{chunk-QXNOSCYL.js → chunk-3KGMM4KS.js} +1 -1
- package/dist/cli/{chunk-6WQDHEVF.mjs → chunk-456RRXAP.mjs} +5 -5
- package/dist/cli/{chunk-V4EYJKGJ.js → chunk-4JQEAYN3.js} +156 -17
- package/dist/cli/{chunk-FGGPCAGC.js → chunk-4PKHFW56.js} +18 -18
- package/dist/cli/{chunk-QONO7FRF.mjs → chunk-57G4NYOL.mjs} +1 -1
- package/dist/cli/{chunk-46V7QSJE.mjs → chunk-5PR4VLLL.mjs} +3 -3
- package/dist/cli/{chunk-OLH2PHMC.mjs → chunk-6P7TGCHQ.mjs} +1 -1
- package/dist/cli/{chunk-AKY7KZRJ.js → chunk-7GNZEOTH.js} +6 -6
- package/dist/cli/{chunk-LFMQVSEI.js → chunk-7HMMTSDA.js} +5 -5
- package/dist/cli/{chunk-ORA5TMML.mjs → chunk-BEQ7RQLT.mjs} +5 -5
- package/dist/cli/{chunk-KQSTV4MW.js → chunk-BLYW6FFB.js} +60 -18
- package/dist/cli/{chunk-GM73TZ2W.js → chunk-C4P2KLWT.js} +41 -41
- package/dist/cli/{chunk-DNGACHFX.js → chunk-COJHT2KF.js} +22 -22
- package/dist/cli/{chunk-6SLEHAXX.js → chunk-DF2X7GJG.js} +5 -5
- package/dist/cli/{chunk-TT4JUUC3.mjs → chunk-DVDWAC2M.mjs} +7 -3
- package/dist/cli/{chunk-5CAVURVS.js → chunk-DYDHLBSK.js} +53 -53
- package/dist/cli/{chunk-UNDLNT3V.js → chunk-ECWOIXAV.js} +1 -1
- package/dist/cli/{chunk-EHLCWGWN.js → chunk-G26VJCNT.js} +4 -4
- package/dist/cli/{chunk-WL2GUGNZ.js → chunk-GQHRGBHV.js} +7 -7
- package/dist/cli/{chunk-DADH3WPE.mjs → chunk-GV45TTI6.mjs} +2 -2
- package/dist/cli/{chunk-OVX3Q5Q3.mjs → chunk-GWNYLIF7.mjs} +1 -1
- package/dist/cli/{chunk-EGOCGWCI.mjs → chunk-H4SAHB3Q.mjs} +3 -3
- package/dist/cli/{chunk-FX4OWXKK.mjs → chunk-HAQRF6DJ.mjs} +2 -2
- package/dist/cli/{chunk-NLZHLEHD.mjs → chunk-HBSWATOU.mjs} +6 -6
- package/dist/cli/{chunk-ACVTMAW4.mjs → chunk-HVJQF5BI.mjs} +2 -2
- package/dist/cli/{chunk-L2VKAASU.mjs → chunk-HXIR3VQL.mjs} +21 -0
- package/dist/cli/{chunk-Z5YRKX7K.mjs → chunk-HXM2JUGD.mjs} +1 -1
- package/dist/cli/{chunk-JPT6VE54.js → chunk-IFIJ4DBJ.js} +2 -2
- package/dist/cli/{chunk-HAITCPCG.js → chunk-JBWOE6AP.js} +16 -16
- package/dist/cli/{chunk-AWLPERL3.js → chunk-JWVG7ZPX.js} +3 -3
- package/dist/cli/{chunk-3XXXMSSP.js → chunk-KE6CSCUF.js} +44 -44
- package/dist/cli/{chunk-2ZGSHVZE.mjs → chunk-LPUBBUKX.mjs} +24 -4
- package/dist/cli/{chunk-PLIKPGOO.mjs → chunk-LQ6RRYXN.mjs} +5 -5
- package/dist/cli/{chunk-FFDZT255.mjs → chunk-LW274RO7.mjs} +1 -1
- package/dist/cli/{chunk-Z2XA6YU4.mjs → chunk-LX35AXTN.mjs} +1 -0
- package/dist/cli/{chunk-FANIRW74.mjs → chunk-NIPLY25A.mjs} +0 -2
- package/dist/cli/{chunk-VHJUH3TB.js → chunk-ON56ISO6.js} +3 -3
- package/dist/cli/{chunk-4I47NCRI.js → chunk-PDJ4UDCO.js} +498 -328
- package/dist/cli/{chunk-SWO5QOXB.mjs → chunk-PFGOCUH3.mjs} +1 -1
- package/dist/cli/{chunk-Q7WDXLYO.js → chunk-PKRW76XG.js} +2 -2
- package/dist/cli/{chunk-YK7NNZD4.mjs → chunk-PMW5YP72.mjs} +37 -190
- package/dist/cli/{chunk-5APOJWJF.mjs → chunk-Q7ZOWNKR.mjs} +183 -13
- package/dist/cli/{chunk-WACIN4PR.mjs → chunk-REEOMNCO.mjs} +3 -3
- package/dist/cli/{chunk-DMXLZ57N.js → chunk-RG34YBDE.js} +2 -2
- package/dist/cli/{chunk-3LEUSRV3.mjs → chunk-RJPDCSTD.mjs} +4 -4
- package/dist/cli/{chunk-IPVRMYWT.js → chunk-RKF263LR.js} +5 -5
- package/dist/cli/{chunk-AUFE624T.js → chunk-RUFR4PUO.js} +10 -10
- package/dist/cli/{chunk-I5EAIFGO.mjs → chunk-SK3HPU2J.mjs} +1 -1
- package/dist/cli/{chunk-ZVNYBQ77.mjs → chunk-SKS53WM6.mjs} +4 -4
- package/dist/cli/{chunk-CQDQNZGH.js → chunk-SL6MYJYM.js} +1 -0
- package/dist/cli/{chunk-E4CABWXL.js → chunk-TI6DTURF.js} +22 -1
- package/dist/cli/{chunk-CFZCRM6R.js → chunk-UHIAQPVA.js} +26 -26
- package/dist/cli/{chunk-D7GWEBMF.js → chunk-UNMNGRPB.js} +7 -7
- package/dist/cli/{chunk-GWHA4DAC.js → chunk-UV4RU2TE.js} +0 -2
- package/dist/cli/{chunk-TTBHOMAA.js → chunk-W7X4KH45.js} +316 -469
- package/dist/cli/chunk-WBSGPLH5.mjs +455 -0
- package/dist/cli/{chunk-SCLP5H4P.mjs → chunk-WUEORIOY.mjs} +1 -1
- package/dist/cli/{chunk-IDDKNMFX.mjs → chunk-Y3T5GWYK.mjs} +153 -14
- package/dist/cli/{chunk-P4MDTBAA.mjs → chunk-YIRVKMON.mjs} +1 -1
- package/dist/cli/{chunk-NDNEARE3.js → chunk-Z44YTSTA.js} +13 -13
- package/dist/cli/{chunk-F6QV42MC.mjs → chunk-Z7SXGOIQ.mjs} +1 -1
- package/dist/cli/{chunk-2VRKBHMD.mjs → chunk-ZHY4T5M6.mjs} +1 -1
- package/dist/cli/{chunk-E7B73LGT.js → chunk-ZY6FL4O4.js} +24 -20
- package/dist/cli/command-docs.js +3 -3
- package/dist/cli/command-docs.mjs +2 -2
- package/dist/cli/{concurrent-runs-help-DIBGMEIN.mjs → concurrent-runs-help-KBWPKSTP.mjs} +7 -7
- package/dist/cli/concurrent-runs-help-TOMLCMV7.js +21 -0
- package/dist/cli/{csv-CAVA3EMS.mjs → csv-M5EBEMZH.mjs} +4 -4
- package/dist/cli/{csv-XZAM7EYZ.js → csv-XGGDZTQI.js} +13 -13
- package/dist/cli/{db-PPGEOBNG.js → db-CVPR54XK.js} +29 -29
- package/dist/cli/{db-HD332QI7.mjs → db-M6FJ6J6E.mjs} +8 -8
- package/dist/cli/describe-RUODIS6M.js +50 -0
- package/dist/cli/describe-X6QA2U3C.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-AFEOLB4A.mjs → executions-EHTS2XJX.mjs} +8 -8
- package/dist/cli/{executions-4ZKBL7IC.js → executions-VJEEWN22.js} +10 -10
- package/dist/cli/{feedback-J2YPLKMF.mjs → feedback-76VGY4GP.mjs} +6 -6
- package/dist/cli/{feedback-M6Y33JKT.js → feedback-DQPUCUXO.js} +14 -14
- package/dist/cli/{git-632RYEF6.mjs → git-IY6DKKLR.mjs} +5 -5
- package/dist/cli/git-RLHTSYRY.js +25 -0
- package/dist/cli/index.js +150 -146
- package/dist/cli/index.mjs +49 -45
- package/dist/cli/integrations-242LE3TQ.mjs +98 -0
- package/dist/cli/integrations-CQSTIKFY.js +98 -0
- package/dist/cli/{legacy-noops-KWZMXYAU.mjs → legacy-noops-SWTSTMRY.mjs} +6 -6
- package/dist/cli/{legacy-noops-4Y62TKPC.js → legacy-noops-U72DO6ZF.js} +9 -9
- package/dist/cli/{mcp-PESLHAAC.mjs → mcp-JJH6JR52.mjs} +72 -15
- package/dist/cli/{mcp-35QA6YG7.js → mcp-L473BKLJ.js} +89 -32
- package/dist/cli/{monitors-4DTUZLAI.js → monitors-3TF2DOFD.js} +119 -104
- package/dist/cli/{monitors-YVBKBJBU.mjs → monitors-VSYHUBKC.mjs} +26 -11
- package/dist/cli/{org-DJNKMFCZ.mjs → org-S5VIKU2E.mjs} +8 -8
- package/dist/cli/{org-FWCBZMER.js → org-YKVI2ZTI.js} +90 -90
- package/dist/cli/{play-PHVQEEEZ.mjs → play-C7T5A3QM.mjs} +44 -25
- package/dist/cli/{play-FZ45M4KD.js → play-DOWEG45Y.js} +374 -355
- package/dist/cli/{providers-46E67QG7.mjs → providers-BMVVX3VD.mjs} +10 -9
- package/dist/cli/{providers-QJU6FMDD.js → providers-TAZPPFTB.js} +13 -12
- package/dist/cli/{quickstart-6HMJJ4RR.mjs → quickstart-A3WKMKTW.mjs} +4 -4
- package/dist/cli/{quickstart-HOL7H5FS.js → quickstart-HD6FQXGR.js} +6 -6
- package/dist/cli/{run-WKSIRXEC.js → run-BVVV2UX7.js} +49 -48
- package/dist/cli/{run-2W2TJ6QA.mjs → run-FV7TWNOC.mjs} +28 -27
- package/dist/cli/{search-Y2CFLSYB.mjs → search-MGK6WIKS.mjs} +9 -9
- package/dist/cli/search-VJFCWUZN.js +32 -0
- package/dist/cli/{search-output-2IK6ZZDY.js → search-output-6Y7KEPIE.js} +6 -6
- package/dist/cli/{search-output-FCZ35PHF.mjs → search-output-GM7LDZKE.mjs} +4 -4
- package/dist/cli/{secrets-PNPNUZLX.mjs → secrets-4RFAR7YI.mjs} +8 -8
- package/dist/cli/{secrets-JVJIHGU4.js → secrets-SISXIXSZ.js} +17 -17
- package/dist/cli/{sessions-GY5VVQGO.mjs → sessions-CE3OMEG7.mjs} +6 -6
- package/dist/cli/sessions-OWWZJZXH.js +22 -0
- package/dist/cli/{settings-5WHMFRNQ.js → settings-4HPM3K4A.js} +89 -89
- package/dist/cli/{settings-YQOPF3AI.mjs → settings-E22IDSX2.mjs} +16 -16
- package/dist/cli/{setup-3VJMKDEU.js → setup-BDRSNLKX.js} +49 -49
- package/dist/cli/{setup-O5U5IEVW.mjs → setup-BK65MDZ6.mjs} +9 -9
- package/dist/cli/{skills-G6J5PF35.mjs → skills-FI2GZMR4.mjs} +7 -7
- package/dist/cli/skills-ZLBFUAFR.js +36 -0
- package/dist/cli/tools-3K72VE33.js +57 -0
- package/dist/cli/{tools-AG7SWL5Y.mjs → tools-HMMWYUNW.mjs} +20 -19
- package/dist/cli/update-QZV6DH5V.js +34 -0
- package/dist/cli/{update-K73DD6CR.mjs → update-WDKBSXV5.mjs} +9 -9
- package/dist/cli/{views-4D2OTLIO.js → views-775AUDWQ.js} +23 -23
- package/dist/cli/{views-MO6DIOMR.mjs → views-JYIJCO23.mjs} +8 -8
- package/dist/cli/{workflow-ZEMFCS4Y.js → workflow-4H6KQRFQ.js} +19 -19
- package/dist/cli/{workflow-MMZMAELI.mjs → workflow-FKKHE3IU.mjs} +9 -9
- package/dist/{client-DLG9mHDh.d.mts → client-ANT3pyoa.d.mts} +1 -1
- package/dist/{client-X-FJD5Dp.d.ts → client-DD_FyJVd.d.ts} +1 -1
- package/dist/{client-core-WtnqyBwY.d.mts → client-core-Dg9tKhdB.d.mts} +339 -3
- package/dist/{client-core-0jmHfFBv.d.ts → client-core-QHmo73k1.d.ts} +339 -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
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DeeplineClient
|
|
3
|
+
} from "./chunk-GV45TTI6.mjs";
|
|
4
|
+
import {
|
|
5
|
+
printCommandEnvelope
|
|
6
|
+
} from "./chunk-DVDWAC2M.mjs";
|
|
7
|
+
|
|
8
|
+
// src/cli/commands/integration-commands.ts
|
|
9
|
+
import { Option } from "commander";
|
|
10
|
+
import { readFileSync } from "fs";
|
|
11
|
+
import { resolve } from "path";
|
|
12
|
+
function printIntegrationResult(value, json, lines, nextCursor) {
|
|
13
|
+
printCommandEnvelope(
|
|
14
|
+
{},
|
|
15
|
+
{
|
|
16
|
+
json: json || void 0,
|
|
17
|
+
legacyJson: { value },
|
|
18
|
+
text: lines.length ? `${lines.join("\n")}
|
|
19
|
+
` : "",
|
|
20
|
+
textStderr: nextCursor ? `Next page cursor: ${nextCursor}
|
|
21
|
+
` : void 0
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
function registerIntegrationBalanceCommand(parent, hidden = false) {
|
|
26
|
+
return parent.command("balance <provider>", { hidden }).description(
|
|
27
|
+
"Read a fresh balance using this workspace\u2019s own provider connection (LeadMagic)."
|
|
28
|
+
).option("--json", "Print the balance and observation timestamp as JSON").action(async (provider, options) => {
|
|
29
|
+
const balance = await new DeeplineClient().getIntegrationBalance(
|
|
30
|
+
provider
|
|
31
|
+
);
|
|
32
|
+
printIntegrationResult(balance, options.json, [
|
|
33
|
+
`${balance.provider}: ${balance.balance.value} ${balance.unit} (observed ${balance.observedAt})`
|
|
34
|
+
]);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function registerWorkspaceConnectionListCommand(parent, name = "workspace-connections", hidden = false) {
|
|
38
|
+
return parent.command(name, { hidden }).description(
|
|
39
|
+
"List named workspace authorizations and their connection status."
|
|
40
|
+
).option("--json", "Print connection summaries as JSON").option("--inventory", "List workspace connections across credential types").option("--provider <provider>", "List connections for one provider").option(
|
|
41
|
+
"--members",
|
|
42
|
+
"List teammates\u2019 personal connections for this provider"
|
|
43
|
+
).option("--cursor <cursor>", "Read the next page of members").action(
|
|
44
|
+
async (options) => {
|
|
45
|
+
const client = new DeeplineClient();
|
|
46
|
+
if (name === "list" && options.cursor && !options.members)
|
|
47
|
+
throw new Error(
|
|
48
|
+
"Use --cursor with --members to continue a member page."
|
|
49
|
+
);
|
|
50
|
+
if (name === "list" && options.inventory && options.members)
|
|
51
|
+
throw new Error("Choose --inventory or --members.");
|
|
52
|
+
if (options.members) {
|
|
53
|
+
if (options.provider !== "hubspot" && options.provider !== "google_calendar_availability")
|
|
54
|
+
throw new Error(
|
|
55
|
+
"Pass --provider hubspot or --provider google_calendar_availability."
|
|
56
|
+
);
|
|
57
|
+
const result = await client.listManagedConnectionMembers(
|
|
58
|
+
options.provider,
|
|
59
|
+
options.cursor
|
|
60
|
+
);
|
|
61
|
+
printIntegrationResult(
|
|
62
|
+
result,
|
|
63
|
+
options.json,
|
|
64
|
+
result.members.map(
|
|
65
|
+
(member) => `${member.name || member.email} ${member.status}${member.account ? " " + member.account.label : ""}`
|
|
66
|
+
),
|
|
67
|
+
result.nextCursor
|
|
68
|
+
);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const { connections } = await client.listWorkspaceConnectionInventory(
|
|
72
|
+
options.provider,
|
|
73
|
+
{ authorizationsOnly: !options.inventory }
|
|
74
|
+
);
|
|
75
|
+
printIntegrationResult(
|
|
76
|
+
connections,
|
|
77
|
+
options.json,
|
|
78
|
+
connections.length ? connections.map(
|
|
79
|
+
(row) => `${row.provider} ${row.status} ${row.name ? row.name + " " : ""}${row.label}`
|
|
80
|
+
) : ["No workspace connections."]
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
function registerLegacyHubSpotMembersCommand(parent, hidden = false) {
|
|
86
|
+
return parent.command("hubspot-members", { hidden }).description(
|
|
87
|
+
"List personal HubSpot connection status for workspace members."
|
|
88
|
+
).option("--cursor <cursor>", "Read the next roster page").option("--json", "Print the roster page as JSON").action(async (options) => {
|
|
89
|
+
const page = await new DeeplineClient().listPersonalHubSpotMembers(
|
|
90
|
+
options.cursor
|
|
91
|
+
);
|
|
92
|
+
const rows = page.members.map((member) => {
|
|
93
|
+
const account = member.account ? ` Portal ${member.account.portalId} User ${member.account.userId}` : "";
|
|
94
|
+
return `${JSON.stringify(member.name || member.email)} ${member.status}${account}`;
|
|
95
|
+
});
|
|
96
|
+
printIntegrationResult(
|
|
97
|
+
page,
|
|
98
|
+
options.json,
|
|
99
|
+
rows.length ? rows : ["No workspace members on this page."],
|
|
100
|
+
page.nextCursor
|
|
101
|
+
);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function registerLegacyWorkspaceConnectionCommand(parent, hidden = false) {
|
|
105
|
+
return parent.command("workspace-connection <provider> <action>", { hidden }).description("Manage a shared workspace account.").option("--json", "Print the result as JSON").option("--name <name>", "Name of a workspace connection").option("--auto-name", "Assign a name when connecting a workspace account").action(
|
|
106
|
+
async (provider, action, options) => {
|
|
107
|
+
if (provider !== "hubspot" && provider !== "google_calendar_availability")
|
|
108
|
+
throw new Error("Choose hubspot or google_calendar_availability.");
|
|
109
|
+
if (action !== "connect" && action !== "reconnect" && action !== "replace" && action !== "disconnect" && action !== "remove")
|
|
110
|
+
throw new Error(
|
|
111
|
+
"Choose connect, reconnect, replace, disconnect, or remove."
|
|
112
|
+
);
|
|
113
|
+
if (options.autoName && (action !== "connect" || options.name !== void 0))
|
|
114
|
+
throw new Error("Use --auto-name with connect and omit --name.");
|
|
115
|
+
const client = new DeeplineClient();
|
|
116
|
+
const { connections } = action === "connect" ? { connections: [] } : options.name ? await client.listWorkspaceConnectionInventory(provider) : await client.listWorkspaceIntegrationConnections();
|
|
117
|
+
const row = connections.find(
|
|
118
|
+
(connection) => connection.provider === provider && (!("type" in connection) || connection.type === "oauth") && (options.name === void 0 || "name" in connection && connection.name === options.name)
|
|
119
|
+
);
|
|
120
|
+
const result = await client.manageWorkspaceIntegrationConnection({
|
|
121
|
+
provider,
|
|
122
|
+
action,
|
|
123
|
+
name: options.name,
|
|
124
|
+
...options.autoName ? { autoName: true } : {},
|
|
125
|
+
connectionId: row?.id,
|
|
126
|
+
authorizationVersion: row?.authorizationVersion
|
|
127
|
+
});
|
|
128
|
+
printIntegrationResult(result, options.json, [
|
|
129
|
+
result.url ?? (action === "remove" ? "Workspace connection removed." : "Workspace connection disconnected.")
|
|
130
|
+
]);
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
function registerLegacyCalendarDelegationCommand(parent, hidden = false) {
|
|
135
|
+
return parent.command("calendar-delegation <action>", { hidden }).description(
|
|
136
|
+
"Manage Google Workspace approval. Named-team settings are deprecated."
|
|
137
|
+
).option("--name <name>", "Select a named availability connection").option("--domain <domain>", "Select a Google Workspace by domain").option("--label <label>", "Display name for a named connection").option("--everyone", "Include all eligible current and future members").option("--cursor <cursor>", "Read the next page of workspace members").option("--revision <revision>", "Current connection revision from status").option("--connection-id <id>", "Connection ID from status for edits").option(
|
|
138
|
+
"--grant-revision <revision>",
|
|
139
|
+
"Workspace approval revision from list"
|
|
140
|
+
).option("--members <memberIds...>", "Workspace member IDs to approve").option(
|
|
141
|
+
"--verification-email <email>",
|
|
142
|
+
"Verify Workspace approval with a work email"
|
|
143
|
+
).option(
|
|
144
|
+
"--dry-run",
|
|
145
|
+
"Print the proposed change without contacting Google or saving it"
|
|
146
|
+
).option("--json", "Print the result as JSON").action(
|
|
147
|
+
async (action, options) => {
|
|
148
|
+
const client = new DeeplineClient();
|
|
149
|
+
if (action === "list") {
|
|
150
|
+
const inventory = await client.listCalendarAvailabilityConnections();
|
|
151
|
+
const approvals = inventory.approvals?.length ? inventory.approvals.map(
|
|
152
|
+
(approval) => `${approval.domain} ${approval.enabled ? "approved" : "paused"} revision ${approval.revision}`
|
|
153
|
+
) : [
|
|
154
|
+
`Workspace approval ${inventory.grantEnabled ? "connected" : "disconnected"} \xB7 revision ${inventory.grantRevision}`
|
|
155
|
+
];
|
|
156
|
+
printIntegrationResult(inventory, options.json, [
|
|
157
|
+
...approvals,
|
|
158
|
+
...inventory.connections.map(
|
|
159
|
+
(row) => `${row.name} ${row.label} ${row.enabled ? "enabled" : "disabled"}${row.domain ? ` ${row.domain}` : ""}`
|
|
160
|
+
)
|
|
161
|
+
]);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (action === "status") {
|
|
165
|
+
if (options.members || options.revision || options.dryRun)
|
|
166
|
+
throw new Error(
|
|
167
|
+
"Use --members, --revision, and --dry-run with a settings change."
|
|
168
|
+
);
|
|
169
|
+
const settings = await client.getCalendarDelegation(
|
|
170
|
+
options.cursor,
|
|
171
|
+
options.name,
|
|
172
|
+
options.domain
|
|
173
|
+
);
|
|
174
|
+
printIntegrationResult(
|
|
175
|
+
settings,
|
|
176
|
+
options.json,
|
|
177
|
+
[
|
|
178
|
+
`${settings.enabled ? "Enabled" : "Disabled"} \xB7 revision ${settings.revision} \xB7 ${settings.domain}`,
|
|
179
|
+
`Google client ${settings.clientId} \xB7 ${settings.scope}`,
|
|
180
|
+
...settings.members.map((member) => {
|
|
181
|
+
const readiness = settings.selectedMemberIds.includes(
|
|
182
|
+
member.memberId
|
|
183
|
+
) ? "verified at setup" : member.eligible ? "eligible" : "verified work email required";
|
|
184
|
+
return `${member.memberId} ${member.email} ${readiness}`;
|
|
185
|
+
})
|
|
186
|
+
],
|
|
187
|
+
settings.nextCursor
|
|
188
|
+
);
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
const workspaceAction = [
|
|
192
|
+
"enable-workspace",
|
|
193
|
+
"disable-workspace",
|
|
194
|
+
"remove-workspace"
|
|
195
|
+
].includes(action);
|
|
196
|
+
if (action !== "enable" && action !== "disable" && action !== "remove" && !workspaceAction)
|
|
197
|
+
throw new Error(
|
|
198
|
+
"Choose list, status, enable, disable, remove, enable-workspace, disable-workspace, or remove-workspace."
|
|
199
|
+
);
|
|
200
|
+
const revision = Number(options.revision);
|
|
201
|
+
if (!workspaceAction && (!options.revision || !/^\d+$/.test(options.revision) || !Number.isSafeInteger(revision)))
|
|
202
|
+
throw new Error(
|
|
203
|
+
"Pass --revision with the current revision from status."
|
|
204
|
+
);
|
|
205
|
+
if (options.cursor || (action === "enable" || action === "enable-workspace" ? !(options.members?.length || action === "enable-workspace" && options.verificationEmail) : options.members || options.verificationEmail) || options.members && options.verificationEmail)
|
|
206
|
+
throw new Error(
|
|
207
|
+
"Use --verification-email for Workspace approval or --members for legacy settings. Use --cursor only with status."
|
|
208
|
+
);
|
|
209
|
+
const grantRevision = Number(options.grantRevision);
|
|
210
|
+
if ((workspaceAction || options.name) && (options.grantRevision === void 0 || !/^\d+$/.test(options.grantRevision) || !Number.isSafeInteger(grantRevision)))
|
|
211
|
+
throw new Error(
|
|
212
|
+
"Pass --grant-revision with the current workspace approval revision."
|
|
213
|
+
);
|
|
214
|
+
let change;
|
|
215
|
+
if (workspaceAction) {
|
|
216
|
+
const selection = {
|
|
217
|
+
grantRevision,
|
|
218
|
+
...options.domain ? { domain: options.domain } : {}
|
|
219
|
+
};
|
|
220
|
+
if (action === "enable-workspace") {
|
|
221
|
+
if (options.verificationEmail) {
|
|
222
|
+
change = {
|
|
223
|
+
...selection,
|
|
224
|
+
action: "enable_workspace",
|
|
225
|
+
verificationEmail: options.verificationEmail
|
|
226
|
+
};
|
|
227
|
+
} else {
|
|
228
|
+
if (options.members?.length !== 1)
|
|
229
|
+
throw new Error(
|
|
230
|
+
"Pass --verification-email with an address in the approved domain."
|
|
231
|
+
);
|
|
232
|
+
change = {
|
|
233
|
+
...selection,
|
|
234
|
+
action: "enable_workspace",
|
|
235
|
+
memberIds: options.members
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
} else if (action === "remove-workspace") {
|
|
239
|
+
if (!options.domain)
|
|
240
|
+
throw new Error("Pass --domain with the approval domain.");
|
|
241
|
+
if (!options.connectionId)
|
|
242
|
+
throw new Error(
|
|
243
|
+
"Pass --connection-id with the disconnected approval ID from list."
|
|
244
|
+
);
|
|
245
|
+
change = {
|
|
246
|
+
...selection,
|
|
247
|
+
action: "remove_workspace",
|
|
248
|
+
domain: options.domain,
|
|
249
|
+
connectionId: options.connectionId
|
|
250
|
+
};
|
|
251
|
+
} else {
|
|
252
|
+
change = { ...selection, action: "disable_workspace" };
|
|
253
|
+
}
|
|
254
|
+
} else if (options.name) {
|
|
255
|
+
if (revision !== 0 && !options.connectionId)
|
|
256
|
+
throw new Error("Pass --connection-id from the connection status.");
|
|
257
|
+
const selection = {
|
|
258
|
+
name: options.name,
|
|
259
|
+
revision,
|
|
260
|
+
grantRevision,
|
|
261
|
+
connectionId: options.connectionId,
|
|
262
|
+
...options.domain ? { domain: options.domain } : {}
|
|
263
|
+
};
|
|
264
|
+
change = action === "enable" ? {
|
|
265
|
+
...selection,
|
|
266
|
+
action,
|
|
267
|
+
allMembers: options.everyone === true,
|
|
268
|
+
label: options.label ?? options.name,
|
|
269
|
+
memberIds: options.members
|
|
270
|
+
} : {
|
|
271
|
+
...selection,
|
|
272
|
+
action: action === "remove" ? "remove" : "disable"
|
|
273
|
+
};
|
|
274
|
+
} else {
|
|
275
|
+
if (action === "remove" || options.domain)
|
|
276
|
+
throw new Error(
|
|
277
|
+
"Pass --name to update a named connection, or use enable-workspace or disable-workspace to change its Google approval."
|
|
278
|
+
);
|
|
279
|
+
change = action === "enable" ? { action, revision, memberIds: options.members } : { action: "disable", revision };
|
|
280
|
+
}
|
|
281
|
+
if (options.dryRun) {
|
|
282
|
+
printIntegrationResult(change, true, []);
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
const result = await client.changeCalendarDelegation(change);
|
|
286
|
+
printIntegrationResult(result, options.json, [
|
|
287
|
+
result.status === "validation_failed" ? "Google calendar verification failed." : `Delegation ${result.status}.`,
|
|
288
|
+
...(result.checks ?? []).map(
|
|
289
|
+
(check) => `${check.memberId} ${check.readiness}`
|
|
290
|
+
)
|
|
291
|
+
]);
|
|
292
|
+
if (result.status === "validation_failed") process.exitCode = 1;
|
|
293
|
+
}
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
function registerLegacyAvailabilityCalendarsCommand(parent, hidden = false) {
|
|
297
|
+
return parent.command("availability-calendars", { hidden }).description("Calendar discovery compatibility command for the pilot.").option("--cursor <cursor>", "Legacy calendar page cursor").option("--json", "Print the response as JSON").action(async (options) => {
|
|
298
|
+
const page = await new DeeplineClient().listAvailabilityCalendars(
|
|
299
|
+
options.cursor
|
|
300
|
+
);
|
|
301
|
+
printIntegrationResult(page, options.json, [
|
|
302
|
+
...page.calendars.map(
|
|
303
|
+
(calendar) => `${JSON.stringify(calendar.name)} ${calendar.id}`
|
|
304
|
+
),
|
|
305
|
+
...page.cursor ? [`Next page cursor: ${JSON.stringify(page.cursor)}`] : []
|
|
306
|
+
]);
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
function registerIntegrationConnectCommand(parent, defaultLink = false, hidden = false) {
|
|
310
|
+
return parent.command("connect <provider>", { hidden }).description(
|
|
311
|
+
"Get a dashboard connection link or connect a provider with credentials or OAuth."
|
|
312
|
+
).addOption(
|
|
313
|
+
new Option("--link", "Print a shareable dashboard link").conflicts([
|
|
314
|
+
"credentialsFile",
|
|
315
|
+
"oauth",
|
|
316
|
+
"preset",
|
|
317
|
+
"scopes",
|
|
318
|
+
"optionalScopes",
|
|
319
|
+
"expectedConnectionId"
|
|
320
|
+
])
|
|
321
|
+
).option(
|
|
322
|
+
"--credentials-file <path>",
|
|
323
|
+
"JSON object of credential field names and string values; keep this file private"
|
|
324
|
+
).option("--oauth", "Return an OAuth authorization URL").addOption(new Option("--expected-connection-id <id>").hideHelp()).option("--preset <id>", "Server-defined access preset (HubSpot only)").option("--scopes <scopes>", "Comma-separated OAuth scopes").option(
|
|
325
|
+
"--optional-scopes <scopes>",
|
|
326
|
+
"Comma-separated optional OAuth scopes"
|
|
327
|
+
).option(
|
|
328
|
+
"--dry-run",
|
|
329
|
+
"Print the proposed setup without saving credentials or starting OAuth"
|
|
330
|
+
).option("--json", "Print JSON without credential values").action(
|
|
331
|
+
async (provider, options) => {
|
|
332
|
+
if (options.expectedConnectionId !== void 0 && (!options.expectedConnectionId.trim() || provider !== "google_calendar_availability" || !options.credentialsFile || options.oauth)) {
|
|
333
|
+
throw new Error(
|
|
334
|
+
"--expected-connection-id requires Calendar availability and a credentials file."
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
if (options.link || defaultLink && !options.oauth && !options.credentialsFile && options.preset === void 0 && options.scopes === void 0 && options.optionalScopes === void 0 && options.expectedConnectionId === void 0) {
|
|
338
|
+
if (options.dryRun) {
|
|
339
|
+
printSetupPlan({ provider, action: "connect_link" }, options.json);
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
const link = await new DeeplineClient().getIntegrationConnectLink(
|
|
343
|
+
provider
|
|
344
|
+
);
|
|
345
|
+
printIntegrationResult(link, options.json, [link.connect_url]);
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
if (options.oauth) {
|
|
349
|
+
if (options.credentialsFile)
|
|
350
|
+
throw new Error("Use --oauth or --credentials-file, not both.");
|
|
351
|
+
if (options.preset !== void 0 && (options.scopes !== void 0 || options.optionalScopes !== void 0))
|
|
352
|
+
throw new Error("Use --preset or individual scopes, not both.");
|
|
353
|
+
const splitScopes = (value) => value.split(",").map((scope) => scope.trim()).filter(Boolean);
|
|
354
|
+
if (options.scopes !== void 0 && splitScopes(options.scopes).length === 0)
|
|
355
|
+
throw new Error("scopes must contain at least one OAuth scope.");
|
|
356
|
+
if (options.dryRun) {
|
|
357
|
+
printSetupPlan(
|
|
358
|
+
{
|
|
359
|
+
provider,
|
|
360
|
+
action: "oauth",
|
|
361
|
+
...options.preset !== void 0 ? { preset: options.preset } : {},
|
|
362
|
+
...options.scopes !== void 0 ? { scopes: splitScopes(options.scopes) } : {},
|
|
363
|
+
...options.optionalScopes !== void 0 ? { optionalScopes: splitScopes(options.optionalScopes) } : {}
|
|
364
|
+
},
|
|
365
|
+
options.json
|
|
366
|
+
);
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
const result2 = await new DeeplineClient().startIntegrationOAuth(
|
|
370
|
+
provider,
|
|
371
|
+
{
|
|
372
|
+
...options.preset !== void 0 ? { preset: options.preset } : {},
|
|
373
|
+
...options.scopes !== void 0 ? { scopes: splitScopes(options.scopes) } : {},
|
|
374
|
+
...options.optionalScopes !== void 0 ? { optionalScopes: splitScopes(options.optionalScopes) } : {}
|
|
375
|
+
}
|
|
376
|
+
);
|
|
377
|
+
if (!result2.ok || typeof result2.redirect_url !== "string" || !result2.redirect_url)
|
|
378
|
+
throw new Error(
|
|
379
|
+
"The API did not return an OAuth authorization URL."
|
|
380
|
+
);
|
|
381
|
+
printIntegrationResult(
|
|
382
|
+
{ provider, redirect_url: result2.redirect_url },
|
|
383
|
+
options.json,
|
|
384
|
+
[result2.redirect_url]
|
|
385
|
+
);
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
if (!options.credentialsFile || options.preset !== void 0 || options.scopes !== void 0 || options.optionalScopes !== void 0)
|
|
389
|
+
throw new Error(
|
|
390
|
+
"Use --link for a dashboard link, --credentials-file to save credentials, or --oauth to request access."
|
|
391
|
+
);
|
|
392
|
+
if (options.dryRun) {
|
|
393
|
+
printSetupPlan(
|
|
394
|
+
{
|
|
395
|
+
provider,
|
|
396
|
+
action: "save_credentials",
|
|
397
|
+
credentials_file: options.credentialsFile,
|
|
398
|
+
...options.expectedConnectionId ? { expected_connection_id: options.expectedConnectionId } : {}
|
|
399
|
+
},
|
|
400
|
+
options.json
|
|
401
|
+
);
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
let credentials;
|
|
405
|
+
try {
|
|
406
|
+
credentials = JSON.parse(
|
|
407
|
+
readFileSync(resolve(options.credentialsFile), "utf8")
|
|
408
|
+
);
|
|
409
|
+
} catch {
|
|
410
|
+
throw new Error(
|
|
411
|
+
"Unable to read --credentials-file as a JSON object."
|
|
412
|
+
);
|
|
413
|
+
}
|
|
414
|
+
if (!credentials || typeof credentials !== "object" || Array.isArray(credentials) || Object.keys(credentials).length === 0 || Object.values(credentials).some((value) => typeof value !== "string")) {
|
|
415
|
+
throw new Error(
|
|
416
|
+
"--credentials-file must contain a nonempty JSON object of string credential values."
|
|
417
|
+
);
|
|
418
|
+
}
|
|
419
|
+
const result = await new DeeplineClient().setIntegrationCredentials(
|
|
420
|
+
provider,
|
|
421
|
+
credentials,
|
|
422
|
+
{ expectedConnectionId: options.expectedConnectionId }
|
|
423
|
+
);
|
|
424
|
+
if (!result.ok || result.credential_saved !== true) {
|
|
425
|
+
throw new Error(
|
|
426
|
+
"The API did not confirm that provider credentials were saved. Inspect the integration before retrying."
|
|
427
|
+
);
|
|
428
|
+
}
|
|
429
|
+
const confirmation = { provider, credential_saved: true };
|
|
430
|
+
printIntegrationResult(confirmation, options.json, [
|
|
431
|
+
`Credentials saved for ${provider} in the active workspace.`
|
|
432
|
+
]);
|
|
433
|
+
}
|
|
434
|
+
);
|
|
435
|
+
}
|
|
436
|
+
function printSetupPlan(plan, json) {
|
|
437
|
+
printIntegrationResult(
|
|
438
|
+
plan,
|
|
439
|
+
json,
|
|
440
|
+
Object.entries(plan).map(
|
|
441
|
+
([field, value]) => `${field}: ${Array.isArray(value) ? value.join(", ") : String(value)}`
|
|
442
|
+
)
|
|
443
|
+
);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
export {
|
|
447
|
+
printIntegrationResult,
|
|
448
|
+
registerIntegrationBalanceCommand,
|
|
449
|
+
registerWorkspaceConnectionListCommand,
|
|
450
|
+
registerLegacyHubSpotMembersCommand,
|
|
451
|
+
registerLegacyWorkspaceConnectionCommand,
|
|
452
|
+
registerLegacyCalendarDelegationCommand,
|
|
453
|
+
registerLegacyAvailabilityCalendarsCommand,
|
|
454
|
+
registerIntegrationConnectCommand
|
|
455
|
+
};
|