@zapier/zapier-sdk-cli 0.71.0 → 0.72.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 CHANGED
@@ -1,5 +1,30 @@
1
1
  # @zapier/zapier-sdk-cli
2
2
 
3
+ ## 0.72.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 6e5189c: Added a `manual` option (experimental) to `publishWorkflowVersion`, exposed in the CLI as `--manual` on `publish-workflow-version`. Pass `manual: true` to publish an on-demand, triggerless workflow version explicitly; pass `trigger` for a triggered one. The two are mutually exclusive — sending both is rejected with a 400.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [80dc74a]
12
+ - Updated dependencies [6e5189c]
13
+ - @zapier/zapier-sdk@0.95.0
14
+ - @zapier/zapier-sdk-mcp@0.19.2
15
+
16
+ ## 0.71.1
17
+
18
+ ### Patch Changes
19
+
20
+ - 0f54b24: CLI commands with an object-typed parameter (e.g. `run-durable`'s `<source-files>`, or an array-of-object parameter like its `notifications`) now reject invalid input with a clear error naming the parameter, instead of silently passing it through to a confusing downstream validation error like `expected record, received string`:
21
+ - A string that isn't valid JSON reports the parse failure. A value that looks like a file path (contains a slash or ends in `.ts`/`.js`/`.tsx`/`.jsx`/`.json`) gets an additional hint that a JSON value was expected, not a path on disk.
22
+ - A string that parses as valid JSON but isn't an object (e.g. `42`, `true`, `null`) is also rejected, since it can never satisfy an object-shaped parameter.
23
+
24
+ - Updated dependencies [59a8180]
25
+ - @zapier/zapier-sdk@0.94.1
26
+ - @zapier/zapier-sdk-mcp@0.19.1
27
+
3
28
  ## 0.71.0
4
29
 
5
30
  ### Minor Changes
package/README.md CHANGED
@@ -874,16 +874,17 @@ Publish a new version of a durable workflow. Enables the workflow by default.
874
874
  | `--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. |
875
875
  | `--connections` | `object` | ❌ | — | — | Map of connection aliases to Zapier connections used by the workflow. Pass `null` to clear an existing binding. |
876
876
  | `--app-versions` | `object` | ❌ | — | — | Map of app keys to pinned app implementation/version used by the workflow. Pass `null` to clear an existing binding. |
877
- | `--trigger` | `object` | ❌ | — | — | Trigger configuration. When provided, the workflow subscribes to a Zapier trigger; omit for webhook-only workflows. |
877
+ | `--trigger` | `object` | ❌ | — | — | Trigger configuration. When provided, the workflow subscribes to a Zapier trigger; for an on-demand, triggerless workflow, omit this and pass `manual: true` instead. |
878
878
  | ​ ↳ `selectedApi` | `string` | ❌ | — | — | Zapier app/API identifier (e.g. 'GoogleSheetsAPI'). Required when a trigger is configured. |
879
879
  | ​ ↳ `action` | `string` | ✅ | — | — | Trigger action key (e.g. 'new_row') |
880
880
  | ​ ↳ `authenticationId` | `string` | ❌ | — | — | Connection ID for the trigger source. Omit or pass null for no-auth triggers (e.g. Schedule by Zapier). |
881
881
  | ​ ↳ `params` | `object` | ❌ | — | — | Trigger parameters as a JSON object |
882
+ | `--manual` | `boolean` | ❌ | — | — | Declare this an on-demand, triggerless workflow version. Pass `manual: true` only when omitting `trigger`; passing both is a contradiction the API rejects with a 400. |
882
883
 
883
884
  **Usage:**
884
885
 
885
886
  ```bash
886
- npx zapier-sdk publish-workflow-version <workflow> <source-files> [--dependencies] [--zapier-durable-version] [--enabled] [--ignore-open-drafts] [--connections] [--app-versions] [--trigger]
887
+ npx zapier-sdk publish-workflow-version <workflow> <source-files> [--dependencies] [--zapier-durable-version] [--enabled] [--ignore-open-drafts] [--connections] [--app-versions] [--trigger] [--manual]
887
888
  ```
888
889
 
889
890
  #### `run-durable` 🧪 _experimental_
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.71.0"};
605
+ version: "0.72.0"};
606
606
  var PACKAGE_MANAGERS = ["npm", "pnpm", "yarn", "bun"];
607
607
  var LOCKFILES = [
608
608
  ["pnpm-lock.yaml", "pnpm"],
@@ -1982,7 +1982,8 @@ function convertCliArgsToSdkParams(parameters, positionalArgs, options) {
1982
1982
  sdkParams[param.name] = convertValue(
1983
1983
  positionalValue,
1984
1984
  param.type,
1985
- param.elementType
1985
+ param.elementType,
1986
+ param.name
1986
1987
  );
1987
1988
  }
1988
1989
  });
@@ -2005,7 +2006,12 @@ function convertCliArgsToSdkParams(parameters, positionalArgs, options) {
2005
2006
  if (param.type === "array" && Array.isArray(value) && value.length === 0) {
2006
2007
  return;
2007
2008
  }
2008
- sdkParams[camelKey] = convertValue(value, param.type, param.elementType);
2009
+ sdkParams[camelKey] = convertValue(
2010
+ value,
2011
+ param.type,
2012
+ param.elementType,
2013
+ param.name
2014
+ );
2009
2015
  }
2010
2016
  });
2011
2017
  return sdkParams;
@@ -2020,7 +2026,28 @@ function parseCliBoolean(value) {
2020
2026
  `Expected a boolean (true or false), received "${value}".`
2021
2027
  );
2022
2028
  }
2023
- function convertValue(value, type, elementType) {
2029
+ function looksLikeFilePath(value) {
2030
+ return /[/\\]/.test(value) || /\.(ts|js|tsx|jsx|json)$/i.test(value);
2031
+ }
2032
+ function parseJsonParameter(value, paramName) {
2033
+ let parsed;
2034
+ try {
2035
+ parsed = JSON.parse(value);
2036
+ } catch (error) {
2037
+ const parseErrorMessage = error instanceof Error ? error.message : String(error);
2038
+ const pathHint = looksLikeFilePath(value) ? ` "${value}" looks like a file path \u2014 this parameter expects a JSON value (e.g. an object), not a path on disk.` : "";
2039
+ throw new commander.InvalidArgumentError(
2040
+ `Parameter "${paramName}" expects JSON, but the value could not be parsed: ${parseErrorMessage}.${pathHint}`
2041
+ );
2042
+ }
2043
+ if (typeof parsed !== "object" || parsed === null) {
2044
+ throw new commander.InvalidArgumentError(
2045
+ `Parameter "${paramName}" expects a JSON object, but got: ${value}.`
2046
+ );
2047
+ }
2048
+ return parsed;
2049
+ }
2050
+ function convertValue(value, type, elementType, paramName) {
2024
2051
  if (value === void 0) {
2025
2052
  return void 0;
2026
2053
  }
@@ -2033,12 +2060,8 @@ function convertValue(value, type, elementType) {
2033
2060
  const arr = Array.isArray(value) ? value : [value];
2034
2061
  if (elementType !== "object") return arr;
2035
2062
  return arr.flatMap((item) => {
2036
- if (typeof item === "string" && (item.startsWith("{") || item.startsWith("["))) {
2037
- try {
2038
- return JSON.parse(item);
2039
- } catch {
2040
- return item;
2041
- }
2063
+ if (typeof item === "string") {
2064
+ return parseJsonParameter(item, paramName ?? "value");
2042
2065
  }
2043
2066
  return item;
2044
2067
  });
@@ -2047,11 +2070,7 @@ function convertValue(value, type, elementType) {
2047
2070
  return value;
2048
2071
  case "object":
2049
2072
  if (typeof value === "string") {
2050
- try {
2051
- return JSON.parse(value);
2052
- } catch {
2053
- return value;
2054
- }
2073
+ return parseJsonParameter(value, paramName ?? "value");
2055
2074
  }
2056
2075
  return value;
2057
2076
  default:
@@ -8341,7 +8360,7 @@ function buildBoxLines(message) {
8341
8360
  // package.json with { type: 'json' }
8342
8361
  var package_default2 = {
8343
8362
  name: "@zapier/zapier-sdk-cli",
8344
- version: "0.71.0"};
8363
+ version: "0.72.0"};
8345
8364
 
8346
8365
  // src/sdk.ts
8347
8366
  var warnedDeprecatedMethods = /* @__PURE__ */ new Set();
package/dist/cli.mjs CHANGED
@@ -558,7 +558,7 @@ var SHARED_COMMAND_CLI_OPTIONS = [
558
558
 
559
559
  // package.json
560
560
  var package_default = {
561
- version: "0.71.0"};
561
+ version: "0.72.0"};
562
562
  var PACKAGE_MANAGERS = ["npm", "pnpm", "yarn", "bun"];
563
563
  var LOCKFILES = [
564
564
  ["pnpm-lock.yaml", "pnpm"],
@@ -1938,7 +1938,8 @@ function convertCliArgsToSdkParams(parameters, positionalArgs, options) {
1938
1938
  sdkParams[param.name] = convertValue(
1939
1939
  positionalValue,
1940
1940
  param.type,
1941
- param.elementType
1941
+ param.elementType,
1942
+ param.name
1942
1943
  );
1943
1944
  }
1944
1945
  });
@@ -1961,7 +1962,12 @@ function convertCliArgsToSdkParams(parameters, positionalArgs, options) {
1961
1962
  if (param.type === "array" && Array.isArray(value) && value.length === 0) {
1962
1963
  return;
1963
1964
  }
1964
- sdkParams[camelKey] = convertValue(value, param.type, param.elementType);
1965
+ sdkParams[camelKey] = convertValue(
1966
+ value,
1967
+ param.type,
1968
+ param.elementType,
1969
+ param.name
1970
+ );
1965
1971
  }
1966
1972
  });
1967
1973
  return sdkParams;
@@ -1976,7 +1982,28 @@ function parseCliBoolean(value) {
1976
1982
  `Expected a boolean (true or false), received "${value}".`
1977
1983
  );
1978
1984
  }
1979
- function convertValue(value, type, elementType) {
1985
+ function looksLikeFilePath(value) {
1986
+ return /[/\\]/.test(value) || /\.(ts|js|tsx|jsx|json)$/i.test(value);
1987
+ }
1988
+ function parseJsonParameter(value, paramName) {
1989
+ let parsed;
1990
+ try {
1991
+ parsed = JSON.parse(value);
1992
+ } catch (error) {
1993
+ const parseErrorMessage = error instanceof Error ? error.message : String(error);
1994
+ const pathHint = looksLikeFilePath(value) ? ` "${value}" looks like a file path \u2014 this parameter expects a JSON value (e.g. an object), not a path on disk.` : "";
1995
+ throw new InvalidArgumentError(
1996
+ `Parameter "${paramName}" expects JSON, but the value could not be parsed: ${parseErrorMessage}.${pathHint}`
1997
+ );
1998
+ }
1999
+ if (typeof parsed !== "object" || parsed === null) {
2000
+ throw new InvalidArgumentError(
2001
+ `Parameter "${paramName}" expects a JSON object, but got: ${value}.`
2002
+ );
2003
+ }
2004
+ return parsed;
2005
+ }
2006
+ function convertValue(value, type, elementType, paramName) {
1980
2007
  if (value === void 0) {
1981
2008
  return void 0;
1982
2009
  }
@@ -1989,12 +2016,8 @@ function convertValue(value, type, elementType) {
1989
2016
  const arr = Array.isArray(value) ? value : [value];
1990
2017
  if (elementType !== "object") return arr;
1991
2018
  return arr.flatMap((item) => {
1992
- if (typeof item === "string" && (item.startsWith("{") || item.startsWith("["))) {
1993
- try {
1994
- return JSON.parse(item);
1995
- } catch {
1996
- return item;
1997
- }
2019
+ if (typeof item === "string") {
2020
+ return parseJsonParameter(item, paramName ?? "value");
1998
2021
  }
1999
2022
  return item;
2000
2023
  });
@@ -2003,11 +2026,7 @@ function convertValue(value, type, elementType) {
2003
2026
  return value;
2004
2027
  case "object":
2005
2028
  if (typeof value === "string") {
2006
- try {
2007
- return JSON.parse(value);
2008
- } catch {
2009
- return value;
2010
- }
2029
+ return parseJsonParameter(value, paramName ?? "value");
2011
2030
  }
2012
2031
  return value;
2013
2032
  default:
@@ -8297,7 +8316,7 @@ function buildBoxLines(message) {
8297
8316
  // package.json with { type: 'json' }
8298
8317
  var package_default2 = {
8299
8318
  name: "@zapier/zapier-sdk-cli",
8300
- version: "0.71.0"};
8319
+ version: "0.72.0"};
8301
8320
 
8302
8321
  // src/sdk.ts
8303
8322
  var warnedDeprecatedMethods = /* @__PURE__ */ new Set();
@@ -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.71.0"};
6864
+ version: "0.72.0"};
6865
6865
 
6866
6866
  // src/sdk.ts
6867
6867
  var warnedDeprecatedMethods = /* @__PURE__ */ new Set();
@@ -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.71.0"};
6823
+ version: "0.72.0"};
6824
6824
 
6825
6825
  // src/sdk.ts
6826
6826
  var warnedDeprecatedMethods = /* @__PURE__ */ new Set();
package/dist/index.cjs CHANGED
@@ -6862,7 +6862,7 @@ function collectDeprecationNoticeAndForward(event, onEvent) {
6862
6862
  // package.json with { type: 'json' }
6863
6863
  var package_default = {
6864
6864
  name: "@zapier/zapier-sdk-cli",
6865
- version: "0.71.0"};
6865
+ version: "0.72.0"};
6866
6866
 
6867
6867
  // src/sdk.ts
6868
6868
  var warnedDeprecatedMethods = /* @__PURE__ */ new Set();
@@ -6946,7 +6946,7 @@ function createZapierCliSdk(options = {}) {
6946
6946
 
6947
6947
  // package.json
6948
6948
  var package_default2 = {
6949
- version: "0.71.0"};
6949
+ version: "0.72.0"};
6950
6950
 
6951
6951
  // src/telemetry/builders.ts
6952
6952
  function createCliBaseEvent(context = {}) {
package/dist/index.mjs CHANGED
@@ -6821,7 +6821,7 @@ function collectDeprecationNoticeAndForward(event, onEvent) {
6821
6821
  // package.json with { type: 'json' }
6822
6822
  var package_default = {
6823
6823
  name: "@zapier/zapier-sdk-cli",
6824
- version: "0.71.0"};
6824
+ version: "0.72.0"};
6825
6825
 
6826
6826
  // src/sdk.ts
6827
6827
  var warnedDeprecatedMethods = /* @__PURE__ */ new Set();
@@ -6905,7 +6905,7 @@ function createZapierCliSdk(options = {}) {
6905
6905
 
6906
6906
  // package.json
6907
6907
  var package_default2 = {
6908
- version: "0.71.0"};
6908
+ version: "0.72.0"};
6909
6909
 
6910
6910
  // src/telemetry/builders.ts
6911
6911
  function createCliBaseEvent(context = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk-cli",
3
- "version": "0.71.0",
3
+ "version": "0.72.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.94.0",
99
- "@zapier/zapier-sdk-mcp": "0.19.0"
98
+ "@zapier/zapier-sdk": "0.95.0",
99
+ "@zapier/zapier-sdk-mcp": "0.19.2"
100
100
  },
101
101
  "devDependencies": {
102
102
  "@types/cross-spawn": "^6.0.6",