@authhero/adapter-interfaces 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/dist/adapter-interfaces.cjs +1 -1
- package/dist/adapter-interfaces.d.ts +1388 -276
- package/dist/adapter-interfaces.iife.js +1 -1
- package/dist/adapter-interfaces.mjs +1270 -1200
- package/package.json +1 -1
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
function
|
|
1
|
+
function ut(t, e) {
|
|
2
2
|
var n = {};
|
|
3
|
-
for (var
|
|
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")
|
|
5
|
-
for (var a = 0,
|
|
6
|
-
e.indexOf(
|
|
5
|
+
for (var a = 0, s = Object.getOwnPropertySymbols(t); a < s.length; a++)
|
|
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 pt(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
|
}
|
|
13
|
-
function
|
|
13
|
+
function F(t, e) {
|
|
14
14
|
const n = t.ZodType.prototype[e];
|
|
15
|
-
t.ZodType.prototype[e] = function(...
|
|
16
|
-
const a = n.apply(this,
|
|
15
|
+
t.ZodType.prototype[e] = function(...s) {
|
|
16
|
+
const a = n.apply(this, s);
|
|
17
17
|
return a._def.openapi = this._def.openapi, a;
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function ht(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),
|
|
27
|
-
} : void 0),
|
|
28
|
-
if (
|
|
24
|
+
var o, c, u, l, m, x;
|
|
25
|
+
const z = typeof a == "string" ? i : a, B = z ?? {}, { param: Ue } = B, ct = ut(B, ["param"]), Ve = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof a == "string" ? { refId: a } : void 0), Le = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), ct), !((l = (u = this._def.openapi) === null || u === void 0 ? void 0 : u.metadata) === null || l === void 0) && l.param || Ue ? {
|
|
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), Ue)
|
|
27
|
+
} : void 0), ze = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(Ve).length > 0 ? { _internal: Ve } : void 0), Object.keys(Le).length > 0 ? { metadata: Le } : void 0) }));
|
|
28
|
+
if (pt(this, "ZodObject")) {
|
|
29
29
|
const dt = this.extend;
|
|
30
|
-
|
|
31
|
-
var
|
|
32
|
-
const Ce = dt.apply(this,
|
|
30
|
+
ze.extend = function(...lt) {
|
|
31
|
+
var we, Se, Te, Oe, je, Ee;
|
|
32
|
+
const Ce = dt.apply(this, lt);
|
|
33
33
|
return Ce._def.openapi = {
|
|
34
34
|
_internal: {
|
|
35
|
-
extendedFrom: !((
|
|
35
|
+
extendedFrom: !((Se = (we = this._def.openapi) === null || we === void 0 ? void 0 : we._internal) === null || Se === void 0) && Se.refId ? { refId: (Oe = (Te = this._def.openapi) === null || Te === void 0 ? void 0 : Te._internal) === null || Oe === void 0 ? void 0 : Oe.refId, schema: this } : (je = this._def.openapi) === null || je === void 0 ? void 0 : je._internal.extendedFrom
|
|
36
36
|
},
|
|
37
37
|
metadata: (Ee = Ce._def.openapi) === null || Ee === void 0 ? void 0 : Ee.metadata
|
|
38
38
|
}, Ce;
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
return
|
|
42
|
-
},
|
|
41
|
+
return ze;
|
|
42
|
+
}, F(t, "optional"), F(t, "nullable"), F(t, "default"), F(t, "transform"), F(t, "refine");
|
|
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(([c, u]) => {
|
|
47
47
|
var l, m;
|
|
48
|
-
u._def.openapi = (m = (l = a[
|
|
48
|
+
u._def.openapi = (m = (l = a[c]) === 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;
|
|
@@ -53,9 +53,9 @@ function pt(t) {
|
|
|
53
53
|
const i = n.apply(this, a);
|
|
54
54
|
return i._def.openapi = void 0, i;
|
|
55
55
|
};
|
|
56
|
-
const
|
|
56
|
+
const s = t.ZodObject.prototype.omit;
|
|
57
57
|
t.ZodObject.prototype.omit = function(...a) {
|
|
58
|
-
const i =
|
|
58
|
+
const i = s.apply(this, a);
|
|
59
59
|
return i._def.openapi = void 0, i;
|
|
60
60
|
};
|
|
61
61
|
}
|
|
@@ -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((c) => typeof a[a[c]] != "number"), o = {};
|
|
79
|
+
for (const c of i)
|
|
80
|
+
o[c] = a[c];
|
|
81
81
|
return t.objectValues(o);
|
|
82
82
|
}, t.objectValues = (a) => t.objectKeys(a).map(function(i) {
|
|
83
83
|
return a[i];
|
|
@@ -91,20 +91,20 @@ var b;
|
|
|
91
91
|
if (i(o))
|
|
92
92
|
return o;
|
|
93
93
|
}, t.isInteger = typeof Number.isInteger == "function" ? (a) => Number.isInteger(a) : (a) => typeof a == "number" && isFinite(a) && Math.floor(a) === a;
|
|
94
|
-
function
|
|
94
|
+
function s(a, i = " | ") {
|
|
95
95
|
return a.map((o) => typeof o == "string" ? `'${o}'` : o).join(i);
|
|
96
96
|
}
|
|
97
|
-
t.joinValues =
|
|
97
|
+
t.joinValues = s, t.jsonStringifyReplacer = (a, i) => typeof i == "bigint" ? i.toString() : i;
|
|
98
98
|
})(b || (b = {}));
|
|
99
|
-
var
|
|
99
|
+
var Ne;
|
|
100
100
|
(function(t) {
|
|
101
101
|
t.mergeShapes = (e, n) => ({
|
|
102
102
|
...e,
|
|
103
103
|
...n
|
|
104
104
|
// second overwrites first
|
|
105
105
|
});
|
|
106
|
-
})(
|
|
107
|
-
const
|
|
106
|
+
})(Ne || (Ne = {}));
|
|
107
|
+
const h = b.arrayToEnum([
|
|
108
108
|
"string",
|
|
109
109
|
"nan",
|
|
110
110
|
"number",
|
|
@@ -128,25 +128,25 @@ const f = b.arrayToEnum([
|
|
|
128
128
|
]), A = (t) => {
|
|
129
129
|
switch (typeof t) {
|
|
130
130
|
case "undefined":
|
|
131
|
-
return
|
|
131
|
+
return h.undefined;
|
|
132
132
|
case "string":
|
|
133
|
-
return
|
|
133
|
+
return h.string;
|
|
134
134
|
case "number":
|
|
135
|
-
return isNaN(t) ?
|
|
135
|
+
return isNaN(t) ? h.nan : h.number;
|
|
136
136
|
case "boolean":
|
|
137
|
-
return
|
|
137
|
+
return h.boolean;
|
|
138
138
|
case "function":
|
|
139
|
-
return
|
|
139
|
+
return h.function;
|
|
140
140
|
case "bigint":
|
|
141
|
-
return
|
|
141
|
+
return h.bigint;
|
|
142
142
|
case "symbol":
|
|
143
|
-
return
|
|
143
|
+
return h.symbol;
|
|
144
144
|
case "object":
|
|
145
|
-
return Array.isArray(t) ?
|
|
145
|
+
return Array.isArray(t) ? h.array : t === null ? h.null : t.then && typeof t.then == "function" && t.catch && typeof t.catch == "function" ? h.promise : typeof Map < "u" && t instanceof Map ? h.map : typeof Set < "u" && t instanceof Set ? h.set : typeof Date < "u" && t instanceof Date ? h.date : h.object;
|
|
146
146
|
default:
|
|
147
|
-
return
|
|
147
|
+
return h.unknown;
|
|
148
148
|
}
|
|
149
|
-
},
|
|
149
|
+
}, d = b.arrayToEnum([
|
|
150
150
|
"invalid_type",
|
|
151
151
|
"invalid_literal",
|
|
152
152
|
"custom",
|
|
@@ -166,10 +166,10 @@ const f = b.arrayToEnum([
|
|
|
166
166
|
]), ft = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
167
167
|
class T extends Error {
|
|
168
168
|
constructor(e) {
|
|
169
|
-
super(), this.issues = [], this.addIssue = (
|
|
170
|
-
this.issues = [...this.issues,
|
|
171
|
-
}, this.addIssues = (
|
|
172
|
-
this.issues = [...this.issues, ...
|
|
169
|
+
super(), this.issues = [], this.addIssue = (s) => {
|
|
170
|
+
this.issues = [...this.issues, s];
|
|
171
|
+
}, this.addIssues = (s = []) => {
|
|
172
|
+
this.issues = [...this.issues, ...s];
|
|
173
173
|
};
|
|
174
174
|
const n = new.target.prototype;
|
|
175
175
|
Object.setPrototypeOf ? Object.setPrototypeOf(this, n) : this.__proto__ = n, this.name = "ZodError", this.issues = e;
|
|
@@ -180,7 +180,7 @@ class T extends Error {
|
|
|
180
180
|
format(e) {
|
|
181
181
|
const n = e || function(i) {
|
|
182
182
|
return i.message;
|
|
183
|
-
},
|
|
183
|
+
}, s = { _errors: [] }, a = (i) => {
|
|
184
184
|
for (const o of i.issues)
|
|
185
185
|
if (o.code === "invalid_union")
|
|
186
186
|
o.unionErrors.map(a);
|
|
@@ -189,16 +189,16 @@ class T extends Error {
|
|
|
189
189
|
else if (o.code === "invalid_arguments")
|
|
190
190
|
a(o.argumentsError);
|
|
191
191
|
else if (o.path.length === 0)
|
|
192
|
-
|
|
192
|
+
s._errors.push(n(o));
|
|
193
193
|
else {
|
|
194
|
-
let
|
|
194
|
+
let c = 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 ? (c[l] = c[l] || { _errors: [] }, c[l]._errors.push(n(o))) : c[l] = c[l] || { _errors: [] }, c = c[l], u++;
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
return a(this),
|
|
201
|
+
return a(this), s;
|
|
202
202
|
}
|
|
203
203
|
static assert(e) {
|
|
204
204
|
if (!(e instanceof T))
|
|
@@ -214,65 +214,65 @@ class T extends Error {
|
|
|
214
214
|
return this.issues.length === 0;
|
|
215
215
|
}
|
|
216
216
|
flatten(e = (n) => n.message) {
|
|
217
|
-
const n = {},
|
|
217
|
+
const n = {}, s = [];
|
|
218
218
|
for (const a of this.issues)
|
|
219
|
-
a.path.length > 0 ? (n[a.path[0]] = n[a.path[0]] || [], n[a.path[0]].push(e(a))) :
|
|
220
|
-
return { formErrors:
|
|
219
|
+
a.path.length > 0 ? (n[a.path[0]] = n[a.path[0]] || [], n[a.path[0]].push(e(a))) : s.push(e(a));
|
|
220
|
+
return { formErrors: s, fieldErrors: n };
|
|
221
221
|
}
|
|
222
222
|
get formErrors() {
|
|
223
223
|
return this.flatten();
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
T.create = (t) => new T(t);
|
|
227
|
-
const
|
|
227
|
+
const K = (t, e) => {
|
|
228
228
|
let n;
|
|
229
229
|
switch (t.code) {
|
|
230
|
-
case
|
|
231
|
-
t.received ===
|
|
230
|
+
case d.invalid_type:
|
|
231
|
+
t.received === h.undefined ? n = "Required" : n = `Expected ${t.expected}, received ${t.received}`;
|
|
232
232
|
break;
|
|
233
|
-
case
|
|
233
|
+
case d.invalid_literal:
|
|
234
234
|
n = `Invalid literal value, expected ${JSON.stringify(t.expected, b.jsonStringifyReplacer)}`;
|
|
235
235
|
break;
|
|
236
|
-
case
|
|
236
|
+
case d.unrecognized_keys:
|
|
237
237
|
n = `Unrecognized key(s) in object: ${b.joinValues(t.keys, ", ")}`;
|
|
238
238
|
break;
|
|
239
|
-
case
|
|
239
|
+
case d.invalid_union:
|
|
240
240
|
n = "Invalid input";
|
|
241
241
|
break;
|
|
242
|
-
case
|
|
242
|
+
case d.invalid_union_discriminator:
|
|
243
243
|
n = `Invalid discriminator value. Expected ${b.joinValues(t.options)}`;
|
|
244
244
|
break;
|
|
245
|
-
case
|
|
245
|
+
case d.invalid_enum_value:
|
|
246
246
|
n = `Invalid enum value. Expected ${b.joinValues(t.options)}, received '${t.received}'`;
|
|
247
247
|
break;
|
|
248
|
-
case
|
|
248
|
+
case d.invalid_arguments:
|
|
249
249
|
n = "Invalid function arguments";
|
|
250
250
|
break;
|
|
251
|
-
case
|
|
251
|
+
case d.invalid_return_type:
|
|
252
252
|
n = "Invalid function return type";
|
|
253
253
|
break;
|
|
254
|
-
case
|
|
254
|
+
case d.invalid_date:
|
|
255
255
|
n = "Invalid date";
|
|
256
256
|
break;
|
|
257
|
-
case
|
|
257
|
+
case d.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 d.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 d.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 d.custom:
|
|
267
267
|
n = "Invalid input";
|
|
268
268
|
break;
|
|
269
|
-
case
|
|
269
|
+
case d.invalid_intersection_types:
|
|
270
270
|
n = "Intersection results could not be merged";
|
|
271
271
|
break;
|
|
272
|
-
case
|
|
272
|
+
case d.not_multiple_of:
|
|
273
273
|
n = `Number must be a multiple of ${t.multipleOf}`;
|
|
274
274
|
break;
|
|
275
|
-
case
|
|
275
|
+
case d.not_finite:
|
|
276
276
|
n = "Number must be finite";
|
|
277
277
|
break;
|
|
278
278
|
default:
|
|
@@ -280,15 +280,15 @@ const H = (t, e) => {
|
|
|
280
280
|
}
|
|
281
281
|
return { message: n };
|
|
282
282
|
};
|
|
283
|
-
let
|
|
284
|
-
function
|
|
285
|
-
|
|
283
|
+
let qe = K;
|
|
284
|
+
function mt(t) {
|
|
285
|
+
qe = t;
|
|
286
286
|
}
|
|
287
|
-
function
|
|
288
|
-
return
|
|
287
|
+
function me() {
|
|
288
|
+
return qe;
|
|
289
289
|
}
|
|
290
|
-
const
|
|
291
|
-
const { data: e, path: n, errorMaps:
|
|
290
|
+
const _e = (t) => {
|
|
291
|
+
const { data: e, path: n, errorMaps: s, issueData: a } = t, i = [...n, ...a.path || []], o = {
|
|
292
292
|
...a,
|
|
293
293
|
path: i
|
|
294
294
|
};
|
|
@@ -298,18 +298,18 @@ const me = (t) => {
|
|
|
298
298
|
path: i,
|
|
299
299
|
message: a.message
|
|
300
300
|
};
|
|
301
|
-
let
|
|
302
|
-
const u =
|
|
301
|
+
let c = "";
|
|
302
|
+
const u = s.filter((l) => !!l).slice().reverse();
|
|
303
303
|
for (const l of u)
|
|
304
|
-
|
|
304
|
+
c = l(o, { data: e, defaultError: c }).message;
|
|
305
305
|
return {
|
|
306
306
|
...a,
|
|
307
307
|
path: i,
|
|
308
|
-
message:
|
|
308
|
+
message: c
|
|
309
309
|
};
|
|
310
|
-
},
|
|
310
|
+
}, _t = [];
|
|
311
311
|
function p(t, e) {
|
|
312
|
-
const n =
|
|
312
|
+
const n = me(), s = _e({
|
|
313
313
|
issueData: e,
|
|
314
314
|
data: t.data,
|
|
315
315
|
path: t.path,
|
|
@@ -317,11 +317,11 @@ function p(t, e) {
|
|
|
317
317
|
t.common.contextualErrorMap,
|
|
318
318
|
t.schemaErrorMap,
|
|
319
319
|
n,
|
|
320
|
-
n ===
|
|
320
|
+
n === K ? void 0 : K
|
|
321
321
|
// then global default map
|
|
322
322
|
].filter((a) => !!a)
|
|
323
323
|
});
|
|
324
|
-
t.common.issues.push(
|
|
324
|
+
t.common.issues.push(s);
|
|
325
325
|
}
|
|
326
326
|
class w {
|
|
327
327
|
constructor() {
|
|
@@ -334,62 +334,62 @@ class w {
|
|
|
334
334
|
this.value !== "aborted" && (this.value = "aborted");
|
|
335
335
|
}
|
|
336
336
|
static mergeArray(e, n) {
|
|
337
|
-
const
|
|
337
|
+
const s = [];
|
|
338
338
|
for (const a of n) {
|
|
339
339
|
if (a.status === "aborted")
|
|
340
340
|
return g;
|
|
341
|
-
a.status === "dirty" && e.dirty(),
|
|
341
|
+
a.status === "dirty" && e.dirty(), s.push(a.value);
|
|
342
342
|
}
|
|
343
|
-
return { status: e.value, value:
|
|
343
|
+
return { status: e.value, value: s };
|
|
344
344
|
}
|
|
345
345
|
static async mergeObjectAsync(e, n) {
|
|
346
|
-
const
|
|
346
|
+
const s = [];
|
|
347
347
|
for (const a of n) {
|
|
348
348
|
const i = await a.key, o = await a.value;
|
|
349
|
-
|
|
349
|
+
s.push({
|
|
350
350
|
key: i,
|
|
351
351
|
value: o
|
|
352
352
|
});
|
|
353
353
|
}
|
|
354
|
-
return w.mergeObjectSync(e,
|
|
354
|
+
return w.mergeObjectSync(e, s);
|
|
355
355
|
}
|
|
356
356
|
static mergeObjectSync(e, n) {
|
|
357
|
-
const
|
|
357
|
+
const s = {};
|
|
358
358
|
for (const a of n) {
|
|
359
359
|
const { key: i, value: o } = a;
|
|
360
360
|
if (i.status === "aborted" || o.status === "aborted")
|
|
361
361
|
return g;
|
|
362
|
-
i.status === "dirty" && e.dirty(), o.status === "dirty" && e.dirty(), i.value !== "__proto__" && (typeof o.value < "u" || a.alwaysSet) && (
|
|
362
|
+
i.status === "dirty" && e.dirty(), o.status === "dirty" && e.dirty(), i.value !== "__proto__" && (typeof o.value < "u" || a.alwaysSet) && (s[i.value] = o.value);
|
|
363
363
|
}
|
|
364
|
-
return { status: e.value, value:
|
|
364
|
+
return { status: e.value, value: s };
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
const g = Object.freeze({
|
|
368
368
|
status: "aborted"
|
|
369
|
-
}),
|
|
370
|
-
function
|
|
371
|
-
if (typeof e == "function" ? t !== e || !
|
|
369
|
+
}), G = (t) => ({ status: "dirty", value: t }), S = (t) => ({ status: "valid", value: t }), Ie = (t) => t.status === "aborted", Re = (t) => t.status === "dirty", ee = (t) => t.status === "valid", te = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
370
|
+
function ge(t, e, n, s) {
|
|
371
|
+
if (typeof e == "function" ? t !== e || !s : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
372
372
|
return e.get(t);
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function Ge(t, e, n, s, a) {
|
|
375
375
|
if (typeof e == "function" ? t !== e || !a : !e.has(t)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
376
376
|
return e.set(t, n), n;
|
|
377
377
|
}
|
|
378
|
-
var
|
|
378
|
+
var f;
|
|
379
379
|
(function(t) {
|
|
380
380
|
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
381
|
-
})(
|
|
382
|
-
var
|
|
381
|
+
})(f || (f = {}));
|
|
382
|
+
var X, Q;
|
|
383
383
|
class Z {
|
|
384
|
-
constructor(e, n,
|
|
385
|
-
this._cachedPath = [], this.parent = e, this.data = n, this._path =
|
|
384
|
+
constructor(e, n, s, a) {
|
|
385
|
+
this._cachedPath = [], this.parent = e, this.data = n, this._path = s, this._key = a;
|
|
386
386
|
}
|
|
387
387
|
get path() {
|
|
388
388
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
|
-
const
|
|
392
|
-
if (
|
|
391
|
+
const Be = (t, e) => {
|
|
392
|
+
if (ee(e))
|
|
393
393
|
return { success: !0, data: e.value };
|
|
394
394
|
if (!t.common.issues.length)
|
|
395
395
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -406,13 +406,13 @@ const ze = (t, e) => {
|
|
|
406
406
|
function y(t) {
|
|
407
407
|
if (!t)
|
|
408
408
|
return {};
|
|
409
|
-
const { errorMap: e, invalid_type_error: n, required_error:
|
|
410
|
-
if (e && (n ||
|
|
409
|
+
const { errorMap: e, invalid_type_error: n, required_error: s, description: a } = t;
|
|
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, c) => {
|
|
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 ?? c.defaultError } : typeof c.data > "u" ? { message: (u = m ?? s) !== null && u !== void 0 ? u : c.defaultError } : o.code !== "invalid_type" ? { message: c.defaultError } : { message: (l = m ?? n) !== null && l !== void 0 ? l : c.defaultError };
|
|
416
416
|
}, description: a };
|
|
417
417
|
}
|
|
418
418
|
class v {
|
|
@@ -450,7 +450,7 @@ class v {
|
|
|
450
450
|
}
|
|
451
451
|
_parseSync(e) {
|
|
452
452
|
const n = this._parse(e);
|
|
453
|
-
if (
|
|
453
|
+
if (te(n))
|
|
454
454
|
throw new Error("Synchronous parse encountered promise.");
|
|
455
455
|
return n;
|
|
456
456
|
}
|
|
@@ -459,17 +459,17 @@ class v {
|
|
|
459
459
|
return Promise.resolve(n);
|
|
460
460
|
}
|
|
461
461
|
parse(e, n) {
|
|
462
|
-
const
|
|
463
|
-
if (
|
|
464
|
-
return
|
|
465
|
-
throw
|
|
462
|
+
const s = this.safeParse(e, n);
|
|
463
|
+
if (s.success)
|
|
464
|
+
return s.data;
|
|
465
|
+
throw s.error;
|
|
466
466
|
}
|
|
467
467
|
safeParse(e, n) {
|
|
468
|
-
var
|
|
468
|
+
var s;
|
|
469
469
|
const a = {
|
|
470
470
|
common: {
|
|
471
471
|
issues: [],
|
|
472
|
-
async: (
|
|
472
|
+
async: (s = n == null ? void 0 : n.async) !== null && s !== void 0 ? s : !1,
|
|
473
473
|
contextualErrorMap: n == null ? void 0 : n.errorMap
|
|
474
474
|
},
|
|
475
475
|
path: (n == null ? void 0 : n.path) || [],
|
|
@@ -478,16 +478,16 @@ class v {
|
|
|
478
478
|
data: e,
|
|
479
479
|
parsedType: A(e)
|
|
480
480
|
}, i = this._parseSync({ data: e, path: a.path, parent: a });
|
|
481
|
-
return
|
|
481
|
+
return Be(a, i);
|
|
482
482
|
}
|
|
483
483
|
async parseAsync(e, n) {
|
|
484
|
-
const
|
|
485
|
-
if (
|
|
486
|
-
return
|
|
487
|
-
throw
|
|
484
|
+
const s = await this.safeParseAsync(e, n);
|
|
485
|
+
if (s.success)
|
|
486
|
+
return s.data;
|
|
487
|
+
throw s.error;
|
|
488
488
|
}
|
|
489
489
|
async safeParseAsync(e, n) {
|
|
490
|
-
const
|
|
490
|
+
const s = {
|
|
491
491
|
common: {
|
|
492
492
|
issues: [],
|
|
493
493
|
contextualErrorMap: n == null ? void 0 : n.errorMap,
|
|
@@ -498,24 +498,24 @@ class v {
|
|
|
498
498
|
parent: null,
|
|
499
499
|
data: e,
|
|
500
500
|
parsedType: A(e)
|
|
501
|
-
}, a = this._parse({ data: e, path:
|
|
502
|
-
return
|
|
501
|
+
}, a = this._parse({ data: e, path: s.path, parent: s }), i = await (te(a) ? a : Promise.resolve(a));
|
|
502
|
+
return Be(s, i);
|
|
503
503
|
}
|
|
504
504
|
refine(e, n) {
|
|
505
|
-
const
|
|
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:
|
|
509
|
-
...
|
|
507
|
+
const o = e(a), c = () => i.addIssue({
|
|
508
|
+
code: d.custom,
|
|
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 : (c(), !1)) : o ? !0 : (c(), !1);
|
|
512
512
|
});
|
|
513
513
|
}
|
|
514
514
|
refinement(e, n) {
|
|
515
|
-
return this._refinement((
|
|
515
|
+
return this._refinement((s, a) => e(s) ? !0 : (a.addIssue(typeof n == "function" ? n(s, a) : n), !1));
|
|
516
516
|
}
|
|
517
517
|
_refinement(e) {
|
|
518
|
-
return new
|
|
518
|
+
return new E({
|
|
519
519
|
schema: this,
|
|
520
520
|
typeName: _.ZodEffects,
|
|
521
521
|
effect: { type: "refinement", refinement: e }
|
|
@@ -525,7 +525,7 @@ class v {
|
|
|
525
525
|
return this._refinement(e);
|
|
526
526
|
}
|
|
527
527
|
optional() {
|
|
528
|
-
return
|
|
528
|
+
return C.create(this, this._def);
|
|
529
529
|
}
|
|
530
530
|
nullable() {
|
|
531
531
|
return D.create(this, this._def);
|
|
@@ -534,19 +534,19 @@ class v {
|
|
|
534
534
|
return this.nullable().optional();
|
|
535
535
|
}
|
|
536
536
|
array() {
|
|
537
|
-
return
|
|
537
|
+
return j.create(this, this._def);
|
|
538
538
|
}
|
|
539
539
|
promise() {
|
|
540
|
-
return
|
|
540
|
+
return J.create(this, this._def);
|
|
541
541
|
}
|
|
542
542
|
or(e) {
|
|
543
|
-
return
|
|
543
|
+
return ae.create([this, e], this._def);
|
|
544
544
|
}
|
|
545
545
|
and(e) {
|
|
546
|
-
return
|
|
546
|
+
return ie.create(this, e, this._def);
|
|
547
547
|
}
|
|
548
548
|
transform(e) {
|
|
549
|
-
return new
|
|
549
|
+
return new E({
|
|
550
550
|
...y(this._def),
|
|
551
551
|
schema: this,
|
|
552
552
|
typeName: _.ZodEffects,
|
|
@@ -555,7 +555,7 @@ class v {
|
|
|
555
555
|
}
|
|
556
556
|
default(e) {
|
|
557
557
|
const n = typeof e == "function" ? e : () => e;
|
|
558
|
-
return new
|
|
558
|
+
return new ue({
|
|
559
559
|
...y(this._def),
|
|
560
560
|
innerType: this,
|
|
561
561
|
defaultValue: n,
|
|
@@ -563,7 +563,7 @@ class v {
|
|
|
563
563
|
});
|
|
564
564
|
}
|
|
565
565
|
brand() {
|
|
566
|
-
return new
|
|
566
|
+
return new Pe({
|
|
567
567
|
typeName: _.ZodBranded,
|
|
568
568
|
type: this,
|
|
569
569
|
...y(this._def)
|
|
@@ -571,7 +571,7 @@ class v {
|
|
|
571
571
|
}
|
|
572
572
|
catch(e) {
|
|
573
573
|
const n = typeof e == "function" ? e : () => e;
|
|
574
|
-
return new
|
|
574
|
+
return new pe({
|
|
575
575
|
...y(this._def),
|
|
576
576
|
innerType: this,
|
|
577
577
|
catchValue: n,
|
|
@@ -589,7 +589,7 @@ class v {
|
|
|
589
589
|
return fe.create(this, e);
|
|
590
590
|
}
|
|
591
591
|
readonly() {
|
|
592
|
-
return
|
|
592
|
+
return he.create(this);
|
|
593
593
|
}
|
|
594
594
|
isOptional() {
|
|
595
595
|
return this.safeParse(void 0).success;
|
|
@@ -598,172 +598,172 @@ class v {
|
|
|
598
598
|
return this.safeParse(null).success;
|
|
599
599
|
}
|
|
600
600
|
}
|
|
601
|
-
const
|
|
602
|
-
let
|
|
603
|
-
const
|
|
604
|
-
function
|
|
601
|
+
const gt = /^c[^\s-]{8,}$/i, yt = /^[0-9a-z]+$/, vt = /^[0-9A-HJKMNP-TV-Z]{26}$/, bt = /^[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, kt = /^[a-z0-9_-]{21}$/i, xt = /^[-+]?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)?)??$/, wt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, St = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
602
|
+
let Ze;
|
|
603
|
+
const Tt = /^(?:(?: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])$/, Ot = /^(([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})))$/, jt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, He = "((\\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])))", Et = new RegExp(`^${He}$`);
|
|
604
|
+
function Ke(t) {
|
|
605
605
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
606
606
|
return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
607
607
|
}
|
|
608
608
|
function Ct(t) {
|
|
609
|
-
return new RegExp(`^${
|
|
609
|
+
return new RegExp(`^${Ke(t)}$`);
|
|
610
610
|
}
|
|
611
|
-
function
|
|
612
|
-
let e = `${
|
|
611
|
+
function Ye(t) {
|
|
612
|
+
let e = `${He}T${Ke(t)}`;
|
|
613
613
|
const n = [];
|
|
614
614
|
return n.push(t.local ? "Z?" : "Z"), t.offset && n.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${n.join("|")})`, new RegExp(`^${e}$`);
|
|
615
615
|
}
|
|
616
|
-
function
|
|
617
|
-
return !!((e === "v4" || !e) &&
|
|
616
|
+
function Zt(t, e) {
|
|
617
|
+
return !!((e === "v4" || !e) && Tt.test(t) || (e === "v6" || !e) && Ot.test(t));
|
|
618
618
|
}
|
|
619
619
|
class O extends v {
|
|
620
620
|
_parse(e) {
|
|
621
|
-
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !==
|
|
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:
|
|
625
|
-
expected:
|
|
624
|
+
code: d.invalid_type,
|
|
625
|
+
expected: h.string,
|
|
626
626
|
received: i.parsedType
|
|
627
627
|
}), g;
|
|
628
628
|
}
|
|
629
|
-
const
|
|
629
|
+
const s = new w();
|
|
630
630
|
let a;
|
|
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: d.too_small,
|
|
635
635
|
minimum: i.value,
|
|
636
636
|
type: "string",
|
|
637
637
|
inclusive: !0,
|
|
638
638
|
exact: !1,
|
|
639
639
|
message: i.message
|
|
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: d.too_big,
|
|
644
644
|
maximum: i.value,
|
|
645
645
|
type: "string",
|
|
646
646
|
inclusive: !0,
|
|
647
647
|
exact: !1,
|
|
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, c = e.data.length < i.value;
|
|
652
|
+
(o || c) && (a = this._getOrReturnCtx(e, a), o ? p(a, {
|
|
653
|
+
code: d.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
|
+
}) : c && p(a, {
|
|
660
|
+
code: d.too_small,
|
|
661
661
|
minimum: i.value,
|
|
662
662
|
type: "string",
|
|
663
663
|
inclusive: !0,
|
|
664
664
|
exact: !0,
|
|
665
665
|
message: i.message
|
|
666
|
-
}),
|
|
666
|
+
}), s.dirty());
|
|
667
667
|
} else if (i.kind === "email")
|
|
668
|
-
|
|
668
|
+
wt.test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
669
669
|
validation: "email",
|
|
670
|
-
code:
|
|
670
|
+
code: d.invalid_string,
|
|
671
671
|
message: i.message
|
|
672
|
-
}),
|
|
672
|
+
}), s.dirty());
|
|
673
673
|
else if (i.kind === "emoji")
|
|
674
|
-
|
|
674
|
+
Ze || (Ze = new RegExp(St, "u")), Ze.test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
675
675
|
validation: "emoji",
|
|
676
|
-
code:
|
|
676
|
+
code: d.invalid_string,
|
|
677
677
|
message: i.message
|
|
678
|
-
}),
|
|
678
|
+
}), s.dirty());
|
|
679
679
|
else if (i.kind === "uuid")
|
|
680
|
-
|
|
680
|
+
bt.test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
681
681
|
validation: "uuid",
|
|
682
|
-
code:
|
|
682
|
+
code: d.invalid_string,
|
|
683
683
|
message: i.message
|
|
684
|
-
}),
|
|
684
|
+
}), s.dirty());
|
|
685
685
|
else if (i.kind === "nanoid")
|
|
686
|
-
|
|
686
|
+
kt.test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
687
687
|
validation: "nanoid",
|
|
688
|
-
code:
|
|
688
|
+
code: d.invalid_string,
|
|
689
689
|
message: i.message
|
|
690
|
-
}),
|
|
690
|
+
}), s.dirty());
|
|
691
691
|
else if (i.kind === "cuid")
|
|
692
|
-
|
|
692
|
+
gt.test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
693
693
|
validation: "cuid",
|
|
694
|
-
code:
|
|
694
|
+
code: d.invalid_string,
|
|
695
695
|
message: i.message
|
|
696
|
-
}),
|
|
696
|
+
}), s.dirty());
|
|
697
697
|
else if (i.kind === "cuid2")
|
|
698
|
-
|
|
698
|
+
yt.test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
699
699
|
validation: "cuid2",
|
|
700
|
-
code:
|
|
700
|
+
code: d.invalid_string,
|
|
701
701
|
message: i.message
|
|
702
|
-
}),
|
|
702
|
+
}), s.dirty());
|
|
703
703
|
else if (i.kind === "ulid")
|
|
704
|
-
|
|
704
|
+
vt.test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
705
705
|
validation: "ulid",
|
|
706
|
-
code:
|
|
706
|
+
code: d.invalid_string,
|
|
707
707
|
message: i.message
|
|
708
|
-
}),
|
|
708
|
+
}), s.dirty());
|
|
709
709
|
else if (i.kind === "url")
|
|
710
710
|
try {
|
|
711
711
|
new URL(e.data);
|
|
712
712
|
} catch {
|
|
713
713
|
a = this._getOrReturnCtx(e, a), p(a, {
|
|
714
714
|
validation: "url",
|
|
715
|
-
code:
|
|
715
|
+
code: d.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: d.invalid_string,
|
|
722
722
|
message: i.message
|
|
723
|
-
}),
|
|
724
|
-
code:
|
|
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: d.invalid_string,
|
|
725
725
|
validation: { includes: i.value, position: i.position },
|
|
726
726
|
message: i.message
|
|
727
|
-
}),
|
|
728
|
-
code:
|
|
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: d.invalid_string,
|
|
729
729
|
validation: { startsWith: i.value },
|
|
730
730
|
message: i.message
|
|
731
|
-
}),
|
|
732
|
-
code:
|
|
731
|
+
}), s.dirty()) : i.kind === "endsWith" ? e.data.endsWith(i.value) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
732
|
+
code: d.invalid_string,
|
|
733
733
|
validation: { endsWith: i.value },
|
|
734
734
|
message: i.message
|
|
735
|
-
}),
|
|
736
|
-
code:
|
|
735
|
+
}), s.dirty()) : i.kind === "datetime" ? Ye(i).test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
736
|
+
code: d.invalid_string,
|
|
737
737
|
validation: "datetime",
|
|
738
738
|
message: i.message
|
|
739
|
-
}),
|
|
740
|
-
code:
|
|
739
|
+
}), s.dirty()) : i.kind === "date" ? Et.test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
740
|
+
code: d.invalid_string,
|
|
741
741
|
validation: "date",
|
|
742
742
|
message: i.message
|
|
743
|
-
}),
|
|
744
|
-
code:
|
|
743
|
+
}), s.dirty()) : i.kind === "time" ? Ct(i).test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
744
|
+
code: d.invalid_string,
|
|
745
745
|
validation: "time",
|
|
746
746
|
message: i.message
|
|
747
|
-
}),
|
|
747
|
+
}), s.dirty()) : i.kind === "duration" ? xt.test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
748
748
|
validation: "duration",
|
|
749
|
-
code:
|
|
749
|
+
code: d.invalid_string,
|
|
750
750
|
message: i.message
|
|
751
|
-
}),
|
|
751
|
+
}), s.dirty()) : i.kind === "ip" ? Zt(e.data, i.version) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
752
752
|
validation: "ip",
|
|
753
|
-
code:
|
|
753
|
+
code: d.invalid_string,
|
|
754
754
|
message: i.message
|
|
755
|
-
}),
|
|
755
|
+
}), s.dirty()) : i.kind === "base64" ? jt.test(e.data) || (a = this._getOrReturnCtx(e, a), p(a, {
|
|
756
756
|
validation: "base64",
|
|
757
|
-
code:
|
|
757
|
+
code: d.invalid_string,
|
|
758
758
|
message: i.message
|
|
759
|
-
}),
|
|
760
|
-
return { status:
|
|
759
|
+
}), s.dirty()) : b.assertNever(i);
|
|
760
|
+
return { status: s.value, value: e.data };
|
|
761
761
|
}
|
|
762
|
-
_regex(e, n,
|
|
762
|
+
_regex(e, n, s) {
|
|
763
763
|
return this.refinement((a) => e.test(a), {
|
|
764
764
|
validation: n,
|
|
765
|
-
code:
|
|
766
|
-
...
|
|
765
|
+
code: d.invalid_string,
|
|
766
|
+
...f.errToObj(s)
|
|
767
767
|
});
|
|
768
768
|
}
|
|
769
769
|
_addCheck(e) {
|
|
@@ -773,37 +773,37 @@ class O extends v {
|
|
|
773
773
|
});
|
|
774
774
|
}
|
|
775
775
|
email(e) {
|
|
776
|
-
return this._addCheck({ kind: "email", ...
|
|
776
|
+
return this._addCheck({ kind: "email", ...f.errToObj(e) });
|
|
777
777
|
}
|
|
778
778
|
url(e) {
|
|
779
|
-
return this._addCheck({ kind: "url", ...
|
|
779
|
+
return this._addCheck({ kind: "url", ...f.errToObj(e) });
|
|
780
780
|
}
|
|
781
781
|
emoji(e) {
|
|
782
|
-
return this._addCheck({ kind: "emoji", ...
|
|
782
|
+
return this._addCheck({ kind: "emoji", ...f.errToObj(e) });
|
|
783
783
|
}
|
|
784
784
|
uuid(e) {
|
|
785
|
-
return this._addCheck({ kind: "uuid", ...
|
|
785
|
+
return this._addCheck({ kind: "uuid", ...f.errToObj(e) });
|
|
786
786
|
}
|
|
787
787
|
nanoid(e) {
|
|
788
|
-
return this._addCheck({ kind: "nanoid", ...
|
|
788
|
+
return this._addCheck({ kind: "nanoid", ...f.errToObj(e) });
|
|
789
789
|
}
|
|
790
790
|
cuid(e) {
|
|
791
|
-
return this._addCheck({ kind: "cuid", ...
|
|
791
|
+
return this._addCheck({ kind: "cuid", ...f.errToObj(e) });
|
|
792
792
|
}
|
|
793
793
|
cuid2(e) {
|
|
794
|
-
return this._addCheck({ kind: "cuid2", ...
|
|
794
|
+
return this._addCheck({ kind: "cuid2", ...f.errToObj(e) });
|
|
795
795
|
}
|
|
796
796
|
ulid(e) {
|
|
797
|
-
return this._addCheck({ kind: "ulid", ...
|
|
797
|
+
return this._addCheck({ kind: "ulid", ...f.errToObj(e) });
|
|
798
798
|
}
|
|
799
799
|
base64(e) {
|
|
800
|
-
return this._addCheck({ kind: "base64", ...
|
|
800
|
+
return this._addCheck({ kind: "base64", ...f.errToObj(e) });
|
|
801
801
|
}
|
|
802
802
|
ip(e) {
|
|
803
|
-
return this._addCheck({ kind: "ip", ...
|
|
803
|
+
return this._addCheck({ kind: "ip", ...f.errToObj(e) });
|
|
804
804
|
}
|
|
805
805
|
datetime(e) {
|
|
806
|
-
var n,
|
|
806
|
+
var n, s;
|
|
807
807
|
return typeof e == "string" ? this._addCheck({
|
|
808
808
|
kind: "datetime",
|
|
809
809
|
precision: null,
|
|
@@ -814,8 +814,8 @@ class O extends v {
|
|
|
814
814
|
kind: "datetime",
|
|
815
815
|
precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
|
|
816
816
|
offset: (n = e == null ? void 0 : e.offset) !== null && n !== void 0 ? n : !1,
|
|
817
|
-
local: (
|
|
818
|
-
...
|
|
817
|
+
local: (s = e == null ? void 0 : e.local) !== null && s !== void 0 ? s : !1,
|
|
818
|
+
...f.errToObj(e == null ? void 0 : e.message)
|
|
819
819
|
});
|
|
820
820
|
}
|
|
821
821
|
date(e) {
|
|
@@ -829,17 +829,17 @@ class O extends v {
|
|
|
829
829
|
}) : this._addCheck({
|
|
830
830
|
kind: "time",
|
|
831
831
|
precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
|
|
832
|
-
...
|
|
832
|
+
...f.errToObj(e == null ? void 0 : e.message)
|
|
833
833
|
});
|
|
834
834
|
}
|
|
835
835
|
duration(e) {
|
|
836
|
-
return this._addCheck({ kind: "duration", ...
|
|
836
|
+
return this._addCheck({ kind: "duration", ...f.errToObj(e) });
|
|
837
837
|
}
|
|
838
838
|
regex(e, n) {
|
|
839
839
|
return this._addCheck({
|
|
840
840
|
kind: "regex",
|
|
841
841
|
regex: e,
|
|
842
|
-
...
|
|
842
|
+
...f.errToObj(n)
|
|
843
843
|
});
|
|
844
844
|
}
|
|
845
845
|
includes(e, n) {
|
|
@@ -847,42 +847,42 @@ class O extends v {
|
|
|
847
847
|
kind: "includes",
|
|
848
848
|
value: e,
|
|
849
849
|
position: n == null ? void 0 : n.position,
|
|
850
|
-
...
|
|
850
|
+
...f.errToObj(n == null ? void 0 : n.message)
|
|
851
851
|
});
|
|
852
852
|
}
|
|
853
853
|
startsWith(e, n) {
|
|
854
854
|
return this._addCheck({
|
|
855
855
|
kind: "startsWith",
|
|
856
856
|
value: e,
|
|
857
|
-
...
|
|
857
|
+
...f.errToObj(n)
|
|
858
858
|
});
|
|
859
859
|
}
|
|
860
860
|
endsWith(e, n) {
|
|
861
861
|
return this._addCheck({
|
|
862
862
|
kind: "endsWith",
|
|
863
863
|
value: e,
|
|
864
|
-
...
|
|
864
|
+
...f.errToObj(n)
|
|
865
865
|
});
|
|
866
866
|
}
|
|
867
867
|
min(e, n) {
|
|
868
868
|
return this._addCheck({
|
|
869
869
|
kind: "min",
|
|
870
870
|
value: e,
|
|
871
|
-
...
|
|
871
|
+
...f.errToObj(n)
|
|
872
872
|
});
|
|
873
873
|
}
|
|
874
874
|
max(e, n) {
|
|
875
875
|
return this._addCheck({
|
|
876
876
|
kind: "max",
|
|
877
877
|
value: e,
|
|
878
|
-
...
|
|
878
|
+
...f.errToObj(n)
|
|
879
879
|
});
|
|
880
880
|
}
|
|
881
881
|
length(e, n) {
|
|
882
882
|
return this._addCheck({
|
|
883
883
|
kind: "length",
|
|
884
884
|
value: e,
|
|
885
|
-
...
|
|
885
|
+
...f.errToObj(n)
|
|
886
886
|
});
|
|
887
887
|
}
|
|
888
888
|
/**
|
|
@@ -890,7 +890,7 @@ class O extends v {
|
|
|
890
890
|
* @see {@link ZodString.min}
|
|
891
891
|
*/
|
|
892
892
|
nonempty(e) {
|
|
893
|
-
return this.min(1,
|
|
893
|
+
return this.min(1, f.errToObj(e));
|
|
894
894
|
}
|
|
895
895
|
trim() {
|
|
896
896
|
return new O({
|
|
@@ -974,8 +974,8 @@ O.create = (t) => {
|
|
|
974
974
|
...y(t)
|
|
975
975
|
});
|
|
976
976
|
};
|
|
977
|
-
function
|
|
978
|
-
const n = (t.toString().split(".")[1] || "").length,
|
|
977
|
+
function Nt(t, e) {
|
|
978
|
+
const n = (t.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, a = n > s ? n : s, i = parseInt(t.toFixed(a).replace(".", "")), o = parseInt(e.toFixed(a).replace(".", ""));
|
|
979
979
|
return i % o / Math.pow(10, a);
|
|
980
980
|
}
|
|
981
981
|
class P extends v {
|
|
@@ -983,59 +983,59 @@ class P extends v {
|
|
|
983
983
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
984
984
|
}
|
|
985
985
|
_parse(e) {
|
|
986
|
-
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !==
|
|
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:
|
|
990
|
-
expected:
|
|
989
|
+
code: d.invalid_type,
|
|
990
|
+
expected: h.number,
|
|
991
991
|
received: i.parsedType
|
|
992
992
|
}), g;
|
|
993
993
|
}
|
|
994
|
-
let
|
|
994
|
+
let s;
|
|
995
995
|
const a = new w();
|
|
996
996
|
for (const i of this._def.checks)
|
|
997
|
-
i.kind === "int" ? b.isInteger(e.data) || (
|
|
998
|
-
code:
|
|
997
|
+
i.kind === "int" ? b.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), p(s, {
|
|
998
|
+
code: d.invalid_type,
|
|
999
999
|
expected: "integer",
|
|
1000
1000
|
received: "float",
|
|
1001
1001
|
message: i.message
|
|
1002
|
-
}), a.dirty()) : i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (
|
|
1003
|
-
code:
|
|
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: d.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
|
-
}), a.dirty()) : i.kind === "max" ? (i.inclusive ? e.data > i.value : e.data >= i.value) && (
|
|
1010
|
-
code:
|
|
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: d.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
|
-
}), a.dirty()) : i.kind === "multipleOf" ?
|
|
1017
|
-
code:
|
|
1016
|
+
}), a.dirty()) : i.kind === "multipleOf" ? Nt(e.data, i.value) !== 0 && (s = this._getOrReturnCtx(e, s), p(s, {
|
|
1017
|
+
code: d.not_multiple_of,
|
|
1018
1018
|
multipleOf: i.value,
|
|
1019
1019
|
message: i.message
|
|
1020
|
-
}), a.dirty()) : i.kind === "finite" ? Number.isFinite(e.data) || (
|
|
1021
|
-
code:
|
|
1020
|
+
}), a.dirty()) : i.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s), p(s, {
|
|
1021
|
+
code: d.not_finite,
|
|
1022
1022
|
message: i.message
|
|
1023
1023
|
}), a.dirty()) : b.assertNever(i);
|
|
1024
1024
|
return { status: a.value, value: e.data };
|
|
1025
1025
|
}
|
|
1026
1026
|
gte(e, n) {
|
|
1027
|
-
return this.setLimit("min", e, !0,
|
|
1027
|
+
return this.setLimit("min", e, !0, f.toString(n));
|
|
1028
1028
|
}
|
|
1029
1029
|
gt(e, n) {
|
|
1030
|
-
return this.setLimit("min", e, !1,
|
|
1030
|
+
return this.setLimit("min", e, !1, f.toString(n));
|
|
1031
1031
|
}
|
|
1032
1032
|
lte(e, n) {
|
|
1033
|
-
return this.setLimit("max", e, !0,
|
|
1033
|
+
return this.setLimit("max", e, !0, f.toString(n));
|
|
1034
1034
|
}
|
|
1035
1035
|
lt(e, n) {
|
|
1036
|
-
return this.setLimit("max", e, !1,
|
|
1036
|
+
return this.setLimit("max", e, !1, f.toString(n));
|
|
1037
1037
|
}
|
|
1038
|
-
setLimit(e, n,
|
|
1038
|
+
setLimit(e, n, s, a) {
|
|
1039
1039
|
return new P({
|
|
1040
1040
|
...this._def,
|
|
1041
1041
|
checks: [
|
|
@@ -1043,8 +1043,8 @@ class P extends v {
|
|
|
1043
1043
|
{
|
|
1044
1044
|
kind: e,
|
|
1045
1045
|
value: n,
|
|
1046
|
-
inclusive:
|
|
1047
|
-
message:
|
|
1046
|
+
inclusive: s,
|
|
1047
|
+
message: f.toString(a)
|
|
1048
1048
|
}
|
|
1049
1049
|
]
|
|
1050
1050
|
});
|
|
@@ -1058,7 +1058,7 @@ class P extends v {
|
|
|
1058
1058
|
int(e) {
|
|
1059
1059
|
return this._addCheck({
|
|
1060
1060
|
kind: "int",
|
|
1061
|
-
message:
|
|
1061
|
+
message: f.toString(e)
|
|
1062
1062
|
});
|
|
1063
1063
|
}
|
|
1064
1064
|
positive(e) {
|
|
@@ -1066,7 +1066,7 @@ class P extends v {
|
|
|
1066
1066
|
kind: "min",
|
|
1067
1067
|
value: 0,
|
|
1068
1068
|
inclusive: !1,
|
|
1069
|
-
message:
|
|
1069
|
+
message: f.toString(e)
|
|
1070
1070
|
});
|
|
1071
1071
|
}
|
|
1072
1072
|
negative(e) {
|
|
@@ -1074,7 +1074,7 @@ class P extends v {
|
|
|
1074
1074
|
kind: "max",
|
|
1075
1075
|
value: 0,
|
|
1076
1076
|
inclusive: !1,
|
|
1077
|
-
message:
|
|
1077
|
+
message: f.toString(e)
|
|
1078
1078
|
});
|
|
1079
1079
|
}
|
|
1080
1080
|
nonpositive(e) {
|
|
@@ -1082,7 +1082,7 @@ class P extends v {
|
|
|
1082
1082
|
kind: "max",
|
|
1083
1083
|
value: 0,
|
|
1084
1084
|
inclusive: !0,
|
|
1085
|
-
message:
|
|
1085
|
+
message: f.toString(e)
|
|
1086
1086
|
});
|
|
1087
1087
|
}
|
|
1088
1088
|
nonnegative(e) {
|
|
@@ -1090,20 +1090,20 @@ class P extends v {
|
|
|
1090
1090
|
kind: "min",
|
|
1091
1091
|
value: 0,
|
|
1092
1092
|
inclusive: !0,
|
|
1093
|
-
message:
|
|
1093
|
+
message: f.toString(e)
|
|
1094
1094
|
});
|
|
1095
1095
|
}
|
|
1096
1096
|
multipleOf(e, n) {
|
|
1097
1097
|
return this._addCheck({
|
|
1098
1098
|
kind: "multipleOf",
|
|
1099
1099
|
value: e,
|
|
1100
|
-
message:
|
|
1100
|
+
message: f.toString(n)
|
|
1101
1101
|
});
|
|
1102
1102
|
}
|
|
1103
1103
|
finite(e) {
|
|
1104
1104
|
return this._addCheck({
|
|
1105
1105
|
kind: "finite",
|
|
1106
|
-
message:
|
|
1106
|
+
message: f.toString(e)
|
|
1107
1107
|
});
|
|
1108
1108
|
}
|
|
1109
1109
|
safe(e) {
|
|
@@ -1111,12 +1111,12 @@ class P extends v {
|
|
|
1111
1111
|
kind: "min",
|
|
1112
1112
|
inclusive: !0,
|
|
1113
1113
|
value: Number.MIN_SAFE_INTEGER,
|
|
1114
|
-
message:
|
|
1114
|
+
message: f.toString(e)
|
|
1115
1115
|
})._addCheck({
|
|
1116
1116
|
kind: "max",
|
|
1117
1117
|
inclusive: !0,
|
|
1118
1118
|
value: Number.MAX_SAFE_INTEGER,
|
|
1119
|
-
message:
|
|
1119
|
+
message: f.toString(e)
|
|
1120
1120
|
});
|
|
1121
1121
|
}
|
|
1122
1122
|
get minValue() {
|
|
@@ -1136,10 +1136,10 @@ class P extends v {
|
|
|
1136
1136
|
}
|
|
1137
1137
|
get isFinite() {
|
|
1138
1138
|
let e = null, n = null;
|
|
1139
|
-
for (const
|
|
1140
|
-
if (
|
|
1139
|
+
for (const s of this._def.checks) {
|
|
1140
|
+
if (s.kind === "finite" || s.kind === "int" || s.kind === "multipleOf")
|
|
1141
1141
|
return !0;
|
|
1142
|
-
|
|
1142
|
+
s.kind === "min" ? (n === null || s.value > n) && (n = s.value) : s.kind === "max" && (e === null || s.value < e) && (e = s.value);
|
|
1143
1143
|
}
|
|
1144
1144
|
return Number.isFinite(n) && Number.isFinite(e);
|
|
1145
1145
|
}
|
|
@@ -1155,49 +1155,49 @@ class M extends v {
|
|
|
1155
1155
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1156
1156
|
}
|
|
1157
1157
|
_parse(e) {
|
|
1158
|
-
if (this._def.coerce && (e.data = BigInt(e.data)), this._getType(e) !==
|
|
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:
|
|
1162
|
-
expected:
|
|
1161
|
+
code: d.invalid_type,
|
|
1162
|
+
expected: h.bigint,
|
|
1163
1163
|
received: i.parsedType
|
|
1164
1164
|
}), g;
|
|
1165
1165
|
}
|
|
1166
|
-
let
|
|
1166
|
+
let s;
|
|
1167
1167
|
const a = new w();
|
|
1168
1168
|
for (const i of this._def.checks)
|
|
1169
|
-
i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (
|
|
1170
|
-
code:
|
|
1169
|
+
i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (s = this._getOrReturnCtx(e, s), p(s, {
|
|
1170
|
+
code: d.too_small,
|
|
1171
1171
|
type: "bigint",
|
|
1172
1172
|
minimum: i.value,
|
|
1173
1173
|
inclusive: i.inclusive,
|
|
1174
1174
|
message: i.message
|
|
1175
|
-
}), a.dirty()) : i.kind === "max" ? (i.inclusive ? e.data > i.value : e.data >= i.value) && (
|
|
1176
|
-
code:
|
|
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: d.too_big,
|
|
1177
1177
|
type: "bigint",
|
|
1178
1178
|
maximum: i.value,
|
|
1179
1179
|
inclusive: i.inclusive,
|
|
1180
1180
|
message: i.message
|
|
1181
|
-
}), a.dirty()) : i.kind === "multipleOf" ? e.data % i.value !== BigInt(0) && (
|
|
1182
|
-
code:
|
|
1181
|
+
}), a.dirty()) : i.kind === "multipleOf" ? e.data % i.value !== BigInt(0) && (s = this._getOrReturnCtx(e, s), p(s, {
|
|
1182
|
+
code: d.not_multiple_of,
|
|
1183
1183
|
multipleOf: i.value,
|
|
1184
1184
|
message: i.message
|
|
1185
1185
|
}), a.dirty()) : b.assertNever(i);
|
|
1186
1186
|
return { status: a.value, value: e.data };
|
|
1187
1187
|
}
|
|
1188
1188
|
gte(e, n) {
|
|
1189
|
-
return this.setLimit("min", e, !0,
|
|
1189
|
+
return this.setLimit("min", e, !0, f.toString(n));
|
|
1190
1190
|
}
|
|
1191
1191
|
gt(e, n) {
|
|
1192
|
-
return this.setLimit("min", e, !1,
|
|
1192
|
+
return this.setLimit("min", e, !1, f.toString(n));
|
|
1193
1193
|
}
|
|
1194
1194
|
lte(e, n) {
|
|
1195
|
-
return this.setLimit("max", e, !0,
|
|
1195
|
+
return this.setLimit("max", e, !0, f.toString(n));
|
|
1196
1196
|
}
|
|
1197
1197
|
lt(e, n) {
|
|
1198
|
-
return this.setLimit("max", e, !1,
|
|
1198
|
+
return this.setLimit("max", e, !1, f.toString(n));
|
|
1199
1199
|
}
|
|
1200
|
-
setLimit(e, n,
|
|
1200
|
+
setLimit(e, n, s, a) {
|
|
1201
1201
|
return new M({
|
|
1202
1202
|
...this._def,
|
|
1203
1203
|
checks: [
|
|
@@ -1205,8 +1205,8 @@ class M extends v {
|
|
|
1205
1205
|
{
|
|
1206
1206
|
kind: e,
|
|
1207
1207
|
value: n,
|
|
1208
|
-
inclusive:
|
|
1209
|
-
message:
|
|
1208
|
+
inclusive: s,
|
|
1209
|
+
message: f.toString(a)
|
|
1210
1210
|
}
|
|
1211
1211
|
]
|
|
1212
1212
|
});
|
|
@@ -1222,7 +1222,7 @@ class M extends v {
|
|
|
1222
1222
|
kind: "min",
|
|
1223
1223
|
value: BigInt(0),
|
|
1224
1224
|
inclusive: !1,
|
|
1225
|
-
message:
|
|
1225
|
+
message: f.toString(e)
|
|
1226
1226
|
});
|
|
1227
1227
|
}
|
|
1228
1228
|
negative(e) {
|
|
@@ -1230,7 +1230,7 @@ class M extends v {
|
|
|
1230
1230
|
kind: "max",
|
|
1231
1231
|
value: BigInt(0),
|
|
1232
1232
|
inclusive: !1,
|
|
1233
|
-
message:
|
|
1233
|
+
message: f.toString(e)
|
|
1234
1234
|
});
|
|
1235
1235
|
}
|
|
1236
1236
|
nonpositive(e) {
|
|
@@ -1238,7 +1238,7 @@ class M extends v {
|
|
|
1238
1238
|
kind: "max",
|
|
1239
1239
|
value: BigInt(0),
|
|
1240
1240
|
inclusive: !0,
|
|
1241
|
-
message:
|
|
1241
|
+
message: f.toString(e)
|
|
1242
1242
|
});
|
|
1243
1243
|
}
|
|
1244
1244
|
nonnegative(e) {
|
|
@@ -1246,14 +1246,14 @@ class M extends v {
|
|
|
1246
1246
|
kind: "min",
|
|
1247
1247
|
value: BigInt(0),
|
|
1248
1248
|
inclusive: !0,
|
|
1249
|
-
message:
|
|
1249
|
+
message: f.toString(e)
|
|
1250
1250
|
});
|
|
1251
1251
|
}
|
|
1252
1252
|
multipleOf(e, n) {
|
|
1253
1253
|
return this._addCheck({
|
|
1254
1254
|
kind: "multipleOf",
|
|
1255
1255
|
value: e,
|
|
1256
|
-
message:
|
|
1256
|
+
message: f.toString(n)
|
|
1257
1257
|
});
|
|
1258
1258
|
}
|
|
1259
1259
|
get minValue() {
|
|
@@ -1278,60 +1278,60 @@ M.create = (t) => {
|
|
|
1278
1278
|
...y(t)
|
|
1279
1279
|
});
|
|
1280
1280
|
};
|
|
1281
|
-
class
|
|
1281
|
+
class ne extends v {
|
|
1282
1282
|
_parse(e) {
|
|
1283
|
-
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !==
|
|
1284
|
-
const
|
|
1285
|
-
return p(
|
|
1286
|
-
code:
|
|
1287
|
-
expected:
|
|
1288
|
-
received:
|
|
1283
|
+
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== h.boolean) {
|
|
1284
|
+
const s = this._getOrReturnCtx(e);
|
|
1285
|
+
return p(s, {
|
|
1286
|
+
code: d.invalid_type,
|
|
1287
|
+
expected: h.boolean,
|
|
1288
|
+
received: s.parsedType
|
|
1289
1289
|
}), g;
|
|
1290
1290
|
}
|
|
1291
1291
|
return S(e.data);
|
|
1292
1292
|
}
|
|
1293
1293
|
}
|
|
1294
|
-
|
|
1294
|
+
ne.create = (t) => new ne({
|
|
1295
1295
|
typeName: _.ZodBoolean,
|
|
1296
1296
|
coerce: (t == null ? void 0 : t.coerce) || !1,
|
|
1297
1297
|
...y(t)
|
|
1298
1298
|
});
|
|
1299
1299
|
class V extends v {
|
|
1300
1300
|
_parse(e) {
|
|
1301
|
-
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !==
|
|
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:
|
|
1305
|
-
expected:
|
|
1304
|
+
code: d.invalid_type,
|
|
1305
|
+
expected: h.date,
|
|
1306
1306
|
received: i.parsedType
|
|
1307
1307
|
}), g;
|
|
1308
1308
|
}
|
|
1309
1309
|
if (isNaN(e.data.getTime())) {
|
|
1310
1310
|
const i = this._getOrReturnCtx(e);
|
|
1311
1311
|
return p(i, {
|
|
1312
|
-
code:
|
|
1312
|
+
code: d.invalid_date
|
|
1313
1313
|
}), g;
|
|
1314
1314
|
}
|
|
1315
|
-
const
|
|
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: d.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
|
-
}),
|
|
1326
|
-
code:
|
|
1325
|
+
}), s.dirty()) : i.kind === "max" ? e.data.getTime() > i.value && (a = this._getOrReturnCtx(e, a), p(a, {
|
|
1326
|
+
code: d.too_big,
|
|
1327
1327
|
message: i.message,
|
|
1328
1328
|
inclusive: !0,
|
|
1329
1329
|
exact: !1,
|
|
1330
1330
|
maximum: i.value,
|
|
1331
1331
|
type: "date"
|
|
1332
|
-
}),
|
|
1332
|
+
}), s.dirty()) : b.assertNever(i);
|
|
1333
1333
|
return {
|
|
1334
|
-
status:
|
|
1334
|
+
status: s.value,
|
|
1335
1335
|
value: new Date(e.data.getTime())
|
|
1336
1336
|
};
|
|
1337
1337
|
}
|
|
@@ -1345,14 +1345,14 @@ class V extends v {
|
|
|
1345
1345
|
return this._addCheck({
|
|
1346
1346
|
kind: "min",
|
|
1347
1347
|
value: e.getTime(),
|
|
1348
|
-
message:
|
|
1348
|
+
message: f.toString(n)
|
|
1349
1349
|
});
|
|
1350
1350
|
}
|
|
1351
1351
|
max(e, n) {
|
|
1352
1352
|
return this._addCheck({
|
|
1353
1353
|
kind: "max",
|
|
1354
1354
|
value: e.getTime(),
|
|
1355
|
-
message:
|
|
1355
|
+
message: f.toString(n)
|
|
1356
1356
|
});
|
|
1357
1357
|
}
|
|
1358
1358
|
get minDate() {
|
|
@@ -1374,58 +1374,58 @@ V.create = (t) => new V({
|
|
|
1374
1374
|
typeName: _.ZodDate,
|
|
1375
1375
|
...y(t)
|
|
1376
1376
|
});
|
|
1377
|
-
class
|
|
1377
|
+
class ye extends v {
|
|
1378
1378
|
_parse(e) {
|
|
1379
|
-
if (this._getType(e) !==
|
|
1380
|
-
const
|
|
1381
|
-
return p(
|
|
1382
|
-
code:
|
|
1383
|
-
expected:
|
|
1384
|
-
received:
|
|
1379
|
+
if (this._getType(e) !== h.symbol) {
|
|
1380
|
+
const s = this._getOrReturnCtx(e);
|
|
1381
|
+
return p(s, {
|
|
1382
|
+
code: d.invalid_type,
|
|
1383
|
+
expected: h.symbol,
|
|
1384
|
+
received: s.parsedType
|
|
1385
1385
|
}), g;
|
|
1386
1386
|
}
|
|
1387
1387
|
return S(e.data);
|
|
1388
1388
|
}
|
|
1389
1389
|
}
|
|
1390
|
-
|
|
1390
|
+
ye.create = (t) => new ye({
|
|
1391
1391
|
typeName: _.ZodSymbol,
|
|
1392
1392
|
...y(t)
|
|
1393
1393
|
});
|
|
1394
|
-
class
|
|
1394
|
+
class re extends v {
|
|
1395
1395
|
_parse(e) {
|
|
1396
|
-
if (this._getType(e) !==
|
|
1397
|
-
const
|
|
1398
|
-
return p(
|
|
1399
|
-
code:
|
|
1400
|
-
expected:
|
|
1401
|
-
received:
|
|
1396
|
+
if (this._getType(e) !== h.undefined) {
|
|
1397
|
+
const s = this._getOrReturnCtx(e);
|
|
1398
|
+
return p(s, {
|
|
1399
|
+
code: d.invalid_type,
|
|
1400
|
+
expected: h.undefined,
|
|
1401
|
+
received: s.parsedType
|
|
1402
1402
|
}), g;
|
|
1403
1403
|
}
|
|
1404
1404
|
return S(e.data);
|
|
1405
1405
|
}
|
|
1406
1406
|
}
|
|
1407
|
-
|
|
1407
|
+
re.create = (t) => new re({
|
|
1408
1408
|
typeName: _.ZodUndefined,
|
|
1409
1409
|
...y(t)
|
|
1410
1410
|
});
|
|
1411
|
-
class
|
|
1411
|
+
class se extends v {
|
|
1412
1412
|
_parse(e) {
|
|
1413
|
-
if (this._getType(e) !==
|
|
1414
|
-
const
|
|
1415
|
-
return p(
|
|
1416
|
-
code:
|
|
1417
|
-
expected:
|
|
1418
|
-
received:
|
|
1413
|
+
if (this._getType(e) !== h.null) {
|
|
1414
|
+
const s = this._getOrReturnCtx(e);
|
|
1415
|
+
return p(s, {
|
|
1416
|
+
code: d.invalid_type,
|
|
1417
|
+
expected: h.null,
|
|
1418
|
+
received: s.parsedType
|
|
1419
1419
|
}), g;
|
|
1420
1420
|
}
|
|
1421
1421
|
return S(e.data);
|
|
1422
1422
|
}
|
|
1423
1423
|
}
|
|
1424
|
-
|
|
1424
|
+
se.create = (t) => new se({
|
|
1425
1425
|
typeName: _.ZodNull,
|
|
1426
1426
|
...y(t)
|
|
1427
1427
|
});
|
|
1428
|
-
class
|
|
1428
|
+
class Y extends v {
|
|
1429
1429
|
constructor() {
|
|
1430
1430
|
super(...arguments), this._any = !0;
|
|
1431
1431
|
}
|
|
@@ -1433,7 +1433,7 @@ class K extends v {
|
|
|
1433
1433
|
return S(e.data);
|
|
1434
1434
|
}
|
|
1435
1435
|
}
|
|
1436
|
-
|
|
1436
|
+
Y.create = (t) => new Y({
|
|
1437
1437
|
typeName: _.ZodAny,
|
|
1438
1438
|
...y(t)
|
|
1439
1439
|
});
|
|
@@ -1453,8 +1453,8 @@ class R extends v {
|
|
|
1453
1453
|
_parse(e) {
|
|
1454
1454
|
const n = this._getOrReturnCtx(e);
|
|
1455
1455
|
return p(n, {
|
|
1456
|
-
code:
|
|
1457
|
-
expected:
|
|
1456
|
+
code: d.invalid_type,
|
|
1457
|
+
expected: h.never,
|
|
1458
1458
|
received: n.parsedType
|
|
1459
1459
|
}), g;
|
|
1460
1460
|
}
|
|
@@ -1463,89 +1463,89 @@ R.create = (t) => new R({
|
|
|
1463
1463
|
typeName: _.ZodNever,
|
|
1464
1464
|
...y(t)
|
|
1465
1465
|
});
|
|
1466
|
-
class
|
|
1466
|
+
class ve extends v {
|
|
1467
1467
|
_parse(e) {
|
|
1468
|
-
if (this._getType(e) !==
|
|
1469
|
-
const
|
|
1470
|
-
return p(
|
|
1471
|
-
code:
|
|
1472
|
-
expected:
|
|
1473
|
-
received:
|
|
1468
|
+
if (this._getType(e) !== h.undefined) {
|
|
1469
|
+
const s = this._getOrReturnCtx(e);
|
|
1470
|
+
return p(s, {
|
|
1471
|
+
code: d.invalid_type,
|
|
1472
|
+
expected: h.void,
|
|
1473
|
+
received: s.parsedType
|
|
1474
1474
|
}), g;
|
|
1475
1475
|
}
|
|
1476
1476
|
return S(e.data);
|
|
1477
1477
|
}
|
|
1478
1478
|
}
|
|
1479
|
-
|
|
1479
|
+
ve.create = (t) => new ve({
|
|
1480
1480
|
typeName: _.ZodVoid,
|
|
1481
1481
|
...y(t)
|
|
1482
1482
|
});
|
|
1483
|
-
class
|
|
1483
|
+
class j extends v {
|
|
1484
1484
|
_parse(e) {
|
|
1485
|
-
const { ctx: n, status:
|
|
1486
|
-
if (n.parsedType !==
|
|
1485
|
+
const { ctx: n, status: s } = this._processInputParams(e), a = this._def;
|
|
1486
|
+
if (n.parsedType !== h.array)
|
|
1487
1487
|
return p(n, {
|
|
1488
|
-
code:
|
|
1489
|
-
expected:
|
|
1488
|
+
code: d.invalid_type,
|
|
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, c = n.data.length < a.exactLength.value;
|
|
1494
|
+
(o || c) && (p(n, {
|
|
1495
|
+
code: o ? d.too_big : d.too_small,
|
|
1496
|
+
minimum: c ? a.exactLength.value : void 0,
|
|
1497
1497
|
maximum: o ? a.exactLength.value : void 0,
|
|
1498
1498
|
type: "array",
|
|
1499
1499
|
inclusive: !0,
|
|
1500
1500
|
exact: !0,
|
|
1501
1501
|
message: a.exactLength.message
|
|
1502
|
-
}),
|
|
1502
|
+
}), s.dirty());
|
|
1503
1503
|
}
|
|
1504
1504
|
if (a.minLength !== null && n.data.length < a.minLength.value && (p(n, {
|
|
1505
|
-
code:
|
|
1505
|
+
code: d.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
|
-
}),
|
|
1512
|
-
code:
|
|
1511
|
+
}), s.dirty()), a.maxLength !== null && n.data.length > a.maxLength.value && (p(n, {
|
|
1512
|
+
code: d.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
|
-
}),
|
|
1519
|
-
return Promise.all([...n.data].map((o,
|
|
1520
|
-
const i = [...n.data].map((o,
|
|
1521
|
-
return w.mergeArray(
|
|
1518
|
+
}), s.dirty()), n.common.async)
|
|
1519
|
+
return Promise.all([...n.data].map((o, c) => a.type._parseAsync(new Z(n, o, n.path, c)))).then((o) => w.mergeArray(s, o));
|
|
1520
|
+
const i = [...n.data].map((o, c) => a.type._parseSync(new Z(n, o, n.path, c)));
|
|
1521
|
+
return w.mergeArray(s, i);
|
|
1522
1522
|
}
|
|
1523
1523
|
get element() {
|
|
1524
1524
|
return this._def.type;
|
|
1525
1525
|
}
|
|
1526
1526
|
min(e, n) {
|
|
1527
|
-
return new
|
|
1527
|
+
return new j({
|
|
1528
1528
|
...this._def,
|
|
1529
|
-
minLength: { value: e, message:
|
|
1529
|
+
minLength: { value: e, message: f.toString(n) }
|
|
1530
1530
|
});
|
|
1531
1531
|
}
|
|
1532
1532
|
max(e, n) {
|
|
1533
|
-
return new
|
|
1533
|
+
return new j({
|
|
1534
1534
|
...this._def,
|
|
1535
|
-
maxLength: { value: e, message:
|
|
1535
|
+
maxLength: { value: e, message: f.toString(n) }
|
|
1536
1536
|
});
|
|
1537
1537
|
}
|
|
1538
1538
|
length(e, n) {
|
|
1539
|
-
return new
|
|
1539
|
+
return new j({
|
|
1540
1540
|
...this._def,
|
|
1541
|
-
exactLength: { value: e, message:
|
|
1541
|
+
exactLength: { value: e, message: f.toString(n) }
|
|
1542
1542
|
});
|
|
1543
1543
|
}
|
|
1544
1544
|
nonempty(e) {
|
|
1545
1545
|
return this.min(1, e);
|
|
1546
1546
|
}
|
|
1547
1547
|
}
|
|
1548
|
-
|
|
1548
|
+
j.create = (t, e) => new j({
|
|
1549
1549
|
type: t,
|
|
1550
1550
|
minLength: null,
|
|
1551
1551
|
maxLength: null,
|
|
@@ -1553,21 +1553,21 @@ E.create = (t, e) => new E({
|
|
|
1553
1553
|
typeName: _.ZodArray,
|
|
1554
1554
|
...y(e)
|
|
1555
1555
|
});
|
|
1556
|
-
function
|
|
1556
|
+
function q(t) {
|
|
1557
1557
|
if (t instanceof k) {
|
|
1558
1558
|
const e = {};
|
|
1559
1559
|
for (const n in t.shape) {
|
|
1560
|
-
const
|
|
1561
|
-
e[n] =
|
|
1560
|
+
const s = t.shape[n];
|
|
1561
|
+
e[n] = C.create(q(s));
|
|
1562
1562
|
}
|
|
1563
1563
|
return new k({
|
|
1564
1564
|
...t._def,
|
|
1565
1565
|
shape: () => e
|
|
1566
1566
|
});
|
|
1567
|
-
} else return t instanceof
|
|
1567
|
+
} else return t instanceof j ? new j({
|
|
1568
1568
|
...t._def,
|
|
1569
|
-
type:
|
|
1570
|
-
}) : t instanceof
|
|
1569
|
+
type: q(t.element)
|
|
1570
|
+
}) : t instanceof C ? C.create(q(t.unwrap())) : t instanceof D ? D.create(q(t.unwrap())) : t instanceof N ? N.create(t.items.map((e) => q(e))) : t;
|
|
1571
1571
|
}
|
|
1572
1572
|
class k extends v {
|
|
1573
1573
|
constructor() {
|
|
@@ -1580,18 +1580,18 @@ class k extends v {
|
|
|
1580
1580
|
return this._cached = { shape: e, keys: n };
|
|
1581
1581
|
}
|
|
1582
1582
|
_parse(e) {
|
|
1583
|
-
if (this._getType(e) !==
|
|
1583
|
+
if (this._getType(e) !== h.object) {
|
|
1584
1584
|
const l = this._getOrReturnCtx(e);
|
|
1585
1585
|
return p(l, {
|
|
1586
|
-
code:
|
|
1587
|
-
expected:
|
|
1586
|
+
code: d.invalid_type,
|
|
1587
|
+
expected: h.object,
|
|
1588
1588
|
received: l.parsedType
|
|
1589
1589
|
}), g;
|
|
1590
1590
|
}
|
|
1591
|
-
const { status:
|
|
1591
|
+
const { status: s, ctx: a } = this._processInputParams(e), { shape: i, keys: o } = this._getCached(), c = [];
|
|
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) || c.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 c)
|
|
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:
|
|
1616
|
-
}),
|
|
1613
|
+
c.length > 0 && (p(a, {
|
|
1614
|
+
code: d.unrecognized_keys,
|
|
1615
|
+
keys: c
|
|
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 c) {
|
|
1621
1621
|
const x = a.data[m];
|
|
1622
1622
|
u.push({
|
|
1623
1623
|
key: { status: "valid", value: m },
|
|
@@ -1640,21 +1640,21 @@ class k extends v {
|
|
|
1640
1640
|
});
|
|
1641
1641
|
}
|
|
1642
1642
|
return l;
|
|
1643
|
-
}).then((l) => w.mergeObjectSync(
|
|
1643
|
+
}).then((l) => w.mergeObjectSync(s, l)) : w.mergeObjectSync(s, u);
|
|
1644
1644
|
}
|
|
1645
1645
|
get shape() {
|
|
1646
1646
|
return this._def.shape();
|
|
1647
1647
|
}
|
|
1648
1648
|
strict(e) {
|
|
1649
|
-
return
|
|
1649
|
+
return f.errToObj, new k({
|
|
1650
1650
|
...this._def,
|
|
1651
1651
|
unknownKeys: "strict",
|
|
1652
1652
|
...e !== void 0 ? {
|
|
1653
|
-
errorMap: (n,
|
|
1654
|
-
var a, i, o,
|
|
1655
|
-
const u = (o = (i = (a = this._def).errorMap) === null || i === void 0 ? void 0 : i.call(a, n,
|
|
1653
|
+
errorMap: (n, s) => {
|
|
1654
|
+
var a, i, o, c;
|
|
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: (c = f.errToObj(e).message) !== null && c !== void 0 ? c : u
|
|
1658
1658
|
} : {
|
|
1659
1659
|
message: u
|
|
1660
1660
|
};
|
|
@@ -1783,8 +1783,8 @@ class k extends v {
|
|
|
1783
1783
|
}
|
|
1784
1784
|
pick(e) {
|
|
1785
1785
|
const n = {};
|
|
1786
|
-
return b.objectKeys(e).forEach((
|
|
1787
|
-
e[
|
|
1786
|
+
return b.objectKeys(e).forEach((s) => {
|
|
1787
|
+
e[s] && this.shape[s] && (n[s] = this.shape[s]);
|
|
1788
1788
|
}), new k({
|
|
1789
1789
|
...this._def,
|
|
1790
1790
|
shape: () => n
|
|
@@ -1792,8 +1792,8 @@ class k extends v {
|
|
|
1792
1792
|
}
|
|
1793
1793
|
omit(e) {
|
|
1794
1794
|
const n = {};
|
|
1795
|
-
return b.objectKeys(this.shape).forEach((
|
|
1796
|
-
e[
|
|
1795
|
+
return b.objectKeys(this.shape).forEach((s) => {
|
|
1796
|
+
e[s] || (n[s] = this.shape[s]);
|
|
1797
1797
|
}), new k({
|
|
1798
1798
|
...this._def,
|
|
1799
1799
|
shape: () => n
|
|
@@ -1803,13 +1803,13 @@ class k extends v {
|
|
|
1803
1803
|
* @deprecated
|
|
1804
1804
|
*/
|
|
1805
1805
|
deepPartial() {
|
|
1806
|
-
return
|
|
1806
|
+
return q(this);
|
|
1807
1807
|
}
|
|
1808
1808
|
partial(e) {
|
|
1809
1809
|
const n = {};
|
|
1810
|
-
return b.objectKeys(this.shape).forEach((
|
|
1811
|
-
const a = this.shape[
|
|
1812
|
-
e && !e[
|
|
1810
|
+
return b.objectKeys(this.shape).forEach((s) => {
|
|
1811
|
+
const a = this.shape[s];
|
|
1812
|
+
e && !e[s] ? n[s] = a : n[s] = a.optional();
|
|
1813
1813
|
}), new k({
|
|
1814
1814
|
...this._def,
|
|
1815
1815
|
shape: () => n
|
|
@@ -1817,14 +1817,14 @@ class k extends v {
|
|
|
1817
1817
|
}
|
|
1818
1818
|
required(e) {
|
|
1819
1819
|
const n = {};
|
|
1820
|
-
return b.objectKeys(this.shape).forEach((
|
|
1821
|
-
if (e && !e[
|
|
1822
|
-
n[
|
|
1820
|
+
return b.objectKeys(this.shape).forEach((s) => {
|
|
1821
|
+
if (e && !e[s])
|
|
1822
|
+
n[s] = this.shape[s];
|
|
1823
1823
|
else {
|
|
1824
|
-
let i = this.shape[
|
|
1825
|
-
for (; i instanceof
|
|
1824
|
+
let i = this.shape[s];
|
|
1825
|
+
for (; i instanceof C; )
|
|
1826
1826
|
i = i._def.innerType;
|
|
1827
|
-
n[
|
|
1827
|
+
n[s] = i;
|
|
1828
1828
|
}
|
|
1829
1829
|
}), new k({
|
|
1830
1830
|
...this._def,
|
|
@@ -1832,7 +1832,7 @@ class k extends v {
|
|
|
1832
1832
|
});
|
|
1833
1833
|
}
|
|
1834
1834
|
keyof() {
|
|
1835
|
-
return
|
|
1835
|
+
return Je(b.objectKeys(this.shape));
|
|
1836
1836
|
}
|
|
1837
1837
|
}
|
|
1838
1838
|
k.create = (t, e) => new k({
|
|
@@ -1856,24 +1856,24 @@ k.lazycreate = (t, e) => new k({
|
|
|
1856
1856
|
typeName: _.ZodObject,
|
|
1857
1857
|
...y(e)
|
|
1858
1858
|
});
|
|
1859
|
-
class
|
|
1859
|
+
class ae extends v {
|
|
1860
1860
|
_parse(e) {
|
|
1861
|
-
const { ctx: n } = this._processInputParams(e),
|
|
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 c of i)
|
|
1864
|
+
if (c.result.status === "valid")
|
|
1865
|
+
return c.result;
|
|
1866
|
+
for (const c of i)
|
|
1867
|
+
if (c.result.status === "dirty")
|
|
1868
|
+
return n.common.issues.push(...c.ctx.common.issues), c.result;
|
|
1869
|
+
const o = i.map((c) => new T(c.ctx.common.issues));
|
|
1870
1870
|
return p(n, {
|
|
1871
|
-
code:
|
|
1871
|
+
code: d.invalid_union,
|
|
1872
1872
|
unionErrors: o
|
|
1873
1873
|
}), g;
|
|
1874
1874
|
}
|
|
1875
1875
|
if (n.common.async)
|
|
1876
|
-
return Promise.all(
|
|
1876
|
+
return Promise.all(s.map(async (i) => {
|
|
1877
1877
|
const o = {
|
|
1878
1878
|
...n,
|
|
1879
1879
|
common: {
|
|
@@ -1894,7 +1894,7 @@ class se extends v {
|
|
|
1894
1894
|
{
|
|
1895
1895
|
let i;
|
|
1896
1896
|
const o = [];
|
|
1897
|
-
for (const u of
|
|
1897
|
+
for (const u of s) {
|
|
1898
1898
|
const l = {
|
|
1899
1899
|
...n,
|
|
1900
1900
|
common: {
|
|
@@ -1913,10 +1913,10 @@ class se 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 c = o.map((u) => new T(u));
|
|
1917
1917
|
return p(n, {
|
|
1918
|
-
code:
|
|
1919
|
-
unionErrors:
|
|
1918
|
+
code: d.invalid_union,
|
|
1919
|
+
unionErrors: c
|
|
1920
1920
|
}), g;
|
|
1921
1921
|
}
|
|
1922
1922
|
}
|
|
@@ -1924,22 +1924,22 @@ class se extends v {
|
|
|
1924
1924
|
return this._def.options;
|
|
1925
1925
|
}
|
|
1926
1926
|
}
|
|
1927
|
-
|
|
1927
|
+
ae.create = (t, e) => new ae({
|
|
1928
1928
|
options: t,
|
|
1929
1929
|
typeName: _.ZodUnion,
|
|
1930
1930
|
...y(e)
|
|
1931
1931
|
});
|
|
1932
|
-
const I = (t) => t instanceof
|
|
1933
|
-
class
|
|
1932
|
+
const I = (t) => t instanceof ce ? I(t.schema) : t instanceof E ? I(t.innerType()) : t instanceof de ? [t.value] : t instanceof $ ? t.options : t instanceof le ? b.objectValues(t.enum) : t instanceof ue ? I(t._def.innerType) : t instanceof re ? [void 0] : t instanceof se ? [null] : t instanceof C ? [void 0, ...I(t.unwrap())] : t instanceof D ? [null, ...I(t.unwrap())] : t instanceof Pe || t instanceof he ? I(t.unwrap()) : t instanceof pe ? I(t._def.innerType) : [];
|
|
1933
|
+
class xe extends v {
|
|
1934
1934
|
_parse(e) {
|
|
1935
1935
|
const { ctx: n } = this._processInputParams(e);
|
|
1936
|
-
if (n.parsedType !==
|
|
1936
|
+
if (n.parsedType !== h.object)
|
|
1937
1937
|
return p(n, {
|
|
1938
|
-
code:
|
|
1939
|
-
expected:
|
|
1938
|
+
code: d.invalid_type,
|
|
1939
|
+
expected: h.object,
|
|
1940
1940
|
received: n.parsedType
|
|
1941
1941
|
}), g;
|
|
1942
|
-
const
|
|
1942
|
+
const s = this.discriminator, a = n.data[s], i = this.optionsMap.get(a);
|
|
1943
1943
|
return i ? n.common.async ? i._parseAsync({
|
|
1944
1944
|
data: n.data,
|
|
1945
1945
|
path: n.path,
|
|
@@ -1949,9 +1949,9 @@ class ke extends v {
|
|
|
1949
1949
|
path: n.path,
|
|
1950
1950
|
parent: n
|
|
1951
1951
|
}) : (p(n, {
|
|
1952
|
-
code:
|
|
1952
|
+
code: d.invalid_union_discriminator,
|
|
1953
1953
|
options: Array.from(this.optionsMap.keys()),
|
|
1954
|
-
path: [
|
|
1954
|
+
path: [s]
|
|
1955
1955
|
}), g);
|
|
1956
1956
|
}
|
|
1957
1957
|
get discriminator() {
|
|
@@ -1971,86 +1971,86 @@ class ke extends v {
|
|
|
1971
1971
|
* @param types an array of object schemas
|
|
1972
1972
|
* @param params
|
|
1973
1973
|
*/
|
|
1974
|
-
static create(e, n,
|
|
1974
|
+
static create(e, n, s) {
|
|
1975
1975
|
const a = /* @__PURE__ */ new Map();
|
|
1976
1976
|
for (const i of n) {
|
|
1977
1977
|
const o = I(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 c of o) {
|
|
1981
|
+
if (a.has(c))
|
|
1982
|
+
throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);
|
|
1983
|
+
a.set(c, i);
|
|
1984
1984
|
}
|
|
1985
1985
|
}
|
|
1986
|
-
return new
|
|
1986
|
+
return new xe({
|
|
1987
1987
|
typeName: _.ZodDiscriminatedUnion,
|
|
1988
1988
|
discriminator: e,
|
|
1989
1989
|
options: n,
|
|
1990
1990
|
optionsMap: a,
|
|
1991
|
-
...y(
|
|
1991
|
+
...y(s)
|
|
1992
1992
|
});
|
|
1993
1993
|
}
|
|
1994
1994
|
}
|
|
1995
|
-
function
|
|
1996
|
-
const n = A(t),
|
|
1995
|
+
function Ae(t, e) {
|
|
1996
|
+
const n = A(t), s = A(e);
|
|
1997
1997
|
if (t === e)
|
|
1998
1998
|
return { valid: !0, data: t };
|
|
1999
|
-
if (n ===
|
|
2000
|
-
const a = b.objectKeys(e), i = b.objectKeys(t).filter((
|
|
2001
|
-
for (const
|
|
2002
|
-
const u =
|
|
1999
|
+
if (n === h.object && s === h.object) {
|
|
2000
|
+
const a = b.objectKeys(e), i = b.objectKeys(t).filter((c) => a.indexOf(c) !== -1), o = { ...t, ...e };
|
|
2001
|
+
for (const c of i) {
|
|
2002
|
+
const u = Ae(t[c], e[c]);
|
|
2003
2003
|
if (!u.valid)
|
|
2004
2004
|
return { valid: !1 };
|
|
2005
|
-
o[
|
|
2005
|
+
o[c] = u.data;
|
|
2006
2006
|
}
|
|
2007
2007
|
return { valid: !0, data: o };
|
|
2008
|
-
} else if (n ===
|
|
2008
|
+
} else if (n === h.array && s === h.array) {
|
|
2009
2009
|
if (t.length !== e.length)
|
|
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], c = e[i], u = Ae(o, c);
|
|
2014
2014
|
if (!u.valid)
|
|
2015
2015
|
return { valid: !1 };
|
|
2016
2016
|
a.push(u.data);
|
|
2017
2017
|
}
|
|
2018
2018
|
return { valid: !0, data: a };
|
|
2019
|
-
} else return n ===
|
|
2019
|
+
} else return n === h.date && s === h.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
|
|
2020
2020
|
}
|
|
2021
|
-
class
|
|
2021
|
+
class ie extends v {
|
|
2022
2022
|
_parse(e) {
|
|
2023
|
-
const { status: n, ctx:
|
|
2024
|
-
if (
|
|
2023
|
+
const { status: n, ctx: s } = this._processInputParams(e), a = (i, o) => {
|
|
2024
|
+
if (Ie(i) || Ie(o))
|
|
2025
2025
|
return g;
|
|
2026
|
-
const
|
|
2027
|
-
return
|
|
2028
|
-
code:
|
|
2026
|
+
const c = Ae(i.value, o.value);
|
|
2027
|
+
return c.valid ? ((Re(i) || Re(o)) && n.dirty(), { status: n.value, value: c.data }) : (p(s, {
|
|
2028
|
+
code: d.invalid_intersection_types
|
|
2029
2029
|
}), g);
|
|
2030
2030
|
};
|
|
2031
|
-
return
|
|
2031
|
+
return s.common.async ? Promise.all([
|
|
2032
2032
|
this._def.left._parseAsync({
|
|
2033
|
-
data:
|
|
2034
|
-
path:
|
|
2035
|
-
parent:
|
|
2033
|
+
data: s.data,
|
|
2034
|
+
path: s.path,
|
|
2035
|
+
parent: s
|
|
2036
2036
|
}),
|
|
2037
2037
|
this._def.right._parseAsync({
|
|
2038
|
-
data:
|
|
2039
|
-
path:
|
|
2040
|
-
parent:
|
|
2038
|
+
data: s.data,
|
|
2039
|
+
path: s.path,
|
|
2040
|
+
parent: s
|
|
2041
2041
|
})
|
|
2042
2042
|
]).then(([i, o]) => a(i, o)) : a(this._def.left._parseSync({
|
|
2043
|
-
data:
|
|
2044
|
-
path:
|
|
2045
|
-
parent:
|
|
2043
|
+
data: s.data,
|
|
2044
|
+
path: s.path,
|
|
2045
|
+
parent: s
|
|
2046
2046
|
}), this._def.right._parseSync({
|
|
2047
|
-
data:
|
|
2048
|
-
path:
|
|
2049
|
-
parent:
|
|
2047
|
+
data: s.data,
|
|
2048
|
+
path: s.path,
|
|
2049
|
+
parent: s
|
|
2050
2050
|
}));
|
|
2051
2051
|
}
|
|
2052
2052
|
}
|
|
2053
|
-
|
|
2053
|
+
ie.create = (t, e, n) => new ie({
|
|
2054
2054
|
left: t,
|
|
2055
2055
|
right: e,
|
|
2056
2056
|
typeName: _.ZodIntersection,
|
|
@@ -2058,33 +2058,33 @@ ae.create = (t, e, n) => new ae({
|
|
|
2058
2058
|
});
|
|
2059
2059
|
class N extends v {
|
|
2060
2060
|
_parse(e) {
|
|
2061
|
-
const { status: n, ctx:
|
|
2062
|
-
if (
|
|
2063
|
-
return p(
|
|
2064
|
-
code:
|
|
2065
|
-
expected:
|
|
2066
|
-
received:
|
|
2061
|
+
const { status: n, ctx: s } = this._processInputParams(e);
|
|
2062
|
+
if (s.parsedType !== h.array)
|
|
2063
|
+
return p(s, {
|
|
2064
|
+
code: d.invalid_type,
|
|
2065
|
+
expected: h.array,
|
|
2066
|
+
received: s.parsedType
|
|
2067
2067
|
}), g;
|
|
2068
|
-
if (
|
|
2069
|
-
return p(
|
|
2070
|
-
code:
|
|
2068
|
+
if (s.data.length < this._def.items.length)
|
|
2069
|
+
return p(s, {
|
|
2070
|
+
code: d.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
|
-
!this._def.rest &&
|
|
2077
|
-
code:
|
|
2076
|
+
!this._def.rest && s.data.length > this._def.items.length && (p(s, {
|
|
2077
|
+
code: d.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 = [...
|
|
2084
|
-
const u = this._def.items[
|
|
2085
|
-
return u ? u._parse(new Z(
|
|
2083
|
+
const i = [...s.data].map((o, c) => {
|
|
2084
|
+
const u = this._def.items[c] || this._def.rest;
|
|
2085
|
+
return u ? u._parse(new Z(s, o, s.path, c)) : null;
|
|
2086
2086
|
}).filter((o) => !!o);
|
|
2087
|
-
return
|
|
2087
|
+
return s.common.async ? Promise.all(i).then((o) => w.mergeArray(n, o)) : w.mergeArray(n, i);
|
|
2088
2088
|
}
|
|
2089
2089
|
get items() {
|
|
2090
2090
|
return this._def.items;
|
|
@@ -2106,7 +2106,7 @@ N.create = (t, e) => {
|
|
|
2106
2106
|
...y(e)
|
|
2107
2107
|
});
|
|
2108
2108
|
};
|
|
2109
|
-
class
|
|
2109
|
+
class oe extends v {
|
|
2110
2110
|
get keySchema() {
|
|
2111
2111
|
return this._def.keyType;
|
|
2112
2112
|
}
|
|
@@ -2114,32 +2114,32 @@ class ie extends v {
|
|
|
2114
2114
|
return this._def.valueType;
|
|
2115
2115
|
}
|
|
2116
2116
|
_parse(e) {
|
|
2117
|
-
const { status: n, ctx:
|
|
2118
|
-
if (
|
|
2119
|
-
return p(
|
|
2120
|
-
code:
|
|
2121
|
-
expected:
|
|
2122
|
-
received:
|
|
2117
|
+
const { status: n, ctx: s } = this._processInputParams(e);
|
|
2118
|
+
if (s.parsedType !== h.object)
|
|
2119
|
+
return p(s, {
|
|
2120
|
+
code: d.invalid_type,
|
|
2121
|
+
expected: h.object,
|
|
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 c in s.data)
|
|
2126
2126
|
a.push({
|
|
2127
|
-
key: i._parse(new Z(
|
|
2128
|
-
value: o._parse(new Z(
|
|
2129
|
-
alwaysSet:
|
|
2127
|
+
key: i._parse(new Z(s, c, s.path, c)),
|
|
2128
|
+
value: o._parse(new Z(s, s.data[c], s.path, c)),
|
|
2129
|
+
alwaysSet: c in s.data
|
|
2130
2130
|
});
|
|
2131
|
-
return
|
|
2131
|
+
return s.common.async ? w.mergeObjectAsync(n, a) : w.mergeObjectSync(n, a);
|
|
2132
2132
|
}
|
|
2133
2133
|
get element() {
|
|
2134
2134
|
return this._def.valueType;
|
|
2135
2135
|
}
|
|
2136
|
-
static create(e, n,
|
|
2137
|
-
return n instanceof v ? new
|
|
2136
|
+
static create(e, n, s) {
|
|
2137
|
+
return n instanceof v ? new oe({
|
|
2138
2138
|
keyType: e,
|
|
2139
2139
|
valueType: n,
|
|
2140
2140
|
typeName: _.ZodRecord,
|
|
2141
|
-
...y(
|
|
2142
|
-
}) : new
|
|
2141
|
+
...y(s)
|
|
2142
|
+
}) : new oe({
|
|
2143
2143
|
keyType: O.create(),
|
|
2144
2144
|
valueType: e,
|
|
2145
2145
|
typeName: _.ZodRecord,
|
|
@@ -2147,7 +2147,7 @@ class ie extends v {
|
|
|
2147
2147
|
});
|
|
2148
2148
|
}
|
|
2149
2149
|
}
|
|
2150
|
-
class
|
|
2150
|
+
class be extends v {
|
|
2151
2151
|
get keySchema() {
|
|
2152
2152
|
return this._def.keyType;
|
|
2153
2153
|
}
|
|
@@ -2155,41 +2155,41 @@ class ve extends v {
|
|
|
2155
2155
|
return this._def.valueType;
|
|
2156
2156
|
}
|
|
2157
2157
|
_parse(e) {
|
|
2158
|
-
const { status: n, ctx:
|
|
2159
|
-
if (
|
|
2160
|
-
return p(
|
|
2161
|
-
code:
|
|
2162
|
-
expected:
|
|
2163
|
-
received:
|
|
2158
|
+
const { status: n, ctx: s } = this._processInputParams(e);
|
|
2159
|
+
if (s.parsedType !== h.map)
|
|
2160
|
+
return p(s, {
|
|
2161
|
+
code: d.invalid_type,
|
|
2162
|
+
expected: h.map,
|
|
2163
|
+
received: s.parsedType
|
|
2164
2164
|
}), g;
|
|
2165
|
-
const a = this._def.keyType, i = this._def.valueType, o = [...
|
|
2166
|
-
key: a._parse(new Z(
|
|
2167
|
-
value: i._parse(new Z(
|
|
2165
|
+
const a = this._def.keyType, i = this._def.valueType, o = [...s.data.entries()].map(([c, u], l) => ({
|
|
2166
|
+
key: a._parse(new Z(s, c, s.path, [l, "key"])),
|
|
2167
|
+
value: i._parse(new Z(s, u, s.path, [l, "value"]))
|
|
2168
2168
|
}));
|
|
2169
|
-
if (
|
|
2170
|
-
const
|
|
2169
|
+
if (s.common.async) {
|
|
2170
|
+
const c = /* @__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(), c.set(l.value, m.value);
|
|
2177
2177
|
}
|
|
2178
|
-
return { status: n.value, value:
|
|
2178
|
+
return { status: n.value, value: c };
|
|
2179
2179
|
});
|
|
2180
2180
|
} else {
|
|
2181
|
-
const
|
|
2181
|
+
const c = /* @__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(), c.set(l.value, m.value);
|
|
2187
2187
|
}
|
|
2188
|
-
return { status: n.value, value:
|
|
2188
|
+
return { status: n.value, value: c };
|
|
2189
2189
|
}
|
|
2190
2190
|
}
|
|
2191
2191
|
}
|
|
2192
|
-
|
|
2192
|
+
be.create = (t, e, n) => new be({
|
|
2193
2193
|
valueType: e,
|
|
2194
2194
|
keyType: t,
|
|
2195
2195
|
typeName: _.ZodMap,
|
|
@@ -2197,23 +2197,23 @@ ve.create = (t, e, n) => new ve({
|
|
|
2197
2197
|
});
|
|
2198
2198
|
class L extends v {
|
|
2199
2199
|
_parse(e) {
|
|
2200
|
-
const { status: n, ctx:
|
|
2201
|
-
if (
|
|
2202
|
-
return p(
|
|
2203
|
-
code:
|
|
2204
|
-
expected:
|
|
2205
|
-
received:
|
|
2200
|
+
const { status: n, ctx: s } = this._processInputParams(e);
|
|
2201
|
+
if (s.parsedType !== h.set)
|
|
2202
|
+
return p(s, {
|
|
2203
|
+
code: d.invalid_type,
|
|
2204
|
+
expected: h.set,
|
|
2205
|
+
received: s.parsedType
|
|
2206
2206
|
}), g;
|
|
2207
2207
|
const a = this._def;
|
|
2208
|
-
a.minSize !== null &&
|
|
2209
|
-
code:
|
|
2208
|
+
a.minSize !== null && s.data.size < a.minSize.value && (p(s, {
|
|
2209
|
+
code: d.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
|
-
}), n.dirty()), a.maxSize !== null &&
|
|
2216
|
-
code:
|
|
2215
|
+
}), n.dirty()), a.maxSize !== null && s.data.size > a.maxSize.value && (p(s, {
|
|
2216
|
+
code: d.too_big,
|
|
2217
2217
|
maximum: a.maxSize.value,
|
|
2218
2218
|
type: "set",
|
|
2219
2219
|
inclusive: !0,
|
|
@@ -2230,19 +2230,19 @@ class L extends v {
|
|
|
2230
2230
|
}
|
|
2231
2231
|
return { status: n.value, value: l };
|
|
2232
2232
|
}
|
|
2233
|
-
const
|
|
2234
|
-
return
|
|
2233
|
+
const c = [...s.data.values()].map((u, l) => i._parse(new Z(s, u, s.path, l)));
|
|
2234
|
+
return s.common.async ? Promise.all(c).then((u) => o(u)) : o(c);
|
|
2235
2235
|
}
|
|
2236
2236
|
min(e, n) {
|
|
2237
2237
|
return new L({
|
|
2238
2238
|
...this._def,
|
|
2239
|
-
minSize: { value: e, message:
|
|
2239
|
+
minSize: { value: e, message: f.toString(n) }
|
|
2240
2240
|
});
|
|
2241
2241
|
}
|
|
2242
2242
|
max(e, n) {
|
|
2243
2243
|
return new L({
|
|
2244
2244
|
...this._def,
|
|
2245
|
-
maxSize: { value: e, message:
|
|
2245
|
+
maxSize: { value: e, message: f.toString(n) }
|
|
2246
2246
|
});
|
|
2247
2247
|
}
|
|
2248
2248
|
size(e, n) {
|
|
@@ -2259,68 +2259,68 @@ L.create = (t, e) => new L({
|
|
|
2259
2259
|
typeName: _.ZodSet,
|
|
2260
2260
|
...y(e)
|
|
2261
2261
|
});
|
|
2262
|
-
class
|
|
2262
|
+
class H extends v {
|
|
2263
2263
|
constructor() {
|
|
2264
2264
|
super(...arguments), this.validate = this.implement;
|
|
2265
2265
|
}
|
|
2266
2266
|
_parse(e) {
|
|
2267
2267
|
const { ctx: n } = this._processInputParams(e);
|
|
2268
|
-
if (n.parsedType !==
|
|
2268
|
+
if (n.parsedType !== h.function)
|
|
2269
2269
|
return p(n, {
|
|
2270
|
-
code:
|
|
2271
|
-
expected:
|
|
2270
|
+
code: d.invalid_type,
|
|
2271
|
+
expected: h.function,
|
|
2272
2272
|
received: n.parsedType
|
|
2273
2273
|
}), g;
|
|
2274
|
-
function
|
|
2275
|
-
return
|
|
2276
|
-
data:
|
|
2274
|
+
function s(c, u) {
|
|
2275
|
+
return _e({
|
|
2276
|
+
data: c,
|
|
2277
2277
|
path: n.path,
|
|
2278
2278
|
errorMaps: [
|
|
2279
2279
|
n.common.contextualErrorMap,
|
|
2280
2280
|
n.schemaErrorMap,
|
|
2281
|
-
|
|
2282
|
-
|
|
2281
|
+
me(),
|
|
2282
|
+
K
|
|
2283
2283
|
].filter((l) => !!l),
|
|
2284
2284
|
issueData: {
|
|
2285
|
-
code:
|
|
2285
|
+
code: d.invalid_arguments,
|
|
2286
2286
|
argumentsError: u
|
|
2287
2287
|
}
|
|
2288
2288
|
});
|
|
2289
2289
|
}
|
|
2290
|
-
function a(
|
|
2291
|
-
return
|
|
2292
|
-
data:
|
|
2290
|
+
function a(c, u) {
|
|
2291
|
+
return _e({
|
|
2292
|
+
data: c,
|
|
2293
2293
|
path: n.path,
|
|
2294
2294
|
errorMaps: [
|
|
2295
2295
|
n.common.contextualErrorMap,
|
|
2296
2296
|
n.schemaErrorMap,
|
|
2297
|
-
|
|
2298
|
-
|
|
2297
|
+
me(),
|
|
2298
|
+
K
|
|
2299
2299
|
].filter((l) => !!l),
|
|
2300
2300
|
issueData: {
|
|
2301
|
-
code:
|
|
2301
|
+
code: d.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
|
-
if (this._def.returns instanceof
|
|
2308
|
-
const
|
|
2307
|
+
if (this._def.returns instanceof J) {
|
|
2308
|
+
const c = this;
|
|
2309
2309
|
return S(async function(...u) {
|
|
2310
|
-
const l = new T([]), m = await
|
|
2311
|
-
throw l.addIssue(
|
|
2310
|
+
const l = new T([]), m = await c._def.args.parseAsync(u, i).catch((B) => {
|
|
2311
|
+
throw l.addIssue(s(u, B)), l;
|
|
2312
2312
|
}), x = await Reflect.apply(o, this, m);
|
|
2313
|
-
return await
|
|
2313
|
+
return await c._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 c = this;
|
|
2319
2319
|
return S(function(...u) {
|
|
2320
|
-
const l =
|
|
2320
|
+
const l = c._def.args.safeParse(u, i);
|
|
2321
2321
|
if (!l.success)
|
|
2322
|
-
throw new T([
|
|
2323
|
-
const m = Reflect.apply(o, this, l.data), x =
|
|
2322
|
+
throw new T([s(u, l.error)]);
|
|
2323
|
+
const m = Reflect.apply(o, this, l.data), x = c._def.returns.safeParse(m, i);
|
|
2324
2324
|
if (!x.success)
|
|
2325
2325
|
throw new T([a(m, x.error)]);
|
|
2326
2326
|
return x.data;
|
|
@@ -2334,13 +2334,13 @@ class G extends v {
|
|
|
2334
2334
|
return this._def.returns;
|
|
2335
2335
|
}
|
|
2336
2336
|
args(...e) {
|
|
2337
|
-
return new
|
|
2337
|
+
return new H({
|
|
2338
2338
|
...this._def,
|
|
2339
2339
|
args: N.create(e).rest(U.create())
|
|
2340
2340
|
});
|
|
2341
2341
|
}
|
|
2342
2342
|
returns(e) {
|
|
2343
|
-
return new
|
|
2343
|
+
return new H({
|
|
2344
2344
|
...this._def,
|
|
2345
2345
|
returns: e
|
|
2346
2346
|
});
|
|
@@ -2351,16 +2351,16 @@ class G extends v {
|
|
|
2351
2351
|
strictImplement(e) {
|
|
2352
2352
|
return this.parse(e);
|
|
2353
2353
|
}
|
|
2354
|
-
static create(e, n,
|
|
2355
|
-
return new
|
|
2354
|
+
static create(e, n, s) {
|
|
2355
|
+
return new H({
|
|
2356
2356
|
args: e || N.create([]).rest(U.create()),
|
|
2357
2357
|
returns: n || U.create(),
|
|
2358
2358
|
typeName: _.ZodFunction,
|
|
2359
|
-
...y(
|
|
2359
|
+
...y(s)
|
|
2360
2360
|
});
|
|
2361
2361
|
}
|
|
2362
2362
|
}
|
|
2363
|
-
class
|
|
2363
|
+
class ce extends v {
|
|
2364
2364
|
get schema() {
|
|
2365
2365
|
return this._def.getter();
|
|
2366
2366
|
}
|
|
@@ -2369,7 +2369,7 @@ class oe extends v {
|
|
|
2369
2369
|
return this._def.getter()._parse({ data: n.data, path: n.path, parent: n });
|
|
2370
2370
|
}
|
|
2371
2371
|
}
|
|
2372
|
-
|
|
2372
|
+
ce.create = (t, e) => new ce({
|
|
2373
2373
|
getter: t,
|
|
2374
2374
|
typeName: _.ZodLazy,
|
|
2375
2375
|
...y(e)
|
|
@@ -2380,7 +2380,7 @@ class de extends v {
|
|
|
2380
2380
|
const n = this._getOrReturnCtx(e);
|
|
2381
2381
|
return p(n, {
|
|
2382
2382
|
received: n.data,
|
|
2383
|
-
code:
|
|
2383
|
+
code: d.invalid_literal,
|
|
2384
2384
|
expected: this._def.value
|
|
2385
2385
|
}), g;
|
|
2386
2386
|
}
|
|
@@ -2395,7 +2395,7 @@ de.create = (t, e) => new de({
|
|
|
2395
2395
|
typeName: _.ZodLiteral,
|
|
2396
2396
|
...y(e)
|
|
2397
2397
|
});
|
|
2398
|
-
function
|
|
2398
|
+
function Je(t, e) {
|
|
2399
2399
|
return new $({
|
|
2400
2400
|
values: t,
|
|
2401
2401
|
typeName: _.ZodEnum,
|
|
@@ -2404,23 +2404,23 @@ function Ye(t, e) {
|
|
|
2404
2404
|
}
|
|
2405
2405
|
class $ extends v {
|
|
2406
2406
|
constructor() {
|
|
2407
|
-
super(...arguments),
|
|
2407
|
+
super(...arguments), X.set(this, void 0);
|
|
2408
2408
|
}
|
|
2409
2409
|
_parse(e) {
|
|
2410
2410
|
if (typeof e.data != "string") {
|
|
2411
|
-
const n = this._getOrReturnCtx(e),
|
|
2411
|
+
const n = this._getOrReturnCtx(e), s = this._def.values;
|
|
2412
2412
|
return p(n, {
|
|
2413
|
-
expected: b.joinValues(
|
|
2413
|
+
expected: b.joinValues(s),
|
|
2414
2414
|
received: n.parsedType,
|
|
2415
|
-
code:
|
|
2415
|
+
code: d.invalid_type
|
|
2416
2416
|
}), g;
|
|
2417
2417
|
}
|
|
2418
|
-
if (
|
|
2419
|
-
const n = this._getOrReturnCtx(e),
|
|
2418
|
+
if (ge(this, X) || Ge(this, X, new Set(this._def.values)), !ge(this, X).has(e.data)) {
|
|
2419
|
+
const n = this._getOrReturnCtx(e), s = this._def.values;
|
|
2420
2420
|
return p(n, {
|
|
2421
2421
|
received: n.data,
|
|
2422
|
-
code:
|
|
2423
|
-
options:
|
|
2422
|
+
code: d.invalid_enum_value,
|
|
2423
|
+
options: s
|
|
2424
2424
|
}), g;
|
|
2425
2425
|
}
|
|
2426
2426
|
return S(e.data);
|
|
@@ -2453,33 +2453,33 @@ class $ extends v {
|
|
|
2453
2453
|
});
|
|
2454
2454
|
}
|
|
2455
2455
|
exclude(e, n = this._def) {
|
|
2456
|
-
return $.create(this.options.filter((
|
|
2456
|
+
return $.create(this.options.filter((s) => !e.includes(s)), {
|
|
2457
2457
|
...this._def,
|
|
2458
2458
|
...n
|
|
2459
2459
|
});
|
|
2460
2460
|
}
|
|
2461
2461
|
}
|
|
2462
|
-
|
|
2463
|
-
$.create =
|
|
2464
|
-
class
|
|
2462
|
+
X = /* @__PURE__ */ new WeakMap();
|
|
2463
|
+
$.create = Je;
|
|
2464
|
+
class le extends v {
|
|
2465
2465
|
constructor() {
|
|
2466
|
-
super(...arguments),
|
|
2466
|
+
super(...arguments), Q.set(this, void 0);
|
|
2467
2467
|
}
|
|
2468
2468
|
_parse(e) {
|
|
2469
|
-
const n = b.getValidEnumValues(this._def.values),
|
|
2470
|
-
if (
|
|
2469
|
+
const n = b.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
2470
|
+
if (s.parsedType !== h.string && s.parsedType !== h.number) {
|
|
2471
2471
|
const a = b.objectValues(n);
|
|
2472
|
-
return p(
|
|
2472
|
+
return p(s, {
|
|
2473
2473
|
expected: b.joinValues(a),
|
|
2474
|
-
received:
|
|
2475
|
-
code:
|
|
2474
|
+
received: s.parsedType,
|
|
2475
|
+
code: d.invalid_type
|
|
2476
2476
|
}), g;
|
|
2477
2477
|
}
|
|
2478
|
-
if (
|
|
2478
|
+
if (ge(this, Q) || Ge(this, Q, new Set(b.getValidEnumValues(this._def.values))), !ge(this, Q).has(e.data)) {
|
|
2479
2479
|
const a = b.objectValues(n);
|
|
2480
|
-
return p(
|
|
2481
|
-
received:
|
|
2482
|
-
code:
|
|
2480
|
+
return p(s, {
|
|
2481
|
+
received: s.data,
|
|
2482
|
+
code: d.invalid_enum_value,
|
|
2483
2483
|
options: a
|
|
2484
2484
|
}), g;
|
|
2485
2485
|
}
|
|
@@ -2489,37 +2489,37 @@ class ce extends v {
|
|
|
2489
2489
|
return this._def.values;
|
|
2490
2490
|
}
|
|
2491
2491
|
}
|
|
2492
|
-
|
|
2493
|
-
|
|
2492
|
+
Q = /* @__PURE__ */ new WeakMap();
|
|
2493
|
+
le.create = (t, e) => new le({
|
|
2494
2494
|
values: t,
|
|
2495
2495
|
typeName: _.ZodNativeEnum,
|
|
2496
2496
|
...y(e)
|
|
2497
2497
|
});
|
|
2498
|
-
class
|
|
2498
|
+
class J extends v {
|
|
2499
2499
|
unwrap() {
|
|
2500
2500
|
return this._def.type;
|
|
2501
2501
|
}
|
|
2502
2502
|
_parse(e) {
|
|
2503
2503
|
const { ctx: n } = this._processInputParams(e);
|
|
2504
|
-
if (n.parsedType !==
|
|
2504
|
+
if (n.parsedType !== h.promise && n.common.async === !1)
|
|
2505
2505
|
return p(n, {
|
|
2506
|
-
code:
|
|
2507
|
-
expected:
|
|
2506
|
+
code: d.invalid_type,
|
|
2507
|
+
expected: h.promise,
|
|
2508
2508
|
received: n.parsedType
|
|
2509
2509
|
}), g;
|
|
2510
|
-
const
|
|
2511
|
-
return S(
|
|
2510
|
+
const s = n.parsedType === h.promise ? n.data : Promise.resolve(n.data);
|
|
2511
|
+
return S(s.then((a) => this._def.type.parseAsync(a, {
|
|
2512
2512
|
path: n.path,
|
|
2513
2513
|
errorMap: n.common.contextualErrorMap
|
|
2514
2514
|
})));
|
|
2515
2515
|
}
|
|
2516
2516
|
}
|
|
2517
|
-
|
|
2517
|
+
J.create = (t, e) => new J({
|
|
2518
2518
|
type: t,
|
|
2519
2519
|
typeName: _.ZodPromise,
|
|
2520
2520
|
...y(e)
|
|
2521
2521
|
});
|
|
2522
|
-
class
|
|
2522
|
+
class E extends v {
|
|
2523
2523
|
innerType() {
|
|
2524
2524
|
return this._def.schema;
|
|
2525
2525
|
}
|
|
@@ -2527,103 +2527,103 @@ class C extends v {
|
|
|
2527
2527
|
return this._def.schema._def.typeName === _.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
2528
2528
|
}
|
|
2529
2529
|
_parse(e) {
|
|
2530
|
-
const { status: n, ctx:
|
|
2530
|
+
const { status: n, ctx: s } = this._processInputParams(e), a = this._def.effect || null, i = {
|
|
2531
2531
|
addIssue: (o) => {
|
|
2532
|
-
p(
|
|
2532
|
+
p(s, o), o.fatal ? n.abort() : n.dirty();
|
|
2533
2533
|
},
|
|
2534
2534
|
get path() {
|
|
2535
|
-
return
|
|
2535
|
+
return s.path;
|
|
2536
2536
|
}
|
|
2537
2537
|
};
|
|
2538
2538
|
if (i.addIssue = i.addIssue.bind(i), a.type === "preprocess") {
|
|
2539
|
-
const o = a.transform(
|
|
2540
|
-
if (
|
|
2541
|
-
return Promise.resolve(o).then(async (
|
|
2539
|
+
const o = a.transform(s.data, i);
|
|
2540
|
+
if (s.common.async)
|
|
2541
|
+
return Promise.resolve(o).then(async (c) => {
|
|
2542
2542
|
if (n.value === "aborted")
|
|
2543
2543
|
return g;
|
|
2544
2544
|
const u = await this._def.schema._parseAsync({
|
|
2545
|
-
data:
|
|
2546
|
-
path:
|
|
2547
|
-
parent:
|
|
2545
|
+
data: c,
|
|
2546
|
+
path: s.path,
|
|
2547
|
+
parent: s
|
|
2548
2548
|
});
|
|
2549
|
-
return u.status === "aborted" ? g : u.status === "dirty" || n.value === "dirty" ?
|
|
2549
|
+
return u.status === "aborted" ? g : u.status === "dirty" || n.value === "dirty" ? G(u.value) : u;
|
|
2550
2550
|
});
|
|
2551
2551
|
{
|
|
2552
2552
|
if (n.value === "aborted")
|
|
2553
2553
|
return g;
|
|
2554
|
-
const
|
|
2554
|
+
const c = this._def.schema._parseSync({
|
|
2555
2555
|
data: o,
|
|
2556
|
-
path:
|
|
2557
|
-
parent:
|
|
2556
|
+
path: s.path,
|
|
2557
|
+
parent: s
|
|
2558
2558
|
});
|
|
2559
|
-
return
|
|
2559
|
+
return c.status === "aborted" ? g : c.status === "dirty" || n.value === "dirty" ? G(c.value) : c;
|
|
2560
2560
|
}
|
|
2561
2561
|
}
|
|
2562
2562
|
if (a.type === "refinement") {
|
|
2563
|
-
const o = (
|
|
2564
|
-
const u = a.refinement(
|
|
2565
|
-
if (
|
|
2563
|
+
const o = (c) => {
|
|
2564
|
+
const u = a.refinement(c, i);
|
|
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 c;
|
|
2570
2570
|
};
|
|
2571
|
-
if (
|
|
2572
|
-
const
|
|
2573
|
-
data:
|
|
2574
|
-
path:
|
|
2575
|
-
parent:
|
|
2571
|
+
if (s.common.async === !1) {
|
|
2572
|
+
const c = this._def.schema._parseSync({
|
|
2573
|
+
data: s.data,
|
|
2574
|
+
path: s.path,
|
|
2575
|
+
parent: s
|
|
2576
2576
|
});
|
|
2577
|
-
return
|
|
2577
|
+
return c.status === "aborted" ? g : (c.status === "dirty" && n.dirty(), o(c.value), { status: n.value, value: c.value });
|
|
2578
2578
|
} else
|
|
2579
|
-
return this._def.schema._parseAsync({ data:
|
|
2579
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((c) => c.status === "aborted" ? g : (c.status === "dirty" && n.dirty(), o(c.value).then(() => ({ status: n.value, value: c.value }))));
|
|
2580
2580
|
}
|
|
2581
2581
|
if (a.type === "transform")
|
|
2582
|
-
if (
|
|
2582
|
+
if (s.common.async === !1) {
|
|
2583
2583
|
const o = this._def.schema._parseSync({
|
|
2584
|
-
data:
|
|
2585
|
-
path:
|
|
2586
|
-
parent:
|
|
2584
|
+
data: s.data,
|
|
2585
|
+
path: s.path,
|
|
2586
|
+
parent: s
|
|
2587
2587
|
});
|
|
2588
|
-
if (!
|
|
2588
|
+
if (!ee(o))
|
|
2589
2589
|
return o;
|
|
2590
|
-
const
|
|
2591
|
-
if (
|
|
2590
|
+
const c = a.transform(o.value, i);
|
|
2591
|
+
if (c 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: c };
|
|
2594
2594
|
} else
|
|
2595
|
-
return this._def.schema._parseAsync({ data:
|
|
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((c) => ({ status: n.value, value: c })) : o);
|
|
2596
2596
|
b.assertNever(a);
|
|
2597
2597
|
}
|
|
2598
2598
|
}
|
|
2599
|
-
|
|
2599
|
+
E.create = (t, e, n) => new E({
|
|
2600
2600
|
schema: t,
|
|
2601
2601
|
typeName: _.ZodEffects,
|
|
2602
2602
|
effect: e,
|
|
2603
2603
|
...y(n)
|
|
2604
2604
|
});
|
|
2605
|
-
|
|
2605
|
+
E.createWithPreprocess = (t, e, n) => new E({
|
|
2606
2606
|
schema: e,
|
|
2607
2607
|
effect: { type: "preprocess", transform: t },
|
|
2608
2608
|
typeName: _.ZodEffects,
|
|
2609
2609
|
...y(n)
|
|
2610
2610
|
});
|
|
2611
|
-
class
|
|
2611
|
+
class C extends v {
|
|
2612
2612
|
_parse(e) {
|
|
2613
|
-
return this._getType(e) ===
|
|
2613
|
+
return this._getType(e) === h.undefined ? S(void 0) : this._def.innerType._parse(e);
|
|
2614
2614
|
}
|
|
2615
2615
|
unwrap() {
|
|
2616
2616
|
return this._def.innerType;
|
|
2617
2617
|
}
|
|
2618
2618
|
}
|
|
2619
|
-
|
|
2619
|
+
C.create = (t, e) => new C({
|
|
2620
2620
|
innerType: t,
|
|
2621
2621
|
typeName: _.ZodOptional,
|
|
2622
2622
|
...y(e)
|
|
2623
2623
|
});
|
|
2624
2624
|
class D extends v {
|
|
2625
2625
|
_parse(e) {
|
|
2626
|
-
return this._getType(e) ===
|
|
2626
|
+
return this._getType(e) === h.null ? S(null) : this._def.innerType._parse(e);
|
|
2627
2627
|
}
|
|
2628
2628
|
unwrap() {
|
|
2629
2629
|
return this._def.innerType;
|
|
@@ -2634,12 +2634,12 @@ D.create = (t, e) => new D({
|
|
|
2634
2634
|
typeName: _.ZodNullable,
|
|
2635
2635
|
...y(e)
|
|
2636
2636
|
});
|
|
2637
|
-
class
|
|
2637
|
+
class ue extends v {
|
|
2638
2638
|
_parse(e) {
|
|
2639
2639
|
const { ctx: n } = this._processInputParams(e);
|
|
2640
|
-
let
|
|
2641
|
-
return n.parsedType ===
|
|
2642
|
-
data:
|
|
2640
|
+
let s = n.data;
|
|
2641
|
+
return n.parsedType === h.undefined && (s = this._def.defaultValue()), this._def.innerType._parse({
|
|
2642
|
+
data: s,
|
|
2643
2643
|
path: n.path,
|
|
2644
2644
|
parent: n
|
|
2645
2645
|
});
|
|
@@ -2648,42 +2648,42 @@ class le extends v {
|
|
|
2648
2648
|
return this._def.innerType;
|
|
2649
2649
|
}
|
|
2650
2650
|
}
|
|
2651
|
-
|
|
2651
|
+
ue.create = (t, e) => new ue({
|
|
2652
2652
|
innerType: t,
|
|
2653
2653
|
typeName: _.ZodDefault,
|
|
2654
2654
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2655
2655
|
...y(e)
|
|
2656
2656
|
});
|
|
2657
|
-
class
|
|
2657
|
+
class pe extends v {
|
|
2658
2658
|
_parse(e) {
|
|
2659
|
-
const { ctx: n } = this._processInputParams(e),
|
|
2659
|
+
const { ctx: n } = this._processInputParams(e), s = {
|
|
2660
2660
|
...n,
|
|
2661
2661
|
common: {
|
|
2662
2662
|
...n.common,
|
|
2663
2663
|
issues: []
|
|
2664
2664
|
}
|
|
2665
2665
|
}, a = this._def.innerType._parse({
|
|
2666
|
-
data:
|
|
2667
|
-
path:
|
|
2666
|
+
data: s.data,
|
|
2667
|
+
path: s.path,
|
|
2668
2668
|
parent: {
|
|
2669
|
-
...
|
|
2669
|
+
...s
|
|
2670
2670
|
}
|
|
2671
2671
|
});
|
|
2672
|
-
return
|
|
2672
|
+
return te(a) ? a.then((i) => ({
|
|
2673
2673
|
status: "valid",
|
|
2674
2674
|
value: i.status === "valid" ? i.value : this._def.catchValue({
|
|
2675
2675
|
get error() {
|
|
2676
|
-
return new T(
|
|
2676
|
+
return new T(s.common.issues);
|
|
2677
2677
|
},
|
|
2678
|
-
input:
|
|
2678
|
+
input: s.data
|
|
2679
2679
|
})
|
|
2680
2680
|
})) : {
|
|
2681
2681
|
status: "valid",
|
|
2682
2682
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2683
2683
|
get error() {
|
|
2684
|
-
return new T(
|
|
2684
|
+
return new T(s.common.issues);
|
|
2685
2685
|
},
|
|
2686
|
-
input:
|
|
2686
|
+
input: s.data
|
|
2687
2687
|
})
|
|
2688
2688
|
};
|
|
2689
2689
|
}
|
|
@@ -2691,35 +2691,35 @@ class ue extends v {
|
|
|
2691
2691
|
return this._def.innerType;
|
|
2692
2692
|
}
|
|
2693
2693
|
}
|
|
2694
|
-
|
|
2694
|
+
pe.create = (t, e) => new pe({
|
|
2695
2695
|
innerType: t,
|
|
2696
2696
|
typeName: _.ZodCatch,
|
|
2697
2697
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2698
2698
|
...y(e)
|
|
2699
2699
|
});
|
|
2700
|
-
class
|
|
2700
|
+
class ke extends v {
|
|
2701
2701
|
_parse(e) {
|
|
2702
|
-
if (this._getType(e) !==
|
|
2703
|
-
const
|
|
2704
|
-
return p(
|
|
2705
|
-
code:
|
|
2706
|
-
expected:
|
|
2707
|
-
received:
|
|
2702
|
+
if (this._getType(e) !== h.nan) {
|
|
2703
|
+
const s = this._getOrReturnCtx(e);
|
|
2704
|
+
return p(s, {
|
|
2705
|
+
code: d.invalid_type,
|
|
2706
|
+
expected: h.nan,
|
|
2707
|
+
received: s.parsedType
|
|
2708
2708
|
}), g;
|
|
2709
2709
|
}
|
|
2710
2710
|
return { status: "valid", value: e.data };
|
|
2711
2711
|
}
|
|
2712
2712
|
}
|
|
2713
|
-
|
|
2713
|
+
ke.create = (t) => new ke({
|
|
2714
2714
|
typeName: _.ZodNaN,
|
|
2715
2715
|
...y(t)
|
|
2716
2716
|
});
|
|
2717
|
-
const
|
|
2718
|
-
class
|
|
2717
|
+
const It = Symbol("zod_brand");
|
|
2718
|
+
class Pe extends v {
|
|
2719
2719
|
_parse(e) {
|
|
2720
|
-
const { ctx: n } = this._processInputParams(e),
|
|
2720
|
+
const { ctx: n } = this._processInputParams(e), s = n.data;
|
|
2721
2721
|
return this._def.type._parse({
|
|
2722
|
-
data:
|
|
2722
|
+
data: s,
|
|
2723
2723
|
path: n.path,
|
|
2724
2724
|
parent: n
|
|
2725
2725
|
});
|
|
@@ -2730,33 +2730,33 @@ class Ae extends v {
|
|
|
2730
2730
|
}
|
|
2731
2731
|
class fe extends v {
|
|
2732
2732
|
_parse(e) {
|
|
2733
|
-
const { status: n, ctx:
|
|
2734
|
-
if (
|
|
2733
|
+
const { status: n, ctx: s } = this._processInputParams(e);
|
|
2734
|
+
if (s.common.async)
|
|
2735
2735
|
return (async () => {
|
|
2736
2736
|
const i = await this._def.in._parseAsync({
|
|
2737
|
-
data:
|
|
2738
|
-
path:
|
|
2739
|
-
parent:
|
|
2737
|
+
data: s.data,
|
|
2738
|
+
path: s.path,
|
|
2739
|
+
parent: s
|
|
2740
2740
|
});
|
|
2741
|
-
return i.status === "aborted" ? g : i.status === "dirty" ? (n.dirty(),
|
|
2741
|
+
return i.status === "aborted" ? g : i.status === "dirty" ? (n.dirty(), G(i.value)) : this._def.out._parseAsync({
|
|
2742
2742
|
data: i.value,
|
|
2743
|
-
path:
|
|
2744
|
-
parent:
|
|
2743
|
+
path: s.path,
|
|
2744
|
+
parent: s
|
|
2745
2745
|
});
|
|
2746
2746
|
})();
|
|
2747
2747
|
{
|
|
2748
2748
|
const a = this._def.in._parseSync({
|
|
2749
|
-
data:
|
|
2750
|
-
path:
|
|
2751
|
-
parent:
|
|
2749
|
+
data: s.data,
|
|
2750
|
+
path: s.path,
|
|
2751
|
+
parent: s
|
|
2752
2752
|
});
|
|
2753
2753
|
return a.status === "aborted" ? g : a.status === "dirty" ? (n.dirty(), {
|
|
2754
2754
|
status: "dirty",
|
|
2755
2755
|
value: a.value
|
|
2756
2756
|
}) : this._def.out._parseSync({
|
|
2757
2757
|
data: a.value,
|
|
2758
|
-
path:
|
|
2759
|
-
parent:
|
|
2758
|
+
path: s.path,
|
|
2759
|
+
parent: s
|
|
2760
2760
|
});
|
|
2761
2761
|
}
|
|
2762
2762
|
}
|
|
@@ -2768,517 +2768,381 @@ class fe extends v {
|
|
|
2768
2768
|
});
|
|
2769
2769
|
}
|
|
2770
2770
|
}
|
|
2771
|
-
class
|
|
2771
|
+
class he extends v {
|
|
2772
2772
|
_parse(e) {
|
|
2773
|
-
const n = this._def.innerType._parse(e),
|
|
2774
|
-
return
|
|
2773
|
+
const n = this._def.innerType._parse(e), s = (a) => (ee(a) && (a.value = Object.freeze(a.value)), a);
|
|
2774
|
+
return te(n) ? n.then((a) => s(a)) : s(n);
|
|
2775
2775
|
}
|
|
2776
2776
|
unwrap() {
|
|
2777
2777
|
return this._def.innerType;
|
|
2778
2778
|
}
|
|
2779
2779
|
}
|
|
2780
|
-
|
|
2780
|
+
he.create = (t, e) => new he({
|
|
2781
2781
|
innerType: t,
|
|
2782
2782
|
typeName: _.ZodReadonly,
|
|
2783
2783
|
...y(e)
|
|
2784
2784
|
});
|
|
2785
|
-
function
|
|
2786
|
-
return t ?
|
|
2785
|
+
function Fe(t, e = {}, n) {
|
|
2786
|
+
return t ? Y.create().superRefine((s, a) => {
|
|
2787
2787
|
var i, o;
|
|
2788
|
-
if (!t(
|
|
2789
|
-
const
|
|
2788
|
+
if (!t(s)) {
|
|
2789
|
+
const c = typeof e == "function" ? e(s) : typeof e == "string" ? { message: e } : e, u = (o = (i = c.fatal) !== null && i !== void 0 ? i : n) !== null && o !== void 0 ? o : !0, l = typeof c == "string" ? { message: c } : c;
|
|
2790
2790
|
a.addIssue({ code: "custom", ...l, fatal: u });
|
|
2791
2791
|
}
|
|
2792
|
-
}) :
|
|
2792
|
+
}) : Y.create();
|
|
2793
2793
|
}
|
|
2794
|
-
const
|
|
2794
|
+
const Rt = {
|
|
2795
2795
|
object: k.lazycreate
|
|
2796
2796
|
};
|
|
2797
2797
|
var _;
|
|
2798
2798
|
(function(t) {
|
|
2799
2799
|
t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
|
|
2800
2800
|
})(_ || (_ = {}));
|
|
2801
|
-
const
|
|
2801
|
+
const At = (t, e = {
|
|
2802
2802
|
message: `Input not instance of ${t.name}`
|
|
2803
|
-
}) =>
|
|
2803
|
+
}) => Fe((n) => n instanceof t, e), Xe = O.create, Qe = P.create, Pt = ke.create, Mt = M.create, et = ne.create, $t = V.create, Dt = ye.create, Ut = re.create, Vt = se.create, Lt = Y.create, zt = U.create, Bt = R.create, Wt = ve.create, qt = j.create, Gt = k.create, Ht = k.strictCreate, Kt = ae.create, Yt = xe.create, Jt = ie.create, Ft = N.create, Xt = oe.create, Qt = be.create, en = L.create, tn = H.create, nn = ce.create, rn = de.create, sn = $.create, an = le.create, on = J.create, We = E.create, cn = C.create, dn = D.create, ln = E.createWithPreprocess, un = fe.create, pn = () => Xe().optional(), hn = () => Qe().optional(), fn = () => et().optional(), mn = {
|
|
2804
2804
|
string: (t) => O.create({ ...t, coerce: !0 }),
|
|
2805
2805
|
number: (t) => P.create({ ...t, coerce: !0 }),
|
|
2806
|
-
boolean: (t) =>
|
|
2806
|
+
boolean: (t) => ne.create({
|
|
2807
2807
|
...t,
|
|
2808
2808
|
coerce: !0
|
|
2809
2809
|
}),
|
|
2810
2810
|
bigint: (t) => M.create({ ...t, coerce: !0 }),
|
|
2811
2811
|
date: (t) => V.create({ ...t, coerce: !0 })
|
|
2812
|
-
},
|
|
2813
|
-
var
|
|
2812
|
+
}, _n = g;
|
|
2813
|
+
var r = /* @__PURE__ */ Object.freeze({
|
|
2814
2814
|
__proto__: null,
|
|
2815
|
-
defaultErrorMap:
|
|
2816
|
-
setErrorMap:
|
|
2817
|
-
getErrorMap:
|
|
2818
|
-
makeIssue:
|
|
2819
|
-
EMPTY_PATH:
|
|
2815
|
+
defaultErrorMap: K,
|
|
2816
|
+
setErrorMap: mt,
|
|
2817
|
+
getErrorMap: me,
|
|
2818
|
+
makeIssue: _e,
|
|
2819
|
+
EMPTY_PATH: _t,
|
|
2820
2820
|
addIssueToContext: p,
|
|
2821
2821
|
ParseStatus: w,
|
|
2822
2822
|
INVALID: g,
|
|
2823
|
-
DIRTY:
|
|
2823
|
+
DIRTY: G,
|
|
2824
2824
|
OK: S,
|
|
2825
|
-
isAborted:
|
|
2826
|
-
isDirty:
|
|
2827
|
-
isValid:
|
|
2828
|
-
isAsync:
|
|
2825
|
+
isAborted: Ie,
|
|
2826
|
+
isDirty: Re,
|
|
2827
|
+
isValid: ee,
|
|
2828
|
+
isAsync: te,
|
|
2829
2829
|
get util() {
|
|
2830
2830
|
return b;
|
|
2831
2831
|
},
|
|
2832
2832
|
get objectUtil() {
|
|
2833
|
-
return
|
|
2833
|
+
return Ne;
|
|
2834
2834
|
},
|
|
2835
|
-
ZodParsedType:
|
|
2835
|
+
ZodParsedType: h,
|
|
2836
2836
|
getParsedType: A,
|
|
2837
2837
|
ZodType: v,
|
|
2838
|
-
datetimeRegex:
|
|
2838
|
+
datetimeRegex: Ye,
|
|
2839
2839
|
ZodString: O,
|
|
2840
2840
|
ZodNumber: P,
|
|
2841
2841
|
ZodBigInt: M,
|
|
2842
|
-
ZodBoolean:
|
|
2842
|
+
ZodBoolean: ne,
|
|
2843
2843
|
ZodDate: V,
|
|
2844
|
-
ZodSymbol:
|
|
2845
|
-
ZodUndefined:
|
|
2846
|
-
ZodNull:
|
|
2847
|
-
ZodAny:
|
|
2844
|
+
ZodSymbol: ye,
|
|
2845
|
+
ZodUndefined: re,
|
|
2846
|
+
ZodNull: se,
|
|
2847
|
+
ZodAny: Y,
|
|
2848
2848
|
ZodUnknown: U,
|
|
2849
2849
|
ZodNever: R,
|
|
2850
|
-
ZodVoid:
|
|
2851
|
-
ZodArray:
|
|
2850
|
+
ZodVoid: ve,
|
|
2851
|
+
ZodArray: j,
|
|
2852
2852
|
ZodObject: k,
|
|
2853
|
-
ZodUnion:
|
|
2854
|
-
ZodDiscriminatedUnion:
|
|
2855
|
-
ZodIntersection:
|
|
2853
|
+
ZodUnion: ae,
|
|
2854
|
+
ZodDiscriminatedUnion: xe,
|
|
2855
|
+
ZodIntersection: ie,
|
|
2856
2856
|
ZodTuple: N,
|
|
2857
|
-
ZodRecord:
|
|
2858
|
-
ZodMap:
|
|
2857
|
+
ZodRecord: oe,
|
|
2858
|
+
ZodMap: be,
|
|
2859
2859
|
ZodSet: L,
|
|
2860
|
-
ZodFunction:
|
|
2861
|
-
ZodLazy:
|
|
2860
|
+
ZodFunction: H,
|
|
2861
|
+
ZodLazy: ce,
|
|
2862
2862
|
ZodLiteral: de,
|
|
2863
2863
|
ZodEnum: $,
|
|
2864
|
-
ZodNativeEnum:
|
|
2865
|
-
ZodPromise:
|
|
2866
|
-
ZodEffects:
|
|
2867
|
-
ZodTransformer:
|
|
2868
|
-
ZodOptional:
|
|
2864
|
+
ZodNativeEnum: le,
|
|
2865
|
+
ZodPromise: J,
|
|
2866
|
+
ZodEffects: E,
|
|
2867
|
+
ZodTransformer: E,
|
|
2868
|
+
ZodOptional: C,
|
|
2869
2869
|
ZodNullable: D,
|
|
2870
|
-
ZodDefault:
|
|
2871
|
-
ZodCatch:
|
|
2872
|
-
ZodNaN:
|
|
2873
|
-
BRAND:
|
|
2874
|
-
ZodBranded:
|
|
2870
|
+
ZodDefault: ue,
|
|
2871
|
+
ZodCatch: pe,
|
|
2872
|
+
ZodNaN: ke,
|
|
2873
|
+
BRAND: It,
|
|
2874
|
+
ZodBranded: Pe,
|
|
2875
2875
|
ZodPipeline: fe,
|
|
2876
|
-
ZodReadonly:
|
|
2877
|
-
custom:
|
|
2876
|
+
ZodReadonly: he,
|
|
2877
|
+
custom: Fe,
|
|
2878
2878
|
Schema: v,
|
|
2879
2879
|
ZodSchema: v,
|
|
2880
|
-
late:
|
|
2880
|
+
late: Rt,
|
|
2881
2881
|
get ZodFirstPartyTypeKind() {
|
|
2882
2882
|
return _;
|
|
2883
2883
|
},
|
|
2884
|
-
coerce:
|
|
2885
|
-
any:
|
|
2886
|
-
array:
|
|
2887
|
-
bigint:
|
|
2888
|
-
boolean:
|
|
2889
|
-
date:
|
|
2890
|
-
discriminatedUnion:
|
|
2891
|
-
effect:
|
|
2892
|
-
enum:
|
|
2893
|
-
function:
|
|
2894
|
-
instanceof:
|
|
2895
|
-
intersection:
|
|
2896
|
-
lazy:
|
|
2897
|
-
literal:
|
|
2898
|
-
map:
|
|
2899
|
-
nan:
|
|
2900
|
-
nativeEnum:
|
|
2901
|
-
never:
|
|
2902
|
-
null:
|
|
2884
|
+
coerce: mn,
|
|
2885
|
+
any: Lt,
|
|
2886
|
+
array: qt,
|
|
2887
|
+
bigint: Mt,
|
|
2888
|
+
boolean: et,
|
|
2889
|
+
date: $t,
|
|
2890
|
+
discriminatedUnion: Yt,
|
|
2891
|
+
effect: We,
|
|
2892
|
+
enum: sn,
|
|
2893
|
+
function: tn,
|
|
2894
|
+
instanceof: At,
|
|
2895
|
+
intersection: Jt,
|
|
2896
|
+
lazy: nn,
|
|
2897
|
+
literal: rn,
|
|
2898
|
+
map: Qt,
|
|
2899
|
+
nan: Pt,
|
|
2900
|
+
nativeEnum: an,
|
|
2901
|
+
never: Bt,
|
|
2902
|
+
null: Vt,
|
|
2903
2903
|
nullable: dn,
|
|
2904
|
-
number:
|
|
2905
|
-
object:
|
|
2904
|
+
number: Qe,
|
|
2905
|
+
object: Gt,
|
|
2906
2906
|
oboolean: fn,
|
|
2907
|
-
onumber:
|
|
2908
|
-
optional:
|
|
2909
|
-
ostring:
|
|
2910
|
-
pipeline:
|
|
2911
|
-
preprocess:
|
|
2912
|
-
promise:
|
|
2913
|
-
record:
|
|
2914
|
-
set:
|
|
2915
|
-
strictObject:
|
|
2916
|
-
string:
|
|
2917
|
-
symbol:
|
|
2918
|
-
transformer:
|
|
2919
|
-
tuple:
|
|
2920
|
-
undefined:
|
|
2921
|
-
union:
|
|
2922
|
-
unknown:
|
|
2923
|
-
void:
|
|
2924
|
-
NEVER:
|
|
2925
|
-
ZodIssueCode:
|
|
2907
|
+
onumber: hn,
|
|
2908
|
+
optional: cn,
|
|
2909
|
+
ostring: pn,
|
|
2910
|
+
pipeline: un,
|
|
2911
|
+
preprocess: ln,
|
|
2912
|
+
promise: on,
|
|
2913
|
+
record: Xt,
|
|
2914
|
+
set: en,
|
|
2915
|
+
strictObject: Ht,
|
|
2916
|
+
string: Xe,
|
|
2917
|
+
symbol: Dt,
|
|
2918
|
+
transformer: We,
|
|
2919
|
+
tuple: Ft,
|
|
2920
|
+
undefined: Ut,
|
|
2921
|
+
union: Kt,
|
|
2922
|
+
unknown: zt,
|
|
2923
|
+
void: Wt,
|
|
2924
|
+
NEVER: _n,
|
|
2925
|
+
ZodIssueCode: d,
|
|
2926
2926
|
quotelessJson: ft,
|
|
2927
2927
|
ZodError: T
|
|
2928
2928
|
});
|
|
2929
|
-
|
|
2930
|
-
const
|
|
2931
|
-
start:
|
|
2932
|
-
limit:
|
|
2933
|
-
length:
|
|
2934
|
-
}),
|
|
2935
|
-
created_at:
|
|
2936
|
-
updated_at:
|
|
2937
|
-
}),
|
|
2938
|
-
email:
|
|
2939
|
-
email_verified:
|
|
2940
|
-
name:
|
|
2941
|
-
username:
|
|
2942
|
-
given_name:
|
|
2943
|
-
phone_number:
|
|
2944
|
-
phone_verified:
|
|
2945
|
-
family_name:
|
|
2946
|
-
}).catchall(
|
|
2947
|
-
connection:
|
|
2948
|
-
user_id:
|
|
2949
|
-
provider:
|
|
2950
|
-
isSocial:
|
|
2951
|
-
access_token:
|
|
2952
|
-
access_token_secret:
|
|
2953
|
-
refresh_token:
|
|
2954
|
-
profileData:
|
|
2955
|
-
}),
|
|
2956
|
-
email:
|
|
2957
|
-
username:
|
|
2958
|
-
given_name:
|
|
2959
|
-
family_name:
|
|
2960
|
-
nickname:
|
|
2961
|
-
name:
|
|
2962
|
-
picture:
|
|
2963
|
-
locale:
|
|
2964
|
-
linked_to:
|
|
2965
|
-
profileData:
|
|
2966
|
-
user_id:
|
|
2967
|
-
}),
|
|
2968
|
-
email_verified:
|
|
2969
|
-
verify_email:
|
|
2970
|
-
last_ip:
|
|
2971
|
-
last_login:
|
|
2972
|
-
user_id:
|
|
2973
|
-
provider:
|
|
2974
|
-
connection:
|
|
2975
|
-
}),
|
|
2976
|
-
user_id:
|
|
2929
|
+
ht(r);
|
|
2930
|
+
const zn = r.object({
|
|
2931
|
+
start: r.number(),
|
|
2932
|
+
limit: r.number(),
|
|
2933
|
+
length: r.number()
|
|
2934
|
+
}), Me = r.object({
|
|
2935
|
+
created_at: r.string(),
|
|
2936
|
+
updated_at: r.string()
|
|
2937
|
+
}), gn = r.object({
|
|
2938
|
+
email: r.string().optional(),
|
|
2939
|
+
email_verified: r.boolean().optional(),
|
|
2940
|
+
name: r.string().optional(),
|
|
2941
|
+
username: r.string().optional(),
|
|
2942
|
+
given_name: r.string().optional(),
|
|
2943
|
+
phone_number: r.string().optional(),
|
|
2944
|
+
phone_verified: r.boolean().optional(),
|
|
2945
|
+
family_name: r.string().optional()
|
|
2946
|
+
}).catchall(r.any()), yn = r.object({
|
|
2947
|
+
connection: r.string(),
|
|
2948
|
+
user_id: r.string(),
|
|
2949
|
+
provider: r.string(),
|
|
2950
|
+
isSocial: r.boolean(),
|
|
2951
|
+
access_token: r.string().optional(),
|
|
2952
|
+
access_token_secret: r.string().optional(),
|
|
2953
|
+
refresh_token: r.string().optional(),
|
|
2954
|
+
profileData: gn.optional()
|
|
2955
|
+
}), tt = r.object({
|
|
2956
|
+
email: r.string().optional(),
|
|
2957
|
+
username: r.string().optional(),
|
|
2958
|
+
given_name: r.string().optional(),
|
|
2959
|
+
family_name: r.string().optional(),
|
|
2960
|
+
nickname: r.string().optional(),
|
|
2961
|
+
name: r.string().optional(),
|
|
2962
|
+
picture: r.string().optional(),
|
|
2963
|
+
locale: r.string().optional(),
|
|
2964
|
+
linked_to: r.string().optional(),
|
|
2965
|
+
profileData: r.string().optional(),
|
|
2966
|
+
user_id: r.string().optional()
|
|
2967
|
+
}), vn = tt.extend({
|
|
2968
|
+
email_verified: r.boolean().default(!1),
|
|
2969
|
+
verify_email: r.boolean().optional(),
|
|
2970
|
+
last_ip: r.string().optional(),
|
|
2971
|
+
last_login: r.string().optional(),
|
|
2972
|
+
user_id: r.string().optional(),
|
|
2973
|
+
provider: r.string().default("email"),
|
|
2974
|
+
connection: r.string().default("email")
|
|
2975
|
+
}), bn = vn.extend(Me.shape).extend({
|
|
2976
|
+
user_id: r.string(),
|
|
2977
2977
|
// TODO: this not might be correct if you use the username
|
|
2978
|
-
email:
|
|
2979
|
-
is_social:
|
|
2980
|
-
login_count:
|
|
2981
|
-
identities:
|
|
2982
|
-
}),
|
|
2983
|
-
email:
|
|
2984
|
-
login_count:
|
|
2985
|
-
multifactor:
|
|
2986
|
-
last_ip:
|
|
2987
|
-
last_login:
|
|
2988
|
-
user_id:
|
|
2989
|
-
}).catchall(
|
|
2990
|
-
id:
|
|
2991
|
-
name:
|
|
2992
|
-
allowed_web_origins:
|
|
2993
|
-
allowed_callback_urls:
|
|
2994
|
-
allowed_logout_urls:
|
|
2995
|
-
email_validation:
|
|
2996
|
-
client_secret:
|
|
2997
|
-
disable_sign_ups:
|
|
2998
|
-
}),
|
|
2999
|
-
created_at:
|
|
3000
|
-
updated_at:
|
|
3001
|
-
}).extend(
|
|
3002
|
-
var
|
|
3003
|
-
const
|
|
3004
|
-
client_id:
|
|
3005
|
-
vendor_id:
|
|
3006
|
-
response_type:
|
|
3007
|
-
response_mode:
|
|
3008
|
-
redirect_uri:
|
|
3009
|
-
audience:
|
|
3010
|
-
state:
|
|
3011
|
-
nonce:
|
|
3012
|
-
scope:
|
|
3013
|
-
code_challenge_method:
|
|
3014
|
-
code_challenge:
|
|
3015
|
-
username:
|
|
3016
|
-
}),
|
|
3017
|
-
authParams:
|
|
3018
|
-
code:
|
|
3019
|
-
user_id:
|
|
3020
|
-
created_at:
|
|
3021
|
-
expires_at:
|
|
3022
|
-
used_at:
|
|
3023
|
-
}),
|
|
3024
|
-
...
|
|
3025
|
-
created_at:
|
|
3026
|
-
}),
|
|
3027
|
-
colors:
|
|
3028
|
-
primary:
|
|
3029
|
-
page_background:
|
|
3030
|
-
type:
|
|
3031
|
-
start:
|
|
3032
|
-
end:
|
|
3033
|
-
angle_deg:
|
|
2978
|
+
email: r.string(),
|
|
2979
|
+
is_social: r.boolean(),
|
|
2980
|
+
login_count: r.number(),
|
|
2981
|
+
identities: r.array(yn).optional()
|
|
2982
|
+
}), Bn = bn, Wn = tt.extend({
|
|
2983
|
+
email: r.string(),
|
|
2984
|
+
login_count: r.number(),
|
|
2985
|
+
multifactor: r.array(r.string()).optional(),
|
|
2986
|
+
last_ip: r.string().optional(),
|
|
2987
|
+
last_login: r.string().optional(),
|
|
2988
|
+
user_id: r.string()
|
|
2989
|
+
}).catchall(r.any()), kn = r.object({
|
|
2990
|
+
id: r.string(),
|
|
2991
|
+
name: r.string(),
|
|
2992
|
+
allowed_web_origins: r.string().transform((t) => t === null ? "" : t).default(""),
|
|
2993
|
+
allowed_callback_urls: r.string().transform((t) => t === null ? "" : t).default(""),
|
|
2994
|
+
allowed_logout_urls: r.string().transform((t) => t === null ? "" : t).default(""),
|
|
2995
|
+
email_validation: r.enum(["enabled", "disabled", "enforced"]).default("enforced"),
|
|
2996
|
+
client_secret: r.string().default(""),
|
|
2997
|
+
disable_sign_ups: r.boolean().default(!1)
|
|
2998
|
+
}), qn = r.object({
|
|
2999
|
+
created_at: r.string().transform((t) => t === null ? "" : t),
|
|
3000
|
+
updated_at: r.string().transform((t) => t === null ? "" : t)
|
|
3001
|
+
}).extend(kn.shape);
|
|
3002
|
+
var nt = /* @__PURE__ */ ((t) => (t.TOKEN = "token", t.TOKEN_ID_TOKEN = "token id_token", t.CODE = "code", t))(nt || {}), rt = /* @__PURE__ */ ((t) => (t.QUERY = "query", t.FRAGMENT = "fragment", t.FORM_POST = "form_post", t.WEB_MESSAGE = "web_message", t))(rt || {}), st = /* @__PURE__ */ ((t) => (t.S265 = "S256", t.plain = "plain", t))(st || {});
|
|
3003
|
+
const $e = r.object({
|
|
3004
|
+
client_id: r.string(),
|
|
3005
|
+
vendor_id: r.string().optional(),
|
|
3006
|
+
response_type: r.nativeEnum(nt).optional(),
|
|
3007
|
+
response_mode: r.nativeEnum(rt).optional(),
|
|
3008
|
+
redirect_uri: r.string().optional(),
|
|
3009
|
+
audience: r.string().optional(),
|
|
3010
|
+
state: r.string().optional(),
|
|
3011
|
+
nonce: r.string().optional(),
|
|
3012
|
+
scope: r.string().optional(),
|
|
3013
|
+
code_challenge_method: r.nativeEnum(st).optional(),
|
|
3014
|
+
code_challenge: r.string().optional(),
|
|
3015
|
+
username: r.string().optional()
|
|
3016
|
+
}), xn = r.object({
|
|
3017
|
+
authParams: $e,
|
|
3018
|
+
code: r.string(),
|
|
3019
|
+
user_id: r.string(),
|
|
3020
|
+
created_at: r.string(),
|
|
3021
|
+
expires_at: r.string(),
|
|
3022
|
+
used_at: r.string().optional()
|
|
3023
|
+
}), Gn = r.object({
|
|
3024
|
+
...xn.shape,
|
|
3025
|
+
created_at: r.string()
|
|
3026
|
+
}), Hn = r.object({
|
|
3027
|
+
colors: r.object({
|
|
3028
|
+
primary: r.string(),
|
|
3029
|
+
page_background: r.object({
|
|
3030
|
+
type: r.string().optional(),
|
|
3031
|
+
start: r.string().optional(),
|
|
3032
|
+
end: r.string().optional(),
|
|
3033
|
+
angle_deg: r.number().optional()
|
|
3034
3034
|
}).optional()
|
|
3035
3035
|
}).optional(),
|
|
3036
|
-
logo_url:
|
|
3037
|
-
favicon_url:
|
|
3038
|
-
font:
|
|
3039
|
-
url:
|
|
3036
|
+
logo_url: r.string().optional(),
|
|
3037
|
+
favicon_url: r.string().optional(),
|
|
3038
|
+
font: r.object({
|
|
3039
|
+
url: r.string()
|
|
3040
3040
|
}).optional()
|
|
3041
|
-
}),
|
|
3042
|
-
id:
|
|
3043
|
-
name:
|
|
3044
|
-
client_id:
|
|
3045
|
-
client_secret:
|
|
3046
|
-
authorization_endpoint:
|
|
3047
|
-
response_type:
|
|
3048
|
-
response_mode:
|
|
3049
|
-
private_key:
|
|
3050
|
-
kid:
|
|
3051
|
-
team_id:
|
|
3052
|
-
token_endpoint:
|
|
3053
|
-
token_exchange_basic_auth:
|
|
3054
|
-
userinfo_endpoint:
|
|
3055
|
-
scope:
|
|
3056
|
-
}),
|
|
3057
|
-
id:
|
|
3058
|
-
created_at:
|
|
3059
|
-
updated_at:
|
|
3060
|
-
}).extend(
|
|
3061
|
-
domain:
|
|
3062
|
-
dkim_private_key:
|
|
3063
|
-
dkim_public_key:
|
|
3064
|
-
email_api_key:
|
|
3065
|
-
email_service:
|
|
3066
|
-
}),
|
|
3067
|
-
id:
|
|
3068
|
-
name:
|
|
3069
|
-
domains:
|
|
3070
|
-
allowed_callback_urls:
|
|
3071
|
-
allowed_logout_urls:
|
|
3072
|
-
allowed_web_origins:
|
|
3073
|
-
email_validation:
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3041
|
+
}), wn = r.object({
|
|
3042
|
+
id: r.string().optional(),
|
|
3043
|
+
name: r.string(),
|
|
3044
|
+
client_id: r.string().optional(),
|
|
3045
|
+
client_secret: r.string().optional(),
|
|
3046
|
+
authorization_endpoint: r.string().optional(),
|
|
3047
|
+
response_type: r.custom().optional(),
|
|
3048
|
+
response_mode: r.custom().optional(),
|
|
3049
|
+
private_key: r.string().optional(),
|
|
3050
|
+
kid: r.string().optional(),
|
|
3051
|
+
team_id: r.string().optional(),
|
|
3052
|
+
token_endpoint: r.string().optional(),
|
|
3053
|
+
token_exchange_basic_auth: r.boolean().optional(),
|
|
3054
|
+
userinfo_endpoint: r.string().optional(),
|
|
3055
|
+
scope: r.string().optional()
|
|
3056
|
+
}), at = r.object({
|
|
3057
|
+
id: r.string(),
|
|
3058
|
+
created_at: r.string().transform((t) => t === null ? "" : t),
|
|
3059
|
+
updated_at: r.string().transform((t) => t === null ? "" : t)
|
|
3060
|
+
}).extend(wn.shape), Sn = r.object({
|
|
3061
|
+
domain: r.string(),
|
|
3062
|
+
dkim_private_key: r.string().optional(),
|
|
3063
|
+
dkim_public_key: r.string().optional(),
|
|
3064
|
+
email_api_key: r.string().optional(),
|
|
3065
|
+
email_service: r.union([r.literal("mailgun"), r.literal("mailchannels")]).optional()
|
|
3066
|
+
}), it = r.object({
|
|
3067
|
+
id: r.string(),
|
|
3068
|
+
name: r.string(),
|
|
3069
|
+
domains: r.array(Sn),
|
|
3070
|
+
allowed_callback_urls: r.array(r.string()),
|
|
3071
|
+
allowed_logout_urls: r.array(r.string()),
|
|
3072
|
+
allowed_web_origins: r.array(r.string()),
|
|
3073
|
+
email_validation: r.union([
|
|
3074
|
+
r.literal("enabled"),
|
|
3075
|
+
r.literal("disabled"),
|
|
3076
|
+
r.literal("enforced")
|
|
3077
3077
|
]),
|
|
3078
|
-
tenant_id:
|
|
3079
|
-
client_secret:
|
|
3080
|
-
disable_sign_ups:
|
|
3081
|
-
tenant:
|
|
3082
|
-
name:
|
|
3083
|
-
audience:
|
|
3084
|
-
logo:
|
|
3085
|
-
primary_color:
|
|
3086
|
-
secondary_color:
|
|
3087
|
-
sender_email:
|
|
3088
|
-
sender_name:
|
|
3089
|
-
support_url:
|
|
3090
|
-
language:
|
|
3078
|
+
tenant_id: r.string(),
|
|
3079
|
+
client_secret: r.string(),
|
|
3080
|
+
disable_sign_ups: r.boolean(),
|
|
3081
|
+
tenant: r.object({
|
|
3082
|
+
name: r.string(),
|
|
3083
|
+
audience: r.string().optional(),
|
|
3084
|
+
logo: r.string().optional(),
|
|
3085
|
+
primary_color: r.string().optional(),
|
|
3086
|
+
secondary_color: r.string().optional(),
|
|
3087
|
+
sender_email: r.string(),
|
|
3088
|
+
sender_name: r.string(),
|
|
3089
|
+
support_url: r.string().optional(),
|
|
3090
|
+
language: r.string().length(2).optional()
|
|
3091
3091
|
})
|
|
3092
|
-
}),
|
|
3093
|
-
connections:
|
|
3094
|
-
}),
|
|
3095
|
-
connections:
|
|
3096
|
-
}),
|
|
3097
|
-
domain:
|
|
3098
|
-
dkim_private_key:
|
|
3099
|
-
dkim_public_key:
|
|
3100
|
-
email_api_key:
|
|
3101
|
-
email_service:
|
|
3102
|
-
}),
|
|
3103
|
-
...
|
|
3104
|
-
id:
|
|
3105
|
-
}),
|
|
3106
|
-
trigger_id:
|
|
3107
|
-
enabled:
|
|
3108
|
-
url:
|
|
3109
|
-
hook_id:
|
|
3110
|
-
}),
|
|
3111
|
-
...
|
|
3112
|
-
hook_id:
|
|
3113
|
-
}),
|
|
3114
|
-
alg:
|
|
3115
|
-
e:
|
|
3116
|
-
kid:
|
|
3117
|
-
kty:
|
|
3118
|
-
n:
|
|
3119
|
-
use:
|
|
3120
|
-
}),
|
|
3121
|
-
keys:
|
|
3122
|
-
}),
|
|
3123
|
-
issuer:
|
|
3124
|
-
authorization_endpoint:
|
|
3125
|
-
token_endpoint:
|
|
3126
|
-
device_authorization_endpoint:
|
|
3127
|
-
userinfo_endpoint:
|
|
3128
|
-
mfa_challenge_endpoint:
|
|
3129
|
-
jwks_uri:
|
|
3130
|
-
registration_endpoint:
|
|
3131
|
-
revocation_endpoint:
|
|
3132
|
-
scopes_supported:
|
|
3133
|
-
response_types_supported:
|
|
3134
|
-
code_challenge_methods_supported:
|
|
3135
|
-
response_modes_supported:
|
|
3136
|
-
subject_types_supported:
|
|
3137
|
-
id_token_signing_alg_values_supported:
|
|
3138
|
-
token_endpoint_auth_methods_supported:
|
|
3139
|
-
claims_supported:
|
|
3140
|
-
request_uri_parameter_supported:
|
|
3141
|
-
request_parameter_supported:
|
|
3142
|
-
token_endpoint_auth_signing_alg_values_supported:
|
|
3143
|
-
}), En = s.object({
|
|
3144
|
-
id: s.string(),
|
|
3145
|
-
email: s.string(),
|
|
3146
|
-
code: s.string(),
|
|
3147
|
-
ip: s.string().optional(),
|
|
3148
|
-
send: s.enum(["code", "link"]),
|
|
3149
|
-
authParams: Me,
|
|
3150
|
-
expires_at: s.string(),
|
|
3151
|
-
used_at: s.string().optional(),
|
|
3152
|
-
user_id: s.string().optional()
|
|
3153
|
-
}), Hn = s.object({
|
|
3154
|
-
created_at: s.string(),
|
|
3155
|
-
...En.shape
|
|
3156
|
-
}), Cn = s.object({
|
|
3157
|
-
user_id: s.string(),
|
|
3158
|
-
password: s.string()
|
|
3159
|
-
}), Kn = s.object({
|
|
3160
|
-
...Cn.shape,
|
|
3161
|
-
created_at: s.string(),
|
|
3162
|
-
updated_at: s.string()
|
|
3163
|
-
}), jn = s.object({
|
|
3164
|
-
session_id: s.string(),
|
|
3165
|
-
client_id: s.string(),
|
|
3166
|
-
expires_at: s.string(),
|
|
3167
|
-
used_at: s.string(),
|
|
3168
|
-
deleted_at: s.string().optional(),
|
|
3169
|
-
user_id: s.string()
|
|
3170
|
-
}), Yn = s.object({
|
|
3171
|
-
created_at: s.string(),
|
|
3172
|
-
...jn.shape
|
|
3173
|
-
}), Jn = s.object({
|
|
3174
|
-
private_key: s.string(),
|
|
3175
|
-
public_key: s.string(),
|
|
3176
|
-
kid: s.string(),
|
|
3177
|
-
created_at: s.string(),
|
|
3178
|
-
revoked_at: s.string().optional()
|
|
3179
|
-
}), Fn = s.object({
|
|
3180
|
-
kid: s.string().openapi({ description: "The key id of the signing key" }),
|
|
3181
|
-
cert: s.string().openapi({ description: "The public certificate of the signing key" }),
|
|
3182
|
-
fingerprint: s.string().openapi({ description: "The cert fingerprint" }),
|
|
3183
|
-
thumbprint: s.string().openapi({ description: "The cert thumbprint" }),
|
|
3184
|
-
pkcs7: s.string().optional().openapi({
|
|
3185
|
-
description: "The public certificate of the signing key in pkcs7 format"
|
|
3186
|
-
}),
|
|
3187
|
-
current: s.boolean().optional().openapi({ description: "True if the key is the current key" }),
|
|
3188
|
-
next: s.boolean().optional().openapi({ description: "True if the key is the next key" }),
|
|
3189
|
-
previous: s.boolean().optional().openapi({ description: "True if the key is the previous key" }),
|
|
3190
|
-
current_since: s.string().optional().openapi({
|
|
3191
|
-
description: "The date and time when the key became the current key"
|
|
3192
|
-
}),
|
|
3193
|
-
current_until: s.string().optional().openapi({
|
|
3194
|
-
description: "The date and time when the current key was rotated"
|
|
3195
|
-
}),
|
|
3196
|
-
revoked: s.boolean().optional().openapi({ description: "True if the key is revoked" }),
|
|
3197
|
-
revoked_at: s.string().optional().openapi({ description: "The date and time when the key was revoked" })
|
|
3198
|
-
}), Zn = s.object({
|
|
3199
|
-
name: s.string(),
|
|
3200
|
-
audience: s.string(),
|
|
3201
|
-
sender_email: s.string().email(),
|
|
3202
|
-
sender_name: s.string(),
|
|
3203
|
-
support_url: s.string().url().optional(),
|
|
3204
|
-
logo: s.string().url().optional(),
|
|
3205
|
-
primary_color: s.string().optional(),
|
|
3206
|
-
secondary_color: s.string().optional(),
|
|
3207
|
-
language: s.string().optional()
|
|
3208
|
-
}), Xn = Zn.extend({
|
|
3209
|
-
created_at: s.string().transform((t) => t === null ? "" : t),
|
|
3210
|
-
updated_at: s.string().transform((t) => t === null ? "" : t)
|
|
3211
|
-
}), Qn = s.object({
|
|
3212
|
-
logoUrl: s.string(),
|
|
3213
|
-
loginBackgroundImage: s.string().nullish(),
|
|
3214
|
-
style: s.object({
|
|
3215
|
-
primaryColor: s.string(),
|
|
3216
|
-
buttonTextColor: s.string(),
|
|
3217
|
-
primaryHoverColor: s.string()
|
|
3218
|
-
}),
|
|
3219
|
-
supportEmail: s.string().nullable(),
|
|
3220
|
-
supportUrl: s.string().nullable(),
|
|
3221
|
-
name: s.string(),
|
|
3222
|
-
showGreyishBackground: s.boolean().optional(),
|
|
3223
|
-
termsAndConditionsUrl: s.string().nullable(),
|
|
3224
|
-
companyName: s.string().optional(),
|
|
3225
|
-
checkoutHideSocial: s.boolean().optional(),
|
|
3226
|
-
siteUrl: s.string().nullable(),
|
|
3227
|
-
manageSubscriptionsUrl: s.string().optional()
|
|
3228
|
-
});
|
|
3229
|
-
var it = /* @__PURE__ */ ((t) => (t.RefreshToken = "refresh_token", t.AuthorizationCode = "authorization_code", t.ClientCredential = "client_credentials", t.Passwordless = "passwordless", t.Password = "password", t))(it || {});
|
|
3230
|
-
const $e = s.nativeEnum(it), er = s.object({
|
|
3231
|
-
grant_type: $e.refine(
|
|
3232
|
-
(t) => t === "authorization_code"
|
|
3233
|
-
/* AuthorizationCode */
|
|
3234
|
-
),
|
|
3235
|
-
code: s.string(),
|
|
3236
|
-
client_secret: s.string(),
|
|
3237
|
-
client_id: s.string()
|
|
3238
|
-
}), tr = s.object({
|
|
3239
|
-
grant_type: $e.refine(
|
|
3240
|
-
(t) => t === "authorization_code"
|
|
3241
|
-
/* AuthorizationCode */
|
|
3242
|
-
),
|
|
3243
|
-
code: s.string(),
|
|
3244
|
-
code_verifier: s.string(),
|
|
3245
|
-
client_id: s.string().optional(),
|
|
3246
|
-
redirect_uri: s.string()
|
|
3247
|
-
}), nr = s.object({
|
|
3248
|
-
grant_type: $e.refine(
|
|
3249
|
-
(t) => t === "client_credentials"
|
|
3250
|
-
/* ClientCredential */
|
|
3251
|
-
),
|
|
3252
|
-
scope: s.string().optional(),
|
|
3253
|
-
client_secret: s.string(),
|
|
3254
|
-
client_id: s.string(),
|
|
3255
|
-
audience: s.string().optional()
|
|
3256
|
-
});
|
|
3257
|
-
s.object({
|
|
3258
|
-
access_token: s.string(),
|
|
3259
|
-
id_token: s.string().optional(),
|
|
3260
|
-
scope: s.string().optional(),
|
|
3261
|
-
state: s.string().optional(),
|
|
3262
|
-
refresh_token: s.string().optional(),
|
|
3263
|
-
token_type: s.string(),
|
|
3264
|
-
expires_in: s.number()
|
|
3092
|
+
}), Kn = it.extend({
|
|
3093
|
+
connections: r.array(at)
|
|
3094
|
+
}), Yn = it.extend({
|
|
3095
|
+
connections: r.array(at.partial())
|
|
3096
|
+
}), Tn = r.object({
|
|
3097
|
+
domain: r.string(),
|
|
3098
|
+
dkim_private_key: r.string().optional(),
|
|
3099
|
+
dkim_public_key: r.string().optional(),
|
|
3100
|
+
email_api_key: r.string().optional(),
|
|
3101
|
+
email_service: r.enum(["mailgun", "mailchannels"])
|
|
3102
|
+
}), Jn = Me.extend({
|
|
3103
|
+
...Tn.shape,
|
|
3104
|
+
id: r.string()
|
|
3105
|
+
}), On = r.object({
|
|
3106
|
+
trigger_id: r.enum(["post-user-registration", "post-user-login"]),
|
|
3107
|
+
enabled: r.boolean().default(!1),
|
|
3108
|
+
url: r.string(),
|
|
3109
|
+
hook_id: r.string().optional()
|
|
3110
|
+
}), Fn = On.extend({
|
|
3111
|
+
...Me.shape,
|
|
3112
|
+
hook_id: r.string()
|
|
3113
|
+
}), jn = r.object({
|
|
3114
|
+
alg: r.string(),
|
|
3115
|
+
e: r.string(),
|
|
3116
|
+
kid: r.string(),
|
|
3117
|
+
kty: r.string(),
|
|
3118
|
+
n: r.string(),
|
|
3119
|
+
use: r.string().optional()
|
|
3120
|
+
}), Xn = r.object({
|
|
3121
|
+
keys: r.array(jn)
|
|
3122
|
+
}), Qn = r.object({
|
|
3123
|
+
issuer: r.string(),
|
|
3124
|
+
authorization_endpoint: r.string(),
|
|
3125
|
+
token_endpoint: r.string(),
|
|
3126
|
+
device_authorization_endpoint: r.string(),
|
|
3127
|
+
userinfo_endpoint: r.string(),
|
|
3128
|
+
mfa_challenge_endpoint: r.string(),
|
|
3129
|
+
jwks_uri: r.string(),
|
|
3130
|
+
registration_endpoint: r.string(),
|
|
3131
|
+
revocation_endpoint: r.string(),
|
|
3132
|
+
scopes_supported: r.array(r.string()),
|
|
3133
|
+
response_types_supported: r.array(r.string()),
|
|
3134
|
+
code_challenge_methods_supported: r.array(r.string()),
|
|
3135
|
+
response_modes_supported: r.array(r.string()),
|
|
3136
|
+
subject_types_supported: r.array(r.string()),
|
|
3137
|
+
id_token_signing_alg_values_supported: r.array(r.string()),
|
|
3138
|
+
token_endpoint_auth_methods_supported: r.array(r.string()),
|
|
3139
|
+
claims_supported: r.array(r.string()),
|
|
3140
|
+
request_uri_parameter_supported: r.boolean(),
|
|
3141
|
+
request_parameter_supported: r.boolean(),
|
|
3142
|
+
token_endpoint_auth_signing_alg_values_supported: r.array(r.string())
|
|
3265
3143
|
});
|
|
3266
|
-
s.
|
|
3267
|
-
|
|
3268
|
-
state: s.string().optional()
|
|
3269
|
-
});
|
|
3270
|
-
const Nn = s.object({
|
|
3271
|
-
id: s.string(),
|
|
3272
|
-
expires_at: s.string(),
|
|
3273
|
-
auth0Client: s.string().optional(),
|
|
3274
|
-
authParams: Me
|
|
3275
|
-
}), rr = s.object({
|
|
3276
|
-
...Nn.shape,
|
|
3277
|
-
created_at: s.string(),
|
|
3278
|
-
updated_at: s.string()
|
|
3279
|
-
});
|
|
3280
|
-
var In = /* @__PURE__ */ ((t) => (t.SUCCESS_API_OPERATION = "sapi", t.SUCCESS_SILENT_AUTH = "ssa", t.FAILED_SILENT_AUTH = "fsa", t.SUCCESS_SIGNUP = "ss", t.FAILED_SIGNUP = "fs", t.SUCCESS_LOGIN = "s", t.FAILED_LOGIN = "f", t.FAILED_LOGIN_INCORRECT_PASSWORD = "fp", t.SUCCESS_LOGOUT = "slo", t.SUCCESS_CROSS_ORIGIN_AUTHENTICATION = "scoa", t.FAILED_CROSS_ORIGIN_AUTHENTICATION = "fcoa", t.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN = "seacft", t.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN = "serft", t.CODE_LINK_SENT = "cls", t.NOT_IMPLEMENTED_1 = "seccft", t))(In || {});
|
|
3281
|
-
const Rn = s.enum([
|
|
3144
|
+
var En = /* @__PURE__ */ ((t) => (t.SUCCESS_API_OPERATION = "sapi", t.SUCCESS_SILENT_AUTH = "ssa", t.FAILED_SILENT_AUTH = "fsa", t.SUCCESS_SIGNUP = "ss", t.FAILED_SIGNUP = "fs", t.SUCCESS_LOGIN = "s", t.FAILED_LOGIN = "f", t.FAILED_LOGIN_INCORRECT_PASSWORD = "fp", t.SUCCESS_LOGOUT = "slo", t.SUCCESS_CROSS_ORIGIN_AUTHENTICATION = "scoa", t.FAILED_CROSS_ORIGIN_AUTHENTICATION = "fcoa", t.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN = "seacft", t.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN = "serft", t.CODE_LINK_SENT = "cls", t.NOT_IMPLEMENTED_1 = "seccft", t))(En || {});
|
|
3145
|
+
const Cn = r.enum([
|
|
3282
3146
|
"sapi",
|
|
3283
3147
|
// SUCCESS_API_OPERATION
|
|
3284
3148
|
"ssa",
|
|
@@ -3310,90 +3174,296 @@ const Rn = s.enum([
|
|
|
3310
3174
|
"seacft",
|
|
3311
3175
|
// SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN
|
|
3312
3176
|
"serft"
|
|
3313
|
-
]),
|
|
3314
|
-
name:
|
|
3315
|
-
version:
|
|
3316
|
-
env:
|
|
3317
|
-
node:
|
|
3177
|
+
]), Zn = r.object({
|
|
3178
|
+
name: r.string(),
|
|
3179
|
+
version: r.string(),
|
|
3180
|
+
env: r.object({
|
|
3181
|
+
node: r.string().optional()
|
|
3318
3182
|
}).optional()
|
|
3319
|
-
}),
|
|
3320
|
-
type:
|
|
3321
|
-
date:
|
|
3322
|
-
description:
|
|
3323
|
-
log_id:
|
|
3324
|
-
_id:
|
|
3325
|
-
ip:
|
|
3326
|
-
user_agent:
|
|
3327
|
-
details:
|
|
3183
|
+
}), er = r.object({
|
|
3184
|
+
type: Cn,
|
|
3185
|
+
date: r.string(),
|
|
3186
|
+
description: r.string().optional(),
|
|
3187
|
+
log_id: r.string().optional(),
|
|
3188
|
+
_id: r.string().optional(),
|
|
3189
|
+
ip: r.string(),
|
|
3190
|
+
user_agent: r.string(),
|
|
3191
|
+
details: r.any().optional(),
|
|
3328
3192
|
// Using z.any() as a placeholder for "details" type
|
|
3329
|
-
isMobile:
|
|
3330
|
-
user_id:
|
|
3331
|
-
user_name:
|
|
3332
|
-
connection:
|
|
3333
|
-
connection_id:
|
|
3334
|
-
client_id:
|
|
3335
|
-
client_name:
|
|
3336
|
-
audience:
|
|
3337
|
-
scope:
|
|
3338
|
-
strategy:
|
|
3339
|
-
strategy_type:
|
|
3340
|
-
hostname:
|
|
3341
|
-
auth0_client:
|
|
3193
|
+
isMobile: r.boolean(),
|
|
3194
|
+
user_id: r.string().optional(),
|
|
3195
|
+
user_name: r.string().optional(),
|
|
3196
|
+
connection: r.string().optional(),
|
|
3197
|
+
connection_id: r.string().optional(),
|
|
3198
|
+
client_id: r.string().optional(),
|
|
3199
|
+
client_name: r.string().optional(),
|
|
3200
|
+
audience: r.string().optional(),
|
|
3201
|
+
scope: r.array(r.string()).optional(),
|
|
3202
|
+
strategy: r.string().optional(),
|
|
3203
|
+
strategy_type: r.string().optional(),
|
|
3204
|
+
hostname: r.string().optional(),
|
|
3205
|
+
auth0_client: Zn.optional()
|
|
3206
|
+
}), Nn = r.object({
|
|
3207
|
+
id: r.string(),
|
|
3208
|
+
email: r.string(),
|
|
3209
|
+
code: r.string(),
|
|
3210
|
+
ip: r.string().optional(),
|
|
3211
|
+
send: r.enum(["code", "link"]),
|
|
3212
|
+
authParams: $e,
|
|
3213
|
+
expires_at: r.string(),
|
|
3214
|
+
used_at: r.string().optional(),
|
|
3215
|
+
user_id: r.string().optional()
|
|
3216
|
+
}), tr = r.object({
|
|
3217
|
+
created_at: r.string(),
|
|
3218
|
+
...Nn.shape
|
|
3219
|
+
}), In = r.object({
|
|
3220
|
+
user_id: r.string(),
|
|
3221
|
+
password: r.string()
|
|
3222
|
+
}), nr = r.object({
|
|
3223
|
+
...In.shape,
|
|
3224
|
+
created_at: r.string(),
|
|
3225
|
+
updated_at: r.string()
|
|
3226
|
+
}), Rn = r.object({
|
|
3227
|
+
session_id: r.string(),
|
|
3228
|
+
client_id: r.string(),
|
|
3229
|
+
expires_at: r.string(),
|
|
3230
|
+
used_at: r.string(),
|
|
3231
|
+
deleted_at: r.string().optional(),
|
|
3232
|
+
user_id: r.string()
|
|
3233
|
+
}), rr = r.object({
|
|
3234
|
+
created_at: r.string(),
|
|
3235
|
+
...Rn.shape
|
|
3236
|
+
}), sr = r.object({
|
|
3237
|
+
private_key: r.string(),
|
|
3238
|
+
public_key: r.string(),
|
|
3239
|
+
kid: r.string(),
|
|
3240
|
+
created_at: r.string(),
|
|
3241
|
+
revoked_at: r.string().optional()
|
|
3242
|
+
}), ar = r.object({
|
|
3243
|
+
kid: r.string().openapi({ description: "The key id of the signing key" }),
|
|
3244
|
+
cert: r.string().openapi({ description: "The public certificate of the signing key" }),
|
|
3245
|
+
fingerprint: r.string().openapi({ description: "The cert fingerprint" }),
|
|
3246
|
+
thumbprint: r.string().openapi({ description: "The cert thumbprint" }),
|
|
3247
|
+
pkcs7: r.string().optional().openapi({
|
|
3248
|
+
description: "The public certificate of the signing key in pkcs7 format"
|
|
3249
|
+
}),
|
|
3250
|
+
current: r.boolean().optional().openapi({ description: "True if the key is the current key" }),
|
|
3251
|
+
next: r.boolean().optional().openapi({ description: "True if the key is the next key" }),
|
|
3252
|
+
previous: r.boolean().optional().openapi({ description: "True if the key is the previous key" }),
|
|
3253
|
+
current_since: r.string().optional().openapi({
|
|
3254
|
+
description: "The date and time when the key became the current key"
|
|
3255
|
+
}),
|
|
3256
|
+
current_until: r.string().optional().openapi({
|
|
3257
|
+
description: "The date and time when the current key was rotated"
|
|
3258
|
+
}),
|
|
3259
|
+
revoked: r.boolean().optional().openapi({ description: "True if the key is revoked" }),
|
|
3260
|
+
revoked_at: r.string().optional().openapi({ description: "The date and time when the key was revoked" })
|
|
3261
|
+
}), An = r.object({
|
|
3262
|
+
name: r.string(),
|
|
3263
|
+
audience: r.string(),
|
|
3264
|
+
sender_email: r.string().email(),
|
|
3265
|
+
sender_name: r.string(),
|
|
3266
|
+
support_url: r.string().url().optional(),
|
|
3267
|
+
logo: r.string().url().optional(),
|
|
3268
|
+
primary_color: r.string().optional(),
|
|
3269
|
+
secondary_color: r.string().optional(),
|
|
3270
|
+
language: r.string().optional()
|
|
3271
|
+
}), ir = An.extend({
|
|
3272
|
+
created_at: r.string().transform((t) => t === null ? "" : t),
|
|
3273
|
+
updated_at: r.string().transform((t) => t === null ? "" : t)
|
|
3274
|
+
}), or = r.object({
|
|
3275
|
+
logoUrl: r.string(),
|
|
3276
|
+
loginBackgroundImage: r.string().nullish(),
|
|
3277
|
+
style: r.object({
|
|
3278
|
+
primaryColor: r.string(),
|
|
3279
|
+
buttonTextColor: r.string(),
|
|
3280
|
+
primaryHoverColor: r.string()
|
|
3281
|
+
}),
|
|
3282
|
+
supportEmail: r.string().nullable(),
|
|
3283
|
+
supportUrl: r.string().nullable(),
|
|
3284
|
+
name: r.string(),
|
|
3285
|
+
showGreyishBackground: r.boolean().optional(),
|
|
3286
|
+
termsAndConditionsUrl: r.string().nullable(),
|
|
3287
|
+
companyName: r.string().optional(),
|
|
3288
|
+
checkoutHideSocial: r.boolean().optional(),
|
|
3289
|
+
siteUrl: r.string().nullable(),
|
|
3290
|
+
manageSubscriptionsUrl: r.string().optional()
|
|
3291
|
+
});
|
|
3292
|
+
var ot = /* @__PURE__ */ ((t) => (t.RefreshToken = "refresh_token", t.AuthorizationCode = "authorization_code", t.ClientCredential = "client_credentials", t.Passwordless = "passwordless", t.Password = "password", t))(ot || {});
|
|
3293
|
+
const De = r.nativeEnum(ot), cr = r.object({
|
|
3294
|
+
grant_type: De.refine(
|
|
3295
|
+
(t) => t === "authorization_code"
|
|
3296
|
+
/* AuthorizationCode */
|
|
3297
|
+
),
|
|
3298
|
+
code: r.string(),
|
|
3299
|
+
client_secret: r.string(),
|
|
3300
|
+
client_id: r.string()
|
|
3301
|
+
}), dr = r.object({
|
|
3302
|
+
grant_type: De.refine(
|
|
3303
|
+
(t) => t === "authorization_code"
|
|
3304
|
+
/* AuthorizationCode */
|
|
3305
|
+
),
|
|
3306
|
+
code: r.string(),
|
|
3307
|
+
code_verifier: r.string(),
|
|
3308
|
+
client_id: r.string().optional(),
|
|
3309
|
+
redirect_uri: r.string()
|
|
3310
|
+
}), lr = r.object({
|
|
3311
|
+
grant_type: De.refine(
|
|
3312
|
+
(t) => t === "client_credentials"
|
|
3313
|
+
/* ClientCredential */
|
|
3314
|
+
),
|
|
3315
|
+
scope: r.string().optional(),
|
|
3316
|
+
client_secret: r.string(),
|
|
3317
|
+
client_id: r.string(),
|
|
3318
|
+
audience: r.string().optional()
|
|
3319
|
+
});
|
|
3320
|
+
r.object({
|
|
3321
|
+
access_token: r.string(),
|
|
3322
|
+
id_token: r.string().optional(),
|
|
3323
|
+
scope: r.string().optional(),
|
|
3324
|
+
state: r.string().optional(),
|
|
3325
|
+
refresh_token: r.string().optional(),
|
|
3326
|
+
token_type: r.string(),
|
|
3327
|
+
expires_in: r.number()
|
|
3328
|
+
});
|
|
3329
|
+
r.object({
|
|
3330
|
+
code: r.string(),
|
|
3331
|
+
state: r.string().optional()
|
|
3332
|
+
});
|
|
3333
|
+
const Pn = r.object({
|
|
3334
|
+
id: r.string(),
|
|
3335
|
+
expires_at: r.string(),
|
|
3336
|
+
auth0Client: r.string().optional(),
|
|
3337
|
+
authParams: $e
|
|
3338
|
+
}), ur = r.object({
|
|
3339
|
+
...Pn.shape,
|
|
3340
|
+
created_at: r.string(),
|
|
3341
|
+
updated_at: r.string()
|
|
3342
|
+
}), Mn = r.object({
|
|
3343
|
+
button_border_radius: r.number(),
|
|
3344
|
+
button_border_weight: r.number(),
|
|
3345
|
+
buttons_style: r.enum(["pill"]),
|
|
3346
|
+
input_border_radius: r.number(),
|
|
3347
|
+
input_border_weight: r.number(),
|
|
3348
|
+
inputs_style: r.enum(["pill"]),
|
|
3349
|
+
show_widget_shadow: r.boolean(),
|
|
3350
|
+
widget_border_weight: r.number(),
|
|
3351
|
+
widget_corner_radius: r.number()
|
|
3352
|
+
}), $n = r.object({
|
|
3353
|
+
base_focus_color: r.string(),
|
|
3354
|
+
base_hover_color: r.string(),
|
|
3355
|
+
body_text: r.string(),
|
|
3356
|
+
captcha_widget_theme: r.enum(["auto"]),
|
|
3357
|
+
error: r.string(),
|
|
3358
|
+
header: r.string(),
|
|
3359
|
+
icons: r.string(),
|
|
3360
|
+
input_background: r.string(),
|
|
3361
|
+
input_border: r.string(),
|
|
3362
|
+
input_filled_text: r.string(),
|
|
3363
|
+
input_labels_placeholders: r.string(),
|
|
3364
|
+
links_focused_components: r.string(),
|
|
3365
|
+
primary_button: r.string(),
|
|
3366
|
+
primary_button_label: r.string(),
|
|
3367
|
+
secondary_button_border: r.string(),
|
|
3368
|
+
secondary_button_label: r.string(),
|
|
3369
|
+
success: r.string(),
|
|
3370
|
+
widget_background: r.string(),
|
|
3371
|
+
widget_border: r.string()
|
|
3372
|
+
}), W = r.object({
|
|
3373
|
+
bold: r.boolean(),
|
|
3374
|
+
size: r.number()
|
|
3375
|
+
}), Dn = r.object({
|
|
3376
|
+
body_text: W,
|
|
3377
|
+
buttons_text: W,
|
|
3378
|
+
font_url: r.string(),
|
|
3379
|
+
input_labels: W,
|
|
3380
|
+
links: W,
|
|
3381
|
+
links_style: r.enum(["normal"]),
|
|
3382
|
+
reference_text_size: r.number(),
|
|
3383
|
+
subtitle: W,
|
|
3384
|
+
title: W
|
|
3385
|
+
}), Un = r.object({
|
|
3386
|
+
background_color: r.string(),
|
|
3387
|
+
background_image_url: r.string(),
|
|
3388
|
+
page_layout: r.enum(["center"])
|
|
3389
|
+
}), Vn = r.object({
|
|
3390
|
+
header_text_alignment: r.enum(["center"]),
|
|
3391
|
+
logo_height: r.number(),
|
|
3392
|
+
logo_position: r.enum(["center"]),
|
|
3393
|
+
logo_url: r.string(),
|
|
3394
|
+
social_buttons_layout: r.enum(["bottom"])
|
|
3395
|
+
}), Ln = r.object({
|
|
3396
|
+
borders: Mn,
|
|
3397
|
+
colors: $n,
|
|
3398
|
+
displayName: r.string(),
|
|
3399
|
+
fonts: Dn,
|
|
3400
|
+
page_background: Un,
|
|
3401
|
+
widget: Vn
|
|
3402
|
+
}), pr = Ln.extend({
|
|
3403
|
+
themeId: r.string()
|
|
3342
3404
|
});
|
|
3343
|
-
function
|
|
3405
|
+
function hr(t) {
|
|
3344
3406
|
const [e, n] = t.split("|");
|
|
3345
3407
|
if (!e || !n)
|
|
3346
3408
|
throw new Error(`Invalid user_id: ${t}`);
|
|
3347
3409
|
return { connection: e, id: n };
|
|
3348
3410
|
}
|
|
3349
3411
|
export {
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
Tn as
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
On as
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
tr as
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3412
|
+
Zn as Auth0Client,
|
|
3413
|
+
rt as AuthorizationResponseMode,
|
|
3414
|
+
nt as AuthorizationResponseType,
|
|
3415
|
+
Kn as ClientSchema,
|
|
3416
|
+
st as CodeChallengeMethod,
|
|
3417
|
+
ot as GrantType,
|
|
3418
|
+
En as LogTypes,
|
|
3419
|
+
Yn as PartialClientSchema,
|
|
3420
|
+
kn as applicationInsertSchema,
|
|
3421
|
+
qn as applicationSchema,
|
|
3422
|
+
Bn as auth0UserResponseSchema,
|
|
3423
|
+
$e as authParamsSchema,
|
|
3424
|
+
xn as authenticationCodeInsertSchema,
|
|
3425
|
+
Gn as authenticationCodeSchema,
|
|
3426
|
+
cr as authorizationCodeGrantTypeParamsSchema,
|
|
3427
|
+
tt as baseUserSchema,
|
|
3428
|
+
Mn as bordersSchema,
|
|
3429
|
+
Hn as brandingSchema,
|
|
3430
|
+
sr as certificateSchema,
|
|
3431
|
+
lr as clientCredentialGrantTypeParamsSchema,
|
|
3432
|
+
$n as colorsSchema,
|
|
3433
|
+
wn as connectionInsertSchema,
|
|
3434
|
+
at as connectionSchema,
|
|
3435
|
+
Tn as domainInsertSchema,
|
|
3436
|
+
Jn as domainSchema,
|
|
3437
|
+
W as fontDetailsSchema,
|
|
3438
|
+
Dn as fontsSchema,
|
|
3439
|
+
On as hookInsertSchema,
|
|
3440
|
+
Fn as hookSchema,
|
|
3441
|
+
yn as identitySchema,
|
|
3442
|
+
Xn as jwksKeySchema,
|
|
3443
|
+
jn as jwksSchema,
|
|
3444
|
+
er as logSchema,
|
|
3445
|
+
Qn as openIDConfigurationSchema,
|
|
3446
|
+
Nn as otpInsertSchema,
|
|
3447
|
+
tr as otpSchema,
|
|
3448
|
+
Un as pageBackgroundSchema,
|
|
3449
|
+
hr as parseUserId,
|
|
3450
|
+
In as passwordInsertSchema,
|
|
3451
|
+
nr as passwordSchema,
|
|
3452
|
+
dr as pkceAuthorizationCodeGrantTypeParamsSchema,
|
|
3453
|
+
gn as profileDataSchema,
|
|
3454
|
+
Rn as sessionInsertSchema,
|
|
3455
|
+
rr as sessionSchema,
|
|
3456
|
+
ar as signingKeySchema,
|
|
3457
|
+
An as tenantInsertSchema,
|
|
3458
|
+
ir as tenantSchema,
|
|
3459
|
+
Ln as themeInsertSchema,
|
|
3460
|
+
pr as themeSchema,
|
|
3461
|
+
zn as totalsSchema,
|
|
3462
|
+
Pn as universalLoginSessionInsertSchema,
|
|
3463
|
+
ur as universalLoginSessionSchema,
|
|
3464
|
+
vn as userInsertSchema,
|
|
3465
|
+
Wn as userResponseSchema,
|
|
3466
|
+
bn as userSchema,
|
|
3467
|
+
or as vendorSettingsSchema,
|
|
3468
|
+
Vn as widgetSchema
|
|
3399
3469
|
};
|