@zapier/zapier-sdk-cli 0.18.3 → 0.21.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/CHANGELOG.md +12 -0
- package/README.md +31 -28
- package/dist/cli.cjs +2 -2
- package/dist/cli.mjs +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
- package/dist/package.json +0 -78
- package/dist/src/cli.d.ts +0 -2
- package/dist/src/cli.js +0 -105
- package/dist/src/generators/ast-generator.d.ts +0 -41
- package/dist/src/generators/ast-generator.js +0 -409
- package/dist/src/index.d.ts +0 -4
- package/dist/src/index.js +0 -4
- package/dist/src/plugins/add/index.d.ts +0 -15
- package/dist/src/plugins/add/index.js +0 -103
- package/dist/src/plugins/add/schemas.d.ts +0 -8
- package/dist/src/plugins/add/schemas.js +0 -22
- package/dist/src/plugins/buildManifest/index.d.ts +0 -13
- package/dist/src/plugins/buildManifest/index.js +0 -81
- package/dist/src/plugins/buildManifest/schemas.d.ts +0 -44
- package/dist/src/plugins/buildManifest/schemas.js +0 -17
- package/dist/src/plugins/bundleCode/index.d.ts +0 -15
- package/dist/src/plugins/bundleCode/index.js +0 -80
- package/dist/src/plugins/bundleCode/schemas.d.ts +0 -10
- package/dist/src/plugins/bundleCode/schemas.js +0 -19
- package/dist/src/plugins/generateAppTypes/index.d.ts +0 -13
- package/dist/src/plugins/generateAppTypes/index.js +0 -157
- package/dist/src/plugins/generateAppTypes/schemas.d.ts +0 -58
- package/dist/src/plugins/generateAppTypes/schemas.js +0 -21
- package/dist/src/plugins/getLoginConfigPath/index.d.ts +0 -15
- package/dist/src/plugins/getLoginConfigPath/index.js +0 -19
- package/dist/src/plugins/getLoginConfigPath/schemas.d.ts +0 -3
- package/dist/src/plugins/getLoginConfigPath/schemas.js +0 -5
- package/dist/src/plugins/index.d.ts +0 -8
- package/dist/src/plugins/index.js +0 -8
- package/dist/src/plugins/login/index.d.ts +0 -23
- package/dist/src/plugins/login/index.js +0 -95
- package/dist/src/plugins/login/schemas.d.ts +0 -5
- package/dist/src/plugins/login/schemas.js +0 -10
- package/dist/src/plugins/logout/index.d.ts +0 -15
- package/dist/src/plugins/logout/index.js +0 -18
- package/dist/src/plugins/logout/schemas.d.ts +0 -3
- package/dist/src/plugins/logout/schemas.js +0 -5
- package/dist/src/plugins/mcp/index.d.ts +0 -15
- package/dist/src/plugins/mcp/index.js +0 -24
- package/dist/src/plugins/mcp/schemas.d.ts +0 -5
- package/dist/src/plugins/mcp/schemas.js +0 -10
- package/dist/src/sdk.d.ts +0 -9
- package/dist/src/sdk.js +0 -24
- package/dist/src/telemetry/builders.d.ts +0 -42
- package/dist/src/telemetry/builders.js +0 -55
- package/dist/src/telemetry/events.d.ts +0 -37
- package/dist/src/telemetry/events.js +0 -4
- package/dist/src/types/sdk.d.ts +0 -5
- package/dist/src/types/sdk.js +0 -1
- package/dist/src/utils/api/client.d.ts +0 -15
- package/dist/src/utils/api/client.js +0 -27
- package/dist/src/utils/auth/login.d.ts +0 -7
- package/dist/src/utils/auth/login.js +0 -154
- package/dist/src/utils/cli-generator-utils.d.ts +0 -14
- package/dist/src/utils/cli-generator-utils.js +0 -122
- package/dist/src/utils/cli-generator.d.ts +0 -3
- package/dist/src/utils/cli-generator.js +0 -555
- package/dist/src/utils/constants.d.ts +0 -3
- package/dist/src/utils/constants.js +0 -5
- package/dist/src/utils/directory-detection.d.ts +0 -5
- package/dist/src/utils/directory-detection.js +0 -21
- package/dist/src/utils/errors.d.ts +0 -16
- package/dist/src/utils/errors.js +0 -19
- package/dist/src/utils/getCallablePromise.d.ts +0 -6
- package/dist/src/utils/getCallablePromise.js +0 -14
- package/dist/src/utils/log.d.ts +0 -8
- package/dist/src/utils/log.js +0 -21
- package/dist/src/utils/manifest-helpers.d.ts +0 -10
- package/dist/src/utils/manifest-helpers.js +0 -19
- package/dist/src/utils/package-manager-detector.d.ts +0 -16
- package/dist/src/utils/package-manager-detector.js +0 -77
- package/dist/src/utils/parameter-resolver.d.ts +0 -42
- package/dist/src/utils/parameter-resolver.js +0 -699
- package/dist/src/utils/schema-formatter.d.ts +0 -6
- package/dist/src/utils/schema-formatter.js +0 -115
- package/dist/src/utils/serializeAsync.d.ts +0 -2
- package/dist/src/utils/serializeAsync.js +0 -16
- package/dist/src/utils/spinner.d.ts +0 -1
- package/dist/src/utils/spinner.js +0 -21
- package/dist/src/utils/version-checker.d.ts +0 -17
- package/dist/src/utils/version-checker.js +0 -156
- package/dist/tsconfig.tsbuildinfo +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @zapier/zapier-sdk-cli
|
|
2
2
|
|
|
3
|
+
## 0.19.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 4dd27eb: Add isExpired parameter to listAuthentications for filtering authentications by expiration status.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [4dd27eb]
|
|
12
|
+
- @zapier/zapier-sdk@1.1.0
|
|
13
|
+
- @zapier/zapier-sdk-mcp@0.4.15
|
|
14
|
+
|
|
3
15
|
## 0.18.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -287,18 +287,19 @@ Find the first authentication matching the criteria
|
|
|
287
287
|
|
|
288
288
|
**Options:**
|
|
289
289
|
|
|
290
|
-
| Option | Type
|
|
291
|
-
| -------------- |
|
|
292
|
-
| `--app-key` | `string`
|
|
293
|
-
| `--search` | `string`
|
|
294
|
-
| `--title` | `string`
|
|
295
|
-
| `--account-id` | `string`
|
|
296
|
-
| `--owner` | `string`
|
|
290
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
291
|
+
| -------------- | --------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------- |
|
|
292
|
+
| `--app-key` | `string` | ❌ | — | — | App key of authentications to list (e.g., 'SlackCLIAPI' or slug like 'github') |
|
|
293
|
+
| `--search` | `string` | ❌ | — | — | Search term to filter authentications by title |
|
|
294
|
+
| `--title` | `string` | ❌ | — | — | Filter authentications by exact title match (searches first, then filters locally) |
|
|
295
|
+
| `--account-id` | `string` | ❌ | — | — | Filter authentications by account ID |
|
|
296
|
+
| `--owner` | `string` | ❌ | — | — | Filter by owner, 'me' for your own authentications or a specific user ID |
|
|
297
|
+
| `--is-expired` | `boolean` | ❌ | — | — | Filter by expired status (true = expired only, false = non-expired only) |
|
|
297
298
|
|
|
298
299
|
**Usage:**
|
|
299
300
|
|
|
300
301
|
```bash
|
|
301
|
-
npx zapier-sdk find-first-authentication [--app-key] [--search] [--title] [--account-id] [--owner]
|
|
302
|
+
npx zapier-sdk find-first-authentication [--app-key] [--search] [--title] [--account-id] [--owner] [--is-expired]
|
|
302
303
|
```
|
|
303
304
|
|
|
304
305
|
#### `find-unique-authentication`
|
|
@@ -307,18 +308,19 @@ Find a unique authentication matching the criteria
|
|
|
307
308
|
|
|
308
309
|
**Options:**
|
|
309
310
|
|
|
310
|
-
| Option | Type
|
|
311
|
-
| -------------- |
|
|
312
|
-
| `--app-key` | `string`
|
|
313
|
-
| `--search` | `string`
|
|
314
|
-
| `--title` | `string`
|
|
315
|
-
| `--account-id` | `string`
|
|
316
|
-
| `--owner` | `string`
|
|
311
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
312
|
+
| -------------- | --------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------- |
|
|
313
|
+
| `--app-key` | `string` | ❌ | — | — | App key of authentications to list (e.g., 'SlackCLIAPI' or slug like 'github') |
|
|
314
|
+
| `--search` | `string` | ❌ | — | — | Search term to filter authentications by title |
|
|
315
|
+
| `--title` | `string` | ❌ | — | — | Filter authentications by exact title match (searches first, then filters locally) |
|
|
316
|
+
| `--account-id` | `string` | ❌ | — | — | Filter authentications by account ID |
|
|
317
|
+
| `--owner` | `string` | ❌ | — | — | Filter by owner, 'me' for your own authentications or a specific user ID |
|
|
318
|
+
| `--is-expired` | `boolean` | ❌ | — | — | Filter by expired status (true = expired only, false = non-expired only) |
|
|
317
319
|
|
|
318
320
|
**Usage:**
|
|
319
321
|
|
|
320
322
|
```bash
|
|
321
|
-
npx zapier-sdk find-unique-authentication [--app-key] [--search] [--title] [--account-id] [--owner]
|
|
323
|
+
npx zapier-sdk find-unique-authentication [--app-key] [--search] [--title] [--account-id] [--owner] [--is-expired]
|
|
322
324
|
```
|
|
323
325
|
|
|
324
326
|
#### `get-authentication`
|
|
@@ -343,22 +345,23 @@ List available authentications with optional filtering
|
|
|
343
345
|
|
|
344
346
|
**Options:**
|
|
345
347
|
|
|
346
|
-
| Option | Type
|
|
347
|
-
| ---------------------- |
|
|
348
|
-
| `--app-key` | `string`
|
|
349
|
-
| `--authentication-ids` | `array`
|
|
350
|
-
| `--search` | `string`
|
|
351
|
-
| `--title` | `string`
|
|
352
|
-
| `--account-id` | `string`
|
|
353
|
-
| `--owner` | `string`
|
|
354
|
-
| `--
|
|
355
|
-
| `--
|
|
356
|
-
| `--
|
|
348
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
349
|
+
| ---------------------- | --------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------- |
|
|
350
|
+
| `--app-key` | `string` | ❌ | — | — | App key of authentications to list (e.g., 'SlackCLIAPI' or slug like 'github') |
|
|
351
|
+
| `--authentication-ids` | `array` | ❌ | — | — | List of authentication IDs to filter by |
|
|
352
|
+
| `--search` | `string` | ❌ | — | — | Search term to filter authentications by title |
|
|
353
|
+
| `--title` | `string` | ❌ | — | — | Filter authentications by exact title match (searches first, then filters locally) |
|
|
354
|
+
| `--account-id` | `string` | ❌ | — | — | Filter authentications by account ID |
|
|
355
|
+
| `--owner` | `string` | ❌ | — | — | Filter by owner, 'me' for your own authentications or a specific user ID |
|
|
356
|
+
| `--is-expired` | `boolean` | ❌ | — | — | Filter by expired status (true = expired only, false = non-expired only) |
|
|
357
|
+
| `--page-size` | `number` | ❌ | — | — | Number of authentications per page |
|
|
358
|
+
| `--max-items` | `number` | ❌ | — | — | Maximum total items to return across all pages |
|
|
359
|
+
| `--cursor` | `string` | ❌ | — | — | Cursor to start from |
|
|
357
360
|
|
|
358
361
|
**Usage:**
|
|
359
362
|
|
|
360
363
|
```bash
|
|
361
|
-
npx zapier-sdk list-authentications [--app-key] [--authentication-ids] [--search] [--title] [--account-id] [--owner] [--page-size] [--max-items] [--cursor]
|
|
364
|
+
npx zapier-sdk list-authentications [--app-key] [--authentication-ids] [--search] [--title] [--account-id] [--owner] [--is-expired] [--page-size] [--max-items] [--cursor]
|
|
362
365
|
```
|
|
363
366
|
|
|
364
367
|
### HTTP Requests
|
package/dist/cli.cjs
CHANGED
|
@@ -1656,7 +1656,7 @@ var LoginSchema = zod.z.object({
|
|
|
1656
1656
|
|
|
1657
1657
|
// package.json
|
|
1658
1658
|
var package_default = {
|
|
1659
|
-
version: "0.
|
|
1659
|
+
version: "0.20.0"};
|
|
1660
1660
|
|
|
1661
1661
|
// src/telemetry/builders.ts
|
|
1662
1662
|
function createCliBaseEvent(context = {}) {
|
|
@@ -2937,7 +2937,7 @@ function createZapierCliSdk(options = {}) {
|
|
|
2937
2937
|
// package.json with { type: 'json' }
|
|
2938
2938
|
var package_default2 = {
|
|
2939
2939
|
name: "@zapier/zapier-sdk-cli",
|
|
2940
|
-
version: "0.
|
|
2940
|
+
version: "0.20.0"};
|
|
2941
2941
|
function detectPackageManager(cwd = process.cwd()) {
|
|
2942
2942
|
const ua = process.env.npm_config_user_agent;
|
|
2943
2943
|
if (ua) {
|
package/dist/cli.mjs
CHANGED
|
@@ -1620,7 +1620,7 @@ var LoginSchema = z.object({
|
|
|
1620
1620
|
|
|
1621
1621
|
// package.json
|
|
1622
1622
|
var package_default = {
|
|
1623
|
-
version: "0.
|
|
1623
|
+
version: "0.20.0"};
|
|
1624
1624
|
|
|
1625
1625
|
// src/telemetry/builders.ts
|
|
1626
1626
|
function createCliBaseEvent(context = {}) {
|
|
@@ -2901,7 +2901,7 @@ function createZapierCliSdk(options = {}) {
|
|
|
2901
2901
|
// package.json with { type: 'json' }
|
|
2902
2902
|
var package_default2 = {
|
|
2903
2903
|
name: "@zapier/zapier-sdk-cli",
|
|
2904
|
-
version: "0.
|
|
2904
|
+
version: "0.20.0"};
|
|
2905
2905
|
function detectPackageManager(cwd = process.cwd()) {
|
|
2906
2906
|
const ua = process.env.npm_config_user_agent;
|
|
2907
2907
|
if (ua) {
|
package/dist/index.cjs
CHANGED
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zapier/zapier-sdk-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "Command line interface for Zapier SDK",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"semver": "^7.7.3",
|
|
54
54
|
"typescript": "^5.8.3",
|
|
55
55
|
"zod": "4.2.1",
|
|
56
|
-
"@zapier/zapier-sdk": "
|
|
57
|
-
"@zapier/zapier-sdk-
|
|
58
|
-
"@zapier/zapier-sdk-
|
|
56
|
+
"@zapier/zapier-sdk": "0.20.0",
|
|
57
|
+
"@zapier/zapier-sdk-cli-login": "0.5.0",
|
|
58
|
+
"@zapier/zapier-sdk-mcp": "0.5.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/express": "^5.0.3",
|
package/dist/package.json
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@zapier/zapier-sdk-cli",
|
|
3
|
-
"version": "0.18.3",
|
|
4
|
-
"description": "Command line interface for Zapier SDK",
|
|
5
|
-
"main": "dist/index.cjs",
|
|
6
|
-
"module": "dist/index.mjs",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"require": {
|
|
11
|
-
"types": "./dist/index.d.ts",
|
|
12
|
-
"default": "./dist/index.cjs"
|
|
13
|
-
},
|
|
14
|
-
"import": {
|
|
15
|
-
"types": "./dist/index.d.mts",
|
|
16
|
-
"default": "./dist/index.mjs"
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
"bin": {
|
|
21
|
-
"zapier-sdk": "./bin/zapier-sdk.mjs"
|
|
22
|
-
},
|
|
23
|
-
"scripts": {
|
|
24
|
-
"test": "vitest",
|
|
25
|
-
"build": "tsup",
|
|
26
|
-
"clean": "rm -rf dist",
|
|
27
|
-
"rebuild": "pnpm clean && pnpm build",
|
|
28
|
-
"dev": "tsx src/cli.ts",
|
|
29
|
-
"typecheck": "tsc --project tsconfig.build.json --noEmit",
|
|
30
|
-
"prepublishOnly": "node ../../scripts/check-version.js"
|
|
31
|
-
},
|
|
32
|
-
"keywords": [
|
|
33
|
-
"zapier",
|
|
34
|
-
"cli",
|
|
35
|
-
"sdk"
|
|
36
|
-
],
|
|
37
|
-
"author": "",
|
|
38
|
-
"license": "SEE LICENSE IN LICENSE",
|
|
39
|
-
"files": [
|
|
40
|
-
"dist",
|
|
41
|
-
"bin",
|
|
42
|
-
"README.md",
|
|
43
|
-
"CHANGELOG.md"
|
|
44
|
-
],
|
|
45
|
-
"publishConfig": {
|
|
46
|
-
"access": "public"
|
|
47
|
-
},
|
|
48
|
-
"dependencies": {
|
|
49
|
-
"@zapier/zapier-sdk": "workspace:*",
|
|
50
|
-
"@zapier/zapier-sdk-cli-login": "workspace:*",
|
|
51
|
-
"@zapier/zapier-sdk-mcp": "workspace:*",
|
|
52
|
-
"chalk": "^5.3.0",
|
|
53
|
-
"cli-table3": "^0.6.5",
|
|
54
|
-
"commander": "^12.0.0",
|
|
55
|
-
"conf": "^14.0.0",
|
|
56
|
-
"esbuild": "^0.25.5",
|
|
57
|
-
"express": "^5.1.0",
|
|
58
|
-
"inquirer": "^12.6.3",
|
|
59
|
-
"is-installed-globally": "^1.0.0",
|
|
60
|
-
"jsonwebtoken": "^9.0.2",
|
|
61
|
-
"open": "^10.2.0",
|
|
62
|
-
"ora": "^8.2.0",
|
|
63
|
-
"package-json": "^10.0.1",
|
|
64
|
-
"pkce-challenge": "^5.0.0",
|
|
65
|
-
"semver": "^7.7.3",
|
|
66
|
-
"typescript": "^5.8.3",
|
|
67
|
-
"zod": "4.2.1"
|
|
68
|
-
},
|
|
69
|
-
"devDependencies": {
|
|
70
|
-
"@types/express": "^5.0.3",
|
|
71
|
-
"@types/inquirer": "^9.0.8",
|
|
72
|
-
"@types/jsonwebtoken": "^9.0.10",
|
|
73
|
-
"@types/node": "^24.0.1",
|
|
74
|
-
"@types/semver": "^7.7.1",
|
|
75
|
-
"tsup": "^8.5.0",
|
|
76
|
-
"vitest": "^3.2.3"
|
|
77
|
-
}
|
|
78
|
-
}
|
package/dist/src/cli.d.ts
DELETED
package/dist/src/cli.js
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { Command, CommanderError } from "commander";
|
|
3
|
-
import { generateCliCommands } from "./utils/cli-generator";
|
|
4
|
-
import { createZapierCliSdk } from "./sdk";
|
|
5
|
-
import packageJson from "../package.json" with { type: "json" };
|
|
6
|
-
import { ZapierCliError } from "./utils/errors";
|
|
7
|
-
import { checkAndNotifyUpdates } from "./utils/version-checker";
|
|
8
|
-
const program = new Command();
|
|
9
|
-
program
|
|
10
|
-
.name("zapier-sdk")
|
|
11
|
-
.description("CLI for Zapier SDK")
|
|
12
|
-
.version(packageJson.version, "-v, --version", "display version number")
|
|
13
|
-
.option("--debug", "Enable debug logging")
|
|
14
|
-
.option("--base-url <url>", "Base URL for Zapier API endpoints")
|
|
15
|
-
.option("--credentials <token>", "Authentication token")
|
|
16
|
-
.option("--credentials-client-id <id>", "OAuth client ID for authentication")
|
|
17
|
-
.option("--credentials-client-secret <secret>", "OAuth client secret for authentication")
|
|
18
|
-
.option("--credentials-base-url <url>", "Base URL for authentication endpoints")
|
|
19
|
-
.option("--tracking-base-url <url>", "Base URL for Zapier tracking endpoints");
|
|
20
|
-
// Check for debug flag early (support both flag and env var)
|
|
21
|
-
const isDebugMode = process.env.DEBUG === "true" || process.argv.includes("--debug");
|
|
22
|
-
// Helper to get flag value from argv
|
|
23
|
-
function getFlagValue(flagName) {
|
|
24
|
-
const index = process.argv.indexOf(flagName);
|
|
25
|
-
return index !== -1 ? process.argv[index + 1] : undefined;
|
|
26
|
-
}
|
|
27
|
-
// Extract options from process.argv for early SDK creation
|
|
28
|
-
// We need to create the SDK before parsing to generate commands from schemas
|
|
29
|
-
const baseUrl = getFlagValue("--base-url");
|
|
30
|
-
const credentialsToken = getFlagValue("--credentials");
|
|
31
|
-
const credentialsClientId = getFlagValue("--credentials-client-id");
|
|
32
|
-
const credentialsClientSecret = getFlagValue("--credentials-client-secret");
|
|
33
|
-
const credentialsBaseUrl = getFlagValue("--credentials-base-url");
|
|
34
|
-
const trackingBaseUrl = getFlagValue("--tracking-base-url");
|
|
35
|
-
// Build credentials object from flags
|
|
36
|
-
function buildCredentialsFromFlags() {
|
|
37
|
-
// If a direct token is provided, use it
|
|
38
|
-
if (credentialsToken) {
|
|
39
|
-
return credentialsToken;
|
|
40
|
-
}
|
|
41
|
-
// If client ID is provided, build a credentials object
|
|
42
|
-
if (credentialsClientId) {
|
|
43
|
-
if (credentialsClientSecret) {
|
|
44
|
-
// Client credentials flow
|
|
45
|
-
return {
|
|
46
|
-
type: "client_credentials",
|
|
47
|
-
clientId: credentialsClientId,
|
|
48
|
-
clientSecret: credentialsClientSecret,
|
|
49
|
-
baseUrl: credentialsBaseUrl,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
// PKCE flow (no secret)
|
|
54
|
-
return {
|
|
55
|
-
type: "pkce",
|
|
56
|
-
clientId: credentialsClientId,
|
|
57
|
-
baseUrl: credentialsBaseUrl,
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
// No credentials from flags - will fall back to env vars or stored login
|
|
62
|
-
return undefined;
|
|
63
|
-
}
|
|
64
|
-
const credentials = buildCredentialsFromFlags();
|
|
65
|
-
// Create CLI SDK instance with all plugins and URL options
|
|
66
|
-
const sdk = createZapierCliSdk({
|
|
67
|
-
debug: isDebugMode,
|
|
68
|
-
credentials,
|
|
69
|
-
baseUrl,
|
|
70
|
-
trackingBaseUrl,
|
|
71
|
-
});
|
|
72
|
-
// Auth commands now handled by plugins
|
|
73
|
-
// Generate CLI commands from SDK schemas (including CLI plugins)
|
|
74
|
-
generateCliCommands(program, sdk);
|
|
75
|
-
// MCP command now handled by plugin
|
|
76
|
-
// Override Commander's default exit behavior to handle our custom errors
|
|
77
|
-
program.exitOverride();
|
|
78
|
-
(async () => {
|
|
79
|
-
let exitCode = 0;
|
|
80
|
-
// Start version checking non-blocking
|
|
81
|
-
const versionCheckPromise = checkAndNotifyUpdates({
|
|
82
|
-
packageName: packageJson.name,
|
|
83
|
-
currentVersion: packageJson.version,
|
|
84
|
-
});
|
|
85
|
-
try {
|
|
86
|
-
await program.parseAsync();
|
|
87
|
-
}
|
|
88
|
-
catch (error) {
|
|
89
|
-
if (error instanceof ZapierCliError) {
|
|
90
|
-
exitCode = error.exitCode;
|
|
91
|
-
}
|
|
92
|
-
else if (error instanceof CommanderError) {
|
|
93
|
-
exitCode = error.exitCode;
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
// For any other unexpected errors, exit with code 1
|
|
97
|
-
console.error("Unexpected error:", error);
|
|
98
|
-
exitCode = 1;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
// Wait for version checking to complete
|
|
102
|
-
await versionCheckPromise;
|
|
103
|
-
// Use exitCode instead of exit() to allow stdout to flush when piped
|
|
104
|
-
process.exitCode = exitCode;
|
|
105
|
-
})();
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { GetSdkType, ListActionsPluginProvides, ListInputFieldsPluginProvides, ManifestPluginProvides, AppItem } from "@zapier/zapier-sdk";
|
|
2
|
-
interface GenerateTypesOptions {
|
|
3
|
-
app: AppItem;
|
|
4
|
-
authenticationId?: string | number;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* AST-based TypeScript type generator using the TypeScript Compiler API
|
|
8
|
-
*/
|
|
9
|
-
export declare class AstTypeGenerator {
|
|
10
|
-
private readonly factory;
|
|
11
|
-
private readonly printer;
|
|
12
|
-
/**
|
|
13
|
-
* Generate TypeScript types using AST for a specific app
|
|
14
|
-
*/
|
|
15
|
-
generateTypes(options: GenerateTypesOptions & {
|
|
16
|
-
sdk: GetSdkType<ListActionsPluginProvides & ListInputFieldsPluginProvides & ManifestPluginProvides>;
|
|
17
|
-
}): Promise<string>;
|
|
18
|
-
private createSourceFile;
|
|
19
|
-
private createImportStatement;
|
|
20
|
-
private createTypeImportStatement;
|
|
21
|
-
private groupActionsByType;
|
|
22
|
-
private createInputInterface;
|
|
23
|
-
private createActionInterface;
|
|
24
|
-
private createAppProxyInterface;
|
|
25
|
-
private createFetchMethodProperty;
|
|
26
|
-
private createAppFactoryInterface;
|
|
27
|
-
private createAppWithFactoryType;
|
|
28
|
-
private createModuleAugmentation;
|
|
29
|
-
private mapFieldTypeToTypeNode;
|
|
30
|
-
private capitalize;
|
|
31
|
-
private sanitizeActionName;
|
|
32
|
-
private sanitizeFieldName;
|
|
33
|
-
private escapeComment;
|
|
34
|
-
private createPropertyName;
|
|
35
|
-
private isValidIdentifier;
|
|
36
|
-
private getPreferredProgrammaticKey;
|
|
37
|
-
private getPreferredAppName;
|
|
38
|
-
private sanitizeToIdentifier;
|
|
39
|
-
private getAllKeys;
|
|
40
|
-
}
|
|
41
|
-
export {};
|