@zapier/zapier-sdk-cli 0.48.0 β 0.48.2
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 +22 -0
- package/README.md +21 -0
- package/dist/cli.cjs +45 -5
- package/dist/cli.mjs +45 -5
- package/dist/experimental.cjs +2 -1
- package/dist/experimental.mjs +2 -1
- package/dist/index.cjs +3 -2
- package/dist/index.mjs +3 -2
- package/dist/package.json +1 -1
- package/dist/src/cli.js +32 -3
- package/dist/src/plugins/mcp/index.d.ts +1 -0
- package/dist/src/plugins/mcp/index.js +8 -7
- package/dist/src/utils/parameter-resolver.js +29 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @zapier/zapier-sdk-cli
|
|
2
2
|
|
|
3
|
+
## 0.48.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 23352c8: Trigger inbox fixes and additions:
|
|
8
|
+
- Send `connection_id: null` for trigger inboxes without a connection so connection-less apps (e.g. tables) work correctly.
|
|
9
|
+
- Add `listTriggers`, a read variant of `listActions` that lists an app's triggers.
|
|
10
|
+
- Add interactive resolvers to trigger inbox message methods: `ackTriggerInboxMessages` and `releaseTriggerInboxMessages` prompt for `messages` with a multi-select of leased messages; `leaseTriggerInboxMessages` prompts for `leaseLimit` and `leaseSeconds`.
|
|
11
|
+
- CLI: coerce static prompt input to the schema's underlying type so numeric/boolean fields (e.g. `leaseLimit`, `leaseSeconds`) no longer fail Zod validation with "expected number, received string".
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [23352c8]
|
|
14
|
+
- @zapier/zapier-sdk@0.53.0
|
|
15
|
+
- @zapier/zapier-sdk-mcp@0.13.4
|
|
16
|
+
|
|
17
|
+
## 0.48.1
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [7984fae]
|
|
22
|
+
- @zapier/zapier-sdk@0.52.0
|
|
23
|
+
- @zapier/zapier-sdk-mcp@0.13.3
|
|
24
|
+
|
|
3
25
|
## 0.48.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
- [`list-trigger-inboxes`](#list-trigger-inboxes--experimental)
|
|
59
59
|
- [`list-trigger-input-field-choices`](#list-trigger-input-field-choices--experimental)
|
|
60
60
|
- [`list-trigger-input-fields`](#list-trigger-input-fields--experimental)
|
|
61
|
+
- [`list-triggers`](#list-triggers--experimental)
|
|
61
62
|
- [`pause-trigger-inbox`](#pause-trigger-inbox--experimental)
|
|
62
63
|
- [`release-trigger-inbox-messages`](#release-trigger-inbox-messages--experimental)
|
|
63
64
|
- [`resume-trigger-inbox`](#resume-trigger-inbox--experimental)
|
|
@@ -146,6 +147,7 @@ These options are available for all commands:
|
|
|
146
147
|
| `--tracking-base-url <url>` | | Base URL for Zapier tracking endpoints. |
|
|
147
148
|
| `--max-network-retries <count>` | | Max retries for rate-limited requests (default: 3). |
|
|
148
149
|
| `--max-network-retry-delay-ms <ms>` | | Max delay in ms to wait for retry (default: 60000). |
|
|
150
|
+
| `--max-concurrent-requests <count>` | | Max concurrent in-flight HTTP requests (default: 200, max: 10000). |
|
|
149
151
|
| `--approval-timeout-ms <ms>` | | Timeout in ms for approval polling. Default: 600000 (10 min). |
|
|
150
152
|
| `--max-approval-retries` | | Maximum number of sequential approval rounds per request (one per gating policy) before giving up. Default: 2. |
|
|
151
153
|
| `--approval-mode` | | Approval flow behavior. "disabled" (default) throws a ZapierApprovalError on approval-required responses without creating an approval. "poll" creates the approval, opens it in a browser, polls until resolved, and retries the original request. "throw" creates the approval and throws a ZapierApprovalError with the approval URL so the caller can surface it. Defaults to the ZAPIER_APPROVAL_MODE env var, then "disabled". |
|
|
@@ -1013,6 +1015,25 @@ Get the input fields required for a specific trigger
|
|
|
1013
1015
|
npx zapier-sdk list-trigger-input-fields <app> <action> [--connection] [--inputs] [--page-size] [--max-items] [--cursor]
|
|
1014
1016
|
```
|
|
1015
1017
|
|
|
1018
|
+
#### `list-triggers` π§ͺ _experimental_
|
|
1019
|
+
|
|
1020
|
+
List all triggers for a specific app
|
|
1021
|
+
|
|
1022
|
+
**Options:**
|
|
1023
|
+
|
|
1024
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
1025
|
+
| ------------- | -------- | -------- | ------- | --------------- | ----------------------------------------------------------------------- |
|
|
1026
|
+
| `<app>` | `string` | β
| β | β | App key of triggers to list (e.g., 'SlackCLIAPI' or slug like 'github') |
|
|
1027
|
+
| `--page-size` | `number` | β | β | β | Number of triggers per page |
|
|
1028
|
+
| `--max-items` | `number` | β | β | β | Maximum total items to return across all pages |
|
|
1029
|
+
| `--cursor` | `string` | β | β | β | Cursor to start from |
|
|
1030
|
+
|
|
1031
|
+
**Usage:**
|
|
1032
|
+
|
|
1033
|
+
```bash
|
|
1034
|
+
npx zapier-sdk list-triggers <app> [--page-size] [--max-items] [--cursor]
|
|
1035
|
+
```
|
|
1036
|
+
|
|
1016
1037
|
#### `pause-trigger-inbox` π§ͺ _experimental_
|
|
1017
1038
|
|
|
1018
1039
|
Pause a trigger inbox; events stop being collected
|
package/dist/cli.cjs
CHANGED
|
@@ -156,6 +156,26 @@ function getLocalResolutionOrderForParams(paramNames, resolvers) {
|
|
|
156
156
|
}
|
|
157
157
|
return order;
|
|
158
158
|
}
|
|
159
|
+
function unwrapSchema(schema) {
|
|
160
|
+
let current = schema;
|
|
161
|
+
while (current instanceof zod.z.ZodOptional || current instanceof zod.z.ZodDefault || current instanceof zod.z.ZodNullable) {
|
|
162
|
+
current = current._zod.def.innerType;
|
|
163
|
+
}
|
|
164
|
+
return current;
|
|
165
|
+
}
|
|
166
|
+
function coerceToSchemaType(value, schema) {
|
|
167
|
+
if (typeof value !== "string") return value;
|
|
168
|
+
const base = unwrapSchema(schema);
|
|
169
|
+
if (base instanceof zod.z.ZodNumber) {
|
|
170
|
+
const n = Number(value);
|
|
171
|
+
return Number.isNaN(n) ? value : n;
|
|
172
|
+
}
|
|
173
|
+
if (base instanceof zod.z.ZodBoolean) {
|
|
174
|
+
if (value === "true") return true;
|
|
175
|
+
if (value === "false") return false;
|
|
176
|
+
}
|
|
177
|
+
return value;
|
|
178
|
+
}
|
|
159
179
|
var SchemaParameterResolver = class {
|
|
160
180
|
constructor() {
|
|
161
181
|
this.debug = false;
|
|
@@ -442,7 +462,7 @@ var SchemaParameterResolver = class {
|
|
|
442
462
|
if (isOptional && (value === void 0 || value === "" || value === staticResolver.placeholder)) {
|
|
443
463
|
return void 0;
|
|
444
464
|
}
|
|
445
|
-
return value;
|
|
465
|
+
return coerceToSchemaType(value, param.schema);
|
|
446
466
|
} else if (resolver.type === "dynamic") {
|
|
447
467
|
const dynamicResolver = resolver;
|
|
448
468
|
this.startSpinner();
|
|
@@ -1190,7 +1210,7 @@ var SHARED_COMMAND_CLI_OPTIONS = [
|
|
|
1190
1210
|
|
|
1191
1211
|
// package.json
|
|
1192
1212
|
var package_default = {
|
|
1193
|
-
version: "0.48.
|
|
1213
|
+
version: "0.48.2"};
|
|
1194
1214
|
|
|
1195
1215
|
// src/telemetry/builders.ts
|
|
1196
1216
|
function createCliBaseEvent(context = {}) {
|
|
@@ -3722,6 +3742,7 @@ var mcpPlugin = zapierSdk.definePlugin(
|
|
|
3722
3742
|
await zapierSdkMcp.startMcpServer({
|
|
3723
3743
|
...options,
|
|
3724
3744
|
debug: sdk2.context.options?.debug,
|
|
3745
|
+
maxConcurrentRequests: sdk2.context.options?.maxConcurrentRequests,
|
|
3725
3746
|
extensions: sdk2.context.extensions,
|
|
3726
3747
|
experimental: sdk2.context.experimental
|
|
3727
3748
|
});
|
|
@@ -6220,7 +6241,7 @@ var watchTriggerInboxCliPlugin = zapierSdk.definePlugin(
|
|
|
6220
6241
|
// package.json with { type: 'json' }
|
|
6221
6242
|
var package_default2 = {
|
|
6222
6243
|
name: "@zapier/zapier-sdk-cli",
|
|
6223
|
-
version: "0.48.
|
|
6244
|
+
version: "0.48.2"};
|
|
6224
6245
|
|
|
6225
6246
|
// src/sdk.ts
|
|
6226
6247
|
zapierSdk.injectCliLogin(login_exports);
|
|
@@ -6482,6 +6503,9 @@ program.name("zapier-sdk").description("CLI for Zapier SDK").version(
|
|
|
6482
6503
|
).option(
|
|
6483
6504
|
"--max-network-retry-delay-ms <ms>",
|
|
6484
6505
|
"Max delay in ms to wait for rate limit retry (default: 60000)"
|
|
6506
|
+
).option(
|
|
6507
|
+
"--max-concurrent-requests <count>",
|
|
6508
|
+
"Max concurrent in-flight HTTP requests (default: 200). Pass 'Infinity' to disable."
|
|
6485
6509
|
).option("--experimental", "Use the experimental SDK / CLI surface");
|
|
6486
6510
|
var booleanFlags = [];
|
|
6487
6511
|
for (const [key, fieldSchema] of Object.entries(
|
|
@@ -6505,8 +6529,13 @@ program.helpOption(
|
|
|
6505
6529
|
);
|
|
6506
6530
|
var isDebugMode = process.env.DEBUG === "true" || process.argv.includes("--debug");
|
|
6507
6531
|
function getFlagValue(flagName) {
|
|
6508
|
-
const
|
|
6509
|
-
|
|
6532
|
+
const prefix = `${flagName}=`;
|
|
6533
|
+
for (let i = 0; i < process.argv.length; i++) {
|
|
6534
|
+
const arg = process.argv[i];
|
|
6535
|
+
if (arg === flagName) return process.argv[i + 1];
|
|
6536
|
+
if (arg.startsWith(prefix)) return arg.slice(prefix.length);
|
|
6537
|
+
}
|
|
6538
|
+
return void 0;
|
|
6510
6539
|
}
|
|
6511
6540
|
var baseUrl = getFlagValue("--base-url");
|
|
6512
6541
|
var credentialsToken = getFlagValue("--credentials");
|
|
@@ -6518,6 +6547,16 @@ var maxNetworkRetriesStr = getFlagValue("--max-network-retries");
|
|
|
6518
6547
|
var maxNetworkRetries = maxNetworkRetriesStr ? parseInt(maxNetworkRetriesStr, 10) : void 0;
|
|
6519
6548
|
var maxNetworkRetryDelayMsStr = getFlagValue("--max-network-retry-delay-ms");
|
|
6520
6549
|
var maxNetworkRetryDelayMs = maxNetworkRetryDelayMsStr ? parseInt(maxNetworkRetryDelayMsStr, 10) : void 0;
|
|
6550
|
+
var maxConcurrentRequestsStr = getFlagValue("--max-concurrent-requests");
|
|
6551
|
+
var maxConcurrentRequests;
|
|
6552
|
+
if (maxConcurrentRequestsStr === void 0) {
|
|
6553
|
+
maxConcurrentRequests = void 0;
|
|
6554
|
+
} else if (maxConcurrentRequestsStr === "Infinity") {
|
|
6555
|
+
maxConcurrentRequests = Infinity;
|
|
6556
|
+
} else {
|
|
6557
|
+
const parsed = parseInt(maxConcurrentRequestsStr, 10);
|
|
6558
|
+
maxConcurrentRequests = Number.isFinite(parsed) ? parsed : NaN;
|
|
6559
|
+
}
|
|
6521
6560
|
function buildCredentialsFromFlags() {
|
|
6522
6561
|
if (credentialsToken) {
|
|
6523
6562
|
return credentialsToken;
|
|
@@ -6560,6 +6599,7 @@ program.exitOverride();
|
|
|
6560
6599
|
trackingBaseUrl,
|
|
6561
6600
|
maxNetworkRetries,
|
|
6562
6601
|
maxNetworkRetryDelayMs,
|
|
6602
|
+
maxConcurrentRequests,
|
|
6563
6603
|
...flagOverrides,
|
|
6564
6604
|
extensions
|
|
6565
6605
|
});
|
package/dist/cli.mjs
CHANGED
|
@@ -115,6 +115,26 @@ function getLocalResolutionOrderForParams(paramNames, resolvers) {
|
|
|
115
115
|
}
|
|
116
116
|
return order;
|
|
117
117
|
}
|
|
118
|
+
function unwrapSchema(schema) {
|
|
119
|
+
let current = schema;
|
|
120
|
+
while (current instanceof z.ZodOptional || current instanceof z.ZodDefault || current instanceof z.ZodNullable) {
|
|
121
|
+
current = current._zod.def.innerType;
|
|
122
|
+
}
|
|
123
|
+
return current;
|
|
124
|
+
}
|
|
125
|
+
function coerceToSchemaType(value, schema) {
|
|
126
|
+
if (typeof value !== "string") return value;
|
|
127
|
+
const base = unwrapSchema(schema);
|
|
128
|
+
if (base instanceof z.ZodNumber) {
|
|
129
|
+
const n = Number(value);
|
|
130
|
+
return Number.isNaN(n) ? value : n;
|
|
131
|
+
}
|
|
132
|
+
if (base instanceof z.ZodBoolean) {
|
|
133
|
+
if (value === "true") return true;
|
|
134
|
+
if (value === "false") return false;
|
|
135
|
+
}
|
|
136
|
+
return value;
|
|
137
|
+
}
|
|
118
138
|
var SchemaParameterResolver = class {
|
|
119
139
|
constructor() {
|
|
120
140
|
this.debug = false;
|
|
@@ -401,7 +421,7 @@ var SchemaParameterResolver = class {
|
|
|
401
421
|
if (isOptional && (value === void 0 || value === "" || value === staticResolver.placeholder)) {
|
|
402
422
|
return void 0;
|
|
403
423
|
}
|
|
404
|
-
return value;
|
|
424
|
+
return coerceToSchemaType(value, param.schema);
|
|
405
425
|
} else if (resolver.type === "dynamic") {
|
|
406
426
|
const dynamicResolver = resolver;
|
|
407
427
|
this.startSpinner();
|
|
@@ -1149,7 +1169,7 @@ var SHARED_COMMAND_CLI_OPTIONS = [
|
|
|
1149
1169
|
|
|
1150
1170
|
// package.json
|
|
1151
1171
|
var package_default = {
|
|
1152
|
-
version: "0.48.
|
|
1172
|
+
version: "0.48.2"};
|
|
1153
1173
|
|
|
1154
1174
|
// src/telemetry/builders.ts
|
|
1155
1175
|
function createCliBaseEvent(context = {}) {
|
|
@@ -3681,6 +3701,7 @@ var mcpPlugin = definePlugin(
|
|
|
3681
3701
|
await startMcpServer({
|
|
3682
3702
|
...options,
|
|
3683
3703
|
debug: sdk2.context.options?.debug,
|
|
3704
|
+
maxConcurrentRequests: sdk2.context.options?.maxConcurrentRequests,
|
|
3684
3705
|
extensions: sdk2.context.extensions,
|
|
3685
3706
|
experimental: sdk2.context.experimental
|
|
3686
3707
|
});
|
|
@@ -6179,7 +6200,7 @@ var watchTriggerInboxCliPlugin = definePlugin(
|
|
|
6179
6200
|
// package.json with { type: 'json' }
|
|
6180
6201
|
var package_default2 = {
|
|
6181
6202
|
name: "@zapier/zapier-sdk-cli",
|
|
6182
|
-
version: "0.48.
|
|
6203
|
+
version: "0.48.2"};
|
|
6183
6204
|
|
|
6184
6205
|
// src/sdk.ts
|
|
6185
6206
|
injectCliLogin(login_exports);
|
|
@@ -6441,6 +6462,9 @@ program.name("zapier-sdk").description("CLI for Zapier SDK").version(
|
|
|
6441
6462
|
).option(
|
|
6442
6463
|
"--max-network-retry-delay-ms <ms>",
|
|
6443
6464
|
"Max delay in ms to wait for rate limit retry (default: 60000)"
|
|
6465
|
+
).option(
|
|
6466
|
+
"--max-concurrent-requests <count>",
|
|
6467
|
+
"Max concurrent in-flight HTTP requests (default: 200). Pass 'Infinity' to disable."
|
|
6444
6468
|
).option("--experimental", "Use the experimental SDK / CLI surface");
|
|
6445
6469
|
var booleanFlags = [];
|
|
6446
6470
|
for (const [key, fieldSchema] of Object.entries(
|
|
@@ -6464,8 +6488,13 @@ program.helpOption(
|
|
|
6464
6488
|
);
|
|
6465
6489
|
var isDebugMode = process.env.DEBUG === "true" || process.argv.includes("--debug");
|
|
6466
6490
|
function getFlagValue(flagName) {
|
|
6467
|
-
const
|
|
6468
|
-
|
|
6491
|
+
const prefix = `${flagName}=`;
|
|
6492
|
+
for (let i = 0; i < process.argv.length; i++) {
|
|
6493
|
+
const arg = process.argv[i];
|
|
6494
|
+
if (arg === flagName) return process.argv[i + 1];
|
|
6495
|
+
if (arg.startsWith(prefix)) return arg.slice(prefix.length);
|
|
6496
|
+
}
|
|
6497
|
+
return void 0;
|
|
6469
6498
|
}
|
|
6470
6499
|
var baseUrl = getFlagValue("--base-url");
|
|
6471
6500
|
var credentialsToken = getFlagValue("--credentials");
|
|
@@ -6477,6 +6506,16 @@ var maxNetworkRetriesStr = getFlagValue("--max-network-retries");
|
|
|
6477
6506
|
var maxNetworkRetries = maxNetworkRetriesStr ? parseInt(maxNetworkRetriesStr, 10) : void 0;
|
|
6478
6507
|
var maxNetworkRetryDelayMsStr = getFlagValue("--max-network-retry-delay-ms");
|
|
6479
6508
|
var maxNetworkRetryDelayMs = maxNetworkRetryDelayMsStr ? parseInt(maxNetworkRetryDelayMsStr, 10) : void 0;
|
|
6509
|
+
var maxConcurrentRequestsStr = getFlagValue("--max-concurrent-requests");
|
|
6510
|
+
var maxConcurrentRequests;
|
|
6511
|
+
if (maxConcurrentRequestsStr === void 0) {
|
|
6512
|
+
maxConcurrentRequests = void 0;
|
|
6513
|
+
} else if (maxConcurrentRequestsStr === "Infinity") {
|
|
6514
|
+
maxConcurrentRequests = Infinity;
|
|
6515
|
+
} else {
|
|
6516
|
+
const parsed = parseInt(maxConcurrentRequestsStr, 10);
|
|
6517
|
+
maxConcurrentRequests = Number.isFinite(parsed) ? parsed : NaN;
|
|
6518
|
+
}
|
|
6480
6519
|
function buildCredentialsFromFlags() {
|
|
6481
6520
|
if (credentialsToken) {
|
|
6482
6521
|
return credentialsToken;
|
|
@@ -6519,6 +6558,7 @@ program.exitOverride();
|
|
|
6519
6558
|
trackingBaseUrl,
|
|
6520
6559
|
maxNetworkRetries,
|
|
6521
6560
|
maxNetworkRetryDelayMs,
|
|
6561
|
+
maxConcurrentRequests,
|
|
6522
6562
|
...flagOverrides,
|
|
6523
6563
|
extensions
|
|
6524
6564
|
});
|
package/dist/experimental.cjs
CHANGED
|
@@ -1481,6 +1481,7 @@ var mcpPlugin = zapierSdk.definePlugin(
|
|
|
1481
1481
|
await zapierSdkMcp.startMcpServer({
|
|
1482
1482
|
...options,
|
|
1483
1483
|
debug: sdk2.context.options?.debug,
|
|
1484
|
+
maxConcurrentRequests: sdk2.context.options?.maxConcurrentRequests,
|
|
1484
1485
|
extensions: sdk2.context.extensions,
|
|
1485
1486
|
experimental: sdk2.context.experimental
|
|
1486
1487
|
});
|
|
@@ -3962,7 +3963,7 @@ var watchTriggerInboxCliPlugin = zapierSdk.definePlugin(
|
|
|
3962
3963
|
// package.json with { type: 'json' }
|
|
3963
3964
|
var package_default = {
|
|
3964
3965
|
name: "@zapier/zapier-sdk-cli",
|
|
3965
|
-
version: "0.48.
|
|
3966
|
+
version: "0.48.2"};
|
|
3966
3967
|
|
|
3967
3968
|
// src/experimental.ts
|
|
3968
3969
|
experimental.injectCliLogin(login_exports);
|
package/dist/experimental.mjs
CHANGED
|
@@ -1445,6 +1445,7 @@ var mcpPlugin = definePlugin(
|
|
|
1445
1445
|
await startMcpServer({
|
|
1446
1446
|
...options,
|
|
1447
1447
|
debug: sdk2.context.options?.debug,
|
|
1448
|
+
maxConcurrentRequests: sdk2.context.options?.maxConcurrentRequests,
|
|
1448
1449
|
extensions: sdk2.context.extensions,
|
|
1449
1450
|
experimental: sdk2.context.experimental
|
|
1450
1451
|
});
|
|
@@ -3926,7 +3927,7 @@ var watchTriggerInboxCliPlugin = definePlugin(
|
|
|
3926
3927
|
// package.json with { type: 'json' }
|
|
3927
3928
|
var package_default = {
|
|
3928
3929
|
name: "@zapier/zapier-sdk-cli",
|
|
3929
|
-
version: "0.48.
|
|
3930
|
+
version: "0.48.2"};
|
|
3930
3931
|
|
|
3931
3932
|
// src/experimental.ts
|
|
3932
3933
|
injectCliLogin(login_exports);
|
package/dist/index.cjs
CHANGED
|
@@ -1480,6 +1480,7 @@ var mcpPlugin = zapierSdk.definePlugin(
|
|
|
1480
1480
|
await zapierSdkMcp.startMcpServer({
|
|
1481
1481
|
...options,
|
|
1482
1482
|
debug: sdk2.context.options?.debug,
|
|
1483
|
+
maxConcurrentRequests: sdk2.context.options?.maxConcurrentRequests,
|
|
1483
1484
|
extensions: sdk2.context.extensions,
|
|
1484
1485
|
experimental: sdk2.context.experimental
|
|
1485
1486
|
});
|
|
@@ -3961,7 +3962,7 @@ zapierSdk.definePlugin(
|
|
|
3961
3962
|
// package.json with { type: 'json' }
|
|
3962
3963
|
var package_default = {
|
|
3963
3964
|
name: "@zapier/zapier-sdk-cli",
|
|
3964
|
-
version: "0.48.
|
|
3965
|
+
version: "0.48.2"};
|
|
3965
3966
|
|
|
3966
3967
|
// src/sdk.ts
|
|
3967
3968
|
zapierSdk.injectCliLogin(login_exports);
|
|
@@ -3989,7 +3990,7 @@ function createZapierCliSdk(options = {}) {
|
|
|
3989
3990
|
|
|
3990
3991
|
// package.json
|
|
3991
3992
|
var package_default2 = {
|
|
3992
|
-
version: "0.48.
|
|
3993
|
+
version: "0.48.2"};
|
|
3993
3994
|
|
|
3994
3995
|
// src/telemetry/builders.ts
|
|
3995
3996
|
function createCliBaseEvent(context = {}) {
|
package/dist/index.mjs
CHANGED
|
@@ -1444,6 +1444,7 @@ var mcpPlugin = definePlugin(
|
|
|
1444
1444
|
await startMcpServer({
|
|
1445
1445
|
...options,
|
|
1446
1446
|
debug: sdk2.context.options?.debug,
|
|
1447
|
+
maxConcurrentRequests: sdk2.context.options?.maxConcurrentRequests,
|
|
1447
1448
|
extensions: sdk2.context.extensions,
|
|
1448
1449
|
experimental: sdk2.context.experimental
|
|
1449
1450
|
});
|
|
@@ -3925,7 +3926,7 @@ definePlugin(
|
|
|
3925
3926
|
// package.json with { type: 'json' }
|
|
3926
3927
|
var package_default = {
|
|
3927
3928
|
name: "@zapier/zapier-sdk-cli",
|
|
3928
|
-
version: "0.48.
|
|
3929
|
+
version: "0.48.2"};
|
|
3929
3930
|
|
|
3930
3931
|
// src/sdk.ts
|
|
3931
3932
|
injectCliLogin(login_exports);
|
|
@@ -3953,7 +3954,7 @@ function createZapierCliSdk(options = {}) {
|
|
|
3953
3954
|
|
|
3954
3955
|
// package.json
|
|
3955
3956
|
var package_default2 = {
|
|
3956
|
-
version: "0.48.
|
|
3957
|
+
version: "0.48.2"};
|
|
3957
3958
|
|
|
3958
3959
|
// src/telemetry/builders.ts
|
|
3959
3960
|
function createCliBaseEvent(context = {}) {
|
package/dist/package.json
CHANGED
package/dist/src/cli.js
CHANGED
|
@@ -27,6 +27,7 @@ program
|
|
|
27
27
|
.option("--tracking-base-url <url>", "Base URL for Zapier tracking endpoints")
|
|
28
28
|
.option("--max-network-retries <count>", "Max retries for rate-limited requests (default: 3)")
|
|
29
29
|
.option("--max-network-retry-delay-ms <ms>", "Max delay in ms to wait for rate limit retry (default: 60000)")
|
|
30
|
+
.option("--max-concurrent-requests <count>", "Max concurrent in-flight HTTP requests (default: 200). Pass 'Infinity' to disable.")
|
|
30
31
|
// Registered so Commander accepts --experimental without rejecting it as
|
|
31
32
|
// unknown. The actual factory selection happens before Commander parses,
|
|
32
33
|
// by peeking at argv directly. Equivalent to using the
|
|
@@ -51,10 +52,20 @@ BaseSdkOptionsSchema.shape)) {
|
|
|
51
52
|
program.helpOption(`${helpOption.short}, ${helpOption.flag}`, helpOption.description);
|
|
52
53
|
// Check for debug flag early (support both flag and env var)
|
|
53
54
|
const isDebugMode = process.env.DEBUG === "true" || process.argv.includes("--debug");
|
|
54
|
-
// Helper to get flag value from argv
|
|
55
|
+
// Helper to get flag value from argv. Handles both Commander forms:
|
|
56
|
+
// `--flag value` (returns the next argv entry) and `--flag=value` (returns
|
|
57
|
+
// the part after the equals). Returns undefined only when the flag is
|
|
58
|
+
// genuinely absent β an explicit empty string still returns "".
|
|
55
59
|
function getFlagValue(flagName) {
|
|
56
|
-
const
|
|
57
|
-
|
|
60
|
+
const prefix = `${flagName}=`;
|
|
61
|
+
for (let i = 0; i < process.argv.length; i++) {
|
|
62
|
+
const arg = process.argv[i];
|
|
63
|
+
if (arg === flagName)
|
|
64
|
+
return process.argv[i + 1];
|
|
65
|
+
if (arg.startsWith(prefix))
|
|
66
|
+
return arg.slice(prefix.length);
|
|
67
|
+
}
|
|
68
|
+
return undefined;
|
|
58
69
|
}
|
|
59
70
|
// Extract options from process.argv for early SDK creation
|
|
60
71
|
// We need to create the SDK before parsing to generate commands from schemas
|
|
@@ -72,6 +83,23 @@ const maxNetworkRetryDelayMsStr = getFlagValue("--max-network-retry-delay-ms");
|
|
|
72
83
|
const maxNetworkRetryDelayMs = maxNetworkRetryDelayMsStr
|
|
73
84
|
? parseInt(maxNetworkRetryDelayMsStr, 10)
|
|
74
85
|
: undefined;
|
|
86
|
+
const maxConcurrentRequestsStr = getFlagValue("--max-concurrent-requests");
|
|
87
|
+
// "Infinity" is the explicit disable sentinel. parseInt of an all-digit
|
|
88
|
+
// overflow value (e.g. "9".repeat(309)) also returns Β±Infinity, which
|
|
89
|
+
// would otherwise look like the sentinel and silently disable throttling
|
|
90
|
+
// β coerce non-finite parseInt results to NaN so the SDK boundary's
|
|
91
|
+
// fall-back-to-default branch handles them.
|
|
92
|
+
let maxConcurrentRequests;
|
|
93
|
+
if (maxConcurrentRequestsStr === undefined) {
|
|
94
|
+
maxConcurrentRequests = undefined;
|
|
95
|
+
}
|
|
96
|
+
else if (maxConcurrentRequestsStr === "Infinity") {
|
|
97
|
+
maxConcurrentRequests = Infinity;
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
const parsed = parseInt(maxConcurrentRequestsStr, 10);
|
|
101
|
+
maxConcurrentRequests = Number.isFinite(parsed) ? parsed : NaN;
|
|
102
|
+
}
|
|
75
103
|
// Build credentials object from flags
|
|
76
104
|
function buildCredentialsFromFlags() {
|
|
77
105
|
// If a direct token is provided, use it
|
|
@@ -143,6 +171,7 @@ program.exitOverride();
|
|
|
143
171
|
trackingBaseUrl,
|
|
144
172
|
maxNetworkRetries,
|
|
145
173
|
maxNetworkRetryDelayMs,
|
|
174
|
+
maxConcurrentRequests,
|
|
146
175
|
...flagOverrides,
|
|
147
176
|
extensions,
|
|
148
177
|
});
|
|
@@ -6,16 +6,17 @@ export const mcpPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
|
|
|
6
6
|
categories: ["utility"],
|
|
7
7
|
inputSchema: McpSchema,
|
|
8
8
|
handler: async ({ sdk, options }) => {
|
|
9
|
-
// Forward debug
|
|
10
|
-
// server's
|
|
11
|
-
// this forward, MCP would build a
|
|
12
|
-
// surfaces would diverge. The
|
|
13
|
-
// experimental
|
|
14
|
-
// `@zapier/zapier-sdk/experimental`
|
|
15
|
-
// exposed.
|
|
9
|
+
// Forward debug, the concurrency cap, and the extensions resolved at
|
|
10
|
+
// CLI startup so the MCP server's SDK matches what the user asked
|
|
11
|
+
// for at the CLI surface. Without this forward, MCP would build a
|
|
12
|
+
// vanilla SDK and the CLI/MCP surfaces would diverge. The
|
|
13
|
+
// `experimental` flag (set by the experimental CLI factory) tells
|
|
14
|
+
// the MCP server to build against `@zapier/zapier-sdk/experimental`
|
|
15
|
+
// so experimental tools are exposed.
|
|
16
16
|
await startMcpServer({
|
|
17
17
|
...options,
|
|
18
18
|
debug: sdk.context.options?.debug,
|
|
19
|
+
maxConcurrentRequests: sdk.context.options?.maxConcurrentRequests,
|
|
19
20
|
extensions: sdk.context.extensions,
|
|
20
21
|
experimental: sdk.context.experimental,
|
|
21
22
|
});
|
|
@@ -58,6 +58,31 @@ function getLocalResolutionOrderForParams(paramNames, resolvers) {
|
|
|
58
58
|
}
|
|
59
59
|
return order;
|
|
60
60
|
}
|
|
61
|
+
function unwrapSchema(schema) {
|
|
62
|
+
let current = schema;
|
|
63
|
+
while (current instanceof z.ZodOptional ||
|
|
64
|
+
current instanceof z.ZodDefault ||
|
|
65
|
+
current instanceof z.ZodNullable) {
|
|
66
|
+
current = current._zod.def.innerType;
|
|
67
|
+
}
|
|
68
|
+
return current;
|
|
69
|
+
}
|
|
70
|
+
function coerceToSchemaType(value, schema) {
|
|
71
|
+
if (typeof value !== "string")
|
|
72
|
+
return value;
|
|
73
|
+
const base = unwrapSchema(schema);
|
|
74
|
+
if (base instanceof z.ZodNumber) {
|
|
75
|
+
const n = Number(value);
|
|
76
|
+
return Number.isNaN(n) ? value : n;
|
|
77
|
+
}
|
|
78
|
+
if (base instanceof z.ZodBoolean) {
|
|
79
|
+
if (value === "true")
|
|
80
|
+
return true;
|
|
81
|
+
if (value === "false")
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
return value;
|
|
85
|
+
}
|
|
61
86
|
// ============================================================================
|
|
62
87
|
// Schema Parameter Resolver
|
|
63
88
|
// ============================================================================
|
|
@@ -338,7 +363,10 @@ export class SchemaParameterResolver {
|
|
|
338
363
|
value === staticResolver.placeholder)) {
|
|
339
364
|
return undefined;
|
|
340
365
|
}
|
|
341
|
-
|
|
366
|
+
// Inquirer's "input" prompt always returns a string. Coerce to match
|
|
367
|
+
// the schema's underlying type so z.number()/z.boolean() validation
|
|
368
|
+
// doesn't reject the value.
|
|
369
|
+
return coerceToSchemaType(value, param.schema);
|
|
342
370
|
}
|
|
343
371
|
else if (resolver.type === "dynamic") {
|
|
344
372
|
const dynamicResolver = resolver;
|