@zapier/zapier-sdk 0.8.2 → 0.8.3
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 +6 -0
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +1 -2
- package/dist/api/polling.d.ts +36 -6
- package/dist/api/polling.d.ts.map +1 -1
- package/dist/api/polling.js +132 -28
- package/dist/api/polling.test.d.ts +2 -0
- package/dist/api/polling.test.d.ts.map +1 -0
- package/dist/api/polling.test.js +318 -0
- package/dist/api/types.d.ts +1 -2
- package/dist/api/types.d.ts.map +1 -1
- package/dist/index.cjs +144 -34
- package/dist/index.d.mts +1 -2
- package/dist/index.mjs +144 -34
- package/package.json +1 -1
- package/src/api/client.ts +5 -4
- package/src/api/polling.test.ts +405 -0
- package/src/api/polling.ts +224 -44
- package/src/api/types.ts +1 -2
- package/tsconfig.tsbuildinfo +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var zod = require('zod');
|
|
4
4
|
var fs = require('fs');
|
|
5
5
|
var path = require('path');
|
|
6
|
+
var promises = require('timers/promises');
|
|
6
7
|
|
|
7
8
|
// src/types/properties.ts
|
|
8
9
|
function withFormatter(schema, formatMeta) {
|
|
@@ -2277,52 +2278,162 @@ function createDebugFetch(options) {
|
|
|
2277
2278
|
}
|
|
2278
2279
|
};
|
|
2279
2280
|
}
|
|
2280
|
-
|
|
2281
|
-
|
|
2281
|
+
var DEFAULT_TIMEOUT_MS = 18e4;
|
|
2282
|
+
var DEFAULT_SUCCESS_STATUS = 200;
|
|
2283
|
+
var DEFAULT_PENDING_STATUS = 202;
|
|
2284
|
+
var DEFAULT_INITIAL_DELAY_MS = 50;
|
|
2285
|
+
var DEFAULT_MAX_POLLING_INTERVAL_MS = 1e4;
|
|
2286
|
+
var MAX_CONSECUTIVE_ERRORS = 3;
|
|
2287
|
+
var MAX_TIMEOUT_BUFFER_MS = 1e4;
|
|
2288
|
+
var BASE_ERROR_BACKOFF_MS = 1e3;
|
|
2289
|
+
var JITTER_FACTOR = 0.5;
|
|
2290
|
+
var DEFAULT_POLLING_STAGES = [
|
|
2291
|
+
[125, 125],
|
|
2292
|
+
// Up to 125ms: poll every 125ms
|
|
2293
|
+
[375, 250],
|
|
2294
|
+
// Up to 375ms: poll every 250ms
|
|
2295
|
+
[875, 500],
|
|
2296
|
+
// Up to 875ms: poll every 500ms
|
|
2297
|
+
[1e4, 1e3],
|
|
2298
|
+
// Up to 10s: poll every 1s
|
|
2299
|
+
[3e4, 2500],
|
|
2300
|
+
// Up to 30s: poll every 2.5s
|
|
2301
|
+
[6e4, 5e3]
|
|
2302
|
+
// Up to 60s: poll every 5s
|
|
2303
|
+
];
|
|
2304
|
+
var calculateWaitTime = (baseInterval, errorCount) => {
|
|
2305
|
+
const jitter = Math.random() * JITTER_FACTOR * baseInterval;
|
|
2306
|
+
const errorBackoff = Math.min(
|
|
2307
|
+
BASE_ERROR_BACKOFF_MS * (errorCount / 2),
|
|
2308
|
+
baseInterval * 2
|
|
2309
|
+
// Cap error backoff at 2x the base interval
|
|
2310
|
+
);
|
|
2311
|
+
return Math.floor(baseInterval + jitter + errorBackoff);
|
|
2312
|
+
};
|
|
2313
|
+
var processResponse = async (response, successStatus, pendingStatus, resultExtractor, errorCount) => {
|
|
2314
|
+
if (!response.ok) {
|
|
2315
|
+
return {
|
|
2316
|
+
status: "continue" /* Continue */,
|
|
2317
|
+
// If for some reason the status is pending, we don't want to increment the error count
|
|
2318
|
+
errorCount: response.status === pendingStatus ? errorCount : errorCount + 1
|
|
2319
|
+
};
|
|
2320
|
+
}
|
|
2321
|
+
if (response.status === successStatus) {
|
|
2322
|
+
try {
|
|
2323
|
+
const resultJson = await response.json();
|
|
2324
|
+
return {
|
|
2325
|
+
result: resultExtractor(resultJson),
|
|
2326
|
+
status: "success" /* Success */,
|
|
2327
|
+
errorCount: 0
|
|
2328
|
+
};
|
|
2329
|
+
} catch (error) {
|
|
2330
|
+
throw new ZapierApiError(
|
|
2331
|
+
"Result extractor failed to parse successful response as JSON",
|
|
2332
|
+
{
|
|
2333
|
+
statusCode: response.status,
|
|
2334
|
+
cause: error
|
|
2335
|
+
}
|
|
2336
|
+
);
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
if (response.status !== pendingStatus) {
|
|
2340
|
+
throw new ZapierApiError(
|
|
2341
|
+
`Unexpected response status during polling: ${response.status}`,
|
|
2342
|
+
{
|
|
2343
|
+
statusCode: response.status
|
|
2344
|
+
}
|
|
2345
|
+
);
|
|
2346
|
+
}
|
|
2347
|
+
return {
|
|
2348
|
+
status: "continue" /* Continue */,
|
|
2349
|
+
errorCount: 0
|
|
2350
|
+
};
|
|
2351
|
+
};
|
|
2282
2352
|
async function pollUntilComplete(options) {
|
|
2283
2353
|
const {
|
|
2284
2354
|
fetchPoll,
|
|
2285
|
-
|
|
2286
|
-
initialDelay =
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
pendingStatus = 202,
|
|
2355
|
+
timeoutMs = DEFAULT_TIMEOUT_MS,
|
|
2356
|
+
initialDelay = DEFAULT_INITIAL_DELAY_MS,
|
|
2357
|
+
successStatus = DEFAULT_SUCCESS_STATUS,
|
|
2358
|
+
pendingStatus = DEFAULT_PENDING_STATUS,
|
|
2290
2359
|
resultExtractor = (response) => response
|
|
2291
2360
|
} = options;
|
|
2292
|
-
|
|
2361
|
+
if (timeoutMs <= 0) {
|
|
2362
|
+
throw new ZapierValidationError("Timeout must be greater than 0", {
|
|
2363
|
+
details: { timeoutMs }
|
|
2364
|
+
});
|
|
2365
|
+
}
|
|
2366
|
+
if (initialDelay < 0) {
|
|
2367
|
+
throw new ZapierValidationError("Initial delay must be non-negative", {
|
|
2368
|
+
details: { initialDelay }
|
|
2369
|
+
});
|
|
2370
|
+
}
|
|
2371
|
+
const startTime = Date.now();
|
|
2372
|
+
let attempts = 0;
|
|
2293
2373
|
let errorCount = 0;
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2374
|
+
const pollingStages = [
|
|
2375
|
+
...DEFAULT_POLLING_STAGES,
|
|
2376
|
+
[timeoutMs + MAX_TIMEOUT_BUFFER_MS, DEFAULT_MAX_POLLING_INTERVAL_MS]
|
|
2377
|
+
// Up to timeout + 10s: poll every 10s
|
|
2378
|
+
];
|
|
2379
|
+
if (initialDelay > 0) {
|
|
2380
|
+
await promises.setTimeout(initialDelay);
|
|
2381
|
+
}
|
|
2382
|
+
while (true) {
|
|
2383
|
+
attempts++;
|
|
2384
|
+
const elapsedTime = Date.now() - startTime;
|
|
2385
|
+
const pollingInterval = pollingStages.find(
|
|
2386
|
+
([maxTimeForStage, _interval]) => {
|
|
2387
|
+
return elapsedTime < maxTimeForStage;
|
|
2388
|
+
}
|
|
2389
|
+
);
|
|
2390
|
+
if (!pollingInterval) {
|
|
2391
|
+
throw new ZapierTimeoutError(
|
|
2392
|
+
`Operation timed out after ${Math.floor(elapsedTime / 1e3)}s (${attempts} attempts)`,
|
|
2393
|
+
{
|
|
2394
|
+
attempts
|
|
2395
|
+
}
|
|
2396
|
+
);
|
|
2397
|
+
}
|
|
2398
|
+
if (attempts > 1) {
|
|
2399
|
+
const waitTime = calculateWaitTime(pollingInterval[1], errorCount);
|
|
2400
|
+
await promises.setTimeout(waitTime);
|
|
2401
|
+
}
|
|
2402
|
+
try {
|
|
2403
|
+
const response = await fetchPoll();
|
|
2404
|
+
const {
|
|
2405
|
+
result,
|
|
2406
|
+
errorCount: newErrorCount,
|
|
2407
|
+
status
|
|
2408
|
+
} = await processResponse(
|
|
2409
|
+
response,
|
|
2410
|
+
successStatus,
|
|
2411
|
+
pendingStatus,
|
|
2412
|
+
resultExtractor,
|
|
2413
|
+
errorCount
|
|
2414
|
+
);
|
|
2415
|
+
errorCount = newErrorCount;
|
|
2416
|
+
if (status === "success" /* Success */) {
|
|
2417
|
+
return result;
|
|
2418
|
+
}
|
|
2419
|
+
if (errorCount >= MAX_CONSECUTIVE_ERRORS) {
|
|
2310
2420
|
throw new ZapierApiError(
|
|
2311
2421
|
`Poll request failed: ${response.status} ${response.statusText}`,
|
|
2312
2422
|
{ statusCode: response.status }
|
|
2313
2423
|
);
|
|
2314
2424
|
}
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2425
|
+
} catch (error) {
|
|
2426
|
+
errorCount++;
|
|
2427
|
+
if (errorCount >= MAX_CONSECUTIVE_ERRORS) {
|
|
2428
|
+
throw new ZapierApiError(
|
|
2429
|
+
`Failed to poll after ${errorCount} consecutive errors: ${error instanceof Error ? error.message : String(error)}`,
|
|
2430
|
+
{
|
|
2431
|
+
cause: error
|
|
2432
|
+
}
|
|
2433
|
+
);
|
|
2319
2434
|
}
|
|
2320
2435
|
}
|
|
2321
2436
|
}
|
|
2322
|
-
throw new ZapierTimeoutError(
|
|
2323
|
-
`Operation timed out after ${maxAttempts} attempts`,
|
|
2324
|
-
{ attempts: maxAttempts, maxAttempts }
|
|
2325
|
-
);
|
|
2326
2437
|
}
|
|
2327
2438
|
|
|
2328
2439
|
// src/auth.ts
|
|
@@ -2377,9 +2488,8 @@ var ZapierApiClient = class {
|
|
|
2377
2488
|
searchParams: options.searchParams,
|
|
2378
2489
|
authRequired: options.authRequired
|
|
2379
2490
|
}),
|
|
2380
|
-
maxAttempts: options.maxAttempts,
|
|
2381
2491
|
initialDelay: options.initialDelay,
|
|
2382
|
-
|
|
2492
|
+
timeoutMs: options.timeoutMs,
|
|
2383
2493
|
successStatus: options.successStatus,
|
|
2384
2494
|
pendingStatus: options.pendingStatus,
|
|
2385
2495
|
resultExtractor: options.resultExtractor
|
package/dist/index.d.mts
CHANGED
|
@@ -1841,9 +1841,8 @@ interface RequestOptions {
|
|
|
1841
1841
|
}) => Error | undefined;
|
|
1842
1842
|
}
|
|
1843
1843
|
interface PollOptions extends RequestOptions {
|
|
1844
|
-
maxAttempts?: number;
|
|
1845
1844
|
initialDelay?: number;
|
|
1846
|
-
|
|
1845
|
+
timeoutMs?: number;
|
|
1847
1846
|
successStatus?: number;
|
|
1848
1847
|
pendingStatus?: number;
|
|
1849
1848
|
resultExtractor?: (response: unknown) => unknown;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { readFileSync, existsSync, writeFileSync } from 'fs';
|
|
3
3
|
import { resolve } from 'path';
|
|
4
|
+
import { setTimeout } from 'timers/promises';
|
|
4
5
|
|
|
5
6
|
// src/types/properties.ts
|
|
6
7
|
function withFormatter(schema, formatMeta) {
|
|
@@ -2275,52 +2276,162 @@ function createDebugFetch(options) {
|
|
|
2275
2276
|
}
|
|
2276
2277
|
};
|
|
2277
2278
|
}
|
|
2278
|
-
|
|
2279
|
-
|
|
2279
|
+
var DEFAULT_TIMEOUT_MS = 18e4;
|
|
2280
|
+
var DEFAULT_SUCCESS_STATUS = 200;
|
|
2281
|
+
var DEFAULT_PENDING_STATUS = 202;
|
|
2282
|
+
var DEFAULT_INITIAL_DELAY_MS = 50;
|
|
2283
|
+
var DEFAULT_MAX_POLLING_INTERVAL_MS = 1e4;
|
|
2284
|
+
var MAX_CONSECUTIVE_ERRORS = 3;
|
|
2285
|
+
var MAX_TIMEOUT_BUFFER_MS = 1e4;
|
|
2286
|
+
var BASE_ERROR_BACKOFF_MS = 1e3;
|
|
2287
|
+
var JITTER_FACTOR = 0.5;
|
|
2288
|
+
var DEFAULT_POLLING_STAGES = [
|
|
2289
|
+
[125, 125],
|
|
2290
|
+
// Up to 125ms: poll every 125ms
|
|
2291
|
+
[375, 250],
|
|
2292
|
+
// Up to 375ms: poll every 250ms
|
|
2293
|
+
[875, 500],
|
|
2294
|
+
// Up to 875ms: poll every 500ms
|
|
2295
|
+
[1e4, 1e3],
|
|
2296
|
+
// Up to 10s: poll every 1s
|
|
2297
|
+
[3e4, 2500],
|
|
2298
|
+
// Up to 30s: poll every 2.5s
|
|
2299
|
+
[6e4, 5e3]
|
|
2300
|
+
// Up to 60s: poll every 5s
|
|
2301
|
+
];
|
|
2302
|
+
var calculateWaitTime = (baseInterval, errorCount) => {
|
|
2303
|
+
const jitter = Math.random() * JITTER_FACTOR * baseInterval;
|
|
2304
|
+
const errorBackoff = Math.min(
|
|
2305
|
+
BASE_ERROR_BACKOFF_MS * (errorCount / 2),
|
|
2306
|
+
baseInterval * 2
|
|
2307
|
+
// Cap error backoff at 2x the base interval
|
|
2308
|
+
);
|
|
2309
|
+
return Math.floor(baseInterval + jitter + errorBackoff);
|
|
2310
|
+
};
|
|
2311
|
+
var processResponse = async (response, successStatus, pendingStatus, resultExtractor, errorCount) => {
|
|
2312
|
+
if (!response.ok) {
|
|
2313
|
+
return {
|
|
2314
|
+
status: "continue" /* Continue */,
|
|
2315
|
+
// If for some reason the status is pending, we don't want to increment the error count
|
|
2316
|
+
errorCount: response.status === pendingStatus ? errorCount : errorCount + 1
|
|
2317
|
+
};
|
|
2318
|
+
}
|
|
2319
|
+
if (response.status === successStatus) {
|
|
2320
|
+
try {
|
|
2321
|
+
const resultJson = await response.json();
|
|
2322
|
+
return {
|
|
2323
|
+
result: resultExtractor(resultJson),
|
|
2324
|
+
status: "success" /* Success */,
|
|
2325
|
+
errorCount: 0
|
|
2326
|
+
};
|
|
2327
|
+
} catch (error) {
|
|
2328
|
+
throw new ZapierApiError(
|
|
2329
|
+
"Result extractor failed to parse successful response as JSON",
|
|
2330
|
+
{
|
|
2331
|
+
statusCode: response.status,
|
|
2332
|
+
cause: error
|
|
2333
|
+
}
|
|
2334
|
+
);
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
2337
|
+
if (response.status !== pendingStatus) {
|
|
2338
|
+
throw new ZapierApiError(
|
|
2339
|
+
`Unexpected response status during polling: ${response.status}`,
|
|
2340
|
+
{
|
|
2341
|
+
statusCode: response.status
|
|
2342
|
+
}
|
|
2343
|
+
);
|
|
2344
|
+
}
|
|
2345
|
+
return {
|
|
2346
|
+
status: "continue" /* Continue */,
|
|
2347
|
+
errorCount: 0
|
|
2348
|
+
};
|
|
2349
|
+
};
|
|
2280
2350
|
async function pollUntilComplete(options) {
|
|
2281
2351
|
const {
|
|
2282
2352
|
fetchPoll,
|
|
2283
|
-
|
|
2284
|
-
initialDelay =
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
pendingStatus = 202,
|
|
2353
|
+
timeoutMs = DEFAULT_TIMEOUT_MS,
|
|
2354
|
+
initialDelay = DEFAULT_INITIAL_DELAY_MS,
|
|
2355
|
+
successStatus = DEFAULT_SUCCESS_STATUS,
|
|
2356
|
+
pendingStatus = DEFAULT_PENDING_STATUS,
|
|
2288
2357
|
resultExtractor = (response) => response
|
|
2289
2358
|
} = options;
|
|
2290
|
-
|
|
2359
|
+
if (timeoutMs <= 0) {
|
|
2360
|
+
throw new ZapierValidationError("Timeout must be greater than 0", {
|
|
2361
|
+
details: { timeoutMs }
|
|
2362
|
+
});
|
|
2363
|
+
}
|
|
2364
|
+
if (initialDelay < 0) {
|
|
2365
|
+
throw new ZapierValidationError("Initial delay must be non-negative", {
|
|
2366
|
+
details: { initialDelay }
|
|
2367
|
+
});
|
|
2368
|
+
}
|
|
2369
|
+
const startTime = Date.now();
|
|
2370
|
+
let attempts = 0;
|
|
2291
2371
|
let errorCount = 0;
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2372
|
+
const pollingStages = [
|
|
2373
|
+
...DEFAULT_POLLING_STAGES,
|
|
2374
|
+
[timeoutMs + MAX_TIMEOUT_BUFFER_MS, DEFAULT_MAX_POLLING_INTERVAL_MS]
|
|
2375
|
+
// Up to timeout + 10s: poll every 10s
|
|
2376
|
+
];
|
|
2377
|
+
if (initialDelay > 0) {
|
|
2378
|
+
await setTimeout(initialDelay);
|
|
2379
|
+
}
|
|
2380
|
+
while (true) {
|
|
2381
|
+
attempts++;
|
|
2382
|
+
const elapsedTime = Date.now() - startTime;
|
|
2383
|
+
const pollingInterval = pollingStages.find(
|
|
2384
|
+
([maxTimeForStage, _interval]) => {
|
|
2385
|
+
return elapsedTime < maxTimeForStage;
|
|
2386
|
+
}
|
|
2387
|
+
);
|
|
2388
|
+
if (!pollingInterval) {
|
|
2389
|
+
throw new ZapierTimeoutError(
|
|
2390
|
+
`Operation timed out after ${Math.floor(elapsedTime / 1e3)}s (${attempts} attempts)`,
|
|
2391
|
+
{
|
|
2392
|
+
attempts
|
|
2393
|
+
}
|
|
2394
|
+
);
|
|
2395
|
+
}
|
|
2396
|
+
if (attempts > 1) {
|
|
2397
|
+
const waitTime = calculateWaitTime(pollingInterval[1], errorCount);
|
|
2398
|
+
await setTimeout(waitTime);
|
|
2399
|
+
}
|
|
2400
|
+
try {
|
|
2401
|
+
const response = await fetchPoll();
|
|
2402
|
+
const {
|
|
2403
|
+
result,
|
|
2404
|
+
errorCount: newErrorCount,
|
|
2405
|
+
status
|
|
2406
|
+
} = await processResponse(
|
|
2407
|
+
response,
|
|
2408
|
+
successStatus,
|
|
2409
|
+
pendingStatus,
|
|
2410
|
+
resultExtractor,
|
|
2411
|
+
errorCount
|
|
2412
|
+
);
|
|
2413
|
+
errorCount = newErrorCount;
|
|
2414
|
+
if (status === "success" /* Success */) {
|
|
2415
|
+
return result;
|
|
2416
|
+
}
|
|
2417
|
+
if (errorCount >= MAX_CONSECUTIVE_ERRORS) {
|
|
2308
2418
|
throw new ZapierApiError(
|
|
2309
2419
|
`Poll request failed: ${response.status} ${response.statusText}`,
|
|
2310
2420
|
{ statusCode: response.status }
|
|
2311
2421
|
);
|
|
2312
2422
|
}
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2423
|
+
} catch (error) {
|
|
2424
|
+
errorCount++;
|
|
2425
|
+
if (errorCount >= MAX_CONSECUTIVE_ERRORS) {
|
|
2426
|
+
throw new ZapierApiError(
|
|
2427
|
+
`Failed to poll after ${errorCount} consecutive errors: ${error instanceof Error ? error.message : String(error)}`,
|
|
2428
|
+
{
|
|
2429
|
+
cause: error
|
|
2430
|
+
}
|
|
2431
|
+
);
|
|
2317
2432
|
}
|
|
2318
2433
|
}
|
|
2319
2434
|
}
|
|
2320
|
-
throw new ZapierTimeoutError(
|
|
2321
|
-
`Operation timed out after ${maxAttempts} attempts`,
|
|
2322
|
-
{ attempts: maxAttempts, maxAttempts }
|
|
2323
|
-
);
|
|
2324
2435
|
}
|
|
2325
2436
|
|
|
2326
2437
|
// src/auth.ts
|
|
@@ -2375,9 +2486,8 @@ var ZapierApiClient = class {
|
|
|
2375
2486
|
searchParams: options.searchParams,
|
|
2376
2487
|
authRequired: options.authRequired
|
|
2377
2488
|
}),
|
|
2378
|
-
maxAttempts: options.maxAttempts,
|
|
2379
2489
|
initialDelay: options.initialDelay,
|
|
2380
|
-
|
|
2490
|
+
timeoutMs: options.timeoutMs,
|
|
2381
2491
|
successStatus: options.successStatus,
|
|
2382
2492
|
pendingStatus: options.pendingStatus,
|
|
2383
2493
|
resultExtractor: options.resultExtractor
|
package/package.json
CHANGED
package/src/api/client.ts
CHANGED
|
@@ -437,19 +437,20 @@ class ZapierApiClient implements ApiClient {
|
|
|
437
437
|
path: string,
|
|
438
438
|
options: PollOptions = {},
|
|
439
439
|
): Promise<TOutput> => {
|
|
440
|
-
return pollUntilComplete({
|
|
440
|
+
return pollUntilComplete<TOutput>({
|
|
441
441
|
fetchPoll: () =>
|
|
442
442
|
this.plainFetch(path, {
|
|
443
443
|
method: "GET",
|
|
444
444
|
searchParams: options.searchParams,
|
|
445
445
|
authRequired: options.authRequired,
|
|
446
446
|
}),
|
|
447
|
-
maxAttempts: options.maxAttempts,
|
|
448
447
|
initialDelay: options.initialDelay,
|
|
449
|
-
|
|
448
|
+
timeoutMs: options.timeoutMs,
|
|
450
449
|
successStatus: options.successStatus,
|
|
451
450
|
pendingStatus: options.pendingStatus,
|
|
452
|
-
resultExtractor: options.resultExtractor
|
|
451
|
+
resultExtractor: options.resultExtractor as
|
|
452
|
+
| ((response: unknown) => TOutput)
|
|
453
|
+
| undefined,
|
|
453
454
|
});
|
|
454
455
|
};
|
|
455
456
|
}
|