@authhero/kysely-adapter 0.7.11 → 0.7.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kysely-adapter.cjs +1 -1
- package/dist/kysely-adapter.d.ts +65 -542
- package/dist/kysely-adapter.iife.js +1 -1
- package/dist/kysely-adapter.mjs +972 -1174
- package/package.json +2 -2
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
1
|
+
var Jn = Object.defineProperty;
|
|
2
|
+
var Kn = (n, e, t) => e in n ? Jn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var Qt = (n, e, t) => Kn(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
var Gt = class extends Error {
|
|
5
5
|
constructor(e = 500, t) {
|
|
6
6
|
super(t == null ? void 0 : t.message, { cause: t == null ? void 0 : t.cause });
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
Qt(this, "res");
|
|
8
|
+
Qt(this, "status");
|
|
9
9
|
this.res = t == null ? void 0 : t.res, this.status = e;
|
|
10
10
|
}
|
|
11
11
|
getResponse() {
|
|
@@ -17,7 +17,7 @@ var Et = class extends Error {
|
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
function
|
|
20
|
+
function Qn(n) {
|
|
21
21
|
return async (e, t) => {
|
|
22
22
|
const { identities: s, ...r } = t, a = {
|
|
23
23
|
...r,
|
|
@@ -30,7 +30,7 @@ function Hn(n) {
|
|
|
30
30
|
try {
|
|
31
31
|
await n.insertInto("users").values(a).execute();
|
|
32
32
|
} catch (o) {
|
|
33
|
-
throw o.code === "SQLITE_CONSTRAINT_UNIQUE" || o.message.includes("AlreadyExists") ? new
|
|
33
|
+
throw o.code === "SQLITE_CONSTRAINT_UNIQUE" || o.message.includes("AlreadyExists") ? new Gt(409, { message: "User already exists" }) : (console.log(o.message), new Gt(500, { message: `${o.code}, ${o.message}` }));
|
|
34
34
|
}
|
|
35
35
|
return {
|
|
36
36
|
...a,
|
|
@@ -47,7 +47,7 @@ function R(n) {
|
|
|
47
47
|
e[t] === null ? delete e[t] : typeof e[t] == "object" && (Array.isArray(e[t]) ? e[t] = e[t].map(R) : e[t] = R(e[t]));
|
|
48
48
|
return e;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function Hn(n, e) {
|
|
51
51
|
var t = {};
|
|
52
52
|
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
|
|
53
53
|
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -55,7 +55,7 @@ function Yn(n, e) {
|
|
|
55
55
|
e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
|
|
56
56
|
return t;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function Yn(n, e) {
|
|
59
59
|
var t;
|
|
60
60
|
return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
|
|
61
61
|
}
|
|
@@ -66,28 +66,28 @@ function Qe(n, e) {
|
|
|
66
66
|
return r._def.openapi = this._def.openapi, r;
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function Gn(n) {
|
|
70
70
|
if (typeof n.ZodType.prototype.openapi < "u")
|
|
71
71
|
return;
|
|
72
72
|
n.ZodType.prototype.openapi = function(r, a) {
|
|
73
|
-
var o, c, d, u, l,
|
|
74
|
-
const
|
|
75
|
-
param: Object.assign(Object.assign({}, (
|
|
76
|
-
} : void 0),
|
|
77
|
-
if (
|
|
73
|
+
var o, c, d, u, l, j;
|
|
74
|
+
const A = typeof r == "string" ? a : r, U = A ?? {}, { param: ie } = U, Re = Hn(U, ["param"]), oe = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), ce = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), Re), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || ie ? {
|
|
75
|
+
param: Object.assign(Object.assign({}, (j = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || j === void 0 ? void 0 : j.param), ie)
|
|
76
|
+
} : void 0), de = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(oe).length > 0 ? { _internal: oe } : void 0), Object.keys(ce).length > 0 ? { metadata: ce } : void 0) }));
|
|
77
|
+
if (Yn(this, "ZodObject")) {
|
|
78
78
|
const $e = this.extend;
|
|
79
|
-
|
|
80
|
-
var Q, H,
|
|
81
|
-
const
|
|
82
|
-
return
|
|
79
|
+
de.extend = function(...Pe) {
|
|
80
|
+
var K, Q, H, ue, xe, Te;
|
|
81
|
+
const Oe = $e.apply(this, Pe);
|
|
82
|
+
return Oe._def.openapi = {
|
|
83
83
|
_internal: {
|
|
84
|
-
extendedFrom: !((
|
|
84
|
+
extendedFrom: !((Q = (K = this._def.openapi) === null || K === void 0 ? void 0 : K._internal) === null || Q === void 0) && Q.refId ? { refId: (ue = (H = this._def.openapi) === null || H === void 0 ? void 0 : H._internal) === null || ue === void 0 ? void 0 : ue.refId, schema: this } : (xe = this._def.openapi) === null || xe === void 0 ? void 0 : xe._internal.extendedFrom
|
|
85
85
|
},
|
|
86
|
-
metadata: (
|
|
87
|
-
},
|
|
86
|
+
metadata: (Te = Oe._def.openapi) === null || Te === void 0 ? void 0 : Te.metadata
|
|
87
|
+
}, Oe;
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
return
|
|
90
|
+
return de;
|
|
91
91
|
}, Qe(n, "optional"), Qe(n, "nullable"), Qe(n, "default"), Qe(n, "transform"), Qe(n, "refine");
|
|
92
92
|
const e = n.ZodObject.prototype.deepPartial;
|
|
93
93
|
n.ZodObject.prototype.deepPartial = function() {
|
|
@@ -145,14 +145,14 @@ var N;
|
|
|
145
145
|
}
|
|
146
146
|
n.joinValues = s, n.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
|
|
147
147
|
})(N || (N = {}));
|
|
148
|
-
var
|
|
148
|
+
var Xt;
|
|
149
149
|
(function(n) {
|
|
150
150
|
n.mergeShapes = (e, t) => ({
|
|
151
151
|
...e,
|
|
152
152
|
...t
|
|
153
153
|
// second overwrites first
|
|
154
154
|
});
|
|
155
|
-
})(
|
|
155
|
+
})(Xt || (Xt = {}));
|
|
156
156
|
const _ = N.arrayToEnum([
|
|
157
157
|
"string",
|
|
158
158
|
"nan",
|
|
@@ -174,7 +174,7 @@ const _ = N.arrayToEnum([
|
|
|
174
174
|
"never",
|
|
175
175
|
"map",
|
|
176
176
|
"set"
|
|
177
|
-
]),
|
|
177
|
+
]), pe = (n) => {
|
|
178
178
|
switch (typeof n) {
|
|
179
179
|
case "undefined":
|
|
180
180
|
return _.undefined;
|
|
@@ -212,8 +212,8 @@ const _ = N.arrayToEnum([
|
|
|
212
212
|
"invalid_intersection_types",
|
|
213
213
|
"not_multiple_of",
|
|
214
214
|
"not_finite"
|
|
215
|
-
]),
|
|
216
|
-
class
|
|
215
|
+
]), Xn = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
216
|
+
class L extends Error {
|
|
217
217
|
constructor(e) {
|
|
218
218
|
super(), this.issues = [], this.addIssue = (s) => {
|
|
219
219
|
this.issues = [...this.issues, s];
|
|
@@ -250,7 +250,7 @@ class V extends Error {
|
|
|
250
250
|
return r(this), s;
|
|
251
251
|
}
|
|
252
252
|
static assert(e) {
|
|
253
|
-
if (!(e instanceof
|
|
253
|
+
if (!(e instanceof L))
|
|
254
254
|
throw new Error(`Not a ZodError: ${e}`);
|
|
255
255
|
}
|
|
256
256
|
toString() {
|
|
@@ -272,7 +272,7 @@ class V extends Error {
|
|
|
272
272
|
return this.flatten();
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
|
|
275
|
+
L.create = (n) => new L(n);
|
|
276
276
|
const ze = (n, e) => {
|
|
277
277
|
let t;
|
|
278
278
|
switch (n.code) {
|
|
@@ -329,14 +329,14 @@ const ze = (n, e) => {
|
|
|
329
329
|
}
|
|
330
330
|
return { message: t };
|
|
331
331
|
};
|
|
332
|
-
let
|
|
333
|
-
function
|
|
334
|
-
|
|
332
|
+
let vn = ze;
|
|
333
|
+
function es(n) {
|
|
334
|
+
vn = n;
|
|
335
335
|
}
|
|
336
|
-
function
|
|
337
|
-
return
|
|
336
|
+
function Et() {
|
|
337
|
+
return vn;
|
|
338
338
|
}
|
|
339
|
-
const
|
|
339
|
+
const At = (n) => {
|
|
340
340
|
const { data: e, path: t, errorMaps: s, issueData: r } = n, a = [...t, ...r.path || []], o = {
|
|
341
341
|
...r,
|
|
342
342
|
path: a
|
|
@@ -356,9 +356,9 @@ const Rt = (n) => {
|
|
|
356
356
|
path: a,
|
|
357
357
|
message: c
|
|
358
358
|
};
|
|
359
|
-
},
|
|
359
|
+
}, ts = [];
|
|
360
360
|
function f(n, e) {
|
|
361
|
-
const t =
|
|
361
|
+
const t = Et(), s = At({
|
|
362
362
|
issueData: e,
|
|
363
363
|
data: n.data,
|
|
364
364
|
path: n.path,
|
|
@@ -415,12 +415,12 @@ class $ {
|
|
|
415
415
|
}
|
|
416
416
|
const x = Object.freeze({
|
|
417
417
|
status: "aborted"
|
|
418
|
-
}),
|
|
419
|
-
function
|
|
418
|
+
}), Rt = (n) => ({ status: "dirty", value: n }), D = (n) => ({ status: "valid", value: n }), en = (n) => n.status === "aborted", tn = (n) => n.status === "dirty", tt = (n) => n.status === "valid", nt = (n) => typeof Promise < "u" && n instanceof Promise;
|
|
419
|
+
function $t(n, e, t, s) {
|
|
420
420
|
if (typeof e == "function" ? n !== e || !s : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
421
421
|
return e.get(n);
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function wn(n, e, t, s, r) {
|
|
424
424
|
if (typeof e == "function" ? n !== e || !r : !e.has(n)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
425
425
|
return e.set(n, t), t;
|
|
426
426
|
}
|
|
@@ -429,7 +429,7 @@ var y;
|
|
|
429
429
|
n.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, n.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
430
430
|
})(y || (y = {}));
|
|
431
431
|
var Ye, Ge;
|
|
432
|
-
class
|
|
432
|
+
class X {
|
|
433
433
|
constructor(e, t, s, r) {
|
|
434
434
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = r;
|
|
435
435
|
}
|
|
@@ -437,7 +437,7 @@ class ee {
|
|
|
437
437
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
const
|
|
440
|
+
const hn = (n, e) => {
|
|
441
441
|
if (tt(e))
|
|
442
442
|
return { success: !0, data: e.value };
|
|
443
443
|
if (!n.common.issues.length)
|
|
@@ -447,12 +447,12 @@ const fn = (n, e) => {
|
|
|
447
447
|
get error() {
|
|
448
448
|
if (this._error)
|
|
449
449
|
return this._error;
|
|
450
|
-
const t = new
|
|
450
|
+
const t = new L(n.common.issues);
|
|
451
451
|
return this._error = t, this._error;
|
|
452
452
|
}
|
|
453
453
|
};
|
|
454
454
|
};
|
|
455
|
-
function
|
|
455
|
+
function T(n) {
|
|
456
456
|
if (!n)
|
|
457
457
|
return {};
|
|
458
458
|
const { errorMap: e, invalid_type_error: t, required_error: s, description: r } = n;
|
|
@@ -464,7 +464,7 @@ function O(n) {
|
|
|
464
464
|
return a.code === "invalid_enum_value" ? { message: u ?? o.defaultError } : typeof o.data > "u" ? { message: (c = u ?? s) !== null && c !== void 0 ? c : o.defaultError } : a.code !== "invalid_type" ? { message: o.defaultError } : { message: (d = u ?? t) !== null && d !== void 0 ? d : o.defaultError };
|
|
465
465
|
}, description: r };
|
|
466
466
|
}
|
|
467
|
-
class
|
|
467
|
+
class S {
|
|
468
468
|
constructor(e) {
|
|
469
469
|
this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this);
|
|
470
470
|
}
|
|
@@ -472,13 +472,13 @@ class Z {
|
|
|
472
472
|
return this._def.description;
|
|
473
473
|
}
|
|
474
474
|
_getType(e) {
|
|
475
|
-
return
|
|
475
|
+
return pe(e.data);
|
|
476
476
|
}
|
|
477
477
|
_getOrReturnCtx(e, t) {
|
|
478
478
|
return t || {
|
|
479
479
|
common: e.parent.common,
|
|
480
480
|
data: e.data,
|
|
481
|
-
parsedType:
|
|
481
|
+
parsedType: pe(e.data),
|
|
482
482
|
schemaErrorMap: this._def.errorMap,
|
|
483
483
|
path: e.path,
|
|
484
484
|
parent: e.parent
|
|
@@ -490,7 +490,7 @@ class Z {
|
|
|
490
490
|
ctx: {
|
|
491
491
|
common: e.parent.common,
|
|
492
492
|
data: e.data,
|
|
493
|
-
parsedType:
|
|
493
|
+
parsedType: pe(e.data),
|
|
494
494
|
schemaErrorMap: this._def.errorMap,
|
|
495
495
|
path: e.path,
|
|
496
496
|
parent: e.parent
|
|
@@ -525,9 +525,9 @@ class Z {
|
|
|
525
525
|
schemaErrorMap: this._def.errorMap,
|
|
526
526
|
parent: null,
|
|
527
527
|
data: e,
|
|
528
|
-
parsedType:
|
|
528
|
+
parsedType: pe(e)
|
|
529
529
|
}, a = this._parseSync({ data: e, path: r.path, parent: r });
|
|
530
|
-
return
|
|
530
|
+
return hn(r, a);
|
|
531
531
|
}
|
|
532
532
|
async parseAsync(e, t) {
|
|
533
533
|
const s = await this.safeParseAsync(e, t);
|
|
@@ -546,9 +546,9 @@ class Z {
|
|
|
546
546
|
schemaErrorMap: this._def.errorMap,
|
|
547
547
|
parent: null,
|
|
548
548
|
data: e,
|
|
549
|
-
parsedType:
|
|
549
|
+
parsedType: pe(e)
|
|
550
550
|
}, r = this._parse({ data: e, path: s.path, parent: s }), a = await (nt(r) ? r : Promise.resolve(r));
|
|
551
|
-
return
|
|
551
|
+
return hn(s, a);
|
|
552
552
|
}
|
|
553
553
|
refine(e, t) {
|
|
554
554
|
const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
|
|
@@ -574,10 +574,10 @@ class Z {
|
|
|
574
574
|
return this._refinement(e);
|
|
575
575
|
}
|
|
576
576
|
optional() {
|
|
577
|
-
return
|
|
577
|
+
return Y.create(this, this._def);
|
|
578
578
|
}
|
|
579
579
|
nullable() {
|
|
580
|
-
return
|
|
580
|
+
return ge.create(this, this._def);
|
|
581
581
|
}
|
|
582
582
|
nullish() {
|
|
583
583
|
return this.nullable().optional();
|
|
@@ -596,7 +596,7 @@ class Z {
|
|
|
596
596
|
}
|
|
597
597
|
transform(e) {
|
|
598
598
|
return new q({
|
|
599
|
-
...
|
|
599
|
+
...T(this._def),
|
|
600
600
|
schema: this,
|
|
601
601
|
typeName: w.ZodEffects,
|
|
602
602
|
effect: { type: "transform", transform: e }
|
|
@@ -605,23 +605,23 @@ class Z {
|
|
|
605
605
|
default(e) {
|
|
606
606
|
const t = typeof e == "function" ? e : () => e;
|
|
607
607
|
return new pt({
|
|
608
|
-
...
|
|
608
|
+
...T(this._def),
|
|
609
609
|
innerType: this,
|
|
610
610
|
defaultValue: t,
|
|
611
611
|
typeName: w.ZodDefault
|
|
612
612
|
});
|
|
613
613
|
}
|
|
614
614
|
brand() {
|
|
615
|
-
return new
|
|
615
|
+
return new cn({
|
|
616
616
|
typeName: w.ZodBranded,
|
|
617
617
|
type: this,
|
|
618
|
-
...
|
|
618
|
+
...T(this._def)
|
|
619
619
|
});
|
|
620
620
|
}
|
|
621
621
|
catch(e) {
|
|
622
622
|
const t = typeof e == "function" ? e : () => e;
|
|
623
623
|
return new ht({
|
|
624
|
-
...
|
|
624
|
+
...T(this._def),
|
|
625
625
|
innerType: this,
|
|
626
626
|
catchValue: t,
|
|
627
627
|
typeName: w.ZodCatch
|
|
@@ -647,25 +647,25 @@ class Z {
|
|
|
647
647
|
return this.safeParse(null).success;
|
|
648
648
|
}
|
|
649
649
|
}
|
|
650
|
-
const
|
|
651
|
-
let
|
|
652
|
-
const
|
|
653
|
-
function
|
|
650
|
+
const ns = /^c[^\s-]{8,}$/i, ss = /^[0-9a-z]+$/, rs = /^[0-9A-HJKMNP-TV-Z]{26}$/, as = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, is = /^[a-z0-9_-]{21}$/i, os = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, cs = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ds = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
651
|
+
let Ht;
|
|
652
|
+
const us = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ls = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, ps = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, kn = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", hs = new RegExp(`^${kn}$`);
|
|
653
|
+
function bn(n) {
|
|
654
654
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
655
655
|
return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
656
656
|
}
|
|
657
|
-
function
|
|
658
|
-
return new RegExp(`^${
|
|
657
|
+
function fs(n) {
|
|
658
|
+
return new RegExp(`^${bn(n)}$`);
|
|
659
659
|
}
|
|
660
|
-
function
|
|
661
|
-
let e = `${
|
|
660
|
+
function xn(n) {
|
|
661
|
+
let e = `${kn}T${bn(n)}`;
|
|
662
662
|
const t = [];
|
|
663
663
|
return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
664
664
|
}
|
|
665
|
-
function
|
|
666
|
-
return !!((e === "v4" || !e) &&
|
|
665
|
+
function ms(n, e) {
|
|
666
|
+
return !!((e === "v4" || !e) && us.test(n) || (e === "v6" || !e) && ls.test(n));
|
|
667
667
|
}
|
|
668
|
-
class F extends
|
|
668
|
+
class F extends S {
|
|
669
669
|
_parse(e) {
|
|
670
670
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== _.string) {
|
|
671
671
|
const r = this._getOrReturnCtx(e);
|
|
@@ -714,43 +714,43 @@ class F extends Z {
|
|
|
714
714
|
message: r.message
|
|
715
715
|
}), t.dirty());
|
|
716
716
|
} else if (r.kind === "email")
|
|
717
|
-
|
|
717
|
+
cs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
718
718
|
validation: "email",
|
|
719
719
|
code: p.invalid_string,
|
|
720
720
|
message: r.message
|
|
721
721
|
}), t.dirty());
|
|
722
722
|
else if (r.kind === "emoji")
|
|
723
|
-
|
|
723
|
+
Ht || (Ht = new RegExp(ds, "u")), Ht.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
724
724
|
validation: "emoji",
|
|
725
725
|
code: p.invalid_string,
|
|
726
726
|
message: r.message
|
|
727
727
|
}), t.dirty());
|
|
728
728
|
else if (r.kind === "uuid")
|
|
729
|
-
|
|
729
|
+
as.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
730
730
|
validation: "uuid",
|
|
731
731
|
code: p.invalid_string,
|
|
732
732
|
message: r.message
|
|
733
733
|
}), t.dirty());
|
|
734
734
|
else if (r.kind === "nanoid")
|
|
735
|
-
|
|
735
|
+
is.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
736
736
|
validation: "nanoid",
|
|
737
737
|
code: p.invalid_string,
|
|
738
738
|
message: r.message
|
|
739
739
|
}), t.dirty());
|
|
740
740
|
else if (r.kind === "cuid")
|
|
741
|
-
|
|
741
|
+
ns.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
742
742
|
validation: "cuid",
|
|
743
743
|
code: p.invalid_string,
|
|
744
744
|
message: r.message
|
|
745
745
|
}), t.dirty());
|
|
746
746
|
else if (r.kind === "cuid2")
|
|
747
|
-
|
|
747
|
+
ss.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
748
748
|
validation: "cuid2",
|
|
749
749
|
code: p.invalid_string,
|
|
750
750
|
message: r.message
|
|
751
751
|
}), t.dirty());
|
|
752
752
|
else if (r.kind === "ulid")
|
|
753
|
-
|
|
753
|
+
rs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
754
754
|
validation: "ulid",
|
|
755
755
|
code: p.invalid_string,
|
|
756
756
|
message: r.message
|
|
@@ -781,27 +781,27 @@ class F extends Z {
|
|
|
781
781
|
code: p.invalid_string,
|
|
782
782
|
validation: { endsWith: r.value },
|
|
783
783
|
message: r.message
|
|
784
|
-
}), t.dirty()) : r.kind === "datetime" ?
|
|
784
|
+
}), t.dirty()) : r.kind === "datetime" ? xn(r).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
785
785
|
code: p.invalid_string,
|
|
786
786
|
validation: "datetime",
|
|
787
787
|
message: r.message
|
|
788
|
-
}), t.dirty()) : r.kind === "date" ?
|
|
788
|
+
}), t.dirty()) : r.kind === "date" ? hs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
789
789
|
code: p.invalid_string,
|
|
790
790
|
validation: "date",
|
|
791
791
|
message: r.message
|
|
792
|
-
}), t.dirty()) : r.kind === "time" ?
|
|
792
|
+
}), t.dirty()) : r.kind === "time" ? fs(r).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
793
793
|
code: p.invalid_string,
|
|
794
794
|
validation: "time",
|
|
795
795
|
message: r.message
|
|
796
|
-
}), t.dirty()) : r.kind === "duration" ?
|
|
796
|
+
}), t.dirty()) : r.kind === "duration" ? os.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
797
797
|
validation: "duration",
|
|
798
798
|
code: p.invalid_string,
|
|
799
799
|
message: r.message
|
|
800
|
-
}), t.dirty()) : r.kind === "ip" ?
|
|
800
|
+
}), t.dirty()) : r.kind === "ip" ? ms(e.data, r.version) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
801
801
|
validation: "ip",
|
|
802
802
|
code: p.invalid_string,
|
|
803
803
|
message: r.message
|
|
804
|
-
}), t.dirty()) : r.kind === "base64" ?
|
|
804
|
+
}), t.dirty()) : r.kind === "base64" ? ps.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
805
805
|
validation: "base64",
|
|
806
806
|
code: p.invalid_string,
|
|
807
807
|
message: r.message
|
|
@@ -1020,14 +1020,14 @@ F.create = (n) => {
|
|
|
1020
1020
|
checks: [],
|
|
1021
1021
|
typeName: w.ZodString,
|
|
1022
1022
|
coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
|
|
1023
|
-
...
|
|
1023
|
+
...T(n)
|
|
1024
1024
|
});
|
|
1025
1025
|
};
|
|
1026
|
-
function
|
|
1026
|
+
function _s(n, e) {
|
|
1027
1027
|
const t = (n.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, r = t > s ? t : s, a = parseInt(n.toFixed(r).replace(".", "")), o = parseInt(e.toFixed(r).replace(".", ""));
|
|
1028
1028
|
return a % o / Math.pow(10, r);
|
|
1029
1029
|
}
|
|
1030
|
-
class
|
|
1030
|
+
class fe extends S {
|
|
1031
1031
|
constructor() {
|
|
1032
1032
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1033
1033
|
}
|
|
@@ -1062,7 +1062,7 @@ class me extends Z {
|
|
|
1062
1062
|
inclusive: r.inclusive,
|
|
1063
1063
|
exact: !1,
|
|
1064
1064
|
message: r.message
|
|
1065
|
-
}), s.dirty()) : r.kind === "multipleOf" ?
|
|
1065
|
+
}), s.dirty()) : r.kind === "multipleOf" ? _s(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), f(t, {
|
|
1066
1066
|
code: p.not_multiple_of,
|
|
1067
1067
|
multipleOf: r.value,
|
|
1068
1068
|
message: r.message
|
|
@@ -1085,7 +1085,7 @@ class me extends Z {
|
|
|
1085
1085
|
return this.setLimit("max", e, !1, y.toString(t));
|
|
1086
1086
|
}
|
|
1087
1087
|
setLimit(e, t, s, r) {
|
|
1088
|
-
return new
|
|
1088
|
+
return new fe({
|
|
1089
1089
|
...this._def,
|
|
1090
1090
|
checks: [
|
|
1091
1091
|
...this._def.checks,
|
|
@@ -1099,7 +1099,7 @@ class me extends Z {
|
|
|
1099
1099
|
});
|
|
1100
1100
|
}
|
|
1101
1101
|
_addCheck(e) {
|
|
1102
|
-
return new
|
|
1102
|
+
return new fe({
|
|
1103
1103
|
...this._def,
|
|
1104
1104
|
checks: [...this._def.checks, e]
|
|
1105
1105
|
});
|
|
@@ -1193,13 +1193,13 @@ class me extends Z {
|
|
|
1193
1193
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
1194
1194
|
}
|
|
1195
1195
|
}
|
|
1196
|
-
|
|
1196
|
+
fe.create = (n) => new fe({
|
|
1197
1197
|
checks: [],
|
|
1198
1198
|
typeName: w.ZodNumber,
|
|
1199
1199
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
1200
|
-
...
|
|
1200
|
+
...T(n)
|
|
1201
1201
|
});
|
|
1202
|
-
class
|
|
1202
|
+
class me extends S {
|
|
1203
1203
|
constructor() {
|
|
1204
1204
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1205
1205
|
}
|
|
@@ -1247,7 +1247,7 @@ class _e extends Z {
|
|
|
1247
1247
|
return this.setLimit("max", e, !1, y.toString(t));
|
|
1248
1248
|
}
|
|
1249
1249
|
setLimit(e, t, s, r) {
|
|
1250
|
-
return new
|
|
1250
|
+
return new me({
|
|
1251
1251
|
...this._def,
|
|
1252
1252
|
checks: [
|
|
1253
1253
|
...this._def.checks,
|
|
@@ -1261,7 +1261,7 @@ class _e extends Z {
|
|
|
1261
1261
|
});
|
|
1262
1262
|
}
|
|
1263
1263
|
_addCheck(e) {
|
|
1264
|
-
return new
|
|
1264
|
+
return new me({
|
|
1265
1265
|
...this._def,
|
|
1266
1266
|
checks: [...this._def.checks, e]
|
|
1267
1267
|
});
|
|
@@ -1318,16 +1318,16 @@ class _e extends Z {
|
|
|
1318
1318
|
return e;
|
|
1319
1319
|
}
|
|
1320
1320
|
}
|
|
1321
|
-
|
|
1321
|
+
me.create = (n) => {
|
|
1322
1322
|
var e;
|
|
1323
|
-
return new
|
|
1323
|
+
return new me({
|
|
1324
1324
|
checks: [],
|
|
1325
1325
|
typeName: w.ZodBigInt,
|
|
1326
1326
|
coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
|
|
1327
|
-
...
|
|
1327
|
+
...T(n)
|
|
1328
1328
|
});
|
|
1329
1329
|
};
|
|
1330
|
-
class st extends
|
|
1330
|
+
class st extends S {
|
|
1331
1331
|
_parse(e) {
|
|
1332
1332
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== _.boolean) {
|
|
1333
1333
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1343,9 +1343,9 @@ class st extends Z {
|
|
|
1343
1343
|
st.create = (n) => new st({
|
|
1344
1344
|
typeName: w.ZodBoolean,
|
|
1345
1345
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
1346
|
-
...
|
|
1346
|
+
...T(n)
|
|
1347
1347
|
});
|
|
1348
|
-
class
|
|
1348
|
+
class je extends S {
|
|
1349
1349
|
_parse(e) {
|
|
1350
1350
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== _.date) {
|
|
1351
1351
|
const r = this._getOrReturnCtx(e);
|
|
@@ -1385,7 +1385,7 @@ class Ne extends Z {
|
|
|
1385
1385
|
};
|
|
1386
1386
|
}
|
|
1387
1387
|
_addCheck(e) {
|
|
1388
|
-
return new
|
|
1388
|
+
return new je({
|
|
1389
1389
|
...this._def,
|
|
1390
1390
|
checks: [...this._def.checks, e]
|
|
1391
1391
|
});
|
|
@@ -1417,13 +1417,13 @@ class Ne extends Z {
|
|
|
1417
1417
|
return e != null ? new Date(e) : null;
|
|
1418
1418
|
}
|
|
1419
1419
|
}
|
|
1420
|
-
|
|
1420
|
+
je.create = (n) => new je({
|
|
1421
1421
|
checks: [],
|
|
1422
1422
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
1423
1423
|
typeName: w.ZodDate,
|
|
1424
|
-
...
|
|
1424
|
+
...T(n)
|
|
1425
1425
|
});
|
|
1426
|
-
class
|
|
1426
|
+
class Pt extends S {
|
|
1427
1427
|
_parse(e) {
|
|
1428
1428
|
if (this._getType(e) !== _.symbol) {
|
|
1429
1429
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1436,11 +1436,11 @@ class Dt extends Z {
|
|
|
1436
1436
|
return D(e.data);
|
|
1437
1437
|
}
|
|
1438
1438
|
}
|
|
1439
|
-
|
|
1439
|
+
Pt.create = (n) => new Pt({
|
|
1440
1440
|
typeName: w.ZodSymbol,
|
|
1441
|
-
...
|
|
1441
|
+
...T(n)
|
|
1442
1442
|
});
|
|
1443
|
-
class rt extends
|
|
1443
|
+
class rt extends S {
|
|
1444
1444
|
_parse(e) {
|
|
1445
1445
|
if (this._getType(e) !== _.undefined) {
|
|
1446
1446
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1455,9 +1455,9 @@ class rt extends Z {
|
|
|
1455
1455
|
}
|
|
1456
1456
|
rt.create = (n) => new rt({
|
|
1457
1457
|
typeName: w.ZodUndefined,
|
|
1458
|
-
...
|
|
1458
|
+
...T(n)
|
|
1459
1459
|
});
|
|
1460
|
-
class at extends
|
|
1460
|
+
class at extends S {
|
|
1461
1461
|
_parse(e) {
|
|
1462
1462
|
if (this._getType(e) !== _.null) {
|
|
1463
1463
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1472,9 +1472,9 @@ class at extends Z {
|
|
|
1472
1472
|
}
|
|
1473
1473
|
at.create = (n) => new at({
|
|
1474
1474
|
typeName: w.ZodNull,
|
|
1475
|
-
...
|
|
1475
|
+
...T(n)
|
|
1476
1476
|
});
|
|
1477
|
-
class Be extends
|
|
1477
|
+
class Be extends S {
|
|
1478
1478
|
constructor() {
|
|
1479
1479
|
super(...arguments), this._any = !0;
|
|
1480
1480
|
}
|
|
@@ -1484,9 +1484,9 @@ class Be extends Z {
|
|
|
1484
1484
|
}
|
|
1485
1485
|
Be.create = (n) => new Be({
|
|
1486
1486
|
typeName: w.ZodAny,
|
|
1487
|
-
...
|
|
1487
|
+
...T(n)
|
|
1488
1488
|
});
|
|
1489
|
-
class
|
|
1489
|
+
class Se extends S {
|
|
1490
1490
|
constructor() {
|
|
1491
1491
|
super(...arguments), this._unknown = !0;
|
|
1492
1492
|
}
|
|
@@ -1494,11 +1494,11 @@ class Ze extends Z {
|
|
|
1494
1494
|
return D(e.data);
|
|
1495
1495
|
}
|
|
1496
1496
|
}
|
|
1497
|
-
|
|
1497
|
+
Se.create = (n) => new Se({
|
|
1498
1498
|
typeName: w.ZodUnknown,
|
|
1499
|
-
...
|
|
1499
|
+
...T(n)
|
|
1500
1500
|
});
|
|
1501
|
-
class
|
|
1501
|
+
class re extends S {
|
|
1502
1502
|
_parse(e) {
|
|
1503
1503
|
const t = this._getOrReturnCtx(e);
|
|
1504
1504
|
return f(t, {
|
|
@@ -1508,11 +1508,11 @@ class ie extends Z {
|
|
|
1508
1508
|
}), x;
|
|
1509
1509
|
}
|
|
1510
1510
|
}
|
|
1511
|
-
|
|
1511
|
+
re.create = (n) => new re({
|
|
1512
1512
|
typeName: w.ZodNever,
|
|
1513
|
-
...
|
|
1513
|
+
...T(n)
|
|
1514
1514
|
});
|
|
1515
|
-
class
|
|
1515
|
+
class Dt extends S {
|
|
1516
1516
|
_parse(e) {
|
|
1517
1517
|
if (this._getType(e) !== _.undefined) {
|
|
1518
1518
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1525,11 +1525,11 @@ class Mt extends Z {
|
|
|
1525
1525
|
return D(e.data);
|
|
1526
1526
|
}
|
|
1527
1527
|
}
|
|
1528
|
-
|
|
1528
|
+
Dt.create = (n) => new Dt({
|
|
1529
1529
|
typeName: w.ZodVoid,
|
|
1530
|
-
...
|
|
1530
|
+
...T(n)
|
|
1531
1531
|
});
|
|
1532
|
-
class B extends
|
|
1532
|
+
class B extends S {
|
|
1533
1533
|
_parse(e) {
|
|
1534
1534
|
const { ctx: t, status: s } = this._processInputParams(e), r = this._def;
|
|
1535
1535
|
if (t.parsedType !== _.array)
|
|
@@ -1565,8 +1565,8 @@ class B extends Z {
|
|
|
1565
1565
|
exact: !1,
|
|
1566
1566
|
message: r.maxLength.message
|
|
1567
1567
|
}), s.dirty()), t.common.async)
|
|
1568
|
-
return Promise.all([...t.data].map((o, c) => r.type._parseAsync(new
|
|
1569
|
-
const a = [...t.data].map((o, c) => r.type._parseSync(new
|
|
1568
|
+
return Promise.all([...t.data].map((o, c) => r.type._parseAsync(new X(t, o, t.path, c)))).then((o) => $.mergeArray(s, o));
|
|
1569
|
+
const a = [...t.data].map((o, c) => r.type._parseSync(new X(t, o, t.path, c)));
|
|
1570
1570
|
return $.mergeArray(s, a);
|
|
1571
1571
|
}
|
|
1572
1572
|
get element() {
|
|
@@ -1600,25 +1600,25 @@ B.create = (n, e) => new B({
|
|
|
1600
1600
|
maxLength: null,
|
|
1601
1601
|
exactLength: null,
|
|
1602
1602
|
typeName: w.ZodArray,
|
|
1603
|
-
...
|
|
1603
|
+
...T(e)
|
|
1604
1604
|
});
|
|
1605
1605
|
function Me(n) {
|
|
1606
|
-
if (n instanceof
|
|
1606
|
+
if (n instanceof I) {
|
|
1607
1607
|
const e = {};
|
|
1608
1608
|
for (const t in n.shape) {
|
|
1609
1609
|
const s = n.shape[t];
|
|
1610
|
-
e[t] =
|
|
1610
|
+
e[t] = Y.create(Me(s));
|
|
1611
1611
|
}
|
|
1612
|
-
return new
|
|
1612
|
+
return new I({
|
|
1613
1613
|
...n._def,
|
|
1614
1614
|
shape: () => e
|
|
1615
1615
|
});
|
|
1616
1616
|
} else return n instanceof B ? new B({
|
|
1617
1617
|
...n._def,
|
|
1618
1618
|
type: Me(n.element)
|
|
1619
|
-
}) : n instanceof
|
|
1619
|
+
}) : n instanceof Y ? Y.create(Me(n.unwrap())) : n instanceof ge ? ge.create(Me(n.unwrap())) : n instanceof ee ? ee.create(n.items.map((e) => Me(e))) : n;
|
|
1620
1620
|
}
|
|
1621
|
-
class
|
|
1621
|
+
class I extends S {
|
|
1622
1622
|
constructor() {
|
|
1623
1623
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1624
1624
|
}
|
|
@@ -1638,7 +1638,7 @@ class E extends Z {
|
|
|
1638
1638
|
}), x;
|
|
1639
1639
|
}
|
|
1640
1640
|
const { status: t, ctx: s } = this._processInputParams(e), { shape: r, keys: a } = this._getCached(), o = [];
|
|
1641
|
-
if (!(this._def.catchall instanceof
|
|
1641
|
+
if (!(this._def.catchall instanceof re && this._def.unknownKeys === "strip"))
|
|
1642
1642
|
for (const d in s.data)
|
|
1643
1643
|
a.includes(d) || o.push(d);
|
|
1644
1644
|
const c = [];
|
|
@@ -1646,11 +1646,11 @@ class E extends Z {
|
|
|
1646
1646
|
const u = r[d], l = s.data[d];
|
|
1647
1647
|
c.push({
|
|
1648
1648
|
key: { status: "valid", value: d },
|
|
1649
|
-
value: u._parse(new
|
|
1649
|
+
value: u._parse(new X(s, l, s.path, d)),
|
|
1650
1650
|
alwaysSet: d in s.data
|
|
1651
1651
|
});
|
|
1652
1652
|
}
|
|
1653
|
-
if (this._def.catchall instanceof
|
|
1653
|
+
if (this._def.catchall instanceof re) {
|
|
1654
1654
|
const d = this._def.unknownKeys;
|
|
1655
1655
|
if (d === "passthrough")
|
|
1656
1656
|
for (const u of o)
|
|
@@ -1671,7 +1671,7 @@ class E extends Z {
|
|
|
1671
1671
|
c.push({
|
|
1672
1672
|
key: { status: "valid", value: u },
|
|
1673
1673
|
value: d._parse(
|
|
1674
|
-
new
|
|
1674
|
+
new X(s, l, s.path, u)
|
|
1675
1675
|
//, ctx.child(key), value, getParsedType(value)
|
|
1676
1676
|
),
|
|
1677
1677
|
alwaysSet: u in s.data
|
|
@@ -1681,10 +1681,10 @@ class E extends Z {
|
|
|
1681
1681
|
return s.common.async ? Promise.resolve().then(async () => {
|
|
1682
1682
|
const d = [];
|
|
1683
1683
|
for (const u of c) {
|
|
1684
|
-
const l = await u.key,
|
|
1684
|
+
const l = await u.key, j = await u.value;
|
|
1685
1685
|
d.push({
|
|
1686
1686
|
key: l,
|
|
1687
|
-
value:
|
|
1687
|
+
value: j,
|
|
1688
1688
|
alwaysSet: u.alwaysSet
|
|
1689
1689
|
});
|
|
1690
1690
|
}
|
|
@@ -1695,7 +1695,7 @@ class E extends Z {
|
|
|
1695
1695
|
return this._def.shape();
|
|
1696
1696
|
}
|
|
1697
1697
|
strict(e) {
|
|
1698
|
-
return y.errToObj, new
|
|
1698
|
+
return y.errToObj, new I({
|
|
1699
1699
|
...this._def,
|
|
1700
1700
|
unknownKeys: "strict",
|
|
1701
1701
|
...e !== void 0 ? {
|
|
@@ -1712,13 +1712,13 @@ class E extends Z {
|
|
|
1712
1712
|
});
|
|
1713
1713
|
}
|
|
1714
1714
|
strip() {
|
|
1715
|
-
return new
|
|
1715
|
+
return new I({
|
|
1716
1716
|
...this._def,
|
|
1717
1717
|
unknownKeys: "strip"
|
|
1718
1718
|
});
|
|
1719
1719
|
}
|
|
1720
1720
|
passthrough() {
|
|
1721
|
-
return new
|
|
1721
|
+
return new I({
|
|
1722
1722
|
...this._def,
|
|
1723
1723
|
unknownKeys: "passthrough"
|
|
1724
1724
|
});
|
|
@@ -1741,7 +1741,7 @@ class E extends Z {
|
|
|
1741
1741
|
// }) as any;
|
|
1742
1742
|
// };
|
|
1743
1743
|
extend(e) {
|
|
1744
|
-
return new
|
|
1744
|
+
return new I({
|
|
1745
1745
|
...this._def,
|
|
1746
1746
|
shape: () => ({
|
|
1747
1747
|
...this._def.shape(),
|
|
@@ -1755,7 +1755,7 @@ class E extends Z {
|
|
|
1755
1755
|
* upgrade if you are experiencing issues.
|
|
1756
1756
|
*/
|
|
1757
1757
|
merge(e) {
|
|
1758
|
-
return new
|
|
1758
|
+
return new I({
|
|
1759
1759
|
unknownKeys: e._def.unknownKeys,
|
|
1760
1760
|
catchall: e._def.catchall,
|
|
1761
1761
|
shape: () => ({
|
|
@@ -1825,7 +1825,7 @@ class E extends Z {
|
|
|
1825
1825
|
// return merged;
|
|
1826
1826
|
// }
|
|
1827
1827
|
catchall(e) {
|
|
1828
|
-
return new
|
|
1828
|
+
return new I({
|
|
1829
1829
|
...this._def,
|
|
1830
1830
|
catchall: e
|
|
1831
1831
|
});
|
|
@@ -1834,7 +1834,7 @@ class E extends Z {
|
|
|
1834
1834
|
const t = {};
|
|
1835
1835
|
return N.objectKeys(e).forEach((s) => {
|
|
1836
1836
|
e[s] && this.shape[s] && (t[s] = this.shape[s]);
|
|
1837
|
-
}), new
|
|
1837
|
+
}), new I({
|
|
1838
1838
|
...this._def,
|
|
1839
1839
|
shape: () => t
|
|
1840
1840
|
});
|
|
@@ -1843,7 +1843,7 @@ class E extends Z {
|
|
|
1843
1843
|
const t = {};
|
|
1844
1844
|
return N.objectKeys(this.shape).forEach((s) => {
|
|
1845
1845
|
e[s] || (t[s] = this.shape[s]);
|
|
1846
|
-
}), new
|
|
1846
|
+
}), new I({
|
|
1847
1847
|
...this._def,
|
|
1848
1848
|
shape: () => t
|
|
1849
1849
|
});
|
|
@@ -1859,7 +1859,7 @@ class E extends Z {
|
|
|
1859
1859
|
return N.objectKeys(this.shape).forEach((s) => {
|
|
1860
1860
|
const r = this.shape[s];
|
|
1861
1861
|
e && !e[s] ? t[s] = r : t[s] = r.optional();
|
|
1862
|
-
}), new
|
|
1862
|
+
}), new I({
|
|
1863
1863
|
...this._def,
|
|
1864
1864
|
shape: () => t
|
|
1865
1865
|
});
|
|
@@ -1871,41 +1871,41 @@ class E extends Z {
|
|
|
1871
1871
|
t[s] = this.shape[s];
|
|
1872
1872
|
else {
|
|
1873
1873
|
let r = this.shape[s];
|
|
1874
|
-
for (; r instanceof
|
|
1874
|
+
for (; r instanceof Y; )
|
|
1875
1875
|
r = r._def.innerType;
|
|
1876
1876
|
t[s] = r;
|
|
1877
1877
|
}
|
|
1878
|
-
}), new
|
|
1878
|
+
}), new I({
|
|
1879
1879
|
...this._def,
|
|
1880
1880
|
shape: () => t
|
|
1881
1881
|
});
|
|
1882
1882
|
}
|
|
1883
1883
|
keyof() {
|
|
1884
|
-
return
|
|
1884
|
+
return Tn(N.objectKeys(this.shape));
|
|
1885
1885
|
}
|
|
1886
1886
|
}
|
|
1887
|
-
|
|
1887
|
+
I.create = (n, e) => new I({
|
|
1888
1888
|
shape: () => n,
|
|
1889
1889
|
unknownKeys: "strip",
|
|
1890
|
-
catchall:
|
|
1890
|
+
catchall: re.create(),
|
|
1891
1891
|
typeName: w.ZodObject,
|
|
1892
|
-
...
|
|
1892
|
+
...T(e)
|
|
1893
1893
|
});
|
|
1894
|
-
|
|
1894
|
+
I.strictCreate = (n, e) => new I({
|
|
1895
1895
|
shape: () => n,
|
|
1896
1896
|
unknownKeys: "strict",
|
|
1897
|
-
catchall:
|
|
1897
|
+
catchall: re.create(),
|
|
1898
1898
|
typeName: w.ZodObject,
|
|
1899
|
-
...
|
|
1899
|
+
...T(e)
|
|
1900
1900
|
});
|
|
1901
|
-
|
|
1901
|
+
I.lazycreate = (n, e) => new I({
|
|
1902
1902
|
shape: n,
|
|
1903
1903
|
unknownKeys: "strip",
|
|
1904
|
-
catchall:
|
|
1904
|
+
catchall: re.create(),
|
|
1905
1905
|
typeName: w.ZodObject,
|
|
1906
|
-
...
|
|
1906
|
+
...T(e)
|
|
1907
1907
|
});
|
|
1908
|
-
class it extends
|
|
1908
|
+
class it extends S {
|
|
1909
1909
|
_parse(e) {
|
|
1910
1910
|
const { ctx: t } = this._processInputParams(e), s = this._def.options;
|
|
1911
1911
|
function r(a) {
|
|
@@ -1915,7 +1915,7 @@ class it extends Z {
|
|
|
1915
1915
|
for (const c of a)
|
|
1916
1916
|
if (c.result.status === "dirty")
|
|
1917
1917
|
return t.common.issues.push(...c.ctx.common.issues), c.result;
|
|
1918
|
-
const o = a.map((c) => new
|
|
1918
|
+
const o = a.map((c) => new L(c.ctx.common.issues));
|
|
1919
1919
|
return f(t, {
|
|
1920
1920
|
code: p.invalid_union,
|
|
1921
1921
|
unionErrors: o
|
|
@@ -1962,7 +1962,7 @@ class it extends Z {
|
|
|
1962
1962
|
}
|
|
1963
1963
|
if (a)
|
|
1964
1964
|
return t.common.issues.push(...a.ctx.common.issues), a.result;
|
|
1965
|
-
const c = o.map((d) => new
|
|
1965
|
+
const c = o.map((d) => new L(d));
|
|
1966
1966
|
return f(t, {
|
|
1967
1967
|
code: p.invalid_union,
|
|
1968
1968
|
unionErrors: c
|
|
@@ -1976,10 +1976,10 @@ class it extends Z {
|
|
|
1976
1976
|
it.create = (n, e) => new it({
|
|
1977
1977
|
options: n,
|
|
1978
1978
|
typeName: w.ZodUnion,
|
|
1979
|
-
...
|
|
1979
|
+
...T(e)
|
|
1980
1980
|
});
|
|
1981
|
-
const
|
|
1982
|
-
class
|
|
1981
|
+
const le = (n) => n instanceof dt ? le(n.schema) : n instanceof q ? le(n.innerType()) : n instanceof ut ? [n.value] : n instanceof _e ? n.options : n instanceof lt ? N.objectValues(n.enum) : n instanceof pt ? le(n._def.innerType) : n instanceof rt ? [void 0] : n instanceof at ? [null] : n instanceof Y ? [void 0, ...le(n.unwrap())] : n instanceof ge ? [null, ...le(n.unwrap())] : n instanceof cn || n instanceof ft ? le(n.unwrap()) : n instanceof ht ? le(n._def.innerType) : [];
|
|
1982
|
+
class Jt extends S {
|
|
1983
1983
|
_parse(e) {
|
|
1984
1984
|
const { ctx: t } = this._processInputParams(e);
|
|
1985
1985
|
if (t.parsedType !== _.object)
|
|
@@ -2023,7 +2023,7 @@ class Kt extends Z {
|
|
|
2023
2023
|
static create(e, t, s) {
|
|
2024
2024
|
const r = /* @__PURE__ */ new Map();
|
|
2025
2025
|
for (const a of t) {
|
|
2026
|
-
const o =
|
|
2026
|
+
const o = le(a.shape[e]);
|
|
2027
2027
|
if (!o.length)
|
|
2028
2028
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
2029
2029
|
for (const c of o) {
|
|
@@ -2032,23 +2032,23 @@ class Kt extends Z {
|
|
|
2032
2032
|
r.set(c, a);
|
|
2033
2033
|
}
|
|
2034
2034
|
}
|
|
2035
|
-
return new
|
|
2035
|
+
return new Jt({
|
|
2036
2036
|
typeName: w.ZodDiscriminatedUnion,
|
|
2037
2037
|
discriminator: e,
|
|
2038
2038
|
options: t,
|
|
2039
2039
|
optionsMap: r,
|
|
2040
|
-
...
|
|
2040
|
+
...T(s)
|
|
2041
2041
|
});
|
|
2042
2042
|
}
|
|
2043
2043
|
}
|
|
2044
|
-
function
|
|
2045
|
-
const t =
|
|
2044
|
+
function nn(n, e) {
|
|
2045
|
+
const t = pe(n), s = pe(e);
|
|
2046
2046
|
if (n === e)
|
|
2047
2047
|
return { valid: !0, data: n };
|
|
2048
2048
|
if (t === _.object && s === _.object) {
|
|
2049
2049
|
const r = N.objectKeys(e), a = N.objectKeys(n).filter((c) => r.indexOf(c) !== -1), o = { ...n, ...e };
|
|
2050
2050
|
for (const c of a) {
|
|
2051
|
-
const d =
|
|
2051
|
+
const d = nn(n[c], e[c]);
|
|
2052
2052
|
if (!d.valid)
|
|
2053
2053
|
return { valid: !1 };
|
|
2054
2054
|
o[c] = d.data;
|
|
@@ -2059,7 +2059,7 @@ function sn(n, e) {
|
|
|
2059
2059
|
return { valid: !1 };
|
|
2060
2060
|
const r = [];
|
|
2061
2061
|
for (let a = 0; a < n.length; a++) {
|
|
2062
|
-
const o = n[a], c = e[a], d =
|
|
2062
|
+
const o = n[a], c = e[a], d = nn(o, c);
|
|
2063
2063
|
if (!d.valid)
|
|
2064
2064
|
return { valid: !1 };
|
|
2065
2065
|
r.push(d.data);
|
|
@@ -2067,13 +2067,13 @@ function sn(n, e) {
|
|
|
2067
2067
|
return { valid: !0, data: r };
|
|
2068
2068
|
} else return t === _.date && s === _.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
|
|
2069
2069
|
}
|
|
2070
|
-
class ot extends
|
|
2070
|
+
class ot extends S {
|
|
2071
2071
|
_parse(e) {
|
|
2072
2072
|
const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
|
|
2073
|
-
if (
|
|
2073
|
+
if (en(a) || en(o))
|
|
2074
2074
|
return x;
|
|
2075
|
-
const c =
|
|
2076
|
-
return c.valid ? ((
|
|
2075
|
+
const c = nn(a.value, o.value);
|
|
2076
|
+
return c.valid ? ((tn(a) || tn(o)) && t.dirty(), { status: t.value, value: c.data }) : (f(s, {
|
|
2077
2077
|
code: p.invalid_intersection_types
|
|
2078
2078
|
}), x);
|
|
2079
2079
|
};
|
|
@@ -2103,9 +2103,9 @@ ot.create = (n, e, t) => new ot({
|
|
|
2103
2103
|
left: n,
|
|
2104
2104
|
right: e,
|
|
2105
2105
|
typeName: w.ZodIntersection,
|
|
2106
|
-
...
|
|
2106
|
+
...T(t)
|
|
2107
2107
|
});
|
|
2108
|
-
class
|
|
2108
|
+
class ee extends S {
|
|
2109
2109
|
_parse(e) {
|
|
2110
2110
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2111
2111
|
if (s.parsedType !== _.array)
|
|
@@ -2131,7 +2131,7 @@ class te extends Z {
|
|
|
2131
2131
|
}), t.dirty());
|
|
2132
2132
|
const r = [...s.data].map((a, o) => {
|
|
2133
2133
|
const c = this._def.items[o] || this._def.rest;
|
|
2134
|
-
return c ? c._parse(new
|
|
2134
|
+
return c ? c._parse(new X(s, a, s.path, o)) : null;
|
|
2135
2135
|
}).filter((a) => !!a);
|
|
2136
2136
|
return s.common.async ? Promise.all(r).then((a) => $.mergeArray(t, a)) : $.mergeArray(t, r);
|
|
2137
2137
|
}
|
|
@@ -2139,23 +2139,23 @@ class te extends Z {
|
|
|
2139
2139
|
return this._def.items;
|
|
2140
2140
|
}
|
|
2141
2141
|
rest(e) {
|
|
2142
|
-
return new
|
|
2142
|
+
return new ee({
|
|
2143
2143
|
...this._def,
|
|
2144
2144
|
rest: e
|
|
2145
2145
|
});
|
|
2146
2146
|
}
|
|
2147
2147
|
}
|
|
2148
|
-
|
|
2148
|
+
ee.create = (n, e) => {
|
|
2149
2149
|
if (!Array.isArray(n))
|
|
2150
2150
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2151
|
-
return new
|
|
2151
|
+
return new ee({
|
|
2152
2152
|
items: n,
|
|
2153
2153
|
typeName: w.ZodTuple,
|
|
2154
2154
|
rest: null,
|
|
2155
|
-
...
|
|
2155
|
+
...T(e)
|
|
2156
2156
|
});
|
|
2157
2157
|
};
|
|
2158
|
-
class ct extends
|
|
2158
|
+
class ct extends S {
|
|
2159
2159
|
get keySchema() {
|
|
2160
2160
|
return this._def.keyType;
|
|
2161
2161
|
}
|
|
@@ -2173,8 +2173,8 @@ class ct extends Z {
|
|
|
2173
2173
|
const r = [], a = this._def.keyType, o = this._def.valueType;
|
|
2174
2174
|
for (const c in s.data)
|
|
2175
2175
|
r.push({
|
|
2176
|
-
key: a._parse(new
|
|
2177
|
-
value: o._parse(new
|
|
2176
|
+
key: a._parse(new X(s, c, s.path, c)),
|
|
2177
|
+
value: o._parse(new X(s, s.data[c], s.path, c)),
|
|
2178
2178
|
alwaysSet: c in s.data
|
|
2179
2179
|
});
|
|
2180
2180
|
return s.common.async ? $.mergeObjectAsync(t, r) : $.mergeObjectSync(t, r);
|
|
@@ -2183,20 +2183,20 @@ class ct extends Z {
|
|
|
2183
2183
|
return this._def.valueType;
|
|
2184
2184
|
}
|
|
2185
2185
|
static create(e, t, s) {
|
|
2186
|
-
return t instanceof
|
|
2186
|
+
return t instanceof S ? new ct({
|
|
2187
2187
|
keyType: e,
|
|
2188
2188
|
valueType: t,
|
|
2189
2189
|
typeName: w.ZodRecord,
|
|
2190
|
-
...
|
|
2190
|
+
...T(s)
|
|
2191
2191
|
}) : new ct({
|
|
2192
2192
|
keyType: F.create(),
|
|
2193
2193
|
valueType: e,
|
|
2194
2194
|
typeName: w.ZodRecord,
|
|
2195
|
-
...
|
|
2195
|
+
...T(t)
|
|
2196
2196
|
});
|
|
2197
2197
|
}
|
|
2198
2198
|
}
|
|
2199
|
-
class
|
|
2199
|
+
class Mt extends S {
|
|
2200
2200
|
get keySchema() {
|
|
2201
2201
|
return this._def.keyType;
|
|
2202
2202
|
}
|
|
@@ -2212,8 +2212,8 @@ class Lt extends Z {
|
|
|
2212
2212
|
received: s.parsedType
|
|
2213
2213
|
}), x;
|
|
2214
2214
|
const r = this._def.keyType, a = this._def.valueType, o = [...s.data.entries()].map(([c, d], u) => ({
|
|
2215
|
-
key: r._parse(new
|
|
2216
|
-
value: a._parse(new
|
|
2215
|
+
key: r._parse(new X(s, c, s.path, [u, "key"])),
|
|
2216
|
+
value: a._parse(new X(s, d, s.path, [u, "value"]))
|
|
2217
2217
|
}));
|
|
2218
2218
|
if (s.common.async) {
|
|
2219
2219
|
const c = /* @__PURE__ */ new Map();
|
|
@@ -2238,13 +2238,13 @@ class Lt extends Z {
|
|
|
2238
2238
|
}
|
|
2239
2239
|
}
|
|
2240
2240
|
}
|
|
2241
|
-
|
|
2241
|
+
Mt.create = (n, e, t) => new Mt({
|
|
2242
2242
|
valueType: e,
|
|
2243
2243
|
keyType: n,
|
|
2244
2244
|
typeName: w.ZodMap,
|
|
2245
|
-
...
|
|
2245
|
+
...T(t)
|
|
2246
2246
|
});
|
|
2247
|
-
class
|
|
2247
|
+
class Ne extends S {
|
|
2248
2248
|
_parse(e) {
|
|
2249
2249
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2250
2250
|
if (s.parsedType !== _.set)
|
|
@@ -2279,17 +2279,17 @@ class Ie extends Z {
|
|
|
2279
2279
|
}
|
|
2280
2280
|
return { status: t.value, value: u };
|
|
2281
2281
|
}
|
|
2282
|
-
const c = [...s.data.values()].map((d, u) => a._parse(new
|
|
2282
|
+
const c = [...s.data.values()].map((d, u) => a._parse(new X(s, d, s.path, u)));
|
|
2283
2283
|
return s.common.async ? Promise.all(c).then((d) => o(d)) : o(c);
|
|
2284
2284
|
}
|
|
2285
2285
|
min(e, t) {
|
|
2286
|
-
return new
|
|
2286
|
+
return new Ne({
|
|
2287
2287
|
...this._def,
|
|
2288
2288
|
minSize: { value: e, message: y.toString(t) }
|
|
2289
2289
|
});
|
|
2290
2290
|
}
|
|
2291
2291
|
max(e, t) {
|
|
2292
|
-
return new
|
|
2292
|
+
return new Ne({
|
|
2293
2293
|
...this._def,
|
|
2294
2294
|
maxSize: { value: e, message: y.toString(t) }
|
|
2295
2295
|
});
|
|
@@ -2301,14 +2301,14 @@ class Ie extends Z {
|
|
|
2301
2301
|
return this.min(1, e);
|
|
2302
2302
|
}
|
|
2303
2303
|
}
|
|
2304
|
-
|
|
2304
|
+
Ne.create = (n, e) => new Ne({
|
|
2305
2305
|
valueType: n,
|
|
2306
2306
|
minSize: null,
|
|
2307
2307
|
maxSize: null,
|
|
2308
2308
|
typeName: w.ZodSet,
|
|
2309
|
-
...
|
|
2309
|
+
...T(e)
|
|
2310
2310
|
});
|
|
2311
|
-
class Ue extends
|
|
2311
|
+
class Ue extends S {
|
|
2312
2312
|
constructor() {
|
|
2313
2313
|
super(...arguments), this.validate = this.implement;
|
|
2314
2314
|
}
|
|
@@ -2321,13 +2321,13 @@ class Ue extends Z {
|
|
|
2321
2321
|
received: t.parsedType
|
|
2322
2322
|
}), x;
|
|
2323
2323
|
function s(c, d) {
|
|
2324
|
-
return
|
|
2324
|
+
return At({
|
|
2325
2325
|
data: c,
|
|
2326
2326
|
path: t.path,
|
|
2327
2327
|
errorMaps: [
|
|
2328
2328
|
t.common.contextualErrorMap,
|
|
2329
2329
|
t.schemaErrorMap,
|
|
2330
|
-
|
|
2330
|
+
Et(),
|
|
2331
2331
|
ze
|
|
2332
2332
|
].filter((u) => !!u),
|
|
2333
2333
|
issueData: {
|
|
@@ -2337,13 +2337,13 @@ class Ue extends Z {
|
|
|
2337
2337
|
});
|
|
2338
2338
|
}
|
|
2339
2339
|
function r(c, d) {
|
|
2340
|
-
return
|
|
2340
|
+
return At({
|
|
2341
2341
|
data: c,
|
|
2342
2342
|
path: t.path,
|
|
2343
2343
|
errorMaps: [
|
|
2344
2344
|
t.common.contextualErrorMap,
|
|
2345
2345
|
t.schemaErrorMap,
|
|
2346
|
-
|
|
2346
|
+
Et(),
|
|
2347
2347
|
ze
|
|
2348
2348
|
].filter((u) => !!u),
|
|
2349
2349
|
issueData: {
|
|
@@ -2356,11 +2356,11 @@ class Ue extends Z {
|
|
|
2356
2356
|
if (this._def.returns instanceof We) {
|
|
2357
2357
|
const c = this;
|
|
2358
2358
|
return D(async function(...d) {
|
|
2359
|
-
const u = new
|
|
2360
|
-
throw u.addIssue(s(d,
|
|
2361
|
-
}),
|
|
2362
|
-
return await c._def.returns._def.type.parseAsync(
|
|
2363
|
-
throw u.addIssue(r(
|
|
2359
|
+
const u = new L([]), l = await c._def.args.parseAsync(d, a).catch((A) => {
|
|
2360
|
+
throw u.addIssue(s(d, A)), u;
|
|
2361
|
+
}), j = await Reflect.apply(o, this, l);
|
|
2362
|
+
return await c._def.returns._def.type.parseAsync(j, a).catch((A) => {
|
|
2363
|
+
throw u.addIssue(r(j, A)), u;
|
|
2364
2364
|
});
|
|
2365
2365
|
});
|
|
2366
2366
|
} else {
|
|
@@ -2368,11 +2368,11 @@ class Ue extends Z {
|
|
|
2368
2368
|
return D(function(...d) {
|
|
2369
2369
|
const u = c._def.args.safeParse(d, a);
|
|
2370
2370
|
if (!u.success)
|
|
2371
|
-
throw new
|
|
2372
|
-
const l = Reflect.apply(o, this, u.data),
|
|
2373
|
-
if (!
|
|
2374
|
-
throw new
|
|
2375
|
-
return
|
|
2371
|
+
throw new L([s(d, u.error)]);
|
|
2372
|
+
const l = Reflect.apply(o, this, u.data), j = c._def.returns.safeParse(l, a);
|
|
2373
|
+
if (!j.success)
|
|
2374
|
+
throw new L([r(l, j.error)]);
|
|
2375
|
+
return j.data;
|
|
2376
2376
|
});
|
|
2377
2377
|
}
|
|
2378
2378
|
}
|
|
@@ -2385,7 +2385,7 @@ class Ue extends Z {
|
|
|
2385
2385
|
args(...e) {
|
|
2386
2386
|
return new Ue({
|
|
2387
2387
|
...this._def,
|
|
2388
|
-
args:
|
|
2388
|
+
args: ee.create(e).rest(Se.create())
|
|
2389
2389
|
});
|
|
2390
2390
|
}
|
|
2391
2391
|
returns(e) {
|
|
@@ -2402,14 +2402,14 @@ class Ue extends Z {
|
|
|
2402
2402
|
}
|
|
2403
2403
|
static create(e, t, s) {
|
|
2404
2404
|
return new Ue({
|
|
2405
|
-
args: e ||
|
|
2406
|
-
returns: t ||
|
|
2405
|
+
args: e || ee.create([]).rest(Se.create()),
|
|
2406
|
+
returns: t || Se.create(),
|
|
2407
2407
|
typeName: w.ZodFunction,
|
|
2408
|
-
...
|
|
2408
|
+
...T(s)
|
|
2409
2409
|
});
|
|
2410
2410
|
}
|
|
2411
2411
|
}
|
|
2412
|
-
class dt extends
|
|
2412
|
+
class dt extends S {
|
|
2413
2413
|
get schema() {
|
|
2414
2414
|
return this._def.getter();
|
|
2415
2415
|
}
|
|
@@ -2421,9 +2421,9 @@ class dt extends Z {
|
|
|
2421
2421
|
dt.create = (n, e) => new dt({
|
|
2422
2422
|
getter: n,
|
|
2423
2423
|
typeName: w.ZodLazy,
|
|
2424
|
-
...
|
|
2424
|
+
...T(e)
|
|
2425
2425
|
});
|
|
2426
|
-
class ut extends
|
|
2426
|
+
class ut extends S {
|
|
2427
2427
|
_parse(e) {
|
|
2428
2428
|
if (e.data !== this._def.value) {
|
|
2429
2429
|
const t = this._getOrReturnCtx(e);
|
|
@@ -2442,16 +2442,16 @@ class ut extends Z {
|
|
|
2442
2442
|
ut.create = (n, e) => new ut({
|
|
2443
2443
|
value: n,
|
|
2444
2444
|
typeName: w.ZodLiteral,
|
|
2445
|
-
...
|
|
2445
|
+
...T(e)
|
|
2446
2446
|
});
|
|
2447
|
-
function
|
|
2448
|
-
return new
|
|
2447
|
+
function Tn(n, e) {
|
|
2448
|
+
return new _e({
|
|
2449
2449
|
values: n,
|
|
2450
2450
|
typeName: w.ZodEnum,
|
|
2451
|
-
...
|
|
2451
|
+
...T(e)
|
|
2452
2452
|
});
|
|
2453
2453
|
}
|
|
2454
|
-
class
|
|
2454
|
+
class _e extends S {
|
|
2455
2455
|
constructor() {
|
|
2456
2456
|
super(...arguments), Ye.set(this, void 0);
|
|
2457
2457
|
}
|
|
@@ -2464,7 +2464,7 @@ class ge extends Z {
|
|
|
2464
2464
|
code: p.invalid_type
|
|
2465
2465
|
}), x;
|
|
2466
2466
|
}
|
|
2467
|
-
if (
|
|
2467
|
+
if ($t(this, Ye) || wn(this, Ye, new Set(this._def.values)), !$t(this, Ye).has(e.data)) {
|
|
2468
2468
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
2469
2469
|
return f(t, {
|
|
2470
2470
|
received: t.data,
|
|
@@ -2496,21 +2496,21 @@ class ge extends Z {
|
|
|
2496
2496
|
return e;
|
|
2497
2497
|
}
|
|
2498
2498
|
extract(e, t = this._def) {
|
|
2499
|
-
return
|
|
2499
|
+
return _e.create(e, {
|
|
2500
2500
|
...this._def,
|
|
2501
2501
|
...t
|
|
2502
2502
|
});
|
|
2503
2503
|
}
|
|
2504
2504
|
exclude(e, t = this._def) {
|
|
2505
|
-
return
|
|
2505
|
+
return _e.create(this.options.filter((s) => !e.includes(s)), {
|
|
2506
2506
|
...this._def,
|
|
2507
2507
|
...t
|
|
2508
2508
|
});
|
|
2509
2509
|
}
|
|
2510
2510
|
}
|
|
2511
2511
|
Ye = /* @__PURE__ */ new WeakMap();
|
|
2512
|
-
|
|
2513
|
-
class lt extends
|
|
2512
|
+
_e.create = Tn;
|
|
2513
|
+
class lt extends S {
|
|
2514
2514
|
constructor() {
|
|
2515
2515
|
super(...arguments), Ge.set(this, void 0);
|
|
2516
2516
|
}
|
|
@@ -2524,7 +2524,7 @@ class lt extends Z {
|
|
|
2524
2524
|
code: p.invalid_type
|
|
2525
2525
|
}), x;
|
|
2526
2526
|
}
|
|
2527
|
-
if (
|
|
2527
|
+
if ($t(this, Ge) || wn(this, Ge, new Set(N.getValidEnumValues(this._def.values))), !$t(this, Ge).has(e.data)) {
|
|
2528
2528
|
const r = N.objectValues(t);
|
|
2529
2529
|
return f(s, {
|
|
2530
2530
|
received: s.data,
|
|
@@ -2542,9 +2542,9 @@ Ge = /* @__PURE__ */ new WeakMap();
|
|
|
2542
2542
|
lt.create = (n, e) => new lt({
|
|
2543
2543
|
values: n,
|
|
2544
2544
|
typeName: w.ZodNativeEnum,
|
|
2545
|
-
...
|
|
2545
|
+
...T(e)
|
|
2546
2546
|
});
|
|
2547
|
-
class We extends
|
|
2547
|
+
class We extends S {
|
|
2548
2548
|
unwrap() {
|
|
2549
2549
|
return this._def.type;
|
|
2550
2550
|
}
|
|
@@ -2566,9 +2566,9 @@ class We extends Z {
|
|
|
2566
2566
|
We.create = (n, e) => new We({
|
|
2567
2567
|
type: n,
|
|
2568
2568
|
typeName: w.ZodPromise,
|
|
2569
|
-
...
|
|
2569
|
+
...T(e)
|
|
2570
2570
|
});
|
|
2571
|
-
class q extends
|
|
2571
|
+
class q extends S {
|
|
2572
2572
|
innerType() {
|
|
2573
2573
|
return this._def.schema;
|
|
2574
2574
|
}
|
|
@@ -2595,7 +2595,7 @@ class q extends Z {
|
|
|
2595
2595
|
path: s.path,
|
|
2596
2596
|
parent: s
|
|
2597
2597
|
});
|
|
2598
|
-
return d.status === "aborted" ? x : d.status === "dirty" || t.value === "dirty" ?
|
|
2598
|
+
return d.status === "aborted" ? x : d.status === "dirty" || t.value === "dirty" ? Rt(d.value) : d;
|
|
2599
2599
|
});
|
|
2600
2600
|
{
|
|
2601
2601
|
if (t.value === "aborted")
|
|
@@ -2605,7 +2605,7 @@ class q extends Z {
|
|
|
2605
2605
|
path: s.path,
|
|
2606
2606
|
parent: s
|
|
2607
2607
|
});
|
|
2608
|
-
return c.status === "aborted" ? x : c.status === "dirty" || t.value === "dirty" ?
|
|
2608
|
+
return c.status === "aborted" ? x : c.status === "dirty" || t.value === "dirty" ? Rt(c.value) : c;
|
|
2609
2609
|
}
|
|
2610
2610
|
}
|
|
2611
2611
|
if (r.type === "refinement") {
|
|
@@ -2649,15 +2649,15 @@ q.create = (n, e, t) => new q({
|
|
|
2649
2649
|
schema: n,
|
|
2650
2650
|
typeName: w.ZodEffects,
|
|
2651
2651
|
effect: e,
|
|
2652
|
-
...
|
|
2652
|
+
...T(t)
|
|
2653
2653
|
});
|
|
2654
2654
|
q.createWithPreprocess = (n, e, t) => new q({
|
|
2655
2655
|
schema: e,
|
|
2656
2656
|
effect: { type: "preprocess", transform: n },
|
|
2657
2657
|
typeName: w.ZodEffects,
|
|
2658
|
-
...
|
|
2658
|
+
...T(t)
|
|
2659
2659
|
});
|
|
2660
|
-
class
|
|
2660
|
+
class Y extends S {
|
|
2661
2661
|
_parse(e) {
|
|
2662
2662
|
return this._getType(e) === _.undefined ? D(void 0) : this._def.innerType._parse(e);
|
|
2663
2663
|
}
|
|
@@ -2665,12 +2665,12 @@ class G extends Z {
|
|
|
2665
2665
|
return this._def.innerType;
|
|
2666
2666
|
}
|
|
2667
2667
|
}
|
|
2668
|
-
|
|
2668
|
+
Y.create = (n, e) => new Y({
|
|
2669
2669
|
innerType: n,
|
|
2670
2670
|
typeName: w.ZodOptional,
|
|
2671
|
-
...
|
|
2671
|
+
...T(e)
|
|
2672
2672
|
});
|
|
2673
|
-
class
|
|
2673
|
+
class ge extends S {
|
|
2674
2674
|
_parse(e) {
|
|
2675
2675
|
return this._getType(e) === _.null ? D(null) : this._def.innerType._parse(e);
|
|
2676
2676
|
}
|
|
@@ -2678,12 +2678,12 @@ class ye extends Z {
|
|
|
2678
2678
|
return this._def.innerType;
|
|
2679
2679
|
}
|
|
2680
2680
|
}
|
|
2681
|
-
|
|
2681
|
+
ge.create = (n, e) => new ge({
|
|
2682
2682
|
innerType: n,
|
|
2683
2683
|
typeName: w.ZodNullable,
|
|
2684
|
-
...
|
|
2684
|
+
...T(e)
|
|
2685
2685
|
});
|
|
2686
|
-
class pt extends
|
|
2686
|
+
class pt extends S {
|
|
2687
2687
|
_parse(e) {
|
|
2688
2688
|
const { ctx: t } = this._processInputParams(e);
|
|
2689
2689
|
let s = t.data;
|
|
@@ -2701,9 +2701,9 @@ pt.create = (n, e) => new pt({
|
|
|
2701
2701
|
innerType: n,
|
|
2702
2702
|
typeName: w.ZodDefault,
|
|
2703
2703
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2704
|
-
...
|
|
2704
|
+
...T(e)
|
|
2705
2705
|
});
|
|
2706
|
-
class ht extends
|
|
2706
|
+
class ht extends S {
|
|
2707
2707
|
_parse(e) {
|
|
2708
2708
|
const { ctx: t } = this._processInputParams(e), s = {
|
|
2709
2709
|
...t,
|
|
@@ -2722,7 +2722,7 @@ class ht extends Z {
|
|
|
2722
2722
|
status: "valid",
|
|
2723
2723
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2724
2724
|
get error() {
|
|
2725
|
-
return new
|
|
2725
|
+
return new L(s.common.issues);
|
|
2726
2726
|
},
|
|
2727
2727
|
input: s.data
|
|
2728
2728
|
})
|
|
@@ -2730,7 +2730,7 @@ class ht extends Z {
|
|
|
2730
2730
|
status: "valid",
|
|
2731
2731
|
value: r.status === "valid" ? r.value : this._def.catchValue({
|
|
2732
2732
|
get error() {
|
|
2733
|
-
return new
|
|
2733
|
+
return new L(s.common.issues);
|
|
2734
2734
|
},
|
|
2735
2735
|
input: s.data
|
|
2736
2736
|
})
|
|
@@ -2744,9 +2744,9 @@ ht.create = (n, e) => new ht({
|
|
|
2744
2744
|
innerType: n,
|
|
2745
2745
|
typeName: w.ZodCatch,
|
|
2746
2746
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2747
|
-
...
|
|
2747
|
+
...T(e)
|
|
2748
2748
|
});
|
|
2749
|
-
class
|
|
2749
|
+
class Lt extends S {
|
|
2750
2750
|
_parse(e) {
|
|
2751
2751
|
if (this._getType(e) !== _.nan) {
|
|
2752
2752
|
const t = this._getOrReturnCtx(e);
|
|
@@ -2759,12 +2759,12 @@ class Vt extends Z {
|
|
|
2759
2759
|
return { status: "valid", value: e.data };
|
|
2760
2760
|
}
|
|
2761
2761
|
}
|
|
2762
|
-
|
|
2762
|
+
Lt.create = (n) => new Lt({
|
|
2763
2763
|
typeName: w.ZodNaN,
|
|
2764
|
-
...
|
|
2764
|
+
...T(n)
|
|
2765
2765
|
});
|
|
2766
|
-
const
|
|
2767
|
-
class
|
|
2766
|
+
const gs = Symbol("zod_brand");
|
|
2767
|
+
class cn extends S {
|
|
2768
2768
|
_parse(e) {
|
|
2769
2769
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
2770
2770
|
return this._def.type._parse({
|
|
@@ -2777,7 +2777,7 @@ class dn extends Z {
|
|
|
2777
2777
|
return this._def.type;
|
|
2778
2778
|
}
|
|
2779
2779
|
}
|
|
2780
|
-
class Nt extends
|
|
2780
|
+
class Nt extends S {
|
|
2781
2781
|
_parse(e) {
|
|
2782
2782
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2783
2783
|
if (s.common.async)
|
|
@@ -2787,7 +2787,7 @@ class Nt extends Z {
|
|
|
2787
2787
|
path: s.path,
|
|
2788
2788
|
parent: s
|
|
2789
2789
|
});
|
|
2790
|
-
return r.status === "aborted" ? x : r.status === "dirty" ? (t.dirty(),
|
|
2790
|
+
return r.status === "aborted" ? x : r.status === "dirty" ? (t.dirty(), Rt(r.value)) : this._def.out._parseAsync({
|
|
2791
2791
|
data: r.value,
|
|
2792
2792
|
path: s.path,
|
|
2793
2793
|
parent: s
|
|
@@ -2817,7 +2817,7 @@ class Nt extends Z {
|
|
|
2817
2817
|
});
|
|
2818
2818
|
}
|
|
2819
2819
|
}
|
|
2820
|
-
class ft extends
|
|
2820
|
+
class ft extends S {
|
|
2821
2821
|
_parse(e) {
|
|
2822
2822
|
const t = this._def.innerType._parse(e), s = (r) => (tt(r) && (r.value = Object.freeze(r.value)), r);
|
|
2823
2823
|
return nt(t) ? t.then((r) => s(r)) : s(t);
|
|
@@ -2829,9 +2829,9 @@ class ft extends Z {
|
|
|
2829
2829
|
ft.create = (n, e) => new ft({
|
|
2830
2830
|
innerType: n,
|
|
2831
2831
|
typeName: w.ZodReadonly,
|
|
2832
|
-
...
|
|
2832
|
+
...T(e)
|
|
2833
2833
|
});
|
|
2834
|
-
function
|
|
2834
|
+
function On(n, e = {}, t) {
|
|
2835
2835
|
return n ? Be.create().superRefine((s, r) => {
|
|
2836
2836
|
var a, o;
|
|
2837
2837
|
if (!n(s)) {
|
|
@@ -2840,151 +2840,151 @@ function Sn(n, e = {}, t) {
|
|
|
2840
2840
|
}
|
|
2841
2841
|
}) : Be.create();
|
|
2842
2842
|
}
|
|
2843
|
-
const
|
|
2844
|
-
object:
|
|
2843
|
+
const ys = {
|
|
2844
|
+
object: I.lazycreate
|
|
2845
2845
|
};
|
|
2846
2846
|
var w;
|
|
2847
2847
|
(function(n) {
|
|
2848
2848
|
n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
|
|
2849
2849
|
})(w || (w = {}));
|
|
2850
|
-
const
|
|
2850
|
+
const vs = (n, e = {
|
|
2851
2851
|
message: `Input not instance of ${n.name}`
|
|
2852
|
-
}) =>
|
|
2852
|
+
}) => On((t) => t instanceof n, e), Sn = F.create, Zn = fe.create, ws = Lt.create, ks = me.create, jn = st.create, bs = je.create, xs = Pt.create, Ts = rt.create, Os = at.create, Ss = Be.create, Zs = Se.create, js = re.create, Ns = Dt.create, Cs = B.create, Is = I.create, Es = I.strictCreate, As = it.create, Rs = Jt.create, $s = ot.create, Ps = ee.create, Ds = ct.create, Ms = Mt.create, Ls = Ne.create, Vs = Ue.create, Us = dt.create, Fs = ut.create, zs = _e.create, Bs = lt.create, Ws = We.create, fn = q.create, qs = Y.create, Js = ge.create, Ks = q.createWithPreprocess, Qs = Nt.create, Hs = () => Sn().optional(), Ys = () => Zn().optional(), Gs = () => jn().optional(), Xs = {
|
|
2853
2853
|
string: (n) => F.create({ ...n, coerce: !0 }),
|
|
2854
|
-
number: (n) =>
|
|
2854
|
+
number: (n) => fe.create({ ...n, coerce: !0 }),
|
|
2855
2855
|
boolean: (n) => st.create({
|
|
2856
2856
|
...n,
|
|
2857
2857
|
coerce: !0
|
|
2858
2858
|
}),
|
|
2859
|
-
bigint: (n) =>
|
|
2860
|
-
date: (n) =>
|
|
2861
|
-
},
|
|
2859
|
+
bigint: (n) => me.create({ ...n, coerce: !0 }),
|
|
2860
|
+
date: (n) => je.create({ ...n, coerce: !0 })
|
|
2861
|
+
}, er = x;
|
|
2862
2862
|
var i = /* @__PURE__ */ Object.freeze({
|
|
2863
2863
|
__proto__: null,
|
|
2864
2864
|
defaultErrorMap: ze,
|
|
2865
|
-
setErrorMap:
|
|
2866
|
-
getErrorMap:
|
|
2867
|
-
makeIssue:
|
|
2868
|
-
EMPTY_PATH:
|
|
2865
|
+
setErrorMap: es,
|
|
2866
|
+
getErrorMap: Et,
|
|
2867
|
+
makeIssue: At,
|
|
2868
|
+
EMPTY_PATH: ts,
|
|
2869
2869
|
addIssueToContext: f,
|
|
2870
2870
|
ParseStatus: $,
|
|
2871
2871
|
INVALID: x,
|
|
2872
|
-
DIRTY:
|
|
2872
|
+
DIRTY: Rt,
|
|
2873
2873
|
OK: D,
|
|
2874
|
-
isAborted:
|
|
2875
|
-
isDirty:
|
|
2874
|
+
isAborted: en,
|
|
2875
|
+
isDirty: tn,
|
|
2876
2876
|
isValid: tt,
|
|
2877
2877
|
isAsync: nt,
|
|
2878
2878
|
get util() {
|
|
2879
2879
|
return N;
|
|
2880
2880
|
},
|
|
2881
2881
|
get objectUtil() {
|
|
2882
|
-
return
|
|
2882
|
+
return Xt;
|
|
2883
2883
|
},
|
|
2884
2884
|
ZodParsedType: _,
|
|
2885
|
-
getParsedType:
|
|
2886
|
-
ZodType:
|
|
2887
|
-
datetimeRegex:
|
|
2885
|
+
getParsedType: pe,
|
|
2886
|
+
ZodType: S,
|
|
2887
|
+
datetimeRegex: xn,
|
|
2888
2888
|
ZodString: F,
|
|
2889
|
-
ZodNumber:
|
|
2890
|
-
ZodBigInt:
|
|
2889
|
+
ZodNumber: fe,
|
|
2890
|
+
ZodBigInt: me,
|
|
2891
2891
|
ZodBoolean: st,
|
|
2892
|
-
ZodDate:
|
|
2893
|
-
ZodSymbol:
|
|
2892
|
+
ZodDate: je,
|
|
2893
|
+
ZodSymbol: Pt,
|
|
2894
2894
|
ZodUndefined: rt,
|
|
2895
2895
|
ZodNull: at,
|
|
2896
2896
|
ZodAny: Be,
|
|
2897
|
-
ZodUnknown:
|
|
2898
|
-
ZodNever:
|
|
2899
|
-
ZodVoid:
|
|
2897
|
+
ZodUnknown: Se,
|
|
2898
|
+
ZodNever: re,
|
|
2899
|
+
ZodVoid: Dt,
|
|
2900
2900
|
ZodArray: B,
|
|
2901
|
-
ZodObject:
|
|
2901
|
+
ZodObject: I,
|
|
2902
2902
|
ZodUnion: it,
|
|
2903
|
-
ZodDiscriminatedUnion:
|
|
2903
|
+
ZodDiscriminatedUnion: Jt,
|
|
2904
2904
|
ZodIntersection: ot,
|
|
2905
|
-
ZodTuple:
|
|
2905
|
+
ZodTuple: ee,
|
|
2906
2906
|
ZodRecord: ct,
|
|
2907
|
-
ZodMap:
|
|
2908
|
-
ZodSet:
|
|
2907
|
+
ZodMap: Mt,
|
|
2908
|
+
ZodSet: Ne,
|
|
2909
2909
|
ZodFunction: Ue,
|
|
2910
2910
|
ZodLazy: dt,
|
|
2911
2911
|
ZodLiteral: ut,
|
|
2912
|
-
ZodEnum:
|
|
2912
|
+
ZodEnum: _e,
|
|
2913
2913
|
ZodNativeEnum: lt,
|
|
2914
2914
|
ZodPromise: We,
|
|
2915
2915
|
ZodEffects: q,
|
|
2916
2916
|
ZodTransformer: q,
|
|
2917
|
-
ZodOptional:
|
|
2918
|
-
ZodNullable:
|
|
2917
|
+
ZodOptional: Y,
|
|
2918
|
+
ZodNullable: ge,
|
|
2919
2919
|
ZodDefault: pt,
|
|
2920
2920
|
ZodCatch: ht,
|
|
2921
|
-
ZodNaN:
|
|
2922
|
-
BRAND:
|
|
2923
|
-
ZodBranded:
|
|
2921
|
+
ZodNaN: Lt,
|
|
2922
|
+
BRAND: gs,
|
|
2923
|
+
ZodBranded: cn,
|
|
2924
2924
|
ZodPipeline: Nt,
|
|
2925
2925
|
ZodReadonly: ft,
|
|
2926
|
-
custom:
|
|
2927
|
-
Schema:
|
|
2928
|
-
ZodSchema:
|
|
2929
|
-
late:
|
|
2926
|
+
custom: On,
|
|
2927
|
+
Schema: S,
|
|
2928
|
+
ZodSchema: S,
|
|
2929
|
+
late: ys,
|
|
2930
2930
|
get ZodFirstPartyTypeKind() {
|
|
2931
2931
|
return w;
|
|
2932
2932
|
},
|
|
2933
|
-
coerce:
|
|
2934
|
-
any:
|
|
2933
|
+
coerce: Xs,
|
|
2934
|
+
any: Ss,
|
|
2935
2935
|
array: Cs,
|
|
2936
|
-
bigint:
|
|
2937
|
-
boolean:
|
|
2938
|
-
date:
|
|
2939
|
-
discriminatedUnion:
|
|
2940
|
-
effect:
|
|
2941
|
-
enum:
|
|
2942
|
-
function:
|
|
2943
|
-
instanceof:
|
|
2944
|
-
intersection:
|
|
2945
|
-
lazy:
|
|
2946
|
-
literal:
|
|
2947
|
-
map:
|
|
2948
|
-
nan:
|
|
2949
|
-
nativeEnum:
|
|
2950
|
-
never:
|
|
2951
|
-
null:
|
|
2952
|
-
nullable:
|
|
2953
|
-
number:
|
|
2954
|
-
object:
|
|
2955
|
-
oboolean:
|
|
2956
|
-
onumber:
|
|
2957
|
-
optional:
|
|
2958
|
-
ostring:
|
|
2959
|
-
pipeline:
|
|
2960
|
-
preprocess:
|
|
2961
|
-
promise:
|
|
2962
|
-
record:
|
|
2963
|
-
set:
|
|
2964
|
-
strictObject:
|
|
2965
|
-
string:
|
|
2966
|
-
symbol:
|
|
2967
|
-
transformer:
|
|
2968
|
-
tuple:
|
|
2969
|
-
undefined:
|
|
2970
|
-
union:
|
|
2971
|
-
unknown:
|
|
2972
|
-
void:
|
|
2973
|
-
NEVER:
|
|
2936
|
+
bigint: ks,
|
|
2937
|
+
boolean: jn,
|
|
2938
|
+
date: bs,
|
|
2939
|
+
discriminatedUnion: Rs,
|
|
2940
|
+
effect: fn,
|
|
2941
|
+
enum: zs,
|
|
2942
|
+
function: Vs,
|
|
2943
|
+
instanceof: vs,
|
|
2944
|
+
intersection: $s,
|
|
2945
|
+
lazy: Us,
|
|
2946
|
+
literal: Fs,
|
|
2947
|
+
map: Ms,
|
|
2948
|
+
nan: ws,
|
|
2949
|
+
nativeEnum: Bs,
|
|
2950
|
+
never: js,
|
|
2951
|
+
null: Os,
|
|
2952
|
+
nullable: Js,
|
|
2953
|
+
number: Zn,
|
|
2954
|
+
object: Is,
|
|
2955
|
+
oboolean: Gs,
|
|
2956
|
+
onumber: Ys,
|
|
2957
|
+
optional: qs,
|
|
2958
|
+
ostring: Hs,
|
|
2959
|
+
pipeline: Qs,
|
|
2960
|
+
preprocess: Ks,
|
|
2961
|
+
promise: Ws,
|
|
2962
|
+
record: Ds,
|
|
2963
|
+
set: Ls,
|
|
2964
|
+
strictObject: Es,
|
|
2965
|
+
string: Sn,
|
|
2966
|
+
symbol: xs,
|
|
2967
|
+
transformer: fn,
|
|
2968
|
+
tuple: Ps,
|
|
2969
|
+
undefined: Ts,
|
|
2970
|
+
union: As,
|
|
2971
|
+
unknown: Zs,
|
|
2972
|
+
void: Ns,
|
|
2973
|
+
NEVER: er,
|
|
2974
2974
|
ZodIssueCode: p,
|
|
2975
|
-
quotelessJson:
|
|
2976
|
-
ZodError:
|
|
2975
|
+
quotelessJson: Xn,
|
|
2976
|
+
ZodError: L
|
|
2977
2977
|
});
|
|
2978
|
-
|
|
2978
|
+
Gn(i);
|
|
2979
2979
|
i.object({
|
|
2980
2980
|
start: i.number(),
|
|
2981
2981
|
limit: i.number(),
|
|
2982
2982
|
length: i.number()
|
|
2983
2983
|
});
|
|
2984
|
-
const
|
|
2984
|
+
const dn = i.object({
|
|
2985
2985
|
created_at: i.string(),
|
|
2986
2986
|
updated_at: i.string()
|
|
2987
|
-
}),
|
|
2987
|
+
}), tr = i.object({
|
|
2988
2988
|
email: i.string().optional(),
|
|
2989
2989
|
email_verified: i.boolean().optional(),
|
|
2990
2990
|
name: i.string().optional(),
|
|
@@ -2993,7 +2993,7 @@ const un = i.object({
|
|
|
2993
2993
|
phone_number: i.string().optional(),
|
|
2994
2994
|
phone_verified: i.boolean().optional(),
|
|
2995
2995
|
family_name: i.string().optional()
|
|
2996
|
-
}).catchall(i.any()),
|
|
2996
|
+
}).catchall(i.any()), nr = i.object({
|
|
2997
2997
|
connection: i.string(),
|
|
2998
2998
|
user_id: i.string(),
|
|
2999
2999
|
provider: i.string(),
|
|
@@ -3001,8 +3001,8 @@ const un = i.object({
|
|
|
3001
3001
|
access_token: i.string().optional(),
|
|
3002
3002
|
access_token_secret: i.string().optional(),
|
|
3003
3003
|
refresh_token: i.string().optional(),
|
|
3004
|
-
profileData:
|
|
3005
|
-
}),
|
|
3004
|
+
profileData: tr.optional()
|
|
3005
|
+
}), Nn = i.object({
|
|
3006
3006
|
email: i.string().optional(),
|
|
3007
3007
|
username: i.string().optional(),
|
|
3008
3008
|
given_name: i.string().optional(),
|
|
@@ -3014,7 +3014,7 @@ const un = i.object({
|
|
|
3014
3014
|
linked_to: i.string().optional(),
|
|
3015
3015
|
profileData: i.string().optional(),
|
|
3016
3016
|
user_id: i.string().optional()
|
|
3017
|
-
}),
|
|
3017
|
+
}), sr = Nn.extend({
|
|
3018
3018
|
email_verified: i.boolean().default(!1),
|
|
3019
3019
|
verify_email: i.boolean().optional(),
|
|
3020
3020
|
last_ip: i.string().optional(),
|
|
@@ -3023,15 +3023,15 @@ const un = i.object({
|
|
|
3023
3023
|
provider: i.string().default("email"),
|
|
3024
3024
|
connection: i.string().default("email")
|
|
3025
3025
|
});
|
|
3026
|
-
|
|
3026
|
+
sr.extend(dn.shape).extend({
|
|
3027
3027
|
user_id: i.string(),
|
|
3028
3028
|
// TODO: this not might be correct if you use the username
|
|
3029
3029
|
email: i.string(),
|
|
3030
3030
|
is_social: i.boolean(),
|
|
3031
3031
|
login_count: i.number(),
|
|
3032
|
-
identities: i.array(
|
|
3032
|
+
identities: i.array(nr).optional()
|
|
3033
3033
|
});
|
|
3034
|
-
|
|
3034
|
+
Nn.extend({
|
|
3035
3035
|
email: i.string(),
|
|
3036
3036
|
login_count: i.number(),
|
|
3037
3037
|
multifactor: i.array(i.string()).optional(),
|
|
@@ -3039,7 +3039,7 @@ In.extend({
|
|
|
3039
3039
|
last_login: i.string().optional(),
|
|
3040
3040
|
user_id: i.string()
|
|
3041
3041
|
}).catchall(i.any());
|
|
3042
|
-
const
|
|
3042
|
+
const rr = i.object({
|
|
3043
3043
|
audience: i.string().optional(),
|
|
3044
3044
|
recipient: i.string().optional(),
|
|
3045
3045
|
createUpnClaim: i.boolean().optional(),
|
|
@@ -3056,7 +3056,7 @@ const ar = i.object({
|
|
|
3056
3056
|
nameIdentifierProbes: i.array(i.string()).optional(),
|
|
3057
3057
|
authnContextClassRef: i.string().optional(),
|
|
3058
3058
|
mappings: i.record(i.string()).optional()
|
|
3059
|
-
}),
|
|
3059
|
+
}), ar = i.object({
|
|
3060
3060
|
id: i.string(),
|
|
3061
3061
|
name: i.string(),
|
|
3062
3062
|
callbacks: i.array(i.string()).openapi({
|
|
@@ -3072,7 +3072,7 @@ const ar = i.object({
|
|
|
3072
3072
|
description: "Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains."
|
|
3073
3073
|
}),
|
|
3074
3074
|
addons: i.object({
|
|
3075
|
-
samlp:
|
|
3075
|
+
samlp: rr.optional()
|
|
3076
3076
|
}).optional().openapi({
|
|
3077
3077
|
description: "Addons associated with the client. The key is the addon's package name and the value is an object with the configuration for the addon."
|
|
3078
3078
|
}),
|
|
@@ -3083,23 +3083,23 @@ const ar = i.object({
|
|
|
3083
3083
|
disable_sign_ups: i.boolean().default(!1).openapi({
|
|
3084
3084
|
description: "Prevents users from signing up using the hosted login page. This is not available in auth0"
|
|
3085
3085
|
})
|
|
3086
|
-
}),
|
|
3086
|
+
}), ir = i.object({
|
|
3087
3087
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3088
3088
|
updated_at: i.string().transform((n) => n === null ? "" : n),
|
|
3089
|
-
...
|
|
3089
|
+
...ar.shape
|
|
3090
3090
|
});
|
|
3091
|
-
var Cn = /* @__PURE__ */ ((n) => (n.TOKEN = "token", n.TOKEN_ID_TOKEN = "token id_token", n.CODE = "code", n))(Cn || {}),
|
|
3092
|
-
const
|
|
3091
|
+
var Cn = /* @__PURE__ */ ((n) => (n.TOKEN = "token", n.TOKEN_ID_TOKEN = "token id_token", n.CODE = "code", n))(Cn || {}), In = /* @__PURE__ */ ((n) => (n.QUERY = "query", n.FRAGMENT = "fragment", n.FORM_POST = "form_post", n.WEB_MESSAGE = "web_message", n.SAML_POST = "saml_post", n))(In || {}), En = /* @__PURE__ */ ((n) => (n.S265 = "S256", n.plain = "plain", n))(En || {});
|
|
3092
|
+
const or = i.object({
|
|
3093
3093
|
client_id: i.string(),
|
|
3094
3094
|
vendor_id: i.string().optional(),
|
|
3095
3095
|
response_type: i.nativeEnum(Cn).optional(),
|
|
3096
|
-
response_mode: i.nativeEnum(
|
|
3096
|
+
response_mode: i.nativeEnum(In).optional(),
|
|
3097
3097
|
redirect_uri: i.string().optional(),
|
|
3098
3098
|
audience: i.string().optional(),
|
|
3099
3099
|
state: i.string().optional(),
|
|
3100
3100
|
nonce: i.string().optional(),
|
|
3101
3101
|
scope: i.string().optional(),
|
|
3102
|
-
code_challenge_method: i.nativeEnum(
|
|
3102
|
+
code_challenge_method: i.nativeEnum(En).optional(),
|
|
3103
3103
|
code_challenge: i.string().optional(),
|
|
3104
3104
|
username: i.string().optional()
|
|
3105
3105
|
});
|
|
@@ -3134,7 +3134,7 @@ const cr = i.object({
|
|
|
3134
3134
|
token_exchange_basic_auth: i.boolean().optional(),
|
|
3135
3135
|
userinfo_endpoint: i.string().optional(),
|
|
3136
3136
|
scope: i.string().optional()
|
|
3137
|
-
}),
|
|
3137
|
+
}), An = i.object({
|
|
3138
3138
|
id: i.string(),
|
|
3139
3139
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3140
3140
|
updated_at: i.string().transform((n) => n === null ? "" : n)
|
|
@@ -3180,10 +3180,10 @@ const lr = i.object({
|
|
|
3180
3180
|
email_service: i.union([i.literal("mailgun"), i.literal("mailchannels")]).optional()
|
|
3181
3181
|
});
|
|
3182
3182
|
i.object({
|
|
3183
|
-
...
|
|
3183
|
+
...ir.shape,
|
|
3184
3184
|
domains: i.array(lr),
|
|
3185
3185
|
tenant: ur,
|
|
3186
|
-
connections: i.array(
|
|
3186
|
+
connections: i.array(An)
|
|
3187
3187
|
});
|
|
3188
3188
|
const pr = i.enum([
|
|
3189
3189
|
"password_reset",
|
|
@@ -3216,7 +3216,7 @@ const pr = i.enum([
|
|
|
3216
3216
|
email_api_key: i.string().optional(),
|
|
3217
3217
|
email_service: i.enum(["mailgun", "mailchannels"])
|
|
3218
3218
|
});
|
|
3219
|
-
|
|
3219
|
+
dn.extend({
|
|
3220
3220
|
...mr.shape,
|
|
3221
3221
|
id: i.string()
|
|
3222
3222
|
});
|
|
@@ -3233,7 +3233,7 @@ const _r = i.object({
|
|
|
3233
3233
|
priority: i.number().optional()
|
|
3234
3234
|
});
|
|
3235
3235
|
_r.extend({
|
|
3236
|
-
...
|
|
3236
|
+
...dn.shape,
|
|
3237
3237
|
hook_id: i.string()
|
|
3238
3238
|
});
|
|
3239
3239
|
const gr = i.object({
|
|
@@ -3271,7 +3271,7 @@ i.object({
|
|
|
3271
3271
|
});
|
|
3272
3272
|
const yr = i.object({
|
|
3273
3273
|
auth0Client: i.string().optional(),
|
|
3274
|
-
authParams:
|
|
3274
|
+
authParams: or,
|
|
3275
3275
|
expires_at: i.string(),
|
|
3276
3276
|
deleted_at: i.string().optional(),
|
|
3277
3277
|
ip: i.string().optional()
|
|
@@ -3387,10 +3387,10 @@ i.object({
|
|
|
3387
3387
|
...xr.shape
|
|
3388
3388
|
});
|
|
3389
3389
|
i.object({
|
|
3390
|
-
private_key: i.string(),
|
|
3391
|
-
public_key: i.string(),
|
|
3390
|
+
private_key: i.string().optional(),
|
|
3391
|
+
public_key: i.string().optional(),
|
|
3392
3392
|
kid: i.string(),
|
|
3393
|
-
created_at: i.string(),
|
|
3393
|
+
created_at: i.string().optional(),
|
|
3394
3394
|
revoked_at: i.string().optional()
|
|
3395
3395
|
});
|
|
3396
3396
|
i.object({
|
|
@@ -3413,10 +3413,10 @@ i.object({
|
|
|
3413
3413
|
revoked: i.boolean().optional().openapi({ description: "True if the key is revoked" }),
|
|
3414
3414
|
revoked_at: i.string().optional().openapi({ description: "The date and time when the key was revoked" })
|
|
3415
3415
|
});
|
|
3416
|
-
var
|
|
3417
|
-
const
|
|
3416
|
+
var Rn = /* @__PURE__ */ ((n) => (n.RefreshToken = "refresh_token", n.AuthorizationCode = "authorization_code", n.ClientCredential = "client_credentials", n.Passwordless = "passwordless", n.Password = "password", n))(Rn || {});
|
|
3417
|
+
const un = i.nativeEnum(Rn);
|
|
3418
3418
|
i.object({
|
|
3419
|
-
grant_type:
|
|
3419
|
+
grant_type: un.refine(
|
|
3420
3420
|
(n) => n === "authorization_code"
|
|
3421
3421
|
/* AuthorizationCode */
|
|
3422
3422
|
),
|
|
@@ -3425,7 +3425,7 @@ i.object({
|
|
|
3425
3425
|
client_id: i.string()
|
|
3426
3426
|
});
|
|
3427
3427
|
i.object({
|
|
3428
|
-
grant_type:
|
|
3428
|
+
grant_type: un.refine(
|
|
3429
3429
|
(n) => n === "authorization_code"
|
|
3430
3430
|
/* AuthorizationCode */
|
|
3431
3431
|
),
|
|
@@ -3435,7 +3435,7 @@ i.object({
|
|
|
3435
3435
|
redirect_uri: i.string()
|
|
3436
3436
|
});
|
|
3437
3437
|
i.object({
|
|
3438
|
-
grant_type:
|
|
3438
|
+
grant_type: un.refine(
|
|
3439
3439
|
(n) => n === "client_credentials"
|
|
3440
3440
|
/* ClientCredential */
|
|
3441
3441
|
),
|
|
@@ -3521,51 +3521,13 @@ const Tr = i.object({
|
|
|
3521
3521
|
Nr.extend({
|
|
3522
3522
|
themeId: i.string()
|
|
3523
3523
|
});
|
|
3524
|
-
|
|
3525
|
-
id: i.string(),
|
|
3526
|
-
expires_at: i.string(),
|
|
3527
|
-
auth0Client: i.string().optional(),
|
|
3528
|
-
authParams: Qt
|
|
3529
|
-
});
|
|
3530
|
-
i.object({
|
|
3531
|
-
...Ir.shape,
|
|
3532
|
-
created_at: i.string(),
|
|
3533
|
-
updated_at: i.string()
|
|
3534
|
-
});
|
|
3535
|
-
const Cr = i.object({
|
|
3536
|
-
id: i.string(),
|
|
3537
|
-
email: i.string(),
|
|
3538
|
-
code: i.string(),
|
|
3539
|
-
ip: i.string().optional(),
|
|
3540
|
-
send: i.enum(["code", "link"]),
|
|
3541
|
-
authParams: Qt,
|
|
3542
|
-
expires_at: i.string(),
|
|
3543
|
-
used_at: i.string().optional(),
|
|
3544
|
-
user_id: i.string().optional()
|
|
3545
|
-
});
|
|
3546
|
-
i.object({
|
|
3547
|
-
created_at: i.string(),
|
|
3548
|
-
...Cr.shape
|
|
3549
|
-
});
|
|
3550
|
-
const Er = i.object({
|
|
3551
|
-
authParams: Qt,
|
|
3552
|
-
code: i.string(),
|
|
3553
|
-
user_id: i.string(),
|
|
3554
|
-
created_at: i.string(),
|
|
3555
|
-
expires_at: i.string(),
|
|
3556
|
-
used_at: i.string().optional()
|
|
3557
|
-
});
|
|
3558
|
-
i.object({
|
|
3559
|
-
...Er.shape,
|
|
3560
|
-
created_at: i.string()
|
|
3561
|
-
});
|
|
3562
|
-
function pn(n) {
|
|
3524
|
+
function ln(n) {
|
|
3563
3525
|
const [e, t] = n.split("|");
|
|
3564
3526
|
if (!e || !t)
|
|
3565
3527
|
throw new Error(`Invalid user_id: ${n}`);
|
|
3566
3528
|
return { connection: e, id: t };
|
|
3567
3529
|
}
|
|
3568
|
-
function
|
|
3530
|
+
function $n(n) {
|
|
3569
3531
|
let e = {};
|
|
3570
3532
|
try {
|
|
3571
3533
|
e = JSON.parse(n.profileData || "{}");
|
|
@@ -3575,7 +3537,7 @@ function Pn(n) {
|
|
|
3575
3537
|
return {
|
|
3576
3538
|
connection: n.connection,
|
|
3577
3539
|
provider: n.provider,
|
|
3578
|
-
user_id:
|
|
3540
|
+
user_id: ln(n.user_id).id,
|
|
3579
3541
|
isSocial: !!n.is_social,
|
|
3580
3542
|
profileData: {
|
|
3581
3543
|
email: n.email,
|
|
@@ -3584,7 +3546,7 @@ function Pn(n) {
|
|
|
3584
3546
|
}
|
|
3585
3547
|
};
|
|
3586
3548
|
}
|
|
3587
|
-
function
|
|
3549
|
+
function Cr(n) {
|
|
3588
3550
|
return async (e, t) => {
|
|
3589
3551
|
const [s, r] = await Promise.all([
|
|
3590
3552
|
n.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", t).selectAll().executeTakeFirst(),
|
|
@@ -3601,16 +3563,16 @@ function Ar(n) {
|
|
|
3601
3563
|
{
|
|
3602
3564
|
connection: s.connection,
|
|
3603
3565
|
provider: s.provider,
|
|
3604
|
-
user_id:
|
|
3566
|
+
user_id: ln(s.user_id).id,
|
|
3605
3567
|
isSocial: !!s.is_social
|
|
3606
3568
|
},
|
|
3607
|
-
...r.map(
|
|
3569
|
+
...r.map($n)
|
|
3608
3570
|
]
|
|
3609
3571
|
};
|
|
3610
3572
|
return R(c);
|
|
3611
3573
|
};
|
|
3612
3574
|
}
|
|
3613
|
-
function
|
|
3575
|
+
function Ee(n, e, t, s) {
|
|
3614
3576
|
return t.split(/\s+/).map((a) => a.replace(/^([^:]+)=/g, "$1:")).map((a) => {
|
|
3615
3577
|
let o = a.startsWith("-"), c, d, u, l;
|
|
3616
3578
|
return a.startsWith("-_exists_:") ? (c = a.substring(10), u = !0, o = !0) : a.startsWith("_exists_:") ? (c = a.substring(9), u = !0, o = !1) : a.includes(":") ? (o = a.startsWith("-"), [c, d] = o ? a.substring(1).split(":") : a.split(":"), u = !1, d.startsWith(">=") ? (l = ">=", d = d.substring(2)) : d.startsWith(">") ? (l = ">", d = d.substring(1)) : d.startsWith("<=") ? (console.log("value", d), l = "<=", d = d.substring(2)) : d.startsWith("<") ? (l = "<", d = d.substring(1)) : l = "=") : (c = null, d = a, u = !1), { key: c, value: d, isNegation: o, isExistsQuery: u, operator: l };
|
|
@@ -3640,26 +3602,26 @@ function Ae(n, e, t, s) {
|
|
|
3640
3602
|
else {
|
|
3641
3603
|
const { ref: l } = n.dynamic;
|
|
3642
3604
|
e = e.where(
|
|
3643
|
-
(
|
|
3644
|
-
s.map((
|
|
3605
|
+
(j) => j.or(
|
|
3606
|
+
s.map((A) => j(l(A), "like", `%${o}%`))
|
|
3645
3607
|
)
|
|
3646
3608
|
);
|
|
3647
3609
|
}
|
|
3648
3610
|
}), e;
|
|
3649
3611
|
}
|
|
3650
|
-
function
|
|
3612
|
+
function be(n) {
|
|
3651
3613
|
return typeof n == "string" ? parseInt(n, 10) : typeof n == "bigint" ? Number(n) : n;
|
|
3652
3614
|
}
|
|
3653
|
-
function
|
|
3615
|
+
function Ir(n) {
|
|
3654
3616
|
return async (e, t) => {
|
|
3655
3617
|
let s = n.selectFrom("users").where("users.tenant_id", "=", e);
|
|
3656
|
-
if (t.q && (s =
|
|
3618
|
+
if (t.q && (s = Ee(n, s, t.q, ["email", "name"])), t.sort && t.sort.sort_by) {
|
|
3657
3619
|
const { ref: l } = n.dynamic;
|
|
3658
3620
|
s = s.orderBy(l(t.sort.sort_by), t.sort.sort_order);
|
|
3659
3621
|
}
|
|
3660
3622
|
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), o = a.map((l) => l.user_id), c = o.length ? await n.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", o).execute() : [], d = a.map((l) => {
|
|
3661
|
-
const
|
|
3662
|
-
(
|
|
3623
|
+
const j = c.filter(
|
|
3624
|
+
(A) => A.linked_to === l.user_id
|
|
3663
3625
|
);
|
|
3664
3626
|
return R({
|
|
3665
3627
|
...l,
|
|
@@ -3669,10 +3631,10 @@ function Rr(n) {
|
|
|
3669
3631
|
{
|
|
3670
3632
|
connection: l.connection,
|
|
3671
3633
|
provider: l.provider,
|
|
3672
|
-
user_id:
|
|
3634
|
+
user_id: ln(l.user_id).id,
|
|
3673
3635
|
isSocial: !!l.is_social
|
|
3674
3636
|
},
|
|
3675
|
-
...
|
|
3637
|
+
...j.map($n)
|
|
3676
3638
|
]
|
|
3677
3639
|
});
|
|
3678
3640
|
}), { count: u } = await s.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
@@ -3680,55 +3642,55 @@ function Rr(n) {
|
|
|
3680
3642
|
users: d,
|
|
3681
3643
|
start: t.page * t.per_page,
|
|
3682
3644
|
limit: t.per_page,
|
|
3683
|
-
length:
|
|
3645
|
+
length: be(u)
|
|
3684
3646
|
};
|
|
3685
3647
|
};
|
|
3686
3648
|
}
|
|
3687
|
-
function
|
|
3649
|
+
function Er(n) {
|
|
3688
3650
|
return async (e, t) => (await n.deleteFrom("users").where("users.tenant_id", "=", e).where("users.linked_to", "=", t).execute(), (await n.deleteFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", t).execute()).length === 1);
|
|
3689
3651
|
}
|
|
3690
|
-
function
|
|
3652
|
+
function Ar(n) {
|
|
3691
3653
|
if (n.email_verified !== void 0)
|
|
3692
3654
|
return n.email_verified ? 1 : 0;
|
|
3693
3655
|
}
|
|
3694
|
-
function
|
|
3656
|
+
function Rr(n) {
|
|
3695
3657
|
return async (e, t, s) => {
|
|
3696
3658
|
const r = {
|
|
3697
3659
|
...s,
|
|
3698
|
-
email_verified:
|
|
3660
|
+
email_verified: Ar(s),
|
|
3699
3661
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3700
3662
|
};
|
|
3701
3663
|
return (await n.updateTable("users").set(r).where("users.tenant_id", "=", e).where("users.user_id", "=", t).execute()).length === 1;
|
|
3702
3664
|
};
|
|
3703
3665
|
}
|
|
3704
|
-
function
|
|
3666
|
+
function $r(n) {
|
|
3705
3667
|
return async (e, t, s, r) => {
|
|
3706
3668
|
const a = { linked_to: null };
|
|
3707
3669
|
return (await n.updateTable("users").set(a).where("users.tenant_id", "=", e).where("users.user_id", "=", `${s}|${r}`).where("users.linked_to", "=", `${t}`).execute()).length === 1;
|
|
3708
3670
|
};
|
|
3709
3671
|
}
|
|
3710
|
-
function
|
|
3672
|
+
function Pr(n) {
|
|
3711
3673
|
return {
|
|
3712
|
-
create:
|
|
3713
|
-
remove:
|
|
3714
|
-
get:
|
|
3715
|
-
list:
|
|
3716
|
-
update:
|
|
3674
|
+
create: Qn(n),
|
|
3675
|
+
remove: Er(n),
|
|
3676
|
+
get: Cr(n),
|
|
3677
|
+
list: Ir(n),
|
|
3678
|
+
update: Rr(n),
|
|
3717
3679
|
// TODO - think about this more when other issues fixed
|
|
3718
|
-
unlink:
|
|
3680
|
+
unlink: $r(n)
|
|
3719
3681
|
};
|
|
3720
3682
|
}
|
|
3721
|
-
const
|
|
3722
|
-
let
|
|
3683
|
+
const Dr = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
3684
|
+
let Ae = (n = 21) => {
|
|
3723
3685
|
let e = "", t = crypto.getRandomValues(new Uint8Array(n));
|
|
3724
3686
|
for (; n--; )
|
|
3725
|
-
e +=
|
|
3687
|
+
e += Dr[t[n] & 63];
|
|
3726
3688
|
return e;
|
|
3727
3689
|
};
|
|
3728
|
-
function
|
|
3690
|
+
function Mr(n) {
|
|
3729
3691
|
return async (e) => {
|
|
3730
3692
|
const t = {
|
|
3731
|
-
id: e.id ||
|
|
3693
|
+
id: e.id || Ae(),
|
|
3732
3694
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3733
3695
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3734
3696
|
...e
|
|
@@ -3736,13 +3698,13 @@ function Ur(n) {
|
|
|
3736
3698
|
return await n.insertInto("tenants").values(t).execute(), t;
|
|
3737
3699
|
};
|
|
3738
3700
|
}
|
|
3739
|
-
function
|
|
3701
|
+
function Lr(n) {
|
|
3740
3702
|
return async (e) => {
|
|
3741
3703
|
const t = await n.selectFrom("tenants").where("tenants.id", "=", e).selectAll().executeTakeFirst();
|
|
3742
3704
|
return t ? R(t) : null;
|
|
3743
3705
|
};
|
|
3744
3706
|
}
|
|
3745
|
-
function
|
|
3707
|
+
function Vr(n) {
|
|
3746
3708
|
return async (e) => {
|
|
3747
3709
|
let t = n.selectFrom("tenants");
|
|
3748
3710
|
if (e.sort && e.sort.sort_by) {
|
|
@@ -3755,7 +3717,7 @@ function zr(n) {
|
|
|
3755
3717
|
return {
|
|
3756
3718
|
tenants: r
|
|
3757
3719
|
};
|
|
3758
|
-
const { count: a } = await t.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), o =
|
|
3720
|
+
const { count: a } = await t.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), o = be(a);
|
|
3759
3721
|
return {
|
|
3760
3722
|
tenants: r.map(R),
|
|
3761
3723
|
start: (e.page - 1) * e.per_page,
|
|
@@ -3764,7 +3726,7 @@ function zr(n) {
|
|
|
3764
3726
|
};
|
|
3765
3727
|
};
|
|
3766
3728
|
}
|
|
3767
|
-
function
|
|
3729
|
+
function Ur(n) {
|
|
3768
3730
|
return async (e, t) => {
|
|
3769
3731
|
const s = {
|
|
3770
3732
|
...t,
|
|
@@ -3774,29 +3736,29 @@ function Br(n) {
|
|
|
3774
3736
|
await n.updateTable("tenants").set(s).where("id", "=", e).execute();
|
|
3775
3737
|
};
|
|
3776
3738
|
}
|
|
3777
|
-
function
|
|
3739
|
+
function Fr(n) {
|
|
3778
3740
|
return async (e) => (await n.deleteFrom("tenants").where("tenants.id", "=", e).execute()).length === 1;
|
|
3779
3741
|
}
|
|
3780
|
-
function
|
|
3742
|
+
function zr(n) {
|
|
3781
3743
|
return {
|
|
3782
|
-
create:
|
|
3783
|
-
get:
|
|
3784
|
-
list:
|
|
3785
|
-
update:
|
|
3786
|
-
remove:
|
|
3744
|
+
create: Mr(n),
|
|
3745
|
+
get: Lr(n),
|
|
3746
|
+
list: Vr(n),
|
|
3747
|
+
update: Ur(n),
|
|
3748
|
+
remove: Fr(n)
|
|
3787
3749
|
};
|
|
3788
3750
|
}
|
|
3789
|
-
function
|
|
3751
|
+
function mn(n) {
|
|
3790
3752
|
return n ? JSON.stringify(n) : void 0;
|
|
3791
3753
|
}
|
|
3792
|
-
const
|
|
3793
|
-
function
|
|
3754
|
+
const Br = 1024;
|
|
3755
|
+
function Wr(n) {
|
|
3794
3756
|
return async (e, t) => {
|
|
3795
3757
|
var r, a, o;
|
|
3796
3758
|
const s = {
|
|
3797
|
-
id:
|
|
3759
|
+
id: Ae(),
|
|
3798
3760
|
...t,
|
|
3799
|
-
user_agent: t.user_agent.slice(0,
|
|
3761
|
+
user_agent: t.user_agent.slice(0, Br)
|
|
3800
3762
|
};
|
|
3801
3763
|
return await n.insertInto("logs").values({
|
|
3802
3764
|
...s,
|
|
@@ -3805,12 +3767,12 @@ function Kr(n) {
|
|
|
3805
3767
|
isMobile: t.isMobile ? 1 : 0,
|
|
3806
3768
|
tenant_id: e,
|
|
3807
3769
|
scope: (a = t.scope) == null ? void 0 : a.join(","),
|
|
3808
|
-
auth0_client:
|
|
3809
|
-
details: (o =
|
|
3770
|
+
auth0_client: mn(t.auth0_client),
|
|
3771
|
+
details: (o = mn(t.details)) == null ? void 0 : o.substring(0, 8192)
|
|
3810
3772
|
}).execute(), s;
|
|
3811
3773
|
};
|
|
3812
3774
|
}
|
|
3813
|
-
function
|
|
3775
|
+
function _n(n) {
|
|
3814
3776
|
if (!n)
|
|
3815
3777
|
return "";
|
|
3816
3778
|
try {
|
|
@@ -3819,23 +3781,23 @@ function gn(n) {
|
|
|
3819
3781
|
return n;
|
|
3820
3782
|
}
|
|
3821
3783
|
}
|
|
3822
|
-
function
|
|
3784
|
+
function Pn(n) {
|
|
3823
3785
|
return {
|
|
3824
3786
|
...n,
|
|
3825
3787
|
client_id: n.client_id,
|
|
3826
3788
|
client_name: "",
|
|
3827
|
-
auth0_client:
|
|
3828
|
-
details:
|
|
3789
|
+
auth0_client: _n(n.auth0_client),
|
|
3790
|
+
details: _n(n.details),
|
|
3829
3791
|
isMobile: !!n.isMobile,
|
|
3830
3792
|
scope: n.scope ? n.scope.split(",") : void 0,
|
|
3831
3793
|
log_id: n.id,
|
|
3832
3794
|
_id: n.id
|
|
3833
3795
|
};
|
|
3834
3796
|
}
|
|
3835
|
-
function
|
|
3797
|
+
function qr(n) {
|
|
3836
3798
|
return async (e, t) => {
|
|
3837
3799
|
let s = n.selectFrom("logs").where("logs.tenant_id", "=", e);
|
|
3838
|
-
t.q && (s =
|
|
3800
|
+
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
3839
3801
|
let r = s;
|
|
3840
3802
|
if (t.sort && t.sort.sort_by) {
|
|
3841
3803
|
const { ref: c } = n.dynamic;
|
|
@@ -3847,30 +3809,30 @@ function Qr(n) {
|
|
|
3847
3809
|
r = r.offset(t.page * t.per_page).limit(t.per_page);
|
|
3848
3810
|
const a = await r.selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
3849
3811
|
return {
|
|
3850
|
-
logs: a.map(
|
|
3812
|
+
logs: a.map(Pn),
|
|
3851
3813
|
start: t.page * t.per_page,
|
|
3852
3814
|
limit: t.per_page,
|
|
3853
|
-
length:
|
|
3815
|
+
length: be(o)
|
|
3854
3816
|
};
|
|
3855
3817
|
};
|
|
3856
3818
|
}
|
|
3857
|
-
function
|
|
3819
|
+
function Jr(n) {
|
|
3858
3820
|
return async (e, t) => {
|
|
3859
3821
|
const s = await n.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", t).selectAll().executeTakeFirst();
|
|
3860
|
-
return s ?
|
|
3822
|
+
return s ? Pn(s) : null;
|
|
3861
3823
|
};
|
|
3862
3824
|
}
|
|
3863
|
-
function
|
|
3825
|
+
function Kr(n) {
|
|
3864
3826
|
return {
|
|
3865
|
-
create:
|
|
3866
|
-
list:
|
|
3867
|
-
get:
|
|
3827
|
+
create: Wr(n),
|
|
3828
|
+
list: qr(n),
|
|
3829
|
+
get: Jr(n)
|
|
3868
3830
|
};
|
|
3869
3831
|
}
|
|
3870
|
-
function
|
|
3832
|
+
function Qr(n) {
|
|
3871
3833
|
return async (e, t) => await n.selectFrom("sessions").where("sessions.tenant_id", "=", e).where("sessions.session_id", "=", t).where("sessions.deleted_at", "is", null).selectAll().executeTakeFirst() ?? null;
|
|
3872
3834
|
}
|
|
3873
|
-
function
|
|
3835
|
+
function Hr(n) {
|
|
3874
3836
|
return async (e, t) => {
|
|
3875
3837
|
const s = {
|
|
3876
3838
|
...t,
|
|
@@ -3880,16 +3842,16 @@ function Xr(n) {
|
|
|
3880
3842
|
return await n.insertInto("sessions").values({ ...s, tenant_id: e }).execute(), { ...t, ...s };
|
|
3881
3843
|
};
|
|
3882
3844
|
}
|
|
3883
|
-
function
|
|
3845
|
+
function Yr(n) {
|
|
3884
3846
|
return async (e, t) => !!(await n.updateTable("sessions").set({ deleted_at: (/* @__PURE__ */ new Date()).toISOString() }).where("tenant_id", "=", e).where("sessions.session_id", "=", t).where("sessions.deleted_at", "is", null).execute()).length;
|
|
3885
3847
|
}
|
|
3886
|
-
function
|
|
3848
|
+
function Gr(n) {
|
|
3887
3849
|
return async (e, t, s) => !!(await n.updateTable("sessions").set(s).where("tenant_id", "=", e).where("sessions.session_id", "=", t).where("sessions.deleted_at", "is", null).execute()).length;
|
|
3888
3850
|
}
|
|
3889
|
-
function
|
|
3851
|
+
function Xr(n) {
|
|
3890
3852
|
return async (e, t) => {
|
|
3891
3853
|
let s = n.selectFrom("sessions").where("sessions.tenant_id", "=", e);
|
|
3892
|
-
t.q && (s =
|
|
3854
|
+
t.q && (s = Ee(n, s, t.q, ["user_id", "session_id"]));
|
|
3893
3855
|
let r = s;
|
|
3894
3856
|
if (t.sort && t.sort.sort_by) {
|
|
3895
3857
|
const { ref: d } = n.dynamic;
|
|
@@ -3899,7 +3861,7 @@ function na(n) {
|
|
|
3899
3861
|
);
|
|
3900
3862
|
}
|
|
3901
3863
|
r = r.offset(t.page * t.per_page).limit(t.per_page);
|
|
3902
|
-
const a = await r.selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), c =
|
|
3864
|
+
const a = await r.selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), c = be(o);
|
|
3903
3865
|
return {
|
|
3904
3866
|
sessions: a,
|
|
3905
3867
|
start: t.page * t.per_page,
|
|
@@ -3908,16 +3870,16 @@ function na(n) {
|
|
|
3908
3870
|
};
|
|
3909
3871
|
};
|
|
3910
3872
|
}
|
|
3911
|
-
function
|
|
3873
|
+
function ea(n) {
|
|
3912
3874
|
return {
|
|
3913
|
-
create:
|
|
3914
|
-
get:
|
|
3915
|
-
list:
|
|
3916
|
-
remove:
|
|
3917
|
-
update:
|
|
3875
|
+
create: Hr(n),
|
|
3876
|
+
get: Qr(n),
|
|
3877
|
+
list: Xr(n),
|
|
3878
|
+
remove: Yr(n),
|
|
3879
|
+
update: Gr(n)
|
|
3918
3880
|
};
|
|
3919
3881
|
}
|
|
3920
|
-
function
|
|
3882
|
+
function ta(n) {
|
|
3921
3883
|
return async (e, t) => {
|
|
3922
3884
|
const s = await n.selectFrom("tickets").where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).where("tickets.used_at", "is", null).selectAll().executeTakeFirst();
|
|
3923
3885
|
if (!s)
|
|
@@ -3947,7 +3909,7 @@ function ra(n) {
|
|
|
3947
3909
|
};
|
|
3948
3910
|
};
|
|
3949
3911
|
}
|
|
3950
|
-
function
|
|
3912
|
+
function na(n) {
|
|
3951
3913
|
return async (e) => {
|
|
3952
3914
|
const { authParams: t, ...s } = e, r = {
|
|
3953
3915
|
...s,
|
|
@@ -3959,83 +3921,27 @@ function aa(n) {
|
|
|
3959
3921
|
await n.insertInto("tickets").values(r).execute();
|
|
3960
3922
|
};
|
|
3961
3923
|
}
|
|
3962
|
-
function
|
|
3924
|
+
function sa(n) {
|
|
3963
3925
|
return async (e, t) => {
|
|
3964
3926
|
await n.updateTable("tickets").set({
|
|
3965
3927
|
used_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3966
3928
|
}).where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).execute();
|
|
3967
3929
|
};
|
|
3968
3930
|
}
|
|
3969
|
-
function
|
|
3970
|
-
return {
|
|
3971
|
-
create: aa(n),
|
|
3972
|
-
get: ra(n),
|
|
3973
|
-
remove: ia(n)
|
|
3974
|
-
};
|
|
3975
|
-
}
|
|
3976
|
-
function ca(n) {
|
|
3977
|
-
return async (e, t) => {
|
|
3978
|
-
const s = (/* @__PURE__ */ new Date()).toISOString();
|
|
3979
|
-
return (await n.selectFrom("otps").where("otps.tenant_id", "=", e).where("otps.email", "=", t).where("otps.expires_at", ">", s).where("otps.used_at", "is", null).selectAll().execute()).map((a) => {
|
|
3980
|
-
const {
|
|
3981
|
-
nonce: o,
|
|
3982
|
-
state: c,
|
|
3983
|
-
scope: d,
|
|
3984
|
-
response_type: u,
|
|
3985
|
-
redirect_uri: l,
|
|
3986
|
-
client_id: T,
|
|
3987
|
-
...C
|
|
3988
|
-
} = a;
|
|
3989
|
-
return {
|
|
3990
|
-
...C,
|
|
3991
|
-
// TODO: this will be removed in the next version of the adapter
|
|
3992
|
-
client_id: T,
|
|
3993
|
-
authParams: {
|
|
3994
|
-
client_id: T,
|
|
3995
|
-
nonce: o,
|
|
3996
|
-
state: c,
|
|
3997
|
-
scope: d,
|
|
3998
|
-
response_type: u,
|
|
3999
|
-
redirect_uri: l
|
|
4000
|
-
},
|
|
4001
|
-
created_at: a.created_at,
|
|
4002
|
-
expires_at: a.expires_at
|
|
4003
|
-
};
|
|
4004
|
-
});
|
|
4005
|
-
};
|
|
4006
|
-
}
|
|
4007
|
-
function da(n) {
|
|
4008
|
-
return async (e, t) => {
|
|
4009
|
-
const { authParams: s, ...r } = t;
|
|
4010
|
-
await n.insertInto("otps").values({
|
|
4011
|
-
...r,
|
|
4012
|
-
...s,
|
|
4013
|
-
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4014
|
-
tenant_id: e,
|
|
4015
|
-
// TODO: this will be fixed in next version of the adapter
|
|
4016
|
-
send: t.send === "code" ? "code" : "link"
|
|
4017
|
-
}).execute();
|
|
4018
|
-
};
|
|
4019
|
-
}
|
|
4020
|
-
function ua(n) {
|
|
4021
|
-
return async (e, t) => (await n.updateTable("otps").set({
|
|
4022
|
-
used_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4023
|
-
}).where("otps.tenant_id", "=", e).where("otps.id", "=", t).execute()).length > 0;
|
|
4024
|
-
}
|
|
4025
|
-
function la(n) {
|
|
3931
|
+
function ra(n) {
|
|
4026
3932
|
return {
|
|
4027
|
-
create:
|
|
4028
|
-
|
|
4029
|
-
remove:
|
|
3933
|
+
create: na(n),
|
|
3934
|
+
get: ta(n),
|
|
3935
|
+
remove: sa(n)
|
|
4030
3936
|
};
|
|
4031
3937
|
}
|
|
4032
|
-
function
|
|
3938
|
+
function aa(n) {
|
|
4033
3939
|
return async (e, t) => {
|
|
4034
3940
|
const s = await n.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", t).selectAll().executeTakeFirstOrThrow(), { tenant_id: r, ...a } = s;
|
|
4035
3941
|
return a;
|
|
4036
3942
|
};
|
|
4037
3943
|
}
|
|
4038
|
-
function
|
|
3944
|
+
function ia(n) {
|
|
4039
3945
|
return async (e, t) => {
|
|
4040
3946
|
const s = {
|
|
4041
3947
|
...t,
|
|
@@ -4048,23 +3954,23 @@ function ha(n) {
|
|
|
4048
3954
|
}).execute(), s;
|
|
4049
3955
|
};
|
|
4050
3956
|
}
|
|
4051
|
-
function
|
|
3957
|
+
function oa(n) {
|
|
4052
3958
|
return async (e, t) => (await n.updateTable("passwords").set({
|
|
4053
3959
|
password: t.password,
|
|
4054
3960
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4055
3961
|
}).where("tenant_id", "=", e).where("user_id", "=", t.user_id).execute()).length === 1;
|
|
4056
3962
|
}
|
|
4057
|
-
function
|
|
3963
|
+
function ca(n) {
|
|
4058
3964
|
return {
|
|
4059
|
-
create:
|
|
4060
|
-
update:
|
|
4061
|
-
get:
|
|
3965
|
+
create: ia(n),
|
|
3966
|
+
update: oa(n),
|
|
3967
|
+
get: aa(n)
|
|
4062
3968
|
};
|
|
4063
3969
|
}
|
|
4064
|
-
function
|
|
3970
|
+
function da(n) {
|
|
4065
3971
|
return async (e, t) => {
|
|
4066
3972
|
let s = n.selectFrom("codes").where("codes.tenant_id", "=", e);
|
|
4067
|
-
t.q && (s =
|
|
3973
|
+
t.q && (s = Ee(n, s, t.q, ["code", "login_id"]));
|
|
4068
3974
|
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
4069
3975
|
return {
|
|
4070
3976
|
codes: a.map((d) => {
|
|
@@ -4073,11 +3979,11 @@ function _a(n) {
|
|
|
4073
3979
|
}),
|
|
4074
3980
|
start: t.page * t.per_page,
|
|
4075
3981
|
limit: t.per_page,
|
|
4076
|
-
length:
|
|
3982
|
+
length: be(o)
|
|
4077
3983
|
};
|
|
4078
3984
|
};
|
|
4079
3985
|
}
|
|
4080
|
-
function
|
|
3986
|
+
function ua(n) {
|
|
4081
3987
|
return async (e, t) => {
|
|
4082
3988
|
const s = {
|
|
4083
3989
|
...t,
|
|
@@ -4089,10 +3995,10 @@ function ga(n) {
|
|
|
4089
3995
|
}).execute(), s;
|
|
4090
3996
|
};
|
|
4091
3997
|
}
|
|
4092
|
-
function
|
|
3998
|
+
function la(n) {
|
|
4093
3999
|
return async (e, t) => (await n.deleteFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4094
4000
|
}
|
|
4095
|
-
function
|
|
4001
|
+
function pa(n) {
|
|
4096
4002
|
return async (e, t, s) => {
|
|
4097
4003
|
let r = n.selectFrom("codes").where("codes.code_id", "=", t).where("codes.code_type", "=", s).where("codes.expires_at", ">", (/* @__PURE__ */ new Date()).toISOString());
|
|
4098
4004
|
e.length && (r = r.where("codes.tenant_id", "=", e));
|
|
@@ -4100,75 +4006,15 @@ function va(n) {
|
|
|
4100
4006
|
return a ? R(a) : null;
|
|
4101
4007
|
};
|
|
4102
4008
|
}
|
|
4103
|
-
function
|
|
4104
|
-
return {
|
|
4105
|
-
create: ga(n),
|
|
4106
|
-
list: _a(n),
|
|
4107
|
-
remove: ya(n),
|
|
4108
|
-
get: va(n)
|
|
4109
|
-
};
|
|
4110
|
-
}
|
|
4111
|
-
function ka(n) {
|
|
4112
|
-
return async (e) => {
|
|
4113
|
-
const t = (/* @__PURE__ */ new Date()).toISOString(), s = await n.selectFrom("universal_login_sessions").where("universal_login_sessions.expires_at", ">", t).where("universal_login_sessions.id", "=", e).selectAll().executeTakeFirst();
|
|
4114
|
-
if (!s) return null;
|
|
4115
|
-
const {
|
|
4116
|
-
response_type: r,
|
|
4117
|
-
response_mode: a,
|
|
4118
|
-
redirect_uri: o,
|
|
4119
|
-
audience: c,
|
|
4120
|
-
state: d,
|
|
4121
|
-
nonce: u,
|
|
4122
|
-
scope: l,
|
|
4123
|
-
code_challenge_method: T,
|
|
4124
|
-
code_challenge: C,
|
|
4125
|
-
username: L,
|
|
4126
|
-
vendor_id: K,
|
|
4127
|
-
...re
|
|
4128
|
-
} = s;
|
|
4129
|
-
return {
|
|
4130
|
-
...re,
|
|
4131
|
-
authParams: {
|
|
4132
|
-
client_id: re.client_id,
|
|
4133
|
-
vendor_id: K,
|
|
4134
|
-
response_type: r,
|
|
4135
|
-
response_mode: a,
|
|
4136
|
-
redirect_uri: o,
|
|
4137
|
-
audience: c,
|
|
4138
|
-
state: d,
|
|
4139
|
-
nonce: u,
|
|
4140
|
-
scope: l,
|
|
4141
|
-
// @ts-ignore
|
|
4142
|
-
code_challenge_method: T,
|
|
4143
|
-
code_challenge: C,
|
|
4144
|
-
username: L
|
|
4145
|
-
}
|
|
4146
|
-
};
|
|
4147
|
-
};
|
|
4148
|
-
}
|
|
4149
|
-
function ba(n) {
|
|
4150
|
-
return async (e, t) => {
|
|
4151
|
-
const { authParams: s, ...r } = t, a = {
|
|
4152
|
-
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4153
|
-
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4154
|
-
};
|
|
4155
|
-
return await n.insertInto("universal_login_sessions").values({ ...s, ...r, ...a, tenant_id: e }).execute(), { ...t, ...a };
|
|
4156
|
-
};
|
|
4157
|
-
}
|
|
4158
|
-
function xa(n) {
|
|
4159
|
-
return async (e, t, s) => {
|
|
4160
|
-
const { authParams: r, ...a } = s;
|
|
4161
|
-
return (await n.updateTable("universal_login_sessions").set({ ...r, ...a }).where("id", "=", t).where("tenant_id", "=", e).execute()).length === 1;
|
|
4162
|
-
};
|
|
4163
|
-
}
|
|
4164
|
-
function Ta(n) {
|
|
4009
|
+
function ha(n) {
|
|
4165
4010
|
return {
|
|
4166
|
-
create:
|
|
4167
|
-
|
|
4168
|
-
|
|
4011
|
+
create: ua(n),
|
|
4012
|
+
list: da(n),
|
|
4013
|
+
remove: la(n),
|
|
4014
|
+
get: pa(n)
|
|
4169
4015
|
};
|
|
4170
4016
|
}
|
|
4171
|
-
function
|
|
4017
|
+
function fa(n) {
|
|
4172
4018
|
return async (e, t) => {
|
|
4173
4019
|
const s = {
|
|
4174
4020
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -4187,7 +4033,7 @@ function Oa(n) {
|
|
|
4187
4033
|
}).execute(), s;
|
|
4188
4034
|
};
|
|
4189
4035
|
}
|
|
4190
|
-
function
|
|
4036
|
+
function ma(n) {
|
|
4191
4037
|
return async (e) => ({
|
|
4192
4038
|
applications: (await n.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()).map((a) => ({
|
|
4193
4039
|
...a,
|
|
@@ -4200,7 +4046,7 @@ function Sa(n) {
|
|
|
4200
4046
|
}))
|
|
4201
4047
|
});
|
|
4202
4048
|
}
|
|
4203
|
-
function
|
|
4049
|
+
function _a(n) {
|
|
4204
4050
|
return async (e, t) => {
|
|
4205
4051
|
const s = await n.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).selectAll().executeTakeFirst();
|
|
4206
4052
|
return s ? R({
|
|
@@ -4214,10 +4060,10 @@ function Za(n) {
|
|
|
4214
4060
|
}) : null;
|
|
4215
4061
|
};
|
|
4216
4062
|
}
|
|
4217
|
-
function
|
|
4063
|
+
function ga(n) {
|
|
4218
4064
|
return async (e, t) => (await n.deleteFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4219
4065
|
}
|
|
4220
|
-
function
|
|
4066
|
+
function ya(n) {
|
|
4221
4067
|
return async (e, t, s) => {
|
|
4222
4068
|
const r = {
|
|
4223
4069
|
...s,
|
|
@@ -4232,19 +4078,19 @@ function Na(n) {
|
|
|
4232
4078
|
return await n.updateTable("applications").set(r).where("applications.id", "=", t).where("applications.tenant_id", "=", e).execute(), !0;
|
|
4233
4079
|
};
|
|
4234
4080
|
}
|
|
4235
|
-
function
|
|
4081
|
+
function va(n) {
|
|
4236
4082
|
return {
|
|
4237
|
-
create:
|
|
4238
|
-
list:
|
|
4239
|
-
get:
|
|
4240
|
-
remove:
|
|
4241
|
-
update:
|
|
4083
|
+
create: fa(n),
|
|
4084
|
+
list: ma(n),
|
|
4085
|
+
get: _a(n),
|
|
4086
|
+
remove: ga(n),
|
|
4087
|
+
update: ya(n)
|
|
4242
4088
|
};
|
|
4243
4089
|
}
|
|
4244
|
-
function
|
|
4090
|
+
function wa(n) {
|
|
4245
4091
|
return async (e, t) => {
|
|
4246
4092
|
const s = {
|
|
4247
|
-
id:
|
|
4093
|
+
id: Ae(),
|
|
4248
4094
|
...t,
|
|
4249
4095
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4250
4096
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -4252,29 +4098,29 @@ function Ca(n) {
|
|
|
4252
4098
|
return await n.insertInto("connections").values({ ...s, tenant_id: e }).execute(), s;
|
|
4253
4099
|
};
|
|
4254
4100
|
}
|
|
4255
|
-
function
|
|
4101
|
+
function ka(n) {
|
|
4256
4102
|
return async (e, t) => {
|
|
4257
4103
|
let s = n.selectFrom("connections").where("connections.tenant_id", "=", e);
|
|
4258
|
-
t.q && (s =
|
|
4104
|
+
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
4259
4105
|
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
4260
4106
|
return {
|
|
4261
4107
|
connections: a.map(R),
|
|
4262
4108
|
start: t.page * t.per_page,
|
|
4263
4109
|
limit: t.per_page,
|
|
4264
|
-
length:
|
|
4110
|
+
length: be(o)
|
|
4265
4111
|
};
|
|
4266
4112
|
};
|
|
4267
4113
|
}
|
|
4268
|
-
function
|
|
4114
|
+
function ba(n) {
|
|
4269
4115
|
return async (e, t) => (await n.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4270
4116
|
}
|
|
4271
|
-
function
|
|
4117
|
+
function xa(n) {
|
|
4272
4118
|
return async (e, t) => {
|
|
4273
4119
|
const s = await n.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).selectAll().executeTakeFirst();
|
|
4274
4120
|
return s ? R(s) : null;
|
|
4275
4121
|
};
|
|
4276
4122
|
}
|
|
4277
|
-
function
|
|
4123
|
+
function Ta(n) {
|
|
4278
4124
|
return async (e, t, s) => {
|
|
4279
4125
|
const r = {
|
|
4280
4126
|
...s,
|
|
@@ -4283,16 +4129,16 @@ function $a(n) {
|
|
|
4283
4129
|
return await n.updateTable("connections").set(r).where("connections.id", "=", t).where("connections.tenant_id", "=", e).execute(), !0;
|
|
4284
4130
|
};
|
|
4285
4131
|
}
|
|
4286
|
-
function
|
|
4132
|
+
function Oa(n) {
|
|
4287
4133
|
return {
|
|
4288
|
-
create:
|
|
4289
|
-
get:
|
|
4290
|
-
list:
|
|
4291
|
-
remove:
|
|
4292
|
-
update:
|
|
4134
|
+
create: wa(n),
|
|
4135
|
+
get: xa(n),
|
|
4136
|
+
list: ka(n),
|
|
4137
|
+
remove: ba(n),
|
|
4138
|
+
update: Ta(n)
|
|
4293
4139
|
};
|
|
4294
4140
|
}
|
|
4295
|
-
function
|
|
4141
|
+
function Sa(n) {
|
|
4296
4142
|
return {
|
|
4297
4143
|
get: async (e) => {
|
|
4298
4144
|
const t = await n.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
|
|
@@ -4300,12 +4146,12 @@ function Da(n) {
|
|
|
4300
4146
|
return null;
|
|
4301
4147
|
const s = await n.selectFrom("tenants").selectAll().where("id", "=", t.tenant_id).executeTakeFirst();
|
|
4302
4148
|
if (!s)
|
|
4303
|
-
throw new
|
|
4149
|
+
throw new Gt(404, { message: "Tenant not found" });
|
|
4304
4150
|
const r = await n.selectFrom("connections").where("tenant_id", "=", t.tenant_id).selectAll().execute(), a = await n.selectFrom("domains").where("tenant_id", "=", t.tenant_id).selectAll().execute();
|
|
4305
4151
|
return {
|
|
4306
4152
|
...t,
|
|
4307
4153
|
connections: r.map(
|
|
4308
|
-
(c) =>
|
|
4154
|
+
(c) => An.parse(R(c))
|
|
4309
4155
|
),
|
|
4310
4156
|
domains: a,
|
|
4311
4157
|
addons: t.addons ? JSON.parse(t.addons) : {},
|
|
@@ -4320,56 +4166,56 @@ function Da(n) {
|
|
|
4320
4166
|
}
|
|
4321
4167
|
};
|
|
4322
4168
|
}
|
|
4323
|
-
function
|
|
4169
|
+
function Za(n) {
|
|
4324
4170
|
return async () => await n.selectFrom("keys").where("revoked_at", "is", null).selectAll().execute();
|
|
4325
4171
|
}
|
|
4326
|
-
function
|
|
4172
|
+
function ja(n) {
|
|
4327
4173
|
return async (e) => {
|
|
4328
|
-
await n.insertInto("keys").values(e).execute();
|
|
4174
|
+
await n.insertInto("keys").values({ ...e, created_at: (/* @__PURE__ */ new Date()).toDateString() }).execute();
|
|
4329
4175
|
};
|
|
4330
4176
|
}
|
|
4331
|
-
function
|
|
4177
|
+
function Na(n) {
|
|
4332
4178
|
return async (e, t) => !!(await n.updateTable("keys").set({ revoked_at: t.toISOString() }).where("kid", "=", e).execute()).length;
|
|
4333
4179
|
}
|
|
4334
|
-
function
|
|
4180
|
+
function Ca(n) {
|
|
4335
4181
|
return {
|
|
4336
|
-
create:
|
|
4337
|
-
list:
|
|
4338
|
-
revoke:
|
|
4182
|
+
create: ja(n),
|
|
4183
|
+
list: Za(n),
|
|
4184
|
+
revoke: Na(n)
|
|
4339
4185
|
};
|
|
4340
4186
|
}
|
|
4341
|
-
function
|
|
4187
|
+
function Ia(n) {
|
|
4342
4188
|
return async (e, t) => {
|
|
4343
4189
|
const s = {
|
|
4344
4190
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4345
4191
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4346
4192
|
tenant_id: e,
|
|
4347
|
-
id:
|
|
4193
|
+
id: Ae(),
|
|
4348
4194
|
...t
|
|
4349
4195
|
};
|
|
4350
4196
|
return await n.insertInto("domains").values(s).execute(), s;
|
|
4351
4197
|
};
|
|
4352
4198
|
}
|
|
4353
|
-
function
|
|
4199
|
+
function Ea(n) {
|
|
4354
4200
|
return async (e, t) => {
|
|
4355
4201
|
let s = n.selectFrom("domains").where("domains.tenant_id", "=", e);
|
|
4356
|
-
t.q && (s =
|
|
4202
|
+
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
4357
4203
|
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
4358
4204
|
return {
|
|
4359
4205
|
domains: a,
|
|
4360
4206
|
start: t.page * t.per_page,
|
|
4361
4207
|
limit: t.per_page,
|
|
4362
|
-
length:
|
|
4208
|
+
length: be(o)
|
|
4363
4209
|
};
|
|
4364
4210
|
};
|
|
4365
4211
|
}
|
|
4366
|
-
function
|
|
4212
|
+
function Aa(n) {
|
|
4367
4213
|
return {
|
|
4368
|
-
create:
|
|
4369
|
-
list:
|
|
4214
|
+
create: Ia(n),
|
|
4215
|
+
list: Ea(n)
|
|
4370
4216
|
};
|
|
4371
4217
|
}
|
|
4372
|
-
function
|
|
4218
|
+
function Ra(n) {
|
|
4373
4219
|
return async (e) => {
|
|
4374
4220
|
const [t] = await n.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
|
|
4375
4221
|
if (!t)
|
|
@@ -4399,9 +4245,9 @@ function Wa(n) {
|
|
|
4399
4245
|
});
|
|
4400
4246
|
};
|
|
4401
4247
|
}
|
|
4402
|
-
function
|
|
4248
|
+
function $a(n) {
|
|
4403
4249
|
return async (e, t) => {
|
|
4404
|
-
var o, c, d, u, l,
|
|
4250
|
+
var o, c, d, u, l, j, A, U, ie, Re, oe, ce, de, $e, Pe, K, Q, H;
|
|
4405
4251
|
const { colors: s, font: r, ...a } = t;
|
|
4406
4252
|
try {
|
|
4407
4253
|
await n.insertInto("branding").values({
|
|
@@ -4409,108 +4255,63 @@ function qa(n) {
|
|
|
4409
4255
|
colors_primary: s == null ? void 0 : s.primary,
|
|
4410
4256
|
colors_page_background_type: (c = (o = t.colors) == null ? void 0 : o.page_background) == null ? void 0 : c.type,
|
|
4411
4257
|
colors_page_background_start: (u = (d = t.colors) == null ? void 0 : d.page_background) == null ? void 0 : u.start,
|
|
4412
|
-
colors_page_background_end: (
|
|
4413
|
-
colors_page_background_angle_dev: (
|
|
4414
|
-
font_url: (
|
|
4258
|
+
colors_page_background_end: (j = (l = t.colors) == null ? void 0 : l.page_background) == null ? void 0 : j.end,
|
|
4259
|
+
colors_page_background_angle_dev: (U = (A = t.colors) == null ? void 0 : A.page_background) == null ? void 0 : U.angle_deg,
|
|
4260
|
+
font_url: (ie = t.font) == null ? void 0 : ie.url,
|
|
4415
4261
|
tenant_id: e
|
|
4416
4262
|
}).execute();
|
|
4417
4263
|
} catch {
|
|
4418
4264
|
await n.updateTable("branding").set({
|
|
4419
4265
|
...a,
|
|
4420
4266
|
colors_primary: s == null ? void 0 : s.primary,
|
|
4421
|
-
colors_page_background_type: (
|
|
4422
|
-
colors_page_background_start: (
|
|
4267
|
+
colors_page_background_type: (oe = (Re = t.colors) == null ? void 0 : Re.page_background) == null ? void 0 : oe.type,
|
|
4268
|
+
colors_page_background_start: (de = (ce = t.colors) == null ? void 0 : ce.page_background) == null ? void 0 : de.start,
|
|
4423
4269
|
colors_page_background_end: (Pe = ($e = t.colors) == null ? void 0 : $e.page_background) == null ? void 0 : Pe.end,
|
|
4424
|
-
colors_page_background_angle_dev: (
|
|
4425
|
-
font_url: (
|
|
4270
|
+
colors_page_background_angle_dev: (Q = (K = t.colors) == null ? void 0 : K.page_background) == null ? void 0 : Q.angle_deg,
|
|
4271
|
+
font_url: (H = t.font) == null ? void 0 : H.url
|
|
4426
4272
|
}).where("tenant_id", "=", e).execute();
|
|
4427
4273
|
}
|
|
4428
4274
|
};
|
|
4429
4275
|
}
|
|
4430
|
-
function
|
|
4431
|
-
return {
|
|
4432
|
-
get: Wa(n),
|
|
4433
|
-
set: qa(n)
|
|
4434
|
-
};
|
|
4435
|
-
}
|
|
4436
|
-
function Ka(n) {
|
|
4437
|
-
return async (e, t) => {
|
|
4438
|
-
const s = await n.selectFrom("authentication_codes").where("tenant_id", "=", e).where("code", "=", t).selectAll().executeTakeFirst();
|
|
4439
|
-
if (!s)
|
|
4440
|
-
throw new Et(403, { message: "Code not found or expired" });
|
|
4441
|
-
const {
|
|
4442
|
-
state: r,
|
|
4443
|
-
nonce: a,
|
|
4444
|
-
scope: o,
|
|
4445
|
-
client_id: c,
|
|
4446
|
-
response_type: d,
|
|
4447
|
-
response_mode: u,
|
|
4448
|
-
redirect_uri: l,
|
|
4449
|
-
...T
|
|
4450
|
-
} = s;
|
|
4451
|
-
return {
|
|
4452
|
-
...T,
|
|
4453
|
-
authParams: {
|
|
4454
|
-
state: r,
|
|
4455
|
-
nonce: a,
|
|
4456
|
-
scope: o,
|
|
4457
|
-
client_id: c,
|
|
4458
|
-
response_type: d,
|
|
4459
|
-
response_mode: u,
|
|
4460
|
-
redirect_uri: l
|
|
4461
|
-
}
|
|
4462
|
-
};
|
|
4463
|
-
};
|
|
4464
|
-
}
|
|
4465
|
-
function Qa(n) {
|
|
4466
|
-
return async (e, t) => {
|
|
4467
|
-
const { authParams: s, ...r } = t;
|
|
4468
|
-
await n.insertInto("authentication_codes").values({
|
|
4469
|
-
...r,
|
|
4470
|
-
...s,
|
|
4471
|
-
tenant_id: e
|
|
4472
|
-
}).execute();
|
|
4473
|
-
};
|
|
4474
|
-
}
|
|
4475
|
-
function Ha(n) {
|
|
4276
|
+
function Pa(n) {
|
|
4476
4277
|
return {
|
|
4477
|
-
|
|
4478
|
-
|
|
4278
|
+
get: Ra(n),
|
|
4279
|
+
set: $a(n)
|
|
4479
4280
|
};
|
|
4480
4281
|
}
|
|
4481
|
-
function
|
|
4282
|
+
function Da(n) {
|
|
4482
4283
|
return async (e, t) => {
|
|
4483
4284
|
let s = n.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
4484
|
-
t.q && (s =
|
|
4285
|
+
t.q && (s = Ee(n, s, t.q, ["url"]));
|
|
4485
4286
|
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
4486
4287
|
return {
|
|
4487
4288
|
hooks: a.map((d) => {
|
|
4488
|
-
const { tenant_id: u, enabled: l, synchronous:
|
|
4289
|
+
const { tenant_id: u, enabled: l, synchronous: j, ...A } = d;
|
|
4489
4290
|
return R({
|
|
4490
|
-
...
|
|
4291
|
+
...A,
|
|
4491
4292
|
enabled: !!l,
|
|
4492
|
-
synchronous: !!
|
|
4293
|
+
synchronous: !!j
|
|
4493
4294
|
});
|
|
4494
4295
|
}),
|
|
4495
4296
|
start: t.page * t.per_page,
|
|
4496
4297
|
limit: t.per_page,
|
|
4497
|
-
length:
|
|
4298
|
+
length: be(o)
|
|
4498
4299
|
};
|
|
4499
4300
|
};
|
|
4500
4301
|
}
|
|
4501
|
-
function
|
|
4302
|
+
function Ma(n) {
|
|
4502
4303
|
return async (e, t) => {
|
|
4503
4304
|
const s = await n.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).selectAll().executeTakeFirst();
|
|
4504
4305
|
return s ? (s.enabled = !!s.enabled, s.synchronous = !!s.synchronous, R(s)) : null;
|
|
4505
4306
|
};
|
|
4506
4307
|
}
|
|
4507
|
-
function
|
|
4308
|
+
function La(n) {
|
|
4508
4309
|
return async (e, t) => (await n.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4509
4310
|
}
|
|
4510
|
-
function
|
|
4311
|
+
function Va(n) {
|
|
4511
4312
|
return async (e, t) => {
|
|
4512
4313
|
const s = {
|
|
4513
|
-
hook_id:
|
|
4314
|
+
hook_id: Ae(),
|
|
4514
4315
|
...t,
|
|
4515
4316
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4516
4317
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -4521,7 +4322,7 @@ function ei(n) {
|
|
|
4521
4322
|
}).execute(), s;
|
|
4522
4323
|
};
|
|
4523
4324
|
}
|
|
4524
|
-
function
|
|
4325
|
+
function Ua(n) {
|
|
4525
4326
|
return async (e, t, s) => {
|
|
4526
4327
|
const r = {
|
|
4527
4328
|
...s,
|
|
@@ -4530,16 +4331,16 @@ function ti(n) {
|
|
|
4530
4331
|
return await n.updateTable("hooks").set(r).where("hooks.hook_id", "=", t).where("hooks.tenant_id", "=", e).execute(), !0;
|
|
4531
4332
|
};
|
|
4532
4333
|
}
|
|
4533
|
-
function
|
|
4334
|
+
function Fa(n) {
|
|
4534
4335
|
return {
|
|
4535
|
-
create:
|
|
4536
|
-
get:
|
|
4537
|
-
list:
|
|
4538
|
-
update:
|
|
4539
|
-
remove:
|
|
4336
|
+
create: Va(n),
|
|
4337
|
+
get: Ma(n),
|
|
4338
|
+
list: Da(n),
|
|
4339
|
+
update: Ua(n),
|
|
4340
|
+
remove: La(n)
|
|
4540
4341
|
};
|
|
4541
4342
|
}
|
|
4542
|
-
function
|
|
4343
|
+
function za(n, e) {
|
|
4543
4344
|
var t = {};
|
|
4544
4345
|
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
|
|
4545
4346
|
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -4547,7 +4348,7 @@ function si(n, e) {
|
|
|
4547
4348
|
e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
|
|
4548
4349
|
return t;
|
|
4549
4350
|
}
|
|
4550
|
-
function
|
|
4351
|
+
function Ba(n, e) {
|
|
4551
4352
|
var t;
|
|
4552
4353
|
return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
|
|
4553
4354
|
}
|
|
@@ -4558,28 +4359,28 @@ function He(n, e) {
|
|
|
4558
4359
|
return r._def.openapi = this._def.openapi, r;
|
|
4559
4360
|
};
|
|
4560
4361
|
}
|
|
4561
|
-
function
|
|
4362
|
+
function Wa(n) {
|
|
4562
4363
|
if (typeof n.ZodType.prototype.openapi < "u")
|
|
4563
4364
|
return;
|
|
4564
4365
|
n.ZodType.prototype.openapi = function(r, a) {
|
|
4565
|
-
var o, c, d, u, l,
|
|
4566
|
-
const
|
|
4567
|
-
param: Object.assign(Object.assign({}, (
|
|
4568
|
-
} : void 0),
|
|
4569
|
-
if (
|
|
4366
|
+
var o, c, d, u, l, j;
|
|
4367
|
+
const A = typeof r == "string" ? a : r, U = A ?? {}, { param: ie } = U, Re = za(U, ["param"]), oe = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), ce = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), Re), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || ie ? {
|
|
4368
|
+
param: Object.assign(Object.assign({}, (j = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || j === void 0 ? void 0 : j.param), ie)
|
|
4369
|
+
} : void 0), de = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(oe).length > 0 ? { _internal: oe } : void 0), Object.keys(ce).length > 0 ? { metadata: ce } : void 0) }));
|
|
4370
|
+
if (Ba(this, "ZodObject")) {
|
|
4570
4371
|
const $e = this.extend;
|
|
4571
|
-
|
|
4572
|
-
var Q, H,
|
|
4573
|
-
const
|
|
4574
|
-
return
|
|
4372
|
+
de.extend = function(...Pe) {
|
|
4373
|
+
var K, Q, H, ue, xe, Te;
|
|
4374
|
+
const Oe = $e.apply(this, Pe);
|
|
4375
|
+
return Oe._def.openapi = {
|
|
4575
4376
|
_internal: {
|
|
4576
|
-
extendedFrom: !((
|
|
4377
|
+
extendedFrom: !((Q = (K = this._def.openapi) === null || K === void 0 ? void 0 : K._internal) === null || Q === void 0) && Q.refId ? { refId: (ue = (H = this._def.openapi) === null || H === void 0 ? void 0 : H._internal) === null || ue === void 0 ? void 0 : ue.refId, schema: this } : (xe = this._def.openapi) === null || xe === void 0 ? void 0 : xe._internal.extendedFrom
|
|
4577
4378
|
},
|
|
4578
|
-
metadata: (
|
|
4579
|
-
},
|
|
4379
|
+
metadata: (Te = Oe._def.openapi) === null || Te === void 0 ? void 0 : Te.metadata
|
|
4380
|
+
}, Oe;
|
|
4580
4381
|
};
|
|
4581
4382
|
}
|
|
4582
|
-
return
|
|
4383
|
+
return de;
|
|
4583
4384
|
}, He(n, "optional"), He(n, "nullable"), He(n, "default"), He(n, "transform"), He(n, "refine");
|
|
4584
4385
|
const e = n.ZodObject.prototype.deepPartial;
|
|
4585
4386
|
n.ZodObject.prototype.deepPartial = function() {
|
|
@@ -4601,7 +4402,7 @@ function ai(n) {
|
|
|
4601
4402
|
};
|
|
4602
4403
|
}
|
|
4603
4404
|
new Set(".\\+*[^]$()");
|
|
4604
|
-
var
|
|
4405
|
+
var C;
|
|
4605
4406
|
(function(n) {
|
|
4606
4407
|
n.assertEqual = (r) => r;
|
|
4607
4408
|
function e(r) {
|
|
@@ -4636,16 +4437,16 @@ var I;
|
|
|
4636
4437
|
return r.map((o) => typeof o == "string" ? `'${o}'` : o).join(a);
|
|
4637
4438
|
}
|
|
4638
4439
|
n.joinValues = s, n.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
|
|
4639
|
-
})(
|
|
4640
|
-
var
|
|
4440
|
+
})(C || (C = {}));
|
|
4441
|
+
var sn;
|
|
4641
4442
|
(function(n) {
|
|
4642
4443
|
n.mergeShapes = (e, t) => ({
|
|
4643
4444
|
...e,
|
|
4644
4445
|
...t
|
|
4645
4446
|
// second overwrites first
|
|
4646
4447
|
});
|
|
4647
|
-
})(
|
|
4648
|
-
const g =
|
|
4448
|
+
})(sn || (sn = {}));
|
|
4449
|
+
const g = C.arrayToEnum([
|
|
4649
4450
|
"string",
|
|
4650
4451
|
"nan",
|
|
4651
4452
|
"number",
|
|
@@ -4666,7 +4467,7 @@ const g = I.arrayToEnum([
|
|
|
4666
4467
|
"never",
|
|
4667
4468
|
"map",
|
|
4668
4469
|
"set"
|
|
4669
|
-
]),
|
|
4470
|
+
]), he = (n) => {
|
|
4670
4471
|
switch (typeof n) {
|
|
4671
4472
|
case "undefined":
|
|
4672
4473
|
return g.undefined;
|
|
@@ -4687,7 +4488,7 @@ const g = I.arrayToEnum([
|
|
|
4687
4488
|
default:
|
|
4688
4489
|
return g.unknown;
|
|
4689
4490
|
}
|
|
4690
|
-
}, h =
|
|
4491
|
+
}, h = C.arrayToEnum([
|
|
4691
4492
|
"invalid_type",
|
|
4692
4493
|
"invalid_literal",
|
|
4693
4494
|
"custom",
|
|
@@ -4704,8 +4505,8 @@ const g = I.arrayToEnum([
|
|
|
4704
4505
|
"invalid_intersection_types",
|
|
4705
4506
|
"not_multiple_of",
|
|
4706
4507
|
"not_finite"
|
|
4707
|
-
]),
|
|
4708
|
-
class
|
|
4508
|
+
]), qa = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
4509
|
+
class V extends Error {
|
|
4709
4510
|
constructor(e) {
|
|
4710
4511
|
super(), this.issues = [], this.addIssue = (s) => {
|
|
4711
4512
|
this.issues = [...this.issues, s];
|
|
@@ -4742,14 +4543,14 @@ class U extends Error {
|
|
|
4742
4543
|
return r(this), s;
|
|
4743
4544
|
}
|
|
4744
4545
|
static assert(e) {
|
|
4745
|
-
if (!(e instanceof
|
|
4546
|
+
if (!(e instanceof V))
|
|
4746
4547
|
throw new Error(`Not a ZodError: ${e}`);
|
|
4747
4548
|
}
|
|
4748
4549
|
toString() {
|
|
4749
4550
|
return this.message;
|
|
4750
4551
|
}
|
|
4751
4552
|
get message() {
|
|
4752
|
-
return JSON.stringify(this.issues,
|
|
4553
|
+
return JSON.stringify(this.issues, C.jsonStringifyReplacer, 2);
|
|
4753
4554
|
}
|
|
4754
4555
|
get isEmpty() {
|
|
4755
4556
|
return this.issues.length === 0;
|
|
@@ -4764,7 +4565,7 @@ class U extends Error {
|
|
|
4764
4565
|
return this.flatten();
|
|
4765
4566
|
}
|
|
4766
4567
|
}
|
|
4767
|
-
|
|
4568
|
+
V.create = (n) => new V(n);
|
|
4768
4569
|
const qe = (n, e) => {
|
|
4769
4570
|
let t;
|
|
4770
4571
|
switch (n.code) {
|
|
@@ -4772,19 +4573,19 @@ const qe = (n, e) => {
|
|
|
4772
4573
|
n.received === g.undefined ? t = "Required" : t = `Expected ${n.expected}, received ${n.received}`;
|
|
4773
4574
|
break;
|
|
4774
4575
|
case h.invalid_literal:
|
|
4775
|
-
t = `Invalid literal value, expected ${JSON.stringify(n.expected,
|
|
4576
|
+
t = `Invalid literal value, expected ${JSON.stringify(n.expected, C.jsonStringifyReplacer)}`;
|
|
4776
4577
|
break;
|
|
4777
4578
|
case h.unrecognized_keys:
|
|
4778
|
-
t = `Unrecognized key(s) in object: ${
|
|
4579
|
+
t = `Unrecognized key(s) in object: ${C.joinValues(n.keys, ", ")}`;
|
|
4779
4580
|
break;
|
|
4780
4581
|
case h.invalid_union:
|
|
4781
4582
|
t = "Invalid input";
|
|
4782
4583
|
break;
|
|
4783
4584
|
case h.invalid_union_discriminator:
|
|
4784
|
-
t = `Invalid discriminator value. Expected ${
|
|
4585
|
+
t = `Invalid discriminator value. Expected ${C.joinValues(n.options)}`;
|
|
4785
4586
|
break;
|
|
4786
4587
|
case h.invalid_enum_value:
|
|
4787
|
-
t = `Invalid enum value. Expected ${
|
|
4588
|
+
t = `Invalid enum value. Expected ${C.joinValues(n.options)}, received '${n.received}'`;
|
|
4788
4589
|
break;
|
|
4789
4590
|
case h.invalid_arguments:
|
|
4790
4591
|
t = "Invalid function arguments";
|
|
@@ -4796,7 +4597,7 @@ const qe = (n, e) => {
|
|
|
4796
4597
|
t = "Invalid date";
|
|
4797
4598
|
break;
|
|
4798
4599
|
case h.invalid_string:
|
|
4799
|
-
typeof n.validation == "object" ? "includes" in n.validation ? (t = `Invalid input: must include "${n.validation.includes}"`, typeof n.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${n.validation.position}`)) : "startsWith" in n.validation ? t = `Invalid input: must start with "${n.validation.startsWith}"` : "endsWith" in n.validation ? t = `Invalid input: must end with "${n.validation.endsWith}"` :
|
|
4600
|
+
typeof n.validation == "object" ? "includes" in n.validation ? (t = `Invalid input: must include "${n.validation.includes}"`, typeof n.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${n.validation.position}`)) : "startsWith" in n.validation ? t = `Invalid input: must start with "${n.validation.startsWith}"` : "endsWith" in n.validation ? t = `Invalid input: must end with "${n.validation.endsWith}"` : C.assertNever(n.validation) : n.validation !== "regex" ? t = `Invalid ${n.validation}` : t = "Invalid";
|
|
4800
4601
|
break;
|
|
4801
4602
|
case h.too_small:
|
|
4802
4603
|
n.type === "array" ? t = `Array must contain ${n.exact ? "exactly" : n.inclusive ? "at least" : "more than"} ${n.minimum} element(s)` : n.type === "string" ? t = `String must contain ${n.exact ? "exactly" : n.inclusive ? "at least" : "over"} ${n.minimum} character(s)` : n.type === "number" ? t = `Number must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${n.minimum}` : n.type === "date" ? t = `Date must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(n.minimum))}` : t = "Invalid input";
|
|
@@ -4817,18 +4618,18 @@ const qe = (n, e) => {
|
|
|
4817
4618
|
t = "Number must be finite";
|
|
4818
4619
|
break;
|
|
4819
4620
|
default:
|
|
4820
|
-
t = e.defaultError,
|
|
4621
|
+
t = e.defaultError, C.assertNever(n);
|
|
4821
4622
|
}
|
|
4822
4623
|
return { message: t };
|
|
4823
4624
|
};
|
|
4824
|
-
let
|
|
4825
|
-
function
|
|
4826
|
-
|
|
4625
|
+
let Dn = qe;
|
|
4626
|
+
function Ja(n) {
|
|
4627
|
+
Dn = n;
|
|
4827
4628
|
}
|
|
4828
|
-
function
|
|
4829
|
-
return
|
|
4629
|
+
function Vt() {
|
|
4630
|
+
return Dn;
|
|
4830
4631
|
}
|
|
4831
|
-
const
|
|
4632
|
+
const Ut = (n) => {
|
|
4832
4633
|
const { data: e, path: t, errorMaps: s, issueData: r } = n, a = [...t, ...r.path || []], o = {
|
|
4833
4634
|
...r,
|
|
4834
4635
|
path: a
|
|
@@ -4848,9 +4649,9 @@ const Ft = (n) => {
|
|
|
4848
4649
|
path: a,
|
|
4849
4650
|
message: c
|
|
4850
4651
|
};
|
|
4851
|
-
},
|
|
4652
|
+
}, Ka = [];
|
|
4852
4653
|
function m(n, e) {
|
|
4853
|
-
const t =
|
|
4654
|
+
const t = Vt(), s = Ut({
|
|
4854
4655
|
issueData: e,
|
|
4855
4656
|
data: n.data,
|
|
4856
4657
|
path: n.path,
|
|
@@ -4907,12 +4708,12 @@ class P {
|
|
|
4907
4708
|
}
|
|
4908
4709
|
const b = Object.freeze({
|
|
4909
4710
|
status: "aborted"
|
|
4910
|
-
}), Ve = (n) => ({ status: "dirty", value: n }), M = (n) => ({ status: "valid", value: n }),
|
|
4911
|
-
function
|
|
4711
|
+
}), Ve = (n) => ({ status: "dirty", value: n }), M = (n) => ({ status: "valid", value: n }), rn = (n) => n.status === "aborted", an = (n) => n.status === "dirty", mt = (n) => n.status === "valid", _t = (n) => typeof Promise < "u" && n instanceof Promise;
|
|
4712
|
+
function Ft(n, e, t, s) {
|
|
4912
4713
|
if (typeof e == "function" ? n !== e || !s : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4913
4714
|
return e.get(n);
|
|
4914
4715
|
}
|
|
4915
|
-
function
|
|
4716
|
+
function Mn(n, e, t, s, r) {
|
|
4916
4717
|
if (typeof e == "function" ? n !== e || !r : !e.has(n)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
4917
4718
|
return e.set(n, t), t;
|
|
4918
4719
|
}
|
|
@@ -4921,7 +4722,7 @@ var v;
|
|
|
4921
4722
|
n.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, n.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
4922
4723
|
})(v || (v = {}));
|
|
4923
4724
|
var Xe, et;
|
|
4924
|
-
class
|
|
4725
|
+
class te {
|
|
4925
4726
|
constructor(e, t, s, r) {
|
|
4926
4727
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = r;
|
|
4927
4728
|
}
|
|
@@ -4929,7 +4730,7 @@ class ne {
|
|
|
4929
4730
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
4930
4731
|
}
|
|
4931
4732
|
}
|
|
4932
|
-
const
|
|
4733
|
+
const gn = (n, e) => {
|
|
4933
4734
|
if (mt(e))
|
|
4934
4735
|
return { success: !0, data: e.value };
|
|
4935
4736
|
if (!n.common.issues.length)
|
|
@@ -4939,12 +4740,12 @@ const yn = (n, e) => {
|
|
|
4939
4740
|
get error() {
|
|
4940
4741
|
if (this._error)
|
|
4941
4742
|
return this._error;
|
|
4942
|
-
const t = new
|
|
4743
|
+
const t = new V(n.common.issues);
|
|
4943
4744
|
return this._error = t, this._error;
|
|
4944
4745
|
}
|
|
4945
4746
|
};
|
|
4946
4747
|
};
|
|
4947
|
-
function
|
|
4748
|
+
function O(n) {
|
|
4948
4749
|
if (!n)
|
|
4949
4750
|
return {};
|
|
4950
4751
|
const { errorMap: e, invalid_type_error: t, required_error: s, description: r } = n;
|
|
@@ -4956,7 +4757,7 @@ function S(n) {
|
|
|
4956
4757
|
return o.code === "invalid_enum_value" ? { message: l ?? c.defaultError } : typeof c.data > "u" ? { message: (d = l ?? s) !== null && d !== void 0 ? d : c.defaultError } : o.code !== "invalid_type" ? { message: c.defaultError } : { message: (u = l ?? t) !== null && u !== void 0 ? u : c.defaultError };
|
|
4957
4758
|
}, description: r };
|
|
4958
4759
|
}
|
|
4959
|
-
class
|
|
4760
|
+
class Z {
|
|
4960
4761
|
constructor(e) {
|
|
4961
4762
|
this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this);
|
|
4962
4763
|
}
|
|
@@ -4964,13 +4765,13 @@ class j {
|
|
|
4964
4765
|
return this._def.description;
|
|
4965
4766
|
}
|
|
4966
4767
|
_getType(e) {
|
|
4967
|
-
return
|
|
4768
|
+
return he(e.data);
|
|
4968
4769
|
}
|
|
4969
4770
|
_getOrReturnCtx(e, t) {
|
|
4970
4771
|
return t || {
|
|
4971
4772
|
common: e.parent.common,
|
|
4972
4773
|
data: e.data,
|
|
4973
|
-
parsedType:
|
|
4774
|
+
parsedType: he(e.data),
|
|
4974
4775
|
schemaErrorMap: this._def.errorMap,
|
|
4975
4776
|
path: e.path,
|
|
4976
4777
|
parent: e.parent
|
|
@@ -4982,7 +4783,7 @@ class j {
|
|
|
4982
4783
|
ctx: {
|
|
4983
4784
|
common: e.parent.common,
|
|
4984
4785
|
data: e.data,
|
|
4985
|
-
parsedType:
|
|
4786
|
+
parsedType: he(e.data),
|
|
4986
4787
|
schemaErrorMap: this._def.errorMap,
|
|
4987
4788
|
path: e.path,
|
|
4988
4789
|
parent: e.parent
|
|
@@ -5017,9 +4818,9 @@ class j {
|
|
|
5017
4818
|
schemaErrorMap: this._def.errorMap,
|
|
5018
4819
|
parent: null,
|
|
5019
4820
|
data: e,
|
|
5020
|
-
parsedType:
|
|
4821
|
+
parsedType: he(e)
|
|
5021
4822
|
}, a = this._parseSync({ data: e, path: r.path, parent: r });
|
|
5022
|
-
return
|
|
4823
|
+
return gn(r, a);
|
|
5023
4824
|
}
|
|
5024
4825
|
async parseAsync(e, t) {
|
|
5025
4826
|
const s = await this.safeParseAsync(e, t);
|
|
@@ -5038,9 +4839,9 @@ class j {
|
|
|
5038
4839
|
schemaErrorMap: this._def.errorMap,
|
|
5039
4840
|
parent: null,
|
|
5040
4841
|
data: e,
|
|
5041
|
-
parsedType:
|
|
4842
|
+
parsedType: he(e)
|
|
5042
4843
|
}, r = this._parse({ data: e, path: s.path, parent: s }), a = await (_t(r) ? r : Promise.resolve(r));
|
|
5043
|
-
return
|
|
4844
|
+
return gn(s, a);
|
|
5044
4845
|
}
|
|
5045
4846
|
refine(e, t) {
|
|
5046
4847
|
const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
|
|
@@ -5066,10 +4867,10 @@ class j {
|
|
|
5066
4867
|
return this._refinement(e);
|
|
5067
4868
|
}
|
|
5068
4869
|
optional() {
|
|
5069
|
-
return
|
|
4870
|
+
return G.create(this, this._def);
|
|
5070
4871
|
}
|
|
5071
4872
|
nullable() {
|
|
5072
|
-
return
|
|
4873
|
+
return ke.create(this, this._def);
|
|
5073
4874
|
}
|
|
5074
4875
|
nullish() {
|
|
5075
4876
|
return this.nullable().optional();
|
|
@@ -5088,7 +4889,7 @@ class j {
|
|
|
5088
4889
|
}
|
|
5089
4890
|
transform(e) {
|
|
5090
4891
|
return new J({
|
|
5091
|
-
...
|
|
4892
|
+
...O(this._def),
|
|
5092
4893
|
schema: this,
|
|
5093
4894
|
typeName: k.ZodEffects,
|
|
5094
4895
|
effect: { type: "transform", transform: e }
|
|
@@ -5097,23 +4898,23 @@ class j {
|
|
|
5097
4898
|
default(e) {
|
|
5098
4899
|
const t = typeof e == "function" ? e : () => e;
|
|
5099
4900
|
return new St({
|
|
5100
|
-
...
|
|
4901
|
+
...O(this._def),
|
|
5101
4902
|
innerType: this,
|
|
5102
4903
|
defaultValue: t,
|
|
5103
4904
|
typeName: k.ZodDefault
|
|
5104
4905
|
});
|
|
5105
4906
|
}
|
|
5106
4907
|
brand() {
|
|
5107
|
-
return new
|
|
4908
|
+
return new pn({
|
|
5108
4909
|
typeName: k.ZodBranded,
|
|
5109
4910
|
type: this,
|
|
5110
|
-
...
|
|
4911
|
+
...O(this._def)
|
|
5111
4912
|
});
|
|
5112
4913
|
}
|
|
5113
4914
|
catch(e) {
|
|
5114
4915
|
const t = typeof e == "function" ? e : () => e;
|
|
5115
4916
|
return new Zt({
|
|
5116
|
-
...
|
|
4917
|
+
...O(this._def),
|
|
5117
4918
|
innerType: this,
|
|
5118
4919
|
catchValue: t,
|
|
5119
4920
|
typeName: k.ZodCatch
|
|
@@ -5127,7 +4928,7 @@ class j {
|
|
|
5127
4928
|
});
|
|
5128
4929
|
}
|
|
5129
4930
|
pipe(e) {
|
|
5130
|
-
return
|
|
4931
|
+
return Ct.create(this, e);
|
|
5131
4932
|
}
|
|
5132
4933
|
readonly() {
|
|
5133
4934
|
return jt.create(this);
|
|
@@ -5139,25 +4940,25 @@ class j {
|
|
|
5139
4940
|
return this.safeParse(null).success;
|
|
5140
4941
|
}
|
|
5141
4942
|
}
|
|
5142
|
-
const
|
|
5143
|
-
let
|
|
5144
|
-
const
|
|
5145
|
-
function
|
|
4943
|
+
const Qa = /^c[^\s-]{8,}$/i, Ha = /^[0-9a-z]+$/, Ya = /^[0-9A-HJKMNP-TV-Z]{26}$/, Ga = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Xa = /^[a-z0-9_-]{21}$/i, ei = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, ti = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ni = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
4944
|
+
let Yt;
|
|
4945
|
+
const si = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ri = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, ai = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Ln = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", ii = new RegExp(`^${Ln}$`);
|
|
4946
|
+
function Vn(n) {
|
|
5146
4947
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
5147
4948
|
return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
5148
4949
|
}
|
|
5149
|
-
function
|
|
5150
|
-
return new RegExp(`^${
|
|
4950
|
+
function oi(n) {
|
|
4951
|
+
return new RegExp(`^${Vn(n)}$`);
|
|
5151
4952
|
}
|
|
5152
|
-
function
|
|
5153
|
-
let e = `${
|
|
4953
|
+
function Un(n) {
|
|
4954
|
+
let e = `${Ln}T${Vn(n)}`;
|
|
5154
4955
|
const t = [];
|
|
5155
4956
|
return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
5156
4957
|
}
|
|
5157
|
-
function
|
|
5158
|
-
return !!((e === "v4" || !e) &&
|
|
4958
|
+
function ci(n, e) {
|
|
4959
|
+
return !!((e === "v4" || !e) && si.test(n) || (e === "v6" || !e) && ri.test(n));
|
|
5159
4960
|
}
|
|
5160
|
-
class z extends
|
|
4961
|
+
class z extends Z {
|
|
5161
4962
|
_parse(e) {
|
|
5162
4963
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== g.string) {
|
|
5163
4964
|
const a = this._getOrReturnCtx(e);
|
|
@@ -5206,43 +5007,43 @@ class z extends j {
|
|
|
5206
5007
|
message: a.message
|
|
5207
5008
|
}), s.dirty());
|
|
5208
5009
|
} else if (a.kind === "email")
|
|
5209
|
-
|
|
5010
|
+
ti.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5210
5011
|
validation: "email",
|
|
5211
5012
|
code: h.invalid_string,
|
|
5212
5013
|
message: a.message
|
|
5213
5014
|
}), s.dirty());
|
|
5214
5015
|
else if (a.kind === "emoji")
|
|
5215
|
-
|
|
5016
|
+
Yt || (Yt = new RegExp(ni, "u")), Yt.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5216
5017
|
validation: "emoji",
|
|
5217
5018
|
code: h.invalid_string,
|
|
5218
5019
|
message: a.message
|
|
5219
5020
|
}), s.dirty());
|
|
5220
5021
|
else if (a.kind === "uuid")
|
|
5221
|
-
|
|
5022
|
+
Ga.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5222
5023
|
validation: "uuid",
|
|
5223
5024
|
code: h.invalid_string,
|
|
5224
5025
|
message: a.message
|
|
5225
5026
|
}), s.dirty());
|
|
5226
5027
|
else if (a.kind === "nanoid")
|
|
5227
|
-
|
|
5028
|
+
Xa.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5228
5029
|
validation: "nanoid",
|
|
5229
5030
|
code: h.invalid_string,
|
|
5230
5031
|
message: a.message
|
|
5231
5032
|
}), s.dirty());
|
|
5232
5033
|
else if (a.kind === "cuid")
|
|
5233
|
-
|
|
5034
|
+
Qa.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5234
5035
|
validation: "cuid",
|
|
5235
5036
|
code: h.invalid_string,
|
|
5236
5037
|
message: a.message
|
|
5237
5038
|
}), s.dirty());
|
|
5238
5039
|
else if (a.kind === "cuid2")
|
|
5239
|
-
|
|
5040
|
+
Ha.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5240
5041
|
validation: "cuid2",
|
|
5241
5042
|
code: h.invalid_string,
|
|
5242
5043
|
message: a.message
|
|
5243
5044
|
}), s.dirty());
|
|
5244
5045
|
else if (a.kind === "ulid")
|
|
5245
|
-
|
|
5046
|
+
Ya.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5246
5047
|
validation: "ulid",
|
|
5247
5048
|
code: h.invalid_string,
|
|
5248
5049
|
message: a.message
|
|
@@ -5273,31 +5074,31 @@ class z extends j {
|
|
|
5273
5074
|
code: h.invalid_string,
|
|
5274
5075
|
validation: { endsWith: a.value },
|
|
5275
5076
|
message: a.message
|
|
5276
|
-
}), s.dirty()) : a.kind === "datetime" ?
|
|
5077
|
+
}), s.dirty()) : a.kind === "datetime" ? Un(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5277
5078
|
code: h.invalid_string,
|
|
5278
5079
|
validation: "datetime",
|
|
5279
5080
|
message: a.message
|
|
5280
|
-
}), s.dirty()) : a.kind === "date" ?
|
|
5081
|
+
}), s.dirty()) : a.kind === "date" ? ii.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5281
5082
|
code: h.invalid_string,
|
|
5282
5083
|
validation: "date",
|
|
5283
5084
|
message: a.message
|
|
5284
|
-
}), s.dirty()) : a.kind === "time" ?
|
|
5085
|
+
}), s.dirty()) : a.kind === "time" ? oi(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5285
5086
|
code: h.invalid_string,
|
|
5286
5087
|
validation: "time",
|
|
5287
5088
|
message: a.message
|
|
5288
|
-
}), s.dirty()) : a.kind === "duration" ?
|
|
5089
|
+
}), s.dirty()) : a.kind === "duration" ? ei.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5289
5090
|
validation: "duration",
|
|
5290
5091
|
code: h.invalid_string,
|
|
5291
5092
|
message: a.message
|
|
5292
|
-
}), s.dirty()) : a.kind === "ip" ?
|
|
5093
|
+
}), s.dirty()) : a.kind === "ip" ? ci(e.data, a.version) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5293
5094
|
validation: "ip",
|
|
5294
5095
|
code: h.invalid_string,
|
|
5295
5096
|
message: a.message
|
|
5296
|
-
}), s.dirty()) : a.kind === "base64" ?
|
|
5097
|
+
}), s.dirty()) : a.kind === "base64" ? ai.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5297
5098
|
validation: "base64",
|
|
5298
5099
|
code: h.invalid_string,
|
|
5299
5100
|
message: a.message
|
|
5300
|
-
}), s.dirty()) :
|
|
5101
|
+
}), s.dirty()) : C.assertNever(a);
|
|
5301
5102
|
return { status: s.value, value: e.data };
|
|
5302
5103
|
}
|
|
5303
5104
|
_regex(e, t, s) {
|
|
@@ -5512,14 +5313,14 @@ z.create = (n) => {
|
|
|
5512
5313
|
checks: [],
|
|
5513
5314
|
typeName: k.ZodString,
|
|
5514
5315
|
coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
|
|
5515
|
-
...
|
|
5316
|
+
...O(n)
|
|
5516
5317
|
});
|
|
5517
5318
|
};
|
|
5518
|
-
function
|
|
5319
|
+
function di(n, e) {
|
|
5519
5320
|
const t = (n.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, r = t > s ? t : s, a = parseInt(n.toFixed(r).replace(".", "")), o = parseInt(e.toFixed(r).replace(".", ""));
|
|
5520
5321
|
return a % o / Math.pow(10, r);
|
|
5521
5322
|
}
|
|
5522
|
-
class
|
|
5323
|
+
class ye extends Z {
|
|
5523
5324
|
constructor() {
|
|
5524
5325
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
5525
5326
|
}
|
|
@@ -5535,7 +5336,7 @@ class ve extends j {
|
|
|
5535
5336
|
let s;
|
|
5536
5337
|
const r = new P();
|
|
5537
5338
|
for (const a of this._def.checks)
|
|
5538
|
-
a.kind === "int" ?
|
|
5339
|
+
a.kind === "int" ? C.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
5539
5340
|
code: h.invalid_type,
|
|
5540
5341
|
expected: "integer",
|
|
5541
5342
|
received: "float",
|
|
@@ -5554,14 +5355,14 @@ class ve extends j {
|
|
|
5554
5355
|
inclusive: a.inclusive,
|
|
5555
5356
|
exact: !1,
|
|
5556
5357
|
message: a.message
|
|
5557
|
-
}), r.dirty()) : a.kind === "multipleOf" ?
|
|
5358
|
+
}), r.dirty()) : a.kind === "multipleOf" ? di(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), m(s, {
|
|
5558
5359
|
code: h.not_multiple_of,
|
|
5559
5360
|
multipleOf: a.value,
|
|
5560
5361
|
message: a.message
|
|
5561
5362
|
}), r.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
5562
5363
|
code: h.not_finite,
|
|
5563
5364
|
message: a.message
|
|
5564
|
-
}), r.dirty()) :
|
|
5365
|
+
}), r.dirty()) : C.assertNever(a);
|
|
5565
5366
|
return { status: r.value, value: e.data };
|
|
5566
5367
|
}
|
|
5567
5368
|
gte(e, t) {
|
|
@@ -5577,7 +5378,7 @@ class ve extends j {
|
|
|
5577
5378
|
return this.setLimit("max", e, !1, v.toString(t));
|
|
5578
5379
|
}
|
|
5579
5380
|
setLimit(e, t, s, r) {
|
|
5580
|
-
return new
|
|
5381
|
+
return new ye({
|
|
5581
5382
|
...this._def,
|
|
5582
5383
|
checks: [
|
|
5583
5384
|
...this._def.checks,
|
|
@@ -5591,7 +5392,7 @@ class ve extends j {
|
|
|
5591
5392
|
});
|
|
5592
5393
|
}
|
|
5593
5394
|
_addCheck(e) {
|
|
5594
|
-
return new
|
|
5395
|
+
return new ye({
|
|
5595
5396
|
...this._def,
|
|
5596
5397
|
checks: [...this._def.checks, e]
|
|
5597
5398
|
});
|
|
@@ -5673,7 +5474,7 @@ class ve extends j {
|
|
|
5673
5474
|
return e;
|
|
5674
5475
|
}
|
|
5675
5476
|
get isInt() {
|
|
5676
|
-
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" &&
|
|
5477
|
+
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && C.isInteger(e.value));
|
|
5677
5478
|
}
|
|
5678
5479
|
get isFinite() {
|
|
5679
5480
|
let e = null, t = null;
|
|
@@ -5685,13 +5486,13 @@ class ve extends j {
|
|
|
5685
5486
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
5686
5487
|
}
|
|
5687
5488
|
}
|
|
5688
|
-
|
|
5489
|
+
ye.create = (n) => new ye({
|
|
5689
5490
|
checks: [],
|
|
5690
5491
|
typeName: k.ZodNumber,
|
|
5691
5492
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
5692
|
-
...
|
|
5493
|
+
...O(n)
|
|
5693
5494
|
});
|
|
5694
|
-
class
|
|
5495
|
+
class ve extends Z {
|
|
5695
5496
|
constructor() {
|
|
5696
5497
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
5697
5498
|
}
|
|
@@ -5723,7 +5524,7 @@ class we extends j {
|
|
|
5723
5524
|
code: h.not_multiple_of,
|
|
5724
5525
|
multipleOf: a.value,
|
|
5725
5526
|
message: a.message
|
|
5726
|
-
}), r.dirty()) :
|
|
5527
|
+
}), r.dirty()) : C.assertNever(a);
|
|
5727
5528
|
return { status: r.value, value: e.data };
|
|
5728
5529
|
}
|
|
5729
5530
|
gte(e, t) {
|
|
@@ -5739,7 +5540,7 @@ class we extends j {
|
|
|
5739
5540
|
return this.setLimit("max", e, !1, v.toString(t));
|
|
5740
5541
|
}
|
|
5741
5542
|
setLimit(e, t, s, r) {
|
|
5742
|
-
return new
|
|
5543
|
+
return new ve({
|
|
5743
5544
|
...this._def,
|
|
5744
5545
|
checks: [
|
|
5745
5546
|
...this._def.checks,
|
|
@@ -5753,7 +5554,7 @@ class we extends j {
|
|
|
5753
5554
|
});
|
|
5754
5555
|
}
|
|
5755
5556
|
_addCheck(e) {
|
|
5756
|
-
return new
|
|
5557
|
+
return new ve({
|
|
5757
5558
|
...this._def,
|
|
5758
5559
|
checks: [...this._def.checks, e]
|
|
5759
5560
|
});
|
|
@@ -5810,16 +5611,16 @@ class we extends j {
|
|
|
5810
5611
|
return e;
|
|
5811
5612
|
}
|
|
5812
5613
|
}
|
|
5813
|
-
|
|
5614
|
+
ve.create = (n) => {
|
|
5814
5615
|
var e;
|
|
5815
|
-
return new
|
|
5616
|
+
return new ve({
|
|
5816
5617
|
checks: [],
|
|
5817
5618
|
typeName: k.ZodBigInt,
|
|
5818
5619
|
coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
|
|
5819
|
-
...
|
|
5620
|
+
...O(n)
|
|
5820
5621
|
});
|
|
5821
5622
|
};
|
|
5822
|
-
class gt extends
|
|
5623
|
+
class gt extends Z {
|
|
5823
5624
|
_parse(e) {
|
|
5824
5625
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== g.boolean) {
|
|
5825
5626
|
const s = this._getOrReturnCtx(e);
|
|
@@ -5835,9 +5636,9 @@ class gt extends j {
|
|
|
5835
5636
|
gt.create = (n) => new gt({
|
|
5836
5637
|
typeName: k.ZodBoolean,
|
|
5837
5638
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
5838
|
-
...
|
|
5639
|
+
...O(n)
|
|
5839
5640
|
});
|
|
5840
|
-
class Ce extends
|
|
5641
|
+
class Ce extends Z {
|
|
5841
5642
|
_parse(e) {
|
|
5842
5643
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== g.date) {
|
|
5843
5644
|
const a = this._getOrReturnCtx(e);
|
|
@@ -5870,7 +5671,7 @@ class Ce extends j {
|
|
|
5870
5671
|
exact: !1,
|
|
5871
5672
|
maximum: a.value,
|
|
5872
5673
|
type: "date"
|
|
5873
|
-
}), s.dirty()) :
|
|
5674
|
+
}), s.dirty()) : C.assertNever(a);
|
|
5874
5675
|
return {
|
|
5875
5676
|
status: s.value,
|
|
5876
5677
|
value: new Date(e.data.getTime())
|
|
@@ -5913,9 +5714,9 @@ Ce.create = (n) => new Ce({
|
|
|
5913
5714
|
checks: [],
|
|
5914
5715
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
5915
5716
|
typeName: k.ZodDate,
|
|
5916
|
-
...
|
|
5717
|
+
...O(n)
|
|
5917
5718
|
});
|
|
5918
|
-
class
|
|
5719
|
+
class zt extends Z {
|
|
5919
5720
|
_parse(e) {
|
|
5920
5721
|
if (this._getType(e) !== g.symbol) {
|
|
5921
5722
|
const s = this._getOrReturnCtx(e);
|
|
@@ -5928,11 +5729,11 @@ class Bt extends j {
|
|
|
5928
5729
|
return M(e.data);
|
|
5929
5730
|
}
|
|
5930
5731
|
}
|
|
5931
|
-
|
|
5732
|
+
zt.create = (n) => new zt({
|
|
5932
5733
|
typeName: k.ZodSymbol,
|
|
5933
|
-
...
|
|
5734
|
+
...O(n)
|
|
5934
5735
|
});
|
|
5935
|
-
class yt extends
|
|
5736
|
+
class yt extends Z {
|
|
5936
5737
|
_parse(e) {
|
|
5937
5738
|
if (this._getType(e) !== g.undefined) {
|
|
5938
5739
|
const s = this._getOrReturnCtx(e);
|
|
@@ -5947,9 +5748,9 @@ class yt extends j {
|
|
|
5947
5748
|
}
|
|
5948
5749
|
yt.create = (n) => new yt({
|
|
5949
5750
|
typeName: k.ZodUndefined,
|
|
5950
|
-
...
|
|
5751
|
+
...O(n)
|
|
5951
5752
|
});
|
|
5952
|
-
class vt extends
|
|
5753
|
+
class vt extends Z {
|
|
5953
5754
|
_parse(e) {
|
|
5954
5755
|
if (this._getType(e) !== g.null) {
|
|
5955
5756
|
const s = this._getOrReturnCtx(e);
|
|
@@ -5964,9 +5765,9 @@ class vt extends j {
|
|
|
5964
5765
|
}
|
|
5965
5766
|
vt.create = (n) => new vt({
|
|
5966
5767
|
typeName: k.ZodNull,
|
|
5967
|
-
...
|
|
5768
|
+
...O(n)
|
|
5968
5769
|
});
|
|
5969
|
-
class Je extends
|
|
5770
|
+
class Je extends Z {
|
|
5970
5771
|
constructor() {
|
|
5971
5772
|
super(...arguments), this._any = !0;
|
|
5972
5773
|
}
|
|
@@ -5976,9 +5777,9 @@ class Je extends j {
|
|
|
5976
5777
|
}
|
|
5977
5778
|
Je.create = (n) => new Je({
|
|
5978
5779
|
typeName: k.ZodAny,
|
|
5979
|
-
...
|
|
5780
|
+
...O(n)
|
|
5980
5781
|
});
|
|
5981
|
-
class
|
|
5782
|
+
class Ze extends Z {
|
|
5982
5783
|
constructor() {
|
|
5983
5784
|
super(...arguments), this._unknown = !0;
|
|
5984
5785
|
}
|
|
@@ -5986,11 +5787,11 @@ class je extends j {
|
|
|
5986
5787
|
return M(e.data);
|
|
5987
5788
|
}
|
|
5988
5789
|
}
|
|
5989
|
-
|
|
5790
|
+
Ze.create = (n) => new Ze({
|
|
5990
5791
|
typeName: k.ZodUnknown,
|
|
5991
|
-
...
|
|
5792
|
+
...O(n)
|
|
5992
5793
|
});
|
|
5993
|
-
class
|
|
5794
|
+
class ae extends Z {
|
|
5994
5795
|
_parse(e) {
|
|
5995
5796
|
const t = this._getOrReturnCtx(e);
|
|
5996
5797
|
return m(t, {
|
|
@@ -6000,11 +5801,11 @@ class oe extends j {
|
|
|
6000
5801
|
}), b;
|
|
6001
5802
|
}
|
|
6002
5803
|
}
|
|
6003
|
-
|
|
5804
|
+
ae.create = (n) => new ae({
|
|
6004
5805
|
typeName: k.ZodNever,
|
|
6005
|
-
...
|
|
5806
|
+
...O(n)
|
|
6006
5807
|
});
|
|
6007
|
-
class
|
|
5808
|
+
class Bt extends Z {
|
|
6008
5809
|
_parse(e) {
|
|
6009
5810
|
if (this._getType(e) !== g.undefined) {
|
|
6010
5811
|
const s = this._getOrReturnCtx(e);
|
|
@@ -6017,11 +5818,11 @@ class Wt extends j {
|
|
|
6017
5818
|
return M(e.data);
|
|
6018
5819
|
}
|
|
6019
5820
|
}
|
|
6020
|
-
|
|
5821
|
+
Bt.create = (n) => new Bt({
|
|
6021
5822
|
typeName: k.ZodVoid,
|
|
6022
|
-
...
|
|
5823
|
+
...O(n)
|
|
6023
5824
|
});
|
|
6024
|
-
class W extends
|
|
5825
|
+
class W extends Z {
|
|
6025
5826
|
_parse(e) {
|
|
6026
5827
|
const { ctx: t, status: s } = this._processInputParams(e), r = this._def;
|
|
6027
5828
|
if (t.parsedType !== g.array)
|
|
@@ -6057,8 +5858,8 @@ class W extends j {
|
|
|
6057
5858
|
exact: !1,
|
|
6058
5859
|
message: r.maxLength.message
|
|
6059
5860
|
}), s.dirty()), t.common.async)
|
|
6060
|
-
return Promise.all([...t.data].map((o, c) => r.type._parseAsync(new
|
|
6061
|
-
const a = [...t.data].map((o, c) => r.type._parseSync(new
|
|
5861
|
+
return Promise.all([...t.data].map((o, c) => r.type._parseAsync(new te(t, o, t.path, c)))).then((o) => P.mergeArray(s, o));
|
|
5862
|
+
const a = [...t.data].map((o, c) => r.type._parseSync(new te(t, o, t.path, c)));
|
|
6062
5863
|
return P.mergeArray(s, a);
|
|
6063
5864
|
}
|
|
6064
5865
|
get element() {
|
|
@@ -6092,32 +5893,32 @@ W.create = (n, e) => new W({
|
|
|
6092
5893
|
maxLength: null,
|
|
6093
5894
|
exactLength: null,
|
|
6094
5895
|
typeName: k.ZodArray,
|
|
6095
|
-
...
|
|
5896
|
+
...O(e)
|
|
6096
5897
|
});
|
|
6097
5898
|
function Le(n) {
|
|
6098
|
-
if (n instanceof
|
|
5899
|
+
if (n instanceof E) {
|
|
6099
5900
|
const e = {};
|
|
6100
5901
|
for (const t in n.shape) {
|
|
6101
5902
|
const s = n.shape[t];
|
|
6102
|
-
e[t] =
|
|
5903
|
+
e[t] = G.create(Le(s));
|
|
6103
5904
|
}
|
|
6104
|
-
return new
|
|
5905
|
+
return new E({
|
|
6105
5906
|
...n._def,
|
|
6106
5907
|
shape: () => e
|
|
6107
5908
|
});
|
|
6108
5909
|
} else return n instanceof W ? new W({
|
|
6109
5910
|
...n._def,
|
|
6110
5911
|
type: Le(n.element)
|
|
6111
|
-
}) : n instanceof
|
|
5912
|
+
}) : n instanceof G ? G.create(Le(n.unwrap())) : n instanceof ke ? ke.create(Le(n.unwrap())) : n instanceof ne ? ne.create(n.items.map((e) => Le(e))) : n;
|
|
6112
5913
|
}
|
|
6113
|
-
class
|
|
5914
|
+
class E extends Z {
|
|
6114
5915
|
constructor() {
|
|
6115
5916
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
6116
5917
|
}
|
|
6117
5918
|
_getCached() {
|
|
6118
5919
|
if (this._cached !== null)
|
|
6119
5920
|
return this._cached;
|
|
6120
|
-
const e = this._def.shape(), t =
|
|
5921
|
+
const e = this._def.shape(), t = C.objectKeys(e);
|
|
6121
5922
|
return this._cached = { shape: e, keys: t };
|
|
6122
5923
|
}
|
|
6123
5924
|
_parse(e) {
|
|
@@ -6130,19 +5931,19 @@ class A extends j {
|
|
|
6130
5931
|
}), b;
|
|
6131
5932
|
}
|
|
6132
5933
|
const { status: s, ctx: r } = this._processInputParams(e), { shape: a, keys: o } = this._getCached(), c = [];
|
|
6133
|
-
if (!(this._def.catchall instanceof
|
|
5934
|
+
if (!(this._def.catchall instanceof ae && this._def.unknownKeys === "strip"))
|
|
6134
5935
|
for (const u in r.data)
|
|
6135
5936
|
o.includes(u) || c.push(u);
|
|
6136
5937
|
const d = [];
|
|
6137
5938
|
for (const u of o) {
|
|
6138
|
-
const l = a[u],
|
|
5939
|
+
const l = a[u], j = r.data[u];
|
|
6139
5940
|
d.push({
|
|
6140
5941
|
key: { status: "valid", value: u },
|
|
6141
|
-
value: l._parse(new
|
|
5942
|
+
value: l._parse(new te(r, j, r.path, u)),
|
|
6142
5943
|
alwaysSet: u in r.data
|
|
6143
5944
|
});
|
|
6144
5945
|
}
|
|
6145
|
-
if (this._def.catchall instanceof
|
|
5946
|
+
if (this._def.catchall instanceof ae) {
|
|
6146
5947
|
const u = this._def.unknownKeys;
|
|
6147
5948
|
if (u === "passthrough")
|
|
6148
5949
|
for (const l of c)
|
|
@@ -6159,11 +5960,11 @@ class A extends j {
|
|
|
6159
5960
|
} else {
|
|
6160
5961
|
const u = this._def.catchall;
|
|
6161
5962
|
for (const l of c) {
|
|
6162
|
-
const
|
|
5963
|
+
const j = r.data[l];
|
|
6163
5964
|
d.push({
|
|
6164
5965
|
key: { status: "valid", value: l },
|
|
6165
5966
|
value: u._parse(
|
|
6166
|
-
new
|
|
5967
|
+
new te(r, j, r.path, l)
|
|
6167
5968
|
//, ctx.child(key), value, getParsedType(value)
|
|
6168
5969
|
),
|
|
6169
5970
|
alwaysSet: l in r.data
|
|
@@ -6173,10 +5974,10 @@ class A extends j {
|
|
|
6173
5974
|
return r.common.async ? Promise.resolve().then(async () => {
|
|
6174
5975
|
const u = [];
|
|
6175
5976
|
for (const l of d) {
|
|
6176
|
-
const
|
|
5977
|
+
const j = await l.key, A = await l.value;
|
|
6177
5978
|
u.push({
|
|
6178
|
-
key:
|
|
6179
|
-
value:
|
|
5979
|
+
key: j,
|
|
5980
|
+
value: A,
|
|
6180
5981
|
alwaysSet: l.alwaysSet
|
|
6181
5982
|
});
|
|
6182
5983
|
}
|
|
@@ -6187,7 +5988,7 @@ class A extends j {
|
|
|
6187
5988
|
return this._def.shape();
|
|
6188
5989
|
}
|
|
6189
5990
|
strict(e) {
|
|
6190
|
-
return v.errToObj, new
|
|
5991
|
+
return v.errToObj, new E({
|
|
6191
5992
|
...this._def,
|
|
6192
5993
|
unknownKeys: "strict",
|
|
6193
5994
|
...e !== void 0 ? {
|
|
@@ -6204,13 +6005,13 @@ class A extends j {
|
|
|
6204
6005
|
});
|
|
6205
6006
|
}
|
|
6206
6007
|
strip() {
|
|
6207
|
-
return new
|
|
6008
|
+
return new E({
|
|
6208
6009
|
...this._def,
|
|
6209
6010
|
unknownKeys: "strip"
|
|
6210
6011
|
});
|
|
6211
6012
|
}
|
|
6212
6013
|
passthrough() {
|
|
6213
|
-
return new
|
|
6014
|
+
return new E({
|
|
6214
6015
|
...this._def,
|
|
6215
6016
|
unknownKeys: "passthrough"
|
|
6216
6017
|
});
|
|
@@ -6233,7 +6034,7 @@ class A extends j {
|
|
|
6233
6034
|
// }) as any;
|
|
6234
6035
|
// };
|
|
6235
6036
|
extend(e) {
|
|
6236
|
-
return new
|
|
6037
|
+
return new E({
|
|
6237
6038
|
...this._def,
|
|
6238
6039
|
shape: () => ({
|
|
6239
6040
|
...this._def.shape(),
|
|
@@ -6247,7 +6048,7 @@ class A extends j {
|
|
|
6247
6048
|
* upgrade if you are experiencing issues.
|
|
6248
6049
|
*/
|
|
6249
6050
|
merge(e) {
|
|
6250
|
-
return new
|
|
6051
|
+
return new E({
|
|
6251
6052
|
unknownKeys: e._def.unknownKeys,
|
|
6252
6053
|
catchall: e._def.catchall,
|
|
6253
6054
|
shape: () => ({
|
|
@@ -6317,25 +6118,25 @@ class A extends j {
|
|
|
6317
6118
|
// return merged;
|
|
6318
6119
|
// }
|
|
6319
6120
|
catchall(e) {
|
|
6320
|
-
return new
|
|
6121
|
+
return new E({
|
|
6321
6122
|
...this._def,
|
|
6322
6123
|
catchall: e
|
|
6323
6124
|
});
|
|
6324
6125
|
}
|
|
6325
6126
|
pick(e) {
|
|
6326
6127
|
const t = {};
|
|
6327
|
-
return
|
|
6128
|
+
return C.objectKeys(e).forEach((s) => {
|
|
6328
6129
|
e[s] && this.shape[s] && (t[s] = this.shape[s]);
|
|
6329
|
-
}), new
|
|
6130
|
+
}), new E({
|
|
6330
6131
|
...this._def,
|
|
6331
6132
|
shape: () => t
|
|
6332
6133
|
});
|
|
6333
6134
|
}
|
|
6334
6135
|
omit(e) {
|
|
6335
6136
|
const t = {};
|
|
6336
|
-
return
|
|
6137
|
+
return C.objectKeys(this.shape).forEach((s) => {
|
|
6337
6138
|
e[s] || (t[s] = this.shape[s]);
|
|
6338
|
-
}), new
|
|
6139
|
+
}), new E({
|
|
6339
6140
|
...this._def,
|
|
6340
6141
|
shape: () => t
|
|
6341
6142
|
});
|
|
@@ -6348,56 +6149,56 @@ class A extends j {
|
|
|
6348
6149
|
}
|
|
6349
6150
|
partial(e) {
|
|
6350
6151
|
const t = {};
|
|
6351
|
-
return
|
|
6152
|
+
return C.objectKeys(this.shape).forEach((s) => {
|
|
6352
6153
|
const r = this.shape[s];
|
|
6353
6154
|
e && !e[s] ? t[s] = r : t[s] = r.optional();
|
|
6354
|
-
}), new
|
|
6155
|
+
}), new E({
|
|
6355
6156
|
...this._def,
|
|
6356
6157
|
shape: () => t
|
|
6357
6158
|
});
|
|
6358
6159
|
}
|
|
6359
6160
|
required(e) {
|
|
6360
6161
|
const t = {};
|
|
6361
|
-
return
|
|
6162
|
+
return C.objectKeys(this.shape).forEach((s) => {
|
|
6362
6163
|
if (e && !e[s])
|
|
6363
6164
|
t[s] = this.shape[s];
|
|
6364
6165
|
else {
|
|
6365
6166
|
let a = this.shape[s];
|
|
6366
|
-
for (; a instanceof
|
|
6167
|
+
for (; a instanceof G; )
|
|
6367
6168
|
a = a._def.innerType;
|
|
6368
6169
|
t[s] = a;
|
|
6369
6170
|
}
|
|
6370
|
-
}), new
|
|
6171
|
+
}), new E({
|
|
6371
6172
|
...this._def,
|
|
6372
6173
|
shape: () => t
|
|
6373
6174
|
});
|
|
6374
6175
|
}
|
|
6375
6176
|
keyof() {
|
|
6376
|
-
return
|
|
6177
|
+
return Fn(C.objectKeys(this.shape));
|
|
6377
6178
|
}
|
|
6378
6179
|
}
|
|
6379
|
-
|
|
6180
|
+
E.create = (n, e) => new E({
|
|
6380
6181
|
shape: () => n,
|
|
6381
6182
|
unknownKeys: "strip",
|
|
6382
|
-
catchall:
|
|
6183
|
+
catchall: ae.create(),
|
|
6383
6184
|
typeName: k.ZodObject,
|
|
6384
|
-
...
|
|
6185
|
+
...O(e)
|
|
6385
6186
|
});
|
|
6386
|
-
|
|
6187
|
+
E.strictCreate = (n, e) => new E({
|
|
6387
6188
|
shape: () => n,
|
|
6388
6189
|
unknownKeys: "strict",
|
|
6389
|
-
catchall:
|
|
6190
|
+
catchall: ae.create(),
|
|
6390
6191
|
typeName: k.ZodObject,
|
|
6391
|
-
...
|
|
6192
|
+
...O(e)
|
|
6392
6193
|
});
|
|
6393
|
-
|
|
6194
|
+
E.lazycreate = (n, e) => new E({
|
|
6394
6195
|
shape: n,
|
|
6395
6196
|
unknownKeys: "strip",
|
|
6396
|
-
catchall:
|
|
6197
|
+
catchall: ae.create(),
|
|
6397
6198
|
typeName: k.ZodObject,
|
|
6398
|
-
...
|
|
6199
|
+
...O(e)
|
|
6399
6200
|
});
|
|
6400
|
-
class wt extends
|
|
6201
|
+
class wt extends Z {
|
|
6401
6202
|
_parse(e) {
|
|
6402
6203
|
const { ctx: t } = this._processInputParams(e), s = this._def.options;
|
|
6403
6204
|
function r(a) {
|
|
@@ -6407,7 +6208,7 @@ class wt extends j {
|
|
|
6407
6208
|
for (const c of a)
|
|
6408
6209
|
if (c.result.status === "dirty")
|
|
6409
6210
|
return t.common.issues.push(...c.ctx.common.issues), c.result;
|
|
6410
|
-
const o = a.map((c) => new
|
|
6211
|
+
const o = a.map((c) => new V(c.ctx.common.issues));
|
|
6411
6212
|
return m(t, {
|
|
6412
6213
|
code: h.invalid_union,
|
|
6413
6214
|
unionErrors: o
|
|
@@ -6454,7 +6255,7 @@ class wt extends j {
|
|
|
6454
6255
|
}
|
|
6455
6256
|
if (a)
|
|
6456
6257
|
return t.common.issues.push(...a.ctx.common.issues), a.result;
|
|
6457
|
-
const c = o.map((d) => new
|
|
6258
|
+
const c = o.map((d) => new V(d));
|
|
6458
6259
|
return m(t, {
|
|
6459
6260
|
code: h.invalid_union,
|
|
6460
6261
|
unionErrors: c
|
|
@@ -6468,10 +6269,10 @@ class wt extends j {
|
|
|
6468
6269
|
wt.create = (n, e) => new wt({
|
|
6469
6270
|
options: n,
|
|
6470
6271
|
typeName: k.ZodUnion,
|
|
6471
|
-
...
|
|
6272
|
+
...O(e)
|
|
6472
6273
|
});
|
|
6473
|
-
const
|
|
6474
|
-
class
|
|
6274
|
+
const se = (n) => n instanceof xt ? se(n.schema) : n instanceof J ? se(n.innerType()) : n instanceof Tt ? [n.value] : n instanceof we ? n.options : n instanceof Ot ? C.objectValues(n.enum) : n instanceof St ? se(n._def.innerType) : n instanceof yt ? [void 0] : n instanceof vt ? [null] : n instanceof G ? [void 0, ...se(n.unwrap())] : n instanceof ke ? [null, ...se(n.unwrap())] : n instanceof pn || n instanceof jt ? se(n.unwrap()) : n instanceof Zt ? se(n._def.innerType) : [];
|
|
6275
|
+
class Kt extends Z {
|
|
6475
6276
|
_parse(e) {
|
|
6476
6277
|
const { ctx: t } = this._processInputParams(e);
|
|
6477
6278
|
if (t.parsedType !== g.object)
|
|
@@ -6515,7 +6316,7 @@ class Ht extends j {
|
|
|
6515
6316
|
static create(e, t, s) {
|
|
6516
6317
|
const r = /* @__PURE__ */ new Map();
|
|
6517
6318
|
for (const a of t) {
|
|
6518
|
-
const o =
|
|
6319
|
+
const o = se(a.shape[e]);
|
|
6519
6320
|
if (!o.length)
|
|
6520
6321
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
6521
6322
|
for (const c of o) {
|
|
@@ -6524,23 +6325,23 @@ class Ht extends j {
|
|
|
6524
6325
|
r.set(c, a);
|
|
6525
6326
|
}
|
|
6526
6327
|
}
|
|
6527
|
-
return new
|
|
6328
|
+
return new Kt({
|
|
6528
6329
|
typeName: k.ZodDiscriminatedUnion,
|
|
6529
6330
|
discriminator: e,
|
|
6530
6331
|
options: t,
|
|
6531
6332
|
optionsMap: r,
|
|
6532
|
-
...
|
|
6333
|
+
...O(s)
|
|
6533
6334
|
});
|
|
6534
6335
|
}
|
|
6535
6336
|
}
|
|
6536
|
-
function
|
|
6537
|
-
const t =
|
|
6337
|
+
function on(n, e) {
|
|
6338
|
+
const t = he(n), s = he(e);
|
|
6538
6339
|
if (n === e)
|
|
6539
6340
|
return { valid: !0, data: n };
|
|
6540
6341
|
if (t === g.object && s === g.object) {
|
|
6541
|
-
const r =
|
|
6342
|
+
const r = C.objectKeys(e), a = C.objectKeys(n).filter((c) => r.indexOf(c) !== -1), o = { ...n, ...e };
|
|
6542
6343
|
for (const c of a) {
|
|
6543
|
-
const d =
|
|
6344
|
+
const d = on(n[c], e[c]);
|
|
6544
6345
|
if (!d.valid)
|
|
6545
6346
|
return { valid: !1 };
|
|
6546
6347
|
o[c] = d.data;
|
|
@@ -6551,7 +6352,7 @@ function cn(n, e) {
|
|
|
6551
6352
|
return { valid: !1 };
|
|
6552
6353
|
const r = [];
|
|
6553
6354
|
for (let a = 0; a < n.length; a++) {
|
|
6554
|
-
const o = n[a], c = e[a], d =
|
|
6355
|
+
const o = n[a], c = e[a], d = on(o, c);
|
|
6555
6356
|
if (!d.valid)
|
|
6556
6357
|
return { valid: !1 };
|
|
6557
6358
|
r.push(d.data);
|
|
@@ -6559,13 +6360,13 @@ function cn(n, e) {
|
|
|
6559
6360
|
return { valid: !0, data: r };
|
|
6560
6361
|
} else return t === g.date && s === g.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
|
|
6561
6362
|
}
|
|
6562
|
-
class kt extends
|
|
6363
|
+
class kt extends Z {
|
|
6563
6364
|
_parse(e) {
|
|
6564
6365
|
const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
|
|
6565
|
-
if (
|
|
6366
|
+
if (rn(a) || rn(o))
|
|
6566
6367
|
return b;
|
|
6567
|
-
const c =
|
|
6568
|
-
return c.valid ? ((
|
|
6368
|
+
const c = on(a.value, o.value);
|
|
6369
|
+
return c.valid ? ((an(a) || an(o)) && t.dirty(), { status: t.value, value: c.data }) : (m(s, {
|
|
6569
6370
|
code: h.invalid_intersection_types
|
|
6570
6371
|
}), b);
|
|
6571
6372
|
};
|
|
@@ -6595,9 +6396,9 @@ kt.create = (n, e, t) => new kt({
|
|
|
6595
6396
|
left: n,
|
|
6596
6397
|
right: e,
|
|
6597
6398
|
typeName: k.ZodIntersection,
|
|
6598
|
-
...
|
|
6399
|
+
...O(t)
|
|
6599
6400
|
});
|
|
6600
|
-
class
|
|
6401
|
+
class ne extends Z {
|
|
6601
6402
|
_parse(e) {
|
|
6602
6403
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
6603
6404
|
if (s.parsedType !== g.array)
|
|
@@ -6623,7 +6424,7 @@ class se extends j {
|
|
|
6623
6424
|
}), t.dirty());
|
|
6624
6425
|
const a = [...s.data].map((o, c) => {
|
|
6625
6426
|
const d = this._def.items[c] || this._def.rest;
|
|
6626
|
-
return d ? d._parse(new
|
|
6427
|
+
return d ? d._parse(new te(s, o, s.path, c)) : null;
|
|
6627
6428
|
}).filter((o) => !!o);
|
|
6628
6429
|
return s.common.async ? Promise.all(a).then((o) => P.mergeArray(t, o)) : P.mergeArray(t, a);
|
|
6629
6430
|
}
|
|
@@ -6631,23 +6432,23 @@ class se extends j {
|
|
|
6631
6432
|
return this._def.items;
|
|
6632
6433
|
}
|
|
6633
6434
|
rest(e) {
|
|
6634
|
-
return new
|
|
6435
|
+
return new ne({
|
|
6635
6436
|
...this._def,
|
|
6636
6437
|
rest: e
|
|
6637
6438
|
});
|
|
6638
6439
|
}
|
|
6639
6440
|
}
|
|
6640
|
-
|
|
6441
|
+
ne.create = (n, e) => {
|
|
6641
6442
|
if (!Array.isArray(n))
|
|
6642
6443
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
6643
|
-
return new
|
|
6444
|
+
return new ne({
|
|
6644
6445
|
items: n,
|
|
6645
6446
|
typeName: k.ZodTuple,
|
|
6646
6447
|
rest: null,
|
|
6647
|
-
...
|
|
6448
|
+
...O(e)
|
|
6648
6449
|
});
|
|
6649
6450
|
};
|
|
6650
|
-
class bt extends
|
|
6451
|
+
class bt extends Z {
|
|
6651
6452
|
get keySchema() {
|
|
6652
6453
|
return this._def.keyType;
|
|
6653
6454
|
}
|
|
@@ -6665,8 +6466,8 @@ class bt extends j {
|
|
|
6665
6466
|
const r = [], a = this._def.keyType, o = this._def.valueType;
|
|
6666
6467
|
for (const c in s.data)
|
|
6667
6468
|
r.push({
|
|
6668
|
-
key: a._parse(new
|
|
6669
|
-
value: o._parse(new
|
|
6469
|
+
key: a._parse(new te(s, c, s.path, c)),
|
|
6470
|
+
value: o._parse(new te(s, s.data[c], s.path, c)),
|
|
6670
6471
|
alwaysSet: c in s.data
|
|
6671
6472
|
});
|
|
6672
6473
|
return s.common.async ? P.mergeObjectAsync(t, r) : P.mergeObjectSync(t, r);
|
|
@@ -6675,20 +6476,20 @@ class bt extends j {
|
|
|
6675
6476
|
return this._def.valueType;
|
|
6676
6477
|
}
|
|
6677
6478
|
static create(e, t, s) {
|
|
6678
|
-
return t instanceof
|
|
6479
|
+
return t instanceof Z ? new bt({
|
|
6679
6480
|
keyType: e,
|
|
6680
6481
|
valueType: t,
|
|
6681
6482
|
typeName: k.ZodRecord,
|
|
6682
|
-
...
|
|
6483
|
+
...O(s)
|
|
6683
6484
|
}) : new bt({
|
|
6684
6485
|
keyType: z.create(),
|
|
6685
6486
|
valueType: e,
|
|
6686
6487
|
typeName: k.ZodRecord,
|
|
6687
|
-
...
|
|
6488
|
+
...O(t)
|
|
6688
6489
|
});
|
|
6689
6490
|
}
|
|
6690
6491
|
}
|
|
6691
|
-
class
|
|
6492
|
+
class Wt extends Z {
|
|
6692
6493
|
get keySchema() {
|
|
6693
6494
|
return this._def.keyType;
|
|
6694
6495
|
}
|
|
@@ -6704,8 +6505,8 @@ class qt extends j {
|
|
|
6704
6505
|
received: s.parsedType
|
|
6705
6506
|
}), b;
|
|
6706
6507
|
const r = this._def.keyType, a = this._def.valueType, o = [...s.data.entries()].map(([c, d], u) => ({
|
|
6707
|
-
key: r._parse(new
|
|
6708
|
-
value: a._parse(new
|
|
6508
|
+
key: r._parse(new te(s, c, s.path, [u, "key"])),
|
|
6509
|
+
value: a._parse(new te(s, d, s.path, [u, "value"]))
|
|
6709
6510
|
}));
|
|
6710
6511
|
if (s.common.async) {
|
|
6711
6512
|
const c = /* @__PURE__ */ new Map();
|
|
@@ -6730,13 +6531,13 @@ class qt extends j {
|
|
|
6730
6531
|
}
|
|
6731
6532
|
}
|
|
6732
6533
|
}
|
|
6733
|
-
|
|
6534
|
+
Wt.create = (n, e, t) => new Wt({
|
|
6734
6535
|
valueType: e,
|
|
6735
6536
|
keyType: n,
|
|
6736
6537
|
typeName: k.ZodMap,
|
|
6737
|
-
...
|
|
6538
|
+
...O(t)
|
|
6738
6539
|
});
|
|
6739
|
-
class
|
|
6540
|
+
class Ie extends Z {
|
|
6740
6541
|
_parse(e) {
|
|
6741
6542
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
6742
6543
|
if (s.parsedType !== g.set)
|
|
@@ -6771,17 +6572,17 @@ class Ee extends j {
|
|
|
6771
6572
|
}
|
|
6772
6573
|
return { status: t.value, value: u };
|
|
6773
6574
|
}
|
|
6774
|
-
const c = [...s.data.values()].map((d, u) => a._parse(new
|
|
6575
|
+
const c = [...s.data.values()].map((d, u) => a._parse(new te(s, d, s.path, u)));
|
|
6775
6576
|
return s.common.async ? Promise.all(c).then((d) => o(d)) : o(c);
|
|
6776
6577
|
}
|
|
6777
6578
|
min(e, t) {
|
|
6778
|
-
return new
|
|
6579
|
+
return new Ie({
|
|
6779
6580
|
...this._def,
|
|
6780
6581
|
minSize: { value: e, message: v.toString(t) }
|
|
6781
6582
|
});
|
|
6782
6583
|
}
|
|
6783
6584
|
max(e, t) {
|
|
6784
|
-
return new
|
|
6585
|
+
return new Ie({
|
|
6785
6586
|
...this._def,
|
|
6786
6587
|
maxSize: { value: e, message: v.toString(t) }
|
|
6787
6588
|
});
|
|
@@ -6793,14 +6594,14 @@ class Ee extends j {
|
|
|
6793
6594
|
return this.min(1, e);
|
|
6794
6595
|
}
|
|
6795
6596
|
}
|
|
6796
|
-
|
|
6597
|
+
Ie.create = (n, e) => new Ie({
|
|
6797
6598
|
valueType: n,
|
|
6798
6599
|
minSize: null,
|
|
6799
6600
|
maxSize: null,
|
|
6800
6601
|
typeName: k.ZodSet,
|
|
6801
|
-
...
|
|
6602
|
+
...O(e)
|
|
6802
6603
|
});
|
|
6803
|
-
class Fe extends
|
|
6604
|
+
class Fe extends Z {
|
|
6804
6605
|
constructor() {
|
|
6805
6606
|
super(...arguments), this.validate = this.implement;
|
|
6806
6607
|
}
|
|
@@ -6813,13 +6614,13 @@ class Fe extends j {
|
|
|
6813
6614
|
received: t.parsedType
|
|
6814
6615
|
}), b;
|
|
6815
6616
|
function s(c, d) {
|
|
6816
|
-
return
|
|
6617
|
+
return Ut({
|
|
6817
6618
|
data: c,
|
|
6818
6619
|
path: t.path,
|
|
6819
6620
|
errorMaps: [
|
|
6820
6621
|
t.common.contextualErrorMap,
|
|
6821
6622
|
t.schemaErrorMap,
|
|
6822
|
-
|
|
6623
|
+
Vt(),
|
|
6823
6624
|
qe
|
|
6824
6625
|
].filter((u) => !!u),
|
|
6825
6626
|
issueData: {
|
|
@@ -6829,13 +6630,13 @@ class Fe extends j {
|
|
|
6829
6630
|
});
|
|
6830
6631
|
}
|
|
6831
6632
|
function r(c, d) {
|
|
6832
|
-
return
|
|
6633
|
+
return Ut({
|
|
6833
6634
|
data: c,
|
|
6834
6635
|
path: t.path,
|
|
6835
6636
|
errorMaps: [
|
|
6836
6637
|
t.common.contextualErrorMap,
|
|
6837
6638
|
t.schemaErrorMap,
|
|
6838
|
-
|
|
6639
|
+
Vt(),
|
|
6839
6640
|
qe
|
|
6840
6641
|
].filter((u) => !!u),
|
|
6841
6642
|
issueData: {
|
|
@@ -6848,11 +6649,11 @@ class Fe extends j {
|
|
|
6848
6649
|
if (this._def.returns instanceof Ke) {
|
|
6849
6650
|
const c = this;
|
|
6850
6651
|
return M(async function(...d) {
|
|
6851
|
-
const u = new
|
|
6852
|
-
throw u.addIssue(s(d,
|
|
6853
|
-
}),
|
|
6854
|
-
return await c._def.returns._def.type.parseAsync(
|
|
6855
|
-
throw u.addIssue(r(
|
|
6652
|
+
const u = new V([]), l = await c._def.args.parseAsync(d, a).catch((U) => {
|
|
6653
|
+
throw u.addIssue(s(d, U)), u;
|
|
6654
|
+
}), j = await Reflect.apply(o, this, l);
|
|
6655
|
+
return await c._def.returns._def.type.parseAsync(j, a).catch((U) => {
|
|
6656
|
+
throw u.addIssue(r(j, U)), u;
|
|
6856
6657
|
});
|
|
6857
6658
|
});
|
|
6858
6659
|
} else {
|
|
@@ -6860,11 +6661,11 @@ class Fe extends j {
|
|
|
6860
6661
|
return M(function(...d) {
|
|
6861
6662
|
const u = c._def.args.safeParse(d, a);
|
|
6862
6663
|
if (!u.success)
|
|
6863
|
-
throw new
|
|
6864
|
-
const l = Reflect.apply(o, this, u.data),
|
|
6865
|
-
if (!
|
|
6866
|
-
throw new
|
|
6867
|
-
return
|
|
6664
|
+
throw new V([s(d, u.error)]);
|
|
6665
|
+
const l = Reflect.apply(o, this, u.data), j = c._def.returns.safeParse(l, a);
|
|
6666
|
+
if (!j.success)
|
|
6667
|
+
throw new V([r(l, j.error)]);
|
|
6668
|
+
return j.data;
|
|
6868
6669
|
});
|
|
6869
6670
|
}
|
|
6870
6671
|
}
|
|
@@ -6877,7 +6678,7 @@ class Fe extends j {
|
|
|
6877
6678
|
args(...e) {
|
|
6878
6679
|
return new Fe({
|
|
6879
6680
|
...this._def,
|
|
6880
|
-
args:
|
|
6681
|
+
args: ne.create(e).rest(Ze.create())
|
|
6881
6682
|
});
|
|
6882
6683
|
}
|
|
6883
6684
|
returns(e) {
|
|
@@ -6894,14 +6695,14 @@ class Fe extends j {
|
|
|
6894
6695
|
}
|
|
6895
6696
|
static create(e, t, s) {
|
|
6896
6697
|
return new Fe({
|
|
6897
|
-
args: e ||
|
|
6898
|
-
returns: t ||
|
|
6698
|
+
args: e || ne.create([]).rest(Ze.create()),
|
|
6699
|
+
returns: t || Ze.create(),
|
|
6899
6700
|
typeName: k.ZodFunction,
|
|
6900
|
-
...
|
|
6701
|
+
...O(s)
|
|
6901
6702
|
});
|
|
6902
6703
|
}
|
|
6903
6704
|
}
|
|
6904
|
-
class xt extends
|
|
6705
|
+
class xt extends Z {
|
|
6905
6706
|
get schema() {
|
|
6906
6707
|
return this._def.getter();
|
|
6907
6708
|
}
|
|
@@ -6913,9 +6714,9 @@ class xt extends j {
|
|
|
6913
6714
|
xt.create = (n, e) => new xt({
|
|
6914
6715
|
getter: n,
|
|
6915
6716
|
typeName: k.ZodLazy,
|
|
6916
|
-
...
|
|
6717
|
+
...O(e)
|
|
6917
6718
|
});
|
|
6918
|
-
class Tt extends
|
|
6719
|
+
class Tt extends Z {
|
|
6919
6720
|
_parse(e) {
|
|
6920
6721
|
if (e.data !== this._def.value) {
|
|
6921
6722
|
const t = this._getOrReturnCtx(e);
|
|
@@ -6934,16 +6735,16 @@ class Tt extends j {
|
|
|
6934
6735
|
Tt.create = (n, e) => new Tt({
|
|
6935
6736
|
value: n,
|
|
6936
6737
|
typeName: k.ZodLiteral,
|
|
6937
|
-
...
|
|
6738
|
+
...O(e)
|
|
6938
6739
|
});
|
|
6939
|
-
function
|
|
6940
|
-
return new
|
|
6740
|
+
function Fn(n, e) {
|
|
6741
|
+
return new we({
|
|
6941
6742
|
values: n,
|
|
6942
6743
|
typeName: k.ZodEnum,
|
|
6943
|
-
...
|
|
6744
|
+
...O(e)
|
|
6944
6745
|
});
|
|
6945
6746
|
}
|
|
6946
|
-
class
|
|
6747
|
+
class we extends Z {
|
|
6947
6748
|
constructor() {
|
|
6948
6749
|
super(...arguments), Xe.set(this, void 0);
|
|
6949
6750
|
}
|
|
@@ -6951,12 +6752,12 @@ class ke extends j {
|
|
|
6951
6752
|
if (typeof e.data != "string") {
|
|
6952
6753
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
6953
6754
|
return m(t, {
|
|
6954
|
-
expected:
|
|
6755
|
+
expected: C.joinValues(s),
|
|
6955
6756
|
received: t.parsedType,
|
|
6956
6757
|
code: h.invalid_type
|
|
6957
6758
|
}), b;
|
|
6958
6759
|
}
|
|
6959
|
-
if (
|
|
6760
|
+
if (Ft(this, Xe) || Mn(this, Xe, new Set(this._def.values)), !Ft(this, Xe).has(e.data)) {
|
|
6960
6761
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
6961
6762
|
return m(t, {
|
|
6962
6763
|
received: t.data,
|
|
@@ -6988,36 +6789,36 @@ class ke extends j {
|
|
|
6988
6789
|
return e;
|
|
6989
6790
|
}
|
|
6990
6791
|
extract(e, t = this._def) {
|
|
6991
|
-
return
|
|
6792
|
+
return we.create(e, {
|
|
6992
6793
|
...this._def,
|
|
6993
6794
|
...t
|
|
6994
6795
|
});
|
|
6995
6796
|
}
|
|
6996
6797
|
exclude(e, t = this._def) {
|
|
6997
|
-
return
|
|
6798
|
+
return we.create(this.options.filter((s) => !e.includes(s)), {
|
|
6998
6799
|
...this._def,
|
|
6999
6800
|
...t
|
|
7000
6801
|
});
|
|
7001
6802
|
}
|
|
7002
6803
|
}
|
|
7003
6804
|
Xe = /* @__PURE__ */ new WeakMap();
|
|
7004
|
-
|
|
7005
|
-
class Ot extends
|
|
6805
|
+
we.create = Fn;
|
|
6806
|
+
class Ot extends Z {
|
|
7006
6807
|
constructor() {
|
|
7007
6808
|
super(...arguments), et.set(this, void 0);
|
|
7008
6809
|
}
|
|
7009
6810
|
_parse(e) {
|
|
7010
|
-
const t =
|
|
6811
|
+
const t = C.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
7011
6812
|
if (s.parsedType !== g.string && s.parsedType !== g.number) {
|
|
7012
|
-
const r =
|
|
6813
|
+
const r = C.objectValues(t);
|
|
7013
6814
|
return m(s, {
|
|
7014
|
-
expected:
|
|
6815
|
+
expected: C.joinValues(r),
|
|
7015
6816
|
received: s.parsedType,
|
|
7016
6817
|
code: h.invalid_type
|
|
7017
6818
|
}), b;
|
|
7018
6819
|
}
|
|
7019
|
-
if (
|
|
7020
|
-
const r =
|
|
6820
|
+
if (Ft(this, et) || Mn(this, et, new Set(C.getValidEnumValues(this._def.values))), !Ft(this, et).has(e.data)) {
|
|
6821
|
+
const r = C.objectValues(t);
|
|
7021
6822
|
return m(s, {
|
|
7022
6823
|
received: s.data,
|
|
7023
6824
|
code: h.invalid_enum_value,
|
|
@@ -7034,9 +6835,9 @@ et = /* @__PURE__ */ new WeakMap();
|
|
|
7034
6835
|
Ot.create = (n, e) => new Ot({
|
|
7035
6836
|
values: n,
|
|
7036
6837
|
typeName: k.ZodNativeEnum,
|
|
7037
|
-
...
|
|
6838
|
+
...O(e)
|
|
7038
6839
|
});
|
|
7039
|
-
class Ke extends
|
|
6840
|
+
class Ke extends Z {
|
|
7040
6841
|
unwrap() {
|
|
7041
6842
|
return this._def.type;
|
|
7042
6843
|
}
|
|
@@ -7058,9 +6859,9 @@ class Ke extends j {
|
|
|
7058
6859
|
Ke.create = (n, e) => new Ke({
|
|
7059
6860
|
type: n,
|
|
7060
6861
|
typeName: k.ZodPromise,
|
|
7061
|
-
...
|
|
6862
|
+
...O(e)
|
|
7062
6863
|
});
|
|
7063
|
-
class J extends
|
|
6864
|
+
class J extends Z {
|
|
7064
6865
|
innerType() {
|
|
7065
6866
|
return this._def.schema;
|
|
7066
6867
|
}
|
|
@@ -7134,22 +6935,22 @@ class J extends j {
|
|
|
7134
6935
|
return { status: t.value, value: c };
|
|
7135
6936
|
} else
|
|
7136
6937
|
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => mt(o) ? Promise.resolve(r.transform(o.value, a)).then((c) => ({ status: t.value, value: c })) : o);
|
|
7137
|
-
|
|
6938
|
+
C.assertNever(r);
|
|
7138
6939
|
}
|
|
7139
6940
|
}
|
|
7140
6941
|
J.create = (n, e, t) => new J({
|
|
7141
6942
|
schema: n,
|
|
7142
6943
|
typeName: k.ZodEffects,
|
|
7143
6944
|
effect: e,
|
|
7144
|
-
...
|
|
6945
|
+
...O(t)
|
|
7145
6946
|
});
|
|
7146
6947
|
J.createWithPreprocess = (n, e, t) => new J({
|
|
7147
6948
|
schema: e,
|
|
7148
6949
|
effect: { type: "preprocess", transform: n },
|
|
7149
6950
|
typeName: k.ZodEffects,
|
|
7150
|
-
...
|
|
6951
|
+
...O(t)
|
|
7151
6952
|
});
|
|
7152
|
-
class
|
|
6953
|
+
class G extends Z {
|
|
7153
6954
|
_parse(e) {
|
|
7154
6955
|
return this._getType(e) === g.undefined ? M(void 0) : this._def.innerType._parse(e);
|
|
7155
6956
|
}
|
|
@@ -7157,12 +6958,12 @@ class X extends j {
|
|
|
7157
6958
|
return this._def.innerType;
|
|
7158
6959
|
}
|
|
7159
6960
|
}
|
|
7160
|
-
|
|
6961
|
+
G.create = (n, e) => new G({
|
|
7161
6962
|
innerType: n,
|
|
7162
6963
|
typeName: k.ZodOptional,
|
|
7163
|
-
...
|
|
6964
|
+
...O(e)
|
|
7164
6965
|
});
|
|
7165
|
-
class
|
|
6966
|
+
class ke extends Z {
|
|
7166
6967
|
_parse(e) {
|
|
7167
6968
|
return this._getType(e) === g.null ? M(null) : this._def.innerType._parse(e);
|
|
7168
6969
|
}
|
|
@@ -7170,12 +6971,12 @@ class be extends j {
|
|
|
7170
6971
|
return this._def.innerType;
|
|
7171
6972
|
}
|
|
7172
6973
|
}
|
|
7173
|
-
|
|
6974
|
+
ke.create = (n, e) => new ke({
|
|
7174
6975
|
innerType: n,
|
|
7175
6976
|
typeName: k.ZodNullable,
|
|
7176
|
-
...
|
|
6977
|
+
...O(e)
|
|
7177
6978
|
});
|
|
7178
|
-
class St extends
|
|
6979
|
+
class St extends Z {
|
|
7179
6980
|
_parse(e) {
|
|
7180
6981
|
const { ctx: t } = this._processInputParams(e);
|
|
7181
6982
|
let s = t.data;
|
|
@@ -7193,9 +6994,9 @@ St.create = (n, e) => new St({
|
|
|
7193
6994
|
innerType: n,
|
|
7194
6995
|
typeName: k.ZodDefault,
|
|
7195
6996
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
7196
|
-
...
|
|
6997
|
+
...O(e)
|
|
7197
6998
|
});
|
|
7198
|
-
class Zt extends
|
|
6999
|
+
class Zt extends Z {
|
|
7199
7000
|
_parse(e) {
|
|
7200
7001
|
const { ctx: t } = this._processInputParams(e), s = {
|
|
7201
7002
|
...t,
|
|
@@ -7214,7 +7015,7 @@ class Zt extends j {
|
|
|
7214
7015
|
status: "valid",
|
|
7215
7016
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
7216
7017
|
get error() {
|
|
7217
|
-
return new
|
|
7018
|
+
return new V(s.common.issues);
|
|
7218
7019
|
},
|
|
7219
7020
|
input: s.data
|
|
7220
7021
|
})
|
|
@@ -7222,7 +7023,7 @@ class Zt extends j {
|
|
|
7222
7023
|
status: "valid",
|
|
7223
7024
|
value: r.status === "valid" ? r.value : this._def.catchValue({
|
|
7224
7025
|
get error() {
|
|
7225
|
-
return new
|
|
7026
|
+
return new V(s.common.issues);
|
|
7226
7027
|
},
|
|
7227
7028
|
input: s.data
|
|
7228
7029
|
})
|
|
@@ -7236,9 +7037,9 @@ Zt.create = (n, e) => new Zt({
|
|
|
7236
7037
|
innerType: n,
|
|
7237
7038
|
typeName: k.ZodCatch,
|
|
7238
7039
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
7239
|
-
...
|
|
7040
|
+
...O(e)
|
|
7240
7041
|
});
|
|
7241
|
-
class
|
|
7042
|
+
class qt extends Z {
|
|
7242
7043
|
_parse(e) {
|
|
7243
7044
|
if (this._getType(e) !== g.nan) {
|
|
7244
7045
|
const s = this._getOrReturnCtx(e);
|
|
@@ -7251,12 +7052,12 @@ class Jt extends j {
|
|
|
7251
7052
|
return { status: "valid", value: e.data };
|
|
7252
7053
|
}
|
|
7253
7054
|
}
|
|
7254
|
-
|
|
7055
|
+
qt.create = (n) => new qt({
|
|
7255
7056
|
typeName: k.ZodNaN,
|
|
7256
|
-
...
|
|
7057
|
+
...O(n)
|
|
7257
7058
|
});
|
|
7258
|
-
const
|
|
7259
|
-
class
|
|
7059
|
+
const ui = Symbol("zod_brand");
|
|
7060
|
+
class pn extends Z {
|
|
7260
7061
|
_parse(e) {
|
|
7261
7062
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
7262
7063
|
return this._def.type._parse({
|
|
@@ -7269,7 +7070,7 @@ class hn extends j {
|
|
|
7269
7070
|
return this._def.type;
|
|
7270
7071
|
}
|
|
7271
7072
|
}
|
|
7272
|
-
class
|
|
7073
|
+
class Ct extends Z {
|
|
7273
7074
|
_parse(e) {
|
|
7274
7075
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
7275
7076
|
if (s.common.async)
|
|
@@ -7302,14 +7103,14 @@ class It extends j {
|
|
|
7302
7103
|
}
|
|
7303
7104
|
}
|
|
7304
7105
|
static create(e, t) {
|
|
7305
|
-
return new
|
|
7106
|
+
return new Ct({
|
|
7306
7107
|
in: e,
|
|
7307
7108
|
out: t,
|
|
7308
7109
|
typeName: k.ZodPipeline
|
|
7309
7110
|
});
|
|
7310
7111
|
}
|
|
7311
7112
|
}
|
|
7312
|
-
class jt extends
|
|
7113
|
+
class jt extends Z {
|
|
7313
7114
|
_parse(e) {
|
|
7314
7115
|
const t = this._def.innerType._parse(e), s = (r) => (mt(r) && (r.value = Object.freeze(r.value)), r);
|
|
7315
7116
|
return _t(t) ? t.then((r) => s(r)) : s(t);
|
|
@@ -7321,9 +7122,9 @@ class jt extends j {
|
|
|
7321
7122
|
jt.create = (n, e) => new jt({
|
|
7322
7123
|
innerType: n,
|
|
7323
7124
|
typeName: k.ZodReadonly,
|
|
7324
|
-
...
|
|
7125
|
+
...O(e)
|
|
7325
7126
|
});
|
|
7326
|
-
function
|
|
7127
|
+
function zn(n, e = {}, t) {
|
|
7327
7128
|
return n ? Je.create().superRefine((s, r) => {
|
|
7328
7129
|
var a, o;
|
|
7329
7130
|
if (!n(s)) {
|
|
@@ -7332,151 +7133,151 @@ function Bn(n, e = {}, t) {
|
|
|
7332
7133
|
}
|
|
7333
7134
|
}) : Je.create();
|
|
7334
7135
|
}
|
|
7335
|
-
const
|
|
7336
|
-
object:
|
|
7136
|
+
const li = {
|
|
7137
|
+
object: E.lazycreate
|
|
7337
7138
|
};
|
|
7338
7139
|
var k;
|
|
7339
7140
|
(function(n) {
|
|
7340
7141
|
n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
|
|
7341
7142
|
})(k || (k = {}));
|
|
7342
|
-
const
|
|
7143
|
+
const pi = (n, e = {
|
|
7343
7144
|
message: `Input not instance of ${n.name}`
|
|
7344
|
-
}) =>
|
|
7145
|
+
}) => zn((t) => t instanceof n, e), Bn = z.create, Wn = ye.create, hi = qt.create, fi = ve.create, qn = gt.create, mi = Ce.create, _i = zt.create, gi = yt.create, yi = vt.create, vi = Je.create, wi = Ze.create, ki = ae.create, bi = Bt.create, xi = W.create, Ti = E.create, Oi = E.strictCreate, Si = wt.create, Zi = Kt.create, ji = kt.create, Ni = ne.create, Ci = bt.create, Ii = Wt.create, Ei = Ie.create, Ai = Fe.create, Ri = xt.create, $i = Tt.create, Pi = we.create, Di = Ot.create, Mi = Ke.create, yn = J.create, Li = G.create, Vi = ke.create, Ui = J.createWithPreprocess, Fi = Ct.create, zi = () => Bn().optional(), Bi = () => Wn().optional(), Wi = () => qn().optional(), qi = {
|
|
7345
7146
|
string: (n) => z.create({ ...n, coerce: !0 }),
|
|
7346
|
-
number: (n) =>
|
|
7147
|
+
number: (n) => ye.create({ ...n, coerce: !0 }),
|
|
7347
7148
|
boolean: (n) => gt.create({
|
|
7348
7149
|
...n,
|
|
7349
7150
|
coerce: !0
|
|
7350
7151
|
}),
|
|
7351
|
-
bigint: (n) =>
|
|
7152
|
+
bigint: (n) => ve.create({ ...n, coerce: !0 }),
|
|
7352
7153
|
date: (n) => Ce.create({ ...n, coerce: !0 })
|
|
7353
|
-
},
|
|
7354
|
-
var
|
|
7154
|
+
}, Ji = b;
|
|
7155
|
+
var Ki = /* @__PURE__ */ Object.freeze({
|
|
7355
7156
|
__proto__: null,
|
|
7356
7157
|
defaultErrorMap: qe,
|
|
7357
|
-
setErrorMap:
|
|
7358
|
-
getErrorMap:
|
|
7359
|
-
makeIssue:
|
|
7360
|
-
EMPTY_PATH:
|
|
7158
|
+
setErrorMap: Ja,
|
|
7159
|
+
getErrorMap: Vt,
|
|
7160
|
+
makeIssue: Ut,
|
|
7161
|
+
EMPTY_PATH: Ka,
|
|
7361
7162
|
addIssueToContext: m,
|
|
7362
7163
|
ParseStatus: P,
|
|
7363
7164
|
INVALID: b,
|
|
7364
7165
|
DIRTY: Ve,
|
|
7365
7166
|
OK: M,
|
|
7366
|
-
isAborted:
|
|
7367
|
-
isDirty:
|
|
7167
|
+
isAborted: rn,
|
|
7168
|
+
isDirty: an,
|
|
7368
7169
|
isValid: mt,
|
|
7369
7170
|
isAsync: _t,
|
|
7370
7171
|
get util() {
|
|
7371
|
-
return
|
|
7172
|
+
return C;
|
|
7372
7173
|
},
|
|
7373
7174
|
get objectUtil() {
|
|
7374
|
-
return
|
|
7175
|
+
return sn;
|
|
7375
7176
|
},
|
|
7376
7177
|
ZodParsedType: g,
|
|
7377
|
-
getParsedType:
|
|
7378
|
-
ZodType:
|
|
7379
|
-
datetimeRegex:
|
|
7178
|
+
getParsedType: he,
|
|
7179
|
+
ZodType: Z,
|
|
7180
|
+
datetimeRegex: Un,
|
|
7380
7181
|
ZodString: z,
|
|
7381
|
-
ZodNumber:
|
|
7382
|
-
ZodBigInt:
|
|
7182
|
+
ZodNumber: ye,
|
|
7183
|
+
ZodBigInt: ve,
|
|
7383
7184
|
ZodBoolean: gt,
|
|
7384
7185
|
ZodDate: Ce,
|
|
7385
|
-
ZodSymbol:
|
|
7186
|
+
ZodSymbol: zt,
|
|
7386
7187
|
ZodUndefined: yt,
|
|
7387
7188
|
ZodNull: vt,
|
|
7388
7189
|
ZodAny: Je,
|
|
7389
|
-
ZodUnknown:
|
|
7390
|
-
ZodNever:
|
|
7391
|
-
ZodVoid:
|
|
7190
|
+
ZodUnknown: Ze,
|
|
7191
|
+
ZodNever: ae,
|
|
7192
|
+
ZodVoid: Bt,
|
|
7392
7193
|
ZodArray: W,
|
|
7393
|
-
ZodObject:
|
|
7194
|
+
ZodObject: E,
|
|
7394
7195
|
ZodUnion: wt,
|
|
7395
|
-
ZodDiscriminatedUnion:
|
|
7196
|
+
ZodDiscriminatedUnion: Kt,
|
|
7396
7197
|
ZodIntersection: kt,
|
|
7397
|
-
ZodTuple:
|
|
7198
|
+
ZodTuple: ne,
|
|
7398
7199
|
ZodRecord: bt,
|
|
7399
|
-
ZodMap:
|
|
7400
|
-
ZodSet:
|
|
7200
|
+
ZodMap: Wt,
|
|
7201
|
+
ZodSet: Ie,
|
|
7401
7202
|
ZodFunction: Fe,
|
|
7402
7203
|
ZodLazy: xt,
|
|
7403
7204
|
ZodLiteral: Tt,
|
|
7404
|
-
ZodEnum:
|
|
7205
|
+
ZodEnum: we,
|
|
7405
7206
|
ZodNativeEnum: Ot,
|
|
7406
7207
|
ZodPromise: Ke,
|
|
7407
7208
|
ZodEffects: J,
|
|
7408
7209
|
ZodTransformer: J,
|
|
7409
|
-
ZodOptional:
|
|
7410
|
-
ZodNullable:
|
|
7210
|
+
ZodOptional: G,
|
|
7211
|
+
ZodNullable: ke,
|
|
7411
7212
|
ZodDefault: St,
|
|
7412
7213
|
ZodCatch: Zt,
|
|
7413
|
-
ZodNaN:
|
|
7414
|
-
BRAND:
|
|
7415
|
-
ZodBranded:
|
|
7416
|
-
ZodPipeline:
|
|
7214
|
+
ZodNaN: qt,
|
|
7215
|
+
BRAND: ui,
|
|
7216
|
+
ZodBranded: pn,
|
|
7217
|
+
ZodPipeline: Ct,
|
|
7417
7218
|
ZodReadonly: jt,
|
|
7418
|
-
custom:
|
|
7419
|
-
Schema:
|
|
7420
|
-
ZodSchema:
|
|
7421
|
-
late:
|
|
7219
|
+
custom: zn,
|
|
7220
|
+
Schema: Z,
|
|
7221
|
+
ZodSchema: Z,
|
|
7222
|
+
late: li,
|
|
7422
7223
|
get ZodFirstPartyTypeKind() {
|
|
7423
7224
|
return k;
|
|
7424
7225
|
},
|
|
7425
|
-
coerce:
|
|
7426
|
-
any:
|
|
7427
|
-
array:
|
|
7428
|
-
bigint:
|
|
7429
|
-
boolean:
|
|
7430
|
-
date:
|
|
7431
|
-
discriminatedUnion:
|
|
7432
|
-
effect:
|
|
7433
|
-
enum:
|
|
7434
|
-
function:
|
|
7435
|
-
instanceof:
|
|
7436
|
-
intersection:
|
|
7437
|
-
lazy:
|
|
7438
|
-
literal:
|
|
7439
|
-
map:
|
|
7440
|
-
nan:
|
|
7441
|
-
nativeEnum:
|
|
7442
|
-
never:
|
|
7443
|
-
null:
|
|
7444
|
-
nullable:
|
|
7445
|
-
number:
|
|
7446
|
-
object:
|
|
7447
|
-
oboolean:
|
|
7448
|
-
onumber:
|
|
7449
|
-
optional:
|
|
7450
|
-
ostring:
|
|
7451
|
-
pipeline:
|
|
7452
|
-
preprocess:
|
|
7453
|
-
promise:
|
|
7454
|
-
record:
|
|
7455
|
-
set:
|
|
7456
|
-
strictObject:
|
|
7457
|
-
string:
|
|
7458
|
-
symbol:
|
|
7459
|
-
transformer:
|
|
7460
|
-
tuple:
|
|
7461
|
-
undefined:
|
|
7462
|
-
union:
|
|
7463
|
-
unknown:
|
|
7464
|
-
void:
|
|
7465
|
-
NEVER:
|
|
7226
|
+
coerce: qi,
|
|
7227
|
+
any: vi,
|
|
7228
|
+
array: xi,
|
|
7229
|
+
bigint: fi,
|
|
7230
|
+
boolean: qn,
|
|
7231
|
+
date: mi,
|
|
7232
|
+
discriminatedUnion: Zi,
|
|
7233
|
+
effect: yn,
|
|
7234
|
+
enum: Pi,
|
|
7235
|
+
function: Ai,
|
|
7236
|
+
instanceof: pi,
|
|
7237
|
+
intersection: ji,
|
|
7238
|
+
lazy: Ri,
|
|
7239
|
+
literal: $i,
|
|
7240
|
+
map: Ii,
|
|
7241
|
+
nan: hi,
|
|
7242
|
+
nativeEnum: Di,
|
|
7243
|
+
never: ki,
|
|
7244
|
+
null: yi,
|
|
7245
|
+
nullable: Vi,
|
|
7246
|
+
number: Wn,
|
|
7247
|
+
object: Ti,
|
|
7248
|
+
oboolean: Wi,
|
|
7249
|
+
onumber: Bi,
|
|
7250
|
+
optional: Li,
|
|
7251
|
+
ostring: zi,
|
|
7252
|
+
pipeline: Fi,
|
|
7253
|
+
preprocess: Ui,
|
|
7254
|
+
promise: Mi,
|
|
7255
|
+
record: Ci,
|
|
7256
|
+
set: Ei,
|
|
7257
|
+
strictObject: Oi,
|
|
7258
|
+
string: Bn,
|
|
7259
|
+
symbol: _i,
|
|
7260
|
+
transformer: yn,
|
|
7261
|
+
tuple: Ni,
|
|
7262
|
+
undefined: gi,
|
|
7263
|
+
union: Si,
|
|
7264
|
+
unknown: wi,
|
|
7265
|
+
void: bi,
|
|
7266
|
+
NEVER: Ji,
|
|
7466
7267
|
ZodIssueCode: h,
|
|
7467
|
-
quotelessJson:
|
|
7468
|
-
ZodError:
|
|
7268
|
+
quotelessJson: qa,
|
|
7269
|
+
ZodError: V
|
|
7469
7270
|
});
|
|
7470
|
-
|
|
7471
|
-
function
|
|
7271
|
+
Wa(Ki);
|
|
7272
|
+
function It(n, e = "", t = {}) {
|
|
7472
7273
|
for (let s in n)
|
|
7473
7274
|
if (Object.prototype.hasOwnProperty.call(n, s)) {
|
|
7474
7275
|
const r = e ? `${e}_${s}` : s;
|
|
7475
|
-
typeof n[s] == "object" && n[s] !== null && !Array.isArray(n[s]) ?
|
|
7276
|
+
typeof n[s] == "object" && n[s] !== null && !Array.isArray(n[s]) ? It(n[s], r, t) : t[r] = n[s];
|
|
7476
7277
|
}
|
|
7477
7278
|
return t;
|
|
7478
7279
|
}
|
|
7479
|
-
function
|
|
7280
|
+
function Qi(n, e) {
|
|
7480
7281
|
const t = {};
|
|
7481
7282
|
for (const [s, r] of Object.entries(n)) {
|
|
7482
7283
|
const a = e.find(
|
|
@@ -7494,99 +7295,96 @@ function uo(n, e) {
|
|
|
7494
7295
|
}
|
|
7495
7296
|
return t;
|
|
7496
7297
|
}
|
|
7497
|
-
function
|
|
7298
|
+
function Hi(n) {
|
|
7498
7299
|
return async (e, t) => {
|
|
7499
7300
|
const s = {
|
|
7500
|
-
themeId:
|
|
7301
|
+
themeId: Ae(),
|
|
7501
7302
|
...t,
|
|
7502
7303
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7503
7304
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7504
7305
|
};
|
|
7505
|
-
return await n.insertInto("themes").values({ ...
|
|
7306
|
+
return await n.insertInto("themes").values({ ...It(s), tenant_id: e }).execute(), s;
|
|
7506
7307
|
};
|
|
7507
7308
|
}
|
|
7508
|
-
function
|
|
7309
|
+
function Yi(n) {
|
|
7509
7310
|
return async (e, t) => (await n.deleteFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
7510
7311
|
}
|
|
7511
|
-
function
|
|
7312
|
+
function Gi(n) {
|
|
7512
7313
|
return async (e, t) => {
|
|
7513
7314
|
const s = await n.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", t).selectAll().executeTakeFirst();
|
|
7514
7315
|
return s ? R(s) : null;
|
|
7515
7316
|
};
|
|
7516
7317
|
}
|
|
7517
|
-
function
|
|
7318
|
+
function Xi(n) {
|
|
7518
7319
|
return async (e, t, s) => {
|
|
7519
|
-
const r =
|
|
7320
|
+
const r = It({
|
|
7520
7321
|
...s,
|
|
7521
7322
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7522
7323
|
});
|
|
7523
7324
|
return await n.updateTable("themes").set(r).where("themes.id", "=", t).where("themes.tenant_id", "=", e).execute(), !0;
|
|
7524
7325
|
};
|
|
7525
7326
|
}
|
|
7526
|
-
function
|
|
7327
|
+
function eo(n) {
|
|
7527
7328
|
return {
|
|
7528
|
-
create:
|
|
7529
|
-
get:
|
|
7530
|
-
remove:
|
|
7531
|
-
update:
|
|
7329
|
+
create: Hi(n),
|
|
7330
|
+
get: Gi(n),
|
|
7331
|
+
remove: Yi(n),
|
|
7332
|
+
update: Xi(n)
|
|
7532
7333
|
};
|
|
7533
7334
|
}
|
|
7534
|
-
function
|
|
7335
|
+
function to(n) {
|
|
7535
7336
|
return async (e, t) => {
|
|
7536
7337
|
const s = (/* @__PURE__ */ new Date()).toISOString(), r = await n.selectFrom("logins").where("logins.expires_at", ">", s).where("logins.login_id", "=", t).selectAll().executeTakeFirst();
|
|
7537
7338
|
return r ? vr.parse(
|
|
7538
|
-
|
|
7339
|
+
Qi(R(r), ["authParams"])
|
|
7539
7340
|
) : null;
|
|
7540
7341
|
};
|
|
7541
7342
|
}
|
|
7542
|
-
function
|
|
7343
|
+
function no(n) {
|
|
7543
7344
|
return async (e, t) => {
|
|
7544
7345
|
const s = {
|
|
7545
|
-
login_id:
|
|
7346
|
+
login_id: Ae(),
|
|
7546
7347
|
...t,
|
|
7547
7348
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7548
7349
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7549
7350
|
};
|
|
7550
|
-
return await n.insertInto("logins").values({ ...
|
|
7351
|
+
return await n.insertInto("logins").values({ ...It(s), tenant_id: e }).execute(), s;
|
|
7551
7352
|
};
|
|
7552
7353
|
}
|
|
7553
|
-
function
|
|
7554
|
-
return async (e, t, s) => (await n.updateTable("logins").set(
|
|
7354
|
+
function so(n) {
|
|
7355
|
+
return async (e, t, s) => (await n.updateTable("logins").set(It(s)).where("logins.login_id", "=", t).where("logins.tenant_id", "=", e).execute()).length === 1;
|
|
7555
7356
|
}
|
|
7556
|
-
function
|
|
7357
|
+
function ro(n) {
|
|
7557
7358
|
return async (e, t) => (await n.deleteFrom("logins").where("logins.tenant_id", "=", e).where("logins.login_id", "=", t).execute()).length > 0;
|
|
7558
7359
|
}
|
|
7559
|
-
function
|
|
7360
|
+
function ao(n) {
|
|
7560
7361
|
return {
|
|
7561
|
-
create:
|
|
7562
|
-
get:
|
|
7563
|
-
update:
|
|
7564
|
-
remove:
|
|
7362
|
+
create: no(n),
|
|
7363
|
+
get: to(n),
|
|
7364
|
+
update: so(n),
|
|
7365
|
+
remove: ro(n)
|
|
7565
7366
|
};
|
|
7566
7367
|
}
|
|
7567
|
-
function
|
|
7368
|
+
function oo(n) {
|
|
7568
7369
|
return {
|
|
7569
|
-
applications:
|
|
7570
|
-
|
|
7571
|
-
|
|
7572
|
-
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
|
|
7577
|
-
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
|
|
7583
|
-
|
|
7584
|
-
|
|
7585
|
-
themes: mo(n),
|
|
7586
|
-
tickets: oa(n),
|
|
7587
|
-
universalLoginSessions: Ta(n)
|
|
7370
|
+
applications: va(n),
|
|
7371
|
+
branding: Pa(n),
|
|
7372
|
+
clients: Sa(n),
|
|
7373
|
+
codes: ha(n),
|
|
7374
|
+
connections: Oa(n),
|
|
7375
|
+
domains: Aa(n),
|
|
7376
|
+
hooks: Fa(n),
|
|
7377
|
+
keys: Ca(n),
|
|
7378
|
+
logins: ao(n),
|
|
7379
|
+
logs: Kr(n),
|
|
7380
|
+
passwords: ca(n),
|
|
7381
|
+
users: Pr(n),
|
|
7382
|
+
sessions: ea(n),
|
|
7383
|
+
tenants: zr(n),
|
|
7384
|
+
themes: eo(n),
|
|
7385
|
+
tickets: ra(n)
|
|
7588
7386
|
};
|
|
7589
7387
|
}
|
|
7590
7388
|
export {
|
|
7591
|
-
|
|
7389
|
+
oo as default
|
|
7592
7390
|
};
|