deepline 0.3.568 → 0.3.569
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 +20 -5
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/monitors/fleets/limits.ts +17 -10
- package/dist/cli/auth-77NOPZ6A.js +44 -0
- package/dist/cli/{auth-AV6JJ2Y6.mjs → auth-VNJLXDGF.mjs} +5 -5
- package/dist/cli/{billing-3RVJZROW.mjs → billing-6HD5LEI2.mjs} +9 -9
- package/dist/cli/{billing-3RUXM4OW.js → billing-OTIIK5ZQ.js} +102 -102
- package/dist/cli/{chunk-Y4Q4LQRX.js → chunk-3WZ3X46C.js} +13 -13
- package/dist/cli/{chunk-ANRKUFUG.js → chunk-44HOKKIN.js} +100 -100
- package/dist/cli/{chunk-LQTLFFUB.mjs → chunk-45OTCUAC.mjs} +2 -2
- package/dist/cli/{chunk-JIEUKZ7J.js → chunk-4CLEOTG6.js} +2 -2
- package/dist/cli/{chunk-G7GN3RGE.mjs → chunk-64MOX3SN.mjs} +15 -3
- package/dist/cli/{chunk-AAXGFMYQ.mjs → chunk-6D4WBX7E.mjs} +15 -5
- package/dist/cli/{chunk-KMWH6VY2.mjs → chunk-6HEZRKAO.mjs} +2 -2
- package/dist/cli/{chunk-VEPXXRHO.mjs → chunk-6SBGYX25.mjs} +2 -2
- package/dist/cli/{chunk-UPUBCTSS.js → chunk-6Z7B3IOW.js} +2 -2
- package/dist/cli/{chunk-D2DYHEH7.js → chunk-7MZUSBSI.js} +23 -23
- package/dist/cli/{chunk-JT7S45KT.mjs → chunk-7NP7WZV2.mjs} +3 -3
- package/dist/cli/{chunk-GLTA22I3.mjs → chunk-7QH52S3E.mjs} +84 -11
- package/dist/cli/{chunk-HQX2P4NH.mjs → chunk-AKNJDDSM.mjs} +1 -1
- package/dist/cli/{chunk-F62RQL3X.js → chunk-ANXJNE2G.js} +3 -3
- package/dist/cli/{chunk-TM3Z7JXT.mjs → chunk-CK6U2NH2.mjs} +1 -1
- package/dist/cli/{chunk-TSNVG3T5.mjs → chunk-D3BJ2KZX.mjs} +1 -1
- package/dist/cli/{chunk-RH3WIX2W.mjs → chunk-DG6ILAO7.mjs} +2 -2
- package/dist/cli/{chunk-QVERY22Q.mjs → chunk-EDNWMQZQ.mjs} +2 -2
- package/dist/cli/{chunk-GXSJTCCG.mjs → chunk-FPRLFIYT.mjs} +4 -4
- package/dist/cli/{chunk-5KHSPLPO.js → chunk-FSAOU4HA.js} +20 -20
- package/dist/cli/{chunk-JPSKSXNS.mjs → chunk-GSUHJUNZ.mjs} +2 -2
- package/dist/cli/{chunk-PPQHQ4J2.js → chunk-H3SQMLHO.js} +48 -48
- package/dist/cli/{chunk-RUAEON5J.js → chunk-H7DRZXYF.js} +4 -4
- package/dist/cli/{chunk-LKXBFVYU.js → chunk-HLRSNCPM.js} +53 -53
- package/dist/cli/{chunk-5SOJGKQM.mjs → chunk-IEOIGU5A.mjs} +1 -1
- package/dist/cli/{chunk-WYXXJA5J.js → chunk-IGIUAHTR.js} +41 -41
- package/dist/cli/{chunk-H4BU2RRU.js → chunk-IS4NFIQY.js} +118 -108
- package/dist/cli/{chunk-M3IMARRH.mjs → chunk-JXRWSBJZ.mjs} +1 -1
- package/dist/cli/{chunk-7X34FUYS.js → chunk-LOF7H5V3.js} +7 -7
- package/dist/cli/{chunk-RJJNXV36.js → chunk-MIGJHZ3P.js} +20 -20
- package/dist/cli/{chunk-KKIDGS7O.js → chunk-N5ZOD3LA.js} +10 -10
- package/dist/cli/{chunk-ZVJ2YNAH.js → chunk-N6KF6X3D.js} +15 -3
- package/dist/cli/{chunk-V5WFPMUC.mjs → chunk-OFBP336D.mjs} +4 -4
- package/dist/cli/{chunk-SONHOBIK.mjs → chunk-P2LVKWU6.mjs} +2 -2
- package/dist/cli/{chunk-JRTB75JO.js → chunk-PAFSVZCZ.js} +95 -22
- package/dist/cli/{chunk-PE2XN2VM.js → chunk-QKPKVLTG.js} +2 -2
- package/dist/cli/{chunk-JJSKWDUI.js → chunk-QLMMNBJW.js} +6 -6
- package/dist/cli/{chunk-2BWPNLYG.js → chunk-S3VGWMFX.js} +9 -9
- package/dist/cli/{chunk-5KDMJLQX.js → chunk-S4MDYDCF.js} +5 -5
- package/dist/cli/{chunk-4PAGRUZA.js → chunk-SMAXLMM3.js} +15 -15
- package/dist/cli/{chunk-4QGZUHDF.mjs → chunk-SRMDDVWK.mjs} +5 -5
- package/dist/cli/{chunk-DIPM4GTS.js → chunk-SWREMC6J.js} +5 -5
- package/dist/cli/{chunk-FQIOTHEZ.mjs → chunk-TALKTQK5.mjs} +1 -1
- package/dist/cli/{chunk-OWSTUCIB.js → chunk-TH2GHSF6.js} +5 -5
- package/dist/cli/{chunk-BXNCAZ7G.mjs → chunk-TRE5X6VQ.mjs} +1 -1
- package/dist/cli/{chunk-5NBR7V5U.js → chunk-TZVKEUM6.js} +1 -1
- package/dist/cli/{chunk-SHO6BOXN.mjs → chunk-UOMMXLDU.mjs} +11 -11
- package/dist/cli/{chunk-VW2EUXY2.mjs → chunk-WPCY5PR3.mjs} +5 -5
- package/dist/cli/{chunk-O4FCX6BS.js → chunk-WVS2ITKP.js} +3 -3
- package/dist/cli/{chunk-MOJOAX3X.mjs → chunk-X4WPW5O3.mjs} +3 -3
- package/dist/cli/{chunk-VIMSKO7W.mjs → chunk-YLZ63U7S.mjs} +5 -5
- package/dist/cli/{chunk-VVGHZ7S6.mjs → chunk-YNSVWNRY.mjs} +1 -1
- package/dist/cli/{chunk-RZMU7ISG.js → chunk-YTOILYBU.js} +26 -26
- package/dist/cli/{chunk-S2HGTJET.mjs → chunk-YTYDKSK7.mjs} +5 -5
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{concurrent-runs-help-SJ27PPHV.mjs → concurrent-runs-help-BVBGDMNV.mjs} +6 -6
- package/dist/cli/concurrent-runs-help-QPUTOBFB.js +22 -0
- package/dist/cli/{csv-ZN4QI6PJ.mjs → csv-BUZIP2TV.mjs} +4 -4
- package/dist/cli/{csv-BGXZKS5R.js → csv-G25E43QV.js} +13 -13
- package/dist/cli/{db-SVBVPMWN.mjs → db-EUN7RRDX.mjs} +6 -6
- package/dist/cli/{db-KTAZ5FBG.js → db-KYIDDEEE.js} +27 -27
- package/dist/cli/{describe-4CGCRK24.mjs → describe-CTYSKRQB.mjs} +18 -18
- package/dist/cli/describe-PJIQSXJ4.js +50 -0
- package/dist/cli/describe-core.d.mts +2 -2
- package/dist/cli/describe-core.d.ts +2 -2
- package/dist/cli/{executions-YL5CTGWP.mjs → executions-BRSOIIV7.mjs} +6 -6
- package/dist/cli/{executions-75DO2GBS.js → executions-LQA34Z76.js} +8 -8
- package/dist/cli/{feedback-VEA3XJM3.mjs → feedback-JYL2FTWI.mjs} +6 -6
- package/dist/cli/{feedback-2SMUBQZR.js → feedback-RVYWQRSZ.js} +14 -14
- package/dist/cli/{git-BEYEHMCX.mjs → git-2Z2KYPCV.mjs} +5 -5
- package/dist/cli/git-MJRG55H7.js +26 -0
- package/dist/cli/index.js +147 -147
- package/dist/cli/index.mjs +46 -46
- package/dist/cli/{integrations-PIXZBU2N.js → integrations-JK3OT5BT.js} +29 -29
- package/dist/cli/{integrations-RXWE6WUZ.mjs → integrations-QFS62VWE.mjs} +7 -7
- package/dist/cli/{legacy-noops-PJHP4GRU.mjs → legacy-noops-NBKBFVDO.mjs} +6 -6
- package/dist/cli/{legacy-noops-XHVEYEJN.js → legacy-noops-RYP5LN5D.js} +9 -9
- package/dist/cli/{mcp-276ZFIUM.js → mcp-KPY7NZPI.js} +24 -24
- package/dist/cli/{mcp-SUOIVUOM.mjs → mcp-KVGJK3SM.mjs} +4 -4
- package/dist/cli/{monitors-DGBB7X4G.js → monitors-DE5SX3CP.js} +100 -100
- package/dist/cli/{monitors-AVGNLV7V.mjs → monitors-H3UWQMMI.mjs} +7 -7
- package/dist/cli/{org-U5275K5D.js → org-CDCSMG3J.js} +121 -121
- package/dist/cli/{org-WKP2BZJQ.mjs → org-N6I5K56T.mjs} +6 -6
- package/dist/cli/{outcomes-H3RAH5ES.mjs → outcomes-EPEMTJVB.mjs} +6 -6
- package/dist/cli/{outcomes-LSCS6QE5.js → outcomes-UNAOLWWO.js} +14 -14
- package/dist/cli/{play-GNT7SITC.js → play-7TVJ3DFQ.js} +324 -324
- package/dist/cli/{play-7MSJU3LP.mjs → play-VVM5XJFT.mjs} +19 -19
- package/dist/cli/{providers-YDKHHCO4.mjs → providers-47CT527B.mjs} +6 -6
- package/dist/cli/{providers-KTEG2ZNS.js → providers-ANYRJ56K.js} +9 -9
- package/dist/cli/{quickstart-T2NJMACU.js → quickstart-H4MI6LVO.js} +6 -6
- package/dist/cli/{quickstart-F6IH43NP.mjs → quickstart-QHMC5YCM.mjs} +4 -4
- package/dist/cli/{run-AJB4MQGO.mjs → run-NXC5W5CW.mjs} +23 -23
- package/dist/cli/{run-MIRJIW45.js → run-V4UAYPAX.js} +44 -44
- package/dist/cli/{search-V6YPFL6J.mjs → search-BEU4VBY4.mjs} +7 -7
- package/dist/cli/search-TUK2STXB.js +32 -0
- package/dist/cli/{search-output-4VDZLO42.mjs → search-output-DUA3WDB7.mjs} +4 -4
- package/dist/cli/{search-output-GGCIICSW.js → search-output-NUGUU7VJ.js} +6 -6
- package/dist/cli/{secrets-L2VDRZDZ.js → secrets-PFDBC5KO.js} +15 -15
- package/dist/cli/{secrets-XUENPM5D.mjs → secrets-XQOOWTH2.mjs} +6 -6
- package/dist/cli/sessions-5333FFSY.js +23 -0
- package/dist/cli/{sessions-W7LHEE35.mjs → sessions-U2ZS5R42.mjs} +6 -6
- package/dist/cli/{settings-NB6Y53VR.js → settings-ATYARYCR.js} +85 -85
- package/dist/cli/{settings-IVFOUU7V.mjs → settings-GPDE7DL2.mjs} +12 -12
- package/dist/cli/{setup-2F42I4HW.js → setup-4AYMU7NK.js} +49 -49
- package/dist/cli/{setup-QUL7OO6A.mjs → setup-UDO6BY5A.mjs} +9 -9
- package/dist/cli/skills-LB56HJOY.js +37 -0
- package/dist/cli/{skills-SL3DNAH6.mjs → skills-RACTA7VV.mjs} +7 -7
- package/dist/cli/tools-3Y7KCKZX.js +57 -0
- package/dist/cli/{tools-TD5EJ2UD.mjs → tools-TXI6XFHE.mjs} +17 -17
- package/dist/cli/update-EWOLMH3E.js +37 -0
- package/dist/cli/{update-Z53GM6PX.mjs → update-VHTKWNXO.mjs} +9 -9
- package/dist/cli/{views-VAQGFKXN.js → views-DVBO3L63.js} +21 -21
- package/dist/cli/{views-ZB6AOING.mjs → views-GCNEHB7D.mjs} +6 -6
- package/dist/cli/{workflow-OKDLEK3G.mjs → workflow-R3A6EGB5.mjs} +7 -7
- package/dist/cli/{workflow-PSIQ5HVP.js → workflow-TFRJ5JKX.js} +17 -17
- package/dist/{client-D5mo-R-t.d.mts → client-ClJlqkKt.d.mts} +1 -1
- package/dist/{client-B8_eh5F-.d.ts → client-DCnExziW.d.ts} +1 -1
- package/dist/{client-core-Br12Asu-.d.ts → client-core-BKq5ZNAl.d.ts} +14 -2
- package/dist/{client-core-BPu-brbA.d.mts → client-core-DAOPQnGD.d.mts} +14 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +9 -9
- package/dist/index.mjs +6 -6
- package/dist/install-integrity.json +118 -118
- package/dist/plays/play-description.d.mts +1 -1
- package/dist/plays/play-description.d.ts +1 -1
- package/dist/plays/run-request.d.mts +1 -1
- package/dist/plays/run-request.d.ts +1 -1
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +5 -5
- package/dist/server.mjs +3 -3
- package/package.json +1 -1
- package/dist/cli/auth-IPONFGG7.js +0 -44
- package/dist/cli/concurrent-runs-help-66WCD2Y4.js +0 -22
- package/dist/cli/describe-M3MOFAVN.js +0 -50
- package/dist/cli/git-XDS5BHBG.js +0 -26
- package/dist/cli/search-YPZ575MY.js +0 -32
- package/dist/cli/sessions-GJLSOVLW.js +0 -23
- package/dist/cli/skills-2KAEOH2N.js +0 -37
- package/dist/cli/tools-W6223Q4W.js +0 -57
- package/dist/cli/update-IZBYF422.js +0 -37
|
@@ -9,7 +9,7 @@ var _chunkLHPYCJNLjs = require('./chunk-LHPYCJNL.js');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkFSAOU4HAjs = require('./chunk-FSAOU4HA.js');
|
|
13
13
|
|
|
14
14
|
// src/cli/describe-options.ts
|
|
15
15
|
function addDescribeOptions(command, options = {}) {
|
|
@@ -250,7 +250,7 @@ function projectRunDatasetCell(value) {
|
|
|
250
250
|
const logicalValue = parseSerializedDatasetValue(value);
|
|
251
251
|
if (logicalValue === null || logicalValue === void 0) return logicalValue;
|
|
252
252
|
if (typeof logicalValue === "object") {
|
|
253
|
-
return
|
|
253
|
+
return _chunkFSAOU4HAjs.csvSafeJsonString.call(void 0, canonicalDatasetJson(logicalValue));
|
|
254
254
|
}
|
|
255
255
|
return logicalValue;
|
|
256
256
|
}
|
|
@@ -642,7 +642,7 @@ function csvText(rows, columns = []) {
|
|
|
642
642
|
rows: rows.map((row) => record(row) ? row : { value: row }),
|
|
643
643
|
columns
|
|
644
644
|
});
|
|
645
|
-
return
|
|
645
|
+
return _chunkFSAOU4HAjs.csvStringFromRows.call(void 0, projection.rows, projection.columns);
|
|
646
646
|
}
|
|
647
647
|
function writeExecutionOutput(result, options, { skipReceiptFile = false } = {}) {
|
|
648
648
|
let temp;
|
|
@@ -770,7 +770,7 @@ function writeExecutionOutput(result, options, { skipReceiptFile = false } = {})
|
|
|
770
770
|
};
|
|
771
771
|
if (options.receiptOut && !skipReceiptFile) {
|
|
772
772
|
persist(options.receiptOut, jsonText(receipt));
|
|
773
|
-
|
|
773
|
+
_chunkFSAOU4HAjs.markJsonOutputHandled.call(void 0, );
|
|
774
774
|
} else {
|
|
775
775
|
printReceipt(receipt, options, {
|
|
776
776
|
data: hasData ? result.data : void 0,
|
|
@@ -939,7 +939,7 @@ function receiptText(receipt, options, extra) {
|
|
|
939
939
|
problems.push(
|
|
940
940
|
`Error: ${record(error) && typeof error.message === "string" ? error.message : JSON.stringify(error)}`
|
|
941
941
|
);
|
|
942
|
-
const diagnostic =
|
|
942
|
+
const diagnostic = _chunkFSAOU4HAjs.formatCliFailureDiagnostic.call(void 0, error);
|
|
943
943
|
if (diagnostic) problems.push(...diagnostic.split("\n"));
|
|
944
944
|
if (record(error) && typeof error.recoveryFile === "string") {
|
|
945
945
|
problems.push(
|
|
@@ -1032,8 +1032,8 @@ function printReceipt(receipt, options, extra) {
|
|
|
1032
1032
|
const text = options.receiptJson ? `${JSON.stringify(receipt, null, 2)}
|
|
1033
1033
|
` : receiptText(receipt, options, extra);
|
|
1034
1034
|
if (options.receiptOut !== void 0) {
|
|
1035
|
-
|
|
1036
|
-
|
|
1035
|
+
_chunkFSAOU4HAjs.writeRawStderr.call(void 0, text);
|
|
1036
|
+
_chunkFSAOU4HAjs.markJsonOutputHandled.call(void 0, );
|
|
1037
1037
|
} else {
|
|
1038
1038
|
(dataOnStdout(options) ? process.stderr : process.stdout).write(text);
|
|
1039
1039
|
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk4CLEOTG6js = require('./chunk-4CLEOTG6.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkIGIUAHTRjs = require('./chunk-IGIUAHTR.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkH3SQMLHOjs = require('./chunk-H3SQMLHO.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkFSAOU4HAjs = require('./chunk-FSAOU4HA.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkWVS2ITKPjs = require('./chunk-WVS2ITKP.js');
|
|
21
21
|
|
|
22
22
|
// src/cli/commands/update.ts
|
|
23
23
|
var _child_process = require('child_process');
|
|
@@ -499,7 +499,7 @@ function normalizedNpmPrefix(value) {
|
|
|
499
499
|
}
|
|
500
500
|
function resolveNpmGlobalPrefix(env) {
|
|
501
501
|
try {
|
|
502
|
-
const plan =
|
|
502
|
+
const plan = _chunkH3SQMLHOjs.resolveShellSpawn.call(void 0,
|
|
503
503
|
"npm",
|
|
504
504
|
["prefix", "-g"],
|
|
505
505
|
process.platform,
|
|
@@ -561,8 +561,8 @@ function resolveUpdatePlan(options = {}) {
|
|
|
561
561
|
const npmGlobalPrefix = options.npmGlobalPrefix !== void 0 ? options.npmGlobalPrefix : resolveNpmGlobalPrefix(env);
|
|
562
562
|
const hasVerifiedNpmOwnership = inferredInstallPrefix !== null && normalizedNpmPrefix(inferredInstallPrefix) === normalizedNpmPrefix(npmGlobalPrefix);
|
|
563
563
|
const installPrefix = options.requireVerifiedNpmOwnership ? hasVerifiedNpmOwnership ? inferredInstallPrefix : null : inferredInstallPrefix;
|
|
564
|
-
const npmVersion = options.npmVersion === void 0 ?
|
|
565
|
-
const npmGlobalInstallFlags =
|
|
564
|
+
const npmVersion = options.npmVersion === void 0 ? _chunk4CLEOTG6js.readNpmVersion.call(void 0, env) : options.npmVersion;
|
|
565
|
+
const npmGlobalInstallFlags = _chunk4CLEOTG6js.npmSupportsAllowScripts.call(void 0, npmVersion) ? [...NPM_SDK_INSTALL_COMMON_FLAGS, "--allow-scripts=esbuild"] : NPM_SDK_INSTALL_COMMON_FLAGS;
|
|
566
566
|
const args = installPrefix ? [
|
|
567
567
|
"install",
|
|
568
568
|
"-g",
|
|
@@ -572,7 +572,7 @@ function resolveUpdatePlan(options = {}) {
|
|
|
572
572
|
packageSpec
|
|
573
573
|
] : ["install", "-g", ...npmGlobalInstallFlags, packageSpec];
|
|
574
574
|
const fallbackRegistryUrl = options.npmFallbackRegistryUrl !== void 0 ? options.npmFallbackRegistryUrl : publicNpmFallbackRegistryUrl(
|
|
575
|
-
_optionalChain([env, 'access', _22 => _22.DEEPLINE_HOST_URL, 'optionalAccess', _23 => _23.trim, 'call', _24 => _24()]) ||
|
|
575
|
+
_optionalChain([env, 'access', _22 => _22.DEEPLINE_HOST_URL, 'optionalAccess', _23 => _23.trim, 'call', _24 => _24()]) || _chunkWVS2ITKPjs.autoDetectBaseUrl.call(void 0, )
|
|
576
576
|
);
|
|
577
577
|
return {
|
|
578
578
|
kind: "npm-global",
|
|
@@ -821,7 +821,7 @@ function sidecarInstallFailure(versionDir) {
|
|
|
821
821
|
function runCommand(command, args, env = process.env) {
|
|
822
822
|
return new Promise((resolveResult) => {
|
|
823
823
|
let output = "";
|
|
824
|
-
const plan =
|
|
824
|
+
const plan = _chunkH3SQMLHOjs.resolveShellSpawn.call(void 0, command, args, process.platform, env);
|
|
825
825
|
const child = _child_process.spawn.call(void 0, plan.command, plan.args, {
|
|
826
826
|
windowsHide: true,
|
|
827
827
|
stdio: ["inherit", "pipe", "pipe"],
|
|
@@ -1169,7 +1169,7 @@ function normalizePinnedVersion(value) {
|
|
|
1169
1169
|
}
|
|
1170
1170
|
async function readPinMetadata(registryUrl, version) {
|
|
1171
1171
|
const controller = new AbortController();
|
|
1172
|
-
const timeout = setTimeout(() => controller.abort(),
|
|
1172
|
+
const timeout = setTimeout(() => controller.abort(), _chunkWVS2ITKPjs.DEFAULT_TIMEOUT);
|
|
1173
1173
|
try {
|
|
1174
1174
|
const response = await fetch(
|
|
1175
1175
|
new URL(
|
|
@@ -1185,7 +1185,7 @@ async function readPinMetadata(registryUrl, version) {
|
|
|
1185
1185
|
if (!response.ok) {
|
|
1186
1186
|
return {
|
|
1187
1187
|
kind: "miss",
|
|
1188
|
-
transient:
|
|
1188
|
+
transient: _chunkWVS2ITKPjs.TRANSIENT_HTTP_STATUSES.has(response.status),
|
|
1189
1189
|
error: new Error(`${registryUrl} returned HTTP ${response.status}`)
|
|
1190
1190
|
};
|
|
1191
1191
|
}
|
|
@@ -1219,8 +1219,8 @@ async function publishedVersionSupportsPin(version, fallbackRegistryUrl, retry =
|
|
|
1219
1219
|
"https://registry.npmjs.org/",
|
|
1220
1220
|
...fallbackRegistryUrl ? [fallbackRegistryUrl] : []
|
|
1221
1221
|
];
|
|
1222
|
-
const maxRetries = _nullishCoalesce(retry.maxRetries, () => (
|
|
1223
|
-
const backoffMs = _nullishCoalesce(retry.backoffMs, () => (
|
|
1222
|
+
const maxRetries = _nullishCoalesce(retry.maxRetries, () => ( _chunkWVS2ITKPjs.DEFAULT_MAX_RETRIES));
|
|
1223
|
+
const backoffMs = _nullishCoalesce(retry.backoffMs, () => ( _chunkWVS2ITKPjs.defaultRetryBackoffMs));
|
|
1224
1224
|
let lastError = null;
|
|
1225
1225
|
for (let round = 1; ; round += 1) {
|
|
1226
1226
|
let transientOnly = true;
|
|
@@ -1283,14 +1283,14 @@ async function resolveInstalledVersionIfLatest(plan) {
|
|
|
1283
1283
|
return null;
|
|
1284
1284
|
}
|
|
1285
1285
|
async function runUpdateCommand(options, dependencies = {}) {
|
|
1286
|
-
const detectBaseUrl = _nullishCoalesce(dependencies.detectBaseUrl, () => (
|
|
1286
|
+
const detectBaseUrl = _nullishCoalesce(dependencies.detectBaseUrl, () => ( _chunkWVS2ITKPjs.autoDetectBaseUrl));
|
|
1287
1287
|
const resolvePlan = _nullishCoalesce(dependencies.resolvePlan, () => ( resolveUpdatePlan));
|
|
1288
1288
|
const runPlan = _nullishCoalesce(dependencies.runPlan, () => ( runUpdatePlan));
|
|
1289
1289
|
const syncSkills = _nullishCoalesce(dependencies.syncSkillsIfNeeded, () => ( (async () => {
|
|
1290
1290
|
const originalWrite = process.stdout.write.bind(process.stdout);
|
|
1291
1291
|
process.stdout.write = (() => true);
|
|
1292
1292
|
try {
|
|
1293
|
-
const exitCode = await
|
|
1293
|
+
const exitCode = await _chunkIGIUAHTRjs.runSkillsCommand.call(void 0, { json: true });
|
|
1294
1294
|
if (exitCode !== 0) {
|
|
1295
1295
|
throw new Error(
|
|
1296
1296
|
`Deepline skills update failed with exit ${exitCode}.`
|
|
@@ -1363,7 +1363,7 @@ async function runUpdateCommand(options, dependencies = {}) {
|
|
|
1363
1363
|
};
|
|
1364
1364
|
if (options.json && !options.executeWithJson) {
|
|
1365
1365
|
const upToDateVersion2 = pinnedVersion || options.force ? null : await resolveUpToDateVersion(plan);
|
|
1366
|
-
|
|
1366
|
+
_chunkFSAOU4HAjs.printCommandEnvelope.call(void 0,
|
|
1367
1367
|
{
|
|
1368
1368
|
...plan,
|
|
1369
1369
|
updated: false,
|
|
@@ -1375,7 +1375,7 @@ async function runUpdateCommand(options, dependencies = {}) {
|
|
|
1375
1375
|
return 0;
|
|
1376
1376
|
}
|
|
1377
1377
|
if (options.printCommand) {
|
|
1378
|
-
|
|
1378
|
+
_chunkFSAOU4HAjs.printCommandEnvelope.call(void 0,
|
|
1379
1379
|
{
|
|
1380
1380
|
...plan,
|
|
1381
1381
|
render: {
|
|
@@ -1388,7 +1388,7 @@ async function runUpdateCommand(options, dependencies = {}) {
|
|
|
1388
1388
|
return 0;
|
|
1389
1389
|
}
|
|
1390
1390
|
if (plan.kind === "source" || plan.kind === "homebrew") {
|
|
1391
|
-
|
|
1391
|
+
_chunkFSAOU4HAjs.printCommandEnvelope.call(void 0, { ...plan, render }, { json: false });
|
|
1392
1392
|
return 0;
|
|
1393
1393
|
}
|
|
1394
1394
|
const upToDateVersion = pinnedVersion || options.force ? null : await resolveUpToDateVersion(plan);
|
|
@@ -1426,7 +1426,7 @@ To retry with full installer output, run: deepline skills install
|
|
|
1426
1426
|
);
|
|
1427
1427
|
}
|
|
1428
1428
|
if (options.executeWithJson && options.json) {
|
|
1429
|
-
|
|
1429
|
+
_chunkFSAOU4HAjs.printCommandEnvelope.call(void 0,
|
|
1430
1430
|
{
|
|
1431
1431
|
ok: true,
|
|
1432
1432
|
pinnedVersion,
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
var _chunkD3BCSAN7js = require('./chunk-D3BCSAN7.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkS4MDYDCFjs = require('./chunk-S4MDYDCF.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkFSAOU4HAjs = require('./chunk-FSAOU4HA.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkWVS2ITKPjs = require('./chunk-WVS2ITKP.js');
|
|
16
16
|
|
|
17
17
|
// src/cli/commands/search.ts
|
|
18
18
|
var _commander = require('commander');
|
|
@@ -22,7 +22,7 @@ var _fs = require('fs');
|
|
|
22
22
|
var _path = require('path');
|
|
23
23
|
var SEARCH_REF_TTL_MS = 15 * 6e4;
|
|
24
24
|
function lastSearchPath() {
|
|
25
|
-
return _path.join.call(void 0,
|
|
25
|
+
return _path.join.call(void 0, _chunkWVS2ITKPjs.sdkCliStateDirPath.call(void 0, _chunkWVS2ITKPjs.resolveConfig.call(void 0, ).baseUrl), "last-search.json");
|
|
26
26
|
}
|
|
27
27
|
function rememberSearchRef(searchRef) {
|
|
28
28
|
writeSearchRefs({ searchRef });
|
|
@@ -132,9 +132,9 @@ async function runSearch(queryInputs, options, types, exclude = []) {
|
|
|
132
132
|
console.error("--summary-width must be an integer of at least 2.");
|
|
133
133
|
return 1;
|
|
134
134
|
}
|
|
135
|
-
const client = new (0,
|
|
135
|
+
const client = new (0, _chunkS4MDYDCFjs.DeeplineClient)();
|
|
136
136
|
const json = options.json === true;
|
|
137
|
-
const renderer = json ? void 0 : await Promise.resolve().then(() => _interopRequireWildcard(require("./search-output-
|
|
137
|
+
const renderer = json ? void 0 : await Promise.resolve().then(() => _interopRequireWildcard(require("./search-output-NUGUU7VJ.js")));
|
|
138
138
|
const searches = [];
|
|
139
139
|
const chunks = [];
|
|
140
140
|
const refs = /* @__PURE__ */ new Map();
|
|
@@ -157,7 +157,7 @@ async function runSearch(queryInputs, options, types, exclude = []) {
|
|
|
157
157
|
const text = _optionalChain([renderer, 'optionalAccess', _12 => _12.renderSearchResults, 'call', _13 => _13(result, summaryWidth)]);
|
|
158
158
|
if (!multiple) {
|
|
159
159
|
if (searchRef) rememberSearchRef(searchRef);
|
|
160
|
-
|
|
160
|
+
_chunkFSAOU4HAjs.printCommandEnvelope.call(void 0, result, { json, text });
|
|
161
161
|
return 0;
|
|
162
162
|
}
|
|
163
163
|
searches.push({ ...result, query });
|
|
@@ -171,8 +171,8 @@ ${text}`);
|
|
|
171
171
|
}
|
|
172
172
|
} catch (error) {
|
|
173
173
|
if (!multiple) throw error;
|
|
174
|
-
const payload =
|
|
175
|
-
const queryExitCode = _nullishCoalesce(payload.exitCode, () => (
|
|
174
|
+
const payload = _chunkFSAOU4HAjs.errorToJsonPayload.call(void 0, error);
|
|
175
|
+
const queryExitCode = _nullishCoalesce(payload.exitCode, () => ( _chunkFSAOU4HAjs.resolveSdkCliFailureExitCode.call(void 0, error)));
|
|
176
176
|
searches.push({ ...payload, query, exitCode: queryExitCode });
|
|
177
177
|
if (!json) {
|
|
178
178
|
console.error(`${JSON.stringify(query)}: ${payload.error.message}`);
|
|
@@ -184,7 +184,7 @@ Search failed.
|
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
rememberSearchRefsByTool(refs);
|
|
187
|
-
|
|
187
|
+
_chunkFSAOU4HAjs.printCommandEnvelope.call(void 0,
|
|
188
188
|
{ searches },
|
|
189
189
|
{
|
|
190
190
|
json,
|
|
@@ -1001,6 +1001,13 @@ Input:
|
|
|
1001
1001
|
names in the error.
|
|
1002
1002
|
--oauth prints an authorization URL. Open it in a browser signed into the
|
|
1003
1003
|
same Deepline org and finish provider consent.
|
|
1004
|
+
Credentials and OAuth write the selected workspace's own connection when a
|
|
1005
|
+
workspace is selected (global --workspace, DEEPLINE_WORKSPACE_ID, or the one
|
|
1006
|
+
saved with deepline org workspace set); other workspaces keep theirs. With
|
|
1007
|
+
no workspace selected they write the org default, which every workspace
|
|
1008
|
+
without its own connection uses. --org-default writes the org default even
|
|
1009
|
+
when a workspace is selected. --managed keys are org-wide, so inside a
|
|
1010
|
+
selected workspace --managed requires --org-default.
|
|
1004
1011
|
HubSpot: --preset read-crm, update-crm, marketing, sales-sequences, tickets, or all.
|
|
1005
1012
|
all requests every supported capability, including write and admin access.
|
|
1006
1013
|
For custom access use comma-separated --scopes and --optional-scopes instead
|
|
@@ -1010,9 +1017,12 @@ Input:
|
|
|
1010
1017
|
Output:
|
|
1011
1018
|
Link: dashboard URL, or {provider, connect_url} with --json. Share connect_url
|
|
1012
1019
|
with the org owner or admin who will finish setup in the browser.
|
|
1013
|
-
Credentials: confirmation without secret
|
|
1014
|
-
|
|
1015
|
-
|
|
1020
|
+
Credentials: confirmation naming the workspace written, without secret
|
|
1021
|
+
values; {provider, credential_saved, team_id} with --json (team_id null is
|
|
1022
|
+
the org default).
|
|
1023
|
+
OAuth: URL and the workspace it connects, or {provider, redirect_url,
|
|
1024
|
+
team_id} with --json. This does not confirm a completed connection. The
|
|
1025
|
+
browser must finish authorization.
|
|
1016
1026
|
--dry-run prints the proposed setup without starting OAuth, reading secret
|
|
1017
1027
|
file contents, or saving credentials.
|
|
1018
1028
|
Cost:
|
|
@@ -1020,6 +1030,8 @@ Cost:
|
|
|
1020
1030
|
Examples:
|
|
1021
1031
|
deepline integrations connect hubspot --link --json
|
|
1022
1032
|
deepline integrations connect heyreach --credentials-file ./heyreach.json
|
|
1033
|
+
deepline --workspace <workspace-id> integrations connect heyreach --credentials-file ./heyreach.json
|
|
1034
|
+
deepline integrations connect heyreach --credentials-file ./heyreach.json --org-default
|
|
1023
1035
|
deepline integrations connect hubspot --oauth --preset read-crm
|
|
1024
1036
|
deepline integrations connect lusha --managed --accept-terms 2026-05-01 --company-domain acme.com --company-legal-name "Acme Inc." --company-country US
|
|
1025
1037
|
`
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
} from "./chunk-5AEDYVB6.mjs";
|
|
4
4
|
import {
|
|
5
5
|
DeeplineClient
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-45OTCUAC.mjs";
|
|
7
7
|
import {
|
|
8
8
|
errorToJsonPayload,
|
|
9
9
|
printCommandEnvelope,
|
|
10
10
|
resolveSdkCliFailureExitCode
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-P2LVKWU6.mjs";
|
|
12
12
|
import {
|
|
13
13
|
resolveConfig,
|
|
14
14
|
sdkCliStateDirPath
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-D3BJ2KZX.mjs";
|
|
16
16
|
|
|
17
17
|
// src/cli/commands/search.ts
|
|
18
18
|
import { Option } from "commander";
|
|
@@ -134,7 +134,7 @@ async function runSearch(queryInputs, options, types, exclude = []) {
|
|
|
134
134
|
}
|
|
135
135
|
const client = new DeeplineClient();
|
|
136
136
|
const json = options.json === true;
|
|
137
|
-
const renderer = json ? void 0 : await import("./search-output-
|
|
137
|
+
const renderer = json ? void 0 : await import("./search-output-DUA3WDB7.mjs");
|
|
138
138
|
const searches = [];
|
|
139
139
|
const chunks = [];
|
|
140
140
|
const refs = /* @__PURE__ */ new Map();
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
resolveApiKeyForBaseUrl,
|
|
5
5
|
resolveCliCommandContext,
|
|
6
6
|
resolveConfig
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-D3BJ2KZX.mjs";
|
|
8
8
|
import {
|
|
9
9
|
SDK_VERSION,
|
|
10
10
|
agentSessionIdFromEnvironment,
|
|
11
11
|
deploymentProtectionHeaders,
|
|
12
12
|
detectAgentRuntime,
|
|
13
13
|
readToolFailureHint
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-IEOIGU5A.mjs";
|
|
15
15
|
import {
|
|
16
16
|
DeeplineError,
|
|
17
17
|
normalizeToolExecutionFailure,
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkS4MDYDCFjs = require('./chunk-S4MDYDCF.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkFSAOU4HAjs = require('./chunk-FSAOU4HA.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkWVS2ITKPjs = require('./chunk-WVS2ITKP.js');
|
|
7
10
|
|
|
8
11
|
// src/cli/commands/integration-commands.ts
|
|
9
12
|
var _commander = require('commander');
|
|
10
13
|
var _fs = require('fs');
|
|
11
14
|
var _path = require('path');
|
|
12
15
|
function printIntegrationResult(value, json, lines, nextCursor) {
|
|
13
|
-
|
|
16
|
+
_chunkFSAOU4HAjs.printCommandEnvelope.call(void 0,
|
|
14
17
|
{},
|
|
15
18
|
{
|
|
16
19
|
json: json || void 0,
|
|
@@ -26,7 +29,7 @@ function registerIntegrationBalanceCommand(parent, hidden = false) {
|
|
|
26
29
|
return parent.command("balance <provider>", { hidden }).description(
|
|
27
30
|
"Read a fresh balance using this org\u2019s own provider connection (LeadMagic)."
|
|
28
31
|
).option("--json", "Print the balance and observation timestamp as JSON").action(async (provider, options) => {
|
|
29
|
-
const balance = await new (0,
|
|
32
|
+
const balance = await new (0, _chunkS4MDYDCFjs.DeeplineClient)().getIntegrationBalance(
|
|
30
33
|
provider
|
|
31
34
|
);
|
|
32
35
|
printIntegrationResult(balance, options.json, [
|
|
@@ -40,7 +43,7 @@ function registerWorkspaceConnectionListCommand(parent, name = "workspace-connec
|
|
|
40
43
|
"List teammates\u2019 personal connections for this provider"
|
|
41
44
|
).option("--cursor <cursor>", "Read the next page of members").action(
|
|
42
45
|
async (options) => {
|
|
43
|
-
const client = new (0,
|
|
46
|
+
const client = new (0, _chunkS4MDYDCFjs.DeeplineClient)();
|
|
44
47
|
if (name === "list" && options.cursor && !options.members)
|
|
45
48
|
throw new Error(
|
|
46
49
|
"Use --cursor with --members to continue a member page."
|
|
@@ -82,7 +85,7 @@ function registerWorkspaceConnectionListCommand(parent, name = "workspace-connec
|
|
|
82
85
|
}
|
|
83
86
|
function registerLegacyHubSpotMembersCommand(parent, hidden = false) {
|
|
84
87
|
return parent.command("hubspot-members", { hidden }).description("List personal HubSpot connection status for org members.").option("--cursor <cursor>", "Read the next roster page").option("--json", "Print the roster page as JSON").action(async (options) => {
|
|
85
|
-
const page = await new (0,
|
|
88
|
+
const page = await new (0, _chunkS4MDYDCFjs.DeeplineClient)().listPersonalHubSpotMembers(
|
|
86
89
|
options.cursor
|
|
87
90
|
);
|
|
88
91
|
const rows = page.members.map((member) => {
|
|
@@ -108,7 +111,7 @@ function registerLegacyWorkspaceConnectionCommand(parent, hidden = false) {
|
|
|
108
111
|
);
|
|
109
112
|
if (options.autoName && (action !== "connect" || options.name !== void 0))
|
|
110
113
|
throw new Error("Use --auto-name with connect and omit --name.");
|
|
111
|
-
const client = new (0,
|
|
114
|
+
const client = new (0, _chunkS4MDYDCFjs.DeeplineClient)();
|
|
112
115
|
const { connections } = action === "connect" ? { connections: [] } : options.name ? await client.listWorkspaceConnectionInventory(provider) : await client.listWorkspaceIntegrationConnections();
|
|
113
116
|
const row = connections.find(
|
|
114
117
|
(connection) => connection.provider === provider && (!("type" in connection) || connection.type === "oauth") && (options.name === void 0 || "name" in connection && connection.name === options.name)
|
|
@@ -141,7 +144,7 @@ function registerLegacyCalendarDelegationCommand(parent, hidden = false) {
|
|
|
141
144
|
"Print the proposed change without contacting Google or saving it"
|
|
142
145
|
).option("--json", "Print the result as JSON").action(
|
|
143
146
|
async (action, options) => {
|
|
144
|
-
const client = new (0,
|
|
147
|
+
const client = new (0, _chunkS4MDYDCFjs.DeeplineClient)();
|
|
145
148
|
if (action === "list") {
|
|
146
149
|
const inventory = await client.listCalendarAvailabilityConnections();
|
|
147
150
|
const approvals = _optionalChain([inventory, 'access', _3 => _3.approvals, 'optionalAccess', _4 => _4.length]) ? inventory.approvals.map(
|
|
@@ -291,7 +294,7 @@ function registerLegacyCalendarDelegationCommand(parent, hidden = false) {
|
|
|
291
294
|
}
|
|
292
295
|
function registerLegacyAvailabilityCalendarsCommand(parent, hidden = false) {
|
|
293
296
|
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) => {
|
|
294
|
-
const page = await new (0,
|
|
297
|
+
const page = await new (0, _chunkS4MDYDCFjs.DeeplineClient)().listAvailabilityCalendars(
|
|
295
298
|
options.cursor
|
|
296
299
|
);
|
|
297
300
|
printIntegrationResult(page, options.json, [
|
|
@@ -329,7 +332,12 @@ function registerIntegrationConnectCommand(parent, defaultLink = false, hidden =
|
|
|
329
332
|
).option(
|
|
330
333
|
"--credentials-file <path>",
|
|
331
334
|
"JSON object of credential field names and string values; keep this file private"
|
|
332
|
-
).option("--oauth", "Return an OAuth authorization URL").addOption(
|
|
335
|
+
).option("--oauth", "Return an OAuth authorization URL").addOption(
|
|
336
|
+
new (0, _commander.Option)(
|
|
337
|
+
"--org-default",
|
|
338
|
+
"Write the org default even when a workspace is selected"
|
|
339
|
+
).conflicts(["link"])
|
|
340
|
+
).addOption(new (0, _commander.Option)("--expected-connection-id <id>").hideHelp()).option("--preset <id>", "Server-defined access preset (HubSpot only)").option("--scopes <scopes>", "Comma-separated OAuth scopes").option(
|
|
333
341
|
"--optional-scopes <scopes>",
|
|
334
342
|
"Comma-separated optional OAuth scopes"
|
|
335
343
|
).option(
|
|
@@ -349,11 +357,14 @@ function registerIntegrationConnectCommand(parent, defaultLink = false, hidden =
|
|
|
349
357
|
"--managed requires --company-domain, --company-legal-name and --company-country."
|
|
350
358
|
);
|
|
351
359
|
}
|
|
360
|
+
const teamId2 = connectTeamId(options.orgDefault);
|
|
361
|
+
refuseManagedWorkspaceConnect(provider, teamId2);
|
|
352
362
|
if (options.dryRun) {
|
|
353
363
|
printSetupPlan(
|
|
354
364
|
{
|
|
355
365
|
provider,
|
|
356
366
|
action: "connect_managed",
|
|
367
|
+
team_id: teamId2,
|
|
357
368
|
terms_version: _nullishCoalesce(options.acceptTerms, () => ( "not accepted")),
|
|
358
369
|
company_domain: options.companyDomain
|
|
359
370
|
},
|
|
@@ -361,7 +372,7 @@ function registerIntegrationConnectCommand(parent, defaultLink = false, hidden =
|
|
|
361
372
|
);
|
|
362
373
|
return;
|
|
363
374
|
}
|
|
364
|
-
const result2 = await new (0,
|
|
375
|
+
const result2 = await new (0, _chunkS4MDYDCFjs.DeeplineClient)().connectManagedIntegration(
|
|
365
376
|
provider,
|
|
366
377
|
{
|
|
367
378
|
termsVersion: options.acceptTerms,
|
|
@@ -380,10 +391,11 @@ function registerIntegrationConnectCommand(parent, defaultLink = false, hidden =
|
|
|
380
391
|
const confirmation2 = {
|
|
381
392
|
provider,
|
|
382
393
|
credential_saved: true,
|
|
383
|
-
credential_mode: "partner_managed"
|
|
394
|
+
credential_mode: "partner_managed",
|
|
395
|
+
team_id: teamId2
|
|
384
396
|
};
|
|
385
397
|
printIntegrationResult(confirmation2, options.json, [
|
|
386
|
-
`${provider} is connected
|
|
398
|
+
`${provider} is connected with a Deepline-managed key for ${describeConnectTarget(teamId2)}. Usage is billed in Deepline credits.`
|
|
387
399
|
]);
|
|
388
400
|
return;
|
|
389
401
|
}
|
|
@@ -397,7 +409,7 @@ function registerIntegrationConnectCommand(parent, defaultLink = false, hidden =
|
|
|
397
409
|
printSetupPlan({ provider, action: "connect_link" }, options.json);
|
|
398
410
|
return;
|
|
399
411
|
}
|
|
400
|
-
const link = await new (0,
|
|
412
|
+
const link = await new (0, _chunkS4MDYDCFjs.DeeplineClient)().getIntegrationConnectLink(
|
|
401
413
|
provider
|
|
402
414
|
);
|
|
403
415
|
printIntegrationResult(link, options.json, [link.connect_url]);
|
|
@@ -411,11 +423,14 @@ function registerIntegrationConnectCommand(parent, defaultLink = false, hidden =
|
|
|
411
423
|
const splitScopes = (value) => value.split(",").map((scope) => scope.trim()).filter(Boolean);
|
|
412
424
|
if (options.scopes !== void 0 && splitScopes(options.scopes).length === 0)
|
|
413
425
|
throw new Error("scopes must contain at least one OAuth scope.");
|
|
426
|
+
const teamId2 = connectTeamId(options.orgDefault);
|
|
427
|
+
refuseMetaWorkspaceConnect(provider, teamId2);
|
|
414
428
|
if (options.dryRun) {
|
|
415
429
|
printSetupPlan(
|
|
416
430
|
{
|
|
417
431
|
provider,
|
|
418
432
|
action: "oauth",
|
|
433
|
+
team_id: teamId2,
|
|
419
434
|
...options.preset !== void 0 ? { preset: options.preset } : {},
|
|
420
435
|
...options.scopes !== void 0 ? { scopes: splitScopes(options.scopes) } : {},
|
|
421
436
|
...options.optionalScopes !== void 0 ? { optionalScopes: splitScopes(options.optionalScopes) } : {}
|
|
@@ -424,22 +439,31 @@ function registerIntegrationConnectCommand(parent, defaultLink = false, hidden =
|
|
|
424
439
|
);
|
|
425
440
|
return;
|
|
426
441
|
}
|
|
427
|
-
const result2 = await new (0,
|
|
442
|
+
const result2 = await new (0, _chunkS4MDYDCFjs.DeeplineClient)().startIntegrationOAuth(
|
|
428
443
|
provider,
|
|
429
444
|
{
|
|
430
445
|
...options.preset !== void 0 ? { preset: options.preset } : {},
|
|
431
446
|
...options.scopes !== void 0 ? { scopes: splitScopes(options.scopes) } : {},
|
|
432
|
-
...options.optionalScopes !== void 0 ? { optionalScopes: splitScopes(options.optionalScopes) } : {}
|
|
447
|
+
...options.optionalScopes !== void 0 ? { optionalScopes: splitScopes(options.optionalScopes) } : {},
|
|
448
|
+
teamId: teamId2
|
|
433
449
|
}
|
|
434
450
|
);
|
|
451
|
+
const confirmed2 = assertConnectTarget(result2, teamId2);
|
|
435
452
|
if (!result2.ok || typeof result2.redirect_url !== "string" || !result2.redirect_url)
|
|
436
453
|
throw new Error(
|
|
437
454
|
"The API did not return an OAuth authorization URL."
|
|
438
455
|
);
|
|
439
456
|
printIntegrationResult(
|
|
440
|
-
{ provider, redirect_url: result2.redirect_url },
|
|
457
|
+
{ provider, redirect_url: result2.redirect_url, team_id: teamId2 },
|
|
441
458
|
options.json,
|
|
442
|
-
[
|
|
459
|
+
[
|
|
460
|
+
result2.redirect_url,
|
|
461
|
+
connectTargetLine(
|
|
462
|
+
`This connects ${provider} for`,
|
|
463
|
+
teamId2,
|
|
464
|
+
confirmed2
|
|
465
|
+
)
|
|
466
|
+
]
|
|
443
467
|
);
|
|
444
468
|
return;
|
|
445
469
|
}
|
|
@@ -447,11 +471,14 @@ function registerIntegrationConnectCommand(parent, defaultLink = false, hidden =
|
|
|
447
471
|
throw new Error(
|
|
448
472
|
"Use --link for a dashboard link, --credentials-file to save credentials, or --oauth to request access."
|
|
449
473
|
);
|
|
474
|
+
const teamId = connectTeamId(options.orgDefault);
|
|
475
|
+
refuseMetaWorkspaceConnect(provider, teamId);
|
|
450
476
|
if (options.dryRun) {
|
|
451
477
|
printSetupPlan(
|
|
452
478
|
{
|
|
453
479
|
provider,
|
|
454
480
|
action: "save_credentials",
|
|
481
|
+
team_id: teamId,
|
|
455
482
|
credentials_file: options.credentialsFile,
|
|
456
483
|
...options.expectedConnectionId ? { expected_connection_id: options.expectedConnectionId } : {}
|
|
457
484
|
},
|
|
@@ -474,23 +501,69 @@ function registerIntegrationConnectCommand(parent, defaultLink = false, hidden =
|
|
|
474
501
|
"--credentials-file must contain a nonempty JSON object of string credential values."
|
|
475
502
|
);
|
|
476
503
|
}
|
|
477
|
-
const result = await new (0,
|
|
504
|
+
const result = await new (0, _chunkS4MDYDCFjs.DeeplineClient)().setIntegrationCredentials(
|
|
478
505
|
provider,
|
|
479
506
|
credentials,
|
|
480
|
-
{ expectedConnectionId: options.expectedConnectionId }
|
|
507
|
+
{ expectedConnectionId: options.expectedConnectionId, teamId }
|
|
481
508
|
);
|
|
482
509
|
if (!result.ok || result.credential_saved !== true) {
|
|
483
510
|
throw new Error(
|
|
484
511
|
"The API did not confirm that provider credentials were saved. Inspect the integration before retrying."
|
|
485
512
|
);
|
|
486
513
|
}
|
|
487
|
-
const
|
|
514
|
+
const confirmed = assertConnectTarget(result, teamId);
|
|
515
|
+
const confirmation = {
|
|
516
|
+
provider,
|
|
517
|
+
credential_saved: true,
|
|
518
|
+
team_id: teamId
|
|
519
|
+
};
|
|
488
520
|
printIntegrationResult(confirmation, options.json, [
|
|
489
|
-
|
|
521
|
+
connectTargetLine(
|
|
522
|
+
`Credentials saved for ${provider} in`,
|
|
523
|
+
teamId,
|
|
524
|
+
confirmed
|
|
525
|
+
)
|
|
490
526
|
]);
|
|
491
527
|
}
|
|
492
528
|
);
|
|
493
529
|
}
|
|
530
|
+
function connectTeamId(orgDefault) {
|
|
531
|
+
if (orgDefault) return null;
|
|
532
|
+
try {
|
|
533
|
+
return _nullishCoalesce(_chunkWVS2ITKPjs.resolveConfig.call(void 0, ).workspace, () => ( null));
|
|
534
|
+
} catch (e2) {
|
|
535
|
+
return _optionalChain([process, 'access', _9 => _9.env, 'access', _10 => _10.DEEPLINE_WORKSPACE_ID, 'optionalAccess', _11 => _11.trim, 'call', _12 => _12()]) || null;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
function describeConnectTarget(teamId) {
|
|
539
|
+
return teamId ? `workspace ${teamId} (its own connection; other workspaces are unchanged)` : "the org default (used by every workspace without its own connection)";
|
|
540
|
+
}
|
|
541
|
+
function assertConnectTarget(result, teamId) {
|
|
542
|
+
if (!("team_id" in result)) return false;
|
|
543
|
+
if ((_nullishCoalesce(result.team_id, () => ( null))) !== teamId) {
|
|
544
|
+
throw new Error(
|
|
545
|
+
`The API wrote ${describeConnectTarget(_nullishCoalesce(result.team_id, () => ( null)))}, not ${describeConnectTarget(teamId)}. Inspect the integration before retrying.`
|
|
546
|
+
);
|
|
547
|
+
}
|
|
548
|
+
return true;
|
|
549
|
+
}
|
|
550
|
+
function connectTargetLine(prefix, teamId, confirmed) {
|
|
551
|
+
if (confirmed) return `${prefix} ${describeConnectTarget(teamId)}.`;
|
|
552
|
+
const requested = teamId ? `workspace ${teamId}` : "the org default";
|
|
553
|
+
return `${prefix} ${requested} (requested; this server did not confirm the target).`;
|
|
554
|
+
}
|
|
555
|
+
function refuseMetaWorkspaceConnect(provider, teamId) {
|
|
556
|
+
if (provider !== "meta_audiences" || !teamId) return;
|
|
557
|
+
throw new Error(
|
|
558
|
+
`Meta Audiences connects workspace ${teamId} with a system user token: run \`deepline org workspaces integrations set ${teamId} meta_audiences --api-key-stdin\`, or pass --org-default to connect the org default.`
|
|
559
|
+
);
|
|
560
|
+
}
|
|
561
|
+
function refuseManagedWorkspaceConnect(provider, teamId) {
|
|
562
|
+
if (!teamId) return;
|
|
563
|
+
throw new Error(
|
|
564
|
+
`A Deepline-managed ${provider} key is set up for the whole org, not workspace ${teamId}. Pass --org-default to connect the org default, or --credentials-file to give this workspace its own key.`
|
|
565
|
+
);
|
|
566
|
+
}
|
|
494
567
|
function printSetupPlan(plan, json) {
|
|
495
568
|
printIntegrationResult(
|
|
496
569
|
plan,
|