@authhero/kysely-adapter 0.4.3 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kysely-adapter.cjs +1 -1
- package/dist/kysely-adapter.d.ts +171 -175
- package/dist/kysely-adapter.iife.js +1 -1
- package/dist/kysely-adapter.mjs +861 -812
- package/package.json +2 -2
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var xt = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
2
|
+
var Tt = (n, e, t) => e in n ? xt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var ze = (n, e, t) => Tt(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
var Ie = 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
|
+
ze(this, "res");
|
|
8
|
+
ze(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 je = class extends Error {
|
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
function
|
|
20
|
+
function Ot(n) {
|
|
21
21
|
return async (e, t) => {
|
|
22
22
|
const { identities: s, ...r } = t, a = {
|
|
23
23
|
...r,
|
|
@@ -30,7 +30,7 @@ function Tt(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 Ie(409, { message: "User already exists" }) : (console.log(o.message), new Ie(500, { message: `${o.code}, ${o.message}` }));
|
|
34
34
|
}
|
|
35
35
|
return {
|
|
36
36
|
...a,
|
|
@@ -47,7 +47,7 @@ function S(n) {
|
|
|
47
47
|
e[t] === null ? delete e[t] : typeof e[t] == "object" && (Array.isArray(e[t]) ? e[t] = e[t].map(S) : e[t] = S(e[t]));
|
|
48
48
|
return e;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function St(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,46 +55,46 @@ function Ot(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 Zt(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
|
}
|
|
62
|
-
function
|
|
62
|
+
function oe(n, e) {
|
|
63
63
|
const t = n.ZodType.prototype[e];
|
|
64
64
|
n.ZodType.prototype[e] = function(...s) {
|
|
65
65
|
const r = t.apply(this, s);
|
|
66
66
|
return r._def.openapi = this._def.openapi, r;
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function jt(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,
|
|
74
|
-
const O = typeof r == "string" ? a : r, U = O ?? {}, { param: z } = U,
|
|
75
|
-
param: Object.assign(Object.assign({}, (k = (
|
|
76
|
-
} : void 0),
|
|
77
|
-
if (
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
var Q,
|
|
81
|
-
const
|
|
82
|
-
return
|
|
73
|
+
var o, c, u, d, _, k;
|
|
74
|
+
const O = typeof r == "string" ? a : r, U = O ?? {}, { param: z } = U, V = St(U, ["param"]), re = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), ie = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), V), !((d = (u = this._def.openapi) === null || u === void 0 ? void 0 : u.metadata) === null || d === void 0) && d.param || z ? {
|
|
75
|
+
param: Object.assign(Object.assign({}, (k = (_ = this._def.openapi) === null || _ === void 0 ? void 0 : _.metadata) === null || k === void 0 ? void 0 : k.param), z)
|
|
76
|
+
} : void 0), ae = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(re).length > 0 ? { _internal: re } : void 0), Object.keys(ie).length > 0 ? { metadata: ie } : void 0) }));
|
|
77
|
+
if (Zt(this, "ZodObject")) {
|
|
78
|
+
const Se = this.extend;
|
|
79
|
+
ae.extend = function(...Ze) {
|
|
80
|
+
var Q, J, H, je, Me, Le;
|
|
81
|
+
const Ue = Se.apply(this, Ze);
|
|
82
|
+
return Ue._def.openapi = {
|
|
83
83
|
_internal: {
|
|
84
|
-
extendedFrom: !((
|
|
84
|
+
extendedFrom: !((J = (Q = this._def.openapi) === null || Q === void 0 ? void 0 : Q._internal) === null || J === void 0) && J.refId ? { refId: (je = (H = this._def.openapi) === null || H === void 0 ? void 0 : H._internal) === null || je === void 0 ? void 0 : je.refId, schema: this } : (Me = this._def.openapi) === null || Me === void 0 ? void 0 : Me._internal.extendedFrom
|
|
85
85
|
},
|
|
86
|
-
metadata: (
|
|
87
|
-
},
|
|
86
|
+
metadata: (Le = Ue._def.openapi) === null || Le === void 0 ? void 0 : Le.metadata
|
|
87
|
+
}, Ue;
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
return
|
|
91
|
-
},
|
|
90
|
+
return ae;
|
|
91
|
+
}, oe(n, "optional"), oe(n, "nullable"), oe(n, "default"), oe(n, "transform"), oe(n, "refine");
|
|
92
92
|
const e = n.ZodObject.prototype.deepPartial;
|
|
93
93
|
n.ZodObject.prototype.deepPartial = function() {
|
|
94
94
|
const r = this._def.shape(), a = e.apply(this), o = a._def.shape();
|
|
95
|
-
return Object.entries(o).forEach(([c,
|
|
96
|
-
var
|
|
97
|
-
|
|
95
|
+
return Object.entries(o).forEach(([c, u]) => {
|
|
96
|
+
var d, _;
|
|
97
|
+
u._def.openapi = (_ = (d = r[c]) === null || d === void 0 ? void 0 : d._def) === null || _ === void 0 ? void 0 : _.openapi;
|
|
98
98
|
}), a._def.openapi = void 0, a;
|
|
99
99
|
};
|
|
100
100
|
const t = n.ZodObject.prototype.pick;
|
|
@@ -145,15 +145,15 @@ var w;
|
|
|
145
145
|
}
|
|
146
146
|
n.joinValues = s, n.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
|
|
147
147
|
})(w || (w = {}));
|
|
148
|
-
var
|
|
148
|
+
var Be;
|
|
149
149
|
(function(n) {
|
|
150
150
|
n.mergeShapes = (e, t) => ({
|
|
151
151
|
...e,
|
|
152
152
|
...t
|
|
153
153
|
// second overwrites first
|
|
154
154
|
});
|
|
155
|
-
})(
|
|
156
|
-
const
|
|
155
|
+
})(Be || (Be = {}));
|
|
156
|
+
const h = w.arrayToEnum([
|
|
157
157
|
"string",
|
|
158
158
|
"nan",
|
|
159
159
|
"number",
|
|
@@ -177,23 +177,23 @@ const _ = w.arrayToEnum([
|
|
|
177
177
|
]), R = (n) => {
|
|
178
178
|
switch (typeof n) {
|
|
179
179
|
case "undefined":
|
|
180
|
-
return
|
|
180
|
+
return h.undefined;
|
|
181
181
|
case "string":
|
|
182
|
-
return
|
|
182
|
+
return h.string;
|
|
183
183
|
case "number":
|
|
184
|
-
return isNaN(n) ?
|
|
184
|
+
return isNaN(n) ? h.nan : h.number;
|
|
185
185
|
case "boolean":
|
|
186
|
-
return
|
|
186
|
+
return h.boolean;
|
|
187
187
|
case "function":
|
|
188
|
-
return
|
|
188
|
+
return h.function;
|
|
189
189
|
case "bigint":
|
|
190
|
-
return
|
|
190
|
+
return h.bigint;
|
|
191
191
|
case "symbol":
|
|
192
|
-
return
|
|
192
|
+
return h.symbol;
|
|
193
193
|
case "object":
|
|
194
|
-
return Array.isArray(n) ?
|
|
194
|
+
return Array.isArray(n) ? h.array : n === null ? h.null : n.then && typeof n.then == "function" && n.catch && typeof n.catch == "function" ? h.promise : typeof Map < "u" && n instanceof Map ? h.map : typeof Set < "u" && n instanceof Set ? h.set : typeof Date < "u" && n instanceof Date ? h.date : h.object;
|
|
195
195
|
default:
|
|
196
|
-
return
|
|
196
|
+
return h.unknown;
|
|
197
197
|
}
|
|
198
198
|
}, l = w.arrayToEnum([
|
|
199
199
|
"invalid_type",
|
|
@@ -212,7 +212,7 @@ const _ = w.arrayToEnum([
|
|
|
212
212
|
"invalid_intersection_types",
|
|
213
213
|
"not_multiple_of",
|
|
214
214
|
"not_finite"
|
|
215
|
-
]),
|
|
215
|
+
]), It = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
216
216
|
class Z extends Error {
|
|
217
217
|
constructor(e) {
|
|
218
218
|
super(), this.issues = [], this.addIssue = (s) => {
|
|
@@ -240,10 +240,10 @@ class Z extends Error {
|
|
|
240
240
|
else if (o.path.length === 0)
|
|
241
241
|
s._errors.push(t(o));
|
|
242
242
|
else {
|
|
243
|
-
let c = s,
|
|
244
|
-
for (;
|
|
245
|
-
const
|
|
246
|
-
|
|
243
|
+
let c = s, u = 0;
|
|
244
|
+
for (; u < o.path.length; ) {
|
|
245
|
+
const d = o.path[u];
|
|
246
|
+
u === o.path.length - 1 ? (c[d] = c[d] || { _errors: [] }, c[d]._errors.push(t(o))) : c[d] = c[d] || { _errors: [] }, c = c[d], u++;
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
};
|
|
@@ -273,11 +273,11 @@ class Z extends Error {
|
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
Z.create = (n) => new Z(n);
|
|
276
|
-
const
|
|
276
|
+
const ee = (n, e) => {
|
|
277
277
|
let t;
|
|
278
278
|
switch (n.code) {
|
|
279
279
|
case l.invalid_type:
|
|
280
|
-
n.received ===
|
|
280
|
+
n.received === h.undefined ? t = "Required" : t = `Expected ${n.expected}, received ${n.received}`;
|
|
281
281
|
break;
|
|
282
282
|
case l.invalid_literal:
|
|
283
283
|
t = `Invalid literal value, expected ${JSON.stringify(n.expected, w.jsonStringifyReplacer)}`;
|
|
@@ -329,14 +329,14 @@ const X = (n, e) => {
|
|
|
329
329
|
}
|
|
330
330
|
return { message: t };
|
|
331
331
|
};
|
|
332
|
-
let
|
|
333
|
-
function
|
|
334
|
-
|
|
332
|
+
let it = ee;
|
|
333
|
+
function At(n) {
|
|
334
|
+
it = n;
|
|
335
335
|
}
|
|
336
|
-
function
|
|
337
|
-
return
|
|
336
|
+
function Ae() {
|
|
337
|
+
return it;
|
|
338
338
|
}
|
|
339
|
-
const
|
|
339
|
+
const Ce = (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
|
|
@@ -348,17 +348,17 @@ const Ae = (n) => {
|
|
|
348
348
|
message: r.message
|
|
349
349
|
};
|
|
350
350
|
let c = "";
|
|
351
|
-
const
|
|
352
|
-
for (const
|
|
353
|
-
c =
|
|
351
|
+
const u = s.filter((d) => !!d).slice().reverse();
|
|
352
|
+
for (const d of u)
|
|
353
|
+
c = d(o, { data: e, defaultError: c }).message;
|
|
354
354
|
return {
|
|
355
355
|
...r,
|
|
356
356
|
path: a,
|
|
357
357
|
message: c
|
|
358
358
|
};
|
|
359
|
-
},
|
|
359
|
+
}, Ct = [];
|
|
360
360
|
function p(n, e) {
|
|
361
|
-
const t =
|
|
361
|
+
const t = Ae(), s = Ce({
|
|
362
362
|
issueData: e,
|
|
363
363
|
data: n.data,
|
|
364
364
|
path: n.path,
|
|
@@ -366,13 +366,13 @@ function p(n, e) {
|
|
|
366
366
|
n.common.contextualErrorMap,
|
|
367
367
|
n.schemaErrorMap,
|
|
368
368
|
t,
|
|
369
|
-
t ===
|
|
369
|
+
t === ee ? void 0 : ee
|
|
370
370
|
// then global default map
|
|
371
371
|
].filter((r) => !!r)
|
|
372
372
|
});
|
|
373
373
|
n.common.issues.push(s);
|
|
374
374
|
}
|
|
375
|
-
class
|
|
375
|
+
class x {
|
|
376
376
|
constructor() {
|
|
377
377
|
this.value = "valid";
|
|
378
378
|
}
|
|
@@ -400,7 +400,7 @@ class b {
|
|
|
400
400
|
value: o
|
|
401
401
|
});
|
|
402
402
|
}
|
|
403
|
-
return
|
|
403
|
+
return x.mergeObjectSync(e, s);
|
|
404
404
|
}
|
|
405
405
|
static mergeObjectSync(e, t) {
|
|
406
406
|
const s = {};
|
|
@@ -415,12 +415,12 @@ class b {
|
|
|
415
415
|
}
|
|
416
416
|
const f = Object.freeze({
|
|
417
417
|
status: "aborted"
|
|
418
|
-
}),
|
|
419
|
-
function
|
|
418
|
+
}), Ne = (n) => ({ status: "dirty", value: n }), T = (n) => ({ status: "valid", value: n }), Ke = (n) => n.status === "aborted", We = (n) => n.status === "dirty", de = (n) => n.status === "valid", le = (n) => typeof Promise < "u" && n instanceof Promise;
|
|
419
|
+
function Ee(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 at(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
|
}
|
|
@@ -428,7 +428,7 @@ var g;
|
|
|
428
428
|
(function(n) {
|
|
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
|
})(g || (g = {}));
|
|
431
|
-
var
|
|
431
|
+
var ce, ue;
|
|
432
432
|
class N {
|
|
433
433
|
constructor(e, t, s, r) {
|
|
434
434
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = r;
|
|
@@ -437,7 +437,7 @@ class N {
|
|
|
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 tt = (n, e) => {
|
|
441
441
|
if (de(e))
|
|
442
442
|
return { success: !0, data: e.value };
|
|
443
443
|
if (!n.common.issues.length)
|
|
@@ -459,9 +459,9 @@ function y(n) {
|
|
|
459
459
|
if (e && (t || s))
|
|
460
460
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
461
461
|
return e ? { errorMap: e, description: r } : { errorMap: (a, o) => {
|
|
462
|
-
var c,
|
|
463
|
-
const { message:
|
|
464
|
-
return a.code === "invalid_enum_value" ? { message:
|
|
462
|
+
var c, u;
|
|
463
|
+
const { message: d } = n;
|
|
464
|
+
return a.code === "invalid_enum_value" ? { message: d ?? o.defaultError } : typeof o.data > "u" ? { message: (c = d ?? s) !== null && c !== void 0 ? c : o.defaultError } : a.code !== "invalid_type" ? { message: o.defaultError } : { message: (u = d ?? t) !== null && u !== void 0 ? u : o.defaultError };
|
|
465
465
|
}, description: r };
|
|
466
466
|
}
|
|
467
467
|
class v {
|
|
@@ -486,7 +486,7 @@ class v {
|
|
|
486
486
|
}
|
|
487
487
|
_processInputParams(e) {
|
|
488
488
|
return {
|
|
489
|
-
status: new
|
|
489
|
+
status: new x(),
|
|
490
490
|
ctx: {
|
|
491
491
|
common: e.parent.common,
|
|
492
492
|
data: e.data,
|
|
@@ -499,7 +499,7 @@ class v {
|
|
|
499
499
|
}
|
|
500
500
|
_parseSync(e) {
|
|
501
501
|
const t = this._parse(e);
|
|
502
|
-
if (
|
|
502
|
+
if (le(t))
|
|
503
503
|
throw new Error("Synchronous parse encountered promise.");
|
|
504
504
|
return t;
|
|
505
505
|
}
|
|
@@ -527,7 +527,7 @@ class v {
|
|
|
527
527
|
data: e,
|
|
528
528
|
parsedType: R(e)
|
|
529
529
|
}, a = this._parseSync({ data: e, path: r.path, parent: r });
|
|
530
|
-
return
|
|
530
|
+
return tt(r, a);
|
|
531
531
|
}
|
|
532
532
|
async parseAsync(e, t) {
|
|
533
533
|
const s = await this.safeParseAsync(e, t);
|
|
@@ -547,8 +547,8 @@ class v {
|
|
|
547
547
|
parent: null,
|
|
548
548
|
data: e,
|
|
549
549
|
parsedType: R(e)
|
|
550
|
-
}, r = this._parse({ data: e, path: s.path, parent: s }), a = await (
|
|
551
|
-
return
|
|
550
|
+
}, r = this._parse({ data: e, path: s.path, parent: s }), a = await (le(r) ? r : Promise.resolve(r));
|
|
551
|
+
return tt(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;
|
|
@@ -557,7 +557,7 @@ class v {
|
|
|
557
557
|
code: l.custom,
|
|
558
558
|
...s(r)
|
|
559
559
|
});
|
|
560
|
-
return typeof Promise < "u" && o instanceof Promise ? o.then((
|
|
560
|
+
return typeof Promise < "u" && o instanceof Promise ? o.then((u) => u ? !0 : (c(), !1)) : o ? !0 : (c(), !1);
|
|
561
561
|
});
|
|
562
562
|
}
|
|
563
563
|
refinement(e, t) {
|
|
@@ -586,13 +586,13 @@ class v {
|
|
|
586
586
|
return I.create(this, this._def);
|
|
587
587
|
}
|
|
588
588
|
promise() {
|
|
589
|
-
return
|
|
589
|
+
return ne.create(this, this._def);
|
|
590
590
|
}
|
|
591
591
|
or(e) {
|
|
592
|
-
return
|
|
592
|
+
return ge.create([this, e], this._def);
|
|
593
593
|
}
|
|
594
594
|
and(e) {
|
|
595
|
-
return
|
|
595
|
+
return me.create(this, e, this._def);
|
|
596
596
|
}
|
|
597
597
|
transform(e) {
|
|
598
598
|
return new A({
|
|
@@ -604,7 +604,7 @@ class v {
|
|
|
604
604
|
}
|
|
605
605
|
default(e) {
|
|
606
606
|
const t = typeof e == "function" ? e : () => e;
|
|
607
|
-
return new
|
|
607
|
+
return new ke({
|
|
608
608
|
...y(this._def),
|
|
609
609
|
innerType: this,
|
|
610
610
|
defaultValue: t,
|
|
@@ -612,7 +612,7 @@ class v {
|
|
|
612
612
|
});
|
|
613
613
|
}
|
|
614
614
|
brand() {
|
|
615
|
-
return new
|
|
615
|
+
return new Je({
|
|
616
616
|
typeName: m.ZodBranded,
|
|
617
617
|
type: this,
|
|
618
618
|
...y(this._def)
|
|
@@ -620,7 +620,7 @@ class v {
|
|
|
620
620
|
}
|
|
621
621
|
catch(e) {
|
|
622
622
|
const t = typeof e == "function" ? e : () => e;
|
|
623
|
-
return new
|
|
623
|
+
return new be({
|
|
624
624
|
...y(this._def),
|
|
625
625
|
innerType: this,
|
|
626
626
|
catchValue: t,
|
|
@@ -635,7 +635,7 @@ class v {
|
|
|
635
635
|
});
|
|
636
636
|
}
|
|
637
637
|
pipe(e) {
|
|
638
|
-
return
|
|
638
|
+
return Te.create(this, e);
|
|
639
639
|
}
|
|
640
640
|
readonly() {
|
|
641
641
|
return xe.create(this);
|
|
@@ -647,35 +647,35 @@ class v {
|
|
|
647
647
|
return this.safeParse(null).success;
|
|
648
648
|
}
|
|
649
649
|
}
|
|
650
|
-
const
|
|
651
|
-
let
|
|
652
|
-
const
|
|
653
|
-
function
|
|
650
|
+
const Nt = /^c[^\s-]{8,}$/i, Et = /^[0-9a-z]+$/, $t = /^[0-9A-HJKMNP-TV-Z]{26}$/, Pt = /^[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, Rt = /^[a-z0-9_-]{21}$/i, Dt = /^[-+]?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)?)??$/, Ft = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Mt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
651
|
+
let Ve;
|
|
652
|
+
const Lt = /^(?:(?: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])$/, Ut = /^(([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})))$/, zt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, ot = "((\\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])))", Vt = new RegExp(`^${ot}$`);
|
|
653
|
+
function ct(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
657
|
function qt(n) {
|
|
658
|
-
return new RegExp(`^${
|
|
658
|
+
return new RegExp(`^${ct(n)}$`);
|
|
659
659
|
}
|
|
660
|
-
function
|
|
661
|
-
let e = `${
|
|
660
|
+
function ut(n) {
|
|
661
|
+
let e = `${ot}T${ct(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 Bt(n, e) {
|
|
666
|
+
return !!((e === "v4" || !e) && Lt.test(n) || (e === "v6" || !e) && Ut.test(n));
|
|
667
667
|
}
|
|
668
668
|
class j extends v {
|
|
669
669
|
_parse(e) {
|
|
670
|
-
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !==
|
|
670
|
+
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== h.string) {
|
|
671
671
|
const r = this._getOrReturnCtx(e);
|
|
672
672
|
return p(r, {
|
|
673
673
|
code: l.invalid_type,
|
|
674
|
-
expected:
|
|
674
|
+
expected: h.string,
|
|
675
675
|
received: r.parsedType
|
|
676
676
|
}), f;
|
|
677
677
|
}
|
|
678
|
-
const t = new
|
|
678
|
+
const t = new x();
|
|
679
679
|
let s;
|
|
680
680
|
for (const r of this._def.checks)
|
|
681
681
|
if (r.kind === "min")
|
|
@@ -714,43 +714,43 @@ class j extends v {
|
|
|
714
714
|
message: r.message
|
|
715
715
|
}), t.dirty());
|
|
716
716
|
} else if (r.kind === "email")
|
|
717
|
-
|
|
717
|
+
Ft.test(e.data) || (s = this._getOrReturnCtx(e, s), p(s, {
|
|
718
718
|
validation: "email",
|
|
719
719
|
code: l.invalid_string,
|
|
720
720
|
message: r.message
|
|
721
721
|
}), t.dirty());
|
|
722
722
|
else if (r.kind === "emoji")
|
|
723
|
-
|
|
723
|
+
Ve || (Ve = new RegExp(Mt, "u")), Ve.test(e.data) || (s = this._getOrReturnCtx(e, s), p(s, {
|
|
724
724
|
validation: "emoji",
|
|
725
725
|
code: l.invalid_string,
|
|
726
726
|
message: r.message
|
|
727
727
|
}), t.dirty());
|
|
728
728
|
else if (r.kind === "uuid")
|
|
729
|
-
|
|
729
|
+
Pt.test(e.data) || (s = this._getOrReturnCtx(e, s), p(s, {
|
|
730
730
|
validation: "uuid",
|
|
731
731
|
code: l.invalid_string,
|
|
732
732
|
message: r.message
|
|
733
733
|
}), t.dirty());
|
|
734
734
|
else if (r.kind === "nanoid")
|
|
735
|
-
|
|
735
|
+
Rt.test(e.data) || (s = this._getOrReturnCtx(e, s), p(s, {
|
|
736
736
|
validation: "nanoid",
|
|
737
737
|
code: l.invalid_string,
|
|
738
738
|
message: r.message
|
|
739
739
|
}), t.dirty());
|
|
740
740
|
else if (r.kind === "cuid")
|
|
741
|
-
|
|
741
|
+
Nt.test(e.data) || (s = this._getOrReturnCtx(e, s), p(s, {
|
|
742
742
|
validation: "cuid",
|
|
743
743
|
code: l.invalid_string,
|
|
744
744
|
message: r.message
|
|
745
745
|
}), t.dirty());
|
|
746
746
|
else if (r.kind === "cuid2")
|
|
747
|
-
|
|
747
|
+
Et.test(e.data) || (s = this._getOrReturnCtx(e, s), p(s, {
|
|
748
748
|
validation: "cuid2",
|
|
749
749
|
code: l.invalid_string,
|
|
750
750
|
message: r.message
|
|
751
751
|
}), t.dirty());
|
|
752
752
|
else if (r.kind === "ulid")
|
|
753
|
-
|
|
753
|
+
$t.test(e.data) || (s = this._getOrReturnCtx(e, s), p(s, {
|
|
754
754
|
validation: "ulid",
|
|
755
755
|
code: l.invalid_string,
|
|
756
756
|
message: r.message
|
|
@@ -781,11 +781,11 @@ class j extends v {
|
|
|
781
781
|
code: l.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" ? ut(r).test(e.data) || (s = this._getOrReturnCtx(e, s), p(s, {
|
|
785
785
|
code: l.invalid_string,
|
|
786
786
|
validation: "datetime",
|
|
787
787
|
message: r.message
|
|
788
|
-
}), t.dirty()) : r.kind === "date" ?
|
|
788
|
+
}), t.dirty()) : r.kind === "date" ? Vt.test(e.data) || (s = this._getOrReturnCtx(e, s), p(s, {
|
|
789
789
|
code: l.invalid_string,
|
|
790
790
|
validation: "date",
|
|
791
791
|
message: r.message
|
|
@@ -793,15 +793,15 @@ class j extends v {
|
|
|
793
793
|
code: l.invalid_string,
|
|
794
794
|
validation: "time",
|
|
795
795
|
message: r.message
|
|
796
|
-
}), t.dirty()) : r.kind === "duration" ?
|
|
796
|
+
}), t.dirty()) : r.kind === "duration" ? Dt.test(e.data) || (s = this._getOrReturnCtx(e, s), p(s, {
|
|
797
797
|
validation: "duration",
|
|
798
798
|
code: l.invalid_string,
|
|
799
799
|
message: r.message
|
|
800
|
-
}), t.dirty()) : r.kind === "ip" ?
|
|
800
|
+
}), t.dirty()) : r.kind === "ip" ? Bt(e.data, r.version) || (s = this._getOrReturnCtx(e, s), p(s, {
|
|
801
801
|
validation: "ip",
|
|
802
802
|
code: l.invalid_string,
|
|
803
803
|
message: r.message
|
|
804
|
-
}), t.dirty()) : r.kind === "base64" ?
|
|
804
|
+
}), t.dirty()) : r.kind === "base64" ? zt.test(e.data) || (s = this._getOrReturnCtx(e, s), p(s, {
|
|
805
805
|
validation: "base64",
|
|
806
806
|
code: l.invalid_string,
|
|
807
807
|
message: r.message
|
|
@@ -1023,7 +1023,7 @@ j.create = (n) => {
|
|
|
1023
1023
|
...y(n)
|
|
1024
1024
|
});
|
|
1025
1025
|
};
|
|
1026
|
-
function
|
|
1026
|
+
function Kt(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
|
}
|
|
@@ -1032,16 +1032,16 @@ class D extends v {
|
|
|
1032
1032
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1033
1033
|
}
|
|
1034
1034
|
_parse(e) {
|
|
1035
|
-
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !==
|
|
1035
|
+
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== h.number) {
|
|
1036
1036
|
const r = this._getOrReturnCtx(e);
|
|
1037
1037
|
return p(r, {
|
|
1038
1038
|
code: l.invalid_type,
|
|
1039
|
-
expected:
|
|
1039
|
+
expected: h.number,
|
|
1040
1040
|
received: r.parsedType
|
|
1041
1041
|
}), f;
|
|
1042
1042
|
}
|
|
1043
1043
|
let t;
|
|
1044
|
-
const s = new
|
|
1044
|
+
const s = new x();
|
|
1045
1045
|
for (const r of this._def.checks)
|
|
1046
1046
|
r.kind === "int" ? w.isInteger(e.data) || (t = this._getOrReturnCtx(e, t), p(t, {
|
|
1047
1047
|
code: l.invalid_type,
|
|
@@ -1062,7 +1062,7 @@ class D extends v {
|
|
|
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" ? Kt(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), p(t, {
|
|
1066
1066
|
code: l.not_multiple_of,
|
|
1067
1067
|
multipleOf: r.value,
|
|
1068
1068
|
message: r.message
|
|
@@ -1204,16 +1204,16 @@ class F extends v {
|
|
|
1204
1204
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1205
1205
|
}
|
|
1206
1206
|
_parse(e) {
|
|
1207
|
-
if (this._def.coerce && (e.data = BigInt(e.data)), this._getType(e) !==
|
|
1207
|
+
if (this._def.coerce && (e.data = BigInt(e.data)), this._getType(e) !== h.bigint) {
|
|
1208
1208
|
const r = this._getOrReturnCtx(e);
|
|
1209
1209
|
return p(r, {
|
|
1210
1210
|
code: l.invalid_type,
|
|
1211
|
-
expected:
|
|
1211
|
+
expected: h.bigint,
|
|
1212
1212
|
received: r.parsedType
|
|
1213
1213
|
}), f;
|
|
1214
1214
|
}
|
|
1215
1215
|
let t;
|
|
1216
|
-
const s = new
|
|
1216
|
+
const s = new x();
|
|
1217
1217
|
for (const r of this._def.checks)
|
|
1218
1218
|
r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t), p(t, {
|
|
1219
1219
|
code: l.too_small,
|
|
@@ -1327,31 +1327,31 @@ F.create = (n) => {
|
|
|
1327
1327
|
...y(n)
|
|
1328
1328
|
});
|
|
1329
1329
|
};
|
|
1330
|
-
class
|
|
1330
|
+
class pe extends v {
|
|
1331
1331
|
_parse(e) {
|
|
1332
|
-
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !==
|
|
1332
|
+
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== h.boolean) {
|
|
1333
1333
|
const t = this._getOrReturnCtx(e);
|
|
1334
1334
|
return p(t, {
|
|
1335
1335
|
code: l.invalid_type,
|
|
1336
|
-
expected:
|
|
1336
|
+
expected: h.boolean,
|
|
1337
1337
|
received: t.parsedType
|
|
1338
1338
|
}), f;
|
|
1339
1339
|
}
|
|
1340
1340
|
return T(e.data);
|
|
1341
1341
|
}
|
|
1342
1342
|
}
|
|
1343
|
-
|
|
1343
|
+
pe.create = (n) => new pe({
|
|
1344
1344
|
typeName: m.ZodBoolean,
|
|
1345
1345
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
1346
1346
|
...y(n)
|
|
1347
1347
|
});
|
|
1348
1348
|
class B extends v {
|
|
1349
1349
|
_parse(e) {
|
|
1350
|
-
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !==
|
|
1350
|
+
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== h.date) {
|
|
1351
1351
|
const r = this._getOrReturnCtx(e);
|
|
1352
1352
|
return p(r, {
|
|
1353
1353
|
code: l.invalid_type,
|
|
1354
|
-
expected:
|
|
1354
|
+
expected: h.date,
|
|
1355
1355
|
received: r.parsedType
|
|
1356
1356
|
}), f;
|
|
1357
1357
|
}
|
|
@@ -1361,7 +1361,7 @@ class B extends v {
|
|
|
1361
1361
|
code: l.invalid_date
|
|
1362
1362
|
}), f;
|
|
1363
1363
|
}
|
|
1364
|
-
const t = new
|
|
1364
|
+
const t = new x();
|
|
1365
1365
|
let s;
|
|
1366
1366
|
for (const r of this._def.checks)
|
|
1367
1367
|
r.kind === "min" ? e.data.getTime() < r.value && (s = this._getOrReturnCtx(e, s), p(s, {
|
|
@@ -1423,58 +1423,58 @@ B.create = (n) => new B({
|
|
|
1423
1423
|
typeName: m.ZodDate,
|
|
1424
1424
|
...y(n)
|
|
1425
1425
|
});
|
|
1426
|
-
class
|
|
1426
|
+
class $e extends v {
|
|
1427
1427
|
_parse(e) {
|
|
1428
|
-
if (this._getType(e) !==
|
|
1428
|
+
if (this._getType(e) !== h.symbol) {
|
|
1429
1429
|
const t = this._getOrReturnCtx(e);
|
|
1430
1430
|
return p(t, {
|
|
1431
1431
|
code: l.invalid_type,
|
|
1432
|
-
expected:
|
|
1432
|
+
expected: h.symbol,
|
|
1433
1433
|
received: t.parsedType
|
|
1434
1434
|
}), f;
|
|
1435
1435
|
}
|
|
1436
1436
|
return T(e.data);
|
|
1437
1437
|
}
|
|
1438
1438
|
}
|
|
1439
|
-
|
|
1439
|
+
$e.create = (n) => new $e({
|
|
1440
1440
|
typeName: m.ZodSymbol,
|
|
1441
1441
|
...y(n)
|
|
1442
1442
|
});
|
|
1443
|
-
class
|
|
1443
|
+
class he extends v {
|
|
1444
1444
|
_parse(e) {
|
|
1445
|
-
if (this._getType(e) !==
|
|
1445
|
+
if (this._getType(e) !== h.undefined) {
|
|
1446
1446
|
const t = this._getOrReturnCtx(e);
|
|
1447
1447
|
return p(t, {
|
|
1448
1448
|
code: l.invalid_type,
|
|
1449
|
-
expected:
|
|
1449
|
+
expected: h.undefined,
|
|
1450
1450
|
received: t.parsedType
|
|
1451
1451
|
}), f;
|
|
1452
1452
|
}
|
|
1453
1453
|
return T(e.data);
|
|
1454
1454
|
}
|
|
1455
1455
|
}
|
|
1456
|
-
|
|
1456
|
+
he.create = (n) => new he({
|
|
1457
1457
|
typeName: m.ZodUndefined,
|
|
1458
1458
|
...y(n)
|
|
1459
1459
|
});
|
|
1460
|
-
class
|
|
1460
|
+
class _e extends v {
|
|
1461
1461
|
_parse(e) {
|
|
1462
|
-
if (this._getType(e) !==
|
|
1462
|
+
if (this._getType(e) !== h.null) {
|
|
1463
1463
|
const t = this._getOrReturnCtx(e);
|
|
1464
1464
|
return p(t, {
|
|
1465
1465
|
code: l.invalid_type,
|
|
1466
|
-
expected:
|
|
1466
|
+
expected: h.null,
|
|
1467
1467
|
received: t.parsedType
|
|
1468
1468
|
}), f;
|
|
1469
1469
|
}
|
|
1470
1470
|
return T(e.data);
|
|
1471
1471
|
}
|
|
1472
1472
|
}
|
|
1473
|
-
|
|
1473
|
+
_e.create = (n) => new _e({
|
|
1474
1474
|
typeName: m.ZodNull,
|
|
1475
1475
|
...y(n)
|
|
1476
1476
|
});
|
|
1477
|
-
class
|
|
1477
|
+
class te extends v {
|
|
1478
1478
|
constructor() {
|
|
1479
1479
|
super(...arguments), this._any = !0;
|
|
1480
1480
|
}
|
|
@@ -1482,11 +1482,11 @@ class ee extends v {
|
|
|
1482
1482
|
return T(e.data);
|
|
1483
1483
|
}
|
|
1484
1484
|
}
|
|
1485
|
-
|
|
1485
|
+
te.create = (n) => new te({
|
|
1486
1486
|
typeName: m.ZodAny,
|
|
1487
1487
|
...y(n)
|
|
1488
1488
|
});
|
|
1489
|
-
class
|
|
1489
|
+
class q extends v {
|
|
1490
1490
|
constructor() {
|
|
1491
1491
|
super(...arguments), this._unknown = !0;
|
|
1492
1492
|
}
|
|
@@ -1494,7 +1494,7 @@ class V extends v {
|
|
|
1494
1494
|
return T(e.data);
|
|
1495
1495
|
}
|
|
1496
1496
|
}
|
|
1497
|
-
|
|
1497
|
+
q.create = (n) => new q({
|
|
1498
1498
|
typeName: m.ZodUnknown,
|
|
1499
1499
|
...y(n)
|
|
1500
1500
|
});
|
|
@@ -1503,7 +1503,7 @@ class $ extends v {
|
|
|
1503
1503
|
const t = this._getOrReturnCtx(e);
|
|
1504
1504
|
return p(t, {
|
|
1505
1505
|
code: l.invalid_type,
|
|
1506
|
-
expected:
|
|
1506
|
+
expected: h.never,
|
|
1507
1507
|
received: t.parsedType
|
|
1508
1508
|
}), f;
|
|
1509
1509
|
}
|
|
@@ -1512,30 +1512,30 @@ $.create = (n) => new $({
|
|
|
1512
1512
|
typeName: m.ZodNever,
|
|
1513
1513
|
...y(n)
|
|
1514
1514
|
});
|
|
1515
|
-
class
|
|
1515
|
+
class Pe extends v {
|
|
1516
1516
|
_parse(e) {
|
|
1517
|
-
if (this._getType(e) !==
|
|
1517
|
+
if (this._getType(e) !== h.undefined) {
|
|
1518
1518
|
const t = this._getOrReturnCtx(e);
|
|
1519
1519
|
return p(t, {
|
|
1520
1520
|
code: l.invalid_type,
|
|
1521
|
-
expected:
|
|
1521
|
+
expected: h.void,
|
|
1522
1522
|
received: t.parsedType
|
|
1523
1523
|
}), f;
|
|
1524
1524
|
}
|
|
1525
1525
|
return T(e.data);
|
|
1526
1526
|
}
|
|
1527
1527
|
}
|
|
1528
|
-
|
|
1528
|
+
Pe.create = (n) => new Pe({
|
|
1529
1529
|
typeName: m.ZodVoid,
|
|
1530
1530
|
...y(n)
|
|
1531
1531
|
});
|
|
1532
1532
|
class I extends v {
|
|
1533
1533
|
_parse(e) {
|
|
1534
1534
|
const { ctx: t, status: s } = this._processInputParams(e), r = this._def;
|
|
1535
|
-
if (t.parsedType !==
|
|
1535
|
+
if (t.parsedType !== h.array)
|
|
1536
1536
|
return p(t, {
|
|
1537
1537
|
code: l.invalid_type,
|
|
1538
|
-
expected:
|
|
1538
|
+
expected: h.array,
|
|
1539
1539
|
received: t.parsedType
|
|
1540
1540
|
}), f;
|
|
1541
1541
|
if (r.exactLength !== null) {
|
|
@@ -1565,9 +1565,9 @@ class I extends v {
|
|
|
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 N(t, o, t.path, c)))).then((o) =>
|
|
1568
|
+
return Promise.all([...t.data].map((o, c) => r.type._parseAsync(new N(t, o, t.path, c)))).then((o) => x.mergeArray(s, o));
|
|
1569
1569
|
const a = [...t.data].map((o, c) => r.type._parseSync(new N(t, o, t.path, c)));
|
|
1570
|
-
return
|
|
1570
|
+
return x.mergeArray(s, a);
|
|
1571
1571
|
}
|
|
1572
1572
|
get element() {
|
|
1573
1573
|
return this._def.type;
|
|
@@ -1603,13 +1603,13 @@ I.create = (n, e) => new I({
|
|
|
1603
1603
|
...y(e)
|
|
1604
1604
|
});
|
|
1605
1605
|
function Y(n) {
|
|
1606
|
-
if (n instanceof
|
|
1606
|
+
if (n instanceof b) {
|
|
1607
1607
|
const e = {};
|
|
1608
1608
|
for (const t in n.shape) {
|
|
1609
1609
|
const s = n.shape[t];
|
|
1610
1610
|
e[t] = C.create(Y(s));
|
|
1611
1611
|
}
|
|
1612
|
-
return new
|
|
1612
|
+
return new b({
|
|
1613
1613
|
...n._def,
|
|
1614
1614
|
shape: () => e
|
|
1615
1615
|
});
|
|
@@ -1618,7 +1618,7 @@ function Y(n) {
|
|
|
1618
1618
|
type: Y(n.element)
|
|
1619
1619
|
}) : n instanceof C ? C.create(Y(n.unwrap())) : n instanceof L ? L.create(Y(n.unwrap())) : n instanceof E ? E.create(n.items.map((e) => Y(e))) : n;
|
|
1620
1620
|
}
|
|
1621
|
-
class
|
|
1621
|
+
class b extends v {
|
|
1622
1622
|
constructor() {
|
|
1623
1623
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1624
1624
|
}
|
|
@@ -1629,96 +1629,96 @@ class x extends v {
|
|
|
1629
1629
|
return this._cached = { shape: e, keys: t };
|
|
1630
1630
|
}
|
|
1631
1631
|
_parse(e) {
|
|
1632
|
-
if (this._getType(e) !==
|
|
1633
|
-
const
|
|
1634
|
-
return p(
|
|
1632
|
+
if (this._getType(e) !== h.object) {
|
|
1633
|
+
const u = this._getOrReturnCtx(e);
|
|
1634
|
+
return p(u, {
|
|
1635
1635
|
code: l.invalid_type,
|
|
1636
|
-
expected:
|
|
1637
|
-
received:
|
|
1636
|
+
expected: h.object,
|
|
1637
|
+
received: u.parsedType
|
|
1638
1638
|
}), f;
|
|
1639
1639
|
}
|
|
1640
1640
|
const { status: t, ctx: s } = this._processInputParams(e), { shape: r, keys: a } = this._getCached(), o = [];
|
|
1641
1641
|
if (!(this._def.catchall instanceof $ && this._def.unknownKeys === "strip"))
|
|
1642
|
-
for (const
|
|
1643
|
-
a.includes(
|
|
1642
|
+
for (const u in s.data)
|
|
1643
|
+
a.includes(u) || o.push(u);
|
|
1644
1644
|
const c = [];
|
|
1645
|
-
for (const
|
|
1646
|
-
const
|
|
1645
|
+
for (const u of a) {
|
|
1646
|
+
const d = r[u], _ = s.data[u];
|
|
1647
1647
|
c.push({
|
|
1648
|
-
key: { status: "valid", value:
|
|
1649
|
-
value:
|
|
1650
|
-
alwaysSet:
|
|
1648
|
+
key: { status: "valid", value: u },
|
|
1649
|
+
value: d._parse(new N(s, _, s.path, u)),
|
|
1650
|
+
alwaysSet: u in s.data
|
|
1651
1651
|
});
|
|
1652
1652
|
}
|
|
1653
1653
|
if (this._def.catchall instanceof $) {
|
|
1654
|
-
const
|
|
1655
|
-
if (
|
|
1656
|
-
for (const
|
|
1654
|
+
const u = this._def.unknownKeys;
|
|
1655
|
+
if (u === "passthrough")
|
|
1656
|
+
for (const d of o)
|
|
1657
1657
|
c.push({
|
|
1658
|
-
key: { status: "valid", value:
|
|
1659
|
-
value: { status: "valid", value: s.data[
|
|
1658
|
+
key: { status: "valid", value: d },
|
|
1659
|
+
value: { status: "valid", value: s.data[d] }
|
|
1660
1660
|
});
|
|
1661
|
-
else if (
|
|
1661
|
+
else if (u === "strict")
|
|
1662
1662
|
o.length > 0 && (p(s, {
|
|
1663
1663
|
code: l.unrecognized_keys,
|
|
1664
1664
|
keys: o
|
|
1665
1665
|
}), t.dirty());
|
|
1666
|
-
else if (
|
|
1666
|
+
else if (u !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
1667
1667
|
} else {
|
|
1668
|
-
const
|
|
1669
|
-
for (const
|
|
1670
|
-
const
|
|
1668
|
+
const u = this._def.catchall;
|
|
1669
|
+
for (const d of o) {
|
|
1670
|
+
const _ = s.data[d];
|
|
1671
1671
|
c.push({
|
|
1672
|
-
key: { status: "valid", value:
|
|
1673
|
-
value:
|
|
1674
|
-
new N(s,
|
|
1672
|
+
key: { status: "valid", value: d },
|
|
1673
|
+
value: u._parse(
|
|
1674
|
+
new N(s, _, s.path, d)
|
|
1675
1675
|
//, ctx.child(key), value, getParsedType(value)
|
|
1676
1676
|
),
|
|
1677
|
-
alwaysSet:
|
|
1677
|
+
alwaysSet: d in s.data
|
|
1678
1678
|
});
|
|
1679
1679
|
}
|
|
1680
1680
|
}
|
|
1681
1681
|
return s.common.async ? Promise.resolve().then(async () => {
|
|
1682
|
-
const
|
|
1683
|
-
for (const
|
|
1684
|
-
const
|
|
1685
|
-
|
|
1686
|
-
key:
|
|
1682
|
+
const u = [];
|
|
1683
|
+
for (const d of c) {
|
|
1684
|
+
const _ = await d.key, k = await d.value;
|
|
1685
|
+
u.push({
|
|
1686
|
+
key: _,
|
|
1687
1687
|
value: k,
|
|
1688
|
-
alwaysSet:
|
|
1688
|
+
alwaysSet: d.alwaysSet
|
|
1689
1689
|
});
|
|
1690
1690
|
}
|
|
1691
|
-
return
|
|
1692
|
-
}).then((
|
|
1691
|
+
return u;
|
|
1692
|
+
}).then((u) => x.mergeObjectSync(t, u)) : x.mergeObjectSync(t, c);
|
|
1693
1693
|
}
|
|
1694
1694
|
get shape() {
|
|
1695
1695
|
return this._def.shape();
|
|
1696
1696
|
}
|
|
1697
1697
|
strict(e) {
|
|
1698
|
-
return g.errToObj, new
|
|
1698
|
+
return g.errToObj, new b({
|
|
1699
1699
|
...this._def,
|
|
1700
1700
|
unknownKeys: "strict",
|
|
1701
1701
|
...e !== void 0 ? {
|
|
1702
1702
|
errorMap: (t, s) => {
|
|
1703
1703
|
var r, a, o, c;
|
|
1704
|
-
const
|
|
1704
|
+
const u = (o = (a = (r = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(r, t, s).message) !== null && o !== void 0 ? o : s.defaultError;
|
|
1705
1705
|
return t.code === "unrecognized_keys" ? {
|
|
1706
|
-
message: (c = g.errToObj(e).message) !== null && c !== void 0 ? c :
|
|
1706
|
+
message: (c = g.errToObj(e).message) !== null && c !== void 0 ? c : u
|
|
1707
1707
|
} : {
|
|
1708
|
-
message:
|
|
1708
|
+
message: u
|
|
1709
1709
|
};
|
|
1710
1710
|
}
|
|
1711
1711
|
} : {}
|
|
1712
1712
|
});
|
|
1713
1713
|
}
|
|
1714
1714
|
strip() {
|
|
1715
|
-
return new
|
|
1715
|
+
return new b({
|
|
1716
1716
|
...this._def,
|
|
1717
1717
|
unknownKeys: "strip"
|
|
1718
1718
|
});
|
|
1719
1719
|
}
|
|
1720
1720
|
passthrough() {
|
|
1721
|
-
return new
|
|
1721
|
+
return new b({
|
|
1722
1722
|
...this._def,
|
|
1723
1723
|
unknownKeys: "passthrough"
|
|
1724
1724
|
});
|
|
@@ -1741,7 +1741,7 @@ class x extends v {
|
|
|
1741
1741
|
// }) as any;
|
|
1742
1742
|
// };
|
|
1743
1743
|
extend(e) {
|
|
1744
|
-
return new
|
|
1744
|
+
return new b({
|
|
1745
1745
|
...this._def,
|
|
1746
1746
|
shape: () => ({
|
|
1747
1747
|
...this._def.shape(),
|
|
@@ -1755,7 +1755,7 @@ class x extends v {
|
|
|
1755
1755
|
* upgrade if you are experiencing issues.
|
|
1756
1756
|
*/
|
|
1757
1757
|
merge(e) {
|
|
1758
|
-
return new
|
|
1758
|
+
return new b({
|
|
1759
1759
|
unknownKeys: e._def.unknownKeys,
|
|
1760
1760
|
catchall: e._def.catchall,
|
|
1761
1761
|
shape: () => ({
|
|
@@ -1825,7 +1825,7 @@ class x extends v {
|
|
|
1825
1825
|
// return merged;
|
|
1826
1826
|
// }
|
|
1827
1827
|
catchall(e) {
|
|
1828
|
-
return new
|
|
1828
|
+
return new b({
|
|
1829
1829
|
...this._def,
|
|
1830
1830
|
catchall: e
|
|
1831
1831
|
});
|
|
@@ -1834,7 +1834,7 @@ class x extends v {
|
|
|
1834
1834
|
const t = {};
|
|
1835
1835
|
return w.objectKeys(e).forEach((s) => {
|
|
1836
1836
|
e[s] && this.shape[s] && (t[s] = this.shape[s]);
|
|
1837
|
-
}), new
|
|
1837
|
+
}), new b({
|
|
1838
1838
|
...this._def,
|
|
1839
1839
|
shape: () => t
|
|
1840
1840
|
});
|
|
@@ -1843,7 +1843,7 @@ class x extends v {
|
|
|
1843
1843
|
const t = {};
|
|
1844
1844
|
return w.objectKeys(this.shape).forEach((s) => {
|
|
1845
1845
|
e[s] || (t[s] = this.shape[s]);
|
|
1846
|
-
}), new
|
|
1846
|
+
}), new b({
|
|
1847
1847
|
...this._def,
|
|
1848
1848
|
shape: () => t
|
|
1849
1849
|
});
|
|
@@ -1859,7 +1859,7 @@ class x extends v {
|
|
|
1859
1859
|
return w.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 b({
|
|
1863
1863
|
...this._def,
|
|
1864
1864
|
shape: () => t
|
|
1865
1865
|
});
|
|
@@ -1875,7 +1875,7 @@ class x extends v {
|
|
|
1875
1875
|
r = r._def.innerType;
|
|
1876
1876
|
t[s] = r;
|
|
1877
1877
|
}
|
|
1878
|
-
}), new
|
|
1878
|
+
}), new b({
|
|
1879
1879
|
...this._def,
|
|
1880
1880
|
shape: () => t
|
|
1881
1881
|
});
|
|
@@ -1884,28 +1884,28 @@ class x extends v {
|
|
|
1884
1884
|
return dt(w.objectKeys(this.shape));
|
|
1885
1885
|
}
|
|
1886
1886
|
}
|
|
1887
|
-
|
|
1887
|
+
b.create = (n, e) => new b({
|
|
1888
1888
|
shape: () => n,
|
|
1889
1889
|
unknownKeys: "strip",
|
|
1890
1890
|
catchall: $.create(),
|
|
1891
1891
|
typeName: m.ZodObject,
|
|
1892
1892
|
...y(e)
|
|
1893
1893
|
});
|
|
1894
|
-
|
|
1894
|
+
b.strictCreate = (n, e) => new b({
|
|
1895
1895
|
shape: () => n,
|
|
1896
1896
|
unknownKeys: "strict",
|
|
1897
1897
|
catchall: $.create(),
|
|
1898
1898
|
typeName: m.ZodObject,
|
|
1899
1899
|
...y(e)
|
|
1900
1900
|
});
|
|
1901
|
-
|
|
1901
|
+
b.lazycreate = (n, e) => new b({
|
|
1902
1902
|
shape: n,
|
|
1903
1903
|
unknownKeys: "strip",
|
|
1904
1904
|
catchall: $.create(),
|
|
1905
1905
|
typeName: m.ZodObject,
|
|
1906
1906
|
...y(e)
|
|
1907
1907
|
});
|
|
1908
|
-
class
|
|
1908
|
+
class ge extends v {
|
|
1909
1909
|
_parse(e) {
|
|
1910
1910
|
const { ctx: t } = this._processInputParams(e), s = this._def.options;
|
|
1911
1911
|
function r(a) {
|
|
@@ -1943,26 +1943,26 @@ class _e extends v {
|
|
|
1943
1943
|
{
|
|
1944
1944
|
let a;
|
|
1945
1945
|
const o = [];
|
|
1946
|
-
for (const
|
|
1947
|
-
const
|
|
1946
|
+
for (const u of s) {
|
|
1947
|
+
const d = {
|
|
1948
1948
|
...t,
|
|
1949
1949
|
common: {
|
|
1950
1950
|
...t.common,
|
|
1951
1951
|
issues: []
|
|
1952
1952
|
},
|
|
1953
1953
|
parent: null
|
|
1954
|
-
},
|
|
1954
|
+
}, _ = u._parseSync({
|
|
1955
1955
|
data: t.data,
|
|
1956
1956
|
path: t.path,
|
|
1957
|
-
parent:
|
|
1957
|
+
parent: d
|
|
1958
1958
|
});
|
|
1959
|
-
if (
|
|
1960
|
-
return
|
|
1961
|
-
|
|
1959
|
+
if (_.status === "valid")
|
|
1960
|
+
return _;
|
|
1961
|
+
_.status === "dirty" && !a && (a = { result: _, ctx: d }), d.common.issues.length && o.push(d.common.issues);
|
|
1962
1962
|
}
|
|
1963
1963
|
if (a)
|
|
1964
1964
|
return t.common.issues.push(...a.ctx.common.issues), a.result;
|
|
1965
|
-
const c = o.map((
|
|
1965
|
+
const c = o.map((u) => new Z(u));
|
|
1966
1966
|
return p(t, {
|
|
1967
1967
|
code: l.invalid_union,
|
|
1968
1968
|
unionErrors: c
|
|
@@ -1973,19 +1973,19 @@ class _e extends v {
|
|
|
1973
1973
|
return this._def.options;
|
|
1974
1974
|
}
|
|
1975
1975
|
}
|
|
1976
|
-
|
|
1976
|
+
ge.create = (n, e) => new ge({
|
|
1977
1977
|
options: n,
|
|
1978
1978
|
typeName: m.ZodUnion,
|
|
1979
1979
|
...y(e)
|
|
1980
1980
|
});
|
|
1981
|
-
const P = (n) => n instanceof
|
|
1982
|
-
class
|
|
1981
|
+
const P = (n) => n instanceof ye ? P(n.schema) : n instanceof A ? P(n.innerType()) : n instanceof ve ? [n.value] : n instanceof M ? n.options : n instanceof we ? w.objectValues(n.enum) : n instanceof ke ? P(n._def.innerType) : n instanceof he ? [void 0] : n instanceof _e ? [null] : n instanceof C ? [void 0, ...P(n.unwrap())] : n instanceof L ? [null, ...P(n.unwrap())] : n instanceof Je || n instanceof xe ? P(n.unwrap()) : n instanceof be ? P(n._def.innerType) : [];
|
|
1982
|
+
class Fe extends v {
|
|
1983
1983
|
_parse(e) {
|
|
1984
1984
|
const { ctx: t } = this._processInputParams(e);
|
|
1985
|
-
if (t.parsedType !==
|
|
1985
|
+
if (t.parsedType !== h.object)
|
|
1986
1986
|
return p(t, {
|
|
1987
1987
|
code: l.invalid_type,
|
|
1988
|
-
expected:
|
|
1988
|
+
expected: h.object,
|
|
1989
1989
|
received: t.parsedType
|
|
1990
1990
|
}), f;
|
|
1991
1991
|
const s = this.discriminator, r = t.data[s], a = this.optionsMap.get(r);
|
|
@@ -2032,7 +2032,7 @@ class De extends v {
|
|
|
2032
2032
|
r.set(c, a);
|
|
2033
2033
|
}
|
|
2034
2034
|
}
|
|
2035
|
-
return new
|
|
2035
|
+
return new Fe({
|
|
2036
2036
|
typeName: m.ZodDiscriminatedUnion,
|
|
2037
2037
|
discriminator: e,
|
|
2038
2038
|
options: t,
|
|
@@ -2041,39 +2041,39 @@ class De extends v {
|
|
|
2041
2041
|
});
|
|
2042
2042
|
}
|
|
2043
2043
|
}
|
|
2044
|
-
function
|
|
2044
|
+
function Qe(n, e) {
|
|
2045
2045
|
const t = R(n), s = R(e);
|
|
2046
2046
|
if (n === e)
|
|
2047
2047
|
return { valid: !0, data: n };
|
|
2048
|
-
if (t ===
|
|
2048
|
+
if (t === h.object && s === h.object) {
|
|
2049
2049
|
const r = w.objectKeys(e), a = w.objectKeys(n).filter((c) => r.indexOf(c) !== -1), o = { ...n, ...e };
|
|
2050
2050
|
for (const c of a) {
|
|
2051
|
-
const
|
|
2052
|
-
if (!
|
|
2051
|
+
const u = Qe(n[c], e[c]);
|
|
2052
|
+
if (!u.valid)
|
|
2053
2053
|
return { valid: !1 };
|
|
2054
|
-
o[c] =
|
|
2054
|
+
o[c] = u.data;
|
|
2055
2055
|
}
|
|
2056
2056
|
return { valid: !0, data: o };
|
|
2057
|
-
} else if (t ===
|
|
2057
|
+
} else if (t === h.array && s === h.array) {
|
|
2058
2058
|
if (n.length !== e.length)
|
|
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],
|
|
2063
|
-
if (!
|
|
2062
|
+
const o = n[a], c = e[a], u = Qe(o, c);
|
|
2063
|
+
if (!u.valid)
|
|
2064
2064
|
return { valid: !1 };
|
|
2065
|
-
r.push(
|
|
2065
|
+
r.push(u.data);
|
|
2066
2066
|
}
|
|
2067
2067
|
return { valid: !0, data: r };
|
|
2068
|
-
} else return t ===
|
|
2068
|
+
} else return t === h.date && s === h.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
|
|
2069
2069
|
}
|
|
2070
|
-
class
|
|
2070
|
+
class me extends v {
|
|
2071
2071
|
_parse(e) {
|
|
2072
2072
|
const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
|
|
2073
|
-
if (
|
|
2073
|
+
if (Ke(a) || Ke(o))
|
|
2074
2074
|
return f;
|
|
2075
|
-
const c =
|
|
2076
|
-
return c.valid ? ((
|
|
2075
|
+
const c = Qe(a.value, o.value);
|
|
2076
|
+
return c.valid ? ((We(a) || We(o)) && t.dirty(), { status: t.value, value: c.data }) : (p(s, {
|
|
2077
2077
|
code: l.invalid_intersection_types
|
|
2078
2078
|
}), f);
|
|
2079
2079
|
};
|
|
@@ -2099,7 +2099,7 @@ class ge extends v {
|
|
|
2099
2099
|
}));
|
|
2100
2100
|
}
|
|
2101
2101
|
}
|
|
2102
|
-
|
|
2102
|
+
me.create = (n, e, t) => new me({
|
|
2103
2103
|
left: n,
|
|
2104
2104
|
right: e,
|
|
2105
2105
|
typeName: m.ZodIntersection,
|
|
@@ -2108,10 +2108,10 @@ ge.create = (n, e, t) => new ge({
|
|
|
2108
2108
|
class E extends v {
|
|
2109
2109
|
_parse(e) {
|
|
2110
2110
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2111
|
-
if (s.parsedType !==
|
|
2111
|
+
if (s.parsedType !== h.array)
|
|
2112
2112
|
return p(s, {
|
|
2113
2113
|
code: l.invalid_type,
|
|
2114
|
-
expected:
|
|
2114
|
+
expected: h.array,
|
|
2115
2115
|
received: s.parsedType
|
|
2116
2116
|
}), f;
|
|
2117
2117
|
if (s.data.length < this._def.items.length)
|
|
@@ -2133,7 +2133,7 @@ class E extends v {
|
|
|
2133
2133
|
const c = this._def.items[o] || this._def.rest;
|
|
2134
2134
|
return c ? c._parse(new N(s, a, s.path, o)) : null;
|
|
2135
2135
|
}).filter((a) => !!a);
|
|
2136
|
-
return s.common.async ? Promise.all(r).then((a) =>
|
|
2136
|
+
return s.common.async ? Promise.all(r).then((a) => x.mergeArray(t, a)) : x.mergeArray(t, r);
|
|
2137
2137
|
}
|
|
2138
2138
|
get items() {
|
|
2139
2139
|
return this._def.items;
|
|
@@ -2155,7 +2155,7 @@ E.create = (n, e) => {
|
|
|
2155
2155
|
...y(e)
|
|
2156
2156
|
});
|
|
2157
2157
|
};
|
|
2158
|
-
class
|
|
2158
|
+
class fe extends v {
|
|
2159
2159
|
get keySchema() {
|
|
2160
2160
|
return this._def.keyType;
|
|
2161
2161
|
}
|
|
@@ -2164,10 +2164,10 @@ class me extends v {
|
|
|
2164
2164
|
}
|
|
2165
2165
|
_parse(e) {
|
|
2166
2166
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2167
|
-
if (s.parsedType !==
|
|
2167
|
+
if (s.parsedType !== h.object)
|
|
2168
2168
|
return p(s, {
|
|
2169
2169
|
code: l.invalid_type,
|
|
2170
|
-
expected:
|
|
2170
|
+
expected: h.object,
|
|
2171
2171
|
received: s.parsedType
|
|
2172
2172
|
}), f;
|
|
2173
2173
|
const r = [], a = this._def.keyType, o = this._def.valueType;
|
|
@@ -2177,18 +2177,18 @@ class me extends v {
|
|
|
2177
2177
|
value: o._parse(new N(s, s.data[c], s.path, c)),
|
|
2178
2178
|
alwaysSet: c in s.data
|
|
2179
2179
|
});
|
|
2180
|
-
return s.common.async ?
|
|
2180
|
+
return s.common.async ? x.mergeObjectAsync(t, r) : x.mergeObjectSync(t, r);
|
|
2181
2181
|
}
|
|
2182
2182
|
get element() {
|
|
2183
2183
|
return this._def.valueType;
|
|
2184
2184
|
}
|
|
2185
2185
|
static create(e, t, s) {
|
|
2186
|
-
return t instanceof v ? new
|
|
2186
|
+
return t instanceof v ? new fe({
|
|
2187
2187
|
keyType: e,
|
|
2188
2188
|
valueType: t,
|
|
2189
2189
|
typeName: m.ZodRecord,
|
|
2190
2190
|
...y(s)
|
|
2191
|
-
}) : new
|
|
2191
|
+
}) : new fe({
|
|
2192
2192
|
keyType: j.create(),
|
|
2193
2193
|
valueType: e,
|
|
2194
2194
|
typeName: m.ZodRecord,
|
|
@@ -2196,7 +2196,7 @@ class me extends v {
|
|
|
2196
2196
|
});
|
|
2197
2197
|
}
|
|
2198
2198
|
}
|
|
2199
|
-
class
|
|
2199
|
+
class Re extends v {
|
|
2200
2200
|
get keySchema() {
|
|
2201
2201
|
return this._def.keyType;
|
|
2202
2202
|
}
|
|
@@ -2205,40 +2205,40 @@ class Pe extends v {
|
|
|
2205
2205
|
}
|
|
2206
2206
|
_parse(e) {
|
|
2207
2207
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2208
|
-
if (s.parsedType !==
|
|
2208
|
+
if (s.parsedType !== h.map)
|
|
2209
2209
|
return p(s, {
|
|
2210
2210
|
code: l.invalid_type,
|
|
2211
|
-
expected:
|
|
2211
|
+
expected: h.map,
|
|
2212
2212
|
received: s.parsedType
|
|
2213
2213
|
}), f;
|
|
2214
|
-
const r = this._def.keyType, a = this._def.valueType, o = [...s.data.entries()].map(([c,
|
|
2215
|
-
key: r._parse(new N(s, c, s.path, [
|
|
2216
|
-
value: a._parse(new N(s,
|
|
2214
|
+
const r = this._def.keyType, a = this._def.valueType, o = [...s.data.entries()].map(([c, u], d) => ({
|
|
2215
|
+
key: r._parse(new N(s, c, s.path, [d, "key"])),
|
|
2216
|
+
value: a._parse(new N(s, u, s.path, [d, "value"]))
|
|
2217
2217
|
}));
|
|
2218
2218
|
if (s.common.async) {
|
|
2219
2219
|
const c = /* @__PURE__ */ new Map();
|
|
2220
2220
|
return Promise.resolve().then(async () => {
|
|
2221
|
-
for (const
|
|
2222
|
-
const
|
|
2223
|
-
if (
|
|
2221
|
+
for (const u of o) {
|
|
2222
|
+
const d = await u.key, _ = await u.value;
|
|
2223
|
+
if (d.status === "aborted" || _.status === "aborted")
|
|
2224
2224
|
return f;
|
|
2225
|
-
(
|
|
2225
|
+
(d.status === "dirty" || _.status === "dirty") && t.dirty(), c.set(d.value, _.value);
|
|
2226
2226
|
}
|
|
2227
2227
|
return { status: t.value, value: c };
|
|
2228
2228
|
});
|
|
2229
2229
|
} else {
|
|
2230
2230
|
const c = /* @__PURE__ */ new Map();
|
|
2231
|
-
for (const
|
|
2232
|
-
const
|
|
2233
|
-
if (
|
|
2231
|
+
for (const u of o) {
|
|
2232
|
+
const d = u.key, _ = u.value;
|
|
2233
|
+
if (d.status === "aborted" || _.status === "aborted")
|
|
2234
2234
|
return f;
|
|
2235
|
-
(
|
|
2235
|
+
(d.status === "dirty" || _.status === "dirty") && t.dirty(), c.set(d.value, _.value);
|
|
2236
2236
|
}
|
|
2237
2237
|
return { status: t.value, value: c };
|
|
2238
2238
|
}
|
|
2239
2239
|
}
|
|
2240
2240
|
}
|
|
2241
|
-
|
|
2241
|
+
Re.create = (n, e, t) => new Re({
|
|
2242
2242
|
valueType: e,
|
|
2243
2243
|
keyType: n,
|
|
2244
2244
|
typeName: m.ZodMap,
|
|
@@ -2247,10 +2247,10 @@ Pe.create = (n, e, t) => new Pe({
|
|
|
2247
2247
|
class K extends v {
|
|
2248
2248
|
_parse(e) {
|
|
2249
2249
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2250
|
-
if (s.parsedType !==
|
|
2250
|
+
if (s.parsedType !== h.set)
|
|
2251
2251
|
return p(s, {
|
|
2252
2252
|
code: l.invalid_type,
|
|
2253
|
-
expected:
|
|
2253
|
+
expected: h.set,
|
|
2254
2254
|
received: s.parsedType
|
|
2255
2255
|
}), f;
|
|
2256
2256
|
const r = this._def;
|
|
@@ -2270,17 +2270,17 @@ class K extends v {
|
|
|
2270
2270
|
message: r.maxSize.message
|
|
2271
2271
|
}), t.dirty());
|
|
2272
2272
|
const a = this._def.valueType;
|
|
2273
|
-
function o(
|
|
2274
|
-
const
|
|
2275
|
-
for (const
|
|
2276
|
-
if (
|
|
2273
|
+
function o(u) {
|
|
2274
|
+
const d = /* @__PURE__ */ new Set();
|
|
2275
|
+
for (const _ of u) {
|
|
2276
|
+
if (_.status === "aborted")
|
|
2277
2277
|
return f;
|
|
2278
|
-
|
|
2278
|
+
_.status === "dirty" && t.dirty(), d.add(_.value);
|
|
2279
2279
|
}
|
|
2280
|
-
return { status: t.value, value:
|
|
2280
|
+
return { status: t.value, value: d };
|
|
2281
2281
|
}
|
|
2282
|
-
const c = [...s.data.values()].map((
|
|
2283
|
-
return s.common.async ? Promise.all(c).then((
|
|
2282
|
+
const c = [...s.data.values()].map((u, d) => a._parse(new N(s, u, s.path, d)));
|
|
2283
|
+
return s.common.async ? Promise.all(c).then((u) => o(u)) : o(c);
|
|
2284
2284
|
}
|
|
2285
2285
|
min(e, t) {
|
|
2286
2286
|
return new K({
|
|
@@ -2308,70 +2308,70 @@ K.create = (n, e) => new K({
|
|
|
2308
2308
|
typeName: m.ZodSet,
|
|
2309
2309
|
...y(e)
|
|
2310
2310
|
});
|
|
2311
|
-
class
|
|
2311
|
+
class X extends v {
|
|
2312
2312
|
constructor() {
|
|
2313
2313
|
super(...arguments), this.validate = this.implement;
|
|
2314
2314
|
}
|
|
2315
2315
|
_parse(e) {
|
|
2316
2316
|
const { ctx: t } = this._processInputParams(e);
|
|
2317
|
-
if (t.parsedType !==
|
|
2317
|
+
if (t.parsedType !== h.function)
|
|
2318
2318
|
return p(t, {
|
|
2319
2319
|
code: l.invalid_type,
|
|
2320
|
-
expected:
|
|
2320
|
+
expected: h.function,
|
|
2321
2321
|
received: t.parsedType
|
|
2322
2322
|
}), f;
|
|
2323
|
-
function s(c,
|
|
2324
|
-
return
|
|
2323
|
+
function s(c, u) {
|
|
2324
|
+
return Ce({
|
|
2325
2325
|
data: c,
|
|
2326
2326
|
path: t.path,
|
|
2327
2327
|
errorMaps: [
|
|
2328
2328
|
t.common.contextualErrorMap,
|
|
2329
2329
|
t.schemaErrorMap,
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
].filter((
|
|
2330
|
+
Ae(),
|
|
2331
|
+
ee
|
|
2332
|
+
].filter((d) => !!d),
|
|
2333
2333
|
issueData: {
|
|
2334
2334
|
code: l.invalid_arguments,
|
|
2335
|
-
argumentsError:
|
|
2335
|
+
argumentsError: u
|
|
2336
2336
|
}
|
|
2337
2337
|
});
|
|
2338
2338
|
}
|
|
2339
|
-
function r(c,
|
|
2340
|
-
return
|
|
2339
|
+
function r(c, u) {
|
|
2340
|
+
return Ce({
|
|
2341
2341
|
data: c,
|
|
2342
2342
|
path: t.path,
|
|
2343
2343
|
errorMaps: [
|
|
2344
2344
|
t.common.contextualErrorMap,
|
|
2345
2345
|
t.schemaErrorMap,
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
].filter((
|
|
2346
|
+
Ae(),
|
|
2347
|
+
ee
|
|
2348
|
+
].filter((d) => !!d),
|
|
2349
2349
|
issueData: {
|
|
2350
2350
|
code: l.invalid_return_type,
|
|
2351
|
-
returnTypeError:
|
|
2351
|
+
returnTypeError: u
|
|
2352
2352
|
}
|
|
2353
2353
|
});
|
|
2354
2354
|
}
|
|
2355
2355
|
const a = { errorMap: t.common.contextualErrorMap }, o = t.data;
|
|
2356
|
-
if (this._def.returns instanceof
|
|
2356
|
+
if (this._def.returns instanceof ne) {
|
|
2357
2357
|
const c = this;
|
|
2358
|
-
return T(async function(...
|
|
2359
|
-
const
|
|
2360
|
-
throw
|
|
2361
|
-
}), k = await Reflect.apply(o, this,
|
|
2358
|
+
return T(async function(...u) {
|
|
2359
|
+
const d = new Z([]), _ = await c._def.args.parseAsync(u, a).catch((O) => {
|
|
2360
|
+
throw d.addIssue(s(u, O)), d;
|
|
2361
|
+
}), k = await Reflect.apply(o, this, _);
|
|
2362
2362
|
return await c._def.returns._def.type.parseAsync(k, a).catch((O) => {
|
|
2363
|
-
throw
|
|
2363
|
+
throw d.addIssue(r(k, O)), d;
|
|
2364
2364
|
});
|
|
2365
2365
|
});
|
|
2366
2366
|
} else {
|
|
2367
2367
|
const c = this;
|
|
2368
|
-
return T(function(...
|
|
2369
|
-
const
|
|
2370
|
-
if (!
|
|
2371
|
-
throw new Z([s(
|
|
2372
|
-
const
|
|
2368
|
+
return T(function(...u) {
|
|
2369
|
+
const d = c._def.args.safeParse(u, a);
|
|
2370
|
+
if (!d.success)
|
|
2371
|
+
throw new Z([s(u, d.error)]);
|
|
2372
|
+
const _ = Reflect.apply(o, this, d.data), k = c._def.returns.safeParse(_, a);
|
|
2373
2373
|
if (!k.success)
|
|
2374
|
-
throw new Z([r(
|
|
2374
|
+
throw new Z([r(_, k.error)]);
|
|
2375
2375
|
return k.data;
|
|
2376
2376
|
});
|
|
2377
2377
|
}
|
|
@@ -2383,13 +2383,13 @@ class G extends v {
|
|
|
2383
2383
|
return this._def.returns;
|
|
2384
2384
|
}
|
|
2385
2385
|
args(...e) {
|
|
2386
|
-
return new
|
|
2386
|
+
return new X({
|
|
2387
2387
|
...this._def,
|
|
2388
|
-
args: E.create(e).rest(
|
|
2388
|
+
args: E.create(e).rest(q.create())
|
|
2389
2389
|
});
|
|
2390
2390
|
}
|
|
2391
2391
|
returns(e) {
|
|
2392
|
-
return new
|
|
2392
|
+
return new X({
|
|
2393
2393
|
...this._def,
|
|
2394
2394
|
returns: e
|
|
2395
2395
|
});
|
|
@@ -2401,15 +2401,15 @@ class G extends v {
|
|
|
2401
2401
|
return this.parse(e);
|
|
2402
2402
|
}
|
|
2403
2403
|
static create(e, t, s) {
|
|
2404
|
-
return new
|
|
2405
|
-
args: e || E.create([]).rest(
|
|
2406
|
-
returns: t ||
|
|
2404
|
+
return new X({
|
|
2405
|
+
args: e || E.create([]).rest(q.create()),
|
|
2406
|
+
returns: t || q.create(),
|
|
2407
2407
|
typeName: m.ZodFunction,
|
|
2408
2408
|
...y(s)
|
|
2409
2409
|
});
|
|
2410
2410
|
}
|
|
2411
2411
|
}
|
|
2412
|
-
class
|
|
2412
|
+
class ye extends v {
|
|
2413
2413
|
get schema() {
|
|
2414
2414
|
return this._def.getter();
|
|
2415
2415
|
}
|
|
@@ -2418,12 +2418,12 @@ class fe extends v {
|
|
|
2418
2418
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
2419
2419
|
}
|
|
2420
2420
|
}
|
|
2421
|
-
|
|
2421
|
+
ye.create = (n, e) => new ye({
|
|
2422
2422
|
getter: n,
|
|
2423
2423
|
typeName: m.ZodLazy,
|
|
2424
2424
|
...y(e)
|
|
2425
2425
|
});
|
|
2426
|
-
class
|
|
2426
|
+
class ve extends v {
|
|
2427
2427
|
_parse(e) {
|
|
2428
2428
|
if (e.data !== this._def.value) {
|
|
2429
2429
|
const t = this._getOrReturnCtx(e);
|
|
@@ -2439,7 +2439,7 @@ class ye extends v {
|
|
|
2439
2439
|
return this._def.value;
|
|
2440
2440
|
}
|
|
2441
2441
|
}
|
|
2442
|
-
|
|
2442
|
+
ve.create = (n, e) => new ve({
|
|
2443
2443
|
value: n,
|
|
2444
2444
|
typeName: m.ZodLiteral,
|
|
2445
2445
|
...y(e)
|
|
@@ -2453,7 +2453,7 @@ function dt(n, e) {
|
|
|
2453
2453
|
}
|
|
2454
2454
|
class M extends v {
|
|
2455
2455
|
constructor() {
|
|
2456
|
-
super(...arguments),
|
|
2456
|
+
super(...arguments), ce.set(this, void 0);
|
|
2457
2457
|
}
|
|
2458
2458
|
_parse(e) {
|
|
2459
2459
|
if (typeof e.data != "string") {
|
|
@@ -2464,7 +2464,7 @@ class M extends v {
|
|
|
2464
2464
|
code: l.invalid_type
|
|
2465
2465
|
}), f;
|
|
2466
2466
|
}
|
|
2467
|
-
if (
|
|
2467
|
+
if (Ee(this, ce) || at(this, ce, new Set(this._def.values)), !Ee(this, ce).has(e.data)) {
|
|
2468
2468
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
2469
2469
|
return p(t, {
|
|
2470
2470
|
received: t.data,
|
|
@@ -2508,15 +2508,15 @@ class M extends v {
|
|
|
2508
2508
|
});
|
|
2509
2509
|
}
|
|
2510
2510
|
}
|
|
2511
|
-
|
|
2511
|
+
ce = /* @__PURE__ */ new WeakMap();
|
|
2512
2512
|
M.create = dt;
|
|
2513
|
-
class
|
|
2513
|
+
class we extends v {
|
|
2514
2514
|
constructor() {
|
|
2515
|
-
super(...arguments),
|
|
2515
|
+
super(...arguments), ue.set(this, void 0);
|
|
2516
2516
|
}
|
|
2517
2517
|
_parse(e) {
|
|
2518
2518
|
const t = w.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
2519
|
-
if (s.parsedType !==
|
|
2519
|
+
if (s.parsedType !== h.string && s.parsedType !== h.number) {
|
|
2520
2520
|
const r = w.objectValues(t);
|
|
2521
2521
|
return p(s, {
|
|
2522
2522
|
expected: w.joinValues(r),
|
|
@@ -2524,7 +2524,7 @@ class ve extends v {
|
|
|
2524
2524
|
code: l.invalid_type
|
|
2525
2525
|
}), f;
|
|
2526
2526
|
}
|
|
2527
|
-
if (
|
|
2527
|
+
if (Ee(this, ue) || at(this, ue, new Set(w.getValidEnumValues(this._def.values))), !Ee(this, ue).has(e.data)) {
|
|
2528
2528
|
const r = w.objectValues(t);
|
|
2529
2529
|
return p(s, {
|
|
2530
2530
|
received: s.data,
|
|
@@ -2538,32 +2538,32 @@ class ve extends v {
|
|
|
2538
2538
|
return this._def.values;
|
|
2539
2539
|
}
|
|
2540
2540
|
}
|
|
2541
|
-
|
|
2542
|
-
|
|
2541
|
+
ue = /* @__PURE__ */ new WeakMap();
|
|
2542
|
+
we.create = (n, e) => new we({
|
|
2543
2543
|
values: n,
|
|
2544
2544
|
typeName: m.ZodNativeEnum,
|
|
2545
2545
|
...y(e)
|
|
2546
2546
|
});
|
|
2547
|
-
class
|
|
2547
|
+
class ne extends v {
|
|
2548
2548
|
unwrap() {
|
|
2549
2549
|
return this._def.type;
|
|
2550
2550
|
}
|
|
2551
2551
|
_parse(e) {
|
|
2552
2552
|
const { ctx: t } = this._processInputParams(e);
|
|
2553
|
-
if (t.parsedType !==
|
|
2553
|
+
if (t.parsedType !== h.promise && t.common.async === !1)
|
|
2554
2554
|
return p(t, {
|
|
2555
2555
|
code: l.invalid_type,
|
|
2556
|
-
expected:
|
|
2556
|
+
expected: h.promise,
|
|
2557
2557
|
received: t.parsedType
|
|
2558
2558
|
}), f;
|
|
2559
|
-
const s = t.parsedType ===
|
|
2559
|
+
const s = t.parsedType === h.promise ? t.data : Promise.resolve(t.data);
|
|
2560
2560
|
return T(s.then((r) => this._def.type.parseAsync(r, {
|
|
2561
2561
|
path: t.path,
|
|
2562
2562
|
errorMap: t.common.contextualErrorMap
|
|
2563
2563
|
})));
|
|
2564
2564
|
}
|
|
2565
2565
|
}
|
|
2566
|
-
|
|
2566
|
+
ne.create = (n, e) => new ne({
|
|
2567
2567
|
type: n,
|
|
2568
2568
|
typeName: m.ZodPromise,
|
|
2569
2569
|
...y(e)
|
|
@@ -2590,12 +2590,12 @@ class A extends v {
|
|
|
2590
2590
|
return Promise.resolve(o).then(async (c) => {
|
|
2591
2591
|
if (t.value === "aborted")
|
|
2592
2592
|
return f;
|
|
2593
|
-
const
|
|
2593
|
+
const u = await this._def.schema._parseAsync({
|
|
2594
2594
|
data: c,
|
|
2595
2595
|
path: s.path,
|
|
2596
2596
|
parent: s
|
|
2597
2597
|
});
|
|
2598
|
-
return
|
|
2598
|
+
return u.status === "aborted" ? f : u.status === "dirty" || t.value === "dirty" ? Ne(u.value) : u;
|
|
2599
2599
|
});
|
|
2600
2600
|
{
|
|
2601
2601
|
if (t.value === "aborted")
|
|
@@ -2605,15 +2605,15 @@ class A extends v {
|
|
|
2605
2605
|
path: s.path,
|
|
2606
2606
|
parent: s
|
|
2607
2607
|
});
|
|
2608
|
-
return c.status === "aborted" ? f : c.status === "dirty" || t.value === "dirty" ?
|
|
2608
|
+
return c.status === "aborted" ? f : c.status === "dirty" || t.value === "dirty" ? Ne(c.value) : c;
|
|
2609
2609
|
}
|
|
2610
2610
|
}
|
|
2611
2611
|
if (r.type === "refinement") {
|
|
2612
2612
|
const o = (c) => {
|
|
2613
|
-
const
|
|
2613
|
+
const u = r.refinement(c, a);
|
|
2614
2614
|
if (s.common.async)
|
|
2615
|
-
return Promise.resolve(
|
|
2616
|
-
if (
|
|
2615
|
+
return Promise.resolve(u);
|
|
2616
|
+
if (u instanceof Promise)
|
|
2617
2617
|
throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2618
2618
|
return c;
|
|
2619
2619
|
};
|
|
@@ -2659,7 +2659,7 @@ A.createWithPreprocess = (n, e, t) => new A({
|
|
|
2659
2659
|
});
|
|
2660
2660
|
class C extends v {
|
|
2661
2661
|
_parse(e) {
|
|
2662
|
-
return this._getType(e) ===
|
|
2662
|
+
return this._getType(e) === h.undefined ? T(void 0) : this._def.innerType._parse(e);
|
|
2663
2663
|
}
|
|
2664
2664
|
unwrap() {
|
|
2665
2665
|
return this._def.innerType;
|
|
@@ -2672,7 +2672,7 @@ C.create = (n, e) => new C({
|
|
|
2672
2672
|
});
|
|
2673
2673
|
class L extends v {
|
|
2674
2674
|
_parse(e) {
|
|
2675
|
-
return this._getType(e) ===
|
|
2675
|
+
return this._getType(e) === h.null ? T(null) : this._def.innerType._parse(e);
|
|
2676
2676
|
}
|
|
2677
2677
|
unwrap() {
|
|
2678
2678
|
return this._def.innerType;
|
|
@@ -2683,11 +2683,11 @@ L.create = (n, e) => new L({
|
|
|
2683
2683
|
typeName: m.ZodNullable,
|
|
2684
2684
|
...y(e)
|
|
2685
2685
|
});
|
|
2686
|
-
class
|
|
2686
|
+
class ke extends v {
|
|
2687
2687
|
_parse(e) {
|
|
2688
2688
|
const { ctx: t } = this._processInputParams(e);
|
|
2689
2689
|
let s = t.data;
|
|
2690
|
-
return t.parsedType ===
|
|
2690
|
+
return t.parsedType === h.undefined && (s = this._def.defaultValue()), this._def.innerType._parse({
|
|
2691
2691
|
data: s,
|
|
2692
2692
|
path: t.path,
|
|
2693
2693
|
parent: t
|
|
@@ -2697,13 +2697,13 @@ class we extends v {
|
|
|
2697
2697
|
return this._def.innerType;
|
|
2698
2698
|
}
|
|
2699
2699
|
}
|
|
2700
|
-
|
|
2700
|
+
ke.create = (n, e) => new ke({
|
|
2701
2701
|
innerType: n,
|
|
2702
2702
|
typeName: m.ZodDefault,
|
|
2703
2703
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2704
2704
|
...y(e)
|
|
2705
2705
|
});
|
|
2706
|
-
class
|
|
2706
|
+
class be extends v {
|
|
2707
2707
|
_parse(e) {
|
|
2708
2708
|
const { ctx: t } = this._processInputParams(e), s = {
|
|
2709
2709
|
...t,
|
|
@@ -2718,7 +2718,7 @@ class ke extends v {
|
|
|
2718
2718
|
...s
|
|
2719
2719
|
}
|
|
2720
2720
|
});
|
|
2721
|
-
return
|
|
2721
|
+
return le(r) ? r.then((a) => ({
|
|
2722
2722
|
status: "valid",
|
|
2723
2723
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2724
2724
|
get error() {
|
|
@@ -2740,31 +2740,31 @@ class ke extends v {
|
|
|
2740
2740
|
return this._def.innerType;
|
|
2741
2741
|
}
|
|
2742
2742
|
}
|
|
2743
|
-
|
|
2743
|
+
be.create = (n, e) => new be({
|
|
2744
2744
|
innerType: n,
|
|
2745
2745
|
typeName: m.ZodCatch,
|
|
2746
2746
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2747
2747
|
...y(e)
|
|
2748
2748
|
});
|
|
2749
|
-
class
|
|
2749
|
+
class De extends v {
|
|
2750
2750
|
_parse(e) {
|
|
2751
|
-
if (this._getType(e) !==
|
|
2751
|
+
if (this._getType(e) !== h.nan) {
|
|
2752
2752
|
const t = this._getOrReturnCtx(e);
|
|
2753
2753
|
return p(t, {
|
|
2754
2754
|
code: l.invalid_type,
|
|
2755
|
-
expected:
|
|
2755
|
+
expected: h.nan,
|
|
2756
2756
|
received: t.parsedType
|
|
2757
2757
|
}), f;
|
|
2758
2758
|
}
|
|
2759
2759
|
return { status: "valid", value: e.data };
|
|
2760
2760
|
}
|
|
2761
2761
|
}
|
|
2762
|
-
|
|
2762
|
+
De.create = (n) => new De({
|
|
2763
2763
|
typeName: m.ZodNaN,
|
|
2764
2764
|
...y(n)
|
|
2765
2765
|
});
|
|
2766
|
-
const
|
|
2767
|
-
class
|
|
2766
|
+
const Wt = Symbol("zod_brand");
|
|
2767
|
+
class Je extends v {
|
|
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 Qe extends v {
|
|
|
2777
2777
|
return this._def.type;
|
|
2778
2778
|
}
|
|
2779
2779
|
}
|
|
2780
|
-
class
|
|
2780
|
+
class Te extends v {
|
|
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 be extends v {
|
|
|
2787
2787
|
path: s.path,
|
|
2788
2788
|
parent: s
|
|
2789
2789
|
});
|
|
2790
|
-
return r.status === "aborted" ? f : r.status === "dirty" ? (t.dirty(),
|
|
2790
|
+
return r.status === "aborted" ? f : r.status === "dirty" ? (t.dirty(), Ne(r.value)) : this._def.out._parseAsync({
|
|
2791
2791
|
data: r.value,
|
|
2792
2792
|
path: s.path,
|
|
2793
2793
|
parent: s
|
|
@@ -2810,7 +2810,7 @@ class be extends v {
|
|
|
2810
2810
|
}
|
|
2811
2811
|
}
|
|
2812
2812
|
static create(e, t) {
|
|
2813
|
-
return new
|
|
2813
|
+
return new Te({
|
|
2814
2814
|
in: e,
|
|
2815
2815
|
out: t,
|
|
2816
2816
|
typeName: m.ZodPipeline
|
|
@@ -2820,7 +2820,7 @@ class be extends v {
|
|
|
2820
2820
|
class xe extends v {
|
|
2821
2821
|
_parse(e) {
|
|
2822
2822
|
const t = this._def.innerType._parse(e), s = (r) => (de(r) && (r.value = Object.freeze(r.value)), r);
|
|
2823
|
-
return
|
|
2823
|
+
return le(t) ? t.then((r) => s(r)) : s(t);
|
|
2824
2824
|
}
|
|
2825
2825
|
unwrap() {
|
|
2826
2826
|
return this._def.innerType;
|
|
@@ -2831,151 +2831,151 @@ xe.create = (n, e) => new xe({
|
|
|
2831
2831
|
typeName: m.ZodReadonly,
|
|
2832
2832
|
...y(e)
|
|
2833
2833
|
});
|
|
2834
|
-
function
|
|
2835
|
-
return n ?
|
|
2834
|
+
function lt(n, e = {}, t) {
|
|
2835
|
+
return n ? te.create().superRefine((s, r) => {
|
|
2836
2836
|
var a, o;
|
|
2837
2837
|
if (!n(s)) {
|
|
2838
|
-
const c = typeof e == "function" ? e(s) : typeof e == "string" ? { message: e } : e,
|
|
2839
|
-
r.addIssue({ code: "custom", ...
|
|
2838
|
+
const c = typeof e == "function" ? e(s) : typeof e == "string" ? { message: e } : e, u = (o = (a = c.fatal) !== null && a !== void 0 ? a : t) !== null && o !== void 0 ? o : !0, d = typeof c == "string" ? { message: c } : c;
|
|
2839
|
+
r.addIssue({ code: "custom", ...d, fatal: u });
|
|
2840
2840
|
}
|
|
2841
|
-
}) :
|
|
2841
|
+
}) : te.create();
|
|
2842
2842
|
}
|
|
2843
|
-
const
|
|
2844
|
-
object:
|
|
2843
|
+
const Qt = {
|
|
2844
|
+
object: b.lazycreate
|
|
2845
2845
|
};
|
|
2846
2846
|
var m;
|
|
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
|
})(m || (m = {}));
|
|
2850
|
-
const
|
|
2850
|
+
const Jt = (n, e = {
|
|
2851
2851
|
message: `Input not instance of ${n.name}`
|
|
2852
|
-
}) =>
|
|
2852
|
+
}) => lt((t) => t instanceof n, e), pt = j.create, ht = D.create, Ht = De.create, Gt = F.create, _t = pe.create, Yt = B.create, Xt = $e.create, en = he.create, tn = _e.create, nn = te.create, sn = q.create, rn = $.create, an = Pe.create, on = I.create, cn = b.create, un = b.strictCreate, dn = ge.create, ln = Fe.create, pn = me.create, hn = E.create, _n = fe.create, gn = Re.create, mn = K.create, fn = X.create, yn = ye.create, vn = ve.create, wn = M.create, kn = we.create, bn = ne.create, nt = A.create, xn = C.create, Tn = L.create, On = A.createWithPreprocess, Sn = Te.create, Zn = () => pt().optional(), jn = () => ht().optional(), In = () => _t().optional(), An = {
|
|
2853
2853
|
string: (n) => j.create({ ...n, coerce: !0 }),
|
|
2854
2854
|
number: (n) => D.create({ ...n, coerce: !0 }),
|
|
2855
|
-
boolean: (n) =>
|
|
2855
|
+
boolean: (n) => pe.create({
|
|
2856
2856
|
...n,
|
|
2857
2857
|
coerce: !0
|
|
2858
2858
|
}),
|
|
2859
2859
|
bigint: (n) => F.create({ ...n, coerce: !0 }),
|
|
2860
2860
|
date: (n) => B.create({ ...n, coerce: !0 })
|
|
2861
|
-
},
|
|
2861
|
+
}, Cn = f;
|
|
2862
2862
|
var i = /* @__PURE__ */ Object.freeze({
|
|
2863
2863
|
__proto__: null,
|
|
2864
|
-
defaultErrorMap:
|
|
2865
|
-
setErrorMap:
|
|
2866
|
-
getErrorMap:
|
|
2867
|
-
makeIssue:
|
|
2868
|
-
EMPTY_PATH:
|
|
2864
|
+
defaultErrorMap: ee,
|
|
2865
|
+
setErrorMap: At,
|
|
2866
|
+
getErrorMap: Ae,
|
|
2867
|
+
makeIssue: Ce,
|
|
2868
|
+
EMPTY_PATH: Ct,
|
|
2869
2869
|
addIssueToContext: p,
|
|
2870
|
-
ParseStatus:
|
|
2870
|
+
ParseStatus: x,
|
|
2871
2871
|
INVALID: f,
|
|
2872
|
-
DIRTY:
|
|
2872
|
+
DIRTY: Ne,
|
|
2873
2873
|
OK: T,
|
|
2874
|
-
isAborted:
|
|
2875
|
-
isDirty:
|
|
2874
|
+
isAborted: Ke,
|
|
2875
|
+
isDirty: We,
|
|
2876
2876
|
isValid: de,
|
|
2877
|
-
isAsync:
|
|
2877
|
+
isAsync: le,
|
|
2878
2878
|
get util() {
|
|
2879
2879
|
return w;
|
|
2880
2880
|
},
|
|
2881
2881
|
get objectUtil() {
|
|
2882
|
-
return
|
|
2882
|
+
return Be;
|
|
2883
2883
|
},
|
|
2884
|
-
ZodParsedType:
|
|
2884
|
+
ZodParsedType: h,
|
|
2885
2885
|
getParsedType: R,
|
|
2886
2886
|
ZodType: v,
|
|
2887
|
-
datetimeRegex:
|
|
2887
|
+
datetimeRegex: ut,
|
|
2888
2888
|
ZodString: j,
|
|
2889
2889
|
ZodNumber: D,
|
|
2890
2890
|
ZodBigInt: F,
|
|
2891
|
-
ZodBoolean:
|
|
2891
|
+
ZodBoolean: pe,
|
|
2892
2892
|
ZodDate: B,
|
|
2893
|
-
ZodSymbol:
|
|
2894
|
-
ZodUndefined:
|
|
2895
|
-
ZodNull:
|
|
2896
|
-
ZodAny:
|
|
2897
|
-
ZodUnknown:
|
|
2893
|
+
ZodSymbol: $e,
|
|
2894
|
+
ZodUndefined: he,
|
|
2895
|
+
ZodNull: _e,
|
|
2896
|
+
ZodAny: te,
|
|
2897
|
+
ZodUnknown: q,
|
|
2898
2898
|
ZodNever: $,
|
|
2899
|
-
ZodVoid:
|
|
2899
|
+
ZodVoid: Pe,
|
|
2900
2900
|
ZodArray: I,
|
|
2901
|
-
ZodObject:
|
|
2902
|
-
ZodUnion:
|
|
2903
|
-
ZodDiscriminatedUnion:
|
|
2904
|
-
ZodIntersection:
|
|
2901
|
+
ZodObject: b,
|
|
2902
|
+
ZodUnion: ge,
|
|
2903
|
+
ZodDiscriminatedUnion: Fe,
|
|
2904
|
+
ZodIntersection: me,
|
|
2905
2905
|
ZodTuple: E,
|
|
2906
|
-
ZodRecord:
|
|
2907
|
-
ZodMap:
|
|
2906
|
+
ZodRecord: fe,
|
|
2907
|
+
ZodMap: Re,
|
|
2908
2908
|
ZodSet: K,
|
|
2909
|
-
ZodFunction:
|
|
2910
|
-
ZodLazy:
|
|
2911
|
-
ZodLiteral:
|
|
2909
|
+
ZodFunction: X,
|
|
2910
|
+
ZodLazy: ye,
|
|
2911
|
+
ZodLiteral: ve,
|
|
2912
2912
|
ZodEnum: M,
|
|
2913
|
-
ZodNativeEnum:
|
|
2914
|
-
ZodPromise:
|
|
2913
|
+
ZodNativeEnum: we,
|
|
2914
|
+
ZodPromise: ne,
|
|
2915
2915
|
ZodEffects: A,
|
|
2916
2916
|
ZodTransformer: A,
|
|
2917
2917
|
ZodOptional: C,
|
|
2918
2918
|
ZodNullable: L,
|
|
2919
|
-
ZodDefault:
|
|
2920
|
-
ZodCatch:
|
|
2921
|
-
ZodNaN:
|
|
2922
|
-
BRAND:
|
|
2923
|
-
ZodBranded:
|
|
2924
|
-
ZodPipeline:
|
|
2919
|
+
ZodDefault: ke,
|
|
2920
|
+
ZodCatch: be,
|
|
2921
|
+
ZodNaN: De,
|
|
2922
|
+
BRAND: Wt,
|
|
2923
|
+
ZodBranded: Je,
|
|
2924
|
+
ZodPipeline: Te,
|
|
2925
2925
|
ZodReadonly: xe,
|
|
2926
|
-
custom:
|
|
2926
|
+
custom: lt,
|
|
2927
2927
|
Schema: v,
|
|
2928
2928
|
ZodSchema: v,
|
|
2929
|
-
late:
|
|
2929
|
+
late: Qt,
|
|
2930
2930
|
get ZodFirstPartyTypeKind() {
|
|
2931
2931
|
return m;
|
|
2932
2932
|
},
|
|
2933
|
-
coerce:
|
|
2934
|
-
any:
|
|
2935
|
-
array:
|
|
2936
|
-
bigint:
|
|
2937
|
-
boolean:
|
|
2933
|
+
coerce: An,
|
|
2934
|
+
any: nn,
|
|
2935
|
+
array: on,
|
|
2936
|
+
bigint: Gt,
|
|
2937
|
+
boolean: _t,
|
|
2938
2938
|
date: Yt,
|
|
2939
|
-
discriminatedUnion:
|
|
2940
|
-
effect:
|
|
2941
|
-
enum:
|
|
2942
|
-
function:
|
|
2943
|
-
instanceof:
|
|
2944
|
-
intersection:
|
|
2945
|
-
lazy:
|
|
2946
|
-
literal:
|
|
2947
|
-
map:
|
|
2939
|
+
discriminatedUnion: ln,
|
|
2940
|
+
effect: nt,
|
|
2941
|
+
enum: wn,
|
|
2942
|
+
function: fn,
|
|
2943
|
+
instanceof: Jt,
|
|
2944
|
+
intersection: pn,
|
|
2945
|
+
lazy: yn,
|
|
2946
|
+
literal: vn,
|
|
2947
|
+
map: gn,
|
|
2948
2948
|
nan: Ht,
|
|
2949
|
-
nativeEnum:
|
|
2950
|
-
never:
|
|
2951
|
-
null:
|
|
2952
|
-
nullable:
|
|
2953
|
-
number:
|
|
2954
|
-
object:
|
|
2955
|
-
oboolean:
|
|
2956
|
-
onumber:
|
|
2949
|
+
nativeEnum: kn,
|
|
2950
|
+
never: rn,
|
|
2951
|
+
null: tn,
|
|
2952
|
+
nullable: Tn,
|
|
2953
|
+
number: ht,
|
|
2954
|
+
object: cn,
|
|
2955
|
+
oboolean: In,
|
|
2956
|
+
onumber: jn,
|
|
2957
2957
|
optional: xn,
|
|
2958
|
-
ostring:
|
|
2959
|
-
pipeline:
|
|
2960
|
-
preprocess:
|
|
2961
|
-
promise:
|
|
2962
|
-
record:
|
|
2963
|
-
set:
|
|
2964
|
-
strictObject:
|
|
2965
|
-
string:
|
|
2966
|
-
symbol:
|
|
2967
|
-
transformer:
|
|
2968
|
-
tuple:
|
|
2969
|
-
undefined:
|
|
2958
|
+
ostring: Zn,
|
|
2959
|
+
pipeline: Sn,
|
|
2960
|
+
preprocess: On,
|
|
2961
|
+
promise: bn,
|
|
2962
|
+
record: _n,
|
|
2963
|
+
set: mn,
|
|
2964
|
+
strictObject: un,
|
|
2965
|
+
string: pt,
|
|
2966
|
+
symbol: Xt,
|
|
2967
|
+
transformer: nt,
|
|
2968
|
+
tuple: hn,
|
|
2969
|
+
undefined: en,
|
|
2970
2970
|
union: dn,
|
|
2971
|
-
unknown:
|
|
2972
|
-
void:
|
|
2973
|
-
NEVER:
|
|
2971
|
+
unknown: sn,
|
|
2972
|
+
void: an,
|
|
2973
|
+
NEVER: Cn,
|
|
2974
2974
|
ZodIssueCode: l,
|
|
2975
|
-
quotelessJson:
|
|
2975
|
+
quotelessJson: It,
|
|
2976
2976
|
ZodError: Z
|
|
2977
2977
|
});
|
|
2978
|
-
|
|
2978
|
+
jt(i);
|
|
2979
2979
|
i.object({
|
|
2980
2980
|
start: i.number(),
|
|
2981
2981
|
limit: i.number(),
|
|
@@ -2984,7 +2984,7 @@ i.object({
|
|
|
2984
2984
|
const He = i.object({
|
|
2985
2985
|
created_at: i.string(),
|
|
2986
2986
|
updated_at: i.string()
|
|
2987
|
-
}),
|
|
2987
|
+
}), Nn = 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 He = 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()), En = i.object({
|
|
2997
2997
|
connection: i.string(),
|
|
2998
2998
|
user_id: i.string(),
|
|
2999
2999
|
provider: i.string(),
|
|
@@ -3001,8 +3001,8 @@ const He = 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: Nn.optional()
|
|
3005
|
+
}), gt = 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 He = i.object({
|
|
|
3014
3014
|
linked_to: i.string().optional(),
|
|
3015
3015
|
profileData: i.string().optional(),
|
|
3016
3016
|
user_id: i.string().optional()
|
|
3017
|
-
}),
|
|
3017
|
+
}), $n = gt.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 He = i.object({
|
|
|
3023
3023
|
provider: i.string().default("email"),
|
|
3024
3024
|
connection: i.string().default("email")
|
|
3025
3025
|
});
|
|
3026
|
-
|
|
3026
|
+
$n.extend(He.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(En).optional()
|
|
3033
3033
|
});
|
|
3034
|
-
|
|
3034
|
+
gt.extend({
|
|
3035
3035
|
email: i.string(),
|
|
3036
3036
|
login_count: i.number(),
|
|
3037
3037
|
multifactor: i.array(i.string()).optional(),
|
|
@@ -3039,7 +3039,7 @@ _t.extend({
|
|
|
3039
3039
|
last_login: i.string().optional(),
|
|
3040
3040
|
user_id: i.string()
|
|
3041
3041
|
}).catchall(i.any());
|
|
3042
|
-
const
|
|
3042
|
+
const Pn = i.object({
|
|
3043
3043
|
id: i.string(),
|
|
3044
3044
|
name: i.string(),
|
|
3045
3045
|
allowed_web_origins: i.string().transform((n) => n === null ? "" : n).default(""),
|
|
@@ -3052,23 +3052,23 @@ const $n = i.object({
|
|
|
3052
3052
|
i.object({
|
|
3053
3053
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3054
3054
|
updated_at: i.string().transform((n) => n === null ? "" : n)
|
|
3055
|
-
}).extend(
|
|
3056
|
-
var
|
|
3057
|
-
const
|
|
3055
|
+
}).extend(Pn.shape);
|
|
3056
|
+
var mt = /* @__PURE__ */ ((n) => (n.TOKEN = "token", n.TOKEN_ID_TOKEN = "token id_token", n.CODE = "code", n))(mt || {}), ft = /* @__PURE__ */ ((n) => (n.QUERY = "query", n.FRAGMENT = "fragment", n.FORM_POST = "form_post", n.WEB_MESSAGE = "web_message", n))(ft || {}), yt = /* @__PURE__ */ ((n) => (n.S265 = "S256", n.plain = "plain", n))(yt || {});
|
|
3057
|
+
const Ge = i.object({
|
|
3058
3058
|
client_id: i.string(),
|
|
3059
3059
|
vendor_id: i.string().optional(),
|
|
3060
|
-
response_type: i.nativeEnum(
|
|
3061
|
-
response_mode: i.nativeEnum(
|
|
3060
|
+
response_type: i.nativeEnum(mt).optional(),
|
|
3061
|
+
response_mode: i.nativeEnum(ft).optional(),
|
|
3062
3062
|
redirect_uri: i.string().optional(),
|
|
3063
3063
|
audience: i.string().optional(),
|
|
3064
3064
|
state: i.string().optional(),
|
|
3065
3065
|
nonce: i.string().optional(),
|
|
3066
3066
|
scope: i.string().optional(),
|
|
3067
|
-
code_challenge_method: i.nativeEnum(
|
|
3067
|
+
code_challenge_method: i.nativeEnum(yt).optional(),
|
|
3068
3068
|
code_challenge: i.string().optional(),
|
|
3069
3069
|
username: i.string().optional()
|
|
3070
|
-
}),
|
|
3071
|
-
authParams:
|
|
3070
|
+
}), Rn = i.object({
|
|
3071
|
+
authParams: Ge,
|
|
3072
3072
|
code: i.string(),
|
|
3073
3073
|
user_id: i.string(),
|
|
3074
3074
|
created_at: i.string(),
|
|
@@ -3076,7 +3076,7 @@ const Je = i.object({
|
|
|
3076
3076
|
used_at: i.string().optional()
|
|
3077
3077
|
});
|
|
3078
3078
|
i.object({
|
|
3079
|
-
...
|
|
3079
|
+
...Rn.shape,
|
|
3080
3080
|
created_at: i.string()
|
|
3081
3081
|
});
|
|
3082
3082
|
i.object({
|
|
@@ -3095,7 +3095,7 @@ i.object({
|
|
|
3095
3095
|
url: i.string()
|
|
3096
3096
|
}).optional()
|
|
3097
3097
|
});
|
|
3098
|
-
const
|
|
3098
|
+
const Dn = i.object({
|
|
3099
3099
|
id: i.string().optional(),
|
|
3100
3100
|
name: i.string(),
|
|
3101
3101
|
client_id: i.string().optional(),
|
|
@@ -3114,16 +3114,16 @@ const Rn = i.object({
|
|
|
3114
3114
|
id: i.string(),
|
|
3115
3115
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3116
3116
|
updated_at: i.string().transform((n) => n === null ? "" : n)
|
|
3117
|
-
}).extend(
|
|
3117
|
+
}).extend(Dn.shape), Fn = i.object({
|
|
3118
3118
|
domain: i.string(),
|
|
3119
3119
|
dkim_private_key: i.string().optional(),
|
|
3120
3120
|
dkim_public_key: i.string().optional(),
|
|
3121
3121
|
email_api_key: i.string().optional(),
|
|
3122
3122
|
email_service: i.union([i.literal("mailgun"), i.literal("mailchannels")]).optional()
|
|
3123
|
-
}),
|
|
3123
|
+
}), vt = i.object({
|
|
3124
3124
|
id: i.string(),
|
|
3125
3125
|
name: i.string(),
|
|
3126
|
-
domains: i.array(
|
|
3126
|
+
domains: i.array(Fn),
|
|
3127
3127
|
allowed_callback_urls: i.array(i.string()),
|
|
3128
3128
|
allowed_logout_urls: i.array(i.string()),
|
|
3129
3129
|
allowed_web_origins: i.array(i.string()),
|
|
@@ -3147,13 +3147,13 @@ const Rn = i.object({
|
|
|
3147
3147
|
language: i.string().length(2).optional()
|
|
3148
3148
|
})
|
|
3149
3149
|
});
|
|
3150
|
-
|
|
3150
|
+
vt.extend({
|
|
3151
3151
|
connections: i.array(Ye)
|
|
3152
3152
|
});
|
|
3153
|
-
|
|
3153
|
+
vt.extend({
|
|
3154
3154
|
connections: i.array(Ye.partial())
|
|
3155
3155
|
});
|
|
3156
|
-
const
|
|
3156
|
+
const Mn = i.object({
|
|
3157
3157
|
domain: i.string(),
|
|
3158
3158
|
dkim_private_key: i.string().optional(),
|
|
3159
3159
|
dkim_public_key: i.string().optional(),
|
|
@@ -3161,20 +3161,20 @@ const Fn = i.object({
|
|
|
3161
3161
|
email_service: i.enum(["mailgun", "mailchannels"])
|
|
3162
3162
|
});
|
|
3163
3163
|
He.extend({
|
|
3164
|
-
...
|
|
3164
|
+
...Mn.shape,
|
|
3165
3165
|
id: i.string()
|
|
3166
3166
|
});
|
|
3167
|
-
const
|
|
3167
|
+
const Ln = i.object({
|
|
3168
3168
|
trigger_id: i.enum(["post-user-registration", "post-user-login"]),
|
|
3169
3169
|
enabled: i.boolean().default(!1),
|
|
3170
3170
|
url: i.string(),
|
|
3171
3171
|
hook_id: i.string().optional()
|
|
3172
3172
|
});
|
|
3173
|
-
|
|
3173
|
+
Ln.extend({
|
|
3174
3174
|
...He.shape,
|
|
3175
3175
|
hook_id: i.string()
|
|
3176
3176
|
});
|
|
3177
|
-
const
|
|
3177
|
+
const Un = i.object({
|
|
3178
3178
|
alg: i.string(),
|
|
3179
3179
|
e: i.string(),
|
|
3180
3180
|
kid: i.string(),
|
|
@@ -3183,7 +3183,7 @@ const Ln = i.object({
|
|
|
3183
3183
|
use: i.string().optional()
|
|
3184
3184
|
});
|
|
3185
3185
|
i.object({
|
|
3186
|
-
keys: i.array(
|
|
3186
|
+
keys: i.array(Un)
|
|
3187
3187
|
});
|
|
3188
3188
|
i.object({
|
|
3189
3189
|
issuer: i.string(),
|
|
@@ -3207,31 +3207,94 @@ i.object({
|
|
|
3207
3207
|
request_parameter_supported: i.boolean(),
|
|
3208
3208
|
token_endpoint_auth_signing_alg_values_supported: i.array(i.string())
|
|
3209
3209
|
});
|
|
3210
|
-
const
|
|
3210
|
+
const zn = i.enum([
|
|
3211
|
+
"sapi",
|
|
3212
|
+
// SUCCESS_API_OPERATION
|
|
3213
|
+
"ssa",
|
|
3214
|
+
// SUCCESS_SILENT_AUTH - omitted for brevity and since it's clear from context
|
|
3215
|
+
"fsa",
|
|
3216
|
+
// FAILED_SILENT_AUTH
|
|
3217
|
+
"ss",
|
|
3218
|
+
// SUCCESS_SIGNUP
|
|
3219
|
+
"ssa",
|
|
3220
|
+
/// SUCCESS_SILENT_AUTH
|
|
3221
|
+
"fs",
|
|
3222
|
+
"s",
|
|
3223
|
+
// SUCCESS_LOGIN
|
|
3224
|
+
"f",
|
|
3225
|
+
// FAILED_LOGIN
|
|
3226
|
+
"fp",
|
|
3227
|
+
// FAILED_LOGIN_INCORRECT_PASSWORD
|
|
3228
|
+
// FAILED_LOGIN_INVALID_EMAIL_USERNAME = "fu", - we don't have this in the logs yet
|
|
3229
|
+
"slo",
|
|
3230
|
+
// SUCCESS_LOGOUT
|
|
3231
|
+
"scoa",
|
|
3232
|
+
// SUCCESS_CROSS_ORIGIN_AUTHENTICATION
|
|
3233
|
+
"fcoa",
|
|
3234
|
+
// FAILED_CROSS_ORIGIN_AUTHENTICATION
|
|
3235
|
+
"seccft",
|
|
3236
|
+
// NOT_IMPLEMENTED_1 - not implemented - just for completion as we do get this in our latest auth0 logs
|
|
3237
|
+
"cls",
|
|
3238
|
+
// NOT_IMPLEMENTED_2
|
|
3239
|
+
"seacft",
|
|
3240
|
+
// SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN
|
|
3241
|
+
"serft"
|
|
3242
|
+
]), Vn = i.object({
|
|
3243
|
+
name: i.string(),
|
|
3244
|
+
version: i.string(),
|
|
3245
|
+
env: i.object({
|
|
3246
|
+
node: i.string().optional()
|
|
3247
|
+
}).optional()
|
|
3248
|
+
});
|
|
3249
|
+
i.object({
|
|
3250
|
+
type: zn,
|
|
3251
|
+
date: i.string(),
|
|
3252
|
+
description: i.string().optional(),
|
|
3253
|
+
log_id: i.string().optional(),
|
|
3254
|
+
_id: i.string().optional(),
|
|
3255
|
+
ip: i.string(),
|
|
3256
|
+
user_agent: i.string(),
|
|
3257
|
+
details: i.any().optional(),
|
|
3258
|
+
// Using z.any() as a placeholder for "details" type
|
|
3259
|
+
isMobile: i.boolean(),
|
|
3260
|
+
user_id: i.string().optional(),
|
|
3261
|
+
user_name: i.string().optional(),
|
|
3262
|
+
connection: i.string().optional(),
|
|
3263
|
+
connection_id: i.string().optional(),
|
|
3264
|
+
client_id: i.string().optional(),
|
|
3265
|
+
client_name: i.string().optional(),
|
|
3266
|
+
audience: i.string().optional(),
|
|
3267
|
+
scope: i.array(i.string()).optional(),
|
|
3268
|
+
strategy: i.string().optional(),
|
|
3269
|
+
strategy_type: i.string().optional(),
|
|
3270
|
+
hostname: i.string().optional(),
|
|
3271
|
+
auth0_client: Vn.optional()
|
|
3272
|
+
});
|
|
3273
|
+
const qn = i.object({
|
|
3211
3274
|
id: i.string(),
|
|
3212
3275
|
email: i.string(),
|
|
3213
3276
|
code: i.string(),
|
|
3214
3277
|
ip: i.string().optional(),
|
|
3215
3278
|
send: i.enum(["code", "link"]),
|
|
3216
|
-
authParams:
|
|
3279
|
+
authParams: Ge,
|
|
3217
3280
|
expires_at: i.string(),
|
|
3218
3281
|
used_at: i.string().optional(),
|
|
3219
3282
|
user_id: i.string().optional()
|
|
3220
3283
|
});
|
|
3221
3284
|
i.object({
|
|
3222
3285
|
created_at: i.string(),
|
|
3223
|
-
...
|
|
3286
|
+
...qn.shape
|
|
3224
3287
|
});
|
|
3225
|
-
const
|
|
3288
|
+
const Bn = i.object({
|
|
3226
3289
|
user_id: i.string(),
|
|
3227
3290
|
password: i.string()
|
|
3228
3291
|
});
|
|
3229
3292
|
i.object({
|
|
3230
|
-
...
|
|
3293
|
+
...Bn.shape,
|
|
3231
3294
|
created_at: i.string(),
|
|
3232
3295
|
updated_at: i.string()
|
|
3233
3296
|
});
|
|
3234
|
-
const
|
|
3297
|
+
const Kn = i.object({
|
|
3235
3298
|
session_id: i.string(),
|
|
3236
3299
|
client_id: i.string(),
|
|
3237
3300
|
expires_at: i.string(),
|
|
@@ -3241,7 +3304,7 @@ const qn = i.object({
|
|
|
3241
3304
|
});
|
|
3242
3305
|
i.object({
|
|
3243
3306
|
created_at: i.string(),
|
|
3244
|
-
...
|
|
3307
|
+
...Kn.shape
|
|
3245
3308
|
});
|
|
3246
3309
|
i.object({
|
|
3247
3310
|
private_key: i.string(),
|
|
@@ -3270,7 +3333,7 @@ i.object({
|
|
|
3270
3333
|
revoked: i.boolean().optional().openapi({ description: "True if the key is revoked" }),
|
|
3271
3334
|
revoked_at: i.string().optional().openapi({ description: "The date and time when the key was revoked" })
|
|
3272
3335
|
});
|
|
3273
|
-
const
|
|
3336
|
+
const Wn = i.object({
|
|
3274
3337
|
name: i.string(),
|
|
3275
3338
|
audience: i.string(),
|
|
3276
3339
|
sender_email: i.string().email(),
|
|
@@ -3281,7 +3344,7 @@ const Vn = i.object({
|
|
|
3281
3344
|
secondary_color: i.string().optional(),
|
|
3282
3345
|
language: i.string().optional()
|
|
3283
3346
|
});
|
|
3284
|
-
|
|
3347
|
+
Wn.extend({
|
|
3285
3348
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3286
3349
|
updated_at: i.string().transform((n) => n === null ? "" : n)
|
|
3287
3350
|
});
|
|
@@ -3303,10 +3366,10 @@ i.object({
|
|
|
3303
3366
|
siteUrl: i.string().nullable(),
|
|
3304
3367
|
manageSubscriptionsUrl: i.string().optional()
|
|
3305
3368
|
});
|
|
3306
|
-
var
|
|
3307
|
-
const
|
|
3369
|
+
var wt = /* @__PURE__ */ ((n) => (n.RefreshToken = "refresh_token", n.AuthorizationCode = "authorization_code", n.ClientCredential = "client_credentials", n.Passwordless = "passwordless", n.Password = "password", n))(wt || {});
|
|
3370
|
+
const Xe = i.nativeEnum(wt);
|
|
3308
3371
|
i.object({
|
|
3309
|
-
grant_type:
|
|
3372
|
+
grant_type: Xe.refine(
|
|
3310
3373
|
(n) => n === "authorization_code"
|
|
3311
3374
|
/* AuthorizationCode */
|
|
3312
3375
|
),
|
|
@@ -3315,7 +3378,7 @@ i.object({
|
|
|
3315
3378
|
client_id: i.string()
|
|
3316
3379
|
});
|
|
3317
3380
|
i.object({
|
|
3318
|
-
grant_type:
|
|
3381
|
+
grant_type: Xe.refine(
|
|
3319
3382
|
(n) => n === "authorization_code"
|
|
3320
3383
|
/* AuthorizationCode */
|
|
3321
3384
|
),
|
|
@@ -3325,7 +3388,7 @@ i.object({
|
|
|
3325
3388
|
redirect_uri: i.string()
|
|
3326
3389
|
});
|
|
3327
3390
|
i.object({
|
|
3328
|
-
grant_type:
|
|
3391
|
+
grant_type: Xe.refine(
|
|
3329
3392
|
(n) => n === "client_credentials"
|
|
3330
3393
|
/* ClientCredential */
|
|
3331
3394
|
),
|
|
@@ -3347,87 +3410,88 @@ i.object({
|
|
|
3347
3410
|
code: i.string(),
|
|
3348
3411
|
state: i.string().optional()
|
|
3349
3412
|
});
|
|
3350
|
-
const
|
|
3413
|
+
const Qn = i.object({
|
|
3351
3414
|
id: i.string(),
|
|
3352
3415
|
expires_at: i.string(),
|
|
3353
3416
|
auth0Client: i.string().optional(),
|
|
3354
|
-
authParams:
|
|
3417
|
+
authParams: Ge
|
|
3355
3418
|
});
|
|
3356
3419
|
i.object({
|
|
3357
|
-
...
|
|
3420
|
+
...Qn.shape,
|
|
3358
3421
|
created_at: i.string(),
|
|
3359
3422
|
updated_at: i.string()
|
|
3360
3423
|
});
|
|
3361
|
-
const
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
"
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
"
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3424
|
+
const Jn = i.object({
|
|
3425
|
+
button_border_radius: i.number(),
|
|
3426
|
+
button_border_weight: i.number(),
|
|
3427
|
+
buttons_style: i.enum(["pill"]),
|
|
3428
|
+
input_border_radius: i.number(),
|
|
3429
|
+
input_border_weight: i.number(),
|
|
3430
|
+
inputs_style: i.enum(["pill"]),
|
|
3431
|
+
show_widget_shadow: i.boolean(),
|
|
3432
|
+
widget_border_weight: i.number(),
|
|
3433
|
+
widget_corner_radius: i.number()
|
|
3434
|
+
}), Hn = i.object({
|
|
3435
|
+
base_focus_color: i.string(),
|
|
3436
|
+
base_hover_color: i.string(),
|
|
3437
|
+
body_text: i.string(),
|
|
3438
|
+
captcha_widget_theme: i.enum(["auto"]),
|
|
3439
|
+
error: i.string(),
|
|
3440
|
+
header: i.string(),
|
|
3441
|
+
icons: i.string(),
|
|
3442
|
+
input_background: i.string(),
|
|
3443
|
+
input_border: i.string(),
|
|
3444
|
+
input_filled_text: i.string(),
|
|
3445
|
+
input_labels_placeholders: i.string(),
|
|
3446
|
+
links_focused_components: i.string(),
|
|
3447
|
+
primary_button: i.string(),
|
|
3448
|
+
primary_button_label: i.string(),
|
|
3449
|
+
secondary_button_border: i.string(),
|
|
3450
|
+
secondary_button_label: i.string(),
|
|
3451
|
+
success: i.string(),
|
|
3452
|
+
widget_background: i.string(),
|
|
3453
|
+
widget_border: i.string()
|
|
3454
|
+
}), G = i.object({
|
|
3455
|
+
bold: i.boolean(),
|
|
3456
|
+
size: i.number()
|
|
3457
|
+
}), Gn = i.object({
|
|
3458
|
+
body_text: G,
|
|
3459
|
+
buttons_text: G,
|
|
3460
|
+
font_url: i.string(),
|
|
3461
|
+
input_labels: G,
|
|
3462
|
+
links: G,
|
|
3463
|
+
links_style: i.enum(["normal"]),
|
|
3464
|
+
reference_text_size: i.number(),
|
|
3465
|
+
subtitle: G,
|
|
3466
|
+
title: G
|
|
3467
|
+
}), Yn = i.object({
|
|
3468
|
+
background_color: i.string(),
|
|
3469
|
+
background_image_url: i.string(),
|
|
3470
|
+
page_layout: i.enum(["center"])
|
|
3471
|
+
}), Xn = i.object({
|
|
3472
|
+
header_text_alignment: i.enum(["center"]),
|
|
3473
|
+
logo_height: i.number(),
|
|
3474
|
+
logo_position: i.enum(["center"]),
|
|
3475
|
+
logo_url: i.string(),
|
|
3476
|
+
social_buttons_layout: i.enum(["bottom"])
|
|
3477
|
+
}), es = i.object({
|
|
3478
|
+
borders: Jn,
|
|
3479
|
+
colors: Hn,
|
|
3480
|
+
displayName: i.string(),
|
|
3481
|
+
fonts: Gn,
|
|
3482
|
+
page_background: Yn,
|
|
3483
|
+
widget: Xn
|
|
3399
3484
|
});
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
date: i.string(),
|
|
3403
|
-
description: i.string().optional(),
|
|
3404
|
-
log_id: i.string().optional(),
|
|
3405
|
-
_id: i.string().optional(),
|
|
3406
|
-
ip: i.string(),
|
|
3407
|
-
user_agent: i.string(),
|
|
3408
|
-
details: i.any().optional(),
|
|
3409
|
-
// Using z.any() as a placeholder for "details" type
|
|
3410
|
-
isMobile: i.boolean(),
|
|
3411
|
-
user_id: i.string().optional(),
|
|
3412
|
-
user_name: i.string().optional(),
|
|
3413
|
-
connection: i.string().optional(),
|
|
3414
|
-
connection_id: i.string().optional(),
|
|
3415
|
-
client_id: i.string().optional(),
|
|
3416
|
-
client_name: i.string().optional(),
|
|
3417
|
-
audience: i.string().optional(),
|
|
3418
|
-
scope: i.array(i.string()).optional(),
|
|
3419
|
-
strategy: i.string().optional(),
|
|
3420
|
-
strategy_type: i.string().optional(),
|
|
3421
|
-
hostname: i.string().optional(),
|
|
3422
|
-
auth0_client: Wn.optional()
|
|
3485
|
+
es.extend({
|
|
3486
|
+
themeId: i.string()
|
|
3423
3487
|
});
|
|
3424
|
-
function
|
|
3488
|
+
function et(n) {
|
|
3425
3489
|
const [e, t] = n.split("|");
|
|
3426
3490
|
if (!e || !t)
|
|
3427
3491
|
throw new Error(`Invalid user_id: ${n}`);
|
|
3428
3492
|
return { connection: e, id: t };
|
|
3429
3493
|
}
|
|
3430
|
-
function
|
|
3494
|
+
function kt(n) {
|
|
3431
3495
|
let e = {};
|
|
3432
3496
|
try {
|
|
3433
3497
|
e = JSON.parse(n.profileData || "{}");
|
|
@@ -3437,7 +3501,7 @@ function wt(n) {
|
|
|
3437
3501
|
return {
|
|
3438
3502
|
connection: n.connection,
|
|
3439
3503
|
provider: n.provider,
|
|
3440
|
-
user_id:
|
|
3504
|
+
user_id: et(n.user_id).id,
|
|
3441
3505
|
isSocial: !!n.is_social,
|
|
3442
3506
|
profileData: {
|
|
3443
3507
|
email: n.email,
|
|
@@ -3446,7 +3510,7 @@ function wt(n) {
|
|
|
3446
3510
|
}
|
|
3447
3511
|
};
|
|
3448
3512
|
}
|
|
3449
|
-
function
|
|
3513
|
+
function ts(n) {
|
|
3450
3514
|
return async (e, t) => {
|
|
3451
3515
|
const [s, r] = await Promise.all([
|
|
3452
3516
|
n.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", t).selectAll().executeTakeFirst(),
|
|
@@ -3463,27 +3527,27 @@ function Qn(n) {
|
|
|
3463
3527
|
{
|
|
3464
3528
|
connection: s.connection,
|
|
3465
3529
|
provider: s.provider,
|
|
3466
|
-
user_id:
|
|
3530
|
+
user_id: et(s.user_id).id,
|
|
3467
3531
|
isSocial: !!s.is_social
|
|
3468
3532
|
},
|
|
3469
|
-
...r.map(
|
|
3533
|
+
...r.map(kt)
|
|
3470
3534
|
]
|
|
3471
3535
|
};
|
|
3472
3536
|
return S(c);
|
|
3473
3537
|
};
|
|
3474
3538
|
}
|
|
3475
|
-
function
|
|
3539
|
+
function se(n, e, t, s) {
|
|
3476
3540
|
return t.split(/\s+/).map((a) => a.replace("=", ":")).map((a) => {
|
|
3477
|
-
let o = a.startsWith("-"), c,
|
|
3478
|
-
return a.startsWith("-_exists_:") ? (c = a.substring(10),
|
|
3479
|
-
}).forEach(({ key: a, value: o, isNegation: c, isExistsQuery:
|
|
3541
|
+
let o = a.startsWith("-"), c, u, d;
|
|
3542
|
+
return a.startsWith("-_exists_:") ? (c = a.substring(10), d = !0, o = !0) : a.startsWith("_exists_:") ? (c = a.substring(9), d = !0, o = !1) : a.includes(":") ? (o = a.startsWith("-"), [c, u] = o ? a.substring(1).split(":") : a.split(":"), d = !1) : (c = null, u = a, d = !1), { key: c, value: u, isNegation: o, isExistsQuery: d };
|
|
3543
|
+
}).forEach(({ key: a, value: o, isNegation: c, isExistsQuery: u }) => {
|
|
3480
3544
|
if (a)
|
|
3481
|
-
|
|
3545
|
+
u ? c ? e = e.where(a, "is", null) : e = e.where(a, "is not", null) : c ? e = e.where(a, "!=", o) : e = e.where(a, "=", o);
|
|
3482
3546
|
else {
|
|
3483
|
-
const { ref:
|
|
3547
|
+
const { ref: d } = n.dynamic;
|
|
3484
3548
|
e = e.where(
|
|
3485
|
-
(
|
|
3486
|
-
s.map((k) =>
|
|
3549
|
+
(_) => _.or(
|
|
3550
|
+
s.map((k) => _(d(k), "like", `%${o}%`))
|
|
3487
3551
|
)
|
|
3488
3552
|
);
|
|
3489
3553
|
}
|
|
@@ -3492,85 +3556,85 @@ function ne(n, e, t, s) {
|
|
|
3492
3556
|
function W(n) {
|
|
3493
3557
|
return typeof n == "string" ? parseInt(n, 10) : typeof n == "bigint" ? Number(n) : n;
|
|
3494
3558
|
}
|
|
3495
|
-
function
|
|
3559
|
+
function ns(n) {
|
|
3496
3560
|
return async (e, t) => {
|
|
3497
3561
|
let s = n.selectFrom("users").where("users.tenant_id", "=", e);
|
|
3498
|
-
if (t.q && (s =
|
|
3499
|
-
const { ref:
|
|
3500
|
-
s = s.orderBy(
|
|
3562
|
+
if (t.q && (s = se(n, s, t.q, ["email", "name"])), t.sort && t.sort.sort_by) {
|
|
3563
|
+
const { ref: _ } = n.dynamic;
|
|
3564
|
+
s = s.orderBy(_(t.sort.sort_by), t.sort.sort_order);
|
|
3501
3565
|
}
|
|
3502
|
-
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), o = a.map((
|
|
3566
|
+
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), o = a.map((_) => _.user_id), c = o.length ? await n.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", o).execute() : [], u = a.map((_) => {
|
|
3503
3567
|
const k = c.filter(
|
|
3504
|
-
(O) => O.linked_to ===
|
|
3568
|
+
(O) => O.linked_to === _.user_id
|
|
3505
3569
|
);
|
|
3506
3570
|
return S({
|
|
3507
|
-
...
|
|
3508
|
-
email_verified:
|
|
3509
|
-
is_social:
|
|
3571
|
+
..._,
|
|
3572
|
+
email_verified: _.email_verified === 1,
|
|
3573
|
+
is_social: _.is_social === 1,
|
|
3510
3574
|
identities: [
|
|
3511
3575
|
{
|
|
3512
|
-
connection:
|
|
3513
|
-
provider:
|
|
3514
|
-
user_id:
|
|
3515
|
-
isSocial: !!
|
|
3576
|
+
connection: _.connection,
|
|
3577
|
+
provider: _.provider,
|
|
3578
|
+
user_id: et(_.user_id).id,
|
|
3579
|
+
isSocial: !!_.is_social
|
|
3516
3580
|
},
|
|
3517
|
-
...k.map(
|
|
3581
|
+
...k.map(kt)
|
|
3518
3582
|
]
|
|
3519
3583
|
});
|
|
3520
|
-
}), { count:
|
|
3584
|
+
}), { count: d } = await s.select((_) => _.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
3521
3585
|
return {
|
|
3522
|
-
users:
|
|
3586
|
+
users: u,
|
|
3523
3587
|
start: t.page * t.per_page,
|
|
3524
3588
|
limit: t.per_page,
|
|
3525
|
-
length: W(
|
|
3589
|
+
length: W(d)
|
|
3526
3590
|
};
|
|
3527
3591
|
};
|
|
3528
3592
|
}
|
|
3529
|
-
function
|
|
3593
|
+
function ss(n) {
|
|
3530
3594
|
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);
|
|
3531
3595
|
}
|
|
3532
|
-
function
|
|
3596
|
+
function rs(n) {
|
|
3533
3597
|
if (n.email_verified !== void 0)
|
|
3534
3598
|
return n.email_verified ? 1 : 0;
|
|
3535
3599
|
}
|
|
3536
|
-
function
|
|
3600
|
+
function is(n) {
|
|
3537
3601
|
return async (e, t, s) => {
|
|
3538
3602
|
const r = {
|
|
3539
3603
|
...s,
|
|
3540
|
-
email_verified:
|
|
3604
|
+
email_verified: rs(s),
|
|
3541
3605
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3542
3606
|
};
|
|
3543
3607
|
return (await n.updateTable("users").set(r).where("users.tenant_id", "=", e).where("users.user_id", "=", t).execute()).length === 1;
|
|
3544
3608
|
};
|
|
3545
3609
|
}
|
|
3546
|
-
function
|
|
3610
|
+
function as(n) {
|
|
3547
3611
|
return async (e, t, s, r) => {
|
|
3548
3612
|
const a = { linked_to: null };
|
|
3549
3613
|
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;
|
|
3550
3614
|
};
|
|
3551
3615
|
}
|
|
3552
|
-
function
|
|
3616
|
+
function os(n) {
|
|
3553
3617
|
return {
|
|
3554
|
-
create:
|
|
3555
|
-
remove:
|
|
3556
|
-
get:
|
|
3557
|
-
list:
|
|
3558
|
-
update:
|
|
3618
|
+
create: Ot(n),
|
|
3619
|
+
remove: ss(n),
|
|
3620
|
+
get: ts(n),
|
|
3621
|
+
list: ns(n),
|
|
3622
|
+
update: is(n),
|
|
3559
3623
|
// TODO - think about this more when other issues fixed
|
|
3560
|
-
unlink:
|
|
3624
|
+
unlink: as(n)
|
|
3561
3625
|
};
|
|
3562
3626
|
}
|
|
3563
|
-
const
|
|
3564
|
-
let
|
|
3627
|
+
const cs = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
3628
|
+
let Oe = (n = 21) => {
|
|
3565
3629
|
let e = "", t = crypto.getRandomValues(new Uint8Array(n));
|
|
3566
3630
|
for (; n--; )
|
|
3567
|
-
e +=
|
|
3631
|
+
e += cs[t[n] & 63];
|
|
3568
3632
|
return e;
|
|
3569
3633
|
};
|
|
3570
|
-
function
|
|
3634
|
+
function us(n) {
|
|
3571
3635
|
return async (e) => {
|
|
3572
3636
|
const t = {
|
|
3573
|
-
id: e.id ||
|
|
3637
|
+
id: e.id || Oe(),
|
|
3574
3638
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3575
3639
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3576
3640
|
...e
|
|
@@ -3578,13 +3642,13 @@ function ns(n) {
|
|
|
3578
3642
|
return await n.insertInto("tenants").values(t).execute(), t;
|
|
3579
3643
|
};
|
|
3580
3644
|
}
|
|
3581
|
-
function
|
|
3645
|
+
function ds(n) {
|
|
3582
3646
|
return async (e) => {
|
|
3583
3647
|
const t = await n.selectFrom("tenants").where("tenants.id", "=", e).selectAll().executeTakeFirst();
|
|
3584
3648
|
return t ? S(t) : null;
|
|
3585
3649
|
};
|
|
3586
3650
|
}
|
|
3587
|
-
function
|
|
3651
|
+
function ls(n) {
|
|
3588
3652
|
return async (e) => {
|
|
3589
3653
|
let t = n.selectFrom("tenants");
|
|
3590
3654
|
if (e.sort && e.sort.sort_by) {
|
|
@@ -3606,7 +3670,7 @@ function rs(n) {
|
|
|
3606
3670
|
};
|
|
3607
3671
|
};
|
|
3608
3672
|
}
|
|
3609
|
-
function
|
|
3673
|
+
function ps(n) {
|
|
3610
3674
|
return async (e, t) => {
|
|
3611
3675
|
const s = {
|
|
3612
3676
|
...t,
|
|
@@ -3616,41 +3680,41 @@ function is(n) {
|
|
|
3616
3680
|
await n.updateTable("tenants").set(s).where("id", "=", e).execute();
|
|
3617
3681
|
};
|
|
3618
3682
|
}
|
|
3619
|
-
function
|
|
3683
|
+
function hs(n) {
|
|
3620
3684
|
return async (e) => (await n.deleteFrom("tenants").where("tenants.id", "=", e).execute()).length === 1;
|
|
3621
3685
|
}
|
|
3622
|
-
function
|
|
3686
|
+
function _s(n) {
|
|
3623
3687
|
return {
|
|
3624
|
-
create:
|
|
3625
|
-
get:
|
|
3626
|
-
list:
|
|
3627
|
-
update:
|
|
3628
|
-
remove:
|
|
3688
|
+
create: us(n),
|
|
3689
|
+
get: ds(n),
|
|
3690
|
+
list: ls(n),
|
|
3691
|
+
update: ps(n),
|
|
3692
|
+
remove: hs(n)
|
|
3629
3693
|
};
|
|
3630
3694
|
}
|
|
3631
|
-
function
|
|
3695
|
+
function st(n) {
|
|
3632
3696
|
return n ? JSON.stringify(n) : void 0;
|
|
3633
3697
|
}
|
|
3634
|
-
const
|
|
3635
|
-
function
|
|
3698
|
+
const gs = 1024;
|
|
3699
|
+
function ms(n) {
|
|
3636
3700
|
return async (e, t) => {
|
|
3637
3701
|
var r, a;
|
|
3638
3702
|
const s = {
|
|
3639
|
-
id:
|
|
3703
|
+
id: Oe(),
|
|
3640
3704
|
...t,
|
|
3641
|
-
user_agent: t.user_agent.slice(0,
|
|
3705
|
+
user_agent: t.user_agent.slice(0, gs)
|
|
3642
3706
|
};
|
|
3643
3707
|
return await n.insertInto("logs").values({
|
|
3644
3708
|
...s,
|
|
3645
3709
|
isMobile: t.isMobile ? 1 : 0,
|
|
3646
3710
|
tenant_id: e,
|
|
3647
3711
|
scope: (r = t.scope) == null ? void 0 : r.join(","),
|
|
3648
|
-
auth0_client:
|
|
3649
|
-
details: (a =
|
|
3712
|
+
auth0_client: st(t.auth0_client),
|
|
3713
|
+
details: (a = st(t.details)) == null ? void 0 : a.substring(0, 8192)
|
|
3650
3714
|
}).execute(), s;
|
|
3651
3715
|
};
|
|
3652
3716
|
}
|
|
3653
|
-
function
|
|
3717
|
+
function rt(n) {
|
|
3654
3718
|
if (!n)
|
|
3655
3719
|
return "";
|
|
3656
3720
|
try {
|
|
@@ -3659,23 +3723,23 @@ function st(n) {
|
|
|
3659
3723
|
return n;
|
|
3660
3724
|
}
|
|
3661
3725
|
}
|
|
3662
|
-
function
|
|
3726
|
+
function bt(n) {
|
|
3663
3727
|
return {
|
|
3664
3728
|
...n,
|
|
3665
3729
|
client_id: n.client_id,
|
|
3666
3730
|
client_name: "",
|
|
3667
|
-
auth0_client:
|
|
3668
|
-
details:
|
|
3731
|
+
auth0_client: rt(n.auth0_client),
|
|
3732
|
+
details: rt(n.details),
|
|
3669
3733
|
isMobile: !!n.isMobile,
|
|
3670
3734
|
scope: n.scope ? n.scope.split(",") : void 0,
|
|
3671
3735
|
log_id: n.id,
|
|
3672
3736
|
_id: n.id
|
|
3673
3737
|
};
|
|
3674
3738
|
}
|
|
3675
|
-
function
|
|
3739
|
+
function fs(n) {
|
|
3676
3740
|
return async (e, t) => {
|
|
3677
3741
|
let s = n.selectFrom("logs").where("logs.tenant_id", "=", e);
|
|
3678
|
-
t.q && (s =
|
|
3742
|
+
t.q && (s = se(n, s, t.q, ["user_id", "ip"]));
|
|
3679
3743
|
let r = s;
|
|
3680
3744
|
if (t.sort && t.sort.sort_by) {
|
|
3681
3745
|
const { ref: c } = n.dynamic;
|
|
@@ -3687,92 +3751,77 @@ function us(n) {
|
|
|
3687
3751
|
r = r.offset(t.page * t.per_page).limit(t.per_page);
|
|
3688
3752
|
const a = await r.selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
3689
3753
|
return {
|
|
3690
|
-
logs: a.map(
|
|
3754
|
+
logs: a.map(bt),
|
|
3691
3755
|
start: t.page * t.per_page,
|
|
3692
3756
|
limit: t.per_page,
|
|
3693
3757
|
length: W(o)
|
|
3694
3758
|
};
|
|
3695
3759
|
};
|
|
3696
3760
|
}
|
|
3697
|
-
function
|
|
3761
|
+
function ys(n) {
|
|
3698
3762
|
return async (e, t) => {
|
|
3699
3763
|
const s = await n.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", t).selectAll().executeTakeFirst();
|
|
3700
|
-
return s ?
|
|
3764
|
+
return s ? bt(s) : null;
|
|
3701
3765
|
};
|
|
3702
3766
|
}
|
|
3703
|
-
function
|
|
3767
|
+
function vs(n) {
|
|
3704
3768
|
return {
|
|
3705
|
-
create:
|
|
3706
|
-
list:
|
|
3707
|
-
get:
|
|
3769
|
+
create: ms(n),
|
|
3770
|
+
list: fs(n),
|
|
3771
|
+
get: ys(n)
|
|
3708
3772
|
};
|
|
3709
3773
|
}
|
|
3710
|
-
function
|
|
3711
|
-
return async (e, t) =>
|
|
3712
|
-
const s = await n.selectFrom("sessions").where("sessions.tenant_id", "=", e).where("sessions.id", "=", t).where("sessions.deleted_at", "is", null).selectAll().executeTakeFirst();
|
|
3713
|
-
return s ? {
|
|
3714
|
-
session_id: s.id,
|
|
3715
|
-
user_id: s.user_id,
|
|
3716
|
-
client_id: s.client_id,
|
|
3717
|
-
created_at: s.created_at,
|
|
3718
|
-
expires_at: s.expires_at,
|
|
3719
|
-
used_at: s.used_at
|
|
3720
|
-
} : null;
|
|
3721
|
-
};
|
|
3774
|
+
function ws(n) {
|
|
3775
|
+
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;
|
|
3722
3776
|
}
|
|
3723
|
-
function
|
|
3777
|
+
function ks(n) {
|
|
3724
3778
|
return async (e, t) => {
|
|
3725
3779
|
const s = {
|
|
3726
|
-
|
|
3727
|
-
client_id: t.client_id,
|
|
3780
|
+
...t,
|
|
3728
3781
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3729
|
-
expires_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3730
|
-
used_at: t.used_at
|
|
3782
|
+
expires_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3731
3783
|
};
|
|
3732
|
-
return await n.insertInto("sessions").values({ ...s, tenant_id: e
|
|
3784
|
+
return await n.insertInto("sessions").values({ ...s, tenant_id: e }).execute(), { ...t, ...s };
|
|
3733
3785
|
};
|
|
3734
3786
|
}
|
|
3735
|
-
function
|
|
3736
|
-
return async (e, t) => !!(await n.updateTable("sessions").set({ deleted_at: (/* @__PURE__ */ new Date()).toISOString() }).where("tenant_id", "=", e).where("sessions.
|
|
3787
|
+
function bs(n) {
|
|
3788
|
+
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;
|
|
3737
3789
|
}
|
|
3738
|
-
function
|
|
3739
|
-
return async (e, t, s) => !!(await n.updateTable("sessions").set(s).where("tenant_id", "=", e).where("sessions.
|
|
3790
|
+
function xs(n) {
|
|
3791
|
+
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;
|
|
3740
3792
|
}
|
|
3741
|
-
function
|
|
3793
|
+
function Ts(n) {
|
|
3742
3794
|
return async (e, t) => {
|
|
3743
3795
|
let s = n.selectFrom("sessions").where("sessions.tenant_id", "=", e);
|
|
3744
|
-
t.q && (s =
|
|
3796
|
+
t.q && (s = se(n, s, t.q, ["user_id", "session_id"]));
|
|
3745
3797
|
let r = s;
|
|
3746
3798
|
if (t.sort && t.sort.sort_by) {
|
|
3747
|
-
const { ref:
|
|
3799
|
+
const { ref: u } = n.dynamic;
|
|
3748
3800
|
r = r.orderBy(
|
|
3749
|
-
|
|
3801
|
+
u(t.sort.sort_by),
|
|
3750
3802
|
t.sort.sort_order
|
|
3751
3803
|
);
|
|
3752
3804
|
}
|
|
3753
3805
|
r = r.offset(t.page * t.per_page).limit(t.per_page);
|
|
3754
|
-
const a = await r.selectAll().execute(), { count: o } = await s.select((
|
|
3806
|
+
const a = await r.selectAll().execute(), { count: o } = await s.select((u) => u.fn.countAll().as("count")).executeTakeFirstOrThrow(), c = W(o);
|
|
3755
3807
|
return {
|
|
3756
|
-
sessions: a
|
|
3757
|
-
const { id: u, ...h } = d;
|
|
3758
|
-
return { session_id: u, ...h };
|
|
3759
|
-
}),
|
|
3808
|
+
sessions: a,
|
|
3760
3809
|
start: t.page * t.per_page,
|
|
3761
3810
|
limit: t.per_page,
|
|
3762
3811
|
length: c
|
|
3763
3812
|
};
|
|
3764
3813
|
};
|
|
3765
3814
|
}
|
|
3766
|
-
function
|
|
3815
|
+
function Os(n) {
|
|
3767
3816
|
return {
|
|
3768
|
-
create:
|
|
3769
|
-
get:
|
|
3770
|
-
list:
|
|
3771
|
-
remove:
|
|
3772
|
-
update:
|
|
3817
|
+
create: ks(n),
|
|
3818
|
+
get: ws(n),
|
|
3819
|
+
list: Ts(n),
|
|
3820
|
+
remove: bs(n),
|
|
3821
|
+
update: xs(n)
|
|
3773
3822
|
};
|
|
3774
3823
|
}
|
|
3775
|
-
function
|
|
3824
|
+
function Ss(n) {
|
|
3776
3825
|
return async (e, t) => {
|
|
3777
3826
|
const s = await n.selectFrom("tickets").where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).where("tickets.used_at", "is", null).selectAll().executeTakeFirst();
|
|
3778
3827
|
if (!s)
|
|
@@ -3782,19 +3831,19 @@ function vs(n) {
|
|
|
3782
3831
|
state: a,
|
|
3783
3832
|
scope: o,
|
|
3784
3833
|
response_type: c,
|
|
3785
|
-
response_mode:
|
|
3786
|
-
redirect_uri:
|
|
3787
|
-
...
|
|
3834
|
+
response_mode: u,
|
|
3835
|
+
redirect_uri: d,
|
|
3836
|
+
..._
|
|
3788
3837
|
} = s;
|
|
3789
3838
|
return {
|
|
3790
|
-
...
|
|
3839
|
+
..._,
|
|
3791
3840
|
authParams: {
|
|
3792
3841
|
nonce: r,
|
|
3793
3842
|
state: a,
|
|
3794
3843
|
scope: o,
|
|
3795
3844
|
response_type: c,
|
|
3796
|
-
response_mode:
|
|
3797
|
-
redirect_uri:
|
|
3845
|
+
response_mode: u,
|
|
3846
|
+
redirect_uri: d
|
|
3798
3847
|
},
|
|
3799
3848
|
created_at: new Date(s.created_at),
|
|
3800
3849
|
expires_at: new Date(s.expires_at),
|
|
@@ -3802,7 +3851,7 @@ function vs(n) {
|
|
|
3802
3851
|
};
|
|
3803
3852
|
};
|
|
3804
3853
|
}
|
|
3805
|
-
function
|
|
3854
|
+
function Zs(n) {
|
|
3806
3855
|
return async (e) => {
|
|
3807
3856
|
const { authParams: t, ...s } = e, r = {
|
|
3808
3857
|
...s,
|
|
@@ -3814,30 +3863,30 @@ function ws(n) {
|
|
|
3814
3863
|
await n.insertInto("tickets").values(r).execute();
|
|
3815
3864
|
};
|
|
3816
3865
|
}
|
|
3817
|
-
function
|
|
3866
|
+
function js(n) {
|
|
3818
3867
|
return async (e, t) => {
|
|
3819
3868
|
await n.updateTable("tickets").set({
|
|
3820
3869
|
used_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3821
3870
|
}).where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).execute();
|
|
3822
3871
|
};
|
|
3823
3872
|
}
|
|
3824
|
-
function
|
|
3873
|
+
function Is(n) {
|
|
3825
3874
|
return {
|
|
3826
|
-
create:
|
|
3827
|
-
get:
|
|
3828
|
-
remove:
|
|
3875
|
+
create: Zs(n),
|
|
3876
|
+
get: Ss(n),
|
|
3877
|
+
remove: js(n)
|
|
3829
3878
|
};
|
|
3830
3879
|
}
|
|
3831
|
-
function
|
|
3880
|
+
function As(n) {
|
|
3832
3881
|
return async (e, t) => {
|
|
3833
3882
|
const s = (/* @__PURE__ */ new Date()).toISOString();
|
|
3834
3883
|
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) => {
|
|
3835
3884
|
const {
|
|
3836
3885
|
nonce: o,
|
|
3837
3886
|
state: c,
|
|
3838
|
-
scope:
|
|
3839
|
-
response_type:
|
|
3840
|
-
redirect_uri:
|
|
3887
|
+
scope: u,
|
|
3888
|
+
response_type: d,
|
|
3889
|
+
redirect_uri: _,
|
|
3841
3890
|
client_id: k,
|
|
3842
3891
|
...O
|
|
3843
3892
|
} = a;
|
|
@@ -3849,9 +3898,9 @@ function bs(n) {
|
|
|
3849
3898
|
client_id: k,
|
|
3850
3899
|
nonce: o,
|
|
3851
3900
|
state: c,
|
|
3852
|
-
scope:
|
|
3853
|
-
response_type:
|
|
3854
|
-
redirect_uri:
|
|
3901
|
+
scope: u,
|
|
3902
|
+
response_type: d,
|
|
3903
|
+
redirect_uri: _
|
|
3855
3904
|
},
|
|
3856
3905
|
created_at: a.created_at,
|
|
3857
3906
|
expires_at: a.expires_at
|
|
@@ -3859,7 +3908,7 @@ function bs(n) {
|
|
|
3859
3908
|
});
|
|
3860
3909
|
};
|
|
3861
3910
|
}
|
|
3862
|
-
function
|
|
3911
|
+
function Cs(n) {
|
|
3863
3912
|
return async (e, t) => {
|
|
3864
3913
|
const { authParams: s, ...r } = t;
|
|
3865
3914
|
await n.insertInto("otps").values({
|
|
@@ -3872,25 +3921,25 @@ function Ts(n) {
|
|
|
3872
3921
|
}).execute();
|
|
3873
3922
|
};
|
|
3874
3923
|
}
|
|
3875
|
-
function
|
|
3924
|
+
function Ns(n) {
|
|
3876
3925
|
return async (e, t) => (await n.updateTable("otps").set({
|
|
3877
3926
|
used_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3878
3927
|
}).where("otps.tenant_id", "=", e).where("otps.id", "=", t).execute()).length > 0;
|
|
3879
3928
|
}
|
|
3880
|
-
function
|
|
3929
|
+
function Es(n) {
|
|
3881
3930
|
return {
|
|
3882
|
-
create:
|
|
3883
|
-
list:
|
|
3884
|
-
remove:
|
|
3931
|
+
create: Cs(n),
|
|
3932
|
+
list: As(n),
|
|
3933
|
+
remove: Ns(n)
|
|
3885
3934
|
};
|
|
3886
3935
|
}
|
|
3887
|
-
function
|
|
3936
|
+
function $s(n) {
|
|
3888
3937
|
return async (e, t) => {
|
|
3889
3938
|
const s = await n.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", t).selectAll().executeTakeFirstOrThrow(), { tenant_id: r, ...a } = s;
|
|
3890
3939
|
return a;
|
|
3891
3940
|
};
|
|
3892
3941
|
}
|
|
3893
|
-
function
|
|
3942
|
+
function Ps(n) {
|
|
3894
3943
|
return async (e, t) => {
|
|
3895
3944
|
const s = {
|
|
3896
3945
|
...t,
|
|
@@ -3903,20 +3952,20 @@ function js(n) {
|
|
|
3903
3952
|
}).execute(), s;
|
|
3904
3953
|
};
|
|
3905
3954
|
}
|
|
3906
|
-
function
|
|
3955
|
+
function Rs(n) {
|
|
3907
3956
|
return async (e, t) => (await n.updateTable("passwords").set({
|
|
3908
3957
|
password: t.password,
|
|
3909
3958
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3910
3959
|
}).where("tenant_id", "=", e).where("user_id", "=", t.user_id).execute()).length === 1;
|
|
3911
3960
|
}
|
|
3912
|
-
function
|
|
3961
|
+
function Ds(n) {
|
|
3913
3962
|
return {
|
|
3914
|
-
create:
|
|
3915
|
-
update:
|
|
3916
|
-
get:
|
|
3963
|
+
create: Ps(n),
|
|
3964
|
+
update: Rs(n),
|
|
3965
|
+
get: $s(n)
|
|
3917
3966
|
};
|
|
3918
3967
|
}
|
|
3919
|
-
function
|
|
3968
|
+
function Fs(n) {
|
|
3920
3969
|
return async (e, t) => {
|
|
3921
3970
|
const s = (/* @__PURE__ */ new Date()).toISOString();
|
|
3922
3971
|
return (await n.selectFrom("codes").where("codes.tenant_id", "=", e).where("codes.user_id", "=", t).where("codes.used_at", "is", null).where("codes.expires_at", ">", s).selectAll().execute()).map((a) => {
|
|
@@ -3925,7 +3974,7 @@ function Cs(n) {
|
|
|
3925
3974
|
});
|
|
3926
3975
|
};
|
|
3927
3976
|
}
|
|
3928
|
-
function
|
|
3977
|
+
function Ms(n) {
|
|
3929
3978
|
return async (e, t) => {
|
|
3930
3979
|
await n.insertInto("codes").values({
|
|
3931
3980
|
...t,
|
|
@@ -3933,13 +3982,13 @@ function Ns(n) {
|
|
|
3933
3982
|
}).execute();
|
|
3934
3983
|
};
|
|
3935
3984
|
}
|
|
3936
|
-
function
|
|
3985
|
+
function Ls(n) {
|
|
3937
3986
|
return {
|
|
3938
|
-
create:
|
|
3939
|
-
list:
|
|
3987
|
+
create: Ms(n),
|
|
3988
|
+
list: Fs(n)
|
|
3940
3989
|
};
|
|
3941
3990
|
}
|
|
3942
|
-
function
|
|
3991
|
+
function Us(n) {
|
|
3943
3992
|
return async (e) => {
|
|
3944
3993
|
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();
|
|
3945
3994
|
if (!s) return null;
|
|
@@ -3948,27 +3997,27 @@ function $s(n) {
|
|
|
3948
3997
|
response_mode: a,
|
|
3949
3998
|
redirect_uri: o,
|
|
3950
3999
|
audience: c,
|
|
3951
|
-
state:
|
|
3952
|
-
nonce:
|
|
3953
|
-
scope:
|
|
4000
|
+
state: u,
|
|
4001
|
+
nonce: d,
|
|
4002
|
+
scope: _,
|
|
3954
4003
|
code_challenge_method: k,
|
|
3955
4004
|
code_challenge: O,
|
|
3956
4005
|
username: U,
|
|
3957
4006
|
vendor_id: z,
|
|
3958
|
-
...
|
|
4007
|
+
...V
|
|
3959
4008
|
} = s;
|
|
3960
4009
|
return {
|
|
3961
|
-
...
|
|
4010
|
+
...V,
|
|
3962
4011
|
authParams: {
|
|
3963
|
-
client_id:
|
|
4012
|
+
client_id: V.client_id,
|
|
3964
4013
|
vendor_id: z,
|
|
3965
4014
|
response_type: r,
|
|
3966
4015
|
response_mode: a,
|
|
3967
4016
|
redirect_uri: o,
|
|
3968
4017
|
audience: c,
|
|
3969
|
-
state:
|
|
3970
|
-
nonce:
|
|
3971
|
-
scope:
|
|
4018
|
+
state: u,
|
|
4019
|
+
nonce: d,
|
|
4020
|
+
scope: _,
|
|
3972
4021
|
// @ts-ignore
|
|
3973
4022
|
code_challenge_method: k,
|
|
3974
4023
|
code_challenge: O,
|
|
@@ -3977,7 +4026,7 @@ function $s(n) {
|
|
|
3977
4026
|
};
|
|
3978
4027
|
};
|
|
3979
4028
|
}
|
|
3980
|
-
function
|
|
4029
|
+
function zs(n) {
|
|
3981
4030
|
return async (e, t) => {
|
|
3982
4031
|
const { authParams: s, ...r } = t, a = {
|
|
3983
4032
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -3986,20 +4035,20 @@ function Ps(n) {
|
|
|
3986
4035
|
return await n.insertInto("universal_login_sessions").values({ ...s, ...r, ...a, tenant_id: e }).execute(), { ...t, ...a };
|
|
3987
4036
|
};
|
|
3988
4037
|
}
|
|
3989
|
-
function
|
|
4038
|
+
function Vs(n) {
|
|
3990
4039
|
return async (e, t, s) => {
|
|
3991
4040
|
const { authParams: r, ...a } = s;
|
|
3992
4041
|
return (await n.updateTable("universal_login_sessions").set({ ...r, ...a }).where("id", "=", t).where("tenant_id", "=", e).execute()).length === 1;
|
|
3993
4042
|
};
|
|
3994
4043
|
}
|
|
3995
|
-
function
|
|
4044
|
+
function qs(n) {
|
|
3996
4045
|
return {
|
|
3997
|
-
create:
|
|
3998
|
-
get:
|
|
3999
|
-
update:
|
|
4046
|
+
create: zs(n),
|
|
4047
|
+
get: Us(n),
|
|
4048
|
+
update: Vs(n)
|
|
4000
4049
|
};
|
|
4001
4050
|
}
|
|
4002
|
-
function
|
|
4051
|
+
function Bs(n) {
|
|
4003
4052
|
return async (e, t) => {
|
|
4004
4053
|
const s = {
|
|
4005
4054
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -4010,21 +4059,21 @@ function Fs(n) {
|
|
|
4010
4059
|
return await n.insertInto("applications").values({ ...s, tenant_id: e }).execute(), s;
|
|
4011
4060
|
};
|
|
4012
4061
|
}
|
|
4013
|
-
function
|
|
4062
|
+
function Ks(n) {
|
|
4014
4063
|
return async (e) => ({
|
|
4015
4064
|
applications: await n.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()
|
|
4016
4065
|
});
|
|
4017
4066
|
}
|
|
4018
|
-
function
|
|
4067
|
+
function Ws(n) {
|
|
4019
4068
|
return async (e, t) => {
|
|
4020
4069
|
const s = await n.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).selectAll().executeTakeFirst();
|
|
4021
4070
|
return s ? (s.disable_sign_ups = !!s.disable_sign_ups, S(s)) : null;
|
|
4022
4071
|
};
|
|
4023
4072
|
}
|
|
4024
|
-
function
|
|
4073
|
+
function Qs(n) {
|
|
4025
4074
|
return async (e, t) => (await n.deleteFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4026
4075
|
}
|
|
4027
|
-
function
|
|
4076
|
+
function Js(n) {
|
|
4028
4077
|
return async (e, t, s) => {
|
|
4029
4078
|
const r = {
|
|
4030
4079
|
...s,
|
|
@@ -4033,19 +4082,19 @@ function zs(n) {
|
|
|
4033
4082
|
return await n.updateTable("applications").set(r).where("applications.id", "=", t).where("applications.tenant_id", "=", e).execute(), !0;
|
|
4034
4083
|
};
|
|
4035
4084
|
}
|
|
4036
|
-
function
|
|
4085
|
+
function Hs(n) {
|
|
4037
4086
|
return {
|
|
4038
|
-
create:
|
|
4039
|
-
list:
|
|
4040
|
-
get:
|
|
4041
|
-
remove:
|
|
4042
|
-
update:
|
|
4087
|
+
create: Bs(n),
|
|
4088
|
+
list: Ks(n),
|
|
4089
|
+
get: Ws(n),
|
|
4090
|
+
remove: Qs(n),
|
|
4091
|
+
update: Js(n)
|
|
4043
4092
|
};
|
|
4044
4093
|
}
|
|
4045
|
-
function
|
|
4094
|
+
function Gs(n) {
|
|
4046
4095
|
return async (e, t) => {
|
|
4047
4096
|
const s = {
|
|
4048
|
-
id:
|
|
4097
|
+
id: Oe(),
|
|
4049
4098
|
...t,
|
|
4050
4099
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4051
4100
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -4053,10 +4102,10 @@ function Vs(n) {
|
|
|
4053
4102
|
return await n.insertInto("connections").values({ ...s, tenant_id: e }).execute(), s;
|
|
4054
4103
|
};
|
|
4055
4104
|
}
|
|
4056
|
-
function
|
|
4105
|
+
function Ys(n) {
|
|
4057
4106
|
return async (e, t) => {
|
|
4058
4107
|
let s = n.selectFrom("connections").where("connections.tenant_id", "=", e);
|
|
4059
|
-
t.q && (s =
|
|
4108
|
+
t.q && (s = se(n, s, t.q, ["user_id", "ip"]));
|
|
4060
4109
|
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();
|
|
4061
4110
|
return {
|
|
4062
4111
|
connections: a.map(S),
|
|
@@ -4066,16 +4115,16 @@ function Bs(n) {
|
|
|
4066
4115
|
};
|
|
4067
4116
|
};
|
|
4068
4117
|
}
|
|
4069
|
-
function
|
|
4118
|
+
function Xs(n) {
|
|
4070
4119
|
return async (e, t) => (await n.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4071
4120
|
}
|
|
4072
|
-
function
|
|
4121
|
+
function er(n) {
|
|
4073
4122
|
return async (e, t) => {
|
|
4074
4123
|
const s = await n.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).selectAll().executeTakeFirst();
|
|
4075
4124
|
return s ? S(s) : null;
|
|
4076
4125
|
};
|
|
4077
4126
|
}
|
|
4078
|
-
function
|
|
4127
|
+
function tr(n) {
|
|
4079
4128
|
return async (e, t, s) => {
|
|
4080
4129
|
const r = {
|
|
4081
4130
|
...s,
|
|
@@ -4084,19 +4133,19 @@ function Qs(n) {
|
|
|
4084
4133
|
return await n.updateTable("connections").set(r).where("connections.id", "=", t).where("connections.tenant_id", "=", e).execute(), !0;
|
|
4085
4134
|
};
|
|
4086
4135
|
}
|
|
4087
|
-
function
|
|
4136
|
+
function nr(n) {
|
|
4088
4137
|
return {
|
|
4089
|
-
create:
|
|
4090
|
-
get:
|
|
4091
|
-
list:
|
|
4092
|
-
remove:
|
|
4093
|
-
update:
|
|
4138
|
+
create: Gs(n),
|
|
4139
|
+
get: er(n),
|
|
4140
|
+
list: Ys(n),
|
|
4141
|
+
remove: Xs(n),
|
|
4142
|
+
update: tr(n)
|
|
4094
4143
|
};
|
|
4095
4144
|
}
|
|
4096
4145
|
function qe(n) {
|
|
4097
4146
|
return n != null && n.length ? n.split(",").map((e) => e.trim()) : [];
|
|
4098
4147
|
}
|
|
4099
|
-
function
|
|
4148
|
+
function sr(n) {
|
|
4100
4149
|
return {
|
|
4101
4150
|
get: async (e) => {
|
|
4102
4151
|
const t = await n.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
|
|
@@ -4104,7 +4153,7 @@ function Js(n) {
|
|
|
4104
4153
|
return null;
|
|
4105
4154
|
const s = await n.selectFrom("tenants").selectAll().where("id", "=", t.tenant_id).executeTakeFirst();
|
|
4106
4155
|
if (!s)
|
|
4107
|
-
throw new
|
|
4156
|
+
throw new Ie(404, { message: "Tenant not found" });
|
|
4108
4157
|
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();
|
|
4109
4158
|
return {
|
|
4110
4159
|
id: t.id,
|
|
@@ -4126,40 +4175,40 @@ function Js(n) {
|
|
|
4126
4175
|
}
|
|
4127
4176
|
};
|
|
4128
4177
|
}
|
|
4129
|
-
function
|
|
4178
|
+
function rr(n) {
|
|
4130
4179
|
return async () => await n.selectFrom("keys").where("revoked_at", "is", null).selectAll().execute();
|
|
4131
4180
|
}
|
|
4132
|
-
function
|
|
4181
|
+
function ir(n) {
|
|
4133
4182
|
return async (e) => {
|
|
4134
4183
|
await n.insertInto("keys").values(e).execute();
|
|
4135
4184
|
};
|
|
4136
4185
|
}
|
|
4137
|
-
function
|
|
4186
|
+
function ar(n) {
|
|
4138
4187
|
return async (e, t) => !!(await n.updateTable("keys").set({ revoked_at: t.toISOString() }).where("kid", "=", e).execute()).length;
|
|
4139
4188
|
}
|
|
4140
|
-
function
|
|
4189
|
+
function or(n) {
|
|
4141
4190
|
return {
|
|
4142
|
-
create:
|
|
4143
|
-
list:
|
|
4144
|
-
revoke:
|
|
4191
|
+
create: ir(n),
|
|
4192
|
+
list: rr(n),
|
|
4193
|
+
revoke: ar(n)
|
|
4145
4194
|
};
|
|
4146
4195
|
}
|
|
4147
|
-
function
|
|
4196
|
+
function cr(n) {
|
|
4148
4197
|
return async (e, t) => {
|
|
4149
4198
|
const s = {
|
|
4150
4199
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4151
4200
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4152
4201
|
tenant_id: e,
|
|
4153
|
-
id:
|
|
4202
|
+
id: Oe(),
|
|
4154
4203
|
...t
|
|
4155
4204
|
};
|
|
4156
4205
|
return await n.insertInto("domains").values(s).execute(), s;
|
|
4157
4206
|
};
|
|
4158
4207
|
}
|
|
4159
|
-
function
|
|
4208
|
+
function ur(n) {
|
|
4160
4209
|
return async (e, t) => {
|
|
4161
4210
|
let s = n.selectFrom("domains").where("domains.tenant_id", "=", e);
|
|
4162
|
-
t.q && (s =
|
|
4211
|
+
t.q && (s = se(n, s, t.q, ["user_id", "ip"]));
|
|
4163
4212
|
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();
|
|
4164
4213
|
return {
|
|
4165
4214
|
domains: a,
|
|
@@ -4169,13 +4218,13 @@ function nr(n) {
|
|
|
4169
4218
|
};
|
|
4170
4219
|
};
|
|
4171
4220
|
}
|
|
4172
|
-
function
|
|
4221
|
+
function dr(n) {
|
|
4173
4222
|
return {
|
|
4174
|
-
create:
|
|
4175
|
-
list:
|
|
4223
|
+
create: cr(n),
|
|
4224
|
+
list: ur(n)
|
|
4176
4225
|
};
|
|
4177
4226
|
}
|
|
4178
|
-
function
|
|
4227
|
+
function lr(n) {
|
|
4179
4228
|
return async (e) => {
|
|
4180
4229
|
const [t] = await n.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
|
|
4181
4230
|
if (!t)
|
|
@@ -4186,36 +4235,36 @@ function rr(n) {
|
|
|
4186
4235
|
colors_page_background_type: a,
|
|
4187
4236
|
colors_page_background_start: o,
|
|
4188
4237
|
colors_page_background_end: c,
|
|
4189
|
-
colors_page_background_angle_dev:
|
|
4190
|
-
font_url:
|
|
4191
|
-
...
|
|
4238
|
+
colors_page_background_angle_dev: u,
|
|
4239
|
+
font_url: d,
|
|
4240
|
+
..._
|
|
4192
4241
|
} = t;
|
|
4193
4242
|
return S({
|
|
4194
|
-
...
|
|
4243
|
+
..._,
|
|
4195
4244
|
colors: {
|
|
4196
4245
|
primary: r,
|
|
4197
4246
|
page_background: {
|
|
4198
4247
|
type: a,
|
|
4199
4248
|
start: o,
|
|
4200
4249
|
end: c,
|
|
4201
|
-
angle_deg:
|
|
4250
|
+
angle_deg: u
|
|
4202
4251
|
}
|
|
4203
4252
|
},
|
|
4204
|
-
font:
|
|
4253
|
+
font: d ? { url: d } : void 0
|
|
4205
4254
|
});
|
|
4206
4255
|
};
|
|
4207
4256
|
}
|
|
4208
|
-
function
|
|
4257
|
+
function pr(n) {
|
|
4209
4258
|
return async (e, t) => {
|
|
4210
|
-
var o, c,
|
|
4259
|
+
var o, c, u, d, _, k, O, U, z, V, re, ie, ae, Se, Ze, Q, J, H;
|
|
4211
4260
|
const { colors: s, font: r, ...a } = t;
|
|
4212
4261
|
try {
|
|
4213
4262
|
await n.insertInto("branding").values({
|
|
4214
4263
|
...a,
|
|
4215
4264
|
colors_primary: s == null ? void 0 : s.primary,
|
|
4216
4265
|
colors_page_background_type: (c = (o = t.colors) == null ? void 0 : o.page_background) == null ? void 0 : c.type,
|
|
4217
|
-
colors_page_background_start: (
|
|
4218
|
-
colors_page_background_end: (k = (
|
|
4266
|
+
colors_page_background_start: (d = (u = t.colors) == null ? void 0 : u.page_background) == null ? void 0 : d.start,
|
|
4267
|
+
colors_page_background_end: (k = (_ = t.colors) == null ? void 0 : _.page_background) == null ? void 0 : k.end,
|
|
4219
4268
|
colors_page_background_angle_dev: (U = (O = t.colors) == null ? void 0 : O.page_background) == null ? void 0 : U.angle_deg,
|
|
4220
4269
|
font_url: (z = t.font) == null ? void 0 : z.url,
|
|
4221
4270
|
tenant_id: e
|
|
@@ -4224,49 +4273,49 @@ function ir(n) {
|
|
|
4224
4273
|
await n.updateTable("branding").set({
|
|
4225
4274
|
...a,
|
|
4226
4275
|
colors_primary: s == null ? void 0 : s.primary,
|
|
4227
|
-
colors_page_background_type: (
|
|
4228
|
-
colors_page_background_start: (
|
|
4229
|
-
colors_page_background_end: (
|
|
4230
|
-
colors_page_background_angle_dev: (
|
|
4231
|
-
font_url: (
|
|
4276
|
+
colors_page_background_type: (re = (V = t.colors) == null ? void 0 : V.page_background) == null ? void 0 : re.type,
|
|
4277
|
+
colors_page_background_start: (ae = (ie = t.colors) == null ? void 0 : ie.page_background) == null ? void 0 : ae.start,
|
|
4278
|
+
colors_page_background_end: (Ze = (Se = t.colors) == null ? void 0 : Se.page_background) == null ? void 0 : Ze.end,
|
|
4279
|
+
colors_page_background_angle_dev: (J = (Q = t.colors) == null ? void 0 : Q.page_background) == null ? void 0 : J.angle_deg,
|
|
4280
|
+
font_url: (H = t.font) == null ? void 0 : H.url
|
|
4232
4281
|
}).where("tenant_id", "=", e).execute();
|
|
4233
4282
|
}
|
|
4234
4283
|
};
|
|
4235
4284
|
}
|
|
4236
|
-
function
|
|
4285
|
+
function hr(n) {
|
|
4237
4286
|
return {
|
|
4238
|
-
get:
|
|
4239
|
-
set:
|
|
4287
|
+
get: lr(n),
|
|
4288
|
+
set: pr(n)
|
|
4240
4289
|
};
|
|
4241
4290
|
}
|
|
4242
|
-
function
|
|
4291
|
+
function _r(n) {
|
|
4243
4292
|
return async (e, t) => {
|
|
4244
4293
|
const s = await n.selectFrom("authentication_codes").where("tenant_id", "=", e).where("code", "=", t).selectAll().executeTakeFirst();
|
|
4245
4294
|
if (!s)
|
|
4246
|
-
throw new
|
|
4295
|
+
throw new Ie(403, { message: "Code not found or expired" });
|
|
4247
4296
|
const {
|
|
4248
4297
|
state: r,
|
|
4249
4298
|
nonce: a,
|
|
4250
4299
|
scope: o,
|
|
4251
4300
|
client_id: c,
|
|
4252
|
-
response_type:
|
|
4253
|
-
response_mode:
|
|
4254
|
-
...
|
|
4301
|
+
response_type: u,
|
|
4302
|
+
response_mode: d,
|
|
4303
|
+
..._
|
|
4255
4304
|
} = s;
|
|
4256
4305
|
return {
|
|
4257
|
-
...
|
|
4306
|
+
..._,
|
|
4258
4307
|
authParams: {
|
|
4259
4308
|
state: r,
|
|
4260
4309
|
nonce: a,
|
|
4261
4310
|
scope: o,
|
|
4262
4311
|
client_id: c,
|
|
4263
|
-
response_type:
|
|
4264
|
-
response_mode:
|
|
4312
|
+
response_type: u,
|
|
4313
|
+
response_mode: d
|
|
4265
4314
|
}
|
|
4266
4315
|
};
|
|
4267
4316
|
};
|
|
4268
4317
|
}
|
|
4269
|
-
function
|
|
4318
|
+
function gr(n) {
|
|
4270
4319
|
return async (e, t) => {
|
|
4271
4320
|
const { authParams: s, ...r } = t;
|
|
4272
4321
|
await n.insertInto("authentication_codes").values({
|
|
@@ -4276,23 +4325,23 @@ function cr(n) {
|
|
|
4276
4325
|
}).execute();
|
|
4277
4326
|
};
|
|
4278
4327
|
}
|
|
4279
|
-
function
|
|
4328
|
+
function mr(n) {
|
|
4280
4329
|
return {
|
|
4281
|
-
create:
|
|
4282
|
-
get:
|
|
4330
|
+
create: gr(n),
|
|
4331
|
+
get: _r(n)
|
|
4283
4332
|
};
|
|
4284
4333
|
}
|
|
4285
|
-
function
|
|
4334
|
+
function fr(n) {
|
|
4286
4335
|
return async (e, t) => {
|
|
4287
4336
|
let s = n.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
4288
|
-
t.q && (s =
|
|
4289
|
-
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((
|
|
4337
|
+
t.q && (s = se(n, s, t.q, ["url"]));
|
|
4338
|
+
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((u) => u.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
4290
4339
|
return {
|
|
4291
|
-
hooks: a.map((
|
|
4292
|
-
const { tenant_id:
|
|
4340
|
+
hooks: a.map((u) => {
|
|
4341
|
+
const { tenant_id: d, enabled: _, ...k } = u;
|
|
4293
4342
|
return S({
|
|
4294
4343
|
...k,
|
|
4295
|
-
enabled: !!
|
|
4344
|
+
enabled: !!_
|
|
4296
4345
|
});
|
|
4297
4346
|
}),
|
|
4298
4347
|
start: t.page * t.per_page,
|
|
@@ -4301,19 +4350,19 @@ function ur(n) {
|
|
|
4301
4350
|
};
|
|
4302
4351
|
};
|
|
4303
4352
|
}
|
|
4304
|
-
function
|
|
4353
|
+
function yr(n) {
|
|
4305
4354
|
return async (e, t) => {
|
|
4306
4355
|
const s = await n.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).selectAll().executeTakeFirst();
|
|
4307
4356
|
return s ? (s.enabled = !!s.enabled, S(s)) : null;
|
|
4308
4357
|
};
|
|
4309
4358
|
}
|
|
4310
|
-
function
|
|
4359
|
+
function vr(n) {
|
|
4311
4360
|
return async (e, t) => (await n.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4312
4361
|
}
|
|
4313
|
-
function
|
|
4362
|
+
function wr(n) {
|
|
4314
4363
|
return async (e, t) => {
|
|
4315
4364
|
const s = {
|
|
4316
|
-
hook_id:
|
|
4365
|
+
hook_id: Oe(),
|
|
4317
4366
|
...t,
|
|
4318
4367
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4319
4368
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -4321,7 +4370,7 @@ function hr(n) {
|
|
|
4321
4370
|
return await n.insertInto("hooks").values({ ...s, tenant_id: e }).execute(), s;
|
|
4322
4371
|
};
|
|
4323
4372
|
}
|
|
4324
|
-
function
|
|
4373
|
+
function kr(n) {
|
|
4325
4374
|
return async (e, t, s) => {
|
|
4326
4375
|
const r = {
|
|
4327
4376
|
...s,
|
|
@@ -4330,36 +4379,36 @@ function _r(n) {
|
|
|
4330
4379
|
return await n.updateTable("hooks").set(r).where("hooks.hook_id", "=", t).where("hooks.tenant_id", "=", e).execute(), !0;
|
|
4331
4380
|
};
|
|
4332
4381
|
}
|
|
4333
|
-
function
|
|
4382
|
+
function br(n) {
|
|
4334
4383
|
return {
|
|
4335
|
-
create:
|
|
4336
|
-
get:
|
|
4337
|
-
list:
|
|
4338
|
-
update:
|
|
4339
|
-
remove:
|
|
4384
|
+
create: wr(n),
|
|
4385
|
+
get: yr(n),
|
|
4386
|
+
list: fr(n),
|
|
4387
|
+
update: kr(n),
|
|
4388
|
+
remove: vr(n)
|
|
4340
4389
|
};
|
|
4341
4390
|
}
|
|
4342
|
-
function
|
|
4391
|
+
function Tr(n) {
|
|
4343
4392
|
return {
|
|
4344
|
-
applications:
|
|
4345
|
-
authenticationCodes:
|
|
4346
|
-
branding:
|
|
4347
|
-
clients:
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
OTP:
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4393
|
+
applications: Hs(n),
|
|
4394
|
+
authenticationCodes: mr(n),
|
|
4395
|
+
branding: hr(n),
|
|
4396
|
+
clients: sr(n),
|
|
4397
|
+
codes: Ls(n),
|
|
4398
|
+
connections: nr(n),
|
|
4399
|
+
domains: dr(n),
|
|
4400
|
+
hooks: br(n),
|
|
4401
|
+
keys: or(n),
|
|
4402
|
+
logs: vs(n),
|
|
4403
|
+
OTP: Es(n),
|
|
4404
|
+
passwords: Ds(n),
|
|
4405
|
+
users: os(n),
|
|
4406
|
+
sessions: Os(n),
|
|
4407
|
+
tenants: _s(n),
|
|
4408
|
+
tickets: Is(n),
|
|
4409
|
+
universalLoginSessions: qs(n)
|
|
4361
4410
|
};
|
|
4362
4411
|
}
|
|
4363
4412
|
export {
|
|
4364
|
-
|
|
4413
|
+
Tr as default
|
|
4365
4414
|
};
|