@zapier/zapier-sdk 0.92.1 → 0.94.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 +22 -0
- package/README.md +71 -1
- package/dist/{chunk-WFWTHI2N.cjs → chunk-TQT6EGZU.cjs} +1148 -1005
- package/dist/{chunk-6B4QZVQM.mjs → chunk-XUVZWY2D.mjs} +1145 -1006
- package/dist/experimental.cjs +395 -379
- package/dist/experimental.d.mts +149 -7
- package/dist/experimental.d.ts +149 -7
- package/dist/experimental.mjs +5 -5
- package/dist/{index-CBwO7l3J.d.mts → index-D6jpmIVn.d.mts} +322 -10
- package/dist/{index-CBwO7l3J.d.ts → index-D6jpmIVn.d.ts} +322 -10
- package/dist/index.cjs +288 -272
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @zapier/zapier-sdk
|
|
2
2
|
|
|
3
|
+
## 0.94.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d700196: Added `createActionRun` and `getActionRun`, the two halves of `runAction` as separately callable methods:
|
|
8
|
+
- `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`.
|
|
9
|
+
- `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.
|
|
10
|
+
|
|
11
|
+
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.
|
|
12
|
+
|
|
13
|
+
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.
|
|
14
|
+
|
|
15
|
+
`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.
|
|
16
|
+
|
|
17
|
+
## 0.93.0
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- bc7405e: `@zapier/kitcore`: added `NegatableMetadata` and a `getNegatable` reader for marking optional boolean schema fields where omission is distinct from false (omitting means "use the server default" or "keep the current value"). Tooling built on kitcore can read the marker to offer an explicit disable affordance — for example, the CLI generates a `--disabled` flag from it.
|
|
22
|
+
|
|
23
|
+
`@zapier/zapier-sdk`: the `publishWorkflowVersion` and `publishWorkflowDraft` `enabled` parameter descriptions now state what omitting the parameter does (uses the server default / preserves the current state) without naming CLI-specific flags. `NegatableMetadata` and `getNegatable` are re-exported from `@zapier/kitcore` for schema-metadata consumers.
|
|
24
|
+
|
|
3
25
|
## 0.92.1
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -11,8 +11,10 @@
|
|
|
11
11
|
- [Accounts](#accounts)
|
|
12
12
|
- [`getProfile`](#getprofile)
|
|
13
13
|
- [Actions](#actions)
|
|
14
|
+
- [`createActionRun`](#createactionrun)
|
|
14
15
|
- [`getAction`](#getaction)
|
|
15
16
|
- [`getActionInputFieldsSchema`](#getactioninputfieldsschema)
|
|
17
|
+
- [`getActionRun`](#getactionrun)
|
|
16
18
|
- [`listActionInputFieldChoices`](#listactioninputfieldchoices)
|
|
17
19
|
- [`listActionInputFields`](#listactioninputfields)
|
|
18
20
|
- [`listActions`](#listactions)
|
|
@@ -471,6 +473,41 @@ const { data: profile } = await zapier.getProfile();
|
|
|
471
473
|
|
|
472
474
|
### Actions
|
|
473
475
|
|
|
476
|
+
#### `createActionRun`
|
|
477
|
+
|
|
478
|
+
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.
|
|
479
|
+
|
|
480
|
+
**Parameters:**
|
|
481
|
+
|
|
482
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
483
|
+
| ----------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
484
|
+
| `options` | `object` | ✅ | — | — | |
|
|
485
|
+
| ↳ `app` | `string` | ✅ | — | — | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
|
|
486
|
+
| ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
|
|
487
|
+
| ↳ `action` | `string` | ✅ | — | — | Action key (e.g., 'send_message' or 'find_row') |
|
|
488
|
+
| ↳ `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. |
|
|
489
|
+
| ↳ `inputs` | `object` | ❌ | — | — | Input parameters for the action |
|
|
490
|
+
| ↳ `page` | `string` | ❌ | — | — | Page to fetch for bulk read actions. Pass the `next_page` a previous run returned to fetch the following page. |
|
|
491
|
+
| ↳ `callbackUrl` | `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. |
|
|
492
|
+
|
|
493
|
+
**Returns:** `Promise<StartedActionRunItem>`
|
|
494
|
+
|
|
495
|
+
| Name | Type | Required | Possible Values | Description |
|
|
496
|
+
| ----------------------- | -------- | -------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
|
|
497
|
+
| `data` | `object` | ✅ | — | |
|
|
498
|
+
| ↳ `id` | `string` | ✅ | — | Action run ID. Pass it as the `run` for `getActionRun` to fetch the run's result. |
|
|
499
|
+
| ↳ `implementation_id` | `string` | ✅ | — | Versioned implementation ID the run was started against (e.g. 'SlackCLIAPI@1.21.1'). The versionless app key is the part before the `@`. |
|
|
500
|
+
|
|
501
|
+
**Example:**
|
|
502
|
+
|
|
503
|
+
```typescript
|
|
504
|
+
const { data: startedActionRun } = await zapier.createActionRun({
|
|
505
|
+
app: "example-app",
|
|
506
|
+
actionType: "read",
|
|
507
|
+
action: "example-action",
|
|
508
|
+
});
|
|
509
|
+
```
|
|
510
|
+
|
|
474
511
|
#### `getAction`
|
|
475
512
|
|
|
476
513
|
Get detailed information about a specific action
|
|
@@ -537,6 +574,39 @@ const { data: inputSchema } = await zapier.getActionInputFieldsSchema({
|
|
|
537
574
|
});
|
|
538
575
|
```
|
|
539
576
|
|
|
577
|
+
#### `getActionRun`
|
|
578
|
+
|
|
579
|
+
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.
|
|
580
|
+
|
|
581
|
+
**Parameters:**
|
|
582
|
+
|
|
583
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
584
|
+
| --------- | -------- | -------- | ------- | --------------- | ------------------------------------------- |
|
|
585
|
+
| `options` | `object` | ✅ | — | — | |
|
|
586
|
+
| ↳ `run` | `string` | ✅ | — | — | Action run ID returned by `createActionRun` |
|
|
587
|
+
|
|
588
|
+
**Returns:** `Promise<ActionRunItem>`
|
|
589
|
+
|
|
590
|
+
| Name | Type | Required | Possible Values | Description |
|
|
591
|
+
| --------------- | ---------- | -------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
592
|
+
| `data` | `object` | ✅ | — | |
|
|
593
|
+
| ↳ `id` | `string` | ✅ | — | Action run ID |
|
|
594
|
+
| ↳ `status` | `string` | ✅ | `waiting`, `success`, `error`, `unknown` | Where the run is in its lifecycle. `waiting` means Zapier is still executing it; `error` means the app returned a failure (details in `errors`). `unknown` means the response carried no status, so the outcome could not be determined — treat it as inconclusive rather than as success. |
|
|
595
|
+
| ↳ `results` | `array` | ✅ | — | Records the action produced. Can be empty even on a successful run. |
|
|
596
|
+
| ↳ `next_page` | `string` | ❌ | — | For bulk read actions, the following page. Pass it back as the `page` for `createActionRun` to fetch that page. |
|
|
597
|
+
| ↳ `errors[]` | `object[]` | ✅ | — | Errors the app returned while running the action |
|
|
598
|
+
| ↳ `code` | `string` | ❌ | — | Machine-readable error category |
|
|
599
|
+
| ↳ `title` | `string` | ❌ | — | Short error label |
|
|
600
|
+
| ↳ `detail` | `string` | ❌ | — | Human-readable error detail |
|
|
601
|
+
|
|
602
|
+
**Example:**
|
|
603
|
+
|
|
604
|
+
```typescript
|
|
605
|
+
const { data: actionRun } = await zapier.getActionRun({
|
|
606
|
+
run: "example-run",
|
|
607
|
+
});
|
|
608
|
+
```
|
|
609
|
+
|
|
540
610
|
#### `listActionInputFieldChoices`
|
|
541
611
|
|
|
542
612
|
Get the available choices for a dynamic dropdown input field
|
|
@@ -1945,7 +2015,7 @@ Publish a new version of a durable workflow. Enables the workflow by default.
|
|
|
1945
2015
|
| ↳ `sourceFiles` | `object` | ✅ | — | — | Source files keyed by filename → contents |
|
|
1946
2016
|
| ↳ `dependencies` | `object` | ❌ | — | — | Optional npm package dependencies |
|
|
1947
2017
|
| ↳ `zapierDurableVersion` | `string` | ❌ | — | — | Exact semver of @zapier/zapier-durable to use (e.g. "1.2.3"). Defaults to server-configured version if omitted. |
|
|
1948
|
-
| ↳ `enabled` | `boolean` | ❌ | — | — | Enable the workflow after publishing. Defaults to true; pass false to publish without enabling.
|
|
2018
|
+
| ↳ `enabled` | `boolean` | ❌ | — | — | Enable the workflow after publishing. Defaults to true if omitted; pass false to publish without enabling. |
|
|
1949
2019
|
| ↳ `ignoreOpenDrafts` | `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. |
|
|
1950
2020
|
| ↳ `connections` | `object` | ❌ | — | — | Map of connection aliases to Zapier connections used by the workflow. Pass `null` to clear an existing binding. |
|
|
1951
2021
|
| ↳ `appVersions` | `object` | ❌ | — | — | Map of app keys to pinned app implementation/version used by the workflow. Pass `null` to clear an existing binding. |
|