@zapier/zapier-sdk-cli 0.70.0 → 0.71.1

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,37 @@
1
1
  # @zapier/zapier-sdk-cli
2
2
 
3
+ ## 0.71.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 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`:
8
+ - 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.
9
+ - 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.
10
+
11
+ - Updated dependencies [59a8180]
12
+ - @zapier/zapier-sdk@0.94.1
13
+ - @zapier/zapier-sdk-mcp@0.19.1
14
+
15
+ ## 0.71.0
16
+
17
+ ### Minor Changes
18
+
19
+ - d700196: Added `createActionRun` and `getActionRun`, the two halves of `runAction` as separately callable methods:
20
+ - `createActionRun({ app, actionType, action, connection?, inputs?, page?, callbackUrl? })` — starts an action run and returns `{ id, implementation_id }` right away, without waiting for it to finish. `implementation_id` is the versioned implementation the run was started against, matching `implementation_id` on an app from `getApp` / `listApps`.
21
+ - `getActionRun({ run })` — returns that run's state: `{ id, status, results, errors, next_page? }`. It is a point-in-time read that answers immediately, so a run that is still executing comes back with `status: "waiting"` and it is up to the caller to check again. Unlike `runAction`, a failed run is reported as `status: "error"` with the details in `errors` rather than thrown.
22
+
23
+ To page a bulk read, pass the `next_page` from `getActionRun` back as the `page` for the next `createActionRun`. The pair uses the same page terminology in both directions, and `next_page` is always a string so it can be handed straight back. `runAction` is a paginated list method, so it keeps the SDK's usual `cursor` / `nextCursor` pair.
24
+
25
+ Pass `callbackUrl` to `createActionRun` to skip polling altogether: Zapier posts the finished run to that URL. It must use HTTPS and resolve to a public host. The delivered body matches what `getActionRun` returns, and carries a `Zapier-Callback-Signature` header holding an RS256 JWT you can verify against `https://zapier.com/.well-known/jwks.json`. Delivery is retried, so the same run can arrive more than once.
26
+
27
+ `runAction` is unchanged and is still the right call for most cases — it starts a run and waits for the result in one step. Reach for the pair when you don't want to block on the result: fan out many runs and collect them later, hand a run ID to another process, or pick a run back up after a restart. Run results are retained for seven days.
28
+
29
+ ### Patch Changes
30
+
31
+ - Updated dependencies [d700196]
32
+ - @zapier/zapier-sdk@0.94.0
33
+ - @zapier/zapier-sdk-mcp@0.19.0
34
+
3
35
  ## 0.70.0
4
36
 
5
37
  ### Minor Changes
package/README.md CHANGED
@@ -13,8 +13,10 @@
13
13
  - [`logout`](#logout)
14
14
  - [`signup`](#signup)
15
15
  - [Actions](#actions)
16
+ - [`create-action-run`](#create-action-run)
16
17
  - [`get-action`](#get-action)
17
18
  - [`get-action-input-fields-schema`](#get-action-input-fields-schema)
19
+ - [`get-action-run`](#get-action-run)
18
20
  - [`list-action-input-field-choices`](#list-action-input-field-choices)
19
21
  - [`list-action-input-fields`](#list-action-input-fields)
20
22
  - [`list-actions`](#list-actions)
@@ -264,6 +266,28 @@ npx zapier-sdk signup [--timeout] [--use-approvals] [--non-interactive] [--headl
264
266
 
265
267
  ### Actions
266
268
 
269
+ #### `create-action-run`
270
+
271
+ Start an action run and return its ID without waiting for the result. Running an action is asynchronous: this hands back a run ID immediately, and `getActionRun` fetches the outcome. Reach for this pair when you want to start work and collect it later (fan out many runs, hand the ID to another process, survive a restart). `runAction` is the one-call form that starts a run and waits for its result.
272
+
273
+ **Options:**
274
+
275
+ | Option | Type | Required | Default | Possible Values | Description |
276
+ | ---------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
277
+ | `<app>` | `string` | ✅ | — | — | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
278
+ | `<action-type>` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
279
+ | `<action>` | `string` | ✅ | — | — | Action key (e.g., 'send_message' or 'find_row') |
280
+ | `--connection` | `string, number` | ❌ | — | — | Connection alias or connection ID (UUID or positive integer). Required if the action needs a connection to authenticate and interact with the service. Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. |
281
+ | `--inputs` | `object` | ❌ | — | — | Input parameters for the action |
282
+ | `--page` | `string` | ❌ | — | — | Page to fetch for bulk read actions. Pass the `next_page` a previous run returned to fetch the following page. |
283
+ | `--callback-url` | `string` | ❌ | — | — | URL Zapier posts the finished run to, so you do not have to poll for it. Must use HTTPS and resolve to a public host, so a local receiver needs a tunnel. The body matches what `getActionRun` returns. Verify the `Zapier-Callback-Signature` header, and expect the same run to arrive more than once. |
284
+
285
+ **Usage:**
286
+
287
+ ```bash
288
+ npx zapier-sdk create-action-run <app> <action-type> <action> [--connection] [--inputs] [--page] [--callback-url]
289
+ ```
290
+
267
291
  #### `get-action`
268
292
 
269
293
  Get detailed information about a specific action
@@ -302,6 +326,22 @@ Get the JSON Schema representation of input fields for an action. Returns a JSON
302
326
  npx zapier-sdk get-action-input-fields-schema <app> <action-type> <action> [--connection] [--inputs]
303
327
  ```
304
328
 
329
+ #### `get-action-run`
330
+
331
+ Fetch the current state of an action run started by `createActionRun`. This is a point-in-time read that returns immediately: a run Zapier has not finished executing comes back with status `waiting`, so call again to check for a result. `runAction` starts a run and waits for its result in one call. Results are stored for seven days after the run was created.
332
+
333
+ **Options:**
334
+
335
+ | Option | Type | Required | Default | Possible Values | Description |
336
+ | ------- | -------- | -------- | ------- | --------------- | ------------------------------------------- |
337
+ | `<run>` | `string` | ✅ | — | — | Action run ID returned by `createActionRun` |
338
+
339
+ **Usage:**
340
+
341
+ ```bash
342
+ npx zapier-sdk get-action-run <run>
343
+ ```
344
+
305
345
  #### `list-action-input-field-choices`
306
346
 
307
347
  Get the available choices for a dynamic dropdown input field
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.70.0"};
605
+ version: "0.71.1"};
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.70.0"};
8363
+ version: "0.71.1"};
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.70.0"};
561
+ version: "0.71.1"};
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.70.0"};
8319
+ version: "0.71.1"};
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.70.0"};
6864
+ version: "0.71.1"};
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.70.0"};
6823
+ version: "0.71.1"};
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.70.0"};
6865
+ version: "0.71.1"};
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.70.0"};
6949
+ version: "0.71.1"};
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.70.0"};
6824
+ version: "0.71.1"};
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.70.0"};
6908
+ version: "0.71.1"};
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.70.0",
3
+ "version": "0.71.1",
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.93.0",
99
- "@zapier/zapier-sdk-mcp": "0.18.23"
98
+ "@zapier/zapier-sdk": "0.94.1",
99
+ "@zapier/zapier-sdk-mcp": "0.19.1"
100
100
  },
101
101
  "devDependencies": {
102
102
  "@types/cross-spawn": "^6.0.6",