@zapier/zapier-sdk-cli 0.32.3 → 0.34.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +39 -2
  3. package/dist/cli.cjs +582 -110
  4. package/dist/cli.mjs +573 -102
  5. package/dist/index.cjs +531 -18
  6. package/dist/index.mjs +525 -15
  7. package/dist/package.json +3 -2
  8. package/dist/src/paths.d.ts +1 -0
  9. package/dist/src/paths.js +6 -0
  10. package/dist/src/plugins/index.d.ts +1 -0
  11. package/dist/src/plugins/index.js +1 -0
  12. package/dist/src/plugins/init/display.d.ts +9 -0
  13. package/dist/src/plugins/init/display.js +72 -0
  14. package/dist/src/plugins/init/index.d.ts +16 -0
  15. package/dist/src/plugins/init/index.js +61 -0
  16. package/dist/src/plugins/init/schemas.d.ts +8 -0
  17. package/dist/src/plugins/init/schemas.js +14 -0
  18. package/dist/src/plugins/init/steps.d.ts +39 -0
  19. package/dist/src/plugins/init/steps.js +141 -0
  20. package/dist/src/plugins/init/types.d.ts +31 -0
  21. package/dist/src/plugins/init/types.js +1 -0
  22. package/dist/src/plugins/init/utils.d.ts +48 -0
  23. package/dist/src/plugins/init/utils.js +135 -0
  24. package/dist/src/plugins/logout/index.js +1 -1
  25. package/dist/src/sdk.js +5 -2
  26. package/dist/src/utils/auth/login.js +33 -4
  27. package/dist/src/utils/package-manager-detector.d.ts +3 -1
  28. package/dist/src/utils/package-manager-detector.js +1 -0
  29. package/dist/src/utils/version-checker.js +1 -8
  30. package/dist/tsconfig.tsbuildinfo +1 -1
  31. package/package.json +6 -5
  32. package/templates/basic/AGENTS.md.hbs +15 -0
  33. package/templates/basic/README.md.hbs +21 -0
  34. package/templates/basic/package.json.hbs +17 -0
  35. package/templates/basic/src/index.ts +46 -0
  36. package/templates/basic/tsconfig.json +12 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk-cli",
3
- "version": "0.32.3",
3
+ "version": "0.34.0",
4
4
  "description": "Command line interface for Zapier SDK",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -40,6 +40,7 @@
40
40
  "files": [
41
41
  "dist",
42
42
  "bin",
43
+ "templates",
43
44
  "README.md",
44
45
  "CHANGELOG.md",
45
46
  "CLAUDE.md"
@@ -51,9 +52,9 @@
51
52
  "chalk": "^5.3.0",
52
53
  "cli-table3": "^0.6.5",
53
54
  "commander": "^12.0.0",
54
- "conf": "^14.0.0",
55
55
  "esbuild": "^0.25.5",
56
56
  "express": "^5.1.0",
57
+ "handlebars": "^4.7.8",
57
58
  "inquirer": "^12.6.3",
58
59
  "is-installed-globally": "^1.0.0",
59
60
  "jsonwebtoken": "^9.0.2",
@@ -64,9 +65,9 @@
64
65
  "semver": "^7.7.3",
65
66
  "typescript": "^5.8.3",
66
67
  "zod": "4.2.1",
67
- "@zapier/zapier-sdk": "0.31.3",
68
- "@zapier/zapier-sdk-mcp": "0.9.9",
69
- "@zapier/zapier-sdk-cli-login": "0.7.0"
68
+ "@zapier/zapier-sdk": "0.32.0",
69
+ "@zapier/zapier-sdk-cli-login": "0.8.0",
70
+ "@zapier/zapier-sdk-mcp": "0.9.11"
70
71
  },
71
72
  "devDependencies": {
72
73
  "@types/express": "^5.0.3",
@@ -0,0 +1,15 @@
1
+ # {{projectName}}
2
+
3
+ This project uses the `@zapier/zapier-sdk` package to interact with Zapier's APIs.
4
+
5
+ ## Documentation
6
+
7
+ For full SDK documentation, read:
8
+
9
+ "zapier-sdk" package documentation:
10
+ - `node_modules/@zapier/zapier-sdk/README.md` — installation, quickstart, and API reference
11
+ - `node_modules/@zapier/zapier-sdk/CLAUDE.md` — architecture, authentication, and usage patterns
12
+
13
+ "zapier-sdk-cli" package documentation:
14
+ - `node_modules/@zapier/zapier-sdk-cli/README.md` — installation, quickstart, and API reference
15
+ - `node_modules/@zapier/zapier-sdk-cli/CLAUDE.md` — architecture, authentication, and usage patterns
@@ -0,0 +1,21 @@
1
+ # {{projectName}}
2
+
3
+ A Zapier SDK project.
4
+
5
+ ## Getting Started
6
+
7
+ ```bash
8
+ # Add an app integration (generates TypeScript types)
9
+ {{execCmd}} zapier-sdk add slack
10
+
11
+ # Run your app
12
+ {{devCmd}}
13
+ ```
14
+
15
+ ## Documentation
16
+
17
+ - [SDK Docs](https://docs.zapier.com/sdk)
18
+ - [SDK API Reference](https://docs.zapier.com/sdk/reference)
19
+ - [CLI Reference](https://docs.zapier.com/sdk/cli-reference)
20
+ - [zapier-sdk on npm](https://www.npmjs.com/package/@zapier/zapier-sdk)
21
+ - [zapier-sdk-cli on npm](https://www.npmjs.com/package/@zapier/zapier-sdk-cli)
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "{{projectName}}",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "{{devScript}}"
7
+ },
8
+ "dependencies": {
9
+ "@zapier/zapier-sdk": "latest"
10
+ },
11
+ "devDependencies": {
12
+ "@zapier/zapier-sdk-cli": "latest",
13
+ "@types/node": "latest",
14
+ {{#if includeTsx}}"tsx": "latest",
15
+ {{/if}}"typescript": "latest"
16
+ }
17
+ }
@@ -0,0 +1,46 @@
1
+ import { createZapierSdk } from "@zapier/zapier-sdk";
2
+
3
+ async function main() {
4
+ // Tip: run `npx zapier-sdk login` first to authenticate.
5
+ const zapier = createZapierSdk();
6
+ console.log("⚡ Zapier SDK factory is initialized.");
7
+
8
+ console.log('🔎 Searching for apps matching "slack"...');
9
+ const { data: apps } = await zapier.listApps({ search: "slack" });
10
+ const topApps = apps.slice(0, 5);
11
+
12
+ console.log(`☑️ Found ${apps.length} matches.`);
13
+ if (topApps.length > 0) {
14
+ console.log("\nTop matches:");
15
+ for (const app of topApps) {
16
+ console.log(` - ${app.title} (${app.slug})`);
17
+ }
18
+ } else {
19
+ console.log(
20
+ '\nNo app matches found for "slack". Try a different search term.',
21
+ );
22
+ }
23
+
24
+ // To use an app, you need a connection. List your connections:
25
+ // const { data: connections } = await zapier.listConnections({ appKey: "slack", owner: "me" });
26
+ //
27
+ // Run an action once you have a connection:
28
+ // const { data: result } = await zapier.runAction({
29
+ // appKey: "slack",
30
+ // actionType: "read",
31
+ // actionKey: "channels",
32
+ // connectionId: connections[0].id,
33
+ // });
34
+ //
35
+ // For type-safe access, generate app types:
36
+ // npx zapier-sdk add slack
37
+ // Then use:
38
+ // await zapier.apps.slack.read.channels({ connectionId: "..." });
39
+ //
40
+ // Make raw API requests with a connection's credentials:
41
+ // const response = await zapier.fetch("https://slack.com/api/emoji.list", {
42
+ // connectionId: connections[0].id,
43
+ // });
44
+ }
45
+
46
+ main().catch(console.error);
@@ -0,0 +1,12 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "Node16",
5
+ "moduleResolution": "Node16",
6
+ "esModuleInterop": true,
7
+ "strict": true,
8
+ "skipLibCheck": true,
9
+ "outDir": "dist"
10
+ },
11
+ "include": ["src/**/*", "*.ts"]
12
+ }