@zapier/zapier-sdk-cli 0.42.2 → 0.43.1

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 (54) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/cli.cjs +1047 -547
  3. package/dist/cli.d.mts +0 -1
  4. package/dist/cli.d.ts +0 -1
  5. package/dist/cli.mjs +1034 -537
  6. package/dist/index.cjs +1037 -538
  7. package/dist/index.d.mts +395 -23
  8. package/dist/index.d.ts +395 -23
  9. package/dist/index.mjs +1027 -531
  10. package/dist/login.cjs +599 -7
  11. package/dist/login.d.mts +144 -1
  12. package/dist/login.d.ts +144 -1
  13. package/dist/login.mjs +565 -1
  14. package/dist/package.json +5 -2
  15. package/dist/src/login/filesystem-cache.d.ts +25 -0
  16. package/dist/src/login/filesystem-cache.js +195 -0
  17. package/dist/src/login/index.d.ts +115 -0
  18. package/dist/src/login/index.js +442 -0
  19. package/dist/src/login/keychain.d.ts +18 -0
  20. package/dist/src/login/keychain.js +74 -0
  21. package/dist/src/login.d.ts +10 -1
  22. package/dist/src/login.js +10 -1
  23. package/dist/src/plugins/add/index.d.ts +250 -11
  24. package/dist/src/plugins/add/index.js +8 -16
  25. package/dist/src/plugins/buildManifest/index.d.ts +116 -9
  26. package/dist/src/plugins/buildManifest/index.js +14 -23
  27. package/dist/src/plugins/bundleCode/index.d.ts +19 -10
  28. package/dist/src/plugins/bundleCode/index.js +7 -17
  29. package/dist/src/plugins/cliOverrides/index.d.ts +12 -10
  30. package/dist/src/plugins/cliOverrides/index.js +16 -20
  31. package/dist/src/plugins/curl/index.d.ts +69 -10
  32. package/dist/src/plugins/curl/index.js +3 -2
  33. package/dist/src/plugins/feedback/index.d.ts +18 -13
  34. package/dist/src/plugins/feedback/index.js +18 -26
  35. package/dist/src/plugins/generateAppTypes/index.d.ts +261 -9
  36. package/dist/src/plugins/generateAppTypes/index.js +17 -45
  37. package/dist/src/plugins/getLoginConfigPath/index.d.ts +12 -10
  38. package/dist/src/plugins/getLoginConfigPath/index.js +9 -19
  39. package/dist/src/plugins/init/index.d.ts +15 -11
  40. package/dist/src/plugins/init/index.js +9 -17
  41. package/dist/src/plugins/login/index.d.ts +18 -13
  42. package/dist/src/plugins/login/index.js +10 -18
  43. package/dist/src/plugins/logout/index.d.ts +12 -11
  44. package/dist/src/plugins/logout/index.js +11 -17
  45. package/dist/src/plugins/mcp/index.d.ts +18 -15
  46. package/dist/src/plugins/mcp/index.js +9 -21
  47. package/dist/src/sdk.js +1 -1
  48. package/dist/src/utils/auth/login.d.ts +1 -1
  49. package/dist/src/utils/auth/login.js +1 -1
  50. package/dist/src/utils/constants.d.ts +1 -1
  51. package/dist/src/utils/constants.js +1 -1
  52. package/dist/src/utils/version-checker.js +1 -1
  53. package/dist/tsconfig.tsbuildinfo +1 -1
  54. package/package.json +7 -4
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import * as _zapier_zapier_sdk from '@zapier/zapier-sdk';
1
2
  import { AppItem, Manifest, ZapierSdk, ZapierSdkOptions, BaseEvent } from '@zapier/zapier-sdk';
2
3
  import { z } from 'zod';
3
4
 
@@ -44,32 +45,149 @@ interface BuildManifestResult {
44
45
  manifest?: Manifest;
45
46
  }
46
47
 
47
- interface BuildManifestPluginProvides {
48
- buildManifest: (options: BuildManifestOptions) => Promise<BuildManifestResult>;
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
+ } & {
49
114
  context: {
50
115
  meta: {
51
- buildManifest: {
52
- inputSchema: typeof BuildManifestSchema;
53
- };
116
+ listApps: _zapier_zapier_sdk.PluginMeta;
54
117
  };
55
118
  };
56
- }
57
-
58
- declare const FeedbackSchema: z.ZodObject<{
59
- feedback: z.ZodString;
60
- }, z.core.$strip>;
61
- type FeedbackOptions = z.infer<typeof FeedbackSchema>;
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>;
62
166
 
63
- interface FeedbackPluginProvides {
64
- feedback: (options: FeedbackOptions) => Promise<string>;
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
+ } & {
65
184
  context: {
66
185
  meta: {
67
- feedback: {
68
- inputSchema: typeof FeedbackSchema;
69
- };
186
+ feedback: _zapier_zapier_sdk.PluginMeta;
70
187
  };
71
188
  };
72
- }
189
+ };
190
+ type FeedbackPluginProvides = ReturnType<typeof feedbackPlugin>;
73
191
 
74
192
  declare const GenerateAppTypesSchema: z.ZodObject<{
75
193
  apps: z.ZodArray<z.ZodString>;
@@ -128,16 +246,270 @@ interface GenerateAppTypesResult {
128
246
  writtenFiles?: Record<string, string>;
129
247
  }
130
248
 
131
- interface GenerateAppTypesPluginProvides {
132
- generateAppTypes: (options: GenerateAppTypesOptions) => Promise<GenerateAppTypesResult>;
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
+ } & {
133
315
  context: {
134
316
  meta: {
135
- generateAppTypes: {
136
- inputSchema: typeof GenerateAppTypesSchema;
137
- };
317
+ listApps: _zapier_zapier_sdk.PluginMeta;
138
318
  };
139
319
  };
140
- }
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>;
141
513
 
142
514
  type ZapierSdkCli = ZapierSdk & BuildManifestPluginProvides & FeedbackPluginProvides & GenerateAppTypesPluginProvides;
143
515