@zapier/zapier-sdk-cli 0.44.1 โ 0.46.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 +18 -0
- package/README.md +381 -29
- package/bin/zapier-sdk-experimental.mjs +14 -0
- package/dist/cli.cjs +608 -38
- package/dist/cli.mjs +607 -37
- package/dist/experimental.cjs +3519 -0
- package/dist/experimental.d.mts +39 -0
- package/dist/experimental.d.ts +39 -0
- package/dist/experimental.mjs +3483 -0
- package/dist/index.cjs +507 -26
- package/dist/index.d.mts +3 -514
- package/dist/index.d.ts +3 -514
- package/dist/index.mjs +505 -24
- package/dist/package.json +14 -2
- package/dist/sdk-B3nKAZdN.d.mts +516 -0
- package/dist/sdk-B3nKAZdN.d.ts +516 -0
- package/dist/src/cli.js +26 -2
- package/dist/src/experimental.d.ts +33 -0
- package/dist/src/experimental.js +83 -0
- package/dist/src/generators/ast-generator.d.ts +2 -2
- package/dist/src/generators/ast-generator.js +1 -1
- package/dist/src/plugins/add/index.d.ts +2 -2
- package/dist/src/plugins/bundleCode/index.js +3 -12
- package/dist/src/plugins/curl/index.js +2 -2
- package/dist/src/plugins/curl/utils.d.ts +11 -1
- package/dist/src/plugins/curl/utils.js +14 -5
- package/dist/src/plugins/drainTriggerInbox/index.d.ts +46 -0
- package/dist/src/plugins/drainTriggerInbox/index.js +178 -0
- package/dist/src/plugins/generateAppTypes/index.d.ts +2 -2
- package/dist/src/plugins/index.d.ts +2 -0
- package/dist/src/plugins/index.js +2 -0
- package/dist/src/plugins/mcp/index.d.ts +1 -0
- package/dist/src/plugins/mcp/index.js +5 -1
- package/dist/src/plugins/watchTriggerInbox/index.d.ts +45 -0
- package/dist/src/plugins/watchTriggerInbox/index.js +157 -0
- package/dist/src/sdk.js +5 -1
- package/dist/src/utils/cli-generator.js +18 -1
- package/dist/src/utils/cli-renderer.d.ts +12 -0
- package/dist/src/utils/cli-renderer.js +22 -1
- package/dist/src/utils/parameter-resolver.d.ts +1 -0
- package/dist/src/utils/parameter-resolver.js +81 -10
- package/dist/src/utils/triggerDrain.d.ts +144 -0
- package/dist/src/utils/triggerDrain.js +351 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +16 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @zapier/zapier-sdk-cli
|
|
2
2
|
|
|
3
|
+
## 0.46.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 774e9d3: Add `(Enter custom value)` sentinel to dynamic-resolver dropdowns in the CLI. Selecting it opens a free-text prompt and returns the typed value, so users can supply IDs that aren't in the fetched list without rerunning the command with a CLI flag. Shown for every single-select dynamic resolver; suppressed on checkbox (multi-select) prompts where a typed scalar can't merge with the user's other selections.
|
|
8
|
+
|
|
9
|
+
## 0.45.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 529663c: Add experimental support for triggers.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [529663c]
|
|
18
|
+
- @zapier/zapier-sdk-mcp@0.13.0
|
|
19
|
+
- @zapier/zapier-sdk@0.49.0
|
|
20
|
+
|
|
3
21
|
## 0.44.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
- [`logout`](#logout)
|
|
14
14
|
- [Actions](#actions)
|
|
15
15
|
- [`get-action`](#get-action)
|
|
16
|
-
- [`get-input-fields-schema`](#get-input-fields-schema)
|
|
16
|
+
- [`get-action-input-fields-schema`](#get-action-input-fields-schema)
|
|
17
|
+
- [`list-action-input-field-choices`](#list-action-input-field-choices)
|
|
18
|
+
- [`list-action-input-fields`](#list-action-input-fields)
|
|
17
19
|
- [`list-actions`](#list-actions)
|
|
18
|
-
- [`list-input-field-choices`](#list-input-field-choices)
|
|
19
|
-
- [`list-input-fields`](#list-input-fields)
|
|
20
20
|
- [`run-action`](#run-action)
|
|
21
21
|
- [Apps](#apps)
|
|
22
22
|
- [`get-app`](#get-app)
|
|
@@ -45,6 +45,24 @@
|
|
|
45
45
|
- [`list-table-records`](#list-table-records)
|
|
46
46
|
- [`list-tables`](#list-tables)
|
|
47
47
|
- [`update-table-records`](#update-table-records)
|
|
48
|
+
- [Triggers (Experimental)](#triggers-experimental)
|
|
49
|
+
- [`ack-trigger-inbox-messages`](#ack-trigger-inbox-messages--experimental)
|
|
50
|
+
- [`create-trigger-inbox`](#create-trigger-inbox--experimental)
|
|
51
|
+
- [`delete-trigger-inbox`](#delete-trigger-inbox--experimental)
|
|
52
|
+
- [`drain-trigger-inbox`](#drain-trigger-inbox--experimental)
|
|
53
|
+
- [`ensure-trigger-inbox`](#ensure-trigger-inbox--experimental)
|
|
54
|
+
- [`get-trigger-inbox`](#get-trigger-inbox--experimental)
|
|
55
|
+
- [`get-trigger-input-fields-schema`](#get-trigger-input-fields-schema--experimental)
|
|
56
|
+
- [`lease-trigger-inbox-messages`](#lease-trigger-inbox-messages--experimental)
|
|
57
|
+
- [`list-trigger-inbox-messages`](#list-trigger-inbox-messages--experimental)
|
|
58
|
+
- [`list-trigger-inboxes`](#list-trigger-inboxes--experimental)
|
|
59
|
+
- [`list-trigger-input-field-choices`](#list-trigger-input-field-choices--experimental)
|
|
60
|
+
- [`list-trigger-input-fields`](#list-trigger-input-fields--experimental)
|
|
61
|
+
- [`pause-trigger-inbox`](#pause-trigger-inbox--experimental)
|
|
62
|
+
- [`release-trigger-inbox-messages`](#release-trigger-inbox-messages--experimental)
|
|
63
|
+
- [`resume-trigger-inbox`](#resume-trigger-inbox--experimental)
|
|
64
|
+
- [`update-trigger-inbox`](#update-trigger-inbox--experimental)
|
|
65
|
+
- [`watch-trigger-inbox`](#watch-trigger-inbox--experimental)
|
|
48
66
|
- [Utilities](#utilities)
|
|
49
67
|
- [`add`](#add)
|
|
50
68
|
- [`build-manifest`](#build-manifest)
|
|
@@ -195,7 +213,7 @@ Get detailed information about a specific action
|
|
|
195
213
|
npx zapier-sdk get-action <app> <action-type> <action>
|
|
196
214
|
```
|
|
197
215
|
|
|
198
|
-
#### `get-input-fields-schema`
|
|
216
|
+
#### `get-action-input-fields-schema`
|
|
199
217
|
|
|
200
218
|
Get the JSON Schema representation of input fields for an action. Returns a JSON Schema object describing the structure, types, and validation rules for the action's input parameters.
|
|
201
219
|
|
|
@@ -212,30 +230,10 @@ Get the JSON Schema representation of input fields for an action. Returns a JSON
|
|
|
212
230
|
**Usage:**
|
|
213
231
|
|
|
214
232
|
```bash
|
|
215
|
-
npx zapier-sdk get-input-fields-schema <app> <action-type> <action> [--connection] [--inputs]
|
|
233
|
+
npx zapier-sdk get-action-input-fields-schema <app> <action-type> <action> [--connection] [--inputs]
|
|
216
234
|
```
|
|
217
235
|
|
|
218
|
-
#### `list-
|
|
219
|
-
|
|
220
|
-
List all actions for a specific app
|
|
221
|
-
|
|
222
|
-
**Options:**
|
|
223
|
-
|
|
224
|
-
| Option | Type | Required | Default | Possible Values | Description |
|
|
225
|
-
| --------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
|
|
226
|
-
| `<app>` | `string` | โ
| โ | โ | App key of actions to list (e.g., 'SlackCLIAPI' or slug like 'github') |
|
|
227
|
-
| `--action-type` | `string` | โ | โ | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Filter actions by type |
|
|
228
|
-
| `--page-size` | `number` | โ | โ | โ | Number of actions per page |
|
|
229
|
-
| `--max-items` | `number` | โ | โ | โ | Maximum total items to return across all pages |
|
|
230
|
-
| `--cursor` | `string` | โ | โ | โ | Cursor to start from |
|
|
231
|
-
|
|
232
|
-
**Usage:**
|
|
233
|
-
|
|
234
|
-
```bash
|
|
235
|
-
npx zapier-sdk list-actions <app> [--action-type] [--page-size] [--max-items] [--cursor]
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
#### `list-input-field-choices`
|
|
236
|
+
#### `list-action-input-field-choices`
|
|
239
237
|
|
|
240
238
|
Get the available choices for a dynamic dropdown input field
|
|
241
239
|
|
|
@@ -257,10 +255,10 @@ Get the available choices for a dynamic dropdown input field
|
|
|
257
255
|
**Usage:**
|
|
258
256
|
|
|
259
257
|
```bash
|
|
260
|
-
npx zapier-sdk list-input-field-choices <app> <action-type> <action> <input-field> [--connection] [--inputs] [--page] [--page-size] [--max-items] [--cursor]
|
|
258
|
+
npx zapier-sdk list-action-input-field-choices <app> <action-type> <action> <input-field> [--connection] [--inputs] [--page] [--page-size] [--max-items] [--cursor]
|
|
261
259
|
```
|
|
262
260
|
|
|
263
|
-
#### `list-input-fields`
|
|
261
|
+
#### `list-action-input-fields`
|
|
264
262
|
|
|
265
263
|
Get the input fields required for a specific action
|
|
266
264
|
|
|
@@ -280,7 +278,27 @@ Get the input fields required for a specific action
|
|
|
280
278
|
**Usage:**
|
|
281
279
|
|
|
282
280
|
```bash
|
|
283
|
-
npx zapier-sdk list-input-fields <app> <action-type> <action> [--connection] [--inputs] [--page-size] [--max-items] [--cursor]
|
|
281
|
+
npx zapier-sdk list-action-input-fields <app> <action-type> <action> [--connection] [--inputs] [--page-size] [--max-items] [--cursor]
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
#### `list-actions`
|
|
285
|
+
|
|
286
|
+
List all actions for a specific app
|
|
287
|
+
|
|
288
|
+
**Options:**
|
|
289
|
+
|
|
290
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
291
|
+
| --------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
|
|
292
|
+
| `<app>` | `string` | โ
| โ | โ | App key of actions to list (e.g., 'SlackCLIAPI' or slug like 'github') |
|
|
293
|
+
| `--action-type` | `string` | โ | โ | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Filter actions by type |
|
|
294
|
+
| `--page-size` | `number` | โ | โ | โ | Number of actions per page |
|
|
295
|
+
| `--max-items` | `number` | โ | โ | โ | Maximum total items to return across all pages |
|
|
296
|
+
| `--cursor` | `string` | โ | โ | โ | Cursor to start from |
|
|
297
|
+
|
|
298
|
+
**Usage:**
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
npx zapier-sdk list-actions <app> [--action-type] [--page-size] [--max-items] [--cursor]
|
|
284
302
|
```
|
|
285
303
|
|
|
286
304
|
#### `run-action`
|
|
@@ -750,6 +768,340 @@ Update one or more records in a table
|
|
|
750
768
|
npx zapier-sdk update-table-records <table> <records> [--key-mode]
|
|
751
769
|
```
|
|
752
770
|
|
|
771
|
+
### Triggers (Experimental)
|
|
772
|
+
|
|
773
|
+
> Experimental. Run via the `zapier-sdk-experimental` bin (or pass `--experimental` to `zapier-sdk`). Flags and behavior may change between versions, and availabilitiy may be limited to some users.
|
|
774
|
+
|
|
775
|
+
#### `ack-trigger-inbox-messages` ๐งช _experimental_
|
|
776
|
+
|
|
777
|
+
Acknowledge messages from a lease. Acked messages are removed from the inbox; unacked ones return to the available pool when the lease expires.
|
|
778
|
+
|
|
779
|
+
**Options:**
|
|
780
|
+
|
|
781
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
782
|
+
| ------------ | -------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
783
|
+
| `<inbox>` | `string` | โ
| โ | โ | Trigger inbox identifier โ UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
|
|
784
|
+
| `<lease>` | `string` | โ
| โ | โ | Lease ID returned from leaseTriggerInboxMessages |
|
|
785
|
+
| `--messages` | `array` | โ | โ | โ | Specific message IDs to ack. Omit to ack every message in the lease. |
|
|
786
|
+
|
|
787
|
+
**Usage:**
|
|
788
|
+
|
|
789
|
+
```bash
|
|
790
|
+
npx zapier-sdk ack-trigger-inbox-messages <inbox> <lease> [--messages]
|
|
791
|
+
```
|
|
792
|
+
|
|
793
|
+
#### `create-trigger-inbox` ๐งช _experimental_
|
|
794
|
+
|
|
795
|
+
Create a new trigger inbox subscription with an auto-generated name. Always creates; use ensureTriggerInbox for get-or-create on a stable name.
|
|
796
|
+
|
|
797
|
+
**Options:**
|
|
798
|
+
|
|
799
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
800
|
+
| -------------------- | ---------------- | -------- | ------- | --------------- | ------------------------------------------------------------------------------------------------------------ |
|
|
801
|
+
| `<app>` | `string` | โ
| โ | โ | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
|
|
802
|
+
| `<action>` | `string` | โ
| โ | โ | Action key (e.g., 'send_message' or 'find_row') |
|
|
803
|
+
| `--connection` | `string, number` | โ | โ | โ | Connection alias or connection ID. Optional for triggers that don't require auth. |
|
|
804
|
+
| `--inputs` | `object` | โ | โ | โ | Input parameters for the trigger subscription |
|
|
805
|
+
| `--notification-url` | `string` | โ | โ | โ | Webhook URL to POST to when new messages arrive |
|
|
806
|
+
|
|
807
|
+
**Usage:**
|
|
808
|
+
|
|
809
|
+
```bash
|
|
810
|
+
npx zapier-sdk create-trigger-inbox <app> <action> [--connection] [--inputs] [--notification-url]
|
|
811
|
+
```
|
|
812
|
+
|
|
813
|
+
#### `delete-trigger-inbox` ๐งช _experimental_
|
|
814
|
+
|
|
815
|
+
Mark a trigger inbox for deletion
|
|
816
|
+
|
|
817
|
+
**Options:**
|
|
818
|
+
|
|
819
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
820
|
+
| --------- | -------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
821
|
+
| `<inbox>` | `string` | โ
| โ | โ | Trigger inbox identifier โ UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
|
|
822
|
+
|
|
823
|
+
**Usage:**
|
|
824
|
+
|
|
825
|
+
```bash
|
|
826
|
+
npx zapier-sdk delete-trigger-inbox <inbox>
|
|
827
|
+
```
|
|
828
|
+
|
|
829
|
+
#### `drain-trigger-inbox` ๐งช _experimental_
|
|
830
|
+
|
|
831
|
+
Drain an existing trigger inbox: lease currently-available messages, process each via onMessage, return when the inbox is empty, maxMessages is reached, or the abort signal fires.
|
|
832
|
+
|
|
833
|
+
**Options:**
|
|
834
|
+
|
|
835
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
836
|
+
| --------------------- | --------- | -------- | ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
837
|
+
| `<inbox>` | `string` | โ
| โ | โ | Trigger inbox identifier โ UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
|
|
838
|
+
| `--concurrency` | `number` | โ | โ | โ | Per-message handler workers running in parallel. Defaults to `leaseLimit`, or 1 if neither is set. |
|
|
839
|
+
| `--lease-limit` | `number` | โ | โ | โ | Per-lease HTTP batch size. Defaults to `concurrency`, or 1 if neither is set. |
|
|
840
|
+
| `--lease-seconds` | `number` | โ | โ | โ | Seconds until the lease expires; messages return to available if not acked. API default is 300 (5 minutes). |
|
|
841
|
+
| `--release-on-error` | `boolean` | โ | โ | โ | If true, errors immediately release the message. If false (default), errors leave it leased until the lease timeout. `ZapierReleaseTriggerMessageSignal` always releases regardless. |
|
|
842
|
+
| `--continue-on-error` | `boolean` | โ | โ | โ | If false (default, fail-fast), the first handler error rejects and stops the drain. If true, handler errors are observed via `onError` and the drain continues. SDK-level errors (lease / ack / release) reject regardless. |
|
|
843
|
+
| `--max-messages` | `number` | โ | โ | โ | Cap total messages drained. Defaults to draining the inbox until empty. |
|
|
844
|
+
| `--exec` | `string` | โ | โ | โ | Run a binary per message with no shell interpretation. Message JSON is piped to stdin; exit code 0 acks, non-zero records the error per the same rules as a thrown handler. Pass extra argv after `--` (e.g. `--exec ./handler -- --verbose`). Mutually exclusive with --exec-shell and --json. |
|
|
845
|
+
| `--exec-shell` | `string` | โ | โ | โ | Run a shell command per message. Message JSON is piped to the subprocess on stdin; exit code 0 acks, non-zero records the error per the same rules as a thrown handler. Interpreted by the platform's default shell (sh on POSIX, cmd.exe on Windows). Mutually exclusive with --exec and --json. |
|
|
846
|
+
| `--json` | `boolean` | โ | โ | โ | Format the drained result as a JSON object on stdout: { data, errors }. Use for scripts or piping. Mutually exclusive with --exec / --exec-shell and the interactive default. |
|
|
847
|
+
|
|
848
|
+
**Usage:**
|
|
849
|
+
|
|
850
|
+
```bash
|
|
851
|
+
npx zapier-sdk drain-trigger-inbox <inbox> [--concurrency] [--lease-limit] [--lease-seconds] [--release-on-error] [--continue-on-error] [--max-messages] [--exec] [--exec-shell] [--json]
|
|
852
|
+
```
|
|
853
|
+
|
|
854
|
+
#### `ensure-trigger-inbox` ๐งช _experimental_
|
|
855
|
+
|
|
856
|
+
Get-or-create a trigger inbox by name. Idempotent on (user, account, name): returns the existing inbox if a matching subscription is registered, creates a new one otherwise. Throws ZapierConflictError if the name exists with a different subscription.
|
|
857
|
+
|
|
858
|
+
**Options:**
|
|
859
|
+
|
|
860
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
861
|
+
| -------------------- | ---------------- | -------- | ------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
862
|
+
| `<name>` | `string` | โ
| โ | โ | Inbox name; serves as the idempotency key. Required for ensureTriggerInbox โ without one, the API mints a fresh inbox each call (use createTriggerInbox for that path). |
|
|
863
|
+
| `<app>` | `string` | โ
| โ | โ | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
|
|
864
|
+
| `<action>` | `string` | โ
| โ | โ | Action key (e.g., 'send_message' or 'find_row') |
|
|
865
|
+
| `--connection` | `string, number` | โ | โ | โ | Connection alias or connection ID. Optional for triggers that don't require auth. |
|
|
866
|
+
| `--inputs` | `object` | โ | โ | โ | Input parameters for the trigger subscription |
|
|
867
|
+
| `--notification-url` | `string` | โ | โ | โ | Webhook URL to POST to when new messages arrive |
|
|
868
|
+
|
|
869
|
+
**Usage:**
|
|
870
|
+
|
|
871
|
+
```bash
|
|
872
|
+
npx zapier-sdk ensure-trigger-inbox <name> <app> <action> [--connection] [--inputs] [--notification-url]
|
|
873
|
+
```
|
|
874
|
+
|
|
875
|
+
#### `get-trigger-inbox` ๐งช _experimental_
|
|
876
|
+
|
|
877
|
+
Get details of a trigger inbox by ID
|
|
878
|
+
|
|
879
|
+
**Options:**
|
|
880
|
+
|
|
881
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
882
|
+
| --------- | -------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
883
|
+
| `<inbox>` | `string` | โ
| โ | โ | Trigger inbox identifier โ UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
|
|
884
|
+
|
|
885
|
+
**Usage:**
|
|
886
|
+
|
|
887
|
+
```bash
|
|
888
|
+
npx zapier-sdk get-trigger-inbox <inbox>
|
|
889
|
+
```
|
|
890
|
+
|
|
891
|
+
#### `get-trigger-input-fields-schema` ๐งช _experimental_
|
|
892
|
+
|
|
893
|
+
Get the JSON Schema representation of input fields for a trigger. Returns a JSON Schema object describing the structure, types, and validation rules for the trigger's input parameters.
|
|
894
|
+
|
|
895
|
+
**Options:**
|
|
896
|
+
|
|
897
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
898
|
+
| -------------- | ---------------- | -------- | ------- | --------------- | ------------------------------------------------------------------------------------------------------------ |
|
|
899
|
+
| `<app>` | `string` | โ
| โ | โ | App key (e.g., 'SlackCLIAPI' or slug like 'github') to get the input schema for |
|
|
900
|
+
| `<action>` | `string` | โ
| โ | โ | Trigger action key to get the input schema for |
|
|
901
|
+
| `--connection` | `string, number` | โ | โ | โ | Connection alias or connection ID. Required if the trigger needs a connection to determine available fields. |
|
|
902
|
+
| `--inputs` | `object` | โ | โ | โ | Current input values that may affect the schema (e.g., when fields depend on other field values) |
|
|
903
|
+
|
|
904
|
+
**Usage:**
|
|
905
|
+
|
|
906
|
+
```bash
|
|
907
|
+
npx zapier-sdk get-trigger-input-fields-schema <app> <action> [--connection] [--inputs]
|
|
908
|
+
```
|
|
909
|
+
|
|
910
|
+
#### `lease-trigger-inbox-messages` ๐งช _experimental_
|
|
911
|
+
|
|
912
|
+
Lease up to N messages from a trigger inbox. Returns messages plus a lease ID; ack within the lease window to remove from the inbox.
|
|
913
|
+
|
|
914
|
+
**Options:**
|
|
915
|
+
|
|
916
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
917
|
+
| ----------------- | -------- | -------- | ------- | --------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
918
|
+
| `<inbox>` | `string` | โ
| โ | โ | Trigger inbox identifier โ UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
|
|
919
|
+
| `--lease-limit` | `number` | โ | โ | โ | Maximum messages to lease in a single batch (1-100) |
|
|
920
|
+
| `--lease-seconds` | `number` | โ | โ | โ | Seconds until the lease expires; messages return to available if not acked. API default is 300 (5 minutes). |
|
|
921
|
+
|
|
922
|
+
**Usage:**
|
|
923
|
+
|
|
924
|
+
```bash
|
|
925
|
+
npx zapier-sdk lease-trigger-inbox-messages <inbox> [--lease-limit] [--lease-seconds]
|
|
926
|
+
```
|
|
927
|
+
|
|
928
|
+
#### `list-trigger-inbox-messages` ๐งช _experimental_
|
|
929
|
+
|
|
930
|
+
List messages in a trigger inbox (no payload, status-only)
|
|
931
|
+
|
|
932
|
+
**Options:**
|
|
933
|
+
|
|
934
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
935
|
+
| ------------- | -------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
936
|
+
| `<inbox>` | `string` | โ
| โ | โ | Trigger inbox identifier โ UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
|
|
937
|
+
| `--page-size` | `number` | โ | โ | โ | Number of messages per page |
|
|
938
|
+
| `--max-items` | `number` | โ | โ | โ | Maximum total items to return across all pages |
|
|
939
|
+
| `--cursor` | `string` | โ | โ | โ | Pagination cursor |
|
|
940
|
+
|
|
941
|
+
**Usage:**
|
|
942
|
+
|
|
943
|
+
```bash
|
|
944
|
+
npx zapier-sdk list-trigger-inbox-messages <inbox> [--page-size] [--max-items] [--cursor]
|
|
945
|
+
```
|
|
946
|
+
|
|
947
|
+
#### `list-trigger-inboxes` ๐งช _experimental_
|
|
948
|
+
|
|
949
|
+
List all trigger inboxes for the authenticated user
|
|
950
|
+
|
|
951
|
+
**Options:**
|
|
952
|
+
|
|
953
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
954
|
+
| ------------- | -------- | -------- | ------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
|
|
955
|
+
| `--name` | `string` | โ | โ | โ | Filter by inbox name (exact match). Names are unique per (user, account), so this returns at most one inbox. |
|
|
956
|
+
| `--status` | `string` | โ | โ | `initializing`, `active`, `paused`, `deleting`, `initialization_failure` | Filter by inbox status |
|
|
957
|
+
| `--page-size` | `number` | โ | โ | โ | Number of inboxes per page |
|
|
958
|
+
| `--max-items` | `number` | โ | โ | โ | Maximum total items to return across all pages |
|
|
959
|
+
| `--cursor` | `string` | โ | โ | โ | Cursor (offset) to start from for pagination |
|
|
960
|
+
|
|
961
|
+
**Usage:**
|
|
962
|
+
|
|
963
|
+
```bash
|
|
964
|
+
npx zapier-sdk list-trigger-inboxes [--name] [--status] [--page-size] [--max-items] [--cursor]
|
|
965
|
+
```
|
|
966
|
+
|
|
967
|
+
#### `list-trigger-input-field-choices` ๐งช _experimental_
|
|
968
|
+
|
|
969
|
+
Get the available choices for a dynamic dropdown input field on a trigger
|
|
970
|
+
|
|
971
|
+
**Options:**
|
|
972
|
+
|
|
973
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
974
|
+
| --------------- | ---------------- | -------- | ------- | --------------- | ------------------------------------------------------------------------------------------------------------------- |
|
|
975
|
+
| `<app>` | `string` | โ
| โ | โ | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
|
|
976
|
+
| `<action>` | `string` | โ
| โ | โ | Action key (e.g., 'send_message' or 'find_row') |
|
|
977
|
+
| `<input-field>` | `string` | โ
| โ | โ | Input field key to get choices for |
|
|
978
|
+
| `--connection` | `string, number` | โ | โ | โ | Connection alias or connection ID. Required if the trigger needs a connection to populate dynamic dropdown options. |
|
|
979
|
+
| `--inputs` | `object` | โ | โ | โ | Current input values that may affect available choices |
|
|
980
|
+
| `--page` | `number` | โ | โ | โ | Page number for paginated results |
|
|
981
|
+
| `--page-size` | `number` | โ | โ | โ | Number of choices per page |
|
|
982
|
+
| `--max-items` | `number` | โ | โ | โ | Maximum total items to return across all pages |
|
|
983
|
+
| `--cursor` | `string` | โ | โ | โ | Cursor to start from |
|
|
984
|
+
|
|
985
|
+
**Usage:**
|
|
986
|
+
|
|
987
|
+
```bash
|
|
988
|
+
npx zapier-sdk list-trigger-input-field-choices <app> <action> <input-field> [--connection] [--inputs] [--page] [--page-size] [--max-items] [--cursor]
|
|
989
|
+
```
|
|
990
|
+
|
|
991
|
+
#### `list-trigger-input-fields` ๐งช _experimental_
|
|
992
|
+
|
|
993
|
+
Get the input fields required for a specific trigger
|
|
994
|
+
|
|
995
|
+
**Options:**
|
|
996
|
+
|
|
997
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
998
|
+
| -------------- | ---------------- | -------- | ------- | --------------- | ------------------------------------------------------------------------------------------------------------ |
|
|
999
|
+
| `<app>` | `string` | โ
| โ | โ | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
|
|
1000
|
+
| `<action>` | `string` | โ
| โ | โ | Action key (e.g., 'send_message' or 'find_row') |
|
|
1001
|
+
| `--connection` | `string, number` | โ | โ | โ | Connection alias or connection ID. Required if the trigger needs a connection to determine available fields. |
|
|
1002
|
+
| `--inputs` | `object` | โ | โ | โ | Current input values that may affect available fields |
|
|
1003
|
+
| `--page-size` | `number` | โ | โ | โ | Number of input fields per page |
|
|
1004
|
+
| `--max-items` | `number` | โ | โ | โ | Maximum total items to return across all pages |
|
|
1005
|
+
| `--cursor` | `string` | โ | โ | โ | Cursor to start from |
|
|
1006
|
+
|
|
1007
|
+
**Usage:**
|
|
1008
|
+
|
|
1009
|
+
```bash
|
|
1010
|
+
npx zapier-sdk list-trigger-input-fields <app> <action> [--connection] [--inputs] [--page-size] [--max-items] [--cursor]
|
|
1011
|
+
```
|
|
1012
|
+
|
|
1013
|
+
#### `pause-trigger-inbox` ๐งช _experimental_
|
|
1014
|
+
|
|
1015
|
+
Pause a trigger inbox; events stop being collected
|
|
1016
|
+
|
|
1017
|
+
**Options:**
|
|
1018
|
+
|
|
1019
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
1020
|
+
| --------- | -------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
1021
|
+
| `<inbox>` | `string` | โ
| โ | โ | Trigger inbox identifier โ UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
|
|
1022
|
+
|
|
1023
|
+
**Usage:**
|
|
1024
|
+
|
|
1025
|
+
```bash
|
|
1026
|
+
npx zapier-sdk pause-trigger-inbox <inbox>
|
|
1027
|
+
```
|
|
1028
|
+
|
|
1029
|
+
#### `release-trigger-inbox-messages` ๐งช _experimental_
|
|
1030
|
+
|
|
1031
|
+
Release messages from a lease back to the inbox without acknowledging them. Released messages become immediately available for re-leasing. The lease attempt still counts against the per-message lease limit; releasing does not refund the attempt.
|
|
1032
|
+
|
|
1033
|
+
**Options:**
|
|
1034
|
+
|
|
1035
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
1036
|
+
| ------------ | -------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
1037
|
+
| `<inbox>` | `string` | โ
| โ | โ | Trigger inbox identifier โ UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
|
|
1038
|
+
| `<lease>` | `string` | โ
| โ | โ | Lease ID returned from leaseTriggerInboxMessages |
|
|
1039
|
+
| `--messages` | `array` | โ | โ | โ | Specific message IDs to release. Omit to release every message in the lease. |
|
|
1040
|
+
|
|
1041
|
+
**Usage:**
|
|
1042
|
+
|
|
1043
|
+
```bash
|
|
1044
|
+
npx zapier-sdk release-trigger-inbox-messages <inbox> <lease> [--messages]
|
|
1045
|
+
```
|
|
1046
|
+
|
|
1047
|
+
#### `resume-trigger-inbox` ๐งช _experimental_
|
|
1048
|
+
|
|
1049
|
+
Resume a paused trigger inbox; events resume being collected
|
|
1050
|
+
|
|
1051
|
+
**Options:**
|
|
1052
|
+
|
|
1053
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
1054
|
+
| --------- | -------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
1055
|
+
| `<inbox>` | `string` | โ
| โ | โ | Trigger inbox identifier โ UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
|
|
1056
|
+
|
|
1057
|
+
**Usage:**
|
|
1058
|
+
|
|
1059
|
+
```bash
|
|
1060
|
+
npx zapier-sdk resume-trigger-inbox <inbox>
|
|
1061
|
+
```
|
|
1062
|
+
|
|
1063
|
+
#### `update-trigger-inbox` ๐งช _experimental_
|
|
1064
|
+
|
|
1065
|
+
Update settings on an existing trigger inbox
|
|
1066
|
+
|
|
1067
|
+
**Options:**
|
|
1068
|
+
|
|
1069
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
1070
|
+
| -------------------- | -------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
1071
|
+
| `<inbox>` | `string` | โ
| โ | โ | Trigger inbox identifier โ UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
|
|
1072
|
+
| `--notification-url` | `string` | โ | โ | โ | Webhook URL to POST to when new messages arrive. Pass null to clear. |
|
|
1073
|
+
|
|
1074
|
+
**Usage:**
|
|
1075
|
+
|
|
1076
|
+
```bash
|
|
1077
|
+
npx zapier-sdk update-trigger-inbox <inbox> [--notification-url]
|
|
1078
|
+
```
|
|
1079
|
+
|
|
1080
|
+
#### `watch-trigger-inbox` ๐งช _experimental_
|
|
1081
|
+
|
|
1082
|
+
Continuously consume a trigger inbox: drain currently-available messages via onMessage, then poll with backoff for new arrivals, until aborted. Resolves cleanly on signal abort or ZapierAbortDrainSignal from a handler; rejects on fatal SDK errors or fail-fast handler errors.
|
|
1083
|
+
|
|
1084
|
+
**Options:**
|
|
1085
|
+
|
|
1086
|
+
| Option | Type | Required | Default | Possible Values | Description |
|
|
1087
|
+
| ------------------------------ | --------- | -------- | ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1088
|
+
| `<inbox>` | `string` | โ
| โ | โ | Trigger inbox identifier โ UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
|
|
1089
|
+
| `--concurrency` | `number` | โ | โ | โ | Per-message handler workers running in parallel. Defaults to `leaseLimit`, or 1 if neither is set. |
|
|
1090
|
+
| `--lease-limit` | `number` | โ | โ | โ | Per-lease HTTP batch size. Defaults to `concurrency`, or 1 if neither is set. |
|
|
1091
|
+
| `--lease-seconds` | `number` | โ | โ | โ | Seconds until the lease expires; messages return to available if not acked. API default is 300 (5 minutes). |
|
|
1092
|
+
| `--release-on-error` | `boolean` | โ | โ | โ | If true, errors immediately release the message. If false (default), errors leave it leased until the lease timeout. `ZapierReleaseTriggerMessageSignal` always releases regardless. |
|
|
1093
|
+
| `--continue-on-error` | `boolean` | โ | โ | โ | If false (default, fail-fast), the first handler error rejects and stops the drain. If true, handler errors are observed via `onError` and the drain continues. SDK-level errors (lease / ack / release) reject regardless. |
|
|
1094
|
+
| `--max-drain-interval-seconds` | `number` | โ | โ | โ | Maximum seconds between empty-inbox poll attempts (default: 60). Caps the back-off cadence. |
|
|
1095
|
+
| `--exec` | `string` | โ | โ | โ | Run a binary per message with no shell interpretation. Message JSON is piped to stdin; exit code 0 acks, non-zero records the error per the same rules as a thrown handler. Pass extra argv after `--` (e.g. `--exec ./handler -- --verbose`). Mutually exclusive with --exec-shell and --json. |
|
|
1096
|
+
| `--exec-shell` | `string` | โ | โ | โ | Run a shell command per message. Message JSON is piped to the subprocess on stdin; exit code 0 acks, non-zero records the error per the same rules as a thrown handler. Interpreted by the platform's default shell (sh on POSIX, cmd.exe on Windows). Mutually exclusive with --exec and --json. |
|
|
1097
|
+
| `--json` | `boolean` | โ | โ | โ | Stream each message as JSON to stdout (one record per line, NDJSON), acking as each write completes. Use for piping to other tools. Mutually exclusive with --exec / --exec-shell and the interactive default. |
|
|
1098
|
+
|
|
1099
|
+
**Usage:**
|
|
1100
|
+
|
|
1101
|
+
```bash
|
|
1102
|
+
npx zapier-sdk watch-trigger-inbox <inbox> [--concurrency] [--lease-limit] [--lease-seconds] [--release-on-error] [--continue-on-error] [--max-drain-interval-seconds] [--exec] [--exec-shell] [--json]
|
|
1103
|
+
```
|
|
1104
|
+
|
|
753
1105
|
### Utilities
|
|
754
1106
|
|
|
755
1107
|
#### `add`
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// The experimental bin loads the same compiled CLI as the stable bin
|
|
4
|
+
// but injects --experimental into argv first. cli.ts only has one
|
|
5
|
+
// detection path (argv flag + env var), so this bin and
|
|
6
|
+
// `zapier-sdk --experimental` are byte-equivalent at the CLI's view
|
|
7
|
+
// of argv. Renaming this file later doesn't break detection โ the
|
|
8
|
+
// signal is what we push, not what we're called.
|
|
9
|
+
//
|
|
10
|
+
// Dynamic import (rather than the static `import "..."` form) is
|
|
11
|
+
// load-bearing: a static import is hoisted above the argv mutation,
|
|
12
|
+
// so cli.mjs would see the unmodified argv.
|
|
13
|
+
process.argv.push("--experimental");
|
|
14
|
+
await import("../dist/cli.mjs");
|