@zapier/zapier-sdk 0.49.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 (61) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +15 -12
  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 +20 -17
  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/api/types.d.ts +8 -7
  13. package/dist/api/types.d.ts.map +1 -1
  14. package/dist/auth.d.ts +13 -2
  15. package/dist/auth.d.ts.map +1 -1
  16. package/dist/auth.js +95 -11
  17. package/dist/constants.d.ts +8 -9
  18. package/dist/constants.d.ts.map +1 -1
  19. package/dist/constants.js +8 -11
  20. package/dist/experimental.cjs +184 -52
  21. package/dist/experimental.d.mts +2 -2
  22. package/dist/experimental.d.ts +26 -26
  23. package/dist/experimental.mjs +183 -52
  24. package/dist/{index-C2vsvjgN.d.mts → index-C52BjTXh.d.mts} +124 -18
  25. package/dist/{index-C2vsvjgN.d.ts → index-C52BjTXh.d.ts} +124 -18
  26. package/dist/index.cjs +184 -52
  27. package/dist/index.d.mts +1 -1
  28. package/dist/index.d.ts +2 -1
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +1 -0
  31. package/dist/index.mjs +183 -52
  32. package/dist/plugins/api/index.d.ts.map +1 -1
  33. package/dist/plugins/api/index.js +1 -2
  34. package/dist/plugins/apps/index.d.ts +2 -2
  35. package/dist/plugins/deprecated/inputFields.d.ts +18 -18
  36. package/dist/plugins/getAction/index.d.ts +6 -6
  37. package/dist/plugins/getAction/schemas.d.ts +4 -4
  38. package/dist/plugins/getActionInputFieldsSchema/index.d.ts +5 -5
  39. package/dist/plugins/getActionInputFieldsSchema/schemas.d.ts +4 -4
  40. package/dist/plugins/listActionInputFieldChoices/index.d.ts +5 -5
  41. package/dist/plugins/listActionInputFieldChoices/schemas.d.ts +4 -4
  42. package/dist/plugins/listActionInputFields/index.d.ts +5 -5
  43. package/dist/plugins/listActionInputFields/schemas.d.ts +4 -4
  44. package/dist/plugins/listActions/index.d.ts +3 -3
  45. package/dist/plugins/listActions/schemas.d.ts +4 -4
  46. package/dist/plugins/runAction/index.d.ts +5 -5
  47. package/dist/plugins/runAction/schemas.d.ts +4 -4
  48. package/dist/plugins/triggers/getTriggerInputFieldsSchema/index.d.ts +2 -2
  49. package/dist/plugins/triggers/listTriggerInputFieldChoices/index.d.ts +2 -2
  50. package/dist/plugins/triggers/listTriggerInputFields/index.d.ts +2 -2
  51. package/dist/schemas/Action.d.ts +1 -1
  52. package/dist/sdk.d.ts +52 -52
  53. package/dist/types/errors.d.ts +5 -5
  54. package/dist/types/properties.d.ts +1 -1
  55. package/dist/types/sdk.d.ts +2 -2
  56. package/dist/types/sdk.d.ts.map +1 -1
  57. package/dist/types/sdk.js +4 -11
  58. package/dist/utils/telemetry.d.ts +11 -0
  59. package/dist/utils/telemetry.d.ts.map +1 -0
  60. package/dist/utils/telemetry.js +19 -0
  61. package/package.json +1 -1
@@ -148,12 +148,10 @@ function parseIntEnvVar(name) {
148
148
  }
149
149
  var ZAPIER_MAX_NETWORK_RETRIES = parseIntEnvVar("ZAPIER_MAX_NETWORK_RETRIES") ?? 3;
150
150
  var ZAPIER_MAX_NETWORK_RETRY_DELAY_MS = parseIntEnvVar("ZAPIER_MAX_NETWORK_RETRY_DELAY_MS") ?? 6e4;
151
- function getZapierIsInteractive() {
152
- return globalThis.process?.env?.ZAPIER_IS_INTERACTIVE === "true";
153
- }
154
151
  function getZapierApprovalMode() {
155
152
  const value = globalThis.process?.env?.ZAPIER_APPROVAL_MODE;
156
- if (value === "poll" || value === "fail") return value;
153
+ if (value === "disabled" || value === "poll" || value === "throw")
154
+ return value;
157
155
  return void 0;
158
156
  }
159
157
  var DEFAULT_APPROVAL_TIMEOUT_MS = 10 * 60 * 1e3;
@@ -1836,33 +1834,40 @@ function getAuthorizationHeader(token) {
1836
1834
  }
1837
1835
  return `Bearer ${token}`;
1838
1836
  }
1839
- function extractUserIdsFromJwt(token) {
1837
+ function readJwtPayload(token) {
1840
1838
  const parts = parseJwt(token);
1841
- if (!parts) {
1842
- return { customuser_id: null, account_id: null };
1843
- }
1839
+ if (!parts) return null;
1840
+ let payload;
1844
1841
  try {
1845
- const payload = JSON.parse(
1846
- Buffer.from(parts[1], "base64url").toString("utf-8")
1847
- );
1848
- let actualPayload = payload;
1849
- if (payload.sub_type === "service" && payload.njwt) {
1850
- const nestedParts = payload.njwt.split(".");
1851
- if (nestedParts.length === 3) {
1852
- 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(
1853
1851
  Buffer.from(nestedParts[1], "base64url").toString("utf-8")
1854
1852
  );
1853
+ } catch {
1855
1854
  }
1856
1855
  }
1857
- const accountId = actualPayload["zap:acc"] != null ? parseInt(String(actualPayload["zap:acc"]), 10) : null;
1858
- const customUserId = actualPayload.sub_type === "customuser" && actualPayload.sub != null ? parseInt(String(actualPayload.sub), 10) : null;
1859
- return {
1860
- customuser_id: customUserId !== null && !isNaN(customUserId) ? customUserId : null,
1861
- account_id: accountId !== null && !isNaN(accountId) ? accountId : null
1862
- };
1863
- } catch {
1856
+ }
1857
+ return payload;
1858
+ }
1859
+ function extractUserIdsFromJwt(token) {
1860
+ const payload = readJwtPayload(token);
1861
+ if (!payload) {
1864
1862
  return { customuser_id: null, account_id: null };
1865
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
+ };
1866
1871
  }
1867
1872
 
1868
1873
  // src/api/debug.ts
@@ -2211,6 +2216,19 @@ function isCredentialsFunction(credentials) {
2211
2216
  return typeof credentials === "function";
2212
2217
  }
2213
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
+
2214
2232
  // src/utils/url-utils.ts
2215
2233
  function getZapierBaseUrl(baseUrl) {
2216
2234
  if (!baseUrl) {
@@ -2433,8 +2451,10 @@ async function resolveCache(options) {
2433
2451
  if (cliLogin?.createCache) {
2434
2452
  try {
2435
2453
  const cache = cliLogin.createCache();
2436
- cachedDefaultCache = cache;
2437
- return cache;
2454
+ if (cache) {
2455
+ cachedDefaultCache = cache;
2456
+ return cache;
2457
+ }
2438
2458
  } catch {
2439
2459
  }
2440
2460
  }
@@ -2446,6 +2466,11 @@ function entryIsValid(entry) {
2446
2466
  if (entry.expiresAt === void 0) return true;
2447
2467
  return entry.expiresAt > Date.now() + TOKEN_EXPIRATION_BUFFER_MS;
2448
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
+ }
2449
2474
  async function invalidateCachedToken(options) {
2450
2475
  const cacheKey = buildCacheKey(options);
2451
2476
  pendingExchanges.delete(cacheKey);
@@ -2559,11 +2584,76 @@ function isCliLoginAvailable() {
2559
2584
  if (cachedCliLogin === void 0) return void 0;
2560
2585
  return cachedCliLogin !== false;
2561
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
+ }
2562
2604
  async function getTokenFromCliLogin(options) {
2563
2605
  const cliLogin = await getCliLogin();
2564
2606
  if (!cliLogin) return void 0;
2565
2607
  return await cliLogin.getToken(options);
2566
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
+ }
2567
2657
  async function resolveAuthToken(options = {}) {
2568
2658
  const credentials = await resolveCredentials({
2569
2659
  credentials: options.credentials,
@@ -2573,14 +2663,24 @@ async function resolveAuthToken(options = {}) {
2573
2663
  if (credentials !== void 0) {
2574
2664
  return resolveAuthTokenFromCredentials(credentials, options);
2575
2665
  }
2576
- 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({
2577
2672
  onEvent: options.onEvent,
2578
2673
  fetch: options.fetch,
2579
2674
  debug: options.debug
2580
2675
  });
2676
+ if (jwtToken !== void 0) {
2677
+ emitAuthResolved(options.onEvent, "jwt");
2678
+ }
2679
+ return jwtToken;
2581
2680
  }
2582
2681
  async function resolveAuthTokenFromCredentials(credentials, options) {
2583
2682
  if (typeof credentials === "string") {
2683
+ emitAuthResolved(options.onEvent, "token");
2584
2684
  return credentials;
2585
2685
  }
2586
2686
  if (isClientCredentials(credentials)) {
@@ -2593,15 +2693,25 @@ async function resolveAuthTokenFromCredentials(credentials, options) {
2593
2693
  baseUrl: resolvedBaseUrl
2594
2694
  });
2595
2695
  const cache = await resolveCache(options);
2596
- const cached = await cache.get(cacheKey);
2597
- if (cached && entryIsValid(cached)) {
2598
- 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;
2599
2702
  }
2600
2703
  const pending = pendingExchanges.get(cacheKey);
2601
2704
  if (pending) return pending;
2602
2705
  const runLocked = async () => {
2603
- const recheck = await cache.get(cacheKey);
2604
- 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
+ }
2605
2715
  const { accessToken, expiresIn } = await exchangeClientCredentials({
2606
2716
  clientId: credentials.clientId,
2607
2717
  clientSecret: credentials.clientSecret,
@@ -2659,7 +2769,7 @@ async function invalidateCredentialsToken(options) {
2659
2769
  }
2660
2770
 
2661
2771
  // src/sdk-version.ts
2662
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.49.0" : void 0) || "unknown";
2772
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.51.0" : void 0) || "unknown";
2663
2773
 
2664
2774
  // src/utils/open-url.ts
2665
2775
  var nodePrefix = "node:";
@@ -2934,10 +3044,10 @@ var ZapierApiClient = class {
2934
3044
  }
2935
3045
  if (errorType !== "approval_required") return response;
2936
3046
  if (attempt === maxRetries) break;
2937
- const isInteractive = this.options.isInteractive ?? getZapierIsInteractive();
2938
- if (!isInteractive) {
3047
+ const mode = this.options.approvalMode ?? getZapierApprovalMode() ?? "disabled";
3048
+ if (mode === "disabled") {
2939
3049
  throw new ZapierApprovalError(
2940
- "Approval required but session is not interactive",
3050
+ "Approvals are disabled. Set approvalMode to 'poll' or 'throw' (or ZAPIER_APPROVAL_MODE) to enable.",
2941
3051
  { status: "approval_required" }
2942
3052
  );
2943
3053
  }
@@ -2947,7 +3057,7 @@ var ZapierApiClient = class {
2947
3057
  { statusCode: 403 }
2948
3058
  );
2949
3059
  }
2950
- await this.runOneApprovalRound(init.approvalContext);
3060
+ await this.runOneApprovalRound(init.approvalContext, mode);
2951
3061
  }
2952
3062
  throw new ZapierApprovalError(
2953
3063
  `Exceeded maximum approval retries (${maxRetries}) for ${path}`,
@@ -3240,7 +3350,9 @@ var ZapierApiClient = class {
3240
3350
  if (data && typeof data === "object") {
3241
3351
  headers["Content-Type"] = "application/json";
3242
3352
  }
3243
- 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;
3244
3356
  const response = await this.fetch(path, {
3245
3357
  ...options,
3246
3358
  method,
@@ -3266,10 +3378,13 @@ var ZapierApiClient = class {
3266
3378
  }
3267
3379
  /**
3268
3380
  * Run a single approval round: create the approval, open the URL (poll mode)
3269
- * or throw (fail mode), poll until resolved, and emit events. Throws on
3381
+ * or throw (throw mode), poll until resolved, and emit events. Throws on
3270
3382
  * denied/timeout/unexpected status. Returns on approved.
3383
+ *
3384
+ * Caller is responsible for passing a non-"disabled" mode; this method
3385
+ * unconditionally creates an approval.
3271
3386
  */
3272
- async runOneApprovalRound(buildContext) {
3387
+ async runOneApprovalRound(buildContext, mode) {
3273
3388
  const context = buildContext();
3274
3389
  let approvalResponse;
3275
3390
  try {
@@ -3344,8 +3459,7 @@ var ZapierApiClient = class {
3344
3459
  approvalId: approval.approval_id,
3345
3460
  approvalUrl: approval.approval_url
3346
3461
  });
3347
- const approvalMode = this.options.approvalMode ?? getZapierApprovalMode();
3348
- if (approvalMode === "fail") {
3462
+ if (mode === "throw") {
3349
3463
  throw new ZapierApprovalError("This request requires approval.", {
3350
3464
  approvalId: approval.approval_id,
3351
3465
  approvalUrl: approval.approval_url,
@@ -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) => {
@@ -3444,7 +3580,6 @@ var apiPlugin = definePlugin(
3444
3580
  debug = false,
3445
3581
  maxNetworkRetries = ZAPIER_MAX_NETWORK_RETRIES,
3446
3582
  maxNetworkRetryDelayMs = ZAPIER_MAX_NETWORK_RETRY_DELAY_MS,
3447
- isInteractive,
3448
3583
  approvalTimeoutMs,
3449
3584
  maxApprovalRetries,
3450
3585
  approvalMode,
@@ -3459,7 +3594,6 @@ var apiPlugin = definePlugin(
3459
3594
  onEvent,
3460
3595
  maxNetworkRetries,
3461
3596
  maxNetworkRetryDelayMs,
3462
- isInteractive,
3463
3597
  approvalTimeoutMs,
3464
3598
  maxApprovalRetries,
3465
3599
  approvalMode,
@@ -10165,16 +10299,13 @@ var BaseSdkOptionsSchema = z.object({
10165
10299
  * Default is 60000 (60 seconds).
10166
10300
  */
10167
10301
  maxNetworkRetryDelayMs: z.number().optional().describe("Max delay in ms to wait for retry (default: 60000).").meta({ valueHint: "ms" }),
10168
- isInteractive: z.boolean().optional().describe(
10169
- "Whether this session is interactive (user can visit approval URLs). Defaults to ZAPIER_IS_INTERACTIVE env var."
10170
- ).meta({ internal: true }),
10171
- approvalTimeoutMs: z.number().optional().describe("Timeout in ms for approval polling. Default: 600000 (10 min).").meta({ valueHint: "ms", internal: true }),
10302
+ approvalTimeoutMs: z.number().optional().describe("Timeout in ms for approval polling. Default: 600000 (10 min).").meta({ valueHint: "ms" }),
10172
10303
  maxApprovalRetries: z.number().optional().describe(
10173
10304
  "Maximum number of sequential approval rounds per request (one per gating policy) before giving up. Default: 2."
10174
- ).meta({ internal: true }),
10175
- approvalMode: z.enum(["poll", "fail"]).optional().describe(
10176
- 'Approval flow behavior. "poll" opens browser and polls (default). "fail" creates the approval and throws immediately with the approval URL.'
10177
- ).meta({ internal: true }),
10305
+ ),
10306
+ approvalMode: z.enum(["disabled", "poll", "throw"]).optional().describe(
10307
+ 'Approval flow behavior. "disabled" (default) throws a ZapierApprovalError on approval-required responses without creating an approval. "poll" creates the approval, opens it in a browser, polls until resolved, and retries the original request. "throw" creates the approval and throws a ZapierApprovalError with the approval URL so the caller can surface it. Defaults to the ZAPIER_APPROVAL_MODE env var, then "disabled".'
10308
+ ),
10178
10309
  // Internal
10179
10310
  manifestPath: z.string().optional().describe("Path to a .zapierrc manifest file for app version locking.").meta({ internal: true }),
10180
10311
  manifest: z.custom().optional().describe("Manifest for app version locking.").meta({ internal: true }),
@@ -10204,4 +10335,4 @@ function createZapierSdk2(options = {}) {
10204
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);
10205
10336
  }
10206
10337
 
10207
- 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, getZapierIsInteractive, 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
  *
@@ -1399,12 +1495,12 @@ declare const BaseSdkOptionsSchema: z.ZodObject<{
1399
1495
  trackingBaseUrl: z.ZodOptional<z.ZodString>;
1400
1496
  maxNetworkRetries: z.ZodOptional<z.ZodNumber>;
1401
1497
  maxNetworkRetryDelayMs: z.ZodOptional<z.ZodNumber>;
1402
- isInteractive: z.ZodOptional<z.ZodBoolean>;
1403
1498
  approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
1404
1499
  maxApprovalRetries: z.ZodOptional<z.ZodNumber>;
1405
1500
  approvalMode: z.ZodOptional<z.ZodEnum<{
1501
+ disabled: "disabled";
1406
1502
  poll: "poll";
1407
- fail: "fail";
1503
+ throw: "throw";
1408
1504
  }>>;
1409
1505
  manifestPath: z.ZodOptional<z.ZodString>;
1410
1506
  manifest: z.ZodOptional<z.ZodCustom<Manifest, Manifest>>;
@@ -5621,15 +5717,15 @@ declare class ZapierRateLimitError extends ZapierError {
5621
5717
  * Terminal status of an approval attempt, exposed on `ZapierApprovalError.approvalStatus`.
5622
5718
  *
5623
5719
  * - `pending`: The approval was created but not yet resolved. Only thrown in
5624
- * `approvalMode: "fail"` — the caller is expected to surface the approval URL
5720
+ * `approvalMode: "throw"` — the caller is expected to surface the approval URL
5625
5721
  * to an end user (e.g. an LLM instructing its user to click the link).
5626
5722
  * - `denied`: A human explicitly rejected the approval in the UI.
5627
5723
  * - `policy_denied`: A policy rule blocked the request before (or instead of)
5628
5724
  * creating an approval. Cannot be approved by a human.
5629
- * - `approval_required`: The backend requested approval, but the current
5630
- * session is non-interactive so the SDK cannot open the approval URL. Retry
5631
- * in an interactive session, or use `approvalMode: "fail"` to surface the
5632
- * approval URL to the caller.
5725
+ * - `approval_required`: The backend requested approval, but `approvalMode` is
5726
+ * `"disabled"` (the default) so the SDK did not create an approval. Set
5727
+ * `approvalMode` to `"poll"` or `"throw"` (or the `ZAPIER_APPROVAL_MODE` env
5728
+ * var) to enable the approval flow.
5633
5729
  * - `timeout`: Poll mode exceeded `approvalTimeoutMs` without the approval
5634
5730
  * being resolved.
5635
5731
  * - `max_retries_exceeded`: A single request triggered more sequential approval
@@ -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.
@@ -8642,20 +8749,19 @@ declare const DEFAULT_ACTION_TIMEOUT_MS = 180000;
8642
8749
  */
8643
8750
  declare const ZAPIER_MAX_NETWORK_RETRIES: number;
8644
8751
  declare const ZAPIER_MAX_NETWORK_RETRY_DELAY_MS: number;
8645
- /**
8646
- * Whether this session is interactive (user can visit approval URLs).
8647
- *
8648
- * Read lazily so tests can set the env var after module import.
8649
- */
8650
- declare function getZapierIsInteractive(): boolean;
8651
8752
  /**
8652
8753
  * Approval flow behavior from environment variable.
8653
- * - "poll": (default) Opens the approval URL in a browser and polls until resolved.
8654
- * - "fail": Creates the approval and throws immediately with the approval URL.
8754
+ * - "disabled": (default when env var is unset) Throw a ZapierApprovalError on
8755
+ * approval-required responses without creating an approval. Callers must
8756
+ * explicitly opt in to approvals via "poll" or "throw".
8757
+ * - "poll": Create the approval, open the URL in a browser, poll until
8758
+ * resolved, and retry the original request on success.
8759
+ * - "throw": Create the approval and throw a ZapierApprovalError immediately
8760
+ * with the approval URL so the caller can surface it.
8655
8761
  *
8656
8762
  * Read lazily so tests can set the env var after module import.
8657
8763
  */
8658
- declare function getZapierApprovalMode(): "poll" | "fail" | undefined;
8764
+ declare function getZapierApprovalMode(): "disabled" | "poll" | "throw" | undefined;
8659
8765
  /**
8660
8766
  * Default timeout for approval polling (10 minutes)
8661
8767
  */
@@ -9536,4 +9642,4 @@ declare const registryPlugin: (sdk: {
9536
9642
  };
9537
9643
  }) => {};
9538
9644
 
9539
- 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, getZapierIsInteractive as e8, getZapierApprovalMode as e9, createZapierSdk as eA, type ZapierSdk as eB, DEFAULT_APPROVAL_TIMEOUT_MS as ea, DEFAULT_MAX_APPROVAL_RETRIES as eb, listTablesPlugin as ec, type ListTablesPluginProvides as ed, getTablePlugin as ee, type GetTablePluginProvides as ef, createTablePlugin as eg, type CreateTablePluginProvides as eh, deleteTablePlugin as ei, type DeleteTablePluginProvides as ej, listTableFieldsPlugin as ek, type ListTableFieldsPluginProvides as el, createTableFieldsPlugin as em, type CreateTableFieldsPluginProvides as en, deleteTableFieldsPlugin as eo, type DeleteTableFieldsPluginProvides as ep, getTableRecordPlugin as eq, type GetTableRecordPluginProvides as er, listTableRecordsPlugin as es, type ListTableRecordsPluginProvides as et, createTableRecordsPlugin as eu, type CreateTableRecordsPluginProvides as ev, deleteTableRecordsPlugin as ew, type DeleteTableRecordsPluginProvides as ex, updateTableRecordsPlugin as ey, type UpdateTableRecordsPluginProvides 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 };