@zapier/zapier-sdk-cli 0.66.5 → 0.67.1

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,29 @@
1
1
  # @zapier/zapier-sdk-cli
2
2
 
3
+ ## 0.67.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [60892be]
8
+ - @zapier/zapier-sdk@0.88.1
9
+ - @zapier/zapier-sdk-mcp@0.18.16
10
+
11
+ ## 0.67.0
12
+
13
+ ### Minor Changes
14
+
15
+ - 0e49ffa: Renamed time-duration flags and env vars so every one carries its unit as a full-word suffix. Coarse durations move to **seconds**; the deprecated names still work (and keep their millisecond meaning).
16
+ - `--max-network-retry-delay-ms` → `--max-network-retry-delay-seconds`
17
+ - `run-action --timeout-ms` → `--timeout-seconds`
18
+ - `create-connection` / `wait-for-new-connection` `--timeout-ms` → `--timeout-seconds`, `--poll-interval-ms` → `--poll-interval-milliseconds`
19
+ - env `ZAPIER_SDK_UPDATE_CHECK_INTERVAL_MS` → `ZAPIER_SDK_UPDATE_CHECK_INTERVAL_SECONDS`
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies [0e49ffa]
24
+ - @zapier/zapier-sdk@0.88.0
25
+ - @zapier/zapier-sdk-mcp@0.18.15
26
+
3
27
  ## 0.66.5
4
28
 
5
29
  ### Patch Changes
package/README.md CHANGED
@@ -157,28 +157,28 @@ npx zapier-sdk fetch "https://gmail.googleapis.com/gmail/v1/users/me/labels" --c
157
157
 
158
158
  These options are available for all commands:
159
159
 
160
- | Option | Short | Description |
161
- | --------------------------------------- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
162
- | `--version` | `-V` | Display version number |
163
- | `--help` | `-h` | Display help for command |
164
- | `--credentials <token>` | | Authentication token. |
165
- | `--credentials-client-id <id>` | | OAuth client ID for authentication. |
166
- | `--credentials-client-secret <secret>` | | OAuth client secret for authentication. |
167
- | `--credentials-base-url <url>` | | Override authentication base URL. |
168
- | `--debug` | | Enable debug logging. |
169
- | `--base-url <url>` | | Base URL for Zapier API endpoints. |
170
- | `--tracking-base-url <url>` | | Base URL for Zapier tracking endpoints. |
171
- | `--max-network-retries <count>` | | Max retries for rate-limited requests (default: 3). |
172
- | `--max-network-retry-delay-ms <ms>` | | Max delay in ms to wait for retry (default: 60000). |
173
- | `--max-concurrent-requests <count>` | | Max concurrent in-flight HTTP requests (default: 200, max: 10000). |
174
- | `--approval-timeout-ms <ms>` | | Timeout in ms for approval polling. Default: 600000 (10 min). |
175
- | `--max-approval-retries` | | Maximum number of sequential approval rounds per request (one per gating policy) before giving up. Default: 2. |
176
- | `--approval-mode` | | Approval flow behavior for manual approvals. "poll" creates the approval, opens it in a browser, polls until resolved, and retries the original request. "throw" creates the manual approval and throws a ZapierApprovalError with the approval URL so the caller can surface it. Server-created auto-mode approvals always poll until they reach a terminal status and retry the original request on approval, even when this option is "throw". "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). |
177
- | `--open-auto-mode-approvals-in-browser` | | By default, auto-mode approvals do not open in a browser. Enable this option to open the approval URL and watch the approval process. Resolution order is: explicit option, then ZAPIER_OPEN_AUTO_MODE_APPROVALS_IN_BROWSER, then false. |
178
- | `--can-include-shared-connections` | | Allow listing shared connections. |
179
- | `--can-include-shared-tables` | | Allow listing shared tables. |
180
- | `--can-delete-tables` | | Allow deleting tables. |
181
- | `--json` | | Output raw JSON instead of formatted results |
160
+ | Option | Short | Description |
161
+ | --------------------------------------------- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
162
+ | `--version` | `-V` | Display version number |
163
+ | `--help` | `-h` | Display help for command |
164
+ | `--credentials <token>` | | Authentication token. |
165
+ | `--credentials-client-id <id>` | | OAuth client ID for authentication. |
166
+ | `--credentials-client-secret <secret>` | | OAuth client secret for authentication. |
167
+ | `--credentials-base-url <url>` | | Override authentication base URL. |
168
+ | `--debug` | | Enable debug logging. |
169
+ | `--base-url <url>` | | Base URL for Zapier API endpoints. |
170
+ | `--tracking-base-url <url>` | | Base URL for Zapier tracking endpoints. |
171
+ | `--max-network-retries <count>` | | Max retries for rate-limited requests (default: 3). |
172
+ | `--max-network-retry-delay-seconds <seconds>` | | Max delay in seconds to wait for a rate-limit retry (default: 60). |
173
+ | `--max-concurrent-requests <count>` | | Max concurrent in-flight HTTP requests (default: 200, max: 10000). |
174
+ | `--approval-timeout-seconds <seconds>` | | Timeout in seconds for approval polling. Default: 600 (10 min). |
175
+ | `--max-approval-retries` | | Maximum number of sequential approval rounds per request (one per gating policy) before giving up. Default: 2. |
176
+ | `--approval-mode` | | Approval flow behavior for manual approvals. "poll" creates the approval, opens it in a browser, polls until resolved, and retries the original request. "throw" creates the manual approval and throws a ZapierApprovalError with the approval URL so the caller can surface it. Server-created auto-mode approvals always poll until they reach a terminal status and retry the original request on approval, even when this option is "throw". "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). |
177
+ | `--open-auto-mode-approvals-in-browser` | | By default, auto-mode approvals do not open in a browser. Enable this option to open the approval URL and watch the approval process. Resolution order is: explicit option, then ZAPIER_OPEN_AUTO_MODE_APPROVALS_IN_BROWSER, then false. |
178
+ | `--can-include-shared-connections` | | Allow listing shared connections. |
179
+ | `--can-include-shared-tables` | | Allow listing shared tables. |
180
+ | `--can-delete-tables` | | Allow deleting tables. |
181
+ | `--json` | | Output raw JSON instead of formatted results |
182
182
 
183
183
  ## Available Commands
184
184
 
@@ -361,22 +361,22 @@ Execute an action with the given inputs
361
361
 
362
362
  **Options:**
363
363
 
364
- | Option | Type | Required | Default | Possible Values | Description |
365
- | --------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
366
- | `<app>` | `string` | ✅ | — | — | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
367
- | `<action-type>` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
368
- | `<action>` | `string` | ✅ | — | — | Action key (e.g., 'send_message' or 'find_row') |
369
- | `--connection` | `string, number` | ❌ | — | — | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. Mutually exclusive with connectionId. |
370
- | `--inputs` | `object` | ❌ | — | — | Input parameters for the action |
371
- | `--timeout-ms` | `number` | ❌ | — | — | Maximum time to wait for action completion in milliseconds (default: 180000) |
372
- | `--page-size` | `number` | ❌ | — | — | Number of results per page |
373
- | `--max-items` | `number` | ❌ | — | — | Maximum total items to return across all pages |
374
- | `--cursor` | `string` | ❌ | — | — | Cursor to start from |
364
+ | Option | Type | Required | Default | Possible Values | Description |
365
+ | ------------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
366
+ | `<app>` | `string` | ✅ | — | — | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
367
+ | `<action-type>` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
368
+ | `<action>` | `string` | ✅ | — | — | Action key (e.g., 'send_message' or 'find_row') |
369
+ | `--connection` | `string, number` | ❌ | — | — | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. Mutually exclusive with connectionId. |
370
+ | `--inputs` | `object` | ❌ | — | — | Input parameters for the action |
371
+ | `--timeout-seconds` | `number` | ❌ | — | — | Maximum time to wait for action completion in seconds (default: 180) |
372
+ | `--page-size` | `number` | ❌ | — | — | Number of results per page |
373
+ | `--max-items` | `number` | ❌ | — | — | Maximum total items to return across all pages |
374
+ | `--cursor` | `string` | ❌ | — | — | Cursor to start from |
375
375
 
376
376
  **Usage:**
377
377
 
378
378
  ```bash
379
- npx zapier-sdk run-action <app> <action-type> <action> [--connection] [--inputs] [--timeout-ms] [--page-size] [--max-items] [--cursor]
379
+ npx zapier-sdk run-action <app> <action-type> <action> [--connection] [--inputs] [--timeout-seconds] [--page-size] [--max-items] [--cursor]
380
380
  ```
381
381
 
382
382
  ### Apps
@@ -807,17 +807,17 @@ This is the right command for most callers. Reach for the lower-level building b
807
807
 
808
808
  **Options:**
809
809
 
810
- | Option | Type | Required | Default | Possible Values | Description |
811
- | -------------------- | -------- | -------- | -------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
812
- | `<app>` | `string` | ✅ | — | — | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
813
- | `--browser` | `string` | ❌ | `"auto"` | `auto`, `always`, `never` | When to auto-open the URL in a browser. `auto` (default) opens in local sessions and skips opening in CI / SSH / headless-Linux. `always` forces the open attempt. `never` skips it. The URL is always printed to stderr regardless — a failed or skipped open degrades gracefully to copy-paste. |
814
- | `--timeout-ms` | `number` | ❌ | — | — | How long to wait for the user to complete the connection flow before giving up. Default 5 minutes (300_000). |
815
- | `--poll-interval-ms` | `number` | ❌ | — | — | Delay before the first poll request, in ms. Default 3 seconds (3_000). Subsequent polling cadence is managed by the SDK's polling primitive (backoff with sane defaults). |
810
+ | Option | Type | Required | Default | Possible Values | Description |
811
+ | ------------------------------ | -------- | -------- | -------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
812
+ | `<app>` | `string` | ✅ | — | — | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
813
+ | `--browser` | `string` | ❌ | `"auto"` | `auto`, `always`, `never` | When to auto-open the URL in a browser. `auto` (default) opens in local sessions and skips opening in CI / SSH / headless-Linux. `always` forces the open attempt. `never` skips it. The URL is always printed to stderr regardless — a failed or skipped open degrades gracefully to copy-paste. |
814
+ | `--timeout-seconds` | `number` | ❌ | — | — | How long to wait for the user to complete the connection flow before giving up. Default 5 minutes (300). |
815
+ | `--poll-interval-milliseconds` | `number` | ❌ | — | — | Delay before the first poll request, in ms. Default 3 seconds (3_000). Subsequent polling cadence is managed by the SDK's polling primitive (backoff with sane defaults). |
816
816
 
817
817
  **Usage:**
818
818
 
819
819
  ```bash
820
- npx zapier-sdk create-connection <app> [--browser] [--timeout-ms] [--poll-interval-ms]
820
+ npx zapier-sdk create-connection <app> [--browser] [--timeout-seconds] [--poll-interval-milliseconds]
821
821
  ```
822
822
 
823
823
  #### `find-first-connection`
@@ -948,17 +948,17 @@ const { data: conn } = await zapier.waitForNewConnection({ app, startedAt });
948
948
 
949
949
  **Options:**
950
950
 
951
- | Option | Type | Required | Default | Possible Values | Description |
952
- | -------------------- | -------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
953
- | `<app>` | `string` | ✅ | — | — | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
954
- | `<started-at>` | `number` | ✅ | — | — | Unix timestamp (seconds). Only connections whose `date` is at or after this value count as 'new'. Prefer the `startedAt` returned by `get-connection-start-url` — it's server-stamped, so the comparison isn't thrown off by client clock skew. If you mint the timestamp yourself, capture it _before_ showing the start URL so a fast OAuth completion isn't missed. |
955
- | `--timeout-ms` | `number` | ❌ | — | — | How long to wait before giving up. Default 5 minutes (300_000). |
956
- | `--poll-interval-ms` | `number` | ❌ | — | — | Delay before the first poll request, in ms. Default 3 seconds (3_000). Subsequent polling cadence is managed by the SDK's polling primitive (backoff with sane defaults). |
951
+ | Option | Type | Required | Default | Possible Values | Description |
952
+ | ------------------------------ | -------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
953
+ | `<app>` | `string` | ✅ | — | — | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
954
+ | `<started-at>` | `number` | ✅ | — | — | Unix timestamp (seconds). Only connections whose `date` is at or after this value count as 'new'. Prefer the `startedAt` returned by `get-connection-start-url` — it's server-stamped, so the comparison isn't thrown off by client clock skew. If you mint the timestamp yourself, capture it _before_ showing the start URL so a fast OAuth completion isn't missed. |
955
+ | `--timeout-seconds` | `number` | ❌ | — | — | How long to wait before giving up. Default 5 minutes (300). |
956
+ | `--poll-interval-milliseconds` | `number` | ❌ | — | — | Delay before the first poll request, in ms. Default 3 seconds (3_000). Subsequent polling cadence is managed by the SDK's polling primitive (backoff with sane defaults). |
957
957
 
958
958
  **Usage:**
959
959
 
960
960
  ```bash
961
- npx zapier-sdk wait-for-new-connection <app> <started-at> [--timeout-ms] [--poll-interval-ms]
961
+ npx zapier-sdk wait-for-new-connection <app> <started-at> [--timeout-seconds] [--poll-interval-milliseconds]
962
962
  ```
963
963
 
964
964
  ### HTTP Requests
package/dist/cli.cjs CHANGED
@@ -536,7 +536,7 @@ var SHARED_COMMAND_CLI_OPTIONS = [
536
536
 
537
537
  // package.json
538
538
  var package_default = {
539
- version: "0.66.5"};
539
+ version: "0.67.1"};
540
540
 
541
541
  // src/telemetry/builders.ts
542
542
  function createCliBaseEvent(context = {}) {
@@ -1893,10 +1893,10 @@ function hasLegacyJwtConfig() {
1893
1893
  }
1894
1894
  var SERVICE2 = "zapier-sdk-cache";
1895
1895
  var CONFIG_KEY = "cache";
1896
- var LOCK_UPDATE_MS = 5e3;
1897
- var LOCK_STALE_MS = 1e4;
1898
- var LOCK_RETRY_WAIT_MS = 100;
1899
- var LOCK_RETRY_MAX_WAIT_MS = 1e3;
1896
+ var LOCK_UPDATE_MILLISECONDS = 5e3;
1897
+ var LOCK_STALE_MILLISECONDS = 1e4;
1898
+ var LOCK_RETRY_WAIT_MILLISECONDS = 100;
1899
+ var LOCK_RETRY_MAX_WAIT_MILLISECONDS = 1e3;
1900
1900
  var LOCK_RETRY_COUNT = 120;
1901
1901
  function keychainAccount(key) {
1902
1902
  return crypto.createHash("sha256").update(key).digest("hex");
@@ -1995,13 +1995,13 @@ function createCache() {
1995
1995
  let release = null;
1996
1996
  try {
1997
1997
  release = await lockfile__namespace.lock(lockTarget, {
1998
- stale: LOCK_STALE_MS,
1999
- update: LOCK_UPDATE_MS,
1998
+ stale: LOCK_STALE_MILLISECONDS,
1999
+ update: LOCK_UPDATE_MILLISECONDS,
2000
2000
  retries: {
2001
2001
  retries: LOCK_RETRY_COUNT,
2002
2002
  factor: 1.2,
2003
- minTimeout: LOCK_RETRY_WAIT_MS,
2004
- maxTimeout: LOCK_RETRY_MAX_WAIT_MS
2003
+ minTimeout: LOCK_RETRY_WAIT_MILLISECONDS,
2004
+ maxTimeout: LOCK_RETRY_MAX_WAIT_MILLISECONDS
2005
2005
  }
2006
2006
  });
2007
2007
  } catch {
@@ -2205,7 +2205,7 @@ async function deleteStoredClientCredentials({
2205
2205
 
2206
2206
  // src/login/index.ts
2207
2207
  var DEFAULT_AUTH_CLIENT_ID = "grwWZD5hUWGvb4V8ODBuOtXer3h0DBEZ2HR8aay6";
2208
- var TOKEN_REFRESH_BUFFER_MS = 5 * 60 * 1e3;
2208
+ var TOKEN_REFRESH_BUFFER_MILLISECONDS = 5 * 60 * 1e3;
2209
2209
  function createDebugLog(enabled) {
2210
2210
  if (!enabled) {
2211
2211
  return () => {
@@ -2442,7 +2442,7 @@ async function resolveOrRefreshToken(options = {}) {
2442
2442
  return void 0;
2443
2443
  }
2444
2444
  const { jwt: storedJwt, refreshToken, expiresAt } = stored;
2445
- if (expiresAt > Date.now() + TOKEN_REFRESH_BUFFER_MS) {
2445
+ if (expiresAt > Date.now() + TOKEN_REFRESH_BUFFER_MILLISECONDS) {
2446
2446
  debugLog("Using cached token (still valid)");
2447
2447
  return storedJwt;
2448
2448
  }
@@ -2714,7 +2714,7 @@ async function setupClientCredentials({
2714
2714
 
2715
2715
  // src/utils/constants.ts
2716
2716
  var LOGIN_PORTS = [49505, 50575, 52804, 55981, 61010, 63851];
2717
- var LOGIN_TIMEOUT_MS = 3e5;
2717
+ var LOGIN_TIMEOUT_MILLISECONDS = 3e5;
2718
2718
 
2719
2719
  // src/utils/getCallablePromise.ts
2720
2720
  var getCallablePromise = () => {
@@ -3160,7 +3160,7 @@ async function runSignupOauthFlow(options) {
3160
3160
  });
3161
3161
  }
3162
3162
  async function startPendingOauthFlow({
3163
- timeoutMs = LOGIN_TIMEOUT_MS,
3163
+ timeoutMs = LOGIN_TIMEOUT_MILLISECONDS,
3164
3164
  pkceCredentials,
3165
3165
  baseUrl: baseUrl2,
3166
3166
  entryPoint,
@@ -3314,7 +3314,7 @@ function writeHeadlessOauthStatus(message) {
3314
3314
  `);
3315
3315
  }
3316
3316
  async function runOauthFlow({
3317
- timeoutMs = LOGIN_TIMEOUT_MS,
3317
+ timeoutMs = LOGIN_TIMEOUT_MILLISECONDS,
3318
3318
  pkceCredentials,
3319
3319
  baseUrl: baseUrl2,
3320
3320
  entryPoint,
@@ -3410,7 +3410,7 @@ async function readHeadlessCallbackUrl({
3410
3410
  }
3411
3411
  }
3412
3412
  async function runHeadlessOauthFlow({
3413
- timeoutMs = LOGIN_TIMEOUT_MS,
3413
+ timeoutMs = LOGIN_TIMEOUT_MILLISECONDS,
3414
3414
  pkceCredentials,
3415
3415
  baseUrl: baseUrl2,
3416
3416
  entryPoint,
@@ -5281,7 +5281,7 @@ var feedbackResolver = zapierSdk.defineResolver({
5281
5281
  });
5282
5282
  var DEFAULT_FEEDBACK_WEBHOOK_URL = "https://hooks.zapier.com/hooks/catch/20279515/uc98k9m/";
5283
5283
  var MAX_RETRIES = 2;
5284
- var RETRY_DELAY_MS = 1e3;
5284
+ var RETRY_DELAY_MILLISECONDS = 1e3;
5285
5285
  function getFeedbackWebhookUrl() {
5286
5286
  return process.env.ZAPIER_FEEDBACK_WEBHOOK_URL || DEFAULT_FEEDBACK_WEBHOOK_URL;
5287
5287
  }
@@ -5295,7 +5295,7 @@ async function postWithRetry({
5295
5295
  body
5296
5296
  });
5297
5297
  if (!response.ok && attemptsLeft > 1) {
5298
- await new Promise((r) => setTimeout(r, RETRY_DELAY_MS));
5298
+ await new Promise((r) => setTimeout(r, RETRY_DELAY_MILLISECONDS));
5299
5299
  return postWithRetry({ body, attemptsLeft: attemptsLeft - 1 });
5300
5300
  }
5301
5301
  return response;
@@ -6767,7 +6767,7 @@ function buildBoxLines(message) {
6767
6767
  // package.json with { type: 'json' }
6768
6768
  var package_default2 = {
6769
6769
  name: "@zapier/zapier-sdk-cli",
6770
- version: "0.66.5"};
6770
+ version: "0.67.1"};
6771
6771
 
6772
6772
  // src/sdk.ts
6773
6773
  var warnedDeprecatedMethods = /* @__PURE__ */ new Set();
@@ -6959,20 +6959,31 @@ function readEnvSpecs() {
6959
6959
  if (!raw) return [];
6960
6960
  return raw.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
6961
6961
  }
6962
- var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
6963
- var CACHE_RESET_INTERVAL_MS = (() => {
6964
- const { ZAPIER_SDK_UPDATE_CHECK_INTERVAL_MS = `${ONE_DAY_MS}` } = process.env;
6965
- const interval = parseInt(ZAPIER_SDK_UPDATE_CHECK_INTERVAL_MS);
6966
- if (isNaN(interval) || interval < 0) {
6962
+ var ONE_DAY_MILLISECONDS = 24 * 60 * 60 * 1e3;
6963
+ var CACHE_RESET_INTERVAL_MILLISECONDS = (() => {
6964
+ const {
6965
+ ZAPIER_SDK_UPDATE_CHECK_INTERVAL_SECONDS,
6966
+ ZAPIER_SDK_UPDATE_CHECK_INTERVAL_MS
6967
+ } = process.env;
6968
+ let intervalMs;
6969
+ if (ZAPIER_SDK_UPDATE_CHECK_INTERVAL_SECONDS !== void 0) {
6970
+ const seconds = parseInt(ZAPIER_SDK_UPDATE_CHECK_INTERVAL_SECONDS);
6971
+ intervalMs = isNaN(seconds) ? NaN : seconds * 1e3;
6972
+ } else if (ZAPIER_SDK_UPDATE_CHECK_INTERVAL_MS !== void 0) {
6973
+ intervalMs = parseInt(ZAPIER_SDK_UPDATE_CHECK_INTERVAL_MS);
6974
+ } else {
6975
+ intervalMs = ONE_DAY_MILLISECONDS;
6976
+ }
6977
+ if (isNaN(intervalMs) || intervalMs < 0) {
6967
6978
  return -1;
6968
6979
  }
6969
- return interval;
6980
+ return intervalMs;
6970
6981
  })();
6971
6982
  function getVersionCache() {
6972
6983
  try {
6973
6984
  const cache = getConfig().get("version_cache");
6974
6985
  const now = Date.now();
6975
- if (!cache || !cache.last_reset_timestamp || now - cache.last_reset_timestamp >= CACHE_RESET_INTERVAL_MS) {
6986
+ if (!cache || !cache.last_reset_timestamp || now - cache.last_reset_timestamp >= CACHE_RESET_INTERVAL_MILLISECONDS) {
6976
6987
  const newCache = {
6977
6988
  last_reset_timestamp: now,
6978
6989
  packages: {}
@@ -7099,7 +7110,7 @@ async function checkAndNotifyUpdates({
7099
7110
  packageName,
7100
7111
  currentVersion
7101
7112
  }) {
7102
- if (CACHE_RESET_INTERVAL_MS < 0) {
7113
+ if (CACHE_RESET_INTERVAL_MILLISECONDS < 0) {
7103
7114
  return;
7104
7115
  }
7105
7116
  const versionInfo = await checkForUpdates({ packageName, currentVersion });
@@ -7155,7 +7166,7 @@ function displayWidth(text) {
7155
7166
  var FALLBACK_PANEL_WIDTH = 72;
7156
7167
  var MIN_PANEL_WIDTH = 36;
7157
7168
  var MAX_PANEL_WIDTH = 88;
7158
- var SPINNER_INTERVAL_MS = 80;
7169
+ var SPINNER_INTERVAL_MILLISECONDS = 80;
7159
7170
  var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
7160
7171
  var ESC = String.fromCharCode(27);
7161
7172
  var HIDE_CURSOR = `${ESC}[?25l`;
@@ -7338,7 +7349,7 @@ function createApprovalProgressRenderer({
7338
7349
  } catch (error) {
7339
7350
  disableAfterError(error);
7340
7351
  }
7341
- }, SPINNER_INTERVAL_MS);
7352
+ }, SPINNER_INTERVAL_MILLISECONDS);
7342
7353
  spinnerTimer.unref?.();
7343
7354
  }
7344
7355
  function update(nextState, { complete = false } = {}) {
@@ -7441,7 +7452,7 @@ function createApprovalProgressRenderer({
7441
7452
  }
7442
7453
 
7443
7454
  // src/cli.ts
7444
- var EXIT_GRACE_PERIOD_MS = 500;
7455
+ var EXIT_GRACE_PERIOD_MILLISECONDS = 500;
7445
7456
  var program = new commander.Command();
7446
7457
  var versionOption = getReservedCliOption("version" /* Version */);
7447
7458
  var helpOption = getReservedCliOption("help" /* Help */);
@@ -7458,9 +7469,12 @@ program.name("zapier-sdk").description("CLI for Zapier SDK").version(
7458
7469
  ).option("--tracking-base-url <url>", "Base URL for Zapier tracking endpoints").option(
7459
7470
  "--max-network-retries <count>",
7460
7471
  "Max retries for rate-limited requests (default: 3)"
7472
+ ).option(
7473
+ "--max-network-retry-delay-seconds <seconds>",
7474
+ "Max delay in seconds to wait for a rate-limit retry (default: 60)"
7461
7475
  ).option(
7462
7476
  "--max-network-retry-delay-ms <ms>",
7463
- "Max delay in ms to wait for rate limit retry (default: 60000)"
7477
+ "Deprecated. Use --max-network-retry-delay-seconds."
7464
7478
  ).option(
7465
7479
  "--max-concurrent-requests <count>",
7466
7480
  "Max concurrent in-flight HTTP requests (default: 200). Pass 'Infinity' to disable."
@@ -7503,6 +7517,10 @@ var credentialsBaseUrl = getFlagValue("--credentials-base-url");
7503
7517
  var trackingBaseUrl = getFlagValue("--tracking-base-url");
7504
7518
  var maxNetworkRetriesStr = getFlagValue("--max-network-retries");
7505
7519
  var maxNetworkRetries = maxNetworkRetriesStr ? parseInt(maxNetworkRetriesStr, 10) : void 0;
7520
+ var maxNetworkRetryDelaySecondsStr = getFlagValue(
7521
+ "--max-network-retry-delay-seconds"
7522
+ );
7523
+ var maxNetworkRetryDelaySeconds = maxNetworkRetryDelaySecondsStr ? parseInt(maxNetworkRetryDelaySecondsStr, 10) : void 0;
7506
7524
  var maxNetworkRetryDelayMsStr = getFlagValue("--max-network-retry-delay-ms");
7507
7525
  var maxNetworkRetryDelayMs = maxNetworkRetryDelayMsStr ? parseInt(maxNetworkRetryDelayMsStr, 10) : void 0;
7508
7526
  var maxConcurrentRequestsStr = getFlagValue("--max-concurrent-requests");
@@ -7559,6 +7577,7 @@ program.exitOverride();
7559
7577
  baseUrl,
7560
7578
  trackingBaseUrl,
7561
7579
  maxNetworkRetries,
7580
+ maxNetworkRetryDelaySeconds,
7562
7581
  maxNetworkRetryDelayMs,
7563
7582
  maxConcurrentRequests,
7564
7583
  onEvent: approvalProgress.onEvent,
@@ -7590,7 +7609,7 @@ program.exitOverride();
7590
7609
  renderDeprecationNotices();
7591
7610
  const exitTimeout = setTimeout(
7592
7611
  () => process.exit(exitCode),
7593
- EXIT_GRACE_PERIOD_MS
7612
+ EXIT_GRACE_PERIOD_MILLISECONDS
7594
7613
  );
7595
7614
  exitTimeout.unref();
7596
7615
  process.exitCode = exitCode;