@zapier/zapier-sdk 0.87.0 → 0.88.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 +22 -0
- package/README.md +44 -44
- package/dist/{chunk-275CXIIT.cjs → chunk-AVB4LBN5.cjs} +179 -101
- package/dist/{chunk-XUT7EPI7.mjs → chunk-IXLMFSFV.mjs} +174 -97
- package/dist/define.d.mts +2 -2
- package/dist/define.d.ts +2 -2
- package/dist/experimental.cjs +350 -346
- package/dist/experimental.d.mts +20 -2
- package/dist/experimental.d.ts +20 -2
- package/dist/experimental.mjs +2 -2
- package/dist/{index-CBvczsOD.d.mts → index-CGfO1ZB1.d.mts} +69 -9
- package/dist/{index-CBvczsOD.d.ts → index-CGfO1ZB1.d.ts} +69 -9
- package/dist/index.cjs +278 -274
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
|
@@ -144,13 +144,34 @@ function buildRegistry({
|
|
|
144
144
|
}).filter((category) => category.functions.length > 0);
|
|
145
145
|
return { functions: filteredFunctions, categories: filteredCategories };
|
|
146
146
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
if (!
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
147
|
+
var isolated = /* @__PURE__ */ new WeakSet();
|
|
148
|
+
function isolate(observer) {
|
|
149
|
+
if (!observer) return void 0;
|
|
150
|
+
if (isolated.has(observer)) return observer;
|
|
151
|
+
const wrapped = (ctx) => {
|
|
152
|
+
try {
|
|
153
|
+
observer(ctx);
|
|
154
|
+
} catch (error) {
|
|
155
|
+
console.error(
|
|
156
|
+
"[core] A method-lifecycle observer threw and was ignored. Observers are fire-and-forget and must not throw.",
|
|
157
|
+
error
|
|
158
|
+
);
|
|
159
|
+
}
|
|
153
160
|
};
|
|
161
|
+
isolated.add(wrapped);
|
|
162
|
+
return wrapped;
|
|
163
|
+
}
|
|
164
|
+
function composeVoid(existing, added) {
|
|
165
|
+
const wrappedExisting = isolate(existing);
|
|
166
|
+
const wrappedAdded = isolate(added);
|
|
167
|
+
if (!wrappedExisting) return wrappedAdded;
|
|
168
|
+
if (!wrappedAdded) return wrappedExisting;
|
|
169
|
+
const composed = (ctx) => {
|
|
170
|
+
wrappedExisting(ctx);
|
|
171
|
+
wrappedAdded(ctx);
|
|
172
|
+
};
|
|
173
|
+
isolated.add(composed);
|
|
174
|
+
return composed;
|
|
154
175
|
}
|
|
155
176
|
function buildHooks(existing, added) {
|
|
156
177
|
const result = {};
|
|
@@ -824,24 +845,27 @@ function createPaginatedFunction(coreFn, options) {
|
|
|
824
845
|
return result.value;
|
|
825
846
|
});
|
|
826
847
|
if (hooks?.onMethodEnd) {
|
|
827
|
-
firstPagePromise.then(
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
848
|
+
firstPagePromise.then(
|
|
849
|
+
() => {
|
|
850
|
+
hooks.onMethodEnd({
|
|
851
|
+
methodName: functionName,
|
|
852
|
+
args,
|
|
853
|
+
isPaginated: true,
|
|
854
|
+
depth,
|
|
855
|
+
durationMs: Date.now() - startTime
|
|
856
|
+
});
|
|
857
|
+
},
|
|
858
|
+
(error) => {
|
|
859
|
+
hooks.onMethodEnd({
|
|
860
|
+
methodName: functionName,
|
|
861
|
+
args,
|
|
862
|
+
isPaginated: true,
|
|
863
|
+
depth,
|
|
864
|
+
durationMs: Date.now() - startTime,
|
|
865
|
+
error: error instanceof Error ? error : new Error(String(error))
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
);
|
|
845
869
|
}
|
|
846
870
|
const pageStream = async function* () {
|
|
847
871
|
yield await firstPagePromise;
|
|
@@ -3831,7 +3855,7 @@ function getZapierSdkService() {
|
|
|
3831
3855
|
}
|
|
3832
3856
|
var MAX_PAGE_LIMIT = 1e4;
|
|
3833
3857
|
var DEFAULT_PAGE_SIZE = 100;
|
|
3834
|
-
var
|
|
3858
|
+
var DEFAULT_ACTION_TIMEOUT_MILLISECONDS = 18e4;
|
|
3835
3859
|
function parseIntEnvVar(name) {
|
|
3836
3860
|
const value = globalThis.process?.env?.[name];
|
|
3837
3861
|
if (value === void 0) return void 0;
|
|
@@ -3845,7 +3869,10 @@ function parseIntEnvVar(name) {
|
|
|
3845
3869
|
return parsed;
|
|
3846
3870
|
}
|
|
3847
3871
|
var ZAPIER_MAX_NETWORK_RETRIES = parseIntEnvVar("ZAPIER_MAX_NETWORK_RETRIES") ?? 3;
|
|
3848
|
-
var
|
|
3872
|
+
var maxNetworkRetryDelaySecondsEnv = parseIntEnvVar(
|
|
3873
|
+
"ZAPIER_MAX_NETWORK_RETRY_DELAY_SECONDS"
|
|
3874
|
+
);
|
|
3875
|
+
var ZAPIER_MAX_NETWORK_RETRY_DELAY_MILLISECONDS = (maxNetworkRetryDelaySecondsEnv != null ? maxNetworkRetryDelaySecondsEnv * 1e3 : void 0) ?? parseIntEnvVar("ZAPIER_MAX_NETWORK_RETRY_DELAY_MS") ?? 6e4;
|
|
3849
3876
|
var MAX_CONCURRENCY_LIMIT = 1e4;
|
|
3850
3877
|
function parseConcurrencyEnvVar(name) {
|
|
3851
3878
|
const value = globalThis.process?.env?.[name];
|
|
@@ -3876,7 +3903,7 @@ function getZapierDefaultApprovalMode() {
|
|
|
3876
3903
|
const isInteractive = !!globalThis.process?.stdin?.isTTY && !!globalThis.process?.stdout?.isTTY;
|
|
3877
3904
|
return isInteractive ? "poll" : "throw";
|
|
3878
3905
|
}
|
|
3879
|
-
var
|
|
3906
|
+
var DEFAULT_APPROVAL_TIMEOUT_MILLISECONDS = 10 * 60 * 1e3;
|
|
3880
3907
|
var DEFAULT_MAX_APPROVAL_RETRIES = 2;
|
|
3881
3908
|
|
|
3882
3909
|
// src/types/properties.ts
|
|
@@ -3918,8 +3945,11 @@ var OffsetPropertySchema = zod.z.number().int().min(0).default(0).describe("Numb
|
|
|
3918
3945
|
var OutputPropertySchema = zod.z.string().describe("Output file path");
|
|
3919
3946
|
var DebugPropertySchema = zod.z.boolean().default(false).describe("Enable debug logging");
|
|
3920
3947
|
var ParamsPropertySchema = zod.z.record(zod.z.string(), zod.z.unknown()).describe("Additional parameters");
|
|
3921
|
-
var
|
|
3922
|
-
`Maximum time to wait for action completion in
|
|
3948
|
+
var ActionTimeoutSecondsPropertySchema = zod.z.number().min(1).optional().describe(
|
|
3949
|
+
`Maximum time to wait for action completion in seconds (default: ${DEFAULT_ACTION_TIMEOUT_MILLISECONDS / 1e3})`
|
|
3950
|
+
);
|
|
3951
|
+
var ActionTimeoutMillisecondsPropertySchema = zod.z.number().min(1e3).optional().describe(
|
|
3952
|
+
`Maximum time to wait for action completion in milliseconds (default: ${DEFAULT_ACTION_TIMEOUT_MILLISECONDS})`
|
|
3923
3953
|
);
|
|
3924
3954
|
var TablePropertySchema = withPositional(
|
|
3925
3955
|
zod.z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table")
|
|
@@ -4327,11 +4357,18 @@ var ActionExecutionInputSchema = zod.z.object({
|
|
|
4327
4357
|
authenticationId: AuthenticationIdPropertySchema.optional().meta({
|
|
4328
4358
|
deprecated: true
|
|
4329
4359
|
}),
|
|
4330
|
-
|
|
4360
|
+
timeoutSeconds: ActionTimeoutSecondsPropertySchema,
|
|
4361
|
+
/** @deprecated Use `timeoutSeconds` instead. */
|
|
4362
|
+
timeoutMs: ActionTimeoutMillisecondsPropertySchema.meta({
|
|
4363
|
+
deprecated: true
|
|
4364
|
+
})
|
|
4331
4365
|
}).describe(
|
|
4332
4366
|
"Execute an action with the given inputs for the bound app, as an alternative to runAction"
|
|
4333
4367
|
).meta({
|
|
4334
|
-
aliases: {
|
|
4368
|
+
aliases: {
|
|
4369
|
+
connectionId: "connection",
|
|
4370
|
+
authenticationId: "connection"
|
|
4371
|
+
}
|
|
4335
4372
|
});
|
|
4336
4373
|
var AppFactoryInputSchema = zod.z.object({
|
|
4337
4374
|
/** @deprecated Use `connection` instead. */
|
|
@@ -4509,19 +4546,19 @@ function createDebugFetch(options) {
|
|
|
4509
4546
|
|
|
4510
4547
|
// src/utils/retry-utils.ts
|
|
4511
4548
|
var MAX_CONSECUTIVE_ERRORS = 3;
|
|
4512
|
-
var
|
|
4513
|
-
var
|
|
4549
|
+
var BASE_ERROR_BACKOFF_MILLISECONDS = 1e3;
|
|
4550
|
+
var BASE_EXPONENTIAL_BACKOFF_MILLISECONDS = 1e3;
|
|
4514
4551
|
var JITTER_FACTOR = 0.5;
|
|
4515
4552
|
function calculateErrorBackoffMs(baseInterval, errorCount) {
|
|
4516
4553
|
const jitter = Math.random() * JITTER_FACTOR * baseInterval;
|
|
4517
4554
|
const errorBackoff = Math.min(
|
|
4518
|
-
|
|
4555
|
+
BASE_ERROR_BACKOFF_MILLISECONDS * (errorCount / 2),
|
|
4519
4556
|
baseInterval * 2
|
|
4520
4557
|
// Cap error backoff at 2x the base interval
|
|
4521
4558
|
);
|
|
4522
4559
|
return Math.floor(baseInterval + jitter + errorBackoff);
|
|
4523
4560
|
}
|
|
4524
|
-
function calculateExponentialBackoffMs(attempt, baseDelayMs =
|
|
4561
|
+
function calculateExponentialBackoffMs(attempt, baseDelayMs = BASE_EXPONENTIAL_BACKOFF_MILLISECONDS) {
|
|
4525
4562
|
const baseDelay = baseDelayMs * Math.pow(2, attempt - 1);
|
|
4526
4563
|
const jitter = Math.random() * JITTER_FACTOR * baseDelay;
|
|
4527
4564
|
return Math.floor(baseDelay + jitter);
|
|
@@ -4624,11 +4661,11 @@ function combineAbortSignals({
|
|
|
4624
4661
|
}
|
|
4625
4662
|
|
|
4626
4663
|
// src/api/polling.ts
|
|
4627
|
-
var
|
|
4664
|
+
var DEFAULT_TIMEOUT_MILLISECONDS = 18e4;
|
|
4628
4665
|
var DEFAULT_SUCCESS_STATUS = 200;
|
|
4629
4666
|
var DEFAULT_PENDING_STATUS = 202;
|
|
4630
|
-
var
|
|
4631
|
-
var
|
|
4667
|
+
var DEFAULT_INITIAL_DELAY_MILLISECONDS = 50;
|
|
4668
|
+
var DEFAULT_MAX_POLLING_INTERVAL_MILLISECONDS = 6e4;
|
|
4632
4669
|
var POLLING_STAGES = [
|
|
4633
4670
|
[125, 125],
|
|
4634
4671
|
// Up to 125ms: poll every 125ms
|
|
@@ -4644,11 +4681,11 @@ var POLLING_STAGES = [
|
|
|
4644
4681
|
// Up to 60s: poll every 5s
|
|
4645
4682
|
[18e4, 1e4]
|
|
4646
4683
|
// Up to 3min: poll every 10s
|
|
4647
|
-
// Beyond 3min: use
|
|
4684
|
+
// Beyond 3min: use DEFAULT_MAX_POLLING_INTERVAL_MILLISECONDS (60s)
|
|
4648
4685
|
];
|
|
4649
4686
|
function getPollingInterval(elapsedMs) {
|
|
4650
4687
|
const stage = POLLING_STAGES.find(([threshold]) => elapsedMs < threshold);
|
|
4651
|
-
return stage ? stage[1] :
|
|
4688
|
+
return stage ? stage[1] : DEFAULT_MAX_POLLING_INTERVAL_MILLISECONDS;
|
|
4652
4689
|
}
|
|
4653
4690
|
function makeAbortError() {
|
|
4654
4691
|
if (typeof DOMException !== "undefined") {
|
|
@@ -4706,8 +4743,8 @@ var processResponse = async (response, successStatus, pendingStatus, isPending,
|
|
|
4706
4743
|
async function pollUntilComplete(options) {
|
|
4707
4744
|
const {
|
|
4708
4745
|
fetchPoll,
|
|
4709
|
-
timeoutMs =
|
|
4710
|
-
initialDelay =
|
|
4746
|
+
timeoutMs = DEFAULT_TIMEOUT_MILLISECONDS,
|
|
4747
|
+
initialDelay = DEFAULT_INITIAL_DELAY_MILLISECONDS,
|
|
4711
4748
|
successStatus = DEFAULT_SUCCESS_STATUS,
|
|
4712
4749
|
pendingStatus = DEFAULT_PENDING_STATUS,
|
|
4713
4750
|
isPending,
|
|
@@ -5154,7 +5191,7 @@ function clearTokenCache() {
|
|
|
5154
5191
|
cachedCliLogin = void 0;
|
|
5155
5192
|
cachedDefaultCache = void 0;
|
|
5156
5193
|
}
|
|
5157
|
-
var
|
|
5194
|
+
var TOKEN_EXPIRATION_BUFFER_MILLISECONDS = 5 * 60 * 1e3;
|
|
5158
5195
|
async function resolveCache(options) {
|
|
5159
5196
|
if (options.cache) return options.cache;
|
|
5160
5197
|
if (cachedDefaultCache !== void 0) return cachedDefaultCache;
|
|
@@ -5175,7 +5212,7 @@ async function resolveCache(options) {
|
|
|
5175
5212
|
}
|
|
5176
5213
|
function entryIsValid(entry) {
|
|
5177
5214
|
if (entry.expiresAt === void 0) return true;
|
|
5178
|
-
return entry.expiresAt > Date.now() +
|
|
5215
|
+
return entry.expiresAt > Date.now() + TOKEN_EXPIRATION_BUFFER_MILLISECONDS;
|
|
5179
5216
|
}
|
|
5180
5217
|
async function readCachedToken(cacheKey, cache) {
|
|
5181
5218
|
const cached = await cache.get(cacheKey);
|
|
@@ -5791,7 +5828,7 @@ function parseDeprecationDate(value) {
|
|
|
5791
5828
|
}
|
|
5792
5829
|
|
|
5793
5830
|
// src/sdk-version.ts
|
|
5794
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.
|
|
5831
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.88.0" : void 0) || "unknown";
|
|
5795
5832
|
|
|
5796
5833
|
// src/utils/open-url.ts
|
|
5797
5834
|
var nodePrefix = "node:";
|
|
@@ -5902,7 +5939,7 @@ var PollApprovalResponseSchema = zod.z.object({
|
|
|
5902
5939
|
mode: ApprovalModeSchema.optional(),
|
|
5903
5940
|
reason: zod.z.string().optional()
|
|
5904
5941
|
});
|
|
5905
|
-
var
|
|
5942
|
+
var APPROVAL_MAX_POLLING_INTERVAL_MILLISECONDS = 5e3;
|
|
5906
5943
|
function validateSdkPath(path) {
|
|
5907
5944
|
if (!path.startsWith("/") || path.startsWith("//")) {
|
|
5908
5945
|
throw new ZapierValidationError(
|
|
@@ -6067,7 +6104,7 @@ var ZapierApiClient = class {
|
|
|
6067
6104
|
}
|
|
6068
6105
|
const rateLimitInfo = parseRateLimitHeaders(response);
|
|
6069
6106
|
const delayMs = rateLimitInfo.retryAfterMs ?? calculateExponentialBackoffMs(retries + 1);
|
|
6070
|
-
if (delayMs > this.
|
|
6107
|
+
if (delayMs > this.maxNetworkRetryDelayMilliseconds || retries >= this.maxNetworkRetries) {
|
|
6071
6108
|
throw new ZapierRateLimitError("Rate limited", {
|
|
6072
6109
|
statusCode: 429,
|
|
6073
6110
|
rateLimit: rateLimitInfo,
|
|
@@ -6324,8 +6361,8 @@ var ZapierApiClient = class {
|
|
|
6324
6361
|
authRequired: options.authRequired,
|
|
6325
6362
|
signal: options.signal
|
|
6326
6363
|
}),
|
|
6327
|
-
initialDelay: options.initialDelay,
|
|
6328
|
-
timeoutMs: options.timeoutMs,
|
|
6364
|
+
initialDelay: options.initialDelayMilliseconds ?? options.initialDelay,
|
|
6365
|
+
timeoutMs: options.timeoutMilliseconds ?? options.timeoutMs,
|
|
6329
6366
|
successStatus: options.successStatus,
|
|
6330
6367
|
pendingStatus: options.pendingStatus,
|
|
6331
6368
|
isPending: options.isPending,
|
|
@@ -6334,7 +6371,7 @@ var ZapierApiClient = class {
|
|
|
6334
6371
|
});
|
|
6335
6372
|
};
|
|
6336
6373
|
this.maxNetworkRetries = options.maxNetworkRetries ?? ZAPIER_MAX_NETWORK_RETRIES;
|
|
6337
|
-
this.
|
|
6374
|
+
this.maxNetworkRetryDelayMilliseconds = options.maxNetworkRetryDelayMilliseconds ?? options.maxNetworkRetryDelayMs ?? ZAPIER_MAX_NETWORK_RETRY_DELAY_MILLISECONDS;
|
|
6338
6375
|
const requested = options.maxConcurrentRequests;
|
|
6339
6376
|
const limit = requested === void 0 || Number.isNaN(requested) ? ZAPIER_MAX_CONCURRENT_REQUESTS : requested;
|
|
6340
6377
|
if (limit !== Infinity && (!Number.isInteger(limit) || limit < 1 || limit > MAX_CONCURRENCY_LIMIT)) {
|
|
@@ -6909,7 +6946,7 @@ var ZapierApiClient = class {
|
|
|
6909
6946
|
}
|
|
6910
6947
|
await openApproval(approval.approval_url);
|
|
6911
6948
|
}
|
|
6912
|
-
const timeoutMs = this.options.approvalTimeoutMs ??
|
|
6949
|
+
const timeoutMs = this.options.approvalTimeoutMilliseconds ?? this.options.approvalTimeoutMs ?? DEFAULT_APPROVAL_TIMEOUT_MILLISECONDS;
|
|
6913
6950
|
let streamAbortController;
|
|
6914
6951
|
let streamPromise;
|
|
6915
6952
|
let removeStreamAbortListener;
|
|
@@ -6949,7 +6986,7 @@ var ZapierApiClient = class {
|
|
|
6949
6986
|
})
|
|
6950
6987
|
),
|
|
6951
6988
|
timeoutMs,
|
|
6952
|
-
maxPollingIntervalMs:
|
|
6989
|
+
maxPollingIntervalMs: APPROVAL_MAX_POLLING_INTERVAL_MILLISECONDS,
|
|
6953
6990
|
signal,
|
|
6954
6991
|
isPending: (body2) => {
|
|
6955
6992
|
const parsed = PollApprovalResponseSchema.safeParse(body2);
|
|
@@ -7129,8 +7166,10 @@ var apiPlugin = defineProperty({
|
|
|
7129
7166
|
onEvent,
|
|
7130
7167
|
debug = false,
|
|
7131
7168
|
maxNetworkRetries = ZAPIER_MAX_NETWORK_RETRIES,
|
|
7132
|
-
|
|
7169
|
+
maxNetworkRetryDelaySeconds,
|
|
7170
|
+
maxNetworkRetryDelayMs,
|
|
7133
7171
|
maxConcurrentRequests = ZAPIER_MAX_CONCURRENT_REQUESTS,
|
|
7172
|
+
approvalTimeoutSeconds,
|
|
7134
7173
|
approvalTimeoutMs,
|
|
7135
7174
|
maxApprovalRetries,
|
|
7136
7175
|
approvalMode,
|
|
@@ -7145,9 +7184,9 @@ var apiPlugin = defineProperty({
|
|
|
7145
7184
|
fetch: customFetch,
|
|
7146
7185
|
onEvent,
|
|
7147
7186
|
maxNetworkRetries,
|
|
7148
|
-
maxNetworkRetryDelayMs,
|
|
7187
|
+
maxNetworkRetryDelayMilliseconds: (maxNetworkRetryDelaySeconds != null ? maxNetworkRetryDelaySeconds * 1e3 : maxNetworkRetryDelayMs) ?? ZAPIER_MAX_NETWORK_RETRY_DELAY_MILLISECONDS,
|
|
7149
7188
|
maxConcurrentRequests,
|
|
7150
|
-
approvalTimeoutMs,
|
|
7189
|
+
approvalTimeoutMilliseconds: approvalTimeoutSeconds != null ? approvalTimeoutSeconds * 1e3 : approvalTimeoutMs,
|
|
7151
7190
|
maxApprovalRetries,
|
|
7152
7191
|
approvalMode,
|
|
7153
7192
|
openAutoModeApprovalsInBrowser,
|
|
@@ -7855,9 +7894,13 @@ var FetchInitZapierFieldsSchema = zod.z.object({
|
|
|
7855
7894
|
deprecated: true
|
|
7856
7895
|
}),
|
|
7857
7896
|
callbackUrl: zod.z.string().optional().describe("URL to send async response to (makes request async)"),
|
|
7897
|
+
maxTimeSeconds: zod.z.number().int().positive().optional().describe(
|
|
7898
|
+
"Maximum seconds to wait for a response. Honored on a best-effort basis; the server may silently enforce a lower ceiling."
|
|
7899
|
+
),
|
|
7900
|
+
/** @deprecated Use `maxTimeSeconds` instead. */
|
|
7858
7901
|
maxTime: zod.z.number().int().positive().optional().describe(
|
|
7859
7902
|
"Maximum seconds to wait for a response. Honored on a best-effort basis; the server may silently enforce a lower ceiling."
|
|
7860
|
-
)
|
|
7903
|
+
).meta({ deprecated: true })
|
|
7861
7904
|
});
|
|
7862
7905
|
var FetchInitSchema = zod.z.object({
|
|
7863
7906
|
method: zod.z.enum(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]).optional().describe("HTTP method for the request (defaults to GET)"),
|
|
@@ -7873,7 +7916,11 @@ var FetchInitSchema = zod.z.object({
|
|
|
7873
7916
|
}).extend(FetchInitZapierFieldsSchema.shape).optional().describe(
|
|
7874
7917
|
"Request options including method, headers, body, and authentication"
|
|
7875
7918
|
).meta({
|
|
7876
|
-
aliases: {
|
|
7919
|
+
aliases: {
|
|
7920
|
+
connectionId: "connection",
|
|
7921
|
+
authenticationId: "connection",
|
|
7922
|
+
maxTime: "maxTimeSeconds"
|
|
7923
|
+
}
|
|
7877
7924
|
});
|
|
7878
7925
|
var FetchInputSchema = zod.z.object({
|
|
7879
7926
|
url: FetchUrlSchema,
|
|
@@ -7924,7 +7971,7 @@ function rewrapIfMaxTimeTimeout({
|
|
|
7924
7971
|
const reason = abortSignal.reason;
|
|
7925
7972
|
if (!reason || reason.name !== "TimeoutError") return error;
|
|
7926
7973
|
return new ZapierTimeoutError(
|
|
7927
|
-
`fetch timed out after ${maxTimeSeconds}s (
|
|
7974
|
+
`fetch timed out after ${maxTimeSeconds}s (maxTimeSeconds)`,
|
|
7928
7975
|
{ cause: error }
|
|
7929
7976
|
);
|
|
7930
7977
|
}
|
|
@@ -7989,9 +8036,11 @@ var fetchPlugin = defineMethod({
|
|
|
7989
8036
|
connection,
|
|
7990
8037
|
authenticationId,
|
|
7991
8038
|
callbackUrl,
|
|
8039
|
+
maxTimeSeconds: maxTimeSecondsInput,
|
|
7992
8040
|
maxTime,
|
|
7993
8041
|
...fetchInit
|
|
7994
8042
|
} = init || {};
|
|
8043
|
+
const maxTimeSeconds = maxTimeSecondsInput ?? maxTime;
|
|
7995
8044
|
const resolvedConnectionId = await resolveConnectionId({
|
|
7996
8045
|
connectionId,
|
|
7997
8046
|
connection,
|
|
@@ -8020,13 +8069,13 @@ var fetchPlugin = defineMethod({
|
|
|
8020
8069
|
if (callbackUrl) {
|
|
8021
8070
|
headers["X-Relay-Callback-Url"] = callbackUrl;
|
|
8022
8071
|
}
|
|
8023
|
-
if (
|
|
8024
|
-
headers["X-Zapier-Sdk-Max-Time"] = String(
|
|
8072
|
+
if (maxTimeSeconds !== void 0) {
|
|
8073
|
+
headers["X-Zapier-Sdk-Max-Time"] = String(maxTimeSeconds);
|
|
8025
8074
|
}
|
|
8026
8075
|
const upstreamUrl = new URL(url).toString();
|
|
8027
8076
|
const method = (fetchInit.method ?? "GET").toUpperCase();
|
|
8028
8077
|
const abortHandle = buildAbortHandle({
|
|
8029
|
-
maxTimeSeconds
|
|
8078
|
+
maxTimeSeconds,
|
|
8030
8079
|
callerSignal: fetchInit.signal
|
|
8031
8080
|
});
|
|
8032
8081
|
try {
|
|
@@ -8056,7 +8105,7 @@ var fetchPlugin = defineMethod({
|
|
|
8056
8105
|
throw rewrapIfMaxTimeTimeout({
|
|
8057
8106
|
error,
|
|
8058
8107
|
abortSignal: abortHandle?.signal,
|
|
8059
|
-
maxTimeSeconds
|
|
8108
|
+
maxTimeSeconds
|
|
8060
8109
|
});
|
|
8061
8110
|
} finally {
|
|
8062
8111
|
abortHandle?.dispose();
|
|
@@ -8076,7 +8125,9 @@ var RunActionBaseSchema = zod.z.object({
|
|
|
8076
8125
|
inputs: InputsPropertySchema.optional().describe(
|
|
8077
8126
|
"Input parameters for the action"
|
|
8078
8127
|
),
|
|
8079
|
-
|
|
8128
|
+
timeoutSeconds: ActionTimeoutSecondsPropertySchema,
|
|
8129
|
+
/** @deprecated Use `timeoutSeconds` instead. */
|
|
8130
|
+
timeoutMs: ActionTimeoutMillisecondsPropertySchema.meta({ deprecated: true }),
|
|
8080
8131
|
pageSize: zod.z.number().min(1).optional().describe("Number of results per page"),
|
|
8081
8132
|
maxItems: zod.z.number().min(1).optional().describe("Maximum total items to return across all pages"),
|
|
8082
8133
|
cursor: zod.z.string().optional().describe("Cursor to start from")
|
|
@@ -9830,7 +9881,7 @@ async function executeAction(actionOptions) {
|
|
|
9830
9881
|
executionOptions,
|
|
9831
9882
|
cursor,
|
|
9832
9883
|
connectionId,
|
|
9833
|
-
|
|
9884
|
+
timeoutMilliseconds
|
|
9834
9885
|
} = actionOptions;
|
|
9835
9886
|
const runRequestData = {
|
|
9836
9887
|
selected_api: selectedApi,
|
|
@@ -9866,7 +9917,7 @@ async function executeAction(actionOptions) {
|
|
|
9866
9917
|
return await api.poll(`/zapier/api/actions/v1/runs/${runId}`, {
|
|
9867
9918
|
successStatus: 200,
|
|
9868
9919
|
pendingStatus: 202,
|
|
9869
|
-
|
|
9920
|
+
timeoutMilliseconds: timeoutMilliseconds ?? DEFAULT_ACTION_TIMEOUT_MILLISECONDS,
|
|
9870
9921
|
resource: { type: "run", id: runId },
|
|
9871
9922
|
isPending: (result) => {
|
|
9872
9923
|
const data = result?.data;
|
|
@@ -9875,7 +9926,7 @@ async function executeAction(actionOptions) {
|
|
|
9875
9926
|
resultExtractor: (result) => result.data
|
|
9876
9927
|
});
|
|
9877
9928
|
}
|
|
9878
|
-
var
|
|
9929
|
+
var CONTEXT_CACHE_TTL_MILLISECONDS = 6e4;
|
|
9879
9930
|
var CONTEXT_CACHE_MAX_SIZE = 500;
|
|
9880
9931
|
var runActionPlugin = defineMethod({
|
|
9881
9932
|
name: "runAction",
|
|
@@ -9956,7 +10007,7 @@ var runActionPlugin = defineMethod({
|
|
|
9956
10007
|
evictIfNeeded();
|
|
9957
10008
|
cache.set(contextKey, {
|
|
9958
10009
|
promise: pending,
|
|
9959
|
-
expiresAt: Date.now() +
|
|
10010
|
+
expiresAt: Date.now() + CONTEXT_CACHE_TTL_MILLISECONDS
|
|
9960
10011
|
});
|
|
9961
10012
|
return pending;
|
|
9962
10013
|
}
|
|
@@ -9973,9 +10024,9 @@ var runActionPlugin = defineMethod({
|
|
|
9973
10024
|
connection,
|
|
9974
10025
|
authenticationId,
|
|
9975
10026
|
inputs = {},
|
|
9976
|
-
cursor
|
|
9977
|
-
timeoutMs
|
|
10027
|
+
cursor
|
|
9978
10028
|
} = input;
|
|
10029
|
+
const timeoutMilliseconds = input.timeoutSeconds != null ? input.timeoutSeconds * 1e3 : input.timeoutMs;
|
|
9979
10030
|
const resolvedConnectionId = await resolveConnectionId({
|
|
9980
10031
|
connectionId,
|
|
9981
10032
|
connection,
|
|
@@ -10003,7 +10054,7 @@ var runActionPlugin = defineMethod({
|
|
|
10003
10054
|
executionOptions: { inputs },
|
|
10004
10055
|
cursor,
|
|
10005
10056
|
connectionId: resolvedConnectionId,
|
|
10006
|
-
|
|
10057
|
+
timeoutMilliseconds
|
|
10007
10058
|
});
|
|
10008
10059
|
if (result.errors && result.errors.length > 0) {
|
|
10009
10060
|
const errorMessage2 = result.errors.map(
|
|
@@ -10060,6 +10111,7 @@ function createActionFunction(appKey, actionType, actionKey, imports, pinnedAuth
|
|
|
10060
10111
|
connectionId: providedConnectionId,
|
|
10061
10112
|
connection: providedConnection,
|
|
10062
10113
|
authenticationId: providedAuthenticationId,
|
|
10114
|
+
timeoutSeconds,
|
|
10063
10115
|
timeoutMs
|
|
10064
10116
|
} = actionOptions;
|
|
10065
10117
|
const { connectionId, connection } = resolveProxyConnection({
|
|
@@ -10076,6 +10128,7 @@ function createActionFunction(appKey, actionType, actionKey, imports, pinnedAuth
|
|
|
10076
10128
|
action: actionKey,
|
|
10077
10129
|
inputs,
|
|
10078
10130
|
connection: connectionId ?? connection,
|
|
10131
|
+
timeoutSeconds,
|
|
10079
10132
|
timeoutMs
|
|
10080
10133
|
});
|
|
10081
10134
|
};
|
|
@@ -11627,12 +11680,18 @@ var WaitForNewConnectionSchema = zod.z.object({
|
|
|
11627
11680
|
startedAt: zod.z.number().int().nonnegative().describe(
|
|
11628
11681
|
"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` \u2014 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."
|
|
11629
11682
|
),
|
|
11683
|
+
timeoutSeconds: zod.z.number().int().positive().optional().describe("How long to wait before giving up. Default 5 minutes (300)."),
|
|
11684
|
+
/** @deprecated Use `timeoutSeconds` instead. */
|
|
11630
11685
|
timeoutMs: zod.z.number().int().positive().optional().describe(
|
|
11631
11686
|
"How long to wait before giving up. Default 5 minutes (300_000)."
|
|
11687
|
+
).meta({ deprecated: true }),
|
|
11688
|
+
pollIntervalMilliseconds: zod.z.number().int().positive().optional().describe(
|
|
11689
|
+
"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)."
|
|
11632
11690
|
),
|
|
11691
|
+
/** @deprecated Use `pollIntervalMilliseconds` instead. */
|
|
11633
11692
|
pollIntervalMs: zod.z.number().int().positive().optional().describe(
|
|
11634
11693
|
"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)."
|
|
11635
|
-
)
|
|
11694
|
+
).meta({ deprecated: true })
|
|
11636
11695
|
}).describe(
|
|
11637
11696
|
"Wait for a new connection to appear for the given app. Polls `/api/v0/connections` with server-side `ordering=-date` until the most recent matching row's `date` is at or after the started-at timestamp, then returns it. Pair with `get-connection-start-url` \u2014 that mints the URL the user opens, this waits for the resulting connection to land. Errors with a timeout after the configured timeout (default 5 min). Example (JS):\n\n```ts\nconst { data: { url, app, startedAt } } = await zapier.getConnectionStartUrl({ app: 'slack' });\n// show `url` to the user via the channel they're reading from\nconst { data: conn } = await zapier.waitForNewConnection({ app, startedAt });\n```"
|
|
11638
11697
|
);
|
|
@@ -11679,8 +11738,8 @@ var waitForNewConnectionPlugin = defineMethod({
|
|
|
11679
11738
|
page_size: "1"
|
|
11680
11739
|
},
|
|
11681
11740
|
authRequired: true,
|
|
11682
|
-
|
|
11683
|
-
|
|
11741
|
+
timeoutMilliseconds: input.timeoutSeconds != null ? input.timeoutSeconds * 1e3 : input.timeoutMs ?? 3e5,
|
|
11742
|
+
initialDelayMilliseconds: input.pollIntervalMilliseconds ?? input.pollIntervalMs ?? 3e3,
|
|
11684
11743
|
isPending: (body) => {
|
|
11685
11744
|
const rows = body.data ?? [];
|
|
11686
11745
|
const head = rows[0];
|
|
@@ -11730,12 +11789,20 @@ var CreateConnectionSchema = zod.z.object({
|
|
|
11730
11789
|
browser: zod.z.enum(["auto", "always", "never"]).default("auto").describe(
|
|
11731
11790
|
"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 \u2014 a failed or skipped open degrades gracefully to copy-paste."
|
|
11732
11791
|
),
|
|
11792
|
+
timeoutSeconds: zod.z.number().int().positive().optional().describe(
|
|
11793
|
+
"How long to wait for the user to complete the connection flow before giving up. Default 5 minutes (300)."
|
|
11794
|
+
),
|
|
11795
|
+
/** @deprecated Use `timeoutSeconds` instead. */
|
|
11733
11796
|
timeoutMs: zod.z.number().int().positive().optional().describe(
|
|
11734
11797
|
"How long to wait for the user to complete the connection flow before giving up. Default 5 minutes (300_000)."
|
|
11798
|
+
).meta({ deprecated: true }),
|
|
11799
|
+
pollIntervalMilliseconds: zod.z.number().int().positive().optional().describe(
|
|
11800
|
+
"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)."
|
|
11735
11801
|
),
|
|
11802
|
+
/** @deprecated Use `pollIntervalMilliseconds` instead. */
|
|
11736
11803
|
pollIntervalMs: zod.z.number().int().positive().optional().describe(
|
|
11737
11804
|
"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)."
|
|
11738
|
-
)
|
|
11805
|
+
).meta({ deprecated: true })
|
|
11739
11806
|
}).describe(
|
|
11740
11807
|
"Create a new app connection, end-to-end. Mints the start URL via `get-connection-start-url`, prints it to stderr, opportunistically opens it in a browser when it looks safe to do so (skipping CI / SSH / headless-Linux by default \u2014 pass `--browser always` to force, `--browser never` to suppress), then polls via `wait-for-new-connection` until the user completes OAuth and the new connection appears. Returns the connection.\n\nThis is the right command for most callers. Reach for the lower-level building blocks when you want either of: (a) hand off the URL and *not* block on completion \u2014 call `get-connection-start-url` alone, no `wait-for-new-connection` needed, or (b) do something custom between minting the URL and waiting \u2014 call `get-connection-start-url`, do your work (email or DM the URL, render a QR code, etc.), then `wait-for-new-connection`."
|
|
11741
11808
|
);
|
|
@@ -11797,8 +11864,9 @@ Open this URL to complete the connection:
|
|
|
11797
11864
|
// Server-stamped mint time: measured on the same clock as a connection's
|
|
11798
11865
|
// `date`, so the freshness check is immune to client/server clock skew.
|
|
11799
11866
|
startedAt: start2.startedAt,
|
|
11867
|
+
timeoutSeconds: input.timeoutSeconds,
|
|
11800
11868
|
timeoutMs: input.timeoutMs,
|
|
11801
|
-
|
|
11869
|
+
pollIntervalMilliseconds: input.pollIntervalMilliseconds ?? input.pollIntervalMs
|
|
11802
11870
|
});
|
|
11803
11871
|
return {
|
|
11804
11872
|
data: CreateConnectionItemSchema.parse({
|
|
@@ -13157,9 +13225,9 @@ async function* readInboxEvents({
|
|
|
13157
13225
|
}
|
|
13158
13226
|
|
|
13159
13227
|
// src/plugins/triggers/watchTriggerInbox/index.ts
|
|
13160
|
-
var
|
|
13161
|
-
var
|
|
13162
|
-
var
|
|
13228
|
+
var SSE_RECONNECT_BACKOFF_MILLISECONDS = [500, 1e3, 2e3, 5e3];
|
|
13229
|
+
var DEFAULT_SAFETY_DRAIN_INTERVAL_MILLISECONDS = 3e5;
|
|
13230
|
+
var SSE_HEALTHY_CONNECTION_MILLISECONDS = 5e3;
|
|
13163
13231
|
var ERROR_BACKOFF_CAP = 4;
|
|
13164
13232
|
function createDrainLatch() {
|
|
13165
13233
|
let pending = false;
|
|
@@ -13217,7 +13285,7 @@ async function drainRunner({
|
|
|
13217
13285
|
consecutiveErrors = Math.min(consecutiveErrors + 1, ERROR_BACKOFF_CAP);
|
|
13218
13286
|
errorAttempts += 1;
|
|
13219
13287
|
const delay = calculateErrorBackoffMs(
|
|
13220
|
-
|
|
13288
|
+
BASE_ERROR_BACKOFF_MILLISECONDS,
|
|
13221
13289
|
consecutiveErrors
|
|
13222
13290
|
);
|
|
13223
13291
|
const statusCode = errorStatusCode(error);
|
|
@@ -13283,7 +13351,7 @@ async function sseLoop({
|
|
|
13283
13351
|
})) {
|
|
13284
13352
|
drainRequest.request();
|
|
13285
13353
|
}
|
|
13286
|
-
if (connected && Date.now() - connectedAt >=
|
|
13354
|
+
if (connected && Date.now() - connectedAt >= SSE_HEALTHY_CONNECTION_MILLISECONDS) {
|
|
13287
13355
|
attempt = 0;
|
|
13288
13356
|
}
|
|
13289
13357
|
} catch (err) {
|
|
@@ -13307,8 +13375,11 @@ async function sseLoop({
|
|
|
13307
13375
|
transientError = err;
|
|
13308
13376
|
}
|
|
13309
13377
|
if (signal.aborted) return;
|
|
13310
|
-
const delay =
|
|
13311
|
-
attempt = Math.min(
|
|
13378
|
+
const delay = SSE_RECONNECT_BACKOFF_MILLISECONDS[Math.min(attempt, SSE_RECONNECT_BACKOFF_MILLISECONDS.length - 1)];
|
|
13379
|
+
attempt = Math.min(
|
|
13380
|
+
attempt + 1,
|
|
13381
|
+
SSE_RECONNECT_BACKOFF_MILLISECONDS.length - 1
|
|
13382
|
+
);
|
|
13312
13383
|
if (transientError !== void 0 && debug) {
|
|
13313
13384
|
const statusCode = errorStatusCode(transientError);
|
|
13314
13385
|
const errorMsg = errorMessage(transientError);
|
|
@@ -13365,7 +13436,7 @@ var watchTriggerInboxPlugin = defineMethod({
|
|
|
13365
13436
|
const { concurrency, leaseLimit } = resolveConcurrencyAndLease(input);
|
|
13366
13437
|
const inboxId = await resolveTriggerInboxId({ api, inbox: input.inbox });
|
|
13367
13438
|
if (input.signal?.aborted) return;
|
|
13368
|
-
const safetyDrainMs = input.maxDrainIntervalSeconds !== void 0 ? input.maxDrainIntervalSeconds * 1e3 :
|
|
13439
|
+
const safetyDrainMs = input.maxDrainIntervalSeconds !== void 0 ? input.maxDrainIntervalSeconds * 1e3 : DEFAULT_SAFETY_DRAIN_INTERVAL_MILLISECONDS;
|
|
13369
13440
|
const stop = new AbortController();
|
|
13370
13441
|
const combined = combineAbortSignals({
|
|
13371
13442
|
handles: [
|
|
@@ -14394,7 +14465,7 @@ var updateTableRecordsPlugin = defineMethod({
|
|
|
14394
14465
|
|
|
14395
14466
|
// src/plugins/eventEmission/transport.ts
|
|
14396
14467
|
var DEFAULT_RETRY_ATTEMPTS = 2;
|
|
14397
|
-
var
|
|
14468
|
+
var DEFAULT_RETRY_DELAY_MILLISECONDS = 300;
|
|
14398
14469
|
function createHttpTransport(config) {
|
|
14399
14470
|
const delay = async (ms) => {
|
|
14400
14471
|
return new Promise((resolve2) => {
|
|
@@ -14419,12 +14490,12 @@ function createHttpTransport(config) {
|
|
|
14419
14490
|
body: JSON.stringify(payload)
|
|
14420
14491
|
});
|
|
14421
14492
|
if (!response.ok && attemptsLeft > 1) {
|
|
14422
|
-
await delay(config.retryDelayMs ||
|
|
14493
|
+
await delay(config.retryDelayMs || DEFAULT_RETRY_DELAY_MILLISECONDS);
|
|
14423
14494
|
return emitWithRetry(subject, event, attemptsLeft - 1);
|
|
14424
14495
|
}
|
|
14425
14496
|
} catch (error) {
|
|
14426
14497
|
if (attemptsLeft > 1) {
|
|
14427
|
-
await delay(config.retryDelayMs ||
|
|
14498
|
+
await delay(config.retryDelayMs || DEFAULT_RETRY_DELAY_MILLISECONDS);
|
|
14428
14499
|
return emitWithRetry(subject, event, attemptsLeft - 1);
|
|
14429
14500
|
}
|
|
14430
14501
|
throw error;
|
|
@@ -14717,7 +14788,7 @@ function makeMethodEndHook(emitMethodCalled) {
|
|
|
14717
14788
|
}
|
|
14718
14789
|
|
|
14719
14790
|
// src/plugins/eventEmission/index.ts
|
|
14720
|
-
var
|
|
14791
|
+
var TELEMETRY_EMIT_TIMEOUT_MILLISECONDS = 300;
|
|
14721
14792
|
var registeredListeners = {};
|
|
14722
14793
|
function removeExistingListeners() {
|
|
14723
14794
|
const events = [
|
|
@@ -14763,7 +14834,7 @@ async function emitWithTimeout(transport, subject, event) {
|
|
|
14763
14834
|
await Promise.race([
|
|
14764
14835
|
transport.emit(subject, event),
|
|
14765
14836
|
new Promise((resolve2) => {
|
|
14766
|
-
const timer = setTimeout(resolve2,
|
|
14837
|
+
const timer = setTimeout(resolve2, TELEMETRY_EMIT_TIMEOUT_MILLISECONDS);
|
|
14767
14838
|
if (typeof timer.unref === "function") {
|
|
14768
14839
|
timer.unref();
|
|
14769
14840
|
}
|
|
@@ -15202,14 +15273,14 @@ function createZapierSdk(options = {}) {
|
|
|
15202
15273
|
|
|
15203
15274
|
// src/utils/batch-utils.ts
|
|
15204
15275
|
var DEFAULT_CONCURRENCY = 10;
|
|
15205
|
-
var
|
|
15206
|
-
var
|
|
15276
|
+
var BATCH_START_DELAY_MILLISECONDS = 25;
|
|
15277
|
+
var DEFAULT_BATCH_TIMEOUT_MILLISECONDS = 18e4;
|
|
15207
15278
|
async function batch(tasks, options = {}) {
|
|
15208
15279
|
const {
|
|
15209
15280
|
concurrency = DEFAULT_CONCURRENCY,
|
|
15210
15281
|
retry = true,
|
|
15211
|
-
batchDelay =
|
|
15212
|
-
timeoutMs =
|
|
15282
|
+
batchDelay = BATCH_START_DELAY_MILLISECONDS,
|
|
15283
|
+
timeoutMs = DEFAULT_BATCH_TIMEOUT_MILLISECONDS,
|
|
15213
15284
|
taskTimeoutMs
|
|
15214
15285
|
} = options;
|
|
15215
15286
|
if (concurrency <= 0) {
|
|
@@ -15302,11 +15373,15 @@ var BaseSdkOptionsSchema = zod.z.object({
|
|
|
15302
15373
|
*/
|
|
15303
15374
|
maxNetworkRetries: zod.z.number().optional().describe("Max retries for rate-limited requests (default: 3).").meta({ valueHint: "count" }),
|
|
15304
15375
|
/**
|
|
15305
|
-
* Maximum delay in
|
|
15376
|
+
* Maximum delay in seconds to wait for a rate-limit retry.
|
|
15306
15377
|
* If the server requests a longer delay, the request fails immediately.
|
|
15307
|
-
* Default is
|
|
15378
|
+
* Default is 60 (60 seconds).
|
|
15308
15379
|
*/
|
|
15309
|
-
|
|
15380
|
+
maxNetworkRetryDelaySeconds: zod.z.number().optional().describe(
|
|
15381
|
+
"Max delay in seconds to wait for a rate-limit retry (default: 60)."
|
|
15382
|
+
).meta({ valueHint: "seconds" }),
|
|
15383
|
+
/** @deprecated Use `maxNetworkRetryDelaySeconds` instead. */
|
|
15384
|
+
maxNetworkRetryDelayMs: zod.z.number().optional().describe("Max delay in ms to wait for retry (default: 60000).").meta({ valueHint: "ms", deprecated: true }),
|
|
15310
15385
|
/**
|
|
15311
15386
|
* Maximum number of concurrent in-flight HTTP requests per client.
|
|
15312
15387
|
* Requests beyond this limit queue in FIFO order until a slot frees.
|
|
@@ -15325,7 +15400,9 @@ var BaseSdkOptionsSchema = zod.z.object({
|
|
|
15325
15400
|
]).optional().describe(
|
|
15326
15401
|
`Max concurrent in-flight HTTP requests (default: 200, max: ${MAX_CONCURRENCY_LIMIT}).`
|
|
15327
15402
|
).meta({ valueHint: "count" }),
|
|
15328
|
-
|
|
15403
|
+
approvalTimeoutSeconds: zod.z.number().optional().describe("Timeout in seconds for approval polling. Default: 600 (10 min).").meta({ valueHint: "seconds" }),
|
|
15404
|
+
/** @deprecated Use `approvalTimeoutSeconds` instead. */
|
|
15405
|
+
approvalTimeoutMs: zod.z.number().optional().describe("Timeout in ms for approval polling. Default: 600000 (10 min).").meta({ valueHint: "ms", deprecated: true }),
|
|
15329
15406
|
maxApprovalRetries: zod.z.number().optional().describe(
|
|
15330
15407
|
"Maximum number of sequential approval rounds per request (one per gating policy) before giving up. Default: 2."
|
|
15331
15408
|
),
|
|
@@ -15362,7 +15439,8 @@ var registryPlugin = (_sdk) => {
|
|
|
15362
15439
|
exports.API_ID = API_ID;
|
|
15363
15440
|
exports.ActionKeyPropertySchema = ActionKeyPropertySchema;
|
|
15364
15441
|
exports.ActionPropertySchema = ActionPropertySchema;
|
|
15365
|
-
exports.
|
|
15442
|
+
exports.ActionTimeoutMillisecondsPropertySchema = ActionTimeoutMillisecondsPropertySchema;
|
|
15443
|
+
exports.ActionTimeoutSecondsPropertySchema = ActionTimeoutSecondsPropertySchema;
|
|
15366
15444
|
exports.ActionTypePropertySchema = ActionTypePropertySchema;
|
|
15367
15445
|
exports.AppKeyPropertySchema = AppKeyPropertySchema;
|
|
15368
15446
|
exports.AppPropertySchema = AppPropertySchema;
|
|
@@ -15373,7 +15451,7 @@ exports.BaseSdkOptionsSchema = BaseSdkOptionsSchema;
|
|
|
15373
15451
|
exports.CONNECTIONS_ID = CONNECTIONS_ID;
|
|
15374
15452
|
exports.CONTEXT = CONTEXT;
|
|
15375
15453
|
exports.CONTEXT_CACHE_MAX_SIZE = CONTEXT_CACHE_MAX_SIZE;
|
|
15376
|
-
exports.
|
|
15454
|
+
exports.CONTEXT_CACHE_TTL_MILLISECONDS = CONTEXT_CACHE_TTL_MILLISECONDS;
|
|
15377
15455
|
exports.CORE_ERROR_SYMBOL = CORE_ERROR_SYMBOL;
|
|
15378
15456
|
exports.CORE_OPTIONS_ID = CORE_OPTIONS_ID;
|
|
15379
15457
|
exports.CORE_SIGNAL_SYMBOL = CORE_SIGNAL_SYMBOL;
|
|
@@ -15390,8 +15468,8 @@ exports.CoreSignal = CoreSignal;
|
|
|
15390
15468
|
exports.CredentialsFunctionSchema = CredentialsFunctionSchema;
|
|
15391
15469
|
exports.CredentialsObjectSchema = CredentialsObjectSchema;
|
|
15392
15470
|
exports.CredentialsSchema = CredentialsSchema;
|
|
15393
|
-
exports.
|
|
15394
|
-
exports.
|
|
15471
|
+
exports.DEFAULT_ACTION_TIMEOUT_MILLISECONDS = DEFAULT_ACTION_TIMEOUT_MILLISECONDS;
|
|
15472
|
+
exports.DEFAULT_APPROVAL_TIMEOUT_MILLISECONDS = DEFAULT_APPROVAL_TIMEOUT_MILLISECONDS;
|
|
15395
15473
|
exports.DEFAULT_CONFIG_PATH = DEFAULT_CONFIG_PATH;
|
|
15396
15474
|
exports.DEFAULT_MAX_APPROVAL_RETRIES = DEFAULT_MAX_APPROVAL_RETRIES;
|
|
15397
15475
|
exports.DEFAULT_PAGE_SIZE = DEFAULT_PAGE_SIZE;
|
|
@@ -15429,7 +15507,7 @@ exports.WatchTriggerInboxSchema = WatchTriggerInboxSchema;
|
|
|
15429
15507
|
exports.ZAPIER_BASE_URL = ZAPIER_BASE_URL;
|
|
15430
15508
|
exports.ZAPIER_MAX_CONCURRENT_REQUESTS = ZAPIER_MAX_CONCURRENT_REQUESTS;
|
|
15431
15509
|
exports.ZAPIER_MAX_NETWORK_RETRIES = ZAPIER_MAX_NETWORK_RETRIES;
|
|
15432
|
-
exports.
|
|
15510
|
+
exports.ZAPIER_MAX_NETWORK_RETRY_DELAY_MILLISECONDS = ZAPIER_MAX_NETWORK_RETRY_DELAY_MILLISECONDS;
|
|
15433
15511
|
exports.ZapierAbortDrainSignal = ZapierAbortDrainSignal;
|
|
15434
15512
|
exports.ZapierActionError = ZapierActionError;
|
|
15435
15513
|
exports.ZapierApiError = ZapierApiError;
|