@zapier/zapier-sdk 0.8.2 → 0.9.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 (104) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +10 -33
  3. package/dist/api/client.d.ts.map +1 -1
  4. package/dist/api/client.js +1 -2
  5. package/dist/api/polling.d.ts +36 -6
  6. package/dist/api/polling.d.ts.map +1 -1
  7. package/dist/api/polling.js +132 -28
  8. package/dist/api/polling.test.d.ts +2 -0
  9. package/dist/api/polling.test.d.ts.map +1 -0
  10. package/dist/api/polling.test.js +318 -0
  11. package/dist/api/types.d.ts +1 -2
  12. package/dist/api/types.d.ts.map +1 -1
  13. package/dist/index.cjs +489 -252
  14. package/dist/index.d.mts +182 -187
  15. package/dist/index.d.ts +1 -2
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +0 -1
  18. package/dist/index.mjs +486 -251
  19. package/dist/plugins/apps/index.d.ts +4 -0
  20. package/dist/plugins/apps/index.d.ts.map +1 -1
  21. package/dist/plugins/getApp/index.d.ts +2 -7
  22. package/dist/plugins/getApp/index.d.ts.map +1 -1
  23. package/dist/plugins/getApp/index.js +9 -9
  24. package/dist/plugins/getApp/index.test.js +1 -1
  25. package/dist/plugins/getAuthentication/index.test.js +1 -1
  26. package/dist/plugins/listActions/index.d.ts +2 -4
  27. package/dist/plugins/listActions/index.d.ts.map +1 -1
  28. package/dist/plugins/listActions/index.js +1 -1
  29. package/dist/plugins/listActions/index.test.js +4 -4
  30. package/dist/plugins/listApps/index.d.ts +4 -7
  31. package/dist/plugins/listApps/index.d.ts.map +1 -1
  32. package/dist/plugins/listApps/index.js +33 -17
  33. package/dist/plugins/listApps/index.test.js +22 -2
  34. package/dist/plugins/listAuthentications/index.d.ts +2 -4
  35. package/dist/plugins/listAuthentications/index.d.ts.map +1 -1
  36. package/dist/plugins/listAuthentications/index.js +4 -0
  37. package/dist/plugins/listAuthentications/index.test.js +39 -13
  38. package/dist/plugins/listAuthentications/schemas.d.ts +3 -0
  39. package/dist/plugins/listAuthentications/schemas.d.ts.map +1 -1
  40. package/dist/plugins/listAuthentications/schemas.js +4 -0
  41. package/dist/plugins/manifest/index.d.ts +25 -9
  42. package/dist/plugins/manifest/index.d.ts.map +1 -1
  43. package/dist/plugins/manifest/index.js +239 -67
  44. package/dist/plugins/manifest/index.test.js +426 -171
  45. package/dist/plugins/manifest/schemas.d.ts +5 -1
  46. package/dist/plugins/manifest/schemas.d.ts.map +1 -1
  47. package/dist/plugins/manifest/schemas.js +1 -0
  48. package/dist/sdk.d.ts +5 -11
  49. package/dist/sdk.d.ts.map +1 -1
  50. package/dist/sdk.js +1 -4
  51. package/dist/types/plugin.d.ts +1 -0
  52. package/dist/types/plugin.d.ts.map +1 -1
  53. package/dist/types/sdk.d.ts +6 -3
  54. package/dist/types/sdk.d.ts.map +1 -1
  55. package/dist/utils/domain-utils.d.ts +16 -0
  56. package/dist/utils/domain-utils.d.ts.map +1 -1
  57. package/dist/utils/domain-utils.js +46 -27
  58. package/dist/utils/domain-utils.test.js +157 -3
  59. package/dist/utils/file-utils.d.ts +4 -0
  60. package/dist/utils/file-utils.d.ts.map +1 -0
  61. package/dist/utils/file-utils.js +74 -0
  62. package/dist/utils/file-utils.test.d.ts +2 -0
  63. package/dist/utils/file-utils.test.d.ts.map +1 -0
  64. package/dist/utils/file-utils.test.js +51 -0
  65. package/package.json +1 -1
  66. package/src/api/client.ts +5 -4
  67. package/src/api/polling.test.ts +405 -0
  68. package/src/api/polling.ts +224 -44
  69. package/src/api/types.ts +1 -2
  70. package/src/index.ts +1 -1
  71. package/src/plugins/apps/index.ts +9 -2
  72. package/src/plugins/getApp/index.test.ts +1 -1
  73. package/src/plugins/getApp/index.ts +12 -14
  74. package/src/plugins/getAuthentication/index.test.ts +1 -1
  75. package/src/plugins/listActions/index.test.ts +8 -7
  76. package/src/plugins/listActions/index.ts +3 -3
  77. package/src/plugins/listApps/index.test.ts +23 -2
  78. package/src/plugins/listApps/index.ts +46 -25
  79. package/src/plugins/listAuthentications/index.test.ts +52 -15
  80. package/src/plugins/listAuthentications/index.ts +7 -2
  81. package/src/plugins/listAuthentications/schemas.ts +4 -0
  82. package/src/plugins/manifest/index.test.ts +503 -197
  83. package/src/plugins/manifest/index.ts +338 -82
  84. package/src/plugins/manifest/schemas.ts +9 -2
  85. package/src/sdk.ts +1 -5
  86. package/src/types/plugin.ts +3 -0
  87. package/src/types/sdk.ts +26 -21
  88. package/src/utils/domain-utils.test.ts +196 -2
  89. package/src/utils/domain-utils.ts +68 -35
  90. package/src/utils/file-utils.test.ts +73 -0
  91. package/src/utils/file-utils.ts +94 -0
  92. package/tsconfig.tsbuildinfo +1 -1
  93. package/dist/plugins/lockVersion/index.d.ts +0 -24
  94. package/dist/plugins/lockVersion/index.d.ts.map +0 -1
  95. package/dist/plugins/lockVersion/index.js +0 -72
  96. package/dist/plugins/lockVersion/index.test.d.ts +0 -2
  97. package/dist/plugins/lockVersion/index.test.d.ts.map +0 -1
  98. package/dist/plugins/lockVersion/index.test.js +0 -129
  99. package/dist/plugins/lockVersion/schemas.d.ts +0 -10
  100. package/dist/plugins/lockVersion/schemas.d.ts.map +0 -1
  101. package/dist/plugins/lockVersion/schemas.js +0 -6
  102. package/src/plugins/lockVersion/index.test.ts +0 -176
  103. package/src/plugins/lockVersion/index.ts +0 -112
  104. package/src/plugins/lockVersion/schemas.ts +0 -9
package/dist/index.d.mts CHANGED
@@ -1841,9 +1841,8 @@ interface RequestOptions {
1841
1841
  }) => Error | undefined;
1842
1842
  }
1843
1843
  interface PollOptions extends RequestOptions {
1844
- maxAttempts?: number;
1845
1844
  initialDelay?: number;
1846
- maxDelay?: number;
1845
+ timeoutMs?: number;
1847
1846
  successStatus?: number;
1848
1847
  pendingStatus?: number;
1849
1848
  resultExtractor?: (response: unknown) => unknown;
@@ -2219,75 +2218,6 @@ declare const RelayFetchSchema: z.ZodObject<{
2219
2218
  relayBaseUrl?: string | undefined;
2220
2219
  }>;
2221
2220
 
2222
- declare const LockVersionSchema: z.ZodObject<{
2223
- appKey: z.ZodString;
2224
- }, "strip", z.ZodTypeAny, {
2225
- appKey: string;
2226
- }, {
2227
- appKey: string;
2228
- }>;
2229
- type LockVersionOptions = z.infer<typeof LockVersionSchema>;
2230
-
2231
- declare const ListAppsSchema: z.ZodObject<{
2232
- appKeys: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2233
- search: z.ZodOptional<z.ZodString>;
2234
- pageSize: z.ZodOptional<z.ZodNumber>;
2235
- maxItems: z.ZodOptional<z.ZodNumber>;
2236
- }, "strip", z.ZodTypeAny, {
2237
- search?: string | undefined;
2238
- pageSize?: number | undefined;
2239
- maxItems?: number | undefined;
2240
- appKeys?: string[] | undefined;
2241
- }, {
2242
- search?: string | undefined;
2243
- pageSize?: number | undefined;
2244
- maxItems?: number | undefined;
2245
- appKeys?: string[] | undefined;
2246
- }>;
2247
- type ListAppsOptions = z.infer<typeof ListAppsSchema>;
2248
-
2249
- interface ListAppsPluginProvides {
2250
- listApps: (options?: ListAppsOptions) => Promise<{
2251
- data: AppItem[];
2252
- }> & AsyncIterable<{
2253
- data: AppItem[];
2254
- nextCursor?: string;
2255
- }> & {
2256
- items(): AsyncIterable<AppItem>;
2257
- };
2258
- context: {
2259
- meta: {
2260
- listApps: {
2261
- inputSchema: typeof ListAppsSchema;
2262
- };
2263
- };
2264
- };
2265
- }
2266
- declare const listAppsPlugin: Plugin<{}, // no SDK dependencies
2267
- {
2268
- api: ApiClient;
2269
- }, // requires api in context
2270
- ListAppsPluginProvides>;
2271
-
2272
- interface LockVersionPluginProvides {
2273
- lockVersion: (options: LockVersionOptions & {
2274
- configPath?: string;
2275
- }) => Promise<{
2276
- data: AppItem;
2277
- configPath: string;
2278
- }>;
2279
- context: {
2280
- meta: {
2281
- lockVersion: {
2282
- inputSchema: typeof LockVersionSchema;
2283
- };
2284
- };
2285
- };
2286
- }
2287
- declare const lockVersionPlugin: Plugin<GetSdkType<ListAppsPluginProvides>, // requires getApp in SDK
2288
- {}, // requires manifest context
2289
- LockVersionPluginProvides>;
2290
-
2291
2221
  interface RegistryPluginProvides {
2292
2222
  getRegistry: () => {
2293
2223
  functions: FunctionRegistryEntry[];
@@ -2359,25 +2289,50 @@ type ZapierFetchInitOptions = RequestInit & {
2359
2289
  authenticationTemplate?: string;
2360
2290
  };
2361
2291
 
2362
- declare const GetAppSchema: z.ZodObject<{
2363
- appKey: z.ZodString;
2292
+ declare const ListAppsSchema: z.ZodObject<{
2293
+ appKeys: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2294
+ search: z.ZodOptional<z.ZodString>;
2295
+ pageSize: z.ZodOptional<z.ZodNumber>;
2296
+ maxItems: z.ZodOptional<z.ZodNumber>;
2364
2297
  }, "strip", z.ZodTypeAny, {
2365
- appKey: string;
2298
+ search?: string | undefined;
2299
+ pageSize?: number | undefined;
2300
+ maxItems?: number | undefined;
2301
+ appKeys?: string[] | undefined;
2366
2302
  }, {
2367
- appKey: string;
2303
+ search?: string | undefined;
2304
+ pageSize?: number | undefined;
2305
+ maxItems?: number | undefined;
2306
+ appKeys?: string[] | undefined;
2368
2307
  }>;
2369
- type GetAppOptions = z.infer<typeof GetAppSchema>;
2308
+ type ListAppsOptions = z.infer<typeof ListAppsSchema>;
2309
+
2310
+ /**
2311
+ * Domain utility functions for working with app identifiers and data normalization
2312
+ */
2313
+
2314
+ interface AppLocator {
2315
+ lookupAppKey: string;
2316
+ slug?: string;
2317
+ implementationName?: string;
2318
+ version?: string;
2319
+ }
2320
+ interface ResolvedAppLocator extends AppLocator {
2321
+ implementationName: string;
2322
+ }
2370
2323
 
2324
+ declare const DEFAULT_CONFIG_PATH: ".zapierrc";
2371
2325
  type ManifestEntry = {
2372
2326
  implementationName: string;
2373
2327
  version?: string;
2374
2328
  };
2375
- type GetManifestEntry = (appKey: string) => ManifestEntry | null;
2376
2329
  type GetVersionedImplementationId = (appKey: string) => Promise<string | null>;
2377
- type GetImplementation = (appKey: string) => Promise<AppItem | null>;
2378
2330
  type Manifest = {
2379
2331
  apps: Record<string, ManifestEntry>;
2380
2332
  };
2333
+ type ResolveAppKeys = ({ appKeys, }: {
2334
+ appKeys: string[];
2335
+ }) => Promise<ResolvedAppLocator[]>;
2381
2336
  declare const ManifestPluginOptionsSchema: z.ZodObject<{
2382
2337
  manifestPath: z.ZodOptional<z.ZodString>;
2383
2338
  manifest: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -2408,19 +2363,75 @@ type ManifestPluginOptions = z.infer<typeof ManifestPluginOptionsSchema>;
2408
2363
  interface ManifestPluginProvides {
2409
2364
  context: {
2410
2365
  getVersionedImplementationId: GetVersionedImplementationId;
2411
- getManifestEntry: GetManifestEntry;
2412
- getImplementation: GetImplementation;
2366
+ resolveAppKeys: ResolveAppKeys;
2367
+ updateManifestEntry: (appKey: string, entry: ManifestEntry, configPath?: string) => Promise<[string, ManifestEntry]>;
2413
2368
  };
2414
2369
  }
2415
2370
  /**
2416
- * Load manifest from a file path synchronously
2417
- * Supports local files (Node.js only)
2371
+ * Read manifest from a file path asynchronously
2372
+ * Supports local files (Node.js) and browser environments (fallback to global filesystem)
2373
+ */
2374
+ declare function readManifestFromFile(filePath: string): Promise<Manifest | null>;
2375
+ /**
2376
+ * Get the preferred key for storing an app in the manifest
2377
+ * Extracted from plugin to make it easier to test
2418
2378
  */
2419
- declare function loadManifestFromFile(filePath: string): Manifest | null;
2420
- declare const manifestPlugin: Plugin<GetSdkType<ListAppsPluginProvides>, {
2379
+ declare function getPreferredManifestEntryKey({ appKey, api, }: {
2380
+ appKey: string;
2381
+ api: ApiClient;
2382
+ }): Promise<string>;
2383
+ /**
2384
+ * Find a manifest entry by any app key (implementation name, slug, etc.).
2385
+ */
2386
+ declare function findManifestEntry({ appKey, manifest, }: {
2387
+ appKey: string;
2388
+ manifest: Manifest;
2389
+ }): [string, ManifestEntry] | null;
2390
+
2391
+ declare const manifestPlugin: Plugin<{}, // no SDK dependencies
2392
+ {
2421
2393
  api: ApiClient;
2422
2394
  }, ManifestPluginProvides>;
2423
2395
 
2396
+ interface ApiPluginOptions extends BaseSdkOptions {
2397
+ }
2398
+ interface ApiPluginProvides {
2399
+ context: {
2400
+ api: ApiClient;
2401
+ };
2402
+ }
2403
+ declare const apiPlugin: Plugin<{}, // no SDK dependencies
2404
+ {}, // requires no context
2405
+ ApiPluginProvides>;
2406
+
2407
+ interface ListAppsPluginProvides {
2408
+ listApps: (options?: ListAppsOptions) => Promise<{
2409
+ data: AppItem[];
2410
+ }> & AsyncIterable<{
2411
+ data: AppItem[];
2412
+ nextCursor?: string;
2413
+ }> & {
2414
+ items(): AsyncIterable<AppItem>;
2415
+ };
2416
+ context: {
2417
+ meta: {
2418
+ listApps: {
2419
+ inputSchema: typeof ListAppsSchema;
2420
+ };
2421
+ };
2422
+ };
2423
+ }
2424
+ declare const listAppsPlugin: Plugin<{}, GetContextType<ApiPluginProvides & ManifestPluginProvides>, ListAppsPluginProvides>;
2425
+
2426
+ declare const GetAppSchema: z.ZodObject<{
2427
+ appKey: z.ZodString;
2428
+ }, "strip", z.ZodTypeAny, {
2429
+ appKey: string;
2430
+ }, {
2431
+ appKey: string;
2432
+ }>;
2433
+ type GetAppOptions = z.infer<typeof GetAppSchema>;
2434
+
2424
2435
  interface GetAppPluginProvides {
2425
2436
  getApp: (options: GetAppOptions) => Promise<{
2426
2437
  data: AppItem;
@@ -2433,11 +2444,7 @@ interface GetAppPluginProvides {
2433
2444
  };
2434
2445
  };
2435
2446
  }
2436
- declare const getAppPlugin: Plugin<GetSdkType<ManifestPluginProvides>, // depends on manifest plugin with getImplementation in context
2437
- {
2438
- getImplementation: GetImplementation;
2439
- }, //
2440
- GetAppPluginProvides>;
2447
+ declare const getAppPlugin: Plugin<GetSdkType<ListAppsPluginProvides>, {}, GetAppPluginProvides>;
2441
2448
 
2442
2449
  declare const ListActionsSchema: z.ZodObject<{
2443
2450
  appKey: z.ZodString;
@@ -2474,12 +2481,10 @@ interface ListActionsPluginProvides {
2474
2481
  };
2475
2482
  };
2476
2483
  }
2477
- declare const listActionsPlugin: Plugin<GetSdkType<ManifestPluginProvides>, // requires getApp in SDK
2478
- {
2484
+ declare const listActionsPlugin: Plugin<GetSdkType<ManifestPluginProvides>, {
2479
2485
  api: ApiClient;
2480
2486
  getVersionedImplementationId: GetVersionedImplementationId;
2481
- }, // requires api and getVersionedImplementationId in context
2482
- ListActionsPluginProvides>;
2487
+ }, ListActionsPluginProvides>;
2483
2488
 
2484
2489
  declare const GetActionSchema: z.ZodObject<{
2485
2490
  appKey: z.ZodString;
@@ -2567,6 +2572,7 @@ RunActionPluginProvides>;
2567
2572
 
2568
2573
  declare const ListAuthenticationsSchema: z.ZodObject<{
2569
2574
  appKey: z.ZodOptional<z.ZodString>;
2575
+ authenticationIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2570
2576
  search: z.ZodOptional<z.ZodString>;
2571
2577
  title: z.ZodOptional<z.ZodString>;
2572
2578
  accountId: z.ZodOptional<z.ZodString>;
@@ -2581,6 +2587,7 @@ declare const ListAuthenticationsSchema: z.ZodObject<{
2581
2587
  maxItems?: number | undefined;
2582
2588
  accountId?: string | undefined;
2583
2589
  owner?: string | undefined;
2590
+ authenticationIds?: string[] | undefined;
2584
2591
  }, {
2585
2592
  title?: string | undefined;
2586
2593
  search?: string | undefined;
@@ -2589,6 +2596,7 @@ declare const ListAuthenticationsSchema: z.ZodObject<{
2589
2596
  maxItems?: number | undefined;
2590
2597
  accountId?: string | undefined;
2591
2598
  owner?: string | undefined;
2599
+ authenticationIds?: string[] | undefined;
2592
2600
  }>;
2593
2601
  type ListAuthenticationsOptions = z.infer<typeof ListAuthenticationsSchema>;
2594
2602
 
@@ -2609,12 +2617,10 @@ interface ListAuthenticationsPluginProvides {
2609
2617
  };
2610
2618
  };
2611
2619
  }
2612
- declare const listAuthenticationsPlugin: Plugin<GetSdkType<ManifestPluginProvides>, // requires getApp in SDK
2613
- {
2620
+ declare const listAuthenticationsPlugin: Plugin<GetSdkType<ManifestPluginProvides>, {
2614
2621
  api: ApiClient;
2615
2622
  getVersionedImplementationId: GetVersionedImplementationId;
2616
- }, // requires api in context
2617
- ListAuthenticationsPluginProvides>;
2623
+ }, ListAuthenticationsPluginProvides>;
2618
2624
 
2619
2625
  interface GetAuthenticationPluginProvides {
2620
2626
  getAuthentication: (options: GetAuthenticationOptions) => Promise<{
@@ -2690,6 +2696,74 @@ declare const listInputFieldsPlugin: Plugin<GetSdkType<GetAppPluginProvides>, //
2690
2696
  }, // requires api and getVersionedImplementationId in context
2691
2697
  ListInputFieldsPluginProvides>;
2692
2698
 
2699
+ declare const InputFieldChoiceItemSchema: z.ZodObject<{
2700
+ key: z.ZodOptional<z.ZodString>;
2701
+ label: z.ZodOptional<z.ZodString>;
2702
+ sample: z.ZodOptional<z.ZodString>;
2703
+ value: z.ZodOptional<z.ZodString>;
2704
+ }, "strip", z.ZodTypeAny, {
2705
+ value?: string | undefined;
2706
+ key?: string | undefined;
2707
+ label?: string | undefined;
2708
+ sample?: string | undefined;
2709
+ }, {
2710
+ value?: string | undefined;
2711
+ key?: string | undefined;
2712
+ label?: string | undefined;
2713
+ sample?: string | undefined;
2714
+ }>;
2715
+ type InputFieldChoiceItem = z.infer<typeof InputFieldChoiceItemSchema>;
2716
+ declare const ListInputFieldChoicesSchema: z.ZodObject<{
2717
+ appKey: z.ZodString;
2718
+ actionType: z.ZodEnum<["read", "read_bulk", "write", "run", "search", "search_or_write", "search_and_write", "filter"]>;
2719
+ actionKey: z.ZodString;
2720
+ inputFieldKey: z.ZodString;
2721
+ authenticationId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2722
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2723
+ page: z.ZodOptional<z.ZodNumber>;
2724
+ pageSize: z.ZodOptional<z.ZodNumber>;
2725
+ maxItems: z.ZodOptional<z.ZodNumber>;
2726
+ }, "strip", z.ZodTypeAny, {
2727
+ appKey: string;
2728
+ actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
2729
+ actionKey: string;
2730
+ inputFieldKey: string;
2731
+ page?: number | undefined;
2732
+ authenticationId?: number | null | undefined;
2733
+ inputs?: Record<string, unknown> | undefined;
2734
+ pageSize?: number | undefined;
2735
+ maxItems?: number | undefined;
2736
+ }, {
2737
+ appKey: string;
2738
+ actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
2739
+ actionKey: string;
2740
+ inputFieldKey: string;
2741
+ page?: number | undefined;
2742
+ authenticationId?: number | null | undefined;
2743
+ inputs?: Record<string, unknown> | undefined;
2744
+ pageSize?: number | undefined;
2745
+ maxItems?: number | undefined;
2746
+ }>;
2747
+ type ListInputFieldChoicesOptions = z.infer<typeof ListInputFieldChoicesSchema>;
2748
+
2749
+ interface ListInputFieldChoicesPluginProvides {
2750
+ listInputFieldChoices: (options: ListInputFieldChoicesOptions) => Promise<{
2751
+ data: InputFieldChoiceItem[];
2752
+ }> & AsyncIterable<{
2753
+ data: InputFieldChoiceItem[];
2754
+ nextCursor?: string;
2755
+ }> & {
2756
+ items(): AsyncIterable<InputFieldChoiceItem>;
2757
+ };
2758
+ context: {
2759
+ meta: {
2760
+ listInputFieldChoices: {
2761
+ inputSchema: typeof ListInputFieldChoicesSchema;
2762
+ };
2763
+ };
2764
+ };
2765
+ }
2766
+
2693
2767
  /**
2694
2768
  * SDK-related types and interfaces
2695
2769
  */
@@ -2717,7 +2791,9 @@ interface FunctionRegistryEntry {
2717
2791
  inputSchema: z.ZodSchema;
2718
2792
  categories: string[];
2719
2793
  }
2720
- type ZapierSdk = GetSdkType<RegistryPluginProvides & FetchPluginProvides & AppsPluginProvides & ListAppsPluginProvides & ManifestPluginProvides & GetAppPluginProvides & ListActionsPluginProvides & GetActionPluginProvides & RunActionPluginProvides & LockVersionPluginProvides & ListAuthenticationsPluginProvides & GetAuthenticationPluginProvides & FindFirstAuthenticationPluginProvides & FindUniqueAuthenticationPluginProvides & ListInputFieldsPluginProvides & RequestPluginProvides & GetProfilePluginProvides>;
2794
+ interface ZapierSdk extends GetSdkType<RegistryPluginProvides & FetchPluginProvides & AppsPluginProvides & ListAppsPluginProvides & ManifestPluginProvides & GetAppPluginProvides & ListActionsPluginProvides & GetActionPluginProvides & RunActionPluginProvides & ListAuthenticationsPluginProvides & GetAuthenticationPluginProvides & FindFirstAuthenticationPluginProvides & FindUniqueAuthenticationPluginProvides & ListInputFieldsPluginProvides & ListInputFieldChoicesPluginProvides & RequestPluginProvides & GetProfilePluginProvides> {
2795
+ apps: ActionProxy & ZapierSdkApps;
2796
+ }
2721
2797
 
2722
2798
  /**
2723
2799
  * ------------------------------
@@ -2745,6 +2821,7 @@ type ExtractContextProperties<T extends PluginProvides> = T["context"];
2745
2821
  type GetSdkType<TPluginProvides extends PluginProvides> = ExtractSdkProperties<TPluginProvides> & {
2746
2822
  getContext(): NonNullable<ExtractContextProperties<TPluginProvides>>;
2747
2823
  };
2824
+ type GetContextType<TPluginProvides extends PluginProvides> = NonNullable<ExtractContextProperties<TPluginProvides>>;
2748
2825
  type PluginOptions<TSdk = {}, TContext = {}> = {
2749
2826
  sdk: TSdk;
2750
2827
  context: TContext & {
@@ -2793,16 +2870,8 @@ declare const appsPlugin: Plugin<GetSdkType<FetchPluginProvides & RunActionPlugi
2793
2870
  {}, // no context requirements
2794
2871
  AppsPluginProvides>;
2795
2872
 
2796
- interface ApiPluginOptions extends BaseSdkOptions {
2797
- }
2798
- interface ApiPluginProvides {
2799
- context: {
2800
- api: ApiClient;
2801
- };
2873
+ interface ZapierSdkApps {
2802
2874
  }
2803
- declare const apiPlugin: Plugin<{}, // no SDK dependencies
2804
- {}, // requires no context
2805
- ApiPluginProvides>;
2806
2875
 
2807
2876
  interface InputsResolver {
2808
2877
  type: "fields";
@@ -2923,93 +2992,25 @@ declare function getTokenFromCliLogin(options?: AuthOptions): Promise<string | u
2923
2992
  */
2924
2993
  declare function getTokenFromEnvOrConfig(options?: AuthOptions): Promise<string | undefined>;
2925
2994
 
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.ZodUnknown>>;
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, unknown> | 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, unknown> | 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
-
2994
2995
  interface ZapierSdkOptions extends BaseSdkOptions {
2995
2996
  }
2996
2997
  declare function createSdk<TCurrentSdk = {}, TCurrentContext = {
2997
2998
  meta: Record<string, PluginMeta>;
2998
2999
  }>(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
+ declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk<ExtractSdkProperties<ApiPluginProvides> & ExtractSdkProperties<ManifestPluginProvides> & ExtractSdkProperties<ListAppsPluginProvides> & ExtractSdkProperties<GetAppPluginProvides> & ExtractSdkProperties<ListActionsPluginProvides> & ExtractSdkProperties<GetActionPluginProvides> & ExtractSdkProperties<ListInputFieldsPluginProvides> & ExtractSdkProperties<ListInputFieldChoicesPluginProvides> & ExtractSdkProperties<RunActionPluginProvides> & ExtractSdkProperties<ListAuthenticationsPluginProvides> & ExtractSdkProperties<GetAuthenticationPluginProvides> & ExtractSdkProperties<FindFirstAuthenticationPluginProvides> & ExtractSdkProperties<FindUniqueAuthenticationPluginProvides> & ExtractSdkProperties<RequestPluginProvides> & ExtractSdkProperties<FetchPluginProvides> & ExtractSdkProperties<AppsPluginProvides> & ExtractSdkProperties<GetProfilePluginProvides>, {
3000
3001
  meta: Record<string, PluginMeta>;
3001
3002
  } & {
3002
3003
  api: ApiClient;
3004
+ } & {
3005
+ getVersionedImplementationId: GetVersionedImplementationId;
3006
+ resolveAppKeys: ResolveAppKeys;
3007
+ updateManifestEntry: (appKey: string, entry: ManifestEntry, configPath?: string) => Promise<[string, ManifestEntry]>;
3003
3008
  } & {
3004
3009
  meta: {
3005
3010
  listApps: {
3006
3011
  inputSchema: typeof ListAppsSchema;
3007
3012
  };
3008
3013
  };
3009
- } & {
3010
- getVersionedImplementationId: GetVersionedImplementationId;
3011
- getManifestEntry: GetManifestEntry;
3012
- getImplementation: GetImplementation;
3013
3014
  } & {
3014
3015
  meta: {
3015
3016
  getApp: {
@@ -3046,12 +3047,6 @@ declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk
3046
3047
  inputSchema: typeof RunActionSchema;
3047
3048
  };
3048
3049
  };
3049
- } & {
3050
- meta: {
3051
- lockVersion: {
3052
- inputSchema: typeof LockVersionSchema;
3053
- };
3054
- };
3055
3050
  } & {
3056
3051
  meta: {
3057
3052
  listAuthentications: {
@@ -3091,4 +3086,4 @@ declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk
3091
3086
  }>;
3092
3087
  declare function createZapierSdk(options?: ZapierSdkOptions): ZapierSdk;
3093
3088
 
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 };
3089
+ export { type Action, type ActionExecutionOptions, 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, DEFAULT_CONFIG_PATH, 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 GetContextType, type GetProfilePluginProvides, type GetSdkType, type InputFieldItem, type InputsProperty, InputsPropertySchema, type LimitProperty, LimitPropertySchema, type ListActionsPluginProvides, type ListAppsPluginProvides, type ListAuthenticationsPluginProvides, type ListInputFieldsPluginProvides, type LoadingEvent, 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 ZapierSdkApps, type ZapierSdkOptions, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, authenticationIdResolver, createFunction, createSdk, createZapierSdk, createZapierSdkWithoutRegistry, fetchPlugin, findFirstAuthenticationPlugin, findManifestEntry, findUniqueAuthenticationPlugin, formatErrorMessage, getActionPlugin, getAppPlugin, getAuthenticationPlugin, getPreferredManifestEntryKey, getProfilePlugin, getResolutionOrder, getResolutionOrderForParams, getResolvableParams, getResolver, getResolversForMissingParams, getTokenFromCliLogin, getTokenFromEnv, getTokenFromEnvOrConfig, hasResolver, inputsResolver, isPositional, listActionsPlugin, listAppsPlugin, listAuthenticationsPlugin, listInputFieldsPlugin, manifestPlugin, readManifestFromFile, registryPlugin, requestPlugin, resolverRegistry, runActionPlugin };
package/dist/index.d.ts CHANGED
@@ -16,7 +16,6 @@ export * from "./plugins/findUniqueAuthentication";
16
16
  export * from "./plugins/runAction";
17
17
  export * from "./plugins/request";
18
18
  export * from "./plugins/manifest";
19
- export * from "./plugins/lockVersion";
20
19
  export * from "./plugins/getProfile";
21
20
  export * from "./plugins/api";
22
21
  export type { Action, App, Need, Field, Choice, ActionExecutionResult, ActionField, ActionFieldChoice, NeedsRequest, NeedsResponse, Authentication, AuthenticationsResponse, UserProfile, } from "./api/types";
@@ -28,7 +27,7 @@ export * from "./resolvers";
28
27
  export { RelayRequestSchema, RelayFetchSchema, } from "./plugins/request/schemas";
29
28
  export { createZapierSdk, createZapierSdkWithoutRegistry, createSdk, ZapierSdkOptions, } from "./sdk";
30
29
  export type { FunctionRegistryEntry } from "./types/sdk";
31
- export type { Plugin, PluginProvides, PluginDependencies, PluginOptions, GetSdkType, Sdk, } from "./types/plugin";
30
+ export type { Plugin, PluginProvides, PluginDependencies, PluginOptions, GetSdkType, GetContextType, Sdk, } from "./types/plugin";
32
31
  export { registryPlugin } from "./plugins/registry";
33
32
  export type { ZapierSdk } from "./types/sdk";
34
33
  //# 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;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"}
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,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,cAAc,EACd,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
@@ -17,7 +17,6 @@ export * from "./plugins/findUniqueAuthentication";
17
17
  export * from "./plugins/runAction";
18
18
  export * from "./plugins/request";
19
19
  export * from "./plugins/manifest";
20
- export * from "./plugins/lockVersion";
21
20
  export * from "./plugins/getProfile";
22
21
  export * from "./plugins/api";
23
22
  // Export schema utilities for CLI