@zapier/zapier-sdk 0.87.1 → 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 +16 -0
- package/README.md +44 -44
- package/dist/{chunk-S6IN256D.cjs → chunk-AVB4LBN5.cjs} +131 -77
- package/dist/{chunk-WVAZCBUJ.mjs → chunk-IXLMFSFV.mjs} +126 -73
- 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 +1 -1
|
@@ -3853,7 +3853,7 @@ function getZapierSdkService() {
|
|
|
3853
3853
|
}
|
|
3854
3854
|
var MAX_PAGE_LIMIT = 1e4;
|
|
3855
3855
|
var DEFAULT_PAGE_SIZE = 100;
|
|
3856
|
-
var
|
|
3856
|
+
var DEFAULT_ACTION_TIMEOUT_MILLISECONDS = 18e4;
|
|
3857
3857
|
function parseIntEnvVar(name) {
|
|
3858
3858
|
const value = globalThis.process?.env?.[name];
|
|
3859
3859
|
if (value === void 0) return void 0;
|
|
@@ -3867,7 +3867,10 @@ function parseIntEnvVar(name) {
|
|
|
3867
3867
|
return parsed;
|
|
3868
3868
|
}
|
|
3869
3869
|
var ZAPIER_MAX_NETWORK_RETRIES = parseIntEnvVar("ZAPIER_MAX_NETWORK_RETRIES") ?? 3;
|
|
3870
|
-
var
|
|
3870
|
+
var maxNetworkRetryDelaySecondsEnv = parseIntEnvVar(
|
|
3871
|
+
"ZAPIER_MAX_NETWORK_RETRY_DELAY_SECONDS"
|
|
3872
|
+
);
|
|
3873
|
+
var ZAPIER_MAX_NETWORK_RETRY_DELAY_MILLISECONDS = (maxNetworkRetryDelaySecondsEnv != null ? maxNetworkRetryDelaySecondsEnv * 1e3 : void 0) ?? parseIntEnvVar("ZAPIER_MAX_NETWORK_RETRY_DELAY_MS") ?? 6e4;
|
|
3871
3874
|
var MAX_CONCURRENCY_LIMIT = 1e4;
|
|
3872
3875
|
function parseConcurrencyEnvVar(name) {
|
|
3873
3876
|
const value = globalThis.process?.env?.[name];
|
|
@@ -3898,7 +3901,7 @@ function getZapierDefaultApprovalMode() {
|
|
|
3898
3901
|
const isInteractive = !!globalThis.process?.stdin?.isTTY && !!globalThis.process?.stdout?.isTTY;
|
|
3899
3902
|
return isInteractive ? "poll" : "throw";
|
|
3900
3903
|
}
|
|
3901
|
-
var
|
|
3904
|
+
var DEFAULT_APPROVAL_TIMEOUT_MILLISECONDS = 10 * 60 * 1e3;
|
|
3902
3905
|
var DEFAULT_MAX_APPROVAL_RETRIES = 2;
|
|
3903
3906
|
|
|
3904
3907
|
// src/types/properties.ts
|
|
@@ -3940,8 +3943,11 @@ var OffsetPropertySchema = z.number().int().min(0).default(0).describe("Number o
|
|
|
3940
3943
|
var OutputPropertySchema = z.string().describe("Output file path");
|
|
3941
3944
|
var DebugPropertySchema = z.boolean().default(false).describe("Enable debug logging");
|
|
3942
3945
|
var ParamsPropertySchema = z.record(z.string(), z.unknown()).describe("Additional parameters");
|
|
3943
|
-
var
|
|
3944
|
-
`Maximum time to wait for action completion in
|
|
3946
|
+
var ActionTimeoutSecondsPropertySchema = z.number().min(1).optional().describe(
|
|
3947
|
+
`Maximum time to wait for action completion in seconds (default: ${DEFAULT_ACTION_TIMEOUT_MILLISECONDS / 1e3})`
|
|
3948
|
+
);
|
|
3949
|
+
var ActionTimeoutMillisecondsPropertySchema = z.number().min(1e3).optional().describe(
|
|
3950
|
+
`Maximum time to wait for action completion in milliseconds (default: ${DEFAULT_ACTION_TIMEOUT_MILLISECONDS})`
|
|
3945
3951
|
);
|
|
3946
3952
|
var TablePropertySchema = withPositional(
|
|
3947
3953
|
z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table")
|
|
@@ -4349,11 +4355,18 @@ var ActionExecutionInputSchema = z.object({
|
|
|
4349
4355
|
authenticationId: AuthenticationIdPropertySchema.optional().meta({
|
|
4350
4356
|
deprecated: true
|
|
4351
4357
|
}),
|
|
4352
|
-
|
|
4358
|
+
timeoutSeconds: ActionTimeoutSecondsPropertySchema,
|
|
4359
|
+
/** @deprecated Use `timeoutSeconds` instead. */
|
|
4360
|
+
timeoutMs: ActionTimeoutMillisecondsPropertySchema.meta({
|
|
4361
|
+
deprecated: true
|
|
4362
|
+
})
|
|
4353
4363
|
}).describe(
|
|
4354
4364
|
"Execute an action with the given inputs for the bound app, as an alternative to runAction"
|
|
4355
4365
|
).meta({
|
|
4356
|
-
aliases: {
|
|
4366
|
+
aliases: {
|
|
4367
|
+
connectionId: "connection",
|
|
4368
|
+
authenticationId: "connection"
|
|
4369
|
+
}
|
|
4357
4370
|
});
|
|
4358
4371
|
var AppFactoryInputSchema = z.object({
|
|
4359
4372
|
/** @deprecated Use `connection` instead. */
|
|
@@ -4531,19 +4544,19 @@ function createDebugFetch(options) {
|
|
|
4531
4544
|
|
|
4532
4545
|
// src/utils/retry-utils.ts
|
|
4533
4546
|
var MAX_CONSECUTIVE_ERRORS = 3;
|
|
4534
|
-
var
|
|
4535
|
-
var
|
|
4547
|
+
var BASE_ERROR_BACKOFF_MILLISECONDS = 1e3;
|
|
4548
|
+
var BASE_EXPONENTIAL_BACKOFF_MILLISECONDS = 1e3;
|
|
4536
4549
|
var JITTER_FACTOR = 0.5;
|
|
4537
4550
|
function calculateErrorBackoffMs(baseInterval, errorCount) {
|
|
4538
4551
|
const jitter = Math.random() * JITTER_FACTOR * baseInterval;
|
|
4539
4552
|
const errorBackoff = Math.min(
|
|
4540
|
-
|
|
4553
|
+
BASE_ERROR_BACKOFF_MILLISECONDS * (errorCount / 2),
|
|
4541
4554
|
baseInterval * 2
|
|
4542
4555
|
// Cap error backoff at 2x the base interval
|
|
4543
4556
|
);
|
|
4544
4557
|
return Math.floor(baseInterval + jitter + errorBackoff);
|
|
4545
4558
|
}
|
|
4546
|
-
function calculateExponentialBackoffMs(attempt, baseDelayMs =
|
|
4559
|
+
function calculateExponentialBackoffMs(attempt, baseDelayMs = BASE_EXPONENTIAL_BACKOFF_MILLISECONDS) {
|
|
4547
4560
|
const baseDelay = baseDelayMs * Math.pow(2, attempt - 1);
|
|
4548
4561
|
const jitter = Math.random() * JITTER_FACTOR * baseDelay;
|
|
4549
4562
|
return Math.floor(baseDelay + jitter);
|
|
@@ -4646,11 +4659,11 @@ function combineAbortSignals({
|
|
|
4646
4659
|
}
|
|
4647
4660
|
|
|
4648
4661
|
// src/api/polling.ts
|
|
4649
|
-
var
|
|
4662
|
+
var DEFAULT_TIMEOUT_MILLISECONDS = 18e4;
|
|
4650
4663
|
var DEFAULT_SUCCESS_STATUS = 200;
|
|
4651
4664
|
var DEFAULT_PENDING_STATUS = 202;
|
|
4652
|
-
var
|
|
4653
|
-
var
|
|
4665
|
+
var DEFAULT_INITIAL_DELAY_MILLISECONDS = 50;
|
|
4666
|
+
var DEFAULT_MAX_POLLING_INTERVAL_MILLISECONDS = 6e4;
|
|
4654
4667
|
var POLLING_STAGES = [
|
|
4655
4668
|
[125, 125],
|
|
4656
4669
|
// Up to 125ms: poll every 125ms
|
|
@@ -4666,11 +4679,11 @@ var POLLING_STAGES = [
|
|
|
4666
4679
|
// Up to 60s: poll every 5s
|
|
4667
4680
|
[18e4, 1e4]
|
|
4668
4681
|
// Up to 3min: poll every 10s
|
|
4669
|
-
// Beyond 3min: use
|
|
4682
|
+
// Beyond 3min: use DEFAULT_MAX_POLLING_INTERVAL_MILLISECONDS (60s)
|
|
4670
4683
|
];
|
|
4671
4684
|
function getPollingInterval(elapsedMs) {
|
|
4672
4685
|
const stage = POLLING_STAGES.find(([threshold]) => elapsedMs < threshold);
|
|
4673
|
-
return stage ? stage[1] :
|
|
4686
|
+
return stage ? stage[1] : DEFAULT_MAX_POLLING_INTERVAL_MILLISECONDS;
|
|
4674
4687
|
}
|
|
4675
4688
|
function makeAbortError() {
|
|
4676
4689
|
if (typeof DOMException !== "undefined") {
|
|
@@ -4728,8 +4741,8 @@ var processResponse = async (response, successStatus, pendingStatus, isPending,
|
|
|
4728
4741
|
async function pollUntilComplete(options) {
|
|
4729
4742
|
const {
|
|
4730
4743
|
fetchPoll,
|
|
4731
|
-
timeoutMs =
|
|
4732
|
-
initialDelay =
|
|
4744
|
+
timeoutMs = DEFAULT_TIMEOUT_MILLISECONDS,
|
|
4745
|
+
initialDelay = DEFAULT_INITIAL_DELAY_MILLISECONDS,
|
|
4733
4746
|
successStatus = DEFAULT_SUCCESS_STATUS,
|
|
4734
4747
|
pendingStatus = DEFAULT_PENDING_STATUS,
|
|
4735
4748
|
isPending,
|
|
@@ -5176,7 +5189,7 @@ function clearTokenCache() {
|
|
|
5176
5189
|
cachedCliLogin = void 0;
|
|
5177
5190
|
cachedDefaultCache = void 0;
|
|
5178
5191
|
}
|
|
5179
|
-
var
|
|
5192
|
+
var TOKEN_EXPIRATION_BUFFER_MILLISECONDS = 5 * 60 * 1e3;
|
|
5180
5193
|
async function resolveCache(options) {
|
|
5181
5194
|
if (options.cache) return options.cache;
|
|
5182
5195
|
if (cachedDefaultCache !== void 0) return cachedDefaultCache;
|
|
@@ -5197,7 +5210,7 @@ async function resolveCache(options) {
|
|
|
5197
5210
|
}
|
|
5198
5211
|
function entryIsValid(entry) {
|
|
5199
5212
|
if (entry.expiresAt === void 0) return true;
|
|
5200
|
-
return entry.expiresAt > Date.now() +
|
|
5213
|
+
return entry.expiresAt > Date.now() + TOKEN_EXPIRATION_BUFFER_MILLISECONDS;
|
|
5201
5214
|
}
|
|
5202
5215
|
async function readCachedToken(cacheKey, cache) {
|
|
5203
5216
|
const cached = await cache.get(cacheKey);
|
|
@@ -5813,7 +5826,7 @@ function parseDeprecationDate(value) {
|
|
|
5813
5826
|
}
|
|
5814
5827
|
|
|
5815
5828
|
// src/sdk-version.ts
|
|
5816
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.
|
|
5829
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.88.0" : void 0) || "unknown";
|
|
5817
5830
|
|
|
5818
5831
|
// src/utils/open-url.ts
|
|
5819
5832
|
var nodePrefix = "node:";
|
|
@@ -5924,7 +5937,7 @@ var PollApprovalResponseSchema = z.object({
|
|
|
5924
5937
|
mode: ApprovalModeSchema.optional(),
|
|
5925
5938
|
reason: z.string().optional()
|
|
5926
5939
|
});
|
|
5927
|
-
var
|
|
5940
|
+
var APPROVAL_MAX_POLLING_INTERVAL_MILLISECONDS = 5e3;
|
|
5928
5941
|
function validateSdkPath(path) {
|
|
5929
5942
|
if (!path.startsWith("/") || path.startsWith("//")) {
|
|
5930
5943
|
throw new ZapierValidationError(
|
|
@@ -6089,7 +6102,7 @@ var ZapierApiClient = class {
|
|
|
6089
6102
|
}
|
|
6090
6103
|
const rateLimitInfo = parseRateLimitHeaders(response);
|
|
6091
6104
|
const delayMs = rateLimitInfo.retryAfterMs ?? calculateExponentialBackoffMs(retries + 1);
|
|
6092
|
-
if (delayMs > this.
|
|
6105
|
+
if (delayMs > this.maxNetworkRetryDelayMilliseconds || retries >= this.maxNetworkRetries) {
|
|
6093
6106
|
throw new ZapierRateLimitError("Rate limited", {
|
|
6094
6107
|
statusCode: 429,
|
|
6095
6108
|
rateLimit: rateLimitInfo,
|
|
@@ -6346,8 +6359,8 @@ var ZapierApiClient = class {
|
|
|
6346
6359
|
authRequired: options.authRequired,
|
|
6347
6360
|
signal: options.signal
|
|
6348
6361
|
}),
|
|
6349
|
-
initialDelay: options.initialDelay,
|
|
6350
|
-
timeoutMs: options.timeoutMs,
|
|
6362
|
+
initialDelay: options.initialDelayMilliseconds ?? options.initialDelay,
|
|
6363
|
+
timeoutMs: options.timeoutMilliseconds ?? options.timeoutMs,
|
|
6351
6364
|
successStatus: options.successStatus,
|
|
6352
6365
|
pendingStatus: options.pendingStatus,
|
|
6353
6366
|
isPending: options.isPending,
|
|
@@ -6356,7 +6369,7 @@ var ZapierApiClient = class {
|
|
|
6356
6369
|
});
|
|
6357
6370
|
};
|
|
6358
6371
|
this.maxNetworkRetries = options.maxNetworkRetries ?? ZAPIER_MAX_NETWORK_RETRIES;
|
|
6359
|
-
this.
|
|
6372
|
+
this.maxNetworkRetryDelayMilliseconds = options.maxNetworkRetryDelayMilliseconds ?? options.maxNetworkRetryDelayMs ?? ZAPIER_MAX_NETWORK_RETRY_DELAY_MILLISECONDS;
|
|
6360
6373
|
const requested = options.maxConcurrentRequests;
|
|
6361
6374
|
const limit = requested === void 0 || Number.isNaN(requested) ? ZAPIER_MAX_CONCURRENT_REQUESTS : requested;
|
|
6362
6375
|
if (limit !== Infinity && (!Number.isInteger(limit) || limit < 1 || limit > MAX_CONCURRENCY_LIMIT)) {
|
|
@@ -6931,7 +6944,7 @@ var ZapierApiClient = class {
|
|
|
6931
6944
|
}
|
|
6932
6945
|
await openApproval(approval.approval_url);
|
|
6933
6946
|
}
|
|
6934
|
-
const timeoutMs = this.options.approvalTimeoutMs ??
|
|
6947
|
+
const timeoutMs = this.options.approvalTimeoutMilliseconds ?? this.options.approvalTimeoutMs ?? DEFAULT_APPROVAL_TIMEOUT_MILLISECONDS;
|
|
6935
6948
|
let streamAbortController;
|
|
6936
6949
|
let streamPromise;
|
|
6937
6950
|
let removeStreamAbortListener;
|
|
@@ -6971,7 +6984,7 @@ var ZapierApiClient = class {
|
|
|
6971
6984
|
})
|
|
6972
6985
|
),
|
|
6973
6986
|
timeoutMs,
|
|
6974
|
-
maxPollingIntervalMs:
|
|
6987
|
+
maxPollingIntervalMs: APPROVAL_MAX_POLLING_INTERVAL_MILLISECONDS,
|
|
6975
6988
|
signal,
|
|
6976
6989
|
isPending: (body2) => {
|
|
6977
6990
|
const parsed = PollApprovalResponseSchema.safeParse(body2);
|
|
@@ -7151,8 +7164,10 @@ var apiPlugin = defineProperty({
|
|
|
7151
7164
|
onEvent,
|
|
7152
7165
|
debug = false,
|
|
7153
7166
|
maxNetworkRetries = ZAPIER_MAX_NETWORK_RETRIES,
|
|
7154
|
-
|
|
7167
|
+
maxNetworkRetryDelaySeconds,
|
|
7168
|
+
maxNetworkRetryDelayMs,
|
|
7155
7169
|
maxConcurrentRequests = ZAPIER_MAX_CONCURRENT_REQUESTS,
|
|
7170
|
+
approvalTimeoutSeconds,
|
|
7156
7171
|
approvalTimeoutMs,
|
|
7157
7172
|
maxApprovalRetries,
|
|
7158
7173
|
approvalMode,
|
|
@@ -7167,9 +7182,9 @@ var apiPlugin = defineProperty({
|
|
|
7167
7182
|
fetch: customFetch,
|
|
7168
7183
|
onEvent,
|
|
7169
7184
|
maxNetworkRetries,
|
|
7170
|
-
maxNetworkRetryDelayMs,
|
|
7185
|
+
maxNetworkRetryDelayMilliseconds: (maxNetworkRetryDelaySeconds != null ? maxNetworkRetryDelaySeconds * 1e3 : maxNetworkRetryDelayMs) ?? ZAPIER_MAX_NETWORK_RETRY_DELAY_MILLISECONDS,
|
|
7171
7186
|
maxConcurrentRequests,
|
|
7172
|
-
approvalTimeoutMs,
|
|
7187
|
+
approvalTimeoutMilliseconds: approvalTimeoutSeconds != null ? approvalTimeoutSeconds * 1e3 : approvalTimeoutMs,
|
|
7173
7188
|
maxApprovalRetries,
|
|
7174
7189
|
approvalMode,
|
|
7175
7190
|
openAutoModeApprovalsInBrowser,
|
|
@@ -7877,9 +7892,13 @@ var FetchInitZapierFieldsSchema = z.object({
|
|
|
7877
7892
|
deprecated: true
|
|
7878
7893
|
}),
|
|
7879
7894
|
callbackUrl: z.string().optional().describe("URL to send async response to (makes request async)"),
|
|
7895
|
+
maxTimeSeconds: z.number().int().positive().optional().describe(
|
|
7896
|
+
"Maximum seconds to wait for a response. Honored on a best-effort basis; the server may silently enforce a lower ceiling."
|
|
7897
|
+
),
|
|
7898
|
+
/** @deprecated Use `maxTimeSeconds` instead. */
|
|
7880
7899
|
maxTime: z.number().int().positive().optional().describe(
|
|
7881
7900
|
"Maximum seconds to wait for a response. Honored on a best-effort basis; the server may silently enforce a lower ceiling."
|
|
7882
|
-
)
|
|
7901
|
+
).meta({ deprecated: true })
|
|
7883
7902
|
});
|
|
7884
7903
|
var FetchInitSchema = z.object({
|
|
7885
7904
|
method: z.enum(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]).optional().describe("HTTP method for the request (defaults to GET)"),
|
|
@@ -7895,7 +7914,11 @@ var FetchInitSchema = z.object({
|
|
|
7895
7914
|
}).extend(FetchInitZapierFieldsSchema.shape).optional().describe(
|
|
7896
7915
|
"Request options including method, headers, body, and authentication"
|
|
7897
7916
|
).meta({
|
|
7898
|
-
aliases: {
|
|
7917
|
+
aliases: {
|
|
7918
|
+
connectionId: "connection",
|
|
7919
|
+
authenticationId: "connection",
|
|
7920
|
+
maxTime: "maxTimeSeconds"
|
|
7921
|
+
}
|
|
7899
7922
|
});
|
|
7900
7923
|
var FetchInputSchema = z.object({
|
|
7901
7924
|
url: FetchUrlSchema,
|
|
@@ -7946,7 +7969,7 @@ function rewrapIfMaxTimeTimeout({
|
|
|
7946
7969
|
const reason = abortSignal.reason;
|
|
7947
7970
|
if (!reason || reason.name !== "TimeoutError") return error;
|
|
7948
7971
|
return new ZapierTimeoutError(
|
|
7949
|
-
`fetch timed out after ${maxTimeSeconds}s (
|
|
7972
|
+
`fetch timed out after ${maxTimeSeconds}s (maxTimeSeconds)`,
|
|
7950
7973
|
{ cause: error }
|
|
7951
7974
|
);
|
|
7952
7975
|
}
|
|
@@ -8011,9 +8034,11 @@ var fetchPlugin = defineMethod({
|
|
|
8011
8034
|
connection,
|
|
8012
8035
|
authenticationId,
|
|
8013
8036
|
callbackUrl,
|
|
8037
|
+
maxTimeSeconds: maxTimeSecondsInput,
|
|
8014
8038
|
maxTime,
|
|
8015
8039
|
...fetchInit
|
|
8016
8040
|
} = init || {};
|
|
8041
|
+
const maxTimeSeconds = maxTimeSecondsInput ?? maxTime;
|
|
8017
8042
|
const resolvedConnectionId = await resolveConnectionId({
|
|
8018
8043
|
connectionId,
|
|
8019
8044
|
connection,
|
|
@@ -8042,13 +8067,13 @@ var fetchPlugin = defineMethod({
|
|
|
8042
8067
|
if (callbackUrl) {
|
|
8043
8068
|
headers["X-Relay-Callback-Url"] = callbackUrl;
|
|
8044
8069
|
}
|
|
8045
|
-
if (
|
|
8046
|
-
headers["X-Zapier-Sdk-Max-Time"] = String(
|
|
8070
|
+
if (maxTimeSeconds !== void 0) {
|
|
8071
|
+
headers["X-Zapier-Sdk-Max-Time"] = String(maxTimeSeconds);
|
|
8047
8072
|
}
|
|
8048
8073
|
const upstreamUrl = new URL(url).toString();
|
|
8049
8074
|
const method = (fetchInit.method ?? "GET").toUpperCase();
|
|
8050
8075
|
const abortHandle = buildAbortHandle({
|
|
8051
|
-
maxTimeSeconds
|
|
8076
|
+
maxTimeSeconds,
|
|
8052
8077
|
callerSignal: fetchInit.signal
|
|
8053
8078
|
});
|
|
8054
8079
|
try {
|
|
@@ -8078,7 +8103,7 @@ var fetchPlugin = defineMethod({
|
|
|
8078
8103
|
throw rewrapIfMaxTimeTimeout({
|
|
8079
8104
|
error,
|
|
8080
8105
|
abortSignal: abortHandle?.signal,
|
|
8081
|
-
maxTimeSeconds
|
|
8106
|
+
maxTimeSeconds
|
|
8082
8107
|
});
|
|
8083
8108
|
} finally {
|
|
8084
8109
|
abortHandle?.dispose();
|
|
@@ -8098,7 +8123,9 @@ var RunActionBaseSchema = z.object({
|
|
|
8098
8123
|
inputs: InputsPropertySchema.optional().describe(
|
|
8099
8124
|
"Input parameters for the action"
|
|
8100
8125
|
),
|
|
8101
|
-
|
|
8126
|
+
timeoutSeconds: ActionTimeoutSecondsPropertySchema,
|
|
8127
|
+
/** @deprecated Use `timeoutSeconds` instead. */
|
|
8128
|
+
timeoutMs: ActionTimeoutMillisecondsPropertySchema.meta({ deprecated: true }),
|
|
8102
8129
|
pageSize: z.number().min(1).optional().describe("Number of results per page"),
|
|
8103
8130
|
maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
|
|
8104
8131
|
cursor: z.string().optional().describe("Cursor to start from")
|
|
@@ -9852,7 +9879,7 @@ async function executeAction(actionOptions) {
|
|
|
9852
9879
|
executionOptions,
|
|
9853
9880
|
cursor,
|
|
9854
9881
|
connectionId,
|
|
9855
|
-
|
|
9882
|
+
timeoutMilliseconds
|
|
9856
9883
|
} = actionOptions;
|
|
9857
9884
|
const runRequestData = {
|
|
9858
9885
|
selected_api: selectedApi,
|
|
@@ -9888,7 +9915,7 @@ async function executeAction(actionOptions) {
|
|
|
9888
9915
|
return await api.poll(`/zapier/api/actions/v1/runs/${runId}`, {
|
|
9889
9916
|
successStatus: 200,
|
|
9890
9917
|
pendingStatus: 202,
|
|
9891
|
-
|
|
9918
|
+
timeoutMilliseconds: timeoutMilliseconds ?? DEFAULT_ACTION_TIMEOUT_MILLISECONDS,
|
|
9892
9919
|
resource: { type: "run", id: runId },
|
|
9893
9920
|
isPending: (result) => {
|
|
9894
9921
|
const data = result?.data;
|
|
@@ -9897,7 +9924,7 @@ async function executeAction(actionOptions) {
|
|
|
9897
9924
|
resultExtractor: (result) => result.data
|
|
9898
9925
|
});
|
|
9899
9926
|
}
|
|
9900
|
-
var
|
|
9927
|
+
var CONTEXT_CACHE_TTL_MILLISECONDS = 6e4;
|
|
9901
9928
|
var CONTEXT_CACHE_MAX_SIZE = 500;
|
|
9902
9929
|
var runActionPlugin = defineMethod({
|
|
9903
9930
|
name: "runAction",
|
|
@@ -9978,7 +10005,7 @@ var runActionPlugin = defineMethod({
|
|
|
9978
10005
|
evictIfNeeded();
|
|
9979
10006
|
cache.set(contextKey, {
|
|
9980
10007
|
promise: pending,
|
|
9981
|
-
expiresAt: Date.now() +
|
|
10008
|
+
expiresAt: Date.now() + CONTEXT_CACHE_TTL_MILLISECONDS
|
|
9982
10009
|
});
|
|
9983
10010
|
return pending;
|
|
9984
10011
|
}
|
|
@@ -9995,9 +10022,9 @@ var runActionPlugin = defineMethod({
|
|
|
9995
10022
|
connection,
|
|
9996
10023
|
authenticationId,
|
|
9997
10024
|
inputs = {},
|
|
9998
|
-
cursor
|
|
9999
|
-
timeoutMs
|
|
10025
|
+
cursor
|
|
10000
10026
|
} = input;
|
|
10027
|
+
const timeoutMilliseconds = input.timeoutSeconds != null ? input.timeoutSeconds * 1e3 : input.timeoutMs;
|
|
10001
10028
|
const resolvedConnectionId = await resolveConnectionId({
|
|
10002
10029
|
connectionId,
|
|
10003
10030
|
connection,
|
|
@@ -10025,7 +10052,7 @@ var runActionPlugin = defineMethod({
|
|
|
10025
10052
|
executionOptions: { inputs },
|
|
10026
10053
|
cursor,
|
|
10027
10054
|
connectionId: resolvedConnectionId,
|
|
10028
|
-
|
|
10055
|
+
timeoutMilliseconds
|
|
10029
10056
|
});
|
|
10030
10057
|
if (result.errors && result.errors.length > 0) {
|
|
10031
10058
|
const errorMessage2 = result.errors.map(
|
|
@@ -10082,6 +10109,7 @@ function createActionFunction(appKey, actionType, actionKey, imports, pinnedAuth
|
|
|
10082
10109
|
connectionId: providedConnectionId,
|
|
10083
10110
|
connection: providedConnection,
|
|
10084
10111
|
authenticationId: providedAuthenticationId,
|
|
10112
|
+
timeoutSeconds,
|
|
10085
10113
|
timeoutMs
|
|
10086
10114
|
} = actionOptions;
|
|
10087
10115
|
const { connectionId, connection } = resolveProxyConnection({
|
|
@@ -10098,6 +10126,7 @@ function createActionFunction(appKey, actionType, actionKey, imports, pinnedAuth
|
|
|
10098
10126
|
action: actionKey,
|
|
10099
10127
|
inputs,
|
|
10100
10128
|
connection: connectionId ?? connection,
|
|
10129
|
+
timeoutSeconds,
|
|
10101
10130
|
timeoutMs
|
|
10102
10131
|
});
|
|
10103
10132
|
};
|
|
@@ -11649,12 +11678,18 @@ var WaitForNewConnectionSchema = z.object({
|
|
|
11649
11678
|
startedAt: z.number().int().nonnegative().describe(
|
|
11650
11679
|
"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."
|
|
11651
11680
|
),
|
|
11681
|
+
timeoutSeconds: z.number().int().positive().optional().describe("How long to wait before giving up. Default 5 minutes (300)."),
|
|
11682
|
+
/** @deprecated Use `timeoutSeconds` instead. */
|
|
11652
11683
|
timeoutMs: z.number().int().positive().optional().describe(
|
|
11653
11684
|
"How long to wait before giving up. Default 5 minutes (300_000)."
|
|
11685
|
+
).meta({ deprecated: true }),
|
|
11686
|
+
pollIntervalMilliseconds: z.number().int().positive().optional().describe(
|
|
11687
|
+
"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)."
|
|
11654
11688
|
),
|
|
11689
|
+
/** @deprecated Use `pollIntervalMilliseconds` instead. */
|
|
11655
11690
|
pollIntervalMs: z.number().int().positive().optional().describe(
|
|
11656
11691
|
"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)."
|
|
11657
|
-
)
|
|
11692
|
+
).meta({ deprecated: true })
|
|
11658
11693
|
}).describe(
|
|
11659
11694
|
"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```"
|
|
11660
11695
|
);
|
|
@@ -11701,8 +11736,8 @@ var waitForNewConnectionPlugin = defineMethod({
|
|
|
11701
11736
|
page_size: "1"
|
|
11702
11737
|
},
|
|
11703
11738
|
authRequired: true,
|
|
11704
|
-
|
|
11705
|
-
|
|
11739
|
+
timeoutMilliseconds: input.timeoutSeconds != null ? input.timeoutSeconds * 1e3 : input.timeoutMs ?? 3e5,
|
|
11740
|
+
initialDelayMilliseconds: input.pollIntervalMilliseconds ?? input.pollIntervalMs ?? 3e3,
|
|
11706
11741
|
isPending: (body) => {
|
|
11707
11742
|
const rows = body.data ?? [];
|
|
11708
11743
|
const head = rows[0];
|
|
@@ -11752,12 +11787,20 @@ var CreateConnectionSchema = z.object({
|
|
|
11752
11787
|
browser: z.enum(["auto", "always", "never"]).default("auto").describe(
|
|
11753
11788
|
"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."
|
|
11754
11789
|
),
|
|
11790
|
+
timeoutSeconds: z.number().int().positive().optional().describe(
|
|
11791
|
+
"How long to wait for the user to complete the connection flow before giving up. Default 5 minutes (300)."
|
|
11792
|
+
),
|
|
11793
|
+
/** @deprecated Use `timeoutSeconds` instead. */
|
|
11755
11794
|
timeoutMs: z.number().int().positive().optional().describe(
|
|
11756
11795
|
"How long to wait for the user to complete the connection flow before giving up. Default 5 minutes (300_000)."
|
|
11796
|
+
).meta({ deprecated: true }),
|
|
11797
|
+
pollIntervalMilliseconds: z.number().int().positive().optional().describe(
|
|
11798
|
+
"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)."
|
|
11757
11799
|
),
|
|
11800
|
+
/** @deprecated Use `pollIntervalMilliseconds` instead. */
|
|
11758
11801
|
pollIntervalMs: z.number().int().positive().optional().describe(
|
|
11759
11802
|
"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)."
|
|
11760
|
-
)
|
|
11803
|
+
).meta({ deprecated: true })
|
|
11761
11804
|
}).describe(
|
|
11762
11805
|
"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`."
|
|
11763
11806
|
);
|
|
@@ -11819,8 +11862,9 @@ Open this URL to complete the connection:
|
|
|
11819
11862
|
// Server-stamped mint time: measured on the same clock as a connection's
|
|
11820
11863
|
// `date`, so the freshness check is immune to client/server clock skew.
|
|
11821
11864
|
startedAt: start2.startedAt,
|
|
11865
|
+
timeoutSeconds: input.timeoutSeconds,
|
|
11822
11866
|
timeoutMs: input.timeoutMs,
|
|
11823
|
-
|
|
11867
|
+
pollIntervalMilliseconds: input.pollIntervalMilliseconds ?? input.pollIntervalMs
|
|
11824
11868
|
});
|
|
11825
11869
|
return {
|
|
11826
11870
|
data: CreateConnectionItemSchema.parse({
|
|
@@ -13179,9 +13223,9 @@ async function* readInboxEvents({
|
|
|
13179
13223
|
}
|
|
13180
13224
|
|
|
13181
13225
|
// src/plugins/triggers/watchTriggerInbox/index.ts
|
|
13182
|
-
var
|
|
13183
|
-
var
|
|
13184
|
-
var
|
|
13226
|
+
var SSE_RECONNECT_BACKOFF_MILLISECONDS = [500, 1e3, 2e3, 5e3];
|
|
13227
|
+
var DEFAULT_SAFETY_DRAIN_INTERVAL_MILLISECONDS = 3e5;
|
|
13228
|
+
var SSE_HEALTHY_CONNECTION_MILLISECONDS = 5e3;
|
|
13185
13229
|
var ERROR_BACKOFF_CAP = 4;
|
|
13186
13230
|
function createDrainLatch() {
|
|
13187
13231
|
let pending = false;
|
|
@@ -13239,7 +13283,7 @@ async function drainRunner({
|
|
|
13239
13283
|
consecutiveErrors = Math.min(consecutiveErrors + 1, ERROR_BACKOFF_CAP);
|
|
13240
13284
|
errorAttempts += 1;
|
|
13241
13285
|
const delay = calculateErrorBackoffMs(
|
|
13242
|
-
|
|
13286
|
+
BASE_ERROR_BACKOFF_MILLISECONDS,
|
|
13243
13287
|
consecutiveErrors
|
|
13244
13288
|
);
|
|
13245
13289
|
const statusCode = errorStatusCode(error);
|
|
@@ -13305,7 +13349,7 @@ async function sseLoop({
|
|
|
13305
13349
|
})) {
|
|
13306
13350
|
drainRequest.request();
|
|
13307
13351
|
}
|
|
13308
|
-
if (connected && Date.now() - connectedAt >=
|
|
13352
|
+
if (connected && Date.now() - connectedAt >= SSE_HEALTHY_CONNECTION_MILLISECONDS) {
|
|
13309
13353
|
attempt = 0;
|
|
13310
13354
|
}
|
|
13311
13355
|
} catch (err) {
|
|
@@ -13329,8 +13373,11 @@ async function sseLoop({
|
|
|
13329
13373
|
transientError = err;
|
|
13330
13374
|
}
|
|
13331
13375
|
if (signal.aborted) return;
|
|
13332
|
-
const delay =
|
|
13333
|
-
attempt = Math.min(
|
|
13376
|
+
const delay = SSE_RECONNECT_BACKOFF_MILLISECONDS[Math.min(attempt, SSE_RECONNECT_BACKOFF_MILLISECONDS.length - 1)];
|
|
13377
|
+
attempt = Math.min(
|
|
13378
|
+
attempt + 1,
|
|
13379
|
+
SSE_RECONNECT_BACKOFF_MILLISECONDS.length - 1
|
|
13380
|
+
);
|
|
13334
13381
|
if (transientError !== void 0 && debug) {
|
|
13335
13382
|
const statusCode = errorStatusCode(transientError);
|
|
13336
13383
|
const errorMsg = errorMessage(transientError);
|
|
@@ -13387,7 +13434,7 @@ var watchTriggerInboxPlugin = defineMethod({
|
|
|
13387
13434
|
const { concurrency, leaseLimit } = resolveConcurrencyAndLease(input);
|
|
13388
13435
|
const inboxId = await resolveTriggerInboxId({ api, inbox: input.inbox });
|
|
13389
13436
|
if (input.signal?.aborted) return;
|
|
13390
|
-
const safetyDrainMs = input.maxDrainIntervalSeconds !== void 0 ? input.maxDrainIntervalSeconds * 1e3 :
|
|
13437
|
+
const safetyDrainMs = input.maxDrainIntervalSeconds !== void 0 ? input.maxDrainIntervalSeconds * 1e3 : DEFAULT_SAFETY_DRAIN_INTERVAL_MILLISECONDS;
|
|
13391
13438
|
const stop = new AbortController();
|
|
13392
13439
|
const combined = combineAbortSignals({
|
|
13393
13440
|
handles: [
|
|
@@ -14416,7 +14463,7 @@ var updateTableRecordsPlugin = defineMethod({
|
|
|
14416
14463
|
|
|
14417
14464
|
// src/plugins/eventEmission/transport.ts
|
|
14418
14465
|
var DEFAULT_RETRY_ATTEMPTS = 2;
|
|
14419
|
-
var
|
|
14466
|
+
var DEFAULT_RETRY_DELAY_MILLISECONDS = 300;
|
|
14420
14467
|
function createHttpTransport(config) {
|
|
14421
14468
|
const delay = async (ms) => {
|
|
14422
14469
|
return new Promise((resolve2) => {
|
|
@@ -14441,12 +14488,12 @@ function createHttpTransport(config) {
|
|
|
14441
14488
|
body: JSON.stringify(payload)
|
|
14442
14489
|
});
|
|
14443
14490
|
if (!response.ok && attemptsLeft > 1) {
|
|
14444
|
-
await delay(config.retryDelayMs ||
|
|
14491
|
+
await delay(config.retryDelayMs || DEFAULT_RETRY_DELAY_MILLISECONDS);
|
|
14445
14492
|
return emitWithRetry(subject, event, attemptsLeft - 1);
|
|
14446
14493
|
}
|
|
14447
14494
|
} catch (error) {
|
|
14448
14495
|
if (attemptsLeft > 1) {
|
|
14449
|
-
await delay(config.retryDelayMs ||
|
|
14496
|
+
await delay(config.retryDelayMs || DEFAULT_RETRY_DELAY_MILLISECONDS);
|
|
14450
14497
|
return emitWithRetry(subject, event, attemptsLeft - 1);
|
|
14451
14498
|
}
|
|
14452
14499
|
throw error;
|
|
@@ -14739,7 +14786,7 @@ function makeMethodEndHook(emitMethodCalled) {
|
|
|
14739
14786
|
}
|
|
14740
14787
|
|
|
14741
14788
|
// src/plugins/eventEmission/index.ts
|
|
14742
|
-
var
|
|
14789
|
+
var TELEMETRY_EMIT_TIMEOUT_MILLISECONDS = 300;
|
|
14743
14790
|
var registeredListeners = {};
|
|
14744
14791
|
function removeExistingListeners() {
|
|
14745
14792
|
const events = [
|
|
@@ -14785,7 +14832,7 @@ async function emitWithTimeout(transport, subject, event) {
|
|
|
14785
14832
|
await Promise.race([
|
|
14786
14833
|
transport.emit(subject, event),
|
|
14787
14834
|
new Promise((resolve2) => {
|
|
14788
|
-
const timer = setTimeout(resolve2,
|
|
14835
|
+
const timer = setTimeout(resolve2, TELEMETRY_EMIT_TIMEOUT_MILLISECONDS);
|
|
14789
14836
|
if (typeof timer.unref === "function") {
|
|
14790
14837
|
timer.unref();
|
|
14791
14838
|
}
|
|
@@ -15224,14 +15271,14 @@ function createZapierSdk(options = {}) {
|
|
|
15224
15271
|
|
|
15225
15272
|
// src/utils/batch-utils.ts
|
|
15226
15273
|
var DEFAULT_CONCURRENCY = 10;
|
|
15227
|
-
var
|
|
15228
|
-
var
|
|
15274
|
+
var BATCH_START_DELAY_MILLISECONDS = 25;
|
|
15275
|
+
var DEFAULT_BATCH_TIMEOUT_MILLISECONDS = 18e4;
|
|
15229
15276
|
async function batch(tasks, options = {}) {
|
|
15230
15277
|
const {
|
|
15231
15278
|
concurrency = DEFAULT_CONCURRENCY,
|
|
15232
15279
|
retry = true,
|
|
15233
|
-
batchDelay =
|
|
15234
|
-
timeoutMs =
|
|
15280
|
+
batchDelay = BATCH_START_DELAY_MILLISECONDS,
|
|
15281
|
+
timeoutMs = DEFAULT_BATCH_TIMEOUT_MILLISECONDS,
|
|
15235
15282
|
taskTimeoutMs
|
|
15236
15283
|
} = options;
|
|
15237
15284
|
if (concurrency <= 0) {
|
|
@@ -15324,11 +15371,15 @@ var BaseSdkOptionsSchema = z.object({
|
|
|
15324
15371
|
*/
|
|
15325
15372
|
maxNetworkRetries: z.number().optional().describe("Max retries for rate-limited requests (default: 3).").meta({ valueHint: "count" }),
|
|
15326
15373
|
/**
|
|
15327
|
-
* Maximum delay in
|
|
15374
|
+
* Maximum delay in seconds to wait for a rate-limit retry.
|
|
15328
15375
|
* If the server requests a longer delay, the request fails immediately.
|
|
15329
|
-
* Default is
|
|
15376
|
+
* Default is 60 (60 seconds).
|
|
15330
15377
|
*/
|
|
15331
|
-
|
|
15378
|
+
maxNetworkRetryDelaySeconds: z.number().optional().describe(
|
|
15379
|
+
"Max delay in seconds to wait for a rate-limit retry (default: 60)."
|
|
15380
|
+
).meta({ valueHint: "seconds" }),
|
|
15381
|
+
/** @deprecated Use `maxNetworkRetryDelaySeconds` instead. */
|
|
15382
|
+
maxNetworkRetryDelayMs: z.number().optional().describe("Max delay in ms to wait for retry (default: 60000).").meta({ valueHint: "ms", deprecated: true }),
|
|
15332
15383
|
/**
|
|
15333
15384
|
* Maximum number of concurrent in-flight HTTP requests per client.
|
|
15334
15385
|
* Requests beyond this limit queue in FIFO order until a slot frees.
|
|
@@ -15347,7 +15398,9 @@ var BaseSdkOptionsSchema = z.object({
|
|
|
15347
15398
|
]).optional().describe(
|
|
15348
15399
|
`Max concurrent in-flight HTTP requests (default: 200, max: ${MAX_CONCURRENCY_LIMIT}).`
|
|
15349
15400
|
).meta({ valueHint: "count" }),
|
|
15350
|
-
|
|
15401
|
+
approvalTimeoutSeconds: z.number().optional().describe("Timeout in seconds for approval polling. Default: 600 (10 min).").meta({ valueHint: "seconds" }),
|
|
15402
|
+
/** @deprecated Use `approvalTimeoutSeconds` instead. */
|
|
15403
|
+
approvalTimeoutMs: z.number().optional().describe("Timeout in ms for approval polling. Default: 600000 (10 min).").meta({ valueHint: "ms", deprecated: true }),
|
|
15351
15404
|
maxApprovalRetries: z.number().optional().describe(
|
|
15352
15405
|
"Maximum number of sequential approval rounds per request (one per gating policy) before giving up. Default: 2."
|
|
15353
15406
|
),
|
|
@@ -15381,4 +15434,4 @@ var registryPlugin = (_sdk) => {
|
|
|
15381
15434
|
return {};
|
|
15382
15435
|
};
|
|
15383
15436
|
|
|
15384
|
-
export { API_ID, ActionKeyPropertySchema, ActionPropertySchema,
|
|
15437
|
+
export { API_ID, ActionKeyPropertySchema, ActionPropertySchema, ActionTimeoutMillisecondsPropertySchema, ActionTimeoutSecondsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AppPropertySchema, AppsPropertySchema, AuthMechanism, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, CONNECTIONS_ID, CONTEXT, CONTEXT_CACHE_MAX_SIZE, CONTEXT_CACHE_TTL_MILLISECONDS, CORE_ERROR_SYMBOL, CORE_OPTIONS_ID, CORE_SIGNAL_SYMBOL, ClientCredentialsObjectSchema, ConnectionEntrySchema, ConnectionIdPropertySchema, ConnectionPropertySchema, ConnectionsMapSchema, ConnectionsPropertySchema, CoreCancelledSignal, CoreDisposeError, CoreErrorCode, CoreSignal, CredentialsFunctionSchema, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MILLISECONDS, DEFAULT_APPROVAL_TIMEOUT_MILLISECONDS, DEFAULT_CONFIG_PATH, DEFAULT_MAX_APPROVAL_RETRIES, DEFAULT_PAGE_SIZE, DEPRECATION_NOTICE_EVENT, DebugPropertySchema, DrainTriggerInboxSchema, EVENT_EMISSION_ID, FieldsPropertySchema, InputFieldPropertySchema, InputsPropertySchema, LeaseLimitPropertySchema, LeasePropertySchema, LeaseSecondsPropertySchema, LimitPropertySchema, MANIFEST_ID, MAX_CONCURRENCY_LIMIT, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RESOLVE_CREDENTIALS_ID, RecordPropertySchema, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, SDK_OPTIONS_ID, TablePropertySchema, TablesPropertySchema, TriggerInboxKeyPropertySchema, TriggerInboxNamePropertySchema, TriggerInboxPropertySchema, WatchTriggerInboxSchema, ZAPIER_BASE_URL, ZAPIER_MAX_CONCURRENT_REQUESTS, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MILLISECONDS, ZapierAbortDrainSignal, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierApprovalError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierConflictError, ZapierError, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierReleaseTriggerMessageSignal, ZapierResourceNotFoundError, ZapierSignal, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, addPlugin, apiPlugin, apiPluginRef, appKeyResolver, appsPlugin, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, cleanupEventListeners, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, composePlugins, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, connectionsPluginRef, createBaseEvent, createClientCredentialsPlugin, createController, createCorePlugin, createFunction, createMemoryCache, createPaginatedFunction, createPaginatedPluginMethod, createPluginMethod, createPluginStack, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierApi, createZapierSdk, createZapierSdkWithoutRegistry, declareMethod, declareOptionalProperty, declarePlugin, declareProperty, defineFormatter, defineLegacyMerge, defineMethod, defineMethodOverride, definePlugin, defineProperty, defineResolver, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, disposeSdk, durableRunIdResolver, eventEmissionHookPlugin, eventEmissionPlugin, eventEmissionPluginRef, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, fromFunctionPlugin, generateEventId, getActionInputFieldsSchemaPlugin, getActionPlugin, getAgent, getAppPlugin, getBaseUrlFromCredentials, getCallerContext, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getContext, getCoreErrorCause, getCoreErrorCode, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOrCreateApiClient, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getRegistryPlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, getTtyContext, getZapierApprovalMode, getZapierDefaultApprovalMode, getZapierOpenAutoModeApprovalsInBrowser, getZapierSdkService, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCoreCancelledSignal, isCoreError, isCoreSignal, isCredentialsFunction, isCredentialsObject, isPermanentHttpError, isPkceCredentials, isPositional, isZapierAbortDrainSignal, isZapierActionError, isZapierAppNotFoundError, isZapierApprovalError, isZapierAuthenticationError, isZapierBundleError, isZapierConflictError, isZapierError, isZapierNotFoundError, isZapierRateLimitError, isZapierReleaseTriggerMessageSignal, isZapierResourceNotFoundError, isZapierSignal, isZapierTimeoutError, isZapierValidationError, listActionInputFieldChoicesPlugin, listActionInputFieldsPlugin, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listTableFieldsPlugin, listTableRecordsPlugin, listTablesPlugin, logDeprecation2 as logDeprecation, manifestPlugin, manifestPluginRef, omitExports, openEnum, parseConcurrencyEnvVar, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings2 as resetDeprecationWarnings, resolveAuth, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, resolveCredentialsPlugin, resolveCredentialsPluginRef, resolvePlugin, runActionPlugin, runInMethodScope, runWithCallerContext, runWithTelemetryContext, sdkOptionsPluginRef, selectExports, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, triggerInboxResolver, triggerMessagesResolver, updateTableRecordsPlugin, workflowIdResolver, workflowRunIdResolver, workflowVersionIdResolver, zapierAdaptError, zapierCoreOptions, zapierSdkPlugin };
|
package/dist/define.d.mts
CHANGED
|
@@ -3,12 +3,12 @@ export { BuiltinApp } from './apps.mjs';
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
interface ZapierClient {
|
|
6
|
-
fetch(url: string,
|
|
6
|
+
fetch(url: string, init: {
|
|
7
7
|
connection?: string;
|
|
8
8
|
method?: string;
|
|
9
9
|
headers?: Record<string, string>;
|
|
10
10
|
body?: string | Record<string, unknown> | null;
|
|
11
|
-
|
|
11
|
+
maxTimeSeconds?: number;
|
|
12
12
|
}): Promise<Response>;
|
|
13
13
|
}
|
|
14
14
|
interface DefineContext {
|
package/dist/define.d.ts
CHANGED
|
@@ -3,12 +3,12 @@ export { BuiltinApp } from './apps.js';
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
interface ZapierClient {
|
|
6
|
-
fetch(url: string,
|
|
6
|
+
fetch(url: string, init: {
|
|
7
7
|
connection?: string;
|
|
8
8
|
method?: string;
|
|
9
9
|
headers?: Record<string, string>;
|
|
10
10
|
body?: string | Record<string, unknown> | null;
|
|
11
|
-
|
|
11
|
+
maxTimeSeconds?: number;
|
|
12
12
|
}): Promise<Response>;
|
|
13
13
|
}
|
|
14
14
|
interface DefineContext {
|