deepline 0.3.559 → 0.3.561
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 +14 -0
- package/dist/bundling-sources/sdk/src/index.ts +2 -0
- package/dist/bundling-sources/sdk/src/integrations.ts +62 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +4 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox-egress.ts +57 -2
- package/dist/cli/auth-3NPCF7CL.js +44 -0
- package/dist/cli/{auth-D6S6E7BL.mjs → auth-3WPN7C5X.mjs} +5 -5
- package/dist/cli/{billing-7YRVKWAU.js → billing-DOHRRK73.js} +102 -102
- package/dist/cli/{billing-3BNTAYUY.mjs → billing-NCTL4WRP.mjs} +9 -9
- package/dist/cli/{chunk-OJ3FRPEP.js → chunk-2YNYWHBI.js} +10 -10
- package/dist/cli/{chunk-G7IGOVPF.js → chunk-3CZLPUBB.js} +20 -20
- package/dist/cli/{chunk-K5BZF2VO.js → chunk-3VBYUQ4G.js} +9 -9
- package/dist/cli/{chunk-VZKBLSTA.mjs → chunk-42RBMROP.mjs} +2 -2
- package/dist/cli/{chunk-PQ52YTDB.js → chunk-4OITRR2V.js} +13 -13
- package/dist/cli/{chunk-YI4ADWTN.js → chunk-5CNHEUGJ.js} +12 -2
- package/dist/cli/{chunk-XXZDT3U7.mjs → chunk-5FJGP5NZ.mjs} +2 -2
- package/dist/cli/{chunk-SSE5P2CX.js → chunk-5TWCVY3S.js} +12 -12
- package/dist/cli/{chunk-EEUJNR5K.js → chunk-65L4IL3E.js} +6 -6
- package/dist/cli/{chunk-A4KQZ6P5.js → chunk-6EJOADKB.js} +206 -180
- package/dist/cli/{chunk-URACGTQE.mjs → chunk-7HGJKBNU.mjs} +1 -1
- package/dist/cli/{chunk-LTCV5BI2.mjs → chunk-AEIRQFS3.mjs} +1 -1
- package/dist/cli/{chunk-YE7OCVI5.js → chunk-AH5T5LX2.js} +26 -26
- package/dist/cli/{chunk-YODGCJPX.mjs → chunk-BIIKWKTD.mjs} +2 -2
- package/dist/cli/{chunk-UA2VLWZH.mjs → chunk-CCRGOHC2.mjs} +2 -2
- package/dist/cli/{chunk-IUDO463I.js → chunk-CUU5CL3V.js} +20 -20
- package/dist/cli/{chunk-QQ6AVBHW.js → chunk-DSOQL4ZF.js} +23 -23
- package/dist/cli/{chunk-3MVBZ4XI.mjs → chunk-EAU5JJXS.mjs} +5 -5
- package/dist/cli/{chunk-53HQJS6D.mjs → chunk-EN36QYE7.mjs} +1 -1
- package/dist/cli/{chunk-2YQGXPQ7.js → chunk-F5XQN6PU.js} +2 -2
- package/dist/cli/{chunk-YFUFYV4M.mjs → chunk-GCBXXN4P.mjs} +5 -5
- package/dist/cli/{chunk-P2DFD2NG.mjs → chunk-GITMBBDH.mjs} +1 -1
- package/dist/cli/{chunk-XPS2UBYV.mjs → chunk-GPGNBG3E.mjs} +3 -3
- package/dist/cli/{chunk-FHMGNUOP.mjs → chunk-HLWNMRSF.mjs} +1 -1
- package/dist/cli/{chunk-WZUOUQZ3.js → chunk-HSRYGNCA.js} +3 -3
- package/dist/cli/{chunk-KGCY3MSS.mjs → chunk-I4FFGMIQ.mjs} +5 -5
- package/dist/cli/{chunk-PZUBDHQ7.mjs → chunk-IEVV72X5.mjs} +4 -4
- package/dist/cli/{chunk-ZMC5FEJN.mjs → chunk-JKBSEUFN.mjs} +2 -2
- package/dist/cli/{chunk-MPEMAGZS.mjs → chunk-JNI4353Z.mjs} +11 -11
- package/dist/cli/{chunk-D7DXRFM2.mjs → chunk-JRQDDQLZ.mjs} +1 -1
- package/dist/cli/{chunk-TPLISQND.js → chunk-JV3WBT3X.js} +5 -5
- package/dist/cli/{chunk-TIMFDVUN.js → chunk-K72PGYSH.js} +48 -48
- package/dist/cli/{chunk-KACD2TYW.mjs → chunk-LRQZ2XO5.mjs} +2 -2
- package/dist/cli/{chunk-EYL4V32Q.js → chunk-M4ZL2H5B.js} +4 -4
- package/dist/cli/{chunk-MJ4JEJLL.mjs → chunk-MTD7OXGL.mjs} +150 -124
- package/dist/cli/{chunk-JUTXZW3S.js → chunk-NGIQXZIE.js} +7 -7
- package/dist/cli/{chunk-II33OPIO.mjs → chunk-O5TXP65R.mjs} +1 -1
- package/dist/cli/{chunk-GETMCDVX.mjs → chunk-OBQOFQX2.mjs} +5 -5
- package/dist/cli/{chunk-XNN45XYF.js → chunk-OML66OOS.js} +2 -2
- package/dist/cli/{chunk-JME33A35.js → chunk-OTOID2SE.js} +15 -15
- package/dist/cli/{chunk-24XWLHKJ.js → chunk-PLQ4OMYO.js} +1 -1
- package/dist/cli/{chunk-OFC24U3N.mjs → chunk-PQLQ2YV7.mjs} +2 -2
- package/dist/cli/{chunk-6BJHMXMA.js → chunk-PSXPGRZK.js} +2 -2
- package/dist/cli/{chunk-22Z2U5MW.mjs → chunk-QO5MVJWJ.mjs} +3 -3
- package/dist/cli/{chunk-OSHKFYY4.js → chunk-RSFBTSJZ.js} +41 -41
- package/dist/cli/{chunk-UHIOXXAO.mjs → chunk-S4WTJQEJ.mjs} +1 -1
- package/dist/cli/{chunk-MWZEGRY2.mjs → chunk-SBUFCQ3W.mjs} +2 -2
- package/dist/cli/{chunk-GWS7XJI2.mjs → chunk-T5WVODJY.mjs} +4 -4
- package/dist/cli/{chunk-BTKVXI3G.mjs → chunk-VACBPVIR.mjs} +12 -2
- package/dist/cli/{chunk-LWOYDMYC.js → chunk-X6IDT5II.js} +3 -3
- package/dist/cli/{chunk-QGVOD6Y4.js → chunk-XDTI5HF7.js} +100 -100
- package/dist/cli/{chunk-FDVSB4NF.js → chunk-XFEBBBYA.js} +53 -53
- package/dist/cli/{chunk-GFHBS7HG.js → chunk-XKYNEKG2.js} +5 -5
- package/dist/cli/{chunk-PNFC7VHH.js → chunk-ZFTQYCMB.js} +5 -5
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/concurrent-runs-help-HWDISMIC.js +22 -0
- package/dist/cli/{concurrent-runs-help-FCAZLZNA.mjs → concurrent-runs-help-YGCPBET7.mjs} +6 -6
- package/dist/cli/{csv-BC26EB4B.mjs → csv-FWL7B2BV.mjs} +4 -4
- package/dist/cli/{csv-SCIQKZNH.js → csv-QEDNA7FG.js} +13 -13
- package/dist/cli/{db-RVOPGYKY.mjs → db-RJEX3BRW.mjs} +6 -6
- package/dist/cli/{db-IJRJVIQ3.js → db-SRNS2IET.js} +27 -27
- package/dist/cli/{describe-K7CRL4PA.mjs → describe-N7EFSCTT.mjs} +18 -18
- package/dist/cli/describe-OHO4OETQ.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-IEVLTSXV.js → executions-FVZYM5X7.js} +8 -8
- package/dist/cli/{executions-PDOO2GFK.mjs → executions-UIB2VWM3.mjs} +6 -6
- package/dist/cli/{feedback-7YVUUROQ.mjs → feedback-2UFZ73PJ.mjs} +6 -6
- package/dist/cli/{feedback-KHYOWTXA.js → feedback-4DPMGP54.js} +14 -14
- package/dist/cli/git-6AKXBYB7.js +26 -0
- package/dist/cli/{git-426CAP5S.mjs → git-LBADM335.mjs} +5 -5
- package/dist/cli/index.js +147 -147
- package/dist/cli/index.mjs +46 -46
- package/dist/cli/{integrations-TNJ4IELE.mjs → integrations-2MLNXLEQ.mjs} +40 -7
- package/dist/cli/{integrations-BVHTRN3W.js → integrations-YNXYTLOA.js} +48 -15
- package/dist/cli/{legacy-noops-F73BMPBV.js → legacy-noops-KZ4TWNLG.js} +9 -9
- package/dist/cli/{legacy-noops-2GB35THO.mjs → legacy-noops-MLULOC4E.mjs} +6 -6
- package/dist/cli/{mcp-KMTC7OBK.js → mcp-B3KGTSQW.js} +24 -24
- package/dist/cli/{mcp-BAGMQXNR.mjs → mcp-LBP6ZNGI.mjs} +4 -4
- package/dist/cli/{monitors-O2BUIK7Q.js → monitors-7OB3JGLF.js} +100 -100
- package/dist/cli/{monitors-ECONWLHL.mjs → monitors-IUJPNNJJ.mjs} +7 -7
- package/dist/cli/{org-AEZZBWA3.mjs → org-4BJVKLJ4.mjs} +6 -6
- package/dist/cli/{org-5NQQ4PRU.js → org-ZETP5SLA.js} +121 -121
- package/dist/cli/{outcomes-ZWHAJH5I.mjs → outcomes-4IH5QXAA.mjs} +6 -6
- package/dist/cli/{outcomes-IKEQKAF7.js → outcomes-XZLWT7OK.js} +14 -14
- package/dist/cli/{play-VDWB7FZ5.js → play-KMXUSZ3W.js} +324 -324
- package/dist/cli/{play-BVKLMTAS.mjs → play-QGYAHOX6.mjs} +19 -19
- package/dist/cli/{providers-RXT3Q5Q7.js → providers-A4FNCWOJ.js} +9 -9
- package/dist/cli/{providers-SWRTGKJJ.mjs → providers-LXMG2WMM.mjs} +6 -6
- package/dist/cli/{quickstart-GQVXM7XV.mjs → quickstart-3L4ZMV5Y.mjs} +4 -4
- package/dist/cli/{quickstart-UJJNXI2S.js → quickstart-BRN25JX5.js} +6 -6
- package/dist/cli/{run-WOTVRFGN.js → run-36GX6EWC.js} +44 -44
- package/dist/cli/{run-GDIEU622.mjs → run-P3WFKNPE.mjs} +23 -23
- package/dist/cli/search-EEJ2VPS3.js +32 -0
- package/dist/cli/{search-EWC7V6GT.mjs → search-SEQFDQKQ.mjs} +7 -7
- package/dist/cli/{search-output-FCW4R6Z4.mjs → search-output-I5U5EI75.mjs} +4 -4
- package/dist/cli/{search-output-FL7STAYJ.js → search-output-Y32YHSQ3.js} +6 -6
- package/dist/cli/{secrets-UXDUGONR.js → secrets-DH46W2VF.js} +15 -15
- package/dist/cli/{secrets-XG22PDCR.mjs → secrets-OIXJK4E4.mjs} +6 -6
- package/dist/cli/{sessions-2OKBG7FD.mjs → sessions-OADAVWXU.mjs} +6 -6
- package/dist/cli/sessions-UJVLZK2H.js +23 -0
- package/dist/cli/{settings-EDYA2V4W.mjs → settings-2N5IJ7CZ.mjs} +12 -12
- package/dist/cli/{settings-RWN7YHK3.js → settings-DNJBXD5N.js} +85 -85
- package/dist/cli/{setup-UZW2IHAT.mjs → setup-5LLJ77BQ.mjs} +9 -9
- package/dist/cli/{setup-HA3PG3ST.js → setup-KKZXSKN6.js} +49 -49
- package/dist/cli/skills-HRGWKTL6.js +37 -0
- package/dist/cli/{skills-V4KAUQQA.mjs → skills-U76N7CTT.mjs} +7 -7
- package/dist/cli/{tools-HFUGLYHU.mjs → tools-4US4UIIT.mjs} +17 -17
- package/dist/cli/tools-RTNCLQEP.js +57 -0
- package/dist/cli/{update-S3KEH7P2.mjs → update-AH44HYX7.mjs} +9 -9
- package/dist/cli/update-YY5PZGYJ.js +37 -0
- package/dist/cli/{views-QH5L37UW.js → views-HOCGYKC5.js} +21 -21
- package/dist/cli/{views-Y7Y5Y7V2.mjs → views-YJAFUL2K.mjs} +6 -6
- package/dist/cli/{workflow-XNN54KIK.mjs → workflow-UCVXUIRX.mjs} +7 -7
- package/dist/cli/{workflow-4W5JT5HP.js → workflow-ZNP5BLMJ.js} +17 -17
- package/dist/{client-BoayTB7p.d.ts → client-BSxuaObS.d.ts} +1 -1
- package/dist/{client-1ogYQqUw.d.mts → client-CnphYDTe.d.mts} +1 -1
- package/dist/{client-core-Ch8CXaX4.d.mts → client-core-DQOTt3yV.d.mts} +37 -2
- package/dist/{client-core-DySw9x_E.d.ts → client-core-Yad6-K7-.d.ts} +37 -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-3SBMYRAJ.js +0 -44
- package/dist/cli/concurrent-runs-help-TVQO4USY.js +0 -22
- package/dist/cli/describe-4FBGZZK5.js +0 -50
- package/dist/cli/git-O6A2FVJE.js +0 -26
- package/dist/cli/search-UIZHXBHR.js +0 -32
- package/dist/cli/sessions-DPYJFTCW.js +0 -23
- package/dist/cli/skills-RQ6V5TGY.js +0 -37
- package/dist/cli/tools-NGQKXMHP.js +0 -57
- package/dist/cli/update-SJJK6XXM.js +0 -37
|
@@ -37,7 +37,7 @@ var _chunkPMH4GLMDjs = require('./chunk-PMH4GLMD.js');
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
var
|
|
40
|
+
var _chunkM4ZL2H5Bjs = require('./chunk-M4ZL2H5B.js');
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
var _chunk6VLFQZK6js = require('./chunk-6VLFQZK6.js');
|
|
@@ -48,6 +48,145 @@ var _chunk6VLFQZK6js = require('./chunk-6VLFQZK6.js');
|
|
|
48
48
|
|
|
49
49
|
var _chunkLFQJW4S2js = require('./chunk-LFQJW4S2.js');
|
|
50
50
|
|
|
51
|
+
// src/integrations.ts
|
|
52
|
+
var CALENDAR_PROVIDER = "google_calendar_availability";
|
|
53
|
+
var AD_ACCOUNT_DISCOVERY_PROVIDERS = [
|
|
54
|
+
"google_ads_audiences",
|
|
55
|
+
"linkedin_ads_audiences"
|
|
56
|
+
];
|
|
57
|
+
function invalid(message) {
|
|
58
|
+
throw new (0, _chunkLFQJW4S2js.DeeplineError)(message, 400, "INVALID_ARGUMENT");
|
|
59
|
+
}
|
|
60
|
+
function planAdAccountDiscovery(provider) {
|
|
61
|
+
if (!AD_ACCOUNT_DISCOVERY_PROVIDERS.includes(provider)) {
|
|
62
|
+
invalid(`Choose ${AD_ACCOUNT_DISCOVERY_PROVIDERS.join(" or ")}.`);
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
provider,
|
|
66
|
+
method: "POST",
|
|
67
|
+
path: `/api/v2/integrations/${provider}/accounts`,
|
|
68
|
+
body: {}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
async function findConnection(client, name, provider) {
|
|
72
|
+
const { connections } = await client.listWorkspaceConnectionInventory(
|
|
73
|
+
provider,
|
|
74
|
+
{ authorizationsOnly: true }
|
|
75
|
+
);
|
|
76
|
+
const matches = connections.filter(
|
|
77
|
+
(row) => row.name === name && (!provider || row.provider === provider)
|
|
78
|
+
);
|
|
79
|
+
if (matches.length === 0)
|
|
80
|
+
throw new (0, _chunkLFQJW4S2js.DeeplineError)(
|
|
81
|
+
`No org connection named ${JSON.stringify(name)}. Run deepline integrations list --json.`,
|
|
82
|
+
404,
|
|
83
|
+
"NOT_FOUND"
|
|
84
|
+
);
|
|
85
|
+
if (matches.length > 1)
|
|
86
|
+
invalid("This name exists for multiple providers. Pass --provider.");
|
|
87
|
+
return matches[0];
|
|
88
|
+
}
|
|
89
|
+
async function changeConnection(client, action, name, options) {
|
|
90
|
+
const row = await findConnection(client, name, options.provider);
|
|
91
|
+
if (options.booking && (action !== "reconnect" || row.type !== "workspace_delegation"))
|
|
92
|
+
invalid("Use --booking with Google Workspace verify or reconnect.");
|
|
93
|
+
if (options.listCalendars && (action !== "reconnect" || row.type !== "workspace_delegation"))
|
|
94
|
+
invalid("Use --list-calendars with Google Workspace verify or reconnect.");
|
|
95
|
+
if (row.type === "workspace_delegation") {
|
|
96
|
+
if (row.provider !== CALENDAR_PROVIDER || !row.domain)
|
|
97
|
+
invalid(
|
|
98
|
+
"The Google Workspace approval is missing its provider or domain."
|
|
99
|
+
);
|
|
100
|
+
if (row.authorizationVersion === void 0)
|
|
101
|
+
invalid("The API did not return a Google Workspace approval revision.");
|
|
102
|
+
if (action === "reconnect") {
|
|
103
|
+
return verifyWorkspace(client, row.domain, options, row);
|
|
104
|
+
}
|
|
105
|
+
if (options.verificationEmail)
|
|
106
|
+
invalid("Use --verification-email with reconnect or verify.");
|
|
107
|
+
if (action === "delete" && row.status !== "disconnected")
|
|
108
|
+
invalid("Disconnect this approval before deleting it.");
|
|
109
|
+
const change2 = action === "delete" ? {
|
|
110
|
+
action: "remove_workspace",
|
|
111
|
+
domain: row.domain,
|
|
112
|
+
connectionId: row.id,
|
|
113
|
+
grantRevision: row.authorizationVersion
|
|
114
|
+
} : {
|
|
115
|
+
action: "disable_workspace",
|
|
116
|
+
domain: row.domain,
|
|
117
|
+
connectionId: row.id,
|
|
118
|
+
grantRevision: row.authorizationVersion
|
|
119
|
+
};
|
|
120
|
+
if (options.dryRun) return change2;
|
|
121
|
+
return client.changeCalendarDelegation(change2);
|
|
122
|
+
}
|
|
123
|
+
if (options.verificationEmail)
|
|
124
|
+
invalid("--verification-email applies to Google Workspace approvals.");
|
|
125
|
+
if (row.type !== "oauth" || row.provider !== "hubspot" && row.provider !== CALENDAR_PROVIDER)
|
|
126
|
+
invalid(
|
|
127
|
+
"Manage this credential type through deepline integrations connect <provider> --link."
|
|
128
|
+
);
|
|
129
|
+
if (row.authorizationVersion === void 0)
|
|
130
|
+
invalid("The API did not return a connection authorization version.");
|
|
131
|
+
const change = {
|
|
132
|
+
action: action === "delete" ? "remove" : action,
|
|
133
|
+
provider: row.provider,
|
|
134
|
+
name,
|
|
135
|
+
connectionId: row.id,
|
|
136
|
+
authorizationVersion: row.authorizationVersion
|
|
137
|
+
};
|
|
138
|
+
if (options.dryRun) return change;
|
|
139
|
+
return client.manageWorkspaceIntegrationConnection(change);
|
|
140
|
+
}
|
|
141
|
+
async function verifyWorkspace(client, domain, options, existing) {
|
|
142
|
+
domain = domain.trim().toLowerCase();
|
|
143
|
+
if (!_chunk4WAM6TLDjs.GOOGLE_WORKSPACE_DOMAIN_PATTERN.test(domain))
|
|
144
|
+
invalid("Enter a Google Workspace domain, such as example.com.");
|
|
145
|
+
const email = _optionalChain([options, 'access', _ => _.verificationEmail, 'optionalAccess', _2 => _2.trim, 'call', _3 => _3(), 'access', _4 => _4.toLowerCase, 'call', _5 => _5()]);
|
|
146
|
+
if (!email || email.length > 254 || !/^[^\s@]+@[^\s@]+$/.test(email) || email.split("@")[1] !== domain)
|
|
147
|
+
invalid("Pass --verification-email with a work email in this domain.");
|
|
148
|
+
const settings = existing ? {
|
|
149
|
+
grantRevision: existing.authorizationVersion,
|
|
150
|
+
connectionId: existing.id,
|
|
151
|
+
grantedScopes: existing.scopes
|
|
152
|
+
} : await client.getCalendarDelegation(void 0, void 0, domain);
|
|
153
|
+
if (settings.grantRevision === void 0)
|
|
154
|
+
invalid("The API did not return a Google Workspace approval revision.");
|
|
155
|
+
const requestedScopes = [
|
|
156
|
+
.../* @__PURE__ */ new Set([
|
|
157
|
+
_chunk4WAM6TLDjs.GOOGLE_WORKSPACE_AVAILABILITY_SCOPE,
|
|
158
|
+
..._nullishCoalesce(settings.grantedScopes, () => ( [])),
|
|
159
|
+
...options.booking ? [_chunk4WAM6TLDjs.GOOGLE_WORKSPACE_BOOKING_SCOPE] : [],
|
|
160
|
+
...options.listCalendars ? [_chunk4WAM6TLDjs.GOOGLE_WORKSPACE_CALENDAR_LIST_SCOPE] : []
|
|
161
|
+
])
|
|
162
|
+
];
|
|
163
|
+
const change = {
|
|
164
|
+
action: "enable_workspace",
|
|
165
|
+
domain,
|
|
166
|
+
grantRevision: settings.grantRevision,
|
|
167
|
+
...settings.connectionId ? { connectionId: settings.connectionId } : {},
|
|
168
|
+
verificationEmail: email,
|
|
169
|
+
...requestedScopes.length > 1 ? { requestedScopes } : {}
|
|
170
|
+
};
|
|
171
|
+
if (options.dryRun) return change;
|
|
172
|
+
return client.changeCalendarDelegation(change);
|
|
173
|
+
}
|
|
174
|
+
function createIntegrationsNamespace(client) {
|
|
175
|
+
return {
|
|
176
|
+
list: (options = {}) => client.listWorkspaceConnectionInventory(options.provider, {
|
|
177
|
+
authorizationsOnly: true
|
|
178
|
+
}),
|
|
179
|
+
get: (name, options = {}) => findConnection(client, name, options.provider),
|
|
180
|
+
connect: (provider) => client.getIntegrationConnectLink(provider),
|
|
181
|
+
discoverAdAccounts: (provider) => client.discoverAdAccounts(provider),
|
|
182
|
+
reconnect: (name, options = {}) => changeConnection(client, "reconnect", name, options),
|
|
183
|
+
disconnect: (name, options = {}) => changeConnection(client, "disconnect", name, options),
|
|
184
|
+
delete: (name, options = {}) => changeConnection(client, "delete", name, options),
|
|
185
|
+
verify: (domain, options) => verifyWorkspace(client, domain, options),
|
|
186
|
+
members: (provider, options = {}) => client.listManagedConnectionMembers(provider, options.cursor)
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
|
|
51
190
|
// ../integration-contracts/billing-plan-skus.ts
|
|
52
191
|
var PLAN_OFFER_SKUS = {
|
|
53
192
|
solo: "payg-v1",
|
|
@@ -166,7 +305,7 @@ async function queryCustomerDatabase(http, input, maxRetries) {
|
|
|
166
305
|
}
|
|
167
306
|
);
|
|
168
307
|
} catch (error) {
|
|
169
|
-
if (error instanceof _chunkLFQJW4S2js.DeeplineError && (_optionalChain([error, 'access',
|
|
308
|
+
if (error instanceof _chunkLFQJW4S2js.DeeplineError && (_optionalChain([error, 'access', _6 => _6.code, 'optionalAccess', _7 => _7.startsWith, 'call', _8 => _8("NETWORK_")]) || // Older API readers return PostgreSQL errors as HTTP 400, including
|
|
170
309
|
// lost connections and explicitly unknown transaction resolution.
|
|
171
310
|
/^08[A-Z0-9]{3}$/.test(_nullishCoalesce(error.code, () => ( ""))) || ["57P01", "57P02", "57P03"].includes(_nullishCoalesce(error.code, () => ( ""))) || error.statusCode === 408 || (_nullishCoalesce(error.statusCode, () => ( 0))) >= 500)) {
|
|
172
311
|
throw new (0, _chunk6VLFQZK6js.CustomerDbQueryOutcomeUnknownError)(
|
|
@@ -365,7 +504,7 @@ function parseExecuteServerTiming(header) {
|
|
|
365
504
|
const durations = /* @__PURE__ */ new Map();
|
|
366
505
|
for (const rawEntry of header.split(",")) {
|
|
367
506
|
const parts = rawEntry.split(";");
|
|
368
|
-
const name = _optionalChain([parts, 'access',
|
|
507
|
+
const name = _optionalChain([parts, 'access', _9 => _9[0], 'optionalAccess', _10 => _10.trim, 'call', _11 => _11(), 'access', _12 => _12.toLowerCase, 'call', _13 => _13()]);
|
|
369
508
|
if (!name) continue;
|
|
370
509
|
for (const parameter of parts.slice(1)) {
|
|
371
510
|
const separator = parameter.indexOf("=");
|
|
@@ -500,7 +639,7 @@ function isRecoverableExecutionAttemptError(error) {
|
|
|
500
639
|
if (error instanceof _chunkLFQJW4S2js.ToolExecutionError) {
|
|
501
640
|
return error.code === "EXECUTION_IN_PROGRESS" || error.origin === "deepline" && error.category === "network" && error.networkScope === "client_to_deepline";
|
|
502
641
|
}
|
|
503
|
-
return error instanceof _chunkLFQJW4S2js.DeeplineError && (error.code === "EXECUTION_IN_PROGRESS" || _optionalChain([error, 'access',
|
|
642
|
+
return error instanceof _chunkLFQJW4S2js.DeeplineError && (error.code === "EXECUTION_IN_PROGRESS" || _optionalChain([error, 'access', _14 => _14.code, 'optionalAccess', _15 => _15.startsWith, 'call', _16 => _16("NETWORK_")]) === true && error.statusCode === void 0);
|
|
504
643
|
}
|
|
505
644
|
function isRecoverableExecutionLookupError(error) {
|
|
506
645
|
if (isRecoverableExecutionAttemptError(error)) return true;
|
|
@@ -609,32 +748,32 @@ var ToolCalls = class {
|
|
|
609
748
|
this.configuredRequestTimeoutMs = configuredRequestTimeoutMs;
|
|
610
749
|
}
|
|
611
750
|
async call(toolId, input, options) {
|
|
612
|
-
const connection = _optionalChain([options, 'optionalAccess',
|
|
613
|
-
if (connection !== void 0 && (!_chunk4WAM6TLDjs.isToolConnectionName.call(void 0, connection) || _optionalChain([options, 'optionalAccess',
|
|
751
|
+
const connection = _optionalChain([options, 'optionalAccess', _17 => _17.connection]);
|
|
752
|
+
if (connection !== void 0 && (!_chunk4WAM6TLDjs.isToolConnectionName.call(void 0, connection) || _optionalChain([options, 'optionalAccess', _18 => _18.idempotencyKey]) !== void 0 || _optionalChain([options, 'optionalAccess', _19 => _19.recover]))) {
|
|
614
753
|
throw new (0, _chunkLFQJW4S2js.DeeplineError)(
|
|
615
754
|
"Use a valid org connection name without execution recovery.",
|
|
616
755
|
400,
|
|
617
756
|
"NAMED_CONNECTION_INVALID"
|
|
618
757
|
);
|
|
619
758
|
}
|
|
620
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
759
|
+
if (_optionalChain([options, 'optionalAccess', _20 => _20.cliInvocationId]) !== void 0) {
|
|
621
760
|
validateCliInvocationId(options.cliInvocationId);
|
|
622
761
|
}
|
|
623
762
|
const inputSnapshot = JSON.parse(JSON.stringify(input));
|
|
624
|
-
const metadataSnapshot = _optionalChain([options, 'optionalAccess',
|
|
625
|
-
const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
763
|
+
const metadataSnapshot = _optionalChain([options, 'optionalAccess', _21 => _21.metadata]) ? JSON.parse(JSON.stringify(options.metadata)) : void 0;
|
|
764
|
+
const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _22 => _22.idempotencyKey]), () => ( (_optionalChain([options, 'optionalAccess', _23 => _23.recover]) ? crypto.randomUUID() : void 0)));
|
|
626
765
|
if (idempotencyKey !== void 0) {
|
|
627
766
|
validateExecutionIdempotencyKey(idempotencyKey);
|
|
628
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
767
|
+
if (_optionalChain([options, 'optionalAccess', _24 => _24.recoveryTimeoutMs]) !== void 0 && (!Number.isFinite(options.recoveryTimeoutMs) || options.recoveryTimeoutMs < 0)) {
|
|
629
768
|
throw new (0, _chunkLFQJW4S2js.DeeplineError)(
|
|
630
769
|
"recoveryTimeoutMs must be a finite, non-negative number.",
|
|
631
770
|
void 0,
|
|
632
771
|
"IDEMPOTENCY_KEY_INVALID"
|
|
633
772
|
);
|
|
634
773
|
}
|
|
635
|
-
await _optionalChain([options, 'optionalAccess',
|
|
774
|
+
await _optionalChain([options, 'optionalAccess', _25 => _25.onExecution, 'optionalCall', _26 => _26({ idempotencyKey })]);
|
|
636
775
|
}
|
|
637
|
-
const timeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
776
|
+
const timeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _27 => _27.timeout]), () => ( resolveToolExecuteTimeoutMs(
|
|
638
777
|
toolId,
|
|
639
778
|
inputSnapshot,
|
|
640
779
|
this.configuredRequestTimeoutMs
|
|
@@ -646,11 +785,11 @@ var ToolCalls = class {
|
|
|
646
785
|
[_chunkLFQJW4S2js.TOOL_EXECUTION_ERROR_SCHEMA_HEADER]: String(
|
|
647
786
|
_chunkLFQJW4S2js.TOOL_EXECUTION_ERROR_SCHEMA_VERSION
|
|
648
787
|
),
|
|
649
|
-
..._optionalChain([options, 'optionalAccess',
|
|
650
|
-
[EXECUTE_RESPONSE_INTENT_HEADER]: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
788
|
+
..._optionalChain([options, 'optionalAccess', _28 => _28.includeToolMetadata]) ? { [INCLUDE_TOOL_METADATA_HEADER]: "true" } : {},
|
|
789
|
+
[EXECUTE_RESPONSE_INTENT_HEADER]: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _29 => _29.responseIntent]), () => ( "raw")),
|
|
651
790
|
...idempotencyKey ? { "Idempotency-Key": idempotencyKey } : {},
|
|
652
|
-
..._optionalChain([options, 'optionalAccess',
|
|
653
|
-
..._optionalChain([options, 'optionalAccess',
|
|
791
|
+
..._optionalChain([options, 'optionalAccess', _30 => _30.searchRef]) ? { "x-deepline-search-ref": options.searchRef } : {},
|
|
792
|
+
..._optionalChain([options, 'optionalAccess', _31 => _31.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
|
|
654
793
|
};
|
|
655
794
|
let lastResponse = null;
|
|
656
795
|
const observeTerminal = (failure) => {
|
|
@@ -665,7 +804,7 @@ var ToolCalls = class {
|
|
|
665
804
|
if (recovery === "running" || recovery === "outcome_unknown") return;
|
|
666
805
|
const state = isRecord(body) ? body.status : null;
|
|
667
806
|
const terminal = state === "completed" || state === "failed" || state === "cancelled" ? state : state === "canceled" ? "cancelled" : failure ? "failed" : null;
|
|
668
|
-
if (!terminal || !_optionalChain([options, 'optionalAccess',
|
|
807
|
+
if (!terminal || !_optionalChain([options, 'optionalAccess', _32 => _32.onResponseReceived])) return;
|
|
669
808
|
const reportObservationFailure = () => console.error("[tools.execute] response observation failed");
|
|
670
809
|
try {
|
|
671
810
|
const notification = options.onResponseReceived({
|
|
@@ -680,8 +819,8 @@ var ToolCalls = class {
|
|
|
680
819
|
};
|
|
681
820
|
const legacyEndpoint = `/api/v2/integrations/${encodeURIComponent(toolId)}/execute`;
|
|
682
821
|
let useLegacyEndpoint = idempotencyKey === void 0;
|
|
683
|
-
const atomicToolOnly = _optionalChain([options, 'optionalAccess',
|
|
684
|
-
const retryAmbiguousDelivery = connection === void 0 && atomicToolOnly && !idempotencyKey && _optionalChain([options, 'optionalAccess',
|
|
822
|
+
const atomicToolOnly = _optionalChain([options, 'optionalAccess', _33 => _33.atomicToolOnly]) === true;
|
|
823
|
+
const retryAmbiguousDelivery = connection === void 0 && atomicToolOnly && !idempotencyKey && _optionalChain([options, 'optionalAccess', _34 => _34.retryAmbiguousDelivery]) === true;
|
|
685
824
|
const dispatchRequest = async (requestTimeoutMs) => {
|
|
686
825
|
let recoverySupported = false;
|
|
687
826
|
let atomicToolsSupported = false;
|
|
@@ -695,9 +834,9 @@ var ToolCalls = class {
|
|
|
695
834
|
headers,
|
|
696
835
|
{
|
|
697
836
|
timeout: requestTimeoutMs,
|
|
698
|
-
maxRetries: connection !== void 0 || idempotencyKey ? 0 : _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
699
|
-
...connection === void 0 && atomicToolOnly && !idempotencyKey && _optionalChain([options, 'optionalAccess',
|
|
700
|
-
retryApiErrors: connection === void 0 && (atomicToolOnly || _optionalChain([options, 'optionalAccess',
|
|
837
|
+
maxRetries: connection !== void 0 || idempotencyKey ? 0 : _nullishCoalesce(_optionalChain([options, 'optionalAccess', _35 => _35.maxRetries]), () => ( (retryAmbiguousDelivery ? 2 : 0))),
|
|
838
|
+
...connection === void 0 && atomicToolOnly && !idempotencyKey && _optionalChain([options, 'optionalAccess', _36 => _36.maxRetries]) === void 0 ? { executePolicyMaxRetries: 2 } : {},
|
|
839
|
+
retryApiErrors: connection === void 0 && (atomicToolOnly || _optionalChain([options, 'optionalAccess', _37 => _37.retryApiErrors]) === true),
|
|
701
840
|
retryFromExecutePolicy: connection === void 0 && atomicToolOnly,
|
|
702
841
|
retryAmbiguousDelivery,
|
|
703
842
|
exactUrlOnly: true,
|
|
@@ -705,9 +844,9 @@ var ToolCalls = class {
|
|
|
705
844
|
idempotencyKey,
|
|
706
845
|
onResponse: (response2) => {
|
|
707
846
|
lastResponse = null;
|
|
708
|
-
atomicToolsSupported = response2.headers.get(
|
|
847
|
+
atomicToolsSupported = response2.headers.get(_chunkM4ZL2H5Bjs.ATOMIC_TOOL_EXECUTE_SUPPORTED_HEADER) === "true";
|
|
709
848
|
recoverySupported = response2.headers.get("X-Deepline-Idempotency-Supported") === "true";
|
|
710
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
849
|
+
if (_optionalChain([options, 'optionalAccess', _38 => _38.onServerTiming])) {
|
|
711
850
|
try {
|
|
712
851
|
const notification = options.onServerTiming(
|
|
713
852
|
parseExecuteServerTiming(
|
|
@@ -744,7 +883,7 @@ var ToolCalls = class {
|
|
|
744
883
|
await this.lookupExecutionByKey(
|
|
745
884
|
idempotencyKey,
|
|
746
885
|
requestTimeoutMs,
|
|
747
|
-
_optionalChain([options, 'optionalAccess',
|
|
886
|
+
_optionalChain([options, 'optionalAccess', _39 => _39.cliInvocationId])
|
|
748
887
|
);
|
|
749
888
|
useLegacyEndpoint = true;
|
|
750
889
|
return post();
|
|
@@ -761,7 +900,7 @@ var ToolCalls = class {
|
|
|
761
900
|
};
|
|
762
901
|
let response;
|
|
763
902
|
let recoveryDeadline = null;
|
|
764
|
-
const recoveryTimeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
903
|
+
const recoveryTimeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _40 => _40.recoveryTimeoutMs]), () => ( DEFAULT_EXECUTION_RECOVERY_TIMEOUT_MS));
|
|
765
904
|
let retryDelayMs = 1e3;
|
|
766
905
|
const recoveryTimeoutError = () => executionRecoveryError({
|
|
767
906
|
toolId,
|
|
@@ -789,7 +928,7 @@ var ToolCalls = class {
|
|
|
789
928
|
this.defaultRequestTimeoutMs,
|
|
790
929
|
remainingMs
|
|
791
930
|
),
|
|
792
|
-
_optionalChain([options, 'optionalAccess',
|
|
931
|
+
_optionalChain([options, 'optionalAccess', _41 => _41.cliInvocationId])
|
|
793
932
|
);
|
|
794
933
|
} catch (error) {
|
|
795
934
|
if (!isRecoverableExecutionLookupError(error)) throw error;
|
|
@@ -982,11 +1121,11 @@ function resolvePlayRunRuntimeSelection(request, env) {
|
|
|
982
1121
|
}
|
|
983
1122
|
return runtime;
|
|
984
1123
|
}
|
|
985
|
-
const configured = _optionalChain([env, 'access',
|
|
986
|
-
const configuredNamespace = _optionalChain([env, 'access',
|
|
987
|
-
const configuredToken = _optionalChain([env, 'access',
|
|
988
|
-
const configuredPlacementPolicy = _optionalChain([env, 'access',
|
|
989
|
-
if (_optionalChain([env, 'access',
|
|
1124
|
+
const configured = _optionalChain([env, 'access', _42 => _42.DEEPLINE_RUNTIME_ENVIRONMENT, 'optionalAccess', _43 => _43.trim, 'call', _44 => _44()]);
|
|
1125
|
+
const configuredNamespace = _optionalChain([env, 'access', _45 => _45.DEEPLINE_RUNTIME_NAMESPACE, 'optionalAccess', _46 => _46.trim, 'call', _47 => _47()]);
|
|
1126
|
+
const configuredToken = _optionalChain([env, 'access', _48 => _48.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _49 => _49.trim, 'call', _50 => _50()]);
|
|
1127
|
+
const configuredPlacementPolicy = _optionalChain([env, 'access', _51 => _51.DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY, 'optionalAccess', _52 => _52.trim, 'call', _53 => _53()]);
|
|
1128
|
+
if (_optionalChain([env, 'access', _54 => _54.DEEPLINE_RUNTIME_GATEWAY_PROFILE, 'optionalAccess', _55 => _55.trim, 'call', _56 => _56()])) {
|
|
990
1129
|
throw new (0, _chunkLFQJW4S2js.DeeplineError)(
|
|
991
1130
|
"DEEPLINE_RUNTIME_GATEWAY_PROFILE was removed: Runtime gateway profiles (vercel_app@1) are no longer available. Unset it to run on the default gateways.",
|
|
992
1131
|
void 0,
|
|
@@ -1044,7 +1183,7 @@ function resolvePlayRunRuntimeSelection(request, env) {
|
|
|
1044
1183
|
"INVALID_RUNTIME_NAMESPACE"
|
|
1045
1184
|
);
|
|
1046
1185
|
}
|
|
1047
|
-
const configuredBackendValue = _optionalChain([env, 'access',
|
|
1186
|
+
const configuredBackendValue = _optionalChain([env, 'access', _57 => _57.DEEPLINE_PLAY_RUNNER_BACKEND, 'optionalAccess', _58 => _58.trim, 'call', _59 => _59()]);
|
|
1048
1187
|
const configuredBackend = configuredBackendValue === "daytona" || configuredBackendValue === "modal" ? configuredBackendValue : void 0;
|
|
1049
1188
|
if (configuredBackendValue && !configuredBackend) {
|
|
1050
1189
|
throw new (0, _chunkLFQJW4S2js.DeeplineError)(
|
|
@@ -1082,7 +1221,7 @@ function resolveStartPlayRunRequest(request, env) {
|
|
|
1082
1221
|
}
|
|
1083
1222
|
function runtimeSelectionHeaders(runtime, env) {
|
|
1084
1223
|
if (!runtime || runtime.environment === "native") return void 0;
|
|
1085
|
-
const token = _optionalChain([env, 'access',
|
|
1224
|
+
const token = _optionalChain([env, 'access', _60 => _60.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _61 => _61.trim, 'call', _62 => _62()]);
|
|
1086
1225
|
if (!token) {
|
|
1087
1226
|
throw new (0, _chunkLFQJW4S2js.DeeplineError)(
|
|
1088
1227
|
"DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN is required for explicit preview runtime selection.",
|
|
@@ -1090,17 +1229,17 @@ function runtimeSelectionHeaders(runtime, env) {
|
|
|
1090
1229
|
"RUNTIME_ENVIRONMENT_TOKEN_REQUIRED"
|
|
1091
1230
|
);
|
|
1092
1231
|
}
|
|
1093
|
-
const receivers = _optionalChain([env, 'access',
|
|
1232
|
+
const receivers = _optionalChain([env, 'access', _63 => _63.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _64 => _64.trim, 'call', _65 => _65()]);
|
|
1094
1233
|
return {
|
|
1095
|
-
[
|
|
1096
|
-
...receivers ? { [
|
|
1234
|
+
[_chunkM4ZL2H5Bjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
|
|
1235
|
+
...receivers ? { [_chunkM4ZL2H5Bjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
|
|
1097
1236
|
};
|
|
1098
1237
|
}
|
|
1099
1238
|
function playRunStartHeaders(runtime, env) {
|
|
1100
1239
|
const headers = runtimeSelectionHeaders(runtime, env);
|
|
1101
|
-
const experimentSwitches = _optionalChain([env, 'access',
|
|
1240
|
+
const experimentSwitches = _optionalChain([env, 'access', _66 => _66.DEEPLINE_EXPERIMENT_SWITCHES, 'optionalAccess', _67 => _67.trim, 'call', _68 => _68()]);
|
|
1102
1241
|
if (!experimentSwitches) return headers;
|
|
1103
|
-
return { ...headers, [
|
|
1242
|
+
return { ...headers, [_chunkM4ZL2H5Bjs.EXPERIMENT_SWITCHES_HEADER]: experimentSwitches };
|
|
1104
1243
|
}
|
|
1105
1244
|
function normalizeTestPolicyOverrides(value, source) {
|
|
1106
1245
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
@@ -1114,7 +1253,7 @@ function normalizeTestPolicyOverrides(value, source) {
|
|
|
1114
1253
|
}
|
|
1115
1254
|
function parseEnvTestPolicyOverrides(env) {
|
|
1116
1255
|
const raw = env.DEEPLINE_TEST_POLICY_OVERRIDES;
|
|
1117
|
-
const trimmed = _optionalChain([raw, 'optionalAccess',
|
|
1256
|
+
const trimmed = _optionalChain([raw, 'optionalAccess', _69 => _69.trim, 'call', _70 => _70()]);
|
|
1118
1257
|
if (!trimmed) return void 0;
|
|
1119
1258
|
let parsed;
|
|
1120
1259
|
try {
|
|
@@ -1134,17 +1273,17 @@ function isRecord2(value) {
|
|
|
1134
1273
|
}
|
|
1135
1274
|
function normalizePlayStatus(raw) {
|
|
1136
1275
|
const runPackage = _chunkMJTVX4QKjs.isPlayRunPackage.call(void 0, raw) ? raw : _chunkMJTVX4QKjs.isPlayRunPackage.call(void 0, raw.package) ? raw.package : null;
|
|
1137
|
-
const packageRun = _optionalChain([runPackage, 'optionalAccess',
|
|
1138
|
-
const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess',
|
|
1276
|
+
const packageRun = _optionalChain([runPackage, 'optionalAccess', _71 => _71.run]);
|
|
1277
|
+
const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess', _72 => _72.status]) === "string" ? packageRun.status : null;
|
|
1139
1278
|
const status = _chunkMJTVX4QKjs.decodePlayRunPublicStatus.call(void 0, rawStatus);
|
|
1140
1279
|
if (!status) {
|
|
1141
1280
|
throw new Error(
|
|
1142
1281
|
`Invalid play run lifecycle status in API response: ${JSON.stringify(rawStatus)}.`
|
|
1143
1282
|
);
|
|
1144
1283
|
}
|
|
1145
|
-
const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess',
|
|
1146
|
-
const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess',
|
|
1147
|
-
const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess',
|
|
1284
|
+
const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess', _73 => _73.id]), () => ( ""));
|
|
1285
|
+
const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _74 => _74.overview]), () => ( raw.overview));
|
|
1286
|
+
const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _75 => _75.runStatus]), () => ( raw.runStatus));
|
|
1148
1287
|
return {
|
|
1149
1288
|
...raw,
|
|
1150
1289
|
runId,
|
|
@@ -1170,22 +1309,22 @@ var PlayClient = class {
|
|
|
1170
1309
|
return _chunkMJTVX4QKjs.startPlayRun.call(void 0,
|
|
1171
1310
|
this.http,
|
|
1172
1311
|
resolved.request,
|
|
1173
|
-
_optionalChain([options, 'optionalAccess',
|
|
1312
|
+
_optionalChain([options, 'optionalAccess', _76 => _76.cliAdmission]) ? { ...headers, "X-Deepline-API-Major": String(_chunkM4ZL2H5Bjs.SDK_API_MAJOR) } : headers,
|
|
1174
1313
|
options
|
|
1175
1314
|
);
|
|
1176
1315
|
}
|
|
1177
1316
|
async getPlayStatus(workflowId, options) {
|
|
1178
1317
|
const params = new URLSearchParams();
|
|
1179
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1318
|
+
if (_optionalChain([options, 'optionalAccess', _77 => _77.billing]) === false) {
|
|
1180
1319
|
params.set("billing", "false");
|
|
1181
1320
|
}
|
|
1182
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1321
|
+
if (_optionalChain([options, 'optionalAccess', _78 => _78.full]) === true) {
|
|
1183
1322
|
params.set("full", "true");
|
|
1184
1323
|
}
|
|
1185
1324
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
1186
1325
|
const response = await this.http.get(
|
|
1187
1326
|
`/api/v2/runs/${encodeURIComponent(workflowId)}${query}`,
|
|
1188
|
-
_optionalChain([options, 'optionalAccess',
|
|
1327
|
+
_optionalChain([options, 'optionalAccess', _79 => _79.runStatus]) === true ? { headers: { "x-deepline-run-status": "1" } } : void 0
|
|
1189
1328
|
);
|
|
1190
1329
|
return normalizePlayStatus(response);
|
|
1191
1330
|
}
|
|
@@ -1198,7 +1337,7 @@ var PlayClient = class {
|
|
|
1198
1337
|
async stopPlay(workflowId, options) {
|
|
1199
1338
|
return this.http.post(
|
|
1200
1339
|
`/api/v2/runs/${encodeURIComponent(workflowId)}/stop`,
|
|
1201
|
-
_optionalChain([options, 'optionalAccess',
|
|
1340
|
+
_optionalChain([options, 'optionalAccess', _80 => _80.reason]) ? { reason: options.reason } : {}
|
|
1202
1341
|
);
|
|
1203
1342
|
}
|
|
1204
1343
|
async listPlayRuns(playName) {
|
|
@@ -1210,7 +1349,7 @@ var PlayClient = class {
|
|
|
1210
1349
|
}
|
|
1211
1350
|
async getPlay(name, options) {
|
|
1212
1351
|
const encodedName = encodeURIComponent(name);
|
|
1213
|
-
const query = _optionalChain([options, 'optionalAccess',
|
|
1352
|
+
const query = _optionalChain([options, 'optionalAccess', _81 => _81.source]) ? `?include=source&revision=${encodeURIComponent(options.source)}` : _optionalChain([options, 'optionalAccess', _82 => _82.guidance]) ? "?include=guidance" : "";
|
|
1214
1353
|
return this.http.get(`/api/v2/plays/${encodedName}${query}`);
|
|
1215
1354
|
}
|
|
1216
1355
|
async clearPlayHistory(name, request = {}) {
|
|
@@ -1222,7 +1361,7 @@ var PlayClient = class {
|
|
|
1222
1361
|
}
|
|
1223
1362
|
async listPlayVersions(name, options) {
|
|
1224
1363
|
const encodedName = encodeURIComponent(name);
|
|
1225
|
-
const suffix = _optionalChain([options, 'optionalAccess',
|
|
1364
|
+
const suffix = _optionalChain([options, 'optionalAccess', _83 => _83.full]) ? "?full=true" : "";
|
|
1226
1365
|
const response = await this.http.get(
|
|
1227
1366
|
`/api/v2/plays/${encodedName}/versions${suffix}`
|
|
1228
1367
|
);
|
|
@@ -2179,7 +2318,7 @@ function parseDsl(input) {
|
|
|
2179
2318
|
input.slice(position)
|
|
2180
2319
|
);
|
|
2181
2320
|
if (!operation) {
|
|
2182
|
-
const token = _nullishCoalesce(_nullishCoalesce(_optionalChain([/^(?:[=!<>~]+|[A-Za-z_]+)/, 'access',
|
|
2321
|
+
const token = _nullishCoalesce(_nullishCoalesce(_optionalChain([/^(?:[=!<>~]+|[A-Za-z_]+)/, 'access', _84 => _84.exec, 'call', _85 => _85(input.slice(position)), 'optionalAccess', _86 => _86[0]]), () => ( input[position])), () => ( "<end>"));
|
|
2183
2322
|
if (token === "=") {
|
|
2184
2323
|
const corrected = `${input.slice(0, position)}==${input.slice(position + 1)}`;
|
|
2185
2324
|
fail(
|
|
@@ -2258,7 +2397,7 @@ function normalizeRunEventQueryTimestamp(value) {
|
|
|
2258
2397
|
return /[1-9]/.test(extraMicros) ? canonical2.replace(/Z$/, `${extraMicros}Z`) : canonical2;
|
|
2259
2398
|
}
|
|
2260
2399
|
function timestampMicros(value) {
|
|
2261
|
-
const fraction = _nullishCoalesce(_optionalChain([/\.(\d+)Z$/, 'access',
|
|
2400
|
+
const fraction = _nullishCoalesce(_optionalChain([/\.(\d+)Z$/, 'access', _87 => _87.exec, 'call', _88 => _88(value), 'optionalAccess', _89 => _89[1]]), () => ( ""));
|
|
2262
2401
|
return BigInt(Date.parse(value)) * BigInt(1e3) + BigInt(fraction.padEnd(6, "0").slice(3));
|
|
2263
2402
|
}
|
|
2264
2403
|
function time(value, nowMs, fallback) {
|
|
@@ -2434,129 +2573,6 @@ function isStopAllPlayRunsDryRunResult(result) {
|
|
|
2434
2573
|
return "dryRun" in result && result.dryRun === true;
|
|
2435
2574
|
}
|
|
2436
2575
|
|
|
2437
|
-
// src/integrations.ts
|
|
2438
|
-
var CALENDAR_PROVIDER = "google_calendar_availability";
|
|
2439
|
-
function invalid(message) {
|
|
2440
|
-
throw new (0, _chunkLFQJW4S2js.DeeplineError)(message, 400, "INVALID_ARGUMENT");
|
|
2441
|
-
}
|
|
2442
|
-
async function findConnection(client, name, provider) {
|
|
2443
|
-
const { connections } = await client.listWorkspaceConnectionInventory(
|
|
2444
|
-
provider,
|
|
2445
|
-
{ authorizationsOnly: true }
|
|
2446
|
-
);
|
|
2447
|
-
const matches = connections.filter(
|
|
2448
|
-
(row) => row.name === name && (!provider || row.provider === provider)
|
|
2449
|
-
);
|
|
2450
|
-
if (matches.length === 0)
|
|
2451
|
-
throw new (0, _chunkLFQJW4S2js.DeeplineError)(
|
|
2452
|
-
`No org connection named ${JSON.stringify(name)}. Run deepline integrations list --json.`,
|
|
2453
|
-
404,
|
|
2454
|
-
"NOT_FOUND"
|
|
2455
|
-
);
|
|
2456
|
-
if (matches.length > 1)
|
|
2457
|
-
invalid("This name exists for multiple providers. Pass --provider.");
|
|
2458
|
-
return matches[0];
|
|
2459
|
-
}
|
|
2460
|
-
async function changeConnection(client, action, name, options) {
|
|
2461
|
-
const row = await findConnection(client, name, options.provider);
|
|
2462
|
-
if (options.booking && (action !== "reconnect" || row.type !== "workspace_delegation"))
|
|
2463
|
-
invalid("Use --booking with Google Workspace verify or reconnect.");
|
|
2464
|
-
if (options.listCalendars && (action !== "reconnect" || row.type !== "workspace_delegation"))
|
|
2465
|
-
invalid("Use --list-calendars with Google Workspace verify or reconnect.");
|
|
2466
|
-
if (row.type === "workspace_delegation") {
|
|
2467
|
-
if (row.provider !== CALENDAR_PROVIDER || !row.domain)
|
|
2468
|
-
invalid(
|
|
2469
|
-
"The Google Workspace approval is missing its provider or domain."
|
|
2470
|
-
);
|
|
2471
|
-
if (row.authorizationVersion === void 0)
|
|
2472
|
-
invalid("The API did not return a Google Workspace approval revision.");
|
|
2473
|
-
if (action === "reconnect") {
|
|
2474
|
-
return verifyWorkspace(client, row.domain, options, row);
|
|
2475
|
-
}
|
|
2476
|
-
if (options.verificationEmail)
|
|
2477
|
-
invalid("Use --verification-email with reconnect or verify.");
|
|
2478
|
-
if (action === "delete" && row.status !== "disconnected")
|
|
2479
|
-
invalid("Disconnect this approval before deleting it.");
|
|
2480
|
-
const change2 = action === "delete" ? {
|
|
2481
|
-
action: "remove_workspace",
|
|
2482
|
-
domain: row.domain,
|
|
2483
|
-
connectionId: row.id,
|
|
2484
|
-
grantRevision: row.authorizationVersion
|
|
2485
|
-
} : {
|
|
2486
|
-
action: "disable_workspace",
|
|
2487
|
-
domain: row.domain,
|
|
2488
|
-
connectionId: row.id,
|
|
2489
|
-
grantRevision: row.authorizationVersion
|
|
2490
|
-
};
|
|
2491
|
-
if (options.dryRun) return change2;
|
|
2492
|
-
return client.changeCalendarDelegation(change2);
|
|
2493
|
-
}
|
|
2494
|
-
if (options.verificationEmail)
|
|
2495
|
-
invalid("--verification-email applies to Google Workspace approvals.");
|
|
2496
|
-
if (row.type !== "oauth" || row.provider !== "hubspot" && row.provider !== CALENDAR_PROVIDER)
|
|
2497
|
-
invalid(
|
|
2498
|
-
"Manage this credential type through deepline integrations connect <provider> --link."
|
|
2499
|
-
);
|
|
2500
|
-
if (row.authorizationVersion === void 0)
|
|
2501
|
-
invalid("The API did not return a connection authorization version.");
|
|
2502
|
-
const change = {
|
|
2503
|
-
action: action === "delete" ? "remove" : action,
|
|
2504
|
-
provider: row.provider,
|
|
2505
|
-
name,
|
|
2506
|
-
connectionId: row.id,
|
|
2507
|
-
authorizationVersion: row.authorizationVersion
|
|
2508
|
-
};
|
|
2509
|
-
if (options.dryRun) return change;
|
|
2510
|
-
return client.manageWorkspaceIntegrationConnection(change);
|
|
2511
|
-
}
|
|
2512
|
-
async function verifyWorkspace(client, domain, options, existing) {
|
|
2513
|
-
domain = domain.trim().toLowerCase();
|
|
2514
|
-
if (!_chunk4WAM6TLDjs.GOOGLE_WORKSPACE_DOMAIN_PATTERN.test(domain))
|
|
2515
|
-
invalid("Enter a Google Workspace domain, such as example.com.");
|
|
2516
|
-
const email = _optionalChain([options, 'access', _85 => _85.verificationEmail, 'optionalAccess', _86 => _86.trim, 'call', _87 => _87(), 'access', _88 => _88.toLowerCase, 'call', _89 => _89()]);
|
|
2517
|
-
if (!email || email.length > 254 || !/^[^\s@]+@[^\s@]+$/.test(email) || email.split("@")[1] !== domain)
|
|
2518
|
-
invalid("Pass --verification-email with a work email in this domain.");
|
|
2519
|
-
const settings = existing ? {
|
|
2520
|
-
grantRevision: existing.authorizationVersion,
|
|
2521
|
-
connectionId: existing.id,
|
|
2522
|
-
grantedScopes: existing.scopes
|
|
2523
|
-
} : await client.getCalendarDelegation(void 0, void 0, domain);
|
|
2524
|
-
if (settings.grantRevision === void 0)
|
|
2525
|
-
invalid("The API did not return a Google Workspace approval revision.");
|
|
2526
|
-
const requestedScopes = [
|
|
2527
|
-
.../* @__PURE__ */ new Set([
|
|
2528
|
-
_chunk4WAM6TLDjs.GOOGLE_WORKSPACE_AVAILABILITY_SCOPE,
|
|
2529
|
-
..._nullishCoalesce(settings.grantedScopes, () => ( [])),
|
|
2530
|
-
...options.booking ? [_chunk4WAM6TLDjs.GOOGLE_WORKSPACE_BOOKING_SCOPE] : [],
|
|
2531
|
-
...options.listCalendars ? [_chunk4WAM6TLDjs.GOOGLE_WORKSPACE_CALENDAR_LIST_SCOPE] : []
|
|
2532
|
-
])
|
|
2533
|
-
];
|
|
2534
|
-
const change = {
|
|
2535
|
-
action: "enable_workspace",
|
|
2536
|
-
domain,
|
|
2537
|
-
grantRevision: settings.grantRevision,
|
|
2538
|
-
...settings.connectionId ? { connectionId: settings.connectionId } : {},
|
|
2539
|
-
verificationEmail: email,
|
|
2540
|
-
...requestedScopes.length > 1 ? { requestedScopes } : {}
|
|
2541
|
-
};
|
|
2542
|
-
if (options.dryRun) return change;
|
|
2543
|
-
return client.changeCalendarDelegation(change);
|
|
2544
|
-
}
|
|
2545
|
-
function createIntegrationsNamespace(client) {
|
|
2546
|
-
return {
|
|
2547
|
-
list: (options = {}) => client.listWorkspaceConnectionInventory(options.provider, {
|
|
2548
|
-
authorizationsOnly: true
|
|
2549
|
-
}),
|
|
2550
|
-
get: (name, options = {}) => findConnection(client, name, options.provider),
|
|
2551
|
-
connect: (provider) => client.getIntegrationConnectLink(provider),
|
|
2552
|
-
reconnect: (name, options = {}) => changeConnection(client, "reconnect", name, options),
|
|
2553
|
-
disconnect: (name, options = {}) => changeConnection(client, "disconnect", name, options),
|
|
2554
|
-
delete: (name, options = {}) => changeConnection(client, "delete", name, options),
|
|
2555
|
-
verify: (domain, options) => verifyWorkspace(client, domain, options),
|
|
2556
|
-
members: (provider, options = {}) => client.listManagedConnectionMembers(provider, options.cursor)
|
|
2557
|
-
};
|
|
2558
|
-
}
|
|
2559
|
-
|
|
2560
2576
|
// ../plays/trigger-config-route.ts
|
|
2561
2577
|
function playTriggerConfigPath(playName) {
|
|
2562
2578
|
return `/api/v2/plays/${encodeURIComponent(playName)}/triggers`;
|
|
@@ -3411,7 +3427,7 @@ function isolatedCiRuntimeEventReadHeaders(env) {
|
|
|
3411
3427
|
"RUNTIME_EVENT_INTERNAL_TOKEN_REQUIRED"
|
|
3412
3428
|
);
|
|
3413
3429
|
}
|
|
3414
|
-
return { [
|
|
3430
|
+
return { [_chunkM4ZL2H5Bjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
|
|
3415
3431
|
}
|
|
3416
3432
|
function sleep(ms) {
|
|
3417
3433
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -4347,7 +4363,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
4347
4363
|
);
|
|
4348
4364
|
const headers = _optionalChain([options, 'optionalAccess', _200 => _200.cliAdmission]) ? {
|
|
4349
4365
|
...runtimeHeaders,
|
|
4350
|
-
"X-Deepline-API-Major": String(
|
|
4366
|
+
"X-Deepline-API-Major": String(_chunkM4ZL2H5Bjs.SDK_API_MAJOR)
|
|
4351
4367
|
} : runtimeHeaders;
|
|
4352
4368
|
const http = this.http;
|
|
4353
4369
|
let submitted = false;
|
|
@@ -5768,6 +5784,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
5768
5784
|
const params = new URLSearchParams({ provider });
|
|
5769
5785
|
return this.http.get(`/api/v2/integrations/balance?${params}`);
|
|
5770
5786
|
}
|
|
5787
|
+
/** Discover and save the ad accounts accessible to the workspace connection. */
|
|
5788
|
+
async discoverAdAccounts(provider) {
|
|
5789
|
+
const { path, body } = planAdAccountDiscovery(provider);
|
|
5790
|
+
return this.http.post(path, body, void 0, {
|
|
5791
|
+
maxRetries: 0,
|
|
5792
|
+
exactUrlOnly: true
|
|
5793
|
+
});
|
|
5794
|
+
}
|
|
5771
5795
|
/** List the internal pilot's workspace connections. */
|
|
5772
5796
|
async listWorkspaceIntegrationConnections() {
|
|
5773
5797
|
return this.http.get("/api/v2/integrations/connections");
|
|
@@ -7629,4 +7653,6 @@ var DeeplineClient = (_class = class _DeeplineClient {
|
|
|
7629
7653
|
|
|
7630
7654
|
|
|
7631
7655
|
|
|
7632
|
-
|
|
7656
|
+
|
|
7657
|
+
|
|
7658
|
+
exports.AD_ACCOUNT_DISCOVERY_PROVIDERS = AD_ACCOUNT_DISCOVERY_PROVIDERS; exports.planAdAccountDiscovery = planAdAccountDiscovery; exports.PUBLIC_PLAN_SKUS = PUBLIC_PLAN_SKUS; exports.iterateCursorPages = iterateCursorPages; exports.requireBillingIdempotencyKey = requireBillingIdempotencyKey; exports.planCustomerDbQuery = planCustomerDbQuery; exports.validateExecutionIdempotencyKey = validateExecutionIdempotencyKey; exports.normalizePlayStatus = normalizePlayStatus; exports.PlayClient = PlayClient; exports.PRODUCT_NOTIFICATION_EVENT_CATALOG = PRODUCT_NOTIFICATION_EVENT_CATALOG; exports.resolveLegacySlackNotification = resolveLegacySlackNotification; exports.RUN_EVENT_SEARCH_KIND_VALUES = RUN_EVENT_SEARCH_KIND_VALUES; exports.logProvenanceReaches = logProvenanceReaches; exports.logLevelReaches = logLevelReaches; exports.parseLogLevel = parseLogLevel; exports.classifyLogLine = classifyLogLine; exports.isTransientPlayRunReadError = isTransientPlayRunReadError; exports.encodeRunLogsCursor = encodeRunLogsCursor; exports.isRunLogsCursor = isRunLogsCursor; exports.RunEventQueryInputError = RunEventQueryInputError; exports.normalizeRunEventOperationRequest = normalizeRunEventOperationRequest; exports.isStopAllPlayRunsDryRunResult = isStopAllPlayRunsDryRunResult; exports.MONITOR_JOB_STATES = MONITOR_JOB_STATES; exports.MONITOR_JOB_PHASES = MONITOR_JOB_PHASES; exports.MONITOR_JOB_RECONCILIATION_STATES = MONITOR_JOB_RECONCILIATION_STATES; exports.DeeplineClient = DeeplineClient;
|