@zapier/zapier-sdk 0.88.1 → 0.90.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,22 @@
1
1
  # @zapier/zapier-sdk
2
2
 
3
+ ## 0.90.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f6eac6f: Added `createWorkflowDraft`, `updateWorkflowDraft`, and `discardWorkflowDraft` (experimental), completing the draft lifecycle alongside the existing read methods.
8
+ - `createWorkflowDraft` forks a new draft from the workflow's live version, with an optional `slug`.
9
+ - `updateWorkflowDraft` saves draft edits — source files, dependencies, trigger, connections, and app-version pins. Pass `draftRevision` to reject the save with a `ZapierConflictError` if the draft changed since it was last read; pass `null` for `trigger`, `connections`, or `appVersions` to clear the stored value, or omit them to leave it unchanged.
10
+ - `discardWorkflowDraft` soft-deletes a draft and returns it with status `discarded`.
11
+
12
+ All ID inputs are UUID-validated at the boundary.
13
+
14
+ ## 0.89.0
15
+
16
+ ### Minor Changes
17
+
18
+ - e24c236: Added `listWorkflowDrafts` and `getWorkflowDraft` (experimental). `listWorkflowDrafts` is paginated (cursor + pageSize), returns a workflow's drafts most recently edited first, and filters by `status` (server default: open) or exact `slug`. `getWorkflowDraft` returns the full draft state including `source_files` and `draft_revision`, the draft's optimistic-concurrency counter. CLI commands taking a draft id present an interactive picker. All ID inputs are UUID-validated at the boundary.
19
+
3
20
  ## 0.88.1
4
21
 
5
22
  ### Patch Changes
package/README.md CHANGED
@@ -29,15 +29,19 @@
29
29
  - [Code Workflows (Experimental)](#code-workflows-experimental)
30
30
  - [`cancelDurableRun`](#canceldurablerun--experimental)
31
31
  - [`createWorkflow`](#createworkflow--experimental)
32
+ - [`createWorkflowDraft`](#createworkflowdraft--experimental)
32
33
  - [`deleteWorkflow`](#deleteworkflow--experimental)
33
34
  - [`disableWorkflow`](#disableworkflow--experimental)
35
+ - [`discardWorkflowDraft`](#discardworkflowdraft--experimental)
34
36
  - [`enableWorkflow`](#enableworkflow--experimental)
35
37
  - [`getDurableRun`](#getdurablerun--experimental)
36
38
  - [`getTriggerRun`](#gettriggerrun--experimental)
37
39
  - [`getWorkflow`](#getworkflow--experimental)
40
+ - [`getWorkflowDraft`](#getworkflowdraft--experimental)
38
41
  - [`getWorkflowRun`](#getworkflowrun--experimental)
39
42
  - [`getWorkflowVersion`](#getworkflowversion--experimental)
40
43
  - [`listDurableRuns`](#listdurableruns--experimental)
44
+ - [`listWorkflowDrafts`](#listworkflowdrafts--experimental)
41
45
  - [`listWorkflowRuns`](#listworkflowruns--experimental)
42
46
  - [`listWorkflowVersions`](#listworkflowversions--experimental)
43
47
  - [`listWorkflows`](#listworkflows--experimental)
@@ -45,6 +49,7 @@
45
49
  - [`runDurable`](#rundurable--experimental)
46
50
  - [`triggerWorkflow`](#triggerworkflow--experimental)
47
51
  - [`updateWorkflow`](#updateworkflow--experimental)
52
+ - [`updateWorkflowDraft`](#updateworkflowdraft--experimental)
48
53
  - [Connections](#connections)
49
54
  - [`createConnection`](#createconnection)
50
55
  - [`findFirstConnection`](#findfirstconnection)
@@ -1177,6 +1182,50 @@ const { data: workflow } = await zapier.createWorkflow({
1177
1182
  });
1178
1183
  ```
1179
1184
 
1185
+ #### `createWorkflowDraft` 🧪 _experimental_
1186
+
1187
+ Fork a new draft from the workflow's current live version (or a blank stub before the first publish)
1188
+
1189
+ **Parameters:**
1190
+
1191
+ | Name | Type | Required | Default | Possible Values | Description |
1192
+ | -------------- | -------- | -------- | ------- | --------------- | ---------------------------------------------------------------------- |
1193
+ | `options` | `object` | ✅ | — | — | |
1194
+ | ​ ↳ `workflow` | `string` | ✅ | — | — | Durable workflow ID |
1195
+ | ​ ↳ `slug` | `string` | ❌ | — | — | Optional slug for URL routing. When omitted, the server generates one. |
1196
+
1197
+ **Returns:** `Promise<WorkflowDraftItem>`
1198
+
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` | ✅ | — | Live version at draft creation or last publish rebase, or null before the workflow's first publish |
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). |
1220
+
1221
+ **Example:**
1222
+
1223
+ ```typescript
1224
+ const { data: workflowDraft } = await zapier.createWorkflowDraft({
1225
+ workflow: "example-workflow",
1226
+ });
1227
+ ```
1228
+
1180
1229
  #### `deleteWorkflow` 🧪 _experimental_
1181
1230
 
1182
1231
  Delete a durable workflow. Throws `ZapierNotFoundError` if the workflow doesn't exist; callers wanting idempotency should catch that themselves.
@@ -1230,6 +1279,51 @@ const { data: workflow } = await zapier.disableWorkflow({
1230
1279
  });
1231
1280
  ```
1232
1281
 
1282
+ #### `discardWorkflowDraft` 🧪 _experimental_
1283
+
1284
+ Discard an open workflow draft (soft delete). The draft's unpublished edits stop resolving; the published version is untouched.
1285
+
1286
+ **Parameters:**
1287
+
1288
+ | Name | Type | Required | Default | Possible Values | Description |
1289
+ | -------------- | -------- | -------- | ------- | --------------- | ------------------- |
1290
+ | `options` | `object` | ✅ | — | — | |
1291
+ | ​ ↳ `workflow` | `string` | ✅ | — | — | Durable workflow ID |
1292
+ | ​ ↳ `draft` | `string` | ✅ | — | — | Workflow draft ID |
1293
+
1294
+ **Returns:** `Promise<WorkflowDraftItem>`
1295
+
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` | ✅ | — | Live version at draft creation or last publish rebase, or null before the workflow's first publish |
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). |
1317
+
1318
+ **Example:**
1319
+
1320
+ ```typescript
1321
+ const result = await zapier.discardWorkflowDraft({
1322
+ workflow: "example-workflow",
1323
+ draft: "example-draft",
1324
+ });
1325
+ ```
1326
+
1233
1327
  #### `enableWorkflow` 🧪 _experimental_
1234
1328
 
1235
1329
  Enable a durable workflow so it accepts triggers
@@ -1379,6 +1473,51 @@ const { data: workflow } = await zapier.getWorkflow({
1379
1473
  });
1380
1474
  ```
1381
1475
 
1476
+ #### `getWorkflowDraft` 🧪 _experimental_
1477
+
1478
+ Get full details of a workflow draft including source files
1479
+
1480
+ **Parameters:**
1481
+
1482
+ | Name | Type | Required | Default | Possible Values | Description |
1483
+ | -------------- | -------- | -------- | ------- | --------------- | ------------------- |
1484
+ | `options` | `object` | ✅ | — | — | |
1485
+ | ​ ↳ `workflow` | `string` | ✅ | — | — | Durable workflow ID |
1486
+ | ​ ↳ `draft` | `string` | ✅ | — | — | Workflow draft ID |
1487
+
1488
+ **Returns:** `Promise<WorkflowDraftItem>`
1489
+
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` | ✅ | — | Live version at draft creation or last publish rebase, or null before the workflow's first publish |
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). |
1511
+
1512
+ **Example:**
1513
+
1514
+ ```typescript
1515
+ const { data: workflowDraft } = await zapier.getWorkflowDraft({
1516
+ workflow: "example-workflow",
1517
+ draft: "example-draft",
1518
+ });
1519
+ ```
1520
+
1382
1521
  #### `getWorkflowRun` 🧪 _experimental_
1383
1522
 
1384
1523
  Get the current state of a workflow run (a triggered execution of a deployed workflow)
@@ -1498,6 +1637,64 @@ for await (const durableRun of zapier.listDurableRuns().items()) {
1498
1637
  }
1499
1638
  ```
1500
1639
 
1640
+ #### `listWorkflowDrafts` 🧪 _experimental_
1641
+
1642
+ List drafts for a workflow, most recently edited first (open drafts by default)
1643
+
1644
+ **Parameters:**
1645
+
1646
+ | Name | Type | Required | Default | Possible Values | Description |
1647
+ | -------------- | -------- | -------- | ------- | ------------------- | ----------------------------------------------------- |
1648
+ | `options` | `object` | ✅ | — | — | |
1649
+ | ​ ↳ `workflow` | `string` | ✅ | — | — | Durable workflow ID |
1650
+ | ​ ↳ `status` | `string` | ❌ | — | `open`, `discarded` | Filter by draft status (server default: open) |
1651
+ | ​ ↳ `slug` | `string` | ❌ | — | — | Filter by exact slug match; returns at most one draft |
1652
+ | ​ ↳ `pageSize` | `number` | ❌ | — | — | Number of drafts per page (max 100) |
1653
+ | ​ ↳ `cursor` | `string` | ❌ | — | — | Pagination cursor |
1654
+ | ​ ↳ `maxItems` | `number` | ❌ | — | — | Maximum total drafts to return across all pages |
1655
+
1656
+ **Returns:** `Promise<PaginatedResult<WorkflowDraftItem>>`
1657
+
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` | ✅ | — | Live version at draft creation or last publish rebase, or null before the workflow's first publish |
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 |
1670
+
1671
+ **Example:**
1672
+
1673
+ ```typescript
1674
+ // Get first page and a cursor for the second page
1675
+ const { data: workflowDrafts, nextCursor } = await zapier.listWorkflowDrafts({
1676
+ workflow: "example-workflow",
1677
+ });
1678
+
1679
+ // Or iterate over all pages
1680
+ for await (const page of zapier
1681
+ .listWorkflowDrafts({
1682
+ workflow: "example-workflow",
1683
+ })
1684
+ .pages()) {
1685
+ // Do something with each page
1686
+ }
1687
+
1688
+ // Or iterate over individual items across all pages
1689
+ for await (const workflowDraft of zapier
1690
+ .listWorkflowDrafts({
1691
+ workflow: "example-workflow",
1692
+ })
1693
+ .items()) {
1694
+ // Do something with each workflowDraft
1695
+ }
1696
+ ```
1697
+
1501
1698
  #### `listWorkflowRuns` 🧪 _experimental_
1502
1699
 
1503
1700
  List workflow runs (triggered executions) for a specific deployed workflow, newest first
@@ -1821,6 +2018,59 @@ const { data: workflow } = await zapier.updateWorkflow({
1821
2018
  });
1822
2019
  ```
1823
2020
 
2021
+ #### `updateWorkflowDraft` 🧪 _experimental_
2022
+
2023
+ Update (autosave) an open workflow draft
2024
+
2025
+ **Parameters:**
2026
+
2027
+ | Name | Type | Required | Default | Possible Values | Description |
2028
+ | -------------------------- | -------- | -------- | ------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2029
+ | `options` | `object` | ✅ | — | — | |
2030
+ | ​ ↳ `workflow` | `string` | ✅ | — | — | Durable workflow ID |
2031
+ | ​ ↳ `draft` | `string` | ✅ | — | — | Workflow draft ID |
2032
+ | ​ ↳ `sourceFiles` | `object` | ✅ | — | — | Source files keyed by filename → contents |
2033
+ | ​ ↳ `zapierDurableVersion` | `string` | ❌ | — | — | Exact semver of @zapier/zapier-durable to use (e.g. "1.2.3"). Leaves the stored pin unchanged if omitted. |
2034
+ | ​ ↳ `dependencies` | `object` | ❌ | — | — | Optional npm package dependencies |
2035
+ | ​ ↳ `draftRevision` | `number` | ❌ | — | — | Expected draft revision for optimistic concurrency. Pass the revision from the last read; the server rejects the save with a conflict if the draft has changed since. Omit to skip the check. |
2036
+ | ​ ↳ `trigger` | `object` | ❌ | — | — | Trigger configuration. Omit to leave the stored trigger unchanged, pass null to clear it, or pass an object to replace it. |
2037
+ | ​ ↳ `connections` | `object` | ❌ | — | — | Map of connection aliases to Zapier connections used by the workflow. Pass `null` to clear an existing binding. |
2038
+ | ​ ↳ `appVersions` | `object` | ❌ | — | — | Map of app keys to pinned app implementation/version used by the workflow. Pass `null` to clear an existing binding. |
2039
+
2040
+ **Returns:** `Promise<WorkflowDraftItem>`
2041
+
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` | ✅ | — | Live version at draft creation or last publish rebase, or null before the workflow's first publish |
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). |
2063
+
2064
+ **Example:**
2065
+
2066
+ ```typescript
2067
+ const { data: workflowDraft } = await zapier.updateWorkflowDraft({
2068
+ workflow: "example-workflow",
2069
+ draft: "example-draft",
2070
+ sourceFiles: {},
2071
+ });
2072
+ ```
2073
+
1824
2074
  ### Connections
1825
2075
 
1826
2076
  #### `createConnection`
@@ -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.88.1" : void 0) || "unknown";
6000
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.90.0" : void 0) || "unknown";
6001
6001
 
6002
6002
  // src/utils/open-url.ts
6003
6003
  var nodePrefix = "node:";
@@ -9255,6 +9255,29 @@ var workflowVersionIdResolver = defineResolver({
9255
9255
  })
9256
9256
  });
9257
9257
 
9258
+ // src/resolvers/workflowDraftId.ts
9259
+ var listWorkflowDraftsRef = declareMethod({ id: "listWorkflowDrafts" });
9260
+ var workflowDraftIdResolver = defineResolver({
9261
+ imports: [listWorkflowDraftsRef],
9262
+ requireParameters: ["workflow"],
9263
+ listItems: ({
9264
+ imports,
9265
+ input,
9266
+ cursor
9267
+ }) => imports.listWorkflowDrafts({
9268
+ workflow: input.workflow,
9269
+ cursor
9270
+ }),
9271
+ prompt: ({ items }) => ({
9272
+ type: "list",
9273
+ message: "Select a workflow draft:",
9274
+ choices: items.map((d) => ({
9275
+ label: `${d.slug} \u2014 last edited ${d.last_edited_at ?? "never"}`,
9276
+ value: d.id
9277
+ }))
9278
+ })
9279
+ });
9280
+
9258
9281
  // src/resolvers/workflowRunId.ts
9259
9282
  var listWorkflowRunsRef = declareMethod({ id: "listWorkflowRuns" });
9260
9283
  var workflowRunIdResolver = defineResolver({
@@ -15633,4 +15656,4 @@ var registryPlugin = (_sdk) => {
15633
15656
  return {};
15634
15657
  };
15635
15658
 
15636
- export { API_ID, ActionKeyPropertySchema, ActionPropertySchema, ActionTimeoutMillisecondsPropertySchema, ActionTimeoutSecondsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AppPropertySchema, AppsPropertySchema, AuthMechanism, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, CONNECTIONS_ID, CONTEXT, CONTEXT_CACHE_MAX_SIZE, CONTEXT_CACHE_TTL_MILLISECONDS, CORE_ERROR_SYMBOL, CORE_OPTIONS_ID, CORE_SIGNAL_SYMBOL, ClientCredentialsObjectSchema, ConnectionEntrySchema, ConnectionIdPropertySchema, ConnectionPropertySchema, ConnectionsMapSchema, ConnectionsPropertySchema, CoreCancelledSignal, CoreDisposeError, CoreErrorCode, CoreSignal, CredentialsFunctionSchema, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MILLISECONDS, DEFAULT_APPROVAL_TIMEOUT_MILLISECONDS, DEFAULT_CONFIG_PATH, DEFAULT_MAX_APPROVAL_RETRIES, DEFAULT_PAGE_SIZE, DEPRECATION_NOTICE_EVENT, DebugPropertySchema, DrainTriggerInboxSchema, EVENT_EMISSION_ID, FieldsPropertySchema, InputFieldPropertySchema, InputsPropertySchema, LeaseLimitPropertySchema, LeasePropertySchema, LeaseSecondsPropertySchema, LimitPropertySchema, MANIFEST_ID, MAX_CONCURRENCY_LIMIT, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RESOLVE_CREDENTIALS_ID, RecordPropertySchema, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, SDK_OPTIONS_ID, TablePropertySchema, TablesPropertySchema, TriggerInboxKeyPropertySchema, TriggerInboxNamePropertySchema, TriggerInboxPropertySchema, WatchTriggerInboxSchema, ZAPIER_BASE_URL, ZAPIER_MAX_CONCURRENT_REQUESTS, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MILLISECONDS, ZapierAbortDrainSignal, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierApprovalError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierConflictError, ZapierError, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierReleaseTriggerMessageSignal, ZapierResourceNotFoundError, ZapierSignal, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, addPlugin, apiPlugin, apiPluginRef, appKeyResolver, appsPlugin, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, cleanupEventListeners, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, composePlugins, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, connectionsPluginRef, createBaseEvent, createClientCredentialsPlugin, createController, createCorePlugin, createFunction, createMemoryCache, createPaginatedFunction, createPaginatedPluginMethod, createPluginMethod, createPluginStack, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierApi, createZapierSdk, createZapierSdkWithoutRegistry, declareMethod, declareOptionalProperty, declarePlugin, declareProperty, defineFormatter, defineLegacyMerge, defineMethod, defineMethodOverride, definePlugin, defineProperty, defineResolver, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, disposeSdk, durableRunIdResolver, eventEmissionHookPlugin, eventEmissionPlugin, eventEmissionPluginRef, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, fromFunctionPlugin, generateEventId, getActionInputFieldsSchemaPlugin, getActionPlugin, getAgent, getAppPlugin, getBaseUrlFromCredentials, getCallerContext, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getContext, getCoreErrorCause, getCoreErrorCode, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOrCreateApiClient, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getRegistryPlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, getTtyContext, getZapierApprovalMode, getZapierDefaultApprovalMode, getZapierOpenAutoModeApprovalsInBrowser, getZapierSdkService, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCoreCancelledSignal, isCoreError, isCoreSignal, isCredentialsFunction, isCredentialsObject, isPermanentHttpError, isPkceCredentials, isPositional, isZapierAbortDrainSignal, isZapierActionError, isZapierAppNotFoundError, isZapierApprovalError, isZapierAuthenticationError, isZapierBundleError, isZapierConflictError, isZapierError, isZapierNotFoundError, isZapierRateLimitError, isZapierReleaseTriggerMessageSignal, isZapierResourceNotFoundError, isZapierSignal, isZapierTimeoutError, isZapierValidationError, listActionInputFieldChoicesPlugin, listActionInputFieldsPlugin, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listTableFieldsPlugin, listTableRecordsPlugin, listTablesPlugin, logDeprecation2 as logDeprecation, manifestPlugin, manifestPluginRef, omitExports, openEnum, operationAnnotatorPlugin, parseConcurrencyEnvVar, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings2 as resetDeprecationWarnings, resolveAuth, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, resolveCredentialsPlugin, resolveCredentialsPluginRef, resolvePlugin, runActionPlugin, runInMethodScope, runWithCallerContext, runWithTelemetryContext, sdkOptionsPluginRef, selectExports, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, triggerInboxResolver, triggerMessagesResolver, updateTableRecordsPlugin, workflowIdResolver, workflowRunIdResolver, workflowVersionIdResolver, zapierAdaptError, zapierCoreOptions, zapierSdkPlugin };
15659
+ export { API_ID, ActionKeyPropertySchema, ActionPropertySchema, ActionTimeoutMillisecondsPropertySchema, ActionTimeoutSecondsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AppPropertySchema, AppsPropertySchema, AuthMechanism, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, CONNECTIONS_ID, CONTEXT, CONTEXT_CACHE_MAX_SIZE, CONTEXT_CACHE_TTL_MILLISECONDS, CORE_ERROR_SYMBOL, CORE_OPTIONS_ID, CORE_SIGNAL_SYMBOL, ClientCredentialsObjectSchema, ConnectionEntrySchema, ConnectionIdPropertySchema, ConnectionPropertySchema, ConnectionsMapSchema, ConnectionsPropertySchema, CoreCancelledSignal, CoreDisposeError, CoreErrorCode, CoreSignal, CredentialsFunctionSchema, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MILLISECONDS, DEFAULT_APPROVAL_TIMEOUT_MILLISECONDS, DEFAULT_CONFIG_PATH, DEFAULT_MAX_APPROVAL_RETRIES, DEFAULT_PAGE_SIZE, DEPRECATION_NOTICE_EVENT, DebugPropertySchema, DrainTriggerInboxSchema, EVENT_EMISSION_ID, FieldsPropertySchema, InputFieldPropertySchema, InputsPropertySchema, LeaseLimitPropertySchema, LeasePropertySchema, LeaseSecondsPropertySchema, LimitPropertySchema, MANIFEST_ID, MAX_CONCURRENCY_LIMIT, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RESOLVE_CREDENTIALS_ID, RecordPropertySchema, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, SDK_OPTIONS_ID, TablePropertySchema, TablesPropertySchema, TriggerInboxKeyPropertySchema, TriggerInboxNamePropertySchema, TriggerInboxPropertySchema, WatchTriggerInboxSchema, ZAPIER_BASE_URL, ZAPIER_MAX_CONCURRENT_REQUESTS, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MILLISECONDS, ZapierAbortDrainSignal, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierApprovalError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierConflictError, ZapierError, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierReleaseTriggerMessageSignal, ZapierResourceNotFoundError, ZapierSignal, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, addPlugin, apiPlugin, apiPluginRef, appKeyResolver, appsPlugin, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, cleanupEventListeners, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, composePlugins, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, connectionsPluginRef, createBaseEvent, createClientCredentialsPlugin, createController, createCorePlugin, createFunction, createMemoryCache, createPaginatedFunction, createPaginatedPluginMethod, createPluginMethod, createPluginStack, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierApi, createZapierSdk, createZapierSdkWithoutRegistry, declareMethod, declareOptionalProperty, declarePlugin, declareProperty, defineFormatter, defineLegacyMerge, defineMethod, defineMethodOverride, definePlugin, defineProperty, defineResolver, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, disposeSdk, durableRunIdResolver, eventEmissionHookPlugin, eventEmissionPlugin, eventEmissionPluginRef, extractErrorDetail, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, fromFunctionPlugin, generateEventId, getActionInputFieldsSchemaPlugin, getActionPlugin, getAgent, getAppPlugin, getBaseUrlFromCredentials, getCallerContext, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getContext, getCoreErrorCause, getCoreErrorCode, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOrCreateApiClient, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getRegistryPlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, getTtyContext, getZapierApprovalMode, getZapierDefaultApprovalMode, getZapierOpenAutoModeApprovalsInBrowser, getZapierSdkService, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCoreCancelledSignal, isCoreError, isCoreSignal, isCredentialsFunction, isCredentialsObject, isPermanentHttpError, isPkceCredentials, isPositional, isZapierAbortDrainSignal, isZapierActionError, isZapierAppNotFoundError, isZapierApprovalError, isZapierAuthenticationError, isZapierBundleError, isZapierConflictError, isZapierError, isZapierNotFoundError, isZapierRateLimitError, isZapierReleaseTriggerMessageSignal, isZapierResourceNotFoundError, isZapierSignal, isZapierTimeoutError, isZapierValidationError, listActionInputFieldChoicesPlugin, listActionInputFieldsPlugin, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listTableFieldsPlugin, listTableRecordsPlugin, listTablesPlugin, logDeprecation2 as logDeprecation, manifestPlugin, manifestPluginRef, omitExports, openEnum, operationAnnotatorPlugin, parseConcurrencyEnvVar, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings2 as resetDeprecationWarnings, resolveAuth, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, resolveCredentialsPlugin, resolveCredentialsPluginRef, resolvePlugin, runActionPlugin, runInMethodScope, runWithCallerContext, runWithTelemetryContext, sdkOptionsPluginRef, selectExports, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, triggerInboxResolver, triggerMessagesResolver, updateTableRecordsPlugin, workflowDraftIdResolver, workflowIdResolver, workflowRunIdResolver, workflowVersionIdResolver, zapierAdaptError, zapierCoreOptions, zapierSdkPlugin };
@@ -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.88.1" : void 0) || "unknown";
6002
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.90.0" : void 0) || "unknown";
6003
6003
 
6004
6004
  // src/utils/open-url.ts
6005
6005
  var nodePrefix = "node:";
@@ -9257,6 +9257,29 @@ var workflowVersionIdResolver = defineResolver({
9257
9257
  })
9258
9258
  });
9259
9259
 
9260
+ // src/resolvers/workflowDraftId.ts
9261
+ var listWorkflowDraftsRef = declareMethod({ id: "listWorkflowDrafts" });
9262
+ var workflowDraftIdResolver = defineResolver({
9263
+ imports: [listWorkflowDraftsRef],
9264
+ requireParameters: ["workflow"],
9265
+ listItems: ({
9266
+ imports,
9267
+ input,
9268
+ cursor
9269
+ }) => imports.listWorkflowDrafts({
9270
+ workflow: input.workflow,
9271
+ cursor
9272
+ }),
9273
+ prompt: ({ items }) => ({
9274
+ type: "list",
9275
+ message: "Select a workflow draft:",
9276
+ choices: items.map((d) => ({
9277
+ label: `${d.slug} \u2014 last edited ${d.last_edited_at ?? "never"}`,
9278
+ value: d.id
9279
+ }))
9280
+ })
9281
+ });
9282
+
9260
9283
  // src/resolvers/workflowRunId.ts
9261
9284
  var listWorkflowRunsRef = declareMethod({ id: "listWorkflowRuns" });
9262
9285
  var workflowRunIdResolver = defineResolver({
@@ -15785,6 +15808,7 @@ exports.durableRunIdResolver = durableRunIdResolver;
15785
15808
  exports.eventEmissionHookPlugin = eventEmissionHookPlugin;
15786
15809
  exports.eventEmissionPlugin = eventEmissionPlugin;
15787
15810
  exports.eventEmissionPluginRef = eventEmissionPluginRef;
15811
+ exports.extractErrorDetail = extractErrorDetail;
15788
15812
  exports.fetchPlugin = fetchPlugin;
15789
15813
  exports.findFirstConnectionPlugin = findFirstConnectionPlugin;
15790
15814
  exports.findManifestEntry = findManifestEntry;
@@ -15902,6 +15926,7 @@ exports.toTitleCase = toTitleCase;
15902
15926
  exports.triggerInboxResolver = triggerInboxResolver;
15903
15927
  exports.triggerMessagesResolver = triggerMessagesResolver;
15904
15928
  exports.updateTableRecordsPlugin = updateTableRecordsPlugin;
15929
+ exports.workflowDraftIdResolver = workflowDraftIdResolver;
15905
15930
  exports.workflowIdResolver = workflowIdResolver;
15906
15931
  exports.workflowRunIdResolver = workflowRunIdResolver;
15907
15932
  exports.workflowVersionIdResolver = workflowVersionIdResolver;