@zapier/zapier-sdk-cli 0.34.8 → 0.34.10

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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk-cli",
3
- "version": "0.34.8",
3
+ "version": "0.34.10",
4
4
  "description": "Command line interface for Zapier SDK",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -1,6 +1,7 @@
1
- import type { Plugin } from "@zapier/zapier-sdk";
1
+ import type { FunctionDeprecation, Plugin } from "@zapier/zapier-sdk";
2
2
  interface FetchMeta {
3
3
  categories?: string[];
4
+ deprecation?: FunctionDeprecation;
4
5
  }
5
6
  interface CliOverridesProvides {
6
7
  context: {
@@ -12,6 +12,9 @@ export const cliOverridesPlugin = ({ context }) => {
12
12
  fetch: {
13
13
  ...context.meta.fetch,
14
14
  categories: [...(context.meta.fetch.categories || []), "deprecated"],
15
+ deprecation: {
16
+ message: "This command is deprecated and will be removed soon. Use `curl` instead. Learn more: https://docs.zapier.com/sdk/cli-reference#curl",
17
+ },
15
18
  },
16
19
  },
17
20
  },
@@ -67,6 +67,16 @@ async function promptConfirm(confirmType) {
67
67
  ]);
68
68
  return { confirmed, messageAfter };
69
69
  }
70
+ function emitDeprecationWarning({ cliCommandName, deprecation, }) {
71
+ if (!deprecation) {
72
+ return;
73
+ }
74
+ console.warn();
75
+ console.warn(chalk.yellow.bold("⚠️ DEPRECATION WARNING") +
76
+ chalk.yellow(` - \`${cliCommandName}\` is deprecated.`));
77
+ console.warn(chalk.yellow(` ${deprecation.message}`));
78
+ console.warn();
79
+ }
70
80
  // ============================================================================
71
81
  // Schema Analysis
72
82
  // ============================================================================
@@ -342,6 +352,10 @@ function createCommandConfig(cliCommandName, functionInfo, sdk) {
342
352
  // The last argument is always the command object with parsed options
343
353
  const commandObj = args[args.length - 1];
344
354
  const options = commandObj.opts();
355
+ emitDeprecationWarning({
356
+ cliCommandName,
357
+ deprecation: functionInfo.deprecation,
358
+ });
345
359
  // Check if this is a list command for pagination
346
360
  const isListCommand = functionInfo.type === "list";
347
361
  const hasPaginationParams = parameters.some((p) => p.name === "maxItems" || p.name === "pageSize");