@zapier/zapier-sdk-cli 0.46.0 → 0.47.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 CHANGED
@@ -1,5 +1,30 @@
1
1
  # @zapier/zapier-sdk-cli
2
2
 
3
+ ## 0.47.0
4
+
5
+ ### Minor Changes
6
+
7
+ - cef5239: Extend the `(Enter custom value)` sentinel to dynamic input-field dropdowns (SELECT-type fields). Selecting it falls through to a free-text prompt and returns the typed value, so users can supply values that aren't in the fetched dropdown (e.g. dynamic dropdowns that don't return every valid option). Single-select fields only; checkbox/multi-select fields are unchanged.
8
+
9
+ ## 0.46.1
10
+
11
+ ### Patch Changes
12
+
13
+ - cd8f37b: Collapse the approval-flow surface into a single tri-state `approvalMode` option.
14
+
15
+ What changed:
16
+ - `approvalMode` is now `"disabled" | "poll" | "throw"` (was `"poll" | "fail"`).
17
+ - `"disabled"` is the default. While the approval flow is alpha, callers must opt in explicitly via `approvalMode: "poll"` or `approvalMode: "throw"` (or the `ZAPIER_APPROVAL_MODE` env var). On an approval-required response, `"disabled"` throws a `ZapierApprovalError` with `status: "approval_required"` without creating an approval.
18
+ - The `isInteractive` SDK option and the `ZAPIER_IS_INTERACTIVE` env var have been removed. Their role is subsumed by `approvalMode`: choosing `"poll"` / `"throw"` is the explicit opt-in that previously required `isInteractive: true`.
19
+ - `"fail"` has been renamed to `"throw"` (both the option value and the `ZAPIER_APPROVAL_MODE` env var value). The behavior is unchanged: throw a `ZapierApprovalError` carrying the approval URL so the caller can surface it.
20
+ - `approvalMode`, `approvalTimeoutMs`, and `maxApprovalRetries` are now part of the public API (no longer marked `internal: true`).
21
+
22
+ There is no back-compat shim. `approvalMode: "fail"` and `isInteractive: <anything>` will fail Zod validation up front.
23
+
24
+ - Updated dependencies [cd8f37b]
25
+ - @zapier/zapier-sdk@0.50.0
26
+ - @zapier/zapier-sdk-mcp@0.13.1
27
+
3
28
  ## 0.46.0
4
29
 
5
30
  ### Minor Changes
package/README.md CHANGED
@@ -133,23 +133,26 @@ npx zapier-sdk fetch "https://gmail.googleapis.com/gmail/v1/users/me/labels" --c
133
133
 
134
134
  These options are available for all commands:
135
135
 
136
- | Option | Short | Description |
137
- | -------------------------------------- | ----- | --------------------------------------------------- |
138
- | `--version` | `-V` | Display version number |
139
- | `--help` | `-h` | Display help for command |
140
- | `--credentials <token>` | | Authentication token. |
141
- | `--credentials-client-id <id>` | | OAuth client ID for authentication. |
142
- | `--credentials-client-secret <secret>` | | OAuth client secret for authentication. |
143
- | `--credentials-base-url <url>` | | Override authentication base URL. |
144
- | `--debug` | | Enable debug logging. |
145
- | `--base-url <url>` | | Base URL for Zapier API endpoints. |
146
- | `--tracking-base-url <url>` | | Base URL for Zapier tracking endpoints. |
147
- | `--max-network-retries <count>` | | Max retries for rate-limited requests (default: 3). |
148
- | `--max-network-retry-delay-ms <ms>` | | Max delay in ms to wait for retry (default: 60000). |
149
- | `--can-include-shared-connections` | | Allow listing shared connections. |
150
- | `--can-include-shared-tables` | | Allow listing shared tables. |
151
- | `--can-delete-tables` | | Allow deleting tables. |
152
- | `--json` | | Output raw JSON instead of formatted results |
136
+ | Option | Short | Description |
137
+ | -------------------------------------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
138
+ | `--version` | `-V` | Display version number |
139
+ | `--help` | `-h` | Display help for command |
140
+ | `--credentials <token>` | | Authentication token. |
141
+ | `--credentials-client-id <id>` | | OAuth client ID for authentication. |
142
+ | `--credentials-client-secret <secret>` | | OAuth client secret for authentication. |
143
+ | `--credentials-base-url <url>` | | Override authentication base URL. |
144
+ | `--debug` | | Enable debug logging. |
145
+ | `--base-url <url>` | | Base URL for Zapier API endpoints. |
146
+ | `--tracking-base-url <url>` | | Base URL for Zapier tracking endpoints. |
147
+ | `--max-network-retries <count>` | | Max retries for rate-limited requests (default: 3). |
148
+ | `--max-network-retry-delay-ms <ms>` | | Max delay in ms to wait for retry (default: 60000). |
149
+ | `--approval-timeout-ms <ms>` | | Timeout in ms for approval polling. Default: 600000 (10 min). |
150
+ | `--max-approval-retries` | | Maximum number of sequential approval rounds per request (one per gating policy) before giving up. Default: 2. |
151
+ | `--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". |
152
+ | `--can-include-shared-connections` | | Allow listing shared connections. |
153
+ | `--can-include-shared-tables` | | Allow listing shared tables. |
154
+ | `--can-delete-tables` | | Allow deleting tables. |
155
+ | `--json` | | Output raw JSON instead of formatted results |
153
156
 
154
157
  ## Available Commands
155
158
 
package/dist/cli.cjs CHANGED
@@ -939,11 +939,18 @@ Optional fields${pathContext}:`));
939
939
  const choices = [...initialChoices];
940
940
  let nextCursor = initialCursor;
941
941
  const LOAD_MORE_SENTINEL = Symbol("LOAD_MORE");
942
+ const CUSTOM_VALUE_SENTINEL = Symbol("CUSTOM_VALUE");
942
943
  while (true) {
943
944
  const promptChoices = choices.map((choice) => ({
944
945
  name: choice.label,
945
946
  value: choice.value
946
947
  }));
948
+ if (!fieldMeta.isMultiSelect) {
949
+ promptChoices.unshift({
950
+ name: chalk7__default.default.dim("(Enter custom value)"),
951
+ value: CUSTOM_VALUE_SENTINEL
952
+ });
953
+ }
947
954
  if (nextCursor) {
948
955
  promptChoices.push({
949
956
  name: chalk7__default.default.dim("(Load more...)"),
@@ -969,6 +976,9 @@ Optional fields${pathContext}:`));
969
976
  };
970
977
  const answer = await inquirer__default.default.prompt([promptConfig]);
971
978
  let selectedValue = answer[fieldMeta.key];
979
+ if (selectedValue === CUSTOM_VALUE_SENTINEL) {
980
+ return await this.promptFreeForm(fieldMeta);
981
+ }
972
982
  const wantsMore = fieldMeta.isMultiSelect ? Array.isArray(selectedValue) && selectedValue.includes(LOAD_MORE_SENTINEL) : selectedValue === LOAD_MORE_SENTINEL;
973
983
  if (wantsMore && nextCursor && context) {
974
984
  if (fieldMeta.isMultiSelect && Array.isArray(selectedValue)) {
@@ -1179,7 +1189,7 @@ var SHARED_COMMAND_CLI_OPTIONS = [
1179
1189
 
1180
1190
  // package.json
1181
1191
  var package_default = {
1182
- version: "0.46.0"};
1192
+ version: "0.47.0"};
1183
1193
 
1184
1194
  // src/telemetry/builders.ts
1185
1195
  function createCliBaseEvent(context = {}) {
@@ -5735,7 +5745,7 @@ var watchTriggerInboxCliPlugin = zapierSdk.definePlugin(
5735
5745
  // package.json with { type: 'json' }
5736
5746
  var package_default2 = {
5737
5747
  name: "@zapier/zapier-sdk-cli",
5738
- version: "0.46.0"};
5748
+ version: "0.47.0"};
5739
5749
 
5740
5750
  // src/sdk.ts
5741
5751
  zapierSdk.injectCliLogin(login_exports);
package/dist/cli.mjs CHANGED
@@ -898,11 +898,18 @@ Optional fields${pathContext}:`));
898
898
  const choices = [...initialChoices];
899
899
  let nextCursor = initialCursor;
900
900
  const LOAD_MORE_SENTINEL = Symbol("LOAD_MORE");
901
+ const CUSTOM_VALUE_SENTINEL = Symbol("CUSTOM_VALUE");
901
902
  while (true) {
902
903
  const promptChoices = choices.map((choice) => ({
903
904
  name: choice.label,
904
905
  value: choice.value
905
906
  }));
907
+ if (!fieldMeta.isMultiSelect) {
908
+ promptChoices.unshift({
909
+ name: chalk7.dim("(Enter custom value)"),
910
+ value: CUSTOM_VALUE_SENTINEL
911
+ });
912
+ }
906
913
  if (nextCursor) {
907
914
  promptChoices.push({
908
915
  name: chalk7.dim("(Load more...)"),
@@ -928,6 +935,9 @@ Optional fields${pathContext}:`));
928
935
  };
929
936
  const answer = await inquirer.prompt([promptConfig]);
930
937
  let selectedValue = answer[fieldMeta.key];
938
+ if (selectedValue === CUSTOM_VALUE_SENTINEL) {
939
+ return await this.promptFreeForm(fieldMeta);
940
+ }
931
941
  const wantsMore = fieldMeta.isMultiSelect ? Array.isArray(selectedValue) && selectedValue.includes(LOAD_MORE_SENTINEL) : selectedValue === LOAD_MORE_SENTINEL;
932
942
  if (wantsMore && nextCursor && context) {
933
943
  if (fieldMeta.isMultiSelect && Array.isArray(selectedValue)) {
@@ -1138,7 +1148,7 @@ var SHARED_COMMAND_CLI_OPTIONS = [
1138
1148
 
1139
1149
  // package.json
1140
1150
  var package_default = {
1141
- version: "0.46.0"};
1151
+ version: "0.47.0"};
1142
1152
 
1143
1153
  // src/telemetry/builders.ts
1144
1154
  function createCliBaseEvent(context = {}) {
@@ -5694,7 +5704,7 @@ var watchTriggerInboxCliPlugin = definePlugin(
5694
5704
  // package.json with { type: 'json' }
5695
5705
  var package_default2 = {
5696
5706
  name: "@zapier/zapier-sdk-cli",
5697
- version: "0.46.0"};
5707
+ version: "0.47.0"};
5698
5708
 
5699
5709
  // src/sdk.ts
5700
5710
  injectCliLogin(login_exports);
@@ -3487,7 +3487,7 @@ var watchTriggerInboxCliPlugin = zapierSdk.definePlugin(
3487
3487
  // package.json with { type: 'json' }
3488
3488
  var package_default = {
3489
3489
  name: "@zapier/zapier-sdk-cli",
3490
- version: "0.46.0"};
3490
+ version: "0.47.0"};
3491
3491
 
3492
3492
  // src/experimental.ts
3493
3493
  experimental.injectCliLogin(login_exports);
@@ -3451,7 +3451,7 @@ var watchTriggerInboxCliPlugin = definePlugin(
3451
3451
  // package.json with { type: 'json' }
3452
3452
  var package_default = {
3453
3453
  name: "@zapier/zapier-sdk-cli",
3454
- version: "0.46.0"};
3454
+ version: "0.47.0"};
3455
3455
 
3456
3456
  // src/experimental.ts
3457
3457
  injectCliLogin(login_exports);
package/dist/index.cjs CHANGED
@@ -3486,7 +3486,7 @@ zapierSdk.definePlugin(
3486
3486
  // package.json with { type: 'json' }
3487
3487
  var package_default = {
3488
3488
  name: "@zapier/zapier-sdk-cli",
3489
- version: "0.46.0"};
3489
+ version: "0.47.0"};
3490
3490
 
3491
3491
  // src/sdk.ts
3492
3492
  zapierSdk.injectCliLogin(login_exports);
@@ -3514,7 +3514,7 @@ function createZapierCliSdk(options = {}) {
3514
3514
 
3515
3515
  // package.json
3516
3516
  var package_default2 = {
3517
- version: "0.46.0"};
3517
+ version: "0.47.0"};
3518
3518
 
3519
3519
  // src/telemetry/builders.ts
3520
3520
  function createCliBaseEvent(context = {}) {
package/dist/index.mjs CHANGED
@@ -3450,7 +3450,7 @@ definePlugin(
3450
3450
  // package.json with { type: 'json' }
3451
3451
  var package_default = {
3452
3452
  name: "@zapier/zapier-sdk-cli",
3453
- version: "0.46.0"};
3453
+ version: "0.47.0"};
3454
3454
 
3455
3455
  // src/sdk.ts
3456
3456
  injectCliLogin(login_exports);
@@ -3478,7 +3478,7 @@ function createZapierCliSdk(options = {}) {
3478
3478
 
3479
3479
  // package.json
3480
3480
  var package_default2 = {
3481
- version: "0.46.0"};
3481
+ version: "0.47.0"};
3482
3482
 
3483
3483
  // src/telemetry/builders.ts
3484
3484
  function createCliBaseEvent(context = {}) {
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk-cli",
3
- "version": "0.46.0",
3
+ "version": "0.47.0",
4
4
  "description": "Command line interface for Zapier SDK",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -801,12 +801,22 @@ export class SchemaParameterResolver {
801
801
  const choices = [...initialChoices];
802
802
  let nextCursor = initialCursor;
803
803
  const LOAD_MORE_SENTINEL = Symbol("LOAD_MORE");
804
+ const CUSTOM_VALUE_SENTINEL = Symbol("CUSTOM_VALUE");
804
805
  // Progressive loading loop
805
806
  while (true) {
806
807
  const promptChoices = choices.map((choice) => ({
807
808
  name: choice.label,
808
809
  value: choice.value,
809
810
  }));
811
+ // Pin "(Enter custom value)" to the top for single-select fields so
812
+ // users can supply values not in the fetched dropdown (e.g. dynamic
813
+ // dropdowns that don't return every valid value).
814
+ if (!fieldMeta.isMultiSelect) {
815
+ promptChoices.unshift({
816
+ name: chalk.dim("(Enter custom value)"),
817
+ value: CUSTOM_VALUE_SENTINEL,
818
+ });
819
+ }
810
820
  // Add "(Load more...)" option if there are more pages
811
821
  if (nextCursor) {
812
822
  promptChoices.push({
@@ -834,6 +844,9 @@ export class SchemaParameterResolver {
834
844
  };
835
845
  const answer = await inquirer.prompt([promptConfig]);
836
846
  let selectedValue = answer[fieldMeta.key];
847
+ if (selectedValue === CUSTOM_VALUE_SENTINEL) {
848
+ return await this.promptFreeForm(fieldMeta);
849
+ }
837
850
  // Check if user selected "Load more..."
838
851
  const wantsMore = fieldMeta.isMultiSelect
839
852
  ? Array.isArray(selectedValue) &&