@zapier/zapier-sdk-cli 0.13.10 → 0.13.12

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.13.10",
3
+ "version": "0.13.12",
4
4
  "description": "Command line interface for Zapier SDK",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -43,9 +43,9 @@
43
43
  "pkce-challenge": "^5.0.0",
44
44
  "typescript": "^5.8.3",
45
45
  "zod": "^3.25.67",
46
- "@zapier/zapier-sdk": "0.13.7",
47
- "@zapier/zapier-sdk-cli-login": "0.3.3",
48
- "@zapier/zapier-sdk-mcp": "0.3.20"
46
+ "@zapier/zapier-sdk": "0.13.9",
47
+ "@zapier/zapier-sdk-cli-login": "0.3.4",
48
+ "@zapier/zapier-sdk-mcp": "0.3.22"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@types/express": "^5.0.3",
package/src/cli.test.ts CHANGED
@@ -11,4 +11,14 @@ describe("CLI", () => {
11
11
  expect(result).toContain("Options:");
12
12
  expect(result).toContain("Commands:");
13
13
  });
14
+
15
+ it("should include authClientId option in help", () => {
16
+ const result = execSync("npx tsx src/cli.ts --help", {
17
+ encoding: "utf-8",
18
+ cwd: __dirname + "/..",
19
+ });
20
+
21
+ expect(result).toContain("--auth-client-id <id>");
22
+ expect(result).toContain("OAuth client ID for Zapier authentication");
23
+ });
14
24
  });
package/src/cli.ts CHANGED
@@ -11,15 +11,47 @@ program
11
11
  .name("zapier-sdk")
12
12
  .description("CLI for Zapier SDK")
13
13
  .version(packageJson.version, "-v, --version", "display version number")
14
- .option("--debug", "Enable debug logging");
14
+ .option("--debug", "Enable debug logging")
15
+ .option("--base-url <url>", "Base URL for Zapier API endpoints")
16
+ .option(
17
+ "--auth-base-url <url>",
18
+ "Base URL for Zapier authentication endpoints",
19
+ )
20
+ .option("--auth-client-id <id>", "OAuth client ID for Zapier authentication")
21
+ .option(
22
+ "--tracking-base-url <url>",
23
+ "Base URL for Zapier tracking endpoints",
24
+ );
15
25
 
16
- // Check for debug flag early
26
+ // Check for debug flag early (support both flag and env var)
17
27
  const isDebugMode =
18
28
  process.env.DEBUG === "true" || process.argv.includes("--debug");
19
29
 
20
- // Create CLI SDK instance with all plugins
30
+ // Extract URL options from process.argv for early SDK creation
31
+ // We need to create the SDK before parsing to generate commands from schemas
32
+ const baseUrlIndex = process.argv.indexOf("--base-url");
33
+ const authBaseUrlIndex = process.argv.indexOf("--auth-base-url");
34
+ const authClientIdIndex = process.argv.indexOf("--auth-client-id");
35
+ const trackingBaseUrlIndex = process.argv.indexOf("--tracking-base-url");
36
+
37
+ const baseUrl =
38
+ baseUrlIndex !== -1 ? process.argv[baseUrlIndex + 1] : undefined;
39
+ const authBaseUrl =
40
+ authBaseUrlIndex !== -1 ? process.argv[authBaseUrlIndex + 1] : undefined;
41
+ const authClientId =
42
+ authClientIdIndex !== -1 ? process.argv[authClientIdIndex + 1] : undefined;
43
+ const trackingBaseUrl =
44
+ trackingBaseUrlIndex !== -1
45
+ ? process.argv[trackingBaseUrlIndex + 1]
46
+ : undefined;
47
+
48
+ // Create CLI SDK instance with all plugins and URL options
21
49
  const sdk = createZapierCliSdk({
22
50
  debug: isDebugMode,
51
+ baseUrl,
52
+ authBaseUrl,
53
+ authClientId,
54
+ trackingBaseUrl,
23
55
  });
24
56
 
25
57
  // Auth commands now handled by plugins