@zapier/zapier-sdk 0.55.0 → 0.56.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @zapier/zapier-sdk
2
2
 
3
+ ## 0.56.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d2aa0e9: Allow opting into approvals during login
8
+
3
9
  ## 0.55.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -330,21 +330,21 @@ console.log(emojiData.emoji);
330
330
 
331
331
  The `createZapierSdk(...)` factory function is the main entry point for the SDK. It provides methods for managing connections, listing apps, running actions, and more.
332
332
 
333
- | Name | Type | Required | Default | Possible Values | Description |
334
- | ----------------------------- | -------------------------- | -------- | ------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
335
- | `credentials` | `string, object, function` | ❌ | — | — | Authentication credentials. Can be a string (token or API key), a client credentials object ({ clientId, clientSecret }), a PKCE object ({ clientId }), or a function returning any of those. |
336
- | `debug` | `boolean` | ❌ | — | — | Enable debug logging. |
337
- | `baseUrl` | `string` | ❌ | — | — | Base URL for Zapier API endpoints. |
338
- | `trackingBaseUrl` | `string` | ❌ | — | — | Base URL for Zapier tracking endpoints. |
339
- | `maxNetworkRetries` | `number` | ❌ | — | — | Max retries for rate-limited requests (default: 3). |
340
- | `maxNetworkRetryDelayMs` | `number` | ❌ | — | — | Max delay in ms to wait for retry (default: 60000). |
341
- | `maxConcurrentRequests` | `number, literal` | ❌ | — | — | Max concurrent in-flight HTTP requests (default: 200, max: 10000). |
342
- | `approvalTimeoutMs` | `number` | ❌ | — | — | Timeout in ms for approval polling. Default: 600000 (10 min). |
343
- | `maxApprovalRetries` | `number` | ❌ | — | — | Maximum number of sequential approval rounds per request (one per gating policy) before giving up. Default: 2. |
344
- | `approvalMode` | `string` | ❌ | — | `disabled`, `poll`, `throw` | 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". |
345
- | `canIncludeSharedConnections` | `boolean` | ❌ | — | — | Allow listing shared connections. |
346
- | `canIncludeSharedTables` | `boolean` | ❌ | — | — | Allow listing shared tables. |
347
- | `canDeleteTables` | `boolean` | ❌ | — | — | Allow deleting tables. |
333
+ | Name | Type | Required | Default | Possible Values | Description |
334
+ | ----------------------------- | -------------------------- | -------- | ------- | --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
335
+ | `credentials` | `string, object, function` | ❌ | — | — | Authentication credentials. Can be a string (token or API key), a client credentials object ({ clientId, clientSecret }), a PKCE object ({ clientId }), or a function returning any of those. |
336
+ | `debug` | `boolean` | ❌ | — | — | Enable debug logging. |
337
+ | `baseUrl` | `string` | ❌ | — | — | Base URL for Zapier API endpoints. |
338
+ | `trackingBaseUrl` | `string` | ❌ | — | — | Base URL for Zapier tracking endpoints. |
339
+ | `maxNetworkRetries` | `number` | ❌ | — | — | Max retries for rate-limited requests (default: 3). |
340
+ | `maxNetworkRetryDelayMs` | `number` | ❌ | — | — | Max delay in ms to wait for retry (default: 60000). |
341
+ | `maxConcurrentRequests` | `number, literal` | ❌ | — | — | Max concurrent in-flight HTTP requests (default: 200, max: 10000). |
342
+ | `approvalTimeoutMs` | `number` | ❌ | — | — | Timeout in ms for approval polling. Default: 600000 (10 min). |
343
+ | `maxApprovalRetries` | `number` | ❌ | — | — | Maximum number of sequential approval rounds per request (one per gating policy) before giving up. Default: 2. |
344
+ | `approvalMode` | `string` | ❌ | — | `disabled`, `poll`, `throw` | Approval flow behavior. "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. "disabled" throws a ZapierApprovalError on approval-required responses without creating an approval. Resolution order is: explicit option, then ZAPIER_APPROVAL_MODE, then the default behavior (poll for interactive TTY, throw otherwise). |
345
+ | `canIncludeSharedConnections` | `boolean` | ❌ | — | — | Allow listing shared connections. |
346
+ | `canIncludeSharedTables` | `boolean` | ❌ | — | — | Allow listing shared tables. |
347
+ | `canDeleteTables` | `boolean` | ❌ | — | — | Allow deleting tables. |
348
348
 
349
349
  ## Named Connections
350
350
 
@@ -13,7 +13,7 @@ import { getZapierBaseUrl, isLocalhostBaseUrl } from "../utils/url-utils";
13
13
  import { sleep, calculateExponentialBackoffMs } from "../utils/retry-utils";
14
14
  import { isPlainObject } from "../utils/type-guard-utils";
15
15
  import { ZapierApiError, ZapierApprovalError, ZapierAuthenticationError, ZapierConfigurationError, ZapierTimeoutError, ZapierValidationError, ZapierResourceNotFoundError, ZapierRateLimitError, } from "../types/errors";
16
- import { MAX_CONCURRENCY_LIMIT, ZAPIER_MAX_CONCURRENT_REQUESTS, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, getZapierApprovalMode, getZapierSdkService, DEFAULT_APPROVAL_TIMEOUT_MS, DEFAULT_MAX_APPROVAL_RETRIES, } from "../constants";
16
+ import { MAX_CONCURRENCY_LIMIT, ZAPIER_MAX_CONCURRENT_REQUESTS, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, getZapierApprovalMode, getZapierDefaultApprovalMode, getZapierSdkService, DEFAULT_APPROVAL_TIMEOUT_MS, DEFAULT_MAX_APPROVAL_RETRIES, } from "../constants";
17
17
  import { SDK_VERSION } from "../sdk-version";
18
18
  import { openApproval } from "../utils/open-approval";
19
19
  import { z } from "zod";
@@ -307,11 +307,10 @@ class ZapierApiClient {
307
307
  // and throw `max_retries_exceeded` below.
308
308
  if (attempt === maxRetries)
309
309
  break;
310
- // Resolve the mode: explicit option > env var > "disabled" (conservative
311
- // default while the approval flow is alpha + opt-in). When disabled,
312
- // surface a distinct status so callers can branch on "enable approvals
313
- // explicitly" vs. a real policy denial.
314
- const mode = this.options.approvalMode ?? getZapierApprovalMode() ?? "disabled";
310
+ // Resolve the mode: explicit option > env var > TTY-based default.
311
+ const mode = this.options.approvalMode ??
312
+ getZapierApprovalMode() ??
313
+ getZapierDefaultApprovalMode();
315
314
  if (mode === "disabled") {
316
315
  throw new ZapierApprovalError("Approvals are disabled. Set approvalMode to 'poll' or 'throw' (or ZAPIER_APPROVAL_MODE) to enable.", { status: "approval_required" });
317
316
  }
@@ -48,13 +48,14 @@ export interface ApiClientOptions {
48
48
  maxConcurrentRequests?: number;
49
49
  /**
50
50
  * Controls how the approval flow is handled.
51
- * - "disabled": (default when env var is unset) Throw a ZapierApprovalError
52
- * on approval-required responses without creating an approval.
53
51
  * - "poll": Create the approval, open the URL in a browser, poll until
54
52
  * resolved, and retry the original request on success.
55
53
  * - "throw": Create the approval and throw a ZapierApprovalError immediately
56
54
  * with the approval URL so the caller can surface it.
57
- * Defaults to the ZAPIER_APPROVAL_MODE env var, then "disabled".
55
+ * - "disabled": Throw a ZapierApprovalError on approval-required responses
56
+ * without creating an approval.
57
+ * Resolution order is: explicit option, then ZAPIER_APPROVAL_MODE, then a
58
+ * TTY-based default ("poll" if interactive, "throw" otherwise).
58
59
  */
59
60
  approvalMode?: "disabled" | "poll" | "throw";
60
61
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EACV,gBAAgB,EAChB,yBAAyB,EAC1B,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EACV,wBAAwB,EACxB,iCAAiC,EAClC,MAAM,oDAAoD,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC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B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAGtE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAGhE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAC;AAGF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,iCAAiC,CACzC,CAAC;AAGF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAC;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,8BAA8B,CACtC,CAAC"}
@@ -48,17 +48,27 @@ export declare function parseConcurrencyEnvVar(name: string): number | undefined
48
48
  export declare const ZAPIER_MAX_CONCURRENT_REQUESTS: number;
49
49
  /**
50
50
  * Approval flow behavior from environment variable.
51
- * - "disabled": (default when env var is unset) Throw a ZapierApprovalError on
52
- * approval-required responses without creating an approval. Callers must
53
- * explicitly opt in to approvals via "poll" or "throw".
54
51
  * - "poll": Create the approval, open the URL in a browser, poll until
55
52
  * resolved, and retry the original request on success.
56
53
  * - "throw": Create the approval and throw a ZapierApprovalError immediately
57
54
  * with the approval URL so the caller can surface it.
55
+ * - "disabled": Throw a ZapierApprovalError on approval-required responses
56
+ * without creating an approval.
58
57
  *
59
- * Read lazily so tests can set the env var after module import.
58
+ * This parser only reflects the env var value. If unset, callers should fall
59
+ * back to getZapierDefaultApprovalMode().
60
+ *
61
+ * Read lazily so tests can set env vars after module import.
60
62
  */
61
63
  export declare function getZapierApprovalMode(): "disabled" | "poll" | "throw" | undefined;
64
+ /**
65
+ * Returns the default approval mode based on whether the process is running in
66
+ * an interactive terminal. If both stdin and stdout are TTYs the user can act
67
+ * on an approval URL immediately, so "poll" is the right default. In a
68
+ * non-interactive context (CI, piped output) the process cannot open a browser
69
+ * or wait for input, so "throw" hands the URL to the caller.
70
+ */
71
+ export declare function getZapierDefaultApprovalMode(): "poll" | "throw";
62
72
  /**
63
73
  * Default timeout for approval polling (10 minutes)
64
74
  */
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe,QACsC,CAAC;AAEnE;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,GAAG,SAAS,CAExD;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,QAAQ,CAAC;AAEpC;;GAEG;AACH,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,yBAAyB,SAAU,CAAC;AAejD;;GAEG;AACH,eAAO,MAAM,0BAA0B,QACY,CAAC;AACpD,eAAO,MAAM,iCAAiC,QACiB,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,QAAS,CAAC;AAE5C,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAYvE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,QACsB,CAAC;AAElE;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,IACjC,UAAU,GACV,MAAM,GACN,OAAO,GACP,SAAS,CAKZ;AAED;;GAEG;AACH,eAAO,MAAM,2BAA2B,QAAiB,CAAC;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,IAAI,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe,QACsC,CAAC;AAEnE;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,GAAG,SAAS,CAExD;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,QAAQ,CAAC;AAEpC;;GAEG;AACH,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,yBAAyB,SAAU,CAAC;AAejD;;GAEG;AACH,eAAO,MAAM,0BAA0B,QACY,CAAC;AACpD,eAAO,MAAM,iCAAiC,QACiB,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,QAAS,CAAC;AAE5C,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAYvE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,QACsB,CAAC;AAElE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,IACjC,UAAU,GACV,MAAM,GACN,OAAO,GACP,SAAS,CAKZ;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,GAAG,OAAO,CAI/D;AAED;;GAEG;AACH,eAAO,MAAM,2BAA2B,QAAiB,CAAC;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,IAAI,CAAC"}
package/dist/constants.js CHANGED
@@ -74,15 +74,17 @@ export function parseConcurrencyEnvVar(name) {
74
74
  export const ZAPIER_MAX_CONCURRENT_REQUESTS = parseConcurrencyEnvVar("ZAPIER_MAX_CONCURRENT_REQUESTS") ?? 200;
75
75
  /**
76
76
  * Approval flow behavior from environment variable.
77
- * - "disabled": (default when env var is unset) Throw a ZapierApprovalError on
78
- * approval-required responses without creating an approval. Callers must
79
- * explicitly opt in to approvals via "poll" or "throw".
80
77
  * - "poll": Create the approval, open the URL in a browser, poll until
81
78
  * resolved, and retry the original request on success.
82
79
  * - "throw": Create the approval and throw a ZapierApprovalError immediately
83
80
  * with the approval URL so the caller can surface it.
81
+ * - "disabled": Throw a ZapierApprovalError on approval-required responses
82
+ * without creating an approval.
84
83
  *
85
- * Read lazily so tests can set the env var after module import.
84
+ * This parser only reflects the env var value. If unset, callers should fall
85
+ * back to getZapierDefaultApprovalMode().
86
+ *
87
+ * Read lazily so tests can set env vars after module import.
86
88
  */
87
89
  export function getZapierApprovalMode() {
88
90
  const value = globalThis.process?.env?.ZAPIER_APPROVAL_MODE;
@@ -90,6 +92,17 @@ export function getZapierApprovalMode() {
90
92
  return value;
91
93
  return undefined;
92
94
  }
95
+ /**
96
+ * Returns the default approval mode based on whether the process is running in
97
+ * an interactive terminal. If both stdin and stdout are TTYs the user can act
98
+ * on an approval URL immediately, so "poll" is the right default. In a
99
+ * non-interactive context (CI, piped output) the process cannot open a browser
100
+ * or wait for input, so "throw" hands the URL to the caller.
101
+ */
102
+ export function getZapierDefaultApprovalMode() {
103
+ const isInteractive = !!globalThis.process?.stdin?.isTTY && !!globalThis.process?.stdout?.isTTY;
104
+ return isInteractive ? "poll" : "throw";
105
+ }
93
106
  /**
94
107
  * Default timeout for approval polling (10 minutes)
95
108
  */
@@ -171,6 +171,10 @@ function getZapierApprovalMode() {
171
171
  return value;
172
172
  return void 0;
173
173
  }
174
+ function getZapierDefaultApprovalMode() {
175
+ const isInteractive = !!globalThis.process?.stdin?.isTTY && !!globalThis.process?.stdout?.isTTY;
176
+ return isInteractive ? "poll" : "throw";
177
+ }
174
178
  var DEFAULT_APPROVAL_TIMEOUT_MS = 10 * 60 * 1e3;
175
179
  var DEFAULT_MAX_APPROVAL_RETRIES = 2;
176
180
 
@@ -2881,7 +2885,7 @@ async function invalidateCredentialsToken(options) {
2881
2885
  }
2882
2886
 
2883
2887
  // src/sdk-version.ts
2884
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.55.0" : void 0) || "unknown";
2888
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.56.0" : void 0) || "unknown";
2885
2889
 
2886
2890
  // src/utils/open-url.ts
2887
2891
  var nodePrefix = "node:";
@@ -3211,7 +3215,7 @@ var ZapierApiClient = class {
3211
3215
  }
3212
3216
  if (errorType !== "approval_required") return response;
3213
3217
  if (attempt === maxRetries) break;
3214
- const mode = this.options.approvalMode ?? getZapierApprovalMode() ?? "disabled";
3218
+ const mode = this.options.approvalMode ?? getZapierApprovalMode() ?? getZapierDefaultApprovalMode();
3215
3219
  if (mode === "disabled") {
3216
3220
  throw new ZapierApprovalError(
3217
3221
  "Approvals are disabled. Set approvalMode to 'poll' or 'throw' (or ZAPIER_APPROVAL_MODE) to enable.",
@@ -10598,7 +10602,7 @@ var BaseSdkOptionsSchema = zod.z.object({
10598
10602
  "Maximum number of sequential approval rounds per request (one per gating policy) before giving up. Default: 2."
10599
10603
  ),
10600
10604
  approvalMode: zod.z.enum(["disabled", "poll", "throw"]).optional().describe(
10601
- '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".'
10605
+ 'Approval flow behavior. "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. "disabled" throws a ZapierApprovalError on approval-required responses without creating an approval. Resolution order is: explicit option, then ZAPIER_APPROVAL_MODE, then the default behavior (poll for interactive TTY, throw otherwise).'
10602
10606
  ),
10603
10607
  // Internal
10604
10608
  manifestPath: zod.z.string().optional().describe("Path to a .zapierrc manifest file for app version locking.").meta({ internal: true }),
@@ -10765,6 +10769,7 @@ exports.getTablePlugin = getTablePlugin;
10765
10769
  exports.getTableRecordPlugin = getTableRecordPlugin;
10766
10770
  exports.getTokenFromCliLogin = getTokenFromCliLogin;
10767
10771
  exports.getZapierApprovalMode = getZapierApprovalMode;
10772
+ exports.getZapierDefaultApprovalMode = getZapierDefaultApprovalMode;
10768
10773
  exports.getZapierSdkService = getZapierSdkService;
10769
10774
  exports.injectCliLogin = injectCliLogin;
10770
10775
  exports.inputFieldKeyResolver = inputFieldKeyResolver;
@@ -1,5 +1,5 @@
1
- import { B as BaseSdkOptions, W as WithAddPlugin, P as PluginMeta, Z as ZapierSdkOptions$1, E as EventEmissionContext, A as ApiClient, M as Manifest, R as ResolvedAppLocator, U as UpdateManifestEntryOptions, a as UpdateManifestEntryResult, b as AddActionEntryOptions, c as AddActionEntryResult, d as ActionEntry, f as findManifestEntry, r as readManifestFromFile, C as CapabilitiesContext, e as PaginatedSdkResult, F as FieldsetItem, g as PositionalMetadata, h as ZapierFetchInitOptions, D as DrainTriggerInboxOptions, i as DynamicResolver, j as WatchTriggerInboxOptions, k as ActionProxy, l as ZapierSdkApps } from './index-DjQ4XDAV.mjs';
2
- export { u as Action, ci as ActionExecutionOptions, y as ActionExecutionResult, z as ActionField, H as ActionFieldChoice, aW as ActionItem, bx as ActionKeyProperty, b5 as ActionKeyPropertySchema, by as ActionProperty, b6 as ActionPropertySchema, as as ActionResolverItem, bJ as ActionTimeoutMsProperty, bh as ActionTimeoutMsPropertySchema, at as ActionTypeItem, bw as ActionTypeProperty, b4 as ActionTypePropertySchema, bW as ApiError, dE as ApiEvent, d0 as ApiPluginOptions, d2 as ApiPluginProvides, v as App, cj as AppFactoryInput, aU as AppItem, bu as AppKeyProperty, b2 as AppKeyPropertySchema, bv as AppProperty, b3 as AppPropertySchema, aD as ApplicationLifecycleEventData, cb as ApprovalStatus, ch as AppsPluginProvides, bO as AppsProperty, bm as AppsPropertySchema, a0 as ArrayResolver, dD as AuthEvent, bC as AuthenticationIdProperty, b9 as AuthenticationIdPropertySchema, az as BaseEvent, al as BaseSdkOptionsSchema, aa as BatchOptions, cP as CONTEXT_CACHE_MAX_SIZE, cO as CONTEXT_CACHE_TTL_MS, x as Choice, dK as ClientCredentialsObject, dV as ClientCredentialsObjectSchema, K as Connection, e1 as ConnectionEntry, e0 as ConnectionEntrySchema, bA as ConnectionIdProperty, b8 as ConnectionIdPropertySchema, aV as ConnectionItem, bB as ConnectionProperty, ba as ConnectionPropertySchema, e3 as ConnectionsMap, e2 as ConnectionsMapSchema, e5 as ConnectionsPluginProvides, bQ as ConnectionsProperty, bo as ConnectionsPropertySchema, O as ConnectionsResponse, cB as CreateClientCredentialsPluginProvides, eu as CreateTableFieldsPluginProvides, eo as CreateTablePluginProvides, eC as CreateTableRecordsPluginProvides, dH as Credentials, d_ as CredentialsFunction, dZ as CredentialsFunctionSchema, dJ as CredentialsObject, dX as CredentialsObjectSchema, d$ as CredentialsSchema, ea as DEFAULT_ACTION_TIMEOUT_MS, eh as DEFAULT_APPROVAL_TIMEOUT_MS, cY as DEFAULT_CONFIG_PATH, ei as DEFAULT_MAX_APPROVAL_RETRIES, e9 as DEFAULT_PAGE_SIZE, bH as DebugProperty, bf as DebugPropertySchema, cD as DeleteClientCredentialsPluginProvides, ew as DeleteTableFieldsPluginProvides, eq as DeleteTablePluginProvides, eE as DeleteTableRecordsPluginProvides, o as DrainTriggerInboxCallback, p as DrainTriggerInboxErrorObserver, a3 as DynamicListResolver, a4 as DynamicSearchResolver, aE as EnhancedErrorEventData, bX as ErrorOptions, dG as EventCallback, aC as EventContext, aB as EventEmissionProvides, cl as FetchPluginProvides, w as Field, bN as FieldsProperty, bl as FieldsPropertySchema, a5 as FieldsResolver, s as FindFirstAuthenticationPluginProvides, cL as FindFirstConnectionPluginProvides, t as FindUniqueAuthenticationPluginProvides, cN as FindUniqueConnectionPluginProvides, Y as FormatMetadata, X as FormattedItem, ak as FunctionDeprecation, a$ as FunctionOptions, aj as FunctionRegistryEntry, cv as GetActionInputFieldsSchemaPluginProvides, cH as GetActionPluginProvides, cF as GetAppPluginProvides, G as GetAuthenticationPluginProvides, cJ as GetConnectionPluginProvides, c$ as GetProfilePluginProvides, em as GetTablePluginProvides, ey as GetTableRecordPluginProvides, aY as InfoFieldItem, aX as InputFieldItem, bz as InputFieldProperty, b7 as InputFieldPropertySchema, bD as InputsProperty, bb as InputsPropertySchema, bV as LeaseLimitProperty, bt as LeaseLimitPropertySchema, bT as LeaseProperty, br as LeasePropertySchema, bU as LeaseSecondsProperty, bs as LeaseSecondsPropertySchema, L as LeasedTriggerMessageItem, bE as LimitProperty, bc as LimitPropertySchema, ct as ListActionInputFieldChoicesPluginProvides, cr as ListActionInputFieldsPluginProvides, cp as ListActionsPluginProvides, cn as ListAppsPluginProvides, q as ListAuthenticationsPluginProvides, cz as ListClientCredentialsPluginProvides, cx as ListConnectionsPluginProvides, es as ListTableFieldsPluginProvides, eA as ListTableRecordsPluginProvides, ek as ListTablesPluginProvides, dF as LoadingEvent, ed as MAX_CONCURRENCY_LIMIT, e8 as MAX_PAGE_LIMIT, cZ as ManifestEntry, cU as ManifestPluginOptions, cX as ManifestPluginProvides, aA as MethodCalledEvent, aF as MethodCalledEventData, N as Need, I as NeedsRequest, J as NeedsResponse, bF as OffsetProperty, bd as OffsetPropertySchema, _ as OutputFormatter, bG as OutputProperty, be as OutputPropertySchema, b1 as PaginatedSdkFunction, bI as ParamsProperty, bg as ParamsPropertySchema, dL as PkceCredentialsObject, dW as PkceCredentialsObjectSchema, am as Plugin, an as PluginProvides, aw as PollOptions, c9 as RateLimitInfo, bL as RecordProperty, bj as RecordPropertySchema, bM as RecordsProperty, bk as RecordsPropertySchema, af as RelayFetchSchema, ae as RelayRequestSchema, av as RequestOptions, cT as RequestPluginProvides, dq as ResolveAuthTokenOptions, dQ as ResolveCredentialsOptions, dI as ResolvedCredentials, dY as ResolvedCredentialsSchema, $ as Resolver, a1 as ResolverMetadata, aZ as RootFieldItem, cR as RunActionPluginProvides, dC as SdkEvent, b0 as SdkPage, a2 as StaticResolver, bK as TableProperty, bi as TablePropertySchema, bP as TablesProperty, bn as TablesPropertySchema, bS as TriggerInboxNameProperty, bq as TriggerInboxNamePropertySchema, bR as TriggerInboxProperty, bp as TriggerInboxPropertySchema, T as TriggerMessageStatus, eG as UpdateTableRecordsPluginProvides, Q as UserProfile, a_ as UserProfileItem, e6 as ZAPIER_BASE_URL, ef as ZAPIER_MAX_CONCURRENT_REQUESTS, eb as ZAPIER_MAX_NETWORK_RETRIES, ec as ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, m as ZapierAbortDrainSignal, c7 as ZapierActionError, bZ as ZapierApiError, b_ as ZapierAppNotFoundError, cc as ZapierApprovalError, c1 as ZapierAuthenticationError, c5 as ZapierBundleError, dy as ZapierCache, dz as ZapierCacheEntry, dA as ZapierCacheSetOptions, c4 as ZapierConfigurationError, c8 as ZapierConflictError, bY as ZapierError, c2 as ZapierNotFoundError, ca as ZapierRateLimitError, cd as ZapierRelayError, n as ZapierReleaseTriggerMessageSignal, c3 as ZapierResourceNotFoundError, cf as ZapierSignal, c6 as ZapierTimeoutError, c0 as ZapierUnknownError, b$ as ZapierValidationError, d5 as actionKeyResolver, d4 as actionTypeResolver, d1 as apiPlugin, d3 as appKeyResolver, cg as appsPlugin, d7 as authenticationIdGenericResolver, d6 as authenticationIdResolver, a9 as batch, aP as buildApplicationLifecycleEvent, ab as buildCapabilityMessage, aR as buildErrorEvent, aQ as buildErrorEventWithContext, aT as buildMethodCalledEvent, dr as clearTokenCache, db as clientCredentialsNameResolver, dc as clientIdResolver, ar as composePlugins, d7 as connectionIdGenericResolver, d6 as connectionIdResolver, e4 as connectionsPlugin, aS as createBaseEvent, cA as createClientCredentialsPlugin, V as createFunction, dB as createMemoryCache, ai as createOptionsPlugin, aq as createPaginatedPluginMethod, ap as createPluginMethod, ah as createSdk, et as createTableFieldsPlugin, en as createTablePlugin, eB as createTableRecordsPlugin, ax as createZapierApi, ag as createZapierSdkWithoutRegistry, ao as definePlugin, cC as deleteClientCredentialsPlugin, ev as deleteTableFieldsPlugin, ep as deleteTablePlugin, eD as deleteTableRecordsPlugin, ck as fetchPlugin, cK as findFirstConnectionPlugin, cM as findUniqueConnectionPlugin, ce as formatErrorMessage, aG as generateEventId, cu as getActionInputFieldsSchemaPlugin, cG as getActionPlugin, cE as getAppPlugin, dT as getBaseUrlFromCredentials, aM as getCiPlatform, dU as getClientIdFromCredentials, cI as getConnectionPlugin, aO as getCpuTime, aH as getCurrentTimestamp, aN as getMemoryUsage, ay as getOrCreateApiClient, aJ as getOsInfo, aK as getPlatformVersions, cV as getPreferredManifestEntryKey, c_ as getProfilePlugin, aI as getReleaseId, el as getTablePlugin, ex as getTableRecordPlugin, dv as getTokenFromCliLogin, eg as getZapierApprovalMode, e7 as getZapierSdkService, dt as injectCliLogin, da as inputFieldKeyResolver, d9 as inputsAllOptionalResolver, d8 as inputsResolver, ds as invalidateCachedToken, dx as invalidateCredentialsToken, aL as isCi, du as isCliLoginAvailable, dM as isClientCredentials, dP as isCredentialsFunction, dO as isCredentialsObject, dN as isPkceCredentials, S as isPositional, cs as listActionInputFieldChoicesPlugin, cq as listActionInputFieldsPlugin, co as listActionsPlugin, cm as listAppsPlugin, cy as listClientCredentialsPlugin, cw as listConnectionsPlugin, er as listTableFieldsPlugin, ez as listTableRecordsPlugin, ej as listTablesPlugin, ac as logDeprecation, cW as manifestPlugin, ee as parseConcurrencyEnvVar, au as registryPlugin, cS as requestPlugin, ad as resetDeprecationWarnings, dw as resolveAuthToken, dS as resolveCredentials, dR as resolveCredentialsFromEnv, cQ as runActionPlugin, a6 as runWithTelemetryContext, di as tableFieldIdsResolver, dk as tableFieldsResolver, dn as tableFiltersResolver, dd as tableIdResolver, dj as tableNameResolver, dg as tableRecordIdResolver, dh as tableRecordIdsResolver, dl as tableRecordsResolver, dp as tableSortResolver, dm as tableUpdateRecordsResolver, a7 as toSnakeCase, a8 as toTitleCase, de as triggerInboxResolver, df as triggerMessagesResolver, eF as updateTableRecordsPlugin } from './index-DjQ4XDAV.mjs';
1
+ import { B as BaseSdkOptions, W as WithAddPlugin, P as PluginMeta, Z as ZapierSdkOptions$1, E as EventEmissionContext, A as ApiClient, M as Manifest, R as ResolvedAppLocator, U as UpdateManifestEntryOptions, a as UpdateManifestEntryResult, b as AddActionEntryOptions, c as AddActionEntryResult, d as ActionEntry, f as findManifestEntry, r as readManifestFromFile, C as CapabilitiesContext, e as PaginatedSdkResult, F as FieldsetItem, g as PositionalMetadata, h as ZapierFetchInitOptions, D as DrainTriggerInboxOptions, i as DynamicResolver, j as WatchTriggerInboxOptions, k as ActionProxy, l as ZapierSdkApps } from './index-CjP7lGzL.mjs';
2
+ export { u as Action, ci as ActionExecutionOptions, y as ActionExecutionResult, z as ActionField, H as ActionFieldChoice, aW as ActionItem, bx as ActionKeyProperty, b5 as ActionKeyPropertySchema, by as ActionProperty, b6 as ActionPropertySchema, as as ActionResolverItem, bJ as ActionTimeoutMsProperty, bh as ActionTimeoutMsPropertySchema, at as ActionTypeItem, bw as ActionTypeProperty, b4 as ActionTypePropertySchema, bW as ApiError, dE as ApiEvent, d0 as ApiPluginOptions, d2 as ApiPluginProvides, v as App, cj as AppFactoryInput, aU as AppItem, bu as AppKeyProperty, b2 as AppKeyPropertySchema, bv as AppProperty, b3 as AppPropertySchema, aD as ApplicationLifecycleEventData, cb as ApprovalStatus, ch as AppsPluginProvides, bO as AppsProperty, bm as AppsPropertySchema, a0 as ArrayResolver, dD as AuthEvent, bC as AuthenticationIdProperty, b9 as AuthenticationIdPropertySchema, az as BaseEvent, al as BaseSdkOptionsSchema, aa as BatchOptions, cP as CONTEXT_CACHE_MAX_SIZE, cO as CONTEXT_CACHE_TTL_MS, x as Choice, dK as ClientCredentialsObject, dV as ClientCredentialsObjectSchema, K as Connection, e1 as ConnectionEntry, e0 as ConnectionEntrySchema, bA as ConnectionIdProperty, b8 as ConnectionIdPropertySchema, aV as ConnectionItem, bB as ConnectionProperty, ba as ConnectionPropertySchema, e3 as ConnectionsMap, e2 as ConnectionsMapSchema, e5 as ConnectionsPluginProvides, bQ as ConnectionsProperty, bo as ConnectionsPropertySchema, O as ConnectionsResponse, cB as CreateClientCredentialsPluginProvides, ev as CreateTableFieldsPluginProvides, ep as CreateTablePluginProvides, eD as CreateTableRecordsPluginProvides, dH as Credentials, d_ as CredentialsFunction, dZ as CredentialsFunctionSchema, dJ as CredentialsObject, dX as CredentialsObjectSchema, d$ as CredentialsSchema, ea as DEFAULT_ACTION_TIMEOUT_MS, ei as DEFAULT_APPROVAL_TIMEOUT_MS, cY as DEFAULT_CONFIG_PATH, ej as DEFAULT_MAX_APPROVAL_RETRIES, e9 as DEFAULT_PAGE_SIZE, bH as DebugProperty, bf as DebugPropertySchema, cD as DeleteClientCredentialsPluginProvides, ex as DeleteTableFieldsPluginProvides, er as DeleteTablePluginProvides, eF as DeleteTableRecordsPluginProvides, o as DrainTriggerInboxCallback, p as DrainTriggerInboxErrorObserver, a3 as DynamicListResolver, a4 as DynamicSearchResolver, aE as EnhancedErrorEventData, bX as ErrorOptions, dG as EventCallback, aC as EventContext, aB as EventEmissionProvides, cl as FetchPluginProvides, w as Field, bN as FieldsProperty, bl as FieldsPropertySchema, a5 as FieldsResolver, s as FindFirstAuthenticationPluginProvides, cL as FindFirstConnectionPluginProvides, t as FindUniqueAuthenticationPluginProvides, cN as FindUniqueConnectionPluginProvides, Y as FormatMetadata, X as FormattedItem, ak as FunctionDeprecation, a$ as FunctionOptions, aj as FunctionRegistryEntry, cv as GetActionInputFieldsSchemaPluginProvides, cH as GetActionPluginProvides, cF as GetAppPluginProvides, G as GetAuthenticationPluginProvides, cJ as GetConnectionPluginProvides, c$ as GetProfilePluginProvides, en as GetTablePluginProvides, ez as GetTableRecordPluginProvides, aY as InfoFieldItem, aX as InputFieldItem, bz as InputFieldProperty, b7 as InputFieldPropertySchema, bD as InputsProperty, bb as InputsPropertySchema, bV as LeaseLimitProperty, bt as LeaseLimitPropertySchema, bT as LeaseProperty, br as LeasePropertySchema, bU as LeaseSecondsProperty, bs as LeaseSecondsPropertySchema, L as LeasedTriggerMessageItem, bE as LimitProperty, bc as LimitPropertySchema, ct as ListActionInputFieldChoicesPluginProvides, cr as ListActionInputFieldsPluginProvides, cp as ListActionsPluginProvides, cn as ListAppsPluginProvides, q as ListAuthenticationsPluginProvides, cz as ListClientCredentialsPluginProvides, cx as ListConnectionsPluginProvides, et as ListTableFieldsPluginProvides, eB as ListTableRecordsPluginProvides, el as ListTablesPluginProvides, dF as LoadingEvent, ed as MAX_CONCURRENCY_LIMIT, e8 as MAX_PAGE_LIMIT, cZ as ManifestEntry, cU as ManifestPluginOptions, cX as ManifestPluginProvides, aA as MethodCalledEvent, aF as MethodCalledEventData, N as Need, I as NeedsRequest, J as NeedsResponse, bF as OffsetProperty, bd as OffsetPropertySchema, _ as OutputFormatter, bG as OutputProperty, be as OutputPropertySchema, b1 as PaginatedSdkFunction, bI as ParamsProperty, bg as ParamsPropertySchema, dL as PkceCredentialsObject, dW as PkceCredentialsObjectSchema, am as Plugin, an as PluginProvides, aw as PollOptions, c9 as RateLimitInfo, bL as RecordProperty, bj as RecordPropertySchema, bM as RecordsProperty, bk as RecordsPropertySchema, af as RelayFetchSchema, ae as RelayRequestSchema, av as RequestOptions, cT as RequestPluginProvides, dq as ResolveAuthTokenOptions, dQ as ResolveCredentialsOptions, dI as ResolvedCredentials, dY as ResolvedCredentialsSchema, $ as Resolver, a1 as ResolverMetadata, aZ as RootFieldItem, cR as RunActionPluginProvides, dC as SdkEvent, b0 as SdkPage, a2 as StaticResolver, bK as TableProperty, bi as TablePropertySchema, bP as TablesProperty, bn as TablesPropertySchema, bS as TriggerInboxNameProperty, bq as TriggerInboxNamePropertySchema, bR as TriggerInboxProperty, bp as TriggerInboxPropertySchema, T as TriggerMessageStatus, eH as UpdateTableRecordsPluginProvides, Q as UserProfile, a_ as UserProfileItem, e6 as ZAPIER_BASE_URL, ef as ZAPIER_MAX_CONCURRENT_REQUESTS, eb as ZAPIER_MAX_NETWORK_RETRIES, ec as ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, m as ZapierAbortDrainSignal, c7 as ZapierActionError, bZ as ZapierApiError, b_ as ZapierAppNotFoundError, cc as ZapierApprovalError, c1 as ZapierAuthenticationError, c5 as ZapierBundleError, dy as ZapierCache, dz as ZapierCacheEntry, dA as ZapierCacheSetOptions, c4 as ZapierConfigurationError, c8 as ZapierConflictError, bY as ZapierError, c2 as ZapierNotFoundError, ca as ZapierRateLimitError, cd as ZapierRelayError, n as ZapierReleaseTriggerMessageSignal, c3 as ZapierResourceNotFoundError, cf as ZapierSignal, c6 as ZapierTimeoutError, c0 as ZapierUnknownError, b$ as ZapierValidationError, d5 as actionKeyResolver, d4 as actionTypeResolver, d1 as apiPlugin, d3 as appKeyResolver, cg as appsPlugin, d7 as authenticationIdGenericResolver, d6 as authenticationIdResolver, a9 as batch, aP as buildApplicationLifecycleEvent, ab as buildCapabilityMessage, aR as buildErrorEvent, aQ as buildErrorEventWithContext, aT as buildMethodCalledEvent, dr as clearTokenCache, db as clientCredentialsNameResolver, dc as clientIdResolver, ar as composePlugins, d7 as connectionIdGenericResolver, d6 as connectionIdResolver, e4 as connectionsPlugin, aS as createBaseEvent, cA as createClientCredentialsPlugin, V as createFunction, dB as createMemoryCache, ai as createOptionsPlugin, aq as createPaginatedPluginMethod, ap as createPluginMethod, ah as createSdk, eu as createTableFieldsPlugin, eo as createTablePlugin, eC as createTableRecordsPlugin, ax as createZapierApi, ag as createZapierSdkWithoutRegistry, ao as definePlugin, cC as deleteClientCredentialsPlugin, ew as deleteTableFieldsPlugin, eq as deleteTablePlugin, eE as deleteTableRecordsPlugin, ck as fetchPlugin, cK as findFirstConnectionPlugin, cM as findUniqueConnectionPlugin, ce as formatErrorMessage, aG as generateEventId, cu as getActionInputFieldsSchemaPlugin, cG as getActionPlugin, cE as getAppPlugin, dT as getBaseUrlFromCredentials, aM as getCiPlatform, dU as getClientIdFromCredentials, cI as getConnectionPlugin, aO as getCpuTime, aH as getCurrentTimestamp, aN as getMemoryUsage, ay as getOrCreateApiClient, aJ as getOsInfo, aK as getPlatformVersions, cV as getPreferredManifestEntryKey, c_ as getProfilePlugin, aI as getReleaseId, em as getTablePlugin, ey as getTableRecordPlugin, dv as getTokenFromCliLogin, eg as getZapierApprovalMode, eh as getZapierDefaultApprovalMode, e7 as getZapierSdkService, dt as injectCliLogin, da as inputFieldKeyResolver, d9 as inputsAllOptionalResolver, d8 as inputsResolver, ds as invalidateCachedToken, dx as invalidateCredentialsToken, aL as isCi, du as isCliLoginAvailable, dM as isClientCredentials, dP as isCredentialsFunction, dO as isCredentialsObject, dN as isPkceCredentials, S as isPositional, cs as listActionInputFieldChoicesPlugin, cq as listActionInputFieldsPlugin, co as listActionsPlugin, cm as listAppsPlugin, cy as listClientCredentialsPlugin, cw as listConnectionsPlugin, es as listTableFieldsPlugin, eA as listTableRecordsPlugin, ek as listTablesPlugin, ac as logDeprecation, cW as manifestPlugin, ee as parseConcurrencyEnvVar, au as registryPlugin, cS as requestPlugin, ad as resetDeprecationWarnings, dw as resolveAuthToken, dS as resolveCredentials, dR as resolveCredentialsFromEnv, cQ as runActionPlugin, a6 as runWithTelemetryContext, di as tableFieldIdsResolver, dk as tableFieldsResolver, dn as tableFiltersResolver, dd as tableIdResolver, dj as tableNameResolver, dg as tableRecordIdResolver, dh as tableRecordIdsResolver, dl as tableRecordsResolver, dp as tableSortResolver, dm as tableUpdateRecordsResolver, a7 as toSnakeCase, a8 as toTitleCase, de as triggerInboxResolver, df as triggerMessagesResolver, eG as updateTableRecordsPlugin } from './index-CjP7lGzL.mjs';
3
3
  import * as zod_v4_core from 'zod/v4/core';
4
4
  import * as zod from 'zod';
5
5
  import '@zapier/zapier-sdk-core/v0/schemas/connections';
@@ -169,6 +169,10 @@ function getZapierApprovalMode() {
169
169
  return value;
170
170
  return void 0;
171
171
  }
172
+ function getZapierDefaultApprovalMode() {
173
+ const isInteractive = !!globalThis.process?.stdin?.isTTY && !!globalThis.process?.stdout?.isTTY;
174
+ return isInteractive ? "poll" : "throw";
175
+ }
172
176
  var DEFAULT_APPROVAL_TIMEOUT_MS = 10 * 60 * 1e3;
173
177
  var DEFAULT_MAX_APPROVAL_RETRIES = 2;
174
178
 
@@ -2879,7 +2883,7 @@ async function invalidateCredentialsToken(options) {
2879
2883
  }
2880
2884
 
2881
2885
  // src/sdk-version.ts
2882
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.55.0" : void 0) || "unknown";
2886
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.56.0" : void 0) || "unknown";
2883
2887
 
2884
2888
  // src/utils/open-url.ts
2885
2889
  var nodePrefix = "node:";
@@ -3209,7 +3213,7 @@ var ZapierApiClient = class {
3209
3213
  }
3210
3214
  if (errorType !== "approval_required") return response;
3211
3215
  if (attempt === maxRetries) break;
3212
- const mode = this.options.approvalMode ?? getZapierApprovalMode() ?? "disabled";
3216
+ const mode = this.options.approvalMode ?? getZapierApprovalMode() ?? getZapierDefaultApprovalMode();
3213
3217
  if (mode === "disabled") {
3214
3218
  throw new ZapierApprovalError(
3215
3219
  "Approvals are disabled. Set approvalMode to 'poll' or 'throw' (or ZAPIER_APPROVAL_MODE) to enable.",
@@ -10596,7 +10600,7 @@ var BaseSdkOptionsSchema = z.object({
10596
10600
  "Maximum number of sequential approval rounds per request (one per gating policy) before giving up. Default: 2."
10597
10601
  ),
10598
10602
  approvalMode: z.enum(["disabled", "poll", "throw"]).optional().describe(
10599
- '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".'
10603
+ 'Approval flow behavior. "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. "disabled" throws a ZapierApprovalError on approval-required responses without creating an approval. Resolution order is: explicit option, then ZAPIER_APPROVAL_MODE, then the default behavior (poll for interactive TTY, throw otherwise).'
10600
10604
  ),
10601
10605
  // Internal
10602
10606
  manifestPath: z.string().optional().describe("Path to a .zapierrc manifest file for app version locking.").meta({ internal: true }),
@@ -10627,4 +10631,4 @@ function createZapierSdk2(options = {}) {
10627
10631
  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(listTriggersPlugin).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);
10628
10632
  }
10629
10633
 
10630
- 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_CONCURRENCY_LIMIT, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RecordPropertySchema, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, TablePropertySchema, TablesPropertySchema, TriggerInboxNamePropertySchema, TriggerInboxPropertySchema, ZAPIER_BASE_URL, ZAPIER_MAX_CONCURRENT_REQUESTS, 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, parseConcurrencyEnvVar, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, runWithTelemetryContext, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, triggerInboxResolver, triggerMessagesResolver, updateTableRecordsPlugin };
10634
+ 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_CONCURRENCY_LIMIT, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RecordPropertySchema, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, TablePropertySchema, TablesPropertySchema, TriggerInboxNamePropertySchema, TriggerInboxPropertySchema, ZAPIER_BASE_URL, ZAPIER_MAX_CONCURRENT_REQUESTS, 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, getZapierDefaultApprovalMode, 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, parseConcurrencyEnvVar, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, runWithTelemetryContext, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, triggerInboxResolver, triggerMessagesResolver, updateTableRecordsPlugin };
@@ -710,13 +710,14 @@ interface ApiClientOptions {
710
710
  maxConcurrentRequests?: number;
711
711
  /**
712
712
  * Controls how the approval flow is handled.
713
- * - "disabled": (default when env var is unset) Throw a ZapierApprovalError
714
- * on approval-required responses without creating an approval.
715
713
  * - "poll": Create the approval, open the URL in a browser, poll until
716
714
  * resolved, and retry the original request on success.
717
715
  * - "throw": Create the approval and throw a ZapierApprovalError immediately
718
716
  * with the approval URL so the caller can surface it.
719
- * Defaults to the ZAPIER_APPROVAL_MODE env var, then "disabled".
717
+ * - "disabled": Throw a ZapierApprovalError on approval-required responses
718
+ * without creating an approval.
719
+ * Resolution order is: explicit option, then ZAPIER_APPROVAL_MODE, then a
720
+ * TTY-based default ("poll" if interactive, "throw" otherwise).
720
721
  */
721
722
  approvalMode?: "disabled" | "poll" | "throw";
722
723
  /**
@@ -8876,17 +8877,27 @@ declare function parseConcurrencyEnvVar(name: string): number | undefined;
8876
8877
  declare const ZAPIER_MAX_CONCURRENT_REQUESTS: number;
8877
8878
  /**
8878
8879
  * Approval flow behavior from environment variable.
8879
- * - "disabled": (default when env var is unset) Throw a ZapierApprovalError on
8880
- * approval-required responses without creating an approval. Callers must
8881
- * explicitly opt in to approvals via "poll" or "throw".
8882
8880
  * - "poll": Create the approval, open the URL in a browser, poll until
8883
8881
  * resolved, and retry the original request on success.
8884
8882
  * - "throw": Create the approval and throw a ZapierApprovalError immediately
8885
8883
  * with the approval URL so the caller can surface it.
8884
+ * - "disabled": Throw a ZapierApprovalError on approval-required responses
8885
+ * without creating an approval.
8886
8886
  *
8887
- * Read lazily so tests can set the env var after module import.
8887
+ * This parser only reflects the env var value. If unset, callers should fall
8888
+ * back to getZapierDefaultApprovalMode().
8889
+ *
8890
+ * Read lazily so tests can set env vars after module import.
8888
8891
  */
8889
8892
  declare function getZapierApprovalMode(): "disabled" | "poll" | "throw" | undefined;
8893
+ /**
8894
+ * Returns the default approval mode based on whether the process is running in
8895
+ * an interactive terminal. If both stdin and stdout are TTYs the user can act
8896
+ * on an approval URL immediately, so "poll" is the right default. In a
8897
+ * non-interactive context (CI, piped output) the process cannot open a browser
8898
+ * or wait for input, so "throw" hands the URL to the caller.
8899
+ */
8900
+ declare function getZapierDefaultApprovalMode(): "poll" | "throw";
8890
8901
  /**
8891
8902
  * Default timeout for approval polling (10 minutes)
8892
8903
  */
@@ -9767,4 +9778,4 @@ declare const registryPlugin: (sdk: {
9767
9778
  };
9768
9779
  }) => {};
9769
9780
 
9770
- 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 FunctionOptions as a$, type ArrayResolver as a0, type ResolverMetadata as a1, type StaticResolver as a2, type DynamicListResolver as a3, type DynamicSearchResolver as a4, type FieldsResolver as a5, runWithTelemetryContext as a6, toSnakeCase as a7, toTitleCase as a8, batch as a9, type MethodCalledEvent as aA, type EventEmissionProvides as aB, type EventContext as aC, type ApplicationLifecycleEventData as aD, type EnhancedErrorEventData as aE, type MethodCalledEventData as aF, generateEventId as aG, getCurrentTimestamp as aH, getReleaseId as aI, getOsInfo as aJ, getPlatformVersions as aK, isCi as aL, getCiPlatform as aM, getMemoryUsage as aN, getCpuTime as aO, buildApplicationLifecycleEvent as aP, buildErrorEventWithContext as aQ, buildErrorEvent as aR, createBaseEvent as aS, buildMethodCalledEvent as aT, type AppItem as aU, type ConnectionItem as aV, type ActionItem$1 as aW, type InputFieldItem as aX, type InfoFieldItem as aY, type RootFieldItem as aZ, type UserProfileItem as a_, type BatchOptions as aa, buildCapabilityMessage as ab, logDeprecation as ac, resetDeprecationWarnings as ad, RelayRequestSchema as ae, RelayFetchSchema as af, createZapierSdkWithoutRegistry as ag, createSdk as ah, createOptionsPlugin as ai, type FunctionRegistryEntry as aj, type FunctionDeprecation as ak, BaseSdkOptionsSchema as al, type Plugin as am, type PluginProvides as an, definePlugin as ao, createPluginMethod as ap, createPaginatedPluginMethod as aq, composePlugins as ar, type ActionItem as as, type ActionTypeItem as at, registryPlugin as au, type RequestOptions as av, type PollOptions as aw, createZapierApi as ax, getOrCreateApiClient as ay, type BaseEvent as az, type AddActionEntryOptions as b, ZapierValidationError as b$, type SdkPage as b0, type PaginatedSdkFunction as b1, AppKeyPropertySchema as b2, AppPropertySchema as b3, ActionTypePropertySchema as b4, ActionKeyPropertySchema as b5, ActionPropertySchema as b6, InputFieldPropertySchema as b7, ConnectionIdPropertySchema as b8, AuthenticationIdPropertySchema as b9, type ConnectionIdProperty as bA, type ConnectionProperty as bB, type AuthenticationIdProperty as bC, type InputsProperty as bD, type LimitProperty as bE, type OffsetProperty as bF, type OutputProperty as bG, type DebugProperty as bH, type ParamsProperty as bI, type ActionTimeoutMsProperty as bJ, type TableProperty as bK, type RecordProperty as bL, type RecordsProperty as bM, type FieldsProperty as bN, type AppsProperty as bO, type TablesProperty as bP, type ConnectionsProperty as bQ, type TriggerInboxProperty as bR, type TriggerInboxNameProperty as bS, type LeaseProperty as bT, type LeaseSecondsProperty as bU, type LeaseLimitProperty as bV, type ApiError as bW, type ErrorOptions as bX, ZapierError as bY, ZapierApiError as bZ, ZapierAppNotFoundError as b_, ConnectionPropertySchema as ba, InputsPropertySchema as bb, LimitPropertySchema as bc, OffsetPropertySchema as bd, OutputPropertySchema as be, DebugPropertySchema as bf, ParamsPropertySchema as bg, ActionTimeoutMsPropertySchema as bh, TablePropertySchema as bi, RecordPropertySchema as bj, RecordsPropertySchema as bk, FieldsPropertySchema as bl, AppsPropertySchema as bm, TablesPropertySchema as bn, ConnectionsPropertySchema as bo, TriggerInboxPropertySchema as bp, TriggerInboxNamePropertySchema as bq, LeasePropertySchema as br, LeaseSecondsPropertySchema as bs, LeaseLimitPropertySchema as bt, type AppKeyProperty as bu, type AppProperty as bv, type ActionTypeProperty as bw, type ActionKeyProperty as bx, type ActionProperty as by, type InputFieldProperty as bz, type AddActionEntryResult as c, type GetProfilePluginProvides as c$, ZapierUnknownError as c0, ZapierAuthenticationError as c1, ZapierNotFoundError as c2, ZapierResourceNotFoundError as c3, ZapierConfigurationError as c4, ZapierBundleError as c5, ZapierTimeoutError as c6, ZapierActionError as c7, ZapierConflictError as c8, type RateLimitInfo as c9, createClientCredentialsPlugin as cA, type CreateClientCredentialsPluginProvides as cB, deleteClientCredentialsPlugin as cC, type DeleteClientCredentialsPluginProvides as cD, getAppPlugin as cE, type GetAppPluginProvides as cF, getActionPlugin as cG, type GetActionPluginProvides as cH, getConnectionPlugin as cI, type GetConnectionPluginProvides as cJ, findFirstConnectionPlugin as cK, type FindFirstConnectionPluginProvides as cL, findUniqueConnectionPlugin as cM, type FindUniqueConnectionPluginProvides as cN, CONTEXT_CACHE_TTL_MS as cO, CONTEXT_CACHE_MAX_SIZE as cP, runActionPlugin as cQ, type RunActionPluginProvides as cR, requestPlugin as cS, type RequestPluginProvides as cT, type ManifestPluginOptions as cU, getPreferredManifestEntryKey as cV, manifestPlugin as cW, type ManifestPluginProvides as cX, DEFAULT_CONFIG_PATH as cY, type ManifestEntry as cZ, getProfilePlugin as c_, ZapierRateLimitError as ca, type ApprovalStatus as cb, ZapierApprovalError as cc, ZapierRelayError as cd, formatErrorMessage as ce, ZapierSignal as cf, appsPlugin as cg, type AppsPluginProvides as ch, type ActionExecutionOptions as ci, type AppFactoryInput as cj, fetchPlugin as ck, type FetchPluginProvides as cl, listAppsPlugin as cm, type ListAppsPluginProvides as cn, listActionsPlugin as co, type ListActionsPluginProvides as cp, listActionInputFieldsPlugin as cq, type ListActionInputFieldsPluginProvides as cr, listActionInputFieldChoicesPlugin as cs, type ListActionInputFieldChoicesPluginProvides as ct, getActionInputFieldsSchemaPlugin as cu, type GetActionInputFieldsSchemaPluginProvides as cv, listConnectionsPlugin as cw, type ListConnectionsPluginProvides as cx, listClientCredentialsPlugin as cy, type ListClientCredentialsPluginProvides as cz, type ActionEntry as d, CredentialsSchema as d$, type ApiPluginOptions as d0, apiPlugin as d1, type ApiPluginProvides as d2, appKeyResolver as d3, actionTypeResolver as d4, actionKeyResolver as d5, connectionIdResolver as d6, connectionIdGenericResolver as d7, inputsResolver as d8, inputsAllOptionalResolver as d9, type ZapierCacheSetOptions as dA, createMemoryCache as dB, type SdkEvent as dC, type AuthEvent as dD, type ApiEvent as dE, type LoadingEvent as dF, type EventCallback as dG, type Credentials as dH, type ResolvedCredentials as dI, type CredentialsObject as dJ, type ClientCredentialsObject as dK, type PkceCredentialsObject as dL, isClientCredentials as dM, isPkceCredentials as dN, isCredentialsObject as dO, isCredentialsFunction as dP, type ResolveCredentialsOptions as dQ, resolveCredentialsFromEnv as dR, resolveCredentials as dS, getBaseUrlFromCredentials as dT, getClientIdFromCredentials as dU, ClientCredentialsObjectSchema as dV, PkceCredentialsObjectSchema as dW, CredentialsObjectSchema as dX, ResolvedCredentialsSchema as dY, CredentialsFunctionSchema as dZ, type CredentialsFunction as d_, inputFieldKeyResolver as da, clientCredentialsNameResolver as db, clientIdResolver as dc, tableIdResolver as dd, triggerInboxResolver as de, triggerMessagesResolver as df, tableRecordIdResolver as dg, tableRecordIdsResolver as dh, tableFieldIdsResolver as di, tableNameResolver as dj, tableFieldsResolver as dk, tableRecordsResolver as dl, tableUpdateRecordsResolver as dm, tableFiltersResolver as dn, tableSortResolver as dp, type ResolveAuthTokenOptions as dq, clearTokenCache as dr, invalidateCachedToken as ds, injectCliLogin as dt, isCliLoginAvailable as du, getTokenFromCliLogin as dv, resolveAuthToken as dw, invalidateCredentialsToken as dx, type ZapierCache as dy, type ZapierCacheEntry as dz, type PaginatedSdkResult as e, ConnectionEntrySchema as e0, type ConnectionEntry as e1, ConnectionsMapSchema as e2, type ConnectionsMap as e3, connectionsPlugin as e4, type ConnectionsPluginProvides as e5, ZAPIER_BASE_URL as e6, getZapierSdkService as e7, MAX_PAGE_LIMIT as e8, DEFAULT_PAGE_SIZE as e9, type ListTableRecordsPluginProvides as eA, createTableRecordsPlugin as eB, type CreateTableRecordsPluginProvides as eC, deleteTableRecordsPlugin as eD, type DeleteTableRecordsPluginProvides as eE, updateTableRecordsPlugin as eF, type UpdateTableRecordsPluginProvides as eG, createZapierSdk as eH, type ZapierSdk as eI, DEFAULT_ACTION_TIMEOUT_MS as ea, ZAPIER_MAX_NETWORK_RETRIES as eb, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS as ec, MAX_CONCURRENCY_LIMIT as ed, parseConcurrencyEnvVar as ee, ZAPIER_MAX_CONCURRENT_REQUESTS as ef, getZapierApprovalMode as eg, DEFAULT_APPROVAL_TIMEOUT_MS as eh, DEFAULT_MAX_APPROVAL_RETRIES as ei, listTablesPlugin as ej, type ListTablesPluginProvides as ek, getTablePlugin as el, type GetTablePluginProvides as em, createTablePlugin as en, type CreateTablePluginProvides as eo, deleteTablePlugin as ep, type DeleteTablePluginProvides as eq, listTableFieldsPlugin as er, type ListTableFieldsPluginProvides as es, createTableFieldsPlugin as et, type CreateTableFieldsPluginProvides as eu, deleteTableFieldsPlugin as ev, type DeleteTableFieldsPluginProvides as ew, getTableRecordPlugin as ex, type GetTableRecordPluginProvides as ey, listTableRecordsPlugin 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 };
9781
+ 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 FunctionOptions as a$, type ArrayResolver as a0, type ResolverMetadata as a1, type StaticResolver as a2, type DynamicListResolver as a3, type DynamicSearchResolver as a4, type FieldsResolver as a5, runWithTelemetryContext as a6, toSnakeCase as a7, toTitleCase as a8, batch as a9, type MethodCalledEvent as aA, type EventEmissionProvides as aB, type EventContext as aC, type ApplicationLifecycleEventData as aD, type EnhancedErrorEventData as aE, type MethodCalledEventData as aF, generateEventId as aG, getCurrentTimestamp as aH, getReleaseId as aI, getOsInfo as aJ, getPlatformVersions as aK, isCi as aL, getCiPlatform as aM, getMemoryUsage as aN, getCpuTime as aO, buildApplicationLifecycleEvent as aP, buildErrorEventWithContext as aQ, buildErrorEvent as aR, createBaseEvent as aS, buildMethodCalledEvent as aT, type AppItem as aU, type ConnectionItem as aV, type ActionItem$1 as aW, type InputFieldItem as aX, type InfoFieldItem as aY, type RootFieldItem as aZ, type UserProfileItem as a_, type BatchOptions as aa, buildCapabilityMessage as ab, logDeprecation as ac, resetDeprecationWarnings as ad, RelayRequestSchema as ae, RelayFetchSchema as af, createZapierSdkWithoutRegistry as ag, createSdk as ah, createOptionsPlugin as ai, type FunctionRegistryEntry as aj, type FunctionDeprecation as ak, BaseSdkOptionsSchema as al, type Plugin as am, type PluginProvides as an, definePlugin as ao, createPluginMethod as ap, createPaginatedPluginMethod as aq, composePlugins as ar, type ActionItem as as, type ActionTypeItem as at, registryPlugin as au, type RequestOptions as av, type PollOptions as aw, createZapierApi as ax, getOrCreateApiClient as ay, type BaseEvent as az, type AddActionEntryOptions as b, ZapierValidationError as b$, type SdkPage as b0, type PaginatedSdkFunction as b1, AppKeyPropertySchema as b2, AppPropertySchema as b3, ActionTypePropertySchema as b4, ActionKeyPropertySchema as b5, ActionPropertySchema as b6, InputFieldPropertySchema as b7, ConnectionIdPropertySchema as b8, AuthenticationIdPropertySchema as b9, type ConnectionIdProperty as bA, type ConnectionProperty as bB, type AuthenticationIdProperty as bC, type InputsProperty as bD, type LimitProperty as bE, type OffsetProperty as bF, type OutputProperty as bG, type DebugProperty as bH, type ParamsProperty as bI, type ActionTimeoutMsProperty as bJ, type TableProperty as bK, type RecordProperty as bL, type RecordsProperty as bM, type FieldsProperty as bN, type AppsProperty as bO, type TablesProperty as bP, type ConnectionsProperty as bQ, type TriggerInboxProperty as bR, type TriggerInboxNameProperty as bS, type LeaseProperty as bT, type LeaseSecondsProperty as bU, type LeaseLimitProperty as bV, type ApiError as bW, type ErrorOptions as bX, ZapierError as bY, ZapierApiError as bZ, ZapierAppNotFoundError as b_, ConnectionPropertySchema as ba, InputsPropertySchema as bb, LimitPropertySchema as bc, OffsetPropertySchema as bd, OutputPropertySchema as be, DebugPropertySchema as bf, ParamsPropertySchema as bg, ActionTimeoutMsPropertySchema as bh, TablePropertySchema as bi, RecordPropertySchema as bj, RecordsPropertySchema as bk, FieldsPropertySchema as bl, AppsPropertySchema as bm, TablesPropertySchema as bn, ConnectionsPropertySchema as bo, TriggerInboxPropertySchema as bp, TriggerInboxNamePropertySchema as bq, LeasePropertySchema as br, LeaseSecondsPropertySchema as bs, LeaseLimitPropertySchema as bt, type AppKeyProperty as bu, type AppProperty as bv, type ActionTypeProperty as bw, type ActionKeyProperty as bx, type ActionProperty as by, type InputFieldProperty as bz, type AddActionEntryResult as c, type GetProfilePluginProvides as c$, ZapierUnknownError as c0, ZapierAuthenticationError as c1, ZapierNotFoundError as c2, ZapierResourceNotFoundError as c3, ZapierConfigurationError as c4, ZapierBundleError as c5, ZapierTimeoutError as c6, ZapierActionError as c7, ZapierConflictError as c8, type RateLimitInfo as c9, createClientCredentialsPlugin as cA, type CreateClientCredentialsPluginProvides as cB, deleteClientCredentialsPlugin as cC, type DeleteClientCredentialsPluginProvides as cD, getAppPlugin as cE, type GetAppPluginProvides as cF, getActionPlugin as cG, type GetActionPluginProvides as cH, getConnectionPlugin as cI, type GetConnectionPluginProvides as cJ, findFirstConnectionPlugin as cK, type FindFirstConnectionPluginProvides as cL, findUniqueConnectionPlugin as cM, type FindUniqueConnectionPluginProvides as cN, CONTEXT_CACHE_TTL_MS as cO, CONTEXT_CACHE_MAX_SIZE as cP, runActionPlugin as cQ, type RunActionPluginProvides as cR, requestPlugin as cS, type RequestPluginProvides as cT, type ManifestPluginOptions as cU, getPreferredManifestEntryKey as cV, manifestPlugin as cW, type ManifestPluginProvides as cX, DEFAULT_CONFIG_PATH as cY, type ManifestEntry as cZ, getProfilePlugin as c_, ZapierRateLimitError as ca, type ApprovalStatus as cb, ZapierApprovalError as cc, ZapierRelayError as cd, formatErrorMessage as ce, ZapierSignal as cf, appsPlugin as cg, type AppsPluginProvides as ch, type ActionExecutionOptions as ci, type AppFactoryInput as cj, fetchPlugin as ck, type FetchPluginProvides as cl, listAppsPlugin as cm, type ListAppsPluginProvides as cn, listActionsPlugin as co, type ListActionsPluginProvides as cp, listActionInputFieldsPlugin as cq, type ListActionInputFieldsPluginProvides as cr, listActionInputFieldChoicesPlugin as cs, type ListActionInputFieldChoicesPluginProvides as ct, getActionInputFieldsSchemaPlugin as cu, type GetActionInputFieldsSchemaPluginProvides as cv, listConnectionsPlugin as cw, type ListConnectionsPluginProvides as cx, listClientCredentialsPlugin as cy, type ListClientCredentialsPluginProvides as cz, type ActionEntry as d, CredentialsSchema as d$, type ApiPluginOptions as d0, apiPlugin as d1, type ApiPluginProvides as d2, appKeyResolver as d3, actionTypeResolver as d4, actionKeyResolver as d5, connectionIdResolver as d6, connectionIdGenericResolver as d7, inputsResolver as d8, inputsAllOptionalResolver as d9, type ZapierCacheSetOptions as dA, createMemoryCache as dB, type SdkEvent as dC, type AuthEvent as dD, type ApiEvent as dE, type LoadingEvent as dF, type EventCallback as dG, type Credentials as dH, type ResolvedCredentials as dI, type CredentialsObject as dJ, type ClientCredentialsObject as dK, type PkceCredentialsObject as dL, isClientCredentials as dM, isPkceCredentials as dN, isCredentialsObject as dO, isCredentialsFunction as dP, type ResolveCredentialsOptions as dQ, resolveCredentialsFromEnv as dR, resolveCredentials as dS, getBaseUrlFromCredentials as dT, getClientIdFromCredentials as dU, ClientCredentialsObjectSchema as dV, PkceCredentialsObjectSchema as dW, CredentialsObjectSchema as dX, ResolvedCredentialsSchema as dY, CredentialsFunctionSchema as dZ, type CredentialsFunction as d_, inputFieldKeyResolver as da, clientCredentialsNameResolver as db, clientIdResolver as dc, tableIdResolver as dd, triggerInboxResolver as de, triggerMessagesResolver as df, tableRecordIdResolver as dg, tableRecordIdsResolver as dh, tableFieldIdsResolver as di, tableNameResolver as dj, tableFieldsResolver as dk, tableRecordsResolver as dl, tableUpdateRecordsResolver as dm, tableFiltersResolver as dn, tableSortResolver as dp, type ResolveAuthTokenOptions as dq, clearTokenCache as dr, invalidateCachedToken as ds, injectCliLogin as dt, isCliLoginAvailable as du, getTokenFromCliLogin as dv, resolveAuthToken as dw, invalidateCredentialsToken as dx, type ZapierCache as dy, type ZapierCacheEntry as dz, type PaginatedSdkResult as e, ConnectionEntrySchema as e0, type ConnectionEntry as e1, ConnectionsMapSchema as e2, type ConnectionsMap as e3, connectionsPlugin as e4, type ConnectionsPluginProvides as e5, ZAPIER_BASE_URL as e6, getZapierSdkService as e7, MAX_PAGE_LIMIT as e8, DEFAULT_PAGE_SIZE as e9, listTableRecordsPlugin as eA, type ListTableRecordsPluginProvides as eB, createTableRecordsPlugin as eC, type CreateTableRecordsPluginProvides as eD, deleteTableRecordsPlugin as eE, type DeleteTableRecordsPluginProvides as eF, updateTableRecordsPlugin as eG, type UpdateTableRecordsPluginProvides as eH, createZapierSdk as eI, type ZapierSdk as eJ, DEFAULT_ACTION_TIMEOUT_MS as ea, ZAPIER_MAX_NETWORK_RETRIES as eb, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS as ec, MAX_CONCURRENCY_LIMIT as ed, parseConcurrencyEnvVar as ee, ZAPIER_MAX_CONCURRENT_REQUESTS as ef, getZapierApprovalMode as eg, getZapierDefaultApprovalMode as eh, DEFAULT_APPROVAL_TIMEOUT_MS as ei, DEFAULT_MAX_APPROVAL_RETRIES as ej, listTablesPlugin as ek, type ListTablesPluginProvides as el, getTablePlugin as em, type GetTablePluginProvides as en, createTablePlugin as eo, type CreateTablePluginProvides as ep, deleteTablePlugin as eq, type DeleteTablePluginProvides as er, listTableFieldsPlugin as es, type ListTableFieldsPluginProvides as et, createTableFieldsPlugin as eu, type CreateTableFieldsPluginProvides as ev, deleteTableFieldsPlugin as ew, type DeleteTableFieldsPluginProvides as ex, getTableRecordPlugin as ey, type GetTableRecordPluginProvides 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 };
@@ -710,13 +710,14 @@ interface ApiClientOptions {
710
710
  maxConcurrentRequests?: number;
711
711
  /**
712
712
  * Controls how the approval flow is handled.
713
- * - "disabled": (default when env var is unset) Throw a ZapierApprovalError
714
- * on approval-required responses without creating an approval.
715
713
  * - "poll": Create the approval, open the URL in a browser, poll until
716
714
  * resolved, and retry the original request on success.
717
715
  * - "throw": Create the approval and throw a ZapierApprovalError immediately
718
716
  * with the approval URL so the caller can surface it.
719
- * Defaults to the ZAPIER_APPROVAL_MODE env var, then "disabled".
717
+ * - "disabled": Throw a ZapierApprovalError on approval-required responses
718
+ * without creating an approval.
719
+ * Resolution order is: explicit option, then ZAPIER_APPROVAL_MODE, then a
720
+ * TTY-based default ("poll" if interactive, "throw" otherwise).
720
721
  */
721
722
  approvalMode?: "disabled" | "poll" | "throw";
722
723
  /**
@@ -8876,17 +8877,27 @@ declare function parseConcurrencyEnvVar(name: string): number | undefined;
8876
8877
  declare const ZAPIER_MAX_CONCURRENT_REQUESTS: number;
8877
8878
  /**
8878
8879
  * Approval flow behavior from environment variable.
8879
- * - "disabled": (default when env var is unset) Throw a ZapierApprovalError on
8880
- * approval-required responses without creating an approval. Callers must
8881
- * explicitly opt in to approvals via "poll" or "throw".
8882
8880
  * - "poll": Create the approval, open the URL in a browser, poll until
8883
8881
  * resolved, and retry the original request on success.
8884
8882
  * - "throw": Create the approval and throw a ZapierApprovalError immediately
8885
8883
  * with the approval URL so the caller can surface it.
8884
+ * - "disabled": Throw a ZapierApprovalError on approval-required responses
8885
+ * without creating an approval.
8886
8886
  *
8887
- * Read lazily so tests can set the env var after module import.
8887
+ * This parser only reflects the env var value. If unset, callers should fall
8888
+ * back to getZapierDefaultApprovalMode().
8889
+ *
8890
+ * Read lazily so tests can set env vars after module import.
8888
8891
  */
8889
8892
  declare function getZapierApprovalMode(): "disabled" | "poll" | "throw" | undefined;
8893
+ /**
8894
+ * Returns the default approval mode based on whether the process is running in
8895
+ * an interactive terminal. If both stdin and stdout are TTYs the user can act
8896
+ * on an approval URL immediately, so "poll" is the right default. In a
8897
+ * non-interactive context (CI, piped output) the process cannot open a browser
8898
+ * or wait for input, so "throw" hands the URL to the caller.
8899
+ */
8900
+ declare function getZapierDefaultApprovalMode(): "poll" | "throw";
8890
8901
  /**
8891
8902
  * Default timeout for approval polling (10 minutes)
8892
8903
  */
@@ -9767,4 +9778,4 @@ declare const registryPlugin: (sdk: {
9767
9778
  };
9768
9779
  }) => {};
9769
9780
 
9770
- 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 FunctionOptions as a$, type ArrayResolver as a0, type ResolverMetadata as a1, type StaticResolver as a2, type DynamicListResolver as a3, type DynamicSearchResolver as a4, type FieldsResolver as a5, runWithTelemetryContext as a6, toSnakeCase as a7, toTitleCase as a8, batch as a9, type MethodCalledEvent as aA, type EventEmissionProvides as aB, type EventContext as aC, type ApplicationLifecycleEventData as aD, type EnhancedErrorEventData as aE, type MethodCalledEventData as aF, generateEventId as aG, getCurrentTimestamp as aH, getReleaseId as aI, getOsInfo as aJ, getPlatformVersions as aK, isCi as aL, getCiPlatform as aM, getMemoryUsage as aN, getCpuTime as aO, buildApplicationLifecycleEvent as aP, buildErrorEventWithContext as aQ, buildErrorEvent as aR, createBaseEvent as aS, buildMethodCalledEvent as aT, type AppItem as aU, type ConnectionItem as aV, type ActionItem$1 as aW, type InputFieldItem as aX, type InfoFieldItem as aY, type RootFieldItem as aZ, type UserProfileItem as a_, type BatchOptions as aa, buildCapabilityMessage as ab, logDeprecation as ac, resetDeprecationWarnings as ad, RelayRequestSchema as ae, RelayFetchSchema as af, createZapierSdkWithoutRegistry as ag, createSdk as ah, createOptionsPlugin as ai, type FunctionRegistryEntry as aj, type FunctionDeprecation as ak, BaseSdkOptionsSchema as al, type Plugin as am, type PluginProvides as an, definePlugin as ao, createPluginMethod as ap, createPaginatedPluginMethod as aq, composePlugins as ar, type ActionItem as as, type ActionTypeItem as at, registryPlugin as au, type RequestOptions as av, type PollOptions as aw, createZapierApi as ax, getOrCreateApiClient as ay, type BaseEvent as az, type AddActionEntryOptions as b, ZapierValidationError as b$, type SdkPage as b0, type PaginatedSdkFunction as b1, AppKeyPropertySchema as b2, AppPropertySchema as b3, ActionTypePropertySchema as b4, ActionKeyPropertySchema as b5, ActionPropertySchema as b6, InputFieldPropertySchema as b7, ConnectionIdPropertySchema as b8, AuthenticationIdPropertySchema as b9, type ConnectionIdProperty as bA, type ConnectionProperty as bB, type AuthenticationIdProperty as bC, type InputsProperty as bD, type LimitProperty as bE, type OffsetProperty as bF, type OutputProperty as bG, type DebugProperty as bH, type ParamsProperty as bI, type ActionTimeoutMsProperty as bJ, type TableProperty as bK, type RecordProperty as bL, type RecordsProperty as bM, type FieldsProperty as bN, type AppsProperty as bO, type TablesProperty as bP, type ConnectionsProperty as bQ, type TriggerInboxProperty as bR, type TriggerInboxNameProperty as bS, type LeaseProperty as bT, type LeaseSecondsProperty as bU, type LeaseLimitProperty as bV, type ApiError as bW, type ErrorOptions as bX, ZapierError as bY, ZapierApiError as bZ, ZapierAppNotFoundError as b_, ConnectionPropertySchema as ba, InputsPropertySchema as bb, LimitPropertySchema as bc, OffsetPropertySchema as bd, OutputPropertySchema as be, DebugPropertySchema as bf, ParamsPropertySchema as bg, ActionTimeoutMsPropertySchema as bh, TablePropertySchema as bi, RecordPropertySchema as bj, RecordsPropertySchema as bk, FieldsPropertySchema as bl, AppsPropertySchema as bm, TablesPropertySchema as bn, ConnectionsPropertySchema as bo, TriggerInboxPropertySchema as bp, TriggerInboxNamePropertySchema as bq, LeasePropertySchema as br, LeaseSecondsPropertySchema as bs, LeaseLimitPropertySchema as bt, type AppKeyProperty as bu, type AppProperty as bv, type ActionTypeProperty as bw, type ActionKeyProperty as bx, type ActionProperty as by, type InputFieldProperty as bz, type AddActionEntryResult as c, type GetProfilePluginProvides as c$, ZapierUnknownError as c0, ZapierAuthenticationError as c1, ZapierNotFoundError as c2, ZapierResourceNotFoundError as c3, ZapierConfigurationError as c4, ZapierBundleError as c5, ZapierTimeoutError as c6, ZapierActionError as c7, ZapierConflictError as c8, type RateLimitInfo as c9, createClientCredentialsPlugin as cA, type CreateClientCredentialsPluginProvides as cB, deleteClientCredentialsPlugin as cC, type DeleteClientCredentialsPluginProvides as cD, getAppPlugin as cE, type GetAppPluginProvides as cF, getActionPlugin as cG, type GetActionPluginProvides as cH, getConnectionPlugin as cI, type GetConnectionPluginProvides as cJ, findFirstConnectionPlugin as cK, type FindFirstConnectionPluginProvides as cL, findUniqueConnectionPlugin as cM, type FindUniqueConnectionPluginProvides as cN, CONTEXT_CACHE_TTL_MS as cO, CONTEXT_CACHE_MAX_SIZE as cP, runActionPlugin as cQ, type RunActionPluginProvides as cR, requestPlugin as cS, type RequestPluginProvides as cT, type ManifestPluginOptions as cU, getPreferredManifestEntryKey as cV, manifestPlugin as cW, type ManifestPluginProvides as cX, DEFAULT_CONFIG_PATH as cY, type ManifestEntry as cZ, getProfilePlugin as c_, ZapierRateLimitError as ca, type ApprovalStatus as cb, ZapierApprovalError as cc, ZapierRelayError as cd, formatErrorMessage as ce, ZapierSignal as cf, appsPlugin as cg, type AppsPluginProvides as ch, type ActionExecutionOptions as ci, type AppFactoryInput as cj, fetchPlugin as ck, type FetchPluginProvides as cl, listAppsPlugin as cm, type ListAppsPluginProvides as cn, listActionsPlugin as co, type ListActionsPluginProvides as cp, listActionInputFieldsPlugin as cq, type ListActionInputFieldsPluginProvides as cr, listActionInputFieldChoicesPlugin as cs, type ListActionInputFieldChoicesPluginProvides as ct, getActionInputFieldsSchemaPlugin as cu, type GetActionInputFieldsSchemaPluginProvides as cv, listConnectionsPlugin as cw, type ListConnectionsPluginProvides as cx, listClientCredentialsPlugin as cy, type ListClientCredentialsPluginProvides as cz, type ActionEntry as d, CredentialsSchema as d$, type ApiPluginOptions as d0, apiPlugin as d1, type ApiPluginProvides as d2, appKeyResolver as d3, actionTypeResolver as d4, actionKeyResolver as d5, connectionIdResolver as d6, connectionIdGenericResolver as d7, inputsResolver as d8, inputsAllOptionalResolver as d9, type ZapierCacheSetOptions as dA, createMemoryCache as dB, type SdkEvent as dC, type AuthEvent as dD, type ApiEvent as dE, type LoadingEvent as dF, type EventCallback as dG, type Credentials as dH, type ResolvedCredentials as dI, type CredentialsObject as dJ, type ClientCredentialsObject as dK, type PkceCredentialsObject as dL, isClientCredentials as dM, isPkceCredentials as dN, isCredentialsObject as dO, isCredentialsFunction as dP, type ResolveCredentialsOptions as dQ, resolveCredentialsFromEnv as dR, resolveCredentials as dS, getBaseUrlFromCredentials as dT, getClientIdFromCredentials as dU, ClientCredentialsObjectSchema as dV, PkceCredentialsObjectSchema as dW, CredentialsObjectSchema as dX, ResolvedCredentialsSchema as dY, CredentialsFunctionSchema as dZ, type CredentialsFunction as d_, inputFieldKeyResolver as da, clientCredentialsNameResolver as db, clientIdResolver as dc, tableIdResolver as dd, triggerInboxResolver as de, triggerMessagesResolver as df, tableRecordIdResolver as dg, tableRecordIdsResolver as dh, tableFieldIdsResolver as di, tableNameResolver as dj, tableFieldsResolver as dk, tableRecordsResolver as dl, tableUpdateRecordsResolver as dm, tableFiltersResolver as dn, tableSortResolver as dp, type ResolveAuthTokenOptions as dq, clearTokenCache as dr, invalidateCachedToken as ds, injectCliLogin as dt, isCliLoginAvailable as du, getTokenFromCliLogin as dv, resolveAuthToken as dw, invalidateCredentialsToken as dx, type ZapierCache as dy, type ZapierCacheEntry as dz, type PaginatedSdkResult as e, ConnectionEntrySchema as e0, type ConnectionEntry as e1, ConnectionsMapSchema as e2, type ConnectionsMap as e3, connectionsPlugin as e4, type ConnectionsPluginProvides as e5, ZAPIER_BASE_URL as e6, getZapierSdkService as e7, MAX_PAGE_LIMIT as e8, DEFAULT_PAGE_SIZE as e9, type ListTableRecordsPluginProvides as eA, createTableRecordsPlugin as eB, type CreateTableRecordsPluginProvides as eC, deleteTableRecordsPlugin as eD, type DeleteTableRecordsPluginProvides as eE, updateTableRecordsPlugin as eF, type UpdateTableRecordsPluginProvides as eG, createZapierSdk as eH, type ZapierSdk as eI, DEFAULT_ACTION_TIMEOUT_MS as ea, ZAPIER_MAX_NETWORK_RETRIES as eb, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS as ec, MAX_CONCURRENCY_LIMIT as ed, parseConcurrencyEnvVar as ee, ZAPIER_MAX_CONCURRENT_REQUESTS as ef, getZapierApprovalMode as eg, DEFAULT_APPROVAL_TIMEOUT_MS as eh, DEFAULT_MAX_APPROVAL_RETRIES as ei, listTablesPlugin as ej, type ListTablesPluginProvides as ek, getTablePlugin as el, type GetTablePluginProvides as em, createTablePlugin as en, type CreateTablePluginProvides as eo, deleteTablePlugin as ep, type DeleteTablePluginProvides as eq, listTableFieldsPlugin as er, type ListTableFieldsPluginProvides as es, createTableFieldsPlugin as et, type CreateTableFieldsPluginProvides as eu, deleteTableFieldsPlugin as ev, type DeleteTableFieldsPluginProvides as ew, getTableRecordPlugin as ex, type GetTableRecordPluginProvides as ey, listTableRecordsPlugin 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 };
9781
+ 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 FunctionOptions as a$, type ArrayResolver as a0, type ResolverMetadata as a1, type StaticResolver as a2, type DynamicListResolver as a3, type DynamicSearchResolver as a4, type FieldsResolver as a5, runWithTelemetryContext as a6, toSnakeCase as a7, toTitleCase as a8, batch as a9, type MethodCalledEvent as aA, type EventEmissionProvides as aB, type EventContext as aC, type ApplicationLifecycleEventData as aD, type EnhancedErrorEventData as aE, type MethodCalledEventData as aF, generateEventId as aG, getCurrentTimestamp as aH, getReleaseId as aI, getOsInfo as aJ, getPlatformVersions as aK, isCi as aL, getCiPlatform as aM, getMemoryUsage as aN, getCpuTime as aO, buildApplicationLifecycleEvent as aP, buildErrorEventWithContext as aQ, buildErrorEvent as aR, createBaseEvent as aS, buildMethodCalledEvent as aT, type AppItem as aU, type ConnectionItem as aV, type ActionItem$1 as aW, type InputFieldItem as aX, type InfoFieldItem as aY, type RootFieldItem as aZ, type UserProfileItem as a_, type BatchOptions as aa, buildCapabilityMessage as ab, logDeprecation as ac, resetDeprecationWarnings as ad, RelayRequestSchema as ae, RelayFetchSchema as af, createZapierSdkWithoutRegistry as ag, createSdk as ah, createOptionsPlugin as ai, type FunctionRegistryEntry as aj, type FunctionDeprecation as ak, BaseSdkOptionsSchema as al, type Plugin as am, type PluginProvides as an, definePlugin as ao, createPluginMethod as ap, createPaginatedPluginMethod as aq, composePlugins as ar, type ActionItem as as, type ActionTypeItem as at, registryPlugin as au, type RequestOptions as av, type PollOptions as aw, createZapierApi as ax, getOrCreateApiClient as ay, type BaseEvent as az, type AddActionEntryOptions as b, ZapierValidationError as b$, type SdkPage as b0, type PaginatedSdkFunction as b1, AppKeyPropertySchema as b2, AppPropertySchema as b3, ActionTypePropertySchema as b4, ActionKeyPropertySchema as b5, ActionPropertySchema as b6, InputFieldPropertySchema as b7, ConnectionIdPropertySchema as b8, AuthenticationIdPropertySchema as b9, type ConnectionIdProperty as bA, type ConnectionProperty as bB, type AuthenticationIdProperty as bC, type InputsProperty as bD, type LimitProperty as bE, type OffsetProperty as bF, type OutputProperty as bG, type DebugProperty as bH, type ParamsProperty as bI, type ActionTimeoutMsProperty as bJ, type TableProperty as bK, type RecordProperty as bL, type RecordsProperty as bM, type FieldsProperty as bN, type AppsProperty as bO, type TablesProperty as bP, type ConnectionsProperty as bQ, type TriggerInboxProperty as bR, type TriggerInboxNameProperty as bS, type LeaseProperty as bT, type LeaseSecondsProperty as bU, type LeaseLimitProperty as bV, type ApiError as bW, type ErrorOptions as bX, ZapierError as bY, ZapierApiError as bZ, ZapierAppNotFoundError as b_, ConnectionPropertySchema as ba, InputsPropertySchema as bb, LimitPropertySchema as bc, OffsetPropertySchema as bd, OutputPropertySchema as be, DebugPropertySchema as bf, ParamsPropertySchema as bg, ActionTimeoutMsPropertySchema as bh, TablePropertySchema as bi, RecordPropertySchema as bj, RecordsPropertySchema as bk, FieldsPropertySchema as bl, AppsPropertySchema as bm, TablesPropertySchema as bn, ConnectionsPropertySchema as bo, TriggerInboxPropertySchema as bp, TriggerInboxNamePropertySchema as bq, LeasePropertySchema as br, LeaseSecondsPropertySchema as bs, LeaseLimitPropertySchema as bt, type AppKeyProperty as bu, type AppProperty as bv, type ActionTypeProperty as bw, type ActionKeyProperty as bx, type ActionProperty as by, type InputFieldProperty as bz, type AddActionEntryResult as c, type GetProfilePluginProvides as c$, ZapierUnknownError as c0, ZapierAuthenticationError as c1, ZapierNotFoundError as c2, ZapierResourceNotFoundError as c3, ZapierConfigurationError as c4, ZapierBundleError as c5, ZapierTimeoutError as c6, ZapierActionError as c7, ZapierConflictError as c8, type RateLimitInfo as c9, createClientCredentialsPlugin as cA, type CreateClientCredentialsPluginProvides as cB, deleteClientCredentialsPlugin as cC, type DeleteClientCredentialsPluginProvides as cD, getAppPlugin as cE, type GetAppPluginProvides as cF, getActionPlugin as cG, type GetActionPluginProvides as cH, getConnectionPlugin as cI, type GetConnectionPluginProvides as cJ, findFirstConnectionPlugin as cK, type FindFirstConnectionPluginProvides as cL, findUniqueConnectionPlugin as cM, type FindUniqueConnectionPluginProvides as cN, CONTEXT_CACHE_TTL_MS as cO, CONTEXT_CACHE_MAX_SIZE as cP, runActionPlugin as cQ, type RunActionPluginProvides as cR, requestPlugin as cS, type RequestPluginProvides as cT, type ManifestPluginOptions as cU, getPreferredManifestEntryKey as cV, manifestPlugin as cW, type ManifestPluginProvides as cX, DEFAULT_CONFIG_PATH as cY, type ManifestEntry as cZ, getProfilePlugin as c_, ZapierRateLimitError as ca, type ApprovalStatus as cb, ZapierApprovalError as cc, ZapierRelayError as cd, formatErrorMessage as ce, ZapierSignal as cf, appsPlugin as cg, type AppsPluginProvides as ch, type ActionExecutionOptions as ci, type AppFactoryInput as cj, fetchPlugin as ck, type FetchPluginProvides as cl, listAppsPlugin as cm, type ListAppsPluginProvides as cn, listActionsPlugin as co, type ListActionsPluginProvides as cp, listActionInputFieldsPlugin as cq, type ListActionInputFieldsPluginProvides as cr, listActionInputFieldChoicesPlugin as cs, type ListActionInputFieldChoicesPluginProvides as ct, getActionInputFieldsSchemaPlugin as cu, type GetActionInputFieldsSchemaPluginProvides as cv, listConnectionsPlugin as cw, type ListConnectionsPluginProvides as cx, listClientCredentialsPlugin as cy, type ListClientCredentialsPluginProvides as cz, type ActionEntry as d, CredentialsSchema as d$, type ApiPluginOptions as d0, apiPlugin as d1, type ApiPluginProvides as d2, appKeyResolver as d3, actionTypeResolver as d4, actionKeyResolver as d5, connectionIdResolver as d6, connectionIdGenericResolver as d7, inputsResolver as d8, inputsAllOptionalResolver as d9, type ZapierCacheSetOptions as dA, createMemoryCache as dB, type SdkEvent as dC, type AuthEvent as dD, type ApiEvent as dE, type LoadingEvent as dF, type EventCallback as dG, type Credentials as dH, type ResolvedCredentials as dI, type CredentialsObject as dJ, type ClientCredentialsObject as dK, type PkceCredentialsObject as dL, isClientCredentials as dM, isPkceCredentials as dN, isCredentialsObject as dO, isCredentialsFunction as dP, type ResolveCredentialsOptions as dQ, resolveCredentialsFromEnv as dR, resolveCredentials as dS, getBaseUrlFromCredentials as dT, getClientIdFromCredentials as dU, ClientCredentialsObjectSchema as dV, PkceCredentialsObjectSchema as dW, CredentialsObjectSchema as dX, ResolvedCredentialsSchema as dY, CredentialsFunctionSchema as dZ, type CredentialsFunction as d_, inputFieldKeyResolver as da, clientCredentialsNameResolver as db, clientIdResolver as dc, tableIdResolver as dd, triggerInboxResolver as de, triggerMessagesResolver as df, tableRecordIdResolver as dg, tableRecordIdsResolver as dh, tableFieldIdsResolver as di, tableNameResolver as dj, tableFieldsResolver as dk, tableRecordsResolver as dl, tableUpdateRecordsResolver as dm, tableFiltersResolver as dn, tableSortResolver as dp, type ResolveAuthTokenOptions as dq, clearTokenCache as dr, invalidateCachedToken as ds, injectCliLogin as dt, isCliLoginAvailable as du, getTokenFromCliLogin as dv, resolveAuthToken as dw, invalidateCredentialsToken as dx, type ZapierCache as dy, type ZapierCacheEntry as dz, type PaginatedSdkResult as e, ConnectionEntrySchema as e0, type ConnectionEntry as e1, ConnectionsMapSchema as e2, type ConnectionsMap as e3, connectionsPlugin as e4, type ConnectionsPluginProvides as e5, ZAPIER_BASE_URL as e6, getZapierSdkService as e7, MAX_PAGE_LIMIT as e8, DEFAULT_PAGE_SIZE as e9, listTableRecordsPlugin as eA, type ListTableRecordsPluginProvides as eB, createTableRecordsPlugin as eC, type CreateTableRecordsPluginProvides as eD, deleteTableRecordsPlugin as eE, type DeleteTableRecordsPluginProvides as eF, updateTableRecordsPlugin as eG, type UpdateTableRecordsPluginProvides as eH, createZapierSdk as eI, type ZapierSdk as eJ, DEFAULT_ACTION_TIMEOUT_MS as ea, ZAPIER_MAX_NETWORK_RETRIES as eb, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS as ec, MAX_CONCURRENCY_LIMIT as ed, parseConcurrencyEnvVar as ee, ZAPIER_MAX_CONCURRENT_REQUESTS as ef, getZapierApprovalMode as eg, getZapierDefaultApprovalMode as eh, DEFAULT_APPROVAL_TIMEOUT_MS as ei, DEFAULT_MAX_APPROVAL_RETRIES as ej, listTablesPlugin as ek, type ListTablesPluginProvides as el, getTablePlugin as em, type GetTablePluginProvides as en, createTablePlugin as eo, type CreateTablePluginProvides as ep, deleteTablePlugin as eq, type DeleteTablePluginProvides as er, listTableFieldsPlugin as es, type ListTableFieldsPluginProvides as et, createTableFieldsPlugin as eu, type CreateTableFieldsPluginProvides as ev, deleteTableFieldsPlugin as ew, type DeleteTableFieldsPluginProvides as ex, getTableRecordPlugin as ey, type GetTableRecordPluginProvides 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 };
package/dist/index.cjs CHANGED
@@ -84,6 +84,10 @@ function getZapierApprovalMode() {
84
84
  return value;
85
85
  return void 0;
86
86
  }
87
+ function getZapierDefaultApprovalMode() {
88
+ const isInteractive = !!globalThis.process?.stdin?.isTTY && !!globalThis.process?.stdout?.isTTY;
89
+ return isInteractive ? "poll" : "throw";
90
+ }
87
91
  var DEFAULT_APPROVAL_TIMEOUT_MS = 10 * 60 * 1e3;
88
92
  var DEFAULT_MAX_APPROVAL_RETRIES = 2;
89
93
 
@@ -6318,7 +6322,7 @@ async function invalidateCredentialsToken(options) {
6318
6322
  }
6319
6323
 
6320
6324
  // src/sdk-version.ts
6321
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.55.0" : void 0) || "unknown";
6325
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.56.0" : void 0) || "unknown";
6322
6326
 
6323
6327
  // src/utils/open-url.ts
6324
6328
  var nodePrefix = "node:";
@@ -6648,7 +6652,7 @@ var ZapierApiClient = class {
6648
6652
  }
6649
6653
  if (errorType !== "approval_required") return response;
6650
6654
  if (attempt === maxRetries) break;
6651
- const mode = this.options.approvalMode ?? getZapierApprovalMode() ?? "disabled";
6655
+ const mode = this.options.approvalMode ?? getZapierApprovalMode() ?? getZapierDefaultApprovalMode();
6652
6656
  if (mode === "disabled") {
6653
6657
  throw new ZapierApprovalError(
6654
6658
  "Approvals are disabled. Set approvalMode to 'poll' or 'throw' (or ZAPIER_APPROVAL_MODE) to enable.",
@@ -9123,7 +9127,7 @@ var BaseSdkOptionsSchema = zod.z.object({
9123
9127
  "Maximum number of sequential approval rounds per request (one per gating policy) before giving up. Default: 2."
9124
9128
  ),
9125
9129
  approvalMode: zod.z.enum(["disabled", "poll", "throw"]).optional().describe(
9126
- '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".'
9130
+ 'Approval flow behavior. "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. "disabled" throws a ZapierApprovalError on approval-required responses without creating an approval. Resolution order is: explicit option, then ZAPIER_APPROVAL_MODE, then the default behavior (poll for interactive TTY, throw otherwise).'
9127
9131
  ),
9128
9132
  // Internal
9129
9133
  manifestPath: zod.z.string().optional().describe("Path to a .zapierrc manifest file for app version locking.").meta({ internal: true }),
@@ -9285,6 +9289,7 @@ exports.getTablePlugin = getTablePlugin;
9285
9289
  exports.getTableRecordPlugin = getTableRecordPlugin;
9286
9290
  exports.getTokenFromCliLogin = getTokenFromCliLogin;
9287
9291
  exports.getZapierApprovalMode = getZapierApprovalMode;
9292
+ exports.getZapierDefaultApprovalMode = getZapierDefaultApprovalMode;
9288
9293
  exports.getZapierSdkService = getZapierSdkService;
9289
9294
  exports.injectCliLogin = injectCliLogin;
9290
9295
  exports.inputFieldKeyResolver = inputFieldKeyResolver;
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- export { u as Action, d as ActionEntry, ci as ActionExecutionOptions, y as ActionExecutionResult, z as ActionField, H as ActionFieldChoice, aW as ActionItem, bx as ActionKeyProperty, b5 as ActionKeyPropertySchema, by as ActionProperty, b6 as ActionPropertySchema, as as ActionResolverItem, bJ as ActionTimeoutMsProperty, bh as ActionTimeoutMsPropertySchema, at as ActionTypeItem, bw as ActionTypeProperty, b4 as ActionTypePropertySchema, b as AddActionEntryOptions, c as AddActionEntryResult, A as ApiClient, bW as ApiError, dE as ApiEvent, d0 as ApiPluginOptions, d2 as ApiPluginProvides, v as App, cj as AppFactoryInput, aU as AppItem, bu as AppKeyProperty, b2 as AppKeyPropertySchema, bv as AppProperty, b3 as AppPropertySchema, aD as ApplicationLifecycleEventData, cb as ApprovalStatus, ch as AppsPluginProvides, bO as AppsProperty, bm as AppsPropertySchema, a0 as ArrayResolver, dD as AuthEvent, bC as AuthenticationIdProperty, b9 as AuthenticationIdPropertySchema, az as BaseEvent, al as BaseSdkOptionsSchema, aa as BatchOptions, cP as CONTEXT_CACHE_MAX_SIZE, cO as CONTEXT_CACHE_TTL_MS, x as Choice, dK as ClientCredentialsObject, dV as ClientCredentialsObjectSchema, K as Connection, e1 as ConnectionEntry, e0 as ConnectionEntrySchema, bA as ConnectionIdProperty, b8 as ConnectionIdPropertySchema, aV as ConnectionItem, bB as ConnectionProperty, ba as ConnectionPropertySchema, e3 as ConnectionsMap, e2 as ConnectionsMapSchema, e5 as ConnectionsPluginProvides, bQ as ConnectionsProperty, bo as ConnectionsPropertySchema, O as ConnectionsResponse, cB as CreateClientCredentialsPluginProvides, eu as CreateTableFieldsPluginProvides, eo as CreateTablePluginProvides, eC as CreateTableRecordsPluginProvides, dH as Credentials, d_ as CredentialsFunction, dZ as CredentialsFunctionSchema, dJ as CredentialsObject, dX as CredentialsObjectSchema, d$ as CredentialsSchema, ea as DEFAULT_ACTION_TIMEOUT_MS, eh as DEFAULT_APPROVAL_TIMEOUT_MS, cY as DEFAULT_CONFIG_PATH, ei as DEFAULT_MAX_APPROVAL_RETRIES, e9 as DEFAULT_PAGE_SIZE, bH as DebugProperty, bf as DebugPropertySchema, cD as DeleteClientCredentialsPluginProvides, ew as DeleteTableFieldsPluginProvides, eq as DeleteTablePluginProvides, eE as DeleteTableRecordsPluginProvides, o as DrainTriggerInboxCallback, p as DrainTriggerInboxErrorObserver, D as DrainTriggerInboxOptions, a3 as DynamicListResolver, i as DynamicResolver, a4 as DynamicSearchResolver, aE as EnhancedErrorEventData, bX as ErrorOptions, dG as EventCallback, aC as EventContext, E as EventEmissionContext, aB as EventEmissionProvides, cl as FetchPluginProvides, w as Field, bN as FieldsProperty, bl as FieldsPropertySchema, a5 as FieldsResolver, F as FieldsetItem, s as FindFirstAuthenticationPluginProvides, cL as FindFirstConnectionPluginProvides, t as FindUniqueAuthenticationPluginProvides, cN as FindUniqueConnectionPluginProvides, Y as FormatMetadata, X as FormattedItem, ak as FunctionDeprecation, a$ as FunctionOptions, aj as FunctionRegistryEntry, cv as GetActionInputFieldsSchemaPluginProvides, cH as GetActionPluginProvides, cF as GetAppPluginProvides, G as GetAuthenticationPluginProvides, cJ as GetConnectionPluginProvides, c$ as GetProfilePluginProvides, em as GetTablePluginProvides, ey as GetTableRecordPluginProvides, aY as InfoFieldItem, aX as InputFieldItem, bz as InputFieldProperty, b7 as InputFieldPropertySchema, bD as InputsProperty, bb as InputsPropertySchema, bV as LeaseLimitProperty, bt as LeaseLimitPropertySchema, bT as LeaseProperty, br as LeasePropertySchema, bU as LeaseSecondsProperty, bs as LeaseSecondsPropertySchema, L as LeasedTriggerMessageItem, bE as LimitProperty, bc as LimitPropertySchema, ct as ListActionInputFieldChoicesPluginProvides, cr as ListActionInputFieldsPluginProvides, cp as ListActionsPluginProvides, cn as ListAppsPluginProvides, q as ListAuthenticationsPluginProvides, cz as ListClientCredentialsPluginProvides, cx as ListConnectionsPluginProvides, es as ListTableFieldsPluginProvides, eA as ListTableRecordsPluginProvides, ek as ListTablesPluginProvides, dF as LoadingEvent, ed as MAX_CONCURRENCY_LIMIT, e8 as MAX_PAGE_LIMIT, M as Manifest, cZ as ManifestEntry, cU as ManifestPluginOptions, cX as ManifestPluginProvides, aA as MethodCalledEvent, aF as MethodCalledEventData, N as Need, I as NeedsRequest, J as NeedsResponse, bF as OffsetProperty, bd as OffsetPropertySchema, _ as OutputFormatter, bG as OutputProperty, be as OutputPropertySchema, b1 as PaginatedSdkFunction, e as PaginatedSdkResult, bI as ParamsProperty, bg as ParamsPropertySchema, dL as PkceCredentialsObject, dW as PkceCredentialsObjectSchema, am as Plugin, P as PluginMeta, an as PluginProvides, aw as PollOptions, g as PositionalMetadata, c9 as RateLimitInfo, bL as RecordProperty, bj as RecordPropertySchema, bM as RecordsProperty, bk as RecordsPropertySchema, af as RelayFetchSchema, ae as RelayRequestSchema, av as RequestOptions, cT as RequestPluginProvides, dq as ResolveAuthTokenOptions, dQ as ResolveCredentialsOptions, R as ResolvedAppLocator, dI as ResolvedCredentials, dY as ResolvedCredentialsSchema, $ as Resolver, a1 as ResolverMetadata, aZ as RootFieldItem, cR as RunActionPluginProvides, dC as SdkEvent, b0 as SdkPage, a2 as StaticResolver, bK as TableProperty, bi as TablePropertySchema, bP as TablesProperty, bn as TablesPropertySchema, bS as TriggerInboxNameProperty, bq as TriggerInboxNamePropertySchema, bR as TriggerInboxProperty, bp as TriggerInboxPropertySchema, T as TriggerMessageStatus, U as UpdateManifestEntryOptions, a as UpdateManifestEntryResult, eG as UpdateTableRecordsPluginProvides, Q as UserProfile, a_ as UserProfileItem, j as WatchTriggerInboxOptions, W as WithAddPlugin, e6 as ZAPIER_BASE_URL, ef as ZAPIER_MAX_CONCURRENT_REQUESTS, eb as ZAPIER_MAX_NETWORK_RETRIES, ec as ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, m as ZapierAbortDrainSignal, c7 as ZapierActionError, bZ as ZapierApiError, b_ as ZapierAppNotFoundError, cc as ZapierApprovalError, c1 as ZapierAuthenticationError, c5 as ZapierBundleError, dy as ZapierCache, dz as ZapierCacheEntry, dA as ZapierCacheSetOptions, c4 as ZapierConfigurationError, c8 as ZapierConflictError, bY as ZapierError, h as ZapierFetchInitOptions, c2 as ZapierNotFoundError, ca as ZapierRateLimitError, cd as ZapierRelayError, n as ZapierReleaseTriggerMessageSignal, c3 as ZapierResourceNotFoundError, eI as ZapierSdk, l as ZapierSdkApps, Z as ZapierSdkOptions, cf as ZapierSignal, c6 as ZapierTimeoutError, c0 as ZapierUnknownError, b$ as ZapierValidationError, d5 as actionKeyResolver, d4 as actionTypeResolver, d1 as apiPlugin, d3 as appKeyResolver, cg as appsPlugin, d7 as authenticationIdGenericResolver, d6 as authenticationIdResolver, a9 as batch, aP as buildApplicationLifecycleEvent, ab as buildCapabilityMessage, aR as buildErrorEvent, aQ as buildErrorEventWithContext, aT as buildMethodCalledEvent, dr as clearTokenCache, db as clientCredentialsNameResolver, dc as clientIdResolver, ar as composePlugins, d7 as connectionIdGenericResolver, d6 as connectionIdResolver, e4 as connectionsPlugin, aS as createBaseEvent, cA as createClientCredentialsPlugin, V as createFunction, dB as createMemoryCache, ai as createOptionsPlugin, aq as createPaginatedPluginMethod, ap as createPluginMethod, ah as createSdk, et as createTableFieldsPlugin, en as createTablePlugin, eB as createTableRecordsPlugin, ax as createZapierApi, eH as createZapierSdk, ag as createZapierSdkWithoutRegistry, ao as definePlugin, cC as deleteClientCredentialsPlugin, ev as deleteTableFieldsPlugin, ep as deleteTablePlugin, eD as deleteTableRecordsPlugin, ck as fetchPlugin, cK as findFirstConnectionPlugin, f as findManifestEntry, cM as findUniqueConnectionPlugin, ce as formatErrorMessage, aG as generateEventId, cu as getActionInputFieldsSchemaPlugin, cG as getActionPlugin, cE as getAppPlugin, dT as getBaseUrlFromCredentials, aM as getCiPlatform, dU as getClientIdFromCredentials, cI as getConnectionPlugin, aO as getCpuTime, aH as getCurrentTimestamp, aN as getMemoryUsage, ay as getOrCreateApiClient, aJ as getOsInfo, aK as getPlatformVersions, cV as getPreferredManifestEntryKey, c_ as getProfilePlugin, aI as getReleaseId, el as getTablePlugin, ex as getTableRecordPlugin, dv as getTokenFromCliLogin, eg as getZapierApprovalMode, e7 as getZapierSdkService, dt as injectCliLogin, da as inputFieldKeyResolver, d9 as inputsAllOptionalResolver, d8 as inputsResolver, ds as invalidateCachedToken, dx as invalidateCredentialsToken, aL as isCi, du as isCliLoginAvailable, dM as isClientCredentials, dP as isCredentialsFunction, dO as isCredentialsObject, dN as isPkceCredentials, S as isPositional, cs as listActionInputFieldChoicesPlugin, cq as listActionInputFieldsPlugin, co as listActionsPlugin, cm as listAppsPlugin, cy as listClientCredentialsPlugin, cw as listConnectionsPlugin, er as listTableFieldsPlugin, ez as listTableRecordsPlugin, ej as listTablesPlugin, ac as logDeprecation, cW as manifestPlugin, ee as parseConcurrencyEnvVar, r as readManifestFromFile, au as registryPlugin, cS as requestPlugin, ad as resetDeprecationWarnings, dw as resolveAuthToken, dS as resolveCredentials, dR as resolveCredentialsFromEnv, cQ as runActionPlugin, a6 as runWithTelemetryContext, di as tableFieldIdsResolver, dk as tableFieldsResolver, dn as tableFiltersResolver, dd as tableIdResolver, dj as tableNameResolver, dg as tableRecordIdResolver, dh as tableRecordIdsResolver, dl as tableRecordsResolver, dp as tableSortResolver, dm as tableUpdateRecordsResolver, a7 as toSnakeCase, a8 as toTitleCase, de as triggerInboxResolver, df as triggerMessagesResolver, eF as updateTableRecordsPlugin } from './index-DjQ4XDAV.mjs';
1
+ export { u as Action, d as ActionEntry, ci as ActionExecutionOptions, y as ActionExecutionResult, z as ActionField, H as ActionFieldChoice, aW as ActionItem, bx as ActionKeyProperty, b5 as ActionKeyPropertySchema, by as ActionProperty, b6 as ActionPropertySchema, as as ActionResolverItem, bJ as ActionTimeoutMsProperty, bh as ActionTimeoutMsPropertySchema, at as ActionTypeItem, bw as ActionTypeProperty, b4 as ActionTypePropertySchema, b as AddActionEntryOptions, c as AddActionEntryResult, A as ApiClient, bW as ApiError, dE as ApiEvent, d0 as ApiPluginOptions, d2 as ApiPluginProvides, v as App, cj as AppFactoryInput, aU as AppItem, bu as AppKeyProperty, b2 as AppKeyPropertySchema, bv as AppProperty, b3 as AppPropertySchema, aD as ApplicationLifecycleEventData, cb as ApprovalStatus, ch as AppsPluginProvides, bO as AppsProperty, bm as AppsPropertySchema, a0 as ArrayResolver, dD as AuthEvent, bC as AuthenticationIdProperty, b9 as AuthenticationIdPropertySchema, az as BaseEvent, al as BaseSdkOptionsSchema, aa as BatchOptions, cP as CONTEXT_CACHE_MAX_SIZE, cO as CONTEXT_CACHE_TTL_MS, x as Choice, dK as ClientCredentialsObject, dV as ClientCredentialsObjectSchema, K as Connection, e1 as ConnectionEntry, e0 as ConnectionEntrySchema, bA as ConnectionIdProperty, b8 as ConnectionIdPropertySchema, aV as ConnectionItem, bB as ConnectionProperty, ba as ConnectionPropertySchema, e3 as ConnectionsMap, e2 as ConnectionsMapSchema, e5 as ConnectionsPluginProvides, bQ as ConnectionsProperty, bo as ConnectionsPropertySchema, O as ConnectionsResponse, cB as CreateClientCredentialsPluginProvides, ev as CreateTableFieldsPluginProvides, ep as CreateTablePluginProvides, eD as CreateTableRecordsPluginProvides, dH as Credentials, d_ as CredentialsFunction, dZ as CredentialsFunctionSchema, dJ as CredentialsObject, dX as CredentialsObjectSchema, d$ as CredentialsSchema, ea as DEFAULT_ACTION_TIMEOUT_MS, ei as DEFAULT_APPROVAL_TIMEOUT_MS, cY as DEFAULT_CONFIG_PATH, ej as DEFAULT_MAX_APPROVAL_RETRIES, e9 as DEFAULT_PAGE_SIZE, bH as DebugProperty, bf as DebugPropertySchema, cD as DeleteClientCredentialsPluginProvides, ex as DeleteTableFieldsPluginProvides, er as DeleteTablePluginProvides, eF as DeleteTableRecordsPluginProvides, o as DrainTriggerInboxCallback, p as DrainTriggerInboxErrorObserver, D as DrainTriggerInboxOptions, a3 as DynamicListResolver, i as DynamicResolver, a4 as DynamicSearchResolver, aE as EnhancedErrorEventData, bX as ErrorOptions, dG as EventCallback, aC as EventContext, E as EventEmissionContext, aB as EventEmissionProvides, cl as FetchPluginProvides, w as Field, bN as FieldsProperty, bl as FieldsPropertySchema, a5 as FieldsResolver, F as FieldsetItem, s as FindFirstAuthenticationPluginProvides, cL as FindFirstConnectionPluginProvides, t as FindUniqueAuthenticationPluginProvides, cN as FindUniqueConnectionPluginProvides, Y as FormatMetadata, X as FormattedItem, ak as FunctionDeprecation, a$ as FunctionOptions, aj as FunctionRegistryEntry, cv as GetActionInputFieldsSchemaPluginProvides, cH as GetActionPluginProvides, cF as GetAppPluginProvides, G as GetAuthenticationPluginProvides, cJ as GetConnectionPluginProvides, c$ as GetProfilePluginProvides, en as GetTablePluginProvides, ez as GetTableRecordPluginProvides, aY as InfoFieldItem, aX as InputFieldItem, bz as InputFieldProperty, b7 as InputFieldPropertySchema, bD as InputsProperty, bb as InputsPropertySchema, bV as LeaseLimitProperty, bt as LeaseLimitPropertySchema, bT as LeaseProperty, br as LeasePropertySchema, bU as LeaseSecondsProperty, bs as LeaseSecondsPropertySchema, L as LeasedTriggerMessageItem, bE as LimitProperty, bc as LimitPropertySchema, ct as ListActionInputFieldChoicesPluginProvides, cr as ListActionInputFieldsPluginProvides, cp as ListActionsPluginProvides, cn as ListAppsPluginProvides, q as ListAuthenticationsPluginProvides, cz as ListClientCredentialsPluginProvides, cx as ListConnectionsPluginProvides, et as ListTableFieldsPluginProvides, eB as ListTableRecordsPluginProvides, el as ListTablesPluginProvides, dF as LoadingEvent, ed as MAX_CONCURRENCY_LIMIT, e8 as MAX_PAGE_LIMIT, M as Manifest, cZ as ManifestEntry, cU as ManifestPluginOptions, cX as ManifestPluginProvides, aA as MethodCalledEvent, aF as MethodCalledEventData, N as Need, I as NeedsRequest, J as NeedsResponse, bF as OffsetProperty, bd as OffsetPropertySchema, _ as OutputFormatter, bG as OutputProperty, be as OutputPropertySchema, b1 as PaginatedSdkFunction, e as PaginatedSdkResult, bI as ParamsProperty, bg as ParamsPropertySchema, dL as PkceCredentialsObject, dW as PkceCredentialsObjectSchema, am as Plugin, P as PluginMeta, an as PluginProvides, aw as PollOptions, g as PositionalMetadata, c9 as RateLimitInfo, bL as RecordProperty, bj as RecordPropertySchema, bM as RecordsProperty, bk as RecordsPropertySchema, af as RelayFetchSchema, ae as RelayRequestSchema, av as RequestOptions, cT as RequestPluginProvides, dq as ResolveAuthTokenOptions, dQ as ResolveCredentialsOptions, R as ResolvedAppLocator, dI as ResolvedCredentials, dY as ResolvedCredentialsSchema, $ as Resolver, a1 as ResolverMetadata, aZ as RootFieldItem, cR as RunActionPluginProvides, dC as SdkEvent, b0 as SdkPage, a2 as StaticResolver, bK as TableProperty, bi as TablePropertySchema, bP as TablesProperty, bn as TablesPropertySchema, bS as TriggerInboxNameProperty, bq as TriggerInboxNamePropertySchema, bR as TriggerInboxProperty, bp as TriggerInboxPropertySchema, T as TriggerMessageStatus, U as UpdateManifestEntryOptions, a as UpdateManifestEntryResult, eH as UpdateTableRecordsPluginProvides, Q as UserProfile, a_ as UserProfileItem, j as WatchTriggerInboxOptions, W as WithAddPlugin, e6 as ZAPIER_BASE_URL, ef as ZAPIER_MAX_CONCURRENT_REQUESTS, eb as ZAPIER_MAX_NETWORK_RETRIES, ec as ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, m as ZapierAbortDrainSignal, c7 as ZapierActionError, bZ as ZapierApiError, b_ as ZapierAppNotFoundError, cc as ZapierApprovalError, c1 as ZapierAuthenticationError, c5 as ZapierBundleError, dy as ZapierCache, dz as ZapierCacheEntry, dA as ZapierCacheSetOptions, c4 as ZapierConfigurationError, c8 as ZapierConflictError, bY as ZapierError, h as ZapierFetchInitOptions, c2 as ZapierNotFoundError, ca as ZapierRateLimitError, cd as ZapierRelayError, n as ZapierReleaseTriggerMessageSignal, c3 as ZapierResourceNotFoundError, eJ as ZapierSdk, l as ZapierSdkApps, Z as ZapierSdkOptions, cf as ZapierSignal, c6 as ZapierTimeoutError, c0 as ZapierUnknownError, b$ as ZapierValidationError, d5 as actionKeyResolver, d4 as actionTypeResolver, d1 as apiPlugin, d3 as appKeyResolver, cg as appsPlugin, d7 as authenticationIdGenericResolver, d6 as authenticationIdResolver, a9 as batch, aP as buildApplicationLifecycleEvent, ab as buildCapabilityMessage, aR as buildErrorEvent, aQ as buildErrorEventWithContext, aT as buildMethodCalledEvent, dr as clearTokenCache, db as clientCredentialsNameResolver, dc as clientIdResolver, ar as composePlugins, d7 as connectionIdGenericResolver, d6 as connectionIdResolver, e4 as connectionsPlugin, aS as createBaseEvent, cA as createClientCredentialsPlugin, V as createFunction, dB as createMemoryCache, ai as createOptionsPlugin, aq as createPaginatedPluginMethod, ap as createPluginMethod, ah as createSdk, eu as createTableFieldsPlugin, eo as createTablePlugin, eC as createTableRecordsPlugin, ax as createZapierApi, eI as createZapierSdk, ag as createZapierSdkWithoutRegistry, ao as definePlugin, cC as deleteClientCredentialsPlugin, ew as deleteTableFieldsPlugin, eq as deleteTablePlugin, eE as deleteTableRecordsPlugin, ck as fetchPlugin, cK as findFirstConnectionPlugin, f as findManifestEntry, cM as findUniqueConnectionPlugin, ce as formatErrorMessage, aG as generateEventId, cu as getActionInputFieldsSchemaPlugin, cG as getActionPlugin, cE as getAppPlugin, dT as getBaseUrlFromCredentials, aM as getCiPlatform, dU as getClientIdFromCredentials, cI as getConnectionPlugin, aO as getCpuTime, aH as getCurrentTimestamp, aN as getMemoryUsage, ay as getOrCreateApiClient, aJ as getOsInfo, aK as getPlatformVersions, cV as getPreferredManifestEntryKey, c_ as getProfilePlugin, aI as getReleaseId, em as getTablePlugin, ey as getTableRecordPlugin, dv as getTokenFromCliLogin, eg as getZapierApprovalMode, eh as getZapierDefaultApprovalMode, e7 as getZapierSdkService, dt as injectCliLogin, da as inputFieldKeyResolver, d9 as inputsAllOptionalResolver, d8 as inputsResolver, ds as invalidateCachedToken, dx as invalidateCredentialsToken, aL as isCi, du as isCliLoginAvailable, dM as isClientCredentials, dP as isCredentialsFunction, dO as isCredentialsObject, dN as isPkceCredentials, S as isPositional, cs as listActionInputFieldChoicesPlugin, cq as listActionInputFieldsPlugin, co as listActionsPlugin, cm as listAppsPlugin, cy as listClientCredentialsPlugin, cw as listConnectionsPlugin, es as listTableFieldsPlugin, eA as listTableRecordsPlugin, ek as listTablesPlugin, ac as logDeprecation, cW as manifestPlugin, ee as parseConcurrencyEnvVar, r as readManifestFromFile, au as registryPlugin, cS as requestPlugin, ad as resetDeprecationWarnings, dw as resolveAuthToken, dS as resolveCredentials, dR as resolveCredentialsFromEnv, cQ as runActionPlugin, a6 as runWithTelemetryContext, di as tableFieldIdsResolver, dk as tableFieldsResolver, dn as tableFiltersResolver, dd as tableIdResolver, dj as tableNameResolver, dg as tableRecordIdResolver, dh as tableRecordIdsResolver, dl as tableRecordsResolver, dp as tableSortResolver, dm as tableUpdateRecordsResolver, a7 as toSnakeCase, a8 as toTitleCase, de as triggerInboxResolver, df as triggerMessagesResolver, eG as updateTableRecordsPlugin } from './index-CjP7lGzL.mjs';
2
2
  import 'zod';
3
3
  import '@zapier/zapier-sdk-core/v0/schemas/connections';
4
4
  import '@zapier/policy-context';
package/dist/index.mjs CHANGED
@@ -82,6 +82,10 @@ function getZapierApprovalMode() {
82
82
  return value;
83
83
  return void 0;
84
84
  }
85
+ function getZapierDefaultApprovalMode() {
86
+ const isInteractive = !!globalThis.process?.stdin?.isTTY && !!globalThis.process?.stdout?.isTTY;
87
+ return isInteractive ? "poll" : "throw";
88
+ }
85
89
  var DEFAULT_APPROVAL_TIMEOUT_MS = 10 * 60 * 1e3;
86
90
  var DEFAULT_MAX_APPROVAL_RETRIES = 2;
87
91
 
@@ -6316,7 +6320,7 @@ async function invalidateCredentialsToken(options) {
6316
6320
  }
6317
6321
 
6318
6322
  // src/sdk-version.ts
6319
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.55.0" : void 0) || "unknown";
6323
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.56.0" : void 0) || "unknown";
6320
6324
 
6321
6325
  // src/utils/open-url.ts
6322
6326
  var nodePrefix = "node:";
@@ -6646,7 +6650,7 @@ var ZapierApiClient = class {
6646
6650
  }
6647
6651
  if (errorType !== "approval_required") return response;
6648
6652
  if (attempt === maxRetries) break;
6649
- const mode = this.options.approvalMode ?? getZapierApprovalMode() ?? "disabled";
6653
+ const mode = this.options.approvalMode ?? getZapierApprovalMode() ?? getZapierDefaultApprovalMode();
6650
6654
  if (mode === "disabled") {
6651
6655
  throw new ZapierApprovalError(
6652
6656
  "Approvals are disabled. Set approvalMode to 'poll' or 'throw' (or ZAPIER_APPROVAL_MODE) to enable.",
@@ -9121,7 +9125,7 @@ var BaseSdkOptionsSchema = z.object({
9121
9125
  "Maximum number of sequential approval rounds per request (one per gating policy) before giving up. Default: 2."
9122
9126
  ),
9123
9127
  approvalMode: z.enum(["disabled", "poll", "throw"]).optional().describe(
9124
- '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".'
9128
+ 'Approval flow behavior. "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. "disabled" throws a ZapierApprovalError on approval-required responses without creating an approval. Resolution order is: explicit option, then ZAPIER_APPROVAL_MODE, then the default behavior (poll for interactive TTY, throw otherwise).'
9125
9129
  ),
9126
9130
  // Internal
9127
9131
  manifestPath: z.string().optional().describe("Path to a .zapierrc manifest file for app version locking.").meta({ internal: true }),
@@ -9147,4 +9151,4 @@ var registryPlugin = definePlugin((_sdk) => {
9147
9151
  return {};
9148
9152
  });
9149
9153
 
9150
- 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_CONCURRENCY_LIMIT, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RecordPropertySchema, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, TablePropertySchema, TablesPropertySchema, TriggerInboxNamePropertySchema, TriggerInboxPropertySchema, ZAPIER_BASE_URL, ZAPIER_MAX_CONCURRENT_REQUESTS, 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, 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, parseConcurrencyEnvVar, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, runWithTelemetryContext, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, triggerInboxResolver, triggerMessagesResolver, updateTableRecordsPlugin };
9154
+ 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_CONCURRENCY_LIMIT, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RecordPropertySchema, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, TablePropertySchema, TablesPropertySchema, TriggerInboxNamePropertySchema, TriggerInboxPropertySchema, ZAPIER_BASE_URL, ZAPIER_MAX_CONCURRENT_REQUESTS, 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, 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, getZapierDefaultApprovalMode, 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, parseConcurrencyEnvVar, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, runWithTelemetryContext, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, triggerInboxResolver, triggerMessagesResolver, updateTableRecordsPlugin };
package/dist/types/sdk.js CHANGED
@@ -73,7 +73,7 @@ export const BaseSdkOptionsSchema = z.object({
73
73
  approvalMode: z
74
74
  .enum(["disabled", "poll", "throw"])
75
75
  .optional()
76
- .describe('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".'),
76
+ .describe('Approval flow behavior. "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. "disabled" throws a ZapierApprovalError on approval-required responses without creating an approval. Resolution order is: explicit option, then ZAPIER_APPROVAL_MODE, then the default behavior (poll for interactive TTY, throw otherwise).'),
77
77
  // Internal
78
78
  manifestPath: z
79
79
  .string()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk",
3
- "version": "0.55.0",
3
+ "version": "0.56.0",
4
4
  "description": "Complete Zapier SDK - combines all Zapier SDK packages",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",