@zapier/zapier-sdk 0.6.4 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +55 -23
- package/dist/api/schemas.d.ts +114 -0
- package/dist/api/schemas.d.ts.map +1 -1
- package/dist/api/schemas.js +45 -0
- package/dist/api/types.d.ts +5 -1
- package/dist/api/types.d.ts.map +1 -1
- package/dist/index.cjs +171 -7
- package/dist/index.d.mts +84 -10
- package/dist/index.mjs +171 -7
- package/dist/plugins/findFirstAuthentication/index.test.js +3 -3
- package/dist/plugins/findFirstAuthentication/schemas.d.ts +3 -3
- package/dist/plugins/findFirstAuthentication/schemas.js +1 -1
- package/dist/plugins/findUniqueAuthentication/index.test.js +3 -3
- package/dist/plugins/findUniqueAuthentication/schemas.d.ts +3 -3
- package/dist/plugins/findUniqueAuthentication/schemas.js +1 -1
- package/dist/plugins/listAuthentications/index.d.ts.map +1 -1
- package/dist/plugins/listAuthentications/index.js +2 -3
- package/dist/plugins/listAuthentications/index.test.js +5 -5
- package/dist/plugins/listAuthentications/schemas.d.ts +3 -3
- package/dist/plugins/listAuthentications/schemas.js +1 -1
- package/dist/plugins/listInputFieldChoices/index.d.ts +28 -0
- package/dist/plugins/listInputFieldChoices/index.d.ts.map +1 -0
- package/dist/plugins/listInputFieldChoices/index.js +78 -0
- package/dist/plugins/listInputFieldChoices/index.test.d.ts +2 -0
- package/dist/plugins/listInputFieldChoices/index.test.d.ts.map +1 -0
- package/dist/plugins/listInputFieldChoices/index.test.js +537 -0
- package/dist/plugins/listInputFieldChoices/schemas.d.ts +61 -0
- package/dist/plugins/listInputFieldChoices/schemas.d.ts.map +1 -0
- package/dist/plugins/listInputFieldChoices/schemas.js +73 -0
- package/dist/sdk.d.ts +7 -1
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +2 -0
- package/package.json +1 -1
- package/src/api/schemas.ts +62 -0
- package/src/api/types.ts +14 -0
- package/src/plugins/findFirstAuthentication/index.test.ts +3 -3
- package/src/plugins/findFirstAuthentication/schemas.ts +1 -1
- package/src/plugins/findUniqueAuthentication/index.test.ts +3 -3
- package/src/plugins/findUniqueAuthentication/schemas.ts +1 -1
- package/src/plugins/listAuthentications/index.test.ts +5 -5
- package/src/plugins/listAuthentications/index.ts +2 -3
- package/src/plugins/listAuthentications/schemas.ts +1 -1
- package/src/plugins/listInputFieldChoices/index.test.ts +653 -0
- package/src/plugins/listInputFieldChoices/index.ts +152 -0
- package/src/plugins/listInputFieldChoices/schemas.ts +139 -0
- package/src/sdk.ts +2 -0
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @zapier/zapier-sdk
|
|
2
2
|
|
|
3
|
+
## 0.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 3a39eee: Add listInputFieldChoices method
|
|
8
|
+
|
|
9
|
+
## 0.7.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 096d674: Changed incorrect account_id parameter to accountId. Also made sure all CLI parameters are documented as kebab-case.
|
|
14
|
+
|
|
3
15
|
## 0.6.4
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
- [Actions](#actions)
|
|
13
13
|
- [`getAction`](#getaction)
|
|
14
14
|
- [`listActions`](#listactions)
|
|
15
|
+
- [`listInputFieldChoices`](#listinputfieldchoices)
|
|
15
16
|
- [`listInputFields`](#listinputfields)
|
|
16
17
|
- [`runAction`](#runaction)
|
|
17
18
|
- [Apps](#apps)
|
|
@@ -124,6 +125,37 @@ const result = await sdk.listActions({
|
|
|
124
125
|
});
|
|
125
126
|
```
|
|
126
127
|
|
|
128
|
+
#### `listInputFieldChoices`
|
|
129
|
+
|
|
130
|
+
Get the available choices for a dynamic dropdown input field
|
|
131
|
+
|
|
132
|
+
**Parameters:**
|
|
133
|
+
|
|
134
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
135
|
+
| ------------------ | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
|
|
136
|
+
| `appKey` | `string` | ✅ | — | — | App key (e.g., 'SlackCLIAPI') |
|
|
137
|
+
| `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
|
|
138
|
+
| `actionKey` | `string` | ✅ | — | — | Action key to execute |
|
|
139
|
+
| `inputFieldKey` | `string` | ✅ | — | — | Input field key to get choices for. |
|
|
140
|
+
| `authenticationId` | `string` | ❌ | — | — | Authentication ID to use for this action |
|
|
141
|
+
| `inputs` | `object` | ❌ | — | — | Current input values that may affect available choices |
|
|
142
|
+
| `page` | `number` | ❌ | — | — | Page number for paginated results |
|
|
143
|
+
| `pageSize` | `number` | ❌ | — | — | Number of choices per page |
|
|
144
|
+
| `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
|
|
145
|
+
|
|
146
|
+
**Returns:** `Promise<PaginatedResult<InputFieldChoiceItem>>`
|
|
147
|
+
|
|
148
|
+
**Example:**
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
const result = await sdk.listInputFieldChoices({
|
|
152
|
+
appKey: "example-key",
|
|
153
|
+
actionType: "read",
|
|
154
|
+
actionKey: "example-key",
|
|
155
|
+
inputFieldKey: "example-key",
|
|
156
|
+
});
|
|
157
|
+
```
|
|
158
|
+
|
|
127
159
|
#### `listInputFields`
|
|
128
160
|
|
|
129
161
|
Get the input fields required for a specific action
|
|
@@ -231,13 +263,13 @@ Find the first authentication matching the criteria
|
|
|
231
263
|
|
|
232
264
|
**Parameters:**
|
|
233
265
|
|
|
234
|
-
| Name
|
|
235
|
-
|
|
|
236
|
-
| `appKey`
|
|
237
|
-
| `search`
|
|
238
|
-
| `title`
|
|
239
|
-
| `
|
|
240
|
-
| `owner`
|
|
266
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
267
|
+
| ----------- | -------- | -------- | ------- | --------------- | ------------------------------------------------------- |
|
|
268
|
+
| `appKey` | `string` | ❌ | — | — | App key of authentication to find (e.g., 'SlackCLIAPI') |
|
|
269
|
+
| `search` | `string` | ❌ | — | — | Search term to filter authentications by title |
|
|
270
|
+
| `title` | `string` | ❌ | — | — | Filter authentications by exact title match |
|
|
271
|
+
| `accountId` | `string` | ❌ | — | — | Filter by account ID |
|
|
272
|
+
| `owner` | `string` | ❌ | — | — | Filter by owner |
|
|
241
273
|
|
|
242
274
|
**Returns:** `Promise<Authentication | null>`
|
|
243
275
|
|
|
@@ -253,13 +285,13 @@ Find a unique authentication matching the criteria
|
|
|
253
285
|
|
|
254
286
|
**Parameters:**
|
|
255
287
|
|
|
256
|
-
| Name
|
|
257
|
-
|
|
|
258
|
-
| `appKey`
|
|
259
|
-
| `search`
|
|
260
|
-
| `title`
|
|
261
|
-
| `
|
|
262
|
-
| `owner`
|
|
288
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
289
|
+
| ----------- | -------- | -------- | ------- | --------------- | ------------------------------------------------------- |
|
|
290
|
+
| `appKey` | `string` | ❌ | — | — | App key of authentication to find (e.g., 'SlackCLIAPI') |
|
|
291
|
+
| `search` | `string` | ❌ | — | — | Search term to filter authentications by title |
|
|
292
|
+
| `title` | `string` | ❌ | — | — | Filter authentications by exact title match |
|
|
293
|
+
| `accountId` | `string` | ❌ | — | — | Filter by account ID |
|
|
294
|
+
| `owner` | `string` | ❌ | — | — | Filter by owner |
|
|
263
295
|
|
|
264
296
|
**Returns:** `Promise<Authentication | null>`
|
|
265
297
|
|
|
@@ -295,15 +327,15 @@ List available authentications with optional filtering
|
|
|
295
327
|
|
|
296
328
|
**Parameters:**
|
|
297
329
|
|
|
298
|
-
| Name
|
|
299
|
-
|
|
|
300
|
-
| `appKey`
|
|
301
|
-
| `search`
|
|
302
|
-
| `title`
|
|
303
|
-
| `
|
|
304
|
-
| `owner`
|
|
305
|
-
| `pageSize`
|
|
306
|
-
| `maxItems`
|
|
330
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
331
|
+
| ----------- | -------- | -------- | ------- | --------------- | -------------------------------------------------------- |
|
|
332
|
+
| `appKey` | `string` | ❌ | — | — | App key of authentications to list (e.g., 'SlackCLIAPI') |
|
|
333
|
+
| `search` | `string` | ❌ | — | — | Search term to filter authentications by title |
|
|
334
|
+
| `title` | `string` | ❌ | — | — | Filter authentications by exact title match |
|
|
335
|
+
| `accountId` | `string` | ❌ | — | — | Filter by account ID |
|
|
336
|
+
| `owner` | `string` | ❌ | — | — | Filter by owner |
|
|
337
|
+
| `pageSize` | `number` | ❌ | — | — | Number of authentications per page |
|
|
338
|
+
| `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
|
|
307
339
|
|
|
308
340
|
**Returns:** `Promise<PaginatedResult<Authentication>>`
|
|
309
341
|
|
package/dist/api/schemas.d.ts
CHANGED
|
@@ -2470,4 +2470,118 @@ export declare const ImplementationsMetaResponseSchema: z.ZodObject<{
|
|
|
2470
2470
|
next?: string | null | undefined;
|
|
2471
2471
|
previous?: string | null | undefined;
|
|
2472
2472
|
}>;
|
|
2473
|
+
export declare const NeedChoicesResponseMetaSchema: z.ZodObject<{
|
|
2474
|
+
page: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2475
|
+
}, "strip", z.ZodTypeAny, {
|
|
2476
|
+
page?: string | null | undefined;
|
|
2477
|
+
}, {
|
|
2478
|
+
page?: string | null | undefined;
|
|
2479
|
+
}>;
|
|
2480
|
+
export declare const NeedChoicesResponseLinksSchema: z.ZodObject<{
|
|
2481
|
+
next: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2482
|
+
prev: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2483
|
+
}, "strip", z.ZodTypeAny, {
|
|
2484
|
+
next?: string | null | undefined;
|
|
2485
|
+
prev?: string | null | undefined;
|
|
2486
|
+
}, {
|
|
2487
|
+
next?: string | null | undefined;
|
|
2488
|
+
prev?: string | null | undefined;
|
|
2489
|
+
}>;
|
|
2490
|
+
export declare const NeedChoicesRequestSchema: z.ZodObject<{
|
|
2491
|
+
selected_api: z.ZodOptional<z.ZodString>;
|
|
2492
|
+
authentication_id: z.ZodOptional<z.ZodNumber>;
|
|
2493
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
2494
|
+
page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
2495
|
+
prefill: z.ZodOptional<z.ZodString>;
|
|
2496
|
+
action_id: z.ZodOptional<z.ZodString>;
|
|
2497
|
+
input_field_id: z.ZodOptional<z.ZodString>;
|
|
2498
|
+
}, "strip", z.ZodTypeAny, {
|
|
2499
|
+
page: number;
|
|
2500
|
+
params?: Record<string, any> | undefined;
|
|
2501
|
+
prefill?: string | undefined;
|
|
2502
|
+
selected_api?: string | undefined;
|
|
2503
|
+
authentication_id?: number | undefined;
|
|
2504
|
+
action_id?: string | undefined;
|
|
2505
|
+
input_field_id?: string | undefined;
|
|
2506
|
+
}, {
|
|
2507
|
+
params?: Record<string, any> | undefined;
|
|
2508
|
+
prefill?: string | undefined;
|
|
2509
|
+
selected_api?: string | undefined;
|
|
2510
|
+
authentication_id?: number | undefined;
|
|
2511
|
+
page?: number | undefined;
|
|
2512
|
+
action_id?: string | undefined;
|
|
2513
|
+
input_field_id?: string | undefined;
|
|
2514
|
+
}>;
|
|
2515
|
+
export declare const NeedChoicesResponseSchema: z.ZodObject<{
|
|
2516
|
+
success: z.ZodBoolean;
|
|
2517
|
+
choices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2518
|
+
key: z.ZodOptional<z.ZodString>;
|
|
2519
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2520
|
+
sample: z.ZodOptional<z.ZodString>;
|
|
2521
|
+
value: z.ZodOptional<z.ZodString>;
|
|
2522
|
+
}, "strip", z.ZodTypeAny, {
|
|
2523
|
+
value?: string | undefined;
|
|
2524
|
+
key?: string | undefined;
|
|
2525
|
+
label?: string | undefined;
|
|
2526
|
+
sample?: string | undefined;
|
|
2527
|
+
}, {
|
|
2528
|
+
value?: string | undefined;
|
|
2529
|
+
key?: string | undefined;
|
|
2530
|
+
label?: string | undefined;
|
|
2531
|
+
sample?: string | undefined;
|
|
2532
|
+
}>, "many">>;
|
|
2533
|
+
next_page: z.ZodOptional<z.ZodNumber>;
|
|
2534
|
+
errors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2535
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
2536
|
+
page: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2537
|
+
}, "strip", z.ZodTypeAny, {
|
|
2538
|
+
page?: string | null | undefined;
|
|
2539
|
+
}, {
|
|
2540
|
+
page?: string | null | undefined;
|
|
2541
|
+
}>>;
|
|
2542
|
+
links: z.ZodOptional<z.ZodObject<{
|
|
2543
|
+
next: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2544
|
+
prev: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2545
|
+
}, "strip", z.ZodTypeAny, {
|
|
2546
|
+
next?: string | null | undefined;
|
|
2547
|
+
prev?: string | null | undefined;
|
|
2548
|
+
}, {
|
|
2549
|
+
next?: string | null | undefined;
|
|
2550
|
+
prev?: string | null | undefined;
|
|
2551
|
+
}>>;
|
|
2552
|
+
}, "strip", z.ZodTypeAny, {
|
|
2553
|
+
success: boolean;
|
|
2554
|
+
choices?: {
|
|
2555
|
+
value?: string | undefined;
|
|
2556
|
+
key?: string | undefined;
|
|
2557
|
+
label?: string | undefined;
|
|
2558
|
+
sample?: string | undefined;
|
|
2559
|
+
}[] | undefined;
|
|
2560
|
+
meta?: {
|
|
2561
|
+
page?: string | null | undefined;
|
|
2562
|
+
} | undefined;
|
|
2563
|
+
links?: {
|
|
2564
|
+
next?: string | null | undefined;
|
|
2565
|
+
prev?: string | null | undefined;
|
|
2566
|
+
} | undefined;
|
|
2567
|
+
errors?: string[] | undefined;
|
|
2568
|
+
next_page?: number | undefined;
|
|
2569
|
+
}, {
|
|
2570
|
+
success: boolean;
|
|
2571
|
+
choices?: {
|
|
2572
|
+
value?: string | undefined;
|
|
2573
|
+
key?: string | undefined;
|
|
2574
|
+
label?: string | undefined;
|
|
2575
|
+
sample?: string | undefined;
|
|
2576
|
+
}[] | undefined;
|
|
2577
|
+
meta?: {
|
|
2578
|
+
page?: string | null | undefined;
|
|
2579
|
+
} | undefined;
|
|
2580
|
+
links?: {
|
|
2581
|
+
next?: string | null | undefined;
|
|
2582
|
+
prev?: string | null | undefined;
|
|
2583
|
+
} | undefined;
|
|
2584
|
+
errors?: string[] | undefined;
|
|
2585
|
+
next_page?: number | undefined;
|
|
2586
|
+
}>;
|
|
2473
2587
|
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/api/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AAMH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;EAK5B,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0CrB,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;EAE5B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;EAElC,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOpC,CAAC"}
|
package/dist/api/schemas.js
CHANGED
|
@@ -353,3 +353,48 @@ export const ImplementationsMetaResponseSchema = z.object({
|
|
|
353
353
|
previous: z.string().nullable().optional(),
|
|
354
354
|
results: z.array(ImplementationMetaSchema),
|
|
355
355
|
});
|
|
356
|
+
// ============================================================================
|
|
357
|
+
// Need Choices Schemas (for listInputFieldChoices functionality)
|
|
358
|
+
// ============================================================================
|
|
359
|
+
export const NeedChoicesResponseMetaSchema = z.object({
|
|
360
|
+
page: z.string().nullable().optional(),
|
|
361
|
+
});
|
|
362
|
+
export const NeedChoicesResponseLinksSchema = z.object({
|
|
363
|
+
next: z.string().nullable().optional(),
|
|
364
|
+
prev: z.string().nullable().optional(),
|
|
365
|
+
});
|
|
366
|
+
export const NeedChoicesRequestSchema = z.object({
|
|
367
|
+
selected_api: z
|
|
368
|
+
.string()
|
|
369
|
+
.optional()
|
|
370
|
+
.describe("Something like `SlackAPI` (for Python apps) or `SplitwiseCLIAPI@1.0.0` (for CLI apps). Non-public apps are fine as long as the authed user can access them."),
|
|
371
|
+
authentication_id: z
|
|
372
|
+
.number()
|
|
373
|
+
.optional()
|
|
374
|
+
.describe("If the app needs auth, provide an `authentication_id` that has the `selected_api` of the app you want to run. Can be any auth visible to the user (including shared)."),
|
|
375
|
+
params: z
|
|
376
|
+
.record(z.any())
|
|
377
|
+
.optional()
|
|
378
|
+
.describe("Object that matches the input the node would normally get. Has all the same keys/types as the `needs` of the action."),
|
|
379
|
+
page: z.number().optional().default(0),
|
|
380
|
+
prefill: z
|
|
381
|
+
.string()
|
|
382
|
+
.optional()
|
|
383
|
+
.describe("The prefill string to indicate what we're fetching choices for. Likely something like `spreadsheet.id.title`. Must be provided alongside `selected_api` if both `action_id` and `input_field_id` are not."),
|
|
384
|
+
action_id: z
|
|
385
|
+
.string()
|
|
386
|
+
.optional()
|
|
387
|
+
.describe("The id that will be used to lookup the Action for prefill lookup. If provided, `input_field_id` is required, else `prefill` must be provided."),
|
|
388
|
+
input_field_id: z
|
|
389
|
+
.string()
|
|
390
|
+
.optional()
|
|
391
|
+
.describe("The id (key) of the input field (Need) that dynamic choices are being retrieved for. If provided, `action_id` is required, else `prefill` must be provided."),
|
|
392
|
+
});
|
|
393
|
+
export const NeedChoicesResponseSchema = z.object({
|
|
394
|
+
success: z.boolean(),
|
|
395
|
+
choices: z.array(NeedChoicesSchema).optional(),
|
|
396
|
+
next_page: z.number().optional(),
|
|
397
|
+
errors: z.array(z.string()).optional(),
|
|
398
|
+
meta: NeedChoicesResponseMetaSchema.optional(),
|
|
399
|
+
links: NeedChoicesResponseLinksSchema.optional(),
|
|
400
|
+
});
|
package/dist/api/types.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* to ensure a single source of truth and eliminate duplication.
|
|
10
10
|
*/
|
|
11
11
|
import { z } from "zod";
|
|
12
|
-
import { NeedChoicesSchema, NeedSchema, ActionLinksSchema, ActionPermissionsSchema, ActionSchema, ChoiceSchema, FieldSchema, ActionExecutionResultSchema, ActionFieldChoiceSchema, ActionFieldSchema, AuthenticationSchema, AuthenticationsResponseSchema, UserProfileSchema, AppSchema, NeedsRequestSchema, NeedsResponseSchema, ImplementationSchema, ImplementationsResponseSchema, ImplementationMetaSchema, ImplementationsMetaResponseSchema, ServiceSchema, ServicesResponseSchema } from "./schemas";
|
|
12
|
+
import { NeedChoicesSchema, NeedSchema, ActionLinksSchema, ActionPermissionsSchema, ActionSchema, ChoiceSchema, FieldSchema, ActionExecutionResultSchema, ActionFieldChoiceSchema, ActionFieldSchema, AuthenticationSchema, AuthenticationsResponseSchema, UserProfileSchema, AppSchema, NeedsRequestSchema, NeedsResponseSchema, ImplementationSchema, ImplementationsResponseSchema, ImplementationMetaSchema, ImplementationsMetaResponseSchema, ServiceSchema, ServicesResponseSchema, NeedChoicesRequestSchema, NeedChoicesResponseSchema, NeedChoicesResponseMetaSchema, NeedChoicesResponseLinksSchema } from "./schemas";
|
|
13
13
|
export interface ApiClientOptions {
|
|
14
14
|
baseUrl: string;
|
|
15
15
|
token?: string;
|
|
@@ -72,4 +72,8 @@ export type Implementation = z.infer<typeof ImplementationSchema>;
|
|
|
72
72
|
export type ImplementationsResponse = z.infer<typeof ImplementationsResponseSchema>;
|
|
73
73
|
export type ImplementationMeta = z.infer<typeof ImplementationMetaSchema>;
|
|
74
74
|
export type ImplementationsMetaResponse = z.infer<typeof ImplementationsMetaResponseSchema>;
|
|
75
|
+
export type NeedChoicesRequest = z.infer<typeof NeedChoicesRequestSchema>;
|
|
76
|
+
export type NeedChoicesResponse = z.infer<typeof NeedChoicesResponseSchema>;
|
|
77
|
+
export type NeedChoicesResponseMeta = z.infer<typeof NeedChoicesResponseMetaSchema>;
|
|
78
|
+
export type NeedChoicesResponseLinks = z.infer<typeof NeedChoicesResponseLinksSchema>;
|
|
75
79
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/api/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,iBAAiB,EACjB,UAAU,EACV,iBAAiB,EACjB,uBAAuB,EACvB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,2BAA2B,EAC3B,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACpB,6BAA6B,EAC7B,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,6BAA6B,EAC7B,wBAAwB,EACxB,iCAAiC,EACjC,aAAa,EACb,sBAAsB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA;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,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAGtE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAGhE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAC;AAGF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,iCAAiC,CACzC,CAAC;AAGF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAC;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,8BAA8B,CACtC,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1189,6 +1189,42 @@ zod.z.object({
|
|
|
1189
1189
|
previous: zod.z.string().nullable().optional(),
|
|
1190
1190
|
results: zod.z.array(ImplementationMetaSchema)
|
|
1191
1191
|
});
|
|
1192
|
+
var NeedChoicesResponseMetaSchema = zod.z.object({
|
|
1193
|
+
page: zod.z.string().nullable().optional()
|
|
1194
|
+
});
|
|
1195
|
+
var NeedChoicesResponseLinksSchema = zod.z.object({
|
|
1196
|
+
next: zod.z.string().nullable().optional(),
|
|
1197
|
+
prev: zod.z.string().nullable().optional()
|
|
1198
|
+
});
|
|
1199
|
+
zod.z.object({
|
|
1200
|
+
selected_api: zod.z.string().optional().describe(
|
|
1201
|
+
"Something like `SlackAPI` (for Python apps) or `SplitwiseCLIAPI@1.0.0` (for CLI apps). Non-public apps are fine as long as the authed user can access them."
|
|
1202
|
+
),
|
|
1203
|
+
authentication_id: zod.z.number().optional().describe(
|
|
1204
|
+
"If the app needs auth, provide an `authentication_id` that has the `selected_api` of the app you want to run. Can be any auth visible to the user (including shared)."
|
|
1205
|
+
),
|
|
1206
|
+
params: zod.z.record(zod.z.any()).optional().describe(
|
|
1207
|
+
"Object that matches the input the node would normally get. Has all the same keys/types as the `needs` of the action."
|
|
1208
|
+
),
|
|
1209
|
+
page: zod.z.number().optional().default(0),
|
|
1210
|
+
prefill: zod.z.string().optional().describe(
|
|
1211
|
+
"The prefill string to indicate what we're fetching choices for. Likely something like `spreadsheet.id.title`. Must be provided alongside `selected_api` if both `action_id` and `input_field_id` are not."
|
|
1212
|
+
),
|
|
1213
|
+
action_id: zod.z.string().optional().describe(
|
|
1214
|
+
"The id that will be used to lookup the Action for prefill lookup. If provided, `input_field_id` is required, else `prefill` must be provided."
|
|
1215
|
+
),
|
|
1216
|
+
input_field_id: zod.z.string().optional().describe(
|
|
1217
|
+
"The id (key) of the input field (Need) that dynamic choices are being retrieved for. If provided, `action_id` is required, else `prefill` must be provided."
|
|
1218
|
+
)
|
|
1219
|
+
});
|
|
1220
|
+
zod.z.object({
|
|
1221
|
+
success: zod.z.boolean(),
|
|
1222
|
+
choices: zod.z.array(NeedChoicesSchema).optional(),
|
|
1223
|
+
next_page: zod.z.number().optional(),
|
|
1224
|
+
errors: zod.z.array(zod.z.string()).optional(),
|
|
1225
|
+
meta: NeedChoicesResponseMetaSchema.optional(),
|
|
1226
|
+
links: NeedChoicesResponseLinksSchema.optional()
|
|
1227
|
+
});
|
|
1192
1228
|
|
|
1193
1229
|
// src/schemas/Action.ts
|
|
1194
1230
|
var ActionItemSchema = withFormatter(
|
|
@@ -1442,7 +1478,7 @@ var ListAuthenticationsSchema = zod.z.object({
|
|
|
1442
1478
|
),
|
|
1443
1479
|
search: zod.z.string().optional().describe("Search term to filter authentications by title"),
|
|
1444
1480
|
title: zod.z.string().optional().describe("Filter authentications by exact title match"),
|
|
1445
|
-
|
|
1481
|
+
accountId: zod.z.string().optional().describe("Filter by account ID"),
|
|
1446
1482
|
owner: zod.z.string().optional().describe("Filter by owner"),
|
|
1447
1483
|
pageSize: zod.z.number().min(1).optional().describe("Number of authentications per page"),
|
|
1448
1484
|
maxItems: zod.z.number().min(1).optional().describe("Maximum total items to return across all pages")
|
|
@@ -1468,8 +1504,8 @@ var listAuthenticationsPlugin = ({ context }) => {
|
|
|
1468
1504
|
} else if (options.title) {
|
|
1469
1505
|
searchParams.search = options.title;
|
|
1470
1506
|
}
|
|
1471
|
-
if (options.
|
|
1472
|
-
searchParams.account_id = options.
|
|
1507
|
+
if (options.accountId) {
|
|
1508
|
+
searchParams.account_id = options.accountId;
|
|
1473
1509
|
}
|
|
1474
1510
|
if (options.owner) {
|
|
1475
1511
|
searchParams.owner = options.owner;
|
|
@@ -1478,7 +1514,6 @@ var listAuthenticationsPlugin = ({ context }) => {
|
|
|
1478
1514
|
if (options.cursor) {
|
|
1479
1515
|
searchParams.offset = options.cursor;
|
|
1480
1516
|
}
|
|
1481
|
-
console.log({ searchParams });
|
|
1482
1517
|
const data = await api.get(
|
|
1483
1518
|
"/api/v4/authentications/",
|
|
1484
1519
|
{
|
|
@@ -1654,7 +1689,7 @@ var FindFirstAuthenticationSchema = zod.z.object({
|
|
|
1654
1689
|
),
|
|
1655
1690
|
search: zod.z.string().optional().describe("Search term to filter authentications by title"),
|
|
1656
1691
|
title: zod.z.string().optional().describe("Filter authentications by exact title match"),
|
|
1657
|
-
|
|
1692
|
+
accountId: zod.z.string().optional().describe("Filter by account ID"),
|
|
1658
1693
|
owner: zod.z.string().optional().describe("Filter by owner")
|
|
1659
1694
|
}).describe("Find the first authentication matching the criteria");
|
|
1660
1695
|
|
|
@@ -1690,7 +1725,7 @@ var FindUniqueAuthenticationSchema = zod.z.object({
|
|
|
1690
1725
|
),
|
|
1691
1726
|
search: zod.z.string().optional().describe("Search term to filter authentications by title"),
|
|
1692
1727
|
title: zod.z.string().optional().describe("Filter authentications by exact title match"),
|
|
1693
|
-
|
|
1728
|
+
accountId: zod.z.string().optional().describe("Filter by account ID"),
|
|
1694
1729
|
owner: zod.z.string().optional().describe("Filter by owner")
|
|
1695
1730
|
}).describe("Find a unique authentication matching the criteria");
|
|
1696
1731
|
|
|
@@ -2873,6 +2908,135 @@ var registryPlugin = ({ sdk, context }) => {
|
|
|
2873
2908
|
getRegistry
|
|
2874
2909
|
};
|
|
2875
2910
|
};
|
|
2911
|
+
var InputFieldChoiceItemSchema = withFormatter(
|
|
2912
|
+
zod.z.object({
|
|
2913
|
+
key: zod.z.string().optional().describe("Unique key/value for the choice"),
|
|
2914
|
+
label: zod.z.string().optional().describe("Human readable label for the choice"),
|
|
2915
|
+
sample: zod.z.string().optional().describe("Sample value for the choice"),
|
|
2916
|
+
value: zod.z.string().optional().describe("Value to be submitted when selected")
|
|
2917
|
+
}),
|
|
2918
|
+
{
|
|
2919
|
+
format: (item) => {
|
|
2920
|
+
const title = item.label || item.key || "Choice";
|
|
2921
|
+
const subtitle = item.label && item.key && item.label !== item.key ? `(${item.key})` : void 0;
|
|
2922
|
+
const details = [];
|
|
2923
|
+
if (item.sample && item.sample !== item.key) {
|
|
2924
|
+
details.push({ text: `Sample: ${item.sample}`, style: "dim" });
|
|
2925
|
+
}
|
|
2926
|
+
if (item.value && item.value !== item.key) {
|
|
2927
|
+
details.push({ text: `Value: ${item.value}`, style: "normal" });
|
|
2928
|
+
}
|
|
2929
|
+
return {
|
|
2930
|
+
title,
|
|
2931
|
+
subtitle,
|
|
2932
|
+
details
|
|
2933
|
+
};
|
|
2934
|
+
}
|
|
2935
|
+
}
|
|
2936
|
+
);
|
|
2937
|
+
var ListInputFieldChoicesSchema = withOutputSchema(
|
|
2938
|
+
zod.z.object({
|
|
2939
|
+
// Required action identification
|
|
2940
|
+
appKey: AppKeyPropertySchema,
|
|
2941
|
+
actionType: ActionTypePropertySchema,
|
|
2942
|
+
actionKey: ActionKeyPropertySchema,
|
|
2943
|
+
// Input field specification
|
|
2944
|
+
inputFieldKey: zod.z.string().min(1).describe("Input field key to get choices for."),
|
|
2945
|
+
// Common parameters
|
|
2946
|
+
authenticationId: AuthenticationIdPropertySchema.nullable().optional(),
|
|
2947
|
+
inputs: InputsPropertySchema.optional().describe(
|
|
2948
|
+
"Current input values that may affect available choices"
|
|
2949
|
+
),
|
|
2950
|
+
page: zod.z.number().int().min(0).optional().describe("Page number for paginated results"),
|
|
2951
|
+
// Pagination options (SDK-level)
|
|
2952
|
+
pageSize: zod.z.number().min(1).optional().describe("Number of choices per page"),
|
|
2953
|
+
maxItems: zod.z.number().min(1).optional().describe("Maximum total items to return across all pages")
|
|
2954
|
+
}).describe("Get the available choices for a dynamic dropdown input field"),
|
|
2955
|
+
InputFieldChoiceItemSchema
|
|
2956
|
+
);
|
|
2957
|
+
|
|
2958
|
+
// src/plugins/listInputFieldChoices/index.ts
|
|
2959
|
+
function transformNeedChoicesToInputFieldChoiceItem(choice) {
|
|
2960
|
+
return {
|
|
2961
|
+
key: choice.key,
|
|
2962
|
+
label: choice.label,
|
|
2963
|
+
sample: choice.sample,
|
|
2964
|
+
value: choice.value
|
|
2965
|
+
};
|
|
2966
|
+
}
|
|
2967
|
+
var listInputFieldChoicesPlugin = ({ context, sdk }) => {
|
|
2968
|
+
const listInputFieldChoices = createPaginatedFunction(async function listInputFieldChoicesPage(options) {
|
|
2969
|
+
const { api } = context;
|
|
2970
|
+
const {
|
|
2971
|
+
appKey,
|
|
2972
|
+
actionType,
|
|
2973
|
+
actionKey,
|
|
2974
|
+
inputFieldKey,
|
|
2975
|
+
authenticationId,
|
|
2976
|
+
inputs,
|
|
2977
|
+
page,
|
|
2978
|
+
cursor
|
|
2979
|
+
} = options;
|
|
2980
|
+
const actionResult = await sdk.getAction({ appKey, actionType, actionKey });
|
|
2981
|
+
const actionId = actionResult.data.id;
|
|
2982
|
+
if (!actionId) {
|
|
2983
|
+
throw new ZapierApiError(
|
|
2984
|
+
`Action ${actionKey} does not have an ID - cannot retrieve input field choices`
|
|
2985
|
+
);
|
|
2986
|
+
}
|
|
2987
|
+
const requestPage = cursor ? parseInt(cursor, 10) : page ?? 0;
|
|
2988
|
+
const choicesRequest = {
|
|
2989
|
+
action_id: actionId,
|
|
2990
|
+
input_field_id: inputFieldKey,
|
|
2991
|
+
page: requestPage,
|
|
2992
|
+
params: inputs || {}
|
|
2993
|
+
};
|
|
2994
|
+
if (authenticationId !== null) {
|
|
2995
|
+
choicesRequest.authentication_id = authenticationId;
|
|
2996
|
+
}
|
|
2997
|
+
const choicesData = await api.post(
|
|
2998
|
+
"/api/v4/implementations/choices/",
|
|
2999
|
+
choicesRequest
|
|
3000
|
+
);
|
|
3001
|
+
if (!choicesData.success) {
|
|
3002
|
+
throw new ZapierApiError(
|
|
3003
|
+
`Failed to get input field choices: ${choicesData.errors?.join(", ") || "Unknown error"}`
|
|
3004
|
+
);
|
|
3005
|
+
}
|
|
3006
|
+
const choices = (choicesData.choices || []).map(
|
|
3007
|
+
transformNeedChoicesToInputFieldChoiceItem
|
|
3008
|
+
);
|
|
3009
|
+
let nextCursor;
|
|
3010
|
+
if (choicesData.next_page !== void 0) {
|
|
3011
|
+
nextCursor = choicesData.next_page.toString();
|
|
3012
|
+
} else if (choicesData.links?.next) {
|
|
3013
|
+
try {
|
|
3014
|
+
const nextUrl = new URL(choicesData.links.next);
|
|
3015
|
+
const nextPage = nextUrl.searchParams.get("page");
|
|
3016
|
+
if (nextPage) {
|
|
3017
|
+
nextCursor = nextPage;
|
|
3018
|
+
}
|
|
3019
|
+
} catch {
|
|
3020
|
+
nextCursor = void 0;
|
|
3021
|
+
}
|
|
3022
|
+
}
|
|
3023
|
+
return {
|
|
3024
|
+
data: choices,
|
|
3025
|
+
nextCursor
|
|
3026
|
+
};
|
|
3027
|
+
}, ListInputFieldChoicesSchema);
|
|
3028
|
+
return {
|
|
3029
|
+
listInputFieldChoices,
|
|
3030
|
+
context: {
|
|
3031
|
+
meta: {
|
|
3032
|
+
listInputFieldChoices: {
|
|
3033
|
+
categories: ["action"],
|
|
3034
|
+
inputSchema: ListInputFieldChoicesSchema
|
|
3035
|
+
}
|
|
3036
|
+
}
|
|
3037
|
+
}
|
|
3038
|
+
};
|
|
3039
|
+
};
|
|
2876
3040
|
|
|
2877
3041
|
// src/sdk.ts
|
|
2878
3042
|
function createSdk(options = {}, initialSdk = {}, initialContext = { meta: {} }) {
|
|
@@ -2923,7 +3087,7 @@ function createSdk(options = {}, initialSdk = {}, initialContext = { meta: {} })
|
|
|
2923
3087
|
};
|
|
2924
3088
|
}
|
|
2925
3089
|
function createZapierSdkWithoutRegistry(options = {}) {
|
|
2926
|
-
return createSdk(options).addPlugin(apiPlugin).addPlugin(listAppsPlugin).addPlugin(manifestPlugin).addPlugin(getAppPlugin).addPlugin(listActionsPlugin).addPlugin(getActionPlugin).addPlugin(listInputFieldsPlugin).addPlugin(runActionPlugin).addPlugin(lockVersionPlugin).addPlugin(listAuthenticationsPlugin).addPlugin(getAuthenticationPlugin).addPlugin(findFirstAuthenticationPlugin).addPlugin(findUniqueAuthenticationPlugin).addPlugin(requestPlugin).addPlugin(fetchPlugin).addPlugin(appsPlugin).addPlugin(getProfilePlugin);
|
|
3090
|
+
return createSdk(options).addPlugin(apiPlugin).addPlugin(listAppsPlugin).addPlugin(manifestPlugin).addPlugin(getAppPlugin).addPlugin(listActionsPlugin).addPlugin(getActionPlugin).addPlugin(listInputFieldsPlugin).addPlugin(listInputFieldChoicesPlugin).addPlugin(runActionPlugin).addPlugin(lockVersionPlugin).addPlugin(listAuthenticationsPlugin).addPlugin(getAuthenticationPlugin).addPlugin(findFirstAuthenticationPlugin).addPlugin(findUniqueAuthenticationPlugin).addPlugin(requestPlugin).addPlugin(fetchPlugin).addPlugin(appsPlugin).addPlugin(getProfilePlugin);
|
|
2927
3091
|
}
|
|
2928
3092
|
function createZapierSdk(options = {}) {
|
|
2929
3093
|
return createZapierSdkWithoutRegistry(options).addPlugin(registryPlugin);
|