@zapier/zapier-sdk-cli 0.49.0 โ†’ 0.50.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.50.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ce779d1: Add `hint?: string | string[]` to `PromptConfig.choices`. The CLI renders it after the choice's `name` as dimmed parens; an unset `hint` with a primitive `value` auto-renders the value.
8
+
9
+ All built-in resolvers migrate to the new shape, so existing dropdowns get small visual cleanups (dim parens, no `ID:` prefix, dash converted to parens, em-dash in `tableRecordId` gone).
10
+
11
+ Plugin authors who embed the value in `name` (e.g. `"Foo (${id})"`) should drop the embedded parens; the auto-default appends a second otherwise.
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [ce779d1]
16
+ - @zapier/zapier-sdk@0.55.0
17
+ - @zapier/zapier-sdk-mcp@0.13.7
18
+
19
+ ## 0.49.1
20
+
21
+ ### Patch Changes
22
+
23
+ - 22a1727: Add optional `name` parameter to `createTriggerInbox` method
24
+ - Updated dependencies [22a1727]
25
+ - @zapier/zapier-sdk-mcp@0.13.6
26
+ - @zapier/zapier-sdk@0.54.1
27
+
3
28
  ## 0.49.0
4
29
 
5
30
  ### Minor Changes
package/README.md CHANGED
@@ -797,22 +797,23 @@ npx zapier-sdk ack-trigger-inbox-messages <inbox> <lease> [--messages]
797
797
 
798
798
  #### `create-trigger-inbox` ๐Ÿงช _experimental_
799
799
 
800
- Create a new trigger inbox subscription with an auto-generated name. Always creates; use ensureTriggerInbox for get-or-create on a stable name.
800
+ Create a new trigger inbox subscription. Always creates a new inbox; use ensureTriggerInbox for get-or-create on a stable name.
801
801
 
802
802
  **Options:**
803
803
 
804
- | Option | Type | Required | Default | Possible Values | Description |
805
- | -------------------- | ---------------- | -------- | ------- | --------------- | ------------------------------------------------------------------------------------------------------------ |
806
- | `<app>` | `string` | โœ… | โ€” | โ€” | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
807
- | `<action>` | `string` | โœ… | โ€” | โ€” | Action key (e.g., 'send_message' or 'find_row') |
808
- | `--connection` | `string, number` | โŒ | โ€” | โ€” | Connection alias or connection ID. Optional for triggers that don't require auth. |
809
- | `--inputs` | `object` | โŒ | โ€” | โ€” | Input parameters for the trigger subscription |
810
- | `--notification-url` | `string` | โŒ | โ€” | โ€” | Webhook URL to POST to when new messages arrive |
804
+ | Option | Type | Required | Default | Possible Values | Description |
805
+ | -------------------- | ---------------- | -------- | ------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------- |
806
+ | `<app>` | `string` | โœ… | โ€” | โ€” | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
807
+ | `<action>` | `string` | โœ… | โ€” | โ€” | Action key (e.g., 'send_message' or 'find_row') |
808
+ | `--name` | `string` | โŒ | โ€” | โ€” | Optional inbox name. Auto-generated when omitted. Throws a conflict error if the name is already in use by another subscription. |
809
+ | `--connection` | `string, number` | โŒ | โ€” | โ€” | Connection alias or connection ID. Optional for triggers that don't require auth. |
810
+ | `--inputs` | `object` | โŒ | โ€” | โ€” | Input parameters for the trigger subscription |
811
+ | `--notification-url` | `string` | โŒ | โ€” | โ€” | Webhook URL to POST to when new messages arrive |
811
812
 
812
813
  **Usage:**
813
814
 
814
815
  ```bash
815
- npx zapier-sdk create-trigger-inbox <app> <action> [--connection] [--inputs] [--notification-url]
816
+ npx zapier-sdk create-trigger-inbox <app> <action> [--name] [--connection] [--inputs] [--notification-url]
816
817
  ```
817
818
 
818
819
  #### `delete-trigger-inbox` ๐Ÿงช _experimental_
package/dist/cli.cjs CHANGED
@@ -178,6 +178,20 @@ function coerceToSchemaType(value, schema) {
178
178
  }
179
179
  return value;
180
180
  }
181
+ function renderChoiceLabel(choice) {
182
+ let effectiveHint = choice.hint;
183
+ if (effectiveHint === void 0 && (typeof choice.value === "string" || typeof choice.value === "number")) {
184
+ effectiveHint = String(choice.value);
185
+ }
186
+ if (!effectiveHint || Array.isArray(effectiveHint) && effectiveHint.length === 0) {
187
+ return choice;
188
+ }
189
+ const hintText = Array.isArray(effectiveHint) ? effectiveHint.join(", ") : effectiveHint;
190
+ if (hintText === choice.name) {
191
+ return choice;
192
+ }
193
+ return { ...choice, name: `${choice.name} ${chalk__default.default.dim(`(${hintText})`)}` };
194
+ }
181
195
  var SchemaParameterResolver = class {
182
196
  constructor() {
183
197
  this.debug = false;
@@ -213,14 +227,8 @@ var SchemaParameterResolver = class {
213
227
  const hasValue = this.getNestedValue(providedParams, param.path) !== void 0;
214
228
  return !hasValue;
215
229
  });
216
- const required = missingResolvable.filter((param) => {
217
- if (param.isRequired) return true;
218
- if (param.name === "inputs") return interactiveMode;
219
- return false;
220
- });
221
- const optional = missingResolvable.filter(
222
- (param) => !required.includes(param)
223
- );
230
+ const required = missingResolvable.filter((param) => param.isRequired);
231
+ const optional = missingResolvable.filter((param) => !param.isRequired);
224
232
  if (parseResult.success && required.length === 0 && optional.length === 0) {
225
233
  return parseResult.data;
226
234
  }
@@ -591,7 +599,7 @@ var SchemaParameterResolver = class {
591
599
  }
592
600
  const { items } = await this.unpackFetchResult(fetchResult, promptLabel);
593
601
  const choicesConfig = resolver.prompt(items, searchParams);
594
- const dataChoices = choicesConfig.choices ?? [];
602
+ const dataChoices = (choicesConfig.choices ?? []).map(renderChoiceLabel);
595
603
  const capabilityHintMessages = await this.computeCapabilityHints(
596
604
  resolver,
597
605
  context
@@ -780,6 +788,9 @@ var SchemaParameterResolver = class {
780
788
  context.resolvedParams
781
789
  );
782
790
  promptConfig.name = promptName;
791
+ if (promptConfig.choices) {
792
+ promptConfig.choices = promptConfig.choices.map(renderChoiceLabel);
793
+ }
783
794
  const hasSelectableChoice = promptConfig.choices?.some(
784
795
  (c) => !c.disabled
785
796
  );
@@ -1561,7 +1572,7 @@ var SHARED_COMMAND_CLI_OPTIONS = [
1561
1572
 
1562
1573
  // package.json
1563
1574
  var package_default = {
1564
- version: "0.49.0"};
1575
+ version: "0.50.0"};
1565
1576
 
1566
1577
  // src/telemetry/builders.ts
1567
1578
  function createCliBaseEvent(context = {}) {
@@ -6592,7 +6603,7 @@ var watchTriggerInboxCliPlugin = zapierSdk.definePlugin(
6592
6603
  // package.json with { type: 'json' }
6593
6604
  var package_default2 = {
6594
6605
  name: "@zapier/zapier-sdk-cli",
6595
- version: "0.49.0"};
6606
+ version: "0.50.0"};
6596
6607
 
6597
6608
  // src/sdk.ts
6598
6609
  zapierSdk.injectCliLogin(login_exports);
package/dist/cli.mjs CHANGED
@@ -136,6 +136,20 @@ function coerceToSchemaType(value, schema) {
136
136
  }
137
137
  return value;
138
138
  }
139
+ function renderChoiceLabel(choice) {
140
+ let effectiveHint = choice.hint;
141
+ if (effectiveHint === void 0 && (typeof choice.value === "string" || typeof choice.value === "number")) {
142
+ effectiveHint = String(choice.value);
143
+ }
144
+ if (!effectiveHint || Array.isArray(effectiveHint) && effectiveHint.length === 0) {
145
+ return choice;
146
+ }
147
+ const hintText = Array.isArray(effectiveHint) ? effectiveHint.join(", ") : effectiveHint;
148
+ if (hintText === choice.name) {
149
+ return choice;
150
+ }
151
+ return { ...choice, name: `${choice.name} ${chalk.dim(`(${hintText})`)}` };
152
+ }
139
153
  var SchemaParameterResolver = class {
140
154
  constructor() {
141
155
  this.debug = false;
@@ -171,14 +185,8 @@ var SchemaParameterResolver = class {
171
185
  const hasValue = this.getNestedValue(providedParams, param.path) !== void 0;
172
186
  return !hasValue;
173
187
  });
174
- const required = missingResolvable.filter((param) => {
175
- if (param.isRequired) return true;
176
- if (param.name === "inputs") return interactiveMode;
177
- return false;
178
- });
179
- const optional = missingResolvable.filter(
180
- (param) => !required.includes(param)
181
- );
188
+ const required = missingResolvable.filter((param) => param.isRequired);
189
+ const optional = missingResolvable.filter((param) => !param.isRequired);
182
190
  if (parseResult.success && required.length === 0 && optional.length === 0) {
183
191
  return parseResult.data;
184
192
  }
@@ -549,7 +557,7 @@ var SchemaParameterResolver = class {
549
557
  }
550
558
  const { items } = await this.unpackFetchResult(fetchResult, promptLabel);
551
559
  const choicesConfig = resolver.prompt(items, searchParams);
552
- const dataChoices = choicesConfig.choices ?? [];
560
+ const dataChoices = (choicesConfig.choices ?? []).map(renderChoiceLabel);
553
561
  const capabilityHintMessages = await this.computeCapabilityHints(
554
562
  resolver,
555
563
  context
@@ -738,6 +746,9 @@ var SchemaParameterResolver = class {
738
746
  context.resolvedParams
739
747
  );
740
748
  promptConfig.name = promptName;
749
+ if (promptConfig.choices) {
750
+ promptConfig.choices = promptConfig.choices.map(renderChoiceLabel);
751
+ }
741
752
  const hasSelectableChoice = promptConfig.choices?.some(
742
753
  (c) => !c.disabled
743
754
  );
@@ -1519,7 +1530,7 @@ var SHARED_COMMAND_CLI_OPTIONS = [
1519
1530
 
1520
1531
  // package.json
1521
1532
  var package_default = {
1522
- version: "0.49.0"};
1533
+ version: "0.50.0"};
1523
1534
 
1524
1535
  // src/telemetry/builders.ts
1525
1536
  function createCliBaseEvent(context = {}) {
@@ -6550,7 +6561,7 @@ var watchTriggerInboxCliPlugin = definePlugin(
6550
6561
  // package.json with { type: 'json' }
6551
6562
  var package_default2 = {
6552
6563
  name: "@zapier/zapier-sdk-cli",
6553
- version: "0.49.0"};
6564
+ version: "0.50.0"};
6554
6565
 
6555
6566
  // src/sdk.ts
6556
6567
  injectCliLogin(login_exports);
@@ -3963,7 +3963,7 @@ var watchTriggerInboxCliPlugin = zapierSdk.definePlugin(
3963
3963
  // package.json with { type: 'json' }
3964
3964
  var package_default = {
3965
3965
  name: "@zapier/zapier-sdk-cli",
3966
- version: "0.49.0"};
3966
+ version: "0.50.0"};
3967
3967
 
3968
3968
  // src/experimental.ts
3969
3969
  experimental.injectCliLogin(login_exports);
@@ -3927,7 +3927,7 @@ var watchTriggerInboxCliPlugin = definePlugin(
3927
3927
  // package.json with { type: 'json' }
3928
3928
  var package_default = {
3929
3929
  name: "@zapier/zapier-sdk-cli",
3930
- version: "0.49.0"};
3930
+ version: "0.50.0"};
3931
3931
 
3932
3932
  // src/experimental.ts
3933
3933
  injectCliLogin(login_exports);
package/dist/index.cjs CHANGED
@@ -3962,7 +3962,7 @@ zapierSdk.definePlugin(
3962
3962
  // package.json with { type: 'json' }
3963
3963
  var package_default = {
3964
3964
  name: "@zapier/zapier-sdk-cli",
3965
- version: "0.49.0"};
3965
+ version: "0.50.0"};
3966
3966
 
3967
3967
  // src/sdk.ts
3968
3968
  zapierSdk.injectCliLogin(login_exports);
@@ -3990,7 +3990,7 @@ function createZapierCliSdk(options = {}) {
3990
3990
 
3991
3991
  // package.json
3992
3992
  var package_default2 = {
3993
- version: "0.49.0"};
3993
+ version: "0.50.0"};
3994
3994
 
3995
3995
  // src/telemetry/builders.ts
3996
3996
  function createCliBaseEvent(context = {}) {
package/dist/index.mjs CHANGED
@@ -3926,7 +3926,7 @@ definePlugin(
3926
3926
  // package.json with { type: 'json' }
3927
3927
  var package_default = {
3928
3928
  name: "@zapier/zapier-sdk-cli",
3929
- version: "0.49.0"};
3929
+ version: "0.50.0"};
3930
3930
 
3931
3931
  // src/sdk.ts
3932
3932
  injectCliLogin(login_exports);
@@ -3954,7 +3954,7 @@ function createZapierCliSdk(options = {}) {
3954
3954
 
3955
3955
  // package.json
3956
3956
  var package_default2 = {
3957
- version: "0.49.0"};
3957
+ version: "0.50.0"};
3958
3958
 
3959
3959
  // src/telemetry/builders.ts
3960
3960
  function createCliBaseEvent(context = {}) {
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk-cli",
3
- "version": "0.49.0",
3
+ "version": "0.50.0",
4
4
  "description": "Command line interface for Zapier SDK",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -1,5 +1,26 @@
1
1
  import { z } from "zod";
2
2
  import { type ZapierSdk } from "@zapier/zapier-sdk";
3
+ /**
4
+ * Append a choice's `hint` to its name as dimmed parens, returning a new
5
+ * choice object. An array hint is joined with ", ". Used by every prompt
6
+ * backend that renders resolver-supplied choices so the dim styling lives
7
+ * in one place.
8
+ *
9
+ * Default-when-unset: if `hint` is not provided and the choice's `value`
10
+ * is a primitive (string or number), the value is auto-rendered as the
11
+ * hint. So a resolver returning `{ name: "Slack", value: "SlackCLIAPI" }`
12
+ * with no `hint` renders as `Slack (SlackCLIAPI)`. To opt out of the
13
+ * auto-default, set `hint: ""` or `hint: []` explicitly.
14
+ *
15
+ * Skip-when-equal: a hint that matches the rendered name verbatim is
16
+ * suppressed so primitive-enum resolvers (where `name === String(value)`)
17
+ * don't render "read (read)". Case differences still render both.
18
+ */
19
+ export declare function renderChoiceLabel<T extends {
20
+ name: string;
21
+ value: unknown;
22
+ hint?: string | string[];
23
+ }>(choice: T): T;
3
24
  export declare class SchemaParameterResolver {
4
25
  private debug;
5
26
  private spinner;
@@ -87,6 +87,40 @@ function coerceToSchemaType(value, schema) {
87
87
  // ============================================================================
88
88
  // Schema Parameter Resolver
89
89
  // ============================================================================
90
+ /**
91
+ * Append a choice's `hint` to its name as dimmed parens, returning a new
92
+ * choice object. An array hint is joined with ", ". Used by every prompt
93
+ * backend that renders resolver-supplied choices so the dim styling lives
94
+ * in one place.
95
+ *
96
+ * Default-when-unset: if `hint` is not provided and the choice's `value`
97
+ * is a primitive (string or number), the value is auto-rendered as the
98
+ * hint. So a resolver returning `{ name: "Slack", value: "SlackCLIAPI" }`
99
+ * with no `hint` renders as `Slack (SlackCLIAPI)`. To opt out of the
100
+ * auto-default, set `hint: ""` or `hint: []` explicitly.
101
+ *
102
+ * Skip-when-equal: a hint that matches the rendered name verbatim is
103
+ * suppressed so primitive-enum resolvers (where `name === String(value)`)
104
+ * don't render "read (read)". Case differences still render both.
105
+ */
106
+ export function renderChoiceLabel(choice) {
107
+ let effectiveHint = choice.hint;
108
+ if (effectiveHint === undefined &&
109
+ (typeof choice.value === "string" || typeof choice.value === "number")) {
110
+ effectiveHint = String(choice.value);
111
+ }
112
+ if (!effectiveHint ||
113
+ (Array.isArray(effectiveHint) && effectiveHint.length === 0)) {
114
+ return choice;
115
+ }
116
+ const hintText = Array.isArray(effectiveHint)
117
+ ? effectiveHint.join(", ")
118
+ : effectiveHint;
119
+ if (hintText === choice.name) {
120
+ return choice;
121
+ }
122
+ return { ...choice, name: `${choice.name} ${chalk.dim(`(${hintText})`)}` };
123
+ }
90
124
  export class SchemaParameterResolver {
91
125
  constructor() {
92
126
  this.debug = false;
@@ -123,16 +157,12 @@ export class SchemaParameterResolver {
123
157
  const hasValue = this.getNestedValue(providedParams, param.path) !== undefined;
124
158
  return !hasValue;
125
159
  });
126
- // Split missing resolvable params into required vs optional.
127
- // "inputs" is treated as required in interactive mode.
128
- const required = missingResolvable.filter((param) => {
129
- if (param.isRequired)
130
- return true;
131
- if (param.name === "inputs")
132
- return interactiveMode;
133
- return false;
134
- });
135
- const optional = missingResolvable.filter((param) => !required.includes(param));
160
+ // Split missing resolvable params into required vs optional based on
161
+ // schema. Optional params still get prompted in interactive mode, but
162
+ // in a second pass after the schema-required ones (and their resolver
163
+ // dependencies) are settled.
164
+ const required = missingResolvable.filter((param) => param.isRequired);
165
+ const optional = missingResolvable.filter((param) => !param.isRequired);
136
166
  if (parseResult.success &&
137
167
  required.length === 0 &&
138
168
  optional.length === 0) {
@@ -517,7 +547,7 @@ export class SchemaParameterResolver {
517
547
  }
518
548
  const { items } = await this.unpackFetchResult(fetchResult, promptLabel);
519
549
  const choicesConfig = resolver.prompt(items, searchParams);
520
- const dataChoices = choicesConfig.choices ?? [];
550
+ const dataChoices = (choicesConfig.choices ?? []).map(renderChoiceLabel);
521
551
  const capabilityHintMessages = await this.computeCapabilityHints(resolver, context);
522
552
  const selected = await search({
523
553
  message: choicesConfig.message,
@@ -734,6 +764,12 @@ export class SchemaParameterResolver {
734
764
  while (true) {
735
765
  const promptConfig = dynamicResolver.prompt(items, context.resolvedParams);
736
766
  promptConfig.name = promptName;
767
+ // Fold any per-choice `hint` into the rendered name once, here, so
768
+ // both the search-backed list path and the checkbox path below
769
+ // pick up the dim styling without each having to know about hints.
770
+ if (promptConfig.choices) {
771
+ promptConfig.choices = promptConfig.choices.map(renderChoiceLabel);
772
+ }
737
773
  // Friendlier than inquirer's default "No selectable choices. All
738
774
  // choices are disabled." when the resolver returns no items (or
739
775
  // filters everything out in `prompt`). Use ZapierCliValidationError