@zapier/zapier-sdk 0.12.0 → 0.13.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.
Files changed (101) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +336 -128
  3. package/dist/api/schemas.d.ts +10 -865
  4. package/dist/api/schemas.d.ts.map +1 -1
  5. package/dist/api/schemas.js +0 -6
  6. package/dist/index.cjs +108 -58
  7. package/dist/index.d.mts +88 -434
  8. package/dist/index.d.ts +1 -0
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.mjs +108 -58
  11. package/dist/plugins/apps/index.d.ts +2 -2
  12. package/dist/plugins/apps/index.d.ts.map +1 -1
  13. package/dist/plugins/apps/index.js +21 -0
  14. package/dist/plugins/apps/schemas.d.ts +51 -0
  15. package/dist/plugins/apps/schemas.d.ts.map +1 -0
  16. package/dist/plugins/apps/schemas.js +13 -0
  17. package/dist/plugins/findFirstAuthentication/schemas.js +1 -1
  18. package/dist/plugins/findUniqueAuthentication/schemas.js +1 -1
  19. package/dist/plugins/getApp/schemas.js +1 -1
  20. package/dist/plugins/getAuthentication/index.test.js +1 -1
  21. package/dist/plugins/listActions/index.d.ts +1 -0
  22. package/dist/plugins/listActions/index.d.ts.map +1 -1
  23. package/dist/plugins/listActions/schemas.d.ts +3 -0
  24. package/dist/plugins/listActions/schemas.d.ts.map +1 -1
  25. package/dist/plugins/listActions/schemas.js +2 -1
  26. package/dist/plugins/listApps/index.d.ts +1 -0
  27. package/dist/plugins/listApps/index.d.ts.map +1 -1
  28. package/dist/plugins/listApps/schemas.d.ts +3 -0
  29. package/dist/plugins/listApps/schemas.d.ts.map +1 -1
  30. package/dist/plugins/listApps/schemas.js +1 -0
  31. package/dist/plugins/listAuthentications/index.d.ts +1 -0
  32. package/dist/plugins/listAuthentications/index.d.ts.map +1 -1
  33. package/dist/plugins/listAuthentications/schemas.d.ts +3 -0
  34. package/dist/plugins/listAuthentications/schemas.d.ts.map +1 -1
  35. package/dist/plugins/listAuthentications/schemas.js +2 -1
  36. package/dist/plugins/listInputFieldChoices/index.d.ts +1 -0
  37. package/dist/plugins/listInputFieldChoices/index.d.ts.map +1 -1
  38. package/dist/plugins/listInputFieldChoices/schemas.d.ts +3 -0
  39. package/dist/plugins/listInputFieldChoices/schemas.d.ts.map +1 -1
  40. package/dist/plugins/listInputFieldChoices/schemas.js +1 -0
  41. package/dist/plugins/listInputFields/index.d.ts +1 -0
  42. package/dist/plugins/listInputFields/index.d.ts.map +1 -1
  43. package/dist/plugins/listInputFields/schemas.d.ts +3 -0
  44. package/dist/plugins/listInputFields/schemas.d.ts.map +1 -1
  45. package/dist/plugins/listInputFields/schemas.js +1 -0
  46. package/dist/plugins/registry/index.d.ts.map +1 -1
  47. package/dist/plugins/registry/index.js +12 -1
  48. package/dist/plugins/runAction/index.d.ts +1 -0
  49. package/dist/plugins/runAction/index.d.ts.map +1 -1
  50. package/dist/plugins/runAction/schemas.d.ts +3 -0
  51. package/dist/plugins/runAction/schemas.d.ts.map +1 -1
  52. package/dist/plugins/runAction/schemas.js +1 -0
  53. package/dist/schemas/Action.d.ts +4 -206
  54. package/dist/schemas/Action.d.ts.map +1 -1
  55. package/dist/schemas/Action.js +3 -2
  56. package/dist/schemas/App.d.ts.map +1 -1
  57. package/dist/schemas/App.js +1 -0
  58. package/dist/schemas/Auth.d.ts +10 -10
  59. package/dist/schemas/Auth.js +1 -1
  60. package/dist/types/properties.d.ts.map +1 -1
  61. package/dist/types/properties.js +4 -1
  62. package/dist/types/sdk.d.ts +1 -1
  63. package/dist/types/sdk.d.ts.map +1 -1
  64. package/dist/utils/domain-utils.d.ts +2 -2
  65. package/dist/utils/domain-utils.d.ts.map +1 -1
  66. package/dist/utils/domain-utils.js +19 -8
  67. package/dist/utils/schema-utils.d.ts +1 -0
  68. package/dist/utils/schema-utils.d.ts.map +1 -1
  69. package/package.json +1 -1
  70. package/src/api/schemas.ts +0 -6
  71. package/src/index.ts +1 -0
  72. package/src/plugins/apps/index.ts +28 -7
  73. package/src/plugins/apps/{types.ts → schemas.ts} +27 -9
  74. package/src/plugins/findFirstAuthentication/schemas.ts +1 -1
  75. package/src/plugins/findUniqueAuthentication/schemas.ts +1 -1
  76. package/src/plugins/getApp/schemas.ts +1 -1
  77. package/src/plugins/getAuthentication/index.test.ts +1 -1
  78. package/src/plugins/listActions/index.ts +1 -0
  79. package/src/plugins/listActions/schemas.ts +2 -1
  80. package/src/plugins/listApps/index.ts +4 -1
  81. package/src/plugins/listApps/schemas.ts +1 -0
  82. package/src/plugins/listAuthentications/index.ts +1 -0
  83. package/src/plugins/listAuthentications/schemas.ts +2 -1
  84. package/src/plugins/listInputFieldChoices/index.ts +1 -0
  85. package/src/plugins/listInputFieldChoices/schemas.ts +1 -0
  86. package/src/plugins/listInputFields/index.ts +1 -0
  87. package/src/plugins/listInputFields/schemas.ts +1 -0
  88. package/src/plugins/registry/index.ts +12 -1
  89. package/src/plugins/runAction/index.ts +4 -1
  90. package/src/plugins/runAction/schemas.ts +1 -0
  91. package/src/schemas/Action.ts +3 -2
  92. package/src/schemas/App.ts +1 -0
  93. package/src/schemas/Auth.ts +1 -1
  94. package/src/types/properties.ts +4 -1
  95. package/src/types/sdk.ts +1 -1
  96. package/src/utils/domain-utils.ts +22 -9
  97. package/src/utils/schema-utils.ts +1 -0
  98. package/tsconfig.tsbuildinfo +1 -1
  99. package/dist/plugins/apps/types.d.ts +0 -30
  100. package/dist/plugins/apps/types.d.ts.map +0 -1
  101. package/dist/plugins/apps/types.js +0 -2
package/README.md CHANGED
@@ -14,6 +14,8 @@
14
14
  - [`listInputFields`](#listinputfields)
15
15
  - [`runAction`](#runaction)
16
16
  - [Apps](#apps)
17
+ - [`apps.{appKey}`](#appsappkey)
18
+ - [`apps.{appKey}.{actionType}.{actionKey}`](#appsappkeyactiontypeactionkey)
17
19
  - [`getApp`](#getapp)
18
20
  - [`listApps`](#listapps)
19
21
  - [Authentications](#authentications)
@@ -29,7 +31,7 @@
29
31
 
30
32
  ```bash
31
33
  npm install @zapier/zapier-sdk
32
- npm install -D @types/node typescript
34
+ npm install -D @zapier/zapier-sdk-cli @types/node typescript
33
35
  npx tsc --init
34
36
  ```
35
37
 
@@ -63,22 +65,74 @@ const zapier = createZapierSdk();
63
65
  // });
64
66
 
65
67
  // ######## Access Apps ########
66
- const apps = await zapier.listApps();
67
- const singleApp = await zapier.getApp({ appKey: "SlackCLIAPI" });
68
+ // List methods return a promise for a page with {data, nextCursor}.
69
+ const { data: firstPageApps, nextCursor } = await zapier.listApps();
70
+ // Use the cursor to get the next page:
71
+ const { data: secondPageApps } = await zapier.listApps({ cursor: nextCursor });
72
+
73
+ console.log({
74
+ firstPageApps,
75
+ secondPageApps,
76
+ });
77
+
78
+ // List methods also return an iterator for all pages.
79
+ // Be careful with lots of pages, note the `search` to filter.
80
+ for await (const page of zapier.listApps({ search: "slack" })) {
81
+ const { data: apps } = page;
82
+ console.log({
83
+ apps,
84
+ });
85
+ }
86
+
87
+ // Use `.items()` to iterate over all items of all pages:
88
+ // Again, be careful with lots of items. Note the `maxItems` to limit the total items.
89
+ for await (const app of zapier.listApps({ maxItems: 100 }).items()) {
90
+ console.log({
91
+ app,
92
+ });
93
+ }
94
+
95
+ // You can collect all results, but this could take a while for long lists!
96
+ const allApps = await Array.fromAsync(
97
+ zapier.listApps({ maxItems: 1000 }).items(),
98
+ );
99
+
100
+ console.log({
101
+ allApps,
102
+ });
103
+
104
+ // The item methods return a promise for a single item, wrapped with {data}.
105
+ // This is just to give us room to add metadata in the future.
106
+ const { data: app } = await zapier.getApp({ appKey: "slack" });
107
+
108
+ console.log({
109
+ app,
110
+ });
68
111
 
69
112
  // ######## Authentication Usage ########
70
- const myAuths = await zapier.listAuthentications({
71
- appKey: "SlackCLIAPI",
113
+ const { data: myAuths } = await zapier.listAuthentications({
114
+ appKey: "slack",
72
115
  owner: "me",
73
116
  });
74
117
 
75
118
  // ######## Find Actions ########
76
119
  // Option 1: List actions
77
- const actions = await zapier.listActions({ appKey: "SlackCLIAPI" });
120
+ // Remember, this is just the first page which may not include them all!
121
+ // See `.items()` usage above, which can be used to make sure you get all actions.
122
+ const { data: actions } = await zapier.listActions({ appKey: "slack" });
123
+
124
+ console.log({
125
+ actions,
126
+ });
127
+
78
128
  const singleAction = await zapier.getAction({
79
- appKey: "SlackCLIAPI",
80
- actionType: actions.data[0].action_type,
81
- actionKey: actions.data[0].key,
129
+ appKey: "slack",
130
+ actionType: actions[0].action_type,
131
+ actionKey: actions[0].key,
132
+ });
133
+
134
+ console.log({
135
+ singleAction,
82
136
  });
83
137
 
84
138
  // Option 2: Access actions via the `apps` proxy
@@ -89,25 +143,28 @@ const singleAction = await zapier.getAction({
89
143
 
90
144
  // ######## Run Actions ########
91
145
  // Option 1:
92
- const allChannels = await zapier.runAction({
93
- appKey: "SlackCLIAPI",
146
+ const { data: channels } = await zapier.runAction({
147
+ appKey: "slack",
94
148
  actionType: "read",
95
149
  actionKey: "channels",
96
- authenticationId: myAuths.data[0].id,
150
+ authenticationId: myAuths[0].id,
151
+ });
152
+
153
+ console.log({
154
+ channels,
97
155
  });
98
156
 
157
+ const { data: profile } = await zapier.getProfile();
158
+
99
159
  // Option 2:
100
- const allChannelsResult = await zapier.apps.slack.read.channels({
101
- authenticationId: myAuths.data[0].id,
160
+ const { data: users } = await zapier.apps.slack.search.user_by_email({
161
+ inputs: {
162
+ email: profile.email,
163
+ },
102
164
  });
103
165
 
104
166
  console.log({
105
- apps: apps.data[0],
106
- singleApp,
107
- actions: actions.data[0],
108
- singleAction,
109
- allChannels: allChannels.data[0],
110
- allChannelsResult,
167
+ users,
111
168
  });
112
169
  ```
113
170
 
@@ -121,16 +178,16 @@ Get current user's profile information
121
178
 
122
179
  **Parameters:**
123
180
 
124
- | Name | Type | Required | Default | Possible Values | Description |
125
- | --------- | -------- | -------- | ------- | --------------- | -------------------------------------- |
126
- | `options` | `string` | ❌ | — | — | Get current user's profile information |
181
+ | Name | Type | Required | Default | Possible Values | Description |
182
+ | --------- | -------- | -------- | ------- | --------------- | ----------- |
183
+ | `options` | `object` | ❌ | — | — | |
127
184
 
128
185
  **Returns:** `Promise<ProfileItem>`
129
186
 
130
187
  **Example:**
131
188
 
132
189
  ```typescript
133
- const result = await sdk.getProfile();
190
+ const { data: profile } = await sdk.getProfile();
134
191
  ```
135
192
 
136
193
  ### Actions
@@ -141,20 +198,19 @@ Get detailed information about a specific action
141
198
 
142
199
  **Parameters:**
143
200
 
144
- | Name | Type | Required | Default | Possible Values | Description |
145
- | -------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------- |
146
- | `options` | `string` | ✅ | — | — | Get detailed information about a specific action |
147
- | ↳ `appKey` | `string` | ✅ | — | — | App key (e.g., 'SlackCLIAPI') |
148
- | ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
149
- | ↳ `actionKey` | `string` | ✅ | — | — | Action key to execute |
201
+ | Name | Type | Required | Default | Possible Values | Description |
202
+ | -------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | --------------------------------------------------- |
203
+ | `options` | `object` | ✅ | — | — | |
204
+ | ↳ `appKey` | `string` | ✅ | — | — | App key (e.g., 'SlackCLIAPI' or slug like 'github') |
205
+ | ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
206
+ | ↳ `actionKey` | `string` | ✅ | — | — | Action key to execute |
150
207
 
151
208
  **Returns:** `Promise<ActionItem>`
152
209
 
153
210
  **Example:**
154
211
 
155
212
  ```typescript
156
- const result = await sdk.getAction({
157
- options: "example-value",
213
+ const { data: action } = await sdk.getAction({
158
214
  appKey: "example-key",
159
215
  actionType: "read",
160
216
  actionKey: "example-key",
@@ -167,23 +223,40 @@ List all actions for a specific app
167
223
 
168
224
  **Parameters:**
169
225
 
170
- | Name | Type | Required | Default | Possible Values | Description |
171
- | -------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------ |
172
- | `options` | `string` | ✅ | — | — | List all actions for a specific app |
173
- | ↳ `appKey` | `string` | ✅ | — | — | App key of actions to list (e.g., 'SlackCLIAPI') |
174
- | ↳ `actionType` | `string` | ❌ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Filter actions by type |
175
- | ↳ `pageSize` | `number` | ❌ | — | — | Number of actions per page |
176
- | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
226
+ | Name | Type | Required | Default | Possible Values | Description |
227
+ | -------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
228
+ | `options` | `object` | ✅ | — | — | |
229
+ | ↳ `appKey` | `string` | ✅ | — | — | App key of actions to list (e.g., 'SlackCLIAPI' or slug like 'github') |
230
+ | ↳ `actionType` | `string` | ❌ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Filter actions by type |
231
+ | ↳ `pageSize` | `number` | ❌ | — | — | Number of actions per page |
232
+ | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
233
+ | ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
177
234
 
178
235
  **Returns:** `Promise<PaginatedResult<ActionItem>>`
179
236
 
180
237
  **Example:**
181
238
 
182
239
  ```typescript
183
- const result = await sdk.listActions({
184
- options: "example-value",
240
+ // Get first page and a cursor for the second page
241
+ const { data: actions, nextCursor } = await sdk.listActions({
185
242
  appKey: "example-key",
186
243
  });
244
+
245
+ // Or iterate over all pages
246
+ for await (const page of sdk.listActions({
247
+ appKey: "example-key",
248
+ })) {
249
+ // Do something with each page
250
+ }
251
+
252
+ // Or iterate over individual items across all pages
253
+ for await (const action of sdk
254
+ .listActions({
255
+ appKey: "example-key",
256
+ })
257
+ .items()) {
258
+ // Do something with each action
259
+ }
187
260
  ```
188
261
 
189
262
  #### `listInputFieldChoices`
@@ -192,31 +265,56 @@ Get the available choices for a dynamic dropdown input field
192
265
 
193
266
  **Parameters:**
194
267
 
195
- | Name | Type | Required | Default | Possible Values | Description |
196
- | -------------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
197
- | `options` | `string` | ✅ | — | — | Get the available choices for a dynamic dropdown input field |
198
- | ↳ `appKey` | `string` | ✅ | — | — | App key (e.g., 'SlackCLIAPI') |
199
- | ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
200
- | ↳ `actionKey` | `string` | ✅ | — | — | Action key to execute |
201
- | ↳ `inputFieldKey` | `string` | ✅ | — | — | Input field key to get choices for. |
202
- | ↳ `authenticationId` | `string` | ❌ | — | — | Authentication ID to use for this action |
203
- | ↳ `inputs` | `object` | ❌ | — | — | Current input values that may affect available choices |
204
- | ↳ `page` | `number` | ❌ | — | — | Page number for paginated results |
205
- | ↳ `pageSize` | `number` | ❌ | — | — | Number of choices per page |
206
- | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
268
+ | Name | Type | Required | Default | Possible Values | Description |
269
+ | -------------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
270
+ | `options` | `object` | ✅ | — | — | |
271
+ | ↳ `appKey` | `string` | ✅ | — | — | App key (e.g., 'SlackCLIAPI' or slug like 'github') |
272
+ | ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
273
+ | ↳ `actionKey` | `string` | ✅ | — | — | Action key to execute |
274
+ | ↳ `inputFieldKey` | `string` | ✅ | — | — | Input field key to get choices for. |
275
+ | ↳ `authenticationId` | `string` | ❌ | — | — | Authentication ID to use for this action |
276
+ | ↳ `inputs` | `object` | ❌ | — | — | Current input values that may affect available choices |
277
+ | ↳ `page` | `number` | ❌ | — | — | Page number for paginated results |
278
+ | ↳ `pageSize` | `number` | ❌ | — | — | Number of choices per page |
279
+ | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
280
+ | ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
207
281
 
208
282
  **Returns:** `Promise<PaginatedResult<InputFieldChoiceItem>>`
209
283
 
210
284
  **Example:**
211
285
 
212
286
  ```typescript
213
- const result = await sdk.listInputFieldChoices({
214
- options: "example-value",
287
+ // Get first page and a cursor for the second page
288
+ const { data: inputFieldChoices, nextCursor } = await sdk.listInputFieldChoices(
289
+ {
290
+ appKey: "example-key",
291
+ actionType: "read",
292
+ actionKey: "example-key",
293
+ inputFieldKey: "example-key",
294
+ },
295
+ );
296
+
297
+ // Or iterate over all pages
298
+ for await (const page of sdk.listInputFieldChoices({
215
299
  appKey: "example-key",
216
300
  actionType: "read",
217
301
  actionKey: "example-key",
218
302
  inputFieldKey: "example-key",
219
- });
303
+ })) {
304
+ // Do something with each page
305
+ }
306
+
307
+ // Or iterate over individual items across all pages
308
+ for await (const inputFieldChoice of sdk
309
+ .listInputFieldChoices({
310
+ appKey: "example-key",
311
+ actionType: "read",
312
+ actionKey: "example-key",
313
+ inputFieldKey: "example-key",
314
+ })
315
+ .items()) {
316
+ // Do something with each inputFieldChoice
317
+ }
220
318
  ```
221
319
 
222
320
  #### `listInputFields`
@@ -227,26 +325,47 @@ Get the input fields required for a specific action
227
325
 
228
326
  | Name | Type | Required | Default | Possible Values | Description |
229
327
  | -------------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
230
- | `options` | `string` | ✅ | — | — | Get the input fields required for a specific action |
231
- | ↳ `appKey` | `string` | ✅ | — | — | App key (e.g., 'SlackCLIAPI') |
328
+ | `options` | `object` | ✅ | — | — | |
329
+ | ↳ `appKey` | `string` | ✅ | — | — | App key (e.g., 'SlackCLIAPI' or slug like 'github') |
232
330
  | ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
233
331
  | ↳ `actionKey` | `string` | ✅ | — | — | Action key to execute |
234
332
  | ↳ `authenticationId` | `string` | ❌ | — | — | Authentication ID to use for this action |
235
333
  | ↳ `inputs` | `object` | ❌ | — | — | Current input values that may affect available fields |
236
334
  | ↳ `pageSize` | `number` | ❌ | — | — | Number of input fields per page |
237
335
  | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
336
+ | ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
238
337
 
239
338
  **Returns:** `Promise<PaginatedResult<RootFieldItemItem>>`
240
339
 
241
340
  **Example:**
242
341
 
243
342
  ```typescript
244
- const result = await sdk.listInputFields({
245
- options: "example-value",
343
+ // Get first page and a cursor for the second page
344
+ const { data: rootFieldItems, nextCursor } = await sdk.listInputFields({
246
345
  appKey: "example-key",
247
346
  actionType: "read",
248
347
  actionKey: "example-key",
249
348
  });
349
+
350
+ // Or iterate over all pages
351
+ for await (const page of sdk.listInputFields({
352
+ appKey: "example-key",
353
+ actionType: "read",
354
+ actionKey: "example-key",
355
+ })) {
356
+ // Do something with each page
357
+ }
358
+
359
+ // Or iterate over individual items across all pages
360
+ for await (const rootFieldItem of sdk
361
+ .listInputFields({
362
+ appKey: "example-key",
363
+ actionType: "read",
364
+ actionKey: "example-key",
365
+ })
366
+ .items()) {
367
+ // Do something with each rootFieldItem
368
+ }
250
369
  ```
251
370
 
252
371
  #### `runAction`
@@ -255,50 +374,125 @@ Execute an action with the given inputs
255
374
 
256
375
  **Parameters:**
257
376
 
258
- | Name | Type | Required | Default | Possible Values | Description |
259
- | -------------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------- |
260
- | `options` | `string` | ✅ | — | — | Execute an action with the given inputs |
261
- | ↳ `appKey` | `string` | ✅ | — | — | App key (e.g., 'SlackCLIAPI') |
262
- | ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
263
- | ↳ `actionKey` | `string` | ✅ | — | — | Action key to execute |
264
- | ↳ `authenticationId` | `string` | ❌ | — | — | Authentication ID to use for this action |
265
- | ↳ `inputs` | `object` | ❌ | — | — | Input parameters for the action |
266
- | ↳ `pageSize` | `number` | ❌ | — | — | Number of results per page |
267
- | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
377
+ | Name | Type | Required | Default | Possible Values | Description |
378
+ | -------------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | --------------------------------------------------- |
379
+ | `options` | `object` | ✅ | — | — | |
380
+ | ↳ `appKey` | `string` | ✅ | — | — | App key (e.g., 'SlackCLIAPI' or slug like 'github') |
381
+ | ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
382
+ | ↳ `actionKey` | `string` | ✅ | — | — | Action key to execute |
383
+ | ↳ `authenticationId` | `string` | ❌ | — | — | Authentication ID to use for this action |
384
+ | ↳ `inputs` | `object` | ❌ | — | — | Input parameters for the action |
385
+ | ↳ `pageSize` | `number` | ❌ | — | — | Number of results per page |
386
+ | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
387
+ | ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
268
388
 
269
389
  **Returns:** `Promise<PaginatedResult<ActionResultItem>>`
270
390
 
271
391
  **Example:**
272
392
 
273
393
  ```typescript
274
- const result = await sdk.runAction({
275
- options: "example-value",
394
+ // Get first page and a cursor for the second page
395
+ const { data: actionResults, nextCursor } = await sdk.runAction({
276
396
  appKey: "example-key",
277
397
  actionType: "read",
278
398
  actionKey: "example-key",
279
399
  });
400
+
401
+ // Or iterate over all pages
402
+ for await (const page of sdk.runAction({
403
+ appKey: "example-key",
404
+ actionType: "read",
405
+ actionKey: "example-key",
406
+ })) {
407
+ // Do something with each page
408
+ }
409
+
410
+ // Or iterate over individual items across all pages
411
+ for await (const actionResult of sdk
412
+ .runAction({
413
+ appKey: "example-key",
414
+ actionType: "read",
415
+ actionKey: "example-key",
416
+ })
417
+ .items()) {
418
+ // Do something with each actionResult
419
+ }
280
420
  ```
281
421
 
282
422
  ### Apps
283
423
 
424
+ #### `apps.{appKey}`
425
+
426
+ Bind an authentication ID to an app
427
+
428
+ **Parameters:**
429
+
430
+ | Name | Type | Required | Default | Possible Values | Description |
431
+ | -------------------- | -------- | -------- | ------- | --------------- | ----------- |
432
+ | `options` | `object` | ✅ | — | — | |
433
+ | ↳ `authenticationId` | `number` | ✅ | — | — | |
434
+
435
+ **Returns:** `Promise<AppProxy>`
436
+
437
+ **Example:**
438
+
439
+ ```typescript
440
+ const result = await sdk.apps.appKey({
441
+ authenticationId: 12345,
442
+ });
443
+ ```
444
+
445
+ #### `apps.{appKey}.{actionType}.{actionKey}`
446
+
447
+ Execute an action with the given inputs for the bound app, as an alternative to runAction
448
+
449
+ **Parameters:**
450
+
451
+ | Name | Type | Required | Default | Possible Values | Description |
452
+ | -------------------- | -------- | -------- | ------- | --------------- | ----------- |
453
+ | `options` | `object` | ✅ | — | — | |
454
+ | ↳ `inputs` | `object` | ❌ | — | — | |
455
+ | ↳ `authenticationId` | `number` | ❌ | — | — | |
456
+
457
+ **Returns:** `Promise<PaginatedResult<ActionResultItem>>`
458
+
459
+ **Example:**
460
+
461
+ ```typescript
462
+ // Get first page and a cursor for the second page
463
+ const { data: actionResults, nextCursor } =
464
+ await sdk.apps.appKey.actionType.actionKey();
465
+
466
+ // Or iterate over all pages
467
+ for await (const page of sdk.apps.appKey.actionType.actionKey()) {
468
+ // Do something with each page
469
+ }
470
+
471
+ // Or iterate over individual items across all pages
472
+ for await (const actionResult of sdk.apps.appKey.actionType
473
+ .actionKey()
474
+ .items()) {
475
+ // Do something with each actionResult
476
+ }
477
+ ```
478
+
284
479
  #### `getApp`
285
480
 
286
481
  Get detailed information about a specific app
287
482
 
288
483
  **Parameters:**
289
484
 
290
- | Name | Type | Required | Default | Possible Values | Description |
291
- | ---------- | -------- | -------- | ------- | --------------- | --------------------------------------------- |
292
- | `options` | `string` | ✅ | — | — | Get detailed information about a specific app |
293
- | ↳ `appKey` | `string` | ✅ | — | — | App key of app to fetch (e.g., 'SlackCLIAPI') |
485
+ | Name | Type | Required | Default | Possible Values | Description |
486
+ | ---------- | -------- | -------- | ------- | --------------- | ------------------------------------------------------------------- |
487
+ | `options` | `object` | ✅ | — | — | |
488
+ | ↳ `appKey` | `string` | ✅ | — | — | App key of app to fetch (e.g., 'SlackCLIAPI' or slug like 'github') |
294
489
 
295
490
  **Returns:** `Promise<AppItem>`
296
491
 
297
492
  **Example:**
298
493
 
299
494
  ```typescript
300
- const result = await sdk.getApp({
301
- options: "example-value",
495
+ const { data: app } = await sdk.getApp({
302
496
  appKey: "example-key",
303
497
  });
304
498
  ```
@@ -311,20 +505,30 @@ List all available apps with optional filtering
311
505
 
312
506
  | Name | Type | Required | Default | Possible Values | Description |
313
507
  | ------------ | -------- | -------- | ------- | --------------- | ------------------------------------------------------------------- |
314
- | `options` | `string` | ✅ | — | — | List all available apps with optional filtering |
508
+ | `options` | `object` | ✅ | — | — | |
315
509
  | ↳ `appKeys` | `array` | ❌ | — | — | Filter apps by app keys (e.g., 'SlackCLIAPI' or slug like 'github') |
316
510
  | ↳ `search` | `string` | ❌ | — | — | Search for apps by name |
317
511
  | ↳ `pageSize` | `number` | ❌ | — | — | Number of apps per page |
318
512
  | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
513
+ | ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
319
514
 
320
515
  **Returns:** `Promise<PaginatedResult<AppItem>>`
321
516
 
322
517
  **Example:**
323
518
 
324
519
  ```typescript
325
- const result = await sdk.listApps({
326
- options: "example-value",
327
- });
520
+ // Get first page and a cursor for the second page
521
+ const { data: apps, nextCursor } = await sdk.listApps();
522
+
523
+ // Or iterate over all pages
524
+ for await (const page of sdk.listApps()) {
525
+ // Do something with each page
526
+ }
527
+
528
+ // Or iterate over individual items across all pages
529
+ for await (const app of sdk.listApps().items()) {
530
+ // Do something with each app
531
+ }
328
532
  ```
329
533
 
330
534
  ### Authentications
@@ -335,23 +539,21 @@ Find the first authentication matching the criteria
335
539
 
336
540
  **Parameters:**
337
541
 
338
- | Name | Type | Required | Default | Possible Values | Description |
339
- | ------------- | -------- | -------- | ------- | --------------- | ------------------------------------------------------- |
340
- | `options` | `string` | ✅ | — | — | Find the first authentication matching the criteria |
341
- | ↳ `appKey` | `string` | ❌ | — | — | App key of authentication to find (e.g., 'SlackCLIAPI') |
342
- | ↳ `search` | `string` | ❌ | — | — | Search term to filter authentications by title |
343
- | ↳ `title` | `string` | ❌ | — | — | Filter authentications by exact title match |
344
- | ↳ `accountId` | `string` | ❌ | — | — | Filter by account ID |
345
- | ↳ `owner` | `string` | ❌ | — | — | Filter by owner |
542
+ | Name | Type | Required | Default | Possible Values | Description |
543
+ | ------------- | -------- | -------- | ------- | --------------- | ----------------------------------------------------------------------------- |
544
+ | `options` | `object` | ✅ | — | — | |
545
+ | ↳ `appKey` | `string` | ❌ | — | — | App key of authentication to find (e.g., 'SlackCLIAPI' or slug like 'github') |
546
+ | ↳ `search` | `string` | ❌ | — | — | Search term to filter authentications by title |
547
+ | ↳ `title` | `string` | ❌ | — | — | Filter authentications by exact title match |
548
+ | ↳ `accountId` | `string` | ❌ | — | — | Filter by account ID |
549
+ | ↳ `owner` | `string` | ❌ | — | — | Filter by owner |
346
550
 
347
551
  **Returns:** `Promise<AuthenticationItem>`
348
552
 
349
553
  **Example:**
350
554
 
351
555
  ```typescript
352
- const result = await sdk.findFirstAuthentication({
353
- options: "example-value",
354
- });
556
+ const { data: authentication } = await sdk.findFirstAuthentication();
355
557
  ```
356
558
 
357
559
  #### `findUniqueAuthentication`
@@ -360,23 +562,21 @@ Find a unique authentication matching the criteria
360
562
 
361
563
  **Parameters:**
362
564
 
363
- | Name | Type | Required | Default | Possible Values | Description |
364
- | ------------- | -------- | -------- | ------- | --------------- | ------------------------------------------------------- |
365
- | `options` | `string` | ✅ | — | — | Find a unique authentication matching the criteria |
366
- | ↳ `appKey` | `string` | ❌ | — | — | App key of authentication to find (e.g., 'SlackCLIAPI') |
367
- | ↳ `search` | `string` | ❌ | — | — | Search term to filter authentications by title |
368
- | ↳ `title` | `string` | ❌ | — | — | Filter authentications by exact title match |
369
- | ↳ `accountId` | `string` | ❌ | — | — | Filter by account ID |
370
- | ↳ `owner` | `string` | ❌ | — | — | Filter by owner |
565
+ | Name | Type | Required | Default | Possible Values | Description |
566
+ | ------------- | -------- | -------- | ------- | --------------- | ----------------------------------------------------------------------------- |
567
+ | `options` | `object` | ✅ | — | — | |
568
+ | ↳ `appKey` | `string` | ❌ | — | — | App key of authentication to find (e.g., 'SlackCLIAPI' or slug like 'github') |
569
+ | ↳ `search` | `string` | ❌ | — | — | Search term to filter authentications by title |
570
+ | ↳ `title` | `string` | ❌ | — | — | Filter authentications by exact title match |
571
+ | ↳ `accountId` | `string` | ❌ | — | — | Filter by account ID |
572
+ | ↳ `owner` | `string` | ❌ | — | — | Filter by owner |
371
573
 
372
574
  **Returns:** `Promise<AuthenticationItem>`
373
575
 
374
576
  **Example:**
375
577
 
376
578
  ```typescript
377
- const result = await sdk.findUniqueAuthentication({
378
- options: "example-value",
379
- });
579
+ const { data: authentication } = await sdk.findUniqueAuthentication();
380
580
  ```
381
581
 
382
582
  #### `getAuthentication`
@@ -385,18 +585,17 @@ Get a specific authentication by ID
385
585
 
386
586
  **Parameters:**
387
587
 
388
- | Name | Type | Required | Default | Possible Values | Description |
389
- | -------------------- | -------- | -------- | ------- | --------------- | ----------------------------------- |
390
- | `options` | `string` | ✅ | — | — | Get a specific authentication by ID |
391
- | ↳ `authenticationId` | `number` | ✅ | — | — | Authentication ID to retrieve |
588
+ | Name | Type | Required | Default | Possible Values | Description |
589
+ | -------------------- | -------- | -------- | ------- | --------------- | ----------------------------- |
590
+ | `options` | `object` | ✅ | — | — | |
591
+ | ↳ `authenticationId` | `number` | ✅ | — | — | Authentication ID to retrieve |
392
592
 
393
593
  **Returns:** `Promise<AuthenticationItem>`
394
594
 
395
595
  **Example:**
396
596
 
397
597
  ```typescript
398
- const result = await sdk.getAuthentication({
399
- options: "example-value",
598
+ const { data: authentication } = await sdk.getAuthentication({
400
599
  authenticationId: 12345,
401
600
  });
402
601
  ```
@@ -407,26 +606,36 @@ List available authentications with optional filtering
407
606
 
408
607
  **Parameters:**
409
608
 
410
- | Name | Type | Required | Default | Possible Values | Description |
411
- | --------------------- | -------- | -------- | ------- | --------------- | ------------------------------------------------------------------------ |
412
- | `options` | `string` | ✅ | — | — | List available authentications with optional filtering |
413
- | ↳ `appKey` | `string` | ❌ | — | — | App key of authentications to list (e.g., 'SlackCLIAPI') |
414
- | ↳ `authenticationIds` | `array` | ❌ | — | — | List of authentication IDs to filter by |
415
- | ↳ `search` | `string` | ❌ | — | — | Search term to filter authentications by title |
416
- | ↳ `title` | `string` | ❌ | — | — | Filter authentications by exact title match |
417
- | ↳ `accountId` | `string` | ❌ | — | — | Filter by account ID |
418
- | ↳ `owner` | `string` | ❌ | — | — | Filter by owner, 'me' for your own authentications or a specific user ID |
419
- | ↳ `pageSize` | `number` | ❌ | — | — | Number of authentications per page |
420
- | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
609
+ | Name | Type | Required | Default | Possible Values | Description |
610
+ | --------------------- | -------- | -------- | ------- | --------------- | ------------------------------------------------------------------------------ |
611
+ | `options` | `object` | ✅ | — | — | |
612
+ | ↳ `appKey` | `string` | ❌ | — | — | App key of authentications to list (e.g., 'SlackCLIAPI' or slug like 'github') |
613
+ | ↳ `authenticationIds` | `array` | ❌ | — | — | List of authentication IDs to filter by |
614
+ | ↳ `search` | `string` | ❌ | — | — | Search term to filter authentications by title |
615
+ | ↳ `title` | `string` | ❌ | — | — | Filter authentications by exact title match |
616
+ | ↳ `accountId` | `string` | ❌ | — | — | Filter by account ID |
617
+ | ↳ `owner` | `string` | ❌ | — | — | Filter by owner, 'me' for your own authentications or a specific user ID |
618
+ | ↳ `pageSize` | `number` | ❌ | — | — | Number of authentications per page |
619
+ | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
620
+ | ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
421
621
 
422
622
  **Returns:** `Promise<PaginatedResult<AuthenticationItem>>`
423
623
 
424
624
  **Example:**
425
625
 
426
626
  ```typescript
427
- const result = await sdk.listAuthentications({
428
- options: "example-value",
429
- });
627
+ // Get first page and a cursor for the second page
628
+ const { data: authentications, nextCursor } = await sdk.listAuthentications();
629
+
630
+ // Or iterate over all pages
631
+ for await (const page of sdk.listAuthentications()) {
632
+ // Do something with each page
633
+ }
634
+
635
+ // Or iterate over individual items across all pages
636
+ for await (const authentication of sdk.listAuthentications().items()) {
637
+ // Do something with each authentication
638
+ }
430
639
  ```
431
640
 
432
641
  ### HTTP Requests
@@ -440,7 +649,7 @@ Execute fetch
440
649
  | Name | Type | Required | Default | Possible Values | Description |
441
650
  | -------------------------- | -------- | -------- | ------- | ---------------------------------------------------------- | -------------------------------------------------------------------- |
442
651
  | `url` | `string` | ✅ | — | — | The URL to fetch |
443
- | `init` | `string` | ❌ | — | — | Fetch options including authentication |
652
+ | `init` | `object` | ❌ | — | — | Fetch options including authentication |
444
653
  | ↳ `method` | `string` | ❌ | — | `GET`, `POST`, `PUT`, `DELETE`, `PATCH`, `HEAD`, `OPTIONS` | |
445
654
  | ↳ `headers` | `object` | ❌ | — | — | |
446
655
  | ↳ `body` | `string` | ❌ | — | — | |
@@ -453,7 +662,7 @@ Execute fetch
453
662
  **Example:**
454
663
 
455
664
  ```typescript
456
- const result = await sdk.fetch("https://example.com");
665
+ const result = await sdk.fetch("https://example.com", { key: "value" });
457
666
  ```
458
667
 
459
668
  #### `request`
@@ -464,7 +673,7 @@ Make authenticated HTTP requests through Zapier's Relay service
464
673
 
465
674
  | Name | Type | Required | Default | Possible Values | Description |
466
675
  | -------------------------- | -------- | -------- | ------- | ---------------------------------------------------------- | -------------------------------------------------------------------- |
467
- | `options` | `string` | ✅ | — | — | Make authenticated HTTP requests through Zapier's Relay service |
676
+ | `options` | `object` | ✅ | — | — | |
468
677
  | ↳ `url` | `string` | ✅ | — | — | The URL to request (will be proxied through Relay) |
469
678
  | ↳ `method` | `string` | ❌ | — | `GET`, `POST`, `PUT`, `DELETE`, `PATCH`, `HEAD`, `OPTIONS` | HTTP method |
470
679
  | ↳ `body` | `string` | ❌ | — | — | Request body as a string |
@@ -480,7 +689,6 @@ Make authenticated HTTP requests through Zapier's Relay service
480
689
 
481
690
  ```typescript
482
691
  const result = await sdk.request({
483
- options: "example-value",
484
692
  url: "https://example.com",
485
693
  });
486
694
  ```