@zapier/zapier-sdk-cli 0.46.1 → 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,11 @@
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
+
3
9
  ## 0.46.1
4
10
 
5
11
  ### Patch Changes
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.1"};
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.1"};
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.1"};
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.1"};
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.1"};
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.1"};
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.1"};
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.1"};
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.1"};
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.1"};
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.1",
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) &&