@trigger.dev/sdk 0.0.0-cross-runtime-20231201165423 → 0.0.0-cross-runtime-20231201170549
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/dist/index.js +17 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -2361,10 +2361,7 @@ function getApiKey(key) {
|
|
|
2361
2361
|
}
|
|
2362
2362
|
__name(getApiKey, "getApiKey");
|
|
2363
2363
|
async function zodfetchWithVersions(versionedSchemaMap, unversionedSchema, url, requestInit, options, retryCount = 0) {
|
|
2364
|
-
const response = await fetch(url,
|
|
2365
|
-
...requestInit,
|
|
2366
|
-
cache: "no-cache"
|
|
2367
|
-
});
|
|
2364
|
+
const response = await fetch(url, requestInitWithCache(requestInit));
|
|
2368
2365
|
if ((!requestInit || requestInit.method === "GET") && response.status === 404 && options?.optional) {
|
|
2369
2366
|
return;
|
|
2370
2367
|
}
|
|
@@ -2398,15 +2395,25 @@ async function zodfetchWithVersions(versionedSchemaMap, unversionedSchema, url,
|
|
|
2398
2395
|
};
|
|
2399
2396
|
}
|
|
2400
2397
|
__name(zodfetchWithVersions, "zodfetchWithVersions");
|
|
2398
|
+
function requestInitWithCache(requestInit) {
|
|
2399
|
+
try {
|
|
2400
|
+
const withCache = {
|
|
2401
|
+
...requestInit,
|
|
2402
|
+
cache: "no-cache"
|
|
2403
|
+
};
|
|
2404
|
+
const _ = new Request("http://localhost", withCache);
|
|
2405
|
+
return withCache;
|
|
2406
|
+
} catch (error) {
|
|
2407
|
+
return requestInit ?? {};
|
|
2408
|
+
}
|
|
2409
|
+
}
|
|
2410
|
+
__name(requestInitWithCache, "requestInitWithCache");
|
|
2401
2411
|
async function fetchHead(url, requestInitWithoutMethod, retryCount = 0) {
|
|
2402
2412
|
const requestInit = {
|
|
2403
2413
|
...requestInitWithoutMethod,
|
|
2404
2414
|
method: "HEAD"
|
|
2405
2415
|
};
|
|
2406
|
-
const response = await fetch(url,
|
|
2407
|
-
...requestInit,
|
|
2408
|
-
cache: "no-cache"
|
|
2409
|
-
});
|
|
2416
|
+
const response = await fetch(url, requestInitWithCache(requestInit));
|
|
2410
2417
|
if (response.status >= 500 && retryCount < 6) {
|
|
2411
2418
|
const delay = exponentialBackoff(retryCount + 1, 2, 50, 1150, 50);
|
|
2412
2419
|
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
@@ -2416,10 +2423,7 @@ async function fetchHead(url, requestInitWithoutMethod, retryCount = 0) {
|
|
|
2416
2423
|
}
|
|
2417
2424
|
__name(fetchHead, "fetchHead");
|
|
2418
2425
|
async function zodfetch(schema, url, requestInit, options, retryCount = 0) {
|
|
2419
|
-
const response = await fetch(url,
|
|
2420
|
-
...requestInit,
|
|
2421
|
-
cache: "no-cache"
|
|
2422
|
-
});
|
|
2426
|
+
const response = await fetch(url, requestInitWithCache(requestInit));
|
|
2423
2427
|
if ((!requestInit || requestInit.method === "GET") && response.status === 404 && options?.optional) {
|
|
2424
2428
|
return;
|
|
2425
2429
|
}
|
|
@@ -3006,7 +3010,7 @@ var DynamicSchedule = _DynamicSchedule;
|
|
|
3006
3010
|
var import_node_events = __toESM(require("node:events"));
|
|
3007
3011
|
|
|
3008
3012
|
// package.json
|
|
3009
|
-
var version = "0.0.0-cross-runtime-
|
|
3013
|
+
var version = "0.0.0-cross-runtime-20231201170549";
|
|
3010
3014
|
|
|
3011
3015
|
// src/concurrencyLimit.ts
|
|
3012
3016
|
var _ConcurrencyLimit = class _ConcurrencyLimit {
|