@authhero/cloudflare-adapter 1.0.0 → 1.2.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() {
|
|
@@ -43,7 +43,7 @@ const ut = (r, e) => e.skipDedupe || e.method !== "GET", lt = (r, e) => e.method
|
|
|
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 $;
|
|
@@ -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 = yt(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),
|
|
93
|
+
const O = typeof s == "string" ? a : s, w = O ?? {}, { param: P } = w, Ne = yt(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
|
});
|
|
@@ -434,7 +434,7 @@ class T {
|
|
|
434
434
|
}
|
|
435
435
|
const y = 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) {
|
|
@@ -605,13 +605,13 @@ 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({
|
|
@@ -623,7 +623,7 @@ class g {
|
|
|
623
623
|
}
|
|
624
624
|
default(e) {
|
|
625
625
|
const t = typeof e == "function" ? e : () => e;
|
|
626
|
-
return new
|
|
626
|
+
return new ye({
|
|
627
627
|
...v(this._def),
|
|
628
628
|
innerType: this,
|
|
629
629
|
defaultValue: t,
|
|
@@ -639,7 +639,7 @@ class g {
|
|
|
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,
|
|
@@ -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;
|
|
@@ -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
|
}
|
|
@@ -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,7 +1212,7 @@ 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
1217
|
typeName: _.ZodNumber,
|
|
1218
1218
|
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
@@ -1346,7 +1346,7 @@ L.create = (r) => {
|
|
|
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);
|
|
@@ -1359,7 +1359,7 @@ class oe extends g {
|
|
|
1359
1359
|
return Z(e.data);
|
|
1360
1360
|
}
|
|
1361
1361
|
}
|
|
1362
|
-
|
|
1362
|
+
de.create = (r) => new de({
|
|
1363
1363
|
typeName: _.ZodBoolean,
|
|
1364
1364
|
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
1365
1365
|
...v(r)
|
|
@@ -1459,7 +1459,7 @@ Ze.create = (r) => new Ze({
|
|
|
1459
1459
|
typeName: _.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);
|
|
@@ -1472,11 +1472,11 @@ class de extends g {
|
|
|
1472
1472
|
return Z(e.data);
|
|
1473
1473
|
}
|
|
1474
1474
|
}
|
|
1475
|
-
|
|
1475
|
+
ce.create = (r) => new ce({
|
|
1476
1476
|
typeName: _.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);
|
|
@@ -1489,11 +1489,11 @@ class ce extends g {
|
|
|
1489
1489
|
return Z(e.data);
|
|
1490
1490
|
}
|
|
1491
1491
|
}
|
|
1492
|
-
|
|
1492
|
+
ue.create = (r) => new ue({
|
|
1493
1493
|
typeName: _.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,7 +1501,7 @@ class K extends g {
|
|
|
1501
1501
|
return Z(e.data);
|
|
1502
1502
|
}
|
|
1503
1503
|
}
|
|
1504
|
-
|
|
1504
|
+
F.create = (r) => new F({
|
|
1505
1505
|
typeName: _.ZodAny,
|
|
1506
1506
|
...v(r)
|
|
1507
1507
|
});
|
|
@@ -1621,12 +1621,12 @@ E.create = (r, e) => new E({
|
|
|
1621
1621
|
typeName: _.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() {
|
|
@@ -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 = {};
|
|
@@ -1924,7 +1924,7 @@ b.lazycreate = (r, e) => new b({
|
|
|
1924
1924
|
typeName: _.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) {
|
|
@@ -1992,12 +1992,12 @@ class ue extends g {
|
|
|
1992
1992
|
return this._def.options;
|
|
1993
1993
|
}
|
|
1994
1994
|
}
|
|
1995
|
-
|
|
1995
|
+
le.create = (r, e) => new le({
|
|
1996
1996
|
options: r,
|
|
1997
1997
|
typeName: _.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 _e ? x.objectValues(r.enum) : r instanceof ye ? 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);
|
|
@@ -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,7 +2086,7 @@ 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))
|
|
@@ -2118,7 +2118,7 @@ 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
2124
|
typeName: _.ZodIntersection,
|
|
@@ -2174,7 +2174,7 @@ I.create = (r, e) => {
|
|
|
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
|
}
|
|
@@ -2202,12 +2202,12 @@ 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
2208
|
typeName: _.ZodRecord,
|
|
2209
2209
|
...v(n)
|
|
2210
|
-
}) : new
|
|
2210
|
+
}) : new he({
|
|
2211
2211
|
keyType: j.create(),
|
|
2212
2212
|
valueType: e,
|
|
2213
2213
|
typeName: _.ZodRecord,
|
|
@@ -2327,7 +2327,7 @@ J.create = (r, e) => new J({
|
|
|
2327
2327
|
typeName: _.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
|
}
|
|
@@ -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,7 +2420,7 @@ 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
2426
|
typeName: _.ZodFunction,
|
|
@@ -2428,7 +2428,7 @@ class G extends g {
|
|
|
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
2442
|
typeName: _.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);
|
|
@@ -2458,7 +2458,7 @@ 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
2463
|
typeName: _.ZodLiteral,
|
|
2464
2464
|
...v(e)
|
|
@@ -2472,7 +2472,7 @@ function tt(r, e) {
|
|
|
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") {
|
|
@@ -2483,7 +2483,7 @@ class U extends g {
|
|
|
2483
2483
|
code: c.invalid_type
|
|
2484
2484
|
}), y;
|
|
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,
|
|
@@ -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 _e 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);
|
|
@@ -2543,7 +2543,7 @@ class me extends g {
|
|
|
2543
2543
|
code: c.invalid_type
|
|
2544
2544
|
}), y;
|
|
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,
|
|
@@ -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
|
+
_e.create = (r, e) => new _e({
|
|
2562
2562
|
values: r,
|
|
2563
2563
|
typeName: _.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
|
}
|
|
@@ -2582,7 +2582,7 @@ class Q extends g {
|
|
|
2582
2582
|
})));
|
|
2583
2583
|
}
|
|
2584
2584
|
}
|
|
2585
|
-
|
|
2585
|
+
ee.create = (r, e) => new ee({
|
|
2586
2586
|
type: r,
|
|
2587
2587
|
typeName: _.ZodPromise,
|
|
2588
2588
|
...v(e)
|
|
@@ -2614,7 +2614,7 @@ class C extends g {
|
|
|
2614
2614
|
path: n.path,
|
|
2615
2615
|
parent: n
|
|
2616
2616
|
});
|
|
2617
|
-
return u.status === "aborted" ? y : u.status === "dirty" || t.value === "dirty" ?
|
|
2617
|
+
return u.status === "aborted" ? y : u.status === "dirty" || t.value === "dirty" ? X(u.value) : u;
|
|
2618
2618
|
});
|
|
2619
2619
|
{
|
|
2620
2620
|
if (t.value === "aborted")
|
|
@@ -2624,7 +2624,7 @@ class C extends g {
|
|
|
2624
2624
|
path: n.path,
|
|
2625
2625
|
parent: n
|
|
2626
2626
|
});
|
|
2627
|
-
return o.status === "aborted" ? y : o.status === "dirty" || t.value === "dirty" ?
|
|
2627
|
+
return o.status === "aborted" ? y : o.status === "dirty" || t.value === "dirty" ? X(o.value) : o;
|
|
2628
2628
|
}
|
|
2629
2629
|
}
|
|
2630
2630
|
if (s.type === "refinement") {
|
|
@@ -2653,14 +2653,14 @@ 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
|
}
|
|
@@ -2702,7 +2702,7 @@ z.create = (r, e) => new z({
|
|
|
2702
2702
|
typeName: _.ZodNullable,
|
|
2703
2703
|
...v(e)
|
|
2704
2704
|
});
|
|
2705
|
-
class
|
|
2705
|
+
class ye extends g {
|
|
2706
2706
|
_parse(e) {
|
|
2707
2707
|
const { ctx: t } = this._processInputParams(e);
|
|
2708
2708
|
let n = t.data;
|
|
@@ -2716,13 +2716,13 @@ class _e extends g {
|
|
|
2716
2716
|
return this._def.innerType;
|
|
2717
2717
|
}
|
|
2718
2718
|
}
|
|
2719
|
-
|
|
2719
|
+
ye.create = (r, e) => new ye({
|
|
2720
2720
|
innerType: r,
|
|
2721
2721
|
typeName: _.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,7 +2759,7 @@ 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
2764
|
typeName: _.ZodCatch,
|
|
2765
2765
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
@@ -2782,7 +2782,7 @@ je.create = (r) => new je({
|
|
|
2782
2782
|
typeName: _.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" ? y : a.status === "dirty" ? (t.dirty(),
|
|
2809
|
+
return a.status === "aborted" ? y : 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
|
|
@@ -2829,37 +2829,37 @@ 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
2835
|
typeName: _.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
2850
|
typeName: _.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
2865
|
var _;
|
|
@@ -2868,10 +2868,10 @@ var _;
|
|
|
2868
2868
|
})(_ || (_ = {}));
|
|
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 = _e.create, fr = ee.create, Ge = C.create, hr = N.create, pr = z.create, mr = C.createWithPreprocess, _r = xe.create, yr = () => 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
|
}),
|
|
@@ -2880,7 +2880,7 @@ const Lt = (r, e = {
|
|
|
2880
2880
|
}, br = y;
|
|
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,
|
|
@@ -2888,12 +2888,12 @@ var h = /* @__PURE__ */ Object.freeze({
|
|
|
2888
2888
|
addIssueToContext: l,
|
|
2889
2889
|
ParseStatus: T,
|
|
2890
2890
|
INVALID: y,
|
|
2891
|
-
DIRTY:
|
|
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,51 +2901,51 @@ 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: _e,
|
|
2933
|
+
ZodPromise: ee,
|
|
2934
2934
|
ZodEffects: C,
|
|
2935
2935
|
ZodTransformer: C,
|
|
2936
2936
|
ZodOptional: N,
|
|
2937
2937
|
ZodNullable: z,
|
|
2938
|
-
ZodDefault:
|
|
2939
|
-
ZodCatch:
|
|
2938
|
+
ZodDefault: ye,
|
|
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
2950
|
return _;
|
|
2951
2951
|
},
|
|
@@ -3061,7 +3061,7 @@ 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,
|
|
@@ -3072,7 +3072,7 @@ 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,49 +3097,83 @@ 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
|
-
const { result:
|
|
3117
|
-
await
|
|
3130
|
+
const t = await r.customDomainAdapter.list(e), { result: n, errors: s, success: a } = jr.parse(
|
|
3131
|
+
await Y(r).get("/custom_hostnames").json()
|
|
3118
3132
|
);
|
|
3119
|
-
if (!
|
|
3120
|
-
throw new
|
|
3121
|
-
message: JSON.stringify(
|
|
3133
|
+
if (!a)
|
|
3134
|
+
throw new H(503, {
|
|
3135
|
+
message: JSON.stringify(s)
|
|
3122
3136
|
});
|
|
3123
|
-
return
|
|
3124
|
-
(
|
|
3125
|
-
|
|
3126
|
-
|
|
3137
|
+
return n.filter(
|
|
3138
|
+
(i) => t.find((o) => o.custom_domain_id === i.id)
|
|
3139
|
+
).filter(
|
|
3140
|
+
(i) => {
|
|
3141
|
+
var o;
|
|
3142
|
+
return !(r.enterprise && ((o = i.custom_metadata) == null ? void 0 : o.tenant_id) !== e);
|
|
3127
3143
|
}
|
|
3128
|
-
).map(
|
|
3144
|
+
).map(
|
|
3145
|
+
(i) => ze({
|
|
3146
|
+
...t.find((o) => o.custom_domain_id === i.id),
|
|
3147
|
+
...i
|
|
3148
|
+
})
|
|
3149
|
+
);
|
|
3129
3150
|
},
|
|
3130
3151
|
remove: async (e, t) => {
|
|
3131
3152
|
var s;
|
|
3132
3153
|
if (r.enterprise) {
|
|
3133
3154
|
const { result: a, success: i } = Ue.parse(
|
|
3134
|
-
await
|
|
3155
|
+
await Y(r).get(`/custom_hostnames/${encodeURIComponent(t)}`).json()
|
|
3135
3156
|
);
|
|
3136
3157
|
if (!i || ((s = a.custom_metadata) == null ? void 0 : s.tenant_id) !== e)
|
|
3137
|
-
throw new
|
|
3158
|
+
throw new H(404);
|
|
3138
3159
|
}
|
|
3139
|
-
|
|
3160
|
+
const n = await Y(r).delete(`/custom_hostnames/${encodeURIComponent(t)}`).res();
|
|
3161
|
+
return n.ok && await r.customDomainAdapter.remove(e, t), n.ok;
|
|
3140
3162
|
},
|
|
3141
|
-
update: async (e, t) => {
|
|
3142
|
-
|
|
3163
|
+
update: async (e, t, n) => {
|
|
3164
|
+
const s = await Y(r).patch(
|
|
3165
|
+
n,
|
|
3166
|
+
`/custom_hostnames/${encodeURIComponent(t)}`
|
|
3167
|
+
).res();
|
|
3168
|
+
if (!s.ok)
|
|
3169
|
+
throw new H(503, {
|
|
3170
|
+
message: await s.text()
|
|
3171
|
+
});
|
|
3172
|
+
return r.customDomainAdapter.update(
|
|
3173
|
+
e,
|
|
3174
|
+
t,
|
|
3175
|
+
n
|
|
3176
|
+
);
|
|
3143
3177
|
}
|
|
3144
3178
|
};
|
|
3145
3179
|
}
|