@zapier/zapier-sdk-cli 0.11.1 → 0.12.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 +21 -0
- package/README.md +18 -18
- package/dist/cli.cjs +32 -15
- package/dist/cli.mjs +32 -15
- package/dist/index.cjs +11 -5
- package/dist/index.mjs +11 -5
- package/dist/package.json +1 -1
- package/dist/src/plugins/add/schemas.js +9 -6
- package/dist/src/utils/cli-generator.js +4 -4
- package/dist/src/utils/parameter-resolver.js +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/plugins/add/schemas.ts +30 -21
- package/src/utils/cli-generator.ts +18 -7
- package/src/utils/parameter-resolver.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @zapier/zapier-sdk-cli
|
|
2
2
|
|
|
3
|
+
## 0.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 21d8487: Improved get started README and added more documentation to the add plugin
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [21d8487]
|
|
12
|
+
- @zapier/zapier-sdk@0.12.0
|
|
13
|
+
- @zapier/zapier-sdk-mcp@0.3.11
|
|
14
|
+
|
|
15
|
+
## 0.11.2
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 407245e: Add packages to meta so we can document `fetch` for SDK but not CLI/MCP.
|
|
20
|
+
- Updated dependencies [407245e]
|
|
21
|
+
- @zapier/zapier-sdk-mcp@0.3.10
|
|
22
|
+
- @zapier/zapier-sdk@0.11.2
|
|
23
|
+
|
|
3
24
|
## 0.11.1
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -51,7 +51,7 @@ npx zapier-sdk login
|
|
|
51
51
|
npx zapier-sdk list-apps
|
|
52
52
|
|
|
53
53
|
# Generate TypeScript types for an app
|
|
54
|
-
npx zapier-sdk
|
|
54
|
+
npx zapier-sdk add slack --types-output ./types/slack.ts
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
## Global Options
|
|
@@ -315,16 +315,16 @@ List available authentications with optional filtering
|
|
|
315
315
|
|
|
316
316
|
**Options:**
|
|
317
317
|
|
|
318
|
-
| Option | Type | Required | Default | Possible Values | Description
|
|
319
|
-
| ---------------------- | -------- | -------- | ------- | --------------- |
|
|
320
|
-
| `--app-key` | `string` | ❌ | — | — | App key of authentications to list (e.g., 'SlackCLIAPI')
|
|
321
|
-
| `--authentication-ids` | `array` | ❌ | — | — | List of authentication IDs to filter by
|
|
322
|
-
| `--search` | `string` | ❌ | — | — | Search term to filter authentications by title
|
|
323
|
-
| `--title` | `string` | ❌ | — | — | Filter authentications by exact title match
|
|
324
|
-
| `--account-id` | `string` | ❌ | — | — | Filter by account ID
|
|
325
|
-
| `--owner` | `string` | ❌ | — | — | Filter by owner
|
|
326
|
-
| `--page-size` | `number` | ❌ | — | — | Number of authentications per page
|
|
327
|
-
| `--max-items` | `number` | ❌ | — | — | Maximum total items to return across all pages
|
|
318
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
319
|
+
| ---------------------- | -------- | -------- | ------- | --------------- | ------------------------------------------------------------------------ |
|
|
320
|
+
| `--app-key` | `string` | ❌ | — | — | App key of authentications to list (e.g., 'SlackCLIAPI') |
|
|
321
|
+
| `--authentication-ids` | `array` | ❌ | — | — | List of authentication IDs to filter by |
|
|
322
|
+
| `--search` | `string` | ❌ | — | — | Search term to filter authentications by title |
|
|
323
|
+
| `--title` | `string` | ❌ | — | — | Filter authentications by exact title match |
|
|
324
|
+
| `--account-id` | `string` | ❌ | — | — | Filter by account ID |
|
|
325
|
+
| `--owner` | `string` | ❌ | — | — | Filter by owner, 'me' for your own authentications or a specific user ID |
|
|
326
|
+
| `--page-size` | `number` | ❌ | — | — | Number of authentications per page |
|
|
327
|
+
| `--max-items` | `number` | ❌ | — | — | Maximum total items to return across all pages |
|
|
328
328
|
|
|
329
329
|
**Usage:**
|
|
330
330
|
|
|
@@ -361,16 +361,16 @@ npx zapier-sdk request <url> [--method] [--body] [--authentication-id] [--callba
|
|
|
361
361
|
|
|
362
362
|
#### `add`
|
|
363
363
|
|
|
364
|
-
|
|
364
|
+
Add apps with manifest locking and TypeScript type generation - updates .zapierrc with app versions and generates TypeScript definition files
|
|
365
365
|
|
|
366
366
|
**Options:**
|
|
367
367
|
|
|
368
|
-
| Option | Type | Required | Default | Possible Values | Description
|
|
369
|
-
| ---------------------- | -------- | -------- | ------- | --------------- |
|
|
370
|
-
| `<app-keys>` | `array` | ✅ | — | — |
|
|
371
|
-
| `--authentication-ids` | `array` | ❌ | — | — | Authentication IDs to use for type generation
|
|
372
|
-
| `--config-path` | `string` | ❌ | — | — | Path to Zapier config file (defaults to '.zapierrc')
|
|
373
|
-
| `--types-output` | `string` | ❌ | — | — | Directory for TypeScript type files (defaults to (src
|
|
368
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
369
|
+
| ---------------------- | -------- | -------- | ------- | --------------- | ------------------------------------------------------------------------------------------------------- |
|
|
370
|
+
| `<app-keys>` | `array` | ✅ | — | — | One or more app keys to add (e.g., 'slack', 'github', 'trello') |
|
|
371
|
+
| `--authentication-ids` | `array` | ❌ | — | — | Authentication IDs to use for type generation (e.g., ['123', '456']) |
|
|
372
|
+
| `--config-path` | `string` | ❌ | — | — | Path to Zapier config file (defaults to '.zapierrc', e.g., './custom/.zapierrc') |
|
|
373
|
+
| `--types-output` | `string` | ❌ | — | — | Directory for TypeScript type files (defaults to (src/lib/.)/zapier/apps/, e.g., './src/types/zapier/') |
|
|
374
374
|
|
|
375
375
|
**Usage:**
|
|
376
376
|
|
package/dist/cli.cjs
CHANGED
|
@@ -561,7 +561,7 @@ Optional fields${pathContext}:`));
|
|
|
561
561
|
}
|
|
562
562
|
hasResolver(paramName, sdk2, functionName) {
|
|
563
563
|
if (functionName && typeof sdk2.getRegistry === "function") {
|
|
564
|
-
const registry = sdk2.getRegistry();
|
|
564
|
+
const registry = sdk2.getRegistry({ package: "cli" });
|
|
565
565
|
const functionInfo = registry.functions.find(
|
|
566
566
|
(f) => f.name === functionName
|
|
567
567
|
);
|
|
@@ -573,7 +573,7 @@ Optional fields${pathContext}:`));
|
|
|
573
573
|
}
|
|
574
574
|
getResolver(paramName, sdk2, functionName) {
|
|
575
575
|
if (functionName && typeof sdk2.getRegistry === "function") {
|
|
576
|
-
const registry = sdk2.getRegistry();
|
|
576
|
+
const registry = sdk2.getRegistry({ package: "cli" });
|
|
577
577
|
const functionInfo = registry.functions.find(
|
|
578
578
|
(f) => f.name === functionName
|
|
579
579
|
);
|
|
@@ -758,7 +758,7 @@ function generateCliCommands(program2, sdk2) {
|
|
|
758
758
|
console.error("SDK registry not available");
|
|
759
759
|
return;
|
|
760
760
|
}
|
|
761
|
-
const registry = sdk2.getRegistry();
|
|
761
|
+
const registry = sdk2.getRegistry({ package: "cli" });
|
|
762
762
|
registry.functions.forEach((fnInfo) => {
|
|
763
763
|
if (!fnInfo.inputSchema) {
|
|
764
764
|
console.warn(`Schema not found for ${fnInfo.name}`);
|
|
@@ -1060,8 +1060,12 @@ async function handlePaginatedListWithAsyncIteration(sdkMethodName, sdkResult, f
|
|
|
1060
1060
|
)
|
|
1061
1061
|
);
|
|
1062
1062
|
}
|
|
1063
|
-
if (functionInfo) {
|
|
1064
|
-
formatItemsFromSchema(
|
|
1063
|
+
if (functionInfo && functionInfo.inputSchema) {
|
|
1064
|
+
formatItemsFromSchema(
|
|
1065
|
+
functionInfo,
|
|
1066
|
+
items,
|
|
1067
|
+
totalShown
|
|
1068
|
+
);
|
|
1065
1069
|
} else {
|
|
1066
1070
|
formatItemsGeneric2(items, totalShown);
|
|
1067
1071
|
}
|
|
@@ -1097,8 +1101,12 @@ async function handlePaginatedListWithAsyncIteration(sdkMethodName, sdkResult, f
|
|
|
1097
1101
|
console.log(chalk3__default.default.yellow(`No ${itemName} found.`));
|
|
1098
1102
|
return;
|
|
1099
1103
|
}
|
|
1100
|
-
if (functionInfo) {
|
|
1101
|
-
formatItemsFromSchema(
|
|
1104
|
+
if (functionInfo && functionInfo.inputSchema) {
|
|
1105
|
+
formatItemsFromSchema(
|
|
1106
|
+
functionInfo,
|
|
1107
|
+
items,
|
|
1108
|
+
0
|
|
1109
|
+
);
|
|
1102
1110
|
} else {
|
|
1103
1111
|
formatItemsGeneric2(items, 0);
|
|
1104
1112
|
}
|
|
@@ -1130,8 +1138,11 @@ function formatNonPaginatedResults(result, requestedMaxItems, userSpecifiedMaxIt
|
|
|
1130
1138
|
console.log(chalk3__default.default.green(`
|
|
1131
1139
|
\u2705 Found ${result.length} ${itemName}:
|
|
1132
1140
|
`));
|
|
1133
|
-
if (functionInfo) {
|
|
1134
|
-
formatItemsFromSchema(
|
|
1141
|
+
if (functionInfo && functionInfo.inputSchema) {
|
|
1142
|
+
formatItemsFromSchema(
|
|
1143
|
+
functionInfo,
|
|
1144
|
+
result
|
|
1145
|
+
);
|
|
1135
1146
|
} else {
|
|
1136
1147
|
formatItemsGeneric2(result);
|
|
1137
1148
|
}
|
|
@@ -1563,15 +1574,21 @@ var getLoginConfigPathPlugin = () => {
|
|
|
1563
1574
|
};
|
|
1564
1575
|
};
|
|
1565
1576
|
var AddSchema = zod.z.object({
|
|
1566
|
-
appKeys: zod.z.array(zod.z.string().min(1, "App key cannot be empty")).min(1, "At least one app key is required")
|
|
1567
|
-
|
|
1577
|
+
appKeys: zod.z.array(zod.z.string().min(1, "App key cannot be empty")).min(1, "At least one app key is required").describe(
|
|
1578
|
+
"One or more app keys to add (e.g., 'slack', 'github', 'trello')"
|
|
1579
|
+
),
|
|
1580
|
+
authenticationIds: zod.z.array(zod.z.string()).optional().describe(
|
|
1581
|
+
"Authentication IDs to use for type generation (e.g., ['123', '456'])"
|
|
1582
|
+
),
|
|
1568
1583
|
configPath: zod.z.string().optional().describe(
|
|
1569
|
-
`Path to Zapier config file (defaults to '${zapierSdk.DEFAULT_CONFIG_PATH}')`
|
|
1584
|
+
`Path to Zapier config file (defaults to '${zapierSdk.DEFAULT_CONFIG_PATH}', e.g., './custom/.zapierrc')`
|
|
1570
1585
|
),
|
|
1571
1586
|
typesOutput: zod.z.string().optional().describe(
|
|
1572
|
-
"Directory for TypeScript type files (defaults to (src
|
|
1587
|
+
"Directory for TypeScript type files (defaults to (src/lib/.)/zapier/apps/, e.g., './src/types/zapier/')"
|
|
1573
1588
|
)
|
|
1574
|
-
})
|
|
1589
|
+
}).describe(
|
|
1590
|
+
"Add apps with manifest locking and TypeScript type generation - updates .zapierrc with app versions and generates TypeScript definition files"
|
|
1591
|
+
);
|
|
1575
1592
|
var AstTypeGenerator = class {
|
|
1576
1593
|
constructor() {
|
|
1577
1594
|
this.factory = ts__namespace.factory;
|
|
@@ -2287,7 +2304,7 @@ function createZapierCliSdk(options = {}) {
|
|
|
2287
2304
|
|
|
2288
2305
|
// package.json
|
|
2289
2306
|
var package_default = {
|
|
2290
|
-
version: "0.
|
|
2307
|
+
version: "0.12.0"};
|
|
2291
2308
|
|
|
2292
2309
|
// src/cli.ts
|
|
2293
2310
|
var program = new commander.Command();
|
package/dist/cli.mjs
CHANGED
|
@@ -528,7 +528,7 @@ Optional fields${pathContext}:`));
|
|
|
528
528
|
}
|
|
529
529
|
hasResolver(paramName, sdk2, functionName) {
|
|
530
530
|
if (functionName && typeof sdk2.getRegistry === "function") {
|
|
531
|
-
const registry = sdk2.getRegistry();
|
|
531
|
+
const registry = sdk2.getRegistry({ package: "cli" });
|
|
532
532
|
const functionInfo = registry.functions.find(
|
|
533
533
|
(f) => f.name === functionName
|
|
534
534
|
);
|
|
@@ -540,7 +540,7 @@ Optional fields${pathContext}:`));
|
|
|
540
540
|
}
|
|
541
541
|
getResolver(paramName, sdk2, functionName) {
|
|
542
542
|
if (functionName && typeof sdk2.getRegistry === "function") {
|
|
543
|
-
const registry = sdk2.getRegistry();
|
|
543
|
+
const registry = sdk2.getRegistry({ package: "cli" });
|
|
544
544
|
const functionInfo = registry.functions.find(
|
|
545
545
|
(f) => f.name === functionName
|
|
546
546
|
);
|
|
@@ -725,7 +725,7 @@ function generateCliCommands(program2, sdk2) {
|
|
|
725
725
|
console.error("SDK registry not available");
|
|
726
726
|
return;
|
|
727
727
|
}
|
|
728
|
-
const registry = sdk2.getRegistry();
|
|
728
|
+
const registry = sdk2.getRegistry({ package: "cli" });
|
|
729
729
|
registry.functions.forEach((fnInfo) => {
|
|
730
730
|
if (!fnInfo.inputSchema) {
|
|
731
731
|
console.warn(`Schema not found for ${fnInfo.name}`);
|
|
@@ -1027,8 +1027,12 @@ async function handlePaginatedListWithAsyncIteration(sdkMethodName, sdkResult, f
|
|
|
1027
1027
|
)
|
|
1028
1028
|
);
|
|
1029
1029
|
}
|
|
1030
|
-
if (functionInfo) {
|
|
1031
|
-
formatItemsFromSchema(
|
|
1030
|
+
if (functionInfo && functionInfo.inputSchema) {
|
|
1031
|
+
formatItemsFromSchema(
|
|
1032
|
+
functionInfo,
|
|
1033
|
+
items,
|
|
1034
|
+
totalShown
|
|
1035
|
+
);
|
|
1032
1036
|
} else {
|
|
1033
1037
|
formatItemsGeneric2(items, totalShown);
|
|
1034
1038
|
}
|
|
@@ -1064,8 +1068,12 @@ async function handlePaginatedListWithAsyncIteration(sdkMethodName, sdkResult, f
|
|
|
1064
1068
|
console.log(chalk3.yellow(`No ${itemName} found.`));
|
|
1065
1069
|
return;
|
|
1066
1070
|
}
|
|
1067
|
-
if (functionInfo) {
|
|
1068
|
-
formatItemsFromSchema(
|
|
1071
|
+
if (functionInfo && functionInfo.inputSchema) {
|
|
1072
|
+
formatItemsFromSchema(
|
|
1073
|
+
functionInfo,
|
|
1074
|
+
items,
|
|
1075
|
+
0
|
|
1076
|
+
);
|
|
1069
1077
|
} else {
|
|
1070
1078
|
formatItemsGeneric2(items, 0);
|
|
1071
1079
|
}
|
|
@@ -1097,8 +1105,11 @@ function formatNonPaginatedResults(result, requestedMaxItems, userSpecifiedMaxIt
|
|
|
1097
1105
|
console.log(chalk3.green(`
|
|
1098
1106
|
\u2705 Found ${result.length} ${itemName}:
|
|
1099
1107
|
`));
|
|
1100
|
-
if (functionInfo) {
|
|
1101
|
-
formatItemsFromSchema(
|
|
1108
|
+
if (functionInfo && functionInfo.inputSchema) {
|
|
1109
|
+
formatItemsFromSchema(
|
|
1110
|
+
functionInfo,
|
|
1111
|
+
result
|
|
1112
|
+
);
|
|
1102
1113
|
} else {
|
|
1103
1114
|
formatItemsGeneric2(result);
|
|
1104
1115
|
}
|
|
@@ -1530,15 +1541,21 @@ var getLoginConfigPathPlugin = () => {
|
|
|
1530
1541
|
};
|
|
1531
1542
|
};
|
|
1532
1543
|
var AddSchema = z.object({
|
|
1533
|
-
appKeys: z.array(z.string().min(1, "App key cannot be empty")).min(1, "At least one app key is required")
|
|
1534
|
-
|
|
1544
|
+
appKeys: z.array(z.string().min(1, "App key cannot be empty")).min(1, "At least one app key is required").describe(
|
|
1545
|
+
"One or more app keys to add (e.g., 'slack', 'github', 'trello')"
|
|
1546
|
+
),
|
|
1547
|
+
authenticationIds: z.array(z.string()).optional().describe(
|
|
1548
|
+
"Authentication IDs to use for type generation (e.g., ['123', '456'])"
|
|
1549
|
+
),
|
|
1535
1550
|
configPath: z.string().optional().describe(
|
|
1536
|
-
`Path to Zapier config file (defaults to '${DEFAULT_CONFIG_PATH}')`
|
|
1551
|
+
`Path to Zapier config file (defaults to '${DEFAULT_CONFIG_PATH}', e.g., './custom/.zapierrc')`
|
|
1537
1552
|
),
|
|
1538
1553
|
typesOutput: z.string().optional().describe(
|
|
1539
|
-
"Directory for TypeScript type files (defaults to (src
|
|
1554
|
+
"Directory for TypeScript type files (defaults to (src/lib/.)/zapier/apps/, e.g., './src/types/zapier/')"
|
|
1540
1555
|
)
|
|
1541
|
-
})
|
|
1556
|
+
}).describe(
|
|
1557
|
+
"Add apps with manifest locking and TypeScript type generation - updates .zapierrc with app versions and generates TypeScript definition files"
|
|
1558
|
+
);
|
|
1542
1559
|
var AstTypeGenerator = class {
|
|
1543
1560
|
constructor() {
|
|
1544
1561
|
this.factory = ts.factory;
|
|
@@ -2254,7 +2271,7 @@ function createZapierCliSdk(options = {}) {
|
|
|
2254
2271
|
|
|
2255
2272
|
// package.json
|
|
2256
2273
|
var package_default = {
|
|
2257
|
-
version: "0.
|
|
2274
|
+
version: "0.12.0"};
|
|
2258
2275
|
|
|
2259
2276
|
// src/cli.ts
|
|
2260
2277
|
var program = new Command();
|
package/dist/index.cjs
CHANGED
|
@@ -438,15 +438,21 @@ var getLoginConfigPathPlugin = () => {
|
|
|
438
438
|
};
|
|
439
439
|
};
|
|
440
440
|
var AddSchema = zod.z.object({
|
|
441
|
-
appKeys: zod.z.array(zod.z.string().min(1, "App key cannot be empty")).min(1, "At least one app key is required")
|
|
442
|
-
|
|
441
|
+
appKeys: zod.z.array(zod.z.string().min(1, "App key cannot be empty")).min(1, "At least one app key is required").describe(
|
|
442
|
+
"One or more app keys to add (e.g., 'slack', 'github', 'trello')"
|
|
443
|
+
),
|
|
444
|
+
authenticationIds: zod.z.array(zod.z.string()).optional().describe(
|
|
445
|
+
"Authentication IDs to use for type generation (e.g., ['123', '456'])"
|
|
446
|
+
),
|
|
443
447
|
configPath: zod.z.string().optional().describe(
|
|
444
|
-
`Path to Zapier config file (defaults to '${zapierSdk.DEFAULT_CONFIG_PATH}')`
|
|
448
|
+
`Path to Zapier config file (defaults to '${zapierSdk.DEFAULT_CONFIG_PATH}', e.g., './custom/.zapierrc')`
|
|
445
449
|
),
|
|
446
450
|
typesOutput: zod.z.string().optional().describe(
|
|
447
|
-
"Directory for TypeScript type files (defaults to (src
|
|
451
|
+
"Directory for TypeScript type files (defaults to (src/lib/.)/zapier/apps/, e.g., './src/types/zapier/')"
|
|
448
452
|
)
|
|
449
|
-
})
|
|
453
|
+
}).describe(
|
|
454
|
+
"Add apps with manifest locking and TypeScript type generation - updates .zapierrc with app versions and generates TypeScript definition files"
|
|
455
|
+
);
|
|
450
456
|
var AstTypeGenerator = class {
|
|
451
457
|
constructor() {
|
|
452
458
|
this.factory = ts__namespace.factory;
|
package/dist/index.mjs
CHANGED
|
@@ -407,15 +407,21 @@ var getLoginConfigPathPlugin = () => {
|
|
|
407
407
|
};
|
|
408
408
|
};
|
|
409
409
|
var AddSchema = z.object({
|
|
410
|
-
appKeys: z.array(z.string().min(1, "App key cannot be empty")).min(1, "At least one app key is required")
|
|
411
|
-
|
|
410
|
+
appKeys: z.array(z.string().min(1, "App key cannot be empty")).min(1, "At least one app key is required").describe(
|
|
411
|
+
"One or more app keys to add (e.g., 'slack', 'github', 'trello')"
|
|
412
|
+
),
|
|
413
|
+
authenticationIds: z.array(z.string()).optional().describe(
|
|
414
|
+
"Authentication IDs to use for type generation (e.g., ['123', '456'])"
|
|
415
|
+
),
|
|
412
416
|
configPath: z.string().optional().describe(
|
|
413
|
-
`Path to Zapier config file (defaults to '${DEFAULT_CONFIG_PATH}')`
|
|
417
|
+
`Path to Zapier config file (defaults to '${DEFAULT_CONFIG_PATH}', e.g., './custom/.zapierrc')`
|
|
414
418
|
),
|
|
415
419
|
typesOutput: z.string().optional().describe(
|
|
416
|
-
"Directory for TypeScript type files (defaults to (src
|
|
420
|
+
"Directory for TypeScript type files (defaults to (src/lib/.)/zapier/apps/, e.g., './src/types/zapier/')"
|
|
417
421
|
)
|
|
418
|
-
})
|
|
422
|
+
}).describe(
|
|
423
|
+
"Add apps with manifest locking and TypeScript type generation - updates .zapierrc with app versions and generates TypeScript definition files"
|
|
424
|
+
);
|
|
419
425
|
var AstTypeGenerator = class {
|
|
420
426
|
constructor() {
|
|
421
427
|
this.factory = ts.factory;
|
package/dist/package.json
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { DEFAULT_CONFIG_PATH } from "@zapier/zapier-sdk";
|
|
3
|
-
export const AddSchema = z
|
|
3
|
+
export const AddSchema = z
|
|
4
|
+
.object({
|
|
4
5
|
appKeys: z
|
|
5
6
|
.array(z.string().min(1, "App key cannot be empty"))
|
|
6
|
-
.min(1, "At least one app key is required")
|
|
7
|
+
.min(1, "At least one app key is required")
|
|
8
|
+
.describe("One or more app keys to add (e.g., 'slack', 'github', 'trello')"),
|
|
7
9
|
authenticationIds: z
|
|
8
10
|
.array(z.string())
|
|
9
11
|
.optional()
|
|
10
|
-
.describe("Authentication IDs to use for type generation"),
|
|
12
|
+
.describe("Authentication IDs to use for type generation (e.g., ['123', '456'])"),
|
|
11
13
|
configPath: z
|
|
12
14
|
.string()
|
|
13
15
|
.optional()
|
|
14
|
-
.describe(`Path to Zapier config file (defaults to '${DEFAULT_CONFIG_PATH}')`),
|
|
16
|
+
.describe(`Path to Zapier config file (defaults to '${DEFAULT_CONFIG_PATH}', e.g., './custom/.zapierrc')`),
|
|
15
17
|
typesOutput: z
|
|
16
18
|
.string()
|
|
17
19
|
.optional()
|
|
18
|
-
.describe("Directory for TypeScript type files (defaults to (src
|
|
19
|
-
})
|
|
20
|
+
.describe("Directory for TypeScript type files (defaults to (src/lib/.)/zapier/apps/, e.g., './src/types/zapier/')"),
|
|
21
|
+
})
|
|
22
|
+
.describe("Add apps with manifest locking and TypeScript type generation - updates .zapierrc with app versions and generates TypeScript definition files");
|
|
@@ -121,7 +121,7 @@ export function generateCliCommands(program, sdk) {
|
|
|
121
121
|
console.error("SDK registry not available");
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
-
const registry = sdk.getRegistry();
|
|
124
|
+
const registry = sdk.getRegistry({ package: "cli" });
|
|
125
125
|
// Create all commands first
|
|
126
126
|
registry.functions.forEach((fnInfo) => {
|
|
127
127
|
if (!fnInfo.inputSchema) {
|
|
@@ -415,7 +415,7 @@ async function handlePaginatedListWithAsyncIteration(sdkMethodName, sdkResult, f
|
|
|
415
415
|
console.log(chalk.blue(`📋 ${getListTitleFromMethod(sdkMethodName, functionInfo)}\n`));
|
|
416
416
|
}
|
|
417
417
|
// Format and display items using function info
|
|
418
|
-
if (functionInfo) {
|
|
418
|
+
if (functionInfo && functionInfo.inputSchema) {
|
|
419
419
|
formatItemsFromSchema(functionInfo, items, totalShown);
|
|
420
420
|
}
|
|
421
421
|
else {
|
|
@@ -452,7 +452,7 @@ async function handlePaginatedListWithAsyncIteration(sdkMethodName, sdkResult, f
|
|
|
452
452
|
console.log(chalk.yellow(`No ${itemName} found.`));
|
|
453
453
|
return;
|
|
454
454
|
}
|
|
455
|
-
if (functionInfo) {
|
|
455
|
+
if (functionInfo && functionInfo.inputSchema) {
|
|
456
456
|
formatItemsFromSchema(functionInfo, items, 0);
|
|
457
457
|
}
|
|
458
458
|
else {
|
|
@@ -486,7 +486,7 @@ function formatNonPaginatedResults(result, requestedMaxItems, userSpecifiedMaxIt
|
|
|
486
486
|
}
|
|
487
487
|
console.log(chalk.green(`\n✅ Found ${result.length} ${itemName}:\n`));
|
|
488
488
|
// Use function info for formatting
|
|
489
|
-
if (functionInfo) {
|
|
489
|
+
if (functionInfo && functionInfo.inputSchema) {
|
|
490
490
|
formatItemsFromSchema(functionInfo, result);
|
|
491
491
|
}
|
|
492
492
|
else {
|
|
@@ -506,7 +506,7 @@ export class SchemaParameterResolver {
|
|
|
506
506
|
hasResolver(paramName, sdk, functionName) {
|
|
507
507
|
// Check plugin-specific resolvers first
|
|
508
508
|
if (functionName && typeof sdk.getRegistry === "function") {
|
|
509
|
-
const registry = sdk.getRegistry();
|
|
509
|
+
const registry = sdk.getRegistry({ package: "cli" });
|
|
510
510
|
const functionInfo = registry.functions.find((f) => f.name === functionName);
|
|
511
511
|
if (functionInfo && functionInfo.resolvers?.[paramName]) {
|
|
512
512
|
return true;
|
|
@@ -518,7 +518,7 @@ export class SchemaParameterResolver {
|
|
|
518
518
|
getResolver(paramName, sdk, functionName) {
|
|
519
519
|
// Check plugin-specific resolvers first
|
|
520
520
|
if (functionName && typeof sdk.getRegistry === "function") {
|
|
521
|
-
const registry = sdk.getRegistry();
|
|
521
|
+
const registry = sdk.getRegistry({ package: "cli" });
|
|
522
522
|
const functionInfo = registry.functions.find((f) => f.name === functionName);
|
|
523
523
|
if (functionInfo && functionInfo.resolvers?.[paramName]) {
|
|
524
524
|
return functionInfo.resolvers[paramName];
|