@zapier/zapier-sdk-cli 0.16.1 → 0.16.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 (60) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cli.cjs +7 -7
  3. package/dist/cli.mjs +7 -7
  4. package/dist/index.cjs +1 -1
  5. package/dist/index.mjs +1 -1
  6. package/dist/package.json +8 -2
  7. package/dist/src/cli.js +2 -1
  8. package/dist/src/utils/cli-generator.js +8 -7
  9. package/dist/tsconfig.tsbuildinfo +1 -1
  10. package/package.json +11 -5
  11. package/src/cli.test.ts +0 -28
  12. package/src/cli.ts +0 -96
  13. package/src/generators/ast-generator.test.ts +0 -908
  14. package/src/generators/ast-generator.ts +0 -774
  15. package/src/index.ts +0 -12
  16. package/src/plugins/add/index.test.ts +0 -58
  17. package/src/plugins/add/index.ts +0 -177
  18. package/src/plugins/add/schemas.ts +0 -35
  19. package/src/plugins/buildManifest/index.test.ts +0 -679
  20. package/src/plugins/buildManifest/index.ts +0 -131
  21. package/src/plugins/buildManifest/schemas.ts +0 -55
  22. package/src/plugins/bundleCode/index.ts +0 -128
  23. package/src/plugins/bundleCode/schemas.ts +0 -24
  24. package/src/plugins/generateAppTypes/index.test.ts +0 -679
  25. package/src/plugins/generateAppTypes/index.ts +0 -227
  26. package/src/plugins/generateAppTypes/schemas.ts +0 -61
  27. package/src/plugins/getLoginConfigPath/index.ts +0 -45
  28. package/src/plugins/getLoginConfigPath/schemas.ts +0 -10
  29. package/src/plugins/index.ts +0 -8
  30. package/src/plugins/login/index.ts +0 -135
  31. package/src/plugins/login/schemas.ts +0 -13
  32. package/src/plugins/logout/index.ts +0 -37
  33. package/src/plugins/logout/schemas.ts +0 -8
  34. package/src/plugins/mcp/index.ts +0 -43
  35. package/src/plugins/mcp/schemas.ts +0 -13
  36. package/src/sdk.ts +0 -45
  37. package/src/telemetry/builders.ts +0 -113
  38. package/src/telemetry/events.ts +0 -39
  39. package/src/types/sdk.ts +0 -8
  40. package/src/utils/api/client.ts +0 -44
  41. package/src/utils/auth/login.ts +0 -214
  42. package/src/utils/cli-generator-utils.ts +0 -169
  43. package/src/utils/cli-generator.test.ts +0 -347
  44. package/src/utils/cli-generator.ts +0 -807
  45. package/src/utils/constants.ts +0 -9
  46. package/src/utils/directory-detection.ts +0 -23
  47. package/src/utils/errors.ts +0 -26
  48. package/src/utils/getCallablePromise.ts +0 -21
  49. package/src/utils/log.ts +0 -23
  50. package/src/utils/manifest-helpers.ts +0 -25
  51. package/src/utils/package-manager-detector.ts +0 -83
  52. package/src/utils/parameter-resolver.ts +0 -1075
  53. package/src/utils/schema-formatter.ts +0 -153
  54. package/src/utils/serializeAsync.ts +0 -26
  55. package/src/utils/spinner.ts +0 -23
  56. package/src/utils/version-checker.test.ts +0 -239
  57. package/src/utils/version-checker.ts +0 -237
  58. package/tsconfig.build.json +0 -18
  59. package/tsconfig.json +0 -19
  60. package/tsup.config.ts +0 -23
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk-cli",
3
- "version": "0.16.1",
3
+ "version": "0.16.3",
4
4
  "description": "Command line interface for Zapier SDK",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -27,8 +27,14 @@
27
27
  ],
28
28
  "author": "",
29
29
  "license": "SEE LICENSE IN LICENSE",
30
+ "files": [
31
+ "dist",
32
+ "bin",
33
+ "README.md",
34
+ "CHANGELOG.md"
35
+ ],
30
36
  "publishConfig": {
31
- "access": "restricted"
37
+ "access": "public"
32
38
  },
33
39
  "dependencies": {
34
40
  "chalk": "^5.3.0",
@@ -47,9 +53,9 @@
47
53
  "semver": "^7.7.3",
48
54
  "typescript": "^5.8.3",
49
55
  "zod": "4.2.1",
50
- "@zapier/zapier-sdk-cli-login": "0.3.5",
51
- "@zapier/zapier-sdk-mcp": "0.4.0",
52
- "@zapier/zapier-sdk": "0.16.0"
56
+ "@zapier/zapier-sdk": "0.16.1",
57
+ "@zapier/zapier-sdk-cli-login": "0.3.6",
58
+ "@zapier/zapier-sdk-mcp": "0.4.1"
53
59
  },
54
60
  "devDependencies": {
55
61
  "@types/express": "^5.0.3",
package/src/cli.test.ts DELETED
@@ -1,28 +0,0 @@
1
- import { describe, it, expect } from "vitest";
2
- import { execSync } from "child_process";
3
-
4
- describe("CLI", () => {
5
- it(
6
- "should show help command",
7
- () => {
8
- const result = execSync("npx tsx src/cli.ts --help", {
9
- encoding: "utf-8",
10
- cwd: __dirname + "/..",
11
- });
12
-
13
- expect(result).toContain("Options:");
14
- expect(result).toContain("Commands:");
15
- },
16
- { timeout: 10000 },
17
- );
18
-
19
- it("should include authClientId option in help", () => {
20
- const result = execSync("npx tsx src/cli.ts --help", {
21
- encoding: "utf-8",
22
- cwd: __dirname + "/..",
23
- });
24
-
25
- expect(result).toContain("--auth-client-id <id>");
26
- expect(result).toContain("OAuth client ID for Zapier authentication");
27
- });
28
- });
package/src/cli.ts DELETED
@@ -1,96 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { Command, CommanderError } from "commander";
4
- import { generateCliCommands } from "./utils/cli-generator";
5
- import { createZapierCliSdk } from "./sdk";
6
- import packageJson from "../package.json" with { type: "json" };
7
- import { ZapierCliError } from "./utils/errors";
8
- import { checkAndNotifyUpdates } from "./utils/version-checker";
9
-
10
- const program = new Command();
11
-
12
- program
13
- .name("zapier-sdk")
14
- .description("CLI for Zapier SDK")
15
- .version(packageJson.version, "-v, --version", "display version number")
16
- .option("--debug", "Enable debug logging")
17
- .option("--base-url <url>", "Base URL for Zapier API endpoints")
18
- .option(
19
- "--auth-base-url <url>",
20
- "Base URL for Zapier authentication endpoints",
21
- )
22
- .option("--auth-client-id <id>", "OAuth client ID for Zapier authentication")
23
- .option(
24
- "--tracking-base-url <url>",
25
- "Base URL for Zapier tracking endpoints",
26
- );
27
-
28
- // Check for debug flag early (support both flag and env var)
29
- const isDebugMode =
30
- process.env.DEBUG === "true" || process.argv.includes("--debug");
31
-
32
- // Extract URL options from process.argv for early SDK creation
33
- // We need to create the SDK before parsing to generate commands from schemas
34
- const baseUrlIndex = process.argv.indexOf("--base-url");
35
- const authBaseUrlIndex = process.argv.indexOf("--auth-base-url");
36
- const authClientIdIndex = process.argv.indexOf("--auth-client-id");
37
- const trackingBaseUrlIndex = process.argv.indexOf("--tracking-base-url");
38
-
39
- const baseUrl =
40
- baseUrlIndex !== -1 ? process.argv[baseUrlIndex + 1] : undefined;
41
- const authBaseUrl =
42
- authBaseUrlIndex !== -1 ? process.argv[authBaseUrlIndex + 1] : undefined;
43
- const authClientId =
44
- authClientIdIndex !== -1 ? process.argv[authClientIdIndex + 1] : undefined;
45
- const trackingBaseUrl =
46
- trackingBaseUrlIndex !== -1
47
- ? process.argv[trackingBaseUrlIndex + 1]
48
- : undefined;
49
-
50
- // Create CLI SDK instance with all plugins and URL options
51
- const sdk = createZapierCliSdk({
52
- debug: isDebugMode,
53
- baseUrl,
54
- authBaseUrl,
55
- authClientId,
56
- trackingBaseUrl,
57
- });
58
-
59
- // Auth commands now handled by plugins
60
-
61
- // Generate CLI commands from SDK schemas (including CLI plugins)
62
- generateCliCommands(program, sdk);
63
-
64
- // MCP command now handled by plugin
65
-
66
- // Override Commander's default exit behavior to handle our custom errors
67
- program.exitOverride();
68
-
69
- (async () => {
70
- let exitCode = 0;
71
-
72
- // Start version checking non-blocking
73
- const versionCheckPromise = checkAndNotifyUpdates({
74
- packageName: packageJson.name,
75
- currentVersion: packageJson.version,
76
- });
77
-
78
- try {
79
- await program.parseAsync();
80
- } catch (error) {
81
- if (error instanceof ZapierCliError) {
82
- exitCode = error.exitCode;
83
- } else if (error instanceof CommanderError) {
84
- exitCode = error.exitCode;
85
- } else {
86
- // For any other unexpected errors, exit with code 1
87
- console.error("Unexpected error:", error);
88
- exitCode = 1;
89
- }
90
- }
91
-
92
- // Wait for version checking to complete
93
- await versionCheckPromise;
94
-
95
- process.exit(exitCode);
96
- })();