@zapier/zapier-sdk-cli 0.39.1 → 0.39.2
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 +9 -0
- package/README.md +7 -7
- package/dist/cli.cjs +19 -7
- package/dist/cli.mjs +19 -7
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/package.json +1 -1
- package/dist/src/utils/cli-generator.js +18 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @zapier/zapier-sdk-cli
|
|
2
2
|
|
|
3
|
+
## 0.39.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 362bc56: Make sure CLI only shows non-deprecated positional parameters.
|
|
8
|
+
- Updated dependencies [362bc56]
|
|
9
|
+
- @zapier/zapier-sdk@0.40.2
|
|
10
|
+
- @zapier/zapier-sdk-mcp@0.10.8
|
|
11
|
+
|
|
3
12
|
## 0.39.1
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -409,10 +409,10 @@ Find the first connection matching the criteria
|
|
|
409
409
|
|
|
410
410
|
| Option | Type | Required | Default | Possible Values | Description |
|
|
411
411
|
| ------------------ | --------- | -------- | ------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
412
|
+
| `[app]` | `string` | ❌ | — | — | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github') |
|
|
412
413
|
| `--search` | `string` | ❌ | — | — | Search term to filter connections by title |
|
|
413
414
|
| `--title` | `string` | ❌ | — | — | Filter connections by exact title match (searches first, then filters locally) |
|
|
414
415
|
| `--owner` | `string` | ❌ | — | — | Filter by owner, 'me' for your own connections or a specific user ID |
|
|
415
|
-
| `--app` | `string` | ❌ | — | — | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github') |
|
|
416
416
|
| `--account` | `string` | ❌ | — | — | Account to filter by |
|
|
417
417
|
| `--include-shared` | `boolean` | ❌ | — | — | Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections. |
|
|
418
418
|
| `--is-expired` | `boolean` | ❌ | — | — | Filter by expired status |
|
|
@@ -420,7 +420,7 @@ Find the first connection matching the criteria
|
|
|
420
420
|
**Usage:**
|
|
421
421
|
|
|
422
422
|
```bash
|
|
423
|
-
npx zapier-sdk find-first-connection [--search] [--title] [--owner] [--
|
|
423
|
+
npx zapier-sdk find-first-connection [app] [--search] [--title] [--owner] [--account] [--include-shared] [--is-expired]
|
|
424
424
|
```
|
|
425
425
|
|
|
426
426
|
#### `find-unique-connection`
|
|
@@ -431,10 +431,10 @@ Find a unique connection matching the criteria
|
|
|
431
431
|
|
|
432
432
|
| Option | Type | Required | Default | Possible Values | Description |
|
|
433
433
|
| ------------------ | --------- | -------- | ------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
434
|
+
| `[app]` | `string` | ❌ | — | — | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github') |
|
|
434
435
|
| `--search` | `string` | ❌ | — | — | Search term to filter connections by title |
|
|
435
436
|
| `--title` | `string` | ❌ | — | — | Filter connections by exact title match (searches first, then filters locally) |
|
|
436
437
|
| `--owner` | `string` | ❌ | — | — | Filter by owner, 'me' for your own connections or a specific user ID |
|
|
437
|
-
| `--app` | `string` | ❌ | — | — | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github') |
|
|
438
438
|
| `--account` | `string` | ❌ | — | — | Account to filter by |
|
|
439
439
|
| `--include-shared` | `boolean` | ❌ | — | — | Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections. |
|
|
440
440
|
| `--is-expired` | `boolean` | ❌ | — | — | Filter by expired status |
|
|
@@ -442,7 +442,7 @@ Find a unique connection matching the criteria
|
|
|
442
442
|
**Usage:**
|
|
443
443
|
|
|
444
444
|
```bash
|
|
445
|
-
npx zapier-sdk find-unique-connection [--search] [--title] [--owner] [--
|
|
445
|
+
npx zapier-sdk find-unique-connection [app] [--search] [--title] [--owner] [--account] [--include-shared] [--is-expired]
|
|
446
446
|
```
|
|
447
447
|
|
|
448
448
|
#### `get-connection`
|
|
@@ -469,10 +469,10 @@ List available connections with optional filtering
|
|
|
469
469
|
|
|
470
470
|
| Option | Type | Required | Default | Possible Values | Description |
|
|
471
471
|
| ------------------ | --------- | -------- | ------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
472
|
+
| `[app]` | `string` | ❌ | — | — | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github') |
|
|
472
473
|
| `--search` | `string` | ❌ | — | — | Search term to filter connections by title |
|
|
473
474
|
| `--title` | `string` | ❌ | — | — | Filter connections by exact title match (searches first, then filters locally) |
|
|
474
475
|
| `--owner` | `string` | ❌ | — | — | Filter by owner, 'me' for your own connections or a specific user ID |
|
|
475
|
-
| `--app` | `string` | ❌ | — | — | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github') |
|
|
476
476
|
| `--connections` | `array` | ❌ | — | — | List of connection IDs to filter by |
|
|
477
477
|
| `--account` | `string` | ❌ | — | — | Account to filter by |
|
|
478
478
|
| `--include-shared` | `boolean` | ❌ | — | — | Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections. |
|
|
@@ -484,7 +484,7 @@ List available connections with optional filtering
|
|
|
484
484
|
**Usage:**
|
|
485
485
|
|
|
486
486
|
```bash
|
|
487
|
-
npx zapier-sdk list-connections [--search] [--title] [--owner] [--
|
|
487
|
+
npx zapier-sdk list-connections [app] [--search] [--title] [--owner] [--connections] [--account] [--include-shared] [--is-expired] [--page-size] [--max-items] [--cursor]
|
|
488
488
|
```
|
|
489
489
|
|
|
490
490
|
### HTTP Requests
|
|
@@ -695,9 +695,9 @@ List records in a table with optional filtering and sorting
|
|
|
695
695
|
| Option | Type | Required | Default | Possible Values | Description |
|
|
696
696
|
| --------------- | -------- | -------- | --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
697
697
|
| `<table>` | `string` | ✅ | — | — | The unique identifier of the table |
|
|
698
|
+
| ↳ `<field-key>` | `string` | ✅ | — | — | The field key to sort by |
|
|
698
699
|
| `--filters` | `array` | ❌ | — | — | Filter conditions for the query |
|
|
699
700
|
| `--sort` | `object` | ❌ | — | — | Sort records by a field |
|
|
700
|
-
| ↳ `<field-key>` | `string` | ✅ | — | — | The field key to sort by |
|
|
701
701
|
| ↳ `--direction` | `string` | ❌ | `"asc"` | — | Sort direction |
|
|
702
702
|
| `--page-size` | `number` | ❌ | — | — | Number of records per page (max 1000) |
|
|
703
703
|
| `--max-items` | `number` | ❌ | — | — | Maximum total items to return across all pages |
|
package/dist/cli.cjs
CHANGED
|
@@ -1103,7 +1103,7 @@ var SHARED_COMMAND_CLI_OPTIONS = [
|
|
|
1103
1103
|
|
|
1104
1104
|
// package.json
|
|
1105
1105
|
var package_default = {
|
|
1106
|
-
version: "0.39.
|
|
1106
|
+
version: "0.39.2"};
|
|
1107
1107
|
|
|
1108
1108
|
// src/telemetry/builders.ts
|
|
1109
1109
|
function createCliBaseEvent(context = {}) {
|
|
@@ -1637,6 +1637,9 @@ function resolveOutputMode({
|
|
|
1637
1637
|
if (hasUserSpecifiedMaxItems) return "collect";
|
|
1638
1638
|
return "paginate";
|
|
1639
1639
|
}
|
|
1640
|
+
function getSchemaAliases(schema) {
|
|
1641
|
+
return schema?.meta?.()?.aliases;
|
|
1642
|
+
}
|
|
1640
1643
|
function analyzeZodSchema(schema, functionInfo) {
|
|
1641
1644
|
const parameters = [];
|
|
1642
1645
|
const schemaDef = schema._zod?.def;
|
|
@@ -1869,6 +1872,15 @@ function createCommandConfig(cliCommandName, functionInfo, sdk2) {
|
|
|
1869
1872
|
const usesInputParameters = !functionInfo.inputSchema && !!functionInfo.inputParameters;
|
|
1870
1873
|
const schema = functionInfo.inputSchema;
|
|
1871
1874
|
const parameters = usesInputParameters ? analyzeInputParameters(functionInfo.inputParameters, functionInfo) : analyzeZodSchema(schema, functionInfo);
|
|
1875
|
+
const schemaAliases = getSchemaAliases(schema);
|
|
1876
|
+
if (schemaAliases) {
|
|
1877
|
+
const aliasedNames = new Set(Object.keys(schemaAliases));
|
|
1878
|
+
for (const param of parameters) {
|
|
1879
|
+
if (aliasedNames.has(param.name)) {
|
|
1880
|
+
param.isAlias = true;
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1872
1884
|
const description = functionInfo.description || schema?.description || `${cliCommandName} command`;
|
|
1873
1885
|
const handler = async (...args) => {
|
|
1874
1886
|
const startTime = Date.now();
|
|
@@ -1901,9 +1913,9 @@ function createCommandConfig(cliCommandName, functionInfo, sdk2) {
|
|
|
1901
1913
|
args.slice(0, -1),
|
|
1902
1914
|
options2
|
|
1903
1915
|
);
|
|
1904
|
-
const
|
|
1905
|
-
if (
|
|
1906
|
-
for (const [oldName, newName] of Object.entries(
|
|
1916
|
+
const schemaAliases2 = getSchemaAliases(schema);
|
|
1917
|
+
if (schemaAliases2) {
|
|
1918
|
+
for (const [oldName, newName] of Object.entries(schemaAliases2)) {
|
|
1907
1919
|
if (oldName in rawParams && !(newName in rawParams)) {
|
|
1908
1920
|
rawParams[newName] = rawParams[oldName];
|
|
1909
1921
|
delete rawParams[oldName];
|
|
@@ -2078,7 +2090,7 @@ function addCommand(program2, commandName, config) {
|
|
|
2078
2090
|
`<${kebabName}>`,
|
|
2079
2091
|
param.description || `${kebabName} parameter`
|
|
2080
2092
|
);
|
|
2081
|
-
} else if (param.isPositional) {
|
|
2093
|
+
} else if (param.isPositional && !param.hidden && !param.isAlias) {
|
|
2082
2094
|
command.argument(
|
|
2083
2095
|
`[${kebabName}]`,
|
|
2084
2096
|
param.description || `${kebabName} parameter`
|
|
@@ -2126,7 +2138,7 @@ function convertCliArgsToSdkParams(parameters, positionalArgs, options) {
|
|
|
2126
2138
|
const sdkParams = {};
|
|
2127
2139
|
let argIndex = 0;
|
|
2128
2140
|
parameters.forEach((param) => {
|
|
2129
|
-
if ((param.required || param.isPositional) && argIndex < positionalArgs.length) {
|
|
2141
|
+
if ((param.required || param.isPositional && !param.hidden && !param.isAlias) && argIndex < positionalArgs.length) {
|
|
2130
2142
|
sdkParams[param.name] = convertValue(
|
|
2131
2143
|
positionalArgs[argIndex],
|
|
2132
2144
|
param.type,
|
|
@@ -4656,7 +4668,7 @@ function createZapierCliSdk(options = {}) {
|
|
|
4656
4668
|
// package.json with { type: 'json' }
|
|
4657
4669
|
var package_default2 = {
|
|
4658
4670
|
name: "@zapier/zapier-sdk-cli",
|
|
4659
|
-
version: "0.39.
|
|
4671
|
+
version: "0.39.2"};
|
|
4660
4672
|
var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
|
|
4661
4673
|
var CACHE_RESET_INTERVAL_MS = (() => {
|
|
4662
4674
|
const { ZAPIER_SDK_UPDATE_CHECK_INTERVAL_MS = `${ONE_DAY_MS}` } = process.env;
|
package/dist/cli.mjs
CHANGED
|
@@ -1065,7 +1065,7 @@ var SHARED_COMMAND_CLI_OPTIONS = [
|
|
|
1065
1065
|
|
|
1066
1066
|
// package.json
|
|
1067
1067
|
var package_default = {
|
|
1068
|
-
version: "0.39.
|
|
1068
|
+
version: "0.39.2"};
|
|
1069
1069
|
|
|
1070
1070
|
// src/telemetry/builders.ts
|
|
1071
1071
|
function createCliBaseEvent(context = {}) {
|
|
@@ -1599,6 +1599,9 @@ function resolveOutputMode({
|
|
|
1599
1599
|
if (hasUserSpecifiedMaxItems) return "collect";
|
|
1600
1600
|
return "paginate";
|
|
1601
1601
|
}
|
|
1602
|
+
function getSchemaAliases(schema) {
|
|
1603
|
+
return schema?.meta?.()?.aliases;
|
|
1604
|
+
}
|
|
1602
1605
|
function analyzeZodSchema(schema, functionInfo) {
|
|
1603
1606
|
const parameters = [];
|
|
1604
1607
|
const schemaDef = schema._zod?.def;
|
|
@@ -1831,6 +1834,15 @@ function createCommandConfig(cliCommandName, functionInfo, sdk2) {
|
|
|
1831
1834
|
const usesInputParameters = !functionInfo.inputSchema && !!functionInfo.inputParameters;
|
|
1832
1835
|
const schema = functionInfo.inputSchema;
|
|
1833
1836
|
const parameters = usesInputParameters ? analyzeInputParameters(functionInfo.inputParameters, functionInfo) : analyzeZodSchema(schema, functionInfo);
|
|
1837
|
+
const schemaAliases = getSchemaAliases(schema);
|
|
1838
|
+
if (schemaAliases) {
|
|
1839
|
+
const aliasedNames = new Set(Object.keys(schemaAliases));
|
|
1840
|
+
for (const param of parameters) {
|
|
1841
|
+
if (aliasedNames.has(param.name)) {
|
|
1842
|
+
param.isAlias = true;
|
|
1843
|
+
}
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1834
1846
|
const description = functionInfo.description || schema?.description || `${cliCommandName} command`;
|
|
1835
1847
|
const handler = async (...args) => {
|
|
1836
1848
|
const startTime = Date.now();
|
|
@@ -1863,9 +1875,9 @@ function createCommandConfig(cliCommandName, functionInfo, sdk2) {
|
|
|
1863
1875
|
args.slice(0, -1),
|
|
1864
1876
|
options2
|
|
1865
1877
|
);
|
|
1866
|
-
const
|
|
1867
|
-
if (
|
|
1868
|
-
for (const [oldName, newName] of Object.entries(
|
|
1878
|
+
const schemaAliases2 = getSchemaAliases(schema);
|
|
1879
|
+
if (schemaAliases2) {
|
|
1880
|
+
for (const [oldName, newName] of Object.entries(schemaAliases2)) {
|
|
1869
1881
|
if (oldName in rawParams && !(newName in rawParams)) {
|
|
1870
1882
|
rawParams[newName] = rawParams[oldName];
|
|
1871
1883
|
delete rawParams[oldName];
|
|
@@ -2040,7 +2052,7 @@ function addCommand(program2, commandName, config) {
|
|
|
2040
2052
|
`<${kebabName}>`,
|
|
2041
2053
|
param.description || `${kebabName} parameter`
|
|
2042
2054
|
);
|
|
2043
|
-
} else if (param.isPositional) {
|
|
2055
|
+
} else if (param.isPositional && !param.hidden && !param.isAlias) {
|
|
2044
2056
|
command.argument(
|
|
2045
2057
|
`[${kebabName}]`,
|
|
2046
2058
|
param.description || `${kebabName} parameter`
|
|
@@ -2088,7 +2100,7 @@ function convertCliArgsToSdkParams(parameters, positionalArgs, options) {
|
|
|
2088
2100
|
const sdkParams = {};
|
|
2089
2101
|
let argIndex = 0;
|
|
2090
2102
|
parameters.forEach((param) => {
|
|
2091
|
-
if ((param.required || param.isPositional) && argIndex < positionalArgs.length) {
|
|
2103
|
+
if ((param.required || param.isPositional && !param.hidden && !param.isAlias) && argIndex < positionalArgs.length) {
|
|
2092
2104
|
sdkParams[param.name] = convertValue(
|
|
2093
2105
|
positionalArgs[argIndex],
|
|
2094
2106
|
param.type,
|
|
@@ -4618,7 +4630,7 @@ function createZapierCliSdk(options = {}) {
|
|
|
4618
4630
|
// package.json with { type: 'json' }
|
|
4619
4631
|
var package_default2 = {
|
|
4620
4632
|
name: "@zapier/zapier-sdk-cli",
|
|
4621
|
-
version: "0.39.
|
|
4633
|
+
version: "0.39.2"};
|
|
4622
4634
|
var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
|
|
4623
4635
|
var CACHE_RESET_INTERVAL_MS = (() => {
|
|
4624
4636
|
const { ZAPIER_SDK_UPDATE_CHECK_INTERVAL_MS = `${ONE_DAY_MS}` } = process.env;
|
package/dist/index.cjs
CHANGED
package/dist/index.mjs
CHANGED
package/dist/package.json
CHANGED
|
@@ -142,6 +142,10 @@ function resolveOutputMode({ isListCommand, hasPaginationParams, hasUserSpecifie
|
|
|
142
142
|
return "collect";
|
|
143
143
|
return "paginate";
|
|
144
144
|
}
|
|
145
|
+
/** Extract the aliases map from a schema's metadata (e.g., { appKey: "app" }). */
|
|
146
|
+
function getSchemaAliases(schema) {
|
|
147
|
+
return schema?.meta?.()?.aliases;
|
|
148
|
+
}
|
|
145
149
|
// ============================================================================
|
|
146
150
|
// Schema Analysis
|
|
147
151
|
// ============================================================================
|
|
@@ -410,6 +414,16 @@ function createCommandConfig(cliCommandName, functionInfo, sdk) {
|
|
|
410
414
|
const parameters = usesInputParameters
|
|
411
415
|
? analyzeInputParameters(functionInfo.inputParameters, functionInfo)
|
|
412
416
|
: analyzeZodSchema(schema, functionInfo);
|
|
417
|
+
// Mark params that are aliases for other params (e.g., appKey is an alias for app).
|
|
418
|
+
const schemaAliases = getSchemaAliases(schema);
|
|
419
|
+
if (schemaAliases) {
|
|
420
|
+
const aliasedNames = new Set(Object.keys(schemaAliases));
|
|
421
|
+
for (const param of parameters) {
|
|
422
|
+
if (aliasedNames.has(param.name)) {
|
|
423
|
+
param.isAlias = true;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
413
427
|
const description = functionInfo.description ||
|
|
414
428
|
schema?.description ||
|
|
415
429
|
`${cliCommandName} command`;
|
|
@@ -444,7 +458,7 @@ function createCommandConfig(cliCommandName, functionInfo, sdk) {
|
|
|
444
458
|
});
|
|
445
459
|
const rawParams = convertCliArgsToSdkParams(parameters, args.slice(0, -1), options);
|
|
446
460
|
// Remap aliased parameter names (e.g., authenticationId → connectionId)
|
|
447
|
-
const schemaAliases = schema
|
|
461
|
+
const schemaAliases = getSchemaAliases(schema);
|
|
448
462
|
if (schemaAliases) {
|
|
449
463
|
for (const [oldName, newName] of Object.entries(schemaAliases)) {
|
|
450
464
|
if (oldName in rawParams && !(newName in rawParams)) {
|
|
@@ -623,7 +637,7 @@ function addCommand(program, commandName, config) {
|
|
|
623
637
|
// Required parameters without resolvers become required positional arguments
|
|
624
638
|
command.argument(`<${kebabName}>`, param.description || `${kebabName} parameter`);
|
|
625
639
|
}
|
|
626
|
-
else if (param.isPositional) {
|
|
640
|
+
else if (param.isPositional && !param.hidden && !param.isAlias) {
|
|
627
641
|
// Optional parameters marked as positional become optional positional arguments
|
|
628
642
|
command.argument(`[${kebabName}]`, param.description || `${kebabName} parameter`);
|
|
629
643
|
}
|
|
@@ -683,7 +697,8 @@ function convertCliArgsToSdkParams(parameters, positionalArgs, options) {
|
|
|
683
697
|
// Handle positional arguments (required parameters or optional positional parameters)
|
|
684
698
|
let argIndex = 0;
|
|
685
699
|
parameters.forEach((param) => {
|
|
686
|
-
if ((param.required ||
|
|
700
|
+
if ((param.required ||
|
|
701
|
+
(param.isPositional && !param.hidden && !param.isAlias)) &&
|
|
687
702
|
argIndex < positionalArgs.length) {
|
|
688
703
|
// Use the original camelCase parameter name for the SDK
|
|
689
704
|
sdkParams[param.name] = convertValue(positionalArgs[argIndex], param.type, param.elementType);
|