@zapier/zapier-sdk-cli 0.6.3 → 0.6.5

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 (95) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +115 -12
  3. package/bin/{zapier-sdk.js → zapier-sdk.mjs} +1 -1
  4. package/dist/cli.cjs +1715 -0
  5. package/dist/cli.d.mts +1 -0
  6. package/dist/cli.d.ts +1 -0
  7. package/dist/{cli.js → cli.mjs} +221 -469
  8. package/dist/index.cjs +770 -0
  9. package/dist/index.d.mts +12 -0
  10. package/dist/index.d.ts +12 -0
  11. package/dist/index.mjs +739 -0
  12. package/dist/package.json +67 -0
  13. package/dist/src/cli.js +8 -14
  14. package/dist/src/index.d.ts +1 -0
  15. package/dist/src/index.js +1 -1
  16. package/dist/src/plugins/bundleCode/index.d.ts +15 -0
  17. package/dist/src/{commands/bundle-code → plugins/bundleCode}/index.js +19 -1
  18. package/dist/src/{commands/bundle-code → plugins/bundleCode}/schemas.d.ts +8 -8
  19. package/dist/src/{commands/bundle-code → plugins/bundleCode}/schemas.js +4 -4
  20. package/dist/src/plugins/generateTypes/index.d.ts +21 -0
  21. package/dist/src/{commands/generate-types → plugins/generateTypes}/index.js +18 -0
  22. package/dist/src/{commands/generate-types → plugins/generateTypes}/schemas.d.ts +0 -3
  23. package/dist/src/{commands/generate-types → plugins/generateTypes}/schemas.js +1 -2
  24. package/dist/src/plugins/getConfigPath/index.d.ts +15 -0
  25. package/dist/src/plugins/getConfigPath/index.js +19 -0
  26. package/dist/src/plugins/getConfigPath/schemas.d.ts +3 -0
  27. package/dist/src/plugins/getConfigPath/schemas.js +5 -0
  28. package/dist/src/plugins/index.d.ts +6 -0
  29. package/dist/src/plugins/index.js +6 -0
  30. package/dist/src/plugins/login/index.d.ts +15 -0
  31. package/dist/src/plugins/login/index.js +26 -0
  32. package/dist/src/plugins/login/schemas.d.ts +9 -0
  33. package/dist/src/plugins/login/schemas.js +10 -0
  34. package/dist/src/plugins/logout/index.d.ts +15 -0
  35. package/dist/src/plugins/logout/index.js +18 -0
  36. package/dist/src/plugins/logout/schemas.d.ts +3 -0
  37. package/dist/src/plugins/logout/schemas.js +5 -0
  38. package/dist/src/plugins/mcp/index.d.ts +15 -0
  39. package/dist/src/plugins/mcp/index.js +24 -0
  40. package/dist/src/plugins/mcp/schemas.d.ts +9 -0
  41. package/dist/src/plugins/mcp/schemas.js +10 -0
  42. package/dist/src/sdk.d.ts +9 -0
  43. package/dist/src/sdk.js +22 -0
  44. package/dist/src/utils/cli-generator.js +12 -8
  45. package/dist/src/utils/schema-formatter.d.ts +1 -1
  46. package/dist/src/utils/schema-formatter.js +8 -8
  47. package/dist/tsconfig.tsbuildinfo +1 -1
  48. package/package.json +19 -8
  49. package/src/cli.ts +8 -21
  50. package/src/index.ts +2 -0
  51. package/src/{commands/bundle-code → plugins/bundleCode}/index.ts +39 -2
  52. package/src/{commands/bundle-code → plugins/bundleCode}/schemas.ts +4 -4
  53. package/src/{commands/generate-types → plugins/generateTypes}/index.ts +56 -3
  54. package/src/{commands/generate-types → plugins/generateTypes}/schemas.ts +0 -4
  55. package/src/plugins/getConfigPath/index.ts +42 -0
  56. package/src/plugins/getConfigPath/schemas.ts +8 -0
  57. package/src/plugins/index.ts +6 -0
  58. package/src/plugins/login/index.ts +48 -0
  59. package/src/plugins/login/schemas.ts +13 -0
  60. package/src/plugins/logout/index.ts +37 -0
  61. package/src/plugins/logout/schemas.ts +8 -0
  62. package/src/plugins/mcp/index.ts +43 -0
  63. package/src/plugins/mcp/schemas.ts +13 -0
  64. package/src/sdk.ts +43 -0
  65. package/src/utils/cli-generator.test.ts +93 -0
  66. package/src/utils/cli-generator.ts +19 -9
  67. package/src/utils/schema-formatter.ts +13 -7
  68. package/tsconfig.build.json +15 -3
  69. package/tsconfig.json +2 -2
  70. package/tsup.config.ts +10 -4
  71. package/bin/zsdk.js +0 -4
  72. package/dist/index.js +0 -0
  73. package/dist/src/commands/bundle-code/cli.d.ts +0 -2
  74. package/dist/src/commands/bundle-code/cli.js +0 -77
  75. package/dist/src/commands/bundle-code/index.d.ts +0 -5
  76. package/dist/src/commands/configPath.d.ts +0 -2
  77. package/dist/src/commands/configPath.js +0 -9
  78. package/dist/src/commands/generate-types/cli.d.ts +0 -2
  79. package/dist/src/commands/generate-types/cli.js +0 -84
  80. package/dist/src/commands/generate-types/index.d.ts +0 -8
  81. package/dist/src/commands/index.d.ts +0 -6
  82. package/dist/src/commands/index.js +0 -6
  83. package/dist/src/commands/login.d.ts +0 -2
  84. package/dist/src/commands/login.js +0 -25
  85. package/dist/src/commands/logout.d.ts +0 -2
  86. package/dist/src/commands/logout.js +0 -16
  87. package/dist/src/commands/mcp.d.ts +0 -2
  88. package/dist/src/commands/mcp.js +0 -11
  89. package/src/commands/bundle-code/cli.ts +0 -118
  90. package/src/commands/configPath.ts +0 -10
  91. package/src/commands/generate-types/cli.ts +0 -126
  92. package/src/commands/index.ts +0 -6
  93. package/src/commands/login.ts +0 -34
  94. package/src/commands/logout.ts +0 -19
  95. package/src/commands/mcp.ts +0 -14
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @zapier/zapier-sdk-cli
2
2
 
3
+ ## 0.6.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 8b2b6b6: Fix pagination numbering regression and async iteration
8
+
9
+ ## 0.6.4
10
+
11
+ ### Patch Changes
12
+
13
+ - 4315531: All CLI commands are now just local plugins used to build a CLI specific SDK, and that CLI specific SDK is used to generate the CLI docs.
14
+ - Updated dependencies [4315531]
15
+ - @zapier/zapier-sdk-mcp@0.2.4
16
+ - @zapier/zapier-sdk@0.6.4
17
+
3
18
  ## 0.6.3
4
19
 
5
20
  ### Patch Changes
package/README.md CHANGED
@@ -6,7 +6,12 @@
6
6
 
7
7
  - [Installation](#installation)
8
8
  - [Quick Start](#quick-start)
9
+ - [Global Options](#global-options)
9
10
  - [Available Commands](#available-commands)
11
+ - [Accounts](#accounts)
12
+ - [`getProfile`](#getprofile)
13
+ - [`login`](#login)
14
+ - [`logout`](#logout)
10
15
  - [Actions](#actions)
11
16
  - [`getAction`](#getaction)
12
17
  - [`listActions`](#listactions)
@@ -22,10 +27,12 @@
22
27
  - [`listAuthentications`](#listauthentications)
23
28
  - [HTTP Requests](#http-requests)
24
29
  - [`request`](#request)
25
- - [Users](#users)
26
- - [`getProfile`](#getprofile)
27
30
  - [Utilities](#utilities)
31
+ - [`bundleCode`](#bundlecode)
32
+ - [`generateTypes`](#generatetypes)
33
+ - [`getConfigPath`](#getconfigpath)
28
34
  - [`lockVersion`](#lockversion)
35
+ - [`mcp`](#mcp)
29
36
 
30
37
  ## Installation
31
38
 
@@ -49,10 +56,59 @@ npx zapier-sdk list-apps
49
56
  npx zapier-sdk generate-types slack --output ./types/slack.ts
50
57
  ```
51
58
 
59
+ ## Global Options
60
+
61
+ These options are available for all commands:
62
+
63
+ | Option | Short | Description |
64
+ | ----------- | ----- | -------------------------------------------- |
65
+ | `--version` | `-v` | Display version number |
66
+ | `--help` | `-h` | Display help for command |
67
+ | `--debug` | | Enable debug logging |
68
+ | `--json` | | Output raw JSON instead of formatted results |
69
+
52
70
  ## Available Commands
53
71
 
54
72
  The CLI automatically generates commands from the SDK registry. All SDK functions are available as CLI commands using kebab-case naming.
55
73
 
74
+ ### Accounts
75
+
76
+ #### `get-profile`
77
+
78
+ Get current user's profile information
79
+
80
+ **Usage:**
81
+
82
+ ```bash
83
+ npx zapier-sdk get-profile
84
+ ```
85
+
86
+ #### `login`
87
+
88
+ Log in to Zapier to access your account
89
+
90
+ **Options:**
91
+
92
+ | Option | Type | Required | Default | Possible Values | Description |
93
+ | ----------- | -------- | -------- | ------- | --------------- | --------------------------------------- |
94
+ | `--timeout` | `string` | ❌ | — | — | Login timeout in seconds (default: 300) |
95
+
96
+ **Usage:**
97
+
98
+ ```bash
99
+ npx zapier-sdk login [--timeout]
100
+ ```
101
+
102
+ #### `logout`
103
+
104
+ Log out of your Zapier account
105
+
106
+ **Usage:**
107
+
108
+ ```bash
109
+ npx zapier-sdk logout
110
+ ```
111
+
56
112
  ### Actions
57
113
 
58
114
  #### `get-action`
@@ -278,19 +334,57 @@ Make authenticated HTTP requests through Zapier's Relay service
278
334
  npx zapier-sdk request <url> [--method] [--body] [--authentication-id] [--callback-url] [--authentication-template] [--headers] [--relay-base-url]
279
335
  ```
280
336
 
281
- ### Users
337
+ ### Utilities
282
338
 
283
- #### `get-profile`
339
+ #### `bundle-code`
284
340
 
285
- Get current user's profile information
341
+ Bundle TypeScript code into executable JavaScript
342
+
343
+ **Options:**
344
+
345
+ | Option | Type | Required | Default | Possible Values | Description |
346
+ | ---------- | --------- | -------- | ------- | --------------- | -------------------------------------------------------- |
347
+ | `<input>` | `string` | ✅ | — | — | Input TypeScript file path to bundle |
348
+ | `--output` | `string` | ❌ | — | — | Output file path (defaults to input with .js extension) |
349
+ | `--string` | `boolean` | ❌ | — | — | Return bundled code as string instead of writing to file |
350
+ | `--minify` | `boolean` | ❌ | — | — | Minify the bundled output |
351
+ | `--target` | `string` | ❌ | — | — | ECMAScript target version |
352
+ | `--cjs` | `boolean` | ❌ | — | — | Output CommonJS format instead of ESM |
286
353
 
287
354
  **Usage:**
288
355
 
289
356
  ```bash
290
- npx zapier-sdk get-profile
357
+ npx zapier-sdk bundle-code <input> [--output] [--string] [--minify] [--target] [--cjs]
291
358
  ```
292
359
 
293
- ### Utilities
360
+ #### `generate-types`
361
+
362
+ Generate TypeScript SDK code for a specific app
363
+
364
+ **Options:**
365
+
366
+ | Option | Type | Required | Default | Possible Values | Description |
367
+ | --------------------- | -------- | -------- | ------- | --------------- | ------------------------------------------------------- |
368
+ | `<appKey>` | `string` | ✅ | — | — | App key to generate SDK code for |
369
+ | `--authentication-id` | `number` | ❌ | — | — | Authentication ID to use for this action |
370
+ | `--output` | `string` | ❌ | — | — | Output file path (defaults to generated/<appKey>.ts) |
371
+ | `--lock-file-path` | `string` | ❌ | — | — | Path to the .zapierrc lock file (defaults to .zapierrc) |
372
+
373
+ **Usage:**
374
+
375
+ ```bash
376
+ npx zapier-sdk generate-types <appKey> [--authentication-id] [--output] [--lock-file-path]
377
+ ```
378
+
379
+ #### `get-config-path`
380
+
381
+ Show the path to the configuration file
382
+
383
+ **Usage:**
384
+
385
+ ```bash
386
+ npx zapier-sdk get-config-path
387
+ ```
294
388
 
295
389
  #### `lock-version`
296
390
 
@@ -308,11 +402,20 @@ Execute lockVersion
308
402
  npx zapier-sdk lock-version <appKey>
309
403
  ```
310
404
 
311
- ### Additional CLI Commands
405
+ #### `mcp`
312
406
 
313
- - `login` - Authenticate with Zapier
314
- - `logout` - Clear authentication
315
- - `generate-types <app-key>` - Generate TypeScript types for an app
316
- - `mcp` - Start MCP server
407
+ Start MCP server for Zapier SDK
408
+
409
+ **Options:**
410
+
411
+ | Option | Type | Required | Default | Possible Values | Description |
412
+ | -------- | -------- | -------- | ------- | --------------- | --------------------------------------------- |
413
+ | `--port` | `string` | ❌ | — | — | Port to listen on (for future HTTP transport) |
414
+
415
+ **Usage:**
416
+
417
+ ```bash
418
+ npx zapier-sdk mcp [--port]
419
+ ```
317
420
 
318
421
  <!-- End Generated CLI Reference -->
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // Import the CLI from the compiled TypeScript
4
- import "../dist/cli.js";
4
+ import "../dist/cli.mjs";