@authhero/cloudflare-adapter 0.7.0 → 1.1.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.
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var ot = Object.defineProperty;
|
|
2
2
|
var dt = (r, e, t) => e in r ? ot(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
-
var
|
|
3
|
+
var Ve = (r, e, t) => dt(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import ct from "wretch";
|
|
5
|
-
var
|
|
5
|
+
var H = class extends Error {
|
|
6
6
|
constructor(e = 500, t) {
|
|
7
7
|
super(t == null ? void 0 : t.message, { cause: t == null ? void 0 : t.cause });
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
Ve(this, "res");
|
|
9
|
+
Ve(this, "status");
|
|
10
10
|
this.res = t == null ? void 0 : t.res, this.status = e;
|
|
11
11
|
}
|
|
12
12
|
getResponse() {
|
|
@@ -38,12 +38,12 @@ const ut = (r, e) => e.skipDedupe || e.method !== "GET", lt = (r, e) => e.method
|
|
|
38
38
|
return n.delete(o), Promise.reject(u);
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
-
}, pt = (r, e) => r * e, mt = (r) => r && r.ok,
|
|
41
|
+
}, pt = (r, e) => r * e, mt = (r) => r && r.ok, yt = ({ delayTimer: r = 500, delayRamp: e = pt, maxAttempts: t = 10, until: n = mt, onRetry: s = null, retryOnNetworkError: a = !1, resolveWithLatestResponse: i = !1, skip: o } = {}) => (u) => (d, p) => {
|
|
42
42
|
let k = 0;
|
|
43
43
|
if (o && o(d, p))
|
|
44
44
|
return u(d, p);
|
|
45
45
|
const O = (w, P) => Promise.resolve(n(w, P)).then((Ne) => Ne ? w && i ? w : P ? Promise.reject(P) : w : (k++, !t || k <= t ? new Promise(($) => {
|
|
46
|
-
const
|
|
46
|
+
const be = e(r, k);
|
|
47
47
|
setTimeout(() => {
|
|
48
48
|
typeof s == "function" ? Promise.resolve(s({
|
|
49
49
|
response: w,
|
|
@@ -51,10 +51,10 @@ const ut = (r, e) => e.skipDedupe || e.method !== "GET", lt = (r, e) => e.method
|
|
|
51
51
|
url: d,
|
|
52
52
|
options: p
|
|
53
53
|
})).then((B = {}) => {
|
|
54
|
-
var
|
|
55
|
-
$(u((
|
|
54
|
+
var te, re;
|
|
55
|
+
$(u((te = B && B.url) !== null && te !== void 0 ? te : d, (re = B && B.options) !== null && re !== void 0 ? re : p));
|
|
56
56
|
}) : $(u(d, p));
|
|
57
|
-
},
|
|
57
|
+
}, be);
|
|
58
58
|
}).then(O).catch(($) => {
|
|
59
59
|
if (!a)
|
|
60
60
|
throw $;
|
|
@@ -66,7 +66,7 @@ const ut = (r, e) => e.skipDedupe || e.method !== "GET", lt = (r, e) => e.method
|
|
|
66
66
|
return O(null, w);
|
|
67
67
|
});
|
|
68
68
|
};
|
|
69
|
-
function
|
|
69
|
+
function _t(r, e) {
|
|
70
70
|
var t = {};
|
|
71
71
|
for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && e.indexOf(n) < 0 && (t[n] = r[n]);
|
|
72
72
|
if (r != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -78,7 +78,7 @@ function vt(r, e) {
|
|
|
78
78
|
var t;
|
|
79
79
|
return ((t = r == null ? void 0 : r._def) === null || t === void 0 ? void 0 : t.typeName) === e;
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function ne(r, e) {
|
|
82
82
|
const t = r.ZodType.prototype[e];
|
|
83
83
|
r.ZodType.prototype[e] = function(...n) {
|
|
84
84
|
const s = t.apply(this, n);
|
|
@@ -90,24 +90,24 @@ function gt(r) {
|
|
|
90
90
|
return;
|
|
91
91
|
r.ZodType.prototype.openapi = function(s, a) {
|
|
92
92
|
var i, o, u, d, p, k;
|
|
93
|
-
const O = typeof s == "string" ? a : s, w = O ?? {}, { param: P } = w, Ne =
|
|
93
|
+
const O = typeof s == "string" ? a : s, w = O ?? {}, { param: P } = w, Ne = _t(w, ["param"]), $ = Object.assign(Object.assign({}, (i = this._def.openapi) === null || i === void 0 ? void 0 : i._internal), typeof s == "string" ? { refId: s } : void 0), be = Object.assign(Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o.metadata), Ne), !((d = (u = this._def.openapi) === null || u === void 0 ? void 0 : u.metadata) === null || d === void 0) && d.param || P ? {
|
|
94
94
|
param: Object.assign(Object.assign({}, (k = (p = this._def.openapi) === null || p === void 0 ? void 0 : p.metadata) === null || k === void 0 ? void 0 : k.param), P)
|
|
95
|
-
} : void 0), B = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys($).length > 0 ? { _internal: $ } : void 0), Object.keys(
|
|
95
|
+
} : void 0), B = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys($).length > 0 ? { _internal: $ } : void 0), Object.keys(be).length > 0 ? { metadata: be } : void 0) }));
|
|
96
96
|
if (vt(this, "ZodObject")) {
|
|
97
|
-
const
|
|
98
|
-
B.extend = function(...
|
|
97
|
+
const te = this.extend;
|
|
98
|
+
B.extend = function(...re) {
|
|
99
99
|
var Re, Ie, Ae, Me, Pe, $e;
|
|
100
|
-
const
|
|
101
|
-
return
|
|
100
|
+
const De = te.apply(this, re);
|
|
101
|
+
return De._def.openapi = {
|
|
102
102
|
_internal: {
|
|
103
103
|
extendedFrom: !((Ie = (Re = this._def.openapi) === null || Re === void 0 ? void 0 : Re._internal) === null || Ie === void 0) && Ie.refId ? { refId: (Me = (Ae = this._def.openapi) === null || Ae === void 0 ? void 0 : Ae._internal) === null || Me === void 0 ? void 0 : Me.refId, schema: this } : (Pe = this._def.openapi) === null || Pe === void 0 ? void 0 : Pe._internal.extendedFrom
|
|
104
104
|
},
|
|
105
|
-
metadata: ($e =
|
|
106
|
-
},
|
|
105
|
+
metadata: ($e = De._def.openapi) === null || $e === void 0 ? void 0 : $e.metadata
|
|
106
|
+
}, De;
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
109
|
return B;
|
|
110
|
-
},
|
|
110
|
+
}, ne(r, "optional"), ne(r, "nullable"), ne(r, "default"), ne(r, "transform"), ne(r, "refine");
|
|
111
111
|
const e = r.ZodObject.prototype.deepPartial;
|
|
112
112
|
r.ZodObject.prototype.deepPartial = function() {
|
|
113
113
|
const s = this._def.shape(), a = e.apply(this), i = a._def.shape();
|
|
@@ -193,7 +193,7 @@ const f = x.arrayToEnum([
|
|
|
193
193
|
"never",
|
|
194
194
|
"map",
|
|
195
195
|
"set"
|
|
196
|
-
]),
|
|
196
|
+
]), D = (r) => {
|
|
197
197
|
switch (typeof r) {
|
|
198
198
|
case "undefined":
|
|
199
199
|
return f.undefined;
|
|
@@ -292,7 +292,7 @@ class S extends Error {
|
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
S.create = (r) => new S(r);
|
|
295
|
-
const
|
|
295
|
+
const Q = (r, e) => {
|
|
296
296
|
let t;
|
|
297
297
|
switch (r.code) {
|
|
298
298
|
case c.invalid_type:
|
|
@@ -348,7 +348,7 @@ const X = (r, e) => {
|
|
|
348
348
|
}
|
|
349
349
|
return { message: t };
|
|
350
350
|
};
|
|
351
|
-
let Xe =
|
|
351
|
+
let Xe = Q;
|
|
352
352
|
function bt(r) {
|
|
353
353
|
Xe = r;
|
|
354
354
|
}
|
|
@@ -385,7 +385,7 @@ function l(r, e) {
|
|
|
385
385
|
r.common.contextualErrorMap,
|
|
386
386
|
r.schemaErrorMap,
|
|
387
387
|
t,
|
|
388
|
-
t ===
|
|
388
|
+
t === Q ? void 0 : Q
|
|
389
389
|
// then global default map
|
|
390
390
|
].filter((s) => !!s)
|
|
391
391
|
});
|
|
@@ -405,7 +405,7 @@ class T {
|
|
|
405
405
|
const n = [];
|
|
406
406
|
for (const s of t) {
|
|
407
407
|
if (s.status === "aborted")
|
|
408
|
-
return
|
|
408
|
+
return _;
|
|
409
409
|
s.status === "dirty" && e.dirty(), n.push(s.value);
|
|
410
410
|
}
|
|
411
411
|
return { status: e.value, value: n };
|
|
@@ -426,15 +426,15 @@ class T {
|
|
|
426
426
|
for (const s of t) {
|
|
427
427
|
const { key: a, value: i } = s;
|
|
428
428
|
if (a.status === "aborted" || i.status === "aborted")
|
|
429
|
-
return
|
|
429
|
+
return _;
|
|
430
430
|
a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value < "u" || s.alwaysSet) && (n[a.value] = i.value);
|
|
431
431
|
}
|
|
432
432
|
return { status: e.value, value: n };
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
|
-
const
|
|
435
|
+
const _ = Object.freeze({
|
|
436
436
|
status: "aborted"
|
|
437
|
-
}),
|
|
437
|
+
}), X = (r) => ({ status: "dirty", value: r }), Z = (r) => ({ status: "valid", value: r }), We = (r) => r.status === "aborted", qe = (r) => r.status === "dirty", ie = (r) => r.status === "valid", oe = (r) => typeof Promise < "u" && r instanceof Promise;
|
|
438
438
|
function Te(r, e, t, n) {
|
|
439
439
|
if (typeof e == "function" ? r !== e || !n : !e.has(r)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
440
440
|
return e.get(r);
|
|
@@ -447,7 +447,7 @@ var m;
|
|
|
447
447
|
(function(r) {
|
|
448
448
|
r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
449
449
|
})(m || (m = {}));
|
|
450
|
-
var
|
|
450
|
+
var se, ae;
|
|
451
451
|
class R {
|
|
452
452
|
constructor(e, t, n, s) {
|
|
453
453
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = s;
|
|
@@ -457,7 +457,7 @@ class R {
|
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
459
|
const Ye = (r, e) => {
|
|
460
|
-
if (
|
|
460
|
+
if (ie(e))
|
|
461
461
|
return { success: !0, data: e.value };
|
|
462
462
|
if (!r.common.issues.length)
|
|
463
463
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -491,13 +491,13 @@ class g {
|
|
|
491
491
|
return this._def.description;
|
|
492
492
|
}
|
|
493
493
|
_getType(e) {
|
|
494
|
-
return
|
|
494
|
+
return D(e.data);
|
|
495
495
|
}
|
|
496
496
|
_getOrReturnCtx(e, t) {
|
|
497
497
|
return t || {
|
|
498
498
|
common: e.parent.common,
|
|
499
499
|
data: e.data,
|
|
500
|
-
parsedType:
|
|
500
|
+
parsedType: D(e.data),
|
|
501
501
|
schemaErrorMap: this._def.errorMap,
|
|
502
502
|
path: e.path,
|
|
503
503
|
parent: e.parent
|
|
@@ -509,7 +509,7 @@ class g {
|
|
|
509
509
|
ctx: {
|
|
510
510
|
common: e.parent.common,
|
|
511
511
|
data: e.data,
|
|
512
|
-
parsedType:
|
|
512
|
+
parsedType: D(e.data),
|
|
513
513
|
schemaErrorMap: this._def.errorMap,
|
|
514
514
|
path: e.path,
|
|
515
515
|
parent: e.parent
|
|
@@ -518,7 +518,7 @@ class g {
|
|
|
518
518
|
}
|
|
519
519
|
_parseSync(e) {
|
|
520
520
|
const t = this._parse(e);
|
|
521
|
-
if (
|
|
521
|
+
if (oe(t))
|
|
522
522
|
throw new Error("Synchronous parse encountered promise.");
|
|
523
523
|
return t;
|
|
524
524
|
}
|
|
@@ -544,7 +544,7 @@ class g {
|
|
|
544
544
|
schemaErrorMap: this._def.errorMap,
|
|
545
545
|
parent: null,
|
|
546
546
|
data: e,
|
|
547
|
-
parsedType:
|
|
547
|
+
parsedType: D(e)
|
|
548
548
|
}, a = this._parseSync({ data: e, path: s.path, parent: s });
|
|
549
549
|
return Ye(s, a);
|
|
550
550
|
}
|
|
@@ -565,8 +565,8 @@ class g {
|
|
|
565
565
|
schemaErrorMap: this._def.errorMap,
|
|
566
566
|
parent: null,
|
|
567
567
|
data: e,
|
|
568
|
-
parsedType:
|
|
569
|
-
}, s = this._parse({ data: e, path: n.path, parent: n }), a = await (
|
|
568
|
+
parsedType: D(e)
|
|
569
|
+
}, s = this._parse({ data: e, path: n.path, parent: n }), a = await (oe(s) ? s : Promise.resolve(s));
|
|
570
570
|
return Ye(n, a);
|
|
571
571
|
}
|
|
572
572
|
refine(e, t) {
|
|
@@ -585,7 +585,7 @@ class g {
|
|
|
585
585
|
_refinement(e) {
|
|
586
586
|
return new C({
|
|
587
587
|
schema: this,
|
|
588
|
-
typeName:
|
|
588
|
+
typeName: y.ZodEffects,
|
|
589
589
|
effect: { type: "refinement", refinement: e }
|
|
590
590
|
});
|
|
591
591
|
}
|
|
@@ -605,19 +605,19 @@ class g {
|
|
|
605
605
|
return E.create(this, this._def);
|
|
606
606
|
}
|
|
607
607
|
promise() {
|
|
608
|
-
return
|
|
608
|
+
return ee.create(this, this._def);
|
|
609
609
|
}
|
|
610
610
|
or(e) {
|
|
611
|
-
return
|
|
611
|
+
return le.create([this, e], this._def);
|
|
612
612
|
}
|
|
613
613
|
and(e) {
|
|
614
|
-
return
|
|
614
|
+
return fe.create(this, e, this._def);
|
|
615
615
|
}
|
|
616
616
|
transform(e) {
|
|
617
617
|
return new C({
|
|
618
618
|
...v(this._def),
|
|
619
619
|
schema: this,
|
|
620
|
-
typeName:
|
|
620
|
+
typeName: y.ZodEffects,
|
|
621
621
|
effect: { type: "transform", transform: e }
|
|
622
622
|
});
|
|
623
623
|
}
|
|
@@ -627,23 +627,23 @@ class g {
|
|
|
627
627
|
...v(this._def),
|
|
628
628
|
innerType: this,
|
|
629
629
|
defaultValue: t,
|
|
630
|
-
typeName:
|
|
630
|
+
typeName: y.ZodDefault
|
|
631
631
|
});
|
|
632
632
|
}
|
|
633
633
|
brand() {
|
|
634
634
|
return new He({
|
|
635
|
-
typeName:
|
|
635
|
+
typeName: y.ZodBranded,
|
|
636
636
|
type: this,
|
|
637
637
|
...v(this._def)
|
|
638
638
|
});
|
|
639
639
|
}
|
|
640
640
|
catch(e) {
|
|
641
641
|
const t = typeof e == "function" ? e : () => e;
|
|
642
|
-
return new
|
|
642
|
+
return new ve({
|
|
643
643
|
...v(this._def),
|
|
644
644
|
innerType: this,
|
|
645
645
|
catchValue: t,
|
|
646
|
-
typeName:
|
|
646
|
+
typeName: y.ZodCatch
|
|
647
647
|
});
|
|
648
648
|
}
|
|
649
649
|
describe(e) {
|
|
@@ -654,10 +654,10 @@ class g {
|
|
|
654
654
|
});
|
|
655
655
|
}
|
|
656
656
|
pipe(e) {
|
|
657
|
-
return
|
|
657
|
+
return xe.create(this, e);
|
|
658
658
|
}
|
|
659
659
|
readonly() {
|
|
660
|
-
return
|
|
660
|
+
return ge.create(this);
|
|
661
661
|
}
|
|
662
662
|
isOptional() {
|
|
663
663
|
return this.safeParse(void 0).success;
|
|
@@ -692,7 +692,7 @@ class j extends g {
|
|
|
692
692
|
code: c.invalid_type,
|
|
693
693
|
expected: f.string,
|
|
694
694
|
received: a.parsedType
|
|
695
|
-
}),
|
|
695
|
+
}), _;
|
|
696
696
|
}
|
|
697
697
|
const n = new T();
|
|
698
698
|
let s;
|
|
@@ -1037,7 +1037,7 @@ j.create = (r) => {
|
|
|
1037
1037
|
var e;
|
|
1038
1038
|
return new j({
|
|
1039
1039
|
checks: [],
|
|
1040
|
-
typeName:
|
|
1040
|
+
typeName: y.ZodString,
|
|
1041
1041
|
coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1,
|
|
1042
1042
|
...v(r)
|
|
1043
1043
|
});
|
|
@@ -1046,7 +1046,7 @@ function $t(r, e) {
|
|
|
1046
1046
|
const t = (r.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, s = t > n ? t : n, a = parseInt(r.toFixed(s).replace(".", "")), i = parseInt(e.toFixed(s).replace(".", ""));
|
|
1047
1047
|
return a % i / Math.pow(10, s);
|
|
1048
1048
|
}
|
|
1049
|
-
class
|
|
1049
|
+
class V extends g {
|
|
1050
1050
|
constructor() {
|
|
1051
1051
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1052
1052
|
}
|
|
@@ -1057,7 +1057,7 @@ class D extends g {
|
|
|
1057
1057
|
code: c.invalid_type,
|
|
1058
1058
|
expected: f.number,
|
|
1059
1059
|
received: a.parsedType
|
|
1060
|
-
}),
|
|
1060
|
+
}), _;
|
|
1061
1061
|
}
|
|
1062
1062
|
let n;
|
|
1063
1063
|
const s = new T();
|
|
@@ -1104,7 +1104,7 @@ class D extends g {
|
|
|
1104
1104
|
return this.setLimit("max", e, !1, m.toString(t));
|
|
1105
1105
|
}
|
|
1106
1106
|
setLimit(e, t, n, s) {
|
|
1107
|
-
return new
|
|
1107
|
+
return new V({
|
|
1108
1108
|
...this._def,
|
|
1109
1109
|
checks: [
|
|
1110
1110
|
...this._def.checks,
|
|
@@ -1118,7 +1118,7 @@ class D extends g {
|
|
|
1118
1118
|
});
|
|
1119
1119
|
}
|
|
1120
1120
|
_addCheck(e) {
|
|
1121
|
-
return new
|
|
1121
|
+
return new V({
|
|
1122
1122
|
...this._def,
|
|
1123
1123
|
checks: [...this._def.checks, e]
|
|
1124
1124
|
});
|
|
@@ -1212,9 +1212,9 @@ class D extends g {
|
|
|
1212
1212
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
1213
1213
|
}
|
|
1214
1214
|
}
|
|
1215
|
-
|
|
1215
|
+
V.create = (r) => new V({
|
|
1216
1216
|
checks: [],
|
|
1217
|
-
typeName:
|
|
1217
|
+
typeName: y.ZodNumber,
|
|
1218
1218
|
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
1219
1219
|
...v(r)
|
|
1220
1220
|
});
|
|
@@ -1229,7 +1229,7 @@ class L extends g {
|
|
|
1229
1229
|
code: c.invalid_type,
|
|
1230
1230
|
expected: f.bigint,
|
|
1231
1231
|
received: a.parsedType
|
|
1232
|
-
}),
|
|
1232
|
+
}), _;
|
|
1233
1233
|
}
|
|
1234
1234
|
let n;
|
|
1235
1235
|
const s = new T();
|
|
@@ -1341,12 +1341,12 @@ L.create = (r) => {
|
|
|
1341
1341
|
var e;
|
|
1342
1342
|
return new L({
|
|
1343
1343
|
checks: [],
|
|
1344
|
-
typeName:
|
|
1344
|
+
typeName: y.ZodBigInt,
|
|
1345
1345
|
coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1,
|
|
1346
1346
|
...v(r)
|
|
1347
1347
|
});
|
|
1348
1348
|
};
|
|
1349
|
-
class
|
|
1349
|
+
class de extends g {
|
|
1350
1350
|
_parse(e) {
|
|
1351
1351
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
|
|
1352
1352
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1354,13 +1354,13 @@ class oe extends g {
|
|
|
1354
1354
|
code: c.invalid_type,
|
|
1355
1355
|
expected: f.boolean,
|
|
1356
1356
|
received: n.parsedType
|
|
1357
|
-
}),
|
|
1357
|
+
}), _;
|
|
1358
1358
|
}
|
|
1359
1359
|
return Z(e.data);
|
|
1360
1360
|
}
|
|
1361
1361
|
}
|
|
1362
|
-
|
|
1363
|
-
typeName:
|
|
1362
|
+
de.create = (r) => new de({
|
|
1363
|
+
typeName: y.ZodBoolean,
|
|
1364
1364
|
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
1365
1365
|
...v(r)
|
|
1366
1366
|
});
|
|
@@ -1372,13 +1372,13 @@ class q extends g {
|
|
|
1372
1372
|
code: c.invalid_type,
|
|
1373
1373
|
expected: f.date,
|
|
1374
1374
|
received: a.parsedType
|
|
1375
|
-
}),
|
|
1375
|
+
}), _;
|
|
1376
1376
|
}
|
|
1377
1377
|
if (isNaN(e.data.getTime())) {
|
|
1378
1378
|
const a = this._getOrReturnCtx(e);
|
|
1379
1379
|
return l(a, {
|
|
1380
1380
|
code: c.invalid_date
|
|
1381
|
-
}),
|
|
1381
|
+
}), _;
|
|
1382
1382
|
}
|
|
1383
1383
|
const n = new T();
|
|
1384
1384
|
let s;
|
|
@@ -1439,7 +1439,7 @@ class q extends g {
|
|
|
1439
1439
|
q.create = (r) => new q({
|
|
1440
1440
|
checks: [],
|
|
1441
1441
|
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
1442
|
-
typeName:
|
|
1442
|
+
typeName: y.ZodDate,
|
|
1443
1443
|
...v(r)
|
|
1444
1444
|
});
|
|
1445
1445
|
class Ze extends g {
|
|
@@ -1450,16 +1450,16 @@ class Ze extends g {
|
|
|
1450
1450
|
code: c.invalid_type,
|
|
1451
1451
|
expected: f.symbol,
|
|
1452
1452
|
received: n.parsedType
|
|
1453
|
-
}),
|
|
1453
|
+
}), _;
|
|
1454
1454
|
}
|
|
1455
1455
|
return Z(e.data);
|
|
1456
1456
|
}
|
|
1457
1457
|
}
|
|
1458
1458
|
Ze.create = (r) => new Ze({
|
|
1459
|
-
typeName:
|
|
1459
|
+
typeName: y.ZodSymbol,
|
|
1460
1460
|
...v(r)
|
|
1461
1461
|
});
|
|
1462
|
-
class
|
|
1462
|
+
class ce extends g {
|
|
1463
1463
|
_parse(e) {
|
|
1464
1464
|
if (this._getType(e) !== f.undefined) {
|
|
1465
1465
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1467,16 +1467,16 @@ class de extends g {
|
|
|
1467
1467
|
code: c.invalid_type,
|
|
1468
1468
|
expected: f.undefined,
|
|
1469
1469
|
received: n.parsedType
|
|
1470
|
-
}),
|
|
1470
|
+
}), _;
|
|
1471
1471
|
}
|
|
1472
1472
|
return Z(e.data);
|
|
1473
1473
|
}
|
|
1474
1474
|
}
|
|
1475
|
-
|
|
1476
|
-
typeName:
|
|
1475
|
+
ce.create = (r) => new ce({
|
|
1476
|
+
typeName: y.ZodUndefined,
|
|
1477
1477
|
...v(r)
|
|
1478
1478
|
});
|
|
1479
|
-
class
|
|
1479
|
+
class ue extends g {
|
|
1480
1480
|
_parse(e) {
|
|
1481
1481
|
if (this._getType(e) !== f.null) {
|
|
1482
1482
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1484,16 +1484,16 @@ class ce extends g {
|
|
|
1484
1484
|
code: c.invalid_type,
|
|
1485
1485
|
expected: f.null,
|
|
1486
1486
|
received: n.parsedType
|
|
1487
|
-
}),
|
|
1487
|
+
}), _;
|
|
1488
1488
|
}
|
|
1489
1489
|
return Z(e.data);
|
|
1490
1490
|
}
|
|
1491
1491
|
}
|
|
1492
|
-
|
|
1493
|
-
typeName:
|
|
1492
|
+
ue.create = (r) => new ue({
|
|
1493
|
+
typeName: y.ZodNull,
|
|
1494
1494
|
...v(r)
|
|
1495
1495
|
});
|
|
1496
|
-
class
|
|
1496
|
+
class F extends g {
|
|
1497
1497
|
constructor() {
|
|
1498
1498
|
super(...arguments), this._any = !0;
|
|
1499
1499
|
}
|
|
@@ -1501,8 +1501,8 @@ class K extends g {
|
|
|
1501
1501
|
return Z(e.data);
|
|
1502
1502
|
}
|
|
1503
1503
|
}
|
|
1504
|
-
|
|
1505
|
-
typeName:
|
|
1504
|
+
F.create = (r) => new F({
|
|
1505
|
+
typeName: y.ZodAny,
|
|
1506
1506
|
...v(r)
|
|
1507
1507
|
});
|
|
1508
1508
|
class W extends g {
|
|
@@ -1514,7 +1514,7 @@ class W extends g {
|
|
|
1514
1514
|
}
|
|
1515
1515
|
}
|
|
1516
1516
|
W.create = (r) => new W({
|
|
1517
|
-
typeName:
|
|
1517
|
+
typeName: y.ZodUnknown,
|
|
1518
1518
|
...v(r)
|
|
1519
1519
|
});
|
|
1520
1520
|
class M extends g {
|
|
@@ -1524,11 +1524,11 @@ class M extends g {
|
|
|
1524
1524
|
code: c.invalid_type,
|
|
1525
1525
|
expected: f.never,
|
|
1526
1526
|
received: t.parsedType
|
|
1527
|
-
}),
|
|
1527
|
+
}), _;
|
|
1528
1528
|
}
|
|
1529
1529
|
}
|
|
1530
1530
|
M.create = (r) => new M({
|
|
1531
|
-
typeName:
|
|
1531
|
+
typeName: y.ZodNever,
|
|
1532
1532
|
...v(r)
|
|
1533
1533
|
});
|
|
1534
1534
|
class Se extends g {
|
|
@@ -1539,13 +1539,13 @@ class Se extends g {
|
|
|
1539
1539
|
code: c.invalid_type,
|
|
1540
1540
|
expected: f.void,
|
|
1541
1541
|
received: n.parsedType
|
|
1542
|
-
}),
|
|
1542
|
+
}), _;
|
|
1543
1543
|
}
|
|
1544
1544
|
return Z(e.data);
|
|
1545
1545
|
}
|
|
1546
1546
|
}
|
|
1547
1547
|
Se.create = (r) => new Se({
|
|
1548
|
-
typeName:
|
|
1548
|
+
typeName: y.ZodVoid,
|
|
1549
1549
|
...v(r)
|
|
1550
1550
|
});
|
|
1551
1551
|
class E extends g {
|
|
@@ -1556,7 +1556,7 @@ class E extends g {
|
|
|
1556
1556
|
code: c.invalid_type,
|
|
1557
1557
|
expected: f.array,
|
|
1558
1558
|
received: t.parsedType
|
|
1559
|
-
}),
|
|
1559
|
+
}), _;
|
|
1560
1560
|
if (s.exactLength !== null) {
|
|
1561
1561
|
const i = t.data.length > s.exactLength.value, o = t.data.length < s.exactLength.value;
|
|
1562
1562
|
(i || o) && (l(t, {
|
|
@@ -1618,15 +1618,15 @@ E.create = (r, e) => new E({
|
|
|
1618
1618
|
minLength: null,
|
|
1619
1619
|
maxLength: null,
|
|
1620
1620
|
exactLength: null,
|
|
1621
|
-
typeName:
|
|
1621
|
+
typeName: y.ZodArray,
|
|
1622
1622
|
...v(e)
|
|
1623
1623
|
});
|
|
1624
|
-
function
|
|
1624
|
+
function G(r) {
|
|
1625
1625
|
if (r instanceof b) {
|
|
1626
1626
|
const e = {};
|
|
1627
1627
|
for (const t in r.shape) {
|
|
1628
1628
|
const n = r.shape[t];
|
|
1629
|
-
e[t] = N.create(
|
|
1629
|
+
e[t] = N.create(G(n));
|
|
1630
1630
|
}
|
|
1631
1631
|
return new b({
|
|
1632
1632
|
...r._def,
|
|
@@ -1634,8 +1634,8 @@ function H(r) {
|
|
|
1634
1634
|
});
|
|
1635
1635
|
} else return r instanceof E ? new E({
|
|
1636
1636
|
...r._def,
|
|
1637
|
-
type:
|
|
1638
|
-
}) : r instanceof N ? N.create(
|
|
1637
|
+
type: G(r.element)
|
|
1638
|
+
}) : r instanceof N ? N.create(G(r.unwrap())) : r instanceof z ? z.create(G(r.unwrap())) : r instanceof I ? I.create(r.items.map((e) => G(e))) : r;
|
|
1639
1639
|
}
|
|
1640
1640
|
class b extends g {
|
|
1641
1641
|
constructor() {
|
|
@@ -1654,7 +1654,7 @@ class b extends g {
|
|
|
1654
1654
|
code: c.invalid_type,
|
|
1655
1655
|
expected: f.object,
|
|
1656
1656
|
received: d.parsedType
|
|
1657
|
-
}),
|
|
1657
|
+
}), _;
|
|
1658
1658
|
}
|
|
1659
1659
|
const { status: n, ctx: s } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
|
|
1660
1660
|
if (!(this._def.catchall instanceof M && this._def.unknownKeys === "strip"))
|
|
@@ -1781,7 +1781,7 @@ class b extends g {
|
|
|
1781
1781
|
...this._def.shape(),
|
|
1782
1782
|
...e._def.shape()
|
|
1783
1783
|
}),
|
|
1784
|
-
typeName:
|
|
1784
|
+
typeName: y.ZodObject
|
|
1785
1785
|
});
|
|
1786
1786
|
}
|
|
1787
1787
|
// merge<
|
|
@@ -1871,7 +1871,7 @@ class b extends g {
|
|
|
1871
1871
|
* @deprecated
|
|
1872
1872
|
*/
|
|
1873
1873
|
deepPartial() {
|
|
1874
|
-
return
|
|
1874
|
+
return G(this);
|
|
1875
1875
|
}
|
|
1876
1876
|
partial(e) {
|
|
1877
1877
|
const t = {};
|
|
@@ -1907,24 +1907,24 @@ b.create = (r, e) => new b({
|
|
|
1907
1907
|
shape: () => r,
|
|
1908
1908
|
unknownKeys: "strip",
|
|
1909
1909
|
catchall: M.create(),
|
|
1910
|
-
typeName:
|
|
1910
|
+
typeName: y.ZodObject,
|
|
1911
1911
|
...v(e)
|
|
1912
1912
|
});
|
|
1913
1913
|
b.strictCreate = (r, e) => new b({
|
|
1914
1914
|
shape: () => r,
|
|
1915
1915
|
unknownKeys: "strict",
|
|
1916
1916
|
catchall: M.create(),
|
|
1917
|
-
typeName:
|
|
1917
|
+
typeName: y.ZodObject,
|
|
1918
1918
|
...v(e)
|
|
1919
1919
|
});
|
|
1920
1920
|
b.lazycreate = (r, e) => new b({
|
|
1921
1921
|
shape: r,
|
|
1922
1922
|
unknownKeys: "strip",
|
|
1923
1923
|
catchall: M.create(),
|
|
1924
|
-
typeName:
|
|
1924
|
+
typeName: y.ZodObject,
|
|
1925
1925
|
...v(e)
|
|
1926
1926
|
});
|
|
1927
|
-
class
|
|
1927
|
+
class le extends g {
|
|
1928
1928
|
_parse(e) {
|
|
1929
1929
|
const { ctx: t } = this._processInputParams(e), n = this._def.options;
|
|
1930
1930
|
function s(a) {
|
|
@@ -1938,7 +1938,7 @@ class ue extends g {
|
|
|
1938
1938
|
return l(t, {
|
|
1939
1939
|
code: c.invalid_union,
|
|
1940
1940
|
unionErrors: i
|
|
1941
|
-
}),
|
|
1941
|
+
}), _;
|
|
1942
1942
|
}
|
|
1943
1943
|
if (t.common.async)
|
|
1944
1944
|
return Promise.all(n.map(async (a) => {
|
|
@@ -1985,19 +1985,19 @@ class ue extends g {
|
|
|
1985
1985
|
return l(t, {
|
|
1986
1986
|
code: c.invalid_union,
|
|
1987
1987
|
unionErrors: o
|
|
1988
|
-
}),
|
|
1988
|
+
}), _;
|
|
1989
1989
|
}
|
|
1990
1990
|
}
|
|
1991
1991
|
get options() {
|
|
1992
1992
|
return this._def.options;
|
|
1993
1993
|
}
|
|
1994
1994
|
}
|
|
1995
|
-
|
|
1995
|
+
le.create = (r, e) => new le({
|
|
1996
1996
|
options: r,
|
|
1997
|
-
typeName:
|
|
1997
|
+
typeName: y.ZodUnion,
|
|
1998
1998
|
...v(e)
|
|
1999
1999
|
});
|
|
2000
|
-
const A = (r) => r instanceof
|
|
2000
|
+
const A = (r) => r instanceof pe ? A(r.schema) : r instanceof C ? A(r.innerType()) : r instanceof me ? [r.value] : r instanceof U ? r.options : r instanceof ye ? x.objectValues(r.enum) : r instanceof _e ? A(r._def.innerType) : r instanceof ce ? [void 0] : r instanceof ue ? [null] : r instanceof N ? [void 0, ...A(r.unwrap())] : r instanceof z ? [null, ...A(r.unwrap())] : r instanceof He || r instanceof ge ? A(r.unwrap()) : r instanceof ve ? A(r._def.innerType) : [];
|
|
2001
2001
|
class Ce extends g {
|
|
2002
2002
|
_parse(e) {
|
|
2003
2003
|
const { ctx: t } = this._processInputParams(e);
|
|
@@ -2006,7 +2006,7 @@ class Ce extends g {
|
|
|
2006
2006
|
code: c.invalid_type,
|
|
2007
2007
|
expected: f.object,
|
|
2008
2008
|
received: t.parsedType
|
|
2009
|
-
}),
|
|
2009
|
+
}), _;
|
|
2010
2010
|
const n = this.discriminator, s = t.data[n], a = this.optionsMap.get(s);
|
|
2011
2011
|
return a ? t.common.async ? a._parseAsync({
|
|
2012
2012
|
data: t.data,
|
|
@@ -2020,7 +2020,7 @@ class Ce extends g {
|
|
|
2020
2020
|
code: c.invalid_union_discriminator,
|
|
2021
2021
|
options: Array.from(this.optionsMap.keys()),
|
|
2022
2022
|
path: [n]
|
|
2023
|
-
}),
|
|
2023
|
+
}), _);
|
|
2024
2024
|
}
|
|
2025
2025
|
get discriminator() {
|
|
2026
2026
|
return this._def.discriminator;
|
|
@@ -2052,7 +2052,7 @@ class Ce extends g {
|
|
|
2052
2052
|
}
|
|
2053
2053
|
}
|
|
2054
2054
|
return new Ce({
|
|
2055
|
-
typeName:
|
|
2055
|
+
typeName: y.ZodDiscriminatedUnion,
|
|
2056
2056
|
discriminator: e,
|
|
2057
2057
|
options: t,
|
|
2058
2058
|
optionsMap: s,
|
|
@@ -2061,7 +2061,7 @@ class Ce extends g {
|
|
|
2061
2061
|
}
|
|
2062
2062
|
}
|
|
2063
2063
|
function Je(r, e) {
|
|
2064
|
-
const t =
|
|
2064
|
+
const t = D(r), n = D(e);
|
|
2065
2065
|
if (r === e)
|
|
2066
2066
|
return { valid: !0, data: r };
|
|
2067
2067
|
if (t === f.object && n === f.object) {
|
|
@@ -2086,15 +2086,15 @@ function Je(r, e) {
|
|
|
2086
2086
|
return { valid: !0, data: s };
|
|
2087
2087
|
} else return t === f.date && n === f.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
|
|
2088
2088
|
}
|
|
2089
|
-
class
|
|
2089
|
+
class fe extends g {
|
|
2090
2090
|
_parse(e) {
|
|
2091
2091
|
const { status: t, ctx: n } = this._processInputParams(e), s = (a, i) => {
|
|
2092
2092
|
if (We(a) || We(i))
|
|
2093
|
-
return
|
|
2093
|
+
return _;
|
|
2094
2094
|
const o = Je(a.value, i.value);
|
|
2095
2095
|
return o.valid ? ((qe(a) || qe(i)) && t.dirty(), { status: t.value, value: o.data }) : (l(n, {
|
|
2096
2096
|
code: c.invalid_intersection_types
|
|
2097
|
-
}),
|
|
2097
|
+
}), _);
|
|
2098
2098
|
};
|
|
2099
2099
|
return n.common.async ? Promise.all([
|
|
2100
2100
|
this._def.left._parseAsync({
|
|
@@ -2118,10 +2118,10 @@ class le extends g {
|
|
|
2118
2118
|
}));
|
|
2119
2119
|
}
|
|
2120
2120
|
}
|
|
2121
|
-
|
|
2121
|
+
fe.create = (r, e, t) => new fe({
|
|
2122
2122
|
left: r,
|
|
2123
2123
|
right: e,
|
|
2124
|
-
typeName:
|
|
2124
|
+
typeName: y.ZodIntersection,
|
|
2125
2125
|
...v(t)
|
|
2126
2126
|
});
|
|
2127
2127
|
class I extends g {
|
|
@@ -2132,7 +2132,7 @@ class I extends g {
|
|
|
2132
2132
|
code: c.invalid_type,
|
|
2133
2133
|
expected: f.array,
|
|
2134
2134
|
received: n.parsedType
|
|
2135
|
-
}),
|
|
2135
|
+
}), _;
|
|
2136
2136
|
if (n.data.length < this._def.items.length)
|
|
2137
2137
|
return l(n, {
|
|
2138
2138
|
code: c.too_small,
|
|
@@ -2140,7 +2140,7 @@ class I extends g {
|
|
|
2140
2140
|
inclusive: !0,
|
|
2141
2141
|
exact: !1,
|
|
2142
2142
|
type: "array"
|
|
2143
|
-
}),
|
|
2143
|
+
}), _;
|
|
2144
2144
|
!this._def.rest && n.data.length > this._def.items.length && (l(n, {
|
|
2145
2145
|
code: c.too_big,
|
|
2146
2146
|
maximum: this._def.items.length,
|
|
@@ -2169,12 +2169,12 @@ I.create = (r, e) => {
|
|
|
2169
2169
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2170
2170
|
return new I({
|
|
2171
2171
|
items: r,
|
|
2172
|
-
typeName:
|
|
2172
|
+
typeName: y.ZodTuple,
|
|
2173
2173
|
rest: null,
|
|
2174
2174
|
...v(e)
|
|
2175
2175
|
});
|
|
2176
2176
|
};
|
|
2177
|
-
class
|
|
2177
|
+
class he extends g {
|
|
2178
2178
|
get keySchema() {
|
|
2179
2179
|
return this._def.keyType;
|
|
2180
2180
|
}
|
|
@@ -2188,7 +2188,7 @@ class fe extends g {
|
|
|
2188
2188
|
code: c.invalid_type,
|
|
2189
2189
|
expected: f.object,
|
|
2190
2190
|
received: n.parsedType
|
|
2191
|
-
}),
|
|
2191
|
+
}), _;
|
|
2192
2192
|
const s = [], a = this._def.keyType, i = this._def.valueType;
|
|
2193
2193
|
for (const o in n.data)
|
|
2194
2194
|
s.push({
|
|
@@ -2202,15 +2202,15 @@ class fe extends g {
|
|
|
2202
2202
|
return this._def.valueType;
|
|
2203
2203
|
}
|
|
2204
2204
|
static create(e, t, n) {
|
|
2205
|
-
return t instanceof g ? new
|
|
2205
|
+
return t instanceof g ? new he({
|
|
2206
2206
|
keyType: e,
|
|
2207
2207
|
valueType: t,
|
|
2208
|
-
typeName:
|
|
2208
|
+
typeName: y.ZodRecord,
|
|
2209
2209
|
...v(n)
|
|
2210
|
-
}) : new
|
|
2210
|
+
}) : new he({
|
|
2211
2211
|
keyType: j.create(),
|
|
2212
2212
|
valueType: e,
|
|
2213
|
-
typeName:
|
|
2213
|
+
typeName: y.ZodRecord,
|
|
2214
2214
|
...v(t)
|
|
2215
2215
|
});
|
|
2216
2216
|
}
|
|
@@ -2229,7 +2229,7 @@ class Oe extends g {
|
|
|
2229
2229
|
code: c.invalid_type,
|
|
2230
2230
|
expected: f.map,
|
|
2231
2231
|
received: n.parsedType
|
|
2232
|
-
}),
|
|
2232
|
+
}), _;
|
|
2233
2233
|
const s = this._def.keyType, a = this._def.valueType, i = [...n.data.entries()].map(([o, u], d) => ({
|
|
2234
2234
|
key: s._parse(new R(n, o, n.path, [d, "key"])),
|
|
2235
2235
|
value: a._parse(new R(n, u, n.path, [d, "value"]))
|
|
@@ -2240,7 +2240,7 @@ class Oe extends g {
|
|
|
2240
2240
|
for (const u of i) {
|
|
2241
2241
|
const d = await u.key, p = await u.value;
|
|
2242
2242
|
if (d.status === "aborted" || p.status === "aborted")
|
|
2243
|
-
return
|
|
2243
|
+
return _;
|
|
2244
2244
|
(d.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(d.value, p.value);
|
|
2245
2245
|
}
|
|
2246
2246
|
return { status: t.value, value: o };
|
|
@@ -2250,7 +2250,7 @@ class Oe extends g {
|
|
|
2250
2250
|
for (const u of i) {
|
|
2251
2251
|
const d = u.key, p = u.value;
|
|
2252
2252
|
if (d.status === "aborted" || p.status === "aborted")
|
|
2253
|
-
return
|
|
2253
|
+
return _;
|
|
2254
2254
|
(d.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(d.value, p.value);
|
|
2255
2255
|
}
|
|
2256
2256
|
return { status: t.value, value: o };
|
|
@@ -2260,7 +2260,7 @@ class Oe extends g {
|
|
|
2260
2260
|
Oe.create = (r, e, t) => new Oe({
|
|
2261
2261
|
valueType: e,
|
|
2262
2262
|
keyType: r,
|
|
2263
|
-
typeName:
|
|
2263
|
+
typeName: y.ZodMap,
|
|
2264
2264
|
...v(t)
|
|
2265
2265
|
});
|
|
2266
2266
|
class J extends g {
|
|
@@ -2271,7 +2271,7 @@ class J extends g {
|
|
|
2271
2271
|
code: c.invalid_type,
|
|
2272
2272
|
expected: f.set,
|
|
2273
2273
|
received: n.parsedType
|
|
2274
|
-
}),
|
|
2274
|
+
}), _;
|
|
2275
2275
|
const s = this._def;
|
|
2276
2276
|
s.minSize !== null && n.data.size < s.minSize.value && (l(n, {
|
|
2277
2277
|
code: c.too_small,
|
|
@@ -2293,7 +2293,7 @@ class J extends g {
|
|
|
2293
2293
|
const d = /* @__PURE__ */ new Set();
|
|
2294
2294
|
for (const p of u) {
|
|
2295
2295
|
if (p.status === "aborted")
|
|
2296
|
-
return
|
|
2296
|
+
return _;
|
|
2297
2297
|
p.status === "dirty" && t.dirty(), d.add(p.value);
|
|
2298
2298
|
}
|
|
2299
2299
|
return { status: t.value, value: d };
|
|
@@ -2324,10 +2324,10 @@ J.create = (r, e) => new J({
|
|
|
2324
2324
|
valueType: r,
|
|
2325
2325
|
minSize: null,
|
|
2326
2326
|
maxSize: null,
|
|
2327
|
-
typeName:
|
|
2327
|
+
typeName: y.ZodSet,
|
|
2328
2328
|
...v(e)
|
|
2329
2329
|
});
|
|
2330
|
-
class
|
|
2330
|
+
class K extends g {
|
|
2331
2331
|
constructor() {
|
|
2332
2332
|
super(...arguments), this.validate = this.implement;
|
|
2333
2333
|
}
|
|
@@ -2338,7 +2338,7 @@ class G extends g {
|
|
|
2338
2338
|
code: c.invalid_type,
|
|
2339
2339
|
expected: f.function,
|
|
2340
2340
|
received: t.parsedType
|
|
2341
|
-
}),
|
|
2341
|
+
}), _;
|
|
2342
2342
|
function n(o, u) {
|
|
2343
2343
|
return we({
|
|
2344
2344
|
data: o,
|
|
@@ -2347,7 +2347,7 @@ class G extends g {
|
|
|
2347
2347
|
t.common.contextualErrorMap,
|
|
2348
2348
|
t.schemaErrorMap,
|
|
2349
2349
|
ke(),
|
|
2350
|
-
|
|
2350
|
+
Q
|
|
2351
2351
|
].filter((d) => !!d),
|
|
2352
2352
|
issueData: {
|
|
2353
2353
|
code: c.invalid_arguments,
|
|
@@ -2363,7 +2363,7 @@ class G extends g {
|
|
|
2363
2363
|
t.common.contextualErrorMap,
|
|
2364
2364
|
t.schemaErrorMap,
|
|
2365
2365
|
ke(),
|
|
2366
|
-
|
|
2366
|
+
Q
|
|
2367
2367
|
].filter((d) => !!d),
|
|
2368
2368
|
issueData: {
|
|
2369
2369
|
code: c.invalid_return_type,
|
|
@@ -2372,7 +2372,7 @@ class G extends g {
|
|
|
2372
2372
|
});
|
|
2373
2373
|
}
|
|
2374
2374
|
const a = { errorMap: t.common.contextualErrorMap }, i = t.data;
|
|
2375
|
-
if (this._def.returns instanceof
|
|
2375
|
+
if (this._def.returns instanceof ee) {
|
|
2376
2376
|
const o = this;
|
|
2377
2377
|
return Z(async function(...u) {
|
|
2378
2378
|
const d = new S([]), p = await o._def.args.parseAsync(u, a).catch((w) => {
|
|
@@ -2402,13 +2402,13 @@ class G extends g {
|
|
|
2402
2402
|
return this._def.returns;
|
|
2403
2403
|
}
|
|
2404
2404
|
args(...e) {
|
|
2405
|
-
return new
|
|
2405
|
+
return new K({
|
|
2406
2406
|
...this._def,
|
|
2407
2407
|
args: I.create(e).rest(W.create())
|
|
2408
2408
|
});
|
|
2409
2409
|
}
|
|
2410
2410
|
returns(e) {
|
|
2411
|
-
return new
|
|
2411
|
+
return new K({
|
|
2412
2412
|
...this._def,
|
|
2413
2413
|
returns: e
|
|
2414
2414
|
});
|
|
@@ -2420,15 +2420,15 @@ class G extends g {
|
|
|
2420
2420
|
return this.parse(e);
|
|
2421
2421
|
}
|
|
2422
2422
|
static create(e, t, n) {
|
|
2423
|
-
return new
|
|
2423
|
+
return new K({
|
|
2424
2424
|
args: e || I.create([]).rest(W.create()),
|
|
2425
2425
|
returns: t || W.create(),
|
|
2426
|
-
typeName:
|
|
2426
|
+
typeName: y.ZodFunction,
|
|
2427
2427
|
...v(n)
|
|
2428
2428
|
});
|
|
2429
2429
|
}
|
|
2430
2430
|
}
|
|
2431
|
-
class
|
|
2431
|
+
class pe extends g {
|
|
2432
2432
|
get schema() {
|
|
2433
2433
|
return this._def.getter();
|
|
2434
2434
|
}
|
|
@@ -2437,12 +2437,12 @@ class he extends g {
|
|
|
2437
2437
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
2438
2438
|
}
|
|
2439
2439
|
}
|
|
2440
|
-
|
|
2440
|
+
pe.create = (r, e) => new pe({
|
|
2441
2441
|
getter: r,
|
|
2442
|
-
typeName:
|
|
2442
|
+
typeName: y.ZodLazy,
|
|
2443
2443
|
...v(e)
|
|
2444
2444
|
});
|
|
2445
|
-
class
|
|
2445
|
+
class me extends g {
|
|
2446
2446
|
_parse(e) {
|
|
2447
2447
|
if (e.data !== this._def.value) {
|
|
2448
2448
|
const t = this._getOrReturnCtx(e);
|
|
@@ -2450,7 +2450,7 @@ class pe extends g {
|
|
|
2450
2450
|
received: t.data,
|
|
2451
2451
|
code: c.invalid_literal,
|
|
2452
2452
|
expected: this._def.value
|
|
2453
|
-
}),
|
|
2453
|
+
}), _;
|
|
2454
2454
|
}
|
|
2455
2455
|
return { status: "valid", value: e.data };
|
|
2456
2456
|
}
|
|
@@ -2458,21 +2458,21 @@ class pe extends g {
|
|
|
2458
2458
|
return this._def.value;
|
|
2459
2459
|
}
|
|
2460
2460
|
}
|
|
2461
|
-
|
|
2461
|
+
me.create = (r, e) => new me({
|
|
2462
2462
|
value: r,
|
|
2463
|
-
typeName:
|
|
2463
|
+
typeName: y.ZodLiteral,
|
|
2464
2464
|
...v(e)
|
|
2465
2465
|
});
|
|
2466
2466
|
function tt(r, e) {
|
|
2467
2467
|
return new U({
|
|
2468
2468
|
values: r,
|
|
2469
|
-
typeName:
|
|
2469
|
+
typeName: y.ZodEnum,
|
|
2470
2470
|
...v(e)
|
|
2471
2471
|
});
|
|
2472
2472
|
}
|
|
2473
2473
|
class U extends g {
|
|
2474
2474
|
constructor() {
|
|
2475
|
-
super(...arguments),
|
|
2475
|
+
super(...arguments), se.set(this, void 0);
|
|
2476
2476
|
}
|
|
2477
2477
|
_parse(e) {
|
|
2478
2478
|
if (typeof e.data != "string") {
|
|
@@ -2481,15 +2481,15 @@ class U extends g {
|
|
|
2481
2481
|
expected: x.joinValues(n),
|
|
2482
2482
|
received: t.parsedType,
|
|
2483
2483
|
code: c.invalid_type
|
|
2484
|
-
}),
|
|
2484
|
+
}), _;
|
|
2485
2485
|
}
|
|
2486
|
-
if (Te(this,
|
|
2486
|
+
if (Te(this, se) || Ke(this, se, new Set(this._def.values)), !Te(this, se).has(e.data)) {
|
|
2487
2487
|
const t = this._getOrReturnCtx(e), n = this._def.values;
|
|
2488
2488
|
return l(t, {
|
|
2489
2489
|
received: t.data,
|
|
2490
2490
|
code: c.invalid_enum_value,
|
|
2491
2491
|
options: n
|
|
2492
|
-
}),
|
|
2492
|
+
}), _;
|
|
2493
2493
|
}
|
|
2494
2494
|
return Z(e.data);
|
|
2495
2495
|
}
|
|
@@ -2527,11 +2527,11 @@ class U extends g {
|
|
|
2527
2527
|
});
|
|
2528
2528
|
}
|
|
2529
2529
|
}
|
|
2530
|
-
|
|
2530
|
+
se = /* @__PURE__ */ new WeakMap();
|
|
2531
2531
|
U.create = tt;
|
|
2532
|
-
class
|
|
2532
|
+
class ye extends g {
|
|
2533
2533
|
constructor() {
|
|
2534
|
-
super(...arguments),
|
|
2534
|
+
super(...arguments), ae.set(this, void 0);
|
|
2535
2535
|
}
|
|
2536
2536
|
_parse(e) {
|
|
2537
2537
|
const t = x.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
@@ -2541,15 +2541,15 @@ class me extends g {
|
|
|
2541
2541
|
expected: x.joinValues(s),
|
|
2542
2542
|
received: n.parsedType,
|
|
2543
2543
|
code: c.invalid_type
|
|
2544
|
-
}),
|
|
2544
|
+
}), _;
|
|
2545
2545
|
}
|
|
2546
|
-
if (Te(this,
|
|
2546
|
+
if (Te(this, ae) || Ke(this, ae, new Set(x.getValidEnumValues(this._def.values))), !Te(this, ae).has(e.data)) {
|
|
2547
2547
|
const s = x.objectValues(t);
|
|
2548
2548
|
return l(n, {
|
|
2549
2549
|
received: n.data,
|
|
2550
2550
|
code: c.invalid_enum_value,
|
|
2551
2551
|
options: s
|
|
2552
|
-
}),
|
|
2552
|
+
}), _;
|
|
2553
2553
|
}
|
|
2554
2554
|
return Z(e.data);
|
|
2555
2555
|
}
|
|
@@ -2557,13 +2557,13 @@ class me extends g {
|
|
|
2557
2557
|
return this._def.values;
|
|
2558
2558
|
}
|
|
2559
2559
|
}
|
|
2560
|
-
|
|
2561
|
-
|
|
2560
|
+
ae = /* @__PURE__ */ new WeakMap();
|
|
2561
|
+
ye.create = (r, e) => new ye({
|
|
2562
2562
|
values: r,
|
|
2563
|
-
typeName:
|
|
2563
|
+
typeName: y.ZodNativeEnum,
|
|
2564
2564
|
...v(e)
|
|
2565
2565
|
});
|
|
2566
|
-
class
|
|
2566
|
+
class ee extends g {
|
|
2567
2567
|
unwrap() {
|
|
2568
2568
|
return this._def.type;
|
|
2569
2569
|
}
|
|
@@ -2574,7 +2574,7 @@ class Q extends g {
|
|
|
2574
2574
|
code: c.invalid_type,
|
|
2575
2575
|
expected: f.promise,
|
|
2576
2576
|
received: t.parsedType
|
|
2577
|
-
}),
|
|
2577
|
+
}), _;
|
|
2578
2578
|
const n = t.parsedType === f.promise ? t.data : Promise.resolve(t.data);
|
|
2579
2579
|
return Z(n.then((s) => this._def.type.parseAsync(s, {
|
|
2580
2580
|
path: t.path,
|
|
@@ -2582,9 +2582,9 @@ class Q extends g {
|
|
|
2582
2582
|
})));
|
|
2583
2583
|
}
|
|
2584
2584
|
}
|
|
2585
|
-
|
|
2585
|
+
ee.create = (r, e) => new ee({
|
|
2586
2586
|
type: r,
|
|
2587
|
-
typeName:
|
|
2587
|
+
typeName: y.ZodPromise,
|
|
2588
2588
|
...v(e)
|
|
2589
2589
|
});
|
|
2590
2590
|
class C extends g {
|
|
@@ -2592,7 +2592,7 @@ class C extends g {
|
|
|
2592
2592
|
return this._def.schema;
|
|
2593
2593
|
}
|
|
2594
2594
|
sourceType() {
|
|
2595
|
-
return this._def.schema._def.typeName ===
|
|
2595
|
+
return this._def.schema._def.typeName === y.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
2596
2596
|
}
|
|
2597
2597
|
_parse(e) {
|
|
2598
2598
|
const { status: t, ctx: n } = this._processInputParams(e), s = this._def.effect || null, a = {
|
|
@@ -2608,23 +2608,23 @@ class C extends g {
|
|
|
2608
2608
|
if (n.common.async)
|
|
2609
2609
|
return Promise.resolve(i).then(async (o) => {
|
|
2610
2610
|
if (t.value === "aborted")
|
|
2611
|
-
return
|
|
2611
|
+
return _;
|
|
2612
2612
|
const u = await this._def.schema._parseAsync({
|
|
2613
2613
|
data: o,
|
|
2614
2614
|
path: n.path,
|
|
2615
2615
|
parent: n
|
|
2616
2616
|
});
|
|
2617
|
-
return u.status === "aborted" ?
|
|
2617
|
+
return u.status === "aborted" ? _ : u.status === "dirty" || t.value === "dirty" ? X(u.value) : u;
|
|
2618
2618
|
});
|
|
2619
2619
|
{
|
|
2620
2620
|
if (t.value === "aborted")
|
|
2621
|
-
return
|
|
2621
|
+
return _;
|
|
2622
2622
|
const o = this._def.schema._parseSync({
|
|
2623
2623
|
data: i,
|
|
2624
2624
|
path: n.path,
|
|
2625
2625
|
parent: n
|
|
2626
2626
|
});
|
|
2627
|
-
return o.status === "aborted" ?
|
|
2627
|
+
return o.status === "aborted" ? _ : o.status === "dirty" || t.value === "dirty" ? X(o.value) : o;
|
|
2628
2628
|
}
|
|
2629
2629
|
}
|
|
2630
2630
|
if (s.type === "refinement") {
|
|
@@ -2642,9 +2642,9 @@ class C extends g {
|
|
|
2642
2642
|
path: n.path,
|
|
2643
2643
|
parent: n
|
|
2644
2644
|
});
|
|
2645
|
-
return o.status === "aborted" ?
|
|
2645
|
+
return o.status === "aborted" ? _ : (o.status === "dirty" && t.dirty(), i(o.value), { status: t.value, value: o.value });
|
|
2646
2646
|
} else
|
|
2647
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => o.status === "aborted" ?
|
|
2647
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => o.status === "aborted" ? _ : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
|
|
2648
2648
|
}
|
|
2649
2649
|
if (s.type === "transform")
|
|
2650
2650
|
if (n.common.async === !1) {
|
|
@@ -2653,27 +2653,27 @@ class C extends g {
|
|
|
2653
2653
|
path: n.path,
|
|
2654
2654
|
parent: n
|
|
2655
2655
|
});
|
|
2656
|
-
if (!
|
|
2656
|
+
if (!ie(i))
|
|
2657
2657
|
return i;
|
|
2658
2658
|
const o = s.transform(i.value, a);
|
|
2659
2659
|
if (o instanceof Promise)
|
|
2660
2660
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2661
2661
|
return { status: t.value, value: o };
|
|
2662
2662
|
} else
|
|
2663
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) =>
|
|
2663
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => ie(i) ? Promise.resolve(s.transform(i.value, a)).then((o) => ({ status: t.value, value: o })) : i);
|
|
2664
2664
|
x.assertNever(s);
|
|
2665
2665
|
}
|
|
2666
2666
|
}
|
|
2667
2667
|
C.create = (r, e, t) => new C({
|
|
2668
2668
|
schema: r,
|
|
2669
|
-
typeName:
|
|
2669
|
+
typeName: y.ZodEffects,
|
|
2670
2670
|
effect: e,
|
|
2671
2671
|
...v(t)
|
|
2672
2672
|
});
|
|
2673
2673
|
C.createWithPreprocess = (r, e, t) => new C({
|
|
2674
2674
|
schema: e,
|
|
2675
2675
|
effect: { type: "preprocess", transform: r },
|
|
2676
|
-
typeName:
|
|
2676
|
+
typeName: y.ZodEffects,
|
|
2677
2677
|
...v(t)
|
|
2678
2678
|
});
|
|
2679
2679
|
class N extends g {
|
|
@@ -2686,7 +2686,7 @@ class N extends g {
|
|
|
2686
2686
|
}
|
|
2687
2687
|
N.create = (r, e) => new N({
|
|
2688
2688
|
innerType: r,
|
|
2689
|
-
typeName:
|
|
2689
|
+
typeName: y.ZodOptional,
|
|
2690
2690
|
...v(e)
|
|
2691
2691
|
});
|
|
2692
2692
|
class z extends g {
|
|
@@ -2699,7 +2699,7 @@ class z extends g {
|
|
|
2699
2699
|
}
|
|
2700
2700
|
z.create = (r, e) => new z({
|
|
2701
2701
|
innerType: r,
|
|
2702
|
-
typeName:
|
|
2702
|
+
typeName: y.ZodNullable,
|
|
2703
2703
|
...v(e)
|
|
2704
2704
|
});
|
|
2705
2705
|
class _e extends g {
|
|
@@ -2718,11 +2718,11 @@ class _e extends g {
|
|
|
2718
2718
|
}
|
|
2719
2719
|
_e.create = (r, e) => new _e({
|
|
2720
2720
|
innerType: r,
|
|
2721
|
-
typeName:
|
|
2721
|
+
typeName: y.ZodDefault,
|
|
2722
2722
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2723
2723
|
...v(e)
|
|
2724
2724
|
});
|
|
2725
|
-
class
|
|
2725
|
+
class ve extends g {
|
|
2726
2726
|
_parse(e) {
|
|
2727
2727
|
const { ctx: t } = this._processInputParams(e), n = {
|
|
2728
2728
|
...t,
|
|
@@ -2737,7 +2737,7 @@ class ye extends g {
|
|
|
2737
2737
|
...n
|
|
2738
2738
|
}
|
|
2739
2739
|
});
|
|
2740
|
-
return
|
|
2740
|
+
return oe(s) ? s.then((a) => ({
|
|
2741
2741
|
status: "valid",
|
|
2742
2742
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2743
2743
|
get error() {
|
|
@@ -2759,9 +2759,9 @@ class ye extends g {
|
|
|
2759
2759
|
return this._def.innerType;
|
|
2760
2760
|
}
|
|
2761
2761
|
}
|
|
2762
|
-
|
|
2762
|
+
ve.create = (r, e) => new ve({
|
|
2763
2763
|
innerType: r,
|
|
2764
|
-
typeName:
|
|
2764
|
+
typeName: y.ZodCatch,
|
|
2765
2765
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2766
2766
|
...v(e)
|
|
2767
2767
|
});
|
|
@@ -2773,16 +2773,16 @@ class je extends g {
|
|
|
2773
2773
|
code: c.invalid_type,
|
|
2774
2774
|
expected: f.nan,
|
|
2775
2775
|
received: n.parsedType
|
|
2776
|
-
}),
|
|
2776
|
+
}), _;
|
|
2777
2777
|
}
|
|
2778
2778
|
return { status: "valid", value: e.data };
|
|
2779
2779
|
}
|
|
2780
2780
|
}
|
|
2781
2781
|
je.create = (r) => new je({
|
|
2782
|
-
typeName:
|
|
2782
|
+
typeName: y.ZodNaN,
|
|
2783
2783
|
...v(r)
|
|
2784
2784
|
});
|
|
2785
|
-
const
|
|
2785
|
+
const Dt = Symbol("zod_brand");
|
|
2786
2786
|
class He extends g {
|
|
2787
2787
|
_parse(e) {
|
|
2788
2788
|
const { ctx: t } = this._processInputParams(e), n = t.data;
|
|
@@ -2796,7 +2796,7 @@ class He extends g {
|
|
|
2796
2796
|
return this._def.type;
|
|
2797
2797
|
}
|
|
2798
2798
|
}
|
|
2799
|
-
class
|
|
2799
|
+
class xe extends g {
|
|
2800
2800
|
_parse(e) {
|
|
2801
2801
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2802
2802
|
if (n.common.async)
|
|
@@ -2806,7 +2806,7 @@ class ge extends g {
|
|
|
2806
2806
|
path: n.path,
|
|
2807
2807
|
parent: n
|
|
2808
2808
|
});
|
|
2809
|
-
return a.status === "aborted" ?
|
|
2809
|
+
return a.status === "aborted" ? _ : a.status === "dirty" ? (t.dirty(), X(a.value)) : this._def.out._parseAsync({
|
|
2810
2810
|
data: a.value,
|
|
2811
2811
|
path: n.path,
|
|
2812
2812
|
parent: n
|
|
@@ -2818,7 +2818,7 @@ class ge extends g {
|
|
|
2818
2818
|
path: n.path,
|
|
2819
2819
|
parent: n
|
|
2820
2820
|
});
|
|
2821
|
-
return s.status === "aborted" ?
|
|
2821
|
+
return s.status === "aborted" ? _ : s.status === "dirty" ? (t.dirty(), {
|
|
2822
2822
|
status: "dirty",
|
|
2823
2823
|
value: s.value
|
|
2824
2824
|
}) : this._def.out._parseSync({
|
|
@@ -2829,71 +2829,71 @@ class ge extends g {
|
|
|
2829
2829
|
}
|
|
2830
2830
|
}
|
|
2831
2831
|
static create(e, t) {
|
|
2832
|
-
return new
|
|
2832
|
+
return new xe({
|
|
2833
2833
|
in: e,
|
|
2834
2834
|
out: t,
|
|
2835
|
-
typeName:
|
|
2835
|
+
typeName: y.ZodPipeline
|
|
2836
2836
|
});
|
|
2837
2837
|
}
|
|
2838
2838
|
}
|
|
2839
|
-
class
|
|
2839
|
+
class ge extends g {
|
|
2840
2840
|
_parse(e) {
|
|
2841
|
-
const t = this._def.innerType._parse(e), n = (s) => (
|
|
2842
|
-
return
|
|
2841
|
+
const t = this._def.innerType._parse(e), n = (s) => (ie(s) && (s.value = Object.freeze(s.value)), s);
|
|
2842
|
+
return oe(t) ? t.then((s) => n(s)) : n(t);
|
|
2843
2843
|
}
|
|
2844
2844
|
unwrap() {
|
|
2845
2845
|
return this._def.innerType;
|
|
2846
2846
|
}
|
|
2847
2847
|
}
|
|
2848
|
-
|
|
2848
|
+
ge.create = (r, e) => new ge({
|
|
2849
2849
|
innerType: r,
|
|
2850
|
-
typeName:
|
|
2850
|
+
typeName: y.ZodReadonly,
|
|
2851
2851
|
...v(e)
|
|
2852
2852
|
});
|
|
2853
2853
|
function rt(r, e = {}, t) {
|
|
2854
|
-
return r ?
|
|
2854
|
+
return r ? F.create().superRefine((n, s) => {
|
|
2855
2855
|
var a, i;
|
|
2856
2856
|
if (!r(n)) {
|
|
2857
2857
|
const o = typeof e == "function" ? e(n) : typeof e == "string" ? { message: e } : e, u = (i = (a = o.fatal) !== null && a !== void 0 ? a : t) !== null && i !== void 0 ? i : !0, d = typeof o == "string" ? { message: o } : o;
|
|
2858
2858
|
s.addIssue({ code: "custom", ...d, fatal: u });
|
|
2859
2859
|
}
|
|
2860
|
-
}) :
|
|
2860
|
+
}) : F.create();
|
|
2861
2861
|
}
|
|
2862
|
-
const
|
|
2862
|
+
const Vt = {
|
|
2863
2863
|
object: b.lazycreate
|
|
2864
2864
|
};
|
|
2865
|
-
var
|
|
2865
|
+
var y;
|
|
2866
2866
|
(function(r) {
|
|
2867
2867
|
r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
|
|
2868
|
-
})(
|
|
2868
|
+
})(y || (y = {}));
|
|
2869
2869
|
const Lt = (r, e = {
|
|
2870
2870
|
message: `Input not instance of ${r.name}`
|
|
2871
|
-
}) => rt((t) => t instanceof r, e), nt = j.create, st =
|
|
2871
|
+
}) => rt((t) => t instanceof r, e), nt = j.create, st = V.create, Ut = je.create, zt = L.create, at = de.create, Bt = q.create, Wt = Ze.create, qt = ce.create, Jt = ue.create, Ht = F.create, Yt = W.create, Gt = M.create, Xt = Se.create, Kt = E.create, Qt = b.create, Ft = b.strictCreate, er = le.create, tr = Ce.create, rr = fe.create, nr = I.create, sr = he.create, ar = Oe.create, ir = J.create, or = K.create, dr = pe.create, cr = me.create, ur = U.create, lr = ye.create, fr = ee.create, Ge = C.create, hr = N.create, pr = z.create, mr = C.createWithPreprocess, yr = xe.create, _r = () => nt().optional(), vr = () => st().optional(), gr = () => at().optional(), xr = {
|
|
2872
2872
|
string: (r) => j.create({ ...r, coerce: !0 }),
|
|
2873
|
-
number: (r) =>
|
|
2874
|
-
boolean: (r) =>
|
|
2873
|
+
number: (r) => V.create({ ...r, coerce: !0 }),
|
|
2874
|
+
boolean: (r) => de.create({
|
|
2875
2875
|
...r,
|
|
2876
2876
|
coerce: !0
|
|
2877
2877
|
}),
|
|
2878
2878
|
bigint: (r) => L.create({ ...r, coerce: !0 }),
|
|
2879
2879
|
date: (r) => q.create({ ...r, coerce: !0 })
|
|
2880
|
-
}, br =
|
|
2880
|
+
}, br = _;
|
|
2881
2881
|
var h = /* @__PURE__ */ Object.freeze({
|
|
2882
2882
|
__proto__: null,
|
|
2883
|
-
defaultErrorMap:
|
|
2883
|
+
defaultErrorMap: Q,
|
|
2884
2884
|
setErrorMap: bt,
|
|
2885
2885
|
getErrorMap: ke,
|
|
2886
2886
|
makeIssue: we,
|
|
2887
2887
|
EMPTY_PATH: kt,
|
|
2888
2888
|
addIssueToContext: l,
|
|
2889
2889
|
ParseStatus: T,
|
|
2890
|
-
INVALID:
|
|
2891
|
-
DIRTY:
|
|
2890
|
+
INVALID: _,
|
|
2891
|
+
DIRTY: X,
|
|
2892
2892
|
OK: Z,
|
|
2893
2893
|
isAborted: We,
|
|
2894
2894
|
isDirty: qe,
|
|
2895
|
-
isValid:
|
|
2896
|
-
isAsync:
|
|
2895
|
+
isValid: ie,
|
|
2896
|
+
isAsync: oe,
|
|
2897
2897
|
get util() {
|
|
2898
2898
|
return x;
|
|
2899
2899
|
},
|
|
@@ -2901,53 +2901,53 @@ var h = /* @__PURE__ */ Object.freeze({
|
|
|
2901
2901
|
return Be;
|
|
2902
2902
|
},
|
|
2903
2903
|
ZodParsedType: f,
|
|
2904
|
-
getParsedType:
|
|
2904
|
+
getParsedType: D,
|
|
2905
2905
|
ZodType: g,
|
|
2906
2906
|
datetimeRegex: et,
|
|
2907
2907
|
ZodString: j,
|
|
2908
|
-
ZodNumber:
|
|
2908
|
+
ZodNumber: V,
|
|
2909
2909
|
ZodBigInt: L,
|
|
2910
|
-
ZodBoolean:
|
|
2910
|
+
ZodBoolean: de,
|
|
2911
2911
|
ZodDate: q,
|
|
2912
2912
|
ZodSymbol: Ze,
|
|
2913
|
-
ZodUndefined:
|
|
2914
|
-
ZodNull:
|
|
2915
|
-
ZodAny:
|
|
2913
|
+
ZodUndefined: ce,
|
|
2914
|
+
ZodNull: ue,
|
|
2915
|
+
ZodAny: F,
|
|
2916
2916
|
ZodUnknown: W,
|
|
2917
2917
|
ZodNever: M,
|
|
2918
2918
|
ZodVoid: Se,
|
|
2919
2919
|
ZodArray: E,
|
|
2920
2920
|
ZodObject: b,
|
|
2921
|
-
ZodUnion:
|
|
2921
|
+
ZodUnion: le,
|
|
2922
2922
|
ZodDiscriminatedUnion: Ce,
|
|
2923
|
-
ZodIntersection:
|
|
2923
|
+
ZodIntersection: fe,
|
|
2924
2924
|
ZodTuple: I,
|
|
2925
|
-
ZodRecord:
|
|
2925
|
+
ZodRecord: he,
|
|
2926
2926
|
ZodMap: Oe,
|
|
2927
2927
|
ZodSet: J,
|
|
2928
|
-
ZodFunction:
|
|
2929
|
-
ZodLazy:
|
|
2930
|
-
ZodLiteral:
|
|
2928
|
+
ZodFunction: K,
|
|
2929
|
+
ZodLazy: pe,
|
|
2930
|
+
ZodLiteral: me,
|
|
2931
2931
|
ZodEnum: U,
|
|
2932
|
-
ZodNativeEnum:
|
|
2933
|
-
ZodPromise:
|
|
2932
|
+
ZodNativeEnum: ye,
|
|
2933
|
+
ZodPromise: ee,
|
|
2934
2934
|
ZodEffects: C,
|
|
2935
2935
|
ZodTransformer: C,
|
|
2936
2936
|
ZodOptional: N,
|
|
2937
2937
|
ZodNullable: z,
|
|
2938
2938
|
ZodDefault: _e,
|
|
2939
|
-
ZodCatch:
|
|
2939
|
+
ZodCatch: ve,
|
|
2940
2940
|
ZodNaN: je,
|
|
2941
|
-
BRAND:
|
|
2941
|
+
BRAND: Dt,
|
|
2942
2942
|
ZodBranded: He,
|
|
2943
|
-
ZodPipeline:
|
|
2944
|
-
ZodReadonly:
|
|
2943
|
+
ZodPipeline: xe,
|
|
2944
|
+
ZodReadonly: ge,
|
|
2945
2945
|
custom: rt,
|
|
2946
2946
|
Schema: g,
|
|
2947
2947
|
ZodSchema: g,
|
|
2948
|
-
late:
|
|
2948
|
+
late: Vt,
|
|
2949
2949
|
get ZodFirstPartyTypeKind() {
|
|
2950
|
-
return
|
|
2950
|
+
return y;
|
|
2951
2951
|
},
|
|
2952
2952
|
coerce: xr,
|
|
2953
2953
|
any: Ht,
|
|
@@ -2974,8 +2974,8 @@ var h = /* @__PURE__ */ Object.freeze({
|
|
|
2974
2974
|
oboolean: gr,
|
|
2975
2975
|
onumber: vr,
|
|
2976
2976
|
optional: hr,
|
|
2977
|
-
ostring:
|
|
2978
|
-
pipeline:
|
|
2977
|
+
ostring: _r,
|
|
2978
|
+
pipeline: yr,
|
|
2979
2979
|
preprocess: mr,
|
|
2980
2980
|
promise: fr,
|
|
2981
2981
|
record: sr,
|
|
@@ -3061,18 +3061,18 @@ const Ee = h.object({
|
|
|
3061
3061
|
success: h.boolean(),
|
|
3062
3062
|
result: h.array(it)
|
|
3063
3063
|
});
|
|
3064
|
-
function
|
|
3064
|
+
function Y(r) {
|
|
3065
3065
|
return ct(`https://api.cloudflare.com/client/v4/zones/${r.zoneId}`).headers({
|
|
3066
3066
|
"X-Auth-Email": r.authEmail,
|
|
3067
3067
|
"X-Auth-Key": r.authKey,
|
|
3068
3068
|
"Content-Type": "application/json"
|
|
3069
|
-
}).middlewares([
|
|
3069
|
+
}).middlewares([yt(), ht()]);
|
|
3070
3070
|
}
|
|
3071
3071
|
function ze(r) {
|
|
3072
3072
|
return {
|
|
3073
3073
|
custom_domain_id: r.id,
|
|
3074
3074
|
domain: r.hostname,
|
|
3075
|
-
primary:
|
|
3075
|
+
primary: r.primary,
|
|
3076
3076
|
status: r.status === "active" ? "ready" : "pending",
|
|
3077
3077
|
type: "auth0_managed_certs"
|
|
3078
3078
|
};
|
|
@@ -3081,7 +3081,7 @@ function Er(r) {
|
|
|
3081
3081
|
return {
|
|
3082
3082
|
create: async (e, t) => {
|
|
3083
3083
|
const { result: n, errors: s, success: a } = Ue.parse(
|
|
3084
|
-
await
|
|
3084
|
+
await Y(r).post(
|
|
3085
3085
|
{
|
|
3086
3086
|
hostname: t.domain,
|
|
3087
3087
|
ssl: {
|
|
@@ -3097,27 +3097,41 @@ function Er(r) {
|
|
|
3097
3097
|
);
|
|
3098
3098
|
if (!a)
|
|
3099
3099
|
throw new Error(JSON.stringify(s));
|
|
3100
|
-
|
|
3100
|
+
const i = ze({
|
|
3101
|
+
...n,
|
|
3102
|
+
primary: !1
|
|
3103
|
+
});
|
|
3104
|
+
return await r.customDomainAdapter.create(e, {
|
|
3105
|
+
custom_domain_id: i.custom_domain_id,
|
|
3106
|
+
domain: i.domain,
|
|
3107
|
+
type: i.type
|
|
3108
|
+
}), i;
|
|
3101
3109
|
},
|
|
3102
3110
|
get: async (e, t) => {
|
|
3103
|
-
var
|
|
3104
|
-
const
|
|
3105
|
-
|
|
3111
|
+
var o;
|
|
3112
|
+
const n = await r.customDomainAdapter.get(
|
|
3113
|
+
e,
|
|
3114
|
+
t
|
|
3106
3115
|
);
|
|
3107
|
-
if (!
|
|
3108
|
-
throw new
|
|
3109
|
-
|
|
3116
|
+
if (!n)
|
|
3117
|
+
throw new H(404);
|
|
3118
|
+
const { result: s, errors: a, success: i } = Ue.parse(
|
|
3119
|
+
await Y(r).get(`/custom_hostnames/${encodeURIComponent(t)}`).json()
|
|
3120
|
+
);
|
|
3121
|
+
if (!i)
|
|
3122
|
+
throw new H(503, {
|
|
3123
|
+
message: JSON.stringify(a)
|
|
3110
3124
|
});
|
|
3111
|
-
if (r.enterprise && ((
|
|
3112
|
-
throw new
|
|
3113
|
-
return ze(n);
|
|
3125
|
+
if (r.enterprise && ((o = s.custom_metadata) == null ? void 0 : o.tenant_id) !== e)
|
|
3126
|
+
throw new H(404);
|
|
3127
|
+
return ze({ ...n, ...s });
|
|
3114
3128
|
},
|
|
3115
3129
|
list: async (e) => {
|
|
3116
3130
|
const { result: t, errors: n, success: s } = jr.parse(
|
|
3117
|
-
await
|
|
3131
|
+
await Y(r).get("/custom_hostnames").json()
|
|
3118
3132
|
);
|
|
3119
3133
|
if (!s)
|
|
3120
|
-
throw new
|
|
3134
|
+
throw new H(503, {
|
|
3121
3135
|
message: JSON.stringify(n)
|
|
3122
3136
|
});
|
|
3123
3137
|
return t.filter(
|
|
@@ -3125,21 +3139,34 @@ function Er(r) {
|
|
|
3125
3139
|
var i;
|
|
3126
3140
|
return !(r.enterprise && ((i = a.custom_metadata) == null ? void 0 : i.tenant_id) !== e);
|
|
3127
3141
|
}
|
|
3128
|
-
).map(ze);
|
|
3142
|
+
).map((a) => ze({ ...a, primary: !1 }));
|
|
3129
3143
|
},
|
|
3130
3144
|
remove: async (e, t) => {
|
|
3131
3145
|
var s;
|
|
3132
3146
|
if (r.enterprise) {
|
|
3133
3147
|
const { result: a, success: i } = Ue.parse(
|
|
3134
|
-
await
|
|
3148
|
+
await Y(r).get(`/custom_hostnames/${encodeURIComponent(t)}`).json()
|
|
3135
3149
|
);
|
|
3136
3150
|
if (!i || ((s = a.custom_metadata) == null ? void 0 : s.tenant_id) !== e)
|
|
3137
|
-
throw new
|
|
3151
|
+
throw new H(404);
|
|
3138
3152
|
}
|
|
3139
|
-
|
|
3153
|
+
const n = await Y(r).delete(`/custom_hostnames/${encodeURIComponent(t)}`).res();
|
|
3154
|
+
return n.ok && await r.customDomainAdapter.remove(e, t), n.ok;
|
|
3140
3155
|
},
|
|
3141
|
-
update: async (e, t) => {
|
|
3142
|
-
|
|
3156
|
+
update: async (e, t, n) => {
|
|
3157
|
+
const s = await Y(r).patch(
|
|
3158
|
+
n,
|
|
3159
|
+
`/custom_hostnames/${encodeURIComponent(t)}`
|
|
3160
|
+
).res();
|
|
3161
|
+
if (!s.ok)
|
|
3162
|
+
throw new H(503, {
|
|
3163
|
+
message: await s.text()
|
|
3164
|
+
});
|
|
3165
|
+
return r.customDomainAdapter.update(
|
|
3166
|
+
e,
|
|
3167
|
+
t,
|
|
3168
|
+
n
|
|
3169
|
+
);
|
|
3143
3170
|
}
|
|
3144
3171
|
};
|
|
3145
3172
|
}
|