@zapier/zapier-sdk-cli 0.69.0 → 0.70.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 +16 -0
- package/README.md +9 -7
- package/dist/cli.cjs +169 -11
- package/dist/cli.mjs +171 -13
- package/dist/experimental.cjs +1 -1
- package/dist/experimental.mjs +1 -1
- package/dist/index.cjs +12 -2
- package/dist/index.d.mts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.mjs +13 -4
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @zapier/zapier-sdk-cli
|
|
2
2
|
|
|
3
|
+
## 0.70.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- af89cf8: Boolean CLI flags are now strict presence toggles, and list-taking positional arguments now collect every operand:
|
|
8
|
+
- `--flag` enables; omitting the flag uses the default. Passing a value (`--flag false` or `--flag=false`) is rejected with an error pointing at the correct spelling, instead of being silently ignored (which previously left the flag enabled). A positional argument whose literal value looks boolean can still be passed after a `--` terminator.
|
|
9
|
+
- Flags where disabling differs from omitting get an explicit disable form: `publish-workflow-version <id> --disabled` and `publish-workflow-draft <workflow> <draft> --disabled` publish without enabling. Generated CLI docs show the disable form wherever one exists.
|
|
10
|
+
- Commands reject unexpected extra positional arguments rather than ignoring them.
|
|
11
|
+
- Commands whose first argument is a list (`add`, `build-manifest`, `generate-app-types`, the `create-`/`update-`/`delete-table-records` and `-fields` commands) now collect every operand into the list: `npx zapier-sdk add slack google-sheets` adds both apps. Previously only the first value was used and the rest were silently ignored.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [bc7405e]
|
|
16
|
+
- @zapier/zapier-sdk@0.93.0
|
|
17
|
+
- @zapier/zapier-sdk-mcp@0.18.23
|
|
18
|
+
|
|
3
19
|
## 0.69.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -197,6 +197,8 @@ These options are available for all commands:
|
|
|
197
197
|
|
|
198
198
|
The CLI automatically generates commands from the SDK registry. All SDK functions are available as CLI commands using kebab-case naming.
|
|
199
199
|
|
|
200
|
+
Boolean flags are presence toggles and take no value: pass `--flag` to enable it, or omit the flag to use the default. Flags where disabling differs from omitting document a separate disable flag (e.g. `--disabled`). A value after a boolean flag (`--flag false`) is rejected as an extra argument.
|
|
201
|
+
|
|
200
202
|
### Accounts
|
|
201
203
|
|
|
202
204
|
#### `get-profile`
|
|
@@ -803,12 +805,12 @@ Publish an open draft as a new immutable workflow version. Advances the workflow
|
|
|
803
805
|
|
|
804
806
|
**Options:**
|
|
805
807
|
|
|
806
|
-
| Option
|
|
807
|
-
|
|
|
808
|
-
| `<workflow>`
|
|
809
|
-
| `<draft>`
|
|
810
|
-
| `--enabled`
|
|
811
|
-
| `--draft-revision`
|
|
808
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
809
|
+
| -------------------------- | --------- | -------- | ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
810
|
+
| `<workflow>` | `string` | ✅ | — | — | Durable workflow ID |
|
|
811
|
+
| `<draft>` | `string` | ✅ | — | — | Workflow draft ID |
|
|
812
|
+
| `--enabled` / `--disabled` | `boolean` | ❌ | — | — | Set the workflow's enabled state as part of the publish. If omitted, the current enabled state is preserved. |
|
|
813
|
+
| `--draft-revision` | `number` | ❌ | — | — | Expected draft revision for optimistic concurrency. Pass the revision from the last read; the server rejects the publish with a conflict if the draft has changed since. Omit to skip the check. |
|
|
812
814
|
|
|
813
815
|
**Usage:**
|
|
814
816
|
|
|
@@ -828,7 +830,7 @@ Publish a new version of a durable workflow. Enables the workflow by default.
|
|
|
828
830
|
| `<source-files>` | `object` | ✅ | — | — | Source files keyed by filename → contents |
|
|
829
831
|
| `--dependencies` | `object` | ❌ | — | — | Optional npm package dependencies |
|
|
830
832
|
| `--zapier-durable-version` | `string` | ❌ | — | — | Exact semver of @zapier/zapier-durable to use (e.g. "1.2.3"). Defaults to server-configured version if omitted. |
|
|
831
|
-
| `--enabled`
|
|
833
|
+
| `--enabled` / `--disabled` | `boolean` | ❌ | — | — | Enable the workflow after publishing. Defaults to true if omitted; pass false to publish without enabling. |
|
|
832
834
|
| `--ignore-open-drafts` | `boolean` | ❌ | — | — | Publish even though the workflow has open draft(s). Without this, the API rejects a direct publish with a 409 while any draft is open, since publishing the draft later would ship its stale content over this version. |
|
|
833
835
|
| `--connections` | `object` | ❌ | — | — | Map of connection aliases to Zapier connections used by the workflow. Pass `null` to clear an existing binding. |
|
|
834
836
|
| `--app-versions` | `object` | ❌ | — | — | Map of app keys to pinned app implementation/version used by the workflow. Pass `null` to clear an existing binding. |
|
package/dist/cli.cjs
CHANGED
|
@@ -602,7 +602,7 @@ var SHARED_COMMAND_CLI_OPTIONS = [
|
|
|
602
602
|
|
|
603
603
|
// package.json
|
|
604
604
|
var package_default = {
|
|
605
|
-
version: "0.
|
|
605
|
+
version: "0.70.0"};
|
|
606
606
|
var PACKAGE_MANAGERS = ["npm", "pnpm", "yarn", "bun"];
|
|
607
607
|
var LOCKFILES = [
|
|
608
608
|
["pnpm-lock.yaml", "pnpm"],
|
|
@@ -866,6 +866,9 @@ function formatItemsGeneric(items, startingNumber = 0) {
|
|
|
866
866
|
function toKebabCase(str) {
|
|
867
867
|
return str.replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").replace(/([a-z\d])([A-Z])/g, "$1-$2").toLowerCase();
|
|
868
868
|
}
|
|
869
|
+
function kebabToCamelCase(str) {
|
|
870
|
+
return str.replace(/-([a-z])/g, (match) => match[1].toUpperCase());
|
|
871
|
+
}
|
|
869
872
|
function formatMissingParamsError(error) {
|
|
870
873
|
return [
|
|
871
874
|
"Missing required parameters:",
|
|
@@ -1261,6 +1264,18 @@ function resolveOutputMode({
|
|
|
1261
1264
|
if (hasUserSpecifiedMaxItems) return "collect";
|
|
1262
1265
|
return "paginate";
|
|
1263
1266
|
}
|
|
1267
|
+
function negationKebabName(param) {
|
|
1268
|
+
if (param.negatable === true) return `no-${toKebabCase(param.name)}`;
|
|
1269
|
+
if (typeof param.negatable === "string") return toKebabCase(param.negatable);
|
|
1270
|
+
return void 0;
|
|
1271
|
+
}
|
|
1272
|
+
function antonymAttributeName(param) {
|
|
1273
|
+
const negationKebab = negationKebabName(param);
|
|
1274
|
+
if (negationKebab === void 0 || negationKebab.startsWith("no-")) {
|
|
1275
|
+
return void 0;
|
|
1276
|
+
}
|
|
1277
|
+
return kebabToCamelCase(negationKebab);
|
|
1278
|
+
}
|
|
1264
1279
|
function takesPositionalSlot(param) {
|
|
1265
1280
|
return param.required || !!param.isPositional && !param.isDeprecated && !param.isAlias;
|
|
1266
1281
|
}
|
|
@@ -1373,7 +1388,8 @@ function analyzeZodField(name, schema) {
|
|
|
1373
1388
|
isPositional: zapierSdk.isPositional(schema),
|
|
1374
1389
|
elementType,
|
|
1375
1390
|
deprecationMessage,
|
|
1376
|
-
isDeprecated
|
|
1391
|
+
isDeprecated,
|
|
1392
|
+
negatable: zapierSdk.getNegatable(schema)
|
|
1377
1393
|
};
|
|
1378
1394
|
}
|
|
1379
1395
|
function positionalProjection(schema, positional) {
|
|
@@ -1758,15 +1774,25 @@ function collect(value, previous = []) {
|
|
|
1758
1774
|
return previous;
|
|
1759
1775
|
}
|
|
1760
1776
|
function addCommand(program2, commandName, config2) {
|
|
1761
|
-
const command = program2.command(commandName, { hidden: config2.hidden ?? false }).description(config2.description);
|
|
1777
|
+
const command = program2.command(commandName, { hidden: config2.hidden ?? false }).description(config2.description).allowExcessArguments(false);
|
|
1762
1778
|
let hasPositionalArray = false;
|
|
1779
|
+
const lastPositionalParamName = [...config2.parameters].reverse().find(takesPositionalSlot)?.name;
|
|
1780
|
+
const booleanFlags2 = [];
|
|
1763
1781
|
config2.parameters.forEach((param) => {
|
|
1764
1782
|
const kebabName = toKebabCase(param.name);
|
|
1765
1783
|
if (param.promptable && param.required) {
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1784
|
+
if (param.type === "array" && !hasPositionalArray && param.name === lastPositionalParamName) {
|
|
1785
|
+
hasPositionalArray = true;
|
|
1786
|
+
command.argument(
|
|
1787
|
+
`[${kebabName}...]`,
|
|
1788
|
+
param.description || `${kebabName} parameter`
|
|
1789
|
+
);
|
|
1790
|
+
} else {
|
|
1791
|
+
command.argument(
|
|
1792
|
+
`[${kebabName}]`,
|
|
1793
|
+
param.description || `${kebabName} parameter`
|
|
1794
|
+
);
|
|
1795
|
+
}
|
|
1770
1796
|
} else if (param.required && param.type === "array" && !hasPositionalArray) {
|
|
1771
1797
|
hasPositionalArray = true;
|
|
1772
1798
|
command.argument(
|
|
@@ -1803,6 +1829,24 @@ function addCommand(program2, commandName, config2) {
|
|
|
1803
1829
|
const opt = new commander.Option(flags.join(", "), param.description);
|
|
1804
1830
|
if (param.isDeprecated) opt.hideHelp();
|
|
1805
1831
|
command.addOption(opt);
|
|
1832
|
+
const negationKebab = negationKebabName(param);
|
|
1833
|
+
if (negationKebab !== void 0) {
|
|
1834
|
+
const negation = new commander.Option(
|
|
1835
|
+
`--${negationKebab}`,
|
|
1836
|
+
`Disable --${kebabName}`
|
|
1837
|
+
);
|
|
1838
|
+
if (!negationKebab.startsWith("no-")) {
|
|
1839
|
+
negation.conflicts(param.name);
|
|
1840
|
+
}
|
|
1841
|
+
if (param.isDeprecated) negation.hideHelp();
|
|
1842
|
+
command.addOption(negation);
|
|
1843
|
+
}
|
|
1844
|
+
booleanFlags2.push({
|
|
1845
|
+
kebabName,
|
|
1846
|
+
attributeName: param.name,
|
|
1847
|
+
negationKebab,
|
|
1848
|
+
shortAlias: alias && alias.length === 1 ? alias : void 0
|
|
1849
|
+
});
|
|
1806
1850
|
} else if (param.type === "array") {
|
|
1807
1851
|
const flagSignature = flags.join(", ") + ` <value>`;
|
|
1808
1852
|
const opt = new commander.Option(flagSignature, param.description || "");
|
|
@@ -1832,24 +1876,128 @@ function addCommand(program2, commandName, config2) {
|
|
|
1832
1876
|
if (config2.supportsJsonOutput === false && opt.name === "json") return;
|
|
1833
1877
|
command.option(opt.flag, opt.description);
|
|
1834
1878
|
});
|
|
1879
|
+
if (booleanFlags2.length > 0) {
|
|
1880
|
+
addBooleanFlagErrorHints({ command, booleanFlags: booleanFlags2 });
|
|
1881
|
+
rejectBooleanFlagValues({ command, booleanFlags: booleanFlags2 });
|
|
1882
|
+
}
|
|
1835
1883
|
command.action(config2.handler);
|
|
1836
1884
|
}
|
|
1885
|
+
function booleanFlagUsageHint(flag) {
|
|
1886
|
+
return flag.negationKebab !== void 0 ? `use --${flag.kebabName} to enable or --${flag.negationKebab} to disable` : `pass --${flag.kebabName} to enable or omit it`;
|
|
1887
|
+
}
|
|
1888
|
+
function addBooleanFlagErrorHints({
|
|
1889
|
+
command,
|
|
1890
|
+
booleanFlags: booleanFlags2
|
|
1891
|
+
}) {
|
|
1892
|
+
const originalError = command.error.bind(command);
|
|
1893
|
+
command.error = (message, errorOptions) => originalError(
|
|
1894
|
+
appendBooleanFlagHint({
|
|
1895
|
+
message,
|
|
1896
|
+
code: errorOptions?.code,
|
|
1897
|
+
command,
|
|
1898
|
+
booleanFlags: booleanFlags2
|
|
1899
|
+
}),
|
|
1900
|
+
errorOptions
|
|
1901
|
+
);
|
|
1902
|
+
}
|
|
1903
|
+
function rejectBooleanFlagValues({
|
|
1904
|
+
command,
|
|
1905
|
+
booleanFlags: booleanFlags2
|
|
1906
|
+
}) {
|
|
1907
|
+
command.hook("preAction", (_thisCommand, actionCommand) => {
|
|
1908
|
+
let root = actionCommand;
|
|
1909
|
+
while (root.parent) root = root.parent;
|
|
1910
|
+
const { rawArgs } = root;
|
|
1911
|
+
const terminatorIndex = rawArgs.indexOf("--");
|
|
1912
|
+
const tokens = terminatorIndex === -1 ? rawArgs : rawArgs.slice(0, terminatorIndex);
|
|
1913
|
+
for (const flag of booleanFlags2) {
|
|
1914
|
+
const spellings = new Set(
|
|
1915
|
+
[
|
|
1916
|
+
`--${flag.kebabName}`,
|
|
1917
|
+
flag.negationKebab === void 0 ? void 0 : `--${flag.negationKebab}`,
|
|
1918
|
+
flag.shortAlias === void 0 ? void 0 : `-${flag.shortAlias}`
|
|
1919
|
+
].filter((spelling) => spelling !== void 0)
|
|
1920
|
+
);
|
|
1921
|
+
for (let i = 0; i < tokens.length - 1; i++) {
|
|
1922
|
+
if (!spellings.has(tokens[i])) continue;
|
|
1923
|
+
const next = tokens[i + 1].trim().toLowerCase();
|
|
1924
|
+
if (!BOOLEAN_TRUE_TOKENS.has(next) && !BOOLEAN_FALSE_TOKENS.has(next)) {
|
|
1925
|
+
continue;
|
|
1926
|
+
}
|
|
1927
|
+
actionCommand.error(
|
|
1928
|
+
`error: ${tokens[i]} is a boolean flag and takes no value, but was followed by '${tokens[i + 1]}': ${booleanFlagUsageHint(flag)}.`,
|
|
1929
|
+
{ code: "zapierSdk.booleanFlagValue" }
|
|
1930
|
+
);
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
});
|
|
1934
|
+
}
|
|
1935
|
+
function appendBooleanFlagHint({
|
|
1936
|
+
message,
|
|
1937
|
+
code,
|
|
1938
|
+
command,
|
|
1939
|
+
booleanFlags: booleanFlags2
|
|
1940
|
+
}) {
|
|
1941
|
+
if (code === "commander.unknownOption") {
|
|
1942
|
+
const flagWithValue = message.match(/'--([^=']+)=/);
|
|
1943
|
+
if (!flagWithValue) return message;
|
|
1944
|
+
const typedName = flagWithValue[1];
|
|
1945
|
+
const flag = booleanFlags2.find(
|
|
1946
|
+
(candidate) => candidate.kebabName === typedName || candidate.negationKebab === typedName
|
|
1947
|
+
);
|
|
1948
|
+
if (flag === void 0) return message;
|
|
1949
|
+
return `${message}
|
|
1950
|
+
(--${typedName} is a boolean flag and takes no value: ${booleanFlagUsageHint(flag)}.)`;
|
|
1951
|
+
}
|
|
1952
|
+
if (code === "commander.excessArguments") {
|
|
1953
|
+
const excessOperands = command.args.slice(
|
|
1954
|
+
command.registeredArguments.length
|
|
1955
|
+
);
|
|
1956
|
+
const strayBooleanToken = excessOperands.find((token) => {
|
|
1957
|
+
const normalized = token.trim().toLowerCase();
|
|
1958
|
+
return BOOLEAN_TRUE_TOKENS.has(normalized) || BOOLEAN_FALSE_TOKENS.has(normalized);
|
|
1959
|
+
});
|
|
1960
|
+
if (strayBooleanToken === void 0) return message;
|
|
1961
|
+
const usedBooleanFlag = booleanFlags2.find(
|
|
1962
|
+
(flag) => [flag.attributeName, flag.negationKebab].filter((name) => name !== void 0).some(
|
|
1963
|
+
(name) => command.getOptionValueSource(kebabToCamelCase(name)) === "cli"
|
|
1964
|
+
)
|
|
1965
|
+
);
|
|
1966
|
+
if (usedBooleanFlag === void 0) return message;
|
|
1967
|
+
return `${message}
|
|
1968
|
+
(Boolean flags take no value, so '${strayBooleanToken}' was read as an extra argument: ${booleanFlagUsageHint(usedBooleanFlag)}.)`;
|
|
1969
|
+
}
|
|
1970
|
+
return message;
|
|
1971
|
+
}
|
|
1837
1972
|
function convertCliArgsToSdkParams(parameters, positionalArgs, options) {
|
|
1838
1973
|
const sdkParams = {};
|
|
1839
1974
|
let argIndex = 0;
|
|
1840
1975
|
parameters.forEach((param) => {
|
|
1841
1976
|
if (takesPositionalSlot(param) && argIndex < positionalArgs.length) {
|
|
1977
|
+
const positionalValue = positionalArgs[argIndex];
|
|
1978
|
+
argIndex++;
|
|
1979
|
+
if (Array.isArray(positionalValue) && positionalValue.length === 0) {
|
|
1980
|
+
return;
|
|
1981
|
+
}
|
|
1842
1982
|
sdkParams[param.name] = convertValue(
|
|
1843
|
-
|
|
1983
|
+
positionalValue,
|
|
1844
1984
|
param.type,
|
|
1845
1985
|
param.elementType
|
|
1846
1986
|
);
|
|
1847
|
-
argIndex++;
|
|
1848
1987
|
}
|
|
1849
1988
|
});
|
|
1850
1989
|
Object.entries(options).forEach(([key, value]) => {
|
|
1851
1990
|
const camelKey = key.replace(/-([a-z])/g, (g) => g[1].toUpperCase());
|
|
1852
1991
|
const param = parameters.find((p) => p.name === camelKey);
|
|
1992
|
+
if (param === void 0 && value === true) {
|
|
1993
|
+
const antonymTarget = parameters.find(
|
|
1994
|
+
(p) => antonymAttributeName(p) === camelKey
|
|
1995
|
+
);
|
|
1996
|
+
if (antonymTarget && sdkParams[antonymTarget.name] === void 0) {
|
|
1997
|
+
sdkParams[antonymTarget.name] = false;
|
|
1998
|
+
}
|
|
1999
|
+
return;
|
|
2000
|
+
}
|
|
1853
2001
|
if (param && value !== void 0) {
|
|
1854
2002
|
if (sdkParams[camelKey] !== void 0) {
|
|
1855
2003
|
return;
|
|
@@ -1862,6 +2010,16 @@ function convertCliArgsToSdkParams(parameters, positionalArgs, options) {
|
|
|
1862
2010
|
});
|
|
1863
2011
|
return sdkParams;
|
|
1864
2012
|
}
|
|
2013
|
+
var BOOLEAN_TRUE_TOKENS = /* @__PURE__ */ new Set(["true", "1", "yes", "y", "on"]);
|
|
2014
|
+
var BOOLEAN_FALSE_TOKENS = /* @__PURE__ */ new Set(["false", "0", "no", "n", "off"]);
|
|
2015
|
+
function parseCliBoolean(value) {
|
|
2016
|
+
const normalized = value.trim().toLowerCase();
|
|
2017
|
+
if (BOOLEAN_TRUE_TOKENS.has(normalized)) return true;
|
|
2018
|
+
if (BOOLEAN_FALSE_TOKENS.has(normalized)) return false;
|
|
2019
|
+
throw new commander.InvalidArgumentError(
|
|
2020
|
+
`Expected a boolean (true or false), received "${value}".`
|
|
2021
|
+
);
|
|
2022
|
+
}
|
|
1865
2023
|
function convertValue(value, type, elementType) {
|
|
1866
2024
|
if (value === void 0) {
|
|
1867
2025
|
return void 0;
|
|
@@ -1870,7 +2028,7 @@ function convertValue(value, type, elementType) {
|
|
|
1870
2028
|
case "number":
|
|
1871
2029
|
return Number(value);
|
|
1872
2030
|
case "boolean":
|
|
1873
|
-
return Boolean(value);
|
|
2031
|
+
return typeof value === "string" ? parseCliBoolean(value) : Boolean(value);
|
|
1874
2032
|
case "array": {
|
|
1875
2033
|
const arr = Array.isArray(value) ? value : [value];
|
|
1876
2034
|
if (elementType !== "object") return arr;
|
|
@@ -8183,7 +8341,7 @@ function buildBoxLines(message) {
|
|
|
8183
8341
|
// package.json with { type: 'json' }
|
|
8184
8342
|
var package_default2 = {
|
|
8185
8343
|
name: "@zapier/zapier-sdk-cli",
|
|
8186
|
-
version: "0.
|
|
8344
|
+
version: "0.70.0"};
|
|
8187
8345
|
|
|
8188
8346
|
// src/sdk.ts
|
|
8189
8347
|
var warnedDeprecatedMethods = /* @__PURE__ */ new Set();
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { Command, CommanderError, Option } from 'commander';
|
|
3
|
-
import { getConnectionPlugin, defineMethod, apiPluginRef, resolveCredentialsPluginRef, eventEmissionPluginRef, sdkOptionsPluginRef, declareOptionalProperty, OutputPropertySchema, ZapierBundleError, isZapierBundleError, DEFAULT_CONFIG_PATH, declareMethod, ZapierValidationError, isZapierValidationError, ZapierUnknownError, manifestPluginRef, defineResolver, isPermanentHttpError, isZapierAuthenticationError, ZapierApiError, defineMethodOverride, zapierCoreOptions, injectCliLogin, definePlugin, omitExports, zapierSdkPlugin, BaseSdkOptionsSchema, disposeSdk, invalidateCachedToken, batch, toSnakeCase, ZapierError, isZapierReleaseTriggerMessageSignal, createSdk as createSdk$1, CORE_OPTIONS_ID as CORE_OPTIONS_ID$1, SDK_OPTIONS_ID as SDK_OPTIONS_ID$1, addPlugin as addPlugin$1, getOrCreateApiClient, isCredentialsObject, getRegistryPlugin, createController, ZapierAbortDrainSignal, ZapierReleaseTriggerMessageSignal, buildApplicationLifecycleEvent, AuthMechanism, DEPRECATION_NOTICE_EVENT, runWithCallerContext, isCoreCancelledSignal, isPositional, resolvePlugin, isZapierError, formatErrorMessage, getOsInfo, getPlatformVersions, getAgent, getTtyContext, getCiPlatform, isCi, isZapierConflictError, getReleaseId, getCurrentTimestamp, generateEventId, isZapierApprovalError, ZapierAuthenticationError } from '@zapier/zapier-sdk';
|
|
2
|
+
import { Command, CommanderError, Option, InvalidArgumentError } from 'commander';
|
|
3
|
+
import { getConnectionPlugin, defineMethod, apiPluginRef, resolveCredentialsPluginRef, eventEmissionPluginRef, sdkOptionsPluginRef, declareOptionalProperty, OutputPropertySchema, ZapierBundleError, isZapierBundleError, DEFAULT_CONFIG_PATH, declareMethod, ZapierValidationError, isZapierValidationError, ZapierUnknownError, manifestPluginRef, defineResolver, isPermanentHttpError, isZapierAuthenticationError, ZapierApiError, defineMethodOverride, zapierCoreOptions, injectCliLogin, definePlugin, omitExports, zapierSdkPlugin, BaseSdkOptionsSchema, disposeSdk, invalidateCachedToken, batch, toSnakeCase, ZapierError, isZapierReleaseTriggerMessageSignal, createSdk as createSdk$1, CORE_OPTIONS_ID as CORE_OPTIONS_ID$1, SDK_OPTIONS_ID as SDK_OPTIONS_ID$1, addPlugin as addPlugin$1, getOrCreateApiClient, isCredentialsObject, getRegistryPlugin, createController, ZapierAbortDrainSignal, ZapierReleaseTriggerMessageSignal, buildApplicationLifecycleEvent, AuthMechanism, DEPRECATION_NOTICE_EVENT, runWithCallerContext, isCoreCancelledSignal, getNegatable, isPositional, resolvePlugin, isZapierError, formatErrorMessage, getOsInfo, getPlatformVersions, getAgent, getTtyContext, getCiPlatform, isCi, isZapierConflictError, getReleaseId, getCurrentTimestamp, generateEventId, isZapierApprovalError, ZapierAuthenticationError } from '@zapier/zapier-sdk';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import inquirer from 'inquirer';
|
|
6
6
|
import chalk8 from 'chalk';
|
|
@@ -558,7 +558,7 @@ var SHARED_COMMAND_CLI_OPTIONS = [
|
|
|
558
558
|
|
|
559
559
|
// package.json
|
|
560
560
|
var package_default = {
|
|
561
|
-
version: "0.
|
|
561
|
+
version: "0.70.0"};
|
|
562
562
|
var PACKAGE_MANAGERS = ["npm", "pnpm", "yarn", "bun"];
|
|
563
563
|
var LOCKFILES = [
|
|
564
564
|
["pnpm-lock.yaml", "pnpm"],
|
|
@@ -822,6 +822,9 @@ function formatItemsGeneric(items, startingNumber = 0) {
|
|
|
822
822
|
function toKebabCase(str) {
|
|
823
823
|
return str.replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").replace(/([a-z\d])([A-Z])/g, "$1-$2").toLowerCase();
|
|
824
824
|
}
|
|
825
|
+
function kebabToCamelCase(str) {
|
|
826
|
+
return str.replace(/-([a-z])/g, (match) => match[1].toUpperCase());
|
|
827
|
+
}
|
|
825
828
|
function formatMissingParamsError(error) {
|
|
826
829
|
return [
|
|
827
830
|
"Missing required parameters:",
|
|
@@ -1217,6 +1220,18 @@ function resolveOutputMode({
|
|
|
1217
1220
|
if (hasUserSpecifiedMaxItems) return "collect";
|
|
1218
1221
|
return "paginate";
|
|
1219
1222
|
}
|
|
1223
|
+
function negationKebabName(param) {
|
|
1224
|
+
if (param.negatable === true) return `no-${toKebabCase(param.name)}`;
|
|
1225
|
+
if (typeof param.negatable === "string") return toKebabCase(param.negatable);
|
|
1226
|
+
return void 0;
|
|
1227
|
+
}
|
|
1228
|
+
function antonymAttributeName(param) {
|
|
1229
|
+
const negationKebab = negationKebabName(param);
|
|
1230
|
+
if (negationKebab === void 0 || negationKebab.startsWith("no-")) {
|
|
1231
|
+
return void 0;
|
|
1232
|
+
}
|
|
1233
|
+
return kebabToCamelCase(negationKebab);
|
|
1234
|
+
}
|
|
1220
1235
|
function takesPositionalSlot(param) {
|
|
1221
1236
|
return param.required || !!param.isPositional && !param.isDeprecated && !param.isAlias;
|
|
1222
1237
|
}
|
|
@@ -1329,7 +1344,8 @@ function analyzeZodField(name, schema) {
|
|
|
1329
1344
|
isPositional: isPositional(schema),
|
|
1330
1345
|
elementType,
|
|
1331
1346
|
deprecationMessage,
|
|
1332
|
-
isDeprecated
|
|
1347
|
+
isDeprecated,
|
|
1348
|
+
negatable: getNegatable(schema)
|
|
1333
1349
|
};
|
|
1334
1350
|
}
|
|
1335
1351
|
function positionalProjection(schema, positional) {
|
|
@@ -1714,15 +1730,25 @@ function collect(value, previous = []) {
|
|
|
1714
1730
|
return previous;
|
|
1715
1731
|
}
|
|
1716
1732
|
function addCommand(program2, commandName, config2) {
|
|
1717
|
-
const command = program2.command(commandName, { hidden: config2.hidden ?? false }).description(config2.description);
|
|
1733
|
+
const command = program2.command(commandName, { hidden: config2.hidden ?? false }).description(config2.description).allowExcessArguments(false);
|
|
1718
1734
|
let hasPositionalArray = false;
|
|
1735
|
+
const lastPositionalParamName = [...config2.parameters].reverse().find(takesPositionalSlot)?.name;
|
|
1736
|
+
const booleanFlags2 = [];
|
|
1719
1737
|
config2.parameters.forEach((param) => {
|
|
1720
1738
|
const kebabName = toKebabCase(param.name);
|
|
1721
1739
|
if (param.promptable && param.required) {
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1740
|
+
if (param.type === "array" && !hasPositionalArray && param.name === lastPositionalParamName) {
|
|
1741
|
+
hasPositionalArray = true;
|
|
1742
|
+
command.argument(
|
|
1743
|
+
`[${kebabName}...]`,
|
|
1744
|
+
param.description || `${kebabName} parameter`
|
|
1745
|
+
);
|
|
1746
|
+
} else {
|
|
1747
|
+
command.argument(
|
|
1748
|
+
`[${kebabName}]`,
|
|
1749
|
+
param.description || `${kebabName} parameter`
|
|
1750
|
+
);
|
|
1751
|
+
}
|
|
1726
1752
|
} else if (param.required && param.type === "array" && !hasPositionalArray) {
|
|
1727
1753
|
hasPositionalArray = true;
|
|
1728
1754
|
command.argument(
|
|
@@ -1759,6 +1785,24 @@ function addCommand(program2, commandName, config2) {
|
|
|
1759
1785
|
const opt = new Option(flags.join(", "), param.description);
|
|
1760
1786
|
if (param.isDeprecated) opt.hideHelp();
|
|
1761
1787
|
command.addOption(opt);
|
|
1788
|
+
const negationKebab = negationKebabName(param);
|
|
1789
|
+
if (negationKebab !== void 0) {
|
|
1790
|
+
const negation = new Option(
|
|
1791
|
+
`--${negationKebab}`,
|
|
1792
|
+
`Disable --${kebabName}`
|
|
1793
|
+
);
|
|
1794
|
+
if (!negationKebab.startsWith("no-")) {
|
|
1795
|
+
negation.conflicts(param.name);
|
|
1796
|
+
}
|
|
1797
|
+
if (param.isDeprecated) negation.hideHelp();
|
|
1798
|
+
command.addOption(negation);
|
|
1799
|
+
}
|
|
1800
|
+
booleanFlags2.push({
|
|
1801
|
+
kebabName,
|
|
1802
|
+
attributeName: param.name,
|
|
1803
|
+
negationKebab,
|
|
1804
|
+
shortAlias: alias && alias.length === 1 ? alias : void 0
|
|
1805
|
+
});
|
|
1762
1806
|
} else if (param.type === "array") {
|
|
1763
1807
|
const flagSignature = flags.join(", ") + ` <value>`;
|
|
1764
1808
|
const opt = new Option(flagSignature, param.description || "");
|
|
@@ -1788,24 +1832,128 @@ function addCommand(program2, commandName, config2) {
|
|
|
1788
1832
|
if (config2.supportsJsonOutput === false && opt.name === "json") return;
|
|
1789
1833
|
command.option(opt.flag, opt.description);
|
|
1790
1834
|
});
|
|
1835
|
+
if (booleanFlags2.length > 0) {
|
|
1836
|
+
addBooleanFlagErrorHints({ command, booleanFlags: booleanFlags2 });
|
|
1837
|
+
rejectBooleanFlagValues({ command, booleanFlags: booleanFlags2 });
|
|
1838
|
+
}
|
|
1791
1839
|
command.action(config2.handler);
|
|
1792
1840
|
}
|
|
1841
|
+
function booleanFlagUsageHint(flag) {
|
|
1842
|
+
return flag.negationKebab !== void 0 ? `use --${flag.kebabName} to enable or --${flag.negationKebab} to disable` : `pass --${flag.kebabName} to enable or omit it`;
|
|
1843
|
+
}
|
|
1844
|
+
function addBooleanFlagErrorHints({
|
|
1845
|
+
command,
|
|
1846
|
+
booleanFlags: booleanFlags2
|
|
1847
|
+
}) {
|
|
1848
|
+
const originalError = command.error.bind(command);
|
|
1849
|
+
command.error = (message, errorOptions) => originalError(
|
|
1850
|
+
appendBooleanFlagHint({
|
|
1851
|
+
message,
|
|
1852
|
+
code: errorOptions?.code,
|
|
1853
|
+
command,
|
|
1854
|
+
booleanFlags: booleanFlags2
|
|
1855
|
+
}),
|
|
1856
|
+
errorOptions
|
|
1857
|
+
);
|
|
1858
|
+
}
|
|
1859
|
+
function rejectBooleanFlagValues({
|
|
1860
|
+
command,
|
|
1861
|
+
booleanFlags: booleanFlags2
|
|
1862
|
+
}) {
|
|
1863
|
+
command.hook("preAction", (_thisCommand, actionCommand) => {
|
|
1864
|
+
let root = actionCommand;
|
|
1865
|
+
while (root.parent) root = root.parent;
|
|
1866
|
+
const { rawArgs } = root;
|
|
1867
|
+
const terminatorIndex = rawArgs.indexOf("--");
|
|
1868
|
+
const tokens = terminatorIndex === -1 ? rawArgs : rawArgs.slice(0, terminatorIndex);
|
|
1869
|
+
for (const flag of booleanFlags2) {
|
|
1870
|
+
const spellings = new Set(
|
|
1871
|
+
[
|
|
1872
|
+
`--${flag.kebabName}`,
|
|
1873
|
+
flag.negationKebab === void 0 ? void 0 : `--${flag.negationKebab}`,
|
|
1874
|
+
flag.shortAlias === void 0 ? void 0 : `-${flag.shortAlias}`
|
|
1875
|
+
].filter((spelling) => spelling !== void 0)
|
|
1876
|
+
);
|
|
1877
|
+
for (let i = 0; i < tokens.length - 1; i++) {
|
|
1878
|
+
if (!spellings.has(tokens[i])) continue;
|
|
1879
|
+
const next = tokens[i + 1].trim().toLowerCase();
|
|
1880
|
+
if (!BOOLEAN_TRUE_TOKENS.has(next) && !BOOLEAN_FALSE_TOKENS.has(next)) {
|
|
1881
|
+
continue;
|
|
1882
|
+
}
|
|
1883
|
+
actionCommand.error(
|
|
1884
|
+
`error: ${tokens[i]} is a boolean flag and takes no value, but was followed by '${tokens[i + 1]}': ${booleanFlagUsageHint(flag)}.`,
|
|
1885
|
+
{ code: "zapierSdk.booleanFlagValue" }
|
|
1886
|
+
);
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
});
|
|
1890
|
+
}
|
|
1891
|
+
function appendBooleanFlagHint({
|
|
1892
|
+
message,
|
|
1893
|
+
code,
|
|
1894
|
+
command,
|
|
1895
|
+
booleanFlags: booleanFlags2
|
|
1896
|
+
}) {
|
|
1897
|
+
if (code === "commander.unknownOption") {
|
|
1898
|
+
const flagWithValue = message.match(/'--([^=']+)=/);
|
|
1899
|
+
if (!flagWithValue) return message;
|
|
1900
|
+
const typedName = flagWithValue[1];
|
|
1901
|
+
const flag = booleanFlags2.find(
|
|
1902
|
+
(candidate) => candidate.kebabName === typedName || candidate.negationKebab === typedName
|
|
1903
|
+
);
|
|
1904
|
+
if (flag === void 0) return message;
|
|
1905
|
+
return `${message}
|
|
1906
|
+
(--${typedName} is a boolean flag and takes no value: ${booleanFlagUsageHint(flag)}.)`;
|
|
1907
|
+
}
|
|
1908
|
+
if (code === "commander.excessArguments") {
|
|
1909
|
+
const excessOperands = command.args.slice(
|
|
1910
|
+
command.registeredArguments.length
|
|
1911
|
+
);
|
|
1912
|
+
const strayBooleanToken = excessOperands.find((token) => {
|
|
1913
|
+
const normalized = token.trim().toLowerCase();
|
|
1914
|
+
return BOOLEAN_TRUE_TOKENS.has(normalized) || BOOLEAN_FALSE_TOKENS.has(normalized);
|
|
1915
|
+
});
|
|
1916
|
+
if (strayBooleanToken === void 0) return message;
|
|
1917
|
+
const usedBooleanFlag = booleanFlags2.find(
|
|
1918
|
+
(flag) => [flag.attributeName, flag.negationKebab].filter((name) => name !== void 0).some(
|
|
1919
|
+
(name) => command.getOptionValueSource(kebabToCamelCase(name)) === "cli"
|
|
1920
|
+
)
|
|
1921
|
+
);
|
|
1922
|
+
if (usedBooleanFlag === void 0) return message;
|
|
1923
|
+
return `${message}
|
|
1924
|
+
(Boolean flags take no value, so '${strayBooleanToken}' was read as an extra argument: ${booleanFlagUsageHint(usedBooleanFlag)}.)`;
|
|
1925
|
+
}
|
|
1926
|
+
return message;
|
|
1927
|
+
}
|
|
1793
1928
|
function convertCliArgsToSdkParams(parameters, positionalArgs, options) {
|
|
1794
1929
|
const sdkParams = {};
|
|
1795
1930
|
let argIndex = 0;
|
|
1796
1931
|
parameters.forEach((param) => {
|
|
1797
1932
|
if (takesPositionalSlot(param) && argIndex < positionalArgs.length) {
|
|
1933
|
+
const positionalValue = positionalArgs[argIndex];
|
|
1934
|
+
argIndex++;
|
|
1935
|
+
if (Array.isArray(positionalValue) && positionalValue.length === 0) {
|
|
1936
|
+
return;
|
|
1937
|
+
}
|
|
1798
1938
|
sdkParams[param.name] = convertValue(
|
|
1799
|
-
|
|
1939
|
+
positionalValue,
|
|
1800
1940
|
param.type,
|
|
1801
1941
|
param.elementType
|
|
1802
1942
|
);
|
|
1803
|
-
argIndex++;
|
|
1804
1943
|
}
|
|
1805
1944
|
});
|
|
1806
1945
|
Object.entries(options).forEach(([key, value]) => {
|
|
1807
1946
|
const camelKey = key.replace(/-([a-z])/g, (g) => g[1].toUpperCase());
|
|
1808
1947
|
const param = parameters.find((p) => p.name === camelKey);
|
|
1948
|
+
if (param === void 0 && value === true) {
|
|
1949
|
+
const antonymTarget = parameters.find(
|
|
1950
|
+
(p) => antonymAttributeName(p) === camelKey
|
|
1951
|
+
);
|
|
1952
|
+
if (antonymTarget && sdkParams[antonymTarget.name] === void 0) {
|
|
1953
|
+
sdkParams[antonymTarget.name] = false;
|
|
1954
|
+
}
|
|
1955
|
+
return;
|
|
1956
|
+
}
|
|
1809
1957
|
if (param && value !== void 0) {
|
|
1810
1958
|
if (sdkParams[camelKey] !== void 0) {
|
|
1811
1959
|
return;
|
|
@@ -1818,6 +1966,16 @@ function convertCliArgsToSdkParams(parameters, positionalArgs, options) {
|
|
|
1818
1966
|
});
|
|
1819
1967
|
return sdkParams;
|
|
1820
1968
|
}
|
|
1969
|
+
var BOOLEAN_TRUE_TOKENS = /* @__PURE__ */ new Set(["true", "1", "yes", "y", "on"]);
|
|
1970
|
+
var BOOLEAN_FALSE_TOKENS = /* @__PURE__ */ new Set(["false", "0", "no", "n", "off"]);
|
|
1971
|
+
function parseCliBoolean(value) {
|
|
1972
|
+
const normalized = value.trim().toLowerCase();
|
|
1973
|
+
if (BOOLEAN_TRUE_TOKENS.has(normalized)) return true;
|
|
1974
|
+
if (BOOLEAN_FALSE_TOKENS.has(normalized)) return false;
|
|
1975
|
+
throw new InvalidArgumentError(
|
|
1976
|
+
`Expected a boolean (true or false), received "${value}".`
|
|
1977
|
+
);
|
|
1978
|
+
}
|
|
1821
1979
|
function convertValue(value, type, elementType) {
|
|
1822
1980
|
if (value === void 0) {
|
|
1823
1981
|
return void 0;
|
|
@@ -1826,7 +1984,7 @@ function convertValue(value, type, elementType) {
|
|
|
1826
1984
|
case "number":
|
|
1827
1985
|
return Number(value);
|
|
1828
1986
|
case "boolean":
|
|
1829
|
-
return Boolean(value);
|
|
1987
|
+
return typeof value === "string" ? parseCliBoolean(value) : Boolean(value);
|
|
1830
1988
|
case "array": {
|
|
1831
1989
|
const arr = Array.isArray(value) ? value : [value];
|
|
1832
1990
|
if (elementType !== "object") return arr;
|
|
@@ -8139,7 +8297,7 @@ function buildBoxLines(message) {
|
|
|
8139
8297
|
// package.json with { type: 'json' }
|
|
8140
8298
|
var package_default2 = {
|
|
8141
8299
|
name: "@zapier/zapier-sdk-cli",
|
|
8142
|
-
version: "0.
|
|
8300
|
+
version: "0.70.0"};
|
|
8143
8301
|
|
|
8144
8302
|
// src/sdk.ts
|
|
8145
8303
|
var warnedDeprecatedMethods = /* @__PURE__ */ new Set();
|
package/dist/experimental.cjs
CHANGED
|
@@ -6861,7 +6861,7 @@ function collectDeprecationNoticeAndForward(event, onEvent) {
|
|
|
6861
6861
|
// package.json with { type: 'json' }
|
|
6862
6862
|
var package_default = {
|
|
6863
6863
|
name: "@zapier/zapier-sdk-cli",
|
|
6864
|
-
version: "0.
|
|
6864
|
+
version: "0.70.0"};
|
|
6865
6865
|
|
|
6866
6866
|
// src/sdk.ts
|
|
6867
6867
|
var warnedDeprecatedMethods = /* @__PURE__ */ new Set();
|
package/dist/experimental.mjs
CHANGED
|
@@ -6820,7 +6820,7 @@ function collectDeprecationNoticeAndForward(event, onEvent) {
|
|
|
6820
6820
|
// package.json with { type: 'json' }
|
|
6821
6821
|
var package_default = {
|
|
6822
6822
|
name: "@zapier/zapier-sdk-cli",
|
|
6823
|
-
version: "0.
|
|
6823
|
+
version: "0.70.0"};
|
|
6824
6824
|
|
|
6825
6825
|
// src/sdk.ts
|
|
6826
6826
|
var warnedDeprecatedMethods = /* @__PURE__ */ new Set();
|
package/dist/index.cjs
CHANGED
|
@@ -32,6 +32,7 @@ var crossSpawn = require('cross-spawn');
|
|
|
32
32
|
var wrapAnsi = require('wrap-ansi');
|
|
33
33
|
var Table = require('cli-table3');
|
|
34
34
|
var experimental = require('@zapier/zapier-sdk/experimental');
|
|
35
|
+
require('commander');
|
|
35
36
|
|
|
36
37
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
37
38
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -6861,7 +6862,7 @@ function collectDeprecationNoticeAndForward(event, onEvent) {
|
|
|
6861
6862
|
// package.json with { type: 'json' }
|
|
6862
6863
|
var package_default = {
|
|
6863
6864
|
name: "@zapier/zapier-sdk-cli",
|
|
6864
|
-
version: "0.
|
|
6865
|
+
version: "0.70.0"};
|
|
6865
6866
|
|
|
6866
6867
|
// src/sdk.ts
|
|
6867
6868
|
var warnedDeprecatedMethods = /* @__PURE__ */ new Set();
|
|
@@ -6945,7 +6946,7 @@ function createZapierCliSdk(options = {}) {
|
|
|
6945
6946
|
|
|
6946
6947
|
// package.json
|
|
6947
6948
|
var package_default2 = {
|
|
6948
|
-
version: "0.
|
|
6949
|
+
version: "0.70.0"};
|
|
6949
6950
|
|
|
6950
6951
|
// src/telemetry/builders.ts
|
|
6951
6952
|
function createCliBaseEvent(context = {}) {
|
|
@@ -7037,6 +7038,14 @@ var SHARED_COMMAND_CLI_OPTIONS = [
|
|
|
7037
7038
|
description: "Output raw JSON instead of formatted results"
|
|
7038
7039
|
}
|
|
7039
7040
|
];
|
|
7041
|
+
function negationKebabName(param) {
|
|
7042
|
+
if (param.negatable === true) return `no-${toKebabCase(param.name)}`;
|
|
7043
|
+
if (typeof param.negatable === "string") return toKebabCase(param.negatable);
|
|
7044
|
+
return void 0;
|
|
7045
|
+
}
|
|
7046
|
+
({
|
|
7047
|
+
[zapierSdk.getConnectionPlugin.name]: /* @__PURE__ */ new Set(["connection"])
|
|
7048
|
+
});
|
|
7040
7049
|
|
|
7041
7050
|
exports.RESERVED_CLI_OPTIONS = RESERVED_CLI_OPTIONS;
|
|
7042
7051
|
exports.ReservedCliParameter = ReservedCliParameter;
|
|
@@ -7044,3 +7053,4 @@ exports.SHARED_COMMAND_CLI_OPTIONS = SHARED_COMMAND_CLI_OPTIONS;
|
|
|
7044
7053
|
exports.buildCliCommandExecutedEvent = buildCliCommandExecutedEvent;
|
|
7045
7054
|
exports.createZapierCliSdk = createZapierCliSdk;
|
|
7046
7055
|
exports.getReservedCliOption = getReservedCliOption;
|
|
7056
|
+
exports.negationKebabName = negationKebabName;
|
package/dist/index.d.mts
CHANGED
|
@@ -125,4 +125,15 @@ declare function getReservedCliOption(name: ReservedCliParameter): Readonly<CliO
|
|
|
125
125
|
/** CLI options automatically added to every SDK-generated command. */
|
|
126
126
|
declare const SHARED_COMMAND_CLI_OPTIONS: readonly Readonly<CliOption>[];
|
|
127
127
|
|
|
128
|
-
|
|
128
|
+
/**
|
|
129
|
+
* The kebab-case flag name (without leading dashes) of a boolean param's
|
|
130
|
+
* disable spelling, or undefined when the param's schema doesn't declare
|
|
131
|
+
* `negatable` metadata. Exported for the docs generator, so the CLI's
|
|
132
|
+
* rendering of the metadata lives in one place.
|
|
133
|
+
*/
|
|
134
|
+
declare function negationKebabName(param: {
|
|
135
|
+
name: string;
|
|
136
|
+
negatable?: true | string;
|
|
137
|
+
}): string | undefined;
|
|
138
|
+
|
|
139
|
+
export { type CliCommandExecutedEvent, type CliCommandExecutedEventData, type CliEventContext, RESERVED_CLI_OPTIONS, ReservedCliParameter, SHARED_COMMAND_CLI_OPTIONS, type ZapierCliSdkOptions, buildCliCommandExecutedEvent, createZapierCliSdk, getReservedCliOption, negationKebabName };
|
package/dist/index.d.ts
CHANGED
|
@@ -125,4 +125,15 @@ declare function getReservedCliOption(name: ReservedCliParameter): Readonly<CliO
|
|
|
125
125
|
/** CLI options automatically added to every SDK-generated command. */
|
|
126
126
|
declare const SHARED_COMMAND_CLI_OPTIONS: readonly Readonly<CliOption>[];
|
|
127
127
|
|
|
128
|
-
|
|
128
|
+
/**
|
|
129
|
+
* The kebab-case flag name (without leading dashes) of a boolean param's
|
|
130
|
+
* disable spelling, or undefined when the param's schema doesn't declare
|
|
131
|
+
* `negatable` metadata. Exported for the docs generator, so the CLI's
|
|
132
|
+
* rendering of the metadata lives in one place.
|
|
133
|
+
*/
|
|
134
|
+
declare function negationKebabName(param: {
|
|
135
|
+
name: string;
|
|
136
|
+
negatable?: true | string;
|
|
137
|
+
}): string | undefined;
|
|
138
|
+
|
|
139
|
+
export { type CliCommandExecutedEvent, type CliCommandExecutedEventData, type CliEventContext, RESERVED_CLI_OPTIONS, ReservedCliParameter, SHARED_COMMAND_CLI_OPTIONS, type ZapierCliSdkOptions, buildCliCommandExecutedEvent, createZapierCliSdk, getReservedCliOption, negationKebabName };
|
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import crypto, { createHash } from 'crypto';
|
|
|
7
7
|
import * as path from 'path';
|
|
8
8
|
import { resolve, join, dirname, basename, relative, extname } from 'path';
|
|
9
9
|
import * as lockfile from 'proper-lockfile';
|
|
10
|
-
import { defineMethod, apiPluginRef, resolveCredentialsPluginRef, eventEmissionPluginRef, sdkOptionsPluginRef, declareOptionalProperty, OutputPropertySchema, ZapierBundleError, isZapierBundleError, DEFAULT_CONFIG_PATH, declareMethod, ZapierValidationError, isZapierValidationError, ZapierUnknownError, manifestPluginRef, defineResolver, isPermanentHttpError, isZapierAuthenticationError, ZapierApiError, defineMethodOverride, zapierCoreOptions, injectCliLogin, definePlugin, omitExports, zapierSdkPlugin, invalidateCachedToken, batch, toSnakeCase, ZapierError, isZapierReleaseTriggerMessageSignal, getOrCreateApiClient, isCredentialsObject, createSdk, getRegistryPlugin, createController, ZapierAbortDrainSignal, ZapierReleaseTriggerMessageSignal, buildApplicationLifecycleEvent, AuthMechanism, isCoreCancelledSignal, ZapierAuthenticationError, CORE_OPTIONS_ID, SDK_OPTIONS_ID, addPlugin, getOsInfo, getPlatformVersions, getAgent, getTtyContext, getCiPlatform, isCi, getReleaseId, getCurrentTimestamp, generateEventId, DEPRECATION_NOTICE_EVENT } from '@zapier/zapier-sdk';
|
|
10
|
+
import { defineMethod, apiPluginRef, resolveCredentialsPluginRef, eventEmissionPluginRef, sdkOptionsPluginRef, declareOptionalProperty, OutputPropertySchema, ZapierBundleError, isZapierBundleError, DEFAULT_CONFIG_PATH, declareMethod, ZapierValidationError, isZapierValidationError, ZapierUnknownError, manifestPluginRef, defineResolver, isPermanentHttpError, isZapierAuthenticationError, ZapierApiError, defineMethodOverride, zapierCoreOptions, injectCliLogin, definePlugin, omitExports, zapierSdkPlugin, getConnectionPlugin, invalidateCachedToken, batch, toSnakeCase, ZapierError, isZapierReleaseTriggerMessageSignal, getOrCreateApiClient, isCredentialsObject, createSdk, getRegistryPlugin, createController, ZapierAbortDrainSignal, ZapierReleaseTriggerMessageSignal, buildApplicationLifecycleEvent, AuthMechanism, isCoreCancelledSignal, ZapierAuthenticationError, CORE_OPTIONS_ID, SDK_OPTIONS_ID, addPlugin, getOsInfo, getPlatformVersions, getAgent, getTtyContext, getCiPlatform, isCi, getReleaseId, getCurrentTimestamp, generateEventId, DEPRECATION_NOTICE_EVENT } from '@zapier/zapier-sdk';
|
|
11
11
|
import { z } from 'zod';
|
|
12
12
|
import chalk3 from 'chalk';
|
|
13
13
|
import { hostname } from 'os';
|
|
@@ -32,6 +32,7 @@ import crossSpawn from 'cross-spawn';
|
|
|
32
32
|
import wrapAnsi from 'wrap-ansi';
|
|
33
33
|
import Table from 'cli-table3';
|
|
34
34
|
import { triggerInboxResolver, DrainTriggerInboxSchema, WatchTriggerInboxSchema } from '@zapier/zapier-sdk/experimental';
|
|
35
|
+
import 'commander';
|
|
35
36
|
|
|
36
37
|
var __defProp = Object.defineProperty;
|
|
37
38
|
var __export = (target, all) => {
|
|
@@ -6820,7 +6821,7 @@ function collectDeprecationNoticeAndForward(event, onEvent) {
|
|
|
6820
6821
|
// package.json with { type: 'json' }
|
|
6821
6822
|
var package_default = {
|
|
6822
6823
|
name: "@zapier/zapier-sdk-cli",
|
|
6823
|
-
version: "0.
|
|
6824
|
+
version: "0.70.0"};
|
|
6824
6825
|
|
|
6825
6826
|
// src/sdk.ts
|
|
6826
6827
|
var warnedDeprecatedMethods = /* @__PURE__ */ new Set();
|
|
@@ -6904,7 +6905,7 @@ function createZapierCliSdk(options = {}) {
|
|
|
6904
6905
|
|
|
6905
6906
|
// package.json
|
|
6906
6907
|
var package_default2 = {
|
|
6907
|
-
version: "0.
|
|
6908
|
+
version: "0.70.0"};
|
|
6908
6909
|
|
|
6909
6910
|
// src/telemetry/builders.ts
|
|
6910
6911
|
function createCliBaseEvent(context = {}) {
|
|
@@ -6996,5 +6997,13 @@ var SHARED_COMMAND_CLI_OPTIONS = [
|
|
|
6996
6997
|
description: "Output raw JSON instead of formatted results"
|
|
6997
6998
|
}
|
|
6998
6999
|
];
|
|
7000
|
+
function negationKebabName(param) {
|
|
7001
|
+
if (param.negatable === true) return `no-${toKebabCase(param.name)}`;
|
|
7002
|
+
if (typeof param.negatable === "string") return toKebabCase(param.negatable);
|
|
7003
|
+
return void 0;
|
|
7004
|
+
}
|
|
7005
|
+
({
|
|
7006
|
+
[getConnectionPlugin.name]: /* @__PURE__ */ new Set(["connection"])
|
|
7007
|
+
});
|
|
6999
7008
|
|
|
7000
|
-
export { RESERVED_CLI_OPTIONS, ReservedCliParameter, SHARED_COMMAND_CLI_OPTIONS, buildCliCommandExecutedEvent, createZapierCliSdk, getReservedCliOption };
|
|
7009
|
+
export { RESERVED_CLI_OPTIONS, ReservedCliParameter, SHARED_COMMAND_CLI_OPTIONS, buildCliCommandExecutedEvent, createZapierCliSdk, getReservedCliOption, negationKebabName };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zapier/zapier-sdk-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.70.0",
|
|
4
4
|
"description": "Command line interface for Zapier SDK",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -95,8 +95,8 @@
|
|
|
95
95
|
"typescript": "^5.8.3",
|
|
96
96
|
"wrap-ansi": "^10.0.0",
|
|
97
97
|
"zod": "4.3.6",
|
|
98
|
-
"@zapier/zapier-sdk": "0.
|
|
99
|
-
"@zapier/zapier-sdk-mcp": "0.18.
|
|
98
|
+
"@zapier/zapier-sdk": "0.93.0",
|
|
99
|
+
"@zapier/zapier-sdk-mcp": "0.18.23"
|
|
100
100
|
},
|
|
101
101
|
"devDependencies": {
|
|
102
102
|
"@types/cross-spawn": "^6.0.6",
|