@zapier/zapier-sdk-cli 0.44.0 → 0.45.0
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/CHANGELOG.md +20 -0
- package/README.md +392 -40
- package/bin/zapier-sdk-experimental.mjs +14 -0
- package/dist/cli.cjs +585 -37
- package/dist/cli.mjs +584 -36
- package/dist/experimental.cjs +3519 -0
- package/dist/experimental.d.mts +39 -0
- package/dist/experimental.d.ts +39 -0
- package/dist/experimental.mjs +3483 -0
- package/dist/index.cjs +507 -26
- package/dist/index.d.mts +3 -514
- package/dist/index.d.ts +3 -514
- package/dist/index.mjs +505 -24
- package/dist/package.json +14 -2
- package/dist/sdk-B3nKAZdN.d.mts +516 -0
- package/dist/sdk-B3nKAZdN.d.ts +516 -0
- package/dist/src/cli.js +26 -2
- package/dist/src/experimental.d.ts +33 -0
- package/dist/src/experimental.js +83 -0
- package/dist/src/generators/ast-generator.d.ts +2 -2
- package/dist/src/generators/ast-generator.js +1 -1
- package/dist/src/plugins/add/index.d.ts +2 -2
- package/dist/src/plugins/bundleCode/index.js +3 -12
- package/dist/src/plugins/curl/index.js +2 -2
- package/dist/src/plugins/curl/utils.d.ts +11 -1
- package/dist/src/plugins/curl/utils.js +14 -5
- package/dist/src/plugins/drainTriggerInbox/index.d.ts +46 -0
- package/dist/src/plugins/drainTriggerInbox/index.js +178 -0
- package/dist/src/plugins/generateAppTypes/index.d.ts +2 -2
- package/dist/src/plugins/index.d.ts +2 -0
- package/dist/src/plugins/index.js +2 -0
- package/dist/src/plugins/mcp/index.d.ts +1 -0
- package/dist/src/plugins/mcp/index.js +5 -1
- package/dist/src/plugins/watchTriggerInbox/index.d.ts +45 -0
- package/dist/src/plugins/watchTriggerInbox/index.js +157 -0
- package/dist/src/sdk.js +5 -1
- package/dist/src/utils/cli-generator.js +18 -1
- package/dist/src/utils/cli-renderer.d.ts +12 -0
- package/dist/src/utils/cli-renderer.js +22 -1
- package/dist/src/utils/parameter-resolver.d.ts +1 -0
- package/dist/src/utils/parameter-resolver.js +55 -9
- package/dist/src/utils/triggerDrain.d.ts +144 -0
- package/dist/src/utils/triggerDrain.js +351 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +16 -4
package/dist/cli.cjs
CHANGED
|
@@ -27,6 +27,7 @@ var isInstalledGlobally = require('is-installed-globally');
|
|
|
27
27
|
var child_process = require('child_process');
|
|
28
28
|
var Handlebars = require('handlebars');
|
|
29
29
|
var url = require('url');
|
|
30
|
+
var experimental = require('@zapier/zapier-sdk/experimental');
|
|
30
31
|
var packageJsonLib = require('package-json');
|
|
31
32
|
var semver = require('semver');
|
|
32
33
|
|
|
@@ -123,7 +124,7 @@ function formatZodError(error) {
|
|
|
123
124
|
}
|
|
124
125
|
function getLocalResolutionOrder(paramName, resolvers, resolved = /* @__PURE__ */ new Set()) {
|
|
125
126
|
const resolver = resolvers[paramName];
|
|
126
|
-
if (!resolver || resolver.type === "static") {
|
|
127
|
+
if (!resolver || resolver.type === "static" || resolver.type === "constant") {
|
|
127
128
|
return [paramName];
|
|
128
129
|
}
|
|
129
130
|
const order = [];
|
|
@@ -206,7 +207,11 @@ var SchemaParameterResolver = class {
|
|
|
206
207
|
}
|
|
207
208
|
return parseResult.data;
|
|
208
209
|
}
|
|
209
|
-
const
|
|
210
|
+
const resolverConstants = this.getResolverConstants(sdk, functionName);
|
|
211
|
+
const resolvedParams = {
|
|
212
|
+
...resolverConstants,
|
|
213
|
+
...providedParams
|
|
214
|
+
};
|
|
210
215
|
const context = {
|
|
211
216
|
sdk,
|
|
212
217
|
currentParams: providedParams,
|
|
@@ -367,12 +372,22 @@ var SchemaParameterResolver = class {
|
|
|
367
372
|
const missingParams = [];
|
|
368
373
|
for (const param of params) {
|
|
369
374
|
const resolver = this.getResolver(param.name, context.sdk, functionName);
|
|
370
|
-
|
|
371
|
-
if (
|
|
375
|
+
let autoResolved = null;
|
|
376
|
+
if (resolver?.type === "constant") {
|
|
377
|
+
autoResolved = {
|
|
378
|
+
resolvedValue: resolver.value
|
|
379
|
+
};
|
|
380
|
+
} else if (resolver?.type === "dynamic") {
|
|
381
|
+
autoResolved = await this.tryAutoResolve(
|
|
382
|
+
resolver,
|
|
383
|
+
context
|
|
384
|
+
);
|
|
385
|
+
}
|
|
386
|
+
if (autoResolved != null) {
|
|
372
387
|
this.setNestedValue(
|
|
373
388
|
resolvedParams,
|
|
374
389
|
param.path,
|
|
375
|
-
|
|
390
|
+
autoResolved.resolvedValue
|
|
376
391
|
);
|
|
377
392
|
context.resolvedParams = resolvedParams;
|
|
378
393
|
} else {
|
|
@@ -406,7 +421,11 @@ var SchemaParameterResolver = class {
|
|
|
406
421
|
const promptLabel = inArrayContext ? `${param.name}[${arrayIndex}]` : param.name;
|
|
407
422
|
const promptName = inArrayContext ? "value" : param.name;
|
|
408
423
|
this.debugLog(`Resolving ${promptLabel}${isOptional ? " (optional)" : ""}`);
|
|
409
|
-
if (resolver.type === "
|
|
424
|
+
if (resolver.type === "constant") {
|
|
425
|
+
const constantResolver = resolver;
|
|
426
|
+
this.stopSpinner();
|
|
427
|
+
return constantResolver.value;
|
|
428
|
+
} else if (resolver.type === "static") {
|
|
410
429
|
const staticResolver = resolver;
|
|
411
430
|
const promptConfig = {
|
|
412
431
|
type: staticResolver.inputType === "password" ? "password" : "input",
|
|
@@ -474,6 +493,14 @@ var SchemaParameterResolver = class {
|
|
|
474
493
|
context.resolvedParams
|
|
475
494
|
);
|
|
476
495
|
promptConfig.name = promptName;
|
|
496
|
+
const hasSelectableChoice = promptConfig.choices?.some(
|
|
497
|
+
(c) => !c.disabled
|
|
498
|
+
);
|
|
499
|
+
if (!hasSelectableChoice && !hasMore) {
|
|
500
|
+
throw new ZapierCliValidationError(
|
|
501
|
+
`No ${promptLabel} available to select.`
|
|
502
|
+
);
|
|
503
|
+
}
|
|
477
504
|
if (isOptional && promptConfig.choices) {
|
|
478
505
|
promptConfig.choices.unshift({
|
|
479
506
|
name: chalk7__default.default.dim("(Skip)"),
|
|
@@ -844,7 +871,7 @@ Optional fields${pathContext}:`));
|
|
|
844
871
|
cursor ? `Fetching more choices for ${fieldMeta.title}` : `Fetching choices for ${fieldMeta.title}`
|
|
845
872
|
);
|
|
846
873
|
this.startSpinner();
|
|
847
|
-
const page = await context.sdk.
|
|
874
|
+
const page = await context.sdk.listActionInputFieldChoices({
|
|
848
875
|
app: context.resolvedParams.app,
|
|
849
876
|
action: context.resolvedParams.action,
|
|
850
877
|
actionType: context.resolvedParams.actionType,
|
|
@@ -1081,6 +1108,23 @@ Optional fields${pathContext}:`));
|
|
|
1081
1108
|
);
|
|
1082
1109
|
return functionInfo?.resolvers || {};
|
|
1083
1110
|
}
|
|
1111
|
+
getResolverConstants(sdk, functionName) {
|
|
1112
|
+
if (!functionName || typeof sdk.getRegistry !== "function") {
|
|
1113
|
+
return {};
|
|
1114
|
+
}
|
|
1115
|
+
const registry = sdk.getRegistry();
|
|
1116
|
+
const functionInfo = registry.functions.find(
|
|
1117
|
+
(f) => f.name === functionName
|
|
1118
|
+
);
|
|
1119
|
+
const resolvers = functionInfo?.resolvers ?? {};
|
|
1120
|
+
const constants = {};
|
|
1121
|
+
for (const [key, resolver] of Object.entries(resolvers)) {
|
|
1122
|
+
if (resolver && typeof resolver === "object" && resolver.type === "constant") {
|
|
1123
|
+
constants[key] = resolver.value;
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
return constants;
|
|
1127
|
+
}
|
|
1084
1128
|
};
|
|
1085
1129
|
|
|
1086
1130
|
// src/utils/cli-options.ts
|
|
@@ -1113,7 +1157,7 @@ var SHARED_COMMAND_CLI_OPTIONS = [
|
|
|
1113
1157
|
|
|
1114
1158
|
// package.json
|
|
1115
1159
|
var package_default = {
|
|
1116
|
-
version: "0.
|
|
1160
|
+
version: "0.45.0"};
|
|
1117
1161
|
|
|
1118
1162
|
// src/telemetry/builders.ts
|
|
1119
1163
|
function createCliBaseEvent(context = {}) {
|
|
@@ -1324,8 +1368,18 @@ async function unwrapHttpResponse(response) {
|
|
|
1324
1368
|
);
|
|
1325
1369
|
}
|
|
1326
1370
|
}
|
|
1371
|
+
function jsonReplacer(_key, value) {
|
|
1372
|
+
if (value instanceof Error) {
|
|
1373
|
+
return {
|
|
1374
|
+
name: value.name,
|
|
1375
|
+
message: value.message,
|
|
1376
|
+
...value.stack ? { stack: value.stack } : {}
|
|
1377
|
+
};
|
|
1378
|
+
}
|
|
1379
|
+
return value;
|
|
1380
|
+
}
|
|
1327
1381
|
function outputJson(envelope) {
|
|
1328
|
-
console.log(JSON.stringify(envelope,
|
|
1382
|
+
console.log(JSON.stringify(envelope, jsonReplacer, 2));
|
|
1329
1383
|
}
|
|
1330
1384
|
function createJsonRenderer() {
|
|
1331
1385
|
return {
|
|
@@ -1726,6 +1780,10 @@ function analyzeZodField(name, schema, functionInfo) {
|
|
|
1726
1780
|
break;
|
|
1727
1781
|
}
|
|
1728
1782
|
}
|
|
1783
|
+
const baseSchemaDef = baseSchema._zod?.def;
|
|
1784
|
+
if (baseSchema instanceof zod.z.ZodFunction || baseSchemaDef?.type === "custom") {
|
|
1785
|
+
return null;
|
|
1786
|
+
}
|
|
1729
1787
|
let paramType = "string";
|
|
1730
1788
|
let elementType;
|
|
1731
1789
|
let choices;
|
|
@@ -1920,7 +1978,8 @@ function createCommandConfig(cliCommandName, functionInfo, sdk) {
|
|
|
1920
1978
|
}
|
|
1921
1979
|
}
|
|
1922
1980
|
}
|
|
1923
|
-
const
|
|
1981
|
+
const baseDescription = functionInfo.description || schema?.description || `${cliCommandName} command`;
|
|
1982
|
+
const description = functionInfo.experimental ? `${baseDescription} (experimental)` : baseDescription;
|
|
1924
1983
|
const handler = async (...args) => {
|
|
1925
1984
|
const startTime = Date.now();
|
|
1926
1985
|
let success = true;
|
|
@@ -3156,7 +3215,8 @@ var mcpPlugin = zapierSdk.definePlugin(
|
|
|
3156
3215
|
await zapierSdkMcp.startMcpServer({
|
|
3157
3216
|
...options,
|
|
3158
3217
|
debug: sdk2.context.options?.debug,
|
|
3159
|
-
extensions: sdk2.context.extensions
|
|
3218
|
+
extensions: sdk2.context.extensions,
|
|
3219
|
+
experimental: sdk2.context.experimental
|
|
3160
3220
|
});
|
|
3161
3221
|
}
|
|
3162
3222
|
})
|
|
@@ -3179,15 +3239,6 @@ var bundleCodePlugin = zapierSdk.definePlugin(
|
|
|
3179
3239
|
handler: async ({ options }) => bundleCode(options)
|
|
3180
3240
|
})
|
|
3181
3241
|
);
|
|
3182
|
-
var ZapierBundleError = class extends Error {
|
|
3183
|
-
constructor(message, details, originalError) {
|
|
3184
|
-
super(message);
|
|
3185
|
-
this.code = "ZAPIER_BUNDLE_ERROR";
|
|
3186
|
-
this.name = "ZapierBundleError";
|
|
3187
|
-
this.details = details;
|
|
3188
|
-
this.originalError = originalError;
|
|
3189
|
-
}
|
|
3190
|
-
};
|
|
3191
3242
|
async function bundleCode(options) {
|
|
3192
3243
|
const {
|
|
3193
3244
|
input,
|
|
@@ -3215,14 +3266,14 @@ async function bundleCode(options) {
|
|
|
3215
3266
|
});
|
|
3216
3267
|
if (result.errors.length > 0) {
|
|
3217
3268
|
const errorMessages = result.errors.map((e) => e.text);
|
|
3218
|
-
throw new ZapierBundleError(
|
|
3269
|
+
throw new zapierSdk.ZapierBundleError(
|
|
3219
3270
|
`Bundle failed: ${errorMessages.join(", ")}`,
|
|
3220
|
-
errorMessages
|
|
3271
|
+
{ buildErrors: errorMessages }
|
|
3221
3272
|
);
|
|
3222
3273
|
}
|
|
3223
3274
|
const bundledCode = result.outputFiles?.[0]?.text;
|
|
3224
3275
|
if (!bundledCode) {
|
|
3225
|
-
throw new ZapierBundleError("No output generated");
|
|
3276
|
+
throw new zapierSdk.ZapierBundleError("No output generated");
|
|
3226
3277
|
}
|
|
3227
3278
|
let finalOutput = bundledCode;
|
|
3228
3279
|
if (returnString) {
|
|
@@ -3234,13 +3285,12 @@ async function bundleCode(options) {
|
|
|
3234
3285
|
}
|
|
3235
3286
|
return finalOutput;
|
|
3236
3287
|
} catch (error) {
|
|
3237
|
-
if (error instanceof ZapierBundleError) {
|
|
3288
|
+
if (error instanceof zapierSdk.ZapierBundleError) {
|
|
3238
3289
|
throw error;
|
|
3239
3290
|
}
|
|
3240
|
-
throw new ZapierBundleError(
|
|
3291
|
+
throw new zapierSdk.ZapierBundleError(
|
|
3241
3292
|
`Bundle failed: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
3242
|
-
void 0
|
|
3243
|
-
error instanceof Error ? error : void 0
|
|
3293
|
+
{ cause: error instanceof Error ? error : void 0 }
|
|
3244
3294
|
);
|
|
3245
3295
|
}
|
|
3246
3296
|
}
|
|
@@ -3415,7 +3465,7 @@ var AstTypeGenerator = class {
|
|
|
3415
3465
|
const actions = actionsResult.data;
|
|
3416
3466
|
const actionsWithFields = [];
|
|
3417
3467
|
const inputFieldsTasks = actions.map(
|
|
3418
|
-
(action) => () => sdk.
|
|
3468
|
+
(action) => () => sdk.listActionInputFields({
|
|
3419
3469
|
appKey: app.implementation_id,
|
|
3420
3470
|
actionKey: action.key,
|
|
3421
3471
|
actionType: action.action_type,
|
|
@@ -4292,11 +4342,12 @@ var CurlSchema = zod.z.object({
|
|
|
4292
4342
|
/** @deprecated Use `connection` instead. */
|
|
4293
4343
|
connectionId: zod.z.union([zod.z.string(), zod.z.number()]).optional().meta({ deprecated: true })
|
|
4294
4344
|
}).describe("Make HTTP requests through Zapier Relay with curl-like options");
|
|
4295
|
-
var
|
|
4345
|
+
var ZapierCurlExitError = class extends zapierSdk.ZapierError {
|
|
4296
4346
|
constructor(message, exitCode) {
|
|
4297
4347
|
super(message);
|
|
4348
|
+
this.name = "ZapierCurlExitError";
|
|
4349
|
+
this.code = "ZAPIER_CURL_EXIT_ERROR";
|
|
4298
4350
|
this.exitCode = exitCode;
|
|
4299
|
-
this.name = "CurlExitError";
|
|
4300
4351
|
}
|
|
4301
4352
|
};
|
|
4302
4353
|
function parseHeaderLine(input) {
|
|
@@ -4388,7 +4439,7 @@ async function resolveDataArgBinary(raw) {
|
|
|
4388
4439
|
}
|
|
4389
4440
|
async function buildFormData(formArgs, formStringArgs) {
|
|
4390
4441
|
if (typeof FormData === "undefined") {
|
|
4391
|
-
throw new
|
|
4442
|
+
throw new ZapierCurlExitError(
|
|
4392
4443
|
"FormData is not available in this runtime; cannot use --form.",
|
|
4393
4444
|
2
|
|
4394
4445
|
);
|
|
@@ -4397,7 +4448,7 @@ async function buildFormData(formArgs, formStringArgs) {
|
|
|
4397
4448
|
const addField = async (item, forceString) => {
|
|
4398
4449
|
const idx = item.indexOf("=");
|
|
4399
4450
|
if (idx === -1) {
|
|
4400
|
-
throw new
|
|
4451
|
+
throw new ZapierCurlExitError(
|
|
4401
4452
|
`Invalid form field: '${item}'. Expected 'name=value' or 'name=@file'.`,
|
|
4402
4453
|
2
|
|
4403
4454
|
);
|
|
@@ -4405,7 +4456,7 @@ async function buildFormData(formArgs, formStringArgs) {
|
|
|
4405
4456
|
const name = item.slice(0, idx);
|
|
4406
4457
|
const value = item.slice(idx + 1);
|
|
4407
4458
|
if (!name) {
|
|
4408
|
-
throw new
|
|
4459
|
+
throw new ZapierCurlExitError(
|
|
4409
4460
|
`Invalid form field: '${item}'. Field name cannot be empty.`,
|
|
4410
4461
|
2
|
|
4411
4462
|
);
|
|
@@ -4642,7 +4693,7 @@ ${Array.from(
|
|
|
4642
4693
|
`
|
|
4643
4694
|
);
|
|
4644
4695
|
}
|
|
4645
|
-
throw new
|
|
4696
|
+
throw new ZapierCurlExitError("HTTP request failed", 22);
|
|
4646
4697
|
}
|
|
4647
4698
|
return void 0;
|
|
4648
4699
|
}
|
|
@@ -5188,11 +5239,481 @@ var initPlugin = zapierSdk.definePlugin(
|
|
|
5188
5239
|
}
|
|
5189
5240
|
})
|
|
5190
5241
|
);
|
|
5242
|
+
var CliSkipLeaseExpireError = class extends Error {
|
|
5243
|
+
constructor() {
|
|
5244
|
+
super("user skipped (let lease expire)");
|
|
5245
|
+
this.name = "CliSkipLeaseExpireError";
|
|
5246
|
+
}
|
|
5247
|
+
};
|
|
5248
|
+
function createInteractiveCallback() {
|
|
5249
|
+
let messageNumber = 0;
|
|
5250
|
+
return async (message) => {
|
|
5251
|
+
messageNumber++;
|
|
5252
|
+
const attrs = message.message_attributes;
|
|
5253
|
+
console.log(
|
|
5254
|
+
`
|
|
5255
|
+
${chalk7__default.default.bold(`Message #${messageNumber}`)} ${chalk7__default.default.dim(message.id)} ${chalk7__default.default.dim(`(lease #${attrs.lease_count})`)}`
|
|
5256
|
+
);
|
|
5257
|
+
if (attrs.error_message) {
|
|
5258
|
+
console.log(chalk7__default.default.yellow(` upstream error: ${attrs.error_message}`));
|
|
5259
|
+
}
|
|
5260
|
+
if (attrs.possible_duplicate_data) {
|
|
5261
|
+
console.log(chalk7__default.default.yellow(" possible duplicate data"));
|
|
5262
|
+
}
|
|
5263
|
+
while (true) {
|
|
5264
|
+
let action;
|
|
5265
|
+
try {
|
|
5266
|
+
const answer = await inquirer__default.default.prompt([
|
|
5267
|
+
{
|
|
5268
|
+
type: "list",
|
|
5269
|
+
name: "action",
|
|
5270
|
+
message: "Action?",
|
|
5271
|
+
choices: [
|
|
5272
|
+
{ name: "Ack (remove from inbox)", value: "ack" },
|
|
5273
|
+
{
|
|
5274
|
+
name: "Skip (release after draining)",
|
|
5275
|
+
value: "skip-release"
|
|
5276
|
+
},
|
|
5277
|
+
{ name: "Skip (let lease expire)", value: "skip-expire" },
|
|
5278
|
+
{ name: "View payload", value: "view" },
|
|
5279
|
+
{ name: "Quit", value: "quit" }
|
|
5280
|
+
]
|
|
5281
|
+
}
|
|
5282
|
+
]);
|
|
5283
|
+
action = answer.action;
|
|
5284
|
+
} catch (error) {
|
|
5285
|
+
if (error instanceof Error && error.name === "ExitPromptError") {
|
|
5286
|
+
throw new zapierSdk.ZapierAbortDrainSignal("user pressed Ctrl-C");
|
|
5287
|
+
}
|
|
5288
|
+
throw error;
|
|
5289
|
+
}
|
|
5290
|
+
if (action === "view") {
|
|
5291
|
+
console.log(chalk7__default.default.dim(JSON.stringify(message.payload, null, 2)));
|
|
5292
|
+
continue;
|
|
5293
|
+
}
|
|
5294
|
+
if (action === "ack") {
|
|
5295
|
+
return;
|
|
5296
|
+
}
|
|
5297
|
+
if (action === "skip-release") {
|
|
5298
|
+
throw new zapierSdk.ZapierReleaseTriggerMessageSignal("user skipped (release)");
|
|
5299
|
+
}
|
|
5300
|
+
if (action === "skip-expire") {
|
|
5301
|
+
throw new CliSkipLeaseExpireError();
|
|
5302
|
+
}
|
|
5303
|
+
if (action === "quit") {
|
|
5304
|
+
throw new zapierSdk.ZapierAbortDrainSignal("user requested quit");
|
|
5305
|
+
}
|
|
5306
|
+
}
|
|
5307
|
+
};
|
|
5308
|
+
}
|
|
5309
|
+
function createNdjsonCallback() {
|
|
5310
|
+
return (message) => new Promise((resolve4, reject) => {
|
|
5311
|
+
process.stdout.write(JSON.stringify(message) + "\n", (err) => {
|
|
5312
|
+
if (err) reject(err);
|
|
5313
|
+
else resolve4();
|
|
5314
|
+
});
|
|
5315
|
+
});
|
|
5316
|
+
}
|
|
5317
|
+
function runSubprocess(options) {
|
|
5318
|
+
const { command, args, shell, label, message, signal } = options;
|
|
5319
|
+
return new Promise((resolve4, reject) => {
|
|
5320
|
+
const child = child_process.spawn(command, args, {
|
|
5321
|
+
shell,
|
|
5322
|
+
stdio: ["pipe", "inherit", "inherit"]
|
|
5323
|
+
});
|
|
5324
|
+
let abortListener;
|
|
5325
|
+
if (signal) {
|
|
5326
|
+
if (signal.aborted) {
|
|
5327
|
+
child.kill();
|
|
5328
|
+
} else {
|
|
5329
|
+
abortListener = () => {
|
|
5330
|
+
child.kill();
|
|
5331
|
+
};
|
|
5332
|
+
signal.addEventListener("abort", abortListener, { once: true });
|
|
5333
|
+
}
|
|
5334
|
+
}
|
|
5335
|
+
child.on("error", (err) => {
|
|
5336
|
+
if (signal && abortListener) {
|
|
5337
|
+
signal.removeEventListener("abort", abortListener);
|
|
5338
|
+
}
|
|
5339
|
+
reject(err);
|
|
5340
|
+
});
|
|
5341
|
+
child.on("close", (code) => {
|
|
5342
|
+
if (signal && abortListener) {
|
|
5343
|
+
signal.removeEventListener("abort", abortListener);
|
|
5344
|
+
}
|
|
5345
|
+
if (signal?.aborted) {
|
|
5346
|
+
reject(new zapierSdk.ZapierAbortDrainSignal(`${label} aborted`));
|
|
5347
|
+
return;
|
|
5348
|
+
}
|
|
5349
|
+
if (code === 0) resolve4();
|
|
5350
|
+
else
|
|
5351
|
+
reject(
|
|
5352
|
+
new Error(
|
|
5353
|
+
`${label} exited with code ${code} for message ${message.id}`
|
|
5354
|
+
)
|
|
5355
|
+
);
|
|
5356
|
+
});
|
|
5357
|
+
child.stdin.on("error", (err) => {
|
|
5358
|
+
if (err.code !== "EPIPE") reject(err);
|
|
5359
|
+
});
|
|
5360
|
+
child.stdin.end(JSON.stringify(message) + "\n");
|
|
5361
|
+
});
|
|
5362
|
+
}
|
|
5363
|
+
function runShellCommand(command, message, signal) {
|
|
5364
|
+
return runSubprocess({
|
|
5365
|
+
command,
|
|
5366
|
+
args: [],
|
|
5367
|
+
shell: true,
|
|
5368
|
+
label: "exec-shell",
|
|
5369
|
+
message,
|
|
5370
|
+
signal
|
|
5371
|
+
});
|
|
5372
|
+
}
|
|
5373
|
+
function runExecCommand(argv, message, signal) {
|
|
5374
|
+
if (argv.length === 0) {
|
|
5375
|
+
return Promise.reject(
|
|
5376
|
+
new Error("exec requires at least one element (the binary)")
|
|
5377
|
+
);
|
|
5378
|
+
}
|
|
5379
|
+
const [command, ...args] = argv;
|
|
5380
|
+
return runSubprocess({
|
|
5381
|
+
command,
|
|
5382
|
+
args,
|
|
5383
|
+
shell: false,
|
|
5384
|
+
label: "exec",
|
|
5385
|
+
message,
|
|
5386
|
+
signal
|
|
5387
|
+
});
|
|
5388
|
+
}
|
|
5389
|
+
function describeReason(reason) {
|
|
5390
|
+
return reason instanceof Error ? reason.message : String(reason);
|
|
5391
|
+
}
|
|
5392
|
+
function printDrainError(reason, message) {
|
|
5393
|
+
console.error(
|
|
5394
|
+
chalk7__default.default.red(`Error processing ${message.id}: ${describeReason(reason)}`)
|
|
5395
|
+
);
|
|
5396
|
+
}
|
|
5397
|
+
function printDrainSummary(counts) {
|
|
5398
|
+
const skipped = counts.skipped ?? 0;
|
|
5399
|
+
const total = counts.fulfilled + counts.rejected + skipped;
|
|
5400
|
+
const parts = [`${counts.fulfilled} fulfilled`];
|
|
5401
|
+
if (skipped > 0) parts.push(`${skipped} skipped`);
|
|
5402
|
+
parts.push(`${counts.rejected} rejected`);
|
|
5403
|
+
console.log(
|
|
5404
|
+
chalk7__default.default.dim(
|
|
5405
|
+
`
|
|
5406
|
+
Processed ${total} message${total === 1 ? "" : "s"} (${parts.join(", ")}).`
|
|
5407
|
+
)
|
|
5408
|
+
);
|
|
5409
|
+
}
|
|
5410
|
+
function warnInteractiveContinueOnErrorOverride() {
|
|
5411
|
+
console.warn(
|
|
5412
|
+
chalk7__default.default.yellow(
|
|
5413
|
+
'Note: continueOnError=false is overridden to true in interactive mode (the "Skip (let lease expire)" choice would otherwise terminate the drain).'
|
|
5414
|
+
)
|
|
5415
|
+
);
|
|
5416
|
+
}
|
|
5417
|
+
function requireInteractiveTty(commandName) {
|
|
5418
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
5419
|
+
throw new ZapierCliValidationError(
|
|
5420
|
+
`${commandName} needs an interactive terminal by default. Pass --exec '<bin>' (with optional \`-- args...\`) or --exec-shell '<cmd>' to run a script per message, or --json for non-interactive output.`
|
|
5421
|
+
);
|
|
5422
|
+
}
|
|
5423
|
+
}
|
|
5424
|
+
function rejectExecJsonMutex(opts) {
|
|
5425
|
+
const picked = [
|
|
5426
|
+
opts.exec ? "--exec" : null,
|
|
5427
|
+
opts.execShell ? "--exec-shell" : null,
|
|
5428
|
+
opts.json ? "--json" : null
|
|
5429
|
+
].filter((x) => x !== null);
|
|
5430
|
+
if (picked.length > 1) {
|
|
5431
|
+
throw new ZapierCliValidationError(
|
|
5432
|
+
`${picked.join(", ")} are mutually exclusive. Pick one.`
|
|
5433
|
+
);
|
|
5434
|
+
}
|
|
5435
|
+
}
|
|
5436
|
+
function getPostDashArgs(argv = process.argv) {
|
|
5437
|
+
const idx = argv.indexOf("--");
|
|
5438
|
+
if (idx === -1) return [];
|
|
5439
|
+
return argv.slice(idx + 1);
|
|
5440
|
+
}
|
|
5441
|
+
function combineSignals(a, b) {
|
|
5442
|
+
if (!a) {
|
|
5443
|
+
return { signal: b, dispose: () => void 0 };
|
|
5444
|
+
}
|
|
5445
|
+
const controller = new AbortController();
|
|
5446
|
+
const onAbort = () => controller.abort();
|
|
5447
|
+
if (a.aborted || b.aborted) controller.abort();
|
|
5448
|
+
else {
|
|
5449
|
+
a.addEventListener("abort", onAbort, { once: true });
|
|
5450
|
+
b.addEventListener("abort", onAbort, { once: true });
|
|
5451
|
+
}
|
|
5452
|
+
return {
|
|
5453
|
+
signal: controller.signal,
|
|
5454
|
+
dispose: () => {
|
|
5455
|
+
a.removeEventListener("abort", onAbort);
|
|
5456
|
+
b.removeEventListener("abort", onAbort);
|
|
5457
|
+
}
|
|
5458
|
+
};
|
|
5459
|
+
}
|
|
5460
|
+
|
|
5461
|
+
// src/plugins/drainTriggerInbox/index.ts
|
|
5462
|
+
var JsonProperty = zod.z.boolean().optional().describe(
|
|
5463
|
+
"Format the drained result as a JSON object on stdout: { data, errors }. Use for scripts or piping. Mutually exclusive with --exec / --exec-shell and the interactive default."
|
|
5464
|
+
);
|
|
5465
|
+
var ExecCliProperty = zod.z.string().optional().describe(
|
|
5466
|
+
"Run a binary per message with no shell interpretation. Message JSON is piped to stdin; exit code 0 acks, non-zero records the error per the same rules as a thrown handler. Pass extra argv after `--` (e.g. `--exec ./handler -- --verbose`). Mutually exclusive with --exec-shell and --json."
|
|
5467
|
+
);
|
|
5468
|
+
var ExecShellCliProperty = zod.z.string().optional().describe(
|
|
5469
|
+
"Run a shell command per message. Message JSON is piped to the subprocess on stdin; exit code 0 acks, non-zero records the error per the same rules as a thrown handler. Interpreted by the platform's default shell (sh on POSIX, cmd.exe on Windows). Mutually exclusive with --exec and --json."
|
|
5470
|
+
);
|
|
5471
|
+
var drainTriggerInboxCliPlugin = zapierSdk.definePlugin(
|
|
5472
|
+
(sdk) => {
|
|
5473
|
+
const original = sdk.drainTriggerInbox;
|
|
5474
|
+
const existingMeta = sdk.context.meta.drainTriggerInbox;
|
|
5475
|
+
const baseInputSchema = existingMeta.inputSchema;
|
|
5476
|
+
const extendedInputSchema = baseInputSchema ? baseInputSchema.extend({
|
|
5477
|
+
exec: ExecCliProperty,
|
|
5478
|
+
execShell: ExecShellCliProperty,
|
|
5479
|
+
json: JsonProperty
|
|
5480
|
+
}) : zod.z.object({
|
|
5481
|
+
exec: ExecCliProperty,
|
|
5482
|
+
execShell: ExecShellCliProperty,
|
|
5483
|
+
json: JsonProperty
|
|
5484
|
+
});
|
|
5485
|
+
return {
|
|
5486
|
+
drainTriggerInbox: async (options) => {
|
|
5487
|
+
const { json, exec, execShell, ...sdkArgs } = options;
|
|
5488
|
+
rejectExecJsonMutex({ exec, execShell, json });
|
|
5489
|
+
if (!exec && !execShell && !json) {
|
|
5490
|
+
requireInteractiveTty("drain-trigger-inbox");
|
|
5491
|
+
}
|
|
5492
|
+
const sigintController = new AbortController();
|
|
5493
|
+
const onSigint = () => sigintController.abort();
|
|
5494
|
+
process.on("SIGINT", onSigint);
|
|
5495
|
+
const combined = combineSignals(
|
|
5496
|
+
sdkArgs.signal,
|
|
5497
|
+
sigintController.signal
|
|
5498
|
+
);
|
|
5499
|
+
let fulfilled = 0;
|
|
5500
|
+
let rejected = 0;
|
|
5501
|
+
let skipped = 0;
|
|
5502
|
+
const liveOnError = (reason, message) => {
|
|
5503
|
+
rejected++;
|
|
5504
|
+
printDrainError(reason, message);
|
|
5505
|
+
};
|
|
5506
|
+
try {
|
|
5507
|
+
if (exec) {
|
|
5508
|
+
const execArgv = [exec, ...getPostDashArgs()];
|
|
5509
|
+
await original({
|
|
5510
|
+
...sdkArgs,
|
|
5511
|
+
signal: combined.signal,
|
|
5512
|
+
onMessage: async (message) => {
|
|
5513
|
+
await runExecCommand(execArgv, message, combined.signal);
|
|
5514
|
+
fulfilled++;
|
|
5515
|
+
},
|
|
5516
|
+
onError: liveOnError
|
|
5517
|
+
});
|
|
5518
|
+
return;
|
|
5519
|
+
}
|
|
5520
|
+
if (execShell) {
|
|
5521
|
+
await original({
|
|
5522
|
+
...sdkArgs,
|
|
5523
|
+
signal: combined.signal,
|
|
5524
|
+
onMessage: async (message) => {
|
|
5525
|
+
await runShellCommand(execShell, message, combined.signal);
|
|
5526
|
+
fulfilled++;
|
|
5527
|
+
},
|
|
5528
|
+
onError: liveOnError
|
|
5529
|
+
});
|
|
5530
|
+
return;
|
|
5531
|
+
}
|
|
5532
|
+
if (json) {
|
|
5533
|
+
const data = [];
|
|
5534
|
+
const errors = [];
|
|
5535
|
+
await original({
|
|
5536
|
+
...sdkArgs,
|
|
5537
|
+
signal: combined.signal,
|
|
5538
|
+
continueOnError: true,
|
|
5539
|
+
onMessage: (message) => {
|
|
5540
|
+
data.push(message);
|
|
5541
|
+
},
|
|
5542
|
+
onError: (reason, message) => {
|
|
5543
|
+
errors.push({ reason, message });
|
|
5544
|
+
}
|
|
5545
|
+
});
|
|
5546
|
+
process.stdout.write(
|
|
5547
|
+
JSON.stringify({ data, errors }, jsonReplacer, 2) + "\n"
|
|
5548
|
+
);
|
|
5549
|
+
return;
|
|
5550
|
+
}
|
|
5551
|
+
if (sdkArgs.continueOnError === false) {
|
|
5552
|
+
warnInteractiveContinueOnErrorOverride();
|
|
5553
|
+
}
|
|
5554
|
+
const interactive = createInteractiveCallback();
|
|
5555
|
+
await original({
|
|
5556
|
+
...sdkArgs,
|
|
5557
|
+
signal: combined.signal,
|
|
5558
|
+
concurrency: 1,
|
|
5559
|
+
continueOnError: true,
|
|
5560
|
+
onMessage: async (message) => {
|
|
5561
|
+
try {
|
|
5562
|
+
await interactive(message);
|
|
5563
|
+
fulfilled++;
|
|
5564
|
+
} catch (err) {
|
|
5565
|
+
if (err instanceof zapierSdk.ZapierReleaseTriggerMessageSignal || err instanceof CliSkipLeaseExpireError) {
|
|
5566
|
+
skipped++;
|
|
5567
|
+
}
|
|
5568
|
+
throw err;
|
|
5569
|
+
}
|
|
5570
|
+
}
|
|
5571
|
+
});
|
|
5572
|
+
} finally {
|
|
5573
|
+
process.off("SIGINT", onSigint);
|
|
5574
|
+
combined.dispose();
|
|
5575
|
+
if (!json) {
|
|
5576
|
+
printDrainSummary({ fulfilled, rejected, skipped });
|
|
5577
|
+
}
|
|
5578
|
+
}
|
|
5579
|
+
},
|
|
5580
|
+
context: {
|
|
5581
|
+
meta: {
|
|
5582
|
+
drainTriggerInbox: {
|
|
5583
|
+
...existingMeta,
|
|
5584
|
+
inputSchema: extendedInputSchema,
|
|
5585
|
+
packages: void 0
|
|
5586
|
+
}
|
|
5587
|
+
}
|
|
5588
|
+
}
|
|
5589
|
+
};
|
|
5590
|
+
}
|
|
5591
|
+
);
|
|
5592
|
+
var JsonProperty2 = zod.z.boolean().optional().describe(
|
|
5593
|
+
"Stream each message as JSON to stdout (one record per line, NDJSON), acking as each write completes. Use for piping to other tools. Mutually exclusive with --exec / --exec-shell and the interactive default."
|
|
5594
|
+
);
|
|
5595
|
+
var ExecCliProperty2 = zod.z.string().optional().describe(
|
|
5596
|
+
"Run a binary per message with no shell interpretation. Message JSON is piped to stdin; exit code 0 acks, non-zero records the error per the same rules as a thrown handler. Pass extra argv after `--` (e.g. `--exec ./handler -- --verbose`). Mutually exclusive with --exec-shell and --json."
|
|
5597
|
+
);
|
|
5598
|
+
var ExecShellCliProperty2 = zod.z.string().optional().describe(
|
|
5599
|
+
"Run a shell command per message. Message JSON is piped to the subprocess on stdin; exit code 0 acks, non-zero records the error per the same rules as a thrown handler. Interpreted by the platform's default shell (sh on POSIX, cmd.exe on Windows). Mutually exclusive with --exec and --json."
|
|
5600
|
+
);
|
|
5601
|
+
var watchTriggerInboxCliPlugin = zapierSdk.definePlugin(
|
|
5602
|
+
(sdk) => {
|
|
5603
|
+
const original = sdk.watchTriggerInbox;
|
|
5604
|
+
const existingMeta = sdk.context.meta.watchTriggerInbox;
|
|
5605
|
+
const baseInputSchema = existingMeta.inputSchema;
|
|
5606
|
+
const extendedInputSchema = baseInputSchema ? baseInputSchema.extend({
|
|
5607
|
+
exec: ExecCliProperty2,
|
|
5608
|
+
execShell: ExecShellCliProperty2,
|
|
5609
|
+
json: JsonProperty2
|
|
5610
|
+
}) : zod.z.object({
|
|
5611
|
+
exec: ExecCliProperty2,
|
|
5612
|
+
execShell: ExecShellCliProperty2,
|
|
5613
|
+
json: JsonProperty2
|
|
5614
|
+
});
|
|
5615
|
+
return {
|
|
5616
|
+
watchTriggerInbox: async (options) => {
|
|
5617
|
+
const { json, exec, execShell, ...sdkArgs } = options;
|
|
5618
|
+
rejectExecJsonMutex({ exec, execShell, json });
|
|
5619
|
+
if (!exec && !execShell && !json) {
|
|
5620
|
+
requireInteractiveTty("watch-trigger-inbox");
|
|
5621
|
+
}
|
|
5622
|
+
const sigintController = new AbortController();
|
|
5623
|
+
const onSigint = () => sigintController.abort();
|
|
5624
|
+
process.on("SIGINT", onSigint);
|
|
5625
|
+
const combined = combineSignals(
|
|
5626
|
+
sdkArgs.signal,
|
|
5627
|
+
sigintController.signal
|
|
5628
|
+
);
|
|
5629
|
+
let fulfilled = 0;
|
|
5630
|
+
let rejected = 0;
|
|
5631
|
+
let skipped = 0;
|
|
5632
|
+
const liveOnError = (reason, message) => {
|
|
5633
|
+
rejected++;
|
|
5634
|
+
printDrainError(reason, message);
|
|
5635
|
+
};
|
|
5636
|
+
try {
|
|
5637
|
+
if (exec) {
|
|
5638
|
+
const execArgv = [exec, ...getPostDashArgs()];
|
|
5639
|
+
await original({
|
|
5640
|
+
...sdkArgs,
|
|
5641
|
+
signal: combined.signal,
|
|
5642
|
+
onMessage: async (message) => {
|
|
5643
|
+
await runExecCommand(execArgv, message, combined.signal);
|
|
5644
|
+
fulfilled++;
|
|
5645
|
+
},
|
|
5646
|
+
onError: liveOnError
|
|
5647
|
+
});
|
|
5648
|
+
} else if (execShell) {
|
|
5649
|
+
await original({
|
|
5650
|
+
...sdkArgs,
|
|
5651
|
+
signal: combined.signal,
|
|
5652
|
+
onMessage: async (message) => {
|
|
5653
|
+
await runShellCommand(execShell, message, combined.signal);
|
|
5654
|
+
fulfilled++;
|
|
5655
|
+
},
|
|
5656
|
+
onError: liveOnError
|
|
5657
|
+
});
|
|
5658
|
+
} else if (json) {
|
|
5659
|
+
const ndjson = createNdjsonCallback();
|
|
5660
|
+
await original({
|
|
5661
|
+
...sdkArgs,
|
|
5662
|
+
signal: combined.signal,
|
|
5663
|
+
onMessage: async (message) => {
|
|
5664
|
+
await ndjson(message);
|
|
5665
|
+
fulfilled++;
|
|
5666
|
+
},
|
|
5667
|
+
onError: liveOnError
|
|
5668
|
+
});
|
|
5669
|
+
} else {
|
|
5670
|
+
if (sdkArgs.continueOnError === false) {
|
|
5671
|
+
warnInteractiveContinueOnErrorOverride();
|
|
5672
|
+
}
|
|
5673
|
+
const interactive = createInteractiveCallback();
|
|
5674
|
+
await original({
|
|
5675
|
+
...sdkArgs,
|
|
5676
|
+
signal: combined.signal,
|
|
5677
|
+
concurrency: 1,
|
|
5678
|
+
continueOnError: true,
|
|
5679
|
+
onMessage: async (message) => {
|
|
5680
|
+
try {
|
|
5681
|
+
await interactive(message);
|
|
5682
|
+
fulfilled++;
|
|
5683
|
+
} catch (err) {
|
|
5684
|
+
if (err instanceof zapierSdk.ZapierReleaseTriggerMessageSignal || err instanceof CliSkipLeaseExpireError) {
|
|
5685
|
+
skipped++;
|
|
5686
|
+
}
|
|
5687
|
+
throw err;
|
|
5688
|
+
}
|
|
5689
|
+
}
|
|
5690
|
+
});
|
|
5691
|
+
}
|
|
5692
|
+
} finally {
|
|
5693
|
+
process.off("SIGINT", onSigint);
|
|
5694
|
+
combined.dispose();
|
|
5695
|
+
if (!json) {
|
|
5696
|
+
printDrainSummary({ fulfilled, rejected, skipped });
|
|
5697
|
+
}
|
|
5698
|
+
}
|
|
5699
|
+
},
|
|
5700
|
+
context: {
|
|
5701
|
+
meta: {
|
|
5702
|
+
watchTriggerInbox: {
|
|
5703
|
+
...existingMeta,
|
|
5704
|
+
inputSchema: extendedInputSchema,
|
|
5705
|
+
packages: void 0
|
|
5706
|
+
}
|
|
5707
|
+
}
|
|
5708
|
+
}
|
|
5709
|
+
};
|
|
5710
|
+
}
|
|
5711
|
+
);
|
|
5191
5712
|
|
|
5192
5713
|
// package.json with { type: 'json' }
|
|
5193
5714
|
var package_default2 = {
|
|
5194
5715
|
name: "@zapier/zapier-sdk-cli",
|
|
5195
|
-
version: "0.
|
|
5716
|
+
version: "0.45.0"};
|
|
5196
5717
|
|
|
5197
5718
|
// src/sdk.ts
|
|
5198
5719
|
zapierSdk.injectCliLogin(login_exports);
|
|
@@ -5217,6 +5738,31 @@ function createZapierCliSdk(options = {}) {
|
|
|
5217
5738
|
}
|
|
5218
5739
|
return chain;
|
|
5219
5740
|
}
|
|
5741
|
+
experimental.injectCliLogin(login_exports);
|
|
5742
|
+
function createZapierCliSdk2(options = {}) {
|
|
5743
|
+
const { extensions = [], ...sdkOptions } = options;
|
|
5744
|
+
const extensionsContextPlugin = () => ({
|
|
5745
|
+
context: { extensions }
|
|
5746
|
+
});
|
|
5747
|
+
const experimentalContextPlugin = () => ({
|
|
5748
|
+
context: { experimental: true }
|
|
5749
|
+
});
|
|
5750
|
+
let chain = experimental.createZapierSdk({
|
|
5751
|
+
...sdkOptions,
|
|
5752
|
+
eventEmission: { ...sdkOptions.eventEmission, callContext: "cli" },
|
|
5753
|
+
callerPackage: { name: package_default2.name, version: package_default2.version }
|
|
5754
|
+
}).addPlugin(extensionsContextPlugin).addPlugin(experimentalContextPlugin).addPlugin(generateAppTypesPlugin).addPlugin(buildManifestPlugin).addPlugin(bundleCodePlugin).addPlugin(getLoginConfigPathPlugin).addPlugin(addPlugin).addPlugin(feedbackPlugin).addPlugin(curlPlugin).addPlugin(initPlugin).addPlugin(drainTriggerInboxCliPlugin, { override: true }).addPlugin(watchTriggerInboxCliPlugin, { override: true }).addPlugin(mcpPlugin).addPlugin(loginPlugin).addPlugin(logoutPlugin).addPlugin(cliOverridesPlugin);
|
|
5755
|
+
for (const ext of extensions) {
|
|
5756
|
+
try {
|
|
5757
|
+
chain = chain.addPlugin(ext);
|
|
5758
|
+
} catch (err) {
|
|
5759
|
+
console.warn(
|
|
5760
|
+
`Extension plugin failed to construct: ${err.message}; skipping.`
|
|
5761
|
+
);
|
|
5762
|
+
}
|
|
5763
|
+
}
|
|
5764
|
+
return chain;
|
|
5765
|
+
}
|
|
5220
5766
|
|
|
5221
5767
|
// src/utils/extensions.ts
|
|
5222
5768
|
var ENV_VAR = "ZAPIER_SDK_EXTENSIONS";
|
|
@@ -5429,7 +5975,7 @@ program.name("zapier-sdk").description("CLI for Zapier SDK").version(
|
|
|
5429
5975
|
).option(
|
|
5430
5976
|
"--max-network-retry-delay-ms <ms>",
|
|
5431
5977
|
"Max delay in ms to wait for rate limit retry (default: 60000)"
|
|
5432
|
-
);
|
|
5978
|
+
).option("--experimental", "Use the experimental SDK / CLI surface");
|
|
5433
5979
|
var booleanFlags = [];
|
|
5434
5980
|
for (const [key, fieldSchema] of Object.entries(
|
|
5435
5981
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -5494,11 +6040,13 @@ for (const { camelName, kebabFlag } of booleanFlags) {
|
|
|
5494
6040
|
flagOverrides[camelName] = true;
|
|
5495
6041
|
}
|
|
5496
6042
|
}
|
|
6043
|
+
var useExperimental = process.argv.includes("--experimental") || process.env.ZAPIER_EXPERIMENTAL === "1" || process.env.ZAPIER_EXPERIMENTAL === "true";
|
|
6044
|
+
var createZapierCliSdk3 = useExperimental ? createZapierCliSdk2 : createZapierCliSdk;
|
|
5497
6045
|
program.exitOverride();
|
|
5498
6046
|
(async () => {
|
|
5499
6047
|
let exitCode = 0;
|
|
5500
6048
|
const extensions = await resolveExtensions();
|
|
5501
|
-
const sdk =
|
|
6049
|
+
const sdk = createZapierCliSdk3({
|
|
5502
6050
|
debug: isDebugMode,
|
|
5503
6051
|
credentials,
|
|
5504
6052
|
baseUrl,
|