@zapier/zapier-sdk-cli 0.44.1 → 0.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +381 -29
  3. package/bin/zapier-sdk-experimental.mjs +14 -0
  4. package/dist/cli.cjs +608 -38
  5. package/dist/cli.mjs +607 -37
  6. package/dist/experimental.cjs +3519 -0
  7. package/dist/experimental.d.mts +39 -0
  8. package/dist/experimental.d.ts +39 -0
  9. package/dist/experimental.mjs +3483 -0
  10. package/dist/index.cjs +507 -26
  11. package/dist/index.d.mts +3 -514
  12. package/dist/index.d.ts +3 -514
  13. package/dist/index.mjs +505 -24
  14. package/dist/package.json +14 -2
  15. package/dist/sdk-B3nKAZdN.d.mts +516 -0
  16. package/dist/sdk-B3nKAZdN.d.ts +516 -0
  17. package/dist/src/cli.js +26 -2
  18. package/dist/src/experimental.d.ts +33 -0
  19. package/dist/src/experimental.js +83 -0
  20. package/dist/src/generators/ast-generator.d.ts +2 -2
  21. package/dist/src/generators/ast-generator.js +1 -1
  22. package/dist/src/plugins/add/index.d.ts +2 -2
  23. package/dist/src/plugins/bundleCode/index.js +3 -12
  24. package/dist/src/plugins/curl/index.js +2 -2
  25. package/dist/src/plugins/curl/utils.d.ts +11 -1
  26. package/dist/src/plugins/curl/utils.js +14 -5
  27. package/dist/src/plugins/drainTriggerInbox/index.d.ts +46 -0
  28. package/dist/src/plugins/drainTriggerInbox/index.js +178 -0
  29. package/dist/src/plugins/generateAppTypes/index.d.ts +2 -2
  30. package/dist/src/plugins/index.d.ts +2 -0
  31. package/dist/src/plugins/index.js +2 -0
  32. package/dist/src/plugins/mcp/index.d.ts +1 -0
  33. package/dist/src/plugins/mcp/index.js +5 -1
  34. package/dist/src/plugins/watchTriggerInbox/index.d.ts +45 -0
  35. package/dist/src/plugins/watchTriggerInbox/index.js +157 -0
  36. package/dist/src/sdk.js +5 -1
  37. package/dist/src/utils/cli-generator.js +18 -1
  38. package/dist/src/utils/cli-renderer.d.ts +12 -0
  39. package/dist/src/utils/cli-renderer.js +22 -1
  40. package/dist/src/utils/parameter-resolver.d.ts +1 -0
  41. package/dist/src/utils/parameter-resolver.js +81 -10
  42. package/dist/src/utils/triggerDrain.d.ts +144 -0
  43. package/dist/src/utils/triggerDrain.js +351 -0
  44. package/dist/tsconfig.tsbuildinfo +1 -1
  45. package/package.json +16 -4
package/dist/index.d.mts CHANGED
@@ -1,517 +1,6 @@
1
- import * as _zapier_zapier_sdk from '@zapier/zapier-sdk';
2
- import { AppItem, Manifest, ZapierSdk, ZapierSdkOptions, Plugin, PluginProvides, BaseEvent } from '@zapier/zapier-sdk';
3
- import { z } from 'zod';
4
-
5
- declare const BuildManifestSchema: z.ZodObject<{
6
- apps: z.ZodArray<z.ZodString>;
7
- skipWrite: z.ZodOptional<z.ZodBoolean>;
8
- configPath: z.ZodOptional<z.ZodString>;
9
- }, z.core.$strip>;
10
- type BuildManifestOptions = z.infer<typeof BuildManifestSchema> & {
11
- onProgress?: (event: ManifestBuildProgressEvent) => void;
12
- };
13
- type ManifestBuildProgressEvent = {
14
- type: "apps_lookup_start";
15
- count: number;
16
- } | {
17
- type: "app_found";
18
- app: AppItem;
19
- } | {
20
- type: "apps_lookup_complete";
21
- count: number;
22
- } | {
23
- type: "app_processing_start";
24
- app: string;
25
- slug?: string;
26
- } | {
27
- type: "manifest_entry_built";
28
- app: string;
29
- manifestKey: string;
30
- version: string;
31
- } | {
32
- type: "manifest_updated";
33
- app: string;
34
- manifestKey: string;
35
- version: string;
36
- } | {
37
- type: "app_processing_complete";
38
- app: string;
39
- } | {
40
- type: "app_processing_error";
41
- app: string;
42
- error: string;
43
- };
44
- interface BuildManifestResult {
45
- manifest?: Manifest;
46
- }
47
-
48
- declare const buildManifestPlugin: (sdk: {
49
- listApps: (options?: ({
50
- search?: string | undefined;
51
- apps?: string[] | undefined;
52
- appKeys?: string[] | undefined;
53
- pageSize?: number | undefined;
54
- maxItems?: number | undefined;
55
- cursor?: string | undefined;
56
- } & {
57
- cursor?: string;
58
- pageSize?: number;
59
- maxItems?: number;
60
- }) | undefined) => _zapier_zapier_sdk.PaginatedSdkResult<{
61
- slug: string;
62
- title: string;
63
- key: string;
64
- implementation_id: string;
65
- description?: string | undefined;
66
- is_hidden?: boolean | undefined;
67
- auth_type?: string | undefined;
68
- actions?: {
69
- read?: number | undefined;
70
- read_bulk?: number | undefined;
71
- write?: number | undefined;
72
- search?: number | undefined;
73
- search_or_write?: number | undefined;
74
- search_and_write?: number | undefined;
75
- filter?: number | undefined;
76
- } | undefined;
77
- is_deprecated?: boolean | undefined;
78
- is_beta?: boolean | undefined;
79
- is_premium?: boolean | undefined;
80
- age_in_days?: number | undefined;
81
- banner?: string | undefined;
82
- categories?: {
83
- id: number;
84
- name: string;
85
- slug: string;
86
- }[] | undefined;
87
- images?: {
88
- url_16x16?: string | undefined;
89
- url_32x32?: string | undefined;
90
- url_64x64?: string | undefined;
91
- url_128x128?: string | undefined;
92
- } | undefined;
93
- popularity?: number | undefined;
94
- has_filters?: boolean | undefined;
95
- has_reads?: boolean | undefined;
96
- has_searches?: boolean | undefined;
97
- has_searches_or_writes?: boolean | undefined;
98
- has_upfront_fields?: boolean | undefined;
99
- has_writes?: boolean | undefined;
100
- is_built_in?: boolean | undefined;
101
- is_featured?: boolean | undefined;
102
- is_invite?: boolean | undefined;
103
- is_public?: boolean | undefined;
104
- is_upcoming?: boolean | undefined;
105
- visibility?: string | undefined;
106
- primary_color?: string | undefined;
107
- secondary_color?: string | undefined;
108
- classification?: string | undefined;
109
- api_docs_url?: string | undefined;
110
- image?: string | undefined;
111
- version?: string | undefined;
112
- }>;
113
- } & {
114
- context: {
115
- meta: {
116
- listApps: _zapier_zapier_sdk.PluginMeta;
117
- };
118
- };
119
- } & {
120
- context: {
121
- getResolvedManifest: () => Promise<Manifest | null>;
122
- getVersionedImplementationId: (appKey: string) => Promise<string | null>;
123
- resolveAppKeys: ({ appKeys }: {
124
- appKeys: string[];
125
- }) => Promise<_zapier_zapier_sdk.ResolvedAppLocator[]>;
126
- updateManifestEntry: (options: _zapier_zapier_sdk.UpdateManifestEntryOptions) => Promise<_zapier_zapier_sdk.UpdateManifestEntryResult>;
127
- addActionEntry: (options: _zapier_zapier_sdk.AddActionEntryOptions) => Promise<_zapier_zapier_sdk.AddActionEntryResult>;
128
- findActionEntry: ({ name, manifest, }: {
129
- name: string;
130
- manifest: Manifest;
131
- }) => _zapier_zapier_sdk.ActionEntry | null;
132
- listActionEntries: ({ configPath, }?: {
133
- configPath?: string;
134
- }) => Promise<Array<[string, _zapier_zapier_sdk.ActionEntry]>>;
135
- deleteActionEntry: ({ name, configPath, skipWrite, }: {
136
- name: string;
137
- configPath?: string;
138
- skipWrite?: boolean;
139
- }) => Promise<Manifest>;
140
- hasActionEntry: ({ name, manifest, }: {
141
- name: string;
142
- manifest: Manifest;
143
- }) => boolean;
144
- findManifestEntry: typeof _zapier_zapier_sdk.findManifestEntry;
145
- readManifestFromFile: typeof _zapier_zapier_sdk.readManifestFromFile;
146
- getManifestConnections: () => Promise<Record<string, {
147
- connectionId: string | number;
148
- }> | null>;
149
- };
150
- } & {
151
- context: _zapier_zapier_sdk.EventEmissionContext;
152
- } & {
153
- context: {
154
- meta: Record<string, _zapier_zapier_sdk.PluginMeta>;
155
- };
156
- }) => {
157
- buildManifest: (options?: BuildManifestOptions | undefined) => Promise<BuildManifestResult>;
158
- } & {
159
- context: {
160
- meta: {
161
- buildManifest: _zapier_zapier_sdk.PluginMeta;
162
- };
163
- };
164
- };
165
- type BuildManifestPluginProvides = ReturnType<typeof buildManifestPlugin>;
166
-
167
- declare const feedbackPlugin: (sdk: {
168
- context: {
169
- options?: {
170
- debug?: boolean;
171
- };
172
- };
173
- } & {
174
- context: _zapier_zapier_sdk.EventEmissionContext;
175
- } & {
176
- context: {
177
- meta: Record<string, _zapier_zapier_sdk.PluginMeta>;
178
- };
179
- }) => {
180
- feedback: (options?: {
181
- feedback: string;
182
- } | undefined) => Promise<string>;
183
- } & {
184
- context: {
185
- meta: {
186
- feedback: _zapier_zapier_sdk.PluginMeta;
187
- };
188
- };
189
- };
190
- type FeedbackPluginProvides = ReturnType<typeof feedbackPlugin>;
191
-
192
- declare const GenerateAppTypesSchema: z.ZodObject<{
193
- apps: z.ZodArray<z.ZodString>;
194
- connections: z.ZodOptional<z.ZodArray<z.ZodString>>;
195
- skipWrite: z.ZodOptional<z.ZodBoolean>;
196
- typesOutputDirectory: z.ZodOptional<z.ZodString>;
197
- }, z.core.$strip>;
198
- type GenerateAppTypesOptions = z.infer<typeof GenerateAppTypesSchema> & {
199
- onProgress?: (event: AppTypesProgressEvent) => void;
200
- };
201
- type AppTypesProgressEvent = {
202
- type: "apps_lookup_start";
203
- count: number;
204
- } | {
205
- type: "app_found";
206
- app: AppItem;
207
- } | {
208
- type: "apps_lookup_complete";
209
- count: number;
210
- } | {
211
- type: "connections_lookup_start";
212
- count: number;
213
- } | {
214
- type: "connections_lookup_complete";
215
- count: number;
216
- } | {
217
- type: "app_processing_start";
218
- app: string;
219
- slug?: string;
220
- } | {
221
- type: "connection_matched";
222
- app: string;
223
- connectionId: string;
224
- connectionTitle: string;
225
- } | {
226
- type: "connection_not_matched";
227
- app: string;
228
- } | {
229
- type: "type_generated";
230
- manifestKey: string;
231
- sizeBytes: number;
232
- } | {
233
- type: "file_written";
234
- manifestKey: string;
235
- filePath: string;
236
- } | {
237
- type: "app_processing_complete";
238
- app: string;
239
- } | {
240
- type: "app_processing_error";
241
- app: string;
242
- error: string;
243
- };
244
- interface GenerateAppTypesResult {
245
- typeDefinitions: Record<string, string>;
246
- writtenFiles?: Record<string, string>;
247
- }
248
-
249
- declare const generateAppTypesPlugin: (sdk: {
250
- listApps: (options?: ({
251
- search?: string | undefined;
252
- apps?: string[] | undefined;
253
- appKeys?: string[] | undefined;
254
- pageSize?: number | undefined;
255
- maxItems?: number | undefined;
256
- cursor?: string | undefined;
257
- } & {
258
- cursor?: string;
259
- pageSize?: number;
260
- maxItems?: number;
261
- }) | undefined) => _zapier_zapier_sdk.PaginatedSdkResult<{
262
- slug: string;
263
- title: string;
264
- key: string;
265
- implementation_id: string;
266
- description?: string | undefined;
267
- is_hidden?: boolean | undefined;
268
- auth_type?: string | undefined;
269
- actions?: {
270
- read?: number | undefined;
271
- read_bulk?: number | undefined;
272
- write?: number | undefined;
273
- search?: number | undefined;
274
- search_or_write?: number | undefined;
275
- search_and_write?: number | undefined;
276
- filter?: number | undefined;
277
- } | undefined;
278
- is_deprecated?: boolean | undefined;
279
- is_beta?: boolean | undefined;
280
- is_premium?: boolean | undefined;
281
- age_in_days?: number | undefined;
282
- banner?: string | undefined;
283
- categories?: {
284
- id: number;
285
- name: string;
286
- slug: string;
287
- }[] | undefined;
288
- images?: {
289
- url_16x16?: string | undefined;
290
- url_32x32?: string | undefined;
291
- url_64x64?: string | undefined;
292
- url_128x128?: string | undefined;
293
- } | undefined;
294
- popularity?: number | undefined;
295
- has_filters?: boolean | undefined;
296
- has_reads?: boolean | undefined;
297
- has_searches?: boolean | undefined;
298
- has_searches_or_writes?: boolean | undefined;
299
- has_upfront_fields?: boolean | undefined;
300
- has_writes?: boolean | undefined;
301
- is_built_in?: boolean | undefined;
302
- is_featured?: boolean | undefined;
303
- is_invite?: boolean | undefined;
304
- is_public?: boolean | undefined;
305
- is_upcoming?: boolean | undefined;
306
- visibility?: string | undefined;
307
- primary_color?: string | undefined;
308
- secondary_color?: string | undefined;
309
- classification?: string | undefined;
310
- api_docs_url?: string | undefined;
311
- image?: string | undefined;
312
- version?: string | undefined;
313
- }>;
314
- } & {
315
- context: {
316
- meta: {
317
- listApps: _zapier_zapier_sdk.PluginMeta;
318
- };
319
- };
320
- } & {
321
- listActions: (options?: (({
322
- app: string;
323
- actionType?: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write" | undefined;
324
- pageSize?: number | undefined;
325
- maxItems?: number | undefined;
326
- cursor?: string | undefined;
327
- } | {
328
- appKey: string;
329
- actionType?: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write" | undefined;
330
- pageSize?: number | undefined;
331
- maxItems?: number | undefined;
332
- cursor?: string | undefined;
333
- }) & {
334
- cursor?: string;
335
- pageSize?: number;
336
- maxItems?: number;
337
- }) | undefined) => _zapier_zapier_sdk.PaginatedSdkResult<{
338
- description: string;
339
- key: string;
340
- app_key: string;
341
- action_type: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
342
- title: string;
343
- type: "action";
344
- id?: string | undefined;
345
- is_important?: boolean | undefined;
346
- is_hidden?: boolean | undefined;
347
- app_version?: string | undefined;
348
- }>;
349
- } & {
350
- context: {
351
- meta: {
352
- listActions: _zapier_zapier_sdk.PluginMeta;
353
- };
354
- };
355
- } & {
356
- listInputFields: (options?: (({
357
- app: string;
358
- actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
359
- action: string;
360
- connection?: string | number | undefined;
361
- connectionId?: string | number | null | undefined;
362
- authenticationId?: string | number | null | undefined;
363
- inputs?: Record<string, unknown> | undefined;
364
- pageSize?: number | undefined;
365
- maxItems?: number | undefined;
366
- cursor?: string | undefined;
367
- } | {
368
- appKey: string;
369
- actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
370
- actionKey: string;
371
- connection?: string | number | undefined;
372
- connectionId?: string | number | null | undefined;
373
- authenticationId?: string | number | null | undefined;
374
- inputs?: Record<string, unknown> | undefined;
375
- pageSize?: number | undefined;
376
- maxItems?: number | undefined;
377
- cursor?: string | undefined;
378
- }) & {
379
- cursor?: string;
380
- pageSize?: number;
381
- maxItems?: number;
382
- }) | undefined) => _zapier_zapier_sdk.PaginatedSdkResult<{
383
- key: string;
384
- type: "input_field";
385
- default_value: string;
386
- depends_on: string[];
387
- description: string;
388
- invalidates_input_fields: boolean;
389
- is_required: boolean;
390
- placeholder: string;
391
- title: string;
392
- value_type: string;
393
- format?: string | undefined;
394
- items?: {
395
- type: string;
396
- } | undefined;
397
- } | {
398
- key: string;
399
- type: "info_field";
400
- description: string;
401
- title?: string | undefined;
402
- } | _zapier_zapier_sdk.FieldsetItem>;
403
- } & {
404
- context: {
405
- meta: {
406
- listInputFields: _zapier_zapier_sdk.PluginMeta;
407
- };
408
- };
409
- } & {
410
- listConnections: (options?: ({
411
- title?: string | undefined;
412
- search?: string | undefined;
413
- owner?: string | undefined;
414
- app?: string | undefined;
415
- appKey?: string | undefined;
416
- connections?: string[] | undefined;
417
- connectionIds?: string[] | undefined;
418
- authenticationIds?: string[] | undefined;
419
- account?: string | undefined;
420
- accountId?: string | undefined;
421
- includeShared?: boolean | undefined;
422
- isExpired?: boolean | undefined;
423
- expired?: boolean | undefined;
424
- pageSize?: number | undefined;
425
- maxItems?: number | undefined;
426
- cursor?: string | undefined;
427
- } & {
428
- cursor?: string;
429
- pageSize?: number;
430
- maxItems?: number;
431
- }) | undefined) => _zapier_zapier_sdk.PaginatedSdkResult<{
432
- date: string;
433
- is_invite_only: boolean;
434
- is_private: boolean;
435
- shared_with_all: boolean;
436
- id: string;
437
- account_id: string;
438
- title?: string | null | undefined;
439
- lastchanged?: string | undefined;
440
- destination_selected_api?: string | null | undefined;
441
- is_stale?: string | undefined;
442
- is_shared?: string | undefined;
443
- marked_stale_at?: string | null | undefined;
444
- label?: string | null | undefined;
445
- identifier?: string | null | undefined;
446
- url?: string | undefined;
447
- groups?: Record<string, unknown>[] | undefined;
448
- members?: string | undefined;
449
- permissions?: Record<string, boolean> | undefined;
450
- public_id?: string | undefined;
451
- account_public_id?: string | undefined;
452
- customuser_public_id?: string | undefined;
453
- implementation_id?: string | undefined;
454
- profile_id?: string | undefined;
455
- is_expired?: string | undefined;
456
- expired_at?: string | null | undefined;
457
- app_key?: string | undefined;
458
- app_version?: string | undefined;
459
- }>;
460
- } & {
461
- context: {
462
- meta: {
463
- listConnections: _zapier_zapier_sdk.PluginMeta;
464
- };
465
- };
466
- } & {
467
- context: {
468
- getResolvedManifest: () => Promise<_zapier_zapier_sdk.Manifest | null>;
469
- getVersionedImplementationId: (appKey: string) => Promise<string | null>;
470
- resolveAppKeys: ({ appKeys }: {
471
- appKeys: string[];
472
- }) => Promise<_zapier_zapier_sdk.ResolvedAppLocator[]>;
473
- updateManifestEntry: (options: _zapier_zapier_sdk.UpdateManifestEntryOptions) => Promise<_zapier_zapier_sdk.UpdateManifestEntryResult>;
474
- addActionEntry: (options: _zapier_zapier_sdk.AddActionEntryOptions) => Promise<_zapier_zapier_sdk.AddActionEntryResult>;
475
- findActionEntry: ({ name, manifest, }: {
476
- name: string;
477
- manifest: _zapier_zapier_sdk.Manifest;
478
- }) => _zapier_zapier_sdk.ActionEntry | null;
479
- listActionEntries: ({ configPath, }?: {
480
- configPath?: string;
481
- }) => Promise<Array<[string, _zapier_zapier_sdk.ActionEntry]>>;
482
- deleteActionEntry: ({ name, configPath, skipWrite, }: {
483
- name: string;
484
- configPath?: string;
485
- skipWrite?: boolean;
486
- }) => Promise<_zapier_zapier_sdk.Manifest>;
487
- hasActionEntry: ({ name, manifest, }: {
488
- name: string;
489
- manifest: _zapier_zapier_sdk.Manifest;
490
- }) => boolean;
491
- findManifestEntry: typeof _zapier_zapier_sdk.findManifestEntry;
492
- readManifestFromFile: typeof _zapier_zapier_sdk.readManifestFromFile;
493
- getManifestConnections: () => Promise<Record<string, {
494
- connectionId: string | number;
495
- }> | null>;
496
- };
497
- } & {
498
- context: _zapier_zapier_sdk.EventEmissionContext;
499
- } & {
500
- context: {
501
- meta: Record<string, _zapier_zapier_sdk.PluginMeta>;
502
- };
503
- }) => {
504
- generateAppTypes: (options?: GenerateAppTypesOptions | undefined) => Promise<GenerateAppTypesResult>;
505
- } & {
506
- context: {
507
- meta: {
508
- generateAppTypes: _zapier_zapier_sdk.PluginMeta;
509
- };
510
- };
511
- };
512
- type GenerateAppTypesPluginProvides = ReturnType<typeof generateAppTypesPlugin>;
513
-
514
- type ZapierSdkCli = ZapierSdk & BuildManifestPluginProvides & FeedbackPluginProvides & GenerateAppTypesPluginProvides;
1
+ import { ZapierSdkOptions, Plugin, PluginProvides, BaseEvent } from '@zapier/zapier-sdk';
2
+ import { Z as ZapierSdkCli } from './sdk-B3nKAZdN.mjs';
3
+ import 'zod';
515
4
 
516
5
  interface ZapierCliSdkOptions extends ZapierSdkOptions {
517
6
  /**