@zapier/zapier-sdk 0.95.0 → 0.97.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 +12 -0
- package/README.md +101 -19
- package/dist/{chunk-Z7BGM75G.cjs → chunk-H24FJYFA.cjs} +352 -22
- package/dist/{chunk-JZDH3POI.mjs → chunk-RTT7PDNL.mjs} +352 -22
- package/dist/experimental.cjs +735 -382
- package/dist/experimental.d.mts +134 -1
- package/dist/experimental.d.ts +134 -1
- package/dist/experimental.mjs +357 -4
- package/dist/index.cjs +276 -276
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @zapier/zapier-sdk
|
|
2
2
|
|
|
3
|
+
## 0.97.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- abbeb60: Added a `manual` option (experimental) to `publishWorkflowDraft` and `updateWorkflowDraft`, exposed in the CLI as `--manual` on `publish-workflow-draft` and `update-workflow-draft`. Pass `manual: true` to declare a draft (or its publish) on-demand and triggerless; pass `trigger` for a triggered one. The two are mutually exclusive — sending both is rejected with a 400. This extends the `manual` flag `publishWorkflowVersion` already supports (see the previous release) to the draft path.
|
|
8
|
+
|
|
9
|
+
## 0.96.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 2726599: Added `createForm` (experimental) to create Zapier Forms from a title, optional description, and typed field list. Forms publish by default and return a shareable `hosted_url`; pass `draft: true` to save without publishing. A complete `document` can be supplied for layouts the field list cannot express.
|
|
14
|
+
|
|
3
15
|
## 0.95.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -63,6 +63,8 @@
|
|
|
63
63
|
- [`waitForNewConnection`](#waitfornewconnection)
|
|
64
64
|
- [HTTP Requests](#http-requests)
|
|
65
65
|
- [`fetch`](#fetch)
|
|
66
|
+
- [Human Inputs (Experimental)](#human-inputs-experimental)
|
|
67
|
+
- [`createForm`](#createform--experimental)
|
|
66
68
|
- [Tables](#tables)
|
|
67
69
|
- [`createTable`](#createtable)
|
|
68
70
|
- [`createTableFields`](#createtablefields)
|
|
@@ -1949,13 +1951,14 @@ Publish an open draft as a new immutable workflow version. Advances the workflow
|
|
|
1949
1951
|
|
|
1950
1952
|
**Parameters:**
|
|
1951
1953
|
|
|
1952
|
-
| Name | Type | Required | Default | Possible Values | Description
|
|
1953
|
-
| ------------------- | --------- | -------- | ------- | --------------- |
|
|
1954
|
-
| `options` | `object` | ✅ | — | — |
|
|
1955
|
-
| ↳ `workflow` | `string` | ✅ | — | — | Durable workflow ID
|
|
1956
|
-
| ↳ `draft` | `string` | ✅ | — | — | Workflow draft ID
|
|
1957
|
-
| ↳ `enabled` | `boolean` | ❌ | — | — | Set the workflow's enabled state as part of the publish. If omitted, the current enabled state is preserved.
|
|
1958
|
-
| ↳ `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.
|
|
1954
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
1955
|
+
| ------------------- | --------- | -------- | ------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1956
|
+
| `options` | `object` | ✅ | — | — | |
|
|
1957
|
+
| ↳ `workflow` | `string` | ✅ | — | — | Durable workflow ID |
|
|
1958
|
+
| ↳ `draft` | `string` | ✅ | — | — | Workflow draft ID |
|
|
1959
|
+
| ↳ `enabled` | `boolean` | ❌ | — | — | Set the workflow's enabled state as part of the publish. If omitted, the current enabled state is preserved. |
|
|
1960
|
+
| ↳ `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. |
|
|
1961
|
+
| ↳ `manual` | `boolean` | ❌ | — | — | Declare this publish on-demand and triggerless, overriding the draft's stored intent for this publish only. Pass `manual: true` only when the draft has no trigger configured; the API rejects a draft with a trigger published as `manual: true` as a contradiction (400). |
|
|
1959
1962
|
|
|
1960
1963
|
**Returns:** `Promise<PublishWorkflowDraftResponse>`
|
|
1961
1964
|
|
|
@@ -2162,18 +2165,19 @@ Update (autosave) an open workflow draft
|
|
|
2162
2165
|
|
|
2163
2166
|
**Parameters:**
|
|
2164
2167
|
|
|
2165
|
-
| Name | Type
|
|
2166
|
-
| -------------------------- |
|
|
2167
|
-
| `options` | `object`
|
|
2168
|
-
| ↳ `workflow` | `string`
|
|
2169
|
-
| ↳ `draft` | `string`
|
|
2170
|
-
| ↳ `sourceFiles` | `object`
|
|
2171
|
-
| ↳ `zapierDurableVersion` | `string`
|
|
2172
|
-
| ↳ `dependencies` | `object`
|
|
2173
|
-
| ↳ `draftRevision` | `number`
|
|
2174
|
-
| ↳ `trigger` | `object`
|
|
2175
|
-
| ↳ `connections` | `object`
|
|
2176
|
-
| ↳ `appVersions` | `object`
|
|
2168
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
2169
|
+
| -------------------------- | --------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
2170
|
+
| `options` | `object` | ✅ | — | — | |
|
|
2171
|
+
| ↳ `workflow` | `string` | ✅ | — | — | Durable workflow ID |
|
|
2172
|
+
| ↳ `draft` | `string` | ✅ | — | — | Workflow draft ID |
|
|
2173
|
+
| ↳ `sourceFiles` | `object` | ✅ | — | — | Source files keyed by filename → contents |
|
|
2174
|
+
| ↳ `zapierDurableVersion` | `string` | ❌ | — | — | Exact semver of @zapier/zapier-durable to use (e.g. "1.2.3"). Leaves the stored pin unchanged if omitted. |
|
|
2175
|
+
| ↳ `dependencies` | `object` | ❌ | — | — | Optional npm package dependencies |
|
|
2176
|
+
| ↳ `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. |
|
|
2177
|
+
| ↳ `trigger` | `object` | ❌ | — | — | Trigger configuration. Omit to leave the stored trigger unchanged, pass null to clear it, or pass an object to replace it; for an on-demand, triggerless workflow, clear this and pass `manual: true` instead. |
|
|
2178
|
+
| ↳ `connections` | `object` | ❌ | — | — | Map of connection aliases to Zapier connections used by the workflow. Pass `null` to clear an existing binding. |
|
|
2179
|
+
| ↳ `appVersions` | `object` | ❌ | — | — | Map of app keys to pinned app implementation/version used by the workflow. Pass `null` to clear an existing binding. |
|
|
2180
|
+
| ↳ `manual` | `boolean` | ❌ | — | — | Declare this draft on-demand and triggerless. Pass `manual: true` only when omitting `trigger` (or clearing it with `trigger: null`); passing both is a contradiction the API rejects with a 400. Setting a `trigger` later clears a previously stored `manual: true`. |
|
|
2177
2181
|
|
|
2178
2182
|
**Returns:** `Promise<WorkflowDraftItem>`
|
|
2179
2183
|
|
|
@@ -2592,6 +2596,84 @@ Make authenticated HTTP requests to any API through Zapier. Pass a connectionId
|
|
|
2592
2596
|
const result = await zapier.fetch("https://example.com", {});
|
|
2593
2597
|
```
|
|
2594
2598
|
|
|
2599
|
+
### Human Inputs (Experimental)
|
|
2600
|
+
|
|
2601
|
+
> ℹ️ **Experimental.** Import from `"@zapier/zapier-sdk/experimental"` to use these methods. Methods and behavior may change.
|
|
2602
|
+
|
|
2603
|
+
#### `createForm` 🧪 _experimental_
|
|
2604
|
+
|
|
2605
|
+
Create a Zapier Form from a title and optional fields. Forms publish by default and return a shareable `hosted_url`; set `draft` to save without publishing.
|
|
2606
|
+
|
|
2607
|
+
**Parameters:**
|
|
2608
|
+
|
|
2609
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
2610
|
+
| ------------------------- | ---------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
2611
|
+
| `options` | `object` | ✅ | — | — | |
|
|
2612
|
+
| ↳ `title` | `string` | ✅ | — | — | The title shown in the Forms UI and on the form. |
|
|
2613
|
+
| ↳ `description` | `string` | ❌ | — | — | An optional description of the form. |
|
|
2614
|
+
| ↳ `fields[]` | `object[]` | ❌ | — | — | Initial fields to add to the form. |
|
|
2615
|
+
| ↳ `label` | `string` | ✅ | — | — | Human-readable label shown above the input. |
|
|
2616
|
+
| ↳ `type` | `string` | ✅ | — | `short_text`, `long_text`, `email`, `number`, `yes_no`, `url`, `date`, `date_range`, `currency`, `phone_number`, `dropdown`, `integration_backed` | The type of field. |
|
|
2617
|
+
| ↳ `required` | `boolean` | ❌ | — | — | Whether the field must be answered before the form can submit. |
|
|
2618
|
+
| ↳ `disabled` | `boolean` | ❌ | — | — | When true, the field is rendered read-only — shown but not editable. A rendering hint only; it is not enforced during submission validation. |
|
|
2619
|
+
| ↳ `variant` | `string` | ❌ | — | `checkbox`, `radio` | For `yes_no` fields: `checkbox` renders a single toggle, `radio` renders explicit yes/no buttons. Defaults to `checkbox`. |
|
|
2620
|
+
| ↳ `multiUrl` | `boolean` | ❌ | — | — | For `url` fields: when true the field accepts a list of URLs, otherwise a single URL. Defaults to false. |
|
|
2621
|
+
| ↳ `includeTime` | `boolean` | ❌ | — | — | For `date` and `date_range` fields: when true the picker also captures a time. Defaults to false. |
|
|
2622
|
+
| ↳ `currencyFormat` | `string` | ❌ | — | — | For `currency` fields: ISO 4217 currency code (e.g. `usd`, `eur`). Controls the symbol shown in the form UI. |
|
|
2623
|
+
| ↳ `decimals` | `literal` | ❌ | — | — | For `currency` fields: allowed decimal places. `0` for whole numbers, `2` for up to two decimal places. Defaults to `2`. |
|
|
2624
|
+
| ↳ `defaultCountry` | `string` | ❌ | — | — | For `phone_number` fields: ISO 3166-1 alpha-2 code for the default selected country (e.g. `US`). Defaults to `US`. |
|
|
2625
|
+
| ↳ `phoneNumberFormat` | `string` | ❌ | — | `national`, `international` | For `phone_number` fields: `national` omits the country-code prefix, `international` includes it. Defaults to `national`. |
|
|
2626
|
+
| ↳ `acceptedCountries` | `array` | ❌ | — | — | For `phone_number` fields: restrict input to specific ISO 3166-1 alpha-2 country codes. Omit to allow all countries. |
|
|
2627
|
+
| ↳ `options[]` | `object[]` | ❌ | — | — | For `dropdown` fields: the selectable options. At least one is required. |
|
|
2628
|
+
| ↳ `value` | `string` | ✅ | — | — | The value submitted when this option is selected. |
|
|
2629
|
+
| ↳ `label` | `string` | ✅ | — | — | Human-readable label shown to the user. |
|
|
2630
|
+
| ↳ `multiSelect` | `boolean` | ❌ | — | — | For `dropdown` fields: when true the user may select multiple options. Defaults to false. |
|
|
2631
|
+
| ↳ `dataSource` | `object` | ❌ | — | — | For `integration_backed` fields: where to fetch the field's options from at render time. |
|
|
2632
|
+
| ↳ `app` | `string` | ✅ | — | — | Zapier app to pull options from. See `listApps` for the catalog. |
|
|
2633
|
+
| ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk` | Whether the data source returns a single record (`read`) or a collection (`read_bulk`). |
|
|
2634
|
+
| ↳ `resource` | `string` | ✅ | — | — | Resource name within the app — typically a trigger or search key from the app's definition. |
|
|
2635
|
+
| ↳ `valueKey` | `string` | ❌ | — | — | Property on each returned record to use as the submitted option value. Defaults to `id`. |
|
|
2636
|
+
| ↳ `labelKey` | `string` | ❌ | — | — | Property on each returned record to use as the displayed option label. Defaults to a sensible name field. |
|
|
2637
|
+
| ↳ `draft` | `boolean` | ❌ | — | — | When true, save without publishing. Omit to publish immediately, making `hosted_url` live. |
|
|
2638
|
+
| ↳ `confirmationTitle` | `string` | ❌ | — | — | Heading shown to the respondent after they submit. Omit to use the form renderer's default. |
|
|
2639
|
+
| ↳ `confirmationMessage` | `string` | ❌ | — | — | Message shown to the respondent after they submit, below the confirmation title. Omit to use the form renderer's default. |
|
|
2640
|
+
| ↳ `callbackUrl` | `string` | ❌ | — | — | Absolute http/https URL notified with the submission JSON each time the form is answered. |
|
|
2641
|
+
| ↳ `consumerAuth` | `string` | ❌ | — | `none`, `zapier` | Who may open the published form. `none` (the default) leaves it public to anyone with the link; `zapier` requires the visitor to be signed in to Zapier on the form's owning account. |
|
|
2642
|
+
| ↳ `document` | `object` | ❌ | — | — | Escape hatch: a complete form document tree, sent as-is. When supplied it replaces the document built from `fields`, and `title`, `description`, `confirmationTitle`, and `confirmationMessage` are ignored. Use only for structures the flat field list cannot express, such as approval decisions or multi-column row layout. |
|
|
2643
|
+
| ↳ `id` | `string` | ✅ | — | — | |
|
|
2644
|
+
| ↳ `type` | `string` | ✅ | — | `root` | |
|
|
2645
|
+
| ↳ `attrs` | `object` | ✅ | — | — | |
|
|
2646
|
+
| ↳ `schema_version` | `number` | ✅ | — | — | |
|
|
2647
|
+
| ↳ `title` | `string` | ✅ | — | — | |
|
|
2648
|
+
| ↳ `children` | `array` | ❌ | — | — | |
|
|
2649
|
+
|
|
2650
|
+
**Returns:** `Promise<FormItem>`
|
|
2651
|
+
|
|
2652
|
+
| Name | Type | Required | Possible Values | Description |
|
|
2653
|
+
| ----------------------- | --------- | -------- | --------------- | ----------- |
|
|
2654
|
+
| `data` | `object` | ✅ | — | |
|
|
2655
|
+
| ↳ `id` | `string` | ✅ | — | |
|
|
2656
|
+
| ↳ `title` | `string` | ✅ | — | |
|
|
2657
|
+
| ↳ `description` | `string` | ❌ | — | |
|
|
2658
|
+
| ↳ `hosted_url` | `string` | ✅ | — | |
|
|
2659
|
+
| ↳ `submission_count` | `number` | ✅ | — | |
|
|
2660
|
+
| ↳ `account_id` | `number` | ✅ | — | |
|
|
2661
|
+
| ↳ `owner_id` | `string` | ✅ | — | |
|
|
2662
|
+
| ↳ `created_at` | `string` | ✅ | — | |
|
|
2663
|
+
| ↳ `updated_at` | `string` | ✅ | — | |
|
|
2664
|
+
| ↳ `document` | `unknown` | ✅ | — | |
|
|
2665
|
+
| ↳ `last_published_at` | `string` | ✅ | — | |
|
|
2666
|
+
| ↳ `consumer_auth` | `unknown` | ✅ | — | |
|
|
2667
|
+
| ↳ `callback_url` | `unknown` | ✅ | — | |
|
|
2668
|
+
|
|
2669
|
+
**Example:**
|
|
2670
|
+
|
|
2671
|
+
```typescript
|
|
2672
|
+
const { data: form } = await zapier.createForm({
|
|
2673
|
+
title: "example-title",
|
|
2674
|
+
});
|
|
2675
|
+
```
|
|
2676
|
+
|
|
2595
2677
|
### Tables
|
|
2596
2678
|
|
|
2597
2679
|
#### `createTable`
|