@zapier/zapier-sdk 0.11.1 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @zapier/zapier-sdk
2
2
 
3
+ ## 0.11.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 407245e: Add packages to meta so we can document `fetch` for SDK but not CLI/MCP.
8
+
3
9
  ## 0.11.1
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -22,6 +22,7 @@
22
22
  - [`getAuthentication`](#getauthentication)
23
23
  - [`listAuthentications`](#listauthentications)
24
24
  - [HTTP Requests](#http-requests)
25
+ - [`fetch`](#fetch)
25
26
  - [`request`](#request)
26
27
 
27
28
  ## Installation
@@ -62,7 +63,11 @@ const result = await sdk.runAction({
62
63
 
63
64
  Get current user's profile information
64
65
 
65
- **Parameters:** None
66
+ **Parameters:**
67
+
68
+ | Name | Type | Required | Default | Possible Values | Description |
69
+ | --------- | -------- | -------- | ------- | --------------- | -------------------------------------- |
70
+ | `options` | `string` | ❌ | — | — | Get current user's profile information |
66
71
 
67
72
  **Returns:** `Promise<ProfileItem>`
68
73
 
@@ -80,11 +85,12 @@ Get detailed information about a specific action
80
85
 
81
86
  **Parameters:**
82
87
 
83
- | Name | Type | Required | Default | Possible Values | Description |
84
- | ------------ | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------- |
85
- | `appKey` | `string` | ✅ | — | — | App key (e.g., 'SlackCLIAPI') |
86
- | `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
87
- | `actionKey` | `string` | ✅ | — | | Action key to execute |
88
+ | Name | Type | Required | Default | Possible Values | Description |
89
+ | -------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------- |
90
+ | `options` | `string` | ✅ | — | — | Get detailed information about a specific action |
91
+ | ↳ `appKey` | `string` | ✅ | — | | App key (e.g., 'SlackCLIAPI') |
92
+ | ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
93
+ | ↳ `actionKey` | `string` | ✅ | — | — | Action key to execute |
88
94
 
89
95
  **Returns:** `Promise<ActionItem>`
90
96
 
@@ -92,6 +98,7 @@ Get detailed information about a specific action
92
98
 
93
99
  ```typescript
94
100
  const result = await sdk.getAction({
101
+ options: "example-value",
95
102
  appKey: "example-key",
96
103
  actionType: "read",
97
104
  actionKey: "example-key",
@@ -104,12 +111,13 @@ List all actions for a specific app
104
111
 
105
112
  **Parameters:**
106
113
 
107
- | Name | Type | Required | Default | Possible Values | Description |
108
- | ------------ | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------ |
109
- | `appKey` | `string` | ✅ | — | — | App key of actions to list (e.g., 'SlackCLIAPI') |
110
- | `actionType` | `string` | | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Filter actions by type |
111
- | `pageSize` | `number` | ❌ | — | | Number of actions per page |
112
- | `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
114
+ | Name | Type | Required | Default | Possible Values | Description |
115
+ | -------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------ |
116
+ | `options` | `string` | ✅ | — | — | List all actions for a specific app |
117
+ | ↳ `appKey` | `string` | | — | — | App key of actions to list (e.g., 'SlackCLIAPI') |
118
+ | ↳ `actionType` | `string` | ❌ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Filter actions by type |
119
+ | ↳ `pageSize` | `number` | ❌ | — | — | Number of actions per page |
120
+ | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
113
121
 
114
122
  **Returns:** `Promise<PaginatedResult<ActionItem>>`
115
123
 
@@ -117,6 +125,7 @@ List all actions for a specific app
117
125
 
118
126
  ```typescript
119
127
  const result = await sdk.listActions({
128
+ options: "example-value",
120
129
  appKey: "example-key",
121
130
  });
122
131
  ```
@@ -127,17 +136,18 @@ Get the available choices for a dynamic dropdown input field
127
136
 
128
137
  **Parameters:**
129
138
 
130
- | Name | Type | Required | Default | Possible Values | Description |
131
- | ------------------ | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
132
- | `appKey` | `string` | ✅ | — | — | App key (e.g., 'SlackCLIAPI') |
133
- | `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
134
- | `actionKey` | `string` | ✅ | — | | Action key to execute |
135
- | `inputFieldKey` | `string` | ✅ | — | — | Input field key to get choices for. |
136
- | `authenticationId` | `string` | | — | — | Authentication ID to use for this action |
137
- | `inputs` | `object` | ❌ | — | — | Current input values that may affect available choices |
138
- | `page` | `number` | ❌ | — | — | Page number for paginated results |
139
- | `pageSize` | `number` | ❌ | — | — | Number of choices per page |
140
- | `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
139
+ | Name | Type | Required | Default | Possible Values | Description |
140
+ | -------------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
141
+ | `options` | `string` | ✅ | — | — | Get the available choices for a dynamic dropdown input field |
142
+ | ↳ `appKey` | `string` | ✅ | — | | App key (e.g., 'SlackCLIAPI') |
143
+ | ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
144
+ | ↳ `actionKey` | `string` | ✅ | — | — | Action key to execute |
145
+ | ↳ `inputFieldKey` | `string` | | — | — | Input field key to get choices for. |
146
+ | ↳ `authenticationId` | `string` | ❌ | — | — | Authentication ID to use for this action |
147
+ | ↳ `inputs` | `object` | ❌ | — | — | Current input values that may affect available choices |
148
+ | ↳ `page` | `number` | ❌ | — | — | Page number for paginated results |
149
+ | ↳ `pageSize` | `number` | ❌ | — | — | Number of choices per page |
150
+ | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
141
151
 
142
152
  **Returns:** `Promise<PaginatedResult<InputFieldChoiceItem>>`
143
153
 
@@ -145,6 +155,7 @@ Get the available choices for a dynamic dropdown input field
145
155
 
146
156
  ```typescript
147
157
  const result = await sdk.listInputFieldChoices({
158
+ options: "example-value",
148
159
  appKey: "example-key",
149
160
  actionType: "read",
150
161
  actionKey: "example-key",
@@ -158,15 +169,16 @@ Get the input fields required for a specific action
158
169
 
159
170
  **Parameters:**
160
171
 
161
- | Name | Type | Required | Default | Possible Values | Description |
162
- | ------------------ | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
163
- | `appKey` | `string` | ✅ | — | — | App key (e.g., 'SlackCLIAPI') |
164
- | `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
165
- | `actionKey` | `string` | ✅ | — | | Action key to execute |
166
- | `authenticationId` | `string` | | — | — | Authentication ID to use for this action |
167
- | `inputs` | `object` | ❌ | — | — | Current input values that may affect available fields |
168
- | `pageSize` | `number` | ❌ | — | — | Number of input fields per page |
169
- | `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
172
+ | Name | Type | Required | Default | Possible Values | Description |
173
+ | -------------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
174
+ | `options` | `string` | ✅ | — | — | Get the input fields required for a specific action |
175
+ | ↳ `appKey` | `string` | ✅ | — | | App key (e.g., 'SlackCLIAPI') |
176
+ | ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
177
+ | ↳ `actionKey` | `string` | | — | — | Action key to execute |
178
+ | ↳ `authenticationId` | `string` | ❌ | — | — | Authentication ID to use for this action |
179
+ | ↳ `inputs` | `object` | ❌ | — | — | Current input values that may affect available fields |
180
+ | ↳ `pageSize` | `number` | ❌ | — | — | Number of input fields per page |
181
+ | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
170
182
 
171
183
  **Returns:** `Promise<PaginatedResult<RootFieldItemItem>>`
172
184
 
@@ -174,6 +186,7 @@ Get the input fields required for a specific action
174
186
 
175
187
  ```typescript
176
188
  const result = await sdk.listInputFields({
189
+ options: "example-value",
177
190
  appKey: "example-key",
178
191
  actionType: "read",
179
192
  actionKey: "example-key",
@@ -186,15 +199,16 @@ Execute an action with the given inputs
186
199
 
187
200
  **Parameters:**
188
201
 
189
- | Name | Type | Required | Default | Possible Values | Description |
190
- | ------------------ | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------- |
191
- | `appKey` | `string` | ✅ | — | — | App key (e.g., 'SlackCLIAPI') |
192
- | `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
193
- | `actionKey` | `string` | ✅ | — | | Action key to execute |
194
- | `authenticationId` | `string` | | — | — | Authentication ID to use for this action |
195
- | `inputs` | `object` | ❌ | — | — | Input parameters for the action |
196
- | `pageSize` | `number` | ❌ | — | — | Number of results per page |
197
- | `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
202
+ | Name | Type | Required | Default | Possible Values | Description |
203
+ | -------------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------- |
204
+ | `options` | `string` | ✅ | — | — | Execute an action with the given inputs |
205
+ | ↳ `appKey` | `string` | ✅ | — | | App key (e.g., 'SlackCLIAPI') |
206
+ | ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
207
+ | ↳ `actionKey` | `string` | | — | — | Action key to execute |
208
+ | ↳ `authenticationId` | `string` | ❌ | — | — | Authentication ID to use for this action |
209
+ | ↳ `inputs` | `object` | ❌ | — | — | Input parameters for the action |
210
+ | ↳ `pageSize` | `number` | ❌ | — | — | Number of results per page |
211
+ | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
198
212
 
199
213
  **Returns:** `Promise<PaginatedResult<ActionResultItem>>`
200
214
 
@@ -202,6 +216,7 @@ Execute an action with the given inputs
202
216
 
203
217
  ```typescript
204
218
  const result = await sdk.runAction({
219
+ options: "example-value",
205
220
  appKey: "example-key",
206
221
  actionType: "read",
207
222
  actionKey: "example-key",
@@ -216,9 +231,10 @@ Get detailed information about a specific app
216
231
 
217
232
  **Parameters:**
218
233
 
219
- | Name | Type | Required | Default | Possible Values | Description |
220
- | -------- | -------- | -------- | ------- | --------------- | --------------------------------------------- |
221
- | `appKey` | `string` | ✅ | — | — | App key of app to fetch (e.g., 'SlackCLIAPI') |
234
+ | Name | Type | Required | Default | Possible Values | Description |
235
+ | ---------- | -------- | -------- | ------- | --------------- | --------------------------------------------- |
236
+ | `options` | `string` | ✅ | — | — | Get detailed information about a specific app |
237
+ | ↳ `appKey` | `string` | ✅ | — | — | App key of app to fetch (e.g., 'SlackCLIAPI') |
222
238
 
223
239
  **Returns:** `Promise<AppItem>`
224
240
 
@@ -226,6 +242,7 @@ Get detailed information about a specific app
226
242
 
227
243
  ```typescript
228
244
  const result = await sdk.getApp({
245
+ options: "example-value",
229
246
  appKey: "example-key",
230
247
  });
231
248
  ```
@@ -236,19 +253,22 @@ List all available apps with optional filtering
236
253
 
237
254
  **Parameters:**
238
255
 
239
- | Name | Type | Required | Default | Possible Values | Description |
240
- | ---------- | -------- | -------- | ------- | --------------- | ------------------------------------------------------------------- |
241
- | `appKeys` | `array` | | — | — | Filter apps by app keys (e.g., 'SlackCLIAPI' or slug like 'github') |
242
- | `search` | `string` | ❌ | — | — | Search for apps by name |
243
- | `pageSize` | `number` | ❌ | — | — | Number of apps per page |
244
- | `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
256
+ | Name | Type | Required | Default | Possible Values | Description |
257
+ | ------------ | -------- | -------- | ------- | --------------- | ------------------------------------------------------------------- |
258
+ | `options` | `string` | | — | — | List all available apps with optional filtering |
259
+ | ↳ `appKeys` | `array` | ❌ | — | — | Filter apps by app keys (e.g., 'SlackCLIAPI' or slug like 'github') |
260
+ | ↳ `search` | `string` | ❌ | — | — | Search for apps by name |
261
+ | ↳ `pageSize` | `number` | ❌ | — | — | Number of apps per page |
262
+ | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
245
263
 
246
264
  **Returns:** `Promise<PaginatedResult<AppItem>>`
247
265
 
248
266
  **Example:**
249
267
 
250
268
  ```typescript
251
- const result = await sdk.listApps();
269
+ const result = await sdk.listApps({
270
+ options: "example-value",
271
+ });
252
272
  ```
253
273
 
254
274
  ### Authentications
@@ -259,20 +279,23 @@ Find the first authentication matching the criteria
259
279
 
260
280
  **Parameters:**
261
281
 
262
- | Name | Type | Required | Default | Possible Values | Description |
263
- | ----------- | -------- | -------- | ------- | --------------- | ------------------------------------------------------- |
264
- | `appKey` | `string` | | — | — | App key of authentication to find (e.g., 'SlackCLIAPI') |
265
- | `search` | `string` | ❌ | — | — | Search term to filter authentications by title |
266
- | `title` | `string` | ❌ | — | — | Filter authentications by exact title match |
267
- | `accountId` | `string` | ❌ | — | — | Filter by account ID |
268
- | `owner` | `string` | ❌ | — | — | Filter by owner |
282
+ | Name | Type | Required | Default | Possible Values | Description |
283
+ | ------------- | -------- | -------- | ------- | --------------- | ------------------------------------------------------- |
284
+ | `options` | `string` | | — | — | Find the first authentication matching the criteria |
285
+ | ↳ `appKey` | `string` | ❌ | — | — | App key of authentication to find (e.g., 'SlackCLIAPI') |
286
+ | ↳ `search` | `string` | ❌ | — | — | Search term to filter authentications by title |
287
+ | ↳ `title` | `string` | ❌ | — | — | Filter authentications by exact title match |
288
+ | ↳ `accountId` | `string` | ❌ | — | — | Filter by account ID |
289
+ | ↳ `owner` | `string` | ❌ | — | — | Filter by owner |
269
290
 
270
291
  **Returns:** `Promise<AuthenticationItem>`
271
292
 
272
293
  **Example:**
273
294
 
274
295
  ```typescript
275
- const result = await sdk.findFirstAuthentication();
296
+ const result = await sdk.findFirstAuthentication({
297
+ options: "example-value",
298
+ });
276
299
  ```
277
300
 
278
301
  #### `findUniqueAuthentication`
@@ -281,20 +304,23 @@ Find a unique authentication matching the criteria
281
304
 
282
305
  **Parameters:**
283
306
 
284
- | Name | Type | Required | Default | Possible Values | Description |
285
- | ----------- | -------- | -------- | ------- | --------------- | ------------------------------------------------------- |
286
- | `appKey` | `string` | | — | — | App key of authentication to find (e.g., 'SlackCLIAPI') |
287
- | `search` | `string` | ❌ | — | — | Search term to filter authentications by title |
288
- | `title` | `string` | ❌ | — | — | Filter authentications by exact title match |
289
- | `accountId` | `string` | ❌ | — | — | Filter by account ID |
290
- | `owner` | `string` | ❌ | — | — | Filter by owner |
307
+ | Name | Type | Required | Default | Possible Values | Description |
308
+ | ------------- | -------- | -------- | ------- | --------------- | ------------------------------------------------------- |
309
+ | `options` | `string` | | — | — | Find a unique authentication matching the criteria |
310
+ | ↳ `appKey` | `string` | ❌ | — | — | App key of authentication to find (e.g., 'SlackCLIAPI') |
311
+ | ↳ `search` | `string` | ❌ | — | — | Search term to filter authentications by title |
312
+ | ↳ `title` | `string` | ❌ | — | — | Filter authentications by exact title match |
313
+ | ↳ `accountId` | `string` | ❌ | — | — | Filter by account ID |
314
+ | ↳ `owner` | `string` | ❌ | — | — | Filter by owner |
291
315
 
292
316
  **Returns:** `Promise<AuthenticationItem>`
293
317
 
294
318
  **Example:**
295
319
 
296
320
  ```typescript
297
- const result = await sdk.findUniqueAuthentication();
321
+ const result = await sdk.findUniqueAuthentication({
322
+ options: "example-value",
323
+ });
298
324
  ```
299
325
 
300
326
  #### `getAuthentication`
@@ -303,9 +329,10 @@ Get a specific authentication by ID
303
329
 
304
330
  **Parameters:**
305
331
 
306
- | Name | Type | Required | Default | Possible Values | Description |
307
- | ------------------ | -------- | -------- | ------- | --------------- | ----------------------------- |
308
- | `authenticationId` | `number` | ✅ | — | — | Authentication ID to retrieve |
332
+ | Name | Type | Required | Default | Possible Values | Description |
333
+ | -------------------- | -------- | -------- | ------- | --------------- | ----------------------------------- |
334
+ | `options` | `string` | ✅ | — | — | Get a specific authentication by ID |
335
+ | ↳ `authenticationId` | `number` | ✅ | — | — | Authentication ID to retrieve |
309
336
 
310
337
  **Returns:** `Promise<AuthenticationItem>`
311
338
 
@@ -313,6 +340,7 @@ Get a specific authentication by ID
313
340
 
314
341
  ```typescript
315
342
  const result = await sdk.getAuthentication({
343
+ options: "example-value",
316
344
  authenticationId: 12345,
317
345
  });
318
346
  ```
@@ -323,43 +351,72 @@ List available authentications with optional filtering
323
351
 
324
352
  **Parameters:**
325
353
 
326
- | Name | Type | Required | Default | Possible Values | Description |
327
- | ------------------- | -------- | -------- | ------- | --------------- | -------------------------------------------------------- |
328
- | `appKey` | `string` | | — | — | App key of authentications to list (e.g., 'SlackCLIAPI') |
329
- | `authenticationIds` | `array` | ❌ | — | — | List of authentication IDs to filter by |
330
- | `search` | `string` | ❌ | — | — | Search term to filter authentications by title |
331
- | `title` | `string` | ❌ | — | — | Filter authentications by exact title match |
332
- | `accountId` | `string` | ❌ | — | — | Filter by account ID |
333
- | `owner` | `string` | ❌ | — | — | Filter by owner |
334
- | `pageSize` | `number` | ❌ | — | — | Number of authentications per page |
335
- | `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
354
+ | Name | Type | Required | Default | Possible Values | Description |
355
+ | --------------------- | -------- | -------- | ------- | --------------- | -------------------------------------------------------- |
356
+ | `options` | `string` | | — | — | List available authentications with optional filtering |
357
+ | ↳ `appKey` | `string` | ❌ | — | — | App key of authentications to list (e.g., 'SlackCLIAPI') |
358
+ | ↳ `authenticationIds` | `array` | ❌ | — | — | List of authentication IDs to filter by |
359
+ | ↳ `search` | `string` | ❌ | — | — | Search term to filter authentications by title |
360
+ | ↳ `title` | `string` | ❌ | — | — | Filter authentications by exact title match |
361
+ | ↳ `accountId` | `string` | ❌ | — | — | Filter by account ID |
362
+ | ↳ `owner` | `string` | ❌ | — | — | Filter by owner |
363
+ | ↳ `pageSize` | `number` | ❌ | — | — | Number of authentications per page |
364
+ | ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
336
365
 
337
366
  **Returns:** `Promise<PaginatedResult<AuthenticationItem>>`
338
367
 
339
368
  **Example:**
340
369
 
341
370
  ```typescript
342
- const result = await sdk.listAuthentications();
371
+ const result = await sdk.listAuthentications({
372
+ options: "example-value",
373
+ });
343
374
  ```
344
375
 
345
376
  ### HTTP Requests
346
377
 
378
+ #### `fetch`
379
+
380
+ Execute fetch
381
+
382
+ **Parameters:**
383
+
384
+ | Name | Type | Required | Default | Possible Values | Description |
385
+ | -------------------------- | -------- | -------- | ------- | ---------------------------------------------------------- | -------------------------------------------------------------------- |
386
+ | `url` | `string` | ✅ | — | — | The URL to fetch |
387
+ | `init` | `string` | ❌ | — | — | Fetch options including authentication |
388
+ | ↳ `method` | `string` | ❌ | — | `GET`, `POST`, `PUT`, `DELETE`, `PATCH`, `HEAD`, `OPTIONS` | |
389
+ | ↳ `headers` | `object` | ❌ | — | — | |
390
+ | ↳ `body` | `string` | ❌ | — | — | |
391
+ | ↳ `authenticationId` | `number` | ❌ | — | — | Zapier authentication ID to use for the request |
392
+ | ↳ `callbackUrl` | `string` | ❌ | — | — | URL to send async response to (makes request async) |
393
+ | ↳ `authenticationTemplate` | `string` | ❌ | — | — | Optional JSON string authentication template to bypass Notary lookup |
394
+
395
+ **Returns:** `Promise<Response>`
396
+
397
+ **Example:**
398
+
399
+ ```typescript
400
+ const result = await sdk.fetch("https://example.com");
401
+ ```
402
+
347
403
  #### `request`
348
404
 
349
405
  Make authenticated HTTP requests through Zapier's Relay service
350
406
 
351
407
  **Parameters:**
352
408
 
353
- | Name | Type | Required | Default | Possible Values | Description |
354
- | ------------------------ | -------- | -------- | ------- | ---------------------------------------------------------- | -------------------------------------------------------------------- |
355
- | `url` | `string` | ✅ | — | — | The URL to request (will be proxied through Relay) |
356
- | `method` | `string` | | — | `GET`, `POST`, `PUT`, `DELETE`, `PATCH`, `HEAD`, `OPTIONS` | HTTP method |
357
- | `body` | `string` | ❌ | — | — | Request body as a string |
358
- | `authenticationId` | `number` | ❌ | — | — | Zapier authentication ID to use for the request |
359
- | `callbackUrl` | `string` | ❌ | — | — | URL to send async response to (makes request async) |
360
- | `authenticationTemplate` | `string` | ❌ | — | — | Optional JSON string authentication template to bypass Notary lookup |
361
- | `headers` | `string` | ❌ | — | — | Request headers |
362
- | `relayBaseUrl` | `string` | ❌ | — | — | Base URL for Relay service |
409
+ | Name | Type | Required | Default | Possible Values | Description |
410
+ | -------------------------- | -------- | -------- | ------- | ---------------------------------------------------------- | -------------------------------------------------------------------- |
411
+ | `options` | `string` | ✅ | — | — | Make authenticated HTTP requests through Zapier's Relay service |
412
+ | ↳ `url` | `string` | | — | — | The URL to request (will be proxied through Relay) |
413
+ | ↳ `method` | `string` | ❌ | — | `GET`, `POST`, `PUT`, `DELETE`, `PATCH`, `HEAD`, `OPTIONS` | HTTP method |
414
+ | ↳ `body` | `string` | ❌ | — | — | Request body as a string |
415
+ | ↳ `authenticationId` | `number` | ❌ | — | — | Zapier authentication ID to use for the request |
416
+ | ↳ `callbackUrl` | `string` | ❌ | — | — | URL to send async response to (makes request async) |
417
+ | ↳ `authenticationTemplate` | `string` | ❌ | — | — | Optional JSON string authentication template to bypass Notary lookup |
418
+ | ↳ `headers` | `string` | ❌ | — | — | Request headers |
419
+ | ↳ `relayBaseUrl` | `string` | ❌ | — | — | Base URL for Relay service |
363
420
 
364
421
  **Returns:** `Promise<Response>`
365
422
 
@@ -367,6 +424,7 @@ Make authenticated HTTP requests through Zapier's Relay service
367
424
 
368
425
  ```typescript
369
426
  const result = await sdk.request({
427
+ options: "example-value",
370
428
  url: "https://example.com",
371
429
  });
372
430
  ```
package/dist/index.cjs CHANGED
@@ -298,6 +298,21 @@ var appsPlugin = ({ sdk }) => {
298
298
  apps: createAppsProxy({ sdk })
299
299
  };
300
300
  };
301
+ var FetchUrlSchema = zod.z.union([zod.z.string(), zod.z.instanceof(URL)]).describe("The URL to fetch");
302
+ var FetchInitSchema = zod.z.object({
303
+ method: zod.z.enum(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]).optional(),
304
+ headers: zod.z.record(zod.z.string()).optional(),
305
+ body: zod.z.union([
306
+ zod.z.string(),
307
+ zod.z.instanceof(FormData),
308
+ zod.z.instanceof(URLSearchParams)
309
+ ]).optional(),
310
+ authenticationId: zod.z.number().optional().describe("Zapier authentication ID to use for the request"),
311
+ callbackUrl: zod.z.string().optional().describe("URL to send async response to (makes request async)"),
312
+ authenticationTemplate: zod.z.string().optional().describe(
313
+ "Optional JSON string authentication template to bypass Notary lookup"
314
+ )
315
+ }).optional().describe("Fetch options including authentication");
301
316
 
302
317
  // src/plugins/fetch/index.ts
303
318
  var fetchPlugin = ({ sdk }) => {
@@ -318,6 +333,19 @@ var fetchPlugin = ({ sdk }) => {
318
333
  callbackUrl,
319
334
  authenticationTemplate
320
335
  });
336
+ },
337
+ context: {
338
+ meta: {
339
+ fetch: {
340
+ packages: ["sdk"],
341
+ categories: ["http"],
342
+ returnType: "Response",
343
+ inputParameters: [
344
+ { name: "url", schema: FetchUrlSchema },
345
+ { name: "init", schema: FetchInitSchema }
346
+ ]
347
+ }
348
+ }
321
349
  }
322
350
  };
323
351
  };
@@ -3495,37 +3523,53 @@ var registryPlugin = ({ sdk, context }) => {
3495
3523
  itemType: meta.itemType,
3496
3524
  returnType: meta.returnType,
3497
3525
  inputSchema: meta.inputSchema,
3526
+ inputParameters: meta.inputParameters,
3498
3527
  outputSchema: meta.outputSchema,
3499
3528
  categories: meta.categories || [],
3500
- resolvers: meta.resolvers
3529
+ resolvers: meta.resolvers,
3530
+ packages: meta.packages
3501
3531
  };
3502
3532
  }).sort((a, b) => a.name.localeCompare(b.name));
3503
3533
  const knownCategories = Object.keys(categoryDefinitions);
3504
- const categories = knownCategories.sort((a, b) => {
3505
- if (a === "other") return 1;
3506
- if (b === "other") return -1;
3507
- const titleA = categoryDefinitions[a].title;
3508
- const titleB = categoryDefinitions[b].title;
3509
- return titleA.localeCompare(titleB);
3510
- }).map((categoryKey) => {
3511
- const categoryFunctions = functions.filter(
3512
- (f) => f.categories.includes(categoryKey) || // If the category is "other" and the function is not in any other category, include it
3513
- categoryKey === "other" && !f.categories.some((c) => knownCategories.includes(c))
3514
- ).map((f) => f.name).sort();
3515
- const definition = categoryDefinitions[categoryKey];
3516
- const title = definition.title;
3517
- return {
3518
- key: categoryKey,
3519
- title,
3520
- titlePlural: definition.titlePlural ?? `${title}s`,
3521
- functions: categoryFunctions
3522
- };
3523
- });
3524
- function getRegistry() {
3525
- return {
3526
- functions,
3527
- categories
3534
+ const registryCache = /* @__PURE__ */ new Map();
3535
+ function getRegistry(options) {
3536
+ const packageFilter = options?.package;
3537
+ const cacheKey = packageFilter || "__all__";
3538
+ if (registryCache.has(cacheKey)) {
3539
+ return registryCache.get(cacheKey);
3540
+ }
3541
+ const filteredFunctions = packageFilter ? functions.filter(
3542
+ (f) => (
3543
+ // Include if packages is undefined (belongs to all packages) or includes the specified package
3544
+ !f.packages || f.packages.includes(packageFilter)
3545
+ )
3546
+ ) : functions;
3547
+ const filteredCategories = knownCategories.sort((a, b) => {
3548
+ if (a === "other") return 1;
3549
+ if (b === "other") return -1;
3550
+ const titleA = categoryDefinitions[a].title;
3551
+ const titleB = categoryDefinitions[b].title;
3552
+ return titleA.localeCompare(titleB);
3553
+ }).map((categoryKey) => {
3554
+ const categoryFunctions = filteredFunctions.filter(
3555
+ (f) => f.categories.includes(categoryKey) || // If the category is "other" and the function is not in any other category, include it
3556
+ categoryKey === "other" && !f.categories.some((c) => knownCategories.includes(c))
3557
+ ).map((f) => f.name).sort();
3558
+ const definition = categoryDefinitions[categoryKey];
3559
+ const title = definition.title;
3560
+ return {
3561
+ key: categoryKey,
3562
+ title,
3563
+ titlePlural: definition.titlePlural ?? `${title}s`,
3564
+ functions: categoryFunctions
3565
+ };
3566
+ }).filter((category) => category.functions.length > 0);
3567
+ const result = {
3568
+ functions: filteredFunctions,
3569
+ categories: filteredCategories
3528
3570
  };
3571
+ registryCache.set(cacheKey, result);
3572
+ return result;
3529
3573
  }
3530
3574
  return {
3531
3575
  getRegistry