@zapier/zapier-sdk 0.87.1 → 0.88.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 +22 -0
- package/README.md +44 -44
- package/dist/{chunk-WVAZCBUJ.mjs → chunk-BLFXMYSW.mjs} +467 -215
- package/dist/{chunk-S6IN256D.cjs → chunk-KQTYZL5Y.cjs} +473 -219
- package/dist/define.d.mts +2 -2
- package/dist/define.d.ts +2 -2
- package/dist/experimental.cjs +354 -346
- package/dist/experimental.d.mts +20 -2
- package/dist/experimental.d.ts +20 -2
- package/dist/experimental.mjs +2 -2
- package/dist/{index-CBvczsOD.d.mts → index-DeefnmJr.d.mts} +221 -28
- package/dist/{index-CBvczsOD.d.ts → index-DeefnmJr.d.ts} +221 -28
- package/dist/index.cjs +282 -274
- 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.88.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 60892be: _This release contains no user-facing changes._
|
|
8
|
+
|
|
9
|
+
## 0.88.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 0e49ffa: Renamed time-duration options and parameters so every one carries its unit as a full-word suffix. Coarse durations (timeouts, waits, the retry-delay cap) now take **seconds**; genuinely sub-second knobs (poll cadence, the low-level `poll` primitive) take **milliseconds**. The old names still work but are deprecated — a caller passing a deprecated `*Ms` name keeps its millisecond meaning, so nothing changes silently; only the new names adopt the new unit.
|
|
14
|
+
|
|
15
|
+
| Before | After |
|
|
16
|
+
| --------------------------------------------------------------------------- | --------------------------------------------------------- |
|
|
17
|
+
| `createZapierSdk({ maxNetworkRetryDelayMs })` | `createZapierSdk({ maxNetworkRetryDelaySeconds })` |
|
|
18
|
+
| `createZapierSdk({ approvalTimeoutMs })` | `createZapierSdk({ approvalTimeoutSeconds })` |
|
|
19
|
+
| `runAction({ timeoutMs })` (and `sdk.apps.<app>.<action>`) | `runAction({ timeoutSeconds })` |
|
|
20
|
+
| `sdk.fetch(url, { maxTime })` | `sdk.fetch(url, { maxTimeSeconds })` |
|
|
21
|
+
| `createConnection` / `waitForNewConnection` `{ timeoutMs, pollIntervalMs }` | `{ timeoutSeconds, pollIntervalMilliseconds }` |
|
|
22
|
+
| `ApiClient.poll({ timeoutMs, initialDelay })` | `poll({ timeoutMilliseconds, initialDelayMilliseconds })` |
|
|
23
|
+
| env `ZAPIER_MAX_NETWORK_RETRY_DELAY_MS` | env `ZAPIER_MAX_NETWORK_RETRY_DELAY_SECONDS` |
|
|
24
|
+
|
|
3
25
|
## 0.87.1
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -359,9 +359,9 @@ The `createZapierSdk(...)` factory function is the main entry point for the SDK.
|
|
|
359
359
|
| `baseUrl` | `string` | ❌ | — | — | Base URL for Zapier API endpoints. |
|
|
360
360
|
| `trackingBaseUrl` | `string` | ❌ | — | — | Base URL for Zapier tracking endpoints. |
|
|
361
361
|
| `maxNetworkRetries` | `number` | ❌ | — | — | Max retries for rate-limited requests (default: 3). |
|
|
362
|
-
| `
|
|
362
|
+
| `maxNetworkRetryDelaySeconds` | `number` | ❌ | — | — | Max delay in seconds to wait for a rate-limit retry (default: 60). |
|
|
363
363
|
| `maxConcurrentRequests` | `number, literal` | ❌ | — | — | Max concurrent in-flight HTTP requests (default: 200, max: 10000). |
|
|
364
|
-
| `
|
|
364
|
+
| `approvalTimeoutSeconds` | `number` | ❌ | — | — | Timeout in seconds for approval polling. Default: 600 (10 min). |
|
|
365
365
|
| `maxApprovalRetries` | `number` | ❌ | — | — | Maximum number of sequential approval rounds per request (one per gating policy) before giving up. Default: 2. |
|
|
366
366
|
| `approvalMode` | `string` | ❌ | — | `disabled`, `poll`, `throw` | Approval flow behavior for manual approvals. "poll" creates the approval, opens it in a browser, polls until resolved, and retries the original request. "throw" creates the manual approval and throws a ZapierApprovalError with the approval URL so the caller can surface it. Server-created auto-mode approvals always poll until they reach a terminal status and retry the original request on approval, even when this option is "throw". "disabled" throws a ZapierApprovalError on approval-required responses without creating an approval. Resolution order is: explicit option, then ZAPIER_APPROVAL_MODE, then the default behavior (poll for interactive TTY, throw otherwise). |
|
|
367
367
|
| `openAutoModeApprovalsInBrowser` | `boolean` | ❌ | — | — | By default, auto-mode approvals do not open in a browser. Enable this option to open the approval URL and watch the approval process. Resolution order is: explicit option, then ZAPIER_OPEN_AUTO_MODE_APPROVALS_IN_BROWSER, then false. |
|
|
@@ -752,18 +752,18 @@ Execute an action with the given inputs
|
|
|
752
752
|
|
|
753
753
|
**Parameters:**
|
|
754
754
|
|
|
755
|
-
| Name
|
|
756
|
-
|
|
|
757
|
-
| `options`
|
|
758
|
-
| ↳ `app`
|
|
759
|
-
| ↳ `actionType`
|
|
760
|
-
| ↳ `action`
|
|
761
|
-
| ↳ `connection`
|
|
762
|
-
| ↳ `inputs`
|
|
763
|
-
| ↳ `
|
|
764
|
-
| ↳ `pageSize`
|
|
765
|
-
| ↳ `maxItems`
|
|
766
|
-
| ↳ `cursor`
|
|
755
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
756
|
+
| -------------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
757
|
+
| `options` | `object` | ✅ | — | — | |
|
|
758
|
+
| ↳ `app` | `string` | ✅ | — | — | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
|
|
759
|
+
| ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
|
|
760
|
+
| ↳ `action` | `string` | ✅ | — | — | Action key (e.g., 'send_message' or 'find_row') |
|
|
761
|
+
| ↳ `connection` | `string, number` | ❌ | — | — | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. Mutually exclusive with connectionId. |
|
|
762
|
+
| ↳ `inputs` | `object` | ❌ | — | — | Input parameters for the action |
|
|
763
|
+
| ↳ `timeoutSeconds` | `number` | ❌ | — | — | Maximum time to wait for action completion in seconds (default: 180) |
|
|
764
|
+
| ↳ `pageSize` | `number` | ❌ | — | — | Number of results per page |
|
|
765
|
+
| ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
|
|
766
|
+
| ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
|
|
767
767
|
|
|
768
768
|
**Returns:** `Promise<PaginatedResult<ActionResultItem>>`
|
|
769
769
|
|
|
@@ -827,12 +827,12 @@ Execute an action with the given inputs for the bound app, as an alternative to
|
|
|
827
827
|
|
|
828
828
|
**Parameters:**
|
|
829
829
|
|
|
830
|
-
| Name
|
|
831
|
-
|
|
|
832
|
-
| `options`
|
|
833
|
-
| ↳ `inputs`
|
|
834
|
-
| ↳ `connection`
|
|
835
|
-
| ↳ `
|
|
830
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
831
|
+
| -------------------- | ---------------- | -------- | ------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
832
|
+
| `options` | `object` | ✅ | — | — | |
|
|
833
|
+
| ↳ `inputs` | `object` | ❌ | — | — | |
|
|
834
|
+
| ↳ `connection` | `string, number` | ❌ | — | — | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. |
|
|
835
|
+
| ↳ `timeoutSeconds` | `number` | ❌ | — | — | Maximum time to wait for action completion in seconds (default: 180) |
|
|
836
836
|
|
|
837
837
|
**Returns:** `Promise<PaginatedResult<ActionResultItem>>`
|
|
838
838
|
|
|
@@ -1831,13 +1831,13 @@ This is the right command for most callers. Reach for the lower-level building b
|
|
|
1831
1831
|
|
|
1832
1832
|
**Parameters:**
|
|
1833
1833
|
|
|
1834
|
-
| Name
|
|
1835
|
-
|
|
|
1836
|
-
| `options`
|
|
1837
|
-
| ↳ `app`
|
|
1838
|
-
| ↳ `browser`
|
|
1839
|
-
| ↳ `
|
|
1840
|
-
| ↳ `
|
|
1834
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
1835
|
+
| ------------------------------ | -------- | -------- | -------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1836
|
+
| `options` | `object` | ✅ | — | — | |
|
|
1837
|
+
| ↳ `app` | `string` | ✅ | — | — | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
|
|
1838
|
+
| ↳ `browser` | `string` | ❌ | `"auto"` | `auto`, `always`, `never` | When to auto-open the URL in a browser. `auto` (default) opens in local sessions and skips opening in CI / SSH / headless-Linux. `always` forces the open attempt. `never` skips it. The URL is always printed to stderr regardless — a failed or skipped open degrades gracefully to copy-paste. |
|
|
1839
|
+
| ↳ `timeoutSeconds` | `number` | ❌ | — | — | How long to wait for the user to complete the connection flow before giving up. Default 5 minutes (300). |
|
|
1840
|
+
| ↳ `pollIntervalMilliseconds` | `number` | ❌ | — | — | Delay before the first poll request, in ms. Default 3 seconds (3_000). Subsequent polling cadence is managed by the SDK's polling primitive (backoff with sane defaults). |
|
|
1841
1841
|
|
|
1842
1842
|
**Returns:** `Promise<ConnectionItem>`
|
|
1843
1843
|
|
|
@@ -2151,13 +2151,13 @@ const { data: conn } = await zapier.waitForNewConnection({ app, startedAt });
|
|
|
2151
2151
|
|
|
2152
2152
|
**Parameters:**
|
|
2153
2153
|
|
|
2154
|
-
| Name
|
|
2155
|
-
|
|
|
2156
|
-
| `options`
|
|
2157
|
-
| ↳ `app`
|
|
2158
|
-
| ↳ `startedAt`
|
|
2159
|
-
| ↳ `
|
|
2160
|
-
| ↳ `
|
|
2154
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
2155
|
+
| ------------------------------ | -------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
2156
|
+
| `options` | `object` | ✅ | — | — | |
|
|
2157
|
+
| ↳ `app` | `string` | ✅ | — | — | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
|
|
2158
|
+
| ↳ `startedAt` | `number` | ✅ | — | — | Unix timestamp (seconds). Only connections whose `date` is at or after this value count as 'new'. Prefer the `startedAt` returned by `get-connection-start-url` — it's server-stamped, so the comparison isn't thrown off by client clock skew. If you mint the timestamp yourself, capture it _before_ showing the start URL so a fast OAuth completion isn't missed. |
|
|
2159
|
+
| ↳ `timeoutSeconds` | `number` | ❌ | — | — | How long to wait before giving up. Default 5 minutes (300). |
|
|
2160
|
+
| ↳ `pollIntervalMilliseconds` | `number` | ❌ | — | — | Delay before the first poll request, in ms. Default 3 seconds (3_000). Subsequent polling cadence is managed by the SDK's polling primitive (backoff with sane defaults). |
|
|
2161
2161
|
|
|
2162
2162
|
**Returns:** `Promise<ConnectionItem>`
|
|
2163
2163
|
|
|
@@ -2185,16 +2185,16 @@ Make authenticated HTTP requests to any API through Zapier. Pass a connectionId
|
|
|
2185
2185
|
|
|
2186
2186
|
**Parameters:**
|
|
2187
2187
|
|
|
2188
|
-
| Name
|
|
2189
|
-
|
|
|
2190
|
-
| `url`
|
|
2191
|
-
| `init`
|
|
2192
|
-
| ↳ `method`
|
|
2193
|
-
| ↳ `headers`
|
|
2194
|
-
| ↳ `body`
|
|
2195
|
-
| ↳ `connection`
|
|
2196
|
-
| ↳ `callbackUrl`
|
|
2197
|
-
| ↳ `
|
|
2188
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
2189
|
+
| -------------------- | ------------------------ | -------- | ------- | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
2190
|
+
| `url` | `string, custom` | ✅ | — | — | The full URL of the API endpoint to call (proxied through Zapier's Relay service) |
|
|
2191
|
+
| `init` | `object` | ❌ | — | — | Request options including method, headers, body, and authentication |
|
|
2192
|
+
| ↳ `method` | `string` | ❌ | — | `GET`, `POST`, `PUT`, `DELETE`, `PATCH`, `HEAD`, `OPTIONS` | HTTP method for the request (defaults to GET) |
|
|
2193
|
+
| ↳ `headers` | `object` | ❌ | — | — | HTTP headers to include in the request |
|
|
2194
|
+
| ↳ `body` | `string, custom, record` | ❌ | — | — | Request body — plain objects and JSON strings are auto-detected and Content-Type is set accordingly |
|
|
2195
|
+
| ↳ `connection` | `string, number` | ❌ | — | — | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. |
|
|
2196
|
+
| ↳ `callbackUrl` | `string` | ❌ | — | — | URL to send async response to (makes request async) |
|
|
2197
|
+
| ↳ `maxTimeSeconds` | `number` | ❌ | — | — | Maximum seconds to wait for a response. Honored on a best-effort basis; the server may silently enforce a lower ceiling. |
|
|
2198
2198
|
|
|
2199
2199
|
**Returns:** `Promise<Response>`
|
|
2200
2200
|
|