@zapier/zapier-sdk-cli 0.59.1 → 0.59.3

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.
Files changed (174) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/cli.cjs +51 -36
  3. package/dist/cli.mjs +53 -38
  4. package/dist/experimental.cjs +11 -3
  5. package/dist/experimental.mjs +12 -4
  6. package/dist/index.cjs +12 -4
  7. package/dist/index.mjs +13 -5
  8. package/package.json +3 -3
  9. package/dist/package.json +0 -121
  10. package/dist/src/cli.d.ts +0 -2
  11. package/dist/src/cli.js +0 -219
  12. package/dist/src/experimental.d.ts +0 -33
  13. package/dist/src/experimental.js +0 -86
  14. package/dist/src/generators/ast-generator.d.ts +0 -41
  15. package/dist/src/generators/ast-generator.js +0 -405
  16. package/dist/src/index.d.ts +0 -5
  17. package/dist/src/index.js +0 -5
  18. package/dist/src/login/config.d.ts +0 -4
  19. package/dist/src/login/config.js +0 -21
  20. package/dist/src/login/credentials-revoke.d.ts +0 -14
  21. package/dist/src/login/credentials-revoke.js +0 -95
  22. package/dist/src/login/credentials-store.d.ts +0 -60
  23. package/dist/src/login/credentials-store.js +0 -181
  24. package/dist/src/login/filesystem-cache.d.ts +0 -25
  25. package/dist/src/login/filesystem-cache.js +0 -195
  26. package/dist/src/login/index.d.ts +0 -110
  27. package/dist/src/login/index.js +0 -424
  28. package/dist/src/login/keychain.d.ts +0 -18
  29. package/dist/src/login/keychain.js +0 -74
  30. package/dist/src/login/legacy-jwt.d.ts +0 -4
  31. package/dist/src/login/legacy-jwt.js +0 -18
  32. package/dist/src/login.d.ts +0 -10
  33. package/dist/src/login.js +0 -10
  34. package/dist/src/paths.d.ts +0 -1
  35. package/dist/src/paths.js +0 -6
  36. package/dist/src/plugins/add/index.d.ts +0 -254
  37. package/dist/src/plugins/add/index.js +0 -95
  38. package/dist/src/plugins/add/schemas.d.ts +0 -8
  39. package/dist/src/plugins/add/schemas.js +0 -22
  40. package/dist/src/plugins/auth/credentials-base-url.d.ts +0 -11
  41. package/dist/src/plugins/auth/credentials-base-url.js +0 -24
  42. package/dist/src/plugins/buildManifest/index.d.ts +0 -120
  43. package/dist/src/plugins/buildManifest/index.js +0 -71
  44. package/dist/src/plugins/buildManifest/schemas.d.ts +0 -44
  45. package/dist/src/plugins/buildManifest/schemas.js +0 -17
  46. package/dist/src/plugins/bundleCode/index.d.ts +0 -23
  47. package/dist/src/plugins/bundleCode/index.js +0 -62
  48. package/dist/src/plugins/bundleCode/schemas.d.ts +0 -10
  49. package/dist/src/plugins/bundleCode/schemas.js +0 -19
  50. package/dist/src/plugins/cliOverrides/index.d.ts +0 -21
  51. package/dist/src/plugins/cliOverrides/index.js +0 -17
  52. package/dist/src/plugins/curl/index.d.ts +0 -76
  53. package/dist/src/plugins/curl/index.js +0 -236
  54. package/dist/src/plugins/curl/schemas.d.ts +0 -40
  55. package/dist/src/plugins/curl/schemas.js +0 -108
  56. package/dist/src/plugins/curl/utils.d.ts +0 -34
  57. package/dist/src/plugins/curl/utils.js +0 -150
  58. package/dist/src/plugins/drainTriggerInbox/index.d.ts +0 -46
  59. package/dist/src/plugins/drainTriggerInbox/index.js +0 -178
  60. package/dist/src/plugins/feedback/index.d.ts +0 -24
  61. package/dist/src/plugins/feedback/index.js +0 -52
  62. package/dist/src/plugins/feedback/schemas.d.ts +0 -5
  63. package/dist/src/plugins/feedback/schemas.js +0 -8
  64. package/dist/src/plugins/generateAppTypes/index.d.ts +0 -265
  65. package/dist/src/plugins/generateAppTypes/index.js +0 -129
  66. package/dist/src/plugins/generateAppTypes/schemas.d.ts +0 -58
  67. package/dist/src/plugins/generateAppTypes/schemas.js +0 -21
  68. package/dist/src/plugins/getLoginConfigPath/index.d.ts +0 -16
  69. package/dist/src/plugins/getLoginConfigPath/index.js +0 -9
  70. package/dist/src/plugins/getLoginConfigPath/schemas.d.ts +0 -3
  71. package/dist/src/plugins/getLoginConfigPath/schemas.js +0 -5
  72. package/dist/src/plugins/index.d.ts +0 -15
  73. package/dist/src/plugins/index.js +0 -15
  74. package/dist/src/plugins/init/display.d.ts +0 -9
  75. package/dist/src/plugins/init/display.js +0 -72
  76. package/dist/src/plugins/init/index.d.ts +0 -21
  77. package/dist/src/plugins/init/index.js +0 -56
  78. package/dist/src/plugins/init/schemas.d.ts +0 -9
  79. package/dist/src/plugins/init/schemas.js +0 -19
  80. package/dist/src/plugins/init/steps.d.ts +0 -39
  81. package/dist/src/plugins/init/steps.js +0 -141
  82. package/dist/src/plugins/init/types.d.ts +0 -31
  83. package/dist/src/plugins/init/types.js +0 -1
  84. package/dist/src/plugins/init/utils.d.ts +0 -48
  85. package/dist/src/plugins/init/utils.js +0 -135
  86. package/dist/src/plugins/login/index.d.ts +0 -25
  87. package/dist/src/plugins/login/index.js +0 -12
  88. package/dist/src/plugins/login/schemas.d.ts +0 -9
  89. package/dist/src/plugins/login/schemas.js +0 -27
  90. package/dist/src/plugins/logout/index.d.ts +0 -30
  91. package/dist/src/plugins/logout/index.js +0 -33
  92. package/dist/src/plugins/logout/schemas.d.ts +0 -2
  93. package/dist/src/plugins/logout/schemas.js +0 -4
  94. package/dist/src/plugins/mcp/index.d.ts +0 -28
  95. package/dist/src/plugins/mcp/index.js +0 -24
  96. package/dist/src/plugins/mcp/schemas.d.ts +0 -5
  97. package/dist/src/plugins/mcp/schemas.js +0 -10
  98. package/dist/src/plugins/signup/index.d.ts +0 -25
  99. package/dist/src/plugins/signup/index.js +0 -12
  100. package/dist/src/plugins/signup/schemas.d.ts +0 -9
  101. package/dist/src/plugins/signup/schemas.js +0 -26
  102. package/dist/src/plugins/signup/test-harness.d.ts +0 -34
  103. package/dist/src/plugins/signup/test-harness.js +0 -76
  104. package/dist/src/plugins/watchTriggerInbox/index.d.ts +0 -46
  105. package/dist/src/plugins/watchTriggerInbox/index.js +0 -166
  106. package/dist/src/sdk.d.ts +0 -17
  107. package/dist/src/sdk.js +0 -67
  108. package/dist/src/telemetry/builders.d.ts +0 -44
  109. package/dist/src/telemetry/builders.js +0 -59
  110. package/dist/src/telemetry/events.d.ts +0 -40
  111. package/dist/src/telemetry/events.js +0 -4
  112. package/dist/src/types/sdk.d.ts +0 -6
  113. package/dist/src/types/sdk.js +0 -1
  114. package/dist/src/utils/api/client.d.ts +0 -15
  115. package/dist/src/utils/api/client.js +0 -27
  116. package/dist/src/utils/approval-errors.d.ts +0 -1
  117. package/dist/src/utils/approval-errors.js +0 -9
  118. package/dist/src/utils/approval-progress.d.ts +0 -12
  119. package/dist/src/utils/approval-progress.js +0 -179
  120. package/dist/src/utils/auth/account-auth.d.ts +0 -33
  121. package/dist/src/utils/auth/account-auth.js +0 -302
  122. package/dist/src/utils/auth/client-credentials.d.ts +0 -26
  123. package/dist/src/utils/auth/client-credentials.js +0 -67
  124. package/dist/src/utils/auth/oauth-callback.d.ts +0 -6
  125. package/dist/src/utils/auth/oauth-callback.js +0 -28
  126. package/dist/src/utils/auth/oauth-errors.d.ts +0 -2
  127. package/dist/src/utils/auth/oauth-errors.js +0 -39
  128. package/dist/src/utils/auth/oauth-flow.d.ts +0 -37
  129. package/dist/src/utils/auth/oauth-flow.js +0 -313
  130. package/dist/src/utils/auth/oauth-transaction.d.ts +0 -35
  131. package/dist/src/utils/auth/oauth-transaction.js +0 -69
  132. package/dist/src/utils/cli-generator-utils.d.ts +0 -14
  133. package/dist/src/utils/cli-generator-utils.js +0 -122
  134. package/dist/src/utils/cli-generator.d.ts +0 -4
  135. package/dist/src/utils/cli-generator.js +0 -831
  136. package/dist/src/utils/cli-options.d.ts +0 -16
  137. package/dist/src/utils/cli-options.js +0 -34
  138. package/dist/src/utils/cli-renderer.d.ts +0 -53
  139. package/dist/src/utils/cli-renderer.js +0 -265
  140. package/dist/src/utils/constants.d.ts +0 -3
  141. package/dist/src/utils/constants.js +0 -5
  142. package/dist/src/utils/directory-detection.d.ts +0 -5
  143. package/dist/src/utils/directory-detection.js +0 -21
  144. package/dist/src/utils/errors.d.ts +0 -33
  145. package/dist/src/utils/errors.js +0 -36
  146. package/dist/src/utils/extensions.d.ts +0 -20
  147. package/dist/src/utils/extensions.js +0 -66
  148. package/dist/src/utils/getCallablePromise.d.ts +0 -6
  149. package/dist/src/utils/getCallablePromise.js +0 -14
  150. package/dist/src/utils/log.d.ts +0 -8
  151. package/dist/src/utils/log.js +0 -26
  152. package/dist/src/utils/manifest-helpers.d.ts +0 -10
  153. package/dist/src/utils/manifest-helpers.js +0 -19
  154. package/dist/src/utils/non-interactive.d.ts +0 -14
  155. package/dist/src/utils/non-interactive.js +0 -15
  156. package/dist/src/utils/package-manager-detector.d.ts +0 -18
  157. package/dist/src/utils/package-manager-detector.js +0 -72
  158. package/dist/src/utils/parameter-resolver.d.ts +0 -179
  159. package/dist/src/utils/parameter-resolver.js +0 -1554
  160. package/dist/src/utils/retry.d.ts +0 -6
  161. package/dist/src/utils/retry.js +0 -21
  162. package/dist/src/utils/schema-formatter.d.ts +0 -11
  163. package/dist/src/utils/schema-formatter.js +0 -131
  164. package/dist/src/utils/serializeAsync.d.ts +0 -2
  165. package/dist/src/utils/serializeAsync.js +0 -16
  166. package/dist/src/utils/spinner.d.ts +0 -1
  167. package/dist/src/utils/spinner.js +0 -21
  168. package/dist/src/utils/string-utils.d.ts +0 -1
  169. package/dist/src/utils/string-utils.js +0 -6
  170. package/dist/src/utils/triggerDrain.d.ts +0 -144
  171. package/dist/src/utils/triggerDrain.js +0 -351
  172. package/dist/src/utils/version-checker.d.ts +0 -17
  173. package/dist/src/utils/version-checker.js +0 -154
  174. package/dist/tsconfig.tsbuildinfo +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # @zapier/zapier-sdk-cli
2
2
 
3
+ ## 0.59.3
4
+
5
+ ### Patch Changes
6
+
7
+ - b8ff1dd: Refactor the SDKs onto kitcore's new internal plugin model.
8
+
9
+ kitcore (an internal building block) gained a new plugin model, and the SDKs were rebuilt on it behind a compatibility bridge, so existing behavior is unchanged. The only changes to the published packages' surface:
10
+ - Removed the deprecated `sdk.addPlugin(...)` chain method (and the `WithAddPlugin` type / chain-style no-arg `createSdk()` doorway). Extend a built SDK with the top-level `addPlugin(sdk, plugin)` instead.
11
+ - `@zapier/zapier-sdk` now re-exports the plugin-authoring helpers (`createSdk`, `defineMethod` / `definePlugin` / `declareMethod` / etc., `selectExports`, `addPlugin`). Note `createSdk` reuses the old doorway's name but now takes a root plugin, so a stale no-arg `createSdk()` call is a compile error rather than silent misbehavior.
12
+
13
+ - Updated dependencies [b8ff1dd]
14
+ - @zapier/zapier-sdk@0.78.0
15
+ - @zapier/zapier-sdk-mcp@0.15.3
16
+
17
+ ## 0.59.2
18
+
19
+ ### Patch Changes
20
+
21
+ - 365ad1b: Fix published type declarations referencing modules consumers can't resolve.
22
+
23
+ `tsc -b` (run in `validate` after the tsup build) was emitting per-module
24
+ declarations over tsup's bundled `dist/index.d.ts`, reintroducing hundreds of
25
+ `import("kitcore")` references; `kitcore` is bundled into the SDK and only a
26
+ devDependency, so consumer type-checks failed with "Cannot find module
27
+ 'kitcore'" (CJS only, since `tsc` doesn't emit the ESM `.d.mts`). tsc now emits
28
+ its declarations to a gitignored side dir instead of `dist`, so it can never
29
+ overwrite tsup's bundle, while project references and editor type-checking keep
30
+ working. (The CLI gets the same treatment, which also stops it from publishing
31
+ stray per-module declarations under `dist/src`.) Separately, the optional
32
+ `@zapier/zapier-sdk-cli/login` module is
33
+ referenced through a local interface instead of `typeof import(...)`, so its
34
+ reference no longer leaks into the published declarations. `verify-exports` now
35
+ fails the build if any published declaration references an undeclared package.
36
+
37
+ - Updated dependencies [365ad1b]
38
+ - @zapier/zapier-sdk@0.77.2
39
+ - @zapier/zapier-sdk-mcp@0.15.2
40
+
3
41
  ## 0.59.1
4
42
 
5
43
  ### Patch Changes
package/dist/cli.cjs CHANGED
@@ -183,18 +183,20 @@ function coerceToSchemaType(value, schema) {
183
183
  return value;
184
184
  }
185
185
  function renderChoiceLabel(choice) {
186
+ const baseName = choice.label ?? choice.name ?? "";
187
+ const alreadyNamed = choice.name === baseName;
186
188
  let effectiveHint = choice.hint;
187
189
  if (effectiveHint === void 0 && (typeof choice.value === "string" || typeof choice.value === "number")) {
188
190
  effectiveHint = String(choice.value);
189
191
  }
190
192
  if (!effectiveHint || Array.isArray(effectiveHint) && effectiveHint.length === 0) {
191
- return choice;
193
+ return alreadyNamed ? choice : { ...choice, name: baseName };
192
194
  }
193
195
  const hintText = Array.isArray(effectiveHint) ? effectiveHint.join(", ") : effectiveHint;
194
- if (hintText === choice.name) {
195
- return choice;
196
+ if (hintText === baseName) {
197
+ return alreadyNamed ? choice : { ...choice, name: baseName };
196
198
  }
197
- return { ...choice, name: `${choice.name} ${chalk__default.default.dim(`(${hintText})`)}` };
199
+ return { ...choice, name: `${baseName} ${chalk__default.default.dim(`(${hintText})`)}` };
198
200
  }
199
201
  var SchemaParameterResolver = class {
200
202
  constructor() {
@@ -792,8 +794,9 @@ var SchemaParameterResolver = class {
792
794
  context.resolvedParams
793
795
  );
794
796
  promptConfig.name = promptName;
797
+ const renderedChoices = promptConfig.choices ? promptConfig.choices.map(renderChoiceLabel) : [];
795
798
  if (promptConfig.choices) {
796
- promptConfig.choices = promptConfig.choices.map(renderChoiceLabel);
799
+ promptConfig.choices = renderedChoices;
797
800
  }
798
801
  const hasSelectableChoice = promptConfig.choices?.some(
799
802
  (c) => !c.disabled
@@ -819,7 +822,7 @@ var SchemaParameterResolver = class {
819
822
  }
820
823
  let selected;
821
824
  if (promptConfig.type === "list") {
822
- const dataChoices = promptConfig.choices ?? [];
825
+ const dataChoices = renderedChoices;
823
826
  selected = await search__default.default({
824
827
  message: promptConfig.message,
825
828
  validate: this.wrapPromptValidate(promptConfig.validate),
@@ -1576,7 +1579,7 @@ var SHARED_COMMAND_CLI_OPTIONS = [
1576
1579
 
1577
1580
  // package.json
1578
1581
  var package_default = {
1579
- version: "0.59.1"};
1582
+ version: "0.59.3"};
1580
1583
 
1581
1584
  // src/telemetry/builders.ts
1582
1585
  function createCliBaseEvent(context = {}) {
@@ -1649,19 +1652,11 @@ function formatJsonOutput(data) {
1649
1652
  }
1650
1653
  async function formatItemsFromSchema(_functionInfo, items, startingNumber = 0, options) {
1651
1654
  if (options?.formatter) {
1652
- let context;
1653
- if (options.formatter.fetch && options.sdk && options.params) {
1654
- for (const item of items) {
1655
- context = await options.formatter.fetch(
1656
- options.sdk,
1657
- options.params,
1658
- item,
1659
- context
1660
- );
1661
- }
1662
- }
1655
+ const formatter = options.formatter;
1656
+ const input = options.input ?? {};
1657
+ const context = formatter.fetchContext ? await formatter.fetchContext({ items, input }) : void 0;
1663
1658
  items.forEach((item, index) => {
1664
- const formatted = options.formatter.format(item, context);
1659
+ const formatted = formatter.format({ item, input, context });
1665
1660
  formatSingleItem(formatted, startingNumber + index);
1666
1661
  });
1667
1662
  return;
@@ -1671,13 +1666,19 @@ async function formatItemsFromSchema(_functionInfo, items, startingNumber = 0, o
1671
1666
  function formatSingleItem(formatted, itemNumber) {
1672
1667
  let titleLine = `${chalk__default.default.gray(`${itemNumber + 1}.`)} ${chalk__default.default.cyan(formatted.title)}`;
1673
1668
  const subtitleParts = [];
1674
- if (formatted.keys) {
1675
- subtitleParts.push(...formatted.keys);
1676
- } else if (formatted.key) {
1677
- subtitleParts.push(formatted.key);
1678
- }
1679
- if (formatted.id) {
1680
- subtitleParts.push(formatted.id);
1669
+ if (formatted.hint !== void 0) {
1670
+ subtitleParts.push(
1671
+ ...Array.isArray(formatted.hint) ? formatted.hint : [formatted.hint]
1672
+ );
1673
+ } else {
1674
+ if (formatted.keys) {
1675
+ subtitleParts.push(...formatted.keys);
1676
+ } else if (formatted.key) {
1677
+ subtitleParts.push(formatted.key);
1678
+ }
1679
+ if (formatted.id) {
1680
+ subtitleParts.push(formatted.id);
1681
+ }
1681
1682
  }
1682
1683
  const uniqueParts = [...new Set(subtitleParts)];
1683
1684
  if (uniqueParts.length > 0) {
@@ -1687,8 +1688,8 @@ function formatSingleItem(formatted, itemNumber) {
1687
1688
  if (formatted.description) {
1688
1689
  console.log(` ${chalk__default.default.dim(formatted.description)}`);
1689
1690
  }
1690
- if (formatted.data !== void 0) {
1691
- formatJsonOutput(formatted.data);
1691
+ if (formatted.raw !== void 0) {
1692
+ formatJsonOutput(formatted.raw);
1692
1693
  console.log();
1693
1694
  return;
1694
1695
  }
@@ -1874,8 +1875,7 @@ function createInteractiveRenderer(context = {}) {
1874
1875
  startingNumber,
1875
1876
  {
1876
1877
  formatter: functionInfo.formatter,
1877
- sdk: context.sdk,
1878
- params: context.params
1878
+ input: context.params
1879
1879
  }
1880
1880
  );
1881
1881
  } else {
@@ -2428,7 +2428,6 @@ function createCommandConfig(cliCommandName, functionInfo, sdk) {
2428
2428
  const options = commandObj.opts();
2429
2429
  const interactiveMode = !options.json;
2430
2430
  const renderer = interactiveMode ? createInteractiveRenderer({
2431
- sdk,
2432
2431
  params: resolvedParams
2433
2432
  }) : createJsonRenderer();
2434
2433
  try {
@@ -7267,7 +7266,7 @@ var watchTriggerInboxCliPlugin = zapierSdk.definePlugin(
7267
7266
  // package.json with { type: 'json' }
7268
7267
  var package_default2 = {
7269
7268
  name: "@zapier/zapier-sdk-cli",
7270
- version: "0.59.1"};
7269
+ version: "0.59.3"};
7271
7270
 
7272
7271
  // src/sdk.ts
7273
7272
  zapierSdk.injectCliLogin(login_exports);
@@ -7276,11 +7275,19 @@ function createZapierCliSdk(options = {}) {
7276
7275
  const extensionsContextPlugin = () => ({
7277
7276
  context: { extensions }
7278
7277
  });
7279
- const sdk = zapierSdk.createZapierSdkStack({
7278
+ const stack = zapierSdk.createZapierSdkStack({
7280
7279
  ...sdkOptions,
7281
7280
  eventEmission: { ...sdkOptions.eventEmission, callContext: "cli" },
7282
7281
  callerPackage: { name: package_default2.name, version: package_default2.version }
7283
- }).use(extensionsContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(mcpPlugin).use(loginPlugin).use(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true }).toSdk();
7282
+ }).use(extensionsContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(mcpPlugin).use(loginPlugin).use(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true });
7283
+ const sdk = zapierSdk.createSdk(
7284
+ zapierSdk.defineLegacyMerge({
7285
+ namespace: "zapier",
7286
+ name: "cli-stack-merge",
7287
+ legacy: stack.toPlugin(),
7288
+ plugin: zapierSdk.zapierSdkPlugin
7289
+ })
7290
+ );
7284
7291
  for (const ext of extensions) {
7285
7292
  try {
7286
7293
  zapierSdk.addPlugin(sdk, ext);
@@ -7301,11 +7308,19 @@ function createZapierCliSdk2(options = {}) {
7301
7308
  const experimentalContextPlugin = () => ({
7302
7309
  context: { experimental: true }
7303
7310
  });
7304
- const sdk = experimental.createZapierSdkStack({
7311
+ const stack = experimental.createZapierSdkStack({
7305
7312
  ...sdkOptions,
7306
7313
  eventEmission: { ...sdkOptions.eventEmission, callContext: "cli" },
7307
7314
  callerPackage: { name: package_default2.name, version: package_default2.version }
7308
- }).use(extensionsContextPlugin).use(experimentalContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(drainTriggerInboxCliPlugin, { override: true }).use(watchTriggerInboxCliPlugin, { override: true }).use(mcpPlugin).use(loginPlugin).use(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true }).toSdk();
7315
+ }).use(extensionsContextPlugin).use(experimentalContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(drainTriggerInboxCliPlugin, { override: true }).use(watchTriggerInboxCliPlugin, { override: true }).use(mcpPlugin).use(loginPlugin).use(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true });
7316
+ const sdk = experimental.createSdk(
7317
+ experimental.defineLegacyMerge({
7318
+ namespace: "zapier",
7319
+ name: "cli-experimental-stack-merge",
7320
+ legacy: stack.toPlugin(),
7321
+ plugin: experimental.zapierSdkPlugin
7322
+ })
7323
+ );
7309
7324
  for (const ext of extensions) {
7310
7325
  try {
7311
7326
  experimental.addPlugin(sdk, ext);
package/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command, CommanderError, Option } from 'commander';
3
3
  import { z } from 'zod';
4
- import { definePlugin, createPluginMethod, OutputPropertySchema, ZapierBundleError, DEFAULT_CONFIG_PATH, ZapierValidationError, ZapierUnknownError, ZapierReleaseTriggerMessageSignal, injectCliLogin, BaseSdkOptionsSchema, getOrCreateApiClient, isPermanentHttpError, invalidateCachedToken, batch, toSnakeCase, ZapierAbortDrainSignal, createZapierSdkStack as createZapierSdkStack$1, addPlugin as addPlugin$1, ZapierError, isCredentialsObject, buildApplicationLifecycleEvent, AuthMechanism, ZapierAuthenticationError, runWithCallerContext, isPositional, runWithTelemetryContext, buildCapabilityMessage, formatErrorMessage, getOsInfo, getPlatformVersions, getAgent, getTtyContext, getCiPlatform, isCi, getReleaseId, getCurrentTimestamp, generateEventId, ZapierApprovalError } from '@zapier/zapier-sdk';
4
+ import { definePlugin, createPluginMethod, OutputPropertySchema, ZapierBundleError, DEFAULT_CONFIG_PATH, ZapierValidationError, ZapierUnknownError, ZapierReleaseTriggerMessageSignal, injectCliLogin, BaseSdkOptionsSchema, getOrCreateApiClient, isPermanentHttpError, invalidateCachedToken, batch, toSnakeCase, ZapierAbortDrainSignal, createZapierSdkStack as createZapierSdkStack$1, createSdk as createSdk$1, defineLegacyMerge as defineLegacyMerge$1, zapierSdkPlugin as zapierSdkPlugin$1, addPlugin as addPlugin$1, ZapierError, isCredentialsObject, buildApplicationLifecycleEvent, AuthMechanism, ZapierAuthenticationError, runWithCallerContext, isPositional, runWithTelemetryContext, buildCapabilityMessage, formatErrorMessage, getOsInfo, getPlatformVersions, getAgent, getTtyContext, getCiPlatform, isCi, getReleaseId, getCurrentTimestamp, generateEventId, ZapierApprovalError } from '@zapier/zapier-sdk';
5
5
  import inquirer from 'inquirer';
6
6
  import search from '@inquirer/search';
7
7
  import chalk from 'chalk';
@@ -30,7 +30,7 @@ import isInstalledGlobally from 'is-installed-globally';
30
30
  import { execSync, spawn } from 'child_process';
31
31
  import Handlebars from 'handlebars';
32
32
  import { fileURLToPath } from 'url';
33
- import { injectCliLogin as injectCliLogin$1, createZapierSdkStack, addPlugin } from '@zapier/zapier-sdk/experimental';
33
+ import { injectCliLogin as injectCliLogin$1, createZapierSdkStack, createSdk, defineLegacyMerge, zapierSdkPlugin, addPlugin } from '@zapier/zapier-sdk/experimental';
34
34
  import packageJsonLib, { VersionNotFoundError } from 'package-json';
35
35
  import semver from 'semver';
36
36
  import React from 'react';
@@ -140,18 +140,20 @@ function coerceToSchemaType(value, schema) {
140
140
  return value;
141
141
  }
142
142
  function renderChoiceLabel(choice) {
143
+ const baseName = choice.label ?? choice.name ?? "";
144
+ const alreadyNamed = choice.name === baseName;
143
145
  let effectiveHint = choice.hint;
144
146
  if (effectiveHint === void 0 && (typeof choice.value === "string" || typeof choice.value === "number")) {
145
147
  effectiveHint = String(choice.value);
146
148
  }
147
149
  if (!effectiveHint || Array.isArray(effectiveHint) && effectiveHint.length === 0) {
148
- return choice;
150
+ return alreadyNamed ? choice : { ...choice, name: baseName };
149
151
  }
150
152
  const hintText = Array.isArray(effectiveHint) ? effectiveHint.join(", ") : effectiveHint;
151
- if (hintText === choice.name) {
152
- return choice;
153
+ if (hintText === baseName) {
154
+ return alreadyNamed ? choice : { ...choice, name: baseName };
153
155
  }
154
- return { ...choice, name: `${choice.name} ${chalk.dim(`(${hintText})`)}` };
156
+ return { ...choice, name: `${baseName} ${chalk.dim(`(${hintText})`)}` };
155
157
  }
156
158
  var SchemaParameterResolver = class {
157
159
  constructor() {
@@ -749,8 +751,9 @@ var SchemaParameterResolver = class {
749
751
  context.resolvedParams
750
752
  );
751
753
  promptConfig.name = promptName;
754
+ const renderedChoices = promptConfig.choices ? promptConfig.choices.map(renderChoiceLabel) : [];
752
755
  if (promptConfig.choices) {
753
- promptConfig.choices = promptConfig.choices.map(renderChoiceLabel);
756
+ promptConfig.choices = renderedChoices;
754
757
  }
755
758
  const hasSelectableChoice = promptConfig.choices?.some(
756
759
  (c) => !c.disabled
@@ -776,7 +779,7 @@ var SchemaParameterResolver = class {
776
779
  }
777
780
  let selected;
778
781
  if (promptConfig.type === "list") {
779
- const dataChoices = promptConfig.choices ?? [];
782
+ const dataChoices = renderedChoices;
780
783
  selected = await search({
781
784
  message: promptConfig.message,
782
785
  validate: this.wrapPromptValidate(promptConfig.validate),
@@ -1533,7 +1536,7 @@ var SHARED_COMMAND_CLI_OPTIONS = [
1533
1536
 
1534
1537
  // package.json
1535
1538
  var package_default = {
1536
- version: "0.59.1"};
1539
+ version: "0.59.3"};
1537
1540
 
1538
1541
  // src/telemetry/builders.ts
1539
1542
  function createCliBaseEvent(context = {}) {
@@ -1606,19 +1609,11 @@ function formatJsonOutput(data) {
1606
1609
  }
1607
1610
  async function formatItemsFromSchema(_functionInfo, items, startingNumber = 0, options) {
1608
1611
  if (options?.formatter) {
1609
- let context;
1610
- if (options.formatter.fetch && options.sdk && options.params) {
1611
- for (const item of items) {
1612
- context = await options.formatter.fetch(
1613
- options.sdk,
1614
- options.params,
1615
- item,
1616
- context
1617
- );
1618
- }
1619
- }
1612
+ const formatter = options.formatter;
1613
+ const input = options.input ?? {};
1614
+ const context = formatter.fetchContext ? await formatter.fetchContext({ items, input }) : void 0;
1620
1615
  items.forEach((item, index) => {
1621
- const formatted = options.formatter.format(item, context);
1616
+ const formatted = formatter.format({ item, input, context });
1622
1617
  formatSingleItem(formatted, startingNumber + index);
1623
1618
  });
1624
1619
  return;
@@ -1628,13 +1623,19 @@ async function formatItemsFromSchema(_functionInfo, items, startingNumber = 0, o
1628
1623
  function formatSingleItem(formatted, itemNumber) {
1629
1624
  let titleLine = `${chalk.gray(`${itemNumber + 1}.`)} ${chalk.cyan(formatted.title)}`;
1630
1625
  const subtitleParts = [];
1631
- if (formatted.keys) {
1632
- subtitleParts.push(...formatted.keys);
1633
- } else if (formatted.key) {
1634
- subtitleParts.push(formatted.key);
1635
- }
1636
- if (formatted.id) {
1637
- subtitleParts.push(formatted.id);
1626
+ if (formatted.hint !== void 0) {
1627
+ subtitleParts.push(
1628
+ ...Array.isArray(formatted.hint) ? formatted.hint : [formatted.hint]
1629
+ );
1630
+ } else {
1631
+ if (formatted.keys) {
1632
+ subtitleParts.push(...formatted.keys);
1633
+ } else if (formatted.key) {
1634
+ subtitleParts.push(formatted.key);
1635
+ }
1636
+ if (formatted.id) {
1637
+ subtitleParts.push(formatted.id);
1638
+ }
1638
1639
  }
1639
1640
  const uniqueParts = [...new Set(subtitleParts)];
1640
1641
  if (uniqueParts.length > 0) {
@@ -1644,8 +1645,8 @@ function formatSingleItem(formatted, itemNumber) {
1644
1645
  if (formatted.description) {
1645
1646
  console.log(` ${chalk.dim(formatted.description)}`);
1646
1647
  }
1647
- if (formatted.data !== void 0) {
1648
- formatJsonOutput(formatted.data);
1648
+ if (formatted.raw !== void 0) {
1649
+ formatJsonOutput(formatted.raw);
1649
1650
  console.log();
1650
1651
  return;
1651
1652
  }
@@ -1831,8 +1832,7 @@ function createInteractiveRenderer(context = {}) {
1831
1832
  startingNumber,
1832
1833
  {
1833
1834
  formatter: functionInfo.formatter,
1834
- sdk: context.sdk,
1835
- params: context.params
1835
+ input: context.params
1836
1836
  }
1837
1837
  );
1838
1838
  } else {
@@ -2385,7 +2385,6 @@ function createCommandConfig(cliCommandName, functionInfo, sdk) {
2385
2385
  const options = commandObj.opts();
2386
2386
  const interactiveMode = !options.json;
2387
2387
  const renderer = interactiveMode ? createInteractiveRenderer({
2388
- sdk,
2389
2388
  params: resolvedParams
2390
2389
  }) : createJsonRenderer();
2391
2390
  try {
@@ -7224,7 +7223,7 @@ var watchTriggerInboxCliPlugin = definePlugin(
7224
7223
  // package.json with { type: 'json' }
7225
7224
  var package_default2 = {
7226
7225
  name: "@zapier/zapier-sdk-cli",
7227
- version: "0.59.1"};
7226
+ version: "0.59.3"};
7228
7227
 
7229
7228
  // src/sdk.ts
7230
7229
  injectCliLogin(login_exports);
@@ -7233,11 +7232,19 @@ function createZapierCliSdk(options = {}) {
7233
7232
  const extensionsContextPlugin = () => ({
7234
7233
  context: { extensions }
7235
7234
  });
7236
- const sdk = createZapierSdkStack$1({
7235
+ const stack = createZapierSdkStack$1({
7237
7236
  ...sdkOptions,
7238
7237
  eventEmission: { ...sdkOptions.eventEmission, callContext: "cli" },
7239
7238
  callerPackage: { name: package_default2.name, version: package_default2.version }
7240
- }).use(extensionsContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(mcpPlugin).use(loginPlugin).use(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true }).toSdk();
7239
+ }).use(extensionsContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(mcpPlugin).use(loginPlugin).use(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true });
7240
+ const sdk = createSdk$1(
7241
+ defineLegacyMerge$1({
7242
+ namespace: "zapier",
7243
+ name: "cli-stack-merge",
7244
+ legacy: stack.toPlugin(),
7245
+ plugin: zapierSdkPlugin$1
7246
+ })
7247
+ );
7241
7248
  for (const ext of extensions) {
7242
7249
  try {
7243
7250
  addPlugin$1(sdk, ext);
@@ -7258,11 +7265,19 @@ function createZapierCliSdk2(options = {}) {
7258
7265
  const experimentalContextPlugin = () => ({
7259
7266
  context: { experimental: true }
7260
7267
  });
7261
- const sdk = createZapierSdkStack({
7268
+ const stack = createZapierSdkStack({
7262
7269
  ...sdkOptions,
7263
7270
  eventEmission: { ...sdkOptions.eventEmission, callContext: "cli" },
7264
7271
  callerPackage: { name: package_default2.name, version: package_default2.version }
7265
- }).use(extensionsContextPlugin).use(experimentalContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(drainTriggerInboxCliPlugin, { override: true }).use(watchTriggerInboxCliPlugin, { override: true }).use(mcpPlugin).use(loginPlugin).use(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true }).toSdk();
7272
+ }).use(extensionsContextPlugin).use(experimentalContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(drainTriggerInboxCliPlugin, { override: true }).use(watchTriggerInboxCliPlugin, { override: true }).use(mcpPlugin).use(loginPlugin).use(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true });
7273
+ const sdk = createSdk(
7274
+ defineLegacyMerge({
7275
+ namespace: "zapier",
7276
+ name: "cli-experimental-stack-merge",
7277
+ legacy: stack.toPlugin(),
7278
+ plugin: zapierSdkPlugin
7279
+ })
7280
+ );
7266
7281
  for (const ext of extensions) {
7267
7282
  try {
7268
7283
  addPlugin(sdk, ext);
@@ -4594,7 +4594,7 @@ var watchTriggerInboxCliPlugin = zapierSdk.definePlugin(
4594
4594
  // package.json with { type: 'json' }
4595
4595
  var package_default = {
4596
4596
  name: "@zapier/zapier-sdk-cli",
4597
- version: "0.59.1"};
4597
+ version: "0.59.3"};
4598
4598
 
4599
4599
  // src/experimental.ts
4600
4600
  experimental.injectCliLogin(login_exports);
@@ -4606,11 +4606,19 @@ function createZapierCliSdk(options = {}) {
4606
4606
  const experimentalContextPlugin = () => ({
4607
4607
  context: { experimental: true }
4608
4608
  });
4609
- const sdk = experimental.createZapierSdkStack({
4609
+ const stack = experimental.createZapierSdkStack({
4610
4610
  ...sdkOptions,
4611
4611
  eventEmission: { ...sdkOptions.eventEmission, callContext: "cli" },
4612
4612
  callerPackage: { name: package_default.name, version: package_default.version }
4613
- }).use(extensionsContextPlugin).use(experimentalContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(drainTriggerInboxCliPlugin, { override: true }).use(watchTriggerInboxCliPlugin, { override: true }).use(mcpPlugin).use(loginPlugin).use(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true }).toSdk();
4613
+ }).use(extensionsContextPlugin).use(experimentalContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(drainTriggerInboxCliPlugin, { override: true }).use(watchTriggerInboxCliPlugin, { override: true }).use(mcpPlugin).use(loginPlugin).use(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true });
4614
+ const sdk = experimental.createSdk(
4615
+ experimental.defineLegacyMerge({
4616
+ namespace: "zapier",
4617
+ name: "cli-experimental-stack-merge",
4618
+ legacy: stack.toPlugin(),
4619
+ plugin: experimental.zapierSdkPlugin
4620
+ })
4621
+ );
4614
4622
  for (const ext of extensions) {
4615
4623
  try {
4616
4624
  experimental.addPlugin(sdk, ext);
@@ -9,7 +9,7 @@ import { resolve, join, dirname, basename, relative, extname } from 'path';
9
9
  import * as lockfile from 'proper-lockfile';
10
10
  import { definePlugin, createPluginMethod, OutputPropertySchema, ZapierBundleError, DEFAULT_CONFIG_PATH, ZapierValidationError, ZapierUnknownError, ZapierReleaseTriggerMessageSignal, getOrCreateApiClient, isPermanentHttpError, invalidateCachedToken, batch, toSnakeCase, ZapierAbortDrainSignal, isCredentialsObject, buildApplicationLifecycleEvent, AuthMechanism, ZapierAuthenticationError, ZapierError } from '@zapier/zapier-sdk';
11
11
  import { z } from 'zod';
12
- import { injectCliLogin, createZapierSdkStack, addPlugin } from '@zapier/zapier-sdk/experimental';
12
+ import { injectCliLogin, createZapierSdkStack, createSdk, defineLegacyMerge, zapierSdkPlugin, addPlugin } from '@zapier/zapier-sdk/experimental';
13
13
  import { hostname } from 'os';
14
14
  import inquirer from 'inquirer';
15
15
  import express from 'express';
@@ -4558,7 +4558,7 @@ var watchTriggerInboxCliPlugin = definePlugin(
4558
4558
  // package.json with { type: 'json' }
4559
4559
  var package_default = {
4560
4560
  name: "@zapier/zapier-sdk-cli",
4561
- version: "0.59.1"};
4561
+ version: "0.59.3"};
4562
4562
 
4563
4563
  // src/experimental.ts
4564
4564
  injectCliLogin(login_exports);
@@ -4570,11 +4570,19 @@ function createZapierCliSdk(options = {}) {
4570
4570
  const experimentalContextPlugin = () => ({
4571
4571
  context: { experimental: true }
4572
4572
  });
4573
- const sdk = createZapierSdkStack({
4573
+ const stack = createZapierSdkStack({
4574
4574
  ...sdkOptions,
4575
4575
  eventEmission: { ...sdkOptions.eventEmission, callContext: "cli" },
4576
4576
  callerPackage: { name: package_default.name, version: package_default.version }
4577
- }).use(extensionsContextPlugin).use(experimentalContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(drainTriggerInboxCliPlugin, { override: true }).use(watchTriggerInboxCliPlugin, { override: true }).use(mcpPlugin).use(loginPlugin).use(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true }).toSdk();
4577
+ }).use(extensionsContextPlugin).use(experimentalContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(drainTriggerInboxCliPlugin, { override: true }).use(watchTriggerInboxCliPlugin, { override: true }).use(mcpPlugin).use(loginPlugin).use(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true });
4578
+ const sdk = createSdk(
4579
+ defineLegacyMerge({
4580
+ namespace: "zapier",
4581
+ name: "cli-experimental-stack-merge",
4582
+ legacy: stack.toPlugin(),
4583
+ plugin: zapierSdkPlugin
4584
+ })
4585
+ );
4578
4586
  for (const ext of extensions) {
4579
4587
  try {
4580
4588
  addPlugin(sdk, ext);
package/dist/index.cjs CHANGED
@@ -4593,7 +4593,7 @@ zapierSdk.definePlugin(
4593
4593
  // package.json with { type: 'json' }
4594
4594
  var package_default = {
4595
4595
  name: "@zapier/zapier-sdk-cli",
4596
- version: "0.59.1"};
4596
+ version: "0.59.3"};
4597
4597
 
4598
4598
  // src/sdk.ts
4599
4599
  zapierSdk.injectCliLogin(login_exports);
@@ -4602,11 +4602,19 @@ function createZapierCliSdk(options = {}) {
4602
4602
  const extensionsContextPlugin = () => ({
4603
4603
  context: { extensions }
4604
4604
  });
4605
- const sdk = zapierSdk.createZapierSdkStack({
4605
+ const stack = zapierSdk.createZapierSdkStack({
4606
4606
  ...sdkOptions,
4607
4607
  eventEmission: { ...sdkOptions.eventEmission, callContext: "cli" },
4608
4608
  callerPackage: { name: package_default.name, version: package_default.version }
4609
- }).use(extensionsContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(mcpPlugin).use(loginPlugin).use(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true }).toSdk();
4609
+ }).use(extensionsContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(mcpPlugin).use(loginPlugin).use(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true });
4610
+ const sdk = zapierSdk.createSdk(
4611
+ zapierSdk.defineLegacyMerge({
4612
+ namespace: "zapier",
4613
+ name: "cli-stack-merge",
4614
+ legacy: stack.toPlugin(),
4615
+ plugin: zapierSdk.zapierSdkPlugin
4616
+ })
4617
+ );
4610
4618
  for (const ext of extensions) {
4611
4619
  try {
4612
4620
  zapierSdk.addPlugin(sdk, ext);
@@ -4621,7 +4629,7 @@ function createZapierCliSdk(options = {}) {
4621
4629
 
4622
4630
  // package.json
4623
4631
  var package_default2 = {
4624
- version: "0.59.1"};
4632
+ version: "0.59.3"};
4625
4633
 
4626
4634
  // src/telemetry/builders.ts
4627
4635
  function createCliBaseEvent(context = {}) {
package/dist/index.mjs CHANGED
@@ -7,7 +7,7 @@ import crypto, { createHash } from 'crypto';
7
7
  import * as path from 'path';
8
8
  import { resolve, join, dirname, basename, relative, extname } from 'path';
9
9
  import * as lockfile from 'proper-lockfile';
10
- import { definePlugin, createPluginMethod, OutputPropertySchema, ZapierBundleError, DEFAULT_CONFIG_PATH, ZapierValidationError, ZapierUnknownError, ZapierReleaseTriggerMessageSignal, injectCliLogin, getOrCreateApiClient, isPermanentHttpError, invalidateCachedToken, batch, toSnakeCase, ZapierAbortDrainSignal, isCredentialsObject, buildApplicationLifecycleEvent, AuthMechanism, ZapierAuthenticationError, ZapierError, createZapierSdkStack, addPlugin, getOsInfo, getPlatformVersions, getAgent, getTtyContext, getCiPlatform, isCi, getReleaseId, getCurrentTimestamp, generateEventId } from '@zapier/zapier-sdk';
10
+ import { definePlugin, createPluginMethod, OutputPropertySchema, ZapierBundleError, DEFAULT_CONFIG_PATH, ZapierValidationError, ZapierUnknownError, ZapierReleaseTriggerMessageSignal, injectCliLogin, getOrCreateApiClient, isPermanentHttpError, invalidateCachedToken, batch, toSnakeCase, ZapierAbortDrainSignal, isCredentialsObject, buildApplicationLifecycleEvent, AuthMechanism, ZapierAuthenticationError, ZapierError, createZapierSdkStack, createSdk, defineLegacyMerge, zapierSdkPlugin, addPlugin, getOsInfo, getPlatformVersions, getAgent, getTtyContext, getCiPlatform, isCi, getReleaseId, getCurrentTimestamp, generateEventId } from '@zapier/zapier-sdk';
11
11
  import { z } from 'zod';
12
12
  import { hostname } from 'os';
13
13
  import inquirer from 'inquirer';
@@ -4557,7 +4557,7 @@ definePlugin(
4557
4557
  // package.json with { type: 'json' }
4558
4558
  var package_default = {
4559
4559
  name: "@zapier/zapier-sdk-cli",
4560
- version: "0.59.1"};
4560
+ version: "0.59.3"};
4561
4561
 
4562
4562
  // src/sdk.ts
4563
4563
  injectCliLogin(login_exports);
@@ -4566,11 +4566,19 @@ function createZapierCliSdk(options = {}) {
4566
4566
  const extensionsContextPlugin = () => ({
4567
4567
  context: { extensions }
4568
4568
  });
4569
- const sdk = createZapierSdkStack({
4569
+ const stack = createZapierSdkStack({
4570
4570
  ...sdkOptions,
4571
4571
  eventEmission: { ...sdkOptions.eventEmission, callContext: "cli" },
4572
4572
  callerPackage: { name: package_default.name, version: package_default.version }
4573
- }).use(extensionsContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(mcpPlugin).use(loginPlugin).use(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true }).toSdk();
4573
+ }).use(extensionsContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(mcpPlugin).use(loginPlugin).use(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true });
4574
+ const sdk = createSdk(
4575
+ defineLegacyMerge({
4576
+ namespace: "zapier",
4577
+ name: "cli-stack-merge",
4578
+ legacy: stack.toPlugin(),
4579
+ plugin: zapierSdkPlugin
4580
+ })
4581
+ );
4574
4582
  for (const ext of extensions) {
4575
4583
  try {
4576
4584
  addPlugin(sdk, ext);
@@ -4585,7 +4593,7 @@ function createZapierCliSdk(options = {}) {
4585
4593
 
4586
4594
  // package.json
4587
4595
  var package_default2 = {
4588
- version: "0.59.1"};
4596
+ version: "0.59.3"};
4589
4597
 
4590
4598
  // src/telemetry/builders.ts
4591
4599
  function createCliBaseEvent(context = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk-cli",
3
- "version": "0.59.1",
3
+ "version": "0.59.3",
4
4
  "description": "Command line interface for Zapier SDK",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -95,8 +95,8 @@
95
95
  "typescript": "^5.8.3",
96
96
  "wrap-ansi": "^10.0.0",
97
97
  "zod": "4.3.6",
98
- "@zapier/zapier-sdk": "0.77.1",
99
- "@zapier/zapier-sdk-mcp": "0.15.1"
98
+ "@zapier/zapier-sdk": "0.78.0",
99
+ "@zapier/zapier-sdk-mcp": "0.15.3"
100
100
  },
101
101
  "devDependencies": {
102
102
  "@types/express": "^5.0.3",