@authhero/adapter-interfaces 0.15.0 → 0.15.2
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/adapter-interfaces.cjs +1 -1
- package/dist/adapter-interfaces.d.ts +128 -116
- package/dist/adapter-interfaces.iife.js +1 -1
- package/dist/adapter-interfaces.mjs +356 -339
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function dt(t, e) {
|
|
2
2
|
var n = {};
|
|
3
3
|
for (var s in t) Object.prototype.hasOwnProperty.call(t, s) && e.indexOf(s) < 0 && (n[s] = t[s]);
|
|
4
4
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -6,7 +6,7 @@ function ct(t, e) {
|
|
|
6
6
|
e.indexOf(s[a]) < 0 && Object.prototype.propertyIsEnumerable.call(t, s[a]) && (n[s[a]] = t[s[a]]);
|
|
7
7
|
return n;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function ct(t, e) {
|
|
10
10
|
var n;
|
|
11
11
|
return ((n = t == null ? void 0 : t._def) === null || n === void 0 ? void 0 : n.typeName) === e;
|
|
12
12
|
}
|
|
@@ -21,11 +21,11 @@ function lt(t) {
|
|
|
21
21
|
if (typeof t.ZodType.prototype.openapi < "u")
|
|
22
22
|
return;
|
|
23
23
|
t.ZodType.prototype.openapi = function(a, i) {
|
|
24
|
-
var o,
|
|
25
|
-
const z = typeof a == "string" ? i : a, B = z ?? {}, { param:
|
|
26
|
-
param: Object.assign(Object.assign({}, (x = (m = this._def.openapi) === null || m === void 0 ? void 0 : m.metadata) === null || x === void 0 ? void 0 : x.param),
|
|
24
|
+
var o, d, u, l, m, x;
|
|
25
|
+
const z = typeof a == "string" ? i : a, B = z ?? {}, { param: De } = B, at = dt(B, ["param"]), $e = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof a == "string" ? { refId: a } : void 0), Ve = Object.assign(Object.assign(Object.assign({}, (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata), at), !((l = (u = this._def.openapi) === null || u === void 0 ? void 0 : u.metadata) === null || l === void 0) && l.param || De ? {
|
|
26
|
+
param: Object.assign(Object.assign({}, (x = (m = this._def.openapi) === null || m === void 0 ? void 0 : m.metadata) === null || x === void 0 ? void 0 : x.param), De)
|
|
27
27
|
} : void 0), Le = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys($e).length > 0 ? { _internal: $e } : void 0), Object.keys(Ve).length > 0 ? { metadata: Ve } : void 0) }));
|
|
28
|
-
if (
|
|
28
|
+
if (ct(this, "ZodObject")) {
|
|
29
29
|
const it = this.extend;
|
|
30
30
|
Le.extend = function(...ot) {
|
|
31
31
|
var we, Se, Te, Ee, Ce, Oe;
|
|
@@ -43,9 +43,9 @@ function lt(t) {
|
|
|
43
43
|
const e = t.ZodObject.prototype.deepPartial;
|
|
44
44
|
t.ZodObject.prototype.deepPartial = function() {
|
|
45
45
|
const a = this._def.shape(), i = e.apply(this), o = i._def.shape();
|
|
46
|
-
return Object.entries(o).forEach(([
|
|
46
|
+
return Object.entries(o).forEach(([d, u]) => {
|
|
47
47
|
var l, m;
|
|
48
|
-
u._def.openapi = (m = (l = a[
|
|
48
|
+
u._def.openapi = (m = (l = a[d]) === null || l === void 0 ? void 0 : l._def) === null || m === void 0 ? void 0 : m.openapi;
|
|
49
49
|
}), i._def.openapi = void 0, i;
|
|
50
50
|
};
|
|
51
51
|
const n = t.ZodObject.prototype.pick;
|
|
@@ -75,9 +75,9 @@ var b;
|
|
|
75
75
|
i[o] = o;
|
|
76
76
|
return i;
|
|
77
77
|
}, t.getValidEnumValues = (a) => {
|
|
78
|
-
const i = t.objectKeys(a).filter((
|
|
79
|
-
for (const
|
|
80
|
-
o[
|
|
78
|
+
const i = t.objectKeys(a).filter((d) => typeof a[a[d]] != "number"), o = {};
|
|
79
|
+
for (const d of i)
|
|
80
|
+
o[d] = a[d];
|
|
81
81
|
return t.objectValues(o);
|
|
82
82
|
}, t.objectValues = (a) => t.objectKeys(a).map(function(i) {
|
|
83
83
|
return a[i];
|
|
@@ -146,7 +146,7 @@ const h = b.arrayToEnum([
|
|
|
146
146
|
default:
|
|
147
147
|
return h.unknown;
|
|
148
148
|
}
|
|
149
|
-
},
|
|
149
|
+
}, c = b.arrayToEnum([
|
|
150
150
|
"invalid_type",
|
|
151
151
|
"invalid_literal",
|
|
152
152
|
"custom",
|
|
@@ -191,10 +191,10 @@ class T extends Error {
|
|
|
191
191
|
else if (o.path.length === 0)
|
|
192
192
|
s._errors.push(n(o));
|
|
193
193
|
else {
|
|
194
|
-
let
|
|
194
|
+
let d = s, u = 0;
|
|
195
195
|
for (; u < o.path.length; ) {
|
|
196
196
|
const l = o.path[u];
|
|
197
|
-
u === o.path.length - 1 ? (
|
|
197
|
+
u === o.path.length - 1 ? (d[l] = d[l] || { _errors: [] }, d[l]._errors.push(n(o))) : d[l] = d[l] || { _errors: [] }, d = d[l], u++;
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
200
|
};
|
|
@@ -227,52 +227,52 @@ T.create = (t) => new T(t);
|
|
|
227
227
|
const F = (t, e) => {
|
|
228
228
|
let n;
|
|
229
229
|
switch (t.code) {
|
|
230
|
-
case
|
|
230
|
+
case c.invalid_type:
|
|
231
231
|
t.received === h.undefined ? n = "Required" : n = `Expected ${t.expected}, received ${t.received}`;
|
|
232
232
|
break;
|
|
233
|
-
case
|
|
233
|
+
case c.invalid_literal:
|
|
234
234
|
n = `Invalid literal value, expected ${JSON.stringify(t.expected, b.jsonStringifyReplacer)}`;
|
|
235
235
|
break;
|
|
236
|
-
case
|
|
236
|
+
case c.unrecognized_keys:
|
|
237
237
|
n = `Unrecognized key(s) in object: ${b.joinValues(t.keys, ", ")}`;
|
|
238
238
|
break;
|
|
239
|
-
case
|
|
239
|
+
case c.invalid_union:
|
|
240
240
|
n = "Invalid input";
|
|
241
241
|
break;
|
|
242
|
-
case
|
|
242
|
+
case c.invalid_union_discriminator:
|
|
243
243
|
n = `Invalid discriminator value. Expected ${b.joinValues(t.options)}`;
|
|
244
244
|
break;
|
|
245
|
-
case
|
|
245
|
+
case c.invalid_enum_value:
|
|
246
246
|
n = `Invalid enum value. Expected ${b.joinValues(t.options)}, received '${t.received}'`;
|
|
247
247
|
break;
|
|
248
|
-
case
|
|
248
|
+
case c.invalid_arguments:
|
|
249
249
|
n = "Invalid function arguments";
|
|
250
250
|
break;
|
|
251
|
-
case
|
|
251
|
+
case c.invalid_return_type:
|
|
252
252
|
n = "Invalid function return type";
|
|
253
253
|
break;
|
|
254
|
-
case
|
|
254
|
+
case c.invalid_date:
|
|
255
255
|
n = "Invalid date";
|
|
256
256
|
break;
|
|
257
|
-
case
|
|
257
|
+
case c.invalid_string:
|
|
258
258
|
typeof t.validation == "object" ? "includes" in t.validation ? (n = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (n = `${n} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? n = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? n = `Invalid input: must end with "${t.validation.endsWith}"` : b.assertNever(t.validation) : t.validation !== "regex" ? n = `Invalid ${t.validation}` : n = "Invalid";
|
|
259
259
|
break;
|
|
260
|
-
case
|
|
260
|
+
case c.too_small:
|
|
261
261
|
t.type === "array" ? n = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "more than"} ${t.minimum} element(s)` : t.type === "string" ? n = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "over"} ${t.minimum} character(s)` : t.type === "number" ? n = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "date" ? n = `Date must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(t.minimum))}` : n = "Invalid input";
|
|
262
262
|
break;
|
|
263
|
-
case
|
|
263
|
+
case c.too_big:
|
|
264
264
|
t.type === "array" ? n = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at most" : "less than"} ${t.maximum} element(s)` : t.type === "string" ? n = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at most" : "under"} ${t.maximum} character(s)` : t.type === "number" ? n = `Number must be ${t.exact ? "exactly" : t.inclusive ? "less than or equal to" : "less than"} ${t.maximum}` : t.type === "bigint" ? n = `BigInt must be ${t.exact ? "exactly" : t.inclusive ? "less than or equal to" : "less than"} ${t.maximum}` : t.type === "date" ? n = `Date must be ${t.exact ? "exactly" : t.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(t.maximum))}` : n = "Invalid input";
|
|
265
265
|
break;
|
|
266
|
-
case
|
|
266
|
+
case c.custom:
|
|
267
267
|
n = "Invalid input";
|
|
268
268
|
break;
|
|
269
|
-
case
|
|
269
|
+
case c.invalid_intersection_types:
|
|
270
270
|
n = "Intersection results could not be merged";
|
|
271
271
|
break;
|
|
272
|
-
case
|
|
272
|
+
case c.not_multiple_of:
|
|
273
273
|
n = `Number must be a multiple of ${t.multipleOf}`;
|
|
274
274
|
break;
|
|
275
|
-
case
|
|
275
|
+
case c.not_finite:
|
|
276
276
|
n = "Number must be finite";
|
|
277
277
|
break;
|
|
278
278
|
default:
|
|
@@ -298,14 +298,14 @@ const _e = (t) => {
|
|
|
298
298
|
path: i,
|
|
299
299
|
message: a.message
|
|
300
300
|
};
|
|
301
|
-
let
|
|
301
|
+
let d = "";
|
|
302
302
|
const u = s.filter((l) => !!l).slice().reverse();
|
|
303
303
|
for (const l of u)
|
|
304
|
-
|
|
304
|
+
d = l(o, { data: e, defaultError: d }).message;
|
|
305
305
|
return {
|
|
306
306
|
...a,
|
|
307
307
|
path: i,
|
|
308
|
-
message:
|
|
308
|
+
message: d
|
|
309
309
|
};
|
|
310
310
|
}, ht = [];
|
|
311
311
|
function p(t, e) {
|
|
@@ -409,10 +409,10 @@ function y(t) {
|
|
|
409
409
|
const { errorMap: e, invalid_type_error: n, required_error: s, description: a } = t;
|
|
410
410
|
if (e && (n || s))
|
|
411
411
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
412
|
-
return e ? { errorMap: e, description: a } : { errorMap: (o,
|
|
412
|
+
return e ? { errorMap: e, description: a } : { errorMap: (o, d) => {
|
|
413
413
|
var u, l;
|
|
414
414
|
const { message: m } = t;
|
|
415
|
-
return o.code === "invalid_enum_value" ? { message: m ??
|
|
415
|
+
return o.code === "invalid_enum_value" ? { message: m ?? d.defaultError } : typeof d.data > "u" ? { message: (u = m ?? s) !== null && u !== void 0 ? u : d.defaultError } : o.code !== "invalid_type" ? { message: d.defaultError } : { message: (l = m ?? n) !== null && l !== void 0 ? l : d.defaultError };
|
|
416
416
|
}, description: a };
|
|
417
417
|
}
|
|
418
418
|
class v {
|
|
@@ -504,11 +504,11 @@ class v {
|
|
|
504
504
|
refine(e, n) {
|
|
505
505
|
const s = (a) => typeof n == "string" || typeof n > "u" ? { message: n } : typeof n == "function" ? n(a) : n;
|
|
506
506
|
return this._refinement((a, i) => {
|
|
507
|
-
const o = e(a),
|
|
508
|
-
code:
|
|
507
|
+
const o = e(a), d = () => i.addIssue({
|
|
508
|
+
code: c.custom,
|
|
509
509
|
...s(a)
|
|
510
510
|
});
|
|
511
|
-
return typeof Promise < "u" && o instanceof Promise ? o.then((u) => u ? !0 : (
|
|
511
|
+
return typeof Promise < "u" && o instanceof Promise ? o.then((u) => u ? !0 : (d(), !1)) : o ? !0 : (d(), !1);
|
|
512
512
|
});
|
|
513
513
|
}
|
|
514
514
|
refinement(e, n) {
|
|
@@ -528,7 +528,7 @@ class v {
|
|
|
528
528
|
return j.create(this, this._def);
|
|
529
529
|
}
|
|
530
530
|
nullable() {
|
|
531
|
-
return
|
|
531
|
+
return D.create(this, this._def);
|
|
532
532
|
}
|
|
533
533
|
nullish() {
|
|
534
534
|
return this.nullable().optional();
|
|
@@ -621,7 +621,7 @@ class E extends v {
|
|
|
621
621
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== h.string) {
|
|
622
622
|
const i = this._getOrReturnCtx(e);
|
|
623
623
|
return p(i, {
|
|
624
|
-
code:
|
|
624
|
+
code: c.invalid_type,
|
|
625
625
|
expected: h.string,
|
|
626
626
|
received: i.parsedType
|
|
627
627
|
}), g;
|
|
@@ -631,7 +631,7 @@ class E extends v {
|
|
|
631
631
|
for (const i of this._def.checks)
|
|
632
632
|
if (i.kind === "min")
|
|
633
633
|
e.data.length < i.value && (a = this._getOrReturnCtx(e, a), p(a, {
|
|
634
|
-
code:
|
|
634
|
+
code: c.too_small,
|
|
635
635
|
minimum: i.value,
|
|
636
636
|
type: "string",
|
|
637
637
|
inclusive: !0,
|
|
@@ -640,7 +640,7 @@ class E extends v {
|
|
|
640
640
|
}), s.dirty());
|
|
641
641
|
else if (i.kind === "max")
|
|
642
642
|
e.data.length > i.value && (a = this._getOrReturnCtx(e, a), p(a, {
|
|
643
|
-
code:
|
|
643
|
+
code: c.too_big,
|
|
644
644
|
maximum: i.value,
|
|
645
645
|
type: "string",
|
|
646
646
|
inclusive: !0,
|
|
@@ -648,16 +648,16 @@ class E extends v {
|
|
|
648
648
|
message: i.message
|
|
649
649
|
}), s.dirty());
|
|
650
650
|
else if (i.kind === "length") {
|
|
651
|
-
const o = e.data.length > i.value,
|
|
652
|
-
(o ||
|
|
653
|
-
code:
|
|
651
|
+
const o = e.data.length > i.value, d = e.data.length < i.value;
|
|
652
|
+
(o || d) && (a = this._getOrReturnCtx(e, a), o ? p(a, {
|
|
653
|
+
code: c.too_big,
|
|
654
654
|
maximum: i.value,
|
|
655
655
|
type: "string",
|
|
656
656
|
inclusive: !0,
|
|
657
657
|
exact: !0,
|
|
658
658
|
message: i.message
|
|
659
|
-
}) :
|
|
660
|
-
code:
|
|
659
|
+
}) : d && p(a, {
|
|
660
|
+
code: c.too_small,
|
|
661
661
|
minimum: i.value,
|
|
662
662
|
type: "string",
|
|
663
663
|
inclusive: !0,
|
|
@@ -667,43 +667,43 @@ class E extends v {
|
|
|
667
667
|
} else if (i.kind === "email")
|
|
668
668
|
bt.test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
669
669
|
validation: "email",
|
|
670
|
-
code:
|
|
670
|
+
code: c.invalid_string,
|
|
671
671
|
message: i.message
|
|
672
672
|
}), s.dirty());
|
|
673
673
|
else if (i.kind === "emoji")
|
|
674
674
|
Ie || (Ie = new RegExp(kt, "u")), Ie.test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
675
675
|
validation: "emoji",
|
|
676
|
-
code:
|
|
676
|
+
code: c.invalid_string,
|
|
677
677
|
message: i.message
|
|
678
678
|
}), s.dirty());
|
|
679
679
|
else if (i.kind === "uuid")
|
|
680
680
|
gt.test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
681
681
|
validation: "uuid",
|
|
682
|
-
code:
|
|
682
|
+
code: c.invalid_string,
|
|
683
683
|
message: i.message
|
|
684
684
|
}), s.dirty());
|
|
685
685
|
else if (i.kind === "nanoid")
|
|
686
686
|
yt.test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
687
687
|
validation: "nanoid",
|
|
688
|
-
code:
|
|
688
|
+
code: c.invalid_string,
|
|
689
689
|
message: i.message
|
|
690
690
|
}), s.dirty());
|
|
691
691
|
else if (i.kind === "cuid")
|
|
692
692
|
ft.test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
693
693
|
validation: "cuid",
|
|
694
|
-
code:
|
|
694
|
+
code: c.invalid_string,
|
|
695
695
|
message: i.message
|
|
696
696
|
}), s.dirty());
|
|
697
697
|
else if (i.kind === "cuid2")
|
|
698
698
|
mt.test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
699
699
|
validation: "cuid2",
|
|
700
|
-
code:
|
|
700
|
+
code: c.invalid_string,
|
|
701
701
|
message: i.message
|
|
702
702
|
}), s.dirty());
|
|
703
703
|
else if (i.kind === "ulid")
|
|
704
704
|
_t.test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
705
705
|
validation: "ulid",
|
|
706
|
-
code:
|
|
706
|
+
code: c.invalid_string,
|
|
707
707
|
message: i.message
|
|
708
708
|
}), s.dirty());
|
|
709
709
|
else if (i.kind === "url")
|
|
@@ -712,49 +712,49 @@ class E extends v {
|
|
|
712
712
|
} catch {
|
|
713
713
|
a = this._getOrReturnCtx(e, a), p(a, {
|
|
714
714
|
validation: "url",
|
|
715
|
-
code:
|
|
715
|
+
code: c.invalid_string,
|
|
716
716
|
message: i.message
|
|
717
717
|
}), s.dirty();
|
|
718
718
|
}
|
|
719
719
|
else i.kind === "regex" ? (i.regex.lastIndex = 0, i.regex.test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
720
720
|
validation: "regex",
|
|
721
|
-
code:
|
|
721
|
+
code: c.invalid_string,
|
|
722
722
|
message: i.message
|
|
723
723
|
}), s.dirty())) : i.kind === "trim" ? e.data = e.data.trim() : i.kind === "includes" ? e.data.includes(i.value, i.position) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
724
|
-
code:
|
|
724
|
+
code: c.invalid_string,
|
|
725
725
|
validation: { includes: i.value, position: i.position },
|
|
726
726
|
message: i.message
|
|
727
727
|
}), s.dirty()) : i.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : i.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : i.kind === "startsWith" ? e.data.startsWith(i.value) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
728
|
-
code:
|
|
728
|
+
code: c.invalid_string,
|
|
729
729
|
validation: { startsWith: i.value },
|
|
730
730
|
message: i.message
|
|
731
731
|
}), s.dirty()) : i.kind === "endsWith" ? e.data.endsWith(i.value) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
732
|
-
code:
|
|
732
|
+
code: c.invalid_string,
|
|
733
733
|
validation: { endsWith: i.value },
|
|
734
734
|
message: i.message
|
|
735
735
|
}), s.dirty()) : i.kind === "datetime" ? Fe(i).test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
736
|
-
code:
|
|
736
|
+
code: c.invalid_string,
|
|
737
737
|
validation: "datetime",
|
|
738
738
|
message: i.message
|
|
739
739
|
}), s.dirty()) : i.kind === "date" ? Tt.test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
740
|
-
code:
|
|
740
|
+
code: c.invalid_string,
|
|
741
741
|
validation: "date",
|
|
742
742
|
message: i.message
|
|
743
743
|
}), s.dirty()) : i.kind === "time" ? Et(i).test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
744
|
-
code:
|
|
744
|
+
code: c.invalid_string,
|
|
745
745
|
validation: "time",
|
|
746
746
|
message: i.message
|
|
747
747
|
}), s.dirty()) : i.kind === "duration" ? vt.test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
748
748
|
validation: "duration",
|
|
749
|
-
code:
|
|
749
|
+
code: c.invalid_string,
|
|
750
750
|
message: i.message
|
|
751
751
|
}), s.dirty()) : i.kind === "ip" ? Ct(e.data, i.version) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
752
752
|
validation: "ip",
|
|
753
|
-
code:
|
|
753
|
+
code: c.invalid_string,
|
|
754
754
|
message: i.message
|
|
755
755
|
}), s.dirty()) : i.kind === "base64" ? St.test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
756
756
|
validation: "base64",
|
|
757
|
-
code:
|
|
757
|
+
code: c.invalid_string,
|
|
758
758
|
message: i.message
|
|
759
759
|
}), s.dirty()) : b.assertNever(i);
|
|
760
760
|
return { status: s.value, value: e.data };
|
|
@@ -762,7 +762,7 @@ class E extends v {
|
|
|
762
762
|
_regex(e, n, s) {
|
|
763
763
|
return this.refinement((a) => e.test(a), {
|
|
764
764
|
validation: n,
|
|
765
|
-
code:
|
|
765
|
+
code: c.invalid_string,
|
|
766
766
|
...f.errToObj(s)
|
|
767
767
|
});
|
|
768
768
|
}
|
|
@@ -986,7 +986,7 @@ class P extends v {
|
|
|
986
986
|
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== h.number) {
|
|
987
987
|
const i = this._getOrReturnCtx(e);
|
|
988
988
|
return p(i, {
|
|
989
|
-
code:
|
|
989
|
+
code: c.invalid_type,
|
|
990
990
|
expected: h.number,
|
|
991
991
|
received: i.parsedType
|
|
992
992
|
}), g;
|
|
@@ -995,30 +995,30 @@ class P extends v {
|
|
|
995
995
|
const a = new w();
|
|
996
996
|
for (const i of this._def.checks)
|
|
997
997
|
i.kind === "int" ? b.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), p(s, {
|
|
998
|
-
code:
|
|
998
|
+
code: c.invalid_type,
|
|
999
999
|
expected: "integer",
|
|
1000
1000
|
received: "float",
|
|
1001
1001
|
message: i.message
|
|
1002
1002
|
}), a.dirty()) : i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (s = this._getOrReturnCtx(e, s), p(s, {
|
|
1003
|
-
code:
|
|
1003
|
+
code: c.too_small,
|
|
1004
1004
|
minimum: i.value,
|
|
1005
1005
|
type: "number",
|
|
1006
1006
|
inclusive: i.inclusive,
|
|
1007
1007
|
exact: !1,
|
|
1008
1008
|
message: i.message
|
|
1009
1009
|
}), a.dirty()) : i.kind === "max" ? (i.inclusive ? e.data > i.value : e.data >= i.value) && (s = this._getOrReturnCtx(e, s), p(s, {
|
|
1010
|
-
code:
|
|
1010
|
+
code: c.too_big,
|
|
1011
1011
|
maximum: i.value,
|
|
1012
1012
|
type: "number",
|
|
1013
1013
|
inclusive: i.inclusive,
|
|
1014
1014
|
exact: !1,
|
|
1015
1015
|
message: i.message
|
|
1016
1016
|
}), a.dirty()) : i.kind === "multipleOf" ? Ot(e.data, i.value) !== 0 && (s = this._getOrReturnCtx(e, s), p(s, {
|
|
1017
|
-
code:
|
|
1017
|
+
code: c.not_multiple_of,
|
|
1018
1018
|
multipleOf: i.value,
|
|
1019
1019
|
message: i.message
|
|
1020
1020
|
}), a.dirty()) : i.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s), p(s, {
|
|
1021
|
-
code:
|
|
1021
|
+
code: c.not_finite,
|
|
1022
1022
|
message: i.message
|
|
1023
1023
|
}), a.dirty()) : b.assertNever(i);
|
|
1024
1024
|
return { status: a.value, value: e.data };
|
|
@@ -1158,7 +1158,7 @@ class M extends v {
|
|
|
1158
1158
|
if (this._def.coerce && (e.data = BigInt(e.data)), this._getType(e) !== h.bigint) {
|
|
1159
1159
|
const i = this._getOrReturnCtx(e);
|
|
1160
1160
|
return p(i, {
|
|
1161
|
-
code:
|
|
1161
|
+
code: c.invalid_type,
|
|
1162
1162
|
expected: h.bigint,
|
|
1163
1163
|
received: i.parsedType
|
|
1164
1164
|
}), g;
|
|
@@ -1167,19 +1167,19 @@ class M extends v {
|
|
|
1167
1167
|
const a = new w();
|
|
1168
1168
|
for (const i of this._def.checks)
|
|
1169
1169
|
i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (s = this._getOrReturnCtx(e, s), p(s, {
|
|
1170
|
-
code:
|
|
1170
|
+
code: c.too_small,
|
|
1171
1171
|
type: "bigint",
|
|
1172
1172
|
minimum: i.value,
|
|
1173
1173
|
inclusive: i.inclusive,
|
|
1174
1174
|
message: i.message
|
|
1175
1175
|
}), a.dirty()) : i.kind === "max" ? (i.inclusive ? e.data > i.value : e.data >= i.value) && (s = this._getOrReturnCtx(e, s), p(s, {
|
|
1176
|
-
code:
|
|
1176
|
+
code: c.too_big,
|
|
1177
1177
|
type: "bigint",
|
|
1178
1178
|
maximum: i.value,
|
|
1179
1179
|
inclusive: i.inclusive,
|
|
1180
1180
|
message: i.message
|
|
1181
1181
|
}), a.dirty()) : i.kind === "multipleOf" ? e.data % i.value !== BigInt(0) && (s = this._getOrReturnCtx(e, s), p(s, {
|
|
1182
|
-
code:
|
|
1182
|
+
code: c.not_multiple_of,
|
|
1183
1183
|
multipleOf: i.value,
|
|
1184
1184
|
message: i.message
|
|
1185
1185
|
}), a.dirty()) : b.assertNever(i);
|
|
@@ -1283,7 +1283,7 @@ class ne extends v {
|
|
|
1283
1283
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== h.boolean) {
|
|
1284
1284
|
const s = this._getOrReturnCtx(e);
|
|
1285
1285
|
return p(s, {
|
|
1286
|
-
code:
|
|
1286
|
+
code: c.invalid_type,
|
|
1287
1287
|
expected: h.boolean,
|
|
1288
1288
|
received: s.parsedType
|
|
1289
1289
|
}), g;
|
|
@@ -1301,7 +1301,7 @@ class V extends v {
|
|
|
1301
1301
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== h.date) {
|
|
1302
1302
|
const i = this._getOrReturnCtx(e);
|
|
1303
1303
|
return p(i, {
|
|
1304
|
-
code:
|
|
1304
|
+
code: c.invalid_type,
|
|
1305
1305
|
expected: h.date,
|
|
1306
1306
|
received: i.parsedType
|
|
1307
1307
|
}), g;
|
|
@@ -1309,21 +1309,21 @@ class V extends v {
|
|
|
1309
1309
|
if (isNaN(e.data.getTime())) {
|
|
1310
1310
|
const i = this._getOrReturnCtx(e);
|
|
1311
1311
|
return p(i, {
|
|
1312
|
-
code:
|
|
1312
|
+
code: c.invalid_date
|
|
1313
1313
|
}), g;
|
|
1314
1314
|
}
|
|
1315
1315
|
const s = new w();
|
|
1316
1316
|
let a;
|
|
1317
1317
|
for (const i of this._def.checks)
|
|
1318
1318
|
i.kind === "min" ? e.data.getTime() < i.value && (a = this._getOrReturnCtx(e, a), p(a, {
|
|
1319
|
-
code:
|
|
1319
|
+
code: c.too_small,
|
|
1320
1320
|
message: i.message,
|
|
1321
1321
|
inclusive: !0,
|
|
1322
1322
|
exact: !1,
|
|
1323
1323
|
minimum: i.value,
|
|
1324
1324
|
type: "date"
|
|
1325
1325
|
}), s.dirty()) : i.kind === "max" ? e.data.getTime() > i.value && (a = this._getOrReturnCtx(e, a), p(a, {
|
|
1326
|
-
code:
|
|
1326
|
+
code: c.too_big,
|
|
1327
1327
|
message: i.message,
|
|
1328
1328
|
inclusive: !0,
|
|
1329
1329
|
exact: !1,
|
|
@@ -1379,7 +1379,7 @@ class ye extends v {
|
|
|
1379
1379
|
if (this._getType(e) !== h.symbol) {
|
|
1380
1380
|
const s = this._getOrReturnCtx(e);
|
|
1381
1381
|
return p(s, {
|
|
1382
|
-
code:
|
|
1382
|
+
code: c.invalid_type,
|
|
1383
1383
|
expected: h.symbol,
|
|
1384
1384
|
received: s.parsedType
|
|
1385
1385
|
}), g;
|
|
@@ -1396,7 +1396,7 @@ class re extends v {
|
|
|
1396
1396
|
if (this._getType(e) !== h.undefined) {
|
|
1397
1397
|
const s = this._getOrReturnCtx(e);
|
|
1398
1398
|
return p(s, {
|
|
1399
|
-
code:
|
|
1399
|
+
code: c.invalid_type,
|
|
1400
1400
|
expected: h.undefined,
|
|
1401
1401
|
received: s.parsedType
|
|
1402
1402
|
}), g;
|
|
@@ -1413,7 +1413,7 @@ class se extends v {
|
|
|
1413
1413
|
if (this._getType(e) !== h.null) {
|
|
1414
1414
|
const s = this._getOrReturnCtx(e);
|
|
1415
1415
|
return p(s, {
|
|
1416
|
-
code:
|
|
1416
|
+
code: c.invalid_type,
|
|
1417
1417
|
expected: h.null,
|
|
1418
1418
|
received: s.parsedType
|
|
1419
1419
|
}), g;
|
|
@@ -1453,7 +1453,7 @@ class R extends v {
|
|
|
1453
1453
|
_parse(e) {
|
|
1454
1454
|
const n = this._getOrReturnCtx(e);
|
|
1455
1455
|
return p(n, {
|
|
1456
|
-
code:
|
|
1456
|
+
code: c.invalid_type,
|
|
1457
1457
|
expected: h.never,
|
|
1458
1458
|
received: n.parsedType
|
|
1459
1459
|
}), g;
|
|
@@ -1468,7 +1468,7 @@ class ve extends v {
|
|
|
1468
1468
|
if (this._getType(e) !== h.undefined) {
|
|
1469
1469
|
const s = this._getOrReturnCtx(e);
|
|
1470
1470
|
return p(s, {
|
|
1471
|
-
code:
|
|
1471
|
+
code: c.invalid_type,
|
|
1472
1472
|
expected: h.void,
|
|
1473
1473
|
received: s.parsedType
|
|
1474
1474
|
}), g;
|
|
@@ -1485,15 +1485,15 @@ class C extends v {
|
|
|
1485
1485
|
const { ctx: n, status: s } = this._processInputParams(e), a = this._def;
|
|
1486
1486
|
if (n.parsedType !== h.array)
|
|
1487
1487
|
return p(n, {
|
|
1488
|
-
code:
|
|
1488
|
+
code: c.invalid_type,
|
|
1489
1489
|
expected: h.array,
|
|
1490
1490
|
received: n.parsedType
|
|
1491
1491
|
}), g;
|
|
1492
1492
|
if (a.exactLength !== null) {
|
|
1493
|
-
const o = n.data.length > a.exactLength.value,
|
|
1494
|
-
(o ||
|
|
1495
|
-
code: o ?
|
|
1496
|
-
minimum:
|
|
1493
|
+
const o = n.data.length > a.exactLength.value, d = n.data.length < a.exactLength.value;
|
|
1494
|
+
(o || d) && (p(n, {
|
|
1495
|
+
code: o ? c.too_big : c.too_small,
|
|
1496
|
+
minimum: d ? a.exactLength.value : void 0,
|
|
1497
1497
|
maximum: o ? a.exactLength.value : void 0,
|
|
1498
1498
|
type: "array",
|
|
1499
1499
|
inclusive: !0,
|
|
@@ -1502,22 +1502,22 @@ class C extends v {
|
|
|
1502
1502
|
}), s.dirty());
|
|
1503
1503
|
}
|
|
1504
1504
|
if (a.minLength !== null && n.data.length < a.minLength.value && (p(n, {
|
|
1505
|
-
code:
|
|
1505
|
+
code: c.too_small,
|
|
1506
1506
|
minimum: a.minLength.value,
|
|
1507
1507
|
type: "array",
|
|
1508
1508
|
inclusive: !0,
|
|
1509
1509
|
exact: !1,
|
|
1510
1510
|
message: a.minLength.message
|
|
1511
1511
|
}), s.dirty()), a.maxLength !== null && n.data.length > a.maxLength.value && (p(n, {
|
|
1512
|
-
code:
|
|
1512
|
+
code: c.too_big,
|
|
1513
1513
|
maximum: a.maxLength.value,
|
|
1514
1514
|
type: "array",
|
|
1515
1515
|
inclusive: !0,
|
|
1516
1516
|
exact: !1,
|
|
1517
1517
|
message: a.maxLength.message
|
|
1518
1518
|
}), s.dirty()), n.common.async)
|
|
1519
|
-
return Promise.all([...n.data].map((o,
|
|
1520
|
-
const i = [...n.data].map((o,
|
|
1519
|
+
return Promise.all([...n.data].map((o, d) => a.type._parseAsync(new I(n, o, n.path, d)))).then((o) => w.mergeArray(s, o));
|
|
1520
|
+
const i = [...n.data].map((o, d) => a.type._parseSync(new I(n, o, n.path, d)));
|
|
1521
1521
|
return w.mergeArray(s, i);
|
|
1522
1522
|
}
|
|
1523
1523
|
get element() {
|
|
@@ -1567,7 +1567,7 @@ function H(t) {
|
|
|
1567
1567
|
} else return t instanceof C ? new C({
|
|
1568
1568
|
...t._def,
|
|
1569
1569
|
type: H(t.element)
|
|
1570
|
-
}) : t instanceof j ? j.create(H(t.unwrap())) : t instanceof
|
|
1570
|
+
}) : t instanceof j ? j.create(H(t.unwrap())) : t instanceof D ? D.create(H(t.unwrap())) : t instanceof N ? N.create(t.items.map((e) => H(e))) : t;
|
|
1571
1571
|
}
|
|
1572
1572
|
class k extends v {
|
|
1573
1573
|
constructor() {
|
|
@@ -1583,15 +1583,15 @@ class k extends v {
|
|
|
1583
1583
|
if (this._getType(e) !== h.object) {
|
|
1584
1584
|
const l = this._getOrReturnCtx(e);
|
|
1585
1585
|
return p(l, {
|
|
1586
|
-
code:
|
|
1586
|
+
code: c.invalid_type,
|
|
1587
1587
|
expected: h.object,
|
|
1588
1588
|
received: l.parsedType
|
|
1589
1589
|
}), g;
|
|
1590
1590
|
}
|
|
1591
|
-
const { status: s, ctx: a } = this._processInputParams(e), { shape: i, keys: o } = this._getCached(),
|
|
1591
|
+
const { status: s, ctx: a } = this._processInputParams(e), { shape: i, keys: o } = this._getCached(), d = [];
|
|
1592
1592
|
if (!(this._def.catchall instanceof R && this._def.unknownKeys === "strip"))
|
|
1593
1593
|
for (const l in a.data)
|
|
1594
|
-
o.includes(l) ||
|
|
1594
|
+
o.includes(l) || d.push(l);
|
|
1595
1595
|
const u = [];
|
|
1596
1596
|
for (const l of o) {
|
|
1597
1597
|
const m = i[l], x = a.data[l];
|
|
@@ -1604,20 +1604,20 @@ class k extends v {
|
|
|
1604
1604
|
if (this._def.catchall instanceof R) {
|
|
1605
1605
|
const l = this._def.unknownKeys;
|
|
1606
1606
|
if (l === "passthrough")
|
|
1607
|
-
for (const m of
|
|
1607
|
+
for (const m of d)
|
|
1608
1608
|
u.push({
|
|
1609
1609
|
key: { status: "valid", value: m },
|
|
1610
1610
|
value: { status: "valid", value: a.data[m] }
|
|
1611
1611
|
});
|
|
1612
1612
|
else if (l === "strict")
|
|
1613
|
-
|
|
1614
|
-
code:
|
|
1615
|
-
keys:
|
|
1613
|
+
d.length > 0 && (p(a, {
|
|
1614
|
+
code: c.unrecognized_keys,
|
|
1615
|
+
keys: d
|
|
1616
1616
|
}), s.dirty());
|
|
1617
1617
|
else if (l !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
1618
1618
|
} else {
|
|
1619
1619
|
const l = this._def.catchall;
|
|
1620
|
-
for (const m of
|
|
1620
|
+
for (const m of d) {
|
|
1621
1621
|
const x = a.data[m];
|
|
1622
1622
|
u.push({
|
|
1623
1623
|
key: { status: "valid", value: m },
|
|
@@ -1651,10 +1651,10 @@ class k extends v {
|
|
|
1651
1651
|
unknownKeys: "strict",
|
|
1652
1652
|
...e !== void 0 ? {
|
|
1653
1653
|
errorMap: (n, s) => {
|
|
1654
|
-
var a, i, o,
|
|
1654
|
+
var a, i, o, d;
|
|
1655
1655
|
const u = (o = (i = (a = this._def).errorMap) === null || i === void 0 ? void 0 : i.call(a, n, s).message) !== null && o !== void 0 ? o : s.defaultError;
|
|
1656
1656
|
return n.code === "unrecognized_keys" ? {
|
|
1657
|
-
message: (
|
|
1657
|
+
message: (d = f.errToObj(e).message) !== null && d !== void 0 ? d : u
|
|
1658
1658
|
} : {
|
|
1659
1659
|
message: u
|
|
1660
1660
|
};
|
|
@@ -1860,15 +1860,15 @@ class ae extends v {
|
|
|
1860
1860
|
_parse(e) {
|
|
1861
1861
|
const { ctx: n } = this._processInputParams(e), s = this._def.options;
|
|
1862
1862
|
function a(i) {
|
|
1863
|
-
for (const
|
|
1864
|
-
if (
|
|
1865
|
-
return
|
|
1866
|
-
for (const
|
|
1867
|
-
if (
|
|
1868
|
-
return n.common.issues.push(...
|
|
1869
|
-
const o = i.map((
|
|
1863
|
+
for (const d of i)
|
|
1864
|
+
if (d.result.status === "valid")
|
|
1865
|
+
return d.result;
|
|
1866
|
+
for (const d of i)
|
|
1867
|
+
if (d.result.status === "dirty")
|
|
1868
|
+
return n.common.issues.push(...d.ctx.common.issues), d.result;
|
|
1869
|
+
const o = i.map((d) => new T(d.ctx.common.issues));
|
|
1870
1870
|
return p(n, {
|
|
1871
|
-
code:
|
|
1871
|
+
code: c.invalid_union,
|
|
1872
1872
|
unionErrors: o
|
|
1873
1873
|
}), g;
|
|
1874
1874
|
}
|
|
@@ -1913,10 +1913,10 @@ class ae extends v {
|
|
|
1913
1913
|
}
|
|
1914
1914
|
if (i)
|
|
1915
1915
|
return n.common.issues.push(...i.ctx.common.issues), i.result;
|
|
1916
|
-
const
|
|
1916
|
+
const d = o.map((u) => new T(u));
|
|
1917
1917
|
return p(n, {
|
|
1918
|
-
code:
|
|
1919
|
-
unionErrors:
|
|
1918
|
+
code: c.invalid_union,
|
|
1919
|
+
unionErrors: d
|
|
1920
1920
|
}), g;
|
|
1921
1921
|
}
|
|
1922
1922
|
}
|
|
@@ -1929,13 +1929,13 @@ ae.create = (t, e) => new ae({
|
|
|
1929
1929
|
typeName: _.ZodUnion,
|
|
1930
1930
|
...y(e)
|
|
1931
1931
|
});
|
|
1932
|
-
const Z = (t) => t instanceof
|
|
1932
|
+
const Z = (t) => t instanceof de ? Z(t.schema) : t instanceof O ? Z(t.innerType()) : t instanceof ce ? [t.value] : t instanceof U ? t.options : t instanceof le ? b.objectValues(t.enum) : t instanceof ue ? Z(t._def.innerType) : t instanceof re ? [void 0] : t instanceof se ? [null] : t instanceof j ? [void 0, ...Z(t.unwrap())] : t instanceof D ? [null, ...Z(t.unwrap())] : t instanceof Pe || t instanceof he ? Z(t.unwrap()) : t instanceof pe ? Z(t._def.innerType) : [];
|
|
1933
1933
|
class xe extends v {
|
|
1934
1934
|
_parse(e) {
|
|
1935
1935
|
const { ctx: n } = this._processInputParams(e);
|
|
1936
1936
|
if (n.parsedType !== h.object)
|
|
1937
1937
|
return p(n, {
|
|
1938
|
-
code:
|
|
1938
|
+
code: c.invalid_type,
|
|
1939
1939
|
expected: h.object,
|
|
1940
1940
|
received: n.parsedType
|
|
1941
1941
|
}), g;
|
|
@@ -1949,7 +1949,7 @@ class xe extends v {
|
|
|
1949
1949
|
path: n.path,
|
|
1950
1950
|
parent: n
|
|
1951
1951
|
}) : (p(n, {
|
|
1952
|
-
code:
|
|
1952
|
+
code: c.invalid_union_discriminator,
|
|
1953
1953
|
options: Array.from(this.optionsMap.keys()),
|
|
1954
1954
|
path: [s]
|
|
1955
1955
|
}), g);
|
|
@@ -1977,10 +1977,10 @@ class xe extends v {
|
|
|
1977
1977
|
const o = Z(i.shape[e]);
|
|
1978
1978
|
if (!o.length)
|
|
1979
1979
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
1980
|
-
for (const
|
|
1981
|
-
if (a.has(
|
|
1982
|
-
throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(
|
|
1983
|
-
a.set(
|
|
1980
|
+
for (const d of o) {
|
|
1981
|
+
if (a.has(d))
|
|
1982
|
+
throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);
|
|
1983
|
+
a.set(d, i);
|
|
1984
1984
|
}
|
|
1985
1985
|
}
|
|
1986
1986
|
return new xe({
|
|
@@ -1997,12 +1997,12 @@ function Ae(t, e) {
|
|
|
1997
1997
|
if (t === e)
|
|
1998
1998
|
return { valid: !0, data: t };
|
|
1999
1999
|
if (n === h.object && s === h.object) {
|
|
2000
|
-
const a = b.objectKeys(e), i = b.objectKeys(t).filter((
|
|
2001
|
-
for (const
|
|
2002
|
-
const u = Ae(t[
|
|
2000
|
+
const a = b.objectKeys(e), i = b.objectKeys(t).filter((d) => a.indexOf(d) !== -1), o = { ...t, ...e };
|
|
2001
|
+
for (const d of i) {
|
|
2002
|
+
const u = Ae(t[d], e[d]);
|
|
2003
2003
|
if (!u.valid)
|
|
2004
2004
|
return { valid: !1 };
|
|
2005
|
-
o[
|
|
2005
|
+
o[d] = u.data;
|
|
2006
2006
|
}
|
|
2007
2007
|
return { valid: !0, data: o };
|
|
2008
2008
|
} else if (n === h.array && s === h.array) {
|
|
@@ -2010,7 +2010,7 @@ function Ae(t, e) {
|
|
|
2010
2010
|
return { valid: !1 };
|
|
2011
2011
|
const a = [];
|
|
2012
2012
|
for (let i = 0; i < t.length; i++) {
|
|
2013
|
-
const o = t[i],
|
|
2013
|
+
const o = t[i], d = e[i], u = Ae(o, d);
|
|
2014
2014
|
if (!u.valid)
|
|
2015
2015
|
return { valid: !1 };
|
|
2016
2016
|
a.push(u.data);
|
|
@@ -2023,9 +2023,9 @@ class ie extends v {
|
|
|
2023
2023
|
const { status: n, ctx: s } = this._processInputParams(e), a = (i, o) => {
|
|
2024
2024
|
if (Ze(i) || Ze(o))
|
|
2025
2025
|
return g;
|
|
2026
|
-
const
|
|
2027
|
-
return
|
|
2028
|
-
code:
|
|
2026
|
+
const d = Ae(i.value, o.value);
|
|
2027
|
+
return d.valid ? ((Re(i) || Re(o)) && n.dirty(), { status: n.value, value: d.data }) : (p(s, {
|
|
2028
|
+
code: c.invalid_intersection_types
|
|
2029
2029
|
}), g);
|
|
2030
2030
|
};
|
|
2031
2031
|
return s.common.async ? Promise.all([
|
|
@@ -2061,28 +2061,28 @@ class N extends v {
|
|
|
2061
2061
|
const { status: n, ctx: s } = this._processInputParams(e);
|
|
2062
2062
|
if (s.parsedType !== h.array)
|
|
2063
2063
|
return p(s, {
|
|
2064
|
-
code:
|
|
2064
|
+
code: c.invalid_type,
|
|
2065
2065
|
expected: h.array,
|
|
2066
2066
|
received: s.parsedType
|
|
2067
2067
|
}), g;
|
|
2068
2068
|
if (s.data.length < this._def.items.length)
|
|
2069
2069
|
return p(s, {
|
|
2070
|
-
code:
|
|
2070
|
+
code: c.too_small,
|
|
2071
2071
|
minimum: this._def.items.length,
|
|
2072
2072
|
inclusive: !0,
|
|
2073
2073
|
exact: !1,
|
|
2074
2074
|
type: "array"
|
|
2075
2075
|
}), g;
|
|
2076
2076
|
!this._def.rest && s.data.length > this._def.items.length && (p(s, {
|
|
2077
|
-
code:
|
|
2077
|
+
code: c.too_big,
|
|
2078
2078
|
maximum: this._def.items.length,
|
|
2079
2079
|
inclusive: !0,
|
|
2080
2080
|
exact: !1,
|
|
2081
2081
|
type: "array"
|
|
2082
2082
|
}), n.dirty());
|
|
2083
|
-
const i = [...s.data].map((o,
|
|
2084
|
-
const u = this._def.items[
|
|
2085
|
-
return u ? u._parse(new I(s, o, s.path,
|
|
2083
|
+
const i = [...s.data].map((o, d) => {
|
|
2084
|
+
const u = this._def.items[d] || this._def.rest;
|
|
2085
|
+
return u ? u._parse(new I(s, o, s.path, d)) : null;
|
|
2086
2086
|
}).filter((o) => !!o);
|
|
2087
2087
|
return s.common.async ? Promise.all(i).then((o) => w.mergeArray(n, o)) : w.mergeArray(n, i);
|
|
2088
2088
|
}
|
|
@@ -2117,16 +2117,16 @@ class oe extends v {
|
|
|
2117
2117
|
const { status: n, ctx: s } = this._processInputParams(e);
|
|
2118
2118
|
if (s.parsedType !== h.object)
|
|
2119
2119
|
return p(s, {
|
|
2120
|
-
code:
|
|
2120
|
+
code: c.invalid_type,
|
|
2121
2121
|
expected: h.object,
|
|
2122
2122
|
received: s.parsedType
|
|
2123
2123
|
}), g;
|
|
2124
2124
|
const a = [], i = this._def.keyType, o = this._def.valueType;
|
|
2125
|
-
for (const
|
|
2125
|
+
for (const d in s.data)
|
|
2126
2126
|
a.push({
|
|
2127
|
-
key: i._parse(new I(s,
|
|
2128
|
-
value: o._parse(new I(s, s.data[
|
|
2129
|
-
alwaysSet:
|
|
2127
|
+
key: i._parse(new I(s, d, s.path, d)),
|
|
2128
|
+
value: o._parse(new I(s, s.data[d], s.path, d)),
|
|
2129
|
+
alwaysSet: d in s.data
|
|
2130
2130
|
});
|
|
2131
2131
|
return s.common.async ? w.mergeObjectAsync(n, a) : w.mergeObjectSync(n, a);
|
|
2132
2132
|
}
|
|
@@ -2158,34 +2158,34 @@ class be extends v {
|
|
|
2158
2158
|
const { status: n, ctx: s } = this._processInputParams(e);
|
|
2159
2159
|
if (s.parsedType !== h.map)
|
|
2160
2160
|
return p(s, {
|
|
2161
|
-
code:
|
|
2161
|
+
code: c.invalid_type,
|
|
2162
2162
|
expected: h.map,
|
|
2163
2163
|
received: s.parsedType
|
|
2164
2164
|
}), g;
|
|
2165
|
-
const a = this._def.keyType, i = this._def.valueType, o = [...s.data.entries()].map(([
|
|
2166
|
-
key: a._parse(new I(s,
|
|
2165
|
+
const a = this._def.keyType, i = this._def.valueType, o = [...s.data.entries()].map(([d, u], l) => ({
|
|
2166
|
+
key: a._parse(new I(s, d, s.path, [l, "key"])),
|
|
2167
2167
|
value: i._parse(new I(s, u, s.path, [l, "value"]))
|
|
2168
2168
|
}));
|
|
2169
2169
|
if (s.common.async) {
|
|
2170
|
-
const
|
|
2170
|
+
const d = /* @__PURE__ */ new Map();
|
|
2171
2171
|
return Promise.resolve().then(async () => {
|
|
2172
2172
|
for (const u of o) {
|
|
2173
2173
|
const l = await u.key, m = await u.value;
|
|
2174
2174
|
if (l.status === "aborted" || m.status === "aborted")
|
|
2175
2175
|
return g;
|
|
2176
|
-
(l.status === "dirty" || m.status === "dirty") && n.dirty(),
|
|
2176
|
+
(l.status === "dirty" || m.status === "dirty") && n.dirty(), d.set(l.value, m.value);
|
|
2177
2177
|
}
|
|
2178
|
-
return { status: n.value, value:
|
|
2178
|
+
return { status: n.value, value: d };
|
|
2179
2179
|
});
|
|
2180
2180
|
} else {
|
|
2181
|
-
const
|
|
2181
|
+
const d = /* @__PURE__ */ new Map();
|
|
2182
2182
|
for (const u of o) {
|
|
2183
2183
|
const l = u.key, m = u.value;
|
|
2184
2184
|
if (l.status === "aborted" || m.status === "aborted")
|
|
2185
2185
|
return g;
|
|
2186
|
-
(l.status === "dirty" || m.status === "dirty") && n.dirty(),
|
|
2186
|
+
(l.status === "dirty" || m.status === "dirty") && n.dirty(), d.set(l.value, m.value);
|
|
2187
2187
|
}
|
|
2188
|
-
return { status: n.value, value:
|
|
2188
|
+
return { status: n.value, value: d };
|
|
2189
2189
|
}
|
|
2190
2190
|
}
|
|
2191
2191
|
}
|
|
@@ -2200,20 +2200,20 @@ class L extends v {
|
|
|
2200
2200
|
const { status: n, ctx: s } = this._processInputParams(e);
|
|
2201
2201
|
if (s.parsedType !== h.set)
|
|
2202
2202
|
return p(s, {
|
|
2203
|
-
code:
|
|
2203
|
+
code: c.invalid_type,
|
|
2204
2204
|
expected: h.set,
|
|
2205
2205
|
received: s.parsedType
|
|
2206
2206
|
}), g;
|
|
2207
2207
|
const a = this._def;
|
|
2208
2208
|
a.minSize !== null && s.data.size < a.minSize.value && (p(s, {
|
|
2209
|
-
code:
|
|
2209
|
+
code: c.too_small,
|
|
2210
2210
|
minimum: a.minSize.value,
|
|
2211
2211
|
type: "set",
|
|
2212
2212
|
inclusive: !0,
|
|
2213
2213
|
exact: !1,
|
|
2214
2214
|
message: a.minSize.message
|
|
2215
2215
|
}), n.dirty()), a.maxSize !== null && s.data.size > a.maxSize.value && (p(s, {
|
|
2216
|
-
code:
|
|
2216
|
+
code: c.too_big,
|
|
2217
2217
|
maximum: a.maxSize.value,
|
|
2218
2218
|
type: "set",
|
|
2219
2219
|
inclusive: !0,
|
|
@@ -2230,8 +2230,8 @@ class L extends v {
|
|
|
2230
2230
|
}
|
|
2231
2231
|
return { status: n.value, value: l };
|
|
2232
2232
|
}
|
|
2233
|
-
const
|
|
2234
|
-
return s.common.async ? Promise.all(
|
|
2233
|
+
const d = [...s.data.values()].map((u, l) => i._parse(new I(s, u, s.path, l)));
|
|
2234
|
+
return s.common.async ? Promise.all(d).then((u) => o(u)) : o(d);
|
|
2235
2235
|
}
|
|
2236
2236
|
min(e, n) {
|
|
2237
2237
|
return new L({
|
|
@@ -2267,13 +2267,13 @@ class G extends v {
|
|
|
2267
2267
|
const { ctx: n } = this._processInputParams(e);
|
|
2268
2268
|
if (n.parsedType !== h.function)
|
|
2269
2269
|
return p(n, {
|
|
2270
|
-
code:
|
|
2270
|
+
code: c.invalid_type,
|
|
2271
2271
|
expected: h.function,
|
|
2272
2272
|
received: n.parsedType
|
|
2273
2273
|
}), g;
|
|
2274
|
-
function s(
|
|
2274
|
+
function s(d, u) {
|
|
2275
2275
|
return _e({
|
|
2276
|
-
data:
|
|
2276
|
+
data: d,
|
|
2277
2277
|
path: n.path,
|
|
2278
2278
|
errorMaps: [
|
|
2279
2279
|
n.common.contextualErrorMap,
|
|
@@ -2282,14 +2282,14 @@ class G extends v {
|
|
|
2282
2282
|
F
|
|
2283
2283
|
].filter((l) => !!l),
|
|
2284
2284
|
issueData: {
|
|
2285
|
-
code:
|
|
2285
|
+
code: c.invalid_arguments,
|
|
2286
2286
|
argumentsError: u
|
|
2287
2287
|
}
|
|
2288
2288
|
});
|
|
2289
2289
|
}
|
|
2290
|
-
function a(
|
|
2290
|
+
function a(d, u) {
|
|
2291
2291
|
return _e({
|
|
2292
|
-
data:
|
|
2292
|
+
data: d,
|
|
2293
2293
|
path: n.path,
|
|
2294
2294
|
errorMaps: [
|
|
2295
2295
|
n.common.contextualErrorMap,
|
|
@@ -2298,29 +2298,29 @@ class G extends v {
|
|
|
2298
2298
|
F
|
|
2299
2299
|
].filter((l) => !!l),
|
|
2300
2300
|
issueData: {
|
|
2301
|
-
code:
|
|
2301
|
+
code: c.invalid_return_type,
|
|
2302
2302
|
returnTypeError: u
|
|
2303
2303
|
}
|
|
2304
2304
|
});
|
|
2305
2305
|
}
|
|
2306
2306
|
const i = { errorMap: n.common.contextualErrorMap }, o = n.data;
|
|
2307
2307
|
if (this._def.returns instanceof K) {
|
|
2308
|
-
const
|
|
2308
|
+
const d = this;
|
|
2309
2309
|
return S(async function(...u) {
|
|
2310
|
-
const l = new T([]), m = await
|
|
2310
|
+
const l = new T([]), m = await d._def.args.parseAsync(u, i).catch((B) => {
|
|
2311
2311
|
throw l.addIssue(s(u, B)), l;
|
|
2312
2312
|
}), x = await Reflect.apply(o, this, m);
|
|
2313
|
-
return await
|
|
2313
|
+
return await d._def.returns._def.type.parseAsync(x, i).catch((B) => {
|
|
2314
2314
|
throw l.addIssue(a(x, B)), l;
|
|
2315
2315
|
});
|
|
2316
2316
|
});
|
|
2317
2317
|
} else {
|
|
2318
|
-
const
|
|
2318
|
+
const d = this;
|
|
2319
2319
|
return S(function(...u) {
|
|
2320
|
-
const l =
|
|
2320
|
+
const l = d._def.args.safeParse(u, i);
|
|
2321
2321
|
if (!l.success)
|
|
2322
2322
|
throw new T([s(u, l.error)]);
|
|
2323
|
-
const m = Reflect.apply(o, this, l.data), x =
|
|
2323
|
+
const m = Reflect.apply(o, this, l.data), x = d._def.returns.safeParse(m, i);
|
|
2324
2324
|
if (!x.success)
|
|
2325
2325
|
throw new T([a(m, x.error)]);
|
|
2326
2326
|
return x.data;
|
|
@@ -2360,7 +2360,7 @@ class G extends v {
|
|
|
2360
2360
|
});
|
|
2361
2361
|
}
|
|
2362
2362
|
}
|
|
2363
|
-
class
|
|
2363
|
+
class de extends v {
|
|
2364
2364
|
get schema() {
|
|
2365
2365
|
return this._def.getter();
|
|
2366
2366
|
}
|
|
@@ -2369,18 +2369,18 @@ class ce extends v {
|
|
|
2369
2369
|
return this._def.getter()._parse({ data: n.data, path: n.path, parent: n });
|
|
2370
2370
|
}
|
|
2371
2371
|
}
|
|
2372
|
-
|
|
2372
|
+
de.create = (t, e) => new de({
|
|
2373
2373
|
getter: t,
|
|
2374
2374
|
typeName: _.ZodLazy,
|
|
2375
2375
|
...y(e)
|
|
2376
2376
|
});
|
|
2377
|
-
class
|
|
2377
|
+
class ce extends v {
|
|
2378
2378
|
_parse(e) {
|
|
2379
2379
|
if (e.data !== this._def.value) {
|
|
2380
2380
|
const n = this._getOrReturnCtx(e);
|
|
2381
2381
|
return p(n, {
|
|
2382
2382
|
received: n.data,
|
|
2383
|
-
code:
|
|
2383
|
+
code: c.invalid_literal,
|
|
2384
2384
|
expected: this._def.value
|
|
2385
2385
|
}), g;
|
|
2386
2386
|
}
|
|
@@ -2390,19 +2390,19 @@ class de extends v {
|
|
|
2390
2390
|
return this._def.value;
|
|
2391
2391
|
}
|
|
2392
2392
|
}
|
|
2393
|
-
|
|
2393
|
+
ce.create = (t, e) => new ce({
|
|
2394
2394
|
value: t,
|
|
2395
2395
|
typeName: _.ZodLiteral,
|
|
2396
2396
|
...y(e)
|
|
2397
2397
|
});
|
|
2398
2398
|
function Ye(t, e) {
|
|
2399
|
-
return new
|
|
2399
|
+
return new U({
|
|
2400
2400
|
values: t,
|
|
2401
2401
|
typeName: _.ZodEnum,
|
|
2402
2402
|
...y(e)
|
|
2403
2403
|
});
|
|
2404
2404
|
}
|
|
2405
|
-
class
|
|
2405
|
+
class U extends v {
|
|
2406
2406
|
constructor() {
|
|
2407
2407
|
super(...arguments), Q.set(this, void 0);
|
|
2408
2408
|
}
|
|
@@ -2412,14 +2412,14 @@ class D extends v {
|
|
|
2412
2412
|
return p(n, {
|
|
2413
2413
|
expected: b.joinValues(s),
|
|
2414
2414
|
received: n.parsedType,
|
|
2415
|
-
code:
|
|
2415
|
+
code: c.invalid_type
|
|
2416
2416
|
}), g;
|
|
2417
2417
|
}
|
|
2418
2418
|
if (ge(this, Q) || He(this, Q, new Set(this._def.values)), !ge(this, Q).has(e.data)) {
|
|
2419
2419
|
const n = this._getOrReturnCtx(e), s = this._def.values;
|
|
2420
2420
|
return p(n, {
|
|
2421
2421
|
received: n.data,
|
|
2422
|
-
code:
|
|
2422
|
+
code: c.invalid_enum_value,
|
|
2423
2423
|
options: s
|
|
2424
2424
|
}), g;
|
|
2425
2425
|
}
|
|
@@ -2447,20 +2447,20 @@ class D extends v {
|
|
|
2447
2447
|
return e;
|
|
2448
2448
|
}
|
|
2449
2449
|
extract(e, n = this._def) {
|
|
2450
|
-
return
|
|
2450
|
+
return U.create(e, {
|
|
2451
2451
|
...this._def,
|
|
2452
2452
|
...n
|
|
2453
2453
|
});
|
|
2454
2454
|
}
|
|
2455
2455
|
exclude(e, n = this._def) {
|
|
2456
|
-
return
|
|
2456
|
+
return U.create(this.options.filter((s) => !e.includes(s)), {
|
|
2457
2457
|
...this._def,
|
|
2458
2458
|
...n
|
|
2459
2459
|
});
|
|
2460
2460
|
}
|
|
2461
2461
|
}
|
|
2462
2462
|
Q = /* @__PURE__ */ new WeakMap();
|
|
2463
|
-
|
|
2463
|
+
U.create = Ye;
|
|
2464
2464
|
class le extends v {
|
|
2465
2465
|
constructor() {
|
|
2466
2466
|
super(...arguments), X.set(this, void 0);
|
|
@@ -2472,14 +2472,14 @@ class le extends v {
|
|
|
2472
2472
|
return p(s, {
|
|
2473
2473
|
expected: b.joinValues(a),
|
|
2474
2474
|
received: s.parsedType,
|
|
2475
|
-
code:
|
|
2475
|
+
code: c.invalid_type
|
|
2476
2476
|
}), g;
|
|
2477
2477
|
}
|
|
2478
2478
|
if (ge(this, X) || He(this, X, new Set(b.getValidEnumValues(this._def.values))), !ge(this, X).has(e.data)) {
|
|
2479
2479
|
const a = b.objectValues(n);
|
|
2480
2480
|
return p(s, {
|
|
2481
2481
|
received: s.data,
|
|
2482
|
-
code:
|
|
2482
|
+
code: c.invalid_enum_value,
|
|
2483
2483
|
options: a
|
|
2484
2484
|
}), g;
|
|
2485
2485
|
}
|
|
@@ -2503,7 +2503,7 @@ class K extends v {
|
|
|
2503
2503
|
const { ctx: n } = this._processInputParams(e);
|
|
2504
2504
|
if (n.parsedType !== h.promise && n.common.async === !1)
|
|
2505
2505
|
return p(n, {
|
|
2506
|
-
code:
|
|
2506
|
+
code: c.invalid_type,
|
|
2507
2507
|
expected: h.promise,
|
|
2508
2508
|
received: n.parsedType
|
|
2509
2509
|
}), g;
|
|
@@ -2538,11 +2538,11 @@ class O extends v {
|
|
|
2538
2538
|
if (i.addIssue = i.addIssue.bind(i), a.type === "preprocess") {
|
|
2539
2539
|
const o = a.transform(s.data, i);
|
|
2540
2540
|
if (s.common.async)
|
|
2541
|
-
return Promise.resolve(o).then(async (
|
|
2541
|
+
return Promise.resolve(o).then(async (d) => {
|
|
2542
2542
|
if (n.value === "aborted")
|
|
2543
2543
|
return g;
|
|
2544
2544
|
const u = await this._def.schema._parseAsync({
|
|
2545
|
-
data:
|
|
2545
|
+
data: d,
|
|
2546
2546
|
path: s.path,
|
|
2547
2547
|
parent: s
|
|
2548
2548
|
});
|
|
@@ -2551,32 +2551,32 @@ class O extends v {
|
|
|
2551
2551
|
{
|
|
2552
2552
|
if (n.value === "aborted")
|
|
2553
2553
|
return g;
|
|
2554
|
-
const
|
|
2554
|
+
const d = this._def.schema._parseSync({
|
|
2555
2555
|
data: o,
|
|
2556
2556
|
path: s.path,
|
|
2557
2557
|
parent: s
|
|
2558
2558
|
});
|
|
2559
|
-
return
|
|
2559
|
+
return d.status === "aborted" ? g : d.status === "dirty" || n.value === "dirty" ? q(d.value) : d;
|
|
2560
2560
|
}
|
|
2561
2561
|
}
|
|
2562
2562
|
if (a.type === "refinement") {
|
|
2563
|
-
const o = (
|
|
2564
|
-
const u = a.refinement(
|
|
2563
|
+
const o = (d) => {
|
|
2564
|
+
const u = a.refinement(d, i);
|
|
2565
2565
|
if (s.common.async)
|
|
2566
2566
|
return Promise.resolve(u);
|
|
2567
2567
|
if (u instanceof Promise)
|
|
2568
2568
|
throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2569
|
-
return
|
|
2569
|
+
return d;
|
|
2570
2570
|
};
|
|
2571
2571
|
if (s.common.async === !1) {
|
|
2572
|
-
const
|
|
2572
|
+
const d = this._def.schema._parseSync({
|
|
2573
2573
|
data: s.data,
|
|
2574
2574
|
path: s.path,
|
|
2575
2575
|
parent: s
|
|
2576
2576
|
});
|
|
2577
|
-
return
|
|
2577
|
+
return d.status === "aborted" ? g : (d.status === "dirty" && n.dirty(), o(d.value), { status: n.value, value: d.value });
|
|
2578
2578
|
} else
|
|
2579
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((
|
|
2579
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((d) => d.status === "aborted" ? g : (d.status === "dirty" && n.dirty(), o(d.value).then(() => ({ status: n.value, value: d.value }))));
|
|
2580
2580
|
}
|
|
2581
2581
|
if (a.type === "transform")
|
|
2582
2582
|
if (s.common.async === !1) {
|
|
@@ -2587,12 +2587,12 @@ class O extends v {
|
|
|
2587
2587
|
});
|
|
2588
2588
|
if (!ee(o))
|
|
2589
2589
|
return o;
|
|
2590
|
-
const
|
|
2591
|
-
if (
|
|
2590
|
+
const d = a.transform(o.value, i);
|
|
2591
|
+
if (d instanceof Promise)
|
|
2592
2592
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2593
|
-
return { status: n.value, value:
|
|
2593
|
+
return { status: n.value, value: d };
|
|
2594
2594
|
} else
|
|
2595
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => ee(o) ? Promise.resolve(a.transform(o.value, i)).then((
|
|
2595
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => ee(o) ? Promise.resolve(a.transform(o.value, i)).then((d) => ({ status: n.value, value: d })) : o);
|
|
2596
2596
|
b.assertNever(a);
|
|
2597
2597
|
}
|
|
2598
2598
|
}
|
|
@@ -2621,7 +2621,7 @@ j.create = (t, e) => new j({
|
|
|
2621
2621
|
typeName: _.ZodOptional,
|
|
2622
2622
|
...y(e)
|
|
2623
2623
|
});
|
|
2624
|
-
class
|
|
2624
|
+
class D extends v {
|
|
2625
2625
|
_parse(e) {
|
|
2626
2626
|
return this._getType(e) === h.null ? S(null) : this._def.innerType._parse(e);
|
|
2627
2627
|
}
|
|
@@ -2629,7 +2629,7 @@ class U extends v {
|
|
|
2629
2629
|
return this._def.innerType;
|
|
2630
2630
|
}
|
|
2631
2631
|
}
|
|
2632
|
-
|
|
2632
|
+
D.create = (t, e) => new D({
|
|
2633
2633
|
innerType: t,
|
|
2634
2634
|
typeName: _.ZodNullable,
|
|
2635
2635
|
...y(e)
|
|
@@ -2702,7 +2702,7 @@ class ke extends v {
|
|
|
2702
2702
|
if (this._getType(e) !== h.nan) {
|
|
2703
2703
|
const s = this._getOrReturnCtx(e);
|
|
2704
2704
|
return p(s, {
|
|
2705
|
-
code:
|
|
2705
|
+
code: c.invalid_type,
|
|
2706
2706
|
expected: h.nan,
|
|
2707
2707
|
received: s.parsedType
|
|
2708
2708
|
}), g;
|
|
@@ -2786,7 +2786,7 @@ function Ke(t, e = {}, n) {
|
|
|
2786
2786
|
return t ? Y.create().superRefine((s, a) => {
|
|
2787
2787
|
var i, o;
|
|
2788
2788
|
if (!t(s)) {
|
|
2789
|
-
const
|
|
2789
|
+
const d = typeof e == "function" ? e(s) : typeof e == "string" ? { message: e } : e, u = (o = (i = d.fatal) !== null && i !== void 0 ? i : n) !== null && o !== void 0 ? o : !0, l = typeof d == "string" ? { message: d } : d;
|
|
2790
2790
|
a.addIssue({ code: "custom", ...l, fatal: u });
|
|
2791
2791
|
}
|
|
2792
2792
|
}) : Y.create();
|
|
@@ -2800,7 +2800,7 @@ var _;
|
|
|
2800
2800
|
})(_ || (_ = {}));
|
|
2801
2801
|
const Nt = (t, e = {
|
|
2802
2802
|
message: `Input not instance of ${t.name}`
|
|
2803
|
-
}) => Ke((n) => n instanceof t, e), Je = E.create, Qe = P.create, Zt = ke.create, Rt = M.create, Xe = ne.create, At = V.create, Pt = ye.create, Mt = re.create,
|
|
2803
|
+
}) => Ke((n) => n instanceof t, e), Je = E.create, Qe = P.create, Zt = ke.create, Rt = M.create, Xe = ne.create, At = V.create, Pt = ye.create, Mt = re.create, Ut = se.create, Dt = Y.create, $t = $.create, Vt = R.create, Lt = ve.create, zt = C.create, Bt = k.create, Wt = k.strictCreate, Ht = ae.create, qt = xe.create, Gt = ie.create, Ft = N.create, Yt = oe.create, Kt = be.create, Jt = L.create, Qt = G.create, Xt = de.create, en = ce.create, tn = U.create, nn = le.create, rn = K.create, Be = O.create, sn = j.create, an = D.create, on = O.createWithPreprocess, dn = fe.create, cn = () => Je().optional(), ln = () => Qe().optional(), un = () => Xe().optional(), pn = {
|
|
2804
2804
|
string: (t) => E.create({ ...t, coerce: !0 }),
|
|
2805
2805
|
number: (t) => P.create({ ...t, coerce: !0 }),
|
|
2806
2806
|
boolean: (t) => ne.create({
|
|
@@ -2858,15 +2858,15 @@ var r = /* @__PURE__ */ Object.freeze({
|
|
|
2858
2858
|
ZodMap: be,
|
|
2859
2859
|
ZodSet: L,
|
|
2860
2860
|
ZodFunction: G,
|
|
2861
|
-
ZodLazy:
|
|
2862
|
-
ZodLiteral:
|
|
2863
|
-
ZodEnum:
|
|
2861
|
+
ZodLazy: de,
|
|
2862
|
+
ZodLiteral: ce,
|
|
2863
|
+
ZodEnum: U,
|
|
2864
2864
|
ZodNativeEnum: le,
|
|
2865
2865
|
ZodPromise: K,
|
|
2866
2866
|
ZodEffects: O,
|
|
2867
2867
|
ZodTransformer: O,
|
|
2868
2868
|
ZodOptional: j,
|
|
2869
|
-
ZodNullable:
|
|
2869
|
+
ZodNullable: D,
|
|
2870
2870
|
ZodDefault: ue,
|
|
2871
2871
|
ZodCatch: pe,
|
|
2872
2872
|
ZodNaN: ke,
|
|
@@ -2882,7 +2882,7 @@ var r = /* @__PURE__ */ Object.freeze({
|
|
|
2882
2882
|
return _;
|
|
2883
2883
|
},
|
|
2884
2884
|
coerce: pn,
|
|
2885
|
-
any:
|
|
2885
|
+
any: Dt,
|
|
2886
2886
|
array: zt,
|
|
2887
2887
|
bigint: Rt,
|
|
2888
2888
|
boolean: Xe,
|
|
@@ -2899,15 +2899,15 @@ var r = /* @__PURE__ */ Object.freeze({
|
|
|
2899
2899
|
nan: Zt,
|
|
2900
2900
|
nativeEnum: nn,
|
|
2901
2901
|
never: Vt,
|
|
2902
|
-
null:
|
|
2902
|
+
null: Ut,
|
|
2903
2903
|
nullable: an,
|
|
2904
2904
|
number: Qe,
|
|
2905
2905
|
object: Bt,
|
|
2906
2906
|
oboolean: un,
|
|
2907
2907
|
onumber: ln,
|
|
2908
2908
|
optional: sn,
|
|
2909
|
-
ostring:
|
|
2910
|
-
pipeline:
|
|
2909
|
+
ostring: cn,
|
|
2910
|
+
pipeline: dn,
|
|
2911
2911
|
preprocess: on,
|
|
2912
2912
|
promise: rn,
|
|
2913
2913
|
record: Yt,
|
|
@@ -2922,12 +2922,12 @@ var r = /* @__PURE__ */ Object.freeze({
|
|
|
2922
2922
|
unknown: $t,
|
|
2923
2923
|
void: Lt,
|
|
2924
2924
|
NEVER: hn,
|
|
2925
|
-
ZodIssueCode:
|
|
2925
|
+
ZodIssueCode: c,
|
|
2926
2926
|
quotelessJson: ut,
|
|
2927
2927
|
ZodError: T
|
|
2928
2928
|
});
|
|
2929
2929
|
lt(r);
|
|
2930
|
-
const
|
|
2930
|
+
const qn = r.object({
|
|
2931
2931
|
start: r.number(),
|
|
2932
2932
|
limit: r.number(),
|
|
2933
2933
|
length: r.number()
|
|
@@ -2979,14 +2979,21 @@ const Wn = r.object({
|
|
|
2979
2979
|
is_social: r.boolean(),
|
|
2980
2980
|
login_count: r.number(),
|
|
2981
2981
|
identities: r.array(mn).optional()
|
|
2982
|
-
}),
|
|
2982
|
+
}), Gn = gn, Fn = et.extend({
|
|
2983
2983
|
email: r.string(),
|
|
2984
2984
|
login_count: r.number(),
|
|
2985
2985
|
multifactor: r.array(r.string()).optional(),
|
|
2986
2986
|
last_ip: r.string().optional(),
|
|
2987
2987
|
last_login: r.string().optional(),
|
|
2988
2988
|
user_id: r.string()
|
|
2989
|
-
}).catchall(r.any()), yn =
|
|
2989
|
+
}).catchall(r.any()), yn = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
2990
|
+
let vn = (t = 21) => {
|
|
2991
|
+
let e = "", n = crypto.getRandomValues(new Uint8Array(t));
|
|
2992
|
+
for (; t--; )
|
|
2993
|
+
e += yn[n[t] & 63];
|
|
2994
|
+
return e;
|
|
2995
|
+
};
|
|
2996
|
+
const bn = r.object({
|
|
2990
2997
|
audience: r.string().optional(),
|
|
2991
2998
|
recipient: r.string().optional(),
|
|
2992
2999
|
createUpnClaim: r.boolean().optional(),
|
|
@@ -3003,43 +3010,43 @@ const Wn = r.object({
|
|
|
3003
3010
|
nameIdentifierProbes: r.array(r.string()).optional(),
|
|
3004
3011
|
authnContextClassRef: r.string().optional(),
|
|
3005
3012
|
mappings: r.record(r.string()).optional()
|
|
3006
|
-
}),
|
|
3013
|
+
}), kn = r.object({
|
|
3007
3014
|
id: r.string(),
|
|
3008
3015
|
name: r.string(),
|
|
3009
3016
|
callbacks: r.array(r.string()).openapi({
|
|
3010
3017
|
description: "Comma-separated list of URLs whitelisted to use as a callback to the client after authentication."
|
|
3011
|
-
}),
|
|
3018
|
+
}).default([]),
|
|
3012
3019
|
allowed_origins: r.array(r.string()).openapi({
|
|
3013
3020
|
description: "Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level. Query strings and hash information are not taken into account when validating these URLs."
|
|
3014
|
-
}),
|
|
3021
|
+
}).default([]),
|
|
3015
3022
|
web_origins: r.array(r.string()).openapi({
|
|
3016
3023
|
description: "Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode."
|
|
3017
|
-
}),
|
|
3024
|
+
}).default([]),
|
|
3018
3025
|
allowed_logout_urls: r.array(r.string()).openapi({
|
|
3019
3026
|
description: "Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains."
|
|
3020
|
-
}),
|
|
3027
|
+
}).default([]),
|
|
3021
3028
|
allowed_clients: r.array(r.string()).openapi({
|
|
3022
3029
|
description: "Ids of clients that will be allowed to perform delegation requests. Clients that will be allowed to make delegation request. By default, all your clients will be allowed. This field allows you to specify specific clients"
|
|
3023
|
-
}),
|
|
3030
|
+
}).default([]),
|
|
3024
3031
|
addons: r.object({
|
|
3025
|
-
samlp:
|
|
3026
|
-
}).
|
|
3032
|
+
samlp: bn.optional()
|
|
3033
|
+
}).openapi({
|
|
3027
3034
|
description: "Addons associated with the client. The key is the addon's package name and the value is an object with the configuration for the addon."
|
|
3028
|
-
}),
|
|
3035
|
+
}).default({}),
|
|
3029
3036
|
email_validation: r.enum(["enabled", "disabled", "enforced"]).default("enforced").openapi({
|
|
3030
3037
|
description: "Defines if it possible to sign in with an unverified email and if verification emails will be sent. This is not available in auth0"
|
|
3031
3038
|
}),
|
|
3032
|
-
client_secret: r.string().default(
|
|
3039
|
+
client_secret: r.string().default(() => vn()),
|
|
3033
3040
|
disable_sign_ups: r.boolean().default(!1).openapi({
|
|
3034
3041
|
description: "Prevents users from signing up using the hosted login page. This is not available in auth0"
|
|
3035
3042
|
})
|
|
3036
|
-
}),
|
|
3043
|
+
}), xn = r.object({
|
|
3037
3044
|
created_at: r.string().transform((t) => t === null ? "" : t),
|
|
3038
3045
|
updated_at: r.string().transform((t) => t === null ? "" : t),
|
|
3039
|
-
...
|
|
3046
|
+
...kn.shape
|
|
3040
3047
|
});
|
|
3041
3048
|
var tt = /* @__PURE__ */ ((t) => (t.TOKEN = "token", t.TOKEN_ID_TOKEN = "token id_token", t.CODE = "code", t))(tt || {}), nt = /* @__PURE__ */ ((t) => (t.QUERY = "query", t.FRAGMENT = "fragment", t.FORM_POST = "form_post", t.WEB_MESSAGE = "web_message", t.SAML_POST = "saml_post", t))(nt || {}), rt = /* @__PURE__ */ ((t) => (t.S265 = "S256", t.plain = "plain", t))(rt || {});
|
|
3042
|
-
const
|
|
3049
|
+
const wn = r.object({
|
|
3043
3050
|
client_id: r.string(),
|
|
3044
3051
|
vendor_id: r.string().optional(),
|
|
3045
3052
|
response_type: r.nativeEnum(tt).optional(),
|
|
@@ -3052,7 +3059,7 @@ const kn = r.object({
|
|
|
3052
3059
|
code_challenge_method: r.nativeEnum(rt).optional(),
|
|
3053
3060
|
code_challenge: r.string().optional(),
|
|
3054
3061
|
username: r.string().optional()
|
|
3055
|
-
}),
|
|
3062
|
+
}), Yn = r.object({
|
|
3056
3063
|
colors: r.object({
|
|
3057
3064
|
primary: r.string(),
|
|
3058
3065
|
page_background: r.object({
|
|
@@ -3067,10 +3074,20 @@ const kn = r.object({
|
|
|
3067
3074
|
font: r.object({
|
|
3068
3075
|
url: r.string()
|
|
3069
3076
|
}).optional()
|
|
3070
|
-
}),
|
|
3077
|
+
}), Sn = r.object({
|
|
3071
3078
|
id: r.string().optional(),
|
|
3072
3079
|
name: r.string(),
|
|
3073
|
-
strategy: r.enum([
|
|
3080
|
+
strategy: r.enum([
|
|
3081
|
+
"google-oauth2",
|
|
3082
|
+
"facebook",
|
|
3083
|
+
"vipps",
|
|
3084
|
+
"apple",
|
|
3085
|
+
"email",
|
|
3086
|
+
"Username-Password-Authentication",
|
|
3087
|
+
"oidc",
|
|
3088
|
+
"oauth2",
|
|
3089
|
+
"custom"
|
|
3090
|
+
]).optional(),
|
|
3074
3091
|
options: r.object({
|
|
3075
3092
|
kid: r.string().optional(),
|
|
3076
3093
|
team_id: r.string().optional(),
|
|
@@ -3079,7 +3096,7 @@ const kn = r.object({
|
|
|
3079
3096
|
client_secret: r.string().optional(),
|
|
3080
3097
|
app_secret: r.string().optional(),
|
|
3081
3098
|
scope: r.string().optional()
|
|
3082
|
-
}),
|
|
3099
|
+
}).optional(),
|
|
3083
3100
|
enabled_clients: r.array(r.string()).optional(),
|
|
3084
3101
|
authorization_endpoint: r.string().optional(),
|
|
3085
3102
|
response_type: r.custom().optional(),
|
|
@@ -3094,11 +3111,11 @@ const kn = r.object({
|
|
|
3094
3111
|
token_exchange_basic_auth: r.boolean().optional(),
|
|
3095
3112
|
userinfo_endpoint: r.string().optional(),
|
|
3096
3113
|
scope: r.string().optional()
|
|
3097
|
-
}),
|
|
3114
|
+
}), Tn = r.object({
|
|
3098
3115
|
id: r.string(),
|
|
3099
3116
|
created_at: r.string().transform((t) => t === null ? "" : t),
|
|
3100
3117
|
updated_at: r.string().transform((t) => t === null ? "" : t)
|
|
3101
|
-
}).extend(
|
|
3118
|
+
}).extend(Sn.shape), En = r.object({
|
|
3102
3119
|
name: r.string(),
|
|
3103
3120
|
audience: r.string(),
|
|
3104
3121
|
sender_email: r.string().email(),
|
|
@@ -3108,12 +3125,12 @@ const kn = r.object({
|
|
|
3108
3125
|
primary_color: r.string().optional(),
|
|
3109
3126
|
secondary_color: r.string().optional(),
|
|
3110
3127
|
language: r.string().optional()
|
|
3111
|
-
}),
|
|
3128
|
+
}), Cn = r.object({
|
|
3112
3129
|
created_at: r.string().transform((t) => t === null ? "" : t),
|
|
3113
3130
|
updated_at: r.string().transform((t) => t === null ? "" : t),
|
|
3114
3131
|
id: r.string(),
|
|
3115
|
-
...
|
|
3116
|
-
}),
|
|
3132
|
+
...En.shape
|
|
3133
|
+
}), Kn = r.object({
|
|
3117
3134
|
logoUrl: r.string(),
|
|
3118
3135
|
loginBackgroundImage: r.string().nullish(),
|
|
3119
3136
|
style: r.object({
|
|
@@ -3130,7 +3147,7 @@ const kn = r.object({
|
|
|
3130
3147
|
checkoutHideSocial: r.boolean().optional(),
|
|
3131
3148
|
siteUrl: r.string().nullable(),
|
|
3132
3149
|
manageSubscriptionsUrl: r.string().optional()
|
|
3133
|
-
}),
|
|
3150
|
+
}), On = r.object({
|
|
3134
3151
|
domain: r.string(),
|
|
3135
3152
|
dkim_private_key: r.string().optional(),
|
|
3136
3153
|
dkim_public_key: r.string().optional(),
|
|
@@ -3138,19 +3155,19 @@ const kn = r.object({
|
|
|
3138
3155
|
email_service: r.union([r.literal("mailgun"), r.literal("mailchannels")]).optional()
|
|
3139
3156
|
});
|
|
3140
3157
|
r.object({
|
|
3141
|
-
...
|
|
3142
|
-
domains: r.array(
|
|
3143
|
-
tenant:
|
|
3144
|
-
connections: r.array(
|
|
3158
|
+
...xn.shape,
|
|
3159
|
+
domains: r.array(On),
|
|
3160
|
+
tenant: Cn,
|
|
3161
|
+
connections: r.array(Tn)
|
|
3145
3162
|
});
|
|
3146
|
-
const
|
|
3163
|
+
const jn = r.enum([
|
|
3147
3164
|
"password_reset",
|
|
3148
3165
|
"email_verification",
|
|
3149
3166
|
"otp",
|
|
3150
3167
|
"authorization_code",
|
|
3151
3168
|
"oauth2_state",
|
|
3152
3169
|
"ticket"
|
|
3153
|
-
]),
|
|
3170
|
+
]), In = r.object({
|
|
3154
3171
|
code_id: r.string().openapi({
|
|
3155
3172
|
description: "The code that will be used in for instance an email verification flow"
|
|
3156
3173
|
}),
|
|
@@ -3160,23 +3177,23 @@ const Cn = r.enum([
|
|
|
3160
3177
|
connection_id: r.string().optional().openapi({
|
|
3161
3178
|
description: "The connection that the code is connected to"
|
|
3162
3179
|
}),
|
|
3163
|
-
code_type:
|
|
3180
|
+
code_type: jn,
|
|
3164
3181
|
expires_at: r.string(),
|
|
3165
3182
|
used_at: r.string().optional(),
|
|
3166
3183
|
user_id: r.string().optional()
|
|
3167
|
-
}),
|
|
3168
|
-
...
|
|
3184
|
+
}), Jn = r.object({
|
|
3185
|
+
...In.shape,
|
|
3169
3186
|
created_at: r.string()
|
|
3170
|
-
}),
|
|
3187
|
+
}), Nn = r.object({
|
|
3171
3188
|
domain: r.string(),
|
|
3172
3189
|
dkim_private_key: r.string().optional(),
|
|
3173
3190
|
dkim_public_key: r.string().optional(),
|
|
3174
3191
|
email_api_key: r.string().optional(),
|
|
3175
3192
|
email_service: r.enum(["mailgun", "mailchannels"])
|
|
3176
|
-
}),
|
|
3177
|
-
...
|
|
3193
|
+
}), Qn = Me.extend({
|
|
3194
|
+
...Nn.shape,
|
|
3178
3195
|
id: r.string()
|
|
3179
|
-
}),
|
|
3196
|
+
}), Zn = r.object({
|
|
3180
3197
|
trigger_id: r.enum([
|
|
3181
3198
|
"pre-user-signup",
|
|
3182
3199
|
"post-user-registration",
|
|
@@ -3187,10 +3204,10 @@ const Cn = r.enum([
|
|
|
3187
3204
|
hook_id: r.string().optional(),
|
|
3188
3205
|
synchronous: r.boolean().default(!1),
|
|
3189
3206
|
priority: r.number().optional()
|
|
3190
|
-
}),
|
|
3207
|
+
}), Xn = Zn.extend({
|
|
3191
3208
|
...Me.shape,
|
|
3192
3209
|
hook_id: r.string()
|
|
3193
|
-
}),
|
|
3210
|
+
}), Rn = r.object({
|
|
3194
3211
|
alg: r.enum([
|
|
3195
3212
|
"RS256",
|
|
3196
3213
|
"RS384",
|
|
@@ -3209,9 +3226,9 @@ const Cn = r.enum([
|
|
|
3209
3226
|
x5t: r.string().optional(),
|
|
3210
3227
|
x5c: r.array(r.string()).optional(),
|
|
3211
3228
|
use: r.enum(["sig", "enc"]).optional()
|
|
3212
|
-
}),
|
|
3213
|
-
keys: r.array(
|
|
3214
|
-
}),
|
|
3229
|
+
}), er = r.object({
|
|
3230
|
+
keys: r.array(Rn)
|
|
3231
|
+
}), tr = r.object({
|
|
3215
3232
|
issuer: r.string(),
|
|
3216
3233
|
authorization_endpoint: r.string(),
|
|
3217
3234
|
token_endpoint: r.string(),
|
|
@@ -3232,24 +3249,24 @@ const Cn = r.enum([
|
|
|
3232
3249
|
request_uri_parameter_supported: r.boolean(),
|
|
3233
3250
|
request_parameter_supported: r.boolean(),
|
|
3234
3251
|
token_endpoint_auth_signing_alg_values_supported: r.array(r.string())
|
|
3235
|
-
}),
|
|
3252
|
+
}), An = r.object({
|
|
3236
3253
|
auth0Client: r.string().optional(),
|
|
3237
|
-
authParams:
|
|
3254
|
+
authParams: wn,
|
|
3238
3255
|
expires_at: r.string(),
|
|
3239
3256
|
deleted_at: r.string().optional(),
|
|
3240
3257
|
ip: r.string().optional()
|
|
3241
3258
|
}).openapi({
|
|
3242
3259
|
description: "This represents a login sesion"
|
|
3243
|
-
}),
|
|
3244
|
-
...
|
|
3260
|
+
}), nr = r.object({
|
|
3261
|
+
...An.shape,
|
|
3245
3262
|
login_id: r.string().openapi({
|
|
3246
3263
|
description: "This is is used as the state in the universal login"
|
|
3247
3264
|
}),
|
|
3248
3265
|
created_at: r.string(),
|
|
3249
3266
|
updated_at: r.string()
|
|
3250
3267
|
});
|
|
3251
|
-
var
|
|
3252
|
-
const
|
|
3268
|
+
var Pn = /* @__PURE__ */ ((t) => (t.FAILED_SILENT_AUTH = "fsa", t.FAILED_SIGNUP = "fs", t.FAILED_LOGIN = "f", t.FAILED_LOGIN_INCORRECT_PASSWORD = "fp", t.FAILED_CHANGE_PASSWORD = "fcp", t.FAILED_BY_CONNECTOR = "fc", t.FAILED_LOGIN_INVALID_EMAIL_USERNAME = "fu", t.FAILED_HOOK = "fh", t.FAILED_CROSS_ORIGIN_AUTHENTICATION = "fcoa", t.SUCCESS_API_OPERATION = "sapi", t.SUCCESS_CHANGE_PASSWORD = "scp", t.SUCCESS_CHANGE_PASSWORD_REQUEST = "scpr", t.SUCCESS_CHANGE_USERNAME = "scu", t.SUCCESS_CROSS_ORIGIN_AUTHENTICATION = "scoa", t.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN = "seacft", t.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN = "serft", t.SUCCESS_LOGIN = "s", t.SUCCESS_LOGOUT = "slo", t.SUCCESS_SIGNUP = "ss", t.SUCCESS_SILENT_AUTH = "ssa", t.SUCCESS_VERIFICATION_EMAIL = "sv", t.SUCCESS_VERIFICATION_EMAIL_REQUEST = "svr", t.CODE_LINK_SENT = "cls", t))(Pn || {});
|
|
3269
|
+
const Mn = r.enum([
|
|
3253
3270
|
"cls",
|
|
3254
3271
|
// CODE_LINK_SENT
|
|
3255
3272
|
"fsa",
|
|
@@ -3298,14 +3315,14 @@ const An = r.enum([
|
|
|
3298
3315
|
// SUCCESS_VERIFICATION_EMAIL
|
|
3299
3316
|
"svr"
|
|
3300
3317
|
// SUCCESS_VERIFICATION_EMAIL_REQUEST
|
|
3301
|
-
]),
|
|
3318
|
+
]), Un = r.object({
|
|
3302
3319
|
name: r.string(),
|
|
3303
3320
|
version: r.string(),
|
|
3304
3321
|
env: r.object({
|
|
3305
3322
|
node: r.string().optional()
|
|
3306
3323
|
}).optional()
|
|
3307
|
-
}),
|
|
3308
|
-
type:
|
|
3324
|
+
}), rr = r.object({
|
|
3325
|
+
type: Mn,
|
|
3309
3326
|
date: r.string(),
|
|
3310
3327
|
description: r.string().optional(),
|
|
3311
3328
|
log_id: r.string().optional(),
|
|
@@ -3326,26 +3343,26 @@ const An = r.enum([
|
|
|
3326
3343
|
strategy: r.string().optional(),
|
|
3327
3344
|
strategy_type: r.string().optional(),
|
|
3328
3345
|
hostname: r.string().optional(),
|
|
3329
|
-
auth0_client:
|
|
3330
|
-
}),
|
|
3346
|
+
auth0_client: Un.optional()
|
|
3347
|
+
}), Dn = r.object({
|
|
3331
3348
|
user_id: r.string(),
|
|
3332
3349
|
password: r.string(),
|
|
3333
3350
|
algorithm: r.enum(["bcrypt", "argon2id"]).default("argon2id")
|
|
3334
|
-
}),
|
|
3335
|
-
...
|
|
3351
|
+
}), sr = r.object({
|
|
3352
|
+
...Dn.shape,
|
|
3336
3353
|
created_at: r.string(),
|
|
3337
3354
|
updated_at: r.string()
|
|
3338
|
-
}),
|
|
3355
|
+
}), $n = r.object({
|
|
3339
3356
|
session_id: r.string(),
|
|
3340
3357
|
client_id: r.string(),
|
|
3341
3358
|
expires_at: r.string(),
|
|
3342
3359
|
used_at: r.string(),
|
|
3343
3360
|
deleted_at: r.string().optional(),
|
|
3344
3361
|
user_id: r.string()
|
|
3345
|
-
}),
|
|
3362
|
+
}), ar = r.object({
|
|
3346
3363
|
created_at: r.string(),
|
|
3347
|
-
|
|
3348
|
-
}),
|
|
3364
|
+
...$n.shape
|
|
3365
|
+
}), ir = r.object({
|
|
3349
3366
|
kid: r.string().openapi({ description: "The key id of the signing key" }),
|
|
3350
3367
|
cert: r.string().openapi({ description: "The public certificate of the signing key" }),
|
|
3351
3368
|
fingerprint: r.string().openapi({ description: "The cert fingerprint" }),
|
|
@@ -3366,16 +3383,16 @@ const An = r.enum([
|
|
|
3366
3383
|
revoked_at: r.string().optional().openapi({ description: "The date and time when the key was revoked" })
|
|
3367
3384
|
});
|
|
3368
3385
|
var st = /* @__PURE__ */ ((t) => (t.RefreshToken = "refresh_token", t.AuthorizationCode = "authorization_code", t.ClientCredential = "client_credentials", t.Passwordless = "passwordless", t.Password = "password", t))(st || {});
|
|
3369
|
-
const
|
|
3370
|
-
grant_type:
|
|
3386
|
+
const Ue = r.nativeEnum(st), or = r.object({
|
|
3387
|
+
grant_type: Ue.refine(
|
|
3371
3388
|
(t) => t === "authorization_code"
|
|
3372
3389
|
/* AuthorizationCode */
|
|
3373
3390
|
),
|
|
3374
3391
|
code: r.string(),
|
|
3375
3392
|
client_secret: r.string(),
|
|
3376
3393
|
client_id: r.string()
|
|
3377
|
-
}),
|
|
3378
|
-
grant_type:
|
|
3394
|
+
}), dr = r.object({
|
|
3395
|
+
grant_type: Ue.refine(
|
|
3379
3396
|
(t) => t === "authorization_code"
|
|
3380
3397
|
/* AuthorizationCode */
|
|
3381
3398
|
),
|
|
@@ -3383,8 +3400,8 @@ const De = r.nativeEnum(st), ar = r.object({
|
|
|
3383
3400
|
code_verifier: r.string(),
|
|
3384
3401
|
client_id: r.string().optional(),
|
|
3385
3402
|
redirect_uri: r.string()
|
|
3386
|
-
}),
|
|
3387
|
-
grant_type:
|
|
3403
|
+
}), cr = r.object({
|
|
3404
|
+
grant_type: Ue.refine(
|
|
3388
3405
|
(t) => t === "client_credentials"
|
|
3389
3406
|
/* ClientCredential */
|
|
3390
3407
|
),
|
|
@@ -3406,7 +3423,7 @@ r.object({
|
|
|
3406
3423
|
code: r.string(),
|
|
3407
3424
|
state: r.string().optional()
|
|
3408
3425
|
});
|
|
3409
|
-
const
|
|
3426
|
+
const Vn = r.object({
|
|
3410
3427
|
button_border_radius: r.number(),
|
|
3411
3428
|
button_border_weight: r.number(),
|
|
3412
3429
|
buttons_style: r.enum(["pill"]),
|
|
@@ -3416,7 +3433,7 @@ const Un = r.object({
|
|
|
3416
3433
|
show_widget_shadow: r.boolean(),
|
|
3417
3434
|
widget_border_weight: r.number(),
|
|
3418
3435
|
widget_corner_radius: r.number()
|
|
3419
|
-
}),
|
|
3436
|
+
}), Ln = r.object({
|
|
3420
3437
|
base_focus_color: r.string(),
|
|
3421
3438
|
base_hover_color: r.string(),
|
|
3422
3439
|
body_text: r.string(),
|
|
@@ -3439,7 +3456,7 @@ const Un = r.object({
|
|
|
3439
3456
|
}), W = r.object({
|
|
3440
3457
|
bold: r.boolean(),
|
|
3441
3458
|
size: r.number()
|
|
3442
|
-
}),
|
|
3459
|
+
}), zn = r.object({
|
|
3443
3460
|
body_text: W,
|
|
3444
3461
|
buttons_text: W,
|
|
3445
3462
|
font_url: r.string(),
|
|
@@ -3449,91 +3466,91 @@ const Un = r.object({
|
|
|
3449
3466
|
reference_text_size: r.number(),
|
|
3450
3467
|
subtitle: W,
|
|
3451
3468
|
title: W
|
|
3452
|
-
}),
|
|
3469
|
+
}), Bn = r.object({
|
|
3453
3470
|
background_color: r.string(),
|
|
3454
3471
|
background_image_url: r.string(),
|
|
3455
3472
|
page_layout: r.enum(["center"])
|
|
3456
|
-
}),
|
|
3473
|
+
}), Wn = r.object({
|
|
3457
3474
|
header_text_alignment: r.enum(["center"]),
|
|
3458
3475
|
logo_height: r.number(),
|
|
3459
3476
|
logo_position: r.enum(["center"]),
|
|
3460
3477
|
logo_url: r.string(),
|
|
3461
3478
|
social_buttons_layout: r.enum(["bottom"])
|
|
3462
|
-
}),
|
|
3463
|
-
borders:
|
|
3464
|
-
colors:
|
|
3479
|
+
}), Hn = r.object({
|
|
3480
|
+
borders: Vn,
|
|
3481
|
+
colors: Ln,
|
|
3465
3482
|
displayName: r.string(),
|
|
3466
|
-
fonts:
|
|
3467
|
-
page_background:
|
|
3468
|
-
widget:
|
|
3469
|
-
}),
|
|
3483
|
+
fonts: zn,
|
|
3484
|
+
page_background: Bn,
|
|
3485
|
+
widget: Wn
|
|
3486
|
+
}), lr = Hn.extend({
|
|
3470
3487
|
themeId: r.string()
|
|
3471
|
-
}),
|
|
3488
|
+
}), ur = r.object({
|
|
3472
3489
|
universal_login_experience: r.enum(["new", "classic"]).default("new"),
|
|
3473
3490
|
identifier_first: r.boolean().default(!0),
|
|
3474
3491
|
password_first: r.boolean().default(!1),
|
|
3475
3492
|
webauthn_platform_first_factor: r.boolean()
|
|
3476
3493
|
});
|
|
3477
|
-
function
|
|
3494
|
+
function pr(t) {
|
|
3478
3495
|
const [e, n] = t.split("|");
|
|
3479
3496
|
if (!e || !n)
|
|
3480
3497
|
throw new Error(`Invalid user_id: ${t}`);
|
|
3481
3498
|
return { connection: e, id: n };
|
|
3482
3499
|
}
|
|
3483
3500
|
export {
|
|
3484
|
-
|
|
3501
|
+
Un as Auth0Client,
|
|
3485
3502
|
nt as AuthorizationResponseMode,
|
|
3486
3503
|
tt as AuthorizationResponseType,
|
|
3487
3504
|
rt as CodeChallengeMethod,
|
|
3488
3505
|
st as GrantType,
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3506
|
+
Pn as LogTypes,
|
|
3507
|
+
kn as applicationInsertSchema,
|
|
3508
|
+
xn as applicationSchema,
|
|
3509
|
+
Gn as auth0UserResponseSchema,
|
|
3510
|
+
wn as authParamsSchema,
|
|
3511
|
+
or as authorizationCodeGrantTypeParamsSchema,
|
|
3495
3512
|
et as baseUserSchema,
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3513
|
+
Vn as bordersSchema,
|
|
3514
|
+
Yn as brandingSchema,
|
|
3515
|
+
cr as clientCredentialGrantTypeParamsSchema,
|
|
3516
|
+
In as codeInsertSchema,
|
|
3517
|
+
Jn as codeSchema,
|
|
3518
|
+
jn as codeTypeSchema,
|
|
3519
|
+
Ln as colorsSchema,
|
|
3520
|
+
Sn as connectionInsertSchema,
|
|
3521
|
+
Tn as connectionSchema,
|
|
3522
|
+
Nn as domainInsertSchema,
|
|
3523
|
+
Qn as domainSchema,
|
|
3507
3524
|
W as fontDetailsSchema,
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3525
|
+
zn as fontsSchema,
|
|
3526
|
+
Zn as hookInsertSchema,
|
|
3527
|
+
Xn as hookSchema,
|
|
3511
3528
|
mn as identitySchema,
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3529
|
+
er as jwksKeySchema,
|
|
3530
|
+
Rn as jwksSchema,
|
|
3531
|
+
rr as logSchema,
|
|
3532
|
+
An as loginInsertSchema,
|
|
3533
|
+
nr as loginSchema,
|
|
3534
|
+
tr as openIDConfigurationSchema,
|
|
3535
|
+
Bn as pageBackgroundSchema,
|
|
3536
|
+
pr as parseUserId,
|
|
3537
|
+
Dn as passwordInsertSchema,
|
|
3538
|
+
sr as passwordSchema,
|
|
3539
|
+
dr as pkceAuthorizationCodeGrantTypeParamsSchema,
|
|
3523
3540
|
fn as profileDataSchema,
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3541
|
+
ur as promptSettingSchema,
|
|
3542
|
+
bn as samlpAddon,
|
|
3543
|
+
$n as sessionInsertSchema,
|
|
3544
|
+
ar as sessionSchema,
|
|
3545
|
+
ir as signingKeySchema,
|
|
3546
|
+
En as tenantInsertSchema,
|
|
3547
|
+
Cn as tenantSchema,
|
|
3548
|
+
Hn as themeInsertSchema,
|
|
3549
|
+
lr as themeSchema,
|
|
3550
|
+
qn as totalsSchema,
|
|
3534
3551
|
_n as userInsertSchema,
|
|
3535
|
-
|
|
3552
|
+
Fn as userResponseSchema,
|
|
3536
3553
|
gn as userSchema,
|
|
3537
|
-
|
|
3538
|
-
|
|
3554
|
+
Kn as vendorSettingsSchema,
|
|
3555
|
+
Wn as widgetSchema
|
|
3539
3556
|
};
|