@zapier/zapier-sdk 0.50.0 → 0.51.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 (50) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +1 -1
  3. package/dist/api/auth.d.ts +1 -6
  4. package/dist/api/auth.d.ts.map +1 -1
  5. package/dist/api/auth.js +34 -27
  6. package/dist/api/client.d.ts.map +1 -1
  7. package/dist/api/client.js +3 -2
  8. package/dist/api/index.d.ts +1 -1
  9. package/dist/api/index.d.ts.map +1 -1
  10. package/dist/api/index.js +1 -1
  11. package/dist/api/schemas.d.ts +3 -3
  12. package/dist/auth.d.ts +13 -2
  13. package/dist/auth.d.ts.map +1 -1
  14. package/dist/auth.js +95 -11
  15. package/dist/experimental.cjs +167 -29
  16. package/dist/experimental.d.mts +2 -2
  17. package/dist/experimental.d.ts +26 -26
  18. package/dist/experimental.mjs +166 -30
  19. package/dist/{index-BQ2ii0Bs.d.mts → index-C52BjTXh.d.mts} +109 -2
  20. package/dist/{index-BQ2ii0Bs.d.ts → index-C52BjTXh.d.ts} +109 -2
  21. package/dist/index.cjs +167 -29
  22. package/dist/index.d.mts +1 -1
  23. package/dist/index.d.ts +2 -1
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +1 -0
  26. package/dist/index.mjs +166 -30
  27. package/dist/plugins/apps/index.d.ts +2 -2
  28. package/dist/plugins/deprecated/inputFields.d.ts +18 -18
  29. package/dist/plugins/getAction/index.d.ts +6 -6
  30. package/dist/plugins/getAction/schemas.d.ts +4 -4
  31. package/dist/plugins/getActionInputFieldsSchema/index.d.ts +5 -5
  32. package/dist/plugins/getActionInputFieldsSchema/schemas.d.ts +4 -4
  33. package/dist/plugins/listActionInputFieldChoices/index.d.ts +5 -5
  34. package/dist/plugins/listActionInputFieldChoices/schemas.d.ts +4 -4
  35. package/dist/plugins/listActionInputFields/index.d.ts +5 -5
  36. package/dist/plugins/listActionInputFields/schemas.d.ts +4 -4
  37. package/dist/plugins/listActions/index.d.ts +3 -3
  38. package/dist/plugins/listActions/schemas.d.ts +4 -4
  39. package/dist/plugins/runAction/index.d.ts +5 -5
  40. package/dist/plugins/runAction/schemas.d.ts +4 -4
  41. package/dist/plugins/triggers/getTriggerInputFieldsSchema/index.d.ts +2 -2
  42. package/dist/plugins/triggers/listTriggerInputFieldChoices/index.d.ts +2 -2
  43. package/dist/plugins/triggers/listTriggerInputFields/index.d.ts +2 -2
  44. package/dist/schemas/Action.d.ts +1 -1
  45. package/dist/sdk.d.ts +52 -52
  46. package/dist/types/properties.d.ts +1 -1
  47. package/dist/utils/telemetry.d.ts +11 -0
  48. package/dist/utils/telemetry.d.ts.map +1 -0
  49. package/dist/utils/telemetry.js +19 -0
  50. package/package.json +1 -1
@@ -1834,33 +1834,40 @@ function getAuthorizationHeader(token) {
1834
1834
  }
1835
1835
  return `Bearer ${token}`;
1836
1836
  }
1837
- function extractUserIdsFromJwt(token) {
1837
+ function readJwtPayload(token) {
1838
1838
  const parts = parseJwt(token);
1839
- if (!parts) {
1840
- return { customuser_id: null, account_id: null };
1841
- }
1839
+ if (!parts) return null;
1840
+ let payload;
1842
1841
  try {
1843
- const payload = JSON.parse(
1844
- Buffer.from(parts[1], "base64url").toString("utf-8")
1845
- );
1846
- let actualPayload = payload;
1847
- if (payload.sub_type === "service" && payload.njwt) {
1848
- const nestedParts = payload.njwt.split(".");
1849
- if (nestedParts.length === 3) {
1850
- actualPayload = JSON.parse(
1842
+ payload = JSON.parse(Buffer.from(parts[1], "base64url").toString("utf-8"));
1843
+ } catch {
1844
+ return null;
1845
+ }
1846
+ if (payload["sub_type"] === "service" && typeof payload["njwt"] === "string") {
1847
+ const nestedParts = parseJwt(payload["njwt"]);
1848
+ if (nestedParts) {
1849
+ try {
1850
+ return JSON.parse(
1851
1851
  Buffer.from(nestedParts[1], "base64url").toString("utf-8")
1852
1852
  );
1853
+ } catch {
1853
1854
  }
1854
1855
  }
1855
- const accountId = actualPayload["zap:acc"] != null ? parseInt(String(actualPayload["zap:acc"]), 10) : null;
1856
- const customUserId = actualPayload.sub_type === "customuser" && actualPayload.sub != null ? parseInt(String(actualPayload.sub), 10) : null;
1857
- return {
1858
- customuser_id: customUserId !== null && !isNaN(customUserId) ? customUserId : null,
1859
- account_id: accountId !== null && !isNaN(accountId) ? accountId : null
1860
- };
1861
- } catch {
1856
+ }
1857
+ return payload;
1858
+ }
1859
+ function extractUserIdsFromJwt(token) {
1860
+ const payload = readJwtPayload(token);
1861
+ if (!payload) {
1862
1862
  return { customuser_id: null, account_id: null };
1863
1863
  }
1864
+ const accRaw = payload["zap:acc"];
1865
+ const accountId = accRaw != null ? parseInt(String(accRaw), 10) : null;
1866
+ const customUserId = payload["sub_type"] === "customuser" && payload["sub"] != null ? parseInt(String(payload["sub"]), 10) : null;
1867
+ return {
1868
+ customuser_id: customUserId !== null && !isNaN(customUserId) ? customUserId : null,
1869
+ account_id: accountId !== null && !isNaN(accountId) ? accountId : null
1870
+ };
1864
1871
  }
1865
1872
 
1866
1873
  // src/api/debug.ts
@@ -2209,6 +2216,19 @@ function isCredentialsFunction(credentials) {
2209
2216
  return typeof credentials === "function";
2210
2217
  }
2211
2218
 
2219
+ // src/utils/telemetry.ts
2220
+ var emittedOnce = /* @__PURE__ */ new WeakMap();
2221
+ function emitOnce(onEvent, event) {
2222
+ if (!emittedOnce.has(onEvent)) {
2223
+ emittedOnce.set(onEvent, /* @__PURE__ */ new Set());
2224
+ }
2225
+ const fired = emittedOnce.get(onEvent);
2226
+ if (!fired.has(event.type)) {
2227
+ fired.add(event.type);
2228
+ onEvent(event);
2229
+ }
2230
+ }
2231
+
2212
2232
  // src/utils/url-utils.ts
2213
2233
  function getZapierBaseUrl(baseUrl) {
2214
2234
  if (!baseUrl) {
@@ -2431,8 +2451,10 @@ async function resolveCache(options) {
2431
2451
  if (cliLogin?.createCache) {
2432
2452
  try {
2433
2453
  const cache = cliLogin.createCache();
2434
- cachedDefaultCache = cache;
2435
- return cache;
2454
+ if (cache) {
2455
+ cachedDefaultCache = cache;
2456
+ return cache;
2457
+ }
2436
2458
  } catch {
2437
2459
  }
2438
2460
  }
@@ -2444,6 +2466,11 @@ function entryIsValid(entry) {
2444
2466
  if (entry.expiresAt === void 0) return true;
2445
2467
  return entry.expiresAt > Date.now() + TOKEN_EXPIRATION_BUFFER_MS;
2446
2468
  }
2469
+ async function readCachedToken(cacheKey, cache) {
2470
+ const cached = await cache.get(cacheKey);
2471
+ if (cached && entryIsValid(cached)) return cached.value;
2472
+ return void 0;
2473
+ }
2447
2474
  async function invalidateCachedToken(options) {
2448
2475
  const cacheKey = buildCacheKey(options);
2449
2476
  pendingExchanges.delete(cacheKey);
@@ -2557,11 +2584,76 @@ function isCliLoginAvailable() {
2557
2584
  if (cachedCliLogin === void 0) return void 0;
2558
2585
  return cachedCliLogin !== false;
2559
2586
  }
2587
+ function emitAuthResolved(onEvent, mechanism) {
2588
+ if (onEvent) {
2589
+ emitOnce(onEvent, {
2590
+ type: "auth_resolved",
2591
+ payload: { mechanism },
2592
+ timestamp: Date.now()
2593
+ });
2594
+ }
2595
+ }
2596
+ async function getActiveCredentialsFromCli(baseUrl) {
2597
+ const cliLogin = await getCliLogin();
2598
+ return cliLogin?.getActiveCredentials?.({ baseUrl });
2599
+ }
2600
+ async function getStoredClientCredentialsFromCli(baseUrl) {
2601
+ const cliLogin = await getCliLogin();
2602
+ return cliLogin?.getStoredClientCredentials?.({ baseUrl });
2603
+ }
2560
2604
  async function getTokenFromCliLogin(options) {
2561
2605
  const cliLogin = await getCliLogin();
2562
2606
  if (!cliLogin) return void 0;
2563
2607
  return await cliLogin.getToken(options);
2564
2608
  }
2609
+ async function tryStoredClientCredentialToken(options) {
2610
+ const activeCredential = await getActiveCredentialsFromCli(options.baseUrl);
2611
+ if (!activeCredential) return void 0;
2612
+ const resolvedBaseUrl = activeCredential.baseUrl || options.baseUrl || DEFAULT_AUTH_BASE_URL;
2613
+ const mergedScopes = mergeScopes(
2614
+ activeCredential.scopes.join(" "),
2615
+ options.requiredScopes
2616
+ );
2617
+ const cacheKey = buildCacheKey({
2618
+ clientId: activeCredential.clientId,
2619
+ scopes: mergedScopes,
2620
+ baseUrl: resolvedBaseUrl
2621
+ });
2622
+ const cache = await resolveCache(options);
2623
+ const pending = pendingExchanges.get(cacheKey);
2624
+ if (pending) return pending;
2625
+ const cached = await readCachedToken(cacheKey, cache);
2626
+ if (cached !== void 0) {
2627
+ if (options.debug)
2628
+ console.log(
2629
+ `[auth] Using cached token (clientId: ${activeCredential.clientId})`
2630
+ );
2631
+ emitAuthResolved(options.onEvent, "client_credentials");
2632
+ return cached;
2633
+ }
2634
+ const storedCredential = await getStoredClientCredentialsFromCli(resolvedBaseUrl);
2635
+ if (!storedCredential) {
2636
+ await invalidateCachedToken({
2637
+ clientId: activeCredential.clientId,
2638
+ scopes: activeCredential.scopes,
2639
+ baseUrl: resolvedBaseUrl,
2640
+ cache: options.cache
2641
+ });
2642
+ throw new ZapierAuthenticationError(
2643
+ `Stored client credential is missing its secret (clientId: ${activeCredential.clientId}). Run \`zapier-sdk login\` to recreate it.`
2644
+ );
2645
+ }
2646
+ if (options.debug)
2647
+ console.log(
2648
+ `[auth] Using stored client credential (clientId: ${storedCredential.clientId})`
2649
+ );
2650
+ const token = await resolveAuthTokenFromCredentials(
2651
+ storedCredential,
2652
+ options
2653
+ );
2654
+ emitAuthResolved(options.onEvent, "client_credentials");
2655
+ return token;
2656
+ }
2565
2657
  async function resolveAuthToken(options = {}) {
2566
2658
  const credentials = await resolveCredentials({
2567
2659
  credentials: options.credentials,
@@ -2571,14 +2663,24 @@ async function resolveAuthToken(options = {}) {
2571
2663
  if (credentials !== void 0) {
2572
2664
  return resolveAuthTokenFromCredentials(credentials, options);
2573
2665
  }
2574
- return getTokenFromCliLogin({
2666
+ const storedToken = await tryStoredClientCredentialToken(options);
2667
+ if (storedToken !== void 0) return storedToken;
2668
+ if (options.debug) {
2669
+ console.log("[auth] Using JWT (no stored client credential found)");
2670
+ }
2671
+ const jwtToken = await getTokenFromCliLogin({
2575
2672
  onEvent: options.onEvent,
2576
2673
  fetch: options.fetch,
2577
2674
  debug: options.debug
2578
2675
  });
2676
+ if (jwtToken !== void 0) {
2677
+ emitAuthResolved(options.onEvent, "jwt");
2678
+ }
2679
+ return jwtToken;
2579
2680
  }
2580
2681
  async function resolveAuthTokenFromCredentials(credentials, options) {
2581
2682
  if (typeof credentials === "string") {
2683
+ emitAuthResolved(options.onEvent, "token");
2582
2684
  return credentials;
2583
2685
  }
2584
2686
  if (isClientCredentials(credentials)) {
@@ -2591,15 +2693,25 @@ async function resolveAuthTokenFromCredentials(credentials, options) {
2591
2693
  baseUrl: resolvedBaseUrl
2592
2694
  });
2593
2695
  const cache = await resolveCache(options);
2594
- const cached = await cache.get(cacheKey);
2595
- if (cached && entryIsValid(cached)) {
2596
- return cached.value;
2696
+ const cached = await readCachedToken(cacheKey, cache);
2697
+ if (cached !== void 0) {
2698
+ if (options.debug) {
2699
+ console.log(`[auth] Using cached token (clientId: ${clientId})`);
2700
+ }
2701
+ return cached;
2597
2702
  }
2598
2703
  const pending = pendingExchanges.get(cacheKey);
2599
2704
  if (pending) return pending;
2600
2705
  const runLocked = async () => {
2601
- const recheck = await cache.get(cacheKey);
2602
- if (recheck && entryIsValid(recheck)) return recheck.value;
2706
+ const recheck = await readCachedToken(cacheKey, cache);
2707
+ if (recheck !== void 0) {
2708
+ if (options.debug) {
2709
+ console.log(
2710
+ `[auth] Using cached token (clientId: ${clientId}, locked recheck)`
2711
+ );
2712
+ }
2713
+ return recheck;
2714
+ }
2603
2715
  const { accessToken, expiresIn } = await exchangeClientCredentials({
2604
2716
  clientId: credentials.clientId,
2605
2717
  clientSecret: credentials.clientSecret,
@@ -2657,7 +2769,7 @@ async function invalidateCredentialsToken(options) {
2657
2769
  }
2658
2770
 
2659
2771
  // src/sdk-version.ts
2660
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.50.0" : void 0) || "unknown";
2772
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.51.0" : void 0) || "unknown";
2661
2773
 
2662
2774
  // src/utils/open-url.ts
2663
2775
  var nodePrefix = "node:";
@@ -3238,7 +3350,9 @@ var ZapierApiClient = class {
3238
3350
  if (data && typeof data === "object") {
3239
3351
  headers["Content-Type"] = "application/json";
3240
3352
  }
3241
- const wasMissingAuthToken = options.authRequired && await this.getAuthToken({ requiredScopes: options.requiredScopes }) == null;
3353
+ const wasMissingAuthToken = options.authRequired && await this.getAuthToken({
3354
+ requiredScopes: options.requiredScopes
3355
+ }) == null;
3242
3356
  const response = await this.fetch(path, {
3243
3357
  ...options,
3244
3358
  method,
@@ -3432,6 +3546,28 @@ var createZapierApi = (options) => {
3432
3546
  });
3433
3547
  };
3434
3548
 
3549
+ // src/api/index.ts
3550
+ function getOrCreateApiClient(config) {
3551
+ const {
3552
+ baseUrl = ZAPIER_BASE_URL,
3553
+ credentials,
3554
+ token,
3555
+ api: providedApi,
3556
+ debug = false,
3557
+ fetch: customFetch
3558
+ } = config;
3559
+ if (providedApi) {
3560
+ return providedApi;
3561
+ }
3562
+ return createZapierApi({
3563
+ baseUrl,
3564
+ credentials,
3565
+ token,
3566
+ debug,
3567
+ fetch: customFetch
3568
+ });
3569
+ }
3570
+
3435
3571
  // src/plugins/api/index.ts
3436
3572
  var apiPlugin = definePlugin(
3437
3573
  (sdk) => {
@@ -10199,4 +10335,4 @@ function createZapierSdk2(options = {}) {
10199
10335
  return createSdk().addPlugin(createOptionsPlugin(options)).addPlugin(eventEmissionPlugin).addPlugin(apiPlugin).addPlugin(manifestPlugin).addPlugin(capabilitiesPlugin).addPlugin(connectionsPlugin).addPlugin(listAppsPlugin).addPlugin(getAppPlugin).addPlugin(listActionsPlugin).addPlugin(getActionPlugin).addPlugin(listActionInputFieldsPlugin).addPlugin(getActionInputFieldsSchemaPlugin).addPlugin(listActionInputFieldChoicesPlugin).addPlugin(listInputFieldsDeprecatedPlugin).addPlugin(getInputFieldsSchemaDeprecatedPlugin).addPlugin(listInputFieldChoicesDeprecatedPlugin).addPlugin(runActionPlugin).addPlugin(listConnectionsPlugin).addPlugin(getConnectionPlugin).addPlugin(findFirstConnectionPlugin).addPlugin(findUniqueConnectionPlugin).addPlugin(listAuthenticationsPlugin).addPlugin(getAuthenticationPlugin).addPlugin(findFirstAuthenticationPlugin).addPlugin(findUniqueAuthenticationPlugin).addPlugin(listClientCredentialsPlugin).addPlugin(createClientCredentialsPlugin).addPlugin(deleteClientCredentialsPlugin).addPlugin(fetchPlugin).addPlugin(requestPlugin).addPlugin(createTriggerInboxPlugin).addPlugin(ensureTriggerInboxPlugin).addPlugin(listTriggerInboxesPlugin).addPlugin(getTriggerInboxPlugin).addPlugin(updateTriggerInboxPlugin).addPlugin(deleteTriggerInboxPlugin).addPlugin(pauseTriggerInboxPlugin).addPlugin(resumeTriggerInboxPlugin).addPlugin(listTriggerInboxMessagesPlugin).addPlugin(leaseTriggerInboxMessagesPlugin).addPlugin(ackTriggerInboxMessagesPlugin).addPlugin(releaseTriggerInboxMessagesPlugin).addPlugin(drainTriggerInboxPlugin).addPlugin(watchTriggerInboxPlugin).addPlugin(listTriggerInputFieldsPlugin).addPlugin(listTriggerInputFieldChoicesPlugin).addPlugin(getTriggerInputFieldsSchemaPlugin).addPlugin(listTablesPlugin).addPlugin(getTablePlugin).addPlugin(deleteTablePlugin).addPlugin(createTablePlugin).addPlugin(listTableFieldsPlugin).addPlugin(createTableFieldsPlugin).addPlugin(deleteTableFieldsPlugin).addPlugin(getTableRecordPlugin).addPlugin(listTableRecordsPlugin).addPlugin(createTableRecordsPlugin).addPlugin(deleteTableRecordsPlugin).addPlugin(updateTableRecordsPlugin).addPlugin(appsPlugin).addPlugin(getProfilePlugin);
10200
10336
  }
10201
10337
 
10202
- export { ActionKeyPropertySchema, ActionPropertySchema, ActionTimeoutMsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AppPropertySchema, AppsPropertySchema, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, CONTEXT_CACHE_MAX_SIZE, CONTEXT_CACHE_TTL_MS, ClientCredentialsObjectSchema, ConnectionEntrySchema, ConnectionIdPropertySchema, ConnectionPropertySchema, ConnectionsMapSchema, ConnectionsPropertySchema, CredentialsFunctionSchema, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MS, DEFAULT_APPROVAL_TIMEOUT_MS, DEFAULT_CONFIG_PATH, DEFAULT_MAX_APPROVAL_RETRIES, DEFAULT_PAGE_SIZE, DebugPropertySchema, FieldsPropertySchema, InputFieldPropertySchema, InputsPropertySchema, LeaseLimitPropertySchema, LeasePropertySchema, LeaseSecondsPropertySchema, LimitPropertySchema, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RecordPropertySchema, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, TablePropertySchema, TablesPropertySchema, TriggerInboxNamePropertySchema, TriggerInboxPropertySchema, ZAPIER_BASE_URL, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, ZapierAbortDrainSignal, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierApprovalError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierConflictError, ZapierError, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierReleaseTriggerMessageSignal, ZapierResourceNotFoundError, ZapierSignal, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, connectionIdGenericResolver as authenticationIdGenericResolver, connectionIdResolver as authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, composePlugins, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, createBaseEvent, createClientCredentialsPlugin, createFunction, createMemoryCache, createOptionsPlugin, createPaginatedPluginMethod, createPluginMethod, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierSdk2 as createZapierSdk, createZapierSdkWithoutRegistry, definePlugin, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, generateEventId, getActionInputFieldsSchemaPlugin, getActionPlugin, getAppPlugin, getBaseUrlFromCredentials, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, getZapierApprovalMode, getZapierSdkService, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCredentialsFunction, isCredentialsObject, isPkceCredentials, isPositional, listActionInputFieldChoicesPlugin, listActionInputFieldsPlugin, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listTableFieldsPlugin, listTableRecordsPlugin, listTablesPlugin, logDeprecation, manifestPlugin, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, runWithTelemetryContext, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, triggerInboxResolver, updateTableRecordsPlugin };
10338
+ export { ActionKeyPropertySchema, ActionPropertySchema, ActionTimeoutMsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AppPropertySchema, AppsPropertySchema, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, CONTEXT_CACHE_MAX_SIZE, CONTEXT_CACHE_TTL_MS, ClientCredentialsObjectSchema, ConnectionEntrySchema, ConnectionIdPropertySchema, ConnectionPropertySchema, ConnectionsMapSchema, ConnectionsPropertySchema, CredentialsFunctionSchema, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MS, DEFAULT_APPROVAL_TIMEOUT_MS, DEFAULT_CONFIG_PATH, DEFAULT_MAX_APPROVAL_RETRIES, DEFAULT_PAGE_SIZE, DebugPropertySchema, FieldsPropertySchema, InputFieldPropertySchema, InputsPropertySchema, LeaseLimitPropertySchema, LeasePropertySchema, LeaseSecondsPropertySchema, LimitPropertySchema, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RecordPropertySchema, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, TablePropertySchema, TablesPropertySchema, TriggerInboxNamePropertySchema, TriggerInboxPropertySchema, ZAPIER_BASE_URL, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, ZapierAbortDrainSignal, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierApprovalError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierConflictError, ZapierError, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierReleaseTriggerMessageSignal, ZapierResourceNotFoundError, ZapierSignal, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, connectionIdGenericResolver as authenticationIdGenericResolver, connectionIdResolver as authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, composePlugins, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, createBaseEvent, createClientCredentialsPlugin, createFunction, createMemoryCache, createOptionsPlugin, createPaginatedPluginMethod, createPluginMethod, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierApi, createZapierSdk2 as createZapierSdk, createZapierSdkWithoutRegistry, definePlugin, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, generateEventId, getActionInputFieldsSchemaPlugin, getActionPlugin, getAppPlugin, getBaseUrlFromCredentials, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOrCreateApiClient, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, getZapierApprovalMode, getZapierSdkService, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCredentialsFunction, isCredentialsObject, isPkceCredentials, isPositional, listActionInputFieldChoicesPlugin, listActionInputFieldsPlugin, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listTableFieldsPlugin, listTableRecordsPlugin, listTablesPlugin, logDeprecation, manifestPlugin, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, runWithTelemetryContext, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, triggerInboxResolver, updateTableRecordsPlugin };
@@ -677,6 +677,69 @@ declare const NeedsResponseSchema: z.ZodObject<{
677
677
  * to ensure a single source of truth and eliminate duplication.
678
678
  */
679
679
 
680
+ interface ApiClientOptions {
681
+ baseUrl: string;
682
+ /**
683
+ * Authentication credentials.
684
+ */
685
+ credentials?: Credentials;
686
+ /**
687
+ * @deprecated Use `credentials` instead.
688
+ */
689
+ token?: string;
690
+ debug?: boolean;
691
+ fetch?: typeof globalThis.fetch;
692
+ onEvent?: (event: SdkEvent) => void;
693
+ /**
694
+ * Maximum number of retries for rate-limited requests (429 responses).
695
+ * Set to 0 to disable retries. Default is 3.
696
+ */
697
+ maxNetworkRetries?: number;
698
+ /**
699
+ * Maximum delay in milliseconds to wait for a rate limit retry.
700
+ * If the server requests a longer delay, the request fails immediately.
701
+ * Default is 60000 (60 seconds).
702
+ */
703
+ maxNetworkRetryDelayMs?: number;
704
+ /**
705
+ * Controls how the approval flow is handled.
706
+ * - "disabled": (default when env var is unset) Throw a ZapierApprovalError
707
+ * on approval-required responses without creating an approval.
708
+ * - "poll": Create the approval, open the URL in a browser, poll until
709
+ * resolved, and retry the original request on success.
710
+ * - "throw": Create the approval and throw a ZapierApprovalError immediately
711
+ * with the approval URL so the caller can surface it.
712
+ * Defaults to the ZAPIER_APPROVAL_MODE env var, then "disabled".
713
+ */
714
+ approvalMode?: "disabled" | "poll" | "throw";
715
+ /**
716
+ * Timeout in ms for approval polling. Default: 600000 (10 minutes).
717
+ */
718
+ approvalTimeoutMs?: number;
719
+ /**
720
+ * Maximum number of sequential approval rounds for a single request before
721
+ * giving up. A single request can legitimately require multiple approvals
722
+ * (one per gating policy); this cap prevents a runaway loop if the server
723
+ * keeps returning approval_required. Default: 2.
724
+ */
725
+ maxApprovalRetries?: number;
726
+ /**
727
+ * Identifies the wrapping package that built this client (e.g., the CLI or
728
+ * MCP server). When set, emitted as `x-zapier-sdk-package` /
729
+ * `x-zapier-sdk-package-version` telemetry headers. Omitted by direct
730
+ * `createZapierSdk` callers — their identity is captured by
731
+ * `x-zapier-sdk-version` alone.
732
+ */
733
+ callerPackage?: {
734
+ name: string;
735
+ version: string;
736
+ };
737
+ /**
738
+ * Pluggable key-value cache used to cache access tokens across
739
+ * invocations. See ZapierCache in ../cache.ts.
740
+ */
741
+ cache?: ZapierCache;
742
+ }
680
743
  interface ApiClient {
681
744
  get: <T = unknown>(path: string, options?: RequestOptions) => Promise<T>;
682
745
  post: <T = unknown>(path: string, data?: unknown, options?: RequestOptions) => Promise<T>;
@@ -848,6 +911,39 @@ interface CapabilitiesContext {
848
911
  hasCapability: (key: GatedFlag) => Promise<boolean>;
849
912
  }
850
913
 
914
+ /**
915
+ * API Client Implementation
916
+ *
917
+ * This module contains the core API client implementation, including
918
+ * HTTP method handlers, response processing, and client factory functions.
919
+ */
920
+
921
+ declare const createZapierApi: (options: ApiClientOptions) => ApiClient;
922
+
923
+ /**
924
+ * Zapier API Client Module
925
+ *
926
+ * This module provides a centralized API layer for all HTTP interactions
927
+ * with Zapier's various APIs. It handles authentication, error handling,
928
+ * polling, and provides consistent patterns across all services.
929
+ */
930
+
931
+ /**
932
+ * Utility function to get or create an API client for standalone functions
933
+ *
934
+ * @param config - Configuration that may include an existing API client
935
+ * @returns ApiClient instance
936
+ */
937
+ declare function getOrCreateApiClient(config: {
938
+ baseUrl?: string;
939
+ credentials?: Credentials;
940
+ /** @deprecated Use `credentials` instead */
941
+ token?: string;
942
+ api?: ApiClient;
943
+ debug?: boolean;
944
+ fetch?: typeof globalThis.fetch;
945
+ }): ApiClient;
946
+
851
947
  /**
852
948
  * Event emission types matching Avro schemas for SDK telemetry
853
949
  *
@@ -8493,7 +8589,18 @@ interface CliLoginOptions {
8493
8589
  };
8494
8590
  debug?: boolean;
8495
8591
  }
8496
- type CliLoginModule = typeof _zapier_zapier_sdk_cli_login;
8592
+ type CliLoginModule = typeof _zapier_zapier_sdk_cli_login & {
8593
+ getActiveCredentials?: (options?: {
8594
+ baseUrl?: string;
8595
+ }) => {
8596
+ clientId: string;
8597
+ scopes: string[];
8598
+ baseUrl?: string;
8599
+ } | undefined;
8600
+ getStoredClientCredentials?: (options?: {
8601
+ baseUrl?: string;
8602
+ }) => Promise<ClientCredentialsObject | undefined>;
8603
+ };
8497
8604
  /**
8498
8605
  * Inject an already-loaded CLI login module so the SDK skips its dynamic import.
8499
8606
  * This guarantees CLI and SDK share the same module instance in the same process.
@@ -9535,4 +9642,4 @@ declare const registryPlugin: (sdk: {
9535
9642
  };
9536
9643
  }) => {};
9537
9644
 
9538
- export { type Resolver as $, type ApiClient as A, type BaseSdkOptions as B, type CapabilitiesContext as C, type DrainTriggerInboxOptions as D, type EventEmissionContext as E, type FieldsetItem as F, type GetAuthenticationPluginProvides as G, type ActionFieldChoice as H, type NeedsRequest as I, type NeedsResponse as J, type Connection as K, type LeasedTriggerMessageItem as L, type Manifest as M, type Need as N, type ConnectionsResponse as O, type PluginMeta as P, type UserProfile as Q, type ResolvedAppLocator as R, isPositional as S, type TriggerMessageStatus as T, type UpdateManifestEntryOptions as U, createFunction as V, type WithAddPlugin as W, type FormattedItem as X, type FormatMetadata as Y, type ZapierSdkOptions as Z, type OutputFormatter as _, type UpdateManifestEntryResult as a, AppPropertySchema as a$, type ArrayResolver as a0, type ResolverMetadata as a1, type StaticResolver as a2, type FieldsResolver as a3, runWithTelemetryContext as a4, toSnakeCase as a5, toTitleCase as a6, batch as a7, type BatchOptions as a8, buildCapabilityMessage as a9, type EnhancedErrorEventData as aA, type MethodCalledEventData as aB, generateEventId as aC, getCurrentTimestamp as aD, getReleaseId as aE, getOsInfo as aF, getPlatformVersions as aG, isCi as aH, getCiPlatform as aI, getMemoryUsage as aJ, getCpuTime as aK, buildApplicationLifecycleEvent as aL, buildErrorEventWithContext as aM, buildErrorEvent as aN, createBaseEvent as aO, buildMethodCalledEvent as aP, type AppItem as aQ, type ConnectionItem as aR, type ActionItem$1 as aS, type InputFieldItem as aT, type InfoFieldItem as aU, type RootFieldItem as aV, type UserProfileItem as aW, type FunctionOptions as aX, type SdkPage as aY, type PaginatedSdkFunction as aZ, AppKeyPropertySchema as a_, logDeprecation as aa, resetDeprecationWarnings as ab, RelayRequestSchema as ac, RelayFetchSchema as ad, createZapierSdkWithoutRegistry as ae, createSdk as af, createOptionsPlugin as ag, type FunctionRegistryEntry as ah, type FunctionDeprecation as ai, BaseSdkOptionsSchema as aj, type Plugin as ak, type PluginProvides as al, definePlugin as am, createPluginMethod as an, createPaginatedPluginMethod as ao, composePlugins as ap, type ActionItem as aq, type ActionTypeItem as ar, type RequestOptions as as, type PollOptions as at, registryPlugin as au, type BaseEvent as av, type MethodCalledEvent as aw, type EventEmissionProvides as ax, type EventContext as ay, type ApplicationLifecycleEventData as az, type AddActionEntryOptions as b, ZapierResourceNotFoundError as b$, ActionTypePropertySchema as b0, ActionKeyPropertySchema as b1, ActionPropertySchema as b2, InputFieldPropertySchema as b3, ConnectionIdPropertySchema as b4, AuthenticationIdPropertySchema as b5, ConnectionPropertySchema as b6, InputsPropertySchema as b7, LimitPropertySchema as b8, OffsetPropertySchema as b9, type LimitProperty as bA, type OffsetProperty as bB, type OutputProperty as bC, type DebugProperty as bD, type ParamsProperty as bE, type ActionTimeoutMsProperty as bF, type TableProperty as bG, type RecordProperty as bH, type RecordsProperty as bI, type FieldsProperty as bJ, type AppsProperty as bK, type TablesProperty as bL, type ConnectionsProperty as bM, type TriggerInboxProperty as bN, type TriggerInboxNameProperty as bO, type LeaseProperty as bP, type LeaseSecondsProperty as bQ, type LeaseLimitProperty as bR, type ApiError as bS, type ErrorOptions as bT, ZapierError as bU, ZapierApiError as bV, ZapierAppNotFoundError as bW, ZapierValidationError as bX, ZapierUnknownError as bY, ZapierAuthenticationError as bZ, ZapierNotFoundError as b_, OutputPropertySchema as ba, DebugPropertySchema as bb, ParamsPropertySchema as bc, ActionTimeoutMsPropertySchema as bd, TablePropertySchema as be, RecordPropertySchema as bf, RecordsPropertySchema as bg, FieldsPropertySchema as bh, AppsPropertySchema as bi, TablesPropertySchema as bj, ConnectionsPropertySchema as bk, TriggerInboxPropertySchema as bl, TriggerInboxNamePropertySchema as bm, LeasePropertySchema as bn, LeaseSecondsPropertySchema as bo, LeaseLimitPropertySchema as bp, type AppKeyProperty as bq, type AppProperty as br, type ActionTypeProperty as bs, type ActionKeyProperty as bt, type ActionProperty as bu, type InputFieldProperty as bv, type ConnectionIdProperty as bw, type ConnectionProperty as bx, type AuthenticationIdProperty as by, type InputsProperty as bz, type AddActionEntryResult as c, appKeyResolver as c$, ZapierConfigurationError as c0, ZapierBundleError as c1, ZapierTimeoutError as c2, ZapierActionError as c3, ZapierConflictError as c4, type RateLimitInfo as c5, ZapierRateLimitError as c6, type ApprovalStatus as c7, ZapierApprovalError as c8, ZapierRelayError as c9, getAppPlugin as cA, type GetAppPluginProvides as cB, getActionPlugin as cC, type GetActionPluginProvides as cD, getConnectionPlugin as cE, type GetConnectionPluginProvides as cF, findFirstConnectionPlugin as cG, type FindFirstConnectionPluginProvides as cH, findUniqueConnectionPlugin as cI, type FindUniqueConnectionPluginProvides as cJ, CONTEXT_CACHE_TTL_MS as cK, CONTEXT_CACHE_MAX_SIZE as cL, runActionPlugin as cM, type RunActionPluginProvides as cN, requestPlugin as cO, type RequestPluginProvides as cP, type ManifestPluginOptions as cQ, getPreferredManifestEntryKey as cR, manifestPlugin as cS, type ManifestPluginProvides as cT, DEFAULT_CONFIG_PATH as cU, type ManifestEntry as cV, getProfilePlugin as cW, type GetProfilePluginProvides as cX, type ApiPluginOptions as cY, apiPlugin as cZ, type ApiPluginProvides as c_, formatErrorMessage as ca, ZapierSignal as cb, appsPlugin as cc, type AppsPluginProvides as cd, type ActionExecutionOptions as ce, type AppFactoryInput as cf, fetchPlugin as cg, type FetchPluginProvides as ch, listAppsPlugin as ci, type ListAppsPluginProvides as cj, listActionsPlugin as ck, type ListActionsPluginProvides as cl, listActionInputFieldsPlugin as cm, type ListActionInputFieldsPluginProvides as cn, listActionInputFieldChoicesPlugin as co, type ListActionInputFieldChoicesPluginProvides as cp, getActionInputFieldsSchemaPlugin as cq, type GetActionInputFieldsSchemaPluginProvides as cr, listConnectionsPlugin as cs, type ListConnectionsPluginProvides as ct, listClientCredentialsPlugin as cu, type ListClientCredentialsPluginProvides as cv, createClientCredentialsPlugin as cw, type CreateClientCredentialsPluginProvides as cx, deleteClientCredentialsPlugin as cy, type DeleteClientCredentialsPluginProvides as cz, type ActionEntry as d, connectionsPlugin as d$, actionTypeResolver as d0, actionKeyResolver as d1, connectionIdResolver as d2, connectionIdGenericResolver as d3, inputsResolver as d4, inputsAllOptionalResolver as d5, inputFieldKeyResolver as d6, clientCredentialsNameResolver as d7, clientIdResolver as d8, tableIdResolver as d9, type LoadingEvent as dA, type EventCallback as dB, type Credentials as dC, type ResolvedCredentials as dD, type CredentialsObject as dE, type ClientCredentialsObject as dF, type PkceCredentialsObject as dG, isClientCredentials as dH, isPkceCredentials as dI, isCredentialsObject as dJ, isCredentialsFunction as dK, type ResolveCredentialsOptions as dL, resolveCredentialsFromEnv as dM, resolveCredentials as dN, getBaseUrlFromCredentials as dO, getClientIdFromCredentials as dP, ClientCredentialsObjectSchema as dQ, PkceCredentialsObjectSchema as dR, CredentialsObjectSchema as dS, ResolvedCredentialsSchema as dT, CredentialsFunctionSchema as dU, type CredentialsFunction as dV, CredentialsSchema as dW, ConnectionEntrySchema as dX, type ConnectionEntry as dY, ConnectionsMapSchema as dZ, type ConnectionsMap as d_, triggerInboxResolver as da, tableRecordIdResolver as db, tableRecordIdsResolver as dc, tableFieldIdsResolver as dd, tableNameResolver as de, tableFieldsResolver as df, tableRecordsResolver as dg, tableUpdateRecordsResolver as dh, tableFiltersResolver as di, tableSortResolver as dj, type ResolveAuthTokenOptions as dk, clearTokenCache as dl, invalidateCachedToken as dm, injectCliLogin as dn, isCliLoginAvailable as dp, getTokenFromCliLogin as dq, resolveAuthToken as dr, invalidateCredentialsToken as ds, type ZapierCache as dt, type ZapierCacheEntry as du, type ZapierCacheSetOptions as dv, createMemoryCache as dw, type SdkEvent as dx, type AuthEvent as dy, type ApiEvent as dz, type PaginatedSdkResult as e, type ConnectionsPluginProvides as e0, ZAPIER_BASE_URL as e1, getZapierSdkService as e2, MAX_PAGE_LIMIT as e3, DEFAULT_PAGE_SIZE as e4, DEFAULT_ACTION_TIMEOUT_MS as e5, ZAPIER_MAX_NETWORK_RETRIES as e6, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS as e7, getZapierApprovalMode as e8, DEFAULT_APPROVAL_TIMEOUT_MS as e9, type ZapierSdk as eA, DEFAULT_MAX_APPROVAL_RETRIES as ea, listTablesPlugin as eb, type ListTablesPluginProvides as ec, getTablePlugin as ed, type GetTablePluginProvides as ee, createTablePlugin as ef, type CreateTablePluginProvides as eg, deleteTablePlugin as eh, type DeleteTablePluginProvides as ei, listTableFieldsPlugin as ej, type ListTableFieldsPluginProvides as ek, createTableFieldsPlugin as el, type CreateTableFieldsPluginProvides as em, deleteTableFieldsPlugin as en, type DeleteTableFieldsPluginProvides as eo, getTableRecordPlugin as ep, type GetTableRecordPluginProvides as eq, listTableRecordsPlugin as er, type ListTableRecordsPluginProvides as es, createTableRecordsPlugin as et, type CreateTableRecordsPluginProvides as eu, deleteTableRecordsPlugin as ev, type DeleteTableRecordsPluginProvides as ew, updateTableRecordsPlugin as ex, type UpdateTableRecordsPluginProvides as ey, createZapierSdk as ez, findManifestEntry as f, type PositionalMetadata as g, type ZapierFetchInitOptions as h, type DynamicResolver as i, type WatchTriggerInboxOptions as j, type ActionProxy as k, type ZapierSdkApps as l, ZapierAbortDrainSignal as m, ZapierReleaseTriggerMessageSignal as n, type DrainTriggerInboxCallback as o, type DrainTriggerInboxErrorObserver as p, type ListAuthenticationsPluginProvides as q, readManifestFromFile as r, type FindFirstAuthenticationPluginProvides as s, type FindUniqueAuthenticationPluginProvides as t, type Action as u, type App as v, type Field as w, type Choice as x, type ActionExecutionResult as y, type ActionField as z };
9645
+ export { type Resolver as $, type ApiClient as A, type BaseSdkOptions as B, type CapabilitiesContext as C, type DrainTriggerInboxOptions as D, type EventEmissionContext as E, type FieldsetItem as F, type GetAuthenticationPluginProvides as G, type ActionFieldChoice as H, type NeedsRequest as I, type NeedsResponse as J, type Connection as K, type LeasedTriggerMessageItem as L, type Manifest as M, type Need as N, type ConnectionsResponse as O, type PluginMeta as P, type UserProfile as Q, type ResolvedAppLocator as R, isPositional as S, type TriggerMessageStatus as T, type UpdateManifestEntryOptions as U, createFunction as V, type WithAddPlugin as W, type FormattedItem as X, type FormatMetadata as Y, type ZapierSdkOptions as Z, type OutputFormatter as _, type UpdateManifestEntryResult as a, type PaginatedSdkFunction as a$, type ArrayResolver as a0, type ResolverMetadata as a1, type StaticResolver as a2, type FieldsResolver as a3, runWithTelemetryContext as a4, toSnakeCase as a5, toTitleCase as a6, batch as a7, type BatchOptions as a8, buildCapabilityMessage as a9, type EventContext as aA, type ApplicationLifecycleEventData as aB, type EnhancedErrorEventData as aC, type MethodCalledEventData as aD, generateEventId as aE, getCurrentTimestamp as aF, getReleaseId as aG, getOsInfo as aH, getPlatformVersions as aI, isCi as aJ, getCiPlatform as aK, getMemoryUsage as aL, getCpuTime as aM, buildApplicationLifecycleEvent as aN, buildErrorEventWithContext as aO, buildErrorEvent as aP, createBaseEvent as aQ, buildMethodCalledEvent as aR, type AppItem as aS, type ConnectionItem as aT, type ActionItem$1 as aU, type InputFieldItem as aV, type InfoFieldItem as aW, type RootFieldItem as aX, type UserProfileItem as aY, type FunctionOptions as aZ, type SdkPage as a_, logDeprecation as aa, resetDeprecationWarnings as ab, RelayRequestSchema as ac, RelayFetchSchema as ad, createZapierSdkWithoutRegistry as ae, createSdk as af, createOptionsPlugin as ag, type FunctionRegistryEntry as ah, type FunctionDeprecation as ai, BaseSdkOptionsSchema as aj, type Plugin as ak, type PluginProvides as al, definePlugin as am, createPluginMethod as an, createPaginatedPluginMethod as ao, composePlugins as ap, type ActionItem as aq, type ActionTypeItem as ar, registryPlugin as as, type RequestOptions as at, type PollOptions as au, createZapierApi as av, getOrCreateApiClient as aw, type BaseEvent as ax, type MethodCalledEvent as ay, type EventEmissionProvides as az, type AddActionEntryOptions as b, ZapierAuthenticationError as b$, AppKeyPropertySchema as b0, AppPropertySchema as b1, ActionTypePropertySchema as b2, ActionKeyPropertySchema as b3, ActionPropertySchema as b4, InputFieldPropertySchema as b5, ConnectionIdPropertySchema as b6, AuthenticationIdPropertySchema as b7, ConnectionPropertySchema as b8, InputsPropertySchema as b9, type AuthenticationIdProperty as bA, type InputsProperty as bB, type LimitProperty as bC, type OffsetProperty as bD, type OutputProperty as bE, type DebugProperty as bF, type ParamsProperty as bG, type ActionTimeoutMsProperty as bH, type TableProperty as bI, type RecordProperty as bJ, type RecordsProperty as bK, type FieldsProperty as bL, type AppsProperty as bM, type TablesProperty as bN, type ConnectionsProperty as bO, type TriggerInboxProperty as bP, type TriggerInboxNameProperty as bQ, type LeaseProperty as bR, type LeaseSecondsProperty as bS, type LeaseLimitProperty as bT, type ApiError as bU, type ErrorOptions as bV, ZapierError as bW, ZapierApiError as bX, ZapierAppNotFoundError as bY, ZapierValidationError as bZ, ZapierUnknownError as b_, LimitPropertySchema as ba, OffsetPropertySchema as bb, OutputPropertySchema as bc, DebugPropertySchema as bd, ParamsPropertySchema as be, ActionTimeoutMsPropertySchema as bf, TablePropertySchema as bg, RecordPropertySchema as bh, RecordsPropertySchema as bi, FieldsPropertySchema as bj, AppsPropertySchema as bk, TablesPropertySchema as bl, ConnectionsPropertySchema as bm, TriggerInboxPropertySchema as bn, TriggerInboxNamePropertySchema as bo, LeasePropertySchema as bp, LeaseSecondsPropertySchema as bq, LeaseLimitPropertySchema as br, type AppKeyProperty as bs, type AppProperty as bt, type ActionTypeProperty as bu, type ActionKeyProperty as bv, type ActionProperty as bw, type InputFieldProperty as bx, type ConnectionIdProperty as by, type ConnectionProperty as bz, type AddActionEntryResult as c, apiPlugin as c$, ZapierNotFoundError as c0, ZapierResourceNotFoundError as c1, ZapierConfigurationError as c2, ZapierBundleError as c3, ZapierTimeoutError as c4, ZapierActionError as c5, ZapierConflictError as c6, type RateLimitInfo as c7, ZapierRateLimitError as c8, type ApprovalStatus as c9, deleteClientCredentialsPlugin as cA, type DeleteClientCredentialsPluginProvides as cB, getAppPlugin as cC, type GetAppPluginProvides as cD, getActionPlugin as cE, type GetActionPluginProvides as cF, getConnectionPlugin as cG, type GetConnectionPluginProvides as cH, findFirstConnectionPlugin as cI, type FindFirstConnectionPluginProvides as cJ, findUniqueConnectionPlugin as cK, type FindUniqueConnectionPluginProvides as cL, CONTEXT_CACHE_TTL_MS as cM, CONTEXT_CACHE_MAX_SIZE as cN, runActionPlugin as cO, type RunActionPluginProvides as cP, requestPlugin as cQ, type RequestPluginProvides as cR, type ManifestPluginOptions as cS, getPreferredManifestEntryKey as cT, manifestPlugin as cU, type ManifestPluginProvides as cV, DEFAULT_CONFIG_PATH as cW, type ManifestEntry as cX, getProfilePlugin as cY, type GetProfilePluginProvides as cZ, type ApiPluginOptions as c_, ZapierApprovalError as ca, ZapierRelayError as cb, formatErrorMessage as cc, ZapierSignal as cd, appsPlugin as ce, type AppsPluginProvides as cf, type ActionExecutionOptions as cg, type AppFactoryInput as ch, fetchPlugin as ci, type FetchPluginProvides as cj, listAppsPlugin as ck, type ListAppsPluginProvides as cl, listActionsPlugin as cm, type ListActionsPluginProvides as cn, listActionInputFieldsPlugin as co, type ListActionInputFieldsPluginProvides as cp, listActionInputFieldChoicesPlugin as cq, type ListActionInputFieldChoicesPluginProvides as cr, getActionInputFieldsSchemaPlugin as cs, type GetActionInputFieldsSchemaPluginProvides as ct, listConnectionsPlugin as cu, type ListConnectionsPluginProvides as cv, listClientCredentialsPlugin as cw, type ListClientCredentialsPluginProvides as cx, createClientCredentialsPlugin as cy, type CreateClientCredentialsPluginProvides as cz, type ActionEntry as d, ConnectionsMapSchema as d$, type ApiPluginProvides as d0, appKeyResolver as d1, actionTypeResolver as d2, actionKeyResolver as d3, connectionIdResolver as d4, connectionIdGenericResolver as d5, inputsResolver as d6, inputsAllOptionalResolver as d7, inputFieldKeyResolver as d8, clientCredentialsNameResolver as d9, type AuthEvent as dA, type ApiEvent as dB, type LoadingEvent as dC, type EventCallback as dD, type Credentials as dE, type ResolvedCredentials as dF, type CredentialsObject as dG, type ClientCredentialsObject as dH, type PkceCredentialsObject as dI, isClientCredentials as dJ, isPkceCredentials as dK, isCredentialsObject as dL, isCredentialsFunction as dM, type ResolveCredentialsOptions as dN, resolveCredentialsFromEnv as dO, resolveCredentials as dP, getBaseUrlFromCredentials as dQ, getClientIdFromCredentials as dR, ClientCredentialsObjectSchema as dS, PkceCredentialsObjectSchema as dT, CredentialsObjectSchema as dU, ResolvedCredentialsSchema as dV, CredentialsFunctionSchema as dW, type CredentialsFunction as dX, CredentialsSchema as dY, ConnectionEntrySchema as dZ, type ConnectionEntry as d_, clientIdResolver as da, tableIdResolver as db, triggerInboxResolver as dc, tableRecordIdResolver as dd, tableRecordIdsResolver as de, tableFieldIdsResolver as df, tableNameResolver as dg, tableFieldsResolver as dh, tableRecordsResolver as di, tableUpdateRecordsResolver as dj, tableFiltersResolver as dk, tableSortResolver as dl, type ResolveAuthTokenOptions as dm, clearTokenCache as dn, invalidateCachedToken as dp, injectCliLogin as dq, isCliLoginAvailable as dr, getTokenFromCliLogin as ds, resolveAuthToken as dt, invalidateCredentialsToken as du, type ZapierCache as dv, type ZapierCacheEntry as dw, type ZapierCacheSetOptions as dx, createMemoryCache as dy, type SdkEvent as dz, type PaginatedSdkResult as e, type ConnectionsMap as e0, connectionsPlugin as e1, type ConnectionsPluginProvides as e2, ZAPIER_BASE_URL as e3, getZapierSdkService as e4, MAX_PAGE_LIMIT as e5, DEFAULT_PAGE_SIZE as e6, DEFAULT_ACTION_TIMEOUT_MS as e7, ZAPIER_MAX_NETWORK_RETRIES as e8, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS as e9, type UpdateTableRecordsPluginProvides as eA, createZapierSdk as eB, type ZapierSdk as eC, getZapierApprovalMode as ea, DEFAULT_APPROVAL_TIMEOUT_MS as eb, DEFAULT_MAX_APPROVAL_RETRIES as ec, listTablesPlugin as ed, type ListTablesPluginProvides as ee, getTablePlugin as ef, type GetTablePluginProvides as eg, createTablePlugin as eh, type CreateTablePluginProvides as ei, deleteTablePlugin as ej, type DeleteTablePluginProvides as ek, listTableFieldsPlugin as el, type ListTableFieldsPluginProvides as em, createTableFieldsPlugin as en, type CreateTableFieldsPluginProvides as eo, deleteTableFieldsPlugin as ep, type DeleteTableFieldsPluginProvides as eq, getTableRecordPlugin as er, type GetTableRecordPluginProvides as es, listTableRecordsPlugin as et, type ListTableRecordsPluginProvides as eu, createTableRecordsPlugin as ev, type CreateTableRecordsPluginProvides as ew, deleteTableRecordsPlugin as ex, type DeleteTableRecordsPluginProvides as ey, updateTableRecordsPlugin as ez, findManifestEntry as f, type PositionalMetadata as g, type ZapierFetchInitOptions as h, type DynamicResolver as i, type WatchTriggerInboxOptions as j, type ActionProxy as k, type ZapierSdkApps as l, ZapierAbortDrainSignal as m, ZapierReleaseTriggerMessageSignal as n, type DrainTriggerInboxCallback as o, type DrainTriggerInboxErrorObserver as p, type ListAuthenticationsPluginProvides as q, readManifestFromFile as r, type FindFirstAuthenticationPluginProvides as s, type FindUniqueAuthenticationPluginProvides as t, type Action as u, type App as v, type Field as w, type Choice as x, type ActionExecutionResult as y, type ActionField as z };
@@ -677,6 +677,69 @@ declare const NeedsResponseSchema: z.ZodObject<{
677
677
  * to ensure a single source of truth and eliminate duplication.
678
678
  */
679
679
 
680
+ interface ApiClientOptions {
681
+ baseUrl: string;
682
+ /**
683
+ * Authentication credentials.
684
+ */
685
+ credentials?: Credentials;
686
+ /**
687
+ * @deprecated Use `credentials` instead.
688
+ */
689
+ token?: string;
690
+ debug?: boolean;
691
+ fetch?: typeof globalThis.fetch;
692
+ onEvent?: (event: SdkEvent) => void;
693
+ /**
694
+ * Maximum number of retries for rate-limited requests (429 responses).
695
+ * Set to 0 to disable retries. Default is 3.
696
+ */
697
+ maxNetworkRetries?: number;
698
+ /**
699
+ * Maximum delay in milliseconds to wait for a rate limit retry.
700
+ * If the server requests a longer delay, the request fails immediately.
701
+ * Default is 60000 (60 seconds).
702
+ */
703
+ maxNetworkRetryDelayMs?: number;
704
+ /**
705
+ * Controls how the approval flow is handled.
706
+ * - "disabled": (default when env var is unset) Throw a ZapierApprovalError
707
+ * on approval-required responses without creating an approval.
708
+ * - "poll": Create the approval, open the URL in a browser, poll until
709
+ * resolved, and retry the original request on success.
710
+ * - "throw": Create the approval and throw a ZapierApprovalError immediately
711
+ * with the approval URL so the caller can surface it.
712
+ * Defaults to the ZAPIER_APPROVAL_MODE env var, then "disabled".
713
+ */
714
+ approvalMode?: "disabled" | "poll" | "throw";
715
+ /**
716
+ * Timeout in ms for approval polling. Default: 600000 (10 minutes).
717
+ */
718
+ approvalTimeoutMs?: number;
719
+ /**
720
+ * Maximum number of sequential approval rounds for a single request before
721
+ * giving up. A single request can legitimately require multiple approvals
722
+ * (one per gating policy); this cap prevents a runaway loop if the server
723
+ * keeps returning approval_required. Default: 2.
724
+ */
725
+ maxApprovalRetries?: number;
726
+ /**
727
+ * Identifies the wrapping package that built this client (e.g., the CLI or
728
+ * MCP server). When set, emitted as `x-zapier-sdk-package` /
729
+ * `x-zapier-sdk-package-version` telemetry headers. Omitted by direct
730
+ * `createZapierSdk` callers — their identity is captured by
731
+ * `x-zapier-sdk-version` alone.
732
+ */
733
+ callerPackage?: {
734
+ name: string;
735
+ version: string;
736
+ };
737
+ /**
738
+ * Pluggable key-value cache used to cache access tokens across
739
+ * invocations. See ZapierCache in ../cache.ts.
740
+ */
741
+ cache?: ZapierCache;
742
+ }
680
743
  interface ApiClient {
681
744
  get: <T = unknown>(path: string, options?: RequestOptions) => Promise<T>;
682
745
  post: <T = unknown>(path: string, data?: unknown, options?: RequestOptions) => Promise<T>;
@@ -848,6 +911,39 @@ interface CapabilitiesContext {
848
911
  hasCapability: (key: GatedFlag) => Promise<boolean>;
849
912
  }
850
913
 
914
+ /**
915
+ * API Client Implementation
916
+ *
917
+ * This module contains the core API client implementation, including
918
+ * HTTP method handlers, response processing, and client factory functions.
919
+ */
920
+
921
+ declare const createZapierApi: (options: ApiClientOptions) => ApiClient;
922
+
923
+ /**
924
+ * Zapier API Client Module
925
+ *
926
+ * This module provides a centralized API layer for all HTTP interactions
927
+ * with Zapier's various APIs. It handles authentication, error handling,
928
+ * polling, and provides consistent patterns across all services.
929
+ */
930
+
931
+ /**
932
+ * Utility function to get or create an API client for standalone functions
933
+ *
934
+ * @param config - Configuration that may include an existing API client
935
+ * @returns ApiClient instance
936
+ */
937
+ declare function getOrCreateApiClient(config: {
938
+ baseUrl?: string;
939
+ credentials?: Credentials;
940
+ /** @deprecated Use `credentials` instead */
941
+ token?: string;
942
+ api?: ApiClient;
943
+ debug?: boolean;
944
+ fetch?: typeof globalThis.fetch;
945
+ }): ApiClient;
946
+
851
947
  /**
852
948
  * Event emission types matching Avro schemas for SDK telemetry
853
949
  *
@@ -8493,7 +8589,18 @@ interface CliLoginOptions {
8493
8589
  };
8494
8590
  debug?: boolean;
8495
8591
  }
8496
- type CliLoginModule = typeof _zapier_zapier_sdk_cli_login;
8592
+ type CliLoginModule = typeof _zapier_zapier_sdk_cli_login & {
8593
+ getActiveCredentials?: (options?: {
8594
+ baseUrl?: string;
8595
+ }) => {
8596
+ clientId: string;
8597
+ scopes: string[];
8598
+ baseUrl?: string;
8599
+ } | undefined;
8600
+ getStoredClientCredentials?: (options?: {
8601
+ baseUrl?: string;
8602
+ }) => Promise<ClientCredentialsObject | undefined>;
8603
+ };
8497
8604
  /**
8498
8605
  * Inject an already-loaded CLI login module so the SDK skips its dynamic import.
8499
8606
  * This guarantees CLI and SDK share the same module instance in the same process.
@@ -9535,4 +9642,4 @@ declare const registryPlugin: (sdk: {
9535
9642
  };
9536
9643
  }) => {};
9537
9644
 
9538
- export { type Resolver as $, type ApiClient as A, type BaseSdkOptions as B, type CapabilitiesContext as C, type DrainTriggerInboxOptions as D, type EventEmissionContext as E, type FieldsetItem as F, type GetAuthenticationPluginProvides as G, type ActionFieldChoice as H, type NeedsRequest as I, type NeedsResponse as J, type Connection as K, type LeasedTriggerMessageItem as L, type Manifest as M, type Need as N, type ConnectionsResponse as O, type PluginMeta as P, type UserProfile as Q, type ResolvedAppLocator as R, isPositional as S, type TriggerMessageStatus as T, type UpdateManifestEntryOptions as U, createFunction as V, type WithAddPlugin as W, type FormattedItem as X, type FormatMetadata as Y, type ZapierSdkOptions as Z, type OutputFormatter as _, type UpdateManifestEntryResult as a, AppPropertySchema as a$, type ArrayResolver as a0, type ResolverMetadata as a1, type StaticResolver as a2, type FieldsResolver as a3, runWithTelemetryContext as a4, toSnakeCase as a5, toTitleCase as a6, batch as a7, type BatchOptions as a8, buildCapabilityMessage as a9, type EnhancedErrorEventData as aA, type MethodCalledEventData as aB, generateEventId as aC, getCurrentTimestamp as aD, getReleaseId as aE, getOsInfo as aF, getPlatformVersions as aG, isCi as aH, getCiPlatform as aI, getMemoryUsage as aJ, getCpuTime as aK, buildApplicationLifecycleEvent as aL, buildErrorEventWithContext as aM, buildErrorEvent as aN, createBaseEvent as aO, buildMethodCalledEvent as aP, type AppItem as aQ, type ConnectionItem as aR, type ActionItem$1 as aS, type InputFieldItem as aT, type InfoFieldItem as aU, type RootFieldItem as aV, type UserProfileItem as aW, type FunctionOptions as aX, type SdkPage as aY, type PaginatedSdkFunction as aZ, AppKeyPropertySchema as a_, logDeprecation as aa, resetDeprecationWarnings as ab, RelayRequestSchema as ac, RelayFetchSchema as ad, createZapierSdkWithoutRegistry as ae, createSdk as af, createOptionsPlugin as ag, type FunctionRegistryEntry as ah, type FunctionDeprecation as ai, BaseSdkOptionsSchema as aj, type Plugin as ak, type PluginProvides as al, definePlugin as am, createPluginMethod as an, createPaginatedPluginMethod as ao, composePlugins as ap, type ActionItem as aq, type ActionTypeItem as ar, type RequestOptions as as, type PollOptions as at, registryPlugin as au, type BaseEvent as av, type MethodCalledEvent as aw, type EventEmissionProvides as ax, type EventContext as ay, type ApplicationLifecycleEventData as az, type AddActionEntryOptions as b, ZapierResourceNotFoundError as b$, ActionTypePropertySchema as b0, ActionKeyPropertySchema as b1, ActionPropertySchema as b2, InputFieldPropertySchema as b3, ConnectionIdPropertySchema as b4, AuthenticationIdPropertySchema as b5, ConnectionPropertySchema as b6, InputsPropertySchema as b7, LimitPropertySchema as b8, OffsetPropertySchema as b9, type LimitProperty as bA, type OffsetProperty as bB, type OutputProperty as bC, type DebugProperty as bD, type ParamsProperty as bE, type ActionTimeoutMsProperty as bF, type TableProperty as bG, type RecordProperty as bH, type RecordsProperty as bI, type FieldsProperty as bJ, type AppsProperty as bK, type TablesProperty as bL, type ConnectionsProperty as bM, type TriggerInboxProperty as bN, type TriggerInboxNameProperty as bO, type LeaseProperty as bP, type LeaseSecondsProperty as bQ, type LeaseLimitProperty as bR, type ApiError as bS, type ErrorOptions as bT, ZapierError as bU, ZapierApiError as bV, ZapierAppNotFoundError as bW, ZapierValidationError as bX, ZapierUnknownError as bY, ZapierAuthenticationError as bZ, ZapierNotFoundError as b_, OutputPropertySchema as ba, DebugPropertySchema as bb, ParamsPropertySchema as bc, ActionTimeoutMsPropertySchema as bd, TablePropertySchema as be, RecordPropertySchema as bf, RecordsPropertySchema as bg, FieldsPropertySchema as bh, AppsPropertySchema as bi, TablesPropertySchema as bj, ConnectionsPropertySchema as bk, TriggerInboxPropertySchema as bl, TriggerInboxNamePropertySchema as bm, LeasePropertySchema as bn, LeaseSecondsPropertySchema as bo, LeaseLimitPropertySchema as bp, type AppKeyProperty as bq, type AppProperty as br, type ActionTypeProperty as bs, type ActionKeyProperty as bt, type ActionProperty as bu, type InputFieldProperty as bv, type ConnectionIdProperty as bw, type ConnectionProperty as bx, type AuthenticationIdProperty as by, type InputsProperty as bz, type AddActionEntryResult as c, appKeyResolver as c$, ZapierConfigurationError as c0, ZapierBundleError as c1, ZapierTimeoutError as c2, ZapierActionError as c3, ZapierConflictError as c4, type RateLimitInfo as c5, ZapierRateLimitError as c6, type ApprovalStatus as c7, ZapierApprovalError as c8, ZapierRelayError as c9, getAppPlugin as cA, type GetAppPluginProvides as cB, getActionPlugin as cC, type GetActionPluginProvides as cD, getConnectionPlugin as cE, type GetConnectionPluginProvides as cF, findFirstConnectionPlugin as cG, type FindFirstConnectionPluginProvides as cH, findUniqueConnectionPlugin as cI, type FindUniqueConnectionPluginProvides as cJ, CONTEXT_CACHE_TTL_MS as cK, CONTEXT_CACHE_MAX_SIZE as cL, runActionPlugin as cM, type RunActionPluginProvides as cN, requestPlugin as cO, type RequestPluginProvides as cP, type ManifestPluginOptions as cQ, getPreferredManifestEntryKey as cR, manifestPlugin as cS, type ManifestPluginProvides as cT, DEFAULT_CONFIG_PATH as cU, type ManifestEntry as cV, getProfilePlugin as cW, type GetProfilePluginProvides as cX, type ApiPluginOptions as cY, apiPlugin as cZ, type ApiPluginProvides as c_, formatErrorMessage as ca, ZapierSignal as cb, appsPlugin as cc, type AppsPluginProvides as cd, type ActionExecutionOptions as ce, type AppFactoryInput as cf, fetchPlugin as cg, type FetchPluginProvides as ch, listAppsPlugin as ci, type ListAppsPluginProvides as cj, listActionsPlugin as ck, type ListActionsPluginProvides as cl, listActionInputFieldsPlugin as cm, type ListActionInputFieldsPluginProvides as cn, listActionInputFieldChoicesPlugin as co, type ListActionInputFieldChoicesPluginProvides as cp, getActionInputFieldsSchemaPlugin as cq, type GetActionInputFieldsSchemaPluginProvides as cr, listConnectionsPlugin as cs, type ListConnectionsPluginProvides as ct, listClientCredentialsPlugin as cu, type ListClientCredentialsPluginProvides as cv, createClientCredentialsPlugin as cw, type CreateClientCredentialsPluginProvides as cx, deleteClientCredentialsPlugin as cy, type DeleteClientCredentialsPluginProvides as cz, type ActionEntry as d, connectionsPlugin as d$, actionTypeResolver as d0, actionKeyResolver as d1, connectionIdResolver as d2, connectionIdGenericResolver as d3, inputsResolver as d4, inputsAllOptionalResolver as d5, inputFieldKeyResolver as d6, clientCredentialsNameResolver as d7, clientIdResolver as d8, tableIdResolver as d9, type LoadingEvent as dA, type EventCallback as dB, type Credentials as dC, type ResolvedCredentials as dD, type CredentialsObject as dE, type ClientCredentialsObject as dF, type PkceCredentialsObject as dG, isClientCredentials as dH, isPkceCredentials as dI, isCredentialsObject as dJ, isCredentialsFunction as dK, type ResolveCredentialsOptions as dL, resolveCredentialsFromEnv as dM, resolveCredentials as dN, getBaseUrlFromCredentials as dO, getClientIdFromCredentials as dP, ClientCredentialsObjectSchema as dQ, PkceCredentialsObjectSchema as dR, CredentialsObjectSchema as dS, ResolvedCredentialsSchema as dT, CredentialsFunctionSchema as dU, type CredentialsFunction as dV, CredentialsSchema as dW, ConnectionEntrySchema as dX, type ConnectionEntry as dY, ConnectionsMapSchema as dZ, type ConnectionsMap as d_, triggerInboxResolver as da, tableRecordIdResolver as db, tableRecordIdsResolver as dc, tableFieldIdsResolver as dd, tableNameResolver as de, tableFieldsResolver as df, tableRecordsResolver as dg, tableUpdateRecordsResolver as dh, tableFiltersResolver as di, tableSortResolver as dj, type ResolveAuthTokenOptions as dk, clearTokenCache as dl, invalidateCachedToken as dm, injectCliLogin as dn, isCliLoginAvailable as dp, getTokenFromCliLogin as dq, resolveAuthToken as dr, invalidateCredentialsToken as ds, type ZapierCache as dt, type ZapierCacheEntry as du, type ZapierCacheSetOptions as dv, createMemoryCache as dw, type SdkEvent as dx, type AuthEvent as dy, type ApiEvent as dz, type PaginatedSdkResult as e, type ConnectionsPluginProvides as e0, ZAPIER_BASE_URL as e1, getZapierSdkService as e2, MAX_PAGE_LIMIT as e3, DEFAULT_PAGE_SIZE as e4, DEFAULT_ACTION_TIMEOUT_MS as e5, ZAPIER_MAX_NETWORK_RETRIES as e6, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS as e7, getZapierApprovalMode as e8, DEFAULT_APPROVAL_TIMEOUT_MS as e9, type ZapierSdk as eA, DEFAULT_MAX_APPROVAL_RETRIES as ea, listTablesPlugin as eb, type ListTablesPluginProvides as ec, getTablePlugin as ed, type GetTablePluginProvides as ee, createTablePlugin as ef, type CreateTablePluginProvides as eg, deleteTablePlugin as eh, type DeleteTablePluginProvides as ei, listTableFieldsPlugin as ej, type ListTableFieldsPluginProvides as ek, createTableFieldsPlugin as el, type CreateTableFieldsPluginProvides as em, deleteTableFieldsPlugin as en, type DeleteTableFieldsPluginProvides as eo, getTableRecordPlugin as ep, type GetTableRecordPluginProvides as eq, listTableRecordsPlugin as er, type ListTableRecordsPluginProvides as es, createTableRecordsPlugin as et, type CreateTableRecordsPluginProvides as eu, deleteTableRecordsPlugin as ev, type DeleteTableRecordsPluginProvides as ew, updateTableRecordsPlugin as ex, type UpdateTableRecordsPluginProvides as ey, createZapierSdk as ez, findManifestEntry as f, type PositionalMetadata as g, type ZapierFetchInitOptions as h, type DynamicResolver as i, type WatchTriggerInboxOptions as j, type ActionProxy as k, type ZapierSdkApps as l, ZapierAbortDrainSignal as m, ZapierReleaseTriggerMessageSignal as n, type DrainTriggerInboxCallback as o, type DrainTriggerInboxErrorObserver as p, type ListAuthenticationsPluginProvides as q, readManifestFromFile as r, type FindFirstAuthenticationPluginProvides as s, type FindUniqueAuthenticationPluginProvides as t, type Action as u, type App as v, type Field as w, type Choice as x, type ActionExecutionResult as y, type ActionField as z };
9645
+ export { type Resolver as $, type ApiClient as A, type BaseSdkOptions as B, type CapabilitiesContext as C, type DrainTriggerInboxOptions as D, type EventEmissionContext as E, type FieldsetItem as F, type GetAuthenticationPluginProvides as G, type ActionFieldChoice as H, type NeedsRequest as I, type NeedsResponse as J, type Connection as K, type LeasedTriggerMessageItem as L, type Manifest as M, type Need as N, type ConnectionsResponse as O, type PluginMeta as P, type UserProfile as Q, type ResolvedAppLocator as R, isPositional as S, type TriggerMessageStatus as T, type UpdateManifestEntryOptions as U, createFunction as V, type WithAddPlugin as W, type FormattedItem as X, type FormatMetadata as Y, type ZapierSdkOptions as Z, type OutputFormatter as _, type UpdateManifestEntryResult as a, type PaginatedSdkFunction as a$, type ArrayResolver as a0, type ResolverMetadata as a1, type StaticResolver as a2, type FieldsResolver as a3, runWithTelemetryContext as a4, toSnakeCase as a5, toTitleCase as a6, batch as a7, type BatchOptions as a8, buildCapabilityMessage as a9, type EventContext as aA, type ApplicationLifecycleEventData as aB, type EnhancedErrorEventData as aC, type MethodCalledEventData as aD, generateEventId as aE, getCurrentTimestamp as aF, getReleaseId as aG, getOsInfo as aH, getPlatformVersions as aI, isCi as aJ, getCiPlatform as aK, getMemoryUsage as aL, getCpuTime as aM, buildApplicationLifecycleEvent as aN, buildErrorEventWithContext as aO, buildErrorEvent as aP, createBaseEvent as aQ, buildMethodCalledEvent as aR, type AppItem as aS, type ConnectionItem as aT, type ActionItem$1 as aU, type InputFieldItem as aV, type InfoFieldItem as aW, type RootFieldItem as aX, type UserProfileItem as aY, type FunctionOptions as aZ, type SdkPage as a_, logDeprecation as aa, resetDeprecationWarnings as ab, RelayRequestSchema as ac, RelayFetchSchema as ad, createZapierSdkWithoutRegistry as ae, createSdk as af, createOptionsPlugin as ag, type FunctionRegistryEntry as ah, type FunctionDeprecation as ai, BaseSdkOptionsSchema as aj, type Plugin as ak, type PluginProvides as al, definePlugin as am, createPluginMethod as an, createPaginatedPluginMethod as ao, composePlugins as ap, type ActionItem as aq, type ActionTypeItem as ar, registryPlugin as as, type RequestOptions as at, type PollOptions as au, createZapierApi as av, getOrCreateApiClient as aw, type BaseEvent as ax, type MethodCalledEvent as ay, type EventEmissionProvides as az, type AddActionEntryOptions as b, ZapierAuthenticationError as b$, AppKeyPropertySchema as b0, AppPropertySchema as b1, ActionTypePropertySchema as b2, ActionKeyPropertySchema as b3, ActionPropertySchema as b4, InputFieldPropertySchema as b5, ConnectionIdPropertySchema as b6, AuthenticationIdPropertySchema as b7, ConnectionPropertySchema as b8, InputsPropertySchema as b9, type AuthenticationIdProperty as bA, type InputsProperty as bB, type LimitProperty as bC, type OffsetProperty as bD, type OutputProperty as bE, type DebugProperty as bF, type ParamsProperty as bG, type ActionTimeoutMsProperty as bH, type TableProperty as bI, type RecordProperty as bJ, type RecordsProperty as bK, type FieldsProperty as bL, type AppsProperty as bM, type TablesProperty as bN, type ConnectionsProperty as bO, type TriggerInboxProperty as bP, type TriggerInboxNameProperty as bQ, type LeaseProperty as bR, type LeaseSecondsProperty as bS, type LeaseLimitProperty as bT, type ApiError as bU, type ErrorOptions as bV, ZapierError as bW, ZapierApiError as bX, ZapierAppNotFoundError as bY, ZapierValidationError as bZ, ZapierUnknownError as b_, LimitPropertySchema as ba, OffsetPropertySchema as bb, OutputPropertySchema as bc, DebugPropertySchema as bd, ParamsPropertySchema as be, ActionTimeoutMsPropertySchema as bf, TablePropertySchema as bg, RecordPropertySchema as bh, RecordsPropertySchema as bi, FieldsPropertySchema as bj, AppsPropertySchema as bk, TablesPropertySchema as bl, ConnectionsPropertySchema as bm, TriggerInboxPropertySchema as bn, TriggerInboxNamePropertySchema as bo, LeasePropertySchema as bp, LeaseSecondsPropertySchema as bq, LeaseLimitPropertySchema as br, type AppKeyProperty as bs, type AppProperty as bt, type ActionTypeProperty as bu, type ActionKeyProperty as bv, type ActionProperty as bw, type InputFieldProperty as bx, type ConnectionIdProperty as by, type ConnectionProperty as bz, type AddActionEntryResult as c, apiPlugin as c$, ZapierNotFoundError as c0, ZapierResourceNotFoundError as c1, ZapierConfigurationError as c2, ZapierBundleError as c3, ZapierTimeoutError as c4, ZapierActionError as c5, ZapierConflictError as c6, type RateLimitInfo as c7, ZapierRateLimitError as c8, type ApprovalStatus as c9, deleteClientCredentialsPlugin as cA, type DeleteClientCredentialsPluginProvides as cB, getAppPlugin as cC, type GetAppPluginProvides as cD, getActionPlugin as cE, type GetActionPluginProvides as cF, getConnectionPlugin as cG, type GetConnectionPluginProvides as cH, findFirstConnectionPlugin as cI, type FindFirstConnectionPluginProvides as cJ, findUniqueConnectionPlugin as cK, type FindUniqueConnectionPluginProvides as cL, CONTEXT_CACHE_TTL_MS as cM, CONTEXT_CACHE_MAX_SIZE as cN, runActionPlugin as cO, type RunActionPluginProvides as cP, requestPlugin as cQ, type RequestPluginProvides as cR, type ManifestPluginOptions as cS, getPreferredManifestEntryKey as cT, manifestPlugin as cU, type ManifestPluginProvides as cV, DEFAULT_CONFIG_PATH as cW, type ManifestEntry as cX, getProfilePlugin as cY, type GetProfilePluginProvides as cZ, type ApiPluginOptions as c_, ZapierApprovalError as ca, ZapierRelayError as cb, formatErrorMessage as cc, ZapierSignal as cd, appsPlugin as ce, type AppsPluginProvides as cf, type ActionExecutionOptions as cg, type AppFactoryInput as ch, fetchPlugin as ci, type FetchPluginProvides as cj, listAppsPlugin as ck, type ListAppsPluginProvides as cl, listActionsPlugin as cm, type ListActionsPluginProvides as cn, listActionInputFieldsPlugin as co, type ListActionInputFieldsPluginProvides as cp, listActionInputFieldChoicesPlugin as cq, type ListActionInputFieldChoicesPluginProvides as cr, getActionInputFieldsSchemaPlugin as cs, type GetActionInputFieldsSchemaPluginProvides as ct, listConnectionsPlugin as cu, type ListConnectionsPluginProvides as cv, listClientCredentialsPlugin as cw, type ListClientCredentialsPluginProvides as cx, createClientCredentialsPlugin as cy, type CreateClientCredentialsPluginProvides as cz, type ActionEntry as d, ConnectionsMapSchema as d$, type ApiPluginProvides as d0, appKeyResolver as d1, actionTypeResolver as d2, actionKeyResolver as d3, connectionIdResolver as d4, connectionIdGenericResolver as d5, inputsResolver as d6, inputsAllOptionalResolver as d7, inputFieldKeyResolver as d8, clientCredentialsNameResolver as d9, type AuthEvent as dA, type ApiEvent as dB, type LoadingEvent as dC, type EventCallback as dD, type Credentials as dE, type ResolvedCredentials as dF, type CredentialsObject as dG, type ClientCredentialsObject as dH, type PkceCredentialsObject as dI, isClientCredentials as dJ, isPkceCredentials as dK, isCredentialsObject as dL, isCredentialsFunction as dM, type ResolveCredentialsOptions as dN, resolveCredentialsFromEnv as dO, resolveCredentials as dP, getBaseUrlFromCredentials as dQ, getClientIdFromCredentials as dR, ClientCredentialsObjectSchema as dS, PkceCredentialsObjectSchema as dT, CredentialsObjectSchema as dU, ResolvedCredentialsSchema as dV, CredentialsFunctionSchema as dW, type CredentialsFunction as dX, CredentialsSchema as dY, ConnectionEntrySchema as dZ, type ConnectionEntry as d_, clientIdResolver as da, tableIdResolver as db, triggerInboxResolver as dc, tableRecordIdResolver as dd, tableRecordIdsResolver as de, tableFieldIdsResolver as df, tableNameResolver as dg, tableFieldsResolver as dh, tableRecordsResolver as di, tableUpdateRecordsResolver as dj, tableFiltersResolver as dk, tableSortResolver as dl, type ResolveAuthTokenOptions as dm, clearTokenCache as dn, invalidateCachedToken as dp, injectCliLogin as dq, isCliLoginAvailable as dr, getTokenFromCliLogin as ds, resolveAuthToken as dt, invalidateCredentialsToken as du, type ZapierCache as dv, type ZapierCacheEntry as dw, type ZapierCacheSetOptions as dx, createMemoryCache as dy, type SdkEvent as dz, type PaginatedSdkResult as e, type ConnectionsMap as e0, connectionsPlugin as e1, type ConnectionsPluginProvides as e2, ZAPIER_BASE_URL as e3, getZapierSdkService as e4, MAX_PAGE_LIMIT as e5, DEFAULT_PAGE_SIZE as e6, DEFAULT_ACTION_TIMEOUT_MS as e7, ZAPIER_MAX_NETWORK_RETRIES as e8, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS as e9, type UpdateTableRecordsPluginProvides as eA, createZapierSdk as eB, type ZapierSdk as eC, getZapierApprovalMode as ea, DEFAULT_APPROVAL_TIMEOUT_MS as eb, DEFAULT_MAX_APPROVAL_RETRIES as ec, listTablesPlugin as ed, type ListTablesPluginProvides as ee, getTablePlugin as ef, type GetTablePluginProvides as eg, createTablePlugin as eh, type CreateTablePluginProvides as ei, deleteTablePlugin as ej, type DeleteTablePluginProvides as ek, listTableFieldsPlugin as el, type ListTableFieldsPluginProvides as em, createTableFieldsPlugin as en, type CreateTableFieldsPluginProvides as eo, deleteTableFieldsPlugin as ep, type DeleteTableFieldsPluginProvides as eq, getTableRecordPlugin as er, type GetTableRecordPluginProvides as es, listTableRecordsPlugin as et, type ListTableRecordsPluginProvides as eu, createTableRecordsPlugin as ev, type CreateTableRecordsPluginProvides as ew, deleteTableRecordsPlugin as ex, type DeleteTableRecordsPluginProvides as ey, updateTableRecordsPlugin as ez, findManifestEntry as f, type PositionalMetadata as g, type ZapierFetchInitOptions as h, type DynamicResolver as i, type WatchTriggerInboxOptions as j, type ActionProxy as k, type ZapierSdkApps as l, ZapierAbortDrainSignal as m, ZapierReleaseTriggerMessageSignal as n, type DrainTriggerInboxCallback as o, type DrainTriggerInboxErrorObserver as p, type ListAuthenticationsPluginProvides as q, readManifestFromFile as r, type FindFirstAuthenticationPluginProvides as s, type FindUniqueAuthenticationPluginProvides as t, type Action as u, type App as v, type Field as w, type Choice as x, type ActionExecutionResult as y, type ActionField as z };