@zapier/zapier-sdk 0.90.0 → 0.91.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 +21 -0
- package/README.md +156 -96
- package/dist/{chunk-J7Z7UHXP.mjs → chunk-22USOWAR.mjs} +11 -5
- package/dist/{chunk-LQEV6ICY.cjs → chunk-6HEA7RSA.cjs} +11 -5
- package/dist/experimental.cjs +474 -401
- package/dist/experimental.d.mts +124 -1
- package/dist/experimental.d.ts +124 -1
- package/dist/experimental.mjs +111 -38
- package/dist/index.cjs +272 -272
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @zapier/zapier-sdk
|
|
2
2
|
|
|
3
|
+
## 0.91.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4886b5b: `runAction` failures now carry the action's structured errors on the thrown
|
|
8
|
+
`ZapierActionError`. `error.errors` (and its `actionErrors` alias) previously
|
|
9
|
+
stayed `undefined` for a failed action run, because the API reports that failure
|
|
10
|
+
in the body of a `200` response rather than as an HTTP error. Each entry now
|
|
11
|
+
exposes the machine-readable `code` — for example `authentication_error` when a
|
|
12
|
+
connection has expired — so callers can branch on the failure instead of
|
|
13
|
+
matching against the message text.
|
|
14
|
+
|
|
15
|
+
## 0.91.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- 5935b7e: Added `publishWorkflowDraft` (experimental) to publish an open workflow draft as a new immutable version.
|
|
20
|
+
- Publishing advances the workflow's live pointer and **discards the draft** — publish consumes it, so an open draft always means unpublished work. Returns both the new `version` and the consumed `draft` (`status: "discarded"`, `base_version_id` still recording the version it was forked from). Prefer it over `publishWorkflowVersion` once a draft exists, so the open draft is never orphaned; continue editing by creating a new draft off the new version.
|
|
21
|
+
- Accepts optional `enabled` (set the workflow's enabled state as part of the publish; preserved if omitted) and `draftRevision` (optimistic concurrency: publish exactly the revision last read).
|
|
22
|
+
- Failure modes stay distinct: a concurrent-edit or trigger-switchover conflict surfaces as `ZapierConflictError` (retryable after re-reading the draft), a trigger-catalog validation outage surfaces as a retryable 503 API error, and invalid `zapier_durable_version` or trigger config surfaces as a validation error.
|
|
23
|
+
|
|
3
24
|
## 0.90.0
|
|
4
25
|
|
|
5
26
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
- [`listWorkflowRuns`](#listworkflowruns--experimental)
|
|
46
46
|
- [`listWorkflowVersions`](#listworkflowversions--experimental)
|
|
47
47
|
- [`listWorkflows`](#listworkflows--experimental)
|
|
48
|
+
- [`publishWorkflowDraft`](#publishworkflowdraft--experimental)
|
|
48
49
|
- [`publishWorkflowVersion`](#publishworkflowversion--experimental)
|
|
49
50
|
- [`runDurable`](#rundurable--experimental)
|
|
50
51
|
- [`triggerWorkflow`](#triggerworkflow--experimental)
|
|
@@ -1196,27 +1197,27 @@ Fork a new draft from the workflow's current live version (or a blank stub befor
|
|
|
1196
1197
|
|
|
1197
1198
|
**Returns:** `Promise<WorkflowDraftItem>`
|
|
1198
1199
|
|
|
1199
|
-
| Name | Type | Required | Possible Values | Description
|
|
1200
|
-
| ---------------------------- | -------- | -------- | ------------------- |
|
|
1201
|
-
| `data` | `object` | ✅ | — |
|
|
1202
|
-
| ↳ `id` | `string` | ✅ | — | Workflow draft ID (UUID)
|
|
1203
|
-
| ↳ `workflow_id` | `string` | ✅ | — | Parent workflow ID (UUID)
|
|
1204
|
-
| ↳ `slug` | `string` | ✅ | — | Human-friendly identifier for URL routing; unique among open drafts per workflow
|
|
1205
|
-
| ↳ `base_version_id` | `string` | ✅ | — |
|
|
1206
|
-
| ↳ `source_files` | `object` | ✅ | — | Source files keyed by filename → contents
|
|
1207
|
-
| ↳ `zapier_durable_version` | `string` | ✅ | — | Pinned semver of @zapier/zapier-durable used by this draft
|
|
1208
|
-
| ↳ `dependencies` | `object` | ✅ | — | Additional npm dependencies pinned for this draft (or null)
|
|
1209
|
-
| ↳ `draft_revision` | `number` | ✅ | — | Monotonic revision counter for optimistic concurrency. Echo it back on draft updates to detect concurrent edits.
|
|
1210
|
-
| ↳ `status` | `string` | ✅ | `open`, `discarded` | Lifecycle status of a workflow draft.
|
|
1211
|
-
| ↳ `created_by_user_id` | `string` | ✅ | — | ID of the user who created (forked) this draft
|
|
1212
|
-
| ↳ `last_edited_by_user_id` | `string` | ✅ | — | ID of the user who last saved this draft (or null)
|
|
1213
|
-
| ↳ `last_edited_at` | `string` | ✅ | — | When the draft was last edited (ISO-8601, or null)
|
|
1214
|
-
| ↳ `discarded_at` | `string` | ✅ | — | When the draft was discarded (ISO-8601), or null while open
|
|
1215
|
-
| ↳ `created_at` | `string` | ✅ | — | When the draft was created (ISO-8601)
|
|
1216
|
-
| ↳ `updated_at` | `string` | ✅ | — | When the draft row was last updated (ISO-8601)
|
|
1217
|
-
| ↳ `trigger` | `object` | ✅ | — | Trigger configuration held on this draft, or null for webhook-only workflows.
|
|
1218
|
-
| ↳ `connections` | `object` | ✅ | — | Connection aliases bound on this draft (or null).
|
|
1219
|
-
| ↳ `app_versions` | `object` | ✅ | — | App-version pins bound on this draft (or null).
|
|
1200
|
+
| Name | Type | Required | Possible Values | Description |
|
|
1201
|
+
| ---------------------------- | -------- | -------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|
|
1202
|
+
| `data` | `object` | ✅ | — | |
|
|
1203
|
+
| ↳ `id` | `string` | ✅ | — | Workflow draft ID (UUID) |
|
|
1204
|
+
| ↳ `workflow_id` | `string` | ✅ | — | Parent workflow ID (UUID) |
|
|
1205
|
+
| ↳ `slug` | `string` | ✅ | — | Human-friendly identifier for URL routing; unique among open drafts per workflow |
|
|
1206
|
+
| ↳ `base_version_id` | `string` | ✅ | — | The version this draft was forked from (the live version at draft creation), or null when the workflow had no published version yet |
|
|
1207
|
+
| ↳ `source_files` | `object` | ✅ | — | Source files keyed by filename → contents |
|
|
1208
|
+
| ↳ `zapier_durable_version` | `string` | ✅ | — | Pinned semver of @zapier/zapier-durable used by this draft |
|
|
1209
|
+
| ↳ `dependencies` | `object` | ✅ | — | Additional npm dependencies pinned for this draft (or null) |
|
|
1210
|
+
| ↳ `draft_revision` | `number` | ✅ | — | Monotonic revision counter for optimistic concurrency. Echo it back on draft updates to detect concurrent edits. |
|
|
1211
|
+
| ↳ `status` | `string` | ✅ | `open`, `discarded` | Lifecycle status of a workflow draft. |
|
|
1212
|
+
| ↳ `created_by_user_id` | `string` | ✅ | — | ID of the user who created (forked) this draft |
|
|
1213
|
+
| ↳ `last_edited_by_user_id` | `string` | ✅ | — | ID of the user who last saved this draft (or null) |
|
|
1214
|
+
| ↳ `last_edited_at` | `string` | ✅ | — | When the draft was last edited (ISO-8601, or null) |
|
|
1215
|
+
| ↳ `discarded_at` | `string` | ✅ | — | When the draft was discarded (ISO-8601), or null while open |
|
|
1216
|
+
| ↳ `created_at` | `string` | ✅ | — | When the draft was created (ISO-8601) |
|
|
1217
|
+
| ↳ `updated_at` | `string` | ✅ | — | When the draft row was last updated (ISO-8601) |
|
|
1218
|
+
| ↳ `trigger` | `object` | ✅ | — | Trigger configuration held on this draft, or null for webhook-only workflows. |
|
|
1219
|
+
| ↳ `connections` | `object` | ✅ | — | Connection aliases bound on this draft (or null). |
|
|
1220
|
+
| ↳ `app_versions` | `object` | ✅ | — | App-version pins bound on this draft (or null). |
|
|
1220
1221
|
|
|
1221
1222
|
**Example:**
|
|
1222
1223
|
|
|
@@ -1293,27 +1294,27 @@ Discard an open workflow draft (soft delete). The draft's unpublished edits stop
|
|
|
1293
1294
|
|
|
1294
1295
|
**Returns:** `Promise<WorkflowDraftItem>`
|
|
1295
1296
|
|
|
1296
|
-
| Name | Type | Required | Possible Values | Description
|
|
1297
|
-
| ---------------------------- | -------- | -------- | ------------------- |
|
|
1298
|
-
| `data` | `object` | ✅ | — |
|
|
1299
|
-
| ↳ `id` | `string` | ✅ | — | Workflow draft ID (UUID)
|
|
1300
|
-
| ↳ `workflow_id` | `string` | ✅ | — | Parent workflow ID (UUID)
|
|
1301
|
-
| ↳ `slug` | `string` | ✅ | — | Human-friendly identifier for URL routing; unique among open drafts per workflow
|
|
1302
|
-
| ↳ `base_version_id` | `string` | ✅ | — |
|
|
1303
|
-
| ↳ `source_files` | `object` | ✅ | — | Source files keyed by filename → contents
|
|
1304
|
-
| ↳ `zapier_durable_version` | `string` | ✅ | — | Pinned semver of @zapier/zapier-durable used by this draft
|
|
1305
|
-
| ↳ `dependencies` | `object` | ✅ | — | Additional npm dependencies pinned for this draft (or null)
|
|
1306
|
-
| ↳ `draft_revision` | `number` | ✅ | — | Monotonic revision counter for optimistic concurrency. Echo it back on draft updates to detect concurrent edits.
|
|
1307
|
-
| ↳ `status` | `string` | ✅ | `open`, `discarded` | Lifecycle status of a workflow draft.
|
|
1308
|
-
| ↳ `created_by_user_id` | `string` | ✅ | — | ID of the user who created (forked) this draft
|
|
1309
|
-
| ↳ `last_edited_by_user_id` | `string` | ✅ | — | ID of the user who last saved this draft (or null)
|
|
1310
|
-
| ↳ `last_edited_at` | `string` | ✅ | — | When the draft was last edited (ISO-8601, or null)
|
|
1311
|
-
| ↳ `discarded_at` | `string` | ✅ | — | When the draft was discarded (ISO-8601), or null while open
|
|
1312
|
-
| ↳ `created_at` | `string` | ✅ | — | When the draft was created (ISO-8601)
|
|
1313
|
-
| ↳ `updated_at` | `string` | ✅ | — | When the draft row was last updated (ISO-8601)
|
|
1314
|
-
| ↳ `trigger` | `object` | ✅ | — | Trigger configuration held on this draft, or null for webhook-only workflows.
|
|
1315
|
-
| ↳ `connections` | `object` | ✅ | — | Connection aliases bound on this draft (or null).
|
|
1316
|
-
| ↳ `app_versions` | `object` | ✅ | — | App-version pins bound on this draft (or null).
|
|
1297
|
+
| Name | Type | Required | Possible Values | Description |
|
|
1298
|
+
| ---------------------------- | -------- | -------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|
|
1299
|
+
| `data` | `object` | ✅ | — | |
|
|
1300
|
+
| ↳ `id` | `string` | ✅ | — | Workflow draft ID (UUID) |
|
|
1301
|
+
| ↳ `workflow_id` | `string` | ✅ | — | Parent workflow ID (UUID) |
|
|
1302
|
+
| ↳ `slug` | `string` | ✅ | — | Human-friendly identifier for URL routing; unique among open drafts per workflow |
|
|
1303
|
+
| ↳ `base_version_id` | `string` | ✅ | — | The version this draft was forked from (the live version at draft creation), or null when the workflow had no published version yet |
|
|
1304
|
+
| ↳ `source_files` | `object` | ✅ | — | Source files keyed by filename → contents |
|
|
1305
|
+
| ↳ `zapier_durable_version` | `string` | ✅ | — | Pinned semver of @zapier/zapier-durable used by this draft |
|
|
1306
|
+
| ↳ `dependencies` | `object` | ✅ | — | Additional npm dependencies pinned for this draft (or null) |
|
|
1307
|
+
| ↳ `draft_revision` | `number` | ✅ | — | Monotonic revision counter for optimistic concurrency. Echo it back on draft updates to detect concurrent edits. |
|
|
1308
|
+
| ↳ `status` | `string` | ✅ | `open`, `discarded` | Lifecycle status of a workflow draft. |
|
|
1309
|
+
| ↳ `created_by_user_id` | `string` | ✅ | — | ID of the user who created (forked) this draft |
|
|
1310
|
+
| ↳ `last_edited_by_user_id` | `string` | ✅ | — | ID of the user who last saved this draft (or null) |
|
|
1311
|
+
| ↳ `last_edited_at` | `string` | ✅ | — | When the draft was last edited (ISO-8601, or null) |
|
|
1312
|
+
| ↳ `discarded_at` | `string` | ✅ | — | When the draft was discarded (ISO-8601), or null while open |
|
|
1313
|
+
| ↳ `created_at` | `string` | ✅ | — | When the draft was created (ISO-8601) |
|
|
1314
|
+
| ↳ `updated_at` | `string` | ✅ | — | When the draft row was last updated (ISO-8601) |
|
|
1315
|
+
| ↳ `trigger` | `object` | ✅ | — | Trigger configuration held on this draft, or null for webhook-only workflows. |
|
|
1316
|
+
| ↳ `connections` | `object` | ✅ | — | Connection aliases bound on this draft (or null). |
|
|
1317
|
+
| ↳ `app_versions` | `object` | ✅ | — | App-version pins bound on this draft (or null). |
|
|
1317
1318
|
|
|
1318
1319
|
**Example:**
|
|
1319
1320
|
|
|
@@ -1487,27 +1488,27 @@ Get full details of a workflow draft including source files
|
|
|
1487
1488
|
|
|
1488
1489
|
**Returns:** `Promise<WorkflowDraftItem>`
|
|
1489
1490
|
|
|
1490
|
-
| Name | Type | Required | Possible Values | Description
|
|
1491
|
-
| ---------------------------- | -------- | -------- | ------------------- |
|
|
1492
|
-
| `data` | `object` | ✅ | — |
|
|
1493
|
-
| ↳ `id` | `string` | ✅ | — | Workflow draft ID (UUID)
|
|
1494
|
-
| ↳ `workflow_id` | `string` | ✅ | — | Parent workflow ID (UUID)
|
|
1495
|
-
| ↳ `slug` | `string` | ✅ | — | Human-friendly identifier for URL routing; unique among open drafts per workflow
|
|
1496
|
-
| ↳ `base_version_id` | `string` | ✅ | — |
|
|
1497
|
-
| ↳ `source_files` | `object` | ✅ | — | Source files keyed by filename → contents
|
|
1498
|
-
| ↳ `zapier_durable_version` | `string` | ✅ | — | Pinned semver of @zapier/zapier-durable used by this draft
|
|
1499
|
-
| ↳ `dependencies` | `object` | ✅ | — | Additional npm dependencies pinned for this draft (or null)
|
|
1500
|
-
| ↳ `draft_revision` | `number` | ✅ | — | Monotonic revision counter for optimistic concurrency. Echo it back on draft updates to detect concurrent edits.
|
|
1501
|
-
| ↳ `status` | `string` | ✅ | `open`, `discarded` | Lifecycle status of a workflow draft.
|
|
1502
|
-
| ↳ `created_by_user_id` | `string` | ✅ | — | ID of the user who created (forked) this draft
|
|
1503
|
-
| ↳ `last_edited_by_user_id` | `string` | ✅ | — | ID of the user who last saved this draft (or null)
|
|
1504
|
-
| ↳ `last_edited_at` | `string` | ✅ | — | When the draft was last edited (ISO-8601, or null)
|
|
1505
|
-
| ↳ `discarded_at` | `string` | ✅ | — | When the draft was discarded (ISO-8601), or null while open
|
|
1506
|
-
| ↳ `created_at` | `string` | ✅ | — | When the draft was created (ISO-8601)
|
|
1507
|
-
| ↳ `updated_at` | `string` | ✅ | — | When the draft row was last updated (ISO-8601)
|
|
1508
|
-
| ↳ `trigger` | `object` | ✅ | — | Trigger configuration held on this draft, or null for webhook-only workflows.
|
|
1509
|
-
| ↳ `connections` | `object` | ✅ | — | Connection aliases bound on this draft (or null).
|
|
1510
|
-
| ↳ `app_versions` | `object` | ✅ | — | App-version pins bound on this draft (or null).
|
|
1491
|
+
| Name | Type | Required | Possible Values | Description |
|
|
1492
|
+
| ---------------------------- | -------- | -------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|
|
1493
|
+
| `data` | `object` | ✅ | — | |
|
|
1494
|
+
| ↳ `id` | `string` | ✅ | — | Workflow draft ID (UUID) |
|
|
1495
|
+
| ↳ `workflow_id` | `string` | ✅ | — | Parent workflow ID (UUID) |
|
|
1496
|
+
| ↳ `slug` | `string` | ✅ | — | Human-friendly identifier for URL routing; unique among open drafts per workflow |
|
|
1497
|
+
| ↳ `base_version_id` | `string` | ✅ | — | The version this draft was forked from (the live version at draft creation), or null when the workflow had no published version yet |
|
|
1498
|
+
| ↳ `source_files` | `object` | ✅ | — | Source files keyed by filename → contents |
|
|
1499
|
+
| ↳ `zapier_durable_version` | `string` | ✅ | — | Pinned semver of @zapier/zapier-durable used by this draft |
|
|
1500
|
+
| ↳ `dependencies` | `object` | ✅ | — | Additional npm dependencies pinned for this draft (or null) |
|
|
1501
|
+
| ↳ `draft_revision` | `number` | ✅ | — | Monotonic revision counter for optimistic concurrency. Echo it back on draft updates to detect concurrent edits. |
|
|
1502
|
+
| ↳ `status` | `string` | ✅ | `open`, `discarded` | Lifecycle status of a workflow draft. |
|
|
1503
|
+
| ↳ `created_by_user_id` | `string` | ✅ | — | ID of the user who created (forked) this draft |
|
|
1504
|
+
| ↳ `last_edited_by_user_id` | `string` | ✅ | — | ID of the user who last saved this draft (or null) |
|
|
1505
|
+
| ↳ `last_edited_at` | `string` | ✅ | — | When the draft was last edited (ISO-8601, or null) |
|
|
1506
|
+
| ↳ `discarded_at` | `string` | ✅ | — | When the draft was discarded (ISO-8601), or null while open |
|
|
1507
|
+
| ↳ `created_at` | `string` | ✅ | — | When the draft was created (ISO-8601) |
|
|
1508
|
+
| ↳ `updated_at` | `string` | ✅ | — | When the draft row was last updated (ISO-8601) |
|
|
1509
|
+
| ↳ `trigger` | `object` | ✅ | — | Trigger configuration held on this draft, or null for webhook-only workflows. |
|
|
1510
|
+
| ↳ `connections` | `object` | ✅ | — | Connection aliases bound on this draft (or null). |
|
|
1511
|
+
| ↳ `app_versions` | `object` | ✅ | — | App-version pins bound on this draft (or null). |
|
|
1511
1512
|
|
|
1512
1513
|
**Example:**
|
|
1513
1514
|
|
|
@@ -1655,18 +1656,18 @@ List drafts for a workflow, most recently edited first (open drafts by default)
|
|
|
1655
1656
|
|
|
1656
1657
|
**Returns:** `Promise<PaginatedResult<WorkflowDraftItem>>`
|
|
1657
1658
|
|
|
1658
|
-
| Name | Type | Required | Possible Values | Description
|
|
1659
|
-
| ---------------------------- | ---------- | -------- | ------------------- |
|
|
1660
|
-
| `data[]` | `object[]` | ✅ | — |
|
|
1661
|
-
| ↳ `id` | `string` | ✅ | — | Workflow draft ID (UUID)
|
|
1662
|
-
| ↳ `workflow_id` | `string` | ✅ | — | Parent workflow ID (UUID)
|
|
1663
|
-
| ↳ `slug` | `string` | ✅ | — | Human-friendly identifier for URL routing; unique among open drafts per workflow
|
|
1664
|
-
| ↳ `base_version_id` | `string` | ✅ | — |
|
|
1665
|
-
| ↳ `status` | `string` | ✅ | `open`, `discarded` | Lifecycle status of a workflow draft.
|
|
1666
|
-
| ↳ `last_edited_by_user_id` | `string` | ✅ | — | ID of the user who last saved this draft (or null)
|
|
1667
|
-
| ↳ `last_edited_at` | `string` | ✅ | — | When the draft was last edited (ISO-8601, or null)
|
|
1668
|
-
| ↳ `created_at` | `string` | ✅ | — | When the draft was created (ISO-8601)
|
|
1669
|
-
| `nextCursor` | `string` | ❌ | — | Cursor for the next page; omitted when there are no more pages
|
|
1659
|
+
| Name | Type | Required | Possible Values | Description |
|
|
1660
|
+
| ---------------------------- | ---------- | -------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|
|
1661
|
+
| `data[]` | `object[]` | ✅ | — | |
|
|
1662
|
+
| ↳ `id` | `string` | ✅ | — | Workflow draft ID (UUID) |
|
|
1663
|
+
| ↳ `workflow_id` | `string` | ✅ | — | Parent workflow ID (UUID) |
|
|
1664
|
+
| ↳ `slug` | `string` | ✅ | — | Human-friendly identifier for URL routing; unique among open drafts per workflow |
|
|
1665
|
+
| ↳ `base_version_id` | `string` | ✅ | — | The version this draft was forked from (the live version at draft creation), or null when the workflow had no published version yet |
|
|
1666
|
+
| ↳ `status` | `string` | ✅ | `open`, `discarded` | Lifecycle status of a workflow draft. |
|
|
1667
|
+
| ↳ `last_edited_by_user_id` | `string` | ✅ | — | ID of the user who last saved this draft (or null) |
|
|
1668
|
+
| ↳ `last_edited_at` | `string` | ✅ | — | When the draft was last edited (ISO-8601, or null) |
|
|
1669
|
+
| ↳ `created_at` | `string` | ✅ | — | When the draft was created (ISO-8601) |
|
|
1670
|
+
| `nextCursor` | `string` | ❌ | — | Cursor for the next page; omitted when there are no more pages |
|
|
1670
1671
|
|
|
1671
1672
|
**Example:**
|
|
1672
1673
|
|
|
@@ -1866,6 +1867,65 @@ for await (const workflow of zapier.listWorkflows().items()) {
|
|
|
1866
1867
|
}
|
|
1867
1868
|
```
|
|
1868
1869
|
|
|
1870
|
+
#### `publishWorkflowDraft` 🧪 _experimental_
|
|
1871
|
+
|
|
1872
|
+
Publish an open draft as a new immutable workflow version. Advances the workflow's live pointer and discards the draft — publish consumes it, so an open draft always means unpublished work. Continue editing by creating a new draft, which forks from the just-published version.
|
|
1873
|
+
|
|
1874
|
+
**Parameters:**
|
|
1875
|
+
|
|
1876
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
1877
|
+
| ------------------- | --------- | -------- | ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
1878
|
+
| `options` | `object` | ✅ | — | — | |
|
|
1879
|
+
| ↳ `workflow` | `string` | ✅ | — | — | Durable workflow ID |
|
|
1880
|
+
| ↳ `draft` | `string` | ✅ | — | — | Workflow draft ID |
|
|
1881
|
+
| ↳ `enabled` | `boolean` | ❌ | — | — | Set the workflow's enabled state as part of the publish. If omitted, the current enabled state is preserved. |
|
|
1882
|
+
| ↳ `draftRevision` | `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. |
|
|
1883
|
+
|
|
1884
|
+
**Returns:** `Promise<PublishWorkflowDraftResponse>`
|
|
1885
|
+
|
|
1886
|
+
| Name | Type | Required | Possible Values | Description |
|
|
1887
|
+
| ------------------------------ | -------- | -------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1888
|
+
| `data` | `object` | ✅ | — | |
|
|
1889
|
+
| ↳ `draft` | `object` | ✅ | — | The consumed draft: status is 'discarded' and discarded_at is set. base_version_id still records the version the draft was forked from. |
|
|
1890
|
+
| ↳ `id` | `string` | ✅ | — | Workflow draft ID (UUID) |
|
|
1891
|
+
| ↳ `workflow_id` | `string` | ✅ | — | Parent workflow ID (UUID) |
|
|
1892
|
+
| ↳ `slug` | `string` | ✅ | — | Human-friendly identifier for URL routing; unique among open drafts per workflow |
|
|
1893
|
+
| ↳ `base_version_id` | `string` | ✅ | — | The version this draft was forked from (the live version at draft creation), or null when the workflow had no published version yet |
|
|
1894
|
+
| ↳ `source_files` | `object` | ✅ | — | Source files keyed by filename → contents |
|
|
1895
|
+
| ↳ `zapier_durable_version` | `string` | ✅ | — | Pinned semver of @zapier/zapier-durable used by this draft |
|
|
1896
|
+
| ↳ `dependencies` | `object` | ✅ | — | Additional npm dependencies pinned for this draft (or null) |
|
|
1897
|
+
| ↳ `draft_revision` | `number` | ✅ | — | Monotonic revision counter for optimistic concurrency. Echo it back on draft updates to detect concurrent edits. |
|
|
1898
|
+
| ↳ `status` | `string` | ✅ | `open`, `discarded` | Lifecycle status of a workflow draft. |
|
|
1899
|
+
| ↳ `created_by_user_id` | `string` | ✅ | — | ID of the user who created (forked) this draft |
|
|
1900
|
+
| ↳ `last_edited_by_user_id` | `string` | ✅ | — | ID of the user who last saved this draft (or null) |
|
|
1901
|
+
| ↳ `last_edited_at` | `string` | ✅ | — | When the draft was last edited (ISO-8601, or null) |
|
|
1902
|
+
| ↳ `discarded_at` | `string` | ✅ | — | When the draft was discarded (ISO-8601), or null while open |
|
|
1903
|
+
| ↳ `created_at` | `string` | ✅ | — | When the draft was created (ISO-8601) |
|
|
1904
|
+
| ↳ `updated_at` | `string` | ✅ | — | When the draft row was last updated (ISO-8601) |
|
|
1905
|
+
| ↳ `trigger` | `object` | ✅ | — | Trigger configuration held on this draft, or null for webhook-only workflows. |
|
|
1906
|
+
| ↳ `connections` | `object` | ✅ | — | Connection aliases bound on this draft (or null). |
|
|
1907
|
+
| ↳ `app_versions` | `object` | ✅ | — | App-version pins bound on this draft (or null). |
|
|
1908
|
+
| ↳ `version` | `object` | ✅ | — | The newly published immutable workflow version, now live. |
|
|
1909
|
+
| ↳ `id` | `string` | ✅ | — | Workflow version ID (UUID) |
|
|
1910
|
+
| ↳ `workflow_id` | `string` | ✅ | — | Parent workflow ID (UUID) |
|
|
1911
|
+
| ↳ `source_files` | `object` | ✅ | — | Source files keyed by filename → contents |
|
|
1912
|
+
| ↳ `zapier_durable_version` | `string` | ✅ | — | Pinned semver of @zapier/zapier-durable used by this version's runs |
|
|
1913
|
+
| ↳ `dependencies` | `object` | ✅ | — | Additional npm dependencies pinned for this version (or null) |
|
|
1914
|
+
| ↳ `created_by_user_id` | `string` | ✅ | — | ID of the user who published this version |
|
|
1915
|
+
| ↳ `created_at` | `string` | ✅ | — | When the version was published (ISO-8601) |
|
|
1916
|
+
| ↳ `trigger` | `object` | ✅ | — | Trigger configuration persisted on this version, or null for webhook-only workflows. |
|
|
1917
|
+
| ↳ `connections` | `object` | ✅ | — | Connection aliases bound on this version (or null). |
|
|
1918
|
+
| ↳ `app_versions` | `object` | ✅ | — | App-version pins bound on this version (or null). |
|
|
1919
|
+
|
|
1920
|
+
**Example:**
|
|
1921
|
+
|
|
1922
|
+
```typescript
|
|
1923
|
+
const { data: workflowVersion } = await zapier.publishWorkflowDraft({
|
|
1924
|
+
workflow: "example-workflow",
|
|
1925
|
+
draft: "example-draft",
|
|
1926
|
+
});
|
|
1927
|
+
```
|
|
1928
|
+
|
|
1869
1929
|
#### `publishWorkflowVersion` 🧪 _experimental_
|
|
1870
1930
|
|
|
1871
1931
|
Publish a new version of a durable workflow. Enables the workflow by default.
|
|
@@ -2039,27 +2099,27 @@ Update (autosave) an open workflow draft
|
|
|
2039
2099
|
|
|
2040
2100
|
**Returns:** `Promise<WorkflowDraftItem>`
|
|
2041
2101
|
|
|
2042
|
-
| Name | Type | Required | Possible Values | Description
|
|
2043
|
-
| ---------------------------- | -------- | -------- | ------------------- |
|
|
2044
|
-
| `data` | `object` | ✅ | — |
|
|
2045
|
-
| ↳ `id` | `string` | ✅ | — | Workflow draft ID (UUID)
|
|
2046
|
-
| ↳ `workflow_id` | `string` | ✅ | — | Parent workflow ID (UUID)
|
|
2047
|
-
| ↳ `slug` | `string` | ✅ | — | Human-friendly identifier for URL routing; unique among open drafts per workflow
|
|
2048
|
-
| ↳ `base_version_id` | `string` | ✅ | — |
|
|
2049
|
-
| ↳ `source_files` | `object` | ✅ | — | Source files keyed by filename → contents
|
|
2050
|
-
| ↳ `zapier_durable_version` | `string` | ✅ | — | Pinned semver of @zapier/zapier-durable used by this draft
|
|
2051
|
-
| ↳ `dependencies` | `object` | ✅ | — | Additional npm dependencies pinned for this draft (or null)
|
|
2052
|
-
| ↳ `draft_revision` | `number` | ✅ | — | Monotonic revision counter for optimistic concurrency. Echo it back on draft updates to detect concurrent edits.
|
|
2053
|
-
| ↳ `status` | `string` | ✅ | `open`, `discarded` | Lifecycle status of a workflow draft.
|
|
2054
|
-
| ↳ `created_by_user_id` | `string` | ✅ | — | ID of the user who created (forked) this draft
|
|
2055
|
-
| ↳ `last_edited_by_user_id` | `string` | ✅ | — | ID of the user who last saved this draft (or null)
|
|
2056
|
-
| ↳ `last_edited_at` | `string` | ✅ | — | When the draft was last edited (ISO-8601, or null)
|
|
2057
|
-
| ↳ `discarded_at` | `string` | ✅ | — | When the draft was discarded (ISO-8601), or null while open
|
|
2058
|
-
| ↳ `created_at` | `string` | ✅ | — | When the draft was created (ISO-8601)
|
|
2059
|
-
| ↳ `updated_at` | `string` | ✅ | — | When the draft row was last updated (ISO-8601)
|
|
2060
|
-
| ↳ `trigger` | `object` | ✅ | — | Trigger configuration held on this draft, or null for webhook-only workflows.
|
|
2061
|
-
| ↳ `connections` | `object` | ✅ | — | Connection aliases bound on this draft (or null).
|
|
2062
|
-
| ↳ `app_versions` | `object` | ✅ | — | App-version pins bound on this draft (or null).
|
|
2102
|
+
| Name | Type | Required | Possible Values | Description |
|
|
2103
|
+
| ---------------------------- | -------- | -------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|
|
2104
|
+
| `data` | `object` | ✅ | — | |
|
|
2105
|
+
| ↳ `id` | `string` | ✅ | — | Workflow draft ID (UUID) |
|
|
2106
|
+
| ↳ `workflow_id` | `string` | ✅ | — | Parent workflow ID (UUID) |
|
|
2107
|
+
| ↳ `slug` | `string` | ✅ | — | Human-friendly identifier for URL routing; unique among open drafts per workflow |
|
|
2108
|
+
| ↳ `base_version_id` | `string` | ✅ | — | The version this draft was forked from (the live version at draft creation), or null when the workflow had no published version yet |
|
|
2109
|
+
| ↳ `source_files` | `object` | ✅ | — | Source files keyed by filename → contents |
|
|
2110
|
+
| ↳ `zapier_durable_version` | `string` | ✅ | — | Pinned semver of @zapier/zapier-durable used by this draft |
|
|
2111
|
+
| ↳ `dependencies` | `object` | ✅ | — | Additional npm dependencies pinned for this draft (or null) |
|
|
2112
|
+
| ↳ `draft_revision` | `number` | ✅ | — | Monotonic revision counter for optimistic concurrency. Echo it back on draft updates to detect concurrent edits. |
|
|
2113
|
+
| ↳ `status` | `string` | ✅ | `open`, `discarded` | Lifecycle status of a workflow draft. |
|
|
2114
|
+
| ↳ `created_by_user_id` | `string` | ✅ | — | ID of the user who created (forked) this draft |
|
|
2115
|
+
| ↳ `last_edited_by_user_id` | `string` | ✅ | — | ID of the user who last saved this draft (or null) |
|
|
2116
|
+
| ↳ `last_edited_at` | `string` | ✅ | — | When the draft was last edited (ISO-8601, or null) |
|
|
2117
|
+
| ↳ `discarded_at` | `string` | ✅ | — | When the draft was discarded (ISO-8601), or null while open |
|
|
2118
|
+
| ↳ `created_at` | `string` | ✅ | — | When the draft was created (ISO-8601) |
|
|
2119
|
+
| ↳ `updated_at` | `string` | ✅ | — | When the draft row was last updated (ISO-8601) |
|
|
2120
|
+
| ↳ `trigger` | `object` | ✅ | — | Trigger configuration held on this draft, or null for webhook-only workflows. |
|
|
2121
|
+
| ↳ `connections` | `object` | ✅ | — | Connection aliases bound on this draft (or null). |
|
|
2122
|
+
| ↳ `app_versions` | `object` | ✅ | — | App-version pins bound on this draft (or null). |
|
|
2063
2123
|
|
|
2064
2124
|
**Example:**
|
|
2065
2125
|
|
|
@@ -5997,7 +5997,7 @@ function parseDeprecationDate(value) {
|
|
|
5997
5997
|
}
|
|
5998
5998
|
|
|
5999
5999
|
// src/sdk-version.ts
|
|
6000
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.
|
|
6000
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.91.1" : void 0) || "unknown";
|
|
6001
6001
|
|
|
6002
6002
|
// src/utils/open-url.ts
|
|
6003
6003
|
var nodePrefix = "node:";
|
|
@@ -10228,12 +10228,18 @@ var runActionPlugin = defineMethod({
|
|
|
10228
10228
|
timeoutMilliseconds
|
|
10229
10229
|
});
|
|
10230
10230
|
if (result.errors && result.errors.length > 0) {
|
|
10231
|
-
const errorMessage2 = result.errors.map(
|
|
10232
|
-
(error) => error.detail || error.title || "Unknown error"
|
|
10233
|
-
).join("; ");
|
|
10231
|
+
const errorMessage2 = result.errors.map((error) => error.detail || error.title || "Unknown error").join("; ");
|
|
10234
10232
|
throw new ZapierActionError(`Action execution failed: ${errorMessage2}`, {
|
|
10235
10233
|
appKey,
|
|
10236
|
-
actionKey
|
|
10234
|
+
actionKey,
|
|
10235
|
+
errors: result.errors.map(
|
|
10236
|
+
(error) => ({
|
|
10237
|
+
status: 200,
|
|
10238
|
+
code: error.code ?? "unknown",
|
|
10239
|
+
title: error.title ?? "",
|
|
10240
|
+
detail: error.detail ?? ""
|
|
10241
|
+
})
|
|
10242
|
+
)
|
|
10237
10243
|
});
|
|
10238
10244
|
}
|
|
10239
10245
|
return {
|
|
@@ -5999,7 +5999,7 @@ function parseDeprecationDate(value) {
|
|
|
5999
5999
|
}
|
|
6000
6000
|
|
|
6001
6001
|
// src/sdk-version.ts
|
|
6002
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.
|
|
6002
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.91.1" : void 0) || "unknown";
|
|
6003
6003
|
|
|
6004
6004
|
// src/utils/open-url.ts
|
|
6005
6005
|
var nodePrefix = "node:";
|
|
@@ -10230,12 +10230,18 @@ var runActionPlugin = defineMethod({
|
|
|
10230
10230
|
timeoutMilliseconds
|
|
10231
10231
|
});
|
|
10232
10232
|
if (result.errors && result.errors.length > 0) {
|
|
10233
|
-
const errorMessage2 = result.errors.map(
|
|
10234
|
-
(error) => error.detail || error.title || "Unknown error"
|
|
10235
|
-
).join("; ");
|
|
10233
|
+
const errorMessage2 = result.errors.map((error) => error.detail || error.title || "Unknown error").join("; ");
|
|
10236
10234
|
throw new ZapierActionError(`Action execution failed: ${errorMessage2}`, {
|
|
10237
10235
|
appKey,
|
|
10238
|
-
actionKey
|
|
10236
|
+
actionKey,
|
|
10237
|
+
errors: result.errors.map(
|
|
10238
|
+
(error) => ({
|
|
10239
|
+
status: 200,
|
|
10240
|
+
code: error.code ?? "unknown",
|
|
10241
|
+
title: error.title ?? "",
|
|
10242
|
+
detail: error.detail ?? ""
|
|
10243
|
+
})
|
|
10244
|
+
)
|
|
10239
10245
|
});
|
|
10240
10246
|
}
|
|
10241
10247
|
return {
|