@zapier/zapier-sdk-cli 0.11.1 → 0.12.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk-cli",
3
- "version": "0.11.1",
3
+ "version": "0.12.0",
4
4
  "description": "Command line interface for Zapier SDK",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -42,9 +42,9 @@
42
42
  "ora": "^8.2.0",
43
43
  "pkce-challenge": "^5.0.0",
44
44
  "zod": "^3.25.67",
45
- "@zapier/zapier-sdk": "0.11.1",
46
45
  "@zapier/zapier-sdk-cli-login": "0.3.2",
47
- "@zapier/zapier-sdk-mcp": "0.3.9"
46
+ "@zapier/zapier-sdk": "0.12.0",
47
+ "@zapier/zapier-sdk-mcp": "0.3.11"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@types/express": "^5.0.3",
@@ -1,26 +1,35 @@
1
1
  import { z } from "zod";
2
2
  import { DEFAULT_CONFIG_PATH } from "@zapier/zapier-sdk";
3
3
 
4
- export const AddSchema = z.object({
5
- appKeys: z
6
- .array(z.string().min(1, "App key cannot be empty"))
7
- .min(1, "At least one app key is required"),
8
- authenticationIds: z
9
- .array(z.string())
10
- .optional()
11
- .describe("Authentication IDs to use for type generation"),
12
- configPath: z
13
- .string()
14
- .optional()
15
- .describe(
16
- `Path to Zapier config file (defaults to '${DEFAULT_CONFIG_PATH}')`,
17
- ),
18
- typesOutput: z
19
- .string()
20
- .optional()
21
- .describe(
22
- "Directory for TypeScript type files (defaults to (src|lib|.)/zapier/apps/)",
23
- ),
24
- });
4
+ export const AddSchema = z
5
+ .object({
6
+ appKeys: z
7
+ .array(z.string().min(1, "App key cannot be empty"))
8
+ .min(1, "At least one app key is required")
9
+ .describe(
10
+ "One or more app keys to add (e.g., 'slack', 'github', 'trello')",
11
+ ),
12
+ authenticationIds: z
13
+ .array(z.string())
14
+ .optional()
15
+ .describe(
16
+ "Authentication IDs to use for type generation (e.g., ['123', '456'])",
17
+ ),
18
+ configPath: z
19
+ .string()
20
+ .optional()
21
+ .describe(
22
+ `Path to Zapier config file (defaults to '${DEFAULT_CONFIG_PATH}', e.g., './custom/.zapierrc')`,
23
+ ),
24
+ typesOutput: z
25
+ .string()
26
+ .optional()
27
+ .describe(
28
+ "Directory for TypeScript type files (defaults to (src/lib/.)/zapier/apps/, e.g., './src/types/zapier/')",
29
+ ),
30
+ })
31
+ .describe(
32
+ "Add apps with manifest locking and TypeScript type generation - updates .zapierrc with app versions and generates TypeScript definition files",
33
+ );
25
34
 
26
35
  export type AddOptions = z.infer<typeof AddSchema>;
@@ -181,7 +181,7 @@ export function generateCliCommands(program: Command, sdk: ZapierSdk): void {
181
181
  return;
182
182
  }
183
183
 
184
- const registry = sdk.getRegistry();
184
+ const registry = sdk.getRegistry({ package: "cli" });
185
185
 
186
186
  // Create all commands first
187
187
  registry.functions.forEach((fnInfo) => {
@@ -616,8 +616,12 @@ async function handlePaginatedListWithAsyncIteration(
616
616
  }
617
617
 
618
618
  // Format and display items using function info
619
- if (functionInfo) {
620
- formatItemsFromSchema(functionInfo, items, totalShown);
619
+ if (functionInfo && functionInfo.inputSchema) {
620
+ formatItemsFromSchema(
621
+ functionInfo as { inputSchema: z.ZodType; outputSchema?: z.ZodType },
622
+ items,
623
+ totalShown,
624
+ );
621
625
  } else {
622
626
  formatItemsGeneric(items, totalShown);
623
627
  }
@@ -659,8 +663,12 @@ async function handlePaginatedListWithAsyncIteration(
659
663
  return;
660
664
  }
661
665
 
662
- if (functionInfo) {
663
- formatItemsFromSchema(functionInfo, items, 0);
666
+ if (functionInfo && functionInfo.inputSchema) {
667
+ formatItemsFromSchema(
668
+ functionInfo as { inputSchema: z.ZodType; outputSchema?: z.ZodType },
669
+ items,
670
+ 0,
671
+ );
664
672
  } else {
665
673
  formatItemsGeneric(items, 0);
666
674
  }
@@ -703,8 +711,11 @@ function formatNonPaginatedResults(
703
711
  console.log(chalk.green(`\n✅ Found ${result.length} ${itemName}:\n`));
704
712
 
705
713
  // Use function info for formatting
706
- if (functionInfo) {
707
- formatItemsFromSchema(functionInfo, result);
714
+ if (functionInfo && functionInfo.inputSchema) {
715
+ formatItemsFromSchema(
716
+ functionInfo as { inputSchema: z.ZodType; outputSchema?: z.ZodType },
717
+ result,
718
+ );
708
719
  } else {
709
720
  // Fallback to generic formatting
710
721
  formatItemsGeneric(result);
@@ -781,7 +781,7 @@ export class SchemaParameterResolver {
781
781
  ): boolean {
782
782
  // Check plugin-specific resolvers first
783
783
  if (functionName && typeof sdk.getRegistry === "function") {
784
- const registry = sdk.getRegistry();
784
+ const registry = sdk.getRegistry({ package: "cli" });
785
785
  const functionInfo = registry.functions.find(
786
786
  (f) => f.name === functionName,
787
787
  );
@@ -801,7 +801,7 @@ export class SchemaParameterResolver {
801
801
  ): any {
802
802
  // Check plugin-specific resolvers first
803
803
  if (functionName && typeof sdk.getRegistry === "function") {
804
- const registry = sdk.getRegistry();
804
+ const registry = sdk.getRegistry({ package: "cli" });
805
805
  const functionInfo = registry.functions.find(
806
806
  (f) => f.name === functionName,
807
807
  );