@zapier/zapier-sdk 0.6.3 → 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.
Files changed (56) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +73 -41
  3. package/dist/api/schemas.d.ts +114 -0
  4. package/dist/api/schemas.d.ts.map +1 -1
  5. package/dist/api/schemas.js +45 -0
  6. package/dist/api/types.d.ts +5 -1
  7. package/dist/api/types.d.ts.map +1 -1
  8. package/dist/index.cjs +2208 -2022
  9. package/dist/index.d.mts +327 -10
  10. package/dist/index.d.ts +18 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +19 -1
  13. package/dist/index.mjs +2191 -2024
  14. package/dist/plugins/findFirstAuthentication/index.test.js +3 -3
  15. package/dist/plugins/findFirstAuthentication/schemas.d.ts +3 -3
  16. package/dist/plugins/findFirstAuthentication/schemas.js +1 -1
  17. package/dist/plugins/findUniqueAuthentication/index.test.js +3 -3
  18. package/dist/plugins/findUniqueAuthentication/schemas.d.ts +3 -3
  19. package/dist/plugins/findUniqueAuthentication/schemas.js +1 -1
  20. package/dist/plugins/getProfile/index.js +1 -1
  21. package/dist/plugins/listAuthentications/index.d.ts.map +1 -1
  22. package/dist/plugins/listAuthentications/index.js +2 -3
  23. package/dist/plugins/listAuthentications/index.test.js +5 -5
  24. package/dist/plugins/listAuthentications/schemas.d.ts +3 -3
  25. package/dist/plugins/listAuthentications/schemas.js +1 -1
  26. package/dist/plugins/listInputFieldChoices/index.d.ts +28 -0
  27. package/dist/plugins/listInputFieldChoices/index.d.ts.map +1 -0
  28. package/dist/plugins/listInputFieldChoices/index.js +78 -0
  29. package/dist/plugins/listInputFieldChoices/index.test.d.ts +2 -0
  30. package/dist/plugins/listInputFieldChoices/index.test.d.ts.map +1 -0
  31. package/dist/plugins/listInputFieldChoices/index.test.js +537 -0
  32. package/dist/plugins/listInputFieldChoices/schemas.d.ts +61 -0
  33. package/dist/plugins/listInputFieldChoices/schemas.d.ts.map +1 -0
  34. package/dist/plugins/listInputFieldChoices/schemas.js +73 -0
  35. package/dist/plugins/registry/index.js +3 -3
  36. package/dist/sdk.d.ts +93 -0
  37. package/dist/sdk.d.ts.map +1 -1
  38. package/dist/sdk.js +7 -2
  39. package/package.json +1 -1
  40. package/src/api/schemas.ts +62 -0
  41. package/src/api/types.ts +14 -0
  42. package/src/index.ts +25 -1
  43. package/src/plugins/findFirstAuthentication/index.test.ts +3 -3
  44. package/src/plugins/findFirstAuthentication/schemas.ts +1 -1
  45. package/src/plugins/findUniqueAuthentication/index.test.ts +3 -3
  46. package/src/plugins/findUniqueAuthentication/schemas.ts +1 -1
  47. package/src/plugins/getProfile/index.ts +1 -1
  48. package/src/plugins/listAuthentications/index.test.ts +5 -5
  49. package/src/plugins/listAuthentications/index.ts +2 -3
  50. package/src/plugins/listAuthentications/schemas.ts +1 -1
  51. package/src/plugins/listInputFieldChoices/index.test.ts +653 -0
  52. package/src/plugins/listInputFieldChoices/index.ts +152 -0
  53. package/src/plugins/listInputFieldChoices/schemas.ts +139 -0
  54. package/src/plugins/registry/index.ts +3 -3
  55. package/src/sdk.ts +8 -1
  56. package/tsconfig.tsbuildinfo +1 -1
package/dist/index.d.mts CHANGED
@@ -970,19 +970,19 @@ declare const FindFirstAuthenticationSchema: z.ZodObject<{
970
970
  appKey: z.ZodOptional<z.ZodString>;
971
971
  search: z.ZodOptional<z.ZodString>;
972
972
  title: z.ZodOptional<z.ZodString>;
973
- account_id: z.ZodOptional<z.ZodString>;
973
+ accountId: z.ZodOptional<z.ZodString>;
974
974
  owner: z.ZodOptional<z.ZodString>;
975
975
  }, "strip", z.ZodTypeAny, {
976
976
  title?: string | undefined;
977
977
  search?: string | undefined;
978
- account_id?: string | undefined;
979
978
  appKey?: string | undefined;
979
+ accountId?: string | undefined;
980
980
  owner?: string | undefined;
981
981
  }, {
982
982
  title?: string | undefined;
983
983
  search?: string | undefined;
984
- account_id?: string | undefined;
985
984
  appKey?: string | undefined;
985
+ accountId?: string | undefined;
986
986
  owner?: string | undefined;
987
987
  }>;
988
988
  type FindFirstAuthenticationOptions = z.infer<typeof FindFirstAuthenticationSchema>;
@@ -991,19 +991,19 @@ declare const FindUniqueAuthenticationSchema: z.ZodObject<{
991
991
  appKey: z.ZodOptional<z.ZodString>;
992
992
  search: z.ZodOptional<z.ZodString>;
993
993
  title: z.ZodOptional<z.ZodString>;
994
- account_id: z.ZodOptional<z.ZodString>;
994
+ accountId: z.ZodOptional<z.ZodString>;
995
995
  owner: z.ZodOptional<z.ZodString>;
996
996
  }, "strip", z.ZodTypeAny, {
997
997
  title?: string | undefined;
998
998
  search?: string | undefined;
999
- account_id?: string | undefined;
1000
999
  appKey?: string | undefined;
1000
+ accountId?: string | undefined;
1001
1001
  owner?: string | undefined;
1002
1002
  }, {
1003
1003
  title?: string | undefined;
1004
1004
  search?: string | undefined;
1005
- account_id?: string | undefined;
1006
1005
  appKey?: string | undefined;
1006
+ accountId?: string | undefined;
1007
1007
  owner?: string | undefined;
1008
1008
  }>;
1009
1009
  type FindUniqueAuthenticationOptions = z.infer<typeof FindUniqueAuthenticationSchema>;
@@ -2185,6 +2185,35 @@ declare const NeedsResponseSchema: z.ZodObject<{
2185
2185
  * to ensure a single source of truth and eliminate duplication.
2186
2186
  */
2187
2187
 
2188
+ interface ApiClient {
2189
+ get: <T = unknown>(path: string, options?: RequestOptions) => Promise<T>;
2190
+ post: <T = unknown>(path: string, data?: unknown, options?: RequestOptions) => Promise<T>;
2191
+ put: <T = unknown>(path: string, data?: unknown, options?: RequestOptions) => Promise<T>;
2192
+ delete: <T = unknown>(path: string, options?: RequestOptions) => Promise<T>;
2193
+ poll: <T = unknown>(path: string, options?: PollOptions) => Promise<T>;
2194
+ fetch: (path: string, init?: RequestInit & {
2195
+ searchParams?: Record<string, string>;
2196
+ authRequired?: boolean;
2197
+ }) => Promise<Response>;
2198
+ }
2199
+ interface RequestOptions {
2200
+ headers?: Record<string, string>;
2201
+ searchParams?: Record<string, string>;
2202
+ authRequired?: boolean;
2203
+ customErrorHandler?: (errorInfo: {
2204
+ status: number;
2205
+ statusText: string;
2206
+ data: unknown;
2207
+ }) => Error | undefined;
2208
+ }
2209
+ interface PollOptions extends RequestOptions {
2210
+ maxAttempts?: number;
2211
+ initialDelay?: number;
2212
+ maxDelay?: number;
2213
+ successStatus?: number;
2214
+ pendingStatus?: number;
2215
+ resultExtractor?: (response: unknown) => unknown;
2216
+ }
2188
2217
  type Need = z.infer<typeof NeedSchema>;
2189
2218
  type Action = z.infer<typeof ActionSchema>;
2190
2219
  type Choice = z.infer<typeof ChoiceSchema>;
@@ -2234,6 +2263,11 @@ interface ListAppsPluginProvides {
2234
2263
  };
2235
2264
  };
2236
2265
  }
2266
+ declare const listAppsPlugin: Plugin<{}, // no SDK dependencies
2267
+ {
2268
+ api: ApiClient;
2269
+ }, // requires api in context
2270
+ ListAppsPluginProvides>;
2237
2271
 
2238
2272
  interface LockVersionPluginProvides {
2239
2273
  lockVersion: (options: LockVersionOptions & {
@@ -2250,6 +2284,9 @@ interface LockVersionPluginProvides {
2250
2284
  };
2251
2285
  };
2252
2286
  }
2287
+ declare const lockVersionPlugin: Plugin<GetSdkType<ListAppsPluginProvides>, // requires getApp in SDK
2288
+ {}, // requires manifest context
2289
+ LockVersionPluginProvides>;
2253
2290
 
2254
2291
  interface RegistryPluginProvides {
2255
2292
  getRegistry: () => {
@@ -2262,6 +2299,9 @@ interface RegistryPluginProvides {
2262
2299
  }[];
2263
2300
  };
2264
2301
  }
2302
+ declare const registryPlugin: Plugin<{}, // accepts any SDK shape
2303
+ {}, // requires no context
2304
+ RegistryPluginProvides>;
2265
2305
 
2266
2306
  declare const GetProfileSchema: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
2267
2307
  type GetProfileOptions = z.infer<typeof GetProfileSchema> & FunctionOptions;
@@ -2278,6 +2318,11 @@ interface GetProfilePluginProvides {
2278
2318
  };
2279
2319
  };
2280
2320
  }
2321
+ declare const getProfilePlugin: Plugin<{}, // no SDK dependencies
2322
+ {
2323
+ api: ApiClient;
2324
+ }, // requires api in context
2325
+ GetProfilePluginProvides>;
2281
2326
 
2282
2327
  interface RequestPluginProvides {
2283
2328
  request: (options: RelayRequestOptions) => Promise<Response>;
@@ -2289,6 +2334,11 @@ interface RequestPluginProvides {
2289
2334
  };
2290
2335
  };
2291
2336
  }
2337
+ declare const requestPlugin: Plugin<{}, // no SDK dependencies
2338
+ {
2339
+ api: ApiClient;
2340
+ }, // requires api in context
2341
+ RequestPluginProvides>;
2292
2342
 
2293
2343
  interface FetchPluginProvides {
2294
2344
  fetch: (url: string | URL, init?: RequestInit & {
@@ -2325,7 +2375,36 @@ type ManifestEntry = {
2325
2375
  type GetManifestEntry = (appKey: string) => ManifestEntry | null;
2326
2376
  type GetVersionedImplementationId = (appKey: string) => Promise<string | null>;
2327
2377
  type GetImplementation = (appKey: string) => Promise<AppItem | null>;
2378
+ type Manifest = {
2379
+ apps: Record<string, ManifestEntry>;
2380
+ };
2381
+ declare const ManifestPluginOptionsSchema: z.ZodObject<{
2382
+ manifestPath: z.ZodOptional<z.ZodString>;
2383
+ manifest: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2384
+ implementationName: z.ZodString;
2385
+ version: z.ZodOptional<z.ZodString>;
2386
+ }, "strip", z.ZodTypeAny, {
2387
+ implementationName: string;
2388
+ version?: string | undefined;
2389
+ }, {
2390
+ implementationName: string;
2391
+ version?: string | undefined;
2392
+ }>>>;
2393
+ }, "strip", z.ZodTypeAny, {
2394
+ manifestPath?: string | undefined;
2395
+ manifest?: Record<string, {
2396
+ implementationName: string;
2397
+ version?: string | undefined;
2398
+ }> | undefined;
2399
+ }, {
2400
+ manifestPath?: string | undefined;
2401
+ manifest?: Record<string, {
2402
+ implementationName: string;
2403
+ version?: string | undefined;
2404
+ }> | undefined;
2405
+ }>;
2328
2406
 
2407
+ type ManifestPluginOptions = z.infer<typeof ManifestPluginOptionsSchema>;
2329
2408
  interface ManifestPluginProvides {
2330
2409
  context: {
2331
2410
  getVersionedImplementationId: GetVersionedImplementationId;
@@ -2333,6 +2412,14 @@ interface ManifestPluginProvides {
2333
2412
  getImplementation: GetImplementation;
2334
2413
  };
2335
2414
  }
2415
+ /**
2416
+ * Load manifest from a file path synchronously
2417
+ * Supports local files (Node.js only)
2418
+ */
2419
+ declare function loadManifestFromFile(filePath: string): Manifest | null;
2420
+ declare const manifestPlugin: Plugin<GetSdkType<ListAppsPluginProvides>, {
2421
+ api: ApiClient;
2422
+ }, ManifestPluginProvides>;
2336
2423
 
2337
2424
  interface GetAppPluginProvides {
2338
2425
  getApp: (options: GetAppOptions) => Promise<{
@@ -2346,6 +2433,11 @@ interface GetAppPluginProvides {
2346
2433
  };
2347
2434
  };
2348
2435
  }
2436
+ declare const getAppPlugin: Plugin<GetSdkType<ManifestPluginProvides>, // depends on manifest plugin with getImplementation in context
2437
+ {
2438
+ getImplementation: GetImplementation;
2439
+ }, //
2440
+ GetAppPluginProvides>;
2349
2441
 
2350
2442
  declare const ListActionsSchema: z.ZodObject<{
2351
2443
  appKey: z.ZodString;
@@ -2382,6 +2474,12 @@ interface ListActionsPluginProvides {
2382
2474
  };
2383
2475
  };
2384
2476
  }
2477
+ declare const listActionsPlugin: Plugin<GetSdkType<ManifestPluginProvides>, // requires getApp in SDK
2478
+ {
2479
+ api: ApiClient;
2480
+ getVersionedImplementationId: GetVersionedImplementationId;
2481
+ }, // requires api and getVersionedImplementationId in context
2482
+ ListActionsPluginProvides>;
2385
2483
 
2386
2484
  declare const GetActionSchema: z.ZodObject<{
2387
2485
  appKey: z.ZodString;
@@ -2410,6 +2508,11 @@ interface GetActionPluginProvides {
2410
2508
  };
2411
2509
  };
2412
2510
  }
2511
+ declare const getActionPlugin: Plugin<GetSdkType<ListActionsPluginProvides>, // requires listActions in SDK
2512
+ {
2513
+ api: ApiClient;
2514
+ }, // requires api in context
2515
+ GetActionPluginProvides>;
2413
2516
 
2414
2517
  declare const RunActionSchema: z.ZodObject<{
2415
2518
  appKey: z.ZodString;
@@ -2455,30 +2558,36 @@ interface RunActionPluginProvides {
2455
2558
  };
2456
2559
  };
2457
2560
  }
2561
+ declare const runActionPlugin: Plugin<GetSdkType<GetActionPluginProvides & GetAppPluginProvides>, // requires getAction and getApp in SDK
2562
+ {
2563
+ api: ApiClient;
2564
+ getVersionedImplementationId: GetVersionedImplementationId;
2565
+ }, // requires api in context
2566
+ RunActionPluginProvides>;
2458
2567
 
2459
2568
  declare const ListAuthenticationsSchema: z.ZodObject<{
2460
2569
  appKey: z.ZodOptional<z.ZodString>;
2461
2570
  search: z.ZodOptional<z.ZodString>;
2462
2571
  title: z.ZodOptional<z.ZodString>;
2463
- account_id: z.ZodOptional<z.ZodString>;
2572
+ accountId: z.ZodOptional<z.ZodString>;
2464
2573
  owner: z.ZodOptional<z.ZodString>;
2465
2574
  pageSize: z.ZodOptional<z.ZodNumber>;
2466
2575
  maxItems: z.ZodOptional<z.ZodNumber>;
2467
2576
  }, "strip", z.ZodTypeAny, {
2468
2577
  title?: string | undefined;
2469
2578
  search?: string | undefined;
2470
- account_id?: string | undefined;
2471
2579
  appKey?: string | undefined;
2472
2580
  pageSize?: number | undefined;
2473
2581
  maxItems?: number | undefined;
2582
+ accountId?: string | undefined;
2474
2583
  owner?: string | undefined;
2475
2584
  }, {
2476
2585
  title?: string | undefined;
2477
2586
  search?: string | undefined;
2478
- account_id?: string | undefined;
2479
2587
  appKey?: string | undefined;
2480
2588
  pageSize?: number | undefined;
2481
2589
  maxItems?: number | undefined;
2590
+ accountId?: string | undefined;
2482
2591
  owner?: string | undefined;
2483
2592
  }>;
2484
2593
  type ListAuthenticationsOptions = z.infer<typeof ListAuthenticationsSchema>;
@@ -2500,6 +2609,12 @@ interface ListAuthenticationsPluginProvides {
2500
2609
  };
2501
2610
  };
2502
2611
  }
2612
+ declare const listAuthenticationsPlugin: Plugin<GetSdkType<ManifestPluginProvides>, // requires getApp in SDK
2613
+ {
2614
+ api: ApiClient;
2615
+ getVersionedImplementationId: GetVersionedImplementationId;
2616
+ }, // requires api in context
2617
+ ListAuthenticationsPluginProvides>;
2503
2618
 
2504
2619
  interface GetAuthenticationPluginProvides {
2505
2620
  getAuthentication: (options: GetAuthenticationOptions) => Promise<{
@@ -2513,6 +2628,11 @@ interface GetAuthenticationPluginProvides {
2513
2628
  };
2514
2629
  };
2515
2630
  }
2631
+ declare const getAuthenticationPlugin: Plugin<{}, // no SDK dependencies
2632
+ {
2633
+ api: ApiClient;
2634
+ }, // requires api in context
2635
+ GetAuthenticationPluginProvides>;
2516
2636
 
2517
2637
  interface FindFirstAuthenticationPluginProvides {
2518
2638
  findFirstAuthentication: (options?: FindFirstAuthenticationOptions) => Promise<{
@@ -2526,6 +2646,9 @@ interface FindFirstAuthenticationPluginProvides {
2526
2646
  };
2527
2647
  };
2528
2648
  }
2649
+ declare const findFirstAuthenticationPlugin: Plugin<GetSdkType<ListAuthenticationsPluginProvides>, // requires listAuthentications in SDK
2650
+ {}, // no context requirements
2651
+ FindFirstAuthenticationPluginProvides>;
2529
2652
 
2530
2653
  interface FindUniqueAuthenticationPluginProvides {
2531
2654
  findUniqueAuthentication: (options?: FindUniqueAuthenticationOptions) => Promise<{
@@ -2539,6 +2662,9 @@ interface FindUniqueAuthenticationPluginProvides {
2539
2662
  };
2540
2663
  };
2541
2664
  }
2665
+ declare const findUniqueAuthenticationPlugin: Plugin<GetSdkType<ListAuthenticationsPluginProvides>, // requires listAuthentications in SDK
2666
+ {}, // no context requirements
2667
+ FindUniqueAuthenticationPluginProvides>;
2542
2668
 
2543
2669
  interface ListInputFieldsPluginProvides {
2544
2670
  listInputFields: (options?: ListInputFieldsOptions) => Promise<{
@@ -2557,6 +2683,12 @@ interface ListInputFieldsPluginProvides {
2557
2683
  };
2558
2684
  };
2559
2685
  }
2686
+ declare const listInputFieldsPlugin: Plugin<GetSdkType<GetAppPluginProvides>, // requires getApp in SDK
2687
+ {
2688
+ api: ApiClient;
2689
+ getVersionedImplementationId: GetVersionedImplementationId;
2690
+ }, // requires api and getVersionedImplementationId in context
2691
+ ListInputFieldsPluginProvides>;
2560
2692
 
2561
2693
  /**
2562
2694
  * SDK-related types and interfaces
@@ -2661,6 +2793,17 @@ declare const appsPlugin: Plugin<GetSdkType<FetchPluginProvides & RunActionPlugi
2661
2793
  {}, // no context requirements
2662
2794
  AppsPluginProvides>;
2663
2795
 
2796
+ interface ApiPluginOptions extends BaseSdkOptions {
2797
+ }
2798
+ interface ApiPluginProvides {
2799
+ context: {
2800
+ api: ApiClient;
2801
+ };
2802
+ }
2803
+ declare const apiPlugin: Plugin<{}, // no SDK dependencies
2804
+ {}, // requires no context
2805
+ ApiPluginProvides>;
2806
+
2664
2807
  interface InputsResolver {
2665
2808
  type: "fields";
2666
2809
  depends: readonly string[];
@@ -2734,6 +2877,19 @@ declare function getResolutionOrder(paramName: string, resolved?: Set<string>):
2734
2877
  */
2735
2878
  declare function getResolutionOrderForParams(paramNames: string[]): string[];
2736
2879
 
2880
+ /**
2881
+ * Generic utility functions for creating paginated SDK functions
2882
+ */
2883
+
2884
+ /**
2885
+ * Higher-order function that creates a function from a core function
2886
+ *
2887
+ * @param coreFn - Function that returns T directly or throws errors
2888
+ * @param schema - Optional Zod schema for validation
2889
+ * @returns A function that normalizes and rethrows errors
2890
+ */
2891
+ declare function createFunction<TOptions, TResult, TSchemaOptions extends TOptions = TOptions>(coreFn: (options: TOptions) => Promise<TResult>, schema?: z.ZodSchema<TSchemaOptions>): (options?: TOptions) => Promise<TResult>;
2892
+
2737
2893
  /**
2738
2894
  * SDK Authentication Utilities
2739
2895
  *
@@ -2767,11 +2923,172 @@ declare function getTokenFromCliLogin(options?: AuthOptions): Promise<string | u
2767
2923
  */
2768
2924
  declare function getTokenFromEnvOrConfig(options?: AuthOptions): Promise<string | undefined>;
2769
2925
 
2926
+ declare const InputFieldChoiceItemSchema: z.ZodObject<{
2927
+ key: z.ZodOptional<z.ZodString>;
2928
+ label: z.ZodOptional<z.ZodString>;
2929
+ sample: z.ZodOptional<z.ZodString>;
2930
+ value: z.ZodOptional<z.ZodString>;
2931
+ }, "strip", z.ZodTypeAny, {
2932
+ value?: string | undefined;
2933
+ key?: string | undefined;
2934
+ label?: string | undefined;
2935
+ sample?: string | undefined;
2936
+ }, {
2937
+ value?: string | undefined;
2938
+ key?: string | undefined;
2939
+ label?: string | undefined;
2940
+ sample?: string | undefined;
2941
+ }>;
2942
+ type InputFieldChoiceItem = z.infer<typeof InputFieldChoiceItemSchema>;
2943
+ declare const ListInputFieldChoicesSchema: z.ZodObject<{
2944
+ appKey: z.ZodString;
2945
+ actionType: z.ZodEnum<["read", "read_bulk", "write", "run", "search", "search_or_write", "search_and_write", "filter"]>;
2946
+ actionKey: z.ZodString;
2947
+ inputFieldKey: z.ZodString;
2948
+ authenticationId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2949
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2950
+ page: z.ZodOptional<z.ZodNumber>;
2951
+ pageSize: z.ZodOptional<z.ZodNumber>;
2952
+ maxItems: z.ZodOptional<z.ZodNumber>;
2953
+ }, "strip", z.ZodTypeAny, {
2954
+ appKey: string;
2955
+ actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
2956
+ actionKey: string;
2957
+ inputFieldKey: string;
2958
+ page?: number | undefined;
2959
+ authenticationId?: number | null | undefined;
2960
+ inputs?: Record<string, any> | undefined;
2961
+ pageSize?: number | undefined;
2962
+ maxItems?: number | undefined;
2963
+ }, {
2964
+ appKey: string;
2965
+ actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
2966
+ actionKey: string;
2967
+ inputFieldKey: string;
2968
+ page?: number | undefined;
2969
+ authenticationId?: number | null | undefined;
2970
+ inputs?: Record<string, any> | undefined;
2971
+ pageSize?: number | undefined;
2972
+ maxItems?: number | undefined;
2973
+ }>;
2974
+ type ListInputFieldChoicesOptions = z.infer<typeof ListInputFieldChoicesSchema>;
2975
+
2976
+ interface ListInputFieldChoicesPluginProvides {
2977
+ listInputFieldChoices: (options: ListInputFieldChoicesOptions) => Promise<{
2978
+ data: InputFieldChoiceItem[];
2979
+ }> & AsyncIterable<{
2980
+ data: InputFieldChoiceItem[];
2981
+ nextCursor?: string;
2982
+ }> & {
2983
+ items(): AsyncIterable<InputFieldChoiceItem>;
2984
+ };
2985
+ context: {
2986
+ meta: {
2987
+ listInputFieldChoices: {
2988
+ inputSchema: typeof ListInputFieldChoicesSchema;
2989
+ };
2990
+ };
2991
+ };
2992
+ }
2993
+
2770
2994
  interface ZapierSdkOptions extends BaseSdkOptions {
2771
2995
  }
2772
2996
  declare function createSdk<TCurrentSdk = {}, TCurrentContext = {
2773
2997
  meta: Record<string, PluginMeta>;
2774
2998
  }>(options?: ZapierSdkOptions, initialSdk?: TCurrentSdk, initialContext?: TCurrentContext): Sdk<TCurrentSdk, TCurrentContext>;
2999
+ declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk<ExtractSdkProperties<ApiPluginProvides> & ExtractSdkProperties<ListAppsPluginProvides> & ExtractSdkProperties<ManifestPluginProvides> & ExtractSdkProperties<GetAppPluginProvides> & ExtractSdkProperties<ListActionsPluginProvides> & ExtractSdkProperties<GetActionPluginProvides> & ExtractSdkProperties<ListInputFieldsPluginProvides> & ExtractSdkProperties<ListInputFieldChoicesPluginProvides> & ExtractSdkProperties<RunActionPluginProvides> & ExtractSdkProperties<LockVersionPluginProvides> & ExtractSdkProperties<ListAuthenticationsPluginProvides> & ExtractSdkProperties<GetAuthenticationPluginProvides> & ExtractSdkProperties<FindFirstAuthenticationPluginProvides> & ExtractSdkProperties<FindUniqueAuthenticationPluginProvides> & ExtractSdkProperties<RequestPluginProvides> & ExtractSdkProperties<FetchPluginProvides> & ExtractSdkProperties<AppsPluginProvides> & ExtractSdkProperties<GetProfilePluginProvides>, {
3000
+ meta: Record<string, PluginMeta>;
3001
+ } & {
3002
+ api: ApiClient;
3003
+ } & {
3004
+ meta: {
3005
+ listApps: {
3006
+ inputSchema: typeof ListAppsSchema;
3007
+ };
3008
+ };
3009
+ } & {
3010
+ getVersionedImplementationId: GetVersionedImplementationId;
3011
+ getManifestEntry: GetManifestEntry;
3012
+ getImplementation: GetImplementation;
3013
+ } & {
3014
+ meta: {
3015
+ getApp: {
3016
+ inputSchema: typeof GetAppSchema;
3017
+ };
3018
+ };
3019
+ } & {
3020
+ meta: {
3021
+ listActions: {
3022
+ inputSchema: typeof ListActionsSchema;
3023
+ };
3024
+ };
3025
+ } & {
3026
+ meta: {
3027
+ getAction: {
3028
+ inputSchema: typeof GetActionSchema;
3029
+ };
3030
+ };
3031
+ } & {
3032
+ meta: {
3033
+ listInputFields: {
3034
+ inputSchema: typeof ListInputFieldsSchema;
3035
+ };
3036
+ };
3037
+ } & {
3038
+ meta: {
3039
+ listInputFieldChoices: {
3040
+ inputSchema: typeof ListInputFieldChoicesSchema;
3041
+ };
3042
+ };
3043
+ } & {
3044
+ meta: {
3045
+ runAction: {
3046
+ inputSchema: typeof RunActionSchema;
3047
+ };
3048
+ };
3049
+ } & {
3050
+ meta: {
3051
+ lockVersion: {
3052
+ inputSchema: typeof LockVersionSchema;
3053
+ };
3054
+ };
3055
+ } & {
3056
+ meta: {
3057
+ listAuthentications: {
3058
+ inputSchema: typeof ListAuthenticationsSchema;
3059
+ };
3060
+ };
3061
+ } & {
3062
+ meta: {
3063
+ getAuthentication: {
3064
+ inputSchema: typeof GetAuthenticationSchema;
3065
+ };
3066
+ };
3067
+ } & {
3068
+ meta: {
3069
+ findFirstAuthentication: {
3070
+ inputSchema: typeof FindFirstAuthenticationSchema;
3071
+ };
3072
+ };
3073
+ } & {
3074
+ meta: {
3075
+ findUniqueAuthentication: {
3076
+ inputSchema: typeof FindUniqueAuthenticationSchema;
3077
+ };
3078
+ };
3079
+ } & {
3080
+ meta: {
3081
+ request: {
3082
+ inputSchema: typeof RelayRequestSchema;
3083
+ };
3084
+ };
3085
+ } & {
3086
+ meta: {
3087
+ getProfile: {
3088
+ inputSchema: typeof GetProfileSchema;
3089
+ };
3090
+ };
3091
+ }>;
2775
3092
  declare function createZapierSdk(options?: ZapierSdkOptions): ZapierSdk;
2776
3093
 
2777
- export { type Action, type ActionExecutionResult, type ActionField, type ActionFieldChoice, type ActionItem, type ActionKeyProperty, ActionKeyPropertySchema, type ActionTypeProperty, ActionTypePropertySchema, type ApiError, type ApiEvent, type App, type AppItem, type AppKeyProperty, AppKeyPropertySchema, type AppsPluginProvides, type AuthEvent, type AuthOptions, type Authentication, type AuthenticationIdProperty, AuthenticationIdPropertySchema, type AuthenticationItem, type AuthenticationsResponse, type Choice, type DebugProperty, DebugPropertySchema, type ErrorOptions, type EventCallback, type FetchPluginProvides, type Field, type FunctionOptions, type FunctionRegistryEntry, type GetSdkType, type InputFieldItem, type InputsProperty, InputsPropertySchema, type LimitProperty, LimitPropertySchema, type LoadingEvent, type Need, type NeedsRequest, type NeedsResponse, type OffsetProperty, OffsetPropertySchema, type OutputProperty, OutputPropertySchema, type PaginatedSdkFunction, type ParamsProperty, ParamsPropertySchema, type Plugin, type PluginDependencies, type PluginOptions, type PluginProvides, RelayFetchSchema, RelayRequestSchema, type ResolverName, type ResolverType, type Sdk, type SdkEvent, type UserProfile, type UserProfileItem, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, type ZapierFetchInitOptions, ZapierNotFoundError, ZapierResourceNotFoundError, type ZapierSdk, type ZapierSdkOptions, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, appKeyResolver, appsPlugin, authenticationIdResolver, createSdk, createZapierSdk, fetchPlugin, formatErrorMessage, getResolutionOrder, getResolutionOrderForParams, getResolvableParams, getResolver, getResolversForMissingParams, getTokenFromCliLogin, getTokenFromEnv, getTokenFromEnvOrConfig, hasResolver, inputsResolver, isPositional, resolverRegistry };
3094
+ export { type Action, type ActionExecutionResult, type ActionField, type ActionFieldChoice, type ActionItem, type ActionKeyProperty, ActionKeyPropertySchema, type ActionTypeProperty, ActionTypePropertySchema, type ApiError, type ApiEvent, type ApiPluginOptions, type ApiPluginProvides, type App, type AppItem, type AppKeyProperty, AppKeyPropertySchema, type AppsPluginProvides, type AuthEvent, type AuthOptions, type Authentication, type AuthenticationIdProperty, AuthenticationIdPropertySchema, type AuthenticationItem, type AuthenticationsResponse, type Choice, type DebugProperty, DebugPropertySchema, type ErrorOptions, type EventCallback, type FetchPluginProvides, type Field, type FindFirstAuthenticationPluginProvides, type FindUniqueAuthenticationPluginProvides, type FunctionOptions, type FunctionRegistryEntry, type GetActionPluginProvides, type GetAppPluginProvides, type GetAuthenticationPluginProvides, type GetProfilePluginProvides, type GetSdkType, type InputFieldItem, type InputsProperty, InputsPropertySchema, type LimitProperty, LimitPropertySchema, type ListActionsPluginProvides, type ListAppsPluginProvides, type ListAuthenticationsPluginProvides, type ListInputFieldsPluginProvides, type LoadingEvent, type LockVersionPluginProvides, type ManifestPluginOptions, type ManifestPluginProvides, type Need, type NeedsRequest, type NeedsResponse, type OffsetProperty, OffsetPropertySchema, type OutputProperty, OutputPropertySchema, type PaginatedSdkFunction, type ParamsProperty, ParamsPropertySchema, type Plugin, type PluginDependencies, type PluginOptions, type PluginProvides, RelayFetchSchema, RelayRequestSchema, type RequestPluginProvides, type ResolverName, type ResolverType, type RunActionPluginProvides, type Sdk, type SdkEvent, type UserProfile, type UserProfileItem, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, type ZapierFetchInitOptions, ZapierNotFoundError, ZapierResourceNotFoundError, type ZapierSdk, type ZapierSdkOptions, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, authenticationIdResolver, createFunction, createSdk, createZapierSdk, createZapierSdkWithoutRegistry, fetchPlugin, findFirstAuthenticationPlugin, findUniqueAuthenticationPlugin, formatErrorMessage, getActionPlugin, getAppPlugin, getAuthenticationPlugin, getProfilePlugin, getResolutionOrder, getResolutionOrderForParams, getResolvableParams, getResolver, getResolversForMissingParams, getTokenFromCliLogin, getTokenFromEnv, getTokenFromEnvOrConfig, hasResolver, inputsResolver, isPositional, listActionsPlugin, listAppsPlugin, listAuthenticationsPlugin, listInputFieldsPlugin, loadManifestFromFile, lockVersionPlugin, manifestPlugin, registryPlugin, requestPlugin, resolverRegistry, runActionPlugin };
package/dist/index.d.ts CHANGED
@@ -4,14 +4,31 @@ export * from "./types/properties";
4
4
  export * from "./types/errors";
5
5
  export * from "./plugins/apps";
6
6
  export * from "./plugins/fetch";
7
+ export * from "./plugins/listApps";
8
+ export * from "./plugins/listActions";
9
+ export * from "./plugins/listInputFields";
10
+ export * from "./plugins/listAuthentications";
11
+ export * from "./plugins/getApp";
12
+ export * from "./plugins/getAction";
13
+ export * from "./plugins/getAuthentication";
14
+ export * from "./plugins/findFirstAuthentication";
15
+ export * from "./plugins/findUniqueAuthentication";
16
+ export * from "./plugins/runAction";
17
+ export * from "./plugins/request";
18
+ export * from "./plugins/manifest";
19
+ export * from "./plugins/lockVersion";
20
+ export * from "./plugins/getProfile";
21
+ export * from "./plugins/api";
7
22
  export type { Action, App, Need, Field, Choice, ActionExecutionResult, ActionField, ActionFieldChoice, NeedsRequest, NeedsResponse, Authentication, AuthenticationsResponse, UserProfile, } from "./api/types";
8
23
  export { isPositional } from "./utils/schema-utils";
9
24
  export { hasResolver } from "./resolvers";
25
+ export { createFunction } from "./utils/function-utils";
10
26
  export * from "./auth";
11
27
  export * from "./resolvers";
12
28
  export { RelayRequestSchema, RelayFetchSchema, } from "./plugins/request/schemas";
13
- export { createZapierSdk, createSdk, ZapierSdkOptions } from "./sdk";
29
+ export { createZapierSdk, createZapierSdkWithoutRegistry, createSdk, ZapierSdkOptions, } from "./sdk";
14
30
  export type { FunctionRegistryEntry } from "./types/sdk";
15
31
  export type { Plugin, PluginProvides, PluginDependencies, PluginOptions, GetSdkType, Sdk, } from "./types/plugin";
32
+ export { registryPlugin } from "./plugins/registry";
16
33
  export type { ZapierSdk } from "./types/sdk";
17
34
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAGhC,YAAY,EACV,MAAM,EACN,GAAG,EACH,IAAI,EACJ,KAAK,EACL,MAAM,EACN,qBAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,WAAW,GACZ,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,cAAc,QAAQ,CAAC;AAGvB,cAAc,aAAa,CAAC;AAI5B,OAAO,EACL,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAGrE,YAAY,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGzD,YAAY,EACV,MAAM,EACN,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,GAAG,GACJ,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAG9B,YAAY,EACV,MAAM,EACN,GAAG,EACH,IAAI,EACJ,KAAK,EACL,MAAM,EACN,qBAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,WAAW,GACZ,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGxD,cAAc,QAAQ,CAAC;AAGvB,cAAc,aAAa,CAAC;AAI5B,OAAO,EACL,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,eAAe,EACf,8BAA8B,EAC9B,SAAS,EACT,gBAAgB,GACjB,MAAM,OAAO,CAAC;AAGf,YAAY,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGzD,YAAY,EACV,MAAM,EACN,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,GAAG,GACJ,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -5,9 +5,25 @@ export * from "./types/properties";
5
5
  export * from "./types/errors";
6
6
  export * from "./plugins/apps";
7
7
  export * from "./plugins/fetch";
8
+ export * from "./plugins/listApps";
9
+ export * from "./plugins/listActions";
10
+ export * from "./plugins/listInputFields";
11
+ export * from "./plugins/listAuthentications";
12
+ export * from "./plugins/getApp";
13
+ export * from "./plugins/getAction";
14
+ export * from "./plugins/getAuthentication";
15
+ export * from "./plugins/findFirstAuthentication";
16
+ export * from "./plugins/findUniqueAuthentication";
17
+ export * from "./plugins/runAction";
18
+ export * from "./plugins/request";
19
+ export * from "./plugins/manifest";
20
+ export * from "./plugins/lockVersion";
21
+ export * from "./plugins/getProfile";
22
+ export * from "./plugins/api";
8
23
  // Export schema utilities for CLI
9
24
  export { isPositional } from "./utils/schema-utils";
10
25
  export { hasResolver } from "./resolvers";
26
+ export { createFunction } from "./utils/function-utils";
11
27
  // Export auth utilities for CLI use
12
28
  export * from "./auth";
13
29
  // Export resolvers for CLI use
@@ -16,4 +32,6 @@ export * from "./resolvers";
16
32
  // Export plugin schemas for external use
17
33
  export { RelayRequestSchema, RelayFetchSchema, } from "./plugins/request/schemas";
18
34
  // Export the main combined SDK and new flexible SDK creator
19
- export { createZapierSdk, createSdk } from "./sdk";
35
+ export { createZapierSdk, createZapierSdkWithoutRegistry, createSdk, } from "./sdk";
36
+ // Export registry plugin for manual use
37
+ export { registryPlugin } from "./plugins/registry";