authhero 0.2.3 → 0.2.4
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/authhero.cjs +1 -1
- package/dist/authhero.d.ts +2684 -0
- package/dist/authhero.iife.js +1 -1
- package/dist/authhero.mjs +694 -655
- package/package.json +8 -4
- package/CHANGELOG.md +0 -34
- package/src/hooks/index.ts +0 -29
- package/src/hooks/link-users.ts +0 -31
- package/src/hooks/webhooks.ts +0 -77
- package/src/index.ts +0 -41
- package/src/management-app.ts +0 -55
- package/src/middlewares/register-component.ts +0 -36
- package/src/routes/management-api/tenants.ts +0 -224
- package/src/routes/oauth2/index.ts +0 -1
- package/src/routes/oauth2/well-known.ts +0 -178
- package/src/types/Bindings.ts +0 -12
- package/src/types/Query.ts +0 -42
- package/src/types/Variables.ts +0 -3
- package/src/types/index.ts +0 -3
- package/src/utils/parse-sort.ts +0 -18
- package/src/utils/users.ts +0 -130
- package/src/vite-env.d.ts +0 -1
- package/tsconfig.json +0 -11
- package/tsconfig.node.json +0 -4
- package/vite.config.ts +0 -41
package/dist/authhero.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
1
|
+
var us = Object.defineProperty;
|
|
2
2
|
var or = (n) => {
|
|
3
3
|
throw TypeError(n);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var g = (n, e, t) =>
|
|
5
|
+
var ls = (n, e, t) => e in n ? us(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
6
|
+
var g = (n, e, t) => ls(n, typeof e != "symbol" ? e + "" : e, t), cr = (n, e, t) => e.has(n) || or("Cannot " + t);
|
|
7
7
|
var m = (n, e, t) => (cr(n, e, "read from private field"), t ? t.call(n) : e.get(n)), K = (n, e, t) => e.has(n) ? or("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), A = (n, e, t, r) => (cr(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t);
|
|
8
8
|
function bt(n, e) {
|
|
9
9
|
var t = {};
|
|
@@ -17,7 +17,7 @@ function C(n, e) {
|
|
|
17
17
|
var t;
|
|
18
18
|
return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function ps(n) {
|
|
21
21
|
return "_def" in n;
|
|
22
22
|
}
|
|
23
23
|
function gt(n, e) {
|
|
@@ -27,24 +27,24 @@ function gt(n, e) {
|
|
|
27
27
|
return s._def.openapi = this._def.openapi, s;
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function hs(n) {
|
|
31
31
|
if (typeof n.ZodType.prototype.openapi < "u")
|
|
32
32
|
return;
|
|
33
33
|
n.ZodType.prototype.openapi = function(s, a) {
|
|
34
34
|
var i, o, d, u, l, p;
|
|
35
|
-
const R = typeof s == "string" ? a : s, D = R ?? {}, { param:
|
|
36
|
-
param: Object.assign(Object.assign({}, (p = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || p === void 0 ? void 0 : p.param),
|
|
37
|
-
} : void 0), ee = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(
|
|
35
|
+
const R = typeof s == "string" ? a : s, D = R ?? {}, { param: P } = D, j = bt(D, ["param"]), U = Object.assign(Object.assign({}, (i = this._def.openapi) === null || i === void 0 ? void 0 : i._internal), typeof s == "string" ? { refId: s } : void 0), H = Object.assign(Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o.metadata), j), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || P ? {
|
|
36
|
+
param: Object.assign(Object.assign({}, (p = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || p === void 0 ? void 0 : p.param), P)
|
|
37
|
+
} : void 0), ee = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(U).length > 0 ? { _internal: U } : void 0), Object.keys(H).length > 0 ? { metadata: H } : void 0) }));
|
|
38
38
|
if (C(this, "ZodObject")) {
|
|
39
39
|
const te = this.extend;
|
|
40
40
|
ee.extend = function(...Re) {
|
|
41
|
-
var ae, ne, X, ge, ie,
|
|
41
|
+
var ae, ne, X, ge, ie, Ve;
|
|
42
42
|
const qe = te.apply(this, Re);
|
|
43
43
|
return qe._def.openapi = {
|
|
44
44
|
_internal: {
|
|
45
45
|
extendedFrom: !((ne = (ae = this._def.openapi) === null || ae === void 0 ? void 0 : ae._internal) === null || ne === void 0) && ne.refId ? { refId: (ge = (X = this._def.openapi) === null || X === void 0 ? void 0 : X._internal) === null || ge === void 0 ? void 0 : ge.refId, schema: this } : (ie = this._def.openapi) === null || ie === void 0 ? void 0 : ie._internal.extendedFrom
|
|
46
46
|
},
|
|
47
|
-
metadata: (
|
|
47
|
+
metadata: (Ve = qe._def.openapi) === null || Ve === void 0 ? void 0 : Ve.metadata
|
|
48
48
|
}, qe;
|
|
49
49
|
};
|
|
50
50
|
}
|
|
@@ -79,7 +79,7 @@ function yn(n, e) {
|
|
|
79
79
|
const t = Object.keys(n);
|
|
80
80
|
return Object.keys(e).every((r) => t.indexOf(r) !== -1) && t.every((r) => yn(n[r], e[r]));
|
|
81
81
|
}
|
|
82
|
-
class
|
|
82
|
+
class fs {
|
|
83
83
|
constructor() {
|
|
84
84
|
this.buckets = /* @__PURE__ */ new Map();
|
|
85
85
|
}
|
|
@@ -128,13 +128,13 @@ class hs {
|
|
|
128
128
|
function jt(n) {
|
|
129
129
|
return n == null;
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function Et(n, e) {
|
|
132
132
|
const t = {};
|
|
133
133
|
return Object.entries(n).forEach(([r, s]) => {
|
|
134
134
|
t[r] = e(s);
|
|
135
135
|
}), t;
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function ms(n, e) {
|
|
138
138
|
const t = {};
|
|
139
139
|
return Object.entries(n).forEach(([r, s]) => {
|
|
140
140
|
e.some((a) => a === r) || (t[r] = s);
|
|
@@ -150,14 +150,14 @@ function dr(n) {
|
|
|
150
150
|
return n.filter((e) => !jt(e));
|
|
151
151
|
}
|
|
152
152
|
const Hn = yn;
|
|
153
|
-
function
|
|
154
|
-
const e = new
|
|
153
|
+
function gs(n) {
|
|
154
|
+
const e = new fs();
|
|
155
155
|
return n.forEach((t) => e.put(t)), [...e.values()];
|
|
156
156
|
}
|
|
157
157
|
function wr(n) {
|
|
158
158
|
return typeof n == "string";
|
|
159
159
|
}
|
|
160
|
-
class
|
|
160
|
+
class _s {
|
|
161
161
|
constructor(e) {
|
|
162
162
|
this.parents = e, this._definitions = [];
|
|
163
163
|
}
|
|
@@ -246,7 +246,7 @@ function yt(n, e) {
|
|
|
246
246
|
throw t instanceof vn ? new vn(Object.assign(Object.assign({}, t.data), e)) : t;
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
|
-
class
|
|
249
|
+
class ys extends Mn {
|
|
250
250
|
constructor(e) {
|
|
251
251
|
super("Unknown zod object type, please specify `type` and other OpenAPI props using `ZodSchema.openapi`."), this.data = e;
|
|
252
252
|
}
|
|
@@ -280,7 +280,7 @@ class L {
|
|
|
280
280
|
* metadata properties
|
|
281
281
|
*/
|
|
282
282
|
static buildSchemaMetadata(e) {
|
|
283
|
-
return st(
|
|
283
|
+
return st(ms(e, ["param"]), jt);
|
|
284
284
|
}
|
|
285
285
|
static buildParameterMetadata(e) {
|
|
286
286
|
return st(e, jt);
|
|
@@ -306,19 +306,19 @@ class L {
|
|
|
306
306
|
return C(e, "ZodEffects") ? this.isOptionalSchema(e._def.schema) : e.isOptional();
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
class
|
|
309
|
+
class vs {
|
|
310
310
|
transform(e, t, r) {
|
|
311
311
|
var s, a;
|
|
312
312
|
const i = e._def.type;
|
|
313
313
|
return Object.assign(Object.assign({}, t("array")), { items: r(i), minItems: (s = e._def.minLength) === null || s === void 0 ? void 0 : s.value, maxItems: (a = e._def.maxLength) === null || a === void 0 ? void 0 : a.value });
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
|
-
class
|
|
316
|
+
class bs {
|
|
317
317
|
transform(e) {
|
|
318
318
|
return Object.assign(Object.assign({}, e("string")), { pattern: "^d+$" });
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
|
-
class
|
|
321
|
+
class ks {
|
|
322
322
|
transform(e, t, r, s, a) {
|
|
323
323
|
const i = [...e.options.values()], o = i.map(s);
|
|
324
324
|
return t ? {
|
|
@@ -351,12 +351,12 @@ class bs {
|
|
|
351
351
|
};
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
|
-
class
|
|
354
|
+
class ws {
|
|
355
355
|
transform(e, t) {
|
|
356
356
|
return Object.assign(Object.assign({}, t("string")), { enum: e._def.values });
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
class
|
|
359
|
+
class xs {
|
|
360
360
|
transform(e, t, r, s) {
|
|
361
361
|
const i = {
|
|
362
362
|
allOf: this.flattenIntersectionTypes(e).map(s)
|
|
@@ -372,41 +372,41 @@ class ws {
|
|
|
372
372
|
return [...t, ...r];
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
|
-
class
|
|
375
|
+
class Os {
|
|
376
376
|
transform(e, t) {
|
|
377
377
|
return Object.assign(Object.assign({}, t(typeof e._def.value)), { enum: [e._def.value] });
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function Ts(n) {
|
|
381
381
|
const t = Object.keys(n).filter((a) => typeof n[n[a]] != "number").map((a) => n[a]), r = t.filter((a) => typeof a == "number").length, s = r === 0 ? "string" : r === t.length ? "numeric" : "mixed";
|
|
382
382
|
return { values: t, type: s };
|
|
383
383
|
}
|
|
384
|
-
class
|
|
384
|
+
class js {
|
|
385
385
|
transform(e, t) {
|
|
386
|
-
const { type: r, values: s } =
|
|
386
|
+
const { type: r, values: s } = Ts(e._def.values);
|
|
387
387
|
if (r === "mixed")
|
|
388
388
|
throw new Mn("Enum has mixed string and number values, please specify the OpenAPI type manually");
|
|
389
389
|
return Object.assign(Object.assign({}, t(r === "numeric" ? "integer" : "string")), { enum: s });
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
class
|
|
392
|
+
class Es {
|
|
393
393
|
transform(e, t, r) {
|
|
394
394
|
return Object.assign(Object.assign({}, t(e.isInt ? "integer" : "number")), r(e._def.checks));
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
|
-
class
|
|
397
|
+
class Rs {
|
|
398
398
|
transform(e, t, r, s) {
|
|
399
399
|
var a;
|
|
400
|
-
const i = (a = L.getInternalMetadata(e)) === null || a === void 0 ? void 0 : a.extendedFrom, o = this.requiredKeysOf(e), d =
|
|
400
|
+
const i = (a = L.getInternalMetadata(e)) === null || a === void 0 ? void 0 : a.extendedFrom, o = this.requiredKeysOf(e), d = Et(e._def.shape(), s);
|
|
401
401
|
if (!i)
|
|
402
402
|
return Object.assign(Object.assign(Object.assign(Object.assign({}, r("object")), { properties: d, default: t }), o.length > 0 ? { required: o } : {}), this.generateAdditionalProperties(e, s));
|
|
403
403
|
const u = i.schema;
|
|
404
404
|
s(u);
|
|
405
|
-
const l = this.requiredKeysOf(u), p =
|
|
405
|
+
const l = this.requiredKeysOf(u), p = Et(u == null ? void 0 : u._def.shape(), s), R = Object.fromEntries(Object.entries(d).filter(([j, U]) => !Hn(p[j], U))), D = o.filter((j) => !l.includes(j)), P = Object.assign(Object.assign(Object.assign(Object.assign({}, r("object")), { default: t, properties: R }), D.length > 0 ? { required: D } : {}), this.generateAdditionalProperties(e, s));
|
|
406
406
|
return {
|
|
407
407
|
allOf: [
|
|
408
408
|
{ $ref: `#/components/schemas/${i.refId}` },
|
|
409
|
-
|
|
409
|
+
P
|
|
410
410
|
]
|
|
411
411
|
};
|
|
412
412
|
}
|
|
@@ -418,7 +418,7 @@ class Zs {
|
|
|
418
418
|
return Object.entries(e._def.shape()).filter(([t, r]) => !L.isOptionalSchema(r)).map(([t, r]) => t);
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
|
-
class
|
|
421
|
+
class Ss {
|
|
422
422
|
transform(e, t, r) {
|
|
423
423
|
const s = e._def.valueType, a = e._def.keyType, i = r(s);
|
|
424
424
|
if (C(a, "ZodEnum") || C(a, "ZodNativeEnum")) {
|
|
@@ -428,7 +428,7 @@ class Rs {
|
|
|
428
428
|
return Object.assign(Object.assign({}, t("object")), { additionalProperties: i });
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
|
-
class
|
|
431
|
+
class Zs {
|
|
432
432
|
transform(e, t) {
|
|
433
433
|
var r, s, a;
|
|
434
434
|
const i = this.getZodStringCheck(e, "regex"), o = (r = this.getZodStringCheck(e, "length")) === null || r === void 0 ? void 0 : r.value, d = Number.isFinite(e.minLength) && (s = e.minLength) !== null && s !== void 0 ? s : void 0, u = Number.isFinite(e.maxLength) && (a = e.maxLength) !== null && a !== void 0 ? a : void 0;
|
|
@@ -458,7 +458,7 @@ class Es {
|
|
|
458
458
|
return e._def.checks.find((r) => r.kind === t);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
class
|
|
461
|
+
class Cs {
|
|
462
462
|
constructor(e) {
|
|
463
463
|
this.versionSpecifics = e;
|
|
464
464
|
}
|
|
@@ -467,7 +467,7 @@ class Ss {
|
|
|
467
467
|
return Object.assign(Object.assign({}, t("array")), this.versionSpecifics.mapTupleItems(a));
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
|
-
class
|
|
470
|
+
class Is {
|
|
471
471
|
transform(e, t, r) {
|
|
472
472
|
const a = this.flattenUnionTypes(e).map((i) => {
|
|
473
473
|
const o = this.unwrapNullable(i);
|
|
@@ -484,9 +484,9 @@ class Cs {
|
|
|
484
484
|
return C(e, "ZodNullable") ? this.unwrapNullable(e.unwrap()) : e;
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
|
-
class
|
|
487
|
+
class Ns {
|
|
488
488
|
constructor(e) {
|
|
489
|
-
this.versionSpecifics = e, this.objectTransformer = new
|
|
489
|
+
this.versionSpecifics = e, this.objectTransformer = new Rs(), this.stringTransformer = new Zs(), this.numberTransformer = new Es(), this.bigIntTransformer = new bs(), this.literalTransformer = new Os(), this.enumTransformer = new ws(), this.nativeEnumTransformer = new js(), this.arrayTransformer = new vs(), this.unionTransformer = new Is(), this.discriminatedUnionTransformer = new ks(), this.intersectionTransformer = new xs(), this.recordTransformer = new Ss(), this.tupleTransformer = new Cs(e);
|
|
490
490
|
}
|
|
491
491
|
transform(e, t, r, s, a) {
|
|
492
492
|
if (C(e, "ZodNull"))
|
|
@@ -537,7 +537,7 @@ class Is {
|
|
|
537
537
|
if (C(e, "ZodDate"))
|
|
538
538
|
return this.versionSpecifics.mapNullableType("string", t);
|
|
539
539
|
const a = L.getRefId(e);
|
|
540
|
-
throw new
|
|
540
|
+
throw new ys({
|
|
541
541
|
currentSchema: e._def,
|
|
542
542
|
schemaName: a
|
|
543
543
|
});
|
|
@@ -545,7 +545,7 @@ class Is {
|
|
|
545
545
|
}
|
|
546
546
|
class xr {
|
|
547
547
|
constructor(e, t) {
|
|
548
|
-
this.definitions = e, this.versionSpecifics = t, this.schemaRefs = {}, this.paramRefs = {}, this.pathRefs = {}, this.rawComponents = [], this.openApiTransformer = new
|
|
548
|
+
this.definitions = e, this.versionSpecifics = t, this.schemaRefs = {}, this.paramRefs = {}, this.pathRefs = {}, this.rawComponents = [], this.openApiTransformer = new Ns(t), this.sortDefinitions();
|
|
549
549
|
}
|
|
550
550
|
generateDocumentData() {
|
|
551
551
|
return this.definitions.forEach((e) => this.generateSingle(e)), {
|
|
@@ -642,12 +642,12 @@ class xr {
|
|
|
642
642
|
const o = e._def.shape();
|
|
643
643
|
return Object.entries(o).map(([u, l]) => {
|
|
644
644
|
var p, R;
|
|
645
|
-
const D = L.getMetadata(l),
|
|
645
|
+
const D = L.getMetadata(l), P = this.getParameterRef(D, {
|
|
646
646
|
in: t,
|
|
647
647
|
name: u
|
|
648
648
|
});
|
|
649
|
-
if (
|
|
650
|
-
return
|
|
649
|
+
if (P)
|
|
650
|
+
return P;
|
|
651
651
|
const j = (p = D == null ? void 0 : D.metadata) === null || p === void 0 ? void 0 : p.param;
|
|
652
652
|
if (j != null && j.name && j.name !== u)
|
|
653
653
|
throw new _t("Conflicting names for parameter", {
|
|
@@ -766,7 +766,7 @@ class xr {
|
|
|
766
766
|
return C(e, "ZodEffects") ? this.cleanParameter(e._def.schema) : e;
|
|
767
767
|
}
|
|
768
768
|
generatePath(e) {
|
|
769
|
-
const { method: t, path: r, request: s, responses: a } = e, i = bt(e, ["method", "path", "request", "responses"]), o =
|
|
769
|
+
const { method: t, path: r, request: s, responses: a } = e, i = bt(e, ["method", "path", "request", "responses"]), o = Et(a, (p) => this.getResponse(p)), d = yt(() => this.getParameters(s), { route: `${t} ${r}` }), u = this.getRequestBody(s == null ? void 0 : s.body);
|
|
770
770
|
return {
|
|
771
771
|
[t]: Object.assign(Object.assign(Object.assign(Object.assign({}, i), d.length > 0 ? {
|
|
772
772
|
parameters: [...i.parameters || [], ...d]
|
|
@@ -791,11 +791,11 @@ class xr {
|
|
|
791
791
|
}
|
|
792
792
|
getResponseHeaders(e) {
|
|
793
793
|
const t = e._def.shape();
|
|
794
|
-
return
|
|
794
|
+
return Et(t, (s) => this.generateSimpleParameter(s));
|
|
795
795
|
}
|
|
796
796
|
getBodyContent(e) {
|
|
797
|
-
return
|
|
798
|
-
if (!t || !
|
|
797
|
+
return Et(e, (t) => {
|
|
798
|
+
if (!t || !ps(t.schema))
|
|
799
799
|
return t;
|
|
800
800
|
const { schema: r } = t, s = bt(t, ["schema"]), a = this.generateSchemaWithRef(r);
|
|
801
801
|
return Object.assign({ schema: a }, s);
|
|
@@ -816,7 +816,7 @@ class Ps {
|
|
|
816
816
|
return Object.assign(Object.assign({}, e ? { type: e } : void 0), t ? this.nullType : void 0);
|
|
817
817
|
}
|
|
818
818
|
mapTupleItems(e) {
|
|
819
|
-
const t =
|
|
819
|
+
const t = gs(e);
|
|
820
820
|
return {
|
|
821
821
|
items: t.length === 1 ? t[0] : { anyOf: t },
|
|
822
822
|
minItems: e.length,
|
|
@@ -836,7 +836,7 @@ class Ps {
|
|
|
836
836
|
}));
|
|
837
837
|
}
|
|
838
838
|
}
|
|
839
|
-
class
|
|
839
|
+
class As {
|
|
840
840
|
constructor(e) {
|
|
841
841
|
const t = new Ps();
|
|
842
842
|
this.generator = new xr(e, t);
|
|
@@ -849,7 +849,7 @@ class Ns {
|
|
|
849
849
|
return this.generator.generateComponents();
|
|
850
850
|
}
|
|
851
851
|
}
|
|
852
|
-
class
|
|
852
|
+
class $s {
|
|
853
853
|
get nullType() {
|
|
854
854
|
return { type: "null" };
|
|
855
855
|
}
|
|
@@ -881,18 +881,18 @@ class As {
|
|
|
881
881
|
}));
|
|
882
882
|
}
|
|
883
883
|
}
|
|
884
|
-
function
|
|
884
|
+
function Ms(n) {
|
|
885
885
|
return "type" in n && n.type === "webhook";
|
|
886
886
|
}
|
|
887
|
-
class
|
|
887
|
+
class Ds {
|
|
888
888
|
constructor(e) {
|
|
889
889
|
this.definitions = e, this.webhookRefs = {};
|
|
890
|
-
const t = new
|
|
890
|
+
const t = new $s();
|
|
891
891
|
this.generator = new xr(this.definitions, t);
|
|
892
892
|
}
|
|
893
893
|
generateDocument(e) {
|
|
894
894
|
const t = this.generator.generateDocumentData();
|
|
895
|
-
return this.definitions.filter(
|
|
895
|
+
return this.definitions.filter(Ms).forEach((r) => this.generateSingleWebhook(r.webhook)), Object.assign(Object.assign(Object.assign({}, e), t), { webhooks: this.webhookRefs });
|
|
896
896
|
}
|
|
897
897
|
generateComponents() {
|
|
898
898
|
return this.generator.generateComponents();
|
|
@@ -905,10 +905,10 @@ class Ms {
|
|
|
905
905
|
var Or = (n) => {
|
|
906
906
|
const e = n.split("/");
|
|
907
907
|
return e[0] === "" && e.shift(), e;
|
|
908
|
-
}, Ds = (n) => {
|
|
909
|
-
const { groups: e, path: t } = Ls(n), r = Or(t);
|
|
910
|
-
return Vs(r, e);
|
|
911
908
|
}, Ls = (n) => {
|
|
909
|
+
const { groups: e, path: t } = Us(n), r = Or(t);
|
|
910
|
+
return Vs(r, e);
|
|
911
|
+
}, Us = (n) => {
|
|
912
912
|
const e = [];
|
|
913
913
|
return n = n.replace(/\{[^}]+\}/g, (t, r) => {
|
|
914
914
|
const s = `@${r}`;
|
|
@@ -929,7 +929,7 @@ var Or = (n) => {
|
|
|
929
929
|
return "*";
|
|
930
930
|
const e = n.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);
|
|
931
931
|
return e ? (hn[n] || (e[2] ? hn[n] = [n, e[1], new RegExp("^" + e[2] + "$")] : hn[n] = [n, e[1], !0]), hn[n]) : null;
|
|
932
|
-
},
|
|
932
|
+
}, qs = (n) => {
|
|
933
933
|
try {
|
|
934
934
|
return decodeURI(n);
|
|
935
935
|
} catch {
|
|
@@ -948,12 +948,12 @@ var Or = (n) => {
|
|
|
948
948
|
const s = e.charCodeAt(r);
|
|
949
949
|
if (s === 37) {
|
|
950
950
|
const a = e.indexOf("?", r), i = e.slice(t, a === -1 ? void 0 : a);
|
|
951
|
-
return
|
|
951
|
+
return qs(i.includes("%25") ? i.replace(/%25/g, "%2525") : i);
|
|
952
952
|
} else if (s === 63)
|
|
953
953
|
break;
|
|
954
954
|
}
|
|
955
955
|
return e.slice(t, r);
|
|
956
|
-
},
|
|
956
|
+
}, Bs = (n) => {
|
|
957
957
|
const e = Tr(n);
|
|
958
958
|
return e.length > 1 && e[e.length - 1] === "/" ? e.slice(0, -1) : e;
|
|
959
959
|
}, Be = (...n) => {
|
|
@@ -977,7 +977,7 @@ var Or = (n) => {
|
|
|
977
977
|
} else
|
|
978
978
|
r += "/" + s;
|
|
979
979
|
}), t.filter((s, a, i) => i.indexOf(s) === a);
|
|
980
|
-
},
|
|
980
|
+
}, Vn = (n) => /[%+]/.test(n) ? (n.indexOf("+") !== -1 && (n = n.replace(/\+/g, " ")), /%/.test(n) ? bn(n) : n) : n, Er = (n, e, t) => {
|
|
981
981
|
let r;
|
|
982
982
|
if (!t && e && !/[%+]/.test(e)) {
|
|
983
983
|
let i = n.indexOf(`?${e}`, 8);
|
|
@@ -985,7 +985,7 @@ var Or = (n) => {
|
|
|
985
985
|
const o = n.charCodeAt(i + e.length + 1);
|
|
986
986
|
if (o === 61) {
|
|
987
987
|
const d = i + e.length + 2, u = n.indexOf("&", d);
|
|
988
|
-
return
|
|
988
|
+
return Vn(n.slice(d, u === -1 ? void 0 : u));
|
|
989
989
|
} else if (o == 38 || isNaN(o))
|
|
990
990
|
return "";
|
|
991
991
|
i = n.indexOf(`&${e}`, i + 1);
|
|
@@ -1004,25 +1004,25 @@ var Or = (n) => {
|
|
|
1004
1004
|
a + 1,
|
|
1005
1005
|
o === -1 ? i === -1 ? void 0 : i : o
|
|
1006
1006
|
);
|
|
1007
|
-
if (r && (d =
|
|
1007
|
+
if (r && (d = Vn(d)), a = i, d === "")
|
|
1008
1008
|
continue;
|
|
1009
1009
|
let u;
|
|
1010
|
-
o === -1 ? u = "" : (u = n.slice(o + 1, i === -1 ? void 0 : i), r && (u =
|
|
1010
|
+
o === -1 ? u = "" : (u = n.slice(o + 1, i === -1 ? void 0 : i), r && (u = Vn(u))), t ? (s[d] && Array.isArray(s[d]) || (s[d] = []), s[d].push(u)) : s[d] ?? (s[d] = u);
|
|
1011
1011
|
}
|
|
1012
1012
|
return e ? s[e] : s;
|
|
1013
|
-
},
|
|
1013
|
+
}, Ws = Er, Hs = (n, e) => Er(n, e, !0), bn = decodeURIComponent, Fs = /^[\w!#$%&'*.^`|~+-]+$/, Ks = /^[ !#-:<-[\]-~]*$/, Gs = (n, e) => n.trim().split(";").reduce((r, s) => {
|
|
1014
1014
|
s = s.trim();
|
|
1015
1015
|
const a = s.indexOf("=");
|
|
1016
1016
|
if (a === -1)
|
|
1017
1017
|
return r;
|
|
1018
1018
|
const i = s.substring(0, a).trim();
|
|
1019
|
-
if (!
|
|
1019
|
+
if (!Fs.test(i))
|
|
1020
1020
|
return r;
|
|
1021
1021
|
let o = s.substring(a + 1).trim();
|
|
1022
|
-
return o.startsWith('"') && o.endsWith('"') && (o = o.slice(1, -1)),
|
|
1023
|
-
}, {}),
|
|
1022
|
+
return o.startsWith('"') && o.endsWith('"') && (o = o.slice(1, -1)), Ks.test(o) && (r[i] = bn(o)), r;
|
|
1023
|
+
}, {}), zs = (n, e, t) => {
|
|
1024
1024
|
const r = n.req.raw.headers.get("Cookie");
|
|
1025
|
-
return r ?
|
|
1025
|
+
return r ? Gs(r) : {};
|
|
1026
1026
|
}, fn = class extends Error {
|
|
1027
1027
|
constructor(e = 500, t) {
|
|
1028
1028
|
super(t == null ? void 0 : t.message, { cause: t == null ? void 0 : t.cause });
|
|
@@ -1038,11 +1038,11 @@ var Or = (n) => {
|
|
|
1038
1038
|
status: this.status
|
|
1039
1039
|
});
|
|
1040
1040
|
}
|
|
1041
|
-
},
|
|
1041
|
+
}, Ys = (n, e) => new Response(n, {
|
|
1042
1042
|
headers: {
|
|
1043
1043
|
"Content-Type": e
|
|
1044
1044
|
}
|
|
1045
|
-
}).formData(),
|
|
1045
|
+
}).formData(), Js = (n, e) => async (t, r) => {
|
|
1046
1046
|
let s = {};
|
|
1047
1047
|
const a = t.req.header("Content-Type");
|
|
1048
1048
|
switch (n) {
|
|
@@ -1066,7 +1066,7 @@ var Or = (n) => {
|
|
|
1066
1066
|
break;
|
|
1067
1067
|
}
|
|
1068
1068
|
try {
|
|
1069
|
-
const o = await t.req.arrayBuffer(), d = await
|
|
1069
|
+
const o = await t.req.arrayBuffer(), d = await Ys(o, a), u = {};
|
|
1070
1070
|
d.forEach((l, p) => {
|
|
1071
1071
|
p.endsWith("[]") ? u[p] === void 0 ? u[p] = [l] : Array.isArray(u[p]) && u[p].push(l) : u[p] = l;
|
|
1072
1072
|
}), s = u, t.req.bodyCache.formData = d;
|
|
@@ -1088,7 +1088,7 @@ var Or = (n) => {
|
|
|
1088
1088
|
s = t.req.header();
|
|
1089
1089
|
break;
|
|
1090
1090
|
case "cookie":
|
|
1091
|
-
s =
|
|
1091
|
+
s = zs(t);
|
|
1092
1092
|
break;
|
|
1093
1093
|
}
|
|
1094
1094
|
const i = await e(s, t);
|
|
@@ -1098,7 +1098,7 @@ var Or = (n) => {
|
|
|
1098
1098
|
};
|
|
1099
1099
|
const Qe = (n, e, t) => (
|
|
1100
1100
|
// @ts-expect-error not typed well
|
|
1101
|
-
|
|
1101
|
+
Js(n, async (r, s) => {
|
|
1102
1102
|
const a = await e.safeParseAsync(r);
|
|
1103
1103
|
if (t) {
|
|
1104
1104
|
const i = await t({ data: r, ...a }, s);
|
|
@@ -1112,25 +1112,25 @@ const Qe = (n, e, t) => (
|
|
|
1112
1112
|
return a.success ? a.data : s.json(a, 400);
|
|
1113
1113
|
})
|
|
1114
1114
|
);
|
|
1115
|
-
var
|
|
1115
|
+
var Qs = async (n, e = /* @__PURE__ */ Object.create(null)) => {
|
|
1116
1116
|
const { all: t = !1, dot: r = !1 } = e, a = (n instanceof Rr ? n.raw.headers : n.headers).get("Content-Type");
|
|
1117
|
-
return a !== null && a.startsWith("multipart/form-data") || a !== null && a.startsWith("application/x-www-form-urlencoded") ?
|
|
1117
|
+
return a !== null && a.startsWith("multipart/form-data") || a !== null && a.startsWith("application/x-www-form-urlencoded") ? Xs(n, { all: t, dot: r }) : {};
|
|
1118
1118
|
};
|
|
1119
|
-
async function
|
|
1119
|
+
async function Xs(n, e) {
|
|
1120
1120
|
const t = await n.formData();
|
|
1121
|
-
return t ?
|
|
1121
|
+
return t ? ea(t, e) : {};
|
|
1122
1122
|
}
|
|
1123
|
-
function
|
|
1123
|
+
function ea(n, e) {
|
|
1124
1124
|
const t = /* @__PURE__ */ Object.create(null);
|
|
1125
1125
|
return n.forEach((r, s) => {
|
|
1126
|
-
e.all || s.endsWith("[]") ?
|
|
1126
|
+
e.all || s.endsWith("[]") ? ta(t, s, r) : t[s] = r;
|
|
1127
1127
|
}), e.dot && Object.entries(t).forEach(([r, s]) => {
|
|
1128
|
-
r.includes(".") && (
|
|
1128
|
+
r.includes(".") && (na(t, r, s), delete t[r]);
|
|
1129
1129
|
}), t;
|
|
1130
1130
|
}
|
|
1131
|
-
var
|
|
1131
|
+
var ta = (n, e, t) => {
|
|
1132
1132
|
n[e] !== void 0 ? Array.isArray(n[e]) ? n[e].push(t) : n[e] = [n[e], t] : n[e] = t;
|
|
1133
|
-
},
|
|
1133
|
+
}, na = (n, e, t) => {
|
|
1134
1134
|
let r = n;
|
|
1135
1135
|
const s = e.split(".");
|
|
1136
1136
|
s.forEach((a, i) => {
|
|
@@ -1172,10 +1172,10 @@ var ea = (n, e, t) => {
|
|
|
1172
1172
|
return m(this, oe)[1] ? m(this, oe)[1][n] : n;
|
|
1173
1173
|
}
|
|
1174
1174
|
query(n) {
|
|
1175
|
-
return
|
|
1175
|
+
return Ws(this.url, n);
|
|
1176
1176
|
}
|
|
1177
1177
|
queries(n) {
|
|
1178
|
-
return
|
|
1178
|
+
return Hs(this.url, n);
|
|
1179
1179
|
}
|
|
1180
1180
|
header(n) {
|
|
1181
1181
|
if (n)
|
|
@@ -1187,7 +1187,7 @@ var ea = (n, e, t) => {
|
|
|
1187
1187
|
}
|
|
1188
1188
|
async parseBody(n) {
|
|
1189
1189
|
var e;
|
|
1190
|
-
return (e = this.bodyCache).parsedBody ?? (e.parsedBody = await
|
|
1190
|
+
return (e = this.bodyCache).parsedBody ?? (e.parsedBody = await Qs(this, n));
|
|
1191
1191
|
}
|
|
1192
1192
|
json() {
|
|
1193
1193
|
return this.cachedBody("json");
|
|
@@ -1222,18 +1222,18 @@ var ea = (n, e, t) => {
|
|
|
1222
1222
|
get routePath() {
|
|
1223
1223
|
return m(this, oe)[0].map(([[, n]]) => n)[this.routeIndex].path;
|
|
1224
1224
|
}
|
|
1225
|
-
}, ot = new WeakMap(), oe = new WeakMap(), vr),
|
|
1225
|
+
}, ot = new WeakMap(), oe = new WeakMap(), vr), ra = {
|
|
1226
1226
|
Stringify: 1,
|
|
1227
1227
|
BeforeStream: 2,
|
|
1228
1228
|
Stream: 3
|
|
1229
|
-
},
|
|
1229
|
+
}, Sr = async (n, e, t, r, s) => {
|
|
1230
1230
|
const a = n.callbacks;
|
|
1231
1231
|
return a != null && a.length ? (s ? s[0] += n : s = [n], Promise.all(a.map((o) => o({ phase: e, buffer: s, context: r }))).then(
|
|
1232
1232
|
(o) => Promise.all(
|
|
1233
|
-
o.filter(Boolean).map((d) =>
|
|
1233
|
+
o.filter(Boolean).map((d) => Sr(d, e, !1, r, s))
|
|
1234
1234
|
).then(() => s[0])
|
|
1235
1235
|
)) : Promise.resolve(n);
|
|
1236
|
-
},
|
|
1236
|
+
}, sa = "text/plain; charset=UTF-8", qn = (n, e = {}) => (Object.entries(e).forEach(([t, r]) => n.set(t, r)), n), an, on, Ie, He, Oe, V, W, ce, Te, cn, ct, dt, dn, un, br, mn = (br = class {
|
|
1237
1237
|
constructor(n, e) {
|
|
1238
1238
|
K(this, an);
|
|
1239
1239
|
K(this, on);
|
|
@@ -1243,7 +1243,7 @@ var ea = (n, e, t) => {
|
|
|
1243
1243
|
g(this, "error");
|
|
1244
1244
|
K(this, He, 200);
|
|
1245
1245
|
K(this, Oe);
|
|
1246
|
-
K(this,
|
|
1246
|
+
K(this, V);
|
|
1247
1247
|
K(this, W);
|
|
1248
1248
|
K(this, ce);
|
|
1249
1249
|
K(this, Te, !0);
|
|
@@ -1260,10 +1260,10 @@ var ea = (n, e, t) => {
|
|
|
1260
1260
|
});
|
|
1261
1261
|
g(this, "header", (n, e, t) => {
|
|
1262
1262
|
if (e === void 0) {
|
|
1263
|
-
m(this,
|
|
1263
|
+
m(this, V) ? m(this, V).delete(n) : m(this, W) && delete m(this, W)[n.toLocaleLowerCase()], this.finalized && this.res.headers.delete(n);
|
|
1264
1264
|
return;
|
|
1265
1265
|
}
|
|
1266
|
-
t != null && t.append ? (m(this,
|
|
1266
|
+
t != null && t.append ? (m(this, V) || (A(this, Te, !1), A(this, V, new Headers(m(this, W))), A(this, W, {})), m(this, V).append(n, e)) : m(this, V) ? m(this, V).set(n, e) : (m(this, W) ?? A(this, W, {}), m(this, W)[n.toLowerCase()] = e), this.finalized && (t != null && t.append ? this.res.headers.append(n, e) : this.res.headers.set(n, e));
|
|
1267
1267
|
});
|
|
1268
1268
|
g(this, "status", (n) => {
|
|
1269
1269
|
A(this, Te, !1), A(this, He, n);
|
|
@@ -1279,7 +1279,7 @@ var ea = (n, e, t) => {
|
|
|
1279
1279
|
});
|
|
1280
1280
|
if (e && typeof e != "number") {
|
|
1281
1281
|
const s = new Headers(e.headers);
|
|
1282
|
-
m(this,
|
|
1282
|
+
m(this, V) && m(this, V).forEach((i, o) => {
|
|
1283
1283
|
o === "set-cookie" ? s.append(o, i) : s.set(o, i);
|
|
1284
1284
|
});
|
|
1285
1285
|
const a = qn(s, m(this, W));
|
|
@@ -1289,21 +1289,21 @@ var ea = (n, e, t) => {
|
|
|
1289
1289
|
});
|
|
1290
1290
|
}
|
|
1291
1291
|
const r = typeof e == "number" ? e : m(this, He);
|
|
1292
|
-
m(this, W) ?? A(this, W, {}), m(this,
|
|
1292
|
+
m(this, W) ?? A(this, W, {}), m(this, V) ?? A(this, V, new Headers()), qn(m(this, V), m(this, W)), m(this, ce) && (m(this, ce).headers.forEach((s, a) => {
|
|
1293
1293
|
var i, o;
|
|
1294
|
-
a === "set-cookie" ? (i = m(this,
|
|
1295
|
-
}), qn(m(this,
|
|
1294
|
+
a === "set-cookie" ? (i = m(this, V)) == null || i.append(a, s) : (o = m(this, V)) == null || o.set(a, s);
|
|
1295
|
+
}), qn(m(this, V), m(this, W))), t ?? (t = {});
|
|
1296
1296
|
for (const [s, a] of Object.entries(t))
|
|
1297
1297
|
if (typeof a == "string")
|
|
1298
|
-
m(this,
|
|
1298
|
+
m(this, V).set(s, a);
|
|
1299
1299
|
else {
|
|
1300
|
-
m(this,
|
|
1300
|
+
m(this, V).delete(s);
|
|
1301
1301
|
for (const i of a)
|
|
1302
|
-
m(this,
|
|
1302
|
+
m(this, V).append(s, i);
|
|
1303
1303
|
}
|
|
1304
1304
|
return new Response(n, {
|
|
1305
1305
|
status: r,
|
|
1306
|
-
headers: m(this,
|
|
1306
|
+
headers: m(this, V)
|
|
1307
1307
|
});
|
|
1308
1308
|
});
|
|
1309
1309
|
g(this, "body", (n, e, t) => typeof e == "number" ? this.newResponse(n, e, t) : this.newResponse(n, e));
|
|
@@ -1313,14 +1313,14 @@ var ea = (n, e, t) => {
|
|
|
1313
1313
|
return new Response(n);
|
|
1314
1314
|
A(this, W, {});
|
|
1315
1315
|
}
|
|
1316
|
-
return m(this, W)["content-type"] =
|
|
1316
|
+
return m(this, W)["content-type"] = sa, typeof e == "number" ? this.newResponse(n, e, t) : this.newResponse(n, e);
|
|
1317
1317
|
});
|
|
1318
1318
|
g(this, "json", (n, e, t) => {
|
|
1319
1319
|
const r = JSON.stringify(n);
|
|
1320
1320
|
return m(this, W) ?? A(this, W, {}), m(this, W)["content-type"] = "application/json; charset=UTF-8", typeof e == "number" ? this.newResponse(r, e, t) : this.newResponse(r, e);
|
|
1321
1321
|
});
|
|
1322
|
-
g(this, "html", (n, e, t) => (m(this, W) ?? A(this, W, {}), m(this, W)["content-type"] = "text/html; charset=UTF-8", typeof n == "object" && (n instanceof Promise || (n = n.toString()), n instanceof Promise) ? n.then((r) =>
|
|
1323
|
-
g(this, "redirect", (n, e) => (m(this,
|
|
1322
|
+
g(this, "html", (n, e, t) => (m(this, W) ?? A(this, W, {}), m(this, W)["content-type"] = "text/html; charset=UTF-8", typeof n == "object" && (n instanceof Promise || (n = n.toString()), n instanceof Promise) ? n.then((r) => Sr(r, ra.Stringify, !1, {})).then((r) => typeof e == "number" ? this.newResponse(r, e, t) : this.newResponse(r, e)) : typeof e == "number" ? this.newResponse(n, e, t) : this.newResponse(n, e)));
|
|
1323
|
+
g(this, "redirect", (n, e) => (m(this, V) ?? A(this, V, new Headers()), m(this, V).set("Location", n), this.newResponse(null, e ?? 302)));
|
|
1324
1324
|
g(this, "notFound", () => (m(this, dt) ?? A(this, dt, () => new Response()), m(this, dt).call(this, this)));
|
|
1325
1325
|
A(this, an, n), e && (A(this, Oe, e.executionCtx), this.env = e.env, A(this, dt, e.notFoundHandler), A(this, un, e.path), A(this, dn, e.matchResult));
|
|
1326
1326
|
}
|
|
@@ -1357,7 +1357,7 @@ var ea = (n, e, t) => {
|
|
|
1357
1357
|
get var() {
|
|
1358
1358
|
return { ...m(this, Ie) };
|
|
1359
1359
|
}
|
|
1360
|
-
}, an = new WeakMap(), on = new WeakMap(), Ie = new WeakMap(), He = new WeakMap(), Oe = new WeakMap(),
|
|
1360
|
+
}, an = new WeakMap(), on = new WeakMap(), Ie = new WeakMap(), He = new WeakMap(), Oe = new WeakMap(), V = new WeakMap(), W = new WeakMap(), ce = new WeakMap(), Te = new WeakMap(), cn = new WeakMap(), ct = new WeakMap(), dt = new WeakMap(), dn = new WeakMap(), un = new WeakMap(), br), lr = (n, e, t) => (r, s) => {
|
|
1361
1361
|
let a = -1;
|
|
1362
1362
|
return i(0);
|
|
1363
1363
|
async function i(o) {
|
|
@@ -1378,8 +1378,8 @@ var ea = (n, e, t) => {
|
|
|
1378
1378
|
}
|
|
1379
1379
|
return d && (r.finalized === !1 || u) && (r.res = d), r;
|
|
1380
1380
|
}
|
|
1381
|
-
}, F = "ALL",
|
|
1382
|
-
},
|
|
1381
|
+
}, F = "ALL", aa = "all", ia = ["get", "post", "put", "delete", "options", "patch"], Zr = "Can not add a route since the matcher is already built.", Cr = class extends Error {
|
|
1382
|
+
}, oa = Symbol("composedHandler"), ca = (n) => n.text("404 Not Found", 404), pr = (n, e) => "getResponse" in n ? n.getResponse() : (console.error(n), e.text("Internal Server Error", 500)), de, kr, Ir = (kr = class {
|
|
1383
1383
|
constructor(e = {}) {
|
|
1384
1384
|
g(this, "get");
|
|
1385
1385
|
g(this, "post");
|
|
@@ -1395,7 +1395,7 @@ var ea = (n, e, t) => {
|
|
|
1395
1395
|
g(this, "_basePath", "/");
|
|
1396
1396
|
K(this, de, "/");
|
|
1397
1397
|
g(this, "routes", []);
|
|
1398
|
-
g(this, "notFoundHandler",
|
|
1398
|
+
g(this, "notFoundHandler", ca);
|
|
1399
1399
|
g(this, "errorHandler", pr);
|
|
1400
1400
|
g(this, "onError", (e) => (this.errorHandler = e, this));
|
|
1401
1401
|
g(this, "notFound", (e) => (this.notFoundHandler = e, this));
|
|
@@ -1412,7 +1412,7 @@ var ea = (n, e, t) => {
|
|
|
1412
1412
|
e.respondWith(this.dispatch(e.request, e, void 0, e.request.method));
|
|
1413
1413
|
});
|
|
1414
1414
|
});
|
|
1415
|
-
[...
|
|
1415
|
+
[...ia, aa].forEach((s) => {
|
|
1416
1416
|
this[s] = (a, ...i) => (typeof a == "string" ? A(this, de, a) : this.addRoute(s, m(this, de), a), i.forEach((o) => {
|
|
1417
1417
|
typeof o != "string" && this.addRoute(s, m(this, de), o);
|
|
1418
1418
|
}), this);
|
|
@@ -1429,7 +1429,7 @@ var ea = (n, e, t) => {
|
|
|
1429
1429
|
this.addRoute(F, m(this, de), i);
|
|
1430
1430
|
}), this);
|
|
1431
1431
|
const r = e.strict ?? !0;
|
|
1432
|
-
delete e.strict, Object.assign(this, e), this.getPath = r ? e.getPath ?? Tr :
|
|
1432
|
+
delete e.strict, Object.assign(this, e), this.getPath = r ? e.getPath ?? Tr : Bs;
|
|
1433
1433
|
}
|
|
1434
1434
|
clone() {
|
|
1435
1435
|
const e = new Ir({
|
|
@@ -1442,7 +1442,7 @@ var ea = (n, e, t) => {
|
|
|
1442
1442
|
const r = this.basePath(e);
|
|
1443
1443
|
return t.routes.map((s) => {
|
|
1444
1444
|
let a;
|
|
1445
|
-
t.errorHandler === pr ? a = s.handler : (a = async (i, o) => (await lr([], t.errorHandler)(i, () => s.handler(i, o))).res, a[
|
|
1445
|
+
t.errorHandler === pr ? a = s.handler : (a = async (i, o) => (await lr([], t.errorHandler)(i, () => s.handler(i, o))).res, a[oa] = s.handler), r.addRoute(s.method, s.path, a);
|
|
1446
1446
|
}), this;
|
|
1447
1447
|
}
|
|
1448
1448
|
basePath(e) {
|
|
@@ -1528,9 +1528,9 @@ var ea = (n, e, t) => {
|
|
|
1528
1528
|
}
|
|
1529
1529
|
})();
|
|
1530
1530
|
}
|
|
1531
|
-
}, de = new WeakMap(), kr), kn = "[^/]+", Rt = ".*",
|
|
1532
|
-
function
|
|
1533
|
-
return n.length === 1 ? e.length === 1 ? n < e ? -1 : 1 : -1 : e.length === 1 || n === Rt || n ===
|
|
1531
|
+
}, de = new WeakMap(), kr), kn = "[^/]+", Rt = ".*", St = "(?:|/.*)", kt = Symbol(), da = new Set(".\\+*[^]$()");
|
|
1532
|
+
function ua(n, e) {
|
|
1533
|
+
return n.length === 1 ? e.length === 1 ? n < e ? -1 : 1 : -1 : e.length === 1 || n === Rt || n === St ? 1 : e === Rt || e === St ? -1 : n === kn ? 1 : e === kn ? -1 : n.length === e.length ? n < e ? -1 : 1 : e.length - n.length;
|
|
1534
1534
|
}
|
|
1535
1535
|
var Fn = class {
|
|
1536
1536
|
constructor() {
|
|
@@ -1547,7 +1547,7 @@ var Fn = class {
|
|
|
1547
1547
|
this.index = t;
|
|
1548
1548
|
return;
|
|
1549
1549
|
}
|
|
1550
|
-
const [i, ...o] = e, d = i === "*" ? o.length === 0 ? ["", "", Rt] : ["", "", kn] : i === "/*" ? ["", "",
|
|
1550
|
+
const [i, ...o] = e, d = i === "*" ? o.length === 0 ? ["", "", Rt] : ["", "", kn] : i === "/*" ? ["", "", St] : i.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);
|
|
1551
1551
|
let u;
|
|
1552
1552
|
if (d) {
|
|
1553
1553
|
const l = d[1];
|
|
@@ -1556,7 +1556,7 @@ var Fn = class {
|
|
|
1556
1556
|
throw kt;
|
|
1557
1557
|
if (u = this.children[p], !u) {
|
|
1558
1558
|
if (Object.keys(this.children).some(
|
|
1559
|
-
(R) => R !== Rt && R !==
|
|
1559
|
+
(R) => R !== Rt && R !== St
|
|
1560
1560
|
))
|
|
1561
1561
|
throw kt;
|
|
1562
1562
|
if (a)
|
|
@@ -1566,7 +1566,7 @@ var Fn = class {
|
|
|
1566
1566
|
!a && l !== "" && r.push([l, u.varIndex]);
|
|
1567
1567
|
} else if (u = this.children[i], !u) {
|
|
1568
1568
|
if (Object.keys(this.children).some(
|
|
1569
|
-
(l) => l.length > 1 && l !== Rt && l !==
|
|
1569
|
+
(l) => l.length > 1 && l !== Rt && l !== St
|
|
1570
1570
|
))
|
|
1571
1571
|
throw kt;
|
|
1572
1572
|
if (a)
|
|
@@ -1576,13 +1576,13 @@ var Fn = class {
|
|
|
1576
1576
|
u.insert(o, t, r, s, a);
|
|
1577
1577
|
}
|
|
1578
1578
|
buildRegExpStr() {
|
|
1579
|
-
const t = Object.keys(this.children).sort(
|
|
1579
|
+
const t = Object.keys(this.children).sort(ua).map((r) => {
|
|
1580
1580
|
const s = this.children[r];
|
|
1581
|
-
return (typeof s.varIndex == "number" ? `(${r})@${s.varIndex}` :
|
|
1581
|
+
return (typeof s.varIndex == "number" ? `(${r})@${s.varIndex}` : da.has(r) ? `\\${r}` : r) + s.buildRegExpStr();
|
|
1582
1582
|
});
|
|
1583
1583
|
return typeof this.index == "number" && t.unshift(`#${this.index}`), t.length === 0 ? "" : t.length === 1 ? t[0] : "(?:" + t.join("|") + ")";
|
|
1584
1584
|
}
|
|
1585
|
-
},
|
|
1585
|
+
}, la = class {
|
|
1586
1586
|
constructor() {
|
|
1587
1587
|
g(this, "context", { varIndex: 0 });
|
|
1588
1588
|
g(this, "root", new Fn());
|
|
@@ -1616,8 +1616,8 @@ var Fn = class {
|
|
|
1616
1616
|
const t = [], r = [];
|
|
1617
1617
|
return n = n.replace(/#(\d+)|@(\d+)|\.\*\$/g, (s, a, i) => typeof a < "u" ? (t[++e] = Number(a), "$()") : (typeof i < "u" && (r[Number(i)] = ++e), "")), [new RegExp(`^${n}`), t, r];
|
|
1618
1618
|
}
|
|
1619
|
-
},
|
|
1620
|
-
function
|
|
1619
|
+
}, Nr = [], pa = [/^$/, [], /* @__PURE__ */ Object.create(null)], gn = /* @__PURE__ */ Object.create(null);
|
|
1620
|
+
function Pr(n) {
|
|
1621
1621
|
return gn[n] ?? (gn[n] = new RegExp(
|
|
1622
1622
|
n === "*" ? "" : `^${n.replace(
|
|
1623
1623
|
/\/\*$|([.\\+*[^\]$()])/g,
|
|
@@ -1625,32 +1625,32 @@ function Nr(n) {
|
|
|
1625
1625
|
)}$`
|
|
1626
1626
|
));
|
|
1627
1627
|
}
|
|
1628
|
-
function
|
|
1628
|
+
function ha() {
|
|
1629
1629
|
gn = /* @__PURE__ */ Object.create(null);
|
|
1630
1630
|
}
|
|
1631
|
-
function
|
|
1631
|
+
function fa(n) {
|
|
1632
1632
|
var u;
|
|
1633
|
-
const e = new
|
|
1633
|
+
const e = new la(), t = [];
|
|
1634
1634
|
if (n.length === 0)
|
|
1635
|
-
return
|
|
1635
|
+
return pa;
|
|
1636
1636
|
const r = n.map(
|
|
1637
1637
|
(l) => [!/\*|\/:/.test(l[0]), ...l]
|
|
1638
1638
|
).sort(
|
|
1639
1639
|
([l, p], [R, D]) => l ? 1 : R ? -1 : p.length - D.length
|
|
1640
1640
|
), s = /* @__PURE__ */ Object.create(null);
|
|
1641
1641
|
for (let l = 0, p = -1, R = r.length; l < R; l++) {
|
|
1642
|
-
const [D,
|
|
1643
|
-
D ? s[
|
|
1644
|
-
let
|
|
1642
|
+
const [D, P, j] = r[l];
|
|
1643
|
+
D ? s[P] = [j.map(([H]) => [H, /* @__PURE__ */ Object.create(null)]), Nr] : p++;
|
|
1644
|
+
let U;
|
|
1645
1645
|
try {
|
|
1646
|
-
|
|
1646
|
+
U = e.insert(P, p, D);
|
|
1647
1647
|
} catch (H) {
|
|
1648
|
-
throw H === kt ? new Cr(
|
|
1648
|
+
throw H === kt ? new Cr(P) : H;
|
|
1649
1649
|
}
|
|
1650
1650
|
D || (t[p] = j.map(([H, ee]) => {
|
|
1651
1651
|
const te = /* @__PURE__ */ Object.create(null);
|
|
1652
1652
|
for (ee -= 1; ee >= 0; ee--) {
|
|
1653
|
-
const [Re, ae] =
|
|
1653
|
+
const [Re, ae] = U[ee];
|
|
1654
1654
|
te[Re] = ae;
|
|
1655
1655
|
}
|
|
1656
1656
|
return [H, te];
|
|
@@ -1659,12 +1659,12 @@ function ha(n) {
|
|
|
1659
1659
|
const [a, i, o] = e.buildRegExp();
|
|
1660
1660
|
for (let l = 0, p = t.length; l < p; l++)
|
|
1661
1661
|
for (let R = 0, D = t[l].length; R < D; R++) {
|
|
1662
|
-
const
|
|
1663
|
-
if (!
|
|
1662
|
+
const P = (u = t[l][R]) == null ? void 0 : u[1];
|
|
1663
|
+
if (!P)
|
|
1664
1664
|
continue;
|
|
1665
|
-
const j = Object.keys(
|
|
1666
|
-
for (let
|
|
1667
|
-
|
|
1665
|
+
const j = Object.keys(P);
|
|
1666
|
+
for (let U = 0, H = j.length; U < H; U++)
|
|
1667
|
+
P[j[U]] = o[P[j[U]]];
|
|
1668
1668
|
}
|
|
1669
1669
|
const d = [];
|
|
1670
1670
|
for (const l in i)
|
|
@@ -1674,11 +1674,11 @@ function ha(n) {
|
|
|
1674
1674
|
function Xe(n, e) {
|
|
1675
1675
|
if (n) {
|
|
1676
1676
|
for (const t of Object.keys(n).sort((r, s) => s.length - r.length))
|
|
1677
|
-
if (
|
|
1677
|
+
if (Pr(t).test(e))
|
|
1678
1678
|
return [...n[t]];
|
|
1679
1679
|
}
|
|
1680
1680
|
}
|
|
1681
|
-
var
|
|
1681
|
+
var ma = class {
|
|
1682
1682
|
constructor() {
|
|
1683
1683
|
g(this, "name", "RegExpRouter");
|
|
1684
1684
|
g(this, "middleware");
|
|
@@ -1689,7 +1689,7 @@ var fa = class {
|
|
|
1689
1689
|
var o;
|
|
1690
1690
|
const { middleware: r, routes: s } = this;
|
|
1691
1691
|
if (!r || !s)
|
|
1692
|
-
throw new Error(
|
|
1692
|
+
throw new Error(Zr);
|
|
1693
1693
|
r[n] || [r, s].forEach((d) => {
|
|
1694
1694
|
d[n] = /* @__PURE__ */ Object.create(null), Object.keys(d[F]).forEach((u) => {
|
|
1695
1695
|
d[n][u] = [...d[F][u]];
|
|
@@ -1697,7 +1697,7 @@ var fa = class {
|
|
|
1697
1697
|
}), e === "/*" && (e = "*");
|
|
1698
1698
|
const a = (e.match(/\/:/g) || []).length;
|
|
1699
1699
|
if (/\*$/.test(e)) {
|
|
1700
|
-
const d =
|
|
1700
|
+
const d = Pr(e);
|
|
1701
1701
|
n === F ? Object.keys(r).forEach((u) => {
|
|
1702
1702
|
var l;
|
|
1703
1703
|
(l = r[u])[e] || (l[e] = Xe(r[u], e) || Xe(r[F], e) || []);
|
|
@@ -1724,7 +1724,7 @@ var fa = class {
|
|
|
1724
1724
|
}
|
|
1725
1725
|
}
|
|
1726
1726
|
match(n, e) {
|
|
1727
|
-
|
|
1727
|
+
ha();
|
|
1728
1728
|
const t = this.buildAllMatchers();
|
|
1729
1729
|
return this.match = (r, s) => {
|
|
1730
1730
|
const a = t[r] || t[F], i = a[2][s];
|
|
@@ -1732,7 +1732,7 @@ var fa = class {
|
|
|
1732
1732
|
return i;
|
|
1733
1733
|
const o = s.match(a[0]);
|
|
1734
1734
|
if (!o)
|
|
1735
|
-
return [[],
|
|
1735
|
+
return [[], Nr];
|
|
1736
1736
|
const d = o.indexOf("", 1);
|
|
1737
1737
|
return [a[1][d], o];
|
|
1738
1738
|
}, this.match(n, e);
|
|
@@ -1751,9 +1751,9 @@ var fa = class {
|
|
|
1751
1751
|
s.length !== 0 ? (t || (t = !0), e.push(...s)) : n !== F && e.push(
|
|
1752
1752
|
...Object.keys(r[F]).map((a) => [a, r[F][a]])
|
|
1753
1753
|
);
|
|
1754
|
-
}), t ?
|
|
1754
|
+
}), t ? fa(e) : null;
|
|
1755
1755
|
}
|
|
1756
|
-
},
|
|
1756
|
+
}, ga = class {
|
|
1757
1757
|
constructor(n) {
|
|
1758
1758
|
g(this, "name", "SmartRouter");
|
|
1759
1759
|
g(this, "routers", []);
|
|
@@ -1762,7 +1762,7 @@ var fa = class {
|
|
|
1762
1762
|
}
|
|
1763
1763
|
add(n, e, t) {
|
|
1764
1764
|
if (!this.routes)
|
|
1765
|
-
throw new Error(
|
|
1765
|
+
throw new Error(Zr);
|
|
1766
1766
|
this.routes.push([n, e, t]);
|
|
1767
1767
|
}
|
|
1768
1768
|
match(n, e) {
|
|
@@ -1810,7 +1810,7 @@ var fa = class {
|
|
|
1810
1810
|
insert(n, e, t) {
|
|
1811
1811
|
this.name = `${n} ${e}`, this.order = ++this.order;
|
|
1812
1812
|
let r = this;
|
|
1813
|
-
const s =
|
|
1813
|
+
const s = Ls(e), a = [];
|
|
1814
1814
|
for (let d = 0, u = s.length; d < u; d++) {
|
|
1815
1815
|
const l = s[d];
|
|
1816
1816
|
if (Object.keys(r.children).includes(l)) {
|
|
@@ -1851,32 +1851,32 @@ var fa = class {
|
|
|
1851
1851
|
for (let o = 0, d = a.length; o < d; o++) {
|
|
1852
1852
|
const u = a[o], l = o === d - 1, p = [];
|
|
1853
1853
|
for (let R = 0, D = s.length; R < D; R++) {
|
|
1854
|
-
const
|
|
1855
|
-
j && (j.params =
|
|
1856
|
-
...this.gHSets(j.children["*"], n,
|
|
1857
|
-
), t.push(...this.gHSets(j, n,
|
|
1858
|
-
for (let
|
|
1859
|
-
const ee =
|
|
1854
|
+
const P = s[R], j = P.children[u];
|
|
1855
|
+
j && (j.params = P.params, l === !0 ? (j.children["*"] && t.push(
|
|
1856
|
+
...this.gHSets(j.children["*"], n, P.params, /* @__PURE__ */ Object.create(null))
|
|
1857
|
+
), t.push(...this.gHSets(j, n, P.params, /* @__PURE__ */ Object.create(null)))) : p.push(j));
|
|
1858
|
+
for (let U = 0, H = P.patterns.length; U < H; U++) {
|
|
1859
|
+
const ee = P.patterns[U], te = { ...P.params };
|
|
1860
1860
|
if (ee === "*") {
|
|
1861
|
-
const ie =
|
|
1862
|
-
ie && (t.push(...this.gHSets(ie, n,
|
|
1861
|
+
const ie = P.children["*"];
|
|
1862
|
+
ie && (t.push(...this.gHSets(ie, n, P.params, /* @__PURE__ */ Object.create(null))), p.push(ie));
|
|
1863
1863
|
continue;
|
|
1864
1864
|
}
|
|
1865
1865
|
if (u === "")
|
|
1866
1866
|
continue;
|
|
1867
|
-
const [Re, ae, ne] = ee, X =
|
|
1867
|
+
const [Re, ae, ne] = ee, X = P.children[Re], ge = a.slice(o).join("/");
|
|
1868
1868
|
if (ne instanceof RegExp && ne.test(ge)) {
|
|
1869
|
-
te[ae] = ge, t.push(...this.gHSets(X, n,
|
|
1869
|
+
te[ae] = ge, t.push(...this.gHSets(X, n, P.params, te));
|
|
1870
1870
|
continue;
|
|
1871
1871
|
}
|
|
1872
|
-
(ne === !0 || ne instanceof RegExp && ne.test(u)) && typeof Re == "string" && (te[ae] = u, l === !0 ? (t.push(...this.gHSets(X, n, te,
|
|
1872
|
+
(ne === !0 || ne instanceof RegExp && ne.test(u)) && typeof Re == "string" && (te[ae] = u, l === !0 ? (t.push(...this.gHSets(X, n, te, P.params)), X.children["*"] && t.push(...this.gHSets(X.children["*"], n, te, P.params))) : (X.params = te, p.push(X)));
|
|
1873
1873
|
}
|
|
1874
1874
|
}
|
|
1875
1875
|
s = p;
|
|
1876
1876
|
}
|
|
1877
1877
|
return [t.sort((o, d) => o.score - d.score).map(({ handler: o, params: d }) => [o, d])];
|
|
1878
1878
|
}
|
|
1879
|
-
},
|
|
1879
|
+
}, _a = class {
|
|
1880
1880
|
constructor() {
|
|
1881
1881
|
g(this, "name", "TrieRouter");
|
|
1882
1882
|
g(this, "node");
|
|
@@ -1894,10 +1894,10 @@ var fa = class {
|
|
|
1894
1894
|
match(n, e) {
|
|
1895
1895
|
return this.node.search(n, e);
|
|
1896
1896
|
}
|
|
1897
|
-
},
|
|
1897
|
+
}, ya = class extends Ir {
|
|
1898
1898
|
constructor(n = {}) {
|
|
1899
|
-
super(n), this.router = n.router ?? new
|
|
1900
|
-
routers: [new
|
|
1899
|
+
super(n), this.router = n.router ?? new ga({
|
|
1900
|
+
routers: [new ma(), new _a()]
|
|
1901
1901
|
});
|
|
1902
1902
|
}
|
|
1903
1903
|
}, $;
|
|
@@ -1965,7 +1965,7 @@ const v = $.arrayToEnum([
|
|
|
1965
1965
|
"never",
|
|
1966
1966
|
"map",
|
|
1967
1967
|
"set"
|
|
1968
|
-
]),
|
|
1968
|
+
]), Ze = (n) => {
|
|
1969
1969
|
switch (typeof n) {
|
|
1970
1970
|
case "undefined":
|
|
1971
1971
|
return v.undefined;
|
|
@@ -2003,7 +2003,7 @@ const v = $.arrayToEnum([
|
|
|
2003
2003
|
"invalid_intersection_types",
|
|
2004
2004
|
"not_multiple_of",
|
|
2005
2005
|
"not_finite"
|
|
2006
|
-
]),
|
|
2006
|
+
]), va = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
2007
2007
|
class re extends Error {
|
|
2008
2008
|
constructor(e) {
|
|
2009
2009
|
super(), this.issues = [], this.addIssue = (r) => {
|
|
@@ -2121,7 +2121,7 @@ const ut = (n, e) => {
|
|
|
2121
2121
|
return { message: t };
|
|
2122
2122
|
};
|
|
2123
2123
|
let $r = ut;
|
|
2124
|
-
function
|
|
2124
|
+
function ba(n) {
|
|
2125
2125
|
$r = n;
|
|
2126
2126
|
}
|
|
2127
2127
|
function wn() {
|
|
@@ -2147,7 +2147,7 @@ const xn = (n) => {
|
|
|
2147
2147
|
path: a,
|
|
2148
2148
|
message: o
|
|
2149
2149
|
};
|
|
2150
|
-
},
|
|
2150
|
+
}, ka = [];
|
|
2151
2151
|
function _(n, e) {
|
|
2152
2152
|
const t = wn(), r = xn({
|
|
2153
2153
|
issueData: e,
|
|
@@ -2206,7 +2206,7 @@ class z {
|
|
|
2206
2206
|
}
|
|
2207
2207
|
const T = Object.freeze({
|
|
2208
2208
|
status: "aborted"
|
|
2209
|
-
}), rt = (n) => ({ status: "dirty", value: n }), J = (n) => ({ status: "valid", value: n }), Gn = (n) => n.status === "aborted", zn = (n) => n.status === "dirty",
|
|
2209
|
+
}), rt = (n) => ({ status: "dirty", value: n }), J = (n) => ({ status: "valid", value: n }), Gn = (n) => n.status === "aborted", zn = (n) => n.status === "dirty", Zt = (n) => n.status === "valid", Ct = (n) => typeof Promise < "u" && n instanceof Promise;
|
|
2210
2210
|
function On(n, e, t, r) {
|
|
2211
2211
|
if (typeof e == "function" ? n !== e || !r : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
2212
2212
|
return e.get(n);
|
|
@@ -2229,7 +2229,7 @@ class ve {
|
|
|
2229
2229
|
}
|
|
2230
2230
|
}
|
|
2231
2231
|
const hr = (n, e) => {
|
|
2232
|
-
if (
|
|
2232
|
+
if (Zt(e))
|
|
2233
2233
|
return { success: !0, data: e.value };
|
|
2234
2234
|
if (!n.common.issues.length)
|
|
2235
2235
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -2243,7 +2243,7 @@ const hr = (n, e) => {
|
|
|
2243
2243
|
}
|
|
2244
2244
|
};
|
|
2245
2245
|
};
|
|
2246
|
-
function
|
|
2246
|
+
function S(n) {
|
|
2247
2247
|
if (!n)
|
|
2248
2248
|
return {};
|
|
2249
2249
|
const { errorMap: e, invalid_type_error: t, required_error: r, description: s } = n;
|
|
@@ -2263,13 +2263,13 @@ class I {
|
|
|
2263
2263
|
return this._def.description;
|
|
2264
2264
|
}
|
|
2265
2265
|
_getType(e) {
|
|
2266
|
-
return
|
|
2266
|
+
return Ze(e.data);
|
|
2267
2267
|
}
|
|
2268
2268
|
_getOrReturnCtx(e, t) {
|
|
2269
2269
|
return t || {
|
|
2270
2270
|
common: e.parent.common,
|
|
2271
2271
|
data: e.data,
|
|
2272
|
-
parsedType:
|
|
2272
|
+
parsedType: Ze(e.data),
|
|
2273
2273
|
schemaErrorMap: this._def.errorMap,
|
|
2274
2274
|
path: e.path,
|
|
2275
2275
|
parent: e.parent
|
|
@@ -2281,7 +2281,7 @@ class I {
|
|
|
2281
2281
|
ctx: {
|
|
2282
2282
|
common: e.parent.common,
|
|
2283
2283
|
data: e.data,
|
|
2284
|
-
parsedType:
|
|
2284
|
+
parsedType: Ze(e.data),
|
|
2285
2285
|
schemaErrorMap: this._def.errorMap,
|
|
2286
2286
|
path: e.path,
|
|
2287
2287
|
parent: e.parent
|
|
@@ -2316,7 +2316,7 @@ class I {
|
|
|
2316
2316
|
schemaErrorMap: this._def.errorMap,
|
|
2317
2317
|
parent: null,
|
|
2318
2318
|
data: e,
|
|
2319
|
-
parsedType:
|
|
2319
|
+
parsedType: Ze(e)
|
|
2320
2320
|
}, a = this._parseSync({ data: e, path: s.path, parent: s });
|
|
2321
2321
|
return hr(s, a);
|
|
2322
2322
|
}
|
|
@@ -2337,7 +2337,7 @@ class I {
|
|
|
2337
2337
|
schemaErrorMap: this._def.errorMap,
|
|
2338
2338
|
parent: null,
|
|
2339
2339
|
data: e,
|
|
2340
|
-
parsedType:
|
|
2340
|
+
parsedType: Ze(e)
|
|
2341
2341
|
}, s = this._parse({ data: e, path: r.path, parent: r }), a = await (Ct(s) ? s : Promise.resolve(s));
|
|
2342
2342
|
return hr(r, a);
|
|
2343
2343
|
}
|
|
@@ -2387,7 +2387,7 @@ class I {
|
|
|
2387
2387
|
}
|
|
2388
2388
|
transform(e) {
|
|
2389
2389
|
return new fe({
|
|
2390
|
-
...
|
|
2390
|
+
...S(this._def),
|
|
2391
2391
|
schema: this,
|
|
2392
2392
|
typeName: x.ZodEffects,
|
|
2393
2393
|
effect: { type: "transform", transform: e }
|
|
@@ -2395,8 +2395,8 @@ class I {
|
|
|
2395
2395
|
}
|
|
2396
2396
|
default(e) {
|
|
2397
2397
|
const t = typeof e == "function" ? e : () => e;
|
|
2398
|
-
return new
|
|
2399
|
-
...
|
|
2398
|
+
return new Vt({
|
|
2399
|
+
...S(this._def),
|
|
2400
2400
|
innerType: this,
|
|
2401
2401
|
defaultValue: t,
|
|
2402
2402
|
typeName: x.ZodDefault
|
|
@@ -2406,13 +2406,13 @@ class I {
|
|
|
2406
2406
|
return new rr({
|
|
2407
2407
|
typeName: x.ZodBranded,
|
|
2408
2408
|
type: this,
|
|
2409
|
-
...
|
|
2409
|
+
...S(this._def)
|
|
2410
2410
|
});
|
|
2411
2411
|
}
|
|
2412
2412
|
catch(e) {
|
|
2413
2413
|
const t = typeof e == "function" ? e : () => e;
|
|
2414
2414
|
return new qt({
|
|
2415
|
-
...
|
|
2415
|
+
...S(this._def),
|
|
2416
2416
|
innerType: this,
|
|
2417
2417
|
catchValue: t,
|
|
2418
2418
|
typeName: x.ZodCatch
|
|
@@ -2438,9 +2438,9 @@ class I {
|
|
|
2438
2438
|
return this.safeParse(null).success;
|
|
2439
2439
|
}
|
|
2440
2440
|
}
|
|
2441
|
-
const
|
|
2441
|
+
const wa = /^c[^\s-]{8,}$/i, xa = /^[0-9a-z]+$/, Oa = /^[0-9A-HJKMNP-TV-Z]{26}$/, Ta = /^[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, ja = /^[a-z0-9_-]{21}$/i, Ea = /^[-+]?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)?)??$/, Ra = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Sa = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
2442
2442
|
let Bn;
|
|
2443
|
-
const
|
|
2443
|
+
const Za = /^(?:(?: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])$/, Ca = /^(([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})))$/, Ia = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Dr = "((\\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])))", Na = new RegExp(`^${Dr}$`);
|
|
2444
2444
|
function Lr(n) {
|
|
2445
2445
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
2446
2446
|
return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
@@ -2448,13 +2448,13 @@ function Lr(n) {
|
|
|
2448
2448
|
function Pa(n) {
|
|
2449
2449
|
return new RegExp(`^${Lr(n)}$`);
|
|
2450
2450
|
}
|
|
2451
|
-
function
|
|
2451
|
+
function Ur(n) {
|
|
2452
2452
|
let e = `${Dr}T${Lr(n)}`;
|
|
2453
2453
|
const t = [];
|
|
2454
2454
|
return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
2455
2455
|
}
|
|
2456
|
-
function
|
|
2457
|
-
return !!((e === "v4" || !e) &&
|
|
2456
|
+
function Aa(n, e) {
|
|
2457
|
+
return !!((e === "v4" || !e) && Za.test(n) || (e === "v6" || !e) && Ca.test(n));
|
|
2458
2458
|
}
|
|
2459
2459
|
class ue extends I {
|
|
2460
2460
|
_parse(e) {
|
|
@@ -2505,43 +2505,43 @@ class ue extends I {
|
|
|
2505
2505
|
message: a.message
|
|
2506
2506
|
}), r.dirty());
|
|
2507
2507
|
} else if (a.kind === "email")
|
|
2508
|
-
|
|
2508
|
+
Ra.test(e.data) || (s = this._getOrReturnCtx(e, s), _(s, {
|
|
2509
2509
|
validation: "email",
|
|
2510
2510
|
code: h.invalid_string,
|
|
2511
2511
|
message: a.message
|
|
2512
2512
|
}), r.dirty());
|
|
2513
2513
|
else if (a.kind === "emoji")
|
|
2514
|
-
Bn || (Bn = new RegExp(
|
|
2514
|
+
Bn || (Bn = new RegExp(Sa, "u")), Bn.test(e.data) || (s = this._getOrReturnCtx(e, s), _(s, {
|
|
2515
2515
|
validation: "emoji",
|
|
2516
2516
|
code: h.invalid_string,
|
|
2517
2517
|
message: a.message
|
|
2518
2518
|
}), r.dirty());
|
|
2519
2519
|
else if (a.kind === "uuid")
|
|
2520
|
-
|
|
2520
|
+
Ta.test(e.data) || (s = this._getOrReturnCtx(e, s), _(s, {
|
|
2521
2521
|
validation: "uuid",
|
|
2522
2522
|
code: h.invalid_string,
|
|
2523
2523
|
message: a.message
|
|
2524
2524
|
}), r.dirty());
|
|
2525
2525
|
else if (a.kind === "nanoid")
|
|
2526
|
-
|
|
2526
|
+
ja.test(e.data) || (s = this._getOrReturnCtx(e, s), _(s, {
|
|
2527
2527
|
validation: "nanoid",
|
|
2528
2528
|
code: h.invalid_string,
|
|
2529
2529
|
message: a.message
|
|
2530
2530
|
}), r.dirty());
|
|
2531
2531
|
else if (a.kind === "cuid")
|
|
2532
|
-
|
|
2532
|
+
wa.test(e.data) || (s = this._getOrReturnCtx(e, s), _(s, {
|
|
2533
2533
|
validation: "cuid",
|
|
2534
2534
|
code: h.invalid_string,
|
|
2535
2535
|
message: a.message
|
|
2536
2536
|
}), r.dirty());
|
|
2537
2537
|
else if (a.kind === "cuid2")
|
|
2538
|
-
|
|
2538
|
+
xa.test(e.data) || (s = this._getOrReturnCtx(e, s), _(s, {
|
|
2539
2539
|
validation: "cuid2",
|
|
2540
2540
|
code: h.invalid_string,
|
|
2541
2541
|
message: a.message
|
|
2542
2542
|
}), r.dirty());
|
|
2543
2543
|
else if (a.kind === "ulid")
|
|
2544
|
-
|
|
2544
|
+
Oa.test(e.data) || (s = this._getOrReturnCtx(e, s), _(s, {
|
|
2545
2545
|
validation: "ulid",
|
|
2546
2546
|
code: h.invalid_string,
|
|
2547
2547
|
message: a.message
|
|
@@ -2572,11 +2572,11 @@ class ue extends I {
|
|
|
2572
2572
|
code: h.invalid_string,
|
|
2573
2573
|
validation: { endsWith: a.value },
|
|
2574
2574
|
message: a.message
|
|
2575
|
-
}), r.dirty()) : a.kind === "datetime" ?
|
|
2575
|
+
}), r.dirty()) : a.kind === "datetime" ? Ur(a).test(e.data) || (s = this._getOrReturnCtx(e, s), _(s, {
|
|
2576
2576
|
code: h.invalid_string,
|
|
2577
2577
|
validation: "datetime",
|
|
2578
2578
|
message: a.message
|
|
2579
|
-
}), r.dirty()) : a.kind === "date" ?
|
|
2579
|
+
}), r.dirty()) : a.kind === "date" ? Na.test(e.data) || (s = this._getOrReturnCtx(e, s), _(s, {
|
|
2580
2580
|
code: h.invalid_string,
|
|
2581
2581
|
validation: "date",
|
|
2582
2582
|
message: a.message
|
|
@@ -2584,15 +2584,15 @@ class ue extends I {
|
|
|
2584
2584
|
code: h.invalid_string,
|
|
2585
2585
|
validation: "time",
|
|
2586
2586
|
message: a.message
|
|
2587
|
-
}), r.dirty()) : a.kind === "duration" ?
|
|
2587
|
+
}), r.dirty()) : a.kind === "duration" ? Ea.test(e.data) || (s = this._getOrReturnCtx(e, s), _(s, {
|
|
2588
2588
|
validation: "duration",
|
|
2589
2589
|
code: h.invalid_string,
|
|
2590
2590
|
message: a.message
|
|
2591
|
-
}), r.dirty()) : a.kind === "ip" ?
|
|
2591
|
+
}), r.dirty()) : a.kind === "ip" ? Aa(e.data, a.version) || (s = this._getOrReturnCtx(e, s), _(s, {
|
|
2592
2592
|
validation: "ip",
|
|
2593
2593
|
code: h.invalid_string,
|
|
2594
2594
|
message: a.message
|
|
2595
|
-
}), r.dirty()) : a.kind === "base64" ?
|
|
2595
|
+
}), r.dirty()) : a.kind === "base64" ? Ia.test(e.data) || (s = this._getOrReturnCtx(e, s), _(s, {
|
|
2596
2596
|
validation: "base64",
|
|
2597
2597
|
code: h.invalid_string,
|
|
2598
2598
|
message: a.message
|
|
@@ -2811,14 +2811,14 @@ ue.create = (n) => {
|
|
|
2811
2811
|
checks: [],
|
|
2812
2812
|
typeName: x.ZodString,
|
|
2813
2813
|
coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
|
|
2814
|
-
...
|
|
2814
|
+
...S(n)
|
|
2815
2815
|
});
|
|
2816
2816
|
};
|
|
2817
|
-
function
|
|
2817
|
+
function $a(n, e) {
|
|
2818
2818
|
const t = (n.toString().split(".")[1] || "").length, r = (e.toString().split(".")[1] || "").length, s = t > r ? t : r, a = parseInt(n.toFixed(s).replace(".", "")), i = parseInt(e.toFixed(s).replace(".", ""));
|
|
2819
2819
|
return a % i / Math.pow(10, s);
|
|
2820
2820
|
}
|
|
2821
|
-
class
|
|
2821
|
+
class Ne extends I {
|
|
2822
2822
|
constructor() {
|
|
2823
2823
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
2824
2824
|
}
|
|
@@ -2853,7 +2853,7 @@ class Pe extends I {
|
|
|
2853
2853
|
inclusive: a.inclusive,
|
|
2854
2854
|
exact: !1,
|
|
2855
2855
|
message: a.message
|
|
2856
|
-
}), s.dirty()) : a.kind === "multipleOf" ?
|
|
2856
|
+
}), s.dirty()) : a.kind === "multipleOf" ? $a(e.data, a.value) !== 0 && (r = this._getOrReturnCtx(e, r), _(r, {
|
|
2857
2857
|
code: h.not_multiple_of,
|
|
2858
2858
|
multipleOf: a.value,
|
|
2859
2859
|
message: a.message
|
|
@@ -2876,7 +2876,7 @@ class Pe extends I {
|
|
|
2876
2876
|
return this.setLimit("max", e, !1, k.toString(t));
|
|
2877
2877
|
}
|
|
2878
2878
|
setLimit(e, t, r, s) {
|
|
2879
|
-
return new
|
|
2879
|
+
return new Ne({
|
|
2880
2880
|
...this._def,
|
|
2881
2881
|
checks: [
|
|
2882
2882
|
...this._def.checks,
|
|
@@ -2890,7 +2890,7 @@ class Pe extends I {
|
|
|
2890
2890
|
});
|
|
2891
2891
|
}
|
|
2892
2892
|
_addCheck(e) {
|
|
2893
|
-
return new
|
|
2893
|
+
return new Ne({
|
|
2894
2894
|
...this._def,
|
|
2895
2895
|
checks: [...this._def.checks, e]
|
|
2896
2896
|
});
|
|
@@ -2984,13 +2984,13 @@ class Pe extends I {
|
|
|
2984
2984
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
2985
2985
|
}
|
|
2986
2986
|
}
|
|
2987
|
-
|
|
2987
|
+
Ne.create = (n) => new Ne({
|
|
2988
2988
|
checks: [],
|
|
2989
2989
|
typeName: x.ZodNumber,
|
|
2990
2990
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
2991
|
-
...
|
|
2991
|
+
...S(n)
|
|
2992
2992
|
});
|
|
2993
|
-
class
|
|
2993
|
+
class Pe extends I {
|
|
2994
2994
|
constructor() {
|
|
2995
2995
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
2996
2996
|
}
|
|
@@ -3038,7 +3038,7 @@ class Ne extends I {
|
|
|
3038
3038
|
return this.setLimit("max", e, !1, k.toString(t));
|
|
3039
3039
|
}
|
|
3040
3040
|
setLimit(e, t, r, s) {
|
|
3041
|
-
return new
|
|
3041
|
+
return new Pe({
|
|
3042
3042
|
...this._def,
|
|
3043
3043
|
checks: [
|
|
3044
3044
|
...this._def.checks,
|
|
@@ -3052,7 +3052,7 @@ class Ne extends I {
|
|
|
3052
3052
|
});
|
|
3053
3053
|
}
|
|
3054
3054
|
_addCheck(e) {
|
|
3055
|
-
return new
|
|
3055
|
+
return new Pe({
|
|
3056
3056
|
...this._def,
|
|
3057
3057
|
checks: [...this._def.checks, e]
|
|
3058
3058
|
});
|
|
@@ -3109,13 +3109,13 @@ class Ne extends I {
|
|
|
3109
3109
|
return e;
|
|
3110
3110
|
}
|
|
3111
3111
|
}
|
|
3112
|
-
|
|
3112
|
+
Pe.create = (n) => {
|
|
3113
3113
|
var e;
|
|
3114
|
-
return new
|
|
3114
|
+
return new Pe({
|
|
3115
3115
|
checks: [],
|
|
3116
3116
|
typeName: x.ZodBigInt,
|
|
3117
3117
|
coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
|
|
3118
|
-
...
|
|
3118
|
+
...S(n)
|
|
3119
3119
|
});
|
|
3120
3120
|
};
|
|
3121
3121
|
class It extends I {
|
|
@@ -3134,7 +3134,7 @@ class It extends I {
|
|
|
3134
3134
|
It.create = (n) => new It({
|
|
3135
3135
|
typeName: x.ZodBoolean,
|
|
3136
3136
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
3137
|
-
...
|
|
3137
|
+
...S(n)
|
|
3138
3138
|
});
|
|
3139
3139
|
class Ge extends I {
|
|
3140
3140
|
_parse(e) {
|
|
@@ -3212,7 +3212,7 @@ Ge.create = (n) => new Ge({
|
|
|
3212
3212
|
checks: [],
|
|
3213
3213
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
3214
3214
|
typeName: x.ZodDate,
|
|
3215
|
-
...
|
|
3215
|
+
...S(n)
|
|
3216
3216
|
});
|
|
3217
3217
|
class Tn extends I {
|
|
3218
3218
|
_parse(e) {
|
|
@@ -3229,9 +3229,9 @@ class Tn extends I {
|
|
|
3229
3229
|
}
|
|
3230
3230
|
Tn.create = (n) => new Tn({
|
|
3231
3231
|
typeName: x.ZodSymbol,
|
|
3232
|
-
...
|
|
3232
|
+
...S(n)
|
|
3233
3233
|
});
|
|
3234
|
-
class
|
|
3234
|
+
class Nt extends I {
|
|
3235
3235
|
_parse(e) {
|
|
3236
3236
|
if (this._getType(e) !== v.undefined) {
|
|
3237
3237
|
const r = this._getOrReturnCtx(e);
|
|
@@ -3244,11 +3244,11 @@ class Pt extends I {
|
|
|
3244
3244
|
return J(e.data);
|
|
3245
3245
|
}
|
|
3246
3246
|
}
|
|
3247
|
-
|
|
3247
|
+
Nt.create = (n) => new Nt({
|
|
3248
3248
|
typeName: x.ZodUndefined,
|
|
3249
|
-
...
|
|
3249
|
+
...S(n)
|
|
3250
3250
|
});
|
|
3251
|
-
class
|
|
3251
|
+
class Pt extends I {
|
|
3252
3252
|
_parse(e) {
|
|
3253
3253
|
if (this._getType(e) !== v.null) {
|
|
3254
3254
|
const r = this._getOrReturnCtx(e);
|
|
@@ -3261,9 +3261,9 @@ class Nt extends I {
|
|
|
3261
3261
|
return J(e.data);
|
|
3262
3262
|
}
|
|
3263
3263
|
}
|
|
3264
|
-
|
|
3264
|
+
Pt.create = (n) => new Pt({
|
|
3265
3265
|
typeName: x.ZodNull,
|
|
3266
|
-
...
|
|
3266
|
+
...S(n)
|
|
3267
3267
|
});
|
|
3268
3268
|
class lt extends I {
|
|
3269
3269
|
constructor() {
|
|
@@ -3275,7 +3275,7 @@ class lt extends I {
|
|
|
3275
3275
|
}
|
|
3276
3276
|
lt.create = (n) => new lt({
|
|
3277
3277
|
typeName: x.ZodAny,
|
|
3278
|
-
...
|
|
3278
|
+
...S(n)
|
|
3279
3279
|
});
|
|
3280
3280
|
class Fe extends I {
|
|
3281
3281
|
constructor() {
|
|
@@ -3287,7 +3287,7 @@ class Fe extends I {
|
|
|
3287
3287
|
}
|
|
3288
3288
|
Fe.create = (n) => new Fe({
|
|
3289
3289
|
typeName: x.ZodUnknown,
|
|
3290
|
-
...
|
|
3290
|
+
...S(n)
|
|
3291
3291
|
});
|
|
3292
3292
|
class je extends I {
|
|
3293
3293
|
_parse(e) {
|
|
@@ -3301,7 +3301,7 @@ class je extends I {
|
|
|
3301
3301
|
}
|
|
3302
3302
|
je.create = (n) => new je({
|
|
3303
3303
|
typeName: x.ZodNever,
|
|
3304
|
-
...
|
|
3304
|
+
...S(n)
|
|
3305
3305
|
});
|
|
3306
3306
|
class jn extends I {
|
|
3307
3307
|
_parse(e) {
|
|
@@ -3318,7 +3318,7 @@ class jn extends I {
|
|
|
3318
3318
|
}
|
|
3319
3319
|
jn.create = (n) => new jn({
|
|
3320
3320
|
typeName: x.ZodVoid,
|
|
3321
|
-
...
|
|
3321
|
+
...S(n)
|
|
3322
3322
|
});
|
|
3323
3323
|
class pe extends I {
|
|
3324
3324
|
_parse(e) {
|
|
@@ -3391,7 +3391,7 @@ pe.create = (n, e) => new pe({
|
|
|
3391
3391
|
maxLength: null,
|
|
3392
3392
|
exactLength: null,
|
|
3393
3393
|
typeName: x.ZodArray,
|
|
3394
|
-
...
|
|
3394
|
+
...S(e)
|
|
3395
3395
|
});
|
|
3396
3396
|
function tt(n) {
|
|
3397
3397
|
if (n instanceof q) {
|
|
@@ -3672,7 +3672,7 @@ class q extends I {
|
|
|
3672
3672
|
});
|
|
3673
3673
|
}
|
|
3674
3674
|
keyof() {
|
|
3675
|
-
return
|
|
3675
|
+
return Vr($.objectKeys(this.shape));
|
|
3676
3676
|
}
|
|
3677
3677
|
}
|
|
3678
3678
|
q.create = (n, e) => new q({
|
|
@@ -3680,21 +3680,21 @@ q.create = (n, e) => new q({
|
|
|
3680
3680
|
unknownKeys: "strip",
|
|
3681
3681
|
catchall: je.create(),
|
|
3682
3682
|
typeName: x.ZodObject,
|
|
3683
|
-
...
|
|
3683
|
+
...S(e)
|
|
3684
3684
|
});
|
|
3685
3685
|
q.strictCreate = (n, e) => new q({
|
|
3686
3686
|
shape: () => n,
|
|
3687
3687
|
unknownKeys: "strict",
|
|
3688
3688
|
catchall: je.create(),
|
|
3689
3689
|
typeName: x.ZodObject,
|
|
3690
|
-
...
|
|
3690
|
+
...S(e)
|
|
3691
3691
|
});
|
|
3692
3692
|
q.lazycreate = (n, e) => new q({
|
|
3693
3693
|
shape: n,
|
|
3694
3694
|
unknownKeys: "strip",
|
|
3695
3695
|
catchall: je.create(),
|
|
3696
3696
|
typeName: x.ZodObject,
|
|
3697
|
-
...
|
|
3697
|
+
...S(e)
|
|
3698
3698
|
});
|
|
3699
3699
|
class At extends I {
|
|
3700
3700
|
_parse(e) {
|
|
@@ -3767,9 +3767,9 @@ class At extends I {
|
|
|
3767
3767
|
At.create = (n, e) => new At({
|
|
3768
3768
|
options: n,
|
|
3769
3769
|
typeName: x.ZodUnion,
|
|
3770
|
-
...
|
|
3770
|
+
...S(e)
|
|
3771
3771
|
});
|
|
3772
|
-
const xe = (n) => n instanceof Dt ? xe(n.schema) : n instanceof fe ? xe(n.innerType()) : n instanceof Lt ? [n.value] : n instanceof Ae ? n.options : n instanceof
|
|
3772
|
+
const xe = (n) => n instanceof Dt ? xe(n.schema) : n instanceof fe ? xe(n.innerType()) : n instanceof Lt ? [n.value] : n instanceof Ae ? n.options : n instanceof Ut ? $.objectValues(n.enum) : n instanceof Vt ? xe(n._def.innerType) : n instanceof Nt ? [void 0] : n instanceof Pt ? [null] : n instanceof _e ? [void 0, ...xe(n.unwrap())] : n instanceof $e ? [null, ...xe(n.unwrap())] : n instanceof rr || n instanceof Bt ? xe(n.unwrap()) : n instanceof qt ? xe(n._def.innerType) : [];
|
|
3773
3773
|
class Dn extends I {
|
|
3774
3774
|
_parse(e) {
|
|
3775
3775
|
const { ctx: t } = this._processInputParams(e);
|
|
@@ -3828,12 +3828,12 @@ class Dn extends I {
|
|
|
3828
3828
|
discriminator: e,
|
|
3829
3829
|
options: t,
|
|
3830
3830
|
optionsMap: s,
|
|
3831
|
-
...
|
|
3831
|
+
...S(r)
|
|
3832
3832
|
});
|
|
3833
3833
|
}
|
|
3834
3834
|
}
|
|
3835
3835
|
function Yn(n, e) {
|
|
3836
|
-
const t =
|
|
3836
|
+
const t = Ze(n), r = Ze(e);
|
|
3837
3837
|
if (n === e)
|
|
3838
3838
|
return { valid: !0, data: n };
|
|
3839
3839
|
if (t === v.object && r === v.object) {
|
|
@@ -3894,7 +3894,7 @@ $t.create = (n, e, t) => new $t({
|
|
|
3894
3894
|
left: n,
|
|
3895
3895
|
right: e,
|
|
3896
3896
|
typeName: x.ZodIntersection,
|
|
3897
|
-
...
|
|
3897
|
+
...S(t)
|
|
3898
3898
|
});
|
|
3899
3899
|
class be extends I {
|
|
3900
3900
|
_parse(e) {
|
|
@@ -3943,7 +3943,7 @@ be.create = (n, e) => {
|
|
|
3943
3943
|
items: n,
|
|
3944
3944
|
typeName: x.ZodTuple,
|
|
3945
3945
|
rest: null,
|
|
3946
|
-
...
|
|
3946
|
+
...S(e)
|
|
3947
3947
|
});
|
|
3948
3948
|
};
|
|
3949
3949
|
class Mt extends I {
|
|
@@ -3978,16 +3978,16 @@ class Mt extends I {
|
|
|
3978
3978
|
keyType: e,
|
|
3979
3979
|
valueType: t,
|
|
3980
3980
|
typeName: x.ZodRecord,
|
|
3981
|
-
...
|
|
3981
|
+
...S(r)
|
|
3982
3982
|
}) : new Mt({
|
|
3983
3983
|
keyType: ue.create(),
|
|
3984
3984
|
valueType: e,
|
|
3985
3985
|
typeName: x.ZodRecord,
|
|
3986
|
-
...
|
|
3986
|
+
...S(t)
|
|
3987
3987
|
});
|
|
3988
3988
|
}
|
|
3989
3989
|
}
|
|
3990
|
-
class
|
|
3990
|
+
class En extends I {
|
|
3991
3991
|
get keySchema() {
|
|
3992
3992
|
return this._def.keyType;
|
|
3993
3993
|
}
|
|
@@ -4029,11 +4029,11 @@ class Zn extends I {
|
|
|
4029
4029
|
}
|
|
4030
4030
|
}
|
|
4031
4031
|
}
|
|
4032
|
-
|
|
4032
|
+
En.create = (n, e, t) => new En({
|
|
4033
4033
|
valueType: e,
|
|
4034
4034
|
keyType: n,
|
|
4035
4035
|
typeName: x.ZodMap,
|
|
4036
|
-
...
|
|
4036
|
+
...S(t)
|
|
4037
4037
|
});
|
|
4038
4038
|
class ze extends I {
|
|
4039
4039
|
_parse(e) {
|
|
@@ -4097,7 +4097,7 @@ ze.create = (n, e) => new ze({
|
|
|
4097
4097
|
minSize: null,
|
|
4098
4098
|
maxSize: null,
|
|
4099
4099
|
typeName: x.ZodSet,
|
|
4100
|
-
...
|
|
4100
|
+
...S(e)
|
|
4101
4101
|
});
|
|
4102
4102
|
class at extends I {
|
|
4103
4103
|
constructor() {
|
|
@@ -4196,7 +4196,7 @@ class at extends I {
|
|
|
4196
4196
|
args: e || be.create([]).rest(Fe.create()),
|
|
4197
4197
|
returns: t || Fe.create(),
|
|
4198
4198
|
typeName: x.ZodFunction,
|
|
4199
|
-
...
|
|
4199
|
+
...S(r)
|
|
4200
4200
|
});
|
|
4201
4201
|
}
|
|
4202
4202
|
}
|
|
@@ -4212,7 +4212,7 @@ class Dt extends I {
|
|
|
4212
4212
|
Dt.create = (n, e) => new Dt({
|
|
4213
4213
|
getter: n,
|
|
4214
4214
|
typeName: x.ZodLazy,
|
|
4215
|
-
...
|
|
4215
|
+
...S(e)
|
|
4216
4216
|
});
|
|
4217
4217
|
class Lt extends I {
|
|
4218
4218
|
_parse(e) {
|
|
@@ -4233,13 +4233,13 @@ class Lt extends I {
|
|
|
4233
4233
|
Lt.create = (n, e) => new Lt({
|
|
4234
4234
|
value: n,
|
|
4235
4235
|
typeName: x.ZodLiteral,
|
|
4236
|
-
...
|
|
4236
|
+
...S(e)
|
|
4237
4237
|
});
|
|
4238
|
-
function
|
|
4238
|
+
function Vr(n, e) {
|
|
4239
4239
|
return new Ae({
|
|
4240
4240
|
values: n,
|
|
4241
4241
|
typeName: x.ZodEnum,
|
|
4242
|
-
...
|
|
4242
|
+
...S(e)
|
|
4243
4243
|
});
|
|
4244
4244
|
}
|
|
4245
4245
|
class Ae extends I {
|
|
@@ -4300,8 +4300,8 @@ class Ae extends I {
|
|
|
4300
4300
|
}
|
|
4301
4301
|
}
|
|
4302
4302
|
wt = /* @__PURE__ */ new WeakMap();
|
|
4303
|
-
Ae.create =
|
|
4304
|
-
class
|
|
4303
|
+
Ae.create = Vr;
|
|
4304
|
+
class Ut extends I {
|
|
4305
4305
|
constructor() {
|
|
4306
4306
|
super(...arguments), xt.set(this, void 0);
|
|
4307
4307
|
}
|
|
@@ -4330,10 +4330,10 @@ class Vt extends I {
|
|
|
4330
4330
|
}
|
|
4331
4331
|
}
|
|
4332
4332
|
xt = /* @__PURE__ */ new WeakMap();
|
|
4333
|
-
|
|
4333
|
+
Ut.create = (n, e) => new Ut({
|
|
4334
4334
|
values: n,
|
|
4335
4335
|
typeName: x.ZodNativeEnum,
|
|
4336
|
-
...
|
|
4336
|
+
...S(e)
|
|
4337
4337
|
});
|
|
4338
4338
|
class pt extends I {
|
|
4339
4339
|
unwrap() {
|
|
@@ -4357,7 +4357,7 @@ class pt extends I {
|
|
|
4357
4357
|
pt.create = (n, e) => new pt({
|
|
4358
4358
|
type: n,
|
|
4359
4359
|
typeName: x.ZodPromise,
|
|
4360
|
-
...
|
|
4360
|
+
...S(e)
|
|
4361
4361
|
});
|
|
4362
4362
|
class fe extends I {
|
|
4363
4363
|
innerType() {
|
|
@@ -4425,14 +4425,14 @@ class fe extends I {
|
|
|
4425
4425
|
path: r.path,
|
|
4426
4426
|
parent: r
|
|
4427
4427
|
});
|
|
4428
|
-
if (!
|
|
4428
|
+
if (!Zt(i))
|
|
4429
4429
|
return i;
|
|
4430
4430
|
const o = s.transform(i.value, a);
|
|
4431
4431
|
if (o instanceof Promise)
|
|
4432
4432
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
4433
4433
|
return { status: t.value, value: o };
|
|
4434
4434
|
} else
|
|
4435
|
-
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((i) =>
|
|
4435
|
+
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((i) => Zt(i) ? Promise.resolve(s.transform(i.value, a)).then((o) => ({ status: t.value, value: o })) : i);
|
|
4436
4436
|
$.assertNever(s);
|
|
4437
4437
|
}
|
|
4438
4438
|
}
|
|
@@ -4440,13 +4440,13 @@ fe.create = (n, e, t) => new fe({
|
|
|
4440
4440
|
schema: n,
|
|
4441
4441
|
typeName: x.ZodEffects,
|
|
4442
4442
|
effect: e,
|
|
4443
|
-
...
|
|
4443
|
+
...S(t)
|
|
4444
4444
|
});
|
|
4445
4445
|
fe.createWithPreprocess = (n, e, t) => new fe({
|
|
4446
4446
|
schema: e,
|
|
4447
4447
|
effect: { type: "preprocess", transform: n },
|
|
4448
4448
|
typeName: x.ZodEffects,
|
|
4449
|
-
...
|
|
4449
|
+
...S(t)
|
|
4450
4450
|
});
|
|
4451
4451
|
class _e extends I {
|
|
4452
4452
|
_parse(e) {
|
|
@@ -4459,7 +4459,7 @@ class _e extends I {
|
|
|
4459
4459
|
_e.create = (n, e) => new _e({
|
|
4460
4460
|
innerType: n,
|
|
4461
4461
|
typeName: x.ZodOptional,
|
|
4462
|
-
...
|
|
4462
|
+
...S(e)
|
|
4463
4463
|
});
|
|
4464
4464
|
class $e extends I {
|
|
4465
4465
|
_parse(e) {
|
|
@@ -4472,9 +4472,9 @@ class $e extends I {
|
|
|
4472
4472
|
$e.create = (n, e) => new $e({
|
|
4473
4473
|
innerType: n,
|
|
4474
4474
|
typeName: x.ZodNullable,
|
|
4475
|
-
...
|
|
4475
|
+
...S(e)
|
|
4476
4476
|
});
|
|
4477
|
-
class
|
|
4477
|
+
class Vt extends I {
|
|
4478
4478
|
_parse(e) {
|
|
4479
4479
|
const { ctx: t } = this._processInputParams(e);
|
|
4480
4480
|
let r = t.data;
|
|
@@ -4488,11 +4488,11 @@ class Ut extends I {
|
|
|
4488
4488
|
return this._def.innerType;
|
|
4489
4489
|
}
|
|
4490
4490
|
}
|
|
4491
|
-
|
|
4491
|
+
Vt.create = (n, e) => new Vt({
|
|
4492
4492
|
innerType: n,
|
|
4493
4493
|
typeName: x.ZodDefault,
|
|
4494
4494
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
4495
|
-
...
|
|
4495
|
+
...S(e)
|
|
4496
4496
|
});
|
|
4497
4497
|
class qt extends I {
|
|
4498
4498
|
_parse(e) {
|
|
@@ -4535,7 +4535,7 @@ qt.create = (n, e) => new qt({
|
|
|
4535
4535
|
innerType: n,
|
|
4536
4536
|
typeName: x.ZodCatch,
|
|
4537
4537
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
4538
|
-
...
|
|
4538
|
+
...S(e)
|
|
4539
4539
|
});
|
|
4540
4540
|
class Rn extends I {
|
|
4541
4541
|
_parse(e) {
|
|
@@ -4552,9 +4552,9 @@ class Rn extends I {
|
|
|
4552
4552
|
}
|
|
4553
4553
|
Rn.create = (n) => new Rn({
|
|
4554
4554
|
typeName: x.ZodNaN,
|
|
4555
|
-
...
|
|
4555
|
+
...S(n)
|
|
4556
4556
|
});
|
|
4557
|
-
const
|
|
4557
|
+
const Ma = Symbol("zod_brand");
|
|
4558
4558
|
class rr extends I {
|
|
4559
4559
|
_parse(e) {
|
|
4560
4560
|
const { ctx: t } = this._processInputParams(e), r = t.data;
|
|
@@ -4610,7 +4610,7 @@ class ln extends I {
|
|
|
4610
4610
|
}
|
|
4611
4611
|
class Bt extends I {
|
|
4612
4612
|
_parse(e) {
|
|
4613
|
-
const t = this._def.innerType._parse(e), r = (s) => (
|
|
4613
|
+
const t = this._def.innerType._parse(e), r = (s) => (Zt(s) && (s.value = Object.freeze(s.value)), s);
|
|
4614
4614
|
return Ct(t) ? t.then((s) => r(s)) : r(t);
|
|
4615
4615
|
}
|
|
4616
4616
|
unwrap() {
|
|
@@ -4620,7 +4620,7 @@ class Bt extends I {
|
|
|
4620
4620
|
Bt.create = (n, e) => new Bt({
|
|
4621
4621
|
innerType: n,
|
|
4622
4622
|
typeName: x.ZodReadonly,
|
|
4623
|
-
...
|
|
4623
|
+
...S(e)
|
|
4624
4624
|
});
|
|
4625
4625
|
function qr(n, e = {}, t) {
|
|
4626
4626
|
return n ? lt.create().superRefine((r, s) => {
|
|
@@ -4631,32 +4631,32 @@ function qr(n, e = {}, t) {
|
|
|
4631
4631
|
}
|
|
4632
4632
|
}) : lt.create();
|
|
4633
4633
|
}
|
|
4634
|
-
const
|
|
4634
|
+
const Da = {
|
|
4635
4635
|
object: q.lazycreate
|
|
4636
4636
|
};
|
|
4637
4637
|
var x;
|
|
4638
4638
|
(function(n) {
|
|
4639
4639
|
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";
|
|
4640
4640
|
})(x || (x = {}));
|
|
4641
|
-
const
|
|
4641
|
+
const La = (n, e = {
|
|
4642
4642
|
message: `Input not instance of ${n.name}`
|
|
4643
|
-
}) => qr((t) => t instanceof n, e), Br = ue.create, Wr =
|
|
4643
|
+
}) => qr((t) => t instanceof n, e), Br = ue.create, Wr = Ne.create, Ua = Rn.create, Va = Pe.create, Hr = It.create, qa = Ge.create, Ba = Tn.create, Wa = Nt.create, Ha = Pt.create, Fa = lt.create, Ka = Fe.create, Ga = je.create, za = jn.create, Ya = pe.create, Ja = q.create, Qa = q.strictCreate, Xa = At.create, ei = Dn.create, ti = $t.create, ni = be.create, ri = Mt.create, si = En.create, ai = ze.create, ii = at.create, oi = Dt.create, ci = Lt.create, di = Ae.create, ui = Ut.create, li = pt.create, fr = fe.create, pi = _e.create, hi = $e.create, fi = fe.createWithPreprocess, mi = ln.create, gi = () => Br().optional(), _i = () => Wr().optional(), yi = () => Hr().optional(), vi = {
|
|
4644
4644
|
string: (n) => ue.create({ ...n, coerce: !0 }),
|
|
4645
|
-
number: (n) =>
|
|
4645
|
+
number: (n) => Ne.create({ ...n, coerce: !0 }),
|
|
4646
4646
|
boolean: (n) => It.create({
|
|
4647
4647
|
...n,
|
|
4648
4648
|
coerce: !0
|
|
4649
4649
|
}),
|
|
4650
|
-
bigint: (n) =>
|
|
4650
|
+
bigint: (n) => Pe.create({ ...n, coerce: !0 }),
|
|
4651
4651
|
date: (n) => Ge.create({ ...n, coerce: !0 })
|
|
4652
|
-
},
|
|
4652
|
+
}, bi = T;
|
|
4653
4653
|
var G = /* @__PURE__ */ Object.freeze({
|
|
4654
4654
|
__proto__: null,
|
|
4655
4655
|
defaultErrorMap: ut,
|
|
4656
|
-
setErrorMap:
|
|
4656
|
+
setErrorMap: ba,
|
|
4657
4657
|
getErrorMap: wn,
|
|
4658
4658
|
makeIssue: xn,
|
|
4659
|
-
EMPTY_PATH:
|
|
4659
|
+
EMPTY_PATH: ka,
|
|
4660
4660
|
addIssueToContext: _,
|
|
4661
4661
|
ParseStatus: z,
|
|
4662
4662
|
INVALID: T,
|
|
@@ -4664,7 +4664,7 @@ var G = /* @__PURE__ */ Object.freeze({
|
|
|
4664
4664
|
OK: J,
|
|
4665
4665
|
isAborted: Gn,
|
|
4666
4666
|
isDirty: zn,
|
|
4667
|
-
isValid:
|
|
4667
|
+
isValid: Zt,
|
|
4668
4668
|
isAsync: Ct,
|
|
4669
4669
|
get util() {
|
|
4670
4670
|
return $;
|
|
@@ -4673,17 +4673,17 @@ var G = /* @__PURE__ */ Object.freeze({
|
|
|
4673
4673
|
return Kn;
|
|
4674
4674
|
},
|
|
4675
4675
|
ZodParsedType: v,
|
|
4676
|
-
getParsedType:
|
|
4676
|
+
getParsedType: Ze,
|
|
4677
4677
|
ZodType: I,
|
|
4678
|
-
datetimeRegex:
|
|
4678
|
+
datetimeRegex: Ur,
|
|
4679
4679
|
ZodString: ue,
|
|
4680
|
-
ZodNumber:
|
|
4681
|
-
ZodBigInt:
|
|
4680
|
+
ZodNumber: Ne,
|
|
4681
|
+
ZodBigInt: Pe,
|
|
4682
4682
|
ZodBoolean: It,
|
|
4683
4683
|
ZodDate: Ge,
|
|
4684
4684
|
ZodSymbol: Tn,
|
|
4685
|
-
ZodUndefined:
|
|
4686
|
-
ZodNull:
|
|
4685
|
+
ZodUndefined: Nt,
|
|
4686
|
+
ZodNull: Pt,
|
|
4687
4687
|
ZodAny: lt,
|
|
4688
4688
|
ZodUnknown: Fe,
|
|
4689
4689
|
ZodNever: je,
|
|
@@ -4695,77 +4695,77 @@ var G = /* @__PURE__ */ Object.freeze({
|
|
|
4695
4695
|
ZodIntersection: $t,
|
|
4696
4696
|
ZodTuple: be,
|
|
4697
4697
|
ZodRecord: Mt,
|
|
4698
|
-
ZodMap:
|
|
4698
|
+
ZodMap: En,
|
|
4699
4699
|
ZodSet: ze,
|
|
4700
4700
|
ZodFunction: at,
|
|
4701
4701
|
ZodLazy: Dt,
|
|
4702
4702
|
ZodLiteral: Lt,
|
|
4703
4703
|
ZodEnum: Ae,
|
|
4704
|
-
ZodNativeEnum:
|
|
4704
|
+
ZodNativeEnum: Ut,
|
|
4705
4705
|
ZodPromise: pt,
|
|
4706
4706
|
ZodEffects: fe,
|
|
4707
4707
|
ZodTransformer: fe,
|
|
4708
4708
|
ZodOptional: _e,
|
|
4709
4709
|
ZodNullable: $e,
|
|
4710
|
-
ZodDefault:
|
|
4710
|
+
ZodDefault: Vt,
|
|
4711
4711
|
ZodCatch: qt,
|
|
4712
4712
|
ZodNaN: Rn,
|
|
4713
|
-
BRAND:
|
|
4713
|
+
BRAND: Ma,
|
|
4714
4714
|
ZodBranded: rr,
|
|
4715
4715
|
ZodPipeline: ln,
|
|
4716
4716
|
ZodReadonly: Bt,
|
|
4717
4717
|
custom: qr,
|
|
4718
4718
|
Schema: I,
|
|
4719
4719
|
ZodSchema: I,
|
|
4720
|
-
late:
|
|
4720
|
+
late: Da,
|
|
4721
4721
|
get ZodFirstPartyTypeKind() {
|
|
4722
4722
|
return x;
|
|
4723
4723
|
},
|
|
4724
|
-
coerce:
|
|
4725
|
-
any:
|
|
4726
|
-
array:
|
|
4724
|
+
coerce: vi,
|
|
4725
|
+
any: Fa,
|
|
4726
|
+
array: Ya,
|
|
4727
4727
|
bigint: Va,
|
|
4728
4728
|
boolean: Hr,
|
|
4729
|
-
date:
|
|
4730
|
-
discriminatedUnion:
|
|
4729
|
+
date: qa,
|
|
4730
|
+
discriminatedUnion: ei,
|
|
4731
4731
|
effect: fr,
|
|
4732
|
-
enum:
|
|
4733
|
-
function:
|
|
4734
|
-
instanceof:
|
|
4735
|
-
intersection:
|
|
4736
|
-
lazy:
|
|
4737
|
-
literal:
|
|
4738
|
-
map:
|
|
4739
|
-
nan:
|
|
4740
|
-
nativeEnum:
|
|
4741
|
-
never:
|
|
4742
|
-
null:
|
|
4743
|
-
nullable:
|
|
4732
|
+
enum: di,
|
|
4733
|
+
function: ii,
|
|
4734
|
+
instanceof: La,
|
|
4735
|
+
intersection: ti,
|
|
4736
|
+
lazy: oi,
|
|
4737
|
+
literal: ci,
|
|
4738
|
+
map: si,
|
|
4739
|
+
nan: Ua,
|
|
4740
|
+
nativeEnum: ui,
|
|
4741
|
+
never: Ga,
|
|
4742
|
+
null: Ha,
|
|
4743
|
+
nullable: hi,
|
|
4744
4744
|
number: Wr,
|
|
4745
|
-
object:
|
|
4746
|
-
oboolean:
|
|
4747
|
-
onumber:
|
|
4748
|
-
optional:
|
|
4749
|
-
ostring:
|
|
4750
|
-
pipeline:
|
|
4751
|
-
preprocess:
|
|
4752
|
-
promise:
|
|
4753
|
-
record:
|
|
4754
|
-
set:
|
|
4755
|
-
strictObject:
|
|
4745
|
+
object: Ja,
|
|
4746
|
+
oboolean: yi,
|
|
4747
|
+
onumber: _i,
|
|
4748
|
+
optional: pi,
|
|
4749
|
+
ostring: gi,
|
|
4750
|
+
pipeline: mi,
|
|
4751
|
+
preprocess: fi,
|
|
4752
|
+
promise: li,
|
|
4753
|
+
record: ri,
|
|
4754
|
+
set: ai,
|
|
4755
|
+
strictObject: Qa,
|
|
4756
4756
|
string: Br,
|
|
4757
|
-
symbol:
|
|
4757
|
+
symbol: Ba,
|
|
4758
4758
|
transformer: fr,
|
|
4759
|
-
tuple:
|
|
4760
|
-
undefined:
|
|
4761
|
-
union:
|
|
4762
|
-
unknown:
|
|
4763
|
-
void:
|
|
4764
|
-
NEVER:
|
|
4759
|
+
tuple: ni,
|
|
4760
|
+
undefined: Wa,
|
|
4761
|
+
union: Xa,
|
|
4762
|
+
unknown: Ka,
|
|
4763
|
+
void: za,
|
|
4764
|
+
NEVER: bi,
|
|
4765
4765
|
ZodIssueCode: h,
|
|
4766
|
-
quotelessJson:
|
|
4766
|
+
quotelessJson: va,
|
|
4767
4767
|
ZodError: re
|
|
4768
|
-
}), Wt = class Jn extends
|
|
4768
|
+
}), Wt = class Jn extends ya {
|
|
4769
4769
|
constructor(t) {
|
|
4770
4770
|
super(t);
|
|
4771
4771
|
g(this, "openAPIRegistry");
|
|
@@ -4802,7 +4802,7 @@ var G = /* @__PURE__ */ Object.freeze({
|
|
|
4802
4802
|
*)
|
|
4803
4803
|
*/
|
|
4804
4804
|
g(this, "openapi", ({ middleware: t, ...r }, s, a = this.defaultHook) => {
|
|
4805
|
-
var u, l, p, R, D,
|
|
4805
|
+
var u, l, p, R, D, P;
|
|
4806
4806
|
this.openAPIRegistry.registerPath(r);
|
|
4807
4807
|
const i = [];
|
|
4808
4808
|
if ((u = r.request) != null && u.query) {
|
|
@@ -4821,19 +4821,19 @@ var G = /* @__PURE__ */ Object.freeze({
|
|
|
4821
4821
|
const j = Qe("cookie", r.request.cookies, a);
|
|
4822
4822
|
i.push(j);
|
|
4823
4823
|
}
|
|
4824
|
-
const o = (
|
|
4824
|
+
const o = (P = (D = r.request) == null ? void 0 : D.body) == null ? void 0 : P.content;
|
|
4825
4825
|
if (o)
|
|
4826
4826
|
for (const j of Object.keys(o)) {
|
|
4827
4827
|
if (!o[j])
|
|
4828
4828
|
continue;
|
|
4829
|
-
const
|
|
4830
|
-
if (
|
|
4829
|
+
const U = o[j].schema;
|
|
4830
|
+
if (U instanceof I) {
|
|
4831
4831
|
if (j.startsWith("application/json")) {
|
|
4832
|
-
const H = Qe("json",
|
|
4832
|
+
const H = Qe("json", U, a);
|
|
4833
4833
|
i.push(H);
|
|
4834
4834
|
}
|
|
4835
4835
|
if (j.startsWith("multipart/form-data") || j.startsWith("application/x-www-form-urlencoded")) {
|
|
4836
|
-
const H = Qe("form",
|
|
4836
|
+
const H = Qe("form", U, a);
|
|
4837
4837
|
i.push(H);
|
|
4838
4838
|
}
|
|
4839
4839
|
}
|
|
@@ -4847,8 +4847,8 @@ var G = /* @__PURE__ */ Object.freeze({
|
|
|
4847
4847
|
s
|
|
4848
4848
|
), this;
|
|
4849
4849
|
});
|
|
4850
|
-
g(this, "getOpenAPIDocument", (t) => new
|
|
4851
|
-
g(this, "getOpenAPI31Document", (t) => new
|
|
4850
|
+
g(this, "getOpenAPIDocument", (t) => new As(this.openAPIRegistry.definitions).generateDocument(t));
|
|
4851
|
+
g(this, "getOpenAPI31Document", (t) => new Ds(this.openAPIRegistry.definitions).generateDocument(t));
|
|
4852
4852
|
g(this, "doc", (t, r) => this.get(t, (s) => {
|
|
4853
4853
|
const a = typeof r == "function" ? r(s) : r;
|
|
4854
4854
|
try {
|
|
@@ -4867,7 +4867,7 @@ var G = /* @__PURE__ */ Object.freeze({
|
|
|
4867
4867
|
return s.json(i, 500);
|
|
4868
4868
|
}
|
|
4869
4869
|
}));
|
|
4870
|
-
this.openAPIRegistry = new
|
|
4870
|
+
this.openAPIRegistry = new _s(), this.defaultHook = t == null ? void 0 : t.defaultHook;
|
|
4871
4871
|
}
|
|
4872
4872
|
route(t, r) {
|
|
4873
4873
|
const s = t.replaceAll(/:([^\/]+)/g, "{$1}");
|
|
@@ -4911,8 +4911,8 @@ var G = /* @__PURE__ */ Object.freeze({
|
|
|
4911
4911
|
};
|
|
4912
4912
|
return Object.defineProperty(e, "getRoutingPath", { enumerable: !1 });
|
|
4913
4913
|
};
|
|
4914
|
-
|
|
4915
|
-
function
|
|
4914
|
+
hs(G);
|
|
4915
|
+
function ki(n, e) {
|
|
4916
4916
|
var t = {};
|
|
4917
4917
|
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && e.indexOf(r) < 0 && (t[r] = n[r]);
|
|
4918
4918
|
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -4920,7 +4920,7 @@ function bi(n, e) {
|
|
|
4920
4920
|
e.indexOf(r[s]) < 0 && Object.prototype.propertyIsEnumerable.call(n, r[s]) && (t[r[s]] = n[r[s]]);
|
|
4921
4921
|
return t;
|
|
4922
4922
|
}
|
|
4923
|
-
function
|
|
4923
|
+
function wi(n, e) {
|
|
4924
4924
|
var t;
|
|
4925
4925
|
return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
|
|
4926
4926
|
}
|
|
@@ -4931,24 +4931,24 @@ function vt(n, e) {
|
|
|
4931
4931
|
return s._def.openapi = this._def.openapi, s;
|
|
4932
4932
|
};
|
|
4933
4933
|
}
|
|
4934
|
-
function
|
|
4934
|
+
function xi(n) {
|
|
4935
4935
|
if (typeof n.ZodType.prototype.openapi < "u")
|
|
4936
4936
|
return;
|
|
4937
4937
|
n.ZodType.prototype.openapi = function(s, a) {
|
|
4938
4938
|
var i, o, d, u, l, p;
|
|
4939
|
-
const R = typeof s == "string" ? a : s, D = R ?? {}, { param:
|
|
4940
|
-
param: Object.assign(Object.assign({}, (p = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || p === void 0 ? void 0 : p.param),
|
|
4941
|
-
} : void 0), ee = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(
|
|
4942
|
-
if (
|
|
4939
|
+
const R = typeof s == "string" ? a : s, D = R ?? {}, { param: P } = D, j = ki(D, ["param"]), U = Object.assign(Object.assign({}, (i = this._def.openapi) === null || i === void 0 ? void 0 : i._internal), typeof s == "string" ? { refId: s } : void 0), H = Object.assign(Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o.metadata), j), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || P ? {
|
|
4940
|
+
param: Object.assign(Object.assign({}, (p = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || p === void 0 ? void 0 : p.param), P)
|
|
4941
|
+
} : void 0), ee = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(U).length > 0 ? { _internal: U } : void 0), Object.keys(H).length > 0 ? { metadata: H } : void 0) }));
|
|
4942
|
+
if (wi(this, "ZodObject")) {
|
|
4943
4943
|
const te = this.extend;
|
|
4944
4944
|
ee.extend = function(...Re) {
|
|
4945
|
-
var ae, ne, X, ge, ie,
|
|
4945
|
+
var ae, ne, X, ge, ie, Ve;
|
|
4946
4946
|
const qe = te.apply(this, Re);
|
|
4947
4947
|
return qe._def.openapi = {
|
|
4948
4948
|
_internal: {
|
|
4949
4949
|
extendedFrom: !((ne = (ae = this._def.openapi) === null || ae === void 0 ? void 0 : ae._internal) === null || ne === void 0) && ne.refId ? { refId: (ge = (X = this._def.openapi) === null || X === void 0 ? void 0 : X._internal) === null || ge === void 0 ? void 0 : ge.refId, schema: this } : (ie = this._def.openapi) === null || ie === void 0 ? void 0 : ie._internal.extendedFrom
|
|
4950
4950
|
},
|
|
4951
|
-
metadata: (
|
|
4951
|
+
metadata: (Ve = qe._def.openapi) === null || Ve === void 0 ? void 0 : Ve.metadata
|
|
4952
4952
|
}, qe;
|
|
4953
4953
|
};
|
|
4954
4954
|
}
|
|
@@ -5077,7 +5077,7 @@ const b = M.arrayToEnum([
|
|
|
5077
5077
|
"invalid_intersection_types",
|
|
5078
5078
|
"not_multiple_of",
|
|
5079
5079
|
"not_finite"
|
|
5080
|
-
]),
|
|
5080
|
+
]), Oi = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
5081
5081
|
class se extends Error {
|
|
5082
5082
|
constructor(e) {
|
|
5083
5083
|
super(), this.issues = [], this.addIssue = (r) => {
|
|
@@ -5195,13 +5195,13 @@ const ht = (n, e) => {
|
|
|
5195
5195
|
return { message: t };
|
|
5196
5196
|
};
|
|
5197
5197
|
let Fr = ht;
|
|
5198
|
-
function
|
|
5198
|
+
function Ti(n) {
|
|
5199
5199
|
Fr = n;
|
|
5200
5200
|
}
|
|
5201
|
-
function
|
|
5201
|
+
function Sn() {
|
|
5202
5202
|
return Fr;
|
|
5203
5203
|
}
|
|
5204
|
-
const
|
|
5204
|
+
const Zn = (n) => {
|
|
5205
5205
|
const { data: e, path: t, errorMaps: r, issueData: s } = n, a = [...t, ...s.path || []], i = {
|
|
5206
5206
|
...s,
|
|
5207
5207
|
path: a
|
|
@@ -5221,9 +5221,9 @@ const Sn = (n) => {
|
|
|
5221
5221
|
path: a,
|
|
5222
5222
|
message: o
|
|
5223
5223
|
};
|
|
5224
|
-
},
|
|
5224
|
+
}, ji = [];
|
|
5225
5225
|
function y(n, e) {
|
|
5226
|
-
const t =
|
|
5226
|
+
const t = Sn(), r = Zn({
|
|
5227
5227
|
issueData: e,
|
|
5228
5228
|
data: n.data,
|
|
5229
5229
|
path: n.path,
|
|
@@ -5251,7 +5251,7 @@ class Y {
|
|
|
5251
5251
|
const r = [];
|
|
5252
5252
|
for (const s of t) {
|
|
5253
5253
|
if (s.status === "aborted")
|
|
5254
|
-
return
|
|
5254
|
+
return E;
|
|
5255
5255
|
s.status === "dirty" && e.dirty(), r.push(s.value);
|
|
5256
5256
|
}
|
|
5257
5257
|
return { status: e.value, value: r };
|
|
@@ -5272,13 +5272,13 @@ class Y {
|
|
|
5272
5272
|
for (const s of t) {
|
|
5273
5273
|
const { key: a, value: i } = s;
|
|
5274
5274
|
if (a.status === "aborted" || i.status === "aborted")
|
|
5275
|
-
return
|
|
5275
|
+
return E;
|
|
5276
5276
|
a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value < "u" || s.alwaysSet) && (r[a.value] = i.value);
|
|
5277
5277
|
}
|
|
5278
5278
|
return { status: e.value, value: r };
|
|
5279
5279
|
}
|
|
5280
5280
|
}
|
|
5281
|
-
const
|
|
5281
|
+
const E = Object.freeze({
|
|
5282
5282
|
status: "aborted"
|
|
5283
5283
|
}), Cn = (n) => ({ status: "dirty", value: n }), Q = (n) => ({ status: "valid", value: n }), Xn = (n) => n.status === "aborted", er = (n) => n.status === "dirty", Ht = (n) => n.status === "valid", Ft = (n) => typeof Promise < "u" && n instanceof Promise;
|
|
5284
5284
|
function In(n, e, t, r) {
|
|
@@ -5317,7 +5317,7 @@ const mr = (n, e) => {
|
|
|
5317
5317
|
}
|
|
5318
5318
|
};
|
|
5319
5319
|
};
|
|
5320
|
-
function
|
|
5320
|
+
function Z(n) {
|
|
5321
5321
|
if (!n)
|
|
5322
5322
|
return {};
|
|
5323
5323
|
const { errorMap: e, invalid_type_error: t, required_error: r, description: s } = n;
|
|
@@ -5329,7 +5329,7 @@ function S(n) {
|
|
|
5329
5329
|
return a.code === "invalid_enum_value" ? { message: u ?? i.defaultError } : typeof i.data > "u" ? { message: (o = u ?? r) !== null && o !== void 0 ? o : i.defaultError } : a.code !== "invalid_type" ? { message: i.defaultError } : { message: (d = u ?? t) !== null && d !== void 0 ? d : i.defaultError };
|
|
5330
5330
|
}, description: s };
|
|
5331
5331
|
}
|
|
5332
|
-
class
|
|
5332
|
+
class N {
|
|
5333
5333
|
constructor(e) {
|
|
5334
5334
|
this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this);
|
|
5335
5335
|
}
|
|
@@ -5442,7 +5442,7 @@ class P {
|
|
|
5442
5442
|
return ye.create(this, this._def);
|
|
5443
5443
|
}
|
|
5444
5444
|
nullable() {
|
|
5445
|
-
return
|
|
5445
|
+
return Ue.create(this, this._def);
|
|
5446
5446
|
}
|
|
5447
5447
|
nullish() {
|
|
5448
5448
|
return this.nullable().optional();
|
|
@@ -5461,7 +5461,7 @@ class P {
|
|
|
5461
5461
|
}
|
|
5462
5462
|
transform(e) {
|
|
5463
5463
|
return new me({
|
|
5464
|
-
...
|
|
5464
|
+
...Z(this._def),
|
|
5465
5465
|
schema: this,
|
|
5466
5466
|
typeName: O.ZodEffects,
|
|
5467
5467
|
effect: { type: "transform", transform: e }
|
|
@@ -5470,7 +5470,7 @@ class P {
|
|
|
5470
5470
|
default(e) {
|
|
5471
5471
|
const t = typeof e == "function" ? e : () => e;
|
|
5472
5472
|
return new nn({
|
|
5473
|
-
...
|
|
5473
|
+
...Z(this._def),
|
|
5474
5474
|
innerType: this,
|
|
5475
5475
|
defaultValue: t,
|
|
5476
5476
|
typeName: O.ZodDefault
|
|
@@ -5480,13 +5480,13 @@ class P {
|
|
|
5480
5480
|
return new sr({
|
|
5481
5481
|
typeName: O.ZodBranded,
|
|
5482
5482
|
type: this,
|
|
5483
|
-
...
|
|
5483
|
+
...Z(this._def)
|
|
5484
5484
|
});
|
|
5485
5485
|
}
|
|
5486
5486
|
catch(e) {
|
|
5487
5487
|
const t = typeof e == "function" ? e : () => e;
|
|
5488
5488
|
return new rn({
|
|
5489
|
-
...
|
|
5489
|
+
...Z(this._def),
|
|
5490
5490
|
innerType: this,
|
|
5491
5491
|
catchValue: t,
|
|
5492
5492
|
typeName: O.ZodCatch
|
|
@@ -5512,14 +5512,14 @@ class P {
|
|
|
5512
5512
|
return this.safeParse(null).success;
|
|
5513
5513
|
}
|
|
5514
5514
|
}
|
|
5515
|
-
const
|
|
5515
|
+
const Ei = /^c[^\s-]{8,}$/i, Ri = /^[0-9a-z]+$/, Si = /^[0-9A-HJKMNP-TV-Z]{26}$/, Zi = /^[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, Ci = /^[a-z0-9_-]{21}$/i, Ii = /^[-+]?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)?)??$/, Ni = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Pi = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
5516
5516
|
let Wn;
|
|
5517
|
-
const
|
|
5517
|
+
const Ai = /^(?:(?: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])$/, $i = /^(([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})))$/, Mi = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Gr = "((\\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])))", Di = new RegExp(`^${Gr}$`);
|
|
5518
5518
|
function zr(n) {
|
|
5519
5519
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
5520
5520
|
return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
5521
5521
|
}
|
|
5522
|
-
function
|
|
5522
|
+
function Li(n) {
|
|
5523
5523
|
return new RegExp(`^${zr(n)}$`);
|
|
5524
5524
|
}
|
|
5525
5525
|
function Yr(n) {
|
|
@@ -5527,10 +5527,10 @@ function Yr(n) {
|
|
|
5527
5527
|
const t = [];
|
|
5528
5528
|
return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
5529
5529
|
}
|
|
5530
|
-
function
|
|
5531
|
-
return !!((e === "v4" || !e) &&
|
|
5530
|
+
function Ui(n, e) {
|
|
5531
|
+
return !!((e === "v4" || !e) && Ai.test(n) || (e === "v6" || !e) && $i.test(n));
|
|
5532
5532
|
}
|
|
5533
|
-
class le extends
|
|
5533
|
+
class le extends N {
|
|
5534
5534
|
_parse(e) {
|
|
5535
5535
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== b.string) {
|
|
5536
5536
|
const s = this._getOrReturnCtx(e);
|
|
@@ -5538,7 +5538,7 @@ class le extends P {
|
|
|
5538
5538
|
code: f.invalid_type,
|
|
5539
5539
|
expected: b.string,
|
|
5540
5540
|
received: s.parsedType
|
|
5541
|
-
}),
|
|
5541
|
+
}), E;
|
|
5542
5542
|
}
|
|
5543
5543
|
const t = new Y();
|
|
5544
5544
|
let r;
|
|
@@ -5579,7 +5579,7 @@ class le extends P {
|
|
|
5579
5579
|
message: s.message
|
|
5580
5580
|
}), t.dirty());
|
|
5581
5581
|
} else if (s.kind === "email")
|
|
5582
|
-
|
|
5582
|
+
Ni.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
5583
5583
|
validation: "email",
|
|
5584
5584
|
code: f.invalid_string,
|
|
5585
5585
|
message: s.message
|
|
@@ -5591,31 +5591,31 @@ class le extends P {
|
|
|
5591
5591
|
message: s.message
|
|
5592
5592
|
}), t.dirty());
|
|
5593
5593
|
else if (s.kind === "uuid")
|
|
5594
|
-
|
|
5594
|
+
Zi.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
5595
5595
|
validation: "uuid",
|
|
5596
5596
|
code: f.invalid_string,
|
|
5597
5597
|
message: s.message
|
|
5598
5598
|
}), t.dirty());
|
|
5599
5599
|
else if (s.kind === "nanoid")
|
|
5600
|
-
|
|
5600
|
+
Ci.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
5601
5601
|
validation: "nanoid",
|
|
5602
5602
|
code: f.invalid_string,
|
|
5603
5603
|
message: s.message
|
|
5604
5604
|
}), t.dirty());
|
|
5605
5605
|
else if (s.kind === "cuid")
|
|
5606
|
-
|
|
5606
|
+
Ei.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
5607
5607
|
validation: "cuid",
|
|
5608
5608
|
code: f.invalid_string,
|
|
5609
5609
|
message: s.message
|
|
5610
5610
|
}), t.dirty());
|
|
5611
5611
|
else if (s.kind === "cuid2")
|
|
5612
|
-
|
|
5612
|
+
Ri.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
5613
5613
|
validation: "cuid2",
|
|
5614
5614
|
code: f.invalid_string,
|
|
5615
5615
|
message: s.message
|
|
5616
5616
|
}), t.dirty());
|
|
5617
5617
|
else if (s.kind === "ulid")
|
|
5618
|
-
|
|
5618
|
+
Si.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
5619
5619
|
validation: "ulid",
|
|
5620
5620
|
code: f.invalid_string,
|
|
5621
5621
|
message: s.message
|
|
@@ -5650,23 +5650,23 @@ class le extends P {
|
|
|
5650
5650
|
code: f.invalid_string,
|
|
5651
5651
|
validation: "datetime",
|
|
5652
5652
|
message: s.message
|
|
5653
|
-
}), t.dirty()) : s.kind === "date" ?
|
|
5653
|
+
}), t.dirty()) : s.kind === "date" ? Di.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
5654
5654
|
code: f.invalid_string,
|
|
5655
5655
|
validation: "date",
|
|
5656
5656
|
message: s.message
|
|
5657
|
-
}), t.dirty()) : s.kind === "time" ?
|
|
5657
|
+
}), t.dirty()) : s.kind === "time" ? Li(s).test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
5658
5658
|
code: f.invalid_string,
|
|
5659
5659
|
validation: "time",
|
|
5660
5660
|
message: s.message
|
|
5661
|
-
}), t.dirty()) : s.kind === "duration" ?
|
|
5661
|
+
}), t.dirty()) : s.kind === "duration" ? Ii.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
5662
5662
|
validation: "duration",
|
|
5663
5663
|
code: f.invalid_string,
|
|
5664
5664
|
message: s.message
|
|
5665
|
-
}), t.dirty()) : s.kind === "ip" ?
|
|
5665
|
+
}), t.dirty()) : s.kind === "ip" ? Ui(e.data, s.version) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
5666
5666
|
validation: "ip",
|
|
5667
5667
|
code: f.invalid_string,
|
|
5668
5668
|
message: s.message
|
|
5669
|
-
}), t.dirty()) : s.kind === "base64" ?
|
|
5669
|
+
}), t.dirty()) : s.kind === "base64" ? Mi.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
5670
5670
|
validation: "base64",
|
|
5671
5671
|
code: f.invalid_string,
|
|
5672
5672
|
message: s.message
|
|
@@ -5885,14 +5885,14 @@ le.create = (n) => {
|
|
|
5885
5885
|
checks: [],
|
|
5886
5886
|
typeName: O.ZodString,
|
|
5887
5887
|
coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
|
|
5888
|
-
...
|
|
5888
|
+
...Z(n)
|
|
5889
5889
|
});
|
|
5890
5890
|
};
|
|
5891
5891
|
function Vi(n, e) {
|
|
5892
5892
|
const t = (n.toString().split(".")[1] || "").length, r = (e.toString().split(".")[1] || "").length, s = t > r ? t : r, a = parseInt(n.toFixed(s).replace(".", "")), i = parseInt(e.toFixed(s).replace(".", ""));
|
|
5893
5893
|
return a % i / Math.pow(10, s);
|
|
5894
5894
|
}
|
|
5895
|
-
class Me extends
|
|
5895
|
+
class Me extends N {
|
|
5896
5896
|
constructor() {
|
|
5897
5897
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
5898
5898
|
}
|
|
@@ -5903,7 +5903,7 @@ class Me extends P {
|
|
|
5903
5903
|
code: f.invalid_type,
|
|
5904
5904
|
expected: b.number,
|
|
5905
5905
|
received: s.parsedType
|
|
5906
|
-
}),
|
|
5906
|
+
}), E;
|
|
5907
5907
|
}
|
|
5908
5908
|
let t;
|
|
5909
5909
|
const r = new Y();
|
|
@@ -6062,9 +6062,9 @@ Me.create = (n) => new Me({
|
|
|
6062
6062
|
checks: [],
|
|
6063
6063
|
typeName: O.ZodNumber,
|
|
6064
6064
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
6065
|
-
...
|
|
6065
|
+
...Z(n)
|
|
6066
6066
|
});
|
|
6067
|
-
class De extends
|
|
6067
|
+
class De extends N {
|
|
6068
6068
|
constructor() {
|
|
6069
6069
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
6070
6070
|
}
|
|
@@ -6075,7 +6075,7 @@ class De extends P {
|
|
|
6075
6075
|
code: f.invalid_type,
|
|
6076
6076
|
expected: b.bigint,
|
|
6077
6077
|
received: s.parsedType
|
|
6078
|
-
}),
|
|
6078
|
+
}), E;
|
|
6079
6079
|
}
|
|
6080
6080
|
let t;
|
|
6081
6081
|
const r = new Y();
|
|
@@ -6189,10 +6189,10 @@ De.create = (n) => {
|
|
|
6189
6189
|
checks: [],
|
|
6190
6190
|
typeName: O.ZodBigInt,
|
|
6191
6191
|
coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
|
|
6192
|
-
...
|
|
6192
|
+
...Z(n)
|
|
6193
6193
|
});
|
|
6194
6194
|
};
|
|
6195
|
-
class Kt extends
|
|
6195
|
+
class Kt extends N {
|
|
6196
6196
|
_parse(e) {
|
|
6197
6197
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== b.boolean) {
|
|
6198
6198
|
const t = this._getOrReturnCtx(e);
|
|
@@ -6200,7 +6200,7 @@ class Kt extends P {
|
|
|
6200
6200
|
code: f.invalid_type,
|
|
6201
6201
|
expected: b.boolean,
|
|
6202
6202
|
received: t.parsedType
|
|
6203
|
-
}),
|
|
6203
|
+
}), E;
|
|
6204
6204
|
}
|
|
6205
6205
|
return Q(e.data);
|
|
6206
6206
|
}
|
|
@@ -6208,9 +6208,9 @@ class Kt extends P {
|
|
|
6208
6208
|
Kt.create = (n) => new Kt({
|
|
6209
6209
|
typeName: O.ZodBoolean,
|
|
6210
6210
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
6211
|
-
...
|
|
6211
|
+
...Z(n)
|
|
6212
6212
|
});
|
|
6213
|
-
class Ye extends
|
|
6213
|
+
class Ye extends N {
|
|
6214
6214
|
_parse(e) {
|
|
6215
6215
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== b.date) {
|
|
6216
6216
|
const s = this._getOrReturnCtx(e);
|
|
@@ -6218,13 +6218,13 @@ class Ye extends P {
|
|
|
6218
6218
|
code: f.invalid_type,
|
|
6219
6219
|
expected: b.date,
|
|
6220
6220
|
received: s.parsedType
|
|
6221
|
-
}),
|
|
6221
|
+
}), E;
|
|
6222
6222
|
}
|
|
6223
6223
|
if (isNaN(e.data.getTime())) {
|
|
6224
6224
|
const s = this._getOrReturnCtx(e);
|
|
6225
6225
|
return y(s, {
|
|
6226
6226
|
code: f.invalid_date
|
|
6227
|
-
}),
|
|
6227
|
+
}), E;
|
|
6228
6228
|
}
|
|
6229
6229
|
const t = new Y();
|
|
6230
6230
|
let r;
|
|
@@ -6286,9 +6286,9 @@ Ye.create = (n) => new Ye({
|
|
|
6286
6286
|
checks: [],
|
|
6287
6287
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
6288
6288
|
typeName: O.ZodDate,
|
|
6289
|
-
...
|
|
6289
|
+
...Z(n)
|
|
6290
6290
|
});
|
|
6291
|
-
class
|
|
6291
|
+
class Nn extends N {
|
|
6292
6292
|
_parse(e) {
|
|
6293
6293
|
if (this._getType(e) !== b.symbol) {
|
|
6294
6294
|
const t = this._getOrReturnCtx(e);
|
|
@@ -6296,16 +6296,16 @@ class Pn extends P {
|
|
|
6296
6296
|
code: f.invalid_type,
|
|
6297
6297
|
expected: b.symbol,
|
|
6298
6298
|
received: t.parsedType
|
|
6299
|
-
}),
|
|
6299
|
+
}), E;
|
|
6300
6300
|
}
|
|
6301
6301
|
return Q(e.data);
|
|
6302
6302
|
}
|
|
6303
6303
|
}
|
|
6304
|
-
|
|
6304
|
+
Nn.create = (n) => new Nn({
|
|
6305
6305
|
typeName: O.ZodSymbol,
|
|
6306
|
-
...
|
|
6306
|
+
...Z(n)
|
|
6307
6307
|
});
|
|
6308
|
-
class Gt extends
|
|
6308
|
+
class Gt extends N {
|
|
6309
6309
|
_parse(e) {
|
|
6310
6310
|
if (this._getType(e) !== b.undefined) {
|
|
6311
6311
|
const t = this._getOrReturnCtx(e);
|
|
@@ -6313,16 +6313,16 @@ class Gt extends P {
|
|
|
6313
6313
|
code: f.invalid_type,
|
|
6314
6314
|
expected: b.undefined,
|
|
6315
6315
|
received: t.parsedType
|
|
6316
|
-
}),
|
|
6316
|
+
}), E;
|
|
6317
6317
|
}
|
|
6318
6318
|
return Q(e.data);
|
|
6319
6319
|
}
|
|
6320
6320
|
}
|
|
6321
6321
|
Gt.create = (n) => new Gt({
|
|
6322
6322
|
typeName: O.ZodUndefined,
|
|
6323
|
-
...
|
|
6323
|
+
...Z(n)
|
|
6324
6324
|
});
|
|
6325
|
-
class zt extends
|
|
6325
|
+
class zt extends N {
|
|
6326
6326
|
_parse(e) {
|
|
6327
6327
|
if (this._getType(e) !== b.null) {
|
|
6328
6328
|
const t = this._getOrReturnCtx(e);
|
|
@@ -6330,16 +6330,16 @@ class zt extends P {
|
|
|
6330
6330
|
code: f.invalid_type,
|
|
6331
6331
|
expected: b.null,
|
|
6332
6332
|
received: t.parsedType
|
|
6333
|
-
}),
|
|
6333
|
+
}), E;
|
|
6334
6334
|
}
|
|
6335
6335
|
return Q(e.data);
|
|
6336
6336
|
}
|
|
6337
6337
|
}
|
|
6338
6338
|
zt.create = (n) => new zt({
|
|
6339
6339
|
typeName: O.ZodNull,
|
|
6340
|
-
...
|
|
6340
|
+
...Z(n)
|
|
6341
6341
|
});
|
|
6342
|
-
class ft extends
|
|
6342
|
+
class ft extends N {
|
|
6343
6343
|
constructor() {
|
|
6344
6344
|
super(...arguments), this._any = !0;
|
|
6345
6345
|
}
|
|
@@ -6349,9 +6349,9 @@ class ft extends P {
|
|
|
6349
6349
|
}
|
|
6350
6350
|
ft.create = (n) => new ft({
|
|
6351
6351
|
typeName: O.ZodAny,
|
|
6352
|
-
...
|
|
6352
|
+
...Z(n)
|
|
6353
6353
|
});
|
|
6354
|
-
class Ke extends
|
|
6354
|
+
class Ke extends N {
|
|
6355
6355
|
constructor() {
|
|
6356
6356
|
super(...arguments), this._unknown = !0;
|
|
6357
6357
|
}
|
|
@@ -6361,23 +6361,23 @@ class Ke extends P {
|
|
|
6361
6361
|
}
|
|
6362
6362
|
Ke.create = (n) => new Ke({
|
|
6363
6363
|
typeName: O.ZodUnknown,
|
|
6364
|
-
...
|
|
6364
|
+
...Z(n)
|
|
6365
6365
|
});
|
|
6366
|
-
class
|
|
6366
|
+
class Ee extends N {
|
|
6367
6367
|
_parse(e) {
|
|
6368
6368
|
const t = this._getOrReturnCtx(e);
|
|
6369
6369
|
return y(t, {
|
|
6370
6370
|
code: f.invalid_type,
|
|
6371
6371
|
expected: b.never,
|
|
6372
6372
|
received: t.parsedType
|
|
6373
|
-
}),
|
|
6373
|
+
}), E;
|
|
6374
6374
|
}
|
|
6375
6375
|
}
|
|
6376
|
-
|
|
6376
|
+
Ee.create = (n) => new Ee({
|
|
6377
6377
|
typeName: O.ZodNever,
|
|
6378
|
-
...
|
|
6378
|
+
...Z(n)
|
|
6379
6379
|
});
|
|
6380
|
-
class
|
|
6380
|
+
class Pn extends N {
|
|
6381
6381
|
_parse(e) {
|
|
6382
6382
|
if (this._getType(e) !== b.undefined) {
|
|
6383
6383
|
const t = this._getOrReturnCtx(e);
|
|
@@ -6385,16 +6385,16 @@ class Nn extends P {
|
|
|
6385
6385
|
code: f.invalid_type,
|
|
6386
6386
|
expected: b.void,
|
|
6387
6387
|
received: t.parsedType
|
|
6388
|
-
}),
|
|
6388
|
+
}), E;
|
|
6389
6389
|
}
|
|
6390
6390
|
return Q(e.data);
|
|
6391
6391
|
}
|
|
6392
6392
|
}
|
|
6393
|
-
|
|
6393
|
+
Pn.create = (n) => new Pn({
|
|
6394
6394
|
typeName: O.ZodVoid,
|
|
6395
|
-
...
|
|
6395
|
+
...Z(n)
|
|
6396
6396
|
});
|
|
6397
|
-
class he extends
|
|
6397
|
+
class he extends N {
|
|
6398
6398
|
_parse(e) {
|
|
6399
6399
|
const { ctx: t, status: r } = this._processInputParams(e), s = this._def;
|
|
6400
6400
|
if (t.parsedType !== b.array)
|
|
@@ -6402,7 +6402,7 @@ class he extends P {
|
|
|
6402
6402
|
code: f.invalid_type,
|
|
6403
6403
|
expected: b.array,
|
|
6404
6404
|
received: t.parsedType
|
|
6405
|
-
}),
|
|
6405
|
+
}), E;
|
|
6406
6406
|
if (s.exactLength !== null) {
|
|
6407
6407
|
const i = t.data.length > s.exactLength.value, o = t.data.length < s.exactLength.value;
|
|
6408
6408
|
(i || o) && (y(t, {
|
|
@@ -6465,7 +6465,7 @@ he.create = (n, e) => new he({
|
|
|
6465
6465
|
maxLength: null,
|
|
6466
6466
|
exactLength: null,
|
|
6467
6467
|
typeName: O.ZodArray,
|
|
6468
|
-
...
|
|
6468
|
+
...Z(e)
|
|
6469
6469
|
});
|
|
6470
6470
|
function nt(n) {
|
|
6471
6471
|
if (n instanceof B) {
|
|
@@ -6481,9 +6481,9 @@ function nt(n) {
|
|
|
6481
6481
|
} else return n instanceof he ? new he({
|
|
6482
6482
|
...n._def,
|
|
6483
6483
|
type: nt(n.element)
|
|
6484
|
-
}) : n instanceof ye ? ye.create(nt(n.unwrap())) : n instanceof
|
|
6484
|
+
}) : n instanceof ye ? ye.create(nt(n.unwrap())) : n instanceof Ue ? Ue.create(nt(n.unwrap())) : n instanceof we ? we.create(n.items.map((e) => nt(e))) : n;
|
|
6485
6485
|
}
|
|
6486
|
-
class B extends
|
|
6486
|
+
class B extends N {
|
|
6487
6487
|
constructor() {
|
|
6488
6488
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
6489
6489
|
}
|
|
@@ -6500,10 +6500,10 @@ class B extends P {
|
|
|
6500
6500
|
code: f.invalid_type,
|
|
6501
6501
|
expected: b.object,
|
|
6502
6502
|
received: d.parsedType
|
|
6503
|
-
}),
|
|
6503
|
+
}), E;
|
|
6504
6504
|
}
|
|
6505
6505
|
const { status: t, ctx: r } = this._processInputParams(e), { shape: s, keys: a } = this._getCached(), i = [];
|
|
6506
|
-
if (!(this._def.catchall instanceof
|
|
6506
|
+
if (!(this._def.catchall instanceof Ee && this._def.unknownKeys === "strip"))
|
|
6507
6507
|
for (const d in r.data)
|
|
6508
6508
|
a.includes(d) || i.push(d);
|
|
6509
6509
|
const o = [];
|
|
@@ -6515,7 +6515,7 @@ class B extends P {
|
|
|
6515
6515
|
alwaysSet: d in r.data
|
|
6516
6516
|
});
|
|
6517
6517
|
}
|
|
6518
|
-
if (this._def.catchall instanceof
|
|
6518
|
+
if (this._def.catchall instanceof Ee) {
|
|
6519
6519
|
const d = this._def.unknownKeys;
|
|
6520
6520
|
if (d === "passthrough")
|
|
6521
6521
|
for (const u of i)
|
|
@@ -6752,25 +6752,25 @@ class B extends P {
|
|
|
6752
6752
|
B.create = (n, e) => new B({
|
|
6753
6753
|
shape: () => n,
|
|
6754
6754
|
unknownKeys: "strip",
|
|
6755
|
-
catchall:
|
|
6755
|
+
catchall: Ee.create(),
|
|
6756
6756
|
typeName: O.ZodObject,
|
|
6757
|
-
...
|
|
6757
|
+
...Z(e)
|
|
6758
6758
|
});
|
|
6759
6759
|
B.strictCreate = (n, e) => new B({
|
|
6760
6760
|
shape: () => n,
|
|
6761
6761
|
unknownKeys: "strict",
|
|
6762
|
-
catchall:
|
|
6762
|
+
catchall: Ee.create(),
|
|
6763
6763
|
typeName: O.ZodObject,
|
|
6764
|
-
...
|
|
6764
|
+
...Z(e)
|
|
6765
6765
|
});
|
|
6766
6766
|
B.lazycreate = (n, e) => new B({
|
|
6767
6767
|
shape: n,
|
|
6768
6768
|
unknownKeys: "strip",
|
|
6769
|
-
catchall:
|
|
6769
|
+
catchall: Ee.create(),
|
|
6770
6770
|
typeName: O.ZodObject,
|
|
6771
|
-
...
|
|
6771
|
+
...Z(e)
|
|
6772
6772
|
});
|
|
6773
|
-
class Yt extends
|
|
6773
|
+
class Yt extends N {
|
|
6774
6774
|
_parse(e) {
|
|
6775
6775
|
const { ctx: t } = this._processInputParams(e), r = this._def.options;
|
|
6776
6776
|
function s(a) {
|
|
@@ -6784,7 +6784,7 @@ class Yt extends P {
|
|
|
6784
6784
|
return y(t, {
|
|
6785
6785
|
code: f.invalid_union,
|
|
6786
6786
|
unionErrors: i
|
|
6787
|
-
}),
|
|
6787
|
+
}), E;
|
|
6788
6788
|
}
|
|
6789
6789
|
if (t.common.async)
|
|
6790
6790
|
return Promise.all(r.map(async (a) => {
|
|
@@ -6831,7 +6831,7 @@ class Yt extends P {
|
|
|
6831
6831
|
return y(t, {
|
|
6832
6832
|
code: f.invalid_union,
|
|
6833
6833
|
unionErrors: o
|
|
6834
|
-
}),
|
|
6834
|
+
}), E;
|
|
6835
6835
|
}
|
|
6836
6836
|
}
|
|
6837
6837
|
get options() {
|
|
@@ -6841,10 +6841,10 @@ class Yt extends P {
|
|
|
6841
6841
|
Yt.create = (n, e) => new Yt({
|
|
6842
6842
|
options: n,
|
|
6843
6843
|
typeName: O.ZodUnion,
|
|
6844
|
-
...
|
|
6844
|
+
...Z(e)
|
|
6845
6845
|
});
|
|
6846
|
-
const
|
|
6847
|
-
class Ln extends
|
|
6846
|
+
const Se = (n) => n instanceof Xt ? Se(n.schema) : n instanceof me ? Se(n.innerType()) : n instanceof en ? [n.value] : n instanceof Le ? n.options : n instanceof tn ? M.objectValues(n.enum) : n instanceof nn ? Se(n._def.innerType) : n instanceof Gt ? [void 0] : n instanceof zt ? [null] : n instanceof ye ? [void 0, ...Se(n.unwrap())] : n instanceof Ue ? [null, ...Se(n.unwrap())] : n instanceof sr || n instanceof sn ? Se(n.unwrap()) : n instanceof rn ? Se(n._def.innerType) : [];
|
|
6847
|
+
class Ln extends N {
|
|
6848
6848
|
_parse(e) {
|
|
6849
6849
|
const { ctx: t } = this._processInputParams(e);
|
|
6850
6850
|
if (t.parsedType !== b.object)
|
|
@@ -6852,7 +6852,7 @@ class Ln extends P {
|
|
|
6852
6852
|
code: f.invalid_type,
|
|
6853
6853
|
expected: b.object,
|
|
6854
6854
|
received: t.parsedType
|
|
6855
|
-
}),
|
|
6855
|
+
}), E;
|
|
6856
6856
|
const r = this.discriminator, s = t.data[r], a = this.optionsMap.get(s);
|
|
6857
6857
|
return a ? t.common.async ? a._parseAsync({
|
|
6858
6858
|
data: t.data,
|
|
@@ -6866,7 +6866,7 @@ class Ln extends P {
|
|
|
6866
6866
|
code: f.invalid_union_discriminator,
|
|
6867
6867
|
options: Array.from(this.optionsMap.keys()),
|
|
6868
6868
|
path: [r]
|
|
6869
|
-
}),
|
|
6869
|
+
}), E);
|
|
6870
6870
|
}
|
|
6871
6871
|
get discriminator() {
|
|
6872
6872
|
return this._def.discriminator;
|
|
@@ -6888,7 +6888,7 @@ class Ln extends P {
|
|
|
6888
6888
|
static create(e, t, r) {
|
|
6889
6889
|
const s = /* @__PURE__ */ new Map();
|
|
6890
6890
|
for (const a of t) {
|
|
6891
|
-
const i =
|
|
6891
|
+
const i = Se(a.shape[e]);
|
|
6892
6892
|
if (!i.length)
|
|
6893
6893
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
6894
6894
|
for (const o of i) {
|
|
@@ -6902,7 +6902,7 @@ class Ln extends P {
|
|
|
6902
6902
|
discriminator: e,
|
|
6903
6903
|
options: t,
|
|
6904
6904
|
optionsMap: s,
|
|
6905
|
-
...
|
|
6905
|
+
...Z(r)
|
|
6906
6906
|
});
|
|
6907
6907
|
}
|
|
6908
6908
|
}
|
|
@@ -6932,15 +6932,15 @@ function tr(n, e) {
|
|
|
6932
6932
|
return { valid: !0, data: s };
|
|
6933
6933
|
} else return t === b.date && r === b.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
|
|
6934
6934
|
}
|
|
6935
|
-
class Jt extends
|
|
6935
|
+
class Jt extends N {
|
|
6936
6936
|
_parse(e) {
|
|
6937
6937
|
const { status: t, ctx: r } = this._processInputParams(e), s = (a, i) => {
|
|
6938
6938
|
if (Xn(a) || Xn(i))
|
|
6939
|
-
return
|
|
6939
|
+
return E;
|
|
6940
6940
|
const o = tr(a.value, i.value);
|
|
6941
6941
|
return o.valid ? ((er(a) || er(i)) && t.dirty(), { status: t.value, value: o.data }) : (y(r, {
|
|
6942
6942
|
code: f.invalid_intersection_types
|
|
6943
|
-
}),
|
|
6943
|
+
}), E);
|
|
6944
6944
|
};
|
|
6945
6945
|
return r.common.async ? Promise.all([
|
|
6946
6946
|
this._def.left._parseAsync({
|
|
@@ -6968,9 +6968,9 @@ Jt.create = (n, e, t) => new Jt({
|
|
|
6968
6968
|
left: n,
|
|
6969
6969
|
right: e,
|
|
6970
6970
|
typeName: O.ZodIntersection,
|
|
6971
|
-
...
|
|
6971
|
+
...Z(t)
|
|
6972
6972
|
});
|
|
6973
|
-
class we extends
|
|
6973
|
+
class we extends N {
|
|
6974
6974
|
_parse(e) {
|
|
6975
6975
|
const { status: t, ctx: r } = this._processInputParams(e);
|
|
6976
6976
|
if (r.parsedType !== b.array)
|
|
@@ -6978,7 +6978,7 @@ class we extends P {
|
|
|
6978
6978
|
code: f.invalid_type,
|
|
6979
6979
|
expected: b.array,
|
|
6980
6980
|
received: r.parsedType
|
|
6981
|
-
}),
|
|
6981
|
+
}), E;
|
|
6982
6982
|
if (r.data.length < this._def.items.length)
|
|
6983
6983
|
return y(r, {
|
|
6984
6984
|
code: f.too_small,
|
|
@@ -6986,7 +6986,7 @@ class we extends P {
|
|
|
6986
6986
|
inclusive: !0,
|
|
6987
6987
|
exact: !1,
|
|
6988
6988
|
type: "array"
|
|
6989
|
-
}),
|
|
6989
|
+
}), E;
|
|
6990
6990
|
!this._def.rest && r.data.length > this._def.items.length && (y(r, {
|
|
6991
6991
|
code: f.too_big,
|
|
6992
6992
|
maximum: this._def.items.length,
|
|
@@ -7017,10 +7017,10 @@ we.create = (n, e) => {
|
|
|
7017
7017
|
items: n,
|
|
7018
7018
|
typeName: O.ZodTuple,
|
|
7019
7019
|
rest: null,
|
|
7020
|
-
...
|
|
7020
|
+
...Z(e)
|
|
7021
7021
|
});
|
|
7022
7022
|
};
|
|
7023
|
-
class Qt extends
|
|
7023
|
+
class Qt extends N {
|
|
7024
7024
|
get keySchema() {
|
|
7025
7025
|
return this._def.keyType;
|
|
7026
7026
|
}
|
|
@@ -7034,7 +7034,7 @@ class Qt extends P {
|
|
|
7034
7034
|
code: f.invalid_type,
|
|
7035
7035
|
expected: b.object,
|
|
7036
7036
|
received: r.parsedType
|
|
7037
|
-
}),
|
|
7037
|
+
}), E;
|
|
7038
7038
|
const s = [], a = this._def.keyType, i = this._def.valueType;
|
|
7039
7039
|
for (const o in r.data)
|
|
7040
7040
|
s.push({
|
|
@@ -7048,20 +7048,20 @@ class Qt extends P {
|
|
|
7048
7048
|
return this._def.valueType;
|
|
7049
7049
|
}
|
|
7050
7050
|
static create(e, t, r) {
|
|
7051
|
-
return t instanceof
|
|
7051
|
+
return t instanceof N ? new Qt({
|
|
7052
7052
|
keyType: e,
|
|
7053
7053
|
valueType: t,
|
|
7054
7054
|
typeName: O.ZodRecord,
|
|
7055
|
-
...
|
|
7055
|
+
...Z(r)
|
|
7056
7056
|
}) : new Qt({
|
|
7057
7057
|
keyType: le.create(),
|
|
7058
7058
|
valueType: e,
|
|
7059
7059
|
typeName: O.ZodRecord,
|
|
7060
|
-
...
|
|
7060
|
+
...Z(t)
|
|
7061
7061
|
});
|
|
7062
7062
|
}
|
|
7063
7063
|
}
|
|
7064
|
-
class An extends
|
|
7064
|
+
class An extends N {
|
|
7065
7065
|
get keySchema() {
|
|
7066
7066
|
return this._def.keyType;
|
|
7067
7067
|
}
|
|
@@ -7075,7 +7075,7 @@ class An extends P {
|
|
|
7075
7075
|
code: f.invalid_type,
|
|
7076
7076
|
expected: b.map,
|
|
7077
7077
|
received: r.parsedType
|
|
7078
|
-
}),
|
|
7078
|
+
}), E;
|
|
7079
7079
|
const s = this._def.keyType, a = this._def.valueType, i = [...r.data.entries()].map(([o, d], u) => ({
|
|
7080
7080
|
key: s._parse(new ke(r, o, r.path, [u, "key"])),
|
|
7081
7081
|
value: a._parse(new ke(r, d, r.path, [u, "value"]))
|
|
@@ -7086,7 +7086,7 @@ class An extends P {
|
|
|
7086
7086
|
for (const d of i) {
|
|
7087
7087
|
const u = await d.key, l = await d.value;
|
|
7088
7088
|
if (u.status === "aborted" || l.status === "aborted")
|
|
7089
|
-
return
|
|
7089
|
+
return E;
|
|
7090
7090
|
(u.status === "dirty" || l.status === "dirty") && t.dirty(), o.set(u.value, l.value);
|
|
7091
7091
|
}
|
|
7092
7092
|
return { status: t.value, value: o };
|
|
@@ -7096,7 +7096,7 @@ class An extends P {
|
|
|
7096
7096
|
for (const d of i) {
|
|
7097
7097
|
const u = d.key, l = d.value;
|
|
7098
7098
|
if (u.status === "aborted" || l.status === "aborted")
|
|
7099
|
-
return
|
|
7099
|
+
return E;
|
|
7100
7100
|
(u.status === "dirty" || l.status === "dirty") && t.dirty(), o.set(u.value, l.value);
|
|
7101
7101
|
}
|
|
7102
7102
|
return { status: t.value, value: o };
|
|
@@ -7107,9 +7107,9 @@ An.create = (n, e, t) => new An({
|
|
|
7107
7107
|
valueType: e,
|
|
7108
7108
|
keyType: n,
|
|
7109
7109
|
typeName: O.ZodMap,
|
|
7110
|
-
...
|
|
7110
|
+
...Z(t)
|
|
7111
7111
|
});
|
|
7112
|
-
class Je extends
|
|
7112
|
+
class Je extends N {
|
|
7113
7113
|
_parse(e) {
|
|
7114
7114
|
const { status: t, ctx: r } = this._processInputParams(e);
|
|
7115
7115
|
if (r.parsedType !== b.set)
|
|
@@ -7117,7 +7117,7 @@ class Je extends P {
|
|
|
7117
7117
|
code: f.invalid_type,
|
|
7118
7118
|
expected: b.set,
|
|
7119
7119
|
received: r.parsedType
|
|
7120
|
-
}),
|
|
7120
|
+
}), E;
|
|
7121
7121
|
const s = this._def;
|
|
7122
7122
|
s.minSize !== null && r.data.size < s.minSize.value && (y(r, {
|
|
7123
7123
|
code: f.too_small,
|
|
@@ -7139,7 +7139,7 @@ class Je extends P {
|
|
|
7139
7139
|
const u = /* @__PURE__ */ new Set();
|
|
7140
7140
|
for (const l of d) {
|
|
7141
7141
|
if (l.status === "aborted")
|
|
7142
|
-
return
|
|
7142
|
+
return E;
|
|
7143
7143
|
l.status === "dirty" && t.dirty(), u.add(l.value);
|
|
7144
7144
|
}
|
|
7145
7145
|
return { status: t.value, value: u };
|
|
@@ -7171,9 +7171,9 @@ Je.create = (n, e) => new Je({
|
|
|
7171
7171
|
minSize: null,
|
|
7172
7172
|
maxSize: null,
|
|
7173
7173
|
typeName: O.ZodSet,
|
|
7174
|
-
...
|
|
7174
|
+
...Z(e)
|
|
7175
7175
|
});
|
|
7176
|
-
class it extends
|
|
7176
|
+
class it extends N {
|
|
7177
7177
|
constructor() {
|
|
7178
7178
|
super(...arguments), this.validate = this.implement;
|
|
7179
7179
|
}
|
|
@@ -7184,15 +7184,15 @@ class it extends P {
|
|
|
7184
7184
|
code: f.invalid_type,
|
|
7185
7185
|
expected: b.function,
|
|
7186
7186
|
received: t.parsedType
|
|
7187
|
-
}),
|
|
7187
|
+
}), E;
|
|
7188
7188
|
function r(o, d) {
|
|
7189
|
-
return
|
|
7189
|
+
return Zn({
|
|
7190
7190
|
data: o,
|
|
7191
7191
|
path: t.path,
|
|
7192
7192
|
errorMaps: [
|
|
7193
7193
|
t.common.contextualErrorMap,
|
|
7194
7194
|
t.schemaErrorMap,
|
|
7195
|
-
|
|
7195
|
+
Sn(),
|
|
7196
7196
|
ht
|
|
7197
7197
|
].filter((u) => !!u),
|
|
7198
7198
|
issueData: {
|
|
@@ -7202,13 +7202,13 @@ class it extends P {
|
|
|
7202
7202
|
});
|
|
7203
7203
|
}
|
|
7204
7204
|
function s(o, d) {
|
|
7205
|
-
return
|
|
7205
|
+
return Zn({
|
|
7206
7206
|
data: o,
|
|
7207
7207
|
path: t.path,
|
|
7208
7208
|
errorMaps: [
|
|
7209
7209
|
t.common.contextualErrorMap,
|
|
7210
7210
|
t.schemaErrorMap,
|
|
7211
|
-
|
|
7211
|
+
Sn(),
|
|
7212
7212
|
ht
|
|
7213
7213
|
].filter((u) => !!u),
|
|
7214
7214
|
issueData: {
|
|
@@ -7270,11 +7270,11 @@ class it extends P {
|
|
|
7270
7270
|
args: e || we.create([]).rest(Ke.create()),
|
|
7271
7271
|
returns: t || Ke.create(),
|
|
7272
7272
|
typeName: O.ZodFunction,
|
|
7273
|
-
...
|
|
7273
|
+
...Z(r)
|
|
7274
7274
|
});
|
|
7275
7275
|
}
|
|
7276
7276
|
}
|
|
7277
|
-
class Xt extends
|
|
7277
|
+
class Xt extends N {
|
|
7278
7278
|
get schema() {
|
|
7279
7279
|
return this._def.getter();
|
|
7280
7280
|
}
|
|
@@ -7286,9 +7286,9 @@ class Xt extends P {
|
|
|
7286
7286
|
Xt.create = (n, e) => new Xt({
|
|
7287
7287
|
getter: n,
|
|
7288
7288
|
typeName: O.ZodLazy,
|
|
7289
|
-
...
|
|
7289
|
+
...Z(e)
|
|
7290
7290
|
});
|
|
7291
|
-
class en extends
|
|
7291
|
+
class en extends N {
|
|
7292
7292
|
_parse(e) {
|
|
7293
7293
|
if (e.data !== this._def.value) {
|
|
7294
7294
|
const t = this._getOrReturnCtx(e);
|
|
@@ -7296,7 +7296,7 @@ class en extends P {
|
|
|
7296
7296
|
received: t.data,
|
|
7297
7297
|
code: f.invalid_literal,
|
|
7298
7298
|
expected: this._def.value
|
|
7299
|
-
}),
|
|
7299
|
+
}), E;
|
|
7300
7300
|
}
|
|
7301
7301
|
return { status: "valid", value: e.data };
|
|
7302
7302
|
}
|
|
@@ -7307,16 +7307,16 @@ class en extends P {
|
|
|
7307
7307
|
en.create = (n, e) => new en({
|
|
7308
7308
|
value: n,
|
|
7309
7309
|
typeName: O.ZodLiteral,
|
|
7310
|
-
...
|
|
7310
|
+
...Z(e)
|
|
7311
7311
|
});
|
|
7312
7312
|
function Jr(n, e) {
|
|
7313
7313
|
return new Le({
|
|
7314
7314
|
values: n,
|
|
7315
7315
|
typeName: O.ZodEnum,
|
|
7316
|
-
...
|
|
7316
|
+
...Z(e)
|
|
7317
7317
|
});
|
|
7318
7318
|
}
|
|
7319
|
-
class Le extends
|
|
7319
|
+
class Le extends N {
|
|
7320
7320
|
constructor() {
|
|
7321
7321
|
super(...arguments), Ot.set(this, void 0);
|
|
7322
7322
|
}
|
|
@@ -7327,7 +7327,7 @@ class Le extends P {
|
|
|
7327
7327
|
expected: M.joinValues(r),
|
|
7328
7328
|
received: t.parsedType,
|
|
7329
7329
|
code: f.invalid_type
|
|
7330
|
-
}),
|
|
7330
|
+
}), E;
|
|
7331
7331
|
}
|
|
7332
7332
|
if (In(this, Ot) || Kr(this, Ot, new Set(this._def.values)), !In(this, Ot).has(e.data)) {
|
|
7333
7333
|
const t = this._getOrReturnCtx(e), r = this._def.values;
|
|
@@ -7335,7 +7335,7 @@ class Le extends P {
|
|
|
7335
7335
|
received: t.data,
|
|
7336
7336
|
code: f.invalid_enum_value,
|
|
7337
7337
|
options: r
|
|
7338
|
-
}),
|
|
7338
|
+
}), E;
|
|
7339
7339
|
}
|
|
7340
7340
|
return Q(e.data);
|
|
7341
7341
|
}
|
|
@@ -7375,7 +7375,7 @@ class Le extends P {
|
|
|
7375
7375
|
}
|
|
7376
7376
|
Ot = /* @__PURE__ */ new WeakMap();
|
|
7377
7377
|
Le.create = Jr;
|
|
7378
|
-
class tn extends
|
|
7378
|
+
class tn extends N {
|
|
7379
7379
|
constructor() {
|
|
7380
7380
|
super(...arguments), Tt.set(this, void 0);
|
|
7381
7381
|
}
|
|
@@ -7387,7 +7387,7 @@ class tn extends P {
|
|
|
7387
7387
|
expected: M.joinValues(s),
|
|
7388
7388
|
received: r.parsedType,
|
|
7389
7389
|
code: f.invalid_type
|
|
7390
|
-
}),
|
|
7390
|
+
}), E;
|
|
7391
7391
|
}
|
|
7392
7392
|
if (In(this, Tt) || Kr(this, Tt, new Set(M.getValidEnumValues(this._def.values))), !In(this, Tt).has(e.data)) {
|
|
7393
7393
|
const s = M.objectValues(t);
|
|
@@ -7395,7 +7395,7 @@ class tn extends P {
|
|
|
7395
7395
|
received: r.data,
|
|
7396
7396
|
code: f.invalid_enum_value,
|
|
7397
7397
|
options: s
|
|
7398
|
-
}),
|
|
7398
|
+
}), E;
|
|
7399
7399
|
}
|
|
7400
7400
|
return Q(e.data);
|
|
7401
7401
|
}
|
|
@@ -7407,9 +7407,9 @@ Tt = /* @__PURE__ */ new WeakMap();
|
|
|
7407
7407
|
tn.create = (n, e) => new tn({
|
|
7408
7408
|
values: n,
|
|
7409
7409
|
typeName: O.ZodNativeEnum,
|
|
7410
|
-
...
|
|
7410
|
+
...Z(e)
|
|
7411
7411
|
});
|
|
7412
|
-
class mt extends
|
|
7412
|
+
class mt extends N {
|
|
7413
7413
|
unwrap() {
|
|
7414
7414
|
return this._def.type;
|
|
7415
7415
|
}
|
|
@@ -7420,7 +7420,7 @@ class mt extends P {
|
|
|
7420
7420
|
code: f.invalid_type,
|
|
7421
7421
|
expected: b.promise,
|
|
7422
7422
|
received: t.parsedType
|
|
7423
|
-
}),
|
|
7423
|
+
}), E;
|
|
7424
7424
|
const r = t.parsedType === b.promise ? t.data : Promise.resolve(t.data);
|
|
7425
7425
|
return Q(r.then((s) => this._def.type.parseAsync(s, {
|
|
7426
7426
|
path: t.path,
|
|
@@ -7431,9 +7431,9 @@ class mt extends P {
|
|
|
7431
7431
|
mt.create = (n, e) => new mt({
|
|
7432
7432
|
type: n,
|
|
7433
7433
|
typeName: O.ZodPromise,
|
|
7434
|
-
...
|
|
7434
|
+
...Z(e)
|
|
7435
7435
|
});
|
|
7436
|
-
class me extends
|
|
7436
|
+
class me extends N {
|
|
7437
7437
|
innerType() {
|
|
7438
7438
|
return this._def.schema;
|
|
7439
7439
|
}
|
|
@@ -7454,23 +7454,23 @@ class me extends P {
|
|
|
7454
7454
|
if (r.common.async)
|
|
7455
7455
|
return Promise.resolve(i).then(async (o) => {
|
|
7456
7456
|
if (t.value === "aborted")
|
|
7457
|
-
return
|
|
7457
|
+
return E;
|
|
7458
7458
|
const d = await this._def.schema._parseAsync({
|
|
7459
7459
|
data: o,
|
|
7460
7460
|
path: r.path,
|
|
7461
7461
|
parent: r
|
|
7462
7462
|
});
|
|
7463
|
-
return d.status === "aborted" ?
|
|
7463
|
+
return d.status === "aborted" ? E : d.status === "dirty" || t.value === "dirty" ? Cn(d.value) : d;
|
|
7464
7464
|
});
|
|
7465
7465
|
{
|
|
7466
7466
|
if (t.value === "aborted")
|
|
7467
|
-
return
|
|
7467
|
+
return E;
|
|
7468
7468
|
const o = this._def.schema._parseSync({
|
|
7469
7469
|
data: i,
|
|
7470
7470
|
path: r.path,
|
|
7471
7471
|
parent: r
|
|
7472
7472
|
});
|
|
7473
|
-
return o.status === "aborted" ?
|
|
7473
|
+
return o.status === "aborted" ? E : o.status === "dirty" || t.value === "dirty" ? Cn(o.value) : o;
|
|
7474
7474
|
}
|
|
7475
7475
|
}
|
|
7476
7476
|
if (s.type === "refinement") {
|
|
@@ -7488,9 +7488,9 @@ class me extends P {
|
|
|
7488
7488
|
path: r.path,
|
|
7489
7489
|
parent: r
|
|
7490
7490
|
});
|
|
7491
|
-
return o.status === "aborted" ?
|
|
7491
|
+
return o.status === "aborted" ? E : (o.status === "dirty" && t.dirty(), i(o.value), { status: t.value, value: o.value });
|
|
7492
7492
|
} else
|
|
7493
|
-
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((o) => o.status === "aborted" ?
|
|
7493
|
+
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((o) => o.status === "aborted" ? E : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
|
|
7494
7494
|
}
|
|
7495
7495
|
if (s.type === "transform")
|
|
7496
7496
|
if (r.common.async === !1) {
|
|
@@ -7514,15 +7514,15 @@ me.create = (n, e, t) => new me({
|
|
|
7514
7514
|
schema: n,
|
|
7515
7515
|
typeName: O.ZodEffects,
|
|
7516
7516
|
effect: e,
|
|
7517
|
-
...
|
|
7517
|
+
...Z(t)
|
|
7518
7518
|
});
|
|
7519
7519
|
me.createWithPreprocess = (n, e, t) => new me({
|
|
7520
7520
|
schema: e,
|
|
7521
7521
|
effect: { type: "preprocess", transform: n },
|
|
7522
7522
|
typeName: O.ZodEffects,
|
|
7523
|
-
...
|
|
7523
|
+
...Z(t)
|
|
7524
7524
|
});
|
|
7525
|
-
class ye extends
|
|
7525
|
+
class ye extends N {
|
|
7526
7526
|
_parse(e) {
|
|
7527
7527
|
return this._getType(e) === b.undefined ? Q(void 0) : this._def.innerType._parse(e);
|
|
7528
7528
|
}
|
|
@@ -7533,9 +7533,9 @@ class ye extends P {
|
|
|
7533
7533
|
ye.create = (n, e) => new ye({
|
|
7534
7534
|
innerType: n,
|
|
7535
7535
|
typeName: O.ZodOptional,
|
|
7536
|
-
...
|
|
7536
|
+
...Z(e)
|
|
7537
7537
|
});
|
|
7538
|
-
class
|
|
7538
|
+
class Ue extends N {
|
|
7539
7539
|
_parse(e) {
|
|
7540
7540
|
return this._getType(e) === b.null ? Q(null) : this._def.innerType._parse(e);
|
|
7541
7541
|
}
|
|
@@ -7543,12 +7543,12 @@ class Ve extends P {
|
|
|
7543
7543
|
return this._def.innerType;
|
|
7544
7544
|
}
|
|
7545
7545
|
}
|
|
7546
|
-
|
|
7546
|
+
Ue.create = (n, e) => new Ue({
|
|
7547
7547
|
innerType: n,
|
|
7548
7548
|
typeName: O.ZodNullable,
|
|
7549
|
-
...
|
|
7549
|
+
...Z(e)
|
|
7550
7550
|
});
|
|
7551
|
-
class nn extends
|
|
7551
|
+
class nn extends N {
|
|
7552
7552
|
_parse(e) {
|
|
7553
7553
|
const { ctx: t } = this._processInputParams(e);
|
|
7554
7554
|
let r = t.data;
|
|
@@ -7566,9 +7566,9 @@ nn.create = (n, e) => new nn({
|
|
|
7566
7566
|
innerType: n,
|
|
7567
7567
|
typeName: O.ZodDefault,
|
|
7568
7568
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
7569
|
-
...
|
|
7569
|
+
...Z(e)
|
|
7570
7570
|
});
|
|
7571
|
-
class rn extends
|
|
7571
|
+
class rn extends N {
|
|
7572
7572
|
_parse(e) {
|
|
7573
7573
|
const { ctx: t } = this._processInputParams(e), r = {
|
|
7574
7574
|
...t,
|
|
@@ -7609,9 +7609,9 @@ rn.create = (n, e) => new rn({
|
|
|
7609
7609
|
innerType: n,
|
|
7610
7610
|
typeName: O.ZodCatch,
|
|
7611
7611
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
7612
|
-
...
|
|
7612
|
+
...Z(e)
|
|
7613
7613
|
});
|
|
7614
|
-
class $n extends
|
|
7614
|
+
class $n extends N {
|
|
7615
7615
|
_parse(e) {
|
|
7616
7616
|
if (this._getType(e) !== b.nan) {
|
|
7617
7617
|
const t = this._getOrReturnCtx(e);
|
|
@@ -7619,17 +7619,17 @@ class $n extends P {
|
|
|
7619
7619
|
code: f.invalid_type,
|
|
7620
7620
|
expected: b.nan,
|
|
7621
7621
|
received: t.parsedType
|
|
7622
|
-
}),
|
|
7622
|
+
}), E;
|
|
7623
7623
|
}
|
|
7624
7624
|
return { status: "valid", value: e.data };
|
|
7625
7625
|
}
|
|
7626
7626
|
}
|
|
7627
7627
|
$n.create = (n) => new $n({
|
|
7628
7628
|
typeName: O.ZodNaN,
|
|
7629
|
-
...
|
|
7629
|
+
...Z(n)
|
|
7630
7630
|
});
|
|
7631
|
-
const
|
|
7632
|
-
class sr extends
|
|
7631
|
+
const qi = Symbol("zod_brand");
|
|
7632
|
+
class sr extends N {
|
|
7633
7633
|
_parse(e) {
|
|
7634
7634
|
const { ctx: t } = this._processInputParams(e), r = t.data;
|
|
7635
7635
|
return this._def.type._parse({
|
|
@@ -7642,7 +7642,7 @@ class sr extends P {
|
|
|
7642
7642
|
return this._def.type;
|
|
7643
7643
|
}
|
|
7644
7644
|
}
|
|
7645
|
-
class pn extends
|
|
7645
|
+
class pn extends N {
|
|
7646
7646
|
_parse(e) {
|
|
7647
7647
|
const { status: t, ctx: r } = this._processInputParams(e);
|
|
7648
7648
|
if (r.common.async)
|
|
@@ -7652,7 +7652,7 @@ class pn extends P {
|
|
|
7652
7652
|
path: r.path,
|
|
7653
7653
|
parent: r
|
|
7654
7654
|
});
|
|
7655
|
-
return s.status === "aborted" ?
|
|
7655
|
+
return s.status === "aborted" ? E : s.status === "dirty" ? (t.dirty(), Cn(s.value)) : this._def.out._parseAsync({
|
|
7656
7656
|
data: s.value,
|
|
7657
7657
|
path: r.path,
|
|
7658
7658
|
parent: r
|
|
@@ -7664,7 +7664,7 @@ class pn extends P {
|
|
|
7664
7664
|
path: r.path,
|
|
7665
7665
|
parent: r
|
|
7666
7666
|
});
|
|
7667
|
-
return s.status === "aborted" ?
|
|
7667
|
+
return s.status === "aborted" ? E : s.status === "dirty" ? (t.dirty(), {
|
|
7668
7668
|
status: "dirty",
|
|
7669
7669
|
value: s.value
|
|
7670
7670
|
}) : this._def.out._parseSync({
|
|
@@ -7682,7 +7682,7 @@ class pn extends P {
|
|
|
7682
7682
|
});
|
|
7683
7683
|
}
|
|
7684
7684
|
}
|
|
7685
|
-
class sn extends
|
|
7685
|
+
class sn extends N {
|
|
7686
7686
|
_parse(e) {
|
|
7687
7687
|
const t = this._def.innerType._parse(e), r = (s) => (Ht(s) && (s.value = Object.freeze(s.value)), s);
|
|
7688
7688
|
return Ft(t) ? t.then((s) => r(s)) : r(t);
|
|
@@ -7694,7 +7694,7 @@ class sn extends P {
|
|
|
7694
7694
|
sn.create = (n, e) => new sn({
|
|
7695
7695
|
innerType: n,
|
|
7696
7696
|
typeName: O.ZodReadonly,
|
|
7697
|
-
...
|
|
7697
|
+
...Z(e)
|
|
7698
7698
|
});
|
|
7699
7699
|
function Qr(n, e = {}, t) {
|
|
7700
7700
|
return n ? ft.create().superRefine((r, s) => {
|
|
@@ -7705,16 +7705,16 @@ function Qr(n, e = {}, t) {
|
|
|
7705
7705
|
}
|
|
7706
7706
|
}) : ft.create();
|
|
7707
7707
|
}
|
|
7708
|
-
const
|
|
7708
|
+
const Bi = {
|
|
7709
7709
|
object: B.lazycreate
|
|
7710
7710
|
};
|
|
7711
7711
|
var O;
|
|
7712
7712
|
(function(n) {
|
|
7713
7713
|
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";
|
|
7714
7714
|
})(O || (O = {}));
|
|
7715
|
-
const
|
|
7715
|
+
const Wi = (n, e = {
|
|
7716
7716
|
message: `Input not instance of ${n.name}`
|
|
7717
|
-
}) => Qr((t) => t instanceof n, e), Xr = le.create, es = Me.create,
|
|
7717
|
+
}) => Qr((t) => t instanceof n, e), Xr = le.create, es = Me.create, Hi = $n.create, Fi = De.create, ts = Kt.create, Ki = Ye.create, Gi = Nn.create, zi = Gt.create, Yi = zt.create, Ji = ft.create, Qi = Ke.create, Xi = Ee.create, eo = Pn.create, to = he.create, no = B.create, ro = B.strictCreate, so = Yt.create, ao = Ln.create, io = Jt.create, oo = we.create, co = Qt.create, uo = An.create, lo = Je.create, po = it.create, ho = Xt.create, fo = en.create, mo = Le.create, go = tn.create, _o = mt.create, gr = me.create, yo = ye.create, vo = Ue.create, bo = me.createWithPreprocess, ko = pn.create, wo = () => Xr().optional(), xo = () => es().optional(), Oo = () => ts().optional(), To = {
|
|
7718
7718
|
string: (n) => le.create({ ...n, coerce: !0 }),
|
|
7719
7719
|
number: (n) => Me.create({ ...n, coerce: !0 }),
|
|
7720
7720
|
boolean: (n) => Kt.create({
|
|
@@ -7723,17 +7723,17 @@ const Bi = (n, e = {
|
|
|
7723
7723
|
}),
|
|
7724
7724
|
bigint: (n) => De.create({ ...n, coerce: !0 }),
|
|
7725
7725
|
date: (n) => Ye.create({ ...n, coerce: !0 })
|
|
7726
|
-
},
|
|
7726
|
+
}, jo = E;
|
|
7727
7727
|
var c = /* @__PURE__ */ Object.freeze({
|
|
7728
7728
|
__proto__: null,
|
|
7729
7729
|
defaultErrorMap: ht,
|
|
7730
|
-
setErrorMap:
|
|
7731
|
-
getErrorMap:
|
|
7732
|
-
makeIssue:
|
|
7733
|
-
EMPTY_PATH:
|
|
7730
|
+
setErrorMap: Ti,
|
|
7731
|
+
getErrorMap: Sn,
|
|
7732
|
+
makeIssue: Zn,
|
|
7733
|
+
EMPTY_PATH: ji,
|
|
7734
7734
|
addIssueToContext: y,
|
|
7735
7735
|
ParseStatus: Y,
|
|
7736
|
-
INVALID:
|
|
7736
|
+
INVALID: E,
|
|
7737
7737
|
DIRTY: Cn,
|
|
7738
7738
|
OK: Q,
|
|
7739
7739
|
isAborted: Xn,
|
|
@@ -7748,20 +7748,20 @@ var c = /* @__PURE__ */ Object.freeze({
|
|
|
7748
7748
|
},
|
|
7749
7749
|
ZodParsedType: b,
|
|
7750
7750
|
getParsedType: Ce,
|
|
7751
|
-
ZodType:
|
|
7751
|
+
ZodType: N,
|
|
7752
7752
|
datetimeRegex: Yr,
|
|
7753
7753
|
ZodString: le,
|
|
7754
7754
|
ZodNumber: Me,
|
|
7755
7755
|
ZodBigInt: De,
|
|
7756
7756
|
ZodBoolean: Kt,
|
|
7757
7757
|
ZodDate: Ye,
|
|
7758
|
-
ZodSymbol:
|
|
7758
|
+
ZodSymbol: Nn,
|
|
7759
7759
|
ZodUndefined: Gt,
|
|
7760
7760
|
ZodNull: zt,
|
|
7761
7761
|
ZodAny: ft,
|
|
7762
7762
|
ZodUnknown: Ke,
|
|
7763
|
-
ZodNever:
|
|
7764
|
-
ZodVoid:
|
|
7763
|
+
ZodNever: Ee,
|
|
7764
|
+
ZodVoid: Pn,
|
|
7765
7765
|
ZodArray: he,
|
|
7766
7766
|
ZodObject: B,
|
|
7767
7767
|
ZodUnion: Yt,
|
|
@@ -7780,75 +7780,75 @@ var c = /* @__PURE__ */ Object.freeze({
|
|
|
7780
7780
|
ZodEffects: me,
|
|
7781
7781
|
ZodTransformer: me,
|
|
7782
7782
|
ZodOptional: ye,
|
|
7783
|
-
ZodNullable:
|
|
7783
|
+
ZodNullable: Ue,
|
|
7784
7784
|
ZodDefault: nn,
|
|
7785
7785
|
ZodCatch: rn,
|
|
7786
7786
|
ZodNaN: $n,
|
|
7787
|
-
BRAND:
|
|
7787
|
+
BRAND: qi,
|
|
7788
7788
|
ZodBranded: sr,
|
|
7789
7789
|
ZodPipeline: pn,
|
|
7790
7790
|
ZodReadonly: sn,
|
|
7791
7791
|
custom: Qr,
|
|
7792
|
-
Schema:
|
|
7793
|
-
ZodSchema:
|
|
7794
|
-
late:
|
|
7792
|
+
Schema: N,
|
|
7793
|
+
ZodSchema: N,
|
|
7794
|
+
late: Bi,
|
|
7795
7795
|
get ZodFirstPartyTypeKind() {
|
|
7796
7796
|
return O;
|
|
7797
7797
|
},
|
|
7798
|
-
coerce:
|
|
7799
|
-
any:
|
|
7800
|
-
array:
|
|
7801
|
-
bigint:
|
|
7798
|
+
coerce: To,
|
|
7799
|
+
any: Ji,
|
|
7800
|
+
array: to,
|
|
7801
|
+
bigint: Fi,
|
|
7802
7802
|
boolean: ts,
|
|
7803
|
-
date:
|
|
7804
|
-
discriminatedUnion:
|
|
7803
|
+
date: Ki,
|
|
7804
|
+
discriminatedUnion: ao,
|
|
7805
7805
|
effect: gr,
|
|
7806
|
-
enum:
|
|
7807
|
-
function:
|
|
7808
|
-
instanceof:
|
|
7809
|
-
intersection:
|
|
7810
|
-
lazy:
|
|
7811
|
-
literal:
|
|
7812
|
-
map:
|
|
7813
|
-
nan:
|
|
7814
|
-
nativeEnum:
|
|
7815
|
-
never:
|
|
7816
|
-
null:
|
|
7817
|
-
nullable:
|
|
7806
|
+
enum: mo,
|
|
7807
|
+
function: po,
|
|
7808
|
+
instanceof: Wi,
|
|
7809
|
+
intersection: io,
|
|
7810
|
+
lazy: ho,
|
|
7811
|
+
literal: fo,
|
|
7812
|
+
map: uo,
|
|
7813
|
+
nan: Hi,
|
|
7814
|
+
nativeEnum: go,
|
|
7815
|
+
never: Xi,
|
|
7816
|
+
null: Yi,
|
|
7817
|
+
nullable: vo,
|
|
7818
7818
|
number: es,
|
|
7819
|
-
object:
|
|
7820
|
-
oboolean:
|
|
7821
|
-
onumber:
|
|
7822
|
-
optional:
|
|
7823
|
-
ostring:
|
|
7824
|
-
pipeline:
|
|
7825
|
-
preprocess:
|
|
7826
|
-
promise:
|
|
7827
|
-
record:
|
|
7828
|
-
set:
|
|
7829
|
-
strictObject:
|
|
7819
|
+
object: no,
|
|
7820
|
+
oboolean: Oo,
|
|
7821
|
+
onumber: xo,
|
|
7822
|
+
optional: yo,
|
|
7823
|
+
ostring: wo,
|
|
7824
|
+
pipeline: ko,
|
|
7825
|
+
preprocess: bo,
|
|
7826
|
+
promise: _o,
|
|
7827
|
+
record: co,
|
|
7828
|
+
set: lo,
|
|
7829
|
+
strictObject: ro,
|
|
7830
7830
|
string: Xr,
|
|
7831
|
-
symbol:
|
|
7831
|
+
symbol: Gi,
|
|
7832
7832
|
transformer: gr,
|
|
7833
|
-
tuple:
|
|
7834
|
-
undefined:
|
|
7835
|
-
union:
|
|
7836
|
-
unknown:
|
|
7837
|
-
void:
|
|
7838
|
-
NEVER:
|
|
7833
|
+
tuple: oo,
|
|
7834
|
+
undefined: zi,
|
|
7835
|
+
union: so,
|
|
7836
|
+
unknown: Qi,
|
|
7837
|
+
void: eo,
|
|
7838
|
+
NEVER: jo,
|
|
7839
7839
|
ZodIssueCode: f,
|
|
7840
|
-
quotelessJson:
|
|
7840
|
+
quotelessJson: Oi,
|
|
7841
7841
|
ZodError: se
|
|
7842
7842
|
});
|
|
7843
|
-
|
|
7844
|
-
const
|
|
7843
|
+
xi(c);
|
|
7844
|
+
const Eo = c.object({
|
|
7845
7845
|
start: c.number(),
|
|
7846
7846
|
limit: c.number(),
|
|
7847
7847
|
length: c.number()
|
|
7848
7848
|
}), ar = c.object({
|
|
7849
7849
|
created_at: c.string(),
|
|
7850
7850
|
updated_at: c.string()
|
|
7851
|
-
}),
|
|
7851
|
+
}), Ro = c.object({
|
|
7852
7852
|
email: c.string().optional(),
|
|
7853
7853
|
email_verified: c.boolean().optional(),
|
|
7854
7854
|
name: c.string().optional(),
|
|
@@ -7857,7 +7857,7 @@ const jo = c.object({
|
|
|
7857
7857
|
phone_number: c.string().optional(),
|
|
7858
7858
|
phone_verified: c.boolean().optional(),
|
|
7859
7859
|
family_name: c.string().optional()
|
|
7860
|
-
}).catchall(c.any()),
|
|
7860
|
+
}).catchall(c.any()), So = c.object({
|
|
7861
7861
|
connection: c.string(),
|
|
7862
7862
|
user_id: c.string(),
|
|
7863
7863
|
provider: c.string(),
|
|
@@ -7865,7 +7865,7 @@ const jo = c.object({
|
|
|
7865
7865
|
access_token: c.string().optional(),
|
|
7866
7866
|
access_token_secret: c.string().optional(),
|
|
7867
7867
|
refresh_token: c.string().optional(),
|
|
7868
|
-
profileData:
|
|
7868
|
+
profileData: Ro.optional()
|
|
7869
7869
|
}), ns = c.object({
|
|
7870
7870
|
email: c.string().optional(),
|
|
7871
7871
|
username: c.string().optional(),
|
|
@@ -7878,7 +7878,7 @@ const jo = c.object({
|
|
|
7878
7878
|
linked_to: c.string().optional(),
|
|
7879
7879
|
profileData: c.string().optional(),
|
|
7880
7880
|
user_id: c.string().optional()
|
|
7881
|
-
}),
|
|
7881
|
+
}), Zo = ns.extend({
|
|
7882
7882
|
email_verified: c.boolean().default(!1),
|
|
7883
7883
|
verify_email: c.boolean().optional(),
|
|
7884
7884
|
last_ip: c.string().optional(),
|
|
@@ -7887,13 +7887,13 @@ const jo = c.object({
|
|
|
7887
7887
|
provider: c.string().default("email"),
|
|
7888
7888
|
connection: c.string().default("email")
|
|
7889
7889
|
});
|
|
7890
|
-
|
|
7890
|
+
Zo.extend(ar.shape).extend({
|
|
7891
7891
|
user_id: c.string(),
|
|
7892
7892
|
// TODO: this not might be correct if you use the username
|
|
7893
7893
|
email: c.string(),
|
|
7894
7894
|
is_social: c.boolean(),
|
|
7895
7895
|
login_count: c.number(),
|
|
7896
|
-
identities: c.array(
|
|
7896
|
+
identities: c.array(So).optional()
|
|
7897
7897
|
});
|
|
7898
7898
|
ns.extend({
|
|
7899
7899
|
email: c.string(),
|
|
@@ -7903,7 +7903,7 @@ ns.extend({
|
|
|
7903
7903
|
last_login: c.string().optional(),
|
|
7904
7904
|
user_id: c.string()
|
|
7905
7905
|
}).catchall(c.any());
|
|
7906
|
-
const
|
|
7906
|
+
const Co = c.object({
|
|
7907
7907
|
id: c.string(),
|
|
7908
7908
|
name: c.string(),
|
|
7909
7909
|
allowed_web_origins: c.string().transform((n) => n === null ? "" : n).default(""),
|
|
@@ -7916,9 +7916,9 @@ const So = c.object({
|
|
|
7916
7916
|
c.object({
|
|
7917
7917
|
created_at: c.string().transform((n) => n === null ? "" : n),
|
|
7918
7918
|
updated_at: c.string().transform((n) => n === null ? "" : n)
|
|
7919
|
-
}).extend(
|
|
7919
|
+
}).extend(Co.shape);
|
|
7920
7920
|
var rs = /* @__PURE__ */ ((n) => (n.TOKEN = "token", n.TOKEN_ID_TOKEN = "token id_token", n.CODE = "code", n))(rs || {}), ss = /* @__PURE__ */ ((n) => (n.QUERY = "query", n.FRAGMENT = "fragment", n.FORM_POST = "form_post", n.WEB_MESSAGE = "web_message", n))(ss || {}), as = /* @__PURE__ */ ((n) => (n.S265 = "S256", n.plain = "plain", n))(as || {});
|
|
7921
|
-
const
|
|
7921
|
+
const Un = c.object({
|
|
7922
7922
|
client_id: c.string(),
|
|
7923
7923
|
vendor_id: c.string().optional(),
|
|
7924
7924
|
response_type: c.nativeEnum(rs).optional(),
|
|
@@ -7948,7 +7948,7 @@ c.object({
|
|
|
7948
7948
|
url: c.string()
|
|
7949
7949
|
}).optional()
|
|
7950
7950
|
});
|
|
7951
|
-
const
|
|
7951
|
+
const Io = c.object({
|
|
7952
7952
|
id: c.string().optional(),
|
|
7953
7953
|
name: c.string(),
|
|
7954
7954
|
client_id: c.string().optional(),
|
|
@@ -7967,7 +7967,7 @@ const Co = c.object({
|
|
|
7967
7967
|
id: c.string(),
|
|
7968
7968
|
created_at: c.string().transform((n) => n === null ? "" : n),
|
|
7969
7969
|
updated_at: c.string().transform((n) => n === null ? "" : n)
|
|
7970
|
-
}).extend(
|
|
7970
|
+
}).extend(Io.shape), No = c.object({
|
|
7971
7971
|
domain: c.string(),
|
|
7972
7972
|
dkim_private_key: c.string().optional(),
|
|
7973
7973
|
dkim_public_key: c.string().optional(),
|
|
@@ -7976,7 +7976,7 @@ const Co = c.object({
|
|
|
7976
7976
|
}), os = c.object({
|
|
7977
7977
|
id: c.string(),
|
|
7978
7978
|
name: c.string(),
|
|
7979
|
-
domains: c.array(
|
|
7979
|
+
domains: c.array(No),
|
|
7980
7980
|
allowed_callback_urls: c.array(c.string()),
|
|
7981
7981
|
allowed_logout_urls: c.array(c.string()),
|
|
7982
7982
|
allowed_web_origins: c.array(c.string()),
|
|
@@ -8013,8 +8013,7 @@ const Po = c.enum([
|
|
|
8013
8013
|
"oauth2",
|
|
8014
8014
|
"oauth2_state",
|
|
8015
8015
|
"ticket"
|
|
8016
|
-
])
|
|
8017
|
-
c.object({
|
|
8016
|
+
]), Ao = c.object({
|
|
8018
8017
|
code_id: c.string().openapi({
|
|
8019
8018
|
description: "The code that will be used in for instance an email verification flow"
|
|
8020
8019
|
}),
|
|
@@ -8022,11 +8021,14 @@ c.object({
|
|
|
8022
8021
|
description: "The id of the login session that the code is connected to"
|
|
8023
8022
|
}),
|
|
8024
8023
|
code_type: Po,
|
|
8025
|
-
created_at: c.string(),
|
|
8026
8024
|
expires_at: c.string(),
|
|
8027
8025
|
used_at: c.string().optional()
|
|
8028
8026
|
});
|
|
8029
|
-
|
|
8027
|
+
c.object({
|
|
8028
|
+
...Ao.shape,
|
|
8029
|
+
created_at: c.string()
|
|
8030
|
+
});
|
|
8031
|
+
const $o = c.object({
|
|
8030
8032
|
domain: c.string(),
|
|
8031
8033
|
dkim_private_key: c.string().optional(),
|
|
8032
8034
|
dkim_public_key: c.string().optional(),
|
|
@@ -8034,28 +8036,28 @@ const No = c.object({
|
|
|
8034
8036
|
email_service: c.enum(["mailgun", "mailchannels"])
|
|
8035
8037
|
});
|
|
8036
8038
|
ar.extend({
|
|
8037
|
-
|
|
8039
|
+
...$o.shape,
|
|
8038
8040
|
id: c.string()
|
|
8039
8041
|
});
|
|
8040
|
-
const
|
|
8042
|
+
const Mo = c.object({
|
|
8041
8043
|
trigger_id: c.enum(["post-user-registration", "post-user-login"]),
|
|
8042
8044
|
enabled: c.boolean().default(!1),
|
|
8043
8045
|
url: c.string(),
|
|
8044
8046
|
hook_id: c.string().optional()
|
|
8045
8047
|
});
|
|
8046
|
-
|
|
8048
|
+
Mo.extend({
|
|
8047
8049
|
...ar.shape,
|
|
8048
8050
|
hook_id: c.string()
|
|
8049
8051
|
});
|
|
8050
|
-
const
|
|
8052
|
+
const Do = c.object({
|
|
8051
8053
|
alg: c.string(),
|
|
8052
8054
|
e: c.string(),
|
|
8053
8055
|
kid: c.string(),
|
|
8054
8056
|
kty: c.string(),
|
|
8055
8057
|
n: c.string(),
|
|
8056
8058
|
use: c.string().optional()
|
|
8057
|
-
}),
|
|
8058
|
-
keys: c.array(
|
|
8059
|
+
}), Lo = c.object({
|
|
8060
|
+
keys: c.array(Do)
|
|
8059
8061
|
}), _r = c.object({
|
|
8060
8062
|
issuer: c.string(),
|
|
8061
8063
|
authorization_endpoint: c.string(),
|
|
@@ -8077,24 +8079,25 @@ const $o = c.object({
|
|
|
8077
8079
|
request_uri_parameter_supported: c.boolean(),
|
|
8078
8080
|
request_parameter_supported: c.boolean(),
|
|
8079
8081
|
token_endpoint_auth_signing_alg_values_supported: c.array(c.string())
|
|
8080
|
-
}),
|
|
8081
|
-
login_id: c.string().openapi({
|
|
8082
|
-
description: "This is is used as the state in the universal login"
|
|
8083
|
-
}),
|
|
8082
|
+
}), Uo = c.object({
|
|
8084
8083
|
auth0Client: c.string().optional(),
|
|
8085
|
-
authParams:
|
|
8084
|
+
authParams: Un,
|
|
8086
8085
|
expires_at: c.string(),
|
|
8087
|
-
deleted_at: c.string(),
|
|
8086
|
+
deleted_at: c.string().optional(),
|
|
8088
8087
|
ip: c.string().optional()
|
|
8089
8088
|
}).openapi({
|
|
8090
8089
|
description: "This represents a login sesion"
|
|
8091
8090
|
});
|
|
8092
8091
|
c.object({
|
|
8093
|
-
...
|
|
8092
|
+
...Uo.shape,
|
|
8093
|
+
login_id: c.string().openapi({
|
|
8094
|
+
description: "This is is used as the state in the universal login"
|
|
8095
|
+
}),
|
|
8094
8096
|
created_at: c.string(),
|
|
8095
8097
|
updated_at: c.string()
|
|
8096
8098
|
});
|
|
8097
|
-
|
|
8099
|
+
var cs = /* @__PURE__ */ ((n) => (n.SUCCESS_API_OPERATION = "sapi", n.SUCCESS_SILENT_AUTH = "ssa", n.FAILED_SILENT_AUTH = "fsa", n.SUCCESS_SIGNUP = "ss", n.FAILED_SIGNUP = "fs", n.SUCCESS_LOGIN = "s", n.FAILED_LOGIN = "f", n.FAILED_LOGIN_INCORRECT_PASSWORD = "fp", n.SUCCESS_LOGOUT = "slo", n.SUCCESS_CROSS_ORIGIN_AUTHENTICATION = "scoa", n.FAILED_CROSS_ORIGIN_AUTHENTICATION = "fcoa", n.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN = "seacft", n.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN = "serft", n.CODE_LINK_SENT = "cls", n.NOT_IMPLEMENTED_1 = "seccft", n))(cs || {});
|
|
8100
|
+
const Vo = c.enum([
|
|
8098
8101
|
"sapi",
|
|
8099
8102
|
// SUCCESS_API_OPERATION
|
|
8100
8103
|
"ssa",
|
|
@@ -8126,7 +8129,7 @@ const Lo = c.enum([
|
|
|
8126
8129
|
"seacft",
|
|
8127
8130
|
// SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN
|
|
8128
8131
|
"serft"
|
|
8129
|
-
]),
|
|
8132
|
+
]), qo = c.object({
|
|
8130
8133
|
name: c.string(),
|
|
8131
8134
|
version: c.string(),
|
|
8132
8135
|
env: c.object({
|
|
@@ -8134,7 +8137,7 @@ const Lo = c.enum([
|
|
|
8134
8137
|
}).optional()
|
|
8135
8138
|
});
|
|
8136
8139
|
c.object({
|
|
8137
|
-
type:
|
|
8140
|
+
type: Vo,
|
|
8138
8141
|
date: c.string(),
|
|
8139
8142
|
description: c.string().optional(),
|
|
8140
8143
|
log_id: c.string().optional(),
|
|
@@ -8155,19 +8158,19 @@ c.object({
|
|
|
8155
8158
|
strategy: c.string().optional(),
|
|
8156
8159
|
strategy_type: c.string().optional(),
|
|
8157
8160
|
hostname: c.string().optional(),
|
|
8158
|
-
auth0_client:
|
|
8161
|
+
auth0_client: qo.optional()
|
|
8159
8162
|
});
|
|
8160
|
-
const
|
|
8163
|
+
const Bo = c.object({
|
|
8161
8164
|
user_id: c.string(),
|
|
8162
8165
|
password: c.string(),
|
|
8163
8166
|
algorithm: c.enum(["bcrypt", "argon2id"]).default("argon2id")
|
|
8164
8167
|
});
|
|
8165
8168
|
c.object({
|
|
8166
|
-
...
|
|
8169
|
+
...Bo.shape,
|
|
8167
8170
|
created_at: c.string(),
|
|
8168
8171
|
updated_at: c.string()
|
|
8169
8172
|
});
|
|
8170
|
-
const
|
|
8173
|
+
const Wo = c.object({
|
|
8171
8174
|
session_id: c.string(),
|
|
8172
8175
|
client_id: c.string(),
|
|
8173
8176
|
expires_at: c.string(),
|
|
@@ -8177,7 +8180,7 @@ const qo = c.object({
|
|
|
8177
8180
|
});
|
|
8178
8181
|
c.object({
|
|
8179
8182
|
created_at: c.string(),
|
|
8180
|
-
...
|
|
8183
|
+
...Wo.shape
|
|
8181
8184
|
});
|
|
8182
8185
|
c.object({
|
|
8183
8186
|
private_key: c.string(),
|
|
@@ -8238,8 +8241,8 @@ c.object({
|
|
|
8238
8241
|
siteUrl: c.string().nullable(),
|
|
8239
8242
|
manageSubscriptionsUrl: c.string().optional()
|
|
8240
8243
|
});
|
|
8241
|
-
var
|
|
8242
|
-
const ir = c.nativeEnum(
|
|
8244
|
+
var ds = /* @__PURE__ */ ((n) => (n.RefreshToken = "refresh_token", n.AuthorizationCode = "authorization_code", n.ClientCredential = "client_credentials", n.Passwordless = "passwordless", n.Password = "password", n))(ds || {});
|
|
8245
|
+
const ir = c.nativeEnum(ds);
|
|
8243
8246
|
c.object({
|
|
8244
8247
|
grant_type: ir.refine(
|
|
8245
8248
|
(n) => n === "authorization_code"
|
|
@@ -8282,7 +8285,7 @@ c.object({
|
|
|
8282
8285
|
code: c.string(),
|
|
8283
8286
|
state: c.string().optional()
|
|
8284
8287
|
});
|
|
8285
|
-
const
|
|
8288
|
+
const Ho = c.object({
|
|
8286
8289
|
button_border_radius: c.number(),
|
|
8287
8290
|
button_border_weight: c.number(),
|
|
8288
8291
|
buttons_style: c.enum(["pill"]),
|
|
@@ -8292,7 +8295,7 @@ const Bo = c.object({
|
|
|
8292
8295
|
show_widget_shadow: c.boolean(),
|
|
8293
8296
|
widget_border_weight: c.number(),
|
|
8294
8297
|
widget_corner_radius: c.number()
|
|
8295
|
-
}),
|
|
8298
|
+
}), Fo = c.object({
|
|
8296
8299
|
base_focus_color: c.string(),
|
|
8297
8300
|
base_hover_color: c.string(),
|
|
8298
8301
|
body_text: c.string(),
|
|
@@ -8315,7 +8318,7 @@ const Bo = c.object({
|
|
|
8315
8318
|
}), et = c.object({
|
|
8316
8319
|
bold: c.boolean(),
|
|
8317
8320
|
size: c.number()
|
|
8318
|
-
}),
|
|
8321
|
+
}), Ko = c.object({
|
|
8319
8322
|
body_text: et,
|
|
8320
8323
|
buttons_text: et,
|
|
8321
8324
|
font_url: c.string(),
|
|
@@ -8325,55 +8328,55 @@ const Bo = c.object({
|
|
|
8325
8328
|
reference_text_size: c.number(),
|
|
8326
8329
|
subtitle: et,
|
|
8327
8330
|
title: et
|
|
8328
|
-
}),
|
|
8331
|
+
}), Go = c.object({
|
|
8329
8332
|
background_color: c.string(),
|
|
8330
8333
|
background_image_url: c.string(),
|
|
8331
8334
|
page_layout: c.enum(["center"])
|
|
8332
|
-
}),
|
|
8335
|
+
}), zo = c.object({
|
|
8333
8336
|
header_text_alignment: c.enum(["center"]),
|
|
8334
8337
|
logo_height: c.number(),
|
|
8335
8338
|
logo_position: c.enum(["center"]),
|
|
8336
8339
|
logo_url: c.string(),
|
|
8337
8340
|
social_buttons_layout: c.enum(["bottom"])
|
|
8338
|
-
}),
|
|
8339
|
-
borders:
|
|
8340
|
-
colors:
|
|
8341
|
+
}), Yo = c.object({
|
|
8342
|
+
borders: Ho,
|
|
8343
|
+
colors: Fo,
|
|
8341
8344
|
displayName: c.string(),
|
|
8342
|
-
fonts:
|
|
8343
|
-
page_background:
|
|
8344
|
-
widget:
|
|
8345
|
+
fonts: Ko,
|
|
8346
|
+
page_background: Go,
|
|
8347
|
+
widget: zo
|
|
8345
8348
|
});
|
|
8346
|
-
|
|
8349
|
+
Yo.extend({
|
|
8347
8350
|
themeId: c.string()
|
|
8348
8351
|
});
|
|
8349
|
-
const
|
|
8352
|
+
const Jo = c.object({
|
|
8350
8353
|
id: c.string(),
|
|
8351
8354
|
expires_at: c.string(),
|
|
8352
8355
|
auth0Client: c.string().optional(),
|
|
8353
|
-
authParams:
|
|
8356
|
+
authParams: Un
|
|
8354
8357
|
});
|
|
8355
8358
|
c.object({
|
|
8356
|
-
...
|
|
8359
|
+
...Jo.shape,
|
|
8357
8360
|
created_at: c.string(),
|
|
8358
8361
|
updated_at: c.string()
|
|
8359
8362
|
});
|
|
8360
|
-
const
|
|
8363
|
+
const Qo = c.object({
|
|
8361
8364
|
id: c.string(),
|
|
8362
8365
|
email: c.string(),
|
|
8363
8366
|
code: c.string(),
|
|
8364
8367
|
ip: c.string().optional(),
|
|
8365
8368
|
send: c.enum(["code", "link"]),
|
|
8366
|
-
authParams:
|
|
8369
|
+
authParams: Un,
|
|
8367
8370
|
expires_at: c.string(),
|
|
8368
8371
|
used_at: c.string().optional(),
|
|
8369
8372
|
user_id: c.string().optional()
|
|
8370
8373
|
});
|
|
8371
8374
|
c.object({
|
|
8372
8375
|
created_at: c.string(),
|
|
8373
|
-
...
|
|
8376
|
+
...Qo.shape
|
|
8374
8377
|
});
|
|
8375
|
-
const
|
|
8376
|
-
authParams:
|
|
8378
|
+
const Xo = c.object({
|
|
8379
|
+
authParams: Un,
|
|
8377
8380
|
code: c.string(),
|
|
8378
8381
|
user_id: c.string(),
|
|
8379
8382
|
created_at: c.string(),
|
|
@@ -8381,10 +8384,10 @@ const Jo = c.object({
|
|
|
8381
8384
|
used_at: c.string().optional()
|
|
8382
8385
|
});
|
|
8383
8386
|
c.object({
|
|
8384
|
-
...
|
|
8387
|
+
...Xo.shape,
|
|
8385
8388
|
created_at: c.string()
|
|
8386
8389
|
});
|
|
8387
|
-
const
|
|
8390
|
+
const ec = new Wt().openapi(
|
|
8388
8391
|
We({
|
|
8389
8392
|
tags: ["jwks"],
|
|
8390
8393
|
method: "get",
|
|
@@ -8394,7 +8397,7 @@ const Qo = new Wt().openapi(
|
|
|
8394
8397
|
200: {
|
|
8395
8398
|
content: {
|
|
8396
8399
|
"application/json": {
|
|
8397
|
-
schema:
|
|
8400
|
+
schema: Lo
|
|
8398
8401
|
}
|
|
8399
8402
|
},
|
|
8400
8403
|
description: "List of tenants"
|
|
@@ -8519,7 +8522,7 @@ const Qo = new Wt().openapi(
|
|
|
8519
8522
|
});
|
|
8520
8523
|
}
|
|
8521
8524
|
);
|
|
8522
|
-
async function
|
|
8525
|
+
async function tc({
|
|
8523
8526
|
userAdapter: n,
|
|
8524
8527
|
tenant_id: e,
|
|
8525
8528
|
email: t
|
|
@@ -8547,11 +8550,11 @@ async function Xo({
|
|
|
8547
8550
|
throw new Error("Primary account not found");
|
|
8548
8551
|
return i;
|
|
8549
8552
|
}
|
|
8550
|
-
function
|
|
8553
|
+
function nc(n) {
|
|
8551
8554
|
return async (e, t) => {
|
|
8552
8555
|
if (!t.email || !t.email_verified)
|
|
8553
8556
|
return n.users.create(e, t);
|
|
8554
|
-
const r = await
|
|
8557
|
+
const r = await tc({
|
|
8555
8558
|
userAdapter: n.users,
|
|
8556
8559
|
tenant_id: e,
|
|
8557
8560
|
email: t.email
|
|
@@ -8562,17 +8565,53 @@ function ec(n) {
|
|
|
8562
8565
|
}), r) : n.users.create(e, t);
|
|
8563
8566
|
};
|
|
8564
8567
|
}
|
|
8565
|
-
|
|
8568
|
+
function rc(n, e) {
|
|
8569
|
+
return {
|
|
8570
|
+
type: e.type,
|
|
8571
|
+
description: e.description || "",
|
|
8572
|
+
ip: n.req.header("x-real-ip") || "",
|
|
8573
|
+
user_agent: n.req.header("user-agent") || "",
|
|
8574
|
+
date: (/* @__PURE__ */ new Date()).toISOString(),
|
|
8575
|
+
details: {
|
|
8576
|
+
request: {
|
|
8577
|
+
method: n.req.method,
|
|
8578
|
+
path: n.req.path,
|
|
8579
|
+
qs: n.req.queries(),
|
|
8580
|
+
body: e.body || n.var.body || ""
|
|
8581
|
+
}
|
|
8582
|
+
},
|
|
8583
|
+
isMobile: !1,
|
|
8584
|
+
client_id: n.var.client_id,
|
|
8585
|
+
client_name: "",
|
|
8586
|
+
user_id: e.userId || n.var.user_id || "",
|
|
8587
|
+
hostname: n.req.header("host") || "",
|
|
8588
|
+
user_name: n.var.username || "",
|
|
8589
|
+
connection_id: "",
|
|
8590
|
+
connection: n.var.connection || "",
|
|
8591
|
+
// auth0_client: ctx.var.auth0_client,
|
|
8592
|
+
strategy: "",
|
|
8593
|
+
strategy_type: "",
|
|
8594
|
+
audience: "",
|
|
8595
|
+
scope: []
|
|
8596
|
+
};
|
|
8597
|
+
}
|
|
8598
|
+
async function sc(n, e, t) {
|
|
8566
8599
|
for await (const r of e)
|
|
8567
|
-
(await fetch(r.url, {
|
|
8600
|
+
if (!(await fetch(r.url, {
|
|
8568
8601
|
method: "POST",
|
|
8569
8602
|
headers: {
|
|
8570
8603
|
"Content-Type": "application/json"
|
|
8571
8604
|
},
|
|
8572
8605
|
body: JSON.stringify(t)
|
|
8573
|
-
})).ok
|
|
8606
|
+
})).ok) {
|
|
8607
|
+
const a = rc(n, {
|
|
8608
|
+
type: cs.FAILED_LOGIN_INCORRECT_PASSWORD,
|
|
8609
|
+
description: "Invalid password"
|
|
8610
|
+
});
|
|
8611
|
+
await t.logs.create(n.var.tenant_id, a);
|
|
8612
|
+
}
|
|
8574
8613
|
}
|
|
8575
|
-
function
|
|
8614
|
+
function ac(n, e) {
|
|
8576
8615
|
return async (t, r) => {
|
|
8577
8616
|
const { hooks: s } = await e.hooks.list(t, {
|
|
8578
8617
|
q: "trigger_id:post-user-registration",
|
|
@@ -8580,26 +8619,26 @@ function nc(n, e) {
|
|
|
8580
8619
|
per_page: 100,
|
|
8581
8620
|
include_totals: !1
|
|
8582
8621
|
});
|
|
8583
|
-
return await
|
|
8622
|
+
return await sc(n, s, {
|
|
8584
8623
|
tenant_id: t,
|
|
8585
8624
|
user: r,
|
|
8586
8625
|
trigger_id: "post-user-registration"
|
|
8587
8626
|
}), r;
|
|
8588
8627
|
};
|
|
8589
8628
|
}
|
|
8590
|
-
function
|
|
8629
|
+
function ic(n, e) {
|
|
8591
8630
|
return async (t, r) => {
|
|
8592
|
-
let s = await
|
|
8593
|
-
return await
|
|
8631
|
+
let s = await nc(e)(t, r);
|
|
8632
|
+
return await ac(n, e)(t, s), s;
|
|
8594
8633
|
};
|
|
8595
8634
|
}
|
|
8596
|
-
function
|
|
8635
|
+
function oc(n, e) {
|
|
8597
8636
|
return {
|
|
8598
8637
|
...e,
|
|
8599
|
-
users: { ...e.users, create:
|
|
8638
|
+
users: { ...e.users, create: ic(n, e) }
|
|
8600
8639
|
};
|
|
8601
8640
|
}
|
|
8602
|
-
const
|
|
8641
|
+
const cc = G.object({
|
|
8603
8642
|
page: G.string().min(0).optional().default("0").transform((n) => parseInt(n, 10)).openapi({
|
|
8604
8643
|
description: "The page number where 0 is the first page"
|
|
8605
8644
|
}),
|
|
@@ -8616,7 +8655,7 @@ const ac = G.object({
|
|
|
8616
8655
|
description: "A lucene query string used to filter the results"
|
|
8617
8656
|
})
|
|
8618
8657
|
});
|
|
8619
|
-
function
|
|
8658
|
+
function dc(n) {
|
|
8620
8659
|
if (!n)
|
|
8621
8660
|
return;
|
|
8622
8661
|
const [e = "", t] = n.split(":");
|
|
@@ -8625,15 +8664,15 @@ function ic(n) {
|
|
|
8625
8664
|
sort_order: t === "1" ? "asc" : "desc"
|
|
8626
8665
|
};
|
|
8627
8666
|
}
|
|
8628
|
-
const
|
|
8667
|
+
const uc = Eo.extend({
|
|
8629
8668
|
tenants: G.array(_n)
|
|
8630
|
-
}),
|
|
8669
|
+
}), lc = new Wt().openapi(
|
|
8631
8670
|
We({
|
|
8632
8671
|
tags: ["tenants"],
|
|
8633
8672
|
method: "get",
|
|
8634
8673
|
path: "/",
|
|
8635
8674
|
request: {
|
|
8636
|
-
query:
|
|
8675
|
+
query: cc
|
|
8637
8676
|
},
|
|
8638
8677
|
// middleware: [authenticationMiddleware({ scopes: ["auth:read"] })],
|
|
8639
8678
|
security: [
|
|
@@ -8645,7 +8684,7 @@ const oc = jo.extend({
|
|
|
8645
8684
|
200: {
|
|
8646
8685
|
content: {
|
|
8647
8686
|
"tenant/json": {
|
|
8648
|
-
schema: G.union([G.array(_n),
|
|
8687
|
+
schema: G.union([G.array(_n), uc])
|
|
8649
8688
|
}
|
|
8650
8689
|
},
|
|
8651
8690
|
description: "List of tenants"
|
|
@@ -8657,7 +8696,7 @@ const oc = jo.extend({
|
|
|
8657
8696
|
page: e,
|
|
8658
8697
|
per_page: t,
|
|
8659
8698
|
include_totals: r,
|
|
8660
|
-
sort:
|
|
8699
|
+
sort: dc(s),
|
|
8661
8700
|
q: a
|
|
8662
8701
|
});
|
|
8663
8702
|
return r ? n.json(i) : n.json(i.tenants);
|
|
@@ -8791,7 +8830,7 @@ const oc = jo.extend({
|
|
|
8791
8830
|
}
|
|
8792
8831
|
);
|
|
8793
8832
|
let yr = !1;
|
|
8794
|
-
function
|
|
8833
|
+
function pc(n) {
|
|
8795
8834
|
n.use(async (e, t) => (yr || (n.openAPIRegistry.registerComponent("securitySchemes", "Bearer", {
|
|
8796
8835
|
type: "oauth2",
|
|
8797
8836
|
scheme: "bearer",
|
|
@@ -8807,11 +8846,11 @@ function dc(n) {
|
|
|
8807
8846
|
}
|
|
8808
8847
|
}), yr = !0), await t()));
|
|
8809
8848
|
}
|
|
8810
|
-
function
|
|
8849
|
+
function hc(n) {
|
|
8811
8850
|
const e = new Wt();
|
|
8812
|
-
e.use(async (r, s) => (r.env.data =
|
|
8813
|
-
const t = e.route("/api/v2/tenants",
|
|
8814
|
-
return
|
|
8851
|
+
e.use(async (r, s) => (r.env.data = oc(r, n.dataAdapter), s()));
|
|
8852
|
+
const t = e.route("/api/v2/tenants", lc);
|
|
8853
|
+
return pc(t), t.doc("/api/v2/spec", {
|
|
8815
8854
|
openapi: "3.0.0",
|
|
8816
8855
|
info: {
|
|
8817
8856
|
version: "1.0.0",
|
|
@@ -8819,12 +8858,12 @@ function uc(n) {
|
|
|
8819
8858
|
}
|
|
8820
8859
|
}), t;
|
|
8821
8860
|
}
|
|
8822
|
-
function
|
|
8861
|
+
function _c(n) {
|
|
8823
8862
|
const e = new Wt();
|
|
8824
8863
|
e.get("/", (s) => s.text("Hello, authhero!"));
|
|
8825
|
-
const t =
|
|
8864
|
+
const t = hc(n);
|
|
8826
8865
|
e.route("/api/v2", t);
|
|
8827
|
-
const r = new Wt().route("/.well-known",
|
|
8866
|
+
const r = new Wt().route("/.well-known", ec);
|
|
8828
8867
|
return r.doc("/spec", {
|
|
8829
8868
|
openapi: "3.0.0",
|
|
8830
8869
|
info: {
|
|
@@ -8834,5 +8873,5 @@ function fc(n) {
|
|
|
8834
8873
|
}), e.route("/", r), e;
|
|
8835
8874
|
}
|
|
8836
8875
|
export {
|
|
8837
|
-
|
|
8876
|
+
_c as init
|
|
8838
8877
|
};
|