@workflow/web 5.3.2 → 5.4.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/build/client/assets/app-Czi_mceE.css +1 -0
- package/build/client/assets/arrow-up-right-74VYxbbA.js +9 -0
- package/build/client/assets/{entry.client-xzxVCL3o.js → entry.client-BqbaswKw.js} +13 -35
- package/build/client/assets/{highlighted-body-JLMTFACH-1yzOVKg0.js → highlighted-body-JLMTFACH-D51eQJbG.js} +2 -2
- package/build/client/assets/{home--wf0CrF6.js → home-DLo3pUJ2.js} +104 -167
- package/build/client/assets/{index-wl5l5E8H.js → index-BUQuaV5X.js} +78 -149
- package/build/client/assets/{manifest-7b81d8d4.js → manifest-67b853ed.js} +1 -1
- package/build/client/assets/mermaid-WFAXDIZX-Bd_l_owX.css +1 -0
- package/build/client/assets/{mermaid-WFAXDIZX-CB__BxYb.js → mermaid-WFAXDIZX-CCgeQ0jh.js} +2044 -2169
- package/build/client/assets/{root-C1XwTNUK.js → root-D8difEo9.js} +8 -33
- package/build/client/assets/root-d42YLYYg.css +1 -0
- package/build/client/assets/{rpc-client-SbyXJdFV.js → rpc-client-DL_nSX36.js} +3 -4
- package/build/client/assets/{run-detail-2CnpdXm1.js → run-detail-DcpR_rST.js} +234 -445
- package/build/client/assets/run-detail-DmVxTs86.css +1 -0
- package/build/client/assets/{run-usage-C3aywyqa.js → run-usage-0JrO5fG2.js} +5 -5
- package/build/client/assets/{run-usage-DRV6lopZ.js → run-usage-CK_ia-7k.js} +36 -53
- package/build/client/assets/{skeleton-DMLgjvZZ.js → skeleton-B2Cf2UXN.js} +3 -21
- package/build/client/assets/{url-state-JAVaNZ_m.js → url-state-n9DuWtVx.js} +521 -779
- package/build/client/assets/{zstd-browser-decoder-Z5736ep5.js → zstd-browser-decoder-CqZHDp17.js} +2 -2
- package/build/server/assets/{app-C4Vf0mu1.js → app-DLSid73Q.js} +13263 -14020
- package/build/server/assets/{esm-CETb4fkq.js → esm-BzrGWk7J.js} +2 -2
- package/build/server/assets/{highlighted-body-JLMTFACH-CF_5tt3-.js → highlighted-body-JLMTFACH-CtQ_zvjG.js} +1 -1
- package/build/server/assets/{index-BrYeW--s.js → index-BI8sdTIq.js} +398 -490
- package/build/server/assets/{mermaid-WFAXDIZX-BHZz_uL6.js → mermaid-WFAXDIZX-BlWV_MqD.js} +1 -1
- package/build/server/assets/{token-k0na1G9v.js → token-BE7-D9Dt.js} +6 -6
- package/build/server/assets/{token-B94O3LuJ.js → token-DOXFZxpM.js} +5 -5
- package/build/server/assets/{token-util-DFlzY9Hw.js → token-util-DjnKfD7P.js} +2 -2
- package/build/server/assets/{token-util-DgTmPzWb.js → token-util-V29s95lj.js} +1 -1
- package/build/server/assets/{wrapper-BEqyNEir.js → wrapper-DBwRVVUb.js} +2 -2
- package/build/server/assets/{zstd-browser-decoder-LnaKiDUZ.js → zstd-browser-decoder-Crq3t_fM.js} +1 -1
- package/build/server/index.js +1 -1
- package/package.json +8 -8
- package/build/client/assets/app-BHCSMHev.css +0 -1
- package/build/client/assets/arrow-up-right-DyaB_ak4.js +0 -15
- package/build/client/assets/mermaid-WFAXDIZX-D8CjRQta.css +0 -1
- package/build/client/assets/root-C3ED6Dwc.css +0 -1
- package/build/client/assets/run-detail-CWoGxu_0.css +0 -1
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
1
|
import { createRequire as __wkfCreateRequire } from "node:module";
|
|
5
2
|
if (typeof require === "undefined") {
|
|
6
3
|
globalThis.require = __wkfCreateRequire(import.meta.url);
|
|
@@ -16,7 +13,7 @@ import path__default from "path";
|
|
|
16
13
|
import require$$0__default from "fs";
|
|
17
14
|
import path from "node:path";
|
|
18
15
|
import require$$0$4 from "child_process";
|
|
19
|
-
import { l as commonjsGlobal } from "./app-
|
|
16
|
+
import { l as commonjsGlobal } from "./app-DLSid73Q.js";
|
|
20
17
|
import require$$0$5 from "os";
|
|
21
18
|
import require$$0$7 from "assert";
|
|
22
19
|
import require$$0$6 from "events";
|
|
@@ -47,23 +44,23 @@ var hasRequiredHeaders;
|
|
|
47
44
|
function requireHeaders() {
|
|
48
45
|
if (hasRequiredHeaders) return headers;
|
|
49
46
|
hasRequiredHeaders = 1;
|
|
50
|
-
var
|
|
47
|
+
var __defProp = Object.defineProperty;
|
|
51
48
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
52
49
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
53
50
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
54
51
|
var __export = (target, all) => {
|
|
55
52
|
for (var name in all)
|
|
56
|
-
|
|
53
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
57
54
|
};
|
|
58
55
|
var __copyProps = (to, from, except, desc) => {
|
|
59
56
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
60
57
|
for (let key of __getOwnPropNames(from))
|
|
61
58
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
62
|
-
|
|
59
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
63
60
|
}
|
|
64
61
|
return to;
|
|
65
62
|
};
|
|
66
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
63
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
67
64
|
var headers_exports = {};
|
|
68
65
|
__export(headers_exports, {
|
|
69
66
|
CITY_HEADER_NAME: () => CITY_HEADER_NAME,
|
|
@@ -92,8 +89,7 @@ function requireHeaders() {
|
|
|
92
89
|
return headers2.get(key) ?? void 0;
|
|
93
90
|
}
|
|
94
91
|
function hasRequestHeaders(input) {
|
|
95
|
-
|
|
96
|
-
return "headers" in input && typeof ((_a = input.headers) == null ? void 0 : _a.get) === "function";
|
|
92
|
+
return "headers" in input && typeof input.headers?.get === "function";
|
|
97
93
|
}
|
|
98
94
|
function getHeaderWithDecode(request, key) {
|
|
99
95
|
const header = getHeader(request.headers, key);
|
|
@@ -139,23 +135,23 @@ var hasRequiredGetEnv;
|
|
|
139
135
|
function requireGetEnv() {
|
|
140
136
|
if (hasRequiredGetEnv) return getEnv_1;
|
|
141
137
|
hasRequiredGetEnv = 1;
|
|
142
|
-
var
|
|
138
|
+
var __defProp = Object.defineProperty;
|
|
143
139
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
144
140
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
145
141
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
146
142
|
var __export = (target, all) => {
|
|
147
143
|
for (var name in all)
|
|
148
|
-
|
|
144
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
149
145
|
};
|
|
150
146
|
var __copyProps = (to, from, except, desc) => {
|
|
151
147
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
152
148
|
for (let key of __getOwnPropNames(from))
|
|
153
149
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
154
|
-
|
|
150
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
155
151
|
}
|
|
156
152
|
return to;
|
|
157
153
|
};
|
|
158
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
154
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
159
155
|
var get_env_exports = {};
|
|
160
156
|
__export(get_env_exports, {
|
|
161
157
|
getEnv: () => getEnv
|
|
@@ -303,34 +299,33 @@ var hasRequiredGetContext$1;
|
|
|
303
299
|
function requireGetContext$1() {
|
|
304
300
|
if (hasRequiredGetContext$1) return getContext_1$1;
|
|
305
301
|
hasRequiredGetContext$1 = 1;
|
|
306
|
-
var
|
|
302
|
+
var __defProp = Object.defineProperty;
|
|
307
303
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
308
304
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
309
305
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
310
306
|
var __export = (target, all) => {
|
|
311
307
|
for (var name in all)
|
|
312
|
-
|
|
308
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
313
309
|
};
|
|
314
310
|
var __copyProps = (to, from, except, desc) => {
|
|
315
311
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
316
312
|
for (let key of __getOwnPropNames(from))
|
|
317
313
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
318
|
-
|
|
314
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
319
315
|
}
|
|
320
316
|
return to;
|
|
321
317
|
};
|
|
322
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
318
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
323
319
|
var get_context_exports = {};
|
|
324
320
|
__export(get_context_exports, {
|
|
325
321
|
SYMBOL_FOR_REQ_CONTEXT: () => SYMBOL_FOR_REQ_CONTEXT,
|
|
326
322
|
getContext: () => getContext
|
|
327
323
|
});
|
|
328
324
|
getContext_1$1 = __toCommonJS(get_context_exports);
|
|
329
|
-
const SYMBOL_FOR_REQ_CONTEXT = Symbol.for("@vercel/request-context");
|
|
325
|
+
const SYMBOL_FOR_REQ_CONTEXT = /* @__PURE__ */ Symbol.for("@vercel/request-context");
|
|
330
326
|
function getContext() {
|
|
331
|
-
var _a, _b;
|
|
332
327
|
const fromSymbol = globalThis;
|
|
333
|
-
return
|
|
328
|
+
return fromSymbol[SYMBOL_FOR_REQ_CONTEXT]?.get?.() ?? {};
|
|
334
329
|
}
|
|
335
330
|
return getContext_1$1;
|
|
336
331
|
}
|
|
@@ -339,23 +334,23 @@ var hasRequiredDeadline;
|
|
|
339
334
|
function requireDeadline() {
|
|
340
335
|
if (hasRequiredDeadline) return deadline;
|
|
341
336
|
hasRequiredDeadline = 1;
|
|
342
|
-
var
|
|
337
|
+
var __defProp = Object.defineProperty;
|
|
343
338
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
344
339
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
345
340
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
346
341
|
var __export = (target, all) => {
|
|
347
342
|
for (var name in all)
|
|
348
|
-
|
|
343
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
349
344
|
};
|
|
350
345
|
var __copyProps = (to, from, except, desc) => {
|
|
351
346
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
352
347
|
for (let key of __getOwnPropNames(from))
|
|
353
348
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
354
|
-
|
|
349
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
355
350
|
}
|
|
356
351
|
return to;
|
|
357
352
|
};
|
|
358
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
353
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
359
354
|
var deadline_exports = {};
|
|
360
355
|
__export(deadline_exports, {
|
|
361
356
|
getDeadline: () => getDeadline
|
|
@@ -380,23 +375,23 @@ var hasRequiredWaitUntil;
|
|
|
380
375
|
function requireWaitUntil() {
|
|
381
376
|
if (hasRequiredWaitUntil) return waitUntil_1;
|
|
382
377
|
hasRequiredWaitUntil = 1;
|
|
383
|
-
var
|
|
378
|
+
var __defProp = Object.defineProperty;
|
|
384
379
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
385
380
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
386
381
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
387
382
|
var __export = (target, all) => {
|
|
388
383
|
for (var name in all)
|
|
389
|
-
|
|
384
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
390
385
|
};
|
|
391
386
|
var __copyProps = (to, from, except, desc) => {
|
|
392
387
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
393
388
|
for (let key of __getOwnPropNames(from))
|
|
394
389
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
395
|
-
|
|
390
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
396
391
|
}
|
|
397
392
|
return to;
|
|
398
393
|
};
|
|
399
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
394
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
400
395
|
var wait_until_exports = {};
|
|
401
396
|
__export(wait_until_exports, {
|
|
402
397
|
waitUntil: () => waitUntil
|
|
@@ -404,13 +399,12 @@ function requireWaitUntil() {
|
|
|
404
399
|
waitUntil_1 = __toCommonJS(wait_until_exports);
|
|
405
400
|
var import_get_context = requireGetContext$1();
|
|
406
401
|
const waitUntil = (promise2) => {
|
|
407
|
-
var _a, _b;
|
|
408
402
|
if (promise2 === null || typeof promise2 !== "object" || typeof promise2.then !== "function") {
|
|
409
403
|
throw new TypeError(
|
|
410
404
|
`waitUntil can only be called with a Promise, got ${typeof promise2}`
|
|
411
405
|
);
|
|
412
406
|
}
|
|
413
|
-
return (
|
|
407
|
+
return (0, import_get_context.getContext)().waitUntil?.(promise2);
|
|
414
408
|
};
|
|
415
409
|
return waitUntil_1;
|
|
416
410
|
}
|
|
@@ -419,33 +413,32 @@ var hasRequiredMetric;
|
|
|
419
413
|
function requireMetric() {
|
|
420
414
|
if (hasRequiredMetric) return metric_1;
|
|
421
415
|
hasRequiredMetric = 1;
|
|
422
|
-
var
|
|
416
|
+
var __defProp = Object.defineProperty;
|
|
423
417
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
424
418
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
425
419
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
426
420
|
var __export = (target, all) => {
|
|
427
421
|
for (var name in all)
|
|
428
|
-
|
|
422
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
429
423
|
};
|
|
430
424
|
var __copyProps = (to, from, except, desc) => {
|
|
431
425
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
432
426
|
for (let key of __getOwnPropNames(from))
|
|
433
427
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
434
|
-
|
|
428
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
435
429
|
}
|
|
436
430
|
return to;
|
|
437
431
|
};
|
|
438
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
432
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
439
433
|
var metric_exports = {};
|
|
440
434
|
__export(metric_exports, {
|
|
441
435
|
metric: () => metric
|
|
442
436
|
});
|
|
443
437
|
metric_1 = __toCommonJS(metric_exports);
|
|
444
|
-
const RUSTY_RUNTIME_IPC_SYMBOL = Symbol.for("@vercel/rusty-runtime-ipc");
|
|
438
|
+
const RUSTY_RUNTIME_IPC_SYMBOL = /* @__PURE__ */ Symbol.for("@vercel/rusty-runtime-ipc");
|
|
445
439
|
function metric(name, value, tags) {
|
|
446
|
-
var _a;
|
|
447
440
|
const ipc = globalThis[RUSTY_RUNTIME_IPC_SYMBOL];
|
|
448
|
-
|
|
441
|
+
ipc?.sendMetric?.(name, value, tags);
|
|
449
442
|
}
|
|
450
443
|
return metric_1;
|
|
451
444
|
}
|
|
@@ -454,23 +447,23 @@ var hasRequiredMiddleware;
|
|
|
454
447
|
function requireMiddleware() {
|
|
455
448
|
if (hasRequiredMiddleware) return middleware;
|
|
456
449
|
hasRequiredMiddleware = 1;
|
|
457
|
-
var
|
|
450
|
+
var __defProp = Object.defineProperty;
|
|
458
451
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
459
452
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
460
453
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
461
454
|
var __export = (target, all) => {
|
|
462
455
|
for (var name in all)
|
|
463
|
-
|
|
456
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
464
457
|
};
|
|
465
458
|
var __copyProps = (to, from, except, desc) => {
|
|
466
459
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
467
460
|
for (let key of __getOwnPropNames(from))
|
|
468
461
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
469
|
-
|
|
462
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
470
463
|
}
|
|
471
464
|
return to;
|
|
472
465
|
};
|
|
473
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
466
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
474
467
|
var middleware_exports = {};
|
|
475
468
|
__export(middleware_exports, {
|
|
476
469
|
next: () => next,
|
|
@@ -478,8 +471,7 @@ function requireMiddleware() {
|
|
|
478
471
|
});
|
|
479
472
|
middleware = __toCommonJS(middleware_exports);
|
|
480
473
|
function handleMiddlewareField(init, headers2) {
|
|
481
|
-
|
|
482
|
-
if ((_a = init == null ? void 0 : init.request) == null ? void 0 : _a.headers) {
|
|
474
|
+
if (init?.request?.headers) {
|
|
483
475
|
if (!(init.request.headers instanceof Headers)) {
|
|
484
476
|
throw new Error("request.headers must be an instance of Headers");
|
|
485
477
|
}
|
|
@@ -492,7 +484,7 @@ function requireMiddleware() {
|
|
|
492
484
|
}
|
|
493
485
|
}
|
|
494
486
|
function rewrite(destination, init) {
|
|
495
|
-
const headers2 = new Headers(
|
|
487
|
+
const headers2 = new Headers(init?.headers ?? {});
|
|
496
488
|
headers2.set("x-middleware-rewrite", String(destination));
|
|
497
489
|
handleMiddlewareField(init, headers2);
|
|
498
490
|
return new Response(null, {
|
|
@@ -501,7 +493,7 @@ function requireMiddleware() {
|
|
|
501
493
|
});
|
|
502
494
|
}
|
|
503
495
|
function next(init) {
|
|
504
|
-
const headers2 = new Headers(
|
|
496
|
+
const headers2 = new Headers(init?.headers ?? {});
|
|
505
497
|
headers2.set("x-middleware-next", "1");
|
|
506
498
|
handleMiddlewareField(init, headers2);
|
|
507
499
|
return new Response(null, {
|
|
@@ -516,23 +508,23 @@ var hasRequiredInMemoryCache;
|
|
|
516
508
|
function requireInMemoryCache() {
|
|
517
509
|
if (hasRequiredInMemoryCache) return inMemoryCache;
|
|
518
510
|
hasRequiredInMemoryCache = 1;
|
|
519
|
-
var
|
|
511
|
+
var __defProp = Object.defineProperty;
|
|
520
512
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
521
513
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
522
514
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
523
515
|
var __export = (target, all) => {
|
|
524
516
|
for (var name in all)
|
|
525
|
-
|
|
517
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
526
518
|
};
|
|
527
519
|
var __copyProps = (to, from, except, desc) => {
|
|
528
520
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
529
521
|
for (let key of __getOwnPropNames(from))
|
|
530
522
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
531
|
-
|
|
523
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
532
524
|
}
|
|
533
525
|
return to;
|
|
534
526
|
};
|
|
535
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
527
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
536
528
|
var in_memory_cache_exports = {};
|
|
537
529
|
__export(in_memory_cache_exports, {
|
|
538
530
|
InMemoryCache: () => InMemoryCache
|
|
@@ -558,8 +550,8 @@ function requireInMemoryCache() {
|
|
|
558
550
|
this.cache[key] = {
|
|
559
551
|
value: serialized,
|
|
560
552
|
lastModified: Date.now(),
|
|
561
|
-
ttl: options
|
|
562
|
-
tags: new Set(
|
|
553
|
+
ttl: options?.ttl,
|
|
554
|
+
tags: new Set(options?.tags || [])
|
|
563
555
|
};
|
|
564
556
|
}
|
|
565
557
|
async delete(key) {
|
|
@@ -584,23 +576,23 @@ var hasRequiredBuildClient;
|
|
|
584
576
|
function requireBuildClient() {
|
|
585
577
|
if (hasRequiredBuildClient) return buildClient;
|
|
586
578
|
hasRequiredBuildClient = 1;
|
|
587
|
-
var
|
|
579
|
+
var __defProp = Object.defineProperty;
|
|
588
580
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
589
581
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
590
582
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
591
583
|
var __export = (target, all) => {
|
|
592
584
|
for (var name in all)
|
|
593
|
-
|
|
585
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
594
586
|
};
|
|
595
587
|
var __copyProps = (to, from, except, desc) => {
|
|
596
588
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
597
589
|
for (let key of __getOwnPropNames(from))
|
|
598
590
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
599
|
-
|
|
591
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
600
592
|
}
|
|
601
593
|
return to;
|
|
602
594
|
};
|
|
603
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
595
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
604
596
|
var build_client_exports = {};
|
|
605
597
|
__export(build_client_exports, {
|
|
606
598
|
BuildCache: () => BuildCache
|
|
@@ -615,7 +607,6 @@ function requireBuildClient() {
|
|
|
615
607
|
timeout = 500
|
|
616
608
|
}) {
|
|
617
609
|
this.get = async (key) => {
|
|
618
|
-
var _a, _b, _c, _d;
|
|
619
610
|
const controller = new AbortController();
|
|
620
611
|
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
621
612
|
try {
|
|
@@ -633,7 +624,7 @@ function requireBuildClient() {
|
|
|
633
624
|
import_index.HEADERS_VERCEL_CACHE_STATE
|
|
634
625
|
);
|
|
635
626
|
if (cacheState !== import_index.PkgCacheState.Fresh) {
|
|
636
|
-
|
|
627
|
+
res.body?.cancel?.();
|
|
637
628
|
clearTimeout(timeoutId);
|
|
638
629
|
return null;
|
|
639
630
|
}
|
|
@@ -651,26 +642,25 @@ function requireBuildClient() {
|
|
|
651
642
|
`Cache request timed out after ${this.timeout}ms`
|
|
652
643
|
);
|
|
653
644
|
timeoutError.stack = error2.stack;
|
|
654
|
-
|
|
645
|
+
this.onError?.(timeoutError);
|
|
655
646
|
} else {
|
|
656
|
-
|
|
647
|
+
this.onError?.(error2);
|
|
657
648
|
}
|
|
658
649
|
return null;
|
|
659
650
|
}
|
|
660
651
|
};
|
|
661
652
|
this.set = async (key, value, options) => {
|
|
662
|
-
var _a, _b;
|
|
663
653
|
const controller = new AbortController();
|
|
664
654
|
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
665
655
|
try {
|
|
666
656
|
const optionalHeaders = {};
|
|
667
|
-
if (options
|
|
657
|
+
if (options?.ttl) {
|
|
668
658
|
optionalHeaders[import_index.HEADERS_VERCEL_REVALIDATE] = options.ttl.toString();
|
|
669
659
|
}
|
|
670
|
-
if (
|
|
660
|
+
if (options?.tags && options.tags.length > 0) {
|
|
671
661
|
optionalHeaders[import_index.HEADERS_VERCEL_CACHE_TAGS] = options.tags.join(",");
|
|
672
662
|
}
|
|
673
|
-
if (options
|
|
663
|
+
if (options?.name) {
|
|
674
664
|
optionalHeaders[import_index.HEADERS_VERCEL_CACHE_ITEM_NAME] = options.name;
|
|
675
665
|
}
|
|
676
666
|
const res = await fetch(`${this.endpoint}${key}`, {
|
|
@@ -693,14 +683,13 @@ function requireBuildClient() {
|
|
|
693
683
|
`Cache request timed out after ${this.timeout}ms`
|
|
694
684
|
);
|
|
695
685
|
timeoutError.stack = error2.stack;
|
|
696
|
-
|
|
686
|
+
this.onError?.(timeoutError);
|
|
697
687
|
} else {
|
|
698
|
-
|
|
688
|
+
this.onError?.(error2);
|
|
699
689
|
}
|
|
700
690
|
}
|
|
701
691
|
};
|
|
702
692
|
this.delete = async (key) => {
|
|
703
|
-
var _a, _b;
|
|
704
693
|
const controller = new AbortController();
|
|
705
694
|
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
706
695
|
try {
|
|
@@ -720,14 +709,13 @@ function requireBuildClient() {
|
|
|
720
709
|
`Cache request timed out after ${this.timeout}ms`
|
|
721
710
|
);
|
|
722
711
|
timeoutError.stack = error2.stack;
|
|
723
|
-
|
|
712
|
+
this.onError?.(timeoutError);
|
|
724
713
|
} else {
|
|
725
|
-
|
|
714
|
+
this.onError?.(error2);
|
|
726
715
|
}
|
|
727
716
|
}
|
|
728
717
|
};
|
|
729
718
|
this.expireTag = async (tag) => {
|
|
730
|
-
var _a, _b;
|
|
731
719
|
const controller = new AbortController();
|
|
732
720
|
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
733
721
|
try {
|
|
@@ -750,9 +738,9 @@ function requireBuildClient() {
|
|
|
750
738
|
`Cache request timed out after ${this.timeout}ms`
|
|
751
739
|
);
|
|
752
740
|
timeoutError.stack = error2.stack;
|
|
753
|
-
|
|
741
|
+
this.onError?.(timeoutError);
|
|
754
742
|
} else {
|
|
755
|
-
|
|
743
|
+
this.onError?.(error2);
|
|
756
744
|
}
|
|
757
745
|
}
|
|
758
746
|
};
|
|
@@ -769,23 +757,23 @@ var hasRequiredCache;
|
|
|
769
757
|
function requireCache() {
|
|
770
758
|
if (hasRequiredCache) return cache;
|
|
771
759
|
hasRequiredCache = 1;
|
|
772
|
-
var
|
|
760
|
+
var __defProp = Object.defineProperty;
|
|
773
761
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
774
762
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
775
763
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
776
764
|
var __export = (target, all) => {
|
|
777
765
|
for (var name in all)
|
|
778
|
-
|
|
766
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
779
767
|
};
|
|
780
768
|
var __copyProps = (to, from, except, desc) => {
|
|
781
769
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
782
770
|
for (let key of __getOwnPropNames(from))
|
|
783
771
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
784
|
-
|
|
772
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
785
773
|
}
|
|
786
774
|
return to;
|
|
787
775
|
};
|
|
788
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
776
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
789
777
|
var cache_exports = {};
|
|
790
778
|
__export(cache_exports, {
|
|
791
779
|
HEADERS_VERCEL_CACHE_ITEM_NAME: () => HEADERS_VERCEL_CACHE_ITEM_NAME,
|
|
@@ -827,9 +815,9 @@ function requireCache() {
|
|
|
827
815
|
);
|
|
828
816
|
};
|
|
829
817
|
function createKeyTransformer(cacheOptions) {
|
|
830
|
-
const hashFunction =
|
|
818
|
+
const hashFunction = cacheOptions?.keyHashFunction || defaultKeyHashFunction;
|
|
831
819
|
return (key) => {
|
|
832
|
-
if (!
|
|
820
|
+
if (!cacheOptions?.namespace)
|
|
833
821
|
return hashFunction(key);
|
|
834
822
|
const separator = cacheOptions.namespaceSeparator || defaultNamespaceSeparator;
|
|
835
823
|
return `${cacheOptions.namespace}${separator}${hashFunction(key)}`;
|
|
@@ -843,7 +831,7 @@ function requireCache() {
|
|
|
843
831
|
set: (key, value, options) => {
|
|
844
832
|
return resolveCache().set(makeKey(key), value, {
|
|
845
833
|
...options,
|
|
846
|
-
name:
|
|
834
|
+
name: options?.name ?? key
|
|
847
835
|
});
|
|
848
836
|
},
|
|
849
837
|
delete: (key) => {
|
|
@@ -926,23 +914,23 @@ var hasRequiredDbConnections;
|
|
|
926
914
|
function requireDbConnections() {
|
|
927
915
|
if (hasRequiredDbConnections) return dbConnections;
|
|
928
916
|
hasRequiredDbConnections = 1;
|
|
929
|
-
var
|
|
917
|
+
var __defProp = Object.defineProperty;
|
|
930
918
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
931
919
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
932
920
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
933
921
|
var __export = (target, all) => {
|
|
934
922
|
for (var name in all)
|
|
935
|
-
|
|
923
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
936
924
|
};
|
|
937
925
|
var __copyProps = (to, from, except, desc) => {
|
|
938
926
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
939
927
|
for (let key of __getOwnPropNames(from))
|
|
940
928
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
941
|
-
|
|
929
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
942
930
|
}
|
|
943
931
|
return to;
|
|
944
932
|
};
|
|
945
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
933
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
946
934
|
var db_connections_exports = {};
|
|
947
935
|
__export(db_connections_exports, {
|
|
948
936
|
attachDatabasePool: () => attachDatabasePool,
|
|
@@ -1006,13 +994,13 @@ function requireDbConnections() {
|
|
|
1006
994
|
Math.max(100, remainingDuration)
|
|
1007
995
|
);
|
|
1008
996
|
idleTimeout = setTimeout(() => {
|
|
1009
|
-
idleTimeoutResolve
|
|
997
|
+
idleTimeoutResolve?.();
|
|
1010
998
|
if (DEBUG) {
|
|
1011
999
|
console.log("Database pool idle timeout reached. Releasing connections.");
|
|
1012
1000
|
}
|
|
1013
1001
|
}, waitTime);
|
|
1014
1002
|
const requestContext = (0, import_get_context.getContext)();
|
|
1015
|
-
if (requestContext
|
|
1003
|
+
if (requestContext?.waitUntil) {
|
|
1016
1004
|
requestContext.waitUntil(promise2);
|
|
1017
1005
|
} else {
|
|
1018
1006
|
console.warn("Pool release event triggered outside of request scope.");
|
|
@@ -1020,7 +1008,7 @@ function requireDbConnections() {
|
|
|
1020
1008
|
}
|
|
1021
1009
|
function attachDatabasePool(dbPool) {
|
|
1022
1010
|
if (idleTimeout) {
|
|
1023
|
-
idleTimeoutResolve
|
|
1011
|
+
idleTimeoutResolve?.();
|
|
1024
1012
|
clearTimeout(idleTimeout);
|
|
1025
1013
|
}
|
|
1026
1014
|
if ("on" in dbPool && dbPool.on && "options" in dbPool && "idleTimeoutMillis" in dbPool.options) {
|
|
@@ -1081,23 +1069,23 @@ var hasRequiredPurge;
|
|
|
1081
1069
|
function requirePurge() {
|
|
1082
1070
|
if (hasRequiredPurge) return purge;
|
|
1083
1071
|
hasRequiredPurge = 1;
|
|
1084
|
-
var
|
|
1072
|
+
var __defProp = Object.defineProperty;
|
|
1085
1073
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
1086
1074
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
1087
1075
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
1088
1076
|
var __export = (target, all) => {
|
|
1089
1077
|
for (var name in all)
|
|
1090
|
-
|
|
1078
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
1091
1079
|
};
|
|
1092
1080
|
var __copyProps = (to, from, except, desc) => {
|
|
1093
1081
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1094
1082
|
for (let key of __getOwnPropNames(from))
|
|
1095
1083
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
1096
|
-
|
|
1084
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
1097
1085
|
}
|
|
1098
1086
|
return to;
|
|
1099
1087
|
};
|
|
1100
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
1088
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1101
1089
|
var purge_exports = {};
|
|
1102
1090
|
__export(purge_exports, {
|
|
1103
1091
|
dangerouslyDeleteBySrcImage: () => dangerouslyDeleteBySrcImage,
|
|
@@ -1136,23 +1124,23 @@ var hasRequiredAddcachetag;
|
|
|
1136
1124
|
function requireAddcachetag() {
|
|
1137
1125
|
if (hasRequiredAddcachetag) return addcachetag;
|
|
1138
1126
|
hasRequiredAddcachetag = 1;
|
|
1139
|
-
var
|
|
1127
|
+
var __defProp = Object.defineProperty;
|
|
1140
1128
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
1141
1129
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
1142
1130
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
1143
1131
|
var __export = (target, all) => {
|
|
1144
1132
|
for (var name in all)
|
|
1145
|
-
|
|
1133
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
1146
1134
|
};
|
|
1147
1135
|
var __copyProps = (to, from, except, desc) => {
|
|
1148
1136
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1149
1137
|
for (let key of __getOwnPropNames(from))
|
|
1150
1138
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
1151
|
-
|
|
1139
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
1152
1140
|
}
|
|
1153
1141
|
return to;
|
|
1154
1142
|
};
|
|
1155
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
1143
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1156
1144
|
var addcachetag_exports = {};
|
|
1157
1145
|
__export(addcachetag_exports, {
|
|
1158
1146
|
addCacheTag: () => addCacheTag
|
|
@@ -1173,23 +1161,23 @@ var hasRequiredWebsocket;
|
|
|
1173
1161
|
function requireWebsocket() {
|
|
1174
1162
|
if (hasRequiredWebsocket) return websocket;
|
|
1175
1163
|
hasRequiredWebsocket = 1;
|
|
1176
|
-
var
|
|
1164
|
+
var __defProp = Object.defineProperty;
|
|
1177
1165
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
1178
1166
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
1179
1167
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
1180
1168
|
var __export = (target, all) => {
|
|
1181
1169
|
for (var name in all)
|
|
1182
|
-
|
|
1170
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
1183
1171
|
};
|
|
1184
1172
|
var __copyProps = (to, from, except, desc) => {
|
|
1185
1173
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1186
1174
|
for (let key of __getOwnPropNames(from))
|
|
1187
1175
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
1188
|
-
|
|
1176
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
1189
1177
|
}
|
|
1190
1178
|
return to;
|
|
1191
1179
|
};
|
|
1192
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
1180
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1193
1181
|
var websocket_exports = {};
|
|
1194
1182
|
__export(websocket_exports, {
|
|
1195
1183
|
experimental_upgradeWebSocket: () => experimental_upgradeWebSocket,
|
|
@@ -1200,7 +1188,7 @@ function requireWebsocket() {
|
|
|
1200
1188
|
const DEFAULT_MAX_PAYLOAD = 256 * 1024;
|
|
1201
1189
|
async function loadWebSocketServer() {
|
|
1202
1190
|
try {
|
|
1203
|
-
const ws = await import("./wrapper-
|
|
1191
|
+
const ws = await import("./wrapper-DBwRVVUb.js");
|
|
1204
1192
|
return ws.WebSocketServer;
|
|
1205
1193
|
} catch {
|
|
1206
1194
|
throw new Error(
|
|
@@ -1268,23 +1256,23 @@ var hasRequiredVersion;
|
|
|
1268
1256
|
function requireVersion() {
|
|
1269
1257
|
if (hasRequiredVersion) return version_1;
|
|
1270
1258
|
hasRequiredVersion = 1;
|
|
1271
|
-
var
|
|
1259
|
+
var __defProp = Object.defineProperty;
|
|
1272
1260
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
1273
1261
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
1274
1262
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
1275
1263
|
var __export = (target, all) => {
|
|
1276
1264
|
for (var name in all)
|
|
1277
|
-
|
|
1265
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
1278
1266
|
};
|
|
1279
1267
|
var __copyProps = (to, from, except, desc) => {
|
|
1280
1268
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1281
1269
|
for (let key of __getOwnPropNames(from))
|
|
1282
1270
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
1283
|
-
|
|
1271
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
1284
1272
|
}
|
|
1285
1273
|
return to;
|
|
1286
1274
|
};
|
|
1287
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
1275
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1288
1276
|
var version_exports = {};
|
|
1289
1277
|
__export(version_exports, {
|
|
1290
1278
|
version: () => version
|
|
@@ -1298,23 +1286,23 @@ var hasRequiredExchangeVercelOidcToken;
|
|
|
1298
1286
|
function requireExchangeVercelOidcToken() {
|
|
1299
1287
|
if (hasRequiredExchangeVercelOidcToken) return exchangeVercelOidcToken_1;
|
|
1300
1288
|
hasRequiredExchangeVercelOidcToken = 1;
|
|
1301
|
-
var
|
|
1289
|
+
var __defProp = Object.defineProperty;
|
|
1302
1290
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
1303
1291
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
1304
1292
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
1305
1293
|
var __export = (target, all) => {
|
|
1306
1294
|
for (var name in all)
|
|
1307
|
-
|
|
1295
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
1308
1296
|
};
|
|
1309
1297
|
var __copyProps = (to, from, except, desc) => {
|
|
1310
1298
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1311
1299
|
for (let key of __getOwnPropNames(from))
|
|
1312
1300
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
1313
|
-
|
|
1301
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
1314
1302
|
}
|
|
1315
1303
|
return to;
|
|
1316
1304
|
};
|
|
1317
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
1305
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1318
1306
|
var exchange_vercel_oidc_token_exports = {};
|
|
1319
1307
|
__export(exchange_vercel_oidc_token_exports, {
|
|
1320
1308
|
exchangeVercelOidcToken: () => exchangeVercelOidcToken
|
|
@@ -1437,34 +1425,33 @@ var hasRequiredGetContext;
|
|
|
1437
1425
|
function requireGetContext() {
|
|
1438
1426
|
if (hasRequiredGetContext) return getContext_1;
|
|
1439
1427
|
hasRequiredGetContext = 1;
|
|
1440
|
-
var
|
|
1428
|
+
var __defProp = Object.defineProperty;
|
|
1441
1429
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
1442
1430
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
1443
1431
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
1444
1432
|
var __export = (target, all) => {
|
|
1445
1433
|
for (var name in all)
|
|
1446
|
-
|
|
1434
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
1447
1435
|
};
|
|
1448
1436
|
var __copyProps = (to, from, except, desc) => {
|
|
1449
1437
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1450
1438
|
for (let key of __getOwnPropNames(from))
|
|
1451
1439
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
1452
|
-
|
|
1440
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
1453
1441
|
}
|
|
1454
1442
|
return to;
|
|
1455
1443
|
};
|
|
1456
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
1444
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1457
1445
|
var get_context_exports = {};
|
|
1458
1446
|
__export(get_context_exports, {
|
|
1459
1447
|
SYMBOL_FOR_REQ_CONTEXT: () => SYMBOL_FOR_REQ_CONTEXT,
|
|
1460
1448
|
getContext: () => getContext
|
|
1461
1449
|
});
|
|
1462
1450
|
getContext_1 = __toCommonJS(get_context_exports);
|
|
1463
|
-
const SYMBOL_FOR_REQ_CONTEXT = Symbol.for("@vercel/request-context");
|
|
1451
|
+
const SYMBOL_FOR_REQ_CONTEXT = /* @__PURE__ */ Symbol.for("@vercel/request-context");
|
|
1464
1452
|
function getContext() {
|
|
1465
|
-
var _a, _b;
|
|
1466
1453
|
const fromSymbol = globalThis;
|
|
1467
|
-
return
|
|
1454
|
+
return fromSymbol[SYMBOL_FOR_REQ_CONTEXT]?.get?.() ?? {};
|
|
1468
1455
|
}
|
|
1469
1456
|
return getContext_1;
|
|
1470
1457
|
}
|
|
@@ -1473,23 +1460,23 @@ var hasRequiredGetVercelOidcTokenSync;
|
|
|
1473
1460
|
function requireGetVercelOidcTokenSync() {
|
|
1474
1461
|
if (hasRequiredGetVercelOidcTokenSync) return getVercelOidcTokenSync_1;
|
|
1475
1462
|
hasRequiredGetVercelOidcTokenSync = 1;
|
|
1476
|
-
var
|
|
1463
|
+
var __defProp = Object.defineProperty;
|
|
1477
1464
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
1478
1465
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
1479
1466
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
1480
1467
|
var __export = (target, all) => {
|
|
1481
1468
|
for (var name in all)
|
|
1482
|
-
|
|
1469
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
1483
1470
|
};
|
|
1484
1471
|
var __copyProps = (to, from, except, desc) => {
|
|
1485
1472
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1486
1473
|
for (let key of __getOwnPropNames(from))
|
|
1487
1474
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
1488
|
-
|
|
1475
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
1489
1476
|
}
|
|
1490
1477
|
return to;
|
|
1491
1478
|
};
|
|
1492
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
1479
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1493
1480
|
var get_vercel_oidc_token_sync_exports = {};
|
|
1494
1481
|
__export(get_vercel_oidc_token_sync_exports, {
|
|
1495
1482
|
getVercelOidcTokenSync: () => getVercelOidcTokenSync
|
|
@@ -1497,8 +1484,7 @@ function requireGetVercelOidcTokenSync() {
|
|
|
1497
1484
|
getVercelOidcTokenSync_1 = __toCommonJS(get_vercel_oidc_token_sync_exports);
|
|
1498
1485
|
var import_get_context = requireGetContext();
|
|
1499
1486
|
function getVercelOidcTokenSync() {
|
|
1500
|
-
|
|
1501
|
-
const token = ((_a = (0, import_get_context.getContext)().headers) == null ? void 0 : _a["x-vercel-oidc-token"]) ?? process.env.VERCEL_OIDC_TOKEN;
|
|
1487
|
+
const token = (0, import_get_context.getContext)().headers?.["x-vercel-oidc-token"] ?? process.env.VERCEL_OIDC_TOKEN;
|
|
1502
1488
|
if (!token) {
|
|
1503
1489
|
throw new Error(
|
|
1504
1490
|
`The 'x-vercel-oidc-token' header is missing from the request.`
|
|
@@ -1513,23 +1499,23 @@ var hasRequiredTokenError;
|
|
|
1513
1499
|
function requireTokenError() {
|
|
1514
1500
|
if (hasRequiredTokenError) return tokenError;
|
|
1515
1501
|
hasRequiredTokenError = 1;
|
|
1516
|
-
var
|
|
1502
|
+
var __defProp = Object.defineProperty;
|
|
1517
1503
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
1518
1504
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
1519
1505
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
1520
1506
|
var __export = (target, all) => {
|
|
1521
1507
|
for (var name in all)
|
|
1522
|
-
|
|
1508
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
1523
1509
|
};
|
|
1524
1510
|
var __copyProps = (to, from, except, desc) => {
|
|
1525
1511
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1526
1512
|
for (let key of __getOwnPropNames(from))
|
|
1527
1513
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
1528
|
-
|
|
1514
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
1529
1515
|
}
|
|
1530
1516
|
return to;
|
|
1531
1517
|
};
|
|
1532
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
1518
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1533
1519
|
var token_error_exports = {};
|
|
1534
1520
|
__export(token_error_exports, {
|
|
1535
1521
|
VercelOidcTokenError: () => VercelOidcTokenError
|
|
@@ -1555,23 +1541,23 @@ var hasRequiredGetVercelOidcTokenWithRefresh;
|
|
|
1555
1541
|
function requireGetVercelOidcTokenWithRefresh() {
|
|
1556
1542
|
if (hasRequiredGetVercelOidcTokenWithRefresh) return getVercelOidcTokenWithRefresh;
|
|
1557
1543
|
hasRequiredGetVercelOidcTokenWithRefresh = 1;
|
|
1558
|
-
var
|
|
1544
|
+
var __defProp = Object.defineProperty;
|
|
1559
1545
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
1560
1546
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
1561
1547
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
1562
1548
|
var __export = (target, all) => {
|
|
1563
1549
|
for (var name in all)
|
|
1564
|
-
|
|
1550
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
1565
1551
|
};
|
|
1566
1552
|
var __copyProps = (to, from, except, desc) => {
|
|
1567
1553
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1568
1554
|
for (let key of __getOwnPropNames(from))
|
|
1569
1555
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
1570
|
-
|
|
1556
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
1571
1557
|
}
|
|
1572
1558
|
return to;
|
|
1573
1559
|
};
|
|
1574
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
1560
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1575
1561
|
var get_vercel_oidc_token_with_refresh_exports = {};
|
|
1576
1562
|
__export(get_vercel_oidc_token_with_refresh_exports, {
|
|
1577
1563
|
getVercelOidcToken: () => getVercelOidcToken
|
|
@@ -1583,10 +1569,9 @@ function requireGetVercelOidcTokenWithRefresh() {
|
|
|
1583
1569
|
var import_get_vercel_oidc_token_sync = requireGetVercelOidcTokenSync();
|
|
1584
1570
|
var import_token_error = requireTokenError();
|
|
1585
1571
|
async function getVercelOidcToken(options) {
|
|
1586
|
-
var _a;
|
|
1587
1572
|
let token = "";
|
|
1588
1573
|
let err;
|
|
1589
|
-
const tokenFromFile = (
|
|
1574
|
+
const tokenFromFile = (0, import_get_context.getContext)().headers?.["x-vercel-oidc-token"] ? null : await tryOidcTokenFromFile();
|
|
1590
1575
|
try {
|
|
1591
1576
|
token = tokenFromFile ?? (0, import_get_vercel_oidc_token_sync.getVercelOidcTokenSync)();
|
|
1592
1577
|
} catch (error2) {
|
|
@@ -1594,10 +1579,10 @@ function requireGetVercelOidcTokenWithRefresh() {
|
|
|
1594
1579
|
}
|
|
1595
1580
|
try {
|
|
1596
1581
|
const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([
|
|
1597
|
-
await import("./token-util-
|
|
1598
|
-
await import("./token-
|
|
1582
|
+
await import("./token-util-DjnKfD7P.js").then((n) => n.t),
|
|
1583
|
+
await import("./token-BE7-D9Dt.js").then((n) => n.t)
|
|
1599
1584
|
]);
|
|
1600
|
-
if (!token || isExpired(getTokenPayload(token), options
|
|
1585
|
+
if (!token || isExpired(getTokenPayload(token), options?.expirationBufferMs)) {
|
|
1601
1586
|
await refreshToken(options);
|
|
1602
1587
|
token = (0, import_get_vercel_oidc_token_sync.getVercelOidcTokenSync)();
|
|
1603
1588
|
}
|
|
@@ -1612,7 +1597,7 @@ ${error2.message}`;
|
|
|
1612
1597
|
}
|
|
1613
1598
|
throw error2;
|
|
1614
1599
|
}
|
|
1615
|
-
if (options
|
|
1600
|
+
if (options?.audience) {
|
|
1616
1601
|
token = await (0, import_exchange_vercel_oidc_token.exchangeVercelOidcToken)({
|
|
1617
1602
|
token,
|
|
1618
1603
|
audience: options.audience,
|
|
@@ -1750,146 +1735,123 @@ var check_iv_length = {};
|
|
|
1750
1735
|
var errors$1 = {};
|
|
1751
1736
|
var hasRequiredErrors$1;
|
|
1752
1737
|
function requireErrors$1() {
|
|
1753
|
-
var _a, _b;
|
|
1754
1738
|
if (hasRequiredErrors$1) return errors$1;
|
|
1755
1739
|
hasRequiredErrors$1 = 1;
|
|
1756
1740
|
Object.defineProperty(errors$1, "__esModule", { value: true });
|
|
1757
1741
|
errors$1.JWSSignatureVerificationFailed = errors$1.JWKSTimeout = errors$1.JWKSMultipleMatchingKeys = errors$1.JWKSNoMatchingKey = errors$1.JWKSInvalid = errors$1.JWKInvalid = errors$1.JWTInvalid = errors$1.JWSInvalid = errors$1.JWEInvalid = errors$1.JWEDecryptionFailed = errors$1.JOSENotSupported = errors$1.JOSEAlgNotAllowed = errors$1.JWTExpired = errors$1.JWTClaimValidationFailed = errors$1.JOSEError = void 0;
|
|
1758
1742
|
class JOSEError extends Error {
|
|
1743
|
+
static code = "ERR_JOSE_GENERIC";
|
|
1744
|
+
code = "ERR_JOSE_GENERIC";
|
|
1759
1745
|
constructor(message, options) {
|
|
1760
|
-
var _a2;
|
|
1761
1746
|
super(message, options);
|
|
1762
|
-
__publicField(this, "code", "ERR_JOSE_GENERIC");
|
|
1763
1747
|
this.name = this.constructor.name;
|
|
1764
|
-
|
|
1748
|
+
Error.captureStackTrace?.(this, this.constructor);
|
|
1765
1749
|
}
|
|
1766
1750
|
}
|
|
1767
|
-
__publicField(JOSEError, "code", "ERR_JOSE_GENERIC");
|
|
1768
1751
|
errors$1.JOSEError = JOSEError;
|
|
1769
1752
|
class JWTClaimValidationFailed extends JOSEError {
|
|
1753
|
+
static code = "ERR_JWT_CLAIM_VALIDATION_FAILED";
|
|
1754
|
+
code = "ERR_JWT_CLAIM_VALIDATION_FAILED";
|
|
1755
|
+
claim;
|
|
1756
|
+
reason;
|
|
1757
|
+
payload;
|
|
1770
1758
|
constructor(message, payload, claim = "unspecified", reason = "unspecified") {
|
|
1771
1759
|
super(message, { cause: { claim, reason, payload } });
|
|
1772
|
-
__publicField(this, "code", "ERR_JWT_CLAIM_VALIDATION_FAILED");
|
|
1773
|
-
__publicField(this, "claim");
|
|
1774
|
-
__publicField(this, "reason");
|
|
1775
|
-
__publicField(this, "payload");
|
|
1776
1760
|
this.claim = claim;
|
|
1777
1761
|
this.reason = reason;
|
|
1778
1762
|
this.payload = payload;
|
|
1779
1763
|
}
|
|
1780
1764
|
}
|
|
1781
|
-
__publicField(JWTClaimValidationFailed, "code", "ERR_JWT_CLAIM_VALIDATION_FAILED");
|
|
1782
1765
|
errors$1.JWTClaimValidationFailed = JWTClaimValidationFailed;
|
|
1783
1766
|
class JWTExpired extends JOSEError {
|
|
1767
|
+
static code = "ERR_JWT_EXPIRED";
|
|
1768
|
+
code = "ERR_JWT_EXPIRED";
|
|
1769
|
+
claim;
|
|
1770
|
+
reason;
|
|
1771
|
+
payload;
|
|
1784
1772
|
constructor(message, payload, claim = "unspecified", reason = "unspecified") {
|
|
1785
1773
|
super(message, { cause: { claim, reason, payload } });
|
|
1786
|
-
__publicField(this, "code", "ERR_JWT_EXPIRED");
|
|
1787
|
-
__publicField(this, "claim");
|
|
1788
|
-
__publicField(this, "reason");
|
|
1789
|
-
__publicField(this, "payload");
|
|
1790
1774
|
this.claim = claim;
|
|
1791
1775
|
this.reason = reason;
|
|
1792
1776
|
this.payload = payload;
|
|
1793
1777
|
}
|
|
1794
1778
|
}
|
|
1795
|
-
__publicField(JWTExpired, "code", "ERR_JWT_EXPIRED");
|
|
1796
1779
|
errors$1.JWTExpired = JWTExpired;
|
|
1797
1780
|
class JOSEAlgNotAllowed extends JOSEError {
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
__publicField(this, "code", "ERR_JOSE_ALG_NOT_ALLOWED");
|
|
1801
|
-
}
|
|
1781
|
+
static code = "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
1782
|
+
code = "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
1802
1783
|
}
|
|
1803
|
-
__publicField(JOSEAlgNotAllowed, "code", "ERR_JOSE_ALG_NOT_ALLOWED");
|
|
1804
1784
|
errors$1.JOSEAlgNotAllowed = JOSEAlgNotAllowed;
|
|
1805
1785
|
class JOSENotSupported extends JOSEError {
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
__publicField(this, "code", "ERR_JOSE_NOT_SUPPORTED");
|
|
1809
|
-
}
|
|
1786
|
+
static code = "ERR_JOSE_NOT_SUPPORTED";
|
|
1787
|
+
code = "ERR_JOSE_NOT_SUPPORTED";
|
|
1810
1788
|
}
|
|
1811
|
-
__publicField(JOSENotSupported, "code", "ERR_JOSE_NOT_SUPPORTED");
|
|
1812
1789
|
errors$1.JOSENotSupported = JOSENotSupported;
|
|
1813
1790
|
class JWEDecryptionFailed extends JOSEError {
|
|
1791
|
+
static code = "ERR_JWE_DECRYPTION_FAILED";
|
|
1792
|
+
code = "ERR_JWE_DECRYPTION_FAILED";
|
|
1814
1793
|
constructor(message = "decryption operation failed", options) {
|
|
1815
1794
|
super(message, options);
|
|
1816
|
-
__publicField(this, "code", "ERR_JWE_DECRYPTION_FAILED");
|
|
1817
1795
|
}
|
|
1818
1796
|
}
|
|
1819
|
-
__publicField(JWEDecryptionFailed, "code", "ERR_JWE_DECRYPTION_FAILED");
|
|
1820
1797
|
errors$1.JWEDecryptionFailed = JWEDecryptionFailed;
|
|
1821
1798
|
class JWEInvalid extends JOSEError {
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
__publicField(this, "code", "ERR_JWE_INVALID");
|
|
1825
|
-
}
|
|
1799
|
+
static code = "ERR_JWE_INVALID";
|
|
1800
|
+
code = "ERR_JWE_INVALID";
|
|
1826
1801
|
}
|
|
1827
|
-
__publicField(JWEInvalid, "code", "ERR_JWE_INVALID");
|
|
1828
1802
|
errors$1.JWEInvalid = JWEInvalid;
|
|
1829
1803
|
class JWSInvalid extends JOSEError {
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
__publicField(this, "code", "ERR_JWS_INVALID");
|
|
1833
|
-
}
|
|
1804
|
+
static code = "ERR_JWS_INVALID";
|
|
1805
|
+
code = "ERR_JWS_INVALID";
|
|
1834
1806
|
}
|
|
1835
|
-
__publicField(JWSInvalid, "code", "ERR_JWS_INVALID");
|
|
1836
1807
|
errors$1.JWSInvalid = JWSInvalid;
|
|
1837
1808
|
class JWTInvalid extends JOSEError {
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
__publicField(this, "code", "ERR_JWT_INVALID");
|
|
1841
|
-
}
|
|
1809
|
+
static code = "ERR_JWT_INVALID";
|
|
1810
|
+
code = "ERR_JWT_INVALID";
|
|
1842
1811
|
}
|
|
1843
|
-
__publicField(JWTInvalid, "code", "ERR_JWT_INVALID");
|
|
1844
1812
|
errors$1.JWTInvalid = JWTInvalid;
|
|
1845
1813
|
class JWKInvalid extends JOSEError {
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
__publicField(this, "code", "ERR_JWK_INVALID");
|
|
1849
|
-
}
|
|
1814
|
+
static code = "ERR_JWK_INVALID";
|
|
1815
|
+
code = "ERR_JWK_INVALID";
|
|
1850
1816
|
}
|
|
1851
|
-
__publicField(JWKInvalid, "code", "ERR_JWK_INVALID");
|
|
1852
1817
|
errors$1.JWKInvalid = JWKInvalid;
|
|
1853
1818
|
class JWKSInvalid extends JOSEError {
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
__publicField(this, "code", "ERR_JWKS_INVALID");
|
|
1857
|
-
}
|
|
1819
|
+
static code = "ERR_JWKS_INVALID";
|
|
1820
|
+
code = "ERR_JWKS_INVALID";
|
|
1858
1821
|
}
|
|
1859
|
-
__publicField(JWKSInvalid, "code", "ERR_JWKS_INVALID");
|
|
1860
1822
|
errors$1.JWKSInvalid = JWKSInvalid;
|
|
1861
1823
|
class JWKSNoMatchingKey extends JOSEError {
|
|
1824
|
+
static code = "ERR_JWKS_NO_MATCHING_KEY";
|
|
1825
|
+
code = "ERR_JWKS_NO_MATCHING_KEY";
|
|
1862
1826
|
constructor(message = "no applicable key found in the JSON Web Key Set", options) {
|
|
1863
1827
|
super(message, options);
|
|
1864
|
-
__publicField(this, "code", "ERR_JWKS_NO_MATCHING_KEY");
|
|
1865
1828
|
}
|
|
1866
1829
|
}
|
|
1867
|
-
__publicField(JWKSNoMatchingKey, "code", "ERR_JWKS_NO_MATCHING_KEY");
|
|
1868
1830
|
errors$1.JWKSNoMatchingKey = JWKSNoMatchingKey;
|
|
1869
|
-
class JWKSMultipleMatchingKeys extends
|
|
1831
|
+
class JWKSMultipleMatchingKeys extends JOSEError {
|
|
1832
|
+
[Symbol.asyncIterator];
|
|
1833
|
+
static code = "ERR_JWKS_MULTIPLE_MATCHING_KEYS";
|
|
1834
|
+
code = "ERR_JWKS_MULTIPLE_MATCHING_KEYS";
|
|
1870
1835
|
constructor(message = "multiple matching keys found in the JSON Web Key Set", options) {
|
|
1871
1836
|
super(message, options);
|
|
1872
|
-
__publicField(this, _a);
|
|
1873
|
-
__publicField(this, "code", "ERR_JWKS_MULTIPLE_MATCHING_KEYS");
|
|
1874
1837
|
}
|
|
1875
1838
|
}
|
|
1876
|
-
__publicField(JWKSMultipleMatchingKeys, "code", "ERR_JWKS_MULTIPLE_MATCHING_KEYS");
|
|
1877
1839
|
errors$1.JWKSMultipleMatchingKeys = JWKSMultipleMatchingKeys;
|
|
1878
1840
|
class JWKSTimeout extends JOSEError {
|
|
1841
|
+
static code = "ERR_JWKS_TIMEOUT";
|
|
1842
|
+
code = "ERR_JWKS_TIMEOUT";
|
|
1879
1843
|
constructor(message = "request timed out", options) {
|
|
1880
1844
|
super(message, options);
|
|
1881
|
-
__publicField(this, "code", "ERR_JWKS_TIMEOUT");
|
|
1882
1845
|
}
|
|
1883
1846
|
}
|
|
1884
|
-
__publicField(JWKSTimeout, "code", "ERR_JWKS_TIMEOUT");
|
|
1885
1847
|
errors$1.JWKSTimeout = JWKSTimeout;
|
|
1886
1848
|
class JWSSignatureVerificationFailed extends JOSEError {
|
|
1849
|
+
static code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
|
|
1850
|
+
code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
|
|
1887
1851
|
constructor(message = "signature verification failed", options) {
|
|
1888
1852
|
super(message, options);
|
|
1889
|
-
__publicField(this, "code", "ERR_JWS_SIGNATURE_VERIFICATION_FAILED");
|
|
1890
1853
|
}
|
|
1891
1854
|
}
|
|
1892
|
-
__publicField(JWSSignatureVerificationFailed, "code", "ERR_JWS_SIGNATURE_VERIFICATION_FAILED");
|
|
1893
1855
|
errors$1.JWSSignatureVerificationFailed = JWSSignatureVerificationFailed;
|
|
1894
1856
|
return errors$1;
|
|
1895
1857
|
}
|
|
@@ -2221,7 +2183,6 @@ function requireInvalid_key_input() {
|
|
|
2221
2183
|
Object.defineProperty(invalid_key_input, "__esModule", { value: true });
|
|
2222
2184
|
invalid_key_input.withAlg = withAlg;
|
|
2223
2185
|
function message(msg, actual, ...types) {
|
|
2224
|
-
var _a;
|
|
2225
2186
|
types = types.filter(Boolean);
|
|
2226
2187
|
if (types.length > 2) {
|
|
2227
2188
|
const last = types.pop();
|
|
@@ -2236,7 +2197,7 @@ function requireInvalid_key_input() {
|
|
|
2236
2197
|
} else if (typeof actual === "function" && actual.name) {
|
|
2237
2198
|
msg += ` Received function ${actual.name}`;
|
|
2238
2199
|
} else if (typeof actual === "object" && actual != null) {
|
|
2239
|
-
if (
|
|
2200
|
+
if (actual.constructor?.name) {
|
|
2240
2201
|
msg += ` Received an instance of ${actual.constructor.name}`;
|
|
2241
2202
|
}
|
|
2242
2203
|
}
|
|
@@ -2259,7 +2220,7 @@ function requireCiphers() {
|
|
|
2259
2220
|
const node_crypto_1 = require$$0$1;
|
|
2260
2221
|
let ciphers$1;
|
|
2261
2222
|
ciphers.default = (algorithm) => {
|
|
2262
|
-
ciphers$1
|
|
2223
|
+
ciphers$1 ||= new Set((0, node_crypto_1.getCiphers)());
|
|
2263
2224
|
return ciphers$1.has(algorithm);
|
|
2264
2225
|
};
|
|
2265
2226
|
return ciphers;
|
|
@@ -2267,7 +2228,6 @@ function requireCiphers() {
|
|
|
2267
2228
|
var is_key_like = {};
|
|
2268
2229
|
var hasRequiredIs_key_like;
|
|
2269
2230
|
function requireIs_key_like() {
|
|
2270
|
-
var _a;
|
|
2271
2231
|
if (hasRequiredIs_key_like) return is_key_like;
|
|
2272
2232
|
hasRequiredIs_key_like = 1;
|
|
2273
2233
|
Object.defineProperty(is_key_like, "__esModule", { value: true });
|
|
@@ -2277,7 +2237,7 @@ function requireIs_key_like() {
|
|
|
2277
2237
|
is_key_like.default = (key) => (0, is_key_object_js_1.default)(key) || (0, webcrypto_js_1.isCryptoKey)(key);
|
|
2278
2238
|
const types = ["KeyObject"];
|
|
2279
2239
|
is_key_like.types = types;
|
|
2280
|
-
if (globalThis.CryptoKey ||
|
|
2240
|
+
if (globalThis.CryptoKey || webcrypto_js_1.default?.CryptoKey) {
|
|
2281
2241
|
types.push("CryptoKey");
|
|
2282
2242
|
}
|
|
2283
2243
|
return is_key_like;
|
|
@@ -2739,11 +2699,10 @@ function requireCheck_key_length() {
|
|
|
2739
2699
|
Object.defineProperty(check_key_length, "__esModule", { value: true });
|
|
2740
2700
|
const node_crypto_1 = require$$0$1;
|
|
2741
2701
|
check_key_length.default = (key, alg) => {
|
|
2742
|
-
var _a;
|
|
2743
2702
|
let modulusLength;
|
|
2744
2703
|
try {
|
|
2745
2704
|
if (key instanceof node_crypto_1.KeyObject) {
|
|
2746
|
-
modulusLength =
|
|
2705
|
+
modulusLength = key.asymmetricKeyDetails?.modulusLength;
|
|
2747
2706
|
} else {
|
|
2748
2707
|
modulusLength = Buffer.from(key.n, "base64url").byteLength << 3;
|
|
2749
2708
|
}
|
|
@@ -2980,7 +2939,7 @@ function require_import() {
|
|
|
2980
2939
|
if (!(0, is_object_js_1.default)(jwk)) {
|
|
2981
2940
|
throw new TypeError("JWK must be an object");
|
|
2982
2941
|
}
|
|
2983
|
-
alg
|
|
2942
|
+
alg ||= jwk.alg;
|
|
2984
2943
|
switch (jwk.kty) {
|
|
2985
2944
|
case "oct":
|
|
2986
2945
|
if (typeof jwk.k !== "string" || !jwk.k) {
|
|
@@ -3010,13 +2969,12 @@ function requireCheck_key_type() {
|
|
|
3010
2969
|
const invalid_key_input_js_1 = /* @__PURE__ */ requireInvalid_key_input();
|
|
3011
2970
|
const is_key_like_js_1 = /* @__PURE__ */ requireIs_key_like();
|
|
3012
2971
|
const jwk = /* @__PURE__ */ requireIs_jwk();
|
|
3013
|
-
const tag = (key) => key
|
|
2972
|
+
const tag = (key) => key?.[Symbol.toStringTag];
|
|
3014
2973
|
const jwkMatchesOp = (alg, key, usage) => {
|
|
3015
|
-
var _a, _b;
|
|
3016
2974
|
if (key.use !== void 0 && key.use !== "sig") {
|
|
3017
2975
|
throw new TypeError("Invalid key for this operation, when present its use must be sig");
|
|
3018
2976
|
}
|
|
3019
|
-
if (key.key_ops !== void 0 &&
|
|
2977
|
+
if (key.key_ops !== void 0 && key.key_ops.includes?.(usage) !== true) {
|
|
3020
2978
|
throw new TypeError(`Invalid key for this operation, when present its key_ops must include ${usage}`);
|
|
3021
2979
|
}
|
|
3022
2980
|
if (key.alg !== void 0 && key.alg !== alg) {
|
|
@@ -3210,9 +3168,8 @@ function requireDecrypt_key_management() {
|
|
|
3210
3168
|
const is_object_js_1 = /* @__PURE__ */ requireIs_object();
|
|
3211
3169
|
const aesgcmkw_js_1 = /* @__PURE__ */ requireAesgcmkw();
|
|
3212
3170
|
async function decryptKeyManagement(alg, key, encryptedKey, joseHeader, options) {
|
|
3213
|
-
var _a, _b;
|
|
3214
3171
|
(0, check_key_type_js_1.default)(alg, key, "decrypt");
|
|
3215
|
-
key = await
|
|
3172
|
+
key = await normalize_key_js_1.default.normalizePrivateKey?.(key, alg) || key;
|
|
3216
3173
|
switch (alg) {
|
|
3217
3174
|
case "dir": {
|
|
3218
3175
|
if (encryptedKey !== void 0)
|
|
@@ -3273,7 +3230,7 @@ function requireDecrypt_key_management() {
|
|
|
3273
3230
|
throw new errors_js_1.JWEInvalid("JWE Encrypted Key missing");
|
|
3274
3231
|
if (typeof joseHeader.p2c !== "number")
|
|
3275
3232
|
throw new errors_js_1.JWEInvalid(`JOSE Header "p2c" (PBES2 Count) missing or invalid`);
|
|
3276
|
-
const p2cLimit =
|
|
3233
|
+
const p2cLimit = options?.maxPBES2Count || 1e4;
|
|
3277
3234
|
if (joseHeader.p2c > p2cLimit)
|
|
3278
3235
|
throw new errors_js_1.JWEInvalid(`JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds`);
|
|
3279
3236
|
if (typeof joseHeader.p2s !== "string")
|
|
@@ -3332,7 +3289,7 @@ function requireValidate_crit() {
|
|
|
3332
3289
|
Object.defineProperty(validate_crit, "__esModule", { value: true });
|
|
3333
3290
|
const errors_js_1 = /* @__PURE__ */ requireErrors$1();
|
|
3334
3291
|
function validateCrit(Err, recognizedDefault, recognizedOption, protectedHeader, joseHeader) {
|
|
3335
|
-
if (joseHeader.crit !== void 0 &&
|
|
3292
|
+
if (joseHeader.crit !== void 0 && protectedHeader?.crit === void 0) {
|
|
3336
3293
|
throw new Err('"crit" (Critical) Header Parameter MUST be integrity protected');
|
|
3337
3294
|
}
|
|
3338
3295
|
if (!protectedHeader || protectedHeader.crit === void 0) {
|
|
@@ -3445,7 +3402,7 @@ function requireDecrypt$3() {
|
|
|
3445
3402
|
...jwe.header,
|
|
3446
3403
|
...jwe.unprotected
|
|
3447
3404
|
};
|
|
3448
|
-
(0, validate_crit_js_1.default)(errors_js_1.JWEInvalid, /* @__PURE__ */ new Map(), options
|
|
3405
|
+
(0, validate_crit_js_1.default)(errors_js_1.JWEInvalid, /* @__PURE__ */ new Map(), options?.crit, parsedProt, joseHeader);
|
|
3449
3406
|
if (joseHeader.zip !== void 0) {
|
|
3450
3407
|
throw new errors_js_1.JOSENotSupported('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');
|
|
3451
3408
|
}
|
|
@@ -3623,7 +3580,7 @@ function requirePrivate_symbols() {
|
|
|
3623
3580
|
hasRequiredPrivate_symbols = 1;
|
|
3624
3581
|
Object.defineProperty(private_symbols, "__esModule", { value: true });
|
|
3625
3582
|
private_symbols.unprotected = void 0;
|
|
3626
|
-
private_symbols.unprotected = Symbol();
|
|
3583
|
+
private_symbols.unprotected = /* @__PURE__ */ Symbol();
|
|
3627
3584
|
return private_symbols;
|
|
3628
3585
|
}
|
|
3629
3586
|
var encrypt_key_management = {};
|
|
@@ -3705,12 +3662,11 @@ function requireEncrypt_key_management() {
|
|
|
3705
3662
|
const check_key_type_js_1 = /* @__PURE__ */ requireCheck_key_type();
|
|
3706
3663
|
const aesgcmkw_js_1 = /* @__PURE__ */ requireAesgcmkw();
|
|
3707
3664
|
async function encryptKeyManagement(alg, enc, key, providedCek, providedParameters = {}) {
|
|
3708
|
-
var _a, _b;
|
|
3709
3665
|
let encryptedKey;
|
|
3710
3666
|
let parameters;
|
|
3711
3667
|
let cek2;
|
|
3712
3668
|
(0, check_key_type_js_1.default)(alg, key, "encrypt");
|
|
3713
|
-
key = await
|
|
3669
|
+
key = await normalize_key_js_1.default.normalizePublicKey?.(key, alg) || key;
|
|
3714
3670
|
switch (alg) {
|
|
3715
3671
|
case "dir": {
|
|
3716
3672
|
cek2 = key;
|
|
@@ -3725,7 +3681,7 @@ function requireEncrypt_key_management() {
|
|
|
3725
3681
|
}
|
|
3726
3682
|
const { apu, apv } = providedParameters;
|
|
3727
3683
|
let { epk: ephemeralKey } = providedParameters;
|
|
3728
|
-
ephemeralKey
|
|
3684
|
+
ephemeralKey ||= (await ECDH.generateEpk(key)).privateKey;
|
|
3729
3685
|
const { x, y, crv, kty } = await (0, export_js_1.exportJWK)(ephemeralKey);
|
|
3730
3686
|
const sharedSecret = await ECDH.deriveKey(key, ephemeralKey, alg === "ECDH-ES" ? enc : alg, alg === "ECDH-ES" ? (0, cek_js_1.bitLength)(enc) : parseInt(alg.slice(-5, -2), 10), apu, apv);
|
|
3731
3687
|
parameters = { epk: { x, crv, kty } };
|
|
@@ -3800,15 +3756,15 @@ function requireEncrypt$3() {
|
|
|
3800
3756
|
const buffer_utils_js_1 = /* @__PURE__ */ requireBuffer_utils();
|
|
3801
3757
|
const validate_crit_js_1 = /* @__PURE__ */ requireValidate_crit();
|
|
3802
3758
|
class FlattenedEncrypt {
|
|
3759
|
+
_plaintext;
|
|
3760
|
+
_protectedHeader;
|
|
3761
|
+
_sharedUnprotectedHeader;
|
|
3762
|
+
_unprotectedHeader;
|
|
3763
|
+
_aad;
|
|
3764
|
+
_cek;
|
|
3765
|
+
_iv;
|
|
3766
|
+
_keyManagementParameters;
|
|
3803
3767
|
constructor(plaintext) {
|
|
3804
|
-
__publicField(this, "_plaintext");
|
|
3805
|
-
__publicField(this, "_protectedHeader");
|
|
3806
|
-
__publicField(this, "_sharedUnprotectedHeader");
|
|
3807
|
-
__publicField(this, "_unprotectedHeader");
|
|
3808
|
-
__publicField(this, "_aad");
|
|
3809
|
-
__publicField(this, "_cek");
|
|
3810
|
-
__publicField(this, "_iv");
|
|
3811
|
-
__publicField(this, "_keyManagementParameters");
|
|
3812
3768
|
if (!(plaintext instanceof Uint8Array)) {
|
|
3813
3769
|
throw new TypeError("plaintext must be an instance of Uint8Array");
|
|
3814
3770
|
}
|
|
@@ -3872,7 +3828,7 @@ function requireEncrypt$3() {
|
|
|
3872
3828
|
...this._unprotectedHeader,
|
|
3873
3829
|
...this._sharedUnprotectedHeader
|
|
3874
3830
|
};
|
|
3875
|
-
(0, validate_crit_js_1.default)(errors_js_1.JWEInvalid, /* @__PURE__ */ new Map(), options
|
|
3831
|
+
(0, validate_crit_js_1.default)(errors_js_1.JWEInvalid, /* @__PURE__ */ new Map(), options?.crit, this._protectedHeader, joseHeader);
|
|
3876
3832
|
if (joseHeader.zip !== void 0) {
|
|
3877
3833
|
throw new errors_js_1.JOSENotSupported('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');
|
|
3878
3834
|
}
|
|
@@ -3965,11 +3921,11 @@ function requireEncrypt$2() {
|
|
|
3965
3921
|
const base64url_js_1 = /* @__PURE__ */ requireBase64url$1();
|
|
3966
3922
|
const validate_crit_js_1 = /* @__PURE__ */ requireValidate_crit();
|
|
3967
3923
|
class IndividualRecipient {
|
|
3924
|
+
parent;
|
|
3925
|
+
unprotectedHeader;
|
|
3926
|
+
key;
|
|
3927
|
+
options;
|
|
3968
3928
|
constructor(enc, key, options) {
|
|
3969
|
-
__publicField(this, "parent");
|
|
3970
|
-
__publicField(this, "unprotectedHeader");
|
|
3971
|
-
__publicField(this, "key");
|
|
3972
|
-
__publicField(this, "options");
|
|
3973
3929
|
this.parent = enc;
|
|
3974
3930
|
this.key = key;
|
|
3975
3931
|
this.options = options;
|
|
@@ -3992,16 +3948,16 @@ function requireEncrypt$2() {
|
|
|
3992
3948
|
}
|
|
3993
3949
|
}
|
|
3994
3950
|
class GeneralEncrypt {
|
|
3951
|
+
_plaintext;
|
|
3952
|
+
_recipients = [];
|
|
3953
|
+
_protectedHeader;
|
|
3954
|
+
_unprotectedHeader;
|
|
3955
|
+
_aad;
|
|
3995
3956
|
constructor(plaintext) {
|
|
3996
|
-
__publicField(this, "_plaintext");
|
|
3997
|
-
__publicField(this, "_recipients", []);
|
|
3998
|
-
__publicField(this, "_protectedHeader");
|
|
3999
|
-
__publicField(this, "_unprotectedHeader");
|
|
4000
|
-
__publicField(this, "_aad");
|
|
4001
3957
|
this._plaintext = plaintext;
|
|
4002
3958
|
}
|
|
4003
3959
|
addRecipient(key, options) {
|
|
4004
|
-
const recipient = new IndividualRecipient(this, key, { crit: options
|
|
3960
|
+
const recipient = new IndividualRecipient(this, key, { crit: options?.crit });
|
|
4005
3961
|
this._recipients.push(recipient);
|
|
4006
3962
|
return recipient;
|
|
4007
3963
|
}
|
|
@@ -4024,7 +3980,6 @@ function requireEncrypt$2() {
|
|
|
4024
3980
|
return this;
|
|
4025
3981
|
}
|
|
4026
3982
|
async encrypt() {
|
|
4027
|
-
var _a, _b, _c;
|
|
4028
3983
|
if (!this._recipients.length) {
|
|
4029
3984
|
throw new errors_js_1.JWEInvalid("at least one recipient must be added");
|
|
4030
3985
|
}
|
|
@@ -4116,7 +4071,7 @@ function requireEncrypt$2() {
|
|
|
4116
4071
|
target.header = flattened.header;
|
|
4117
4072
|
continue;
|
|
4118
4073
|
}
|
|
4119
|
-
const { encryptedKey, parameters } = await (0, encrypt_key_management_js_1.default)(
|
|
4074
|
+
const { encryptedKey, parameters } = await (0, encrypt_key_management_js_1.default)(recipient.unprotectedHeader?.alg || this._protectedHeader?.alg || this._unprotectedHeader?.alg, enc, recipient.key, cek2, { p2c });
|
|
4120
4075
|
target.encrypted_key = (0, base64url_js_1.encode)(encryptedKey);
|
|
4121
4076
|
if (recipient.unprotectedHeader || parameters)
|
|
4122
4077
|
target.header = { ...recipient.unprotectedHeader, ...parameters };
|
|
@@ -4446,7 +4401,7 @@ function requireVerify$3() {
|
|
|
4446
4401
|
...parsedProt,
|
|
4447
4402
|
...jws.header
|
|
4448
4403
|
};
|
|
4449
|
-
const extensions = (0, validate_crit_js_1.default)(errors_js_1.JWSInvalid, /* @__PURE__ */ new Map([["b64", true]]), options
|
|
4404
|
+
const extensions = (0, validate_crit_js_1.default)(errors_js_1.JWSInvalid, /* @__PURE__ */ new Map([["b64", true]]), options?.crit, parsedProt, joseHeader);
|
|
4450
4405
|
let b64 = true;
|
|
4451
4406
|
if (extensions.has("b64")) {
|
|
4452
4407
|
b64 = parsedProt.b64;
|
|
@@ -4768,9 +4723,8 @@ function requireVerify() {
|
|
|
4768
4723
|
const jwt_claims_set_js_1 = /* @__PURE__ */ requireJwt_claims_set();
|
|
4769
4724
|
const errors_js_1 = /* @__PURE__ */ requireErrors$1();
|
|
4770
4725
|
async function jwtVerify(jwt, key, options) {
|
|
4771
|
-
var _a;
|
|
4772
4726
|
const verified = await (0, verify_js_1.compactVerify)(jwt, key, options);
|
|
4773
|
-
if (
|
|
4727
|
+
if (verified.protectedHeader.crit?.includes("b64") && verified.protectedHeader.b64 === false) {
|
|
4774
4728
|
throw new errors_js_1.JWTInvalid("JWTs MUST NOT use unencoded payload");
|
|
4775
4729
|
}
|
|
4776
4730
|
const payload = (0, jwt_claims_set_js_1.default)(verified.protectedHeader, verified.payload, options);
|
|
@@ -4822,8 +4776,8 @@ function requireEncrypt$1() {
|
|
|
4822
4776
|
encrypt$1.CompactEncrypt = void 0;
|
|
4823
4777
|
const encrypt_js_1 = /* @__PURE__ */ requireEncrypt$3();
|
|
4824
4778
|
class CompactEncrypt {
|
|
4779
|
+
_flattened;
|
|
4825
4780
|
constructor(plaintext) {
|
|
4826
|
-
__publicField(this, "_flattened");
|
|
4827
4781
|
this._flattened = new encrypt_js_1.FlattenedEncrypt(plaintext);
|
|
4828
4782
|
}
|
|
4829
4783
|
setContentEncryptionKey(cek2) {
|
|
@@ -4866,10 +4820,10 @@ function requireSign$3() {
|
|
|
4866
4820
|
const check_key_type_js_1 = /* @__PURE__ */ requireCheck_key_type();
|
|
4867
4821
|
const validate_crit_js_1 = /* @__PURE__ */ requireValidate_crit();
|
|
4868
4822
|
class FlattenedSign {
|
|
4823
|
+
_payload;
|
|
4824
|
+
_protectedHeader;
|
|
4825
|
+
_unprotectedHeader;
|
|
4869
4826
|
constructor(payload) {
|
|
4870
|
-
__publicField(this, "_payload");
|
|
4871
|
-
__publicField(this, "_protectedHeader");
|
|
4872
|
-
__publicField(this, "_unprotectedHeader");
|
|
4873
4827
|
if (!(payload instanceof Uint8Array)) {
|
|
4874
4828
|
throw new TypeError("payload must be an instance of Uint8Array");
|
|
4875
4829
|
}
|
|
@@ -4900,7 +4854,7 @@ function requireSign$3() {
|
|
|
4900
4854
|
...this._protectedHeader,
|
|
4901
4855
|
...this._unprotectedHeader
|
|
4902
4856
|
};
|
|
4903
|
-
const extensions = (0, validate_crit_js_1.default)(errors_js_1.JWSInvalid, /* @__PURE__ */ new Map([["b64", true]]), options
|
|
4857
|
+
const extensions = (0, validate_crit_js_1.default)(errors_js_1.JWSInvalid, /* @__PURE__ */ new Map([["b64", true]]), options?.crit, this._protectedHeader, joseHeader);
|
|
4904
4858
|
let b64 = true;
|
|
4905
4859
|
if (extensions.has("b64")) {
|
|
4906
4860
|
b64 = this._protectedHeader.b64;
|
|
@@ -4952,8 +4906,8 @@ function requireSign$2() {
|
|
|
4952
4906
|
sign$3.CompactSign = void 0;
|
|
4953
4907
|
const sign_js_1 = /* @__PURE__ */ requireSign$3();
|
|
4954
4908
|
class CompactSign {
|
|
4909
|
+
_flattened;
|
|
4955
4910
|
constructor(payload) {
|
|
4956
|
-
__publicField(this, "_flattened");
|
|
4957
4911
|
this._flattened = new sign_js_1.FlattenedSign(payload);
|
|
4958
4912
|
}
|
|
4959
4913
|
setProtectedHeader(protectedHeader) {
|
|
@@ -4981,12 +4935,12 @@ function requireSign$1() {
|
|
|
4981
4935
|
const sign_js_1 = /* @__PURE__ */ requireSign$3();
|
|
4982
4936
|
const errors_js_1 = /* @__PURE__ */ requireErrors$1();
|
|
4983
4937
|
class IndividualSignature {
|
|
4938
|
+
parent;
|
|
4939
|
+
protectedHeader;
|
|
4940
|
+
unprotectedHeader;
|
|
4941
|
+
options;
|
|
4942
|
+
key;
|
|
4984
4943
|
constructor(sig, key, options) {
|
|
4985
|
-
__publicField(this, "parent");
|
|
4986
|
-
__publicField(this, "protectedHeader");
|
|
4987
|
-
__publicField(this, "unprotectedHeader");
|
|
4988
|
-
__publicField(this, "options");
|
|
4989
|
-
__publicField(this, "key");
|
|
4990
4944
|
this.parent = sig;
|
|
4991
4945
|
this.key = key;
|
|
4992
4946
|
this.options = options;
|
|
@@ -5016,9 +4970,9 @@ function requireSign$1() {
|
|
|
5016
4970
|
}
|
|
5017
4971
|
}
|
|
5018
4972
|
class GeneralSign {
|
|
4973
|
+
_payload;
|
|
4974
|
+
_signatures = [];
|
|
5019
4975
|
constructor(payload) {
|
|
5020
|
-
__publicField(this, "_payload");
|
|
5021
|
-
__publicField(this, "_signatures", []);
|
|
5022
4976
|
this._payload = payload;
|
|
5023
4977
|
}
|
|
5024
4978
|
addSignature(key, options) {
|
|
@@ -5071,8 +5025,8 @@ function requireProduce() {
|
|
|
5071
5025
|
return input;
|
|
5072
5026
|
}
|
|
5073
5027
|
class ProduceJWT {
|
|
5028
|
+
_payload;
|
|
5074
5029
|
constructor(payload = {}) {
|
|
5075
|
-
__publicField(this, "_payload");
|
|
5076
5030
|
if (!(0, is_object_js_1.default)(payload)) {
|
|
5077
5031
|
throw new TypeError("JWT Claims Set MUST be an object");
|
|
5078
5032
|
}
|
|
@@ -5144,19 +5098,15 @@ function requireSign() {
|
|
|
5144
5098
|
const buffer_utils_js_1 = /* @__PURE__ */ requireBuffer_utils();
|
|
5145
5099
|
const produce_js_1 = /* @__PURE__ */ requireProduce();
|
|
5146
5100
|
class SignJWT extends produce_js_1.ProduceJWT {
|
|
5147
|
-
|
|
5148
|
-
super(...arguments);
|
|
5149
|
-
__publicField(this, "_protectedHeader");
|
|
5150
|
-
}
|
|
5101
|
+
_protectedHeader;
|
|
5151
5102
|
setProtectedHeader(protectedHeader) {
|
|
5152
5103
|
this._protectedHeader = protectedHeader;
|
|
5153
5104
|
return this;
|
|
5154
5105
|
}
|
|
5155
5106
|
async sign(key, options) {
|
|
5156
|
-
var _a;
|
|
5157
5107
|
const sig = new sign_js_1.CompactSign(buffer_utils_js_1.encoder.encode(JSON.stringify(this._payload)));
|
|
5158
5108
|
sig.setProtectedHeader(this._protectedHeader);
|
|
5159
|
-
if (Array.isArray(
|
|
5109
|
+
if (Array.isArray(this._protectedHeader?.crit) && this._protectedHeader.crit.includes("b64") && this._protectedHeader.b64 === false) {
|
|
5160
5110
|
throw new errors_js_1.JWTInvalid("JWTs MUST NOT use unencoded payload");
|
|
5161
5111
|
}
|
|
5162
5112
|
return sig.sign(key, options);
|
|
@@ -5176,16 +5126,13 @@ function requireEncrypt() {
|
|
|
5176
5126
|
const buffer_utils_js_1 = /* @__PURE__ */ requireBuffer_utils();
|
|
5177
5127
|
const produce_js_1 = /* @__PURE__ */ requireProduce();
|
|
5178
5128
|
class EncryptJWT extends produce_js_1.ProduceJWT {
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
__publicField(this, "_replicateSubjectAsHeader");
|
|
5187
|
-
__publicField(this, "_replicateAudienceAsHeader");
|
|
5188
|
-
}
|
|
5129
|
+
_cek;
|
|
5130
|
+
_iv;
|
|
5131
|
+
_keyManagementParameters;
|
|
5132
|
+
_protectedHeader;
|
|
5133
|
+
_replicateIssuerAsHeader;
|
|
5134
|
+
_replicateSubjectAsHeader;
|
|
5135
|
+
_replicateAudienceAsHeader;
|
|
5189
5136
|
setProtectedHeader(protectedHeader) {
|
|
5190
5137
|
if (this._protectedHeader) {
|
|
5191
5138
|
throw new TypeError("setProtectedHeader can only be called once");
|
|
@@ -5275,7 +5222,7 @@ function requireThumbprint() {
|
|
|
5275
5222
|
if (!(0, is_object_js_1.default)(jwk)) {
|
|
5276
5223
|
throw new TypeError("JWK must be an object");
|
|
5277
5224
|
}
|
|
5278
|
-
digestAlgorithm
|
|
5225
|
+
digestAlgorithm ??= "sha256";
|
|
5279
5226
|
if (digestAlgorithm !== "sha256" && digestAlgorithm !== "sha384" && digestAlgorithm !== "sha512") {
|
|
5280
5227
|
throw new TypeError('digestAlgorithm must one of "sha256", "sha384", or "sha512"');
|
|
5281
5228
|
}
|
|
@@ -5308,7 +5255,7 @@ function requireThumbprint() {
|
|
|
5308
5255
|
return (0, base64url_js_1.encode)(await (0, digest_js_1.default)(digestAlgorithm, data));
|
|
5309
5256
|
}
|
|
5310
5257
|
async function calculateJwkThumbprintUri(jwk, digestAlgorithm) {
|
|
5311
|
-
digestAlgorithm
|
|
5258
|
+
digestAlgorithm ??= "sha256";
|
|
5312
5259
|
const thumbprint2 = await calculateJwkThumbprint(jwk, digestAlgorithm);
|
|
5313
5260
|
return `urn:ietf:params:oauth:jwk-thumbprint:sha-${digestAlgorithm.slice(-3)}:${thumbprint2}`;
|
|
5314
5261
|
}
|
|
@@ -5327,7 +5274,7 @@ function requireEmbedded() {
|
|
|
5327
5274
|
async function EmbeddedJWK(protectedHeader, token) {
|
|
5328
5275
|
const joseHeader = {
|
|
5329
5276
|
...protectedHeader,
|
|
5330
|
-
...token
|
|
5277
|
+
...token?.header
|
|
5331
5278
|
};
|
|
5332
5279
|
if (!(0, is_object_js_1.default)(joseHeader.jwk)) {
|
|
5333
5280
|
throw new errors_js_1.JWSInvalid('"jwk" (JSON Web Key) Header Parameter must be a JSON object');
|
|
@@ -5376,16 +5323,16 @@ function requireLocal() {
|
|
|
5376
5323
|
return JSON.parse(JSON.stringify(obj));
|
|
5377
5324
|
}
|
|
5378
5325
|
class LocalJWKSet {
|
|
5326
|
+
_jwks;
|
|
5327
|
+
_cached = /* @__PURE__ */ new WeakMap();
|
|
5379
5328
|
constructor(jwks) {
|
|
5380
|
-
__publicField(this, "_jwks");
|
|
5381
|
-
__publicField(this, "_cached", /* @__PURE__ */ new WeakMap());
|
|
5382
5329
|
if (!isJWKSLike(jwks)) {
|
|
5383
5330
|
throw new errors_js_1.JWKSInvalid("JSON Web Key Set malformed");
|
|
5384
5331
|
}
|
|
5385
5332
|
this._jwks = clone(jwks);
|
|
5386
5333
|
}
|
|
5387
5334
|
async getKey(protectedHeader, token) {
|
|
5388
|
-
const { alg, kid } = { ...protectedHeader, ...token
|
|
5335
|
+
const { alg, kid } = { ...protectedHeader, ...token?.header };
|
|
5389
5336
|
const kty = getKtyFromAlg(alg);
|
|
5390
5337
|
const candidates = this._jwks.keys.filter((jwk2) => {
|
|
5391
5338
|
let candidate = kty === jwk2.kty;
|
|
@@ -5527,7 +5474,6 @@ function requireRemote() {
|
|
|
5527
5474
|
if (hasRequiredRemote) return remote;
|
|
5528
5475
|
hasRequiredRemote = 1;
|
|
5529
5476
|
(function(exports) {
|
|
5530
|
-
var _a, _b;
|
|
5531
5477
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5532
5478
|
exports.experimental_jwksCache = exports.jwksCache = void 0;
|
|
5533
5479
|
exports.createRemoteJWKSet = createRemoteJWKSet;
|
|
@@ -5539,12 +5485,12 @@ function requireRemote() {
|
|
|
5539
5485
|
return typeof WebSocketPair !== "undefined" || typeof navigator !== "undefined" && navigator.userAgent === "Cloudflare-Workers" || typeof EdgeRuntime !== "undefined" && EdgeRuntime === "vercel";
|
|
5540
5486
|
}
|
|
5541
5487
|
let USER_AGENT;
|
|
5542
|
-
if (typeof navigator === "undefined" || !
|
|
5488
|
+
if (typeof navigator === "undefined" || !navigator.userAgent?.startsWith?.("Mozilla/5.0 ")) {
|
|
5543
5489
|
const NAME = "jose";
|
|
5544
5490
|
const VERSION = "v5.10.0";
|
|
5545
5491
|
USER_AGENT = `${NAME}/${VERSION}`;
|
|
5546
5492
|
}
|
|
5547
|
-
exports.jwksCache = Symbol();
|
|
5493
|
+
exports.jwksCache = /* @__PURE__ */ Symbol();
|
|
5548
5494
|
function isFreshJwksCache(input, cacheMaxAge) {
|
|
5549
5495
|
if (typeof input !== "object" || input === null) {
|
|
5550
5496
|
return false;
|
|
@@ -5558,27 +5504,27 @@ function requireRemote() {
|
|
|
5558
5504
|
return true;
|
|
5559
5505
|
}
|
|
5560
5506
|
class RemoteJWKSet {
|
|
5507
|
+
_url;
|
|
5508
|
+
_timeoutDuration;
|
|
5509
|
+
_cooldownDuration;
|
|
5510
|
+
_cacheMaxAge;
|
|
5511
|
+
_jwksTimestamp;
|
|
5512
|
+
_pendingFetch;
|
|
5513
|
+
_options;
|
|
5514
|
+
_local;
|
|
5515
|
+
_cache;
|
|
5561
5516
|
constructor(url, options) {
|
|
5562
|
-
__publicField(this, "_url");
|
|
5563
|
-
__publicField(this, "_timeoutDuration");
|
|
5564
|
-
__publicField(this, "_cooldownDuration");
|
|
5565
|
-
__publicField(this, "_cacheMaxAge");
|
|
5566
|
-
__publicField(this, "_jwksTimestamp");
|
|
5567
|
-
__publicField(this, "_pendingFetch");
|
|
5568
|
-
__publicField(this, "_options");
|
|
5569
|
-
__publicField(this, "_local");
|
|
5570
|
-
__publicField(this, "_cache");
|
|
5571
5517
|
if (!(url instanceof URL)) {
|
|
5572
5518
|
throw new TypeError("url must be an instance of URL");
|
|
5573
5519
|
}
|
|
5574
5520
|
this._url = new URL(url.href);
|
|
5575
|
-
this._options = { agent: options
|
|
5576
|
-
this._timeoutDuration = typeof
|
|
5577
|
-
this._cooldownDuration = typeof
|
|
5578
|
-
this._cacheMaxAge = typeof
|
|
5579
|
-
if (
|
|
5580
|
-
this._cache = options
|
|
5581
|
-
if (isFreshJwksCache(options
|
|
5521
|
+
this._options = { agent: options?.agent, headers: options?.headers };
|
|
5522
|
+
this._timeoutDuration = typeof options?.timeoutDuration === "number" ? options?.timeoutDuration : 5e3;
|
|
5523
|
+
this._cooldownDuration = typeof options?.cooldownDuration === "number" ? options?.cooldownDuration : 3e4;
|
|
5524
|
+
this._cacheMaxAge = typeof options?.cacheMaxAge === "number" ? options?.cacheMaxAge : 6e5;
|
|
5525
|
+
if (options?.[exports.jwksCache] !== void 0) {
|
|
5526
|
+
this._cache = options?.[exports.jwksCache];
|
|
5527
|
+
if (isFreshJwksCache(options?.[exports.jwksCache], this._cacheMaxAge)) {
|
|
5582
5528
|
this._jwksTimestamp = this._cache.uat;
|
|
5583
5529
|
this._local = (0, local_js_1.createLocalJWKSet)(this._cache.jwks);
|
|
5584
5530
|
}
|
|
@@ -5615,7 +5561,7 @@ function requireRemote() {
|
|
|
5615
5561
|
headers2.set("User-Agent", USER_AGENT);
|
|
5616
5562
|
this._options.headers = Object.fromEntries(headers2.entries());
|
|
5617
5563
|
}
|
|
5618
|
-
this._pendingFetch
|
|
5564
|
+
this._pendingFetch ||= (0, fetch_jwks_js_1.default)(this._url, this._timeoutDuration, this._options).then((json) => {
|
|
5619
5565
|
this._local = (0, local_js_1.createLocalJWKSet)(json);
|
|
5620
5566
|
if (this._cache) {
|
|
5621
5567
|
this._cache.uat = Date.now();
|
|
@@ -5626,7 +5572,7 @@ function requireRemote() {
|
|
|
5626
5572
|
}).catch((err) => {
|
|
5627
5573
|
this._pendingFetch = void 0;
|
|
5628
5574
|
throw err;
|
|
5629
|
-
})
|
|
5575
|
+
});
|
|
5630
5576
|
await this._pendingFetch;
|
|
5631
5577
|
}
|
|
5632
5578
|
}
|
|
@@ -5656,10 +5602,7 @@ function requireRemote() {
|
|
|
5656
5602
|
configurable: false
|
|
5657
5603
|
},
|
|
5658
5604
|
jwks: {
|
|
5659
|
-
value: () =>
|
|
5660
|
-
var _a2;
|
|
5661
|
-
return (_a2 = set._local) == null ? void 0 : _a2.jwks();
|
|
5662
|
-
},
|
|
5605
|
+
value: () => set._local?.jwks(),
|
|
5663
5606
|
enumerable: true,
|
|
5664
5607
|
configurable: false,
|
|
5665
5608
|
writable: false
|
|
@@ -5856,7 +5799,7 @@ function requireGenerate() {
|
|
|
5856
5799
|
case "RSA-OAEP-384":
|
|
5857
5800
|
case "RSA-OAEP-512":
|
|
5858
5801
|
case "RSA1_5": {
|
|
5859
|
-
const modulusLength =
|
|
5802
|
+
const modulusLength = options?.modulusLength ?? 2048;
|
|
5860
5803
|
if (typeof modulusLength !== "number" || modulusLength < 2048) {
|
|
5861
5804
|
throw new errors_js_1.JOSENotSupported("Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used");
|
|
5862
5805
|
}
|
|
@@ -5877,7 +5820,7 @@ function requireGenerate() {
|
|
|
5877
5820
|
case "Ed25519":
|
|
5878
5821
|
return generate$1("ed25519");
|
|
5879
5822
|
case "EdDSA": {
|
|
5880
|
-
switch (options
|
|
5823
|
+
switch (options?.crv) {
|
|
5881
5824
|
case void 0:
|
|
5882
5825
|
case "Ed25519":
|
|
5883
5826
|
return generate$1("ed25519");
|
|
@@ -5891,7 +5834,7 @@ function requireGenerate() {
|
|
|
5891
5834
|
case "ECDH-ES+A128KW":
|
|
5892
5835
|
case "ECDH-ES+A192KW":
|
|
5893
5836
|
case "ECDH-ES+A256KW": {
|
|
5894
|
-
const crv =
|
|
5837
|
+
const crv = options?.crv ?? "P-256";
|
|
5895
5838
|
switch (crv) {
|
|
5896
5839
|
case void 0:
|
|
5897
5840
|
case "P-256":
|
|
@@ -6109,23 +6052,23 @@ var hasRequiredVerifyVercelOidcToken;
|
|
|
6109
6052
|
function requireVerifyVercelOidcToken() {
|
|
6110
6053
|
if (hasRequiredVerifyVercelOidcToken) return verifyVercelOidcToken_1;
|
|
6111
6054
|
hasRequiredVerifyVercelOidcToken = 1;
|
|
6112
|
-
var
|
|
6055
|
+
var __defProp = Object.defineProperty;
|
|
6113
6056
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6114
6057
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6115
6058
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6116
6059
|
var __export = (target, all) => {
|
|
6117
6060
|
for (var name in all)
|
|
6118
|
-
|
|
6061
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
6119
6062
|
};
|
|
6120
6063
|
var __copyProps = (to, from, except, desc) => {
|
|
6121
6064
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
6122
6065
|
for (let key of __getOwnPropNames(from))
|
|
6123
6066
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
6124
|
-
|
|
6067
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
6125
6068
|
}
|
|
6126
6069
|
return to;
|
|
6127
6070
|
};
|
|
6128
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
6071
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
6129
6072
|
var verify_vercel_oidc_token_exports = {};
|
|
6130
6073
|
__export(verify_vercel_oidc_token_exports, {
|
|
6131
6074
|
verifyVercelOidcToken: () => verifyVercelOidcToken
|
|
@@ -6239,23 +6182,23 @@ var hasRequiredAuthErrors;
|
|
|
6239
6182
|
function requireAuthErrors() {
|
|
6240
6183
|
if (hasRequiredAuthErrors) return authErrors;
|
|
6241
6184
|
hasRequiredAuthErrors = 1;
|
|
6242
|
-
var
|
|
6185
|
+
var __defProp = Object.defineProperty;
|
|
6243
6186
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6244
6187
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6245
6188
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6246
6189
|
var __export = (target, all) => {
|
|
6247
6190
|
for (var name in all)
|
|
6248
|
-
|
|
6191
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
6249
6192
|
};
|
|
6250
6193
|
var __copyProps = (to, from, except, desc) => {
|
|
6251
6194
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
6252
6195
|
for (let key of __getOwnPropNames(from))
|
|
6253
6196
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
6254
|
-
|
|
6197
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
6255
6198
|
}
|
|
6256
6199
|
return to;
|
|
6257
6200
|
};
|
|
6258
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
6201
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
6259
6202
|
var auth_errors_exports = {};
|
|
6260
6203
|
__export(auth_errors_exports, {
|
|
6261
6204
|
AccessTokenMissingError: () => AccessTokenMissingError,
|
|
@@ -6286,23 +6229,23 @@ var hasRequiredErrors;
|
|
|
6286
6229
|
function requireErrors() {
|
|
6287
6230
|
if (hasRequiredErrors) return errors;
|
|
6288
6231
|
hasRequiredErrors = 1;
|
|
6289
|
-
var
|
|
6232
|
+
var __defProp = Object.defineProperty;
|
|
6290
6233
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6291
6234
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6292
6235
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6293
6236
|
var __export = (target, all) => {
|
|
6294
6237
|
for (var name in all)
|
|
6295
|
-
|
|
6238
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
6296
6239
|
};
|
|
6297
6240
|
var __copyProps = (to, from, except, desc) => {
|
|
6298
6241
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
6299
6242
|
for (let key of __getOwnPropNames(from))
|
|
6300
6243
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
6301
|
-
|
|
6244
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
6302
6245
|
}
|
|
6303
6246
|
return to;
|
|
6304
6247
|
};
|
|
6305
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
6248
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
6306
6249
|
var errors_exports = {};
|
|
6307
6250
|
__export(errors_exports, {
|
|
6308
6251
|
VercelCliError: () => VercelCliError,
|
|
@@ -8396,20 +8339,20 @@ function requireEnvpath() {
|
|
|
8396
8339
|
if (hasRequiredEnvpath) return envpath;
|
|
8397
8340
|
hasRequiredEnvpath = 1;
|
|
8398
8341
|
var __create = Object.create;
|
|
8399
|
-
var
|
|
8342
|
+
var __defProp = Object.defineProperty;
|
|
8400
8343
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8401
8344
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8402
8345
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8403
8346
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8404
8347
|
var __export = (target, all) => {
|
|
8405
8348
|
for (var name in all)
|
|
8406
|
-
|
|
8349
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8407
8350
|
};
|
|
8408
8351
|
var __copyProps = (to, from, except, desc) => {
|
|
8409
8352
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
8410
8353
|
for (let key of __getOwnPropNames(from))
|
|
8411
8354
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
8412
|
-
|
|
8355
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
8413
8356
|
}
|
|
8414
8357
|
return to;
|
|
8415
8358
|
};
|
|
@@ -8418,10 +8361,10 @@ function requireEnvpath() {
|
|
|
8418
8361
|
// file that has been converted to a CommonJS file using a Babel-
|
|
8419
8362
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
8420
8363
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
8421
|
-
!mod || !mod.__esModule ?
|
|
8364
|
+
!mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
8422
8365
|
mod
|
|
8423
8366
|
));
|
|
8424
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
8367
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
8425
8368
|
var envpath_exports = {};
|
|
8426
8369
|
__export(envpath_exports, {
|
|
8427
8370
|
getEnvPath: () => getEnvPath,
|
|
@@ -8483,23 +8426,23 @@ var hasRequiredErrutils;
|
|
|
8483
8426
|
function requireErrutils() {
|
|
8484
8427
|
if (hasRequiredErrutils) return errutils;
|
|
8485
8428
|
hasRequiredErrutils = 1;
|
|
8486
|
-
var
|
|
8429
|
+
var __defProp = Object.defineProperty;
|
|
8487
8430
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8488
8431
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8489
8432
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8490
8433
|
var __export = (target, all) => {
|
|
8491
8434
|
for (var name in all)
|
|
8492
|
-
|
|
8435
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8493
8436
|
};
|
|
8494
8437
|
var __copyProps = (to, from, except, desc) => {
|
|
8495
8438
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
8496
8439
|
for (let key of __getOwnPropNames(from))
|
|
8497
8440
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
8498
|
-
|
|
8441
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
8499
8442
|
}
|
|
8500
8443
|
return to;
|
|
8501
8444
|
};
|
|
8502
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
8445
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
8503
8446
|
var errutils_exports = {};
|
|
8504
8447
|
__export(errutils_exports, {
|
|
8505
8448
|
getErrorMessage: () => getErrorMessage,
|
|
@@ -8523,20 +8466,20 @@ function requireFsutils() {
|
|
|
8523
8466
|
if (hasRequiredFsutils) return fsutils;
|
|
8524
8467
|
hasRequiredFsutils = 1;
|
|
8525
8468
|
var __create = Object.create;
|
|
8526
|
-
var
|
|
8469
|
+
var __defProp = Object.defineProperty;
|
|
8527
8470
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8528
8471
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8529
8472
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8530
8473
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8531
8474
|
var __export = (target, all) => {
|
|
8532
8475
|
for (var name in all)
|
|
8533
|
-
|
|
8476
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8534
8477
|
};
|
|
8535
8478
|
var __copyProps = (to, from, except, desc) => {
|
|
8536
8479
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
8537
8480
|
for (let key of __getOwnPropNames(from))
|
|
8538
8481
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
8539
|
-
|
|
8482
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
8540
8483
|
}
|
|
8541
8484
|
return to;
|
|
8542
8485
|
};
|
|
@@ -8545,10 +8488,10 @@ function requireFsutils() {
|
|
|
8545
8488
|
// file that has been converted to a CommonJS file using a Babel-
|
|
8546
8489
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
8547
8490
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
8548
|
-
!mod || !mod.__esModule ?
|
|
8491
|
+
!mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
8549
8492
|
mod
|
|
8550
8493
|
));
|
|
8551
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
8494
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
8552
8495
|
var fsutils_exports = {};
|
|
8553
8496
|
__export(fsutils_exports, {
|
|
8554
8497
|
getCanonicalPath: () => getCanonicalPath,
|
|
@@ -8617,20 +8560,20 @@ function requireSafety() {
|
|
|
8617
8560
|
if (hasRequiredSafety) return safety;
|
|
8618
8561
|
hasRequiredSafety = 1;
|
|
8619
8562
|
var __create = Object.create;
|
|
8620
|
-
var
|
|
8563
|
+
var __defProp = Object.defineProperty;
|
|
8621
8564
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8622
8565
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8623
8566
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8624
8567
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8625
8568
|
var __export = (target, all) => {
|
|
8626
8569
|
for (var name in all)
|
|
8627
|
-
|
|
8570
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8628
8571
|
};
|
|
8629
8572
|
var __copyProps = (to, from, except, desc) => {
|
|
8630
8573
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
8631
8574
|
for (let key of __getOwnPropNames(from))
|
|
8632
8575
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
8633
|
-
|
|
8576
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
8634
8577
|
}
|
|
8635
8578
|
return to;
|
|
8636
8579
|
};
|
|
@@ -8639,10 +8582,10 @@ function requireSafety() {
|
|
|
8639
8582
|
// file that has been converted to a CommonJS file using a Babel-
|
|
8640
8583
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
8641
8584
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
8642
|
-
!mod || !mod.__esModule ?
|
|
8585
|
+
!mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
8643
8586
|
mod
|
|
8644
8587
|
));
|
|
8645
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
8588
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
8646
8589
|
var safety_exports = {};
|
|
8647
8590
|
__export(safety_exports, {
|
|
8648
8591
|
getSkippedNodeModulesReason: () => getSkippedNodeModulesReason,
|
|
@@ -8659,7 +8602,7 @@ function requireSafety() {
|
|
|
8659
8602
|
var import_fsutils = requireFsutils();
|
|
8660
8603
|
async function getSkippedNodeModulesReason(nodeModulesDirectory, parentDirectories) {
|
|
8661
8604
|
const parentDirectory = import_node_path2.default.dirname(nodeModulesDirectory);
|
|
8662
|
-
parentDirectories
|
|
8605
|
+
parentDirectories ??= [parentDirectory];
|
|
8663
8606
|
for (const directory of parentDirectories) {
|
|
8664
8607
|
let unsafeParentReason;
|
|
8665
8608
|
try {
|
|
@@ -8785,20 +8728,20 @@ function requireLookup() {
|
|
|
8785
8728
|
if (hasRequiredLookup) return lookup;
|
|
8786
8729
|
hasRequiredLookup = 1;
|
|
8787
8730
|
var __create = Object.create;
|
|
8788
|
-
var
|
|
8731
|
+
var __defProp = Object.defineProperty;
|
|
8789
8732
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8790
8733
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8791
8734
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8792
8735
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8793
8736
|
var __export = (target, all) => {
|
|
8794
8737
|
for (var name in all)
|
|
8795
|
-
|
|
8738
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8796
8739
|
};
|
|
8797
8740
|
var __copyProps = (to, from, except, desc) => {
|
|
8798
8741
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
8799
8742
|
for (let key of __getOwnPropNames(from))
|
|
8800
8743
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
8801
|
-
|
|
8744
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
8802
8745
|
}
|
|
8803
8746
|
return to;
|
|
8804
8747
|
};
|
|
@@ -8807,10 +8750,10 @@ function requireLookup() {
|
|
|
8807
8750
|
// file that has been converted to a CommonJS file using a Babel-
|
|
8808
8751
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
8809
8752
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
8810
|
-
!mod || !mod.__esModule ?
|
|
8753
|
+
!mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
8811
8754
|
mod
|
|
8812
8755
|
));
|
|
8813
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
8756
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
8814
8757
|
var lookup_exports = {};
|
|
8815
8758
|
__export(lookup_exports, {
|
|
8816
8759
|
clearCachedCliInvocation: () => clearCachedCliInvocation,
|
|
@@ -9253,20 +9196,20 @@ function requireExec() {
|
|
|
9253
9196
|
if (hasRequiredExec) return exec;
|
|
9254
9197
|
hasRequiredExec = 1;
|
|
9255
9198
|
var __create = Object.create;
|
|
9256
|
-
var
|
|
9199
|
+
var __defProp = Object.defineProperty;
|
|
9257
9200
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9258
9201
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9259
9202
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9260
9203
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9261
9204
|
var __export = (target, all) => {
|
|
9262
9205
|
for (var name in all)
|
|
9263
|
-
|
|
9206
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9264
9207
|
};
|
|
9265
9208
|
var __copyProps = (to, from, except, desc) => {
|
|
9266
9209
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
9267
9210
|
for (let key of __getOwnPropNames(from))
|
|
9268
9211
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9269
|
-
|
|
9212
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9270
9213
|
}
|
|
9271
9214
|
return to;
|
|
9272
9215
|
};
|
|
@@ -9275,10 +9218,10 @@ function requireExec() {
|
|
|
9275
9218
|
// file that has been converted to a CommonJS file using a Babel-
|
|
9276
9219
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
9277
9220
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
9278
|
-
!mod || !mod.__esModule ?
|
|
9221
|
+
!mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
9279
9222
|
mod
|
|
9280
9223
|
));
|
|
9281
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
9224
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
9282
9225
|
var exec_exports = {};
|
|
9283
9226
|
__export(exec_exports, {
|
|
9284
9227
|
execVercelCli: () => execVercelCli
|
|
@@ -9367,23 +9310,23 @@ var hasRequiredDist$2;
|
|
|
9367
9310
|
function requireDist$2() {
|
|
9368
9311
|
if (hasRequiredDist$2) return dist$2;
|
|
9369
9312
|
hasRequiredDist$2 = 1;
|
|
9370
|
-
var
|
|
9313
|
+
var __defProp = Object.defineProperty;
|
|
9371
9314
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9372
9315
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9373
9316
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9374
9317
|
var __export = (target, all) => {
|
|
9375
9318
|
for (var name in all)
|
|
9376
|
-
|
|
9319
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9377
9320
|
};
|
|
9378
9321
|
var __copyProps = (to, from, except, desc) => {
|
|
9379
9322
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
9380
9323
|
for (let key of __getOwnPropNames(from))
|
|
9381
9324
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9382
|
-
|
|
9325
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9383
9326
|
}
|
|
9384
9327
|
return to;
|
|
9385
9328
|
};
|
|
9386
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
9329
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
9387
9330
|
var src_exports = {};
|
|
9388
9331
|
__export(src_exports, {
|
|
9389
9332
|
VercelCliError: () => import_errors.VercelCliError,
|
|
@@ -9403,7 +9346,7 @@ function requireDist$1() {
|
|
|
9403
9346
|
if (hasRequiredDist$1) return dist$1;
|
|
9404
9347
|
hasRequiredDist$1 = 1;
|
|
9405
9348
|
var __create = Object.create;
|
|
9406
|
-
var
|
|
9349
|
+
var __defProp = Object.defineProperty;
|
|
9407
9350
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9408
9351
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9409
9352
|
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
@@ -9411,12 +9354,12 @@ function requireDist$1() {
|
|
|
9411
9354
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9412
9355
|
};
|
|
9413
9356
|
var __export = (target, all) => {
|
|
9414
|
-
for (var name in all)
|
|
9357
|
+
for (var name in all) __defProp(target, name, { get: all[name], enumerable: true });
|
|
9415
9358
|
}, __copyProps = (to, from, except, desc) => {
|
|
9416
|
-
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except &&
|
|
9359
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9417
9360
|
return to;
|
|
9418
9361
|
};
|
|
9419
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(!mod || !mod.__esModule ?
|
|
9362
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(!mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
9420
9363
|
var require_lib = __commonJS({ "../../node_modules/.pnpm/os-paths@4.4.0/node_modules/os-paths/src/lib/index.js"(exports, module2) {
|
|
9421
9364
|
var os = require$$0$5, paths = path__default, isWinOS = /^win/i.test(process.platform);
|
|
9422
9365
|
function normalize_path(path3) {
|
|
@@ -9576,7 +9519,7 @@ function requireDist$1() {
|
|
|
9576
9519
|
let ratio = val / step, roundedRatio = Math.round(ratio), tolerance = 4 * Number.EPSILON * Math.max(Math.abs(ratio), 1);
|
|
9577
9520
|
return Math.abs(ratio - roundedRatio) < tolerance ? 0 : ratio - roundedRatio;
|
|
9578
9521
|
}
|
|
9579
|
-
var EVALUATING = Symbol("evaluating");
|
|
9522
|
+
var EVALUATING = /* @__PURE__ */ Symbol("evaluating");
|
|
9580
9523
|
function defineLazy(object2, key, getter) {
|
|
9581
9524
|
let value;
|
|
9582
9525
|
Object.defineProperty(object2, key, { get() {
|
|
@@ -9593,7 +9536,7 @@ function requireDist$1() {
|
|
|
9593
9536
|
}
|
|
9594
9537
|
function rawShape(def) {
|
|
9595
9538
|
let desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
9596
|
-
return
|
|
9539
|
+
return desc?.get ? desc.get.raw : desc?.value;
|
|
9597
9540
|
}
|
|
9598
9541
|
function sourceShape(schema) {
|
|
9599
9542
|
return rawShape(schema._zod.def) ?? schema._zod.def.shape;
|
|
@@ -9635,7 +9578,7 @@ function requireDist$1() {
|
|
|
9635
9578
|
return mergeDefs(schema._zod.def);
|
|
9636
9579
|
}
|
|
9637
9580
|
function getElementAtPath(obj, path3) {
|
|
9638
|
-
return path3 ? path3.reduce((acc, key) => acc
|
|
9581
|
+
return path3 ? path3.reduce((acc, key) => acc?.[key], obj) : obj;
|
|
9639
9582
|
}
|
|
9640
9583
|
function promiseAllObject(promisesObj) {
|
|
9641
9584
|
let keys = Object.keys(promisesObj), promises = keys.map((key) => promisesObj[key]);
|
|
@@ -9662,8 +9605,7 @@ function requireDist$1() {
|
|
|
9662
9605
|
return typeof data == "object" && data !== null && !Array.isArray(data);
|
|
9663
9606
|
}
|
|
9664
9607
|
var allowsEval = cached(() => {
|
|
9665
|
-
|
|
9666
|
-
if (globalConfig.jitless || typeof navigator < "u" && ((_a3 = navigator == null ? void 0 : navigator.userAgent) == null ? void 0 : _a3.includes("Cloudflare"))) return false;
|
|
9608
|
+
if (globalConfig.jitless || typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare")) return false;
|
|
9667
9609
|
try {
|
|
9668
9610
|
let F = Function;
|
|
9669
9611
|
return new F(""), true;
|
|
@@ -9714,14 +9656,14 @@ function requireDist$1() {
|
|
|
9714
9656
|
}
|
|
9715
9657
|
function clone(inst, def, params) {
|
|
9716
9658
|
let cl = new inst._zod.constr(def ?? inst._zod.def);
|
|
9717
|
-
return (!def ||
|
|
9659
|
+
return (!def || params?.parent) && (cl._zod.parent = inst), cl;
|
|
9718
9660
|
}
|
|
9719
9661
|
function normalizeParams(_params) {
|
|
9720
9662
|
let params = _params;
|
|
9721
9663
|
if (!params) return {};
|
|
9722
9664
|
if (typeof params == "string") return { error: () => params };
|
|
9723
|
-
if (
|
|
9724
|
-
if (
|
|
9665
|
+
if (params?.message !== void 0) {
|
|
9666
|
+
if (params?.error !== void 0) throw new Error("Cannot specify both `message` and `error` params");
|
|
9725
9667
|
params.error = params.message;
|
|
9726
9668
|
}
|
|
9727
9669
|
return delete params.message, typeof params.error == "string" ? { ...params, error: () => params.error } : params;
|
|
@@ -9758,10 +9700,9 @@ function requireDist$1() {
|
|
|
9758
9700
|
return mirrorShape(newShape, schema, maskedKeys(schema, mask)), clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
|
|
9759
9701
|
}
|
|
9760
9702
|
function maskedKeys(schema, mask) {
|
|
9761
|
-
var _a3;
|
|
9762
9703
|
let raw = sourceShape(schema), keys = [];
|
|
9763
9704
|
for (let key of Reflect.ownKeys(mask)) {
|
|
9764
|
-
if (!
|
|
9705
|
+
if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
9765
9706
|
mask[key] && keys.push(key);
|
|
9766
9707
|
}
|
|
9767
9708
|
return keys;
|
|
@@ -9790,9 +9731,8 @@ function requireDist$1() {
|
|
|
9790
9731
|
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
9791
9732
|
}
|
|
9792
9733
|
function merge(a, b) {
|
|
9793
|
-
|
|
9794
|
-
if (
|
|
9795
|
-
if ((_b = a._zod.def.checks) == null ? void 0 : _b.length) throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
|
|
9734
|
+
if (!b?._zod?.def) throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");
|
|
9735
|
+
if (a._zod.def.checks?.length) throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
|
|
9796
9736
|
let newShape = {};
|
|
9797
9737
|
mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a))), mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
|
|
9798
9738
|
let def = mergeDefs(a._zod.def, { shape: newShape, get catchall() {
|
|
@@ -9811,15 +9751,13 @@ function requireDist$1() {
|
|
|
9811
9751
|
return mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) => selected && !selected.has(key) ? value : new Class2({ type: "nonoptional", innerType: value })), clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
|
|
9812
9752
|
}
|
|
9813
9753
|
function aborted(x, startIndex = 0) {
|
|
9814
|
-
var _a3;
|
|
9815
9754
|
if (x.aborted === true) return true;
|
|
9816
|
-
for (let i = startIndex; i < x.issues.length; i++) if (
|
|
9755
|
+
for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue !== true) return true;
|
|
9817
9756
|
return false;
|
|
9818
9757
|
}
|
|
9819
9758
|
function explicitlyAborted(x, startIndex = 0) {
|
|
9820
|
-
var _a3;
|
|
9821
9759
|
if (x.aborted === true) return true;
|
|
9822
|
-
for (let i = startIndex; i < x.issues.length; i++) if (
|
|
9760
|
+
for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue === false) return true;
|
|
9823
9761
|
return false;
|
|
9824
9762
|
}
|
|
9825
9763
|
function prefixIssues(path3, issues) {
|
|
@@ -9829,7 +9767,7 @@ function requireDist$1() {
|
|
|
9829
9767
|
});
|
|
9830
9768
|
}
|
|
9831
9769
|
function unwrapMessage(message) {
|
|
9832
|
-
return typeof message == "string" ? message : message
|
|
9770
|
+
return typeof message == "string" ? message : message?.message;
|
|
9833
9771
|
}
|
|
9834
9772
|
function sizeCaps(defChecks) {
|
|
9835
9773
|
let caps = [];
|
|
@@ -9846,13 +9784,12 @@ function requireDist$1() {
|
|
|
9846
9784
|
for (let i = start; i < issues.length; i++) (_a3 = issues[i]).schema ?? (_a3.schema = inst);
|
|
9847
9785
|
}
|
|
9848
9786
|
function finalizeIssue(iss, ctx, config2) {
|
|
9849
|
-
var _a4, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
9850
9787
|
var _a3;
|
|
9851
|
-
let traits =
|
|
9852
|
-
|
|
9853
|
-
let schemaError = iss.schema !== iss.inst ?
|
|
9788
|
+
let traits = iss.inst?._zod?.traits;
|
|
9789
|
+
traits?.has("$ZodType") && (traits.has("$ZodCheck") ? (_a3 = iss).schema ?? (_a3.schema = iss.inst) : iss.schema = iss.inst);
|
|
9790
|
+
let schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : void 0, message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(schemaError?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input", full = {};
|
|
9854
9791
|
for (let k of Object.keys(iss)) k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__" || (full[k] = iss[k]);
|
|
9855
|
-
return full.path ?? (full.path = []), full.message = message,
|
|
9792
|
+
return full.path ?? (full.path = []), full.message = message, ctx?.reportInput && (full.input = iss.input), full;
|
|
9856
9793
|
}
|
|
9857
9794
|
function getSizableOrigin(input) {
|
|
9858
9795
|
return input instanceof Set ? "set" : input instanceof Map ? "map" : input instanceof File ? "file" : "unknown";
|
|
@@ -10039,26 +9976,22 @@ function requireDist$1() {
|
|
|
10039
9976
|
let proto2 = _.prototype;
|
|
10040
9977
|
for (let k in proto2) Object.prototype.hasOwnProperty.call(proto2, k) && (k in inst || (inst[k] = proto2[k].bind(inst)));
|
|
10041
9978
|
}
|
|
10042
|
-
let Parent =
|
|
9979
|
+
let Parent = params?.Parent ?? Object;
|
|
10043
9980
|
class Definition extends Parent {
|
|
10044
9981
|
}
|
|
10045
9982
|
Object.defineProperty(Definition, "name", { value: name });
|
|
10046
9983
|
function _(def) {
|
|
10047
|
-
|
|
10048
|
-
let inst = (params == null ? void 0 : params.Parent) ? newError(Definition) : this;
|
|
9984
|
+
let inst = params?.Parent ? newError(Definition) : this;
|
|
10049
9985
|
init(inst, def);
|
|
10050
9986
|
let deferred = inst._zod.deferred;
|
|
10051
9987
|
if (deferred) {
|
|
10052
9988
|
for (let fn of deferred) fn();
|
|
10053
9989
|
inst._zod.deferred = void 0;
|
|
10054
9990
|
}
|
|
10055
|
-
let pp =
|
|
9991
|
+
let pp = globalThis.__zod_globalConfig?.postProcessor;
|
|
10056
9992
|
return pp && pp(inst), inst;
|
|
10057
9993
|
}
|
|
10058
|
-
return Object.defineProperty(_, "init", { value: init }), Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => {
|
|
10059
|
-
var _a3, _b;
|
|
10060
|
-
return (params == null ? void 0 : params.Parent) && inst instanceof params.Parent ? true : (_b = (_a3 = inst == null ? void 0 : inst._zod) == null ? void 0 : _a3.traits) == null ? void 0 : _b.has(name);
|
|
10061
|
-
} }), Object.defineProperty(_, "name", { value: name }), _;
|
|
9994
|
+
return Object.defineProperty(_, "init", { value: init }), Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => params?.Parent && inst instanceof params.Parent ? true : inst?._zod?.traits?.has(name) }), Object.defineProperty(_, "name", { value: name }), _;
|
|
10062
9995
|
}
|
|
10063
9996
|
var $ZodAsyncError = class extends Error {
|
|
10064
9997
|
constructor() {
|
|
@@ -10126,15 +10059,15 @@ function requireDist$1() {
|
|
|
10126
10059
|
return processError(error22), fieldErrors;
|
|
10127
10060
|
}
|
|
10128
10061
|
function finalizeParams(callee, params) {
|
|
10129
|
-
return { callee:
|
|
10062
|
+
return { callee: params?.callee ?? callee, Err: params?.Err };
|
|
10130
10063
|
}
|
|
10131
10064
|
var _parse = (_Err) => {
|
|
10132
10065
|
let fn = (schema, value, _ctx, _params) => {
|
|
10133
10066
|
let ctx = _ctx ? { ..._ctx, async: false } : { async: false }, result = schema._zod.run({ value, issues: [] }, ctx);
|
|
10134
10067
|
if (result instanceof Promise) throw new $ZodAsyncError();
|
|
10135
10068
|
if (result.issues.length) {
|
|
10136
|
-
let e = new (
|
|
10137
|
-
throw captureStackTrace(e,
|
|
10069
|
+
let e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
10070
|
+
throw captureStackTrace(e, _params?.callee ?? fn), e;
|
|
10138
10071
|
}
|
|
10139
10072
|
return result.value;
|
|
10140
10073
|
};
|
|
@@ -10144,8 +10077,8 @@ function requireDist$1() {
|
|
|
10144
10077
|
let fn = async (schema, value, _ctx, params) => {
|
|
10145
10078
|
let ctx = _ctx ? { ..._ctx, async: true } : { async: true }, result = schema._zod.run({ value, issues: [] }, ctx);
|
|
10146
10079
|
if (result instanceof Promise && (result = await result), result.issues.length) {
|
|
10147
|
-
let e = new (
|
|
10148
|
-
throw captureStackTrace(e,
|
|
10080
|
+
let e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
10081
|
+
throw captureStackTrace(e, params?.callee ?? fn), e;
|
|
10149
10082
|
}
|
|
10150
10083
|
return result.value;
|
|
10151
10084
|
};
|
|
@@ -10168,7 +10101,7 @@ function requireDist$1() {
|
|
|
10168
10101
|
let ctx = _ctx ? { ..._ctx, async: true } : { async: true }, result = schema._zod.run({ value, issues: [] }, ctx);
|
|
10169
10102
|
return result instanceof Promise && (result = await result), result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
10170
10103
|
};
|
|
10171
|
-
var COMPILE_INVALID = Symbol.for("zod.compile.invalid"), COMPILE_FALLBACK = Symbol.for("zod.compile.fallback"), validate = (schema, value, _ctx) => {
|
|
10104
|
+
var COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid"), COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback"), validate = (schema, value, _ctx) => {
|
|
10172
10105
|
let validator = schema._zod.bag.validator;
|
|
10173
10106
|
if (validator !== void 0) {
|
|
10174
10107
|
if (validator(value) !== COMPILE_INVALID) return true;
|
|
@@ -10276,9 +10209,8 @@ function requireDist$1() {
|
|
|
10276
10209
|
(typeof payload.value == "bigint" ? def.value !== BigInt(0) && payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0) || payload.issues.push({ origin: typeof payload.value, code: "not_multiple_of", divisor: def.value, input: payload.value, inst, continue: !def.abort });
|
|
10277
10210
|
};
|
|
10278
10211
|
}), $ZodCheckNumberFormat = $constructor("$ZodCheckNumberFormat", (inst, def) => {
|
|
10279
|
-
var _a3;
|
|
10280
10212
|
$ZodCheck.init(inst, def), def.format = def.format || "float64";
|
|
10281
|
-
let isInt =
|
|
10213
|
+
let isInt = def.format?.includes("int"), origin = isInt ? "int" : "number", [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
|
|
10282
10214
|
inst._zod.check = (payload) => {
|
|
10283
10215
|
let input = payload.value;
|
|
10284
10216
|
if (isInt) {
|
|
@@ -10378,7 +10310,7 @@ function requireDist$1() {
|
|
|
10378
10310
|
for (let line of dedented) this.content.push(line);
|
|
10379
10311
|
}
|
|
10380
10312
|
compile() {
|
|
10381
|
-
let F = Function, content =
|
|
10313
|
+
let F = Function, content = this?.content ?? [""];
|
|
10382
10314
|
return new F(...Object.keys(this.closed), `return function (${this.args.join(", ")}) {
|
|
10383
10315
|
${content.join(`
|
|
10384
10316
|
`)}
|
|
@@ -10387,12 +10319,11 @@ ${content.join(`
|
|
|
10387
10319
|
};
|
|
10388
10320
|
var version = { major: 4, minor: 6, patch: 7 };
|
|
10389
10321
|
var $ZodType = $constructor("$ZodType", (inst, def) => {
|
|
10390
|
-
var _a4;
|
|
10391
10322
|
var _a3;
|
|
10392
10323
|
inst ?? (inst = {}), inst._zod.def = def, inst._zod.bag = inst._zod.bag || {}, inst._zod.version = version;
|
|
10393
|
-
let defChecks = inst._zod.def.checks, checks = inst._zod.traits.has("$ZodCheck") ? [inst, ...defChecks ?? []] :
|
|
10324
|
+
let defChecks = inst._zod.def.checks, checks = inst._zod.traits.has("$ZodCheck") ? [inst, ...defChecks ?? []] : defChecks?.length ? [...defChecks] : [];
|
|
10394
10325
|
for (let ch of checks) for (let fn of ch._zod.onattach) fn(inst);
|
|
10395
|
-
if (checks.length === 0) (_a3 = inst._zod).deferred ?? (_a3.deferred = []),
|
|
10326
|
+
if (checks.length === 0) (_a3 = inst._zod).deferred ?? (_a3.deferred = []), inst._zod.deferred?.push(() => {
|
|
10396
10327
|
inst._zod.run = inst._zod.parse;
|
|
10397
10328
|
});
|
|
10398
10329
|
else {
|
|
@@ -10404,7 +10335,7 @@ ${content.join(`
|
|
|
10404
10335
|
if (explicitlyAborted(payload) || !ch._zod.def.when(payload)) continue;
|
|
10405
10336
|
} else if (isAborted) continue;
|
|
10406
10337
|
let currLen = payload.issues.length, _ = ch._zod.check(payload);
|
|
10407
|
-
if (_ instanceof Promise &&
|
|
10338
|
+
if (_ instanceof Promise && ctx?.async === false) throw new $ZodAsyncError();
|
|
10408
10339
|
if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
|
|
10409
10340
|
await _, payload.issues.length !== currLen && (attachSchema(payload.issues, currLen, inst), isAborted || (isAborted = aborted(payload, currLen)));
|
|
10410
10341
|
});
|
|
@@ -10490,8 +10421,7 @@ ${content.join(`
|
|
|
10490
10421
|
return !("normalize" in def) && !("hostname" in def) && !("protocol" in def) ? canParseURL(trimmed) || URL_UNPARSEABLE : parseURLObject(trimmed, def);
|
|
10491
10422
|
}
|
|
10492
10423
|
function parseURLObject(trimmed, def) {
|
|
10493
|
-
|
|
10494
|
-
if (!def.normalize && ((_a3 = def.protocol) == null ? void 0 : _a3.source) === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) return URL_BAD_FORMAT;
|
|
10424
|
+
if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) return URL_BAD_FORMAT;
|
|
10495
10425
|
try {
|
|
10496
10426
|
if (typeof URL < "u") {
|
|
10497
10427
|
let URLStatic = URL;
|
|
@@ -10617,7 +10547,7 @@ ${content.join(`
|
|
|
10617
10547
|
let [header] = tokensParts;
|
|
10618
10548
|
if (!header) return false;
|
|
10619
10549
|
let parsedHeader = JSON.parse(atob(header));
|
|
10620
|
-
return !("typ" in parsedHeader &&
|
|
10550
|
+
return !("typ" in parsedHeader && parsedHeader?.typ !== "JWT" || !parsedHeader.alg || algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm));
|
|
10621
10551
|
} catch {
|
|
10622
10552
|
return false;
|
|
10623
10553
|
}
|
|
@@ -10661,7 +10591,7 @@ ${content.join(`
|
|
|
10661
10591
|
let cap = Math.min(...caps.map((c) => c[0])), parse2 = inst._zod.parse;
|
|
10662
10592
|
inst._zod.parse = (payload, ctx) => {
|
|
10663
10593
|
let n = size(payload.value);
|
|
10664
|
-
if (n > cap && !
|
|
10594
|
+
if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
|
|
10665
10595
|
for (let [max, ch] of sizeCaps(inst._zod.def.checks)) if (n > max && ch._zod.def.when(payload)) {
|
|
10666
10596
|
let start = payload.issues.length;
|
|
10667
10597
|
return ch._zod.check(payload), payload.issues[start].continue = false, attachSchema(payload.issues, start, inst), payload;
|
|
@@ -10677,11 +10607,11 @@ ${content.join(`
|
|
|
10677
10607
|
var $ZodArray = $constructor("$ZodArray", (inst, def) => {
|
|
10678
10608
|
$ZodType.init(inst, def);
|
|
10679
10609
|
let memo2 = globalConfig.memoizer;
|
|
10680
|
-
memo2
|
|
10610
|
+
memo2?.attach(inst), inst._zod.parse = (payload, ctx) => {
|
|
10681
10611
|
let input = payload.value;
|
|
10682
10612
|
if (!Array.isArray(input)) return payload.issues.push({ expected: "array", code: "invalid_type", input, inst }), payload;
|
|
10683
10613
|
payload.value = memo2 ? memo2.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
|
|
10684
|
-
let proms = [], abortEarly = ctx
|
|
10614
|
+
let proms = [], abortEarly = ctx?.abortEarly;
|
|
10685
10615
|
for (let i = 0; i < input.length; i++) {
|
|
10686
10616
|
let item = input[i], result = def.element._zod.run({ value: item, issues: [] }, ctx);
|
|
10687
10617
|
if (result instanceof Promise) proms.push(result.then((result2) => handleArrayResult(result2, payload, i)));
|
|
@@ -10706,9 +10636,8 @@ ${content.join(`
|
|
|
10706
10636
|
}
|
|
10707
10637
|
var NO_SYMBOL_KEYS = [];
|
|
10708
10638
|
function normalizeDef(def) {
|
|
10709
|
-
var _a3, _b, _c, _d;
|
|
10710
10639
|
let keys = Object.keys(def.shape), ownSymbols = Object.getOwnPropertySymbols(def.shape), symbolKeys = ownSymbols.length ? ownSymbols : NO_SYMBOL_KEYS, allKeys = symbolKeys.length ? [...keys, ...symbolKeys] : keys;
|
|
10711
|
-
for (let k of allKeys) if (!
|
|
10640
|
+
for (let k of allKeys) if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) throw new Error(`Invalid element at key "${String(k)}": expected a Zod schema`);
|
|
10712
10641
|
let okeys = optionalKeys(def.shape);
|
|
10713
10642
|
return { ...def, allKeys, symbolKeys, keySet: new Set(keys), numKeys: keys.length, optionalKeys: new Set(okeys) };
|
|
10714
10643
|
}
|
|
@@ -10735,7 +10664,7 @@ ${content.join(`
|
|
|
10735
10664
|
}
|
|
10736
10665
|
var $ZodObject = $constructor("$ZodObject", (inst, def) => {
|
|
10737
10666
|
$ZodType.init(inst, def);
|
|
10738
|
-
let desc = Object.getOwnPropertyDescriptor(def, "shape"), sh =
|
|
10667
|
+
let desc = Object.getOwnPropertyDescriptor(def, "shape"), sh = desc?.get ? desc.get.raw : def.shape ?? {};
|
|
10739
10668
|
if (sh) {
|
|
10740
10669
|
let get = () => {
|
|
10741
10670
|
let newSh = { ...sh };
|
|
@@ -10757,12 +10686,12 @@ ${content.join(`
|
|
|
10757
10686
|
return propValues;
|
|
10758
10687
|
});
|
|
10759
10688
|
let isObject2 = isObject, catchall = def.catchall, value, memo2 = globalConfig.memoizer;
|
|
10760
|
-
memo2
|
|
10689
|
+
memo2?.attach(inst), inst._zod.parse = (payload, ctx) => {
|
|
10761
10690
|
value ?? (value = _normalized.value);
|
|
10762
10691
|
let input = payload.value;
|
|
10763
10692
|
if (!isObject2(input)) return payload.issues.push({ expected: "object", code: "invalid_type", input, inst }), payload;
|
|
10764
10693
|
payload.value = memo2 ? memo2.alloc(inst, payload, {}, ctx) : {};
|
|
10765
|
-
let proms = [], shape = value.shape, abortEarly = ctx
|
|
10694
|
+
let proms = [], shape = value.shape, abortEarly = ctx?.abortEarly, seen = payload.issues.length;
|
|
10766
10695
|
for (let key of value.allKeys) {
|
|
10767
10696
|
if (abortEarly && payload.issues.length !== seen) {
|
|
10768
10697
|
if (aborted(payload, seen)) break;
|
|
@@ -10777,7 +10706,6 @@ ${content.join(`
|
|
|
10777
10706
|
}), $ZodObjectJIT = $constructor("$ZodObjectJIT", (inst, def) => {
|
|
10778
10707
|
$ZodObject.init(inst, def);
|
|
10779
10708
|
let superParse = inst._zod.parse, _normalized = cached(() => normalizeDef(def)), memo2 = globalConfig.memoizer, generateFastpass = (shape) => {
|
|
10780
|
-
var _a3, _b;
|
|
10781
10709
|
let normalized = _normalized.value, syms = normalized.symbolKeys, doc = new Doc(["payload", "ctx"], { shape, inst, memo: memo2, syms }), parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`, prefixStr = (id, k) => `
|
|
10782
10710
|
let ${id}_ab = false;
|
|
10783
10711
|
for (let i = 0; i < ${id}.issues.length; i++) {
|
|
@@ -10796,7 +10724,7 @@ ${content.join(`
|
|
|
10796
10724
|
doc.write(memo2 ? "const newResult = memo.alloc(inst, payload, {}, ctx);" : "const newResult = {};");
|
|
10797
10725
|
for (let key of normalized.allKeys) {
|
|
10798
10726
|
if (key === "__proto__") continue;
|
|
10799
|
-
let id = ids[key], k = typeof key == "symbol" ? `syms[${syms.indexOf(key)}]` : esc(key), isPresent = `${k} in input`, schema = shape[key], optin =
|
|
10727
|
+
let id = ids[key], k = typeof key == "symbol" ? `syms[${syms.indexOf(key)}]` : esc(key), isPresent = `${k} in input`, schema = shape[key], optin = schema?._zod?.optin, isOptionalIn = optin !== void 0, isOptionalOut = schema?._zod?.optout === "optional";
|
|
10800
10728
|
if (doc.write(`const ${id} = ${parseStr(k)};`), isOptionalIn && isOptionalOut) {
|
|
10801
10729
|
let assign = optin === "optional" ? `${id}_present` : `${id}.value !== undefined || ${id}_present`;
|
|
10802
10730
|
doc.write(`
|
|
@@ -10846,7 +10774,7 @@ ${content.join(`
|
|
|
10846
10774
|
inst._zod.parse = (payload, ctx) => {
|
|
10847
10775
|
value ?? (value = _normalized.value);
|
|
10848
10776
|
let input = payload.value;
|
|
10849
|
-
return isObject2(input) ? jit && fastEnabled &&
|
|
10777
|
+
return isObject2(input) ? jit && fastEnabled && ctx?.async === false && ctx.jitless !== true ? (fastpass || (fastpass = generateFastpass(def.shape)), payload = fastpass(payload, ctx), catchall ? handleCatchall([], input, payload, ctx, value, inst, ctx?.abortEarly === true) : payload) : superParse(payload, ctx) : (payload.issues.push({ expected: "object", code: "invalid_type", input, inst }), payload);
|
|
10850
10778
|
};
|
|
10851
10779
|
});
|
|
10852
10780
|
function handleUnionResults(results, final, inst, ctx) {
|
|
@@ -10912,10 +10840,9 @@ ${content.join(`
|
|
|
10912
10840
|
}
|
|
10913
10841
|
function handleIntersectionResults(result, left, right) {
|
|
10914
10842
|
let unrecKeys = /* @__PURE__ */ new Map(), unrecIssue, keyIssues = /* @__PURE__ */ new Map(), collect = (iss, side) => {
|
|
10915
|
-
var _a3, _b;
|
|
10916
10843
|
let keys;
|
|
10917
|
-
if (iss.code === "unrecognized_keys" && !
|
|
10918
|
-
else if (iss.code === "invalid_key" && iss.origin === "record" &&
|
|
10844
|
+
if (iss.code === "unrecognized_keys" && !iss.path?.length) unrecIssue ?? (unrecIssue = iss), keys = iss.keys;
|
|
10845
|
+
else if (iss.code === "invalid_key" && iss.origin === "record" && iss.path?.length === 1) {
|
|
10919
10846
|
let k = String(iss.path[0]);
|
|
10920
10847
|
keyIssues.has(k) || keyIssues.set(k, iss), keys = [k];
|
|
10921
10848
|
} else return false;
|
|
@@ -10959,8 +10886,7 @@ ${content.join(`
|
|
|
10959
10886
|
};
|
|
10960
10887
|
});
|
|
10961
10888
|
var $ZodTransform = $constructor("$ZodTransform", (inst, def) => {
|
|
10962
|
-
|
|
10963
|
-
$ZodType.init(inst, def), inst._zod.optin = "optional", (_a3 = globalConfig.memoizer) == null ? void 0 : _a3.guard(inst), inst._zod.parse = (payload, ctx) => {
|
|
10889
|
+
$ZodType.init(inst, def), inst._zod.optin = "optional", globalConfig.memoizer?.guard(inst), inst._zod.parse = (payload, ctx) => {
|
|
10964
10890
|
if (ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name);
|
|
10965
10891
|
let _out = def.transform(payload.value, payload);
|
|
10966
10892
|
if (ctx.async) return (_out instanceof Promise ? _out : Promise.resolve(_out)).then((output2) => (payload.value = output2, payload));
|
|
@@ -11042,13 +10968,7 @@ ${content.join(`
|
|
|
11042
10968
|
return left.issues.some((iss) => iss.code !== "unrecognized_keys") ? (left.aborted = true, left) : next._zod.run({ value: left.value, issues: left.issues }, ctx);
|
|
11043
10969
|
}
|
|
11044
10970
|
var $ZodReadonly = $constructor("$ZodReadonly", (inst, def) => {
|
|
11045
|
-
$ZodType.init(inst, def), defineLazyInternal(inst, "propValues", (zod) => zod.def.innerType._zod.propValues), defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values), defineLazyInternal(inst, "optin", (zod) => {
|
|
11046
|
-
var _a3, _b;
|
|
11047
|
-
return (_b = (_a3 = zod.def.innerType) == null ? void 0 : _a3._zod) == null ? void 0 : _b.optin;
|
|
11048
|
-
}), defineLazyInternal(inst, "optout", (zod) => {
|
|
11049
|
-
var _a3, _b;
|
|
11050
|
-
return (_b = (_a3 = zod.def.innerType) == null ? void 0 : _a3._zod) == null ? void 0 : _b.optout;
|
|
11051
|
-
}), inst._zod.parse = (payload, ctx) => {
|
|
10971
|
+
$ZodType.init(inst, def), defineLazyInternal(inst, "propValues", (zod) => zod.def.innerType._zod.propValues), defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values), defineLazyInternal(inst, "optin", (zod) => zod.def.innerType?._zod?.optin), defineLazyInternal(inst, "optout", (zod) => zod.def.innerType?._zod?.optout), inst._zod.parse = (payload, ctx) => {
|
|
11052
10972
|
if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
|
|
11053
10973
|
let result = def.innerType._zod.run(payload, ctx);
|
|
11054
10974
|
return result instanceof Promise ? result.then(handleReadonlyResult) : handleReadonlyResult(result);
|
|
@@ -11088,17 +11008,16 @@ ${content.join(`
|
|
|
11088
11008
|
if (stack.has(inst)) return PROVEN;
|
|
11089
11009
|
stack.add(inst);
|
|
11090
11010
|
let result = NONE, check = (child) => {
|
|
11091
|
-
if (result !== PROVEN &&
|
|
11011
|
+
if (result !== PROVEN && child?._zod) {
|
|
11092
11012
|
let answer = isRecursive(child, stack);
|
|
11093
11013
|
answer > result && (result = answer);
|
|
11094
11014
|
}
|
|
11095
11015
|
}, shape = (sh, spread) => {
|
|
11096
|
-
var _a3;
|
|
11097
11016
|
let answer = NONE;
|
|
11098
11017
|
for (let key of Reflect.ownKeys(sh)) {
|
|
11099
11018
|
let desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
11100
11019
|
if (!desc.enumerable) continue;
|
|
11101
|
-
let child = desc.get ? ASSUMED :
|
|
11020
|
+
let child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack) : NONE;
|
|
11102
11021
|
child > answer && (answer = child);
|
|
11103
11022
|
}
|
|
11104
11023
|
return answer;
|
|
@@ -11240,8 +11159,7 @@ ${content.join(`
|
|
|
11240
11159
|
return memo;
|
|
11241
11160
|
}
|
|
11242
11161
|
function isBackEdge(ctx, value) {
|
|
11243
|
-
|
|
11244
|
-
let backEdges = (_a3 = ctx[STATE]) == null ? void 0 : _a3.backEdges;
|
|
11162
|
+
let backEdges = ctx[STATE]?.backEdges;
|
|
11245
11163
|
return backEdges !== void 0 && isRef(value) && backEdges.has(value);
|
|
11246
11164
|
}
|
|
11247
11165
|
var error2 = () => {
|
|
@@ -11510,9 +11428,9 @@ ${content.join(`
|
|
|
11510
11428
|
return target;
|
|
11511
11429
|
}
|
|
11512
11430
|
function initializeContext(params) {
|
|
11513
|
-
let target =
|
|
11514
|
-
return target === "draft-4" && (target = "draft-04"), target === "draft-7" && (target = "draft-07"), { processors: params.processors ?? {}, metadataRegistry:
|
|
11515
|
-
}), io:
|
|
11431
|
+
let target = params?.target ?? "draft-2020-12";
|
|
11432
|
+
return target === "draft-4" && (target = "draft-04"), target === "draft-7" && (target = "draft-07"), { processors: params.processors ?? {}, metadataRegistry: params?.metadata ?? globalRegistry, target, unrepresentable: params?.unrepresentable ?? "throw", override: params?.override ?? (() => {
|
|
11433
|
+
}), io: params?.io ?? "output", counter: 0, seen: /* @__PURE__ */ new Map(), sharedDefsExtractedFor: void 0, sharedEmitDoneFor: void 0, cycles: params?.cycles ?? "ref", reused: params?.reused ?? "inline", intersections: [], deferred: [], external: params?.external ?? void 0 };
|
|
11516
11434
|
}
|
|
11517
11435
|
function handleUnrepresentable(schema, ctx, json, params, message) {
|
|
11518
11436
|
let result = typeof ctx.unrepresentable == "function" ? ctx.unrepresentable({ zodSchema: schema, path: params.path, message }) : ctx.unrepresentable;
|
|
@@ -11521,13 +11439,12 @@ ${content.join(`
|
|
|
11521
11439
|
return Object.assign(json, result), true;
|
|
11522
11440
|
}
|
|
11523
11441
|
function processSchema(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
11524
|
-
var _a4, _b;
|
|
11525
11442
|
var _a3;
|
|
11526
11443
|
let def = schema._zod.def, seen = ctx.seen.get(schema);
|
|
11527
11444
|
if (seen) return seen.count++, _params.schemaPath.includes(schema) && (seen.cycle = _params.path), seen.schema;
|
|
11528
11445
|
let result = { schema: {}, count: 1, cycle: void 0, path: _params.path };
|
|
11529
11446
|
ctx.seen.set(schema, result), ctx.sharedDefsExtractedFor = void 0, ctx.sharedEmitDoneFor = void 0;
|
|
11530
|
-
let overrideSchema =
|
|
11447
|
+
let overrideSchema = schema._zod.toJSONSchema?.();
|
|
11531
11448
|
if (overrideSchema) result.schema = overrideSchema;
|
|
11532
11449
|
else {
|
|
11533
11450
|
let params = { ..._params, schemaPath: [..._params.schemaPath, schema], path: _params.path };
|
|
@@ -11547,13 +11464,12 @@ ${content.join(`
|
|
|
11547
11464
|
return segment.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
11548
11465
|
}
|
|
11549
11466
|
function extractDefs(ctx, schema) {
|
|
11550
|
-
var _a3, _b, _c, _d;
|
|
11551
11467
|
let root = ctx.seen.get(schema);
|
|
11552
11468
|
if (!root) throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
11553
11469
|
if (ctx.external && ctx.sharedDefsExtractedFor === ctx.external) return;
|
|
11554
11470
|
let idToSchema = /* @__PURE__ */ new Map();
|
|
11555
11471
|
for (let entry of ctx.seen.entries()) {
|
|
11556
|
-
let id =
|
|
11472
|
+
let id = ctx.metadataRegistry.get(entry[0])?.id;
|
|
11557
11473
|
if (id) {
|
|
11558
11474
|
let existing = idToSchema.get(id);
|
|
11559
11475
|
if (existing && existing !== entry[0]) throw new Error(`Duplicate schema id "${id}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
@@ -11561,10 +11477,9 @@ ${content.join(`
|
|
|
11561
11477
|
}
|
|
11562
11478
|
}
|
|
11563
11479
|
let makeURI = (entry) => {
|
|
11564
|
-
var _a4;
|
|
11565
11480
|
let defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
11566
11481
|
if (ctx.external) {
|
|
11567
|
-
let externalId =
|
|
11482
|
+
let externalId = ctx.external.registry.get(entry[0])?.id, uriGenerator = ctx.external.uri ?? ((id2) => id2);
|
|
11568
11483
|
if (externalId) return { ref: uriGenerator(externalId) };
|
|
11569
11484
|
let id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
|
|
11570
11485
|
return entry[1].defId = id, { defId: id, ref: `${uriGenerator("__shared")}#/${defsSegment}/${encodeJSONPointerSegment(id)}` };
|
|
@@ -11583,7 +11498,7 @@ ${content.join(`
|
|
|
11583
11498
|
};
|
|
11584
11499
|
if (ctx.cycles === "throw") for (let entry of ctx.seen.entries()) {
|
|
11585
11500
|
let seen = entry[1];
|
|
11586
|
-
if (seen.cycle) throw new Error(`Cycle detected: #/${
|
|
11501
|
+
if (seen.cycle) throw new Error(`Cycle detected: #/${seen.cycle?.join("/")}/<root>
|
|
11587
11502
|
|
|
11588
11503
|
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
|
|
11589
11504
|
}
|
|
@@ -11594,13 +11509,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
11594
11509
|
continue;
|
|
11595
11510
|
}
|
|
11596
11511
|
if (ctx.external) {
|
|
11597
|
-
let ext =
|
|
11512
|
+
let ext = ctx.external.registry.get(entry[0])?.id;
|
|
11598
11513
|
if (schema !== entry[0] && ext) {
|
|
11599
11514
|
extractToDef(entry);
|
|
11600
11515
|
continue;
|
|
11601
11516
|
}
|
|
11602
11517
|
}
|
|
11603
|
-
if (
|
|
11518
|
+
if (ctx.metadataRegistry.get(entry[0])?.id) {
|
|
11604
11519
|
extractToDef(entry);
|
|
11605
11520
|
continue;
|
|
11606
11521
|
}
|
|
@@ -11635,7 +11550,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
11635
11550
|
return extra === void 0 || extra === false || typeof extra != "object" || extra === null ? null : Object.keys(extra).length ? extra : null;
|
|
11636
11551
|
}
|
|
11637
11552
|
function foldObjects(members2) {
|
|
11638
|
-
var _a3;
|
|
11639
11553
|
let objects = [];
|
|
11640
11554
|
for (let member of members2) {
|
|
11641
11555
|
if (typeof member != "object" || member.type !== "object") return null;
|
|
@@ -11648,7 +11562,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
11648
11562
|
if (Object.prototype.hasOwnProperty.call(properties, key)) continue;
|
|
11649
11563
|
let parts = [];
|
|
11650
11564
|
for (let other of objects) {
|
|
11651
|
-
let part =
|
|
11565
|
+
let part = other.properties?.[key] ?? undeclaredConstraint(other);
|
|
11652
11566
|
part != null && (parts.some((seen) => JSON.stringify(seen) === JSON.stringify(part)) || parts.push(part));
|
|
11653
11567
|
}
|
|
11654
11568
|
let merged = parts.length === 1 ? parts[0] : foldObjects(parts) ?? { allOf: parts };
|
|
@@ -11684,7 +11598,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
11684
11598
|
folded && (delete json.allOf, assignProps(json, folded));
|
|
11685
11599
|
}
|
|
11686
11600
|
function finalize(ctx, schema) {
|
|
11687
|
-
var _a3, _b, _c, _d;
|
|
11688
11601
|
let root = ctx.seen.get(schema);
|
|
11689
11602
|
if (!root) throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
11690
11603
|
let flattenRef = (zodSchema) => {
|
|
@@ -11701,7 +11614,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
11701
11614
|
if (parent && parent !== ref) {
|
|
11702
11615
|
flattenRef(parent);
|
|
11703
11616
|
let parentSeen = ctx.seen.get(parent);
|
|
11704
|
-
if (
|
|
11617
|
+
if (parentSeen?.schema.$ref && (schema2.$ref = parentSeen.schema.$ref, parentSeen.def)) for (let key in schema2) key === "$ref" || key === "allOf" || key in parentSeen.def && JSON.stringify(schema2[key]) === JSON.stringify(parentSeen.def[key]) && delete schema2[key];
|
|
11705
11618
|
}
|
|
11706
11619
|
ctx.override({ zodSchema, jsonSchema: schema2, path: seen.path ?? [] });
|
|
11707
11620
|
};
|
|
@@ -11712,7 +11625,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
11712
11625
|
if (ctx.intersections.length) {
|
|
11713
11626
|
let carriers = /* @__PURE__ */ new Map();
|
|
11714
11627
|
for (let seen of ctx.seen.values()) for (let json of [seen.schema, seen.def]) {
|
|
11715
|
-
let allOf = json
|
|
11628
|
+
let allOf = json?.allOf;
|
|
11716
11629
|
if (!Array.isArray(allOf)) continue;
|
|
11717
11630
|
let existing = carriers.get(allOf);
|
|
11718
11631
|
existing ? existing.push(json) : carriers.set(allOf, [json]);
|
|
@@ -11721,15 +11634,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
11721
11634
|
}
|
|
11722
11635
|
}
|
|
11723
11636
|
let result = {};
|
|
11724
|
-
if (ctx.target === "draft-2020-12" ? result.$schema = "https://json-schema.org/draft/2020-12/schema" : ctx.target === "draft-07" ? result.$schema = "http://json-schema.org/draft-07/schema#" : ctx.target === "draft-04" ? result.$schema = "http://json-schema.org/draft-04/schema#" : ctx.target,
|
|
11725
|
-
let id =
|
|
11637
|
+
if (ctx.target === "draft-2020-12" ? result.$schema = "https://json-schema.org/draft/2020-12/schema" : ctx.target === "draft-07" ? result.$schema = "http://json-schema.org/draft-07/schema#" : ctx.target === "draft-04" ? result.$schema = "http://json-schema.org/draft-04/schema#" : ctx.target, ctx.external?.uri) {
|
|
11638
|
+
let id = ctx.external.registry.get(schema)?.id;
|
|
11726
11639
|
if (!id) throw new Error("Schema is missing an `id` property");
|
|
11727
11640
|
result.$id = ctx.external.uri(id);
|
|
11728
11641
|
}
|
|
11729
11642
|
assignProps(result, root.defId ? root.schema : root.def ?? root.schema);
|
|
11730
|
-
let rootMetaId =
|
|
11643
|
+
let rootMetaId = ctx.metadataRegistry.get(schema)?.id;
|
|
11731
11644
|
rootMetaId !== void 0 && result.id === rootMetaId && delete result.id;
|
|
11732
|
-
let defs =
|
|
11645
|
+
let defs = ctx.external?.defs ?? {};
|
|
11733
11646
|
if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) for (let entry of ctx.seen.entries()) {
|
|
11734
11647
|
let seen = entry[1];
|
|
11735
11648
|
seen.def && seen.defId && (seen.def.id === seen.defId && delete seen.def.id, assignProp(defs, seen.defId, seen.def));
|
|
@@ -11798,9 +11711,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
11798
11711
|
setFormat(agg, def.format), def.pattern && addPattern(agg, def.pattern), (def.format === "base64" || def.format === "base64url") && (agg.contentEncoding = def.format), (def.local || def.precision === -1) && (agg.laxFormat = true);
|
|
11799
11712
|
}, mime_type: (agg, def) => intersectMime(agg, def.mime) };
|
|
11800
11713
|
function aggregateChecks(schema) {
|
|
11801
|
-
var _a3;
|
|
11802
11714
|
let agg = {}, def = schema._zod.def, list = schema._zod.traits.has("$ZodCheck") ? [schema, ...def.checks ?? []] : def.checks ?? [];
|
|
11803
|
-
for (let ch of list)
|
|
11715
|
+
for (let ch of list) contributors[ch._zod.def.check]?.(agg, ch._zod.def);
|
|
11804
11716
|
let bag = schema._zod.bag;
|
|
11805
11717
|
bag.minimum !== void 0 && narrowMin(agg, "minimum", bag.minimum), bag.exclusiveMinimum !== void 0 && narrowMin(agg, "exclusiveMinimum", bag.exclusiveMinimum), bag.maximum !== void 0 && narrowMax(agg, "maximum", bag.maximum), bag.exclusiveMaximum !== void 0 && narrowMax(agg, "exclusiveMaximum", bag.exclusiveMaximum), bag.multipleOf !== void 0 && addDivisor(agg, bag.multipleOf), bag.format !== void 0 && (agg.format ?? (agg.format = bag.format), bag.format.includes("int") && (agg.isInt = true)), bag.mime && intersectMime(agg, bag.mime);
|
|
11806
11718
|
for (let pattern of bag.patterns ?? []) addPattern(agg, pattern);
|
|
@@ -11872,7 +11784,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
11872
11784
|
return def.type === "pipe" && def.in._zod.traits.has("$ZodTransform") ? inputOptin(def.out) : def.type === "catch" ? inputOptin(def.innerType) : schema._zod.optin;
|
|
11873
11785
|
}
|
|
11874
11786
|
var objectProcessor = (schema, ctx, _json, params) => {
|
|
11875
|
-
var _a3;
|
|
11876
11787
|
let json = _json, def = schema._zod.def, shape = def.shape;
|
|
11877
11788
|
if (Object.getOwnPropertySymbols(shape).length && handleUnrepresentable(schema, ctx, json, params, "Symbol keys cannot be represented in JSON Schema")) return;
|
|
11878
11789
|
json.type = "object", json.properties = {};
|
|
@@ -11882,7 +11793,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
11882
11793
|
let field = def.shape[key];
|
|
11883
11794
|
(ctx.io === "input" ? inputOptin(field) === void 0 : field._zod.optout === void 0) && requiredKeys.push(key);
|
|
11884
11795
|
}
|
|
11885
|
-
requiredKeys.length > 0 && (json.required = requiredKeys),
|
|
11796
|
+
requiredKeys.length > 0 && (json.required = requiredKeys), def.catchall?._zod.def.type === "never" ? json.additionalProperties = false : def.catchall ? def.catchall && (json.additionalProperties = processSchema(def.catchall, ctx, { ...params, path: [...params.path, "additionalProperties"] })) : ctx.io === "output" && (json.additionalProperties = false);
|
|
11886
11797
|
}, unionProcessor = (schema, ctx, json, params) => {
|
|
11887
11798
|
let def = schema._zod.def, isExclusive = def.inclusive === false, options = def.options.map((x, i) => processSchema(x, ctx, { ...params, path: [...params.path, isExclusive ? "oneOf" : "anyOf", i] }));
|
|
11888
11799
|
isExclusive ? json.oneOf = options : json.anyOf = options;
|
|
@@ -11898,7 +11809,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
11898
11809
|
processSchema(def.innerType, ctx, params);
|
|
11899
11810
|
let seen = ctx.seen.get(schema);
|
|
11900
11811
|
seen.ref = def.innerType;
|
|
11901
|
-
}, UNREPRESENTABLE_DEFAULT = Symbol();
|
|
11812
|
+
}, UNREPRESENTABLE_DEFAULT = /* @__PURE__ */ Symbol();
|
|
11902
11813
|
function serializeDefaultValue(value, schema, ctx, json, params) {
|
|
11903
11814
|
let unrepresentable = false, serialized = JSON.stringify(value, (_, val) => typeof val != "bigint" ? val : (unrepresentable = true, null));
|
|
11904
11815
|
return unrepresentable ? (handleUnrepresentable(schema, ctx, json, params, "BigInt defaults cannot be represented in JSON Schema"), UNREPRESENTABLE_DEFAULT) : JSON.parse(serialized);
|
|
@@ -12045,7 +11956,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
12045
11956
|
}, async safeParseAsync(data, params) {
|
|
12046
11957
|
return safeParseAsync(this, data, params);
|
|
12047
11958
|
}, get spa() {
|
|
12048
|
-
return this
|
|
11959
|
+
return this?.safeParseAsync;
|
|
12049
11960
|
}, set spa(value) {
|
|
12050
11961
|
util_exports.own(this, "spa", value);
|
|
12051
11962
|
}, validate(data, params) {
|
|
@@ -12071,8 +11982,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
12071
11982
|
}, toJSONSchema(params) {
|
|
12072
11983
|
return createToJSONSchemaMethod(this, {})(params);
|
|
12073
11984
|
}, get description() {
|
|
12074
|
-
|
|
12075
|
-
return (_a3 = globalRegistry.get(this)) == null ? void 0 : _a3.description;
|
|
11985
|
+
return globalRegistry.get(this)?.description;
|
|
12076
11986
|
}, get _def() {
|
|
12077
11987
|
return this._zod.def;
|
|
12078
11988
|
} }), _ZodString = $constructor("_ZodString", (inst, def) => {
|
|
@@ -12242,7 +12152,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
12242
12152
|
return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
|
|
12243
12153
|
}, isInt: (inst) => {
|
|
12244
12154
|
let { isInt, multipleOf } = aggregateChecks(inst);
|
|
12245
|
-
return !!isInt || !!
|
|
12155
|
+
return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
|
|
12246
12156
|
}, format: (inst) => aggregateChecks(inst).format ?? null }, { gt(value, params) {
|
|
12247
12157
|
return this.check(_gt(value, params));
|
|
12248
12158
|
}, gte(value, params) {
|
|
@@ -12657,20 +12567,20 @@ function requireTokenIo() {
|
|
|
12657
12567
|
if (hasRequiredTokenIo) return tokenIo;
|
|
12658
12568
|
hasRequiredTokenIo = 1;
|
|
12659
12569
|
var __create = Object.create;
|
|
12660
|
-
var
|
|
12570
|
+
var __defProp = Object.defineProperty;
|
|
12661
12571
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12662
12572
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
12663
12573
|
var __getProtoOf = Object.getPrototypeOf;
|
|
12664
12574
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12665
12575
|
var __export = (target, all) => {
|
|
12666
12576
|
for (var name in all)
|
|
12667
|
-
|
|
12577
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12668
12578
|
};
|
|
12669
12579
|
var __copyProps = (to, from, except, desc) => {
|
|
12670
12580
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
12671
12581
|
for (let key of __getOwnPropNames(from))
|
|
12672
12582
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12673
|
-
|
|
12583
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12674
12584
|
}
|
|
12675
12585
|
return to;
|
|
12676
12586
|
};
|
|
@@ -12679,10 +12589,10 @@ function requireTokenIo() {
|
|
|
12679
12589
|
// file that has been converted to a CommonJS file using a Babel-
|
|
12680
12590
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
12681
12591
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
12682
|
-
!mod || !mod.__esModule ?
|
|
12592
|
+
!mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
12683
12593
|
mod
|
|
12684
12594
|
));
|
|
12685
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
12595
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
12686
12596
|
var token_io_exports = {};
|
|
12687
12597
|
__export(token_io_exports, {
|
|
12688
12598
|
findRootDir: () => findRootDir,
|
|
@@ -12735,23 +12645,23 @@ var hasRequiredOauth;
|
|
|
12735
12645
|
function requireOauth() {
|
|
12736
12646
|
if (hasRequiredOauth) return oauth;
|
|
12737
12647
|
hasRequiredOauth = 1;
|
|
12738
|
-
var
|
|
12648
|
+
var __defProp = Object.defineProperty;
|
|
12739
12649
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12740
12650
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
12741
12651
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12742
12652
|
var __export = (target, all) => {
|
|
12743
12653
|
for (var name in all)
|
|
12744
|
-
|
|
12654
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12745
12655
|
};
|
|
12746
12656
|
var __copyProps = (to, from, except, desc) => {
|
|
12747
12657
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
12748
12658
|
for (let key of __getOwnPropNames(from))
|
|
12749
12659
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12750
|
-
|
|
12660
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12751
12661
|
}
|
|
12752
12662
|
return to;
|
|
12753
12663
|
};
|
|
12754
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
12664
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
12755
12665
|
var oauth_exports = {};
|
|
12756
12666
|
__export(oauth_exports, {
|
|
12757
12667
|
processTokenResponse: () => processTokenResponse,
|
|
@@ -12825,20 +12735,20 @@ function requireTokenUtil() {
|
|
|
12825
12735
|
if (hasRequiredTokenUtil) return tokenUtil;
|
|
12826
12736
|
hasRequiredTokenUtil = 1;
|
|
12827
12737
|
var __create = Object.create;
|
|
12828
|
-
var
|
|
12738
|
+
var __defProp = Object.defineProperty;
|
|
12829
12739
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12830
12740
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
12831
12741
|
var __getProtoOf = Object.getPrototypeOf;
|
|
12832
12742
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12833
12743
|
var __export = (target, all) => {
|
|
12834
12744
|
for (var name in all)
|
|
12835
|
-
|
|
12745
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12836
12746
|
};
|
|
12837
12747
|
var __copyProps = (to, from, except, desc) => {
|
|
12838
12748
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
12839
12749
|
for (let key of __getOwnPropNames(from))
|
|
12840
12750
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12841
|
-
|
|
12751
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12842
12752
|
}
|
|
12843
12753
|
return to;
|
|
12844
12754
|
};
|
|
@@ -12847,10 +12757,10 @@ function requireTokenUtil() {
|
|
|
12847
12757
|
// file that has been converted to a CommonJS file using a Babel-
|
|
12848
12758
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
12849
12759
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
12850
|
-
!mod || !mod.__esModule ?
|
|
12760
|
+
!mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
12851
12761
|
mod
|
|
12852
12762
|
));
|
|
12853
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
12763
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
12854
12764
|
var token_util_exports = {};
|
|
12855
12765
|
__export(token_util_exports, {
|
|
12856
12766
|
assertVercelOidcTokenResponse: () => assertVercelOidcTokenResponse,
|
|
@@ -12878,7 +12788,7 @@ function requireTokenUtil() {
|
|
|
12878
12788
|
if (!authConfig || !authConfig.token && !authConfig.refreshToken) {
|
|
12879
12789
|
throw new import_auth_errors.AccessTokenMissingError();
|
|
12880
12790
|
}
|
|
12881
|
-
if (isValidAccessToken(authConfig, options
|
|
12791
|
+
if (isValidAccessToken(authConfig, options?.expirationBufferMs)) {
|
|
12882
12792
|
return authConfig.token;
|
|
12883
12793
|
}
|
|
12884
12794
|
if (!authConfig.refreshToken) {
|
|
@@ -12927,7 +12837,6 @@ function requireTokenUtil() {
|
|
|
12927
12837
|
}
|
|
12928
12838
|
}
|
|
12929
12839
|
async function getVercelOidcTokenFromCli(projectId, teamId) {
|
|
12930
|
-
var _a;
|
|
12931
12840
|
assertCliId(projectId, "project");
|
|
12932
12841
|
if (teamId) {
|
|
12933
12842
|
assertCliId(teamId, "team");
|
|
@@ -12958,7 +12867,7 @@ function requireTokenUtil() {
|
|
|
12958
12867
|
throw error2;
|
|
12959
12868
|
}
|
|
12960
12869
|
let message = error2 instanceof Error ? error2.message : "";
|
|
12961
|
-
const stderr = error2 instanceof import_cli_exec.VercelCliError ?
|
|
12870
|
+
const stderr = error2 instanceof import_cli_exec.VercelCliError ? error2.stderr?.trim() : void 0;
|
|
12962
12871
|
if (stderr && !message.includes(stderr)) {
|
|
12963
12872
|
message = `${message}
|
|
12964
12873
|
${stderr}`.trim();
|
|
@@ -13067,23 +12976,23 @@ var hasRequiredDist;
|
|
|
13067
12976
|
function requireDist() {
|
|
13068
12977
|
if (hasRequiredDist) return dist;
|
|
13069
12978
|
hasRequiredDist = 1;
|
|
13070
|
-
var
|
|
12979
|
+
var __defProp = Object.defineProperty;
|
|
13071
12980
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13072
12981
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13073
12982
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
13074
12983
|
var __export = (target, all) => {
|
|
13075
12984
|
for (var name in all)
|
|
13076
|
-
|
|
12985
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13077
12986
|
};
|
|
13078
12987
|
var __copyProps = (to, from, except, desc) => {
|
|
13079
12988
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
13080
12989
|
for (let key of __getOwnPropNames(from))
|
|
13081
12990
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13082
|
-
|
|
12991
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13083
12992
|
}
|
|
13084
12993
|
return to;
|
|
13085
12994
|
};
|
|
13086
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
12995
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
13087
12996
|
var src_exports = {};
|
|
13088
12997
|
__export(src_exports, {
|
|
13089
12998
|
AccessTokenMissingError: () => import_auth_errors.AccessTokenMissingError,
|
|
@@ -13110,23 +13019,23 @@ var hasRequiredAffinity;
|
|
|
13110
13019
|
function requireAffinity() {
|
|
13111
13020
|
if (hasRequiredAffinity) return affinity;
|
|
13112
13021
|
hasRequiredAffinity = 1;
|
|
13113
|
-
var
|
|
13022
|
+
var __defProp = Object.defineProperty;
|
|
13114
13023
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13115
13024
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13116
13025
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
13117
13026
|
var __export = (target, all) => {
|
|
13118
13027
|
for (var name in all)
|
|
13119
|
-
|
|
13028
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13120
13029
|
};
|
|
13121
13030
|
var __copyProps = (to, from, except, desc) => {
|
|
13122
13031
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
13123
13032
|
for (let key of __getOwnPropNames(from))
|
|
13124
13033
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13125
|
-
|
|
13034
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13126
13035
|
}
|
|
13127
13036
|
return to;
|
|
13128
13037
|
};
|
|
13129
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
13038
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
13130
13039
|
var affinity_exports = {};
|
|
13131
13040
|
__export(affinity_exports, {
|
|
13132
13041
|
unstable_getAffinityHeaders: () => unstable_getAffinityHeaders,
|
|
@@ -13137,8 +13046,7 @@ function requireAffinity() {
|
|
|
13137
13046
|
var import_get_context = requireGetContext$1();
|
|
13138
13047
|
const AFFINITY_ID_HEADER = "x-vercel-affinity-id";
|
|
13139
13048
|
function unstable_getAffinityId() {
|
|
13140
|
-
|
|
13141
|
-
return (_a = (0, import_get_context.getContext)().headers) == null ? void 0 : _a[AFFINITY_ID_HEADER];
|
|
13049
|
+
return (0, import_get_context.getContext)().headers?.[AFFINITY_ID_HEADER];
|
|
13142
13050
|
}
|
|
13143
13051
|
async function unstable_getAffinityHeaders(options) {
|
|
13144
13052
|
const { affinityId, oidc } = options;
|
|
@@ -13160,23 +13068,23 @@ var hasRequiredFunctions;
|
|
|
13160
13068
|
function requireFunctions() {
|
|
13161
13069
|
if (hasRequiredFunctions) return functions;
|
|
13162
13070
|
hasRequiredFunctions = 1;
|
|
13163
|
-
var
|
|
13071
|
+
var __defProp = Object.defineProperty;
|
|
13164
13072
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13165
13073
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13166
13074
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
13167
13075
|
var __export = (target, all) => {
|
|
13168
13076
|
for (var name in all)
|
|
13169
|
-
|
|
13077
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13170
13078
|
};
|
|
13171
13079
|
var __copyProps = (to, from, except, desc) => {
|
|
13172
13080
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
13173
13081
|
for (let key of __getOwnPropNames(from))
|
|
13174
13082
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13175
|
-
|
|
13083
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13176
13084
|
}
|
|
13177
13085
|
return to;
|
|
13178
13086
|
};
|
|
13179
|
-
var __toCommonJS = (mod) => __copyProps(
|
|
13087
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
13180
13088
|
var src_exports = {};
|
|
13181
13089
|
__export(src_exports, {
|
|
13182
13090
|
addCacheTag: () => import_addcachetag.addCacheTag,
|