@resconet/qp-bridge 0.0.1-alpha.6 → 0.0.1-alpha.7
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 +28 -0
- package/index.js +1 -1
- package/index.mjs +396 -364
- package/lib/qp-bridge-types.d.ts +87 -0
- package/lib/qp-bridge.d.ts +16 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
let he;
|
|
2
2
|
const Ye = new Uint8Array(16);
|
|
3
|
-
function
|
|
3
|
+
function He() {
|
|
4
4
|
if (!he && (he = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !he))
|
|
5
5
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
6
6
|
return he(Ye);
|
|
@@ -8,18 +8,18 @@ function Ge() {
|
|
|
8
8
|
const b = [];
|
|
9
9
|
for (let s = 0; s < 256; ++s)
|
|
10
10
|
b.push((s + 256).toString(16).slice(1));
|
|
11
|
-
function
|
|
11
|
+
function Je(s, e = 0) {
|
|
12
12
|
return b[s[e + 0]] + b[s[e + 1]] + b[s[e + 2]] + b[s[e + 3]] + "-" + b[s[e + 4]] + b[s[e + 5]] + "-" + b[s[e + 6]] + b[s[e + 7]] + "-" + b[s[e + 8]] + b[s[e + 9]] + "-" + b[s[e + 10]] + b[s[e + 11]] + b[s[e + 12]] + b[s[e + 13]] + b[s[e + 14]] + b[s[e + 15]];
|
|
13
13
|
}
|
|
14
|
-
const
|
|
15
|
-
randomUUID:
|
|
14
|
+
const Xe = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Ie = {
|
|
15
|
+
randomUUID: Xe
|
|
16
16
|
};
|
|
17
|
-
function
|
|
18
|
-
if (
|
|
19
|
-
return
|
|
17
|
+
function Ke(s, e, t) {
|
|
18
|
+
if (Ie.randomUUID && !e && !s)
|
|
19
|
+
return Ie.randomUUID();
|
|
20
20
|
s = s || {};
|
|
21
|
-
const n = s.random || (s.rng ||
|
|
22
|
-
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128,
|
|
21
|
+
const n = s.random || (s.rng || He)();
|
|
22
|
+
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, Je(n);
|
|
23
23
|
}
|
|
24
24
|
var _;
|
|
25
25
|
(function(s) {
|
|
@@ -57,14 +57,14 @@ var _;
|
|
|
57
57
|
}
|
|
58
58
|
s.joinValues = n, s.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
|
|
59
59
|
})(_ || (_ = {}));
|
|
60
|
-
var
|
|
60
|
+
var Se;
|
|
61
61
|
(function(s) {
|
|
62
62
|
s.mergeShapes = (e, t) => ({
|
|
63
63
|
...e,
|
|
64
64
|
...t
|
|
65
65
|
// second overwrites first
|
|
66
66
|
});
|
|
67
|
-
})(
|
|
67
|
+
})(Se || (Se = {}));
|
|
68
68
|
const f = _.arrayToEnum([
|
|
69
69
|
"string",
|
|
70
70
|
"nan",
|
|
@@ -86,7 +86,7 @@ const f = _.arrayToEnum([
|
|
|
86
86
|
"never",
|
|
87
87
|
"map",
|
|
88
88
|
"set"
|
|
89
|
-
]),
|
|
89
|
+
]), A = (s) => {
|
|
90
90
|
switch (typeof s) {
|
|
91
91
|
case "undefined":
|
|
92
92
|
return f.undefined;
|
|
@@ -124,7 +124,7 @@ const f = _.arrayToEnum([
|
|
|
124
124
|
"invalid_intersection_types",
|
|
125
125
|
"not_multiple_of",
|
|
126
126
|
"not_finite"
|
|
127
|
-
]),
|
|
127
|
+
]), Fe = (s) => JSON.stringify(s, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
128
128
|
class S extends Error {
|
|
129
129
|
constructor(e) {
|
|
130
130
|
super(), this.issues = [], this.addIssue = (n) => {
|
|
@@ -185,7 +185,7 @@ class S extends Error {
|
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
S.create = (s) => new S(s);
|
|
188
|
-
const
|
|
188
|
+
const Q = (s, e) => {
|
|
189
189
|
let t;
|
|
190
190
|
switch (s.code) {
|
|
191
191
|
case d.invalid_type:
|
|
@@ -241,8 +241,8 @@ const Y = (s, e) => {
|
|
|
241
241
|
}
|
|
242
242
|
return { message: t };
|
|
243
243
|
};
|
|
244
|
-
let Ae =
|
|
245
|
-
function
|
|
244
|
+
let Ae = Q;
|
|
245
|
+
function et(s) {
|
|
246
246
|
Ae = s;
|
|
247
247
|
}
|
|
248
248
|
function pe() {
|
|
@@ -268,7 +268,7 @@ const me = (s) => {
|
|
|
268
268
|
path: a,
|
|
269
269
|
message: o
|
|
270
270
|
};
|
|
271
|
-
},
|
|
271
|
+
}, tt = [];
|
|
272
272
|
function l(s, e) {
|
|
273
273
|
const t = pe(), n = me({
|
|
274
274
|
issueData: e,
|
|
@@ -278,7 +278,7 @@ function l(s, e) {
|
|
|
278
278
|
s.common.contextualErrorMap,
|
|
279
279
|
s.schemaErrorMap,
|
|
280
280
|
t,
|
|
281
|
-
t ===
|
|
281
|
+
t === Q ? void 0 : Q
|
|
282
282
|
// then global default map
|
|
283
283
|
].filter((r) => !!r)
|
|
284
284
|
});
|
|
@@ -327,13 +327,13 @@ class w {
|
|
|
327
327
|
}
|
|
328
328
|
const m = Object.freeze({
|
|
329
329
|
status: "aborted"
|
|
330
|
-
}), W = (s) => ({ status: "dirty", value: s }), T = (s) => ({ status: "valid", value: s }),
|
|
331
|
-
function
|
|
330
|
+
}), W = (s) => ({ status: "dirty", value: s }), T = (s) => ({ status: "valid", value: s }), Ze = (s) => s.status === "aborted", Ce = (s) => s.status === "dirty", K = (s) => s.status === "valid", F = (s) => typeof Promise < "u" && s instanceof Promise;
|
|
331
|
+
function ge(s, e, t, n) {
|
|
332
332
|
if (typeof e == "function" ? s !== e || !n : !e.has(s))
|
|
333
333
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
334
334
|
return e.get(s);
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function Pe(s, e, t, n, r) {
|
|
337
337
|
if (typeof e == "function" ? s !== e || !r : !e.has(s))
|
|
338
338
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
339
339
|
return e.set(s, t), t;
|
|
@@ -343,7 +343,7 @@ var h;
|
|
|
343
343
|
s.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, s.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
344
344
|
})(h || (h = {}));
|
|
345
345
|
var J, X;
|
|
346
|
-
class
|
|
346
|
+
class O {
|
|
347
347
|
constructor(e, t, n, r) {
|
|
348
348
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = r;
|
|
349
349
|
}
|
|
@@ -351,7 +351,7 @@ class R {
|
|
|
351
351
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
|
-
const
|
|
354
|
+
const je = (s, e) => {
|
|
355
355
|
if (K(e))
|
|
356
356
|
return { success: !0, data: e.value };
|
|
357
357
|
if (!s.common.issues.length)
|
|
@@ -366,7 +366,7 @@ const Ie = (s, e) => {
|
|
|
366
366
|
}
|
|
367
367
|
};
|
|
368
368
|
};
|
|
369
|
-
function
|
|
369
|
+
function y(s) {
|
|
370
370
|
if (!s)
|
|
371
371
|
return {};
|
|
372
372
|
const { errorMap: e, invalid_type_error: t, required_error: n, description: r } = s;
|
|
@@ -374,8 +374,8 @@ function g(s) {
|
|
|
374
374
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
375
375
|
return e ? { errorMap: e, description: r } : { errorMap: (i, o) => {
|
|
376
376
|
var u, c;
|
|
377
|
-
const { message:
|
|
378
|
-
return i.code === "invalid_enum_value" ? { message:
|
|
377
|
+
const { message: g } = s;
|
|
378
|
+
return i.code === "invalid_enum_value" ? { message: g ?? o.defaultError } : typeof o.data > "u" ? { message: (u = g ?? n) !== null && u !== void 0 ? u : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (c = g ?? t) !== null && c !== void 0 ? c : o.defaultError };
|
|
379
379
|
}, description: r };
|
|
380
380
|
}
|
|
381
381
|
class v {
|
|
@@ -386,13 +386,13 @@ class v {
|
|
|
386
386
|
return this._def.description;
|
|
387
387
|
}
|
|
388
388
|
_getType(e) {
|
|
389
|
-
return
|
|
389
|
+
return A(e.data);
|
|
390
390
|
}
|
|
391
391
|
_getOrReturnCtx(e, t) {
|
|
392
392
|
return t || {
|
|
393
393
|
common: e.parent.common,
|
|
394
394
|
data: e.data,
|
|
395
|
-
parsedType:
|
|
395
|
+
parsedType: A(e.data),
|
|
396
396
|
schemaErrorMap: this._def.errorMap,
|
|
397
397
|
path: e.path,
|
|
398
398
|
parent: e.parent
|
|
@@ -404,7 +404,7 @@ class v {
|
|
|
404
404
|
ctx: {
|
|
405
405
|
common: e.parent.common,
|
|
406
406
|
data: e.data,
|
|
407
|
-
parsedType:
|
|
407
|
+
parsedType: A(e.data),
|
|
408
408
|
schemaErrorMap: this._def.errorMap,
|
|
409
409
|
path: e.path,
|
|
410
410
|
parent: e.parent
|
|
@@ -439,9 +439,9 @@ class v {
|
|
|
439
439
|
schemaErrorMap: this._def.errorMap,
|
|
440
440
|
parent: null,
|
|
441
441
|
data: e,
|
|
442
|
-
parsedType:
|
|
442
|
+
parsedType: A(e)
|
|
443
443
|
}, a = this._parseSync({ data: e, path: r.path, parent: r });
|
|
444
|
-
return
|
|
444
|
+
return je(r, a);
|
|
445
445
|
}
|
|
446
446
|
async parseAsync(e, t) {
|
|
447
447
|
const n = await this.safeParseAsync(e, t);
|
|
@@ -460,9 +460,9 @@ class v {
|
|
|
460
460
|
schemaErrorMap: this._def.errorMap,
|
|
461
461
|
parent: null,
|
|
462
462
|
data: e,
|
|
463
|
-
parsedType:
|
|
463
|
+
parsedType: A(e)
|
|
464
464
|
}, r = this._parse({ data: e, path: n.path, parent: n }), a = await (F(r) ? r : Promise.resolve(r));
|
|
465
|
-
return
|
|
465
|
+
return je(n, a);
|
|
466
466
|
}
|
|
467
467
|
refine(e, t) {
|
|
468
468
|
const n = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
|
|
@@ -478,7 +478,7 @@ class v {
|
|
|
478
478
|
return this._refinement((n, r) => e(n) ? !0 : (r.addIssue(typeof t == "function" ? t(n, r) : t), !1));
|
|
479
479
|
}
|
|
480
480
|
_refinement(e) {
|
|
481
|
-
return new
|
|
481
|
+
return new R({
|
|
482
482
|
schema: this,
|
|
483
483
|
typeName: p.ZodEffects,
|
|
484
484
|
effect: { type: "refinement", refinement: e }
|
|
@@ -488,7 +488,7 @@ class v {
|
|
|
488
488
|
return this._refinement(e);
|
|
489
489
|
}
|
|
490
490
|
optional() {
|
|
491
|
-
return
|
|
491
|
+
return N.create(this, this._def);
|
|
492
492
|
}
|
|
493
493
|
nullable() {
|
|
494
494
|
return D.create(this, this._def);
|
|
@@ -509,8 +509,8 @@ class v {
|
|
|
509
509
|
return re.create(this, e, this._def);
|
|
510
510
|
}
|
|
511
511
|
transform(e) {
|
|
512
|
-
return new
|
|
513
|
-
...
|
|
512
|
+
return new R({
|
|
513
|
+
...y(this._def),
|
|
514
514
|
schema: this,
|
|
515
515
|
typeName: p.ZodEffects,
|
|
516
516
|
effect: { type: "transform", transform: e }
|
|
@@ -519,23 +519,23 @@ class v {
|
|
|
519
519
|
default(e) {
|
|
520
520
|
const t = typeof e == "function" ? e : () => e;
|
|
521
521
|
return new ce({
|
|
522
|
-
...
|
|
522
|
+
...y(this._def),
|
|
523
523
|
innerType: this,
|
|
524
524
|
defaultValue: t,
|
|
525
525
|
typeName: p.ZodDefault
|
|
526
526
|
});
|
|
527
527
|
}
|
|
528
528
|
brand() {
|
|
529
|
-
return new
|
|
529
|
+
return new Re({
|
|
530
530
|
typeName: p.ZodBranded,
|
|
531
531
|
type: this,
|
|
532
|
-
...
|
|
532
|
+
...y(this._def)
|
|
533
533
|
});
|
|
534
534
|
}
|
|
535
535
|
catch(e) {
|
|
536
536
|
const t = typeof e == "function" ? e : () => e;
|
|
537
537
|
return new ue({
|
|
538
|
-
...
|
|
538
|
+
...y(this._def),
|
|
539
539
|
innerType: this,
|
|
540
540
|
catchValue: t,
|
|
541
541
|
typeName: p.ZodCatch
|
|
@@ -561,23 +561,23 @@ class v {
|
|
|
561
561
|
return this.safeParse(null).success;
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
|
-
const
|
|
565
|
-
let
|
|
566
|
-
const
|
|
567
|
-
function
|
|
564
|
+
const st = /^c[^\s-]{8,}$/i, nt = /^[0-9a-z]+$/, rt = /^[0-9A-HJKMNP-TV-Z]{26}$/, at = /^[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, it = /^[a-z0-9_-]{21}$/i, ot = /^[-+]?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)?)??$/, dt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ct = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
565
|
+
let Te;
|
|
566
|
+
const ut = /^(?:(?: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])$/, lt = /^(([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})))$/, ft = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, $e = "((\\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])))", ht = new RegExp(`^${$e}$`);
|
|
567
|
+
function Ve(s) {
|
|
568
568
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
569
569
|
return s.precision ? e = `${e}\\.\\d{${s.precision}}` : s.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
570
570
|
}
|
|
571
|
-
function
|
|
572
|
-
return new RegExp(`^${
|
|
571
|
+
function pt(s) {
|
|
572
|
+
return new RegExp(`^${Ve(s)}$`);
|
|
573
573
|
}
|
|
574
|
-
function
|
|
575
|
-
let e = `${
|
|
574
|
+
function De(s) {
|
|
575
|
+
let e = `${$e}T${Ve(s)}`;
|
|
576
576
|
const t = [];
|
|
577
577
|
return t.push(s.local ? "Z?" : "Z"), s.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
578
578
|
}
|
|
579
|
-
function
|
|
580
|
-
return !!((e === "v4" || !e) &&
|
|
579
|
+
function mt(s, e) {
|
|
580
|
+
return !!((e === "v4" || !e) && ut.test(s) || (e === "v6" || !e) && lt.test(s));
|
|
581
581
|
}
|
|
582
582
|
class C extends v {
|
|
583
583
|
_parse(e) {
|
|
@@ -628,43 +628,43 @@ class C extends v {
|
|
|
628
628
|
message: a.message
|
|
629
629
|
}), n.dirty());
|
|
630
630
|
} else if (a.kind === "email")
|
|
631
|
-
|
|
631
|
+
dt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
632
632
|
validation: "email",
|
|
633
633
|
code: d.invalid_string,
|
|
634
634
|
message: a.message
|
|
635
635
|
}), n.dirty());
|
|
636
636
|
else if (a.kind === "emoji")
|
|
637
|
-
|
|
637
|
+
Te || (Te = new RegExp(ct, "u")), Te.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
638
638
|
validation: "emoji",
|
|
639
639
|
code: d.invalid_string,
|
|
640
640
|
message: a.message
|
|
641
641
|
}), n.dirty());
|
|
642
642
|
else if (a.kind === "uuid")
|
|
643
|
-
|
|
643
|
+
at.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
644
644
|
validation: "uuid",
|
|
645
645
|
code: d.invalid_string,
|
|
646
646
|
message: a.message
|
|
647
647
|
}), n.dirty());
|
|
648
648
|
else if (a.kind === "nanoid")
|
|
649
|
-
|
|
649
|
+
it.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
650
650
|
validation: "nanoid",
|
|
651
651
|
code: d.invalid_string,
|
|
652
652
|
message: a.message
|
|
653
653
|
}), n.dirty());
|
|
654
654
|
else if (a.kind === "cuid")
|
|
655
|
-
|
|
655
|
+
st.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
656
656
|
validation: "cuid",
|
|
657
657
|
code: d.invalid_string,
|
|
658
658
|
message: a.message
|
|
659
659
|
}), n.dirty());
|
|
660
660
|
else if (a.kind === "cuid2")
|
|
661
|
-
|
|
661
|
+
nt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
662
662
|
validation: "cuid2",
|
|
663
663
|
code: d.invalid_string,
|
|
664
664
|
message: a.message
|
|
665
665
|
}), n.dirty());
|
|
666
666
|
else if (a.kind === "ulid")
|
|
667
|
-
|
|
667
|
+
rt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
668
668
|
validation: "ulid",
|
|
669
669
|
code: d.invalid_string,
|
|
670
670
|
message: a.message
|
|
@@ -696,27 +696,27 @@ class C extends v {
|
|
|
696
696
|
code: d.invalid_string,
|
|
697
697
|
validation: { endsWith: a.value },
|
|
698
698
|
message: a.message
|
|
699
|
-
}), n.dirty()) : a.kind === "datetime" ?
|
|
699
|
+
}), n.dirty()) : a.kind === "datetime" ? De(a).test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
700
700
|
code: d.invalid_string,
|
|
701
701
|
validation: "datetime",
|
|
702
702
|
message: a.message
|
|
703
|
-
}), n.dirty()) : a.kind === "date" ?
|
|
703
|
+
}), n.dirty()) : a.kind === "date" ? ht.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
704
704
|
code: d.invalid_string,
|
|
705
705
|
validation: "date",
|
|
706
706
|
message: a.message
|
|
707
|
-
}), n.dirty()) : a.kind === "time" ?
|
|
707
|
+
}), n.dirty()) : a.kind === "time" ? pt(a).test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
708
708
|
code: d.invalid_string,
|
|
709
709
|
validation: "time",
|
|
710
710
|
message: a.message
|
|
711
|
-
}), n.dirty()) : a.kind === "duration" ?
|
|
711
|
+
}), n.dirty()) : a.kind === "duration" ? ot.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
712
712
|
validation: "duration",
|
|
713
713
|
code: d.invalid_string,
|
|
714
714
|
message: a.message
|
|
715
|
-
}), n.dirty()) : a.kind === "ip" ?
|
|
715
|
+
}), n.dirty()) : a.kind === "ip" ? mt(e.data, a.version) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
716
716
|
validation: "ip",
|
|
717
717
|
code: d.invalid_string,
|
|
718
718
|
message: a.message
|
|
719
|
-
}), n.dirty()) : a.kind === "base64" ?
|
|
719
|
+
}), n.dirty()) : a.kind === "base64" ? ft.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
720
720
|
validation: "base64",
|
|
721
721
|
code: d.invalid_string,
|
|
722
722
|
message: a.message
|
|
@@ -935,10 +935,10 @@ C.create = (s) => {
|
|
|
935
935
|
checks: [],
|
|
936
936
|
typeName: p.ZodString,
|
|
937
937
|
coerce: (e = s == null ? void 0 : s.coerce) !== null && e !== void 0 ? e : !1,
|
|
938
|
-
...
|
|
938
|
+
...y(s)
|
|
939
939
|
});
|
|
940
940
|
};
|
|
941
|
-
function
|
|
941
|
+
function gt(s, e) {
|
|
942
942
|
const t = (s.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, r = t > n ? t : n, a = parseInt(s.toFixed(r).replace(".", "")), i = parseInt(e.toFixed(r).replace(".", ""));
|
|
943
943
|
return a % i / Math.pow(10, r);
|
|
944
944
|
}
|
|
@@ -977,7 +977,7 @@ class P extends v {
|
|
|
977
977
|
inclusive: a.inclusive,
|
|
978
978
|
exact: !1,
|
|
979
979
|
message: a.message
|
|
980
|
-
}), r.dirty()) : a.kind === "multipleOf" ?
|
|
980
|
+
}), r.dirty()) : a.kind === "multipleOf" ? gt(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), l(n, {
|
|
981
981
|
code: d.not_multiple_of,
|
|
982
982
|
multipleOf: a.value,
|
|
983
983
|
message: a.message
|
|
@@ -1112,7 +1112,7 @@ P.create = (s) => new P({
|
|
|
1112
1112
|
checks: [],
|
|
1113
1113
|
typeName: p.ZodNumber,
|
|
1114
1114
|
coerce: (s == null ? void 0 : s.coerce) || !1,
|
|
1115
|
-
...
|
|
1115
|
+
...y(s)
|
|
1116
1116
|
});
|
|
1117
1117
|
class $ extends v {
|
|
1118
1118
|
constructor() {
|
|
@@ -1239,7 +1239,7 @@ $.create = (s) => {
|
|
|
1239
1239
|
checks: [],
|
|
1240
1240
|
typeName: p.ZodBigInt,
|
|
1241
1241
|
coerce: (e = s == null ? void 0 : s.coerce) !== null && e !== void 0 ? e : !1,
|
|
1242
|
-
...
|
|
1242
|
+
...y(s)
|
|
1243
1243
|
});
|
|
1244
1244
|
};
|
|
1245
1245
|
class ee extends v {
|
|
@@ -1258,9 +1258,9 @@ class ee extends v {
|
|
|
1258
1258
|
ee.create = (s) => new ee({
|
|
1259
1259
|
typeName: p.ZodBoolean,
|
|
1260
1260
|
coerce: (s == null ? void 0 : s.coerce) || !1,
|
|
1261
|
-
...
|
|
1261
|
+
...y(s)
|
|
1262
1262
|
});
|
|
1263
|
-
class
|
|
1263
|
+
class z extends v {
|
|
1264
1264
|
_parse(e) {
|
|
1265
1265
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
|
|
1266
1266
|
const a = this._getOrReturnCtx(e);
|
|
@@ -1300,7 +1300,7 @@ class U extends v {
|
|
|
1300
1300
|
};
|
|
1301
1301
|
}
|
|
1302
1302
|
_addCheck(e) {
|
|
1303
|
-
return new
|
|
1303
|
+
return new z({
|
|
1304
1304
|
...this._def,
|
|
1305
1305
|
checks: [...this._def.checks, e]
|
|
1306
1306
|
});
|
|
@@ -1332,13 +1332,13 @@ class U extends v {
|
|
|
1332
1332
|
return e != null ? new Date(e) : null;
|
|
1333
1333
|
}
|
|
1334
1334
|
}
|
|
1335
|
-
|
|
1335
|
+
z.create = (s) => new z({
|
|
1336
1336
|
checks: [],
|
|
1337
1337
|
coerce: (s == null ? void 0 : s.coerce) || !1,
|
|
1338
1338
|
typeName: p.ZodDate,
|
|
1339
|
-
...
|
|
1339
|
+
...y(s)
|
|
1340
1340
|
});
|
|
1341
|
-
class
|
|
1341
|
+
class ye extends v {
|
|
1342
1342
|
_parse(e) {
|
|
1343
1343
|
if (this._getType(e) !== f.symbol) {
|
|
1344
1344
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1351,9 +1351,9 @@ class ge extends v {
|
|
|
1351
1351
|
return T(e.data);
|
|
1352
1352
|
}
|
|
1353
1353
|
}
|
|
1354
|
-
|
|
1354
|
+
ye.create = (s) => new ye({
|
|
1355
1355
|
typeName: p.ZodSymbol,
|
|
1356
|
-
...
|
|
1356
|
+
...y(s)
|
|
1357
1357
|
});
|
|
1358
1358
|
class te extends v {
|
|
1359
1359
|
_parse(e) {
|
|
@@ -1370,7 +1370,7 @@ class te extends v {
|
|
|
1370
1370
|
}
|
|
1371
1371
|
te.create = (s) => new te({
|
|
1372
1372
|
typeName: p.ZodUndefined,
|
|
1373
|
-
...
|
|
1373
|
+
...y(s)
|
|
1374
1374
|
});
|
|
1375
1375
|
class se extends v {
|
|
1376
1376
|
_parse(e) {
|
|
@@ -1387,9 +1387,9 @@ class se extends v {
|
|
|
1387
1387
|
}
|
|
1388
1388
|
se.create = (s) => new se({
|
|
1389
1389
|
typeName: p.ZodNull,
|
|
1390
|
-
...
|
|
1390
|
+
...y(s)
|
|
1391
1391
|
});
|
|
1392
|
-
class
|
|
1392
|
+
class Y extends v {
|
|
1393
1393
|
constructor() {
|
|
1394
1394
|
super(...arguments), this._any = !0;
|
|
1395
1395
|
}
|
|
@@ -1397,11 +1397,11 @@ class G extends v {
|
|
|
1397
1397
|
return T(e.data);
|
|
1398
1398
|
}
|
|
1399
1399
|
}
|
|
1400
|
-
|
|
1400
|
+
Y.create = (s) => new Y({
|
|
1401
1401
|
typeName: p.ZodAny,
|
|
1402
|
-
...
|
|
1402
|
+
...y(s)
|
|
1403
1403
|
});
|
|
1404
|
-
class
|
|
1404
|
+
class U extends v {
|
|
1405
1405
|
constructor() {
|
|
1406
1406
|
super(...arguments), this._unknown = !0;
|
|
1407
1407
|
}
|
|
@@ -1409,11 +1409,11 @@ class L extends v {
|
|
|
1409
1409
|
return T(e.data);
|
|
1410
1410
|
}
|
|
1411
1411
|
}
|
|
1412
|
-
|
|
1412
|
+
U.create = (s) => new U({
|
|
1413
1413
|
typeName: p.ZodUnknown,
|
|
1414
|
-
...
|
|
1414
|
+
...y(s)
|
|
1415
1415
|
});
|
|
1416
|
-
class
|
|
1416
|
+
class M extends v {
|
|
1417
1417
|
_parse(e) {
|
|
1418
1418
|
const t = this._getOrReturnCtx(e);
|
|
1419
1419
|
return l(t, {
|
|
@@ -1423,9 +1423,9 @@ class A extends v {
|
|
|
1423
1423
|
}), m;
|
|
1424
1424
|
}
|
|
1425
1425
|
}
|
|
1426
|
-
|
|
1426
|
+
M.create = (s) => new M({
|
|
1427
1427
|
typeName: p.ZodNever,
|
|
1428
|
-
...
|
|
1428
|
+
...y(s)
|
|
1429
1429
|
});
|
|
1430
1430
|
class ve extends v {
|
|
1431
1431
|
_parse(e) {
|
|
@@ -1442,7 +1442,7 @@ class ve extends v {
|
|
|
1442
1442
|
}
|
|
1443
1443
|
ve.create = (s) => new ve({
|
|
1444
1444
|
typeName: p.ZodVoid,
|
|
1445
|
-
...
|
|
1445
|
+
...y(s)
|
|
1446
1446
|
});
|
|
1447
1447
|
class E extends v {
|
|
1448
1448
|
_parse(e) {
|
|
@@ -1480,8 +1480,8 @@ class E extends v {
|
|
|
1480
1480
|
exact: !1,
|
|
1481
1481
|
message: r.maxLength.message
|
|
1482
1482
|
}), n.dirty()), t.common.async)
|
|
1483
|
-
return Promise.all([...t.data].map((i, o) => r.type._parseAsync(new
|
|
1484
|
-
const a = [...t.data].map((i, o) => r.type._parseSync(new
|
|
1483
|
+
return Promise.all([...t.data].map((i, o) => r.type._parseAsync(new O(t, i, t.path, o)))).then((i) => w.mergeArray(n, i));
|
|
1484
|
+
const a = [...t.data].map((i, o) => r.type._parseSync(new O(t, i, t.path, o)));
|
|
1485
1485
|
return w.mergeArray(n, a);
|
|
1486
1486
|
}
|
|
1487
1487
|
get element() {
|
|
@@ -1515,16 +1515,16 @@ E.create = (s, e) => new E({
|
|
|
1515
1515
|
maxLength: null,
|
|
1516
1516
|
exactLength: null,
|
|
1517
1517
|
typeName: p.ZodArray,
|
|
1518
|
-
...
|
|
1518
|
+
...y(e)
|
|
1519
1519
|
});
|
|
1520
1520
|
function B(s) {
|
|
1521
|
-
if (s instanceof
|
|
1521
|
+
if (s instanceof k) {
|
|
1522
1522
|
const e = {};
|
|
1523
1523
|
for (const t in s.shape) {
|
|
1524
1524
|
const n = s.shape[t];
|
|
1525
|
-
e[t] =
|
|
1525
|
+
e[t] = N.create(B(n));
|
|
1526
1526
|
}
|
|
1527
|
-
return new
|
|
1527
|
+
return new k({
|
|
1528
1528
|
...s._def,
|
|
1529
1529
|
shape: () => e
|
|
1530
1530
|
});
|
|
@@ -1532,9 +1532,9 @@ function B(s) {
|
|
|
1532
1532
|
return s instanceof E ? new E({
|
|
1533
1533
|
...s._def,
|
|
1534
1534
|
type: B(s.element)
|
|
1535
|
-
}) : s instanceof
|
|
1535
|
+
}) : s instanceof N ? N.create(B(s.unwrap())) : s instanceof D ? D.create(B(s.unwrap())) : s instanceof I ? I.create(s.items.map((e) => B(e))) : s;
|
|
1536
1536
|
}
|
|
1537
|
-
class
|
|
1537
|
+
class k extends v {
|
|
1538
1538
|
constructor() {
|
|
1539
1539
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1540
1540
|
}
|
|
@@ -1554,25 +1554,25 @@ class x extends v {
|
|
|
1554
1554
|
}), m;
|
|
1555
1555
|
}
|
|
1556
1556
|
const { status: n, ctx: r } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
|
|
1557
|
-
if (!(this._def.catchall instanceof
|
|
1557
|
+
if (!(this._def.catchall instanceof M && this._def.unknownKeys === "strip"))
|
|
1558
1558
|
for (const c in r.data)
|
|
1559
1559
|
i.includes(c) || o.push(c);
|
|
1560
1560
|
const u = [];
|
|
1561
1561
|
for (const c of i) {
|
|
1562
|
-
const
|
|
1562
|
+
const g = a[c], Z = r.data[c];
|
|
1563
1563
|
u.push({
|
|
1564
1564
|
key: { status: "valid", value: c },
|
|
1565
|
-
value:
|
|
1565
|
+
value: g._parse(new O(r, Z, r.path, c)),
|
|
1566
1566
|
alwaysSet: c in r.data
|
|
1567
1567
|
});
|
|
1568
1568
|
}
|
|
1569
|
-
if (this._def.catchall instanceof
|
|
1569
|
+
if (this._def.catchall instanceof M) {
|
|
1570
1570
|
const c = this._def.unknownKeys;
|
|
1571
1571
|
if (c === "passthrough")
|
|
1572
|
-
for (const
|
|
1572
|
+
for (const g of o)
|
|
1573
1573
|
u.push({
|
|
1574
|
-
key: { status: "valid", value:
|
|
1575
|
-
value: { status: "valid", value: r.data[
|
|
1574
|
+
key: { status: "valid", value: g },
|
|
1575
|
+
value: { status: "valid", value: r.data[g] }
|
|
1576
1576
|
});
|
|
1577
1577
|
else if (c === "strict")
|
|
1578
1578
|
o.length > 0 && (l(r, {
|
|
@@ -1583,26 +1583,26 @@ class x extends v {
|
|
|
1583
1583
|
throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
1584
1584
|
} else {
|
|
1585
1585
|
const c = this._def.catchall;
|
|
1586
|
-
for (const
|
|
1587
|
-
const Z = r.data[
|
|
1586
|
+
for (const g of o) {
|
|
1587
|
+
const Z = r.data[g];
|
|
1588
1588
|
u.push({
|
|
1589
|
-
key: { status: "valid", value:
|
|
1589
|
+
key: { status: "valid", value: g },
|
|
1590
1590
|
value: c._parse(
|
|
1591
|
-
new
|
|
1591
|
+
new O(r, Z, r.path, g)
|
|
1592
1592
|
//, ctx.child(key), value, getParsedType(value)
|
|
1593
1593
|
),
|
|
1594
|
-
alwaysSet:
|
|
1594
|
+
alwaysSet: g in r.data
|
|
1595
1595
|
});
|
|
1596
1596
|
}
|
|
1597
1597
|
}
|
|
1598
1598
|
return r.common.async ? Promise.resolve().then(async () => {
|
|
1599
1599
|
const c = [];
|
|
1600
|
-
for (const
|
|
1601
|
-
const Z = await
|
|
1600
|
+
for (const g of u) {
|
|
1601
|
+
const Z = await g.key, Oe = await g.value;
|
|
1602
1602
|
c.push({
|
|
1603
1603
|
key: Z,
|
|
1604
1604
|
value: Oe,
|
|
1605
|
-
alwaysSet:
|
|
1605
|
+
alwaysSet: g.alwaysSet
|
|
1606
1606
|
});
|
|
1607
1607
|
}
|
|
1608
1608
|
return c;
|
|
@@ -1612,7 +1612,7 @@ class x extends v {
|
|
|
1612
1612
|
return this._def.shape();
|
|
1613
1613
|
}
|
|
1614
1614
|
strict(e) {
|
|
1615
|
-
return h.errToObj, new
|
|
1615
|
+
return h.errToObj, new k({
|
|
1616
1616
|
...this._def,
|
|
1617
1617
|
unknownKeys: "strict",
|
|
1618
1618
|
...e !== void 0 ? {
|
|
@@ -1629,13 +1629,13 @@ class x extends v {
|
|
|
1629
1629
|
});
|
|
1630
1630
|
}
|
|
1631
1631
|
strip() {
|
|
1632
|
-
return new
|
|
1632
|
+
return new k({
|
|
1633
1633
|
...this._def,
|
|
1634
1634
|
unknownKeys: "strip"
|
|
1635
1635
|
});
|
|
1636
1636
|
}
|
|
1637
1637
|
passthrough() {
|
|
1638
|
-
return new
|
|
1638
|
+
return new k({
|
|
1639
1639
|
...this._def,
|
|
1640
1640
|
unknownKeys: "passthrough"
|
|
1641
1641
|
});
|
|
@@ -1658,7 +1658,7 @@ class x extends v {
|
|
|
1658
1658
|
// }) as any;
|
|
1659
1659
|
// };
|
|
1660
1660
|
extend(e) {
|
|
1661
|
-
return new
|
|
1661
|
+
return new k({
|
|
1662
1662
|
...this._def,
|
|
1663
1663
|
shape: () => ({
|
|
1664
1664
|
...this._def.shape(),
|
|
@@ -1672,7 +1672,7 @@ class x extends v {
|
|
|
1672
1672
|
* upgrade if you are experiencing issues.
|
|
1673
1673
|
*/
|
|
1674
1674
|
merge(e) {
|
|
1675
|
-
return new
|
|
1675
|
+
return new k({
|
|
1676
1676
|
unknownKeys: e._def.unknownKeys,
|
|
1677
1677
|
catchall: e._def.catchall,
|
|
1678
1678
|
shape: () => ({
|
|
@@ -1742,7 +1742,7 @@ class x extends v {
|
|
|
1742
1742
|
// return merged;
|
|
1743
1743
|
// }
|
|
1744
1744
|
catchall(e) {
|
|
1745
|
-
return new
|
|
1745
|
+
return new k({
|
|
1746
1746
|
...this._def,
|
|
1747
1747
|
catchall: e
|
|
1748
1748
|
});
|
|
@@ -1751,7 +1751,7 @@ class x extends v {
|
|
|
1751
1751
|
const t = {};
|
|
1752
1752
|
return _.objectKeys(e).forEach((n) => {
|
|
1753
1753
|
e[n] && this.shape[n] && (t[n] = this.shape[n]);
|
|
1754
|
-
}), new
|
|
1754
|
+
}), new k({
|
|
1755
1755
|
...this._def,
|
|
1756
1756
|
shape: () => t
|
|
1757
1757
|
});
|
|
@@ -1760,7 +1760,7 @@ class x extends v {
|
|
|
1760
1760
|
const t = {};
|
|
1761
1761
|
return _.objectKeys(this.shape).forEach((n) => {
|
|
1762
1762
|
e[n] || (t[n] = this.shape[n]);
|
|
1763
|
-
}), new
|
|
1763
|
+
}), new k({
|
|
1764
1764
|
...this._def,
|
|
1765
1765
|
shape: () => t
|
|
1766
1766
|
});
|
|
@@ -1776,7 +1776,7 @@ class x extends v {
|
|
|
1776
1776
|
return _.objectKeys(this.shape).forEach((n) => {
|
|
1777
1777
|
const r = this.shape[n];
|
|
1778
1778
|
e && !e[n] ? t[n] = r : t[n] = r.optional();
|
|
1779
|
-
}), new
|
|
1779
|
+
}), new k({
|
|
1780
1780
|
...this._def,
|
|
1781
1781
|
shape: () => t
|
|
1782
1782
|
});
|
|
@@ -1788,39 +1788,39 @@ class x extends v {
|
|
|
1788
1788
|
t[n] = this.shape[n];
|
|
1789
1789
|
else {
|
|
1790
1790
|
let a = this.shape[n];
|
|
1791
|
-
for (; a instanceof
|
|
1791
|
+
for (; a instanceof N; )
|
|
1792
1792
|
a = a._def.innerType;
|
|
1793
1793
|
t[n] = a;
|
|
1794
1794
|
}
|
|
1795
|
-
}), new
|
|
1795
|
+
}), new k({
|
|
1796
1796
|
...this._def,
|
|
1797
1797
|
shape: () => t
|
|
1798
1798
|
});
|
|
1799
1799
|
}
|
|
1800
1800
|
keyof() {
|
|
1801
|
-
return
|
|
1801
|
+
return Le(_.objectKeys(this.shape));
|
|
1802
1802
|
}
|
|
1803
1803
|
}
|
|
1804
|
-
|
|
1804
|
+
k.create = (s, e) => new k({
|
|
1805
1805
|
shape: () => s,
|
|
1806
1806
|
unknownKeys: "strip",
|
|
1807
|
-
catchall:
|
|
1807
|
+
catchall: M.create(),
|
|
1808
1808
|
typeName: p.ZodObject,
|
|
1809
|
-
...
|
|
1809
|
+
...y(e)
|
|
1810
1810
|
});
|
|
1811
|
-
|
|
1811
|
+
k.strictCreate = (s, e) => new k({
|
|
1812
1812
|
shape: () => s,
|
|
1813
1813
|
unknownKeys: "strict",
|
|
1814
|
-
catchall:
|
|
1814
|
+
catchall: M.create(),
|
|
1815
1815
|
typeName: p.ZodObject,
|
|
1816
|
-
...
|
|
1816
|
+
...y(e)
|
|
1817
1817
|
});
|
|
1818
|
-
|
|
1818
|
+
k.lazycreate = (s, e) => new k({
|
|
1819
1819
|
shape: s,
|
|
1820
1820
|
unknownKeys: "strip",
|
|
1821
|
-
catchall:
|
|
1821
|
+
catchall: M.create(),
|
|
1822
1822
|
typeName: p.ZodObject,
|
|
1823
|
-
...
|
|
1823
|
+
...y(e)
|
|
1824
1824
|
});
|
|
1825
1825
|
class ne extends v {
|
|
1826
1826
|
_parse(e) {
|
|
@@ -1868,14 +1868,14 @@ class ne extends v {
|
|
|
1868
1868
|
issues: []
|
|
1869
1869
|
},
|
|
1870
1870
|
parent: null
|
|
1871
|
-
},
|
|
1871
|
+
}, g = u._parseSync({
|
|
1872
1872
|
data: t.data,
|
|
1873
1873
|
path: t.path,
|
|
1874
1874
|
parent: c
|
|
1875
1875
|
});
|
|
1876
|
-
if (
|
|
1877
|
-
return
|
|
1878
|
-
|
|
1876
|
+
if (g.status === "valid")
|
|
1877
|
+
return g;
|
|
1878
|
+
g.status === "dirty" && !a && (a = { result: g, ctx: c }), c.common.issues.length && i.push(c.common.issues);
|
|
1879
1879
|
}
|
|
1880
1880
|
if (a)
|
|
1881
1881
|
return t.common.issues.push(...a.ctx.common.issues), a.result;
|
|
@@ -1893,9 +1893,9 @@ class ne extends v {
|
|
|
1893
1893
|
ne.create = (s, e) => new ne({
|
|
1894
1894
|
options: s,
|
|
1895
1895
|
typeName: p.ZodUnion,
|
|
1896
|
-
...
|
|
1896
|
+
...y(e)
|
|
1897
1897
|
});
|
|
1898
|
-
const j = (s) => s instanceof ie ? j(s.schema) : s instanceof
|
|
1898
|
+
const j = (s) => s instanceof ie ? j(s.schema) : s instanceof R ? j(s.innerType()) : s instanceof oe ? [s.value] : s instanceof V ? s.options : s instanceof de ? _.objectValues(s.enum) : s instanceof ce ? j(s._def.innerType) : s instanceof te ? [void 0] : s instanceof se ? [null] : s instanceof N ? [void 0, ...j(s.unwrap())] : s instanceof D ? [null, ...j(s.unwrap())] : s instanceof Re || s instanceof le ? j(s.unwrap()) : s instanceof ue ? j(s._def.innerType) : [];
|
|
1899
1899
|
class ke extends v {
|
|
1900
1900
|
_parse(e) {
|
|
1901
1901
|
const { ctx: t } = this._processInputParams(e);
|
|
@@ -1954,18 +1954,18 @@ class ke extends v {
|
|
|
1954
1954
|
discriminator: e,
|
|
1955
1955
|
options: t,
|
|
1956
1956
|
optionsMap: r,
|
|
1957
|
-
...
|
|
1957
|
+
...y(n)
|
|
1958
1958
|
});
|
|
1959
1959
|
}
|
|
1960
1960
|
}
|
|
1961
|
-
function
|
|
1962
|
-
const t =
|
|
1961
|
+
function Ee(s, e) {
|
|
1962
|
+
const t = A(s), n = A(e);
|
|
1963
1963
|
if (s === e)
|
|
1964
1964
|
return { valid: !0, data: s };
|
|
1965
1965
|
if (t === f.object && n === f.object) {
|
|
1966
1966
|
const r = _.objectKeys(e), a = _.objectKeys(s).filter((o) => r.indexOf(o) !== -1), i = { ...s, ...e };
|
|
1967
1967
|
for (const o of a) {
|
|
1968
|
-
const u =
|
|
1968
|
+
const u = Ee(s[o], e[o]);
|
|
1969
1969
|
if (!u.valid)
|
|
1970
1970
|
return { valid: !1 };
|
|
1971
1971
|
i[o] = u.data;
|
|
@@ -1976,7 +1976,7 @@ function Ce(s, e) {
|
|
|
1976
1976
|
return { valid: !1 };
|
|
1977
1977
|
const r = [];
|
|
1978
1978
|
for (let a = 0; a < s.length; a++) {
|
|
1979
|
-
const i = s[a], o = e[a], u =
|
|
1979
|
+
const i = s[a], o = e[a], u = Ee(i, o);
|
|
1980
1980
|
if (!u.valid)
|
|
1981
1981
|
return { valid: !1 };
|
|
1982
1982
|
r.push(u.data);
|
|
@@ -1988,10 +1988,10 @@ function Ce(s, e) {
|
|
|
1988
1988
|
class re extends v {
|
|
1989
1989
|
_parse(e) {
|
|
1990
1990
|
const { status: t, ctx: n } = this._processInputParams(e), r = (a, i) => {
|
|
1991
|
-
if (
|
|
1991
|
+
if (Ze(a) || Ze(i))
|
|
1992
1992
|
return m;
|
|
1993
|
-
const o =
|
|
1994
|
-
return o.valid ? ((
|
|
1993
|
+
const o = Ee(a.value, i.value);
|
|
1994
|
+
return o.valid ? ((Ce(a) || Ce(i)) && t.dirty(), { status: t.value, value: o.data }) : (l(n, {
|
|
1995
1995
|
code: d.invalid_intersection_types
|
|
1996
1996
|
}), m);
|
|
1997
1997
|
};
|
|
@@ -2021,7 +2021,7 @@ re.create = (s, e, t) => new re({
|
|
|
2021
2021
|
left: s,
|
|
2022
2022
|
right: e,
|
|
2023
2023
|
typeName: p.ZodIntersection,
|
|
2024
|
-
...
|
|
2024
|
+
...y(t)
|
|
2025
2025
|
});
|
|
2026
2026
|
class I extends v {
|
|
2027
2027
|
_parse(e) {
|
|
@@ -2049,7 +2049,7 @@ class I extends v {
|
|
|
2049
2049
|
}), t.dirty());
|
|
2050
2050
|
const a = [...n.data].map((i, o) => {
|
|
2051
2051
|
const u = this._def.items[o] || this._def.rest;
|
|
2052
|
-
return u ? u._parse(new
|
|
2052
|
+
return u ? u._parse(new O(n, i, n.path, o)) : null;
|
|
2053
2053
|
}).filter((i) => !!i);
|
|
2054
2054
|
return n.common.async ? Promise.all(a).then((i) => w.mergeArray(t, i)) : w.mergeArray(t, a);
|
|
2055
2055
|
}
|
|
@@ -2070,7 +2070,7 @@ I.create = (s, e) => {
|
|
|
2070
2070
|
items: s,
|
|
2071
2071
|
typeName: p.ZodTuple,
|
|
2072
2072
|
rest: null,
|
|
2073
|
-
...
|
|
2073
|
+
...y(e)
|
|
2074
2074
|
});
|
|
2075
2075
|
};
|
|
2076
2076
|
class ae extends v {
|
|
@@ -2091,8 +2091,8 @@ class ae extends v {
|
|
|
2091
2091
|
const r = [], a = this._def.keyType, i = this._def.valueType;
|
|
2092
2092
|
for (const o in n.data)
|
|
2093
2093
|
r.push({
|
|
2094
|
-
key: a._parse(new
|
|
2095
|
-
value: i._parse(new
|
|
2094
|
+
key: a._parse(new O(n, o, n.path, o)),
|
|
2095
|
+
value: i._parse(new O(n, n.data[o], n.path, o)),
|
|
2096
2096
|
alwaysSet: o in n.data
|
|
2097
2097
|
});
|
|
2098
2098
|
return n.common.async ? w.mergeObjectAsync(t, r) : w.mergeObjectSync(t, r);
|
|
@@ -2105,12 +2105,12 @@ class ae extends v {
|
|
|
2105
2105
|
keyType: e,
|
|
2106
2106
|
valueType: t,
|
|
2107
2107
|
typeName: p.ZodRecord,
|
|
2108
|
-
...
|
|
2108
|
+
...y(n)
|
|
2109
2109
|
}) : new ae({
|
|
2110
2110
|
keyType: C.create(),
|
|
2111
2111
|
valueType: e,
|
|
2112
2112
|
typeName: p.ZodRecord,
|
|
2113
|
-
...
|
|
2113
|
+
...y(t)
|
|
2114
2114
|
});
|
|
2115
2115
|
}
|
|
2116
2116
|
}
|
|
@@ -2130,27 +2130,27 @@ class _e extends v {
|
|
|
2130
2130
|
received: n.parsedType
|
|
2131
2131
|
}), m;
|
|
2132
2132
|
const r = this._def.keyType, a = this._def.valueType, i = [...n.data.entries()].map(([o, u], c) => ({
|
|
2133
|
-
key: r._parse(new
|
|
2134
|
-
value: a._parse(new
|
|
2133
|
+
key: r._parse(new O(n, o, n.path, [c, "key"])),
|
|
2134
|
+
value: a._parse(new O(n, u, n.path, [c, "value"]))
|
|
2135
2135
|
}));
|
|
2136
2136
|
if (n.common.async) {
|
|
2137
2137
|
const o = /* @__PURE__ */ new Map();
|
|
2138
2138
|
return Promise.resolve().then(async () => {
|
|
2139
2139
|
for (const u of i) {
|
|
2140
|
-
const c = await u.key,
|
|
2141
|
-
if (c.status === "aborted" ||
|
|
2140
|
+
const c = await u.key, g = await u.value;
|
|
2141
|
+
if (c.status === "aborted" || g.status === "aborted")
|
|
2142
2142
|
return m;
|
|
2143
|
-
(c.status === "dirty" ||
|
|
2143
|
+
(c.status === "dirty" || g.status === "dirty") && t.dirty(), o.set(c.value, g.value);
|
|
2144
2144
|
}
|
|
2145
2145
|
return { status: t.value, value: o };
|
|
2146
2146
|
});
|
|
2147
2147
|
} else {
|
|
2148
2148
|
const o = /* @__PURE__ */ new Map();
|
|
2149
2149
|
for (const u of i) {
|
|
2150
|
-
const c = u.key,
|
|
2151
|
-
if (c.status === "aborted" ||
|
|
2150
|
+
const c = u.key, g = u.value;
|
|
2151
|
+
if (c.status === "aborted" || g.status === "aborted")
|
|
2152
2152
|
return m;
|
|
2153
|
-
(c.status === "dirty" ||
|
|
2153
|
+
(c.status === "dirty" || g.status === "dirty") && t.dirty(), o.set(c.value, g.value);
|
|
2154
2154
|
}
|
|
2155
2155
|
return { status: t.value, value: o };
|
|
2156
2156
|
}
|
|
@@ -2160,9 +2160,9 @@ _e.create = (s, e, t) => new _e({
|
|
|
2160
2160
|
valueType: e,
|
|
2161
2161
|
keyType: s,
|
|
2162
2162
|
typeName: p.ZodMap,
|
|
2163
|
-
...
|
|
2163
|
+
...y(t)
|
|
2164
2164
|
});
|
|
2165
|
-
class
|
|
2165
|
+
class q extends v {
|
|
2166
2166
|
_parse(e) {
|
|
2167
2167
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2168
2168
|
if (n.parsedType !== f.set)
|
|
@@ -2190,24 +2190,24 @@ class z extends v {
|
|
|
2190
2190
|
const a = this._def.valueType;
|
|
2191
2191
|
function i(u) {
|
|
2192
2192
|
const c = /* @__PURE__ */ new Set();
|
|
2193
|
-
for (const
|
|
2194
|
-
if (
|
|
2193
|
+
for (const g of u) {
|
|
2194
|
+
if (g.status === "aborted")
|
|
2195
2195
|
return m;
|
|
2196
|
-
|
|
2196
|
+
g.status === "dirty" && t.dirty(), c.add(g.value);
|
|
2197
2197
|
}
|
|
2198
2198
|
return { status: t.value, value: c };
|
|
2199
2199
|
}
|
|
2200
|
-
const o = [...n.data.values()].map((u, c) => a._parse(new
|
|
2200
|
+
const o = [...n.data.values()].map((u, c) => a._parse(new O(n, u, n.path, c)));
|
|
2201
2201
|
return n.common.async ? Promise.all(o).then((u) => i(u)) : i(o);
|
|
2202
2202
|
}
|
|
2203
2203
|
min(e, t) {
|
|
2204
|
-
return new
|
|
2204
|
+
return new q({
|
|
2205
2205
|
...this._def,
|
|
2206
2206
|
minSize: { value: e, message: h.toString(t) }
|
|
2207
2207
|
});
|
|
2208
2208
|
}
|
|
2209
2209
|
max(e, t) {
|
|
2210
|
-
return new
|
|
2210
|
+
return new q({
|
|
2211
2211
|
...this._def,
|
|
2212
2212
|
maxSize: { value: e, message: h.toString(t) }
|
|
2213
2213
|
});
|
|
@@ -2219,14 +2219,14 @@ class z extends v {
|
|
|
2219
2219
|
return this.min(1, e);
|
|
2220
2220
|
}
|
|
2221
2221
|
}
|
|
2222
|
-
|
|
2222
|
+
q.create = (s, e) => new q({
|
|
2223
2223
|
valueType: s,
|
|
2224
2224
|
minSize: null,
|
|
2225
2225
|
maxSize: null,
|
|
2226
2226
|
typeName: p.ZodSet,
|
|
2227
|
-
...
|
|
2227
|
+
...y(e)
|
|
2228
2228
|
});
|
|
2229
|
-
class
|
|
2229
|
+
class G extends v {
|
|
2230
2230
|
constructor() {
|
|
2231
2231
|
super(...arguments), this.validate = this.implement;
|
|
2232
2232
|
}
|
|
@@ -2246,7 +2246,7 @@ class Q extends v {
|
|
|
2246
2246
|
t.common.contextualErrorMap,
|
|
2247
2247
|
t.schemaErrorMap,
|
|
2248
2248
|
pe(),
|
|
2249
|
-
|
|
2249
|
+
Q
|
|
2250
2250
|
].filter((c) => !!c),
|
|
2251
2251
|
issueData: {
|
|
2252
2252
|
code: d.invalid_arguments,
|
|
@@ -2262,7 +2262,7 @@ class Q extends v {
|
|
|
2262
2262
|
t.common.contextualErrorMap,
|
|
2263
2263
|
t.schemaErrorMap,
|
|
2264
2264
|
pe(),
|
|
2265
|
-
|
|
2265
|
+
Q
|
|
2266
2266
|
].filter((c) => !!c),
|
|
2267
2267
|
issueData: {
|
|
2268
2268
|
code: d.invalid_return_type,
|
|
@@ -2274,11 +2274,11 @@ class Q extends v {
|
|
|
2274
2274
|
if (this._def.returns instanceof H) {
|
|
2275
2275
|
const o = this;
|
|
2276
2276
|
return T(async function(...u) {
|
|
2277
|
-
const c = new S([]),
|
|
2278
|
-
throw c.addIssue(n(u,
|
|
2279
|
-
}), Z = await Reflect.apply(i, this,
|
|
2280
|
-
return await o._def.returns._def.type.parseAsync(Z, a).catch((
|
|
2281
|
-
throw c.addIssue(r(Z,
|
|
2277
|
+
const c = new S([]), g = await o._def.args.parseAsync(u, a).catch((we) => {
|
|
2278
|
+
throw c.addIssue(n(u, we)), c;
|
|
2279
|
+
}), Z = await Reflect.apply(i, this, g);
|
|
2280
|
+
return await o._def.returns._def.type.parseAsync(Z, a).catch((we) => {
|
|
2281
|
+
throw c.addIssue(r(Z, we)), c;
|
|
2282
2282
|
});
|
|
2283
2283
|
});
|
|
2284
2284
|
} else {
|
|
@@ -2287,9 +2287,9 @@ class Q extends v {
|
|
|
2287
2287
|
const c = o._def.args.safeParse(u, a);
|
|
2288
2288
|
if (!c.success)
|
|
2289
2289
|
throw new S([n(u, c.error)]);
|
|
2290
|
-
const
|
|
2290
|
+
const g = Reflect.apply(i, this, c.data), Z = o._def.returns.safeParse(g, a);
|
|
2291
2291
|
if (!Z.success)
|
|
2292
|
-
throw new S([r(
|
|
2292
|
+
throw new S([r(g, Z.error)]);
|
|
2293
2293
|
return Z.data;
|
|
2294
2294
|
});
|
|
2295
2295
|
}
|
|
@@ -2301,13 +2301,13 @@ class Q extends v {
|
|
|
2301
2301
|
return this._def.returns;
|
|
2302
2302
|
}
|
|
2303
2303
|
args(...e) {
|
|
2304
|
-
return new
|
|
2304
|
+
return new G({
|
|
2305
2305
|
...this._def,
|
|
2306
|
-
args: I.create(e).rest(
|
|
2306
|
+
args: I.create(e).rest(U.create())
|
|
2307
2307
|
});
|
|
2308
2308
|
}
|
|
2309
2309
|
returns(e) {
|
|
2310
|
-
return new
|
|
2310
|
+
return new G({
|
|
2311
2311
|
...this._def,
|
|
2312
2312
|
returns: e
|
|
2313
2313
|
});
|
|
@@ -2319,11 +2319,11 @@ class Q extends v {
|
|
|
2319
2319
|
return this.parse(e);
|
|
2320
2320
|
}
|
|
2321
2321
|
static create(e, t, n) {
|
|
2322
|
-
return new
|
|
2323
|
-
args: e || I.create([]).rest(
|
|
2324
|
-
returns: t ||
|
|
2322
|
+
return new G({
|
|
2323
|
+
args: e || I.create([]).rest(U.create()),
|
|
2324
|
+
returns: t || U.create(),
|
|
2325
2325
|
typeName: p.ZodFunction,
|
|
2326
|
-
...
|
|
2326
|
+
...y(n)
|
|
2327
2327
|
});
|
|
2328
2328
|
}
|
|
2329
2329
|
}
|
|
@@ -2339,7 +2339,7 @@ class ie extends v {
|
|
|
2339
2339
|
ie.create = (s, e) => new ie({
|
|
2340
2340
|
getter: s,
|
|
2341
2341
|
typeName: p.ZodLazy,
|
|
2342
|
-
...
|
|
2342
|
+
...y(e)
|
|
2343
2343
|
});
|
|
2344
2344
|
class oe extends v {
|
|
2345
2345
|
_parse(e) {
|
|
@@ -2360,13 +2360,13 @@ class oe extends v {
|
|
|
2360
2360
|
oe.create = (s, e) => new oe({
|
|
2361
2361
|
value: s,
|
|
2362
2362
|
typeName: p.ZodLiteral,
|
|
2363
|
-
...
|
|
2363
|
+
...y(e)
|
|
2364
2364
|
});
|
|
2365
|
-
function
|
|
2365
|
+
function Le(s, e) {
|
|
2366
2366
|
return new V({
|
|
2367
2367
|
values: s,
|
|
2368
2368
|
typeName: p.ZodEnum,
|
|
2369
|
-
...
|
|
2369
|
+
...y(e)
|
|
2370
2370
|
});
|
|
2371
2371
|
}
|
|
2372
2372
|
class V extends v {
|
|
@@ -2382,7 +2382,7 @@ class V extends v {
|
|
|
2382
2382
|
code: d.invalid_type
|
|
2383
2383
|
}), m;
|
|
2384
2384
|
}
|
|
2385
|
-
if (
|
|
2385
|
+
if (ge(this, J) || Pe(this, J, new Set(this._def.values)), !ge(this, J).has(e.data)) {
|
|
2386
2386
|
const t = this._getOrReturnCtx(e), n = this._def.values;
|
|
2387
2387
|
return l(t, {
|
|
2388
2388
|
received: t.data,
|
|
@@ -2427,7 +2427,7 @@ class V extends v {
|
|
|
2427
2427
|
}
|
|
2428
2428
|
}
|
|
2429
2429
|
J = /* @__PURE__ */ new WeakMap();
|
|
2430
|
-
V.create =
|
|
2430
|
+
V.create = Le;
|
|
2431
2431
|
class de extends v {
|
|
2432
2432
|
constructor() {
|
|
2433
2433
|
super(...arguments), X.set(this, void 0);
|
|
@@ -2442,7 +2442,7 @@ class de extends v {
|
|
|
2442
2442
|
code: d.invalid_type
|
|
2443
2443
|
}), m;
|
|
2444
2444
|
}
|
|
2445
|
-
if (
|
|
2445
|
+
if (ge(this, X) || Pe(this, X, new Set(_.getValidEnumValues(this._def.values))), !ge(this, X).has(e.data)) {
|
|
2446
2446
|
const r = _.objectValues(t);
|
|
2447
2447
|
return l(n, {
|
|
2448
2448
|
received: n.data,
|
|
@@ -2460,7 +2460,7 @@ X = /* @__PURE__ */ new WeakMap();
|
|
|
2460
2460
|
de.create = (s, e) => new de({
|
|
2461
2461
|
values: s,
|
|
2462
2462
|
typeName: p.ZodNativeEnum,
|
|
2463
|
-
...
|
|
2463
|
+
...y(e)
|
|
2464
2464
|
});
|
|
2465
2465
|
class H extends v {
|
|
2466
2466
|
unwrap() {
|
|
@@ -2484,9 +2484,9 @@ class H extends v {
|
|
|
2484
2484
|
H.create = (s, e) => new H({
|
|
2485
2485
|
type: s,
|
|
2486
2486
|
typeName: p.ZodPromise,
|
|
2487
|
-
...
|
|
2487
|
+
...y(e)
|
|
2488
2488
|
});
|
|
2489
|
-
class
|
|
2489
|
+
class R extends v {
|
|
2490
2490
|
innerType() {
|
|
2491
2491
|
return this._def.schema;
|
|
2492
2492
|
}
|
|
@@ -2563,19 +2563,19 @@ class N extends v {
|
|
|
2563
2563
|
_.assertNever(r);
|
|
2564
2564
|
}
|
|
2565
2565
|
}
|
|
2566
|
-
|
|
2566
|
+
R.create = (s, e, t) => new R({
|
|
2567
2567
|
schema: s,
|
|
2568
2568
|
typeName: p.ZodEffects,
|
|
2569
2569
|
effect: e,
|
|
2570
|
-
...
|
|
2570
|
+
...y(t)
|
|
2571
2571
|
});
|
|
2572
|
-
|
|
2572
|
+
R.createWithPreprocess = (s, e, t) => new R({
|
|
2573
2573
|
schema: e,
|
|
2574
2574
|
effect: { type: "preprocess", transform: s },
|
|
2575
2575
|
typeName: p.ZodEffects,
|
|
2576
|
-
...
|
|
2576
|
+
...y(t)
|
|
2577
2577
|
});
|
|
2578
|
-
class
|
|
2578
|
+
class N extends v {
|
|
2579
2579
|
_parse(e) {
|
|
2580
2580
|
return this._getType(e) === f.undefined ? T(void 0) : this._def.innerType._parse(e);
|
|
2581
2581
|
}
|
|
@@ -2583,10 +2583,10 @@ class O extends v {
|
|
|
2583
2583
|
return this._def.innerType;
|
|
2584
2584
|
}
|
|
2585
2585
|
}
|
|
2586
|
-
|
|
2586
|
+
N.create = (s, e) => new N({
|
|
2587
2587
|
innerType: s,
|
|
2588
2588
|
typeName: p.ZodOptional,
|
|
2589
|
-
...
|
|
2589
|
+
...y(e)
|
|
2590
2590
|
});
|
|
2591
2591
|
class D extends v {
|
|
2592
2592
|
_parse(e) {
|
|
@@ -2599,7 +2599,7 @@ class D extends v {
|
|
|
2599
2599
|
D.create = (s, e) => new D({
|
|
2600
2600
|
innerType: s,
|
|
2601
2601
|
typeName: p.ZodNullable,
|
|
2602
|
-
...
|
|
2602
|
+
...y(e)
|
|
2603
2603
|
});
|
|
2604
2604
|
class ce extends v {
|
|
2605
2605
|
_parse(e) {
|
|
@@ -2619,7 +2619,7 @@ ce.create = (s, e) => new ce({
|
|
|
2619
2619
|
innerType: s,
|
|
2620
2620
|
typeName: p.ZodDefault,
|
|
2621
2621
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2622
|
-
...
|
|
2622
|
+
...y(e)
|
|
2623
2623
|
});
|
|
2624
2624
|
class ue extends v {
|
|
2625
2625
|
_parse(e) {
|
|
@@ -2662,7 +2662,7 @@ ue.create = (s, e) => new ue({
|
|
|
2662
2662
|
innerType: s,
|
|
2663
2663
|
typeName: p.ZodCatch,
|
|
2664
2664
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2665
|
-
...
|
|
2665
|
+
...y(e)
|
|
2666
2666
|
});
|
|
2667
2667
|
class xe extends v {
|
|
2668
2668
|
_parse(e) {
|
|
@@ -2679,10 +2679,10 @@ class xe extends v {
|
|
|
2679
2679
|
}
|
|
2680
2680
|
xe.create = (s) => new xe({
|
|
2681
2681
|
typeName: p.ZodNaN,
|
|
2682
|
-
...
|
|
2682
|
+
...y(s)
|
|
2683
2683
|
});
|
|
2684
2684
|
const yt = Symbol("zod_brand");
|
|
2685
|
-
class
|
|
2685
|
+
class Re extends v {
|
|
2686
2686
|
_parse(e) {
|
|
2687
2687
|
const { ctx: t } = this._processInputParams(e), n = t.data;
|
|
2688
2688
|
return this._def.type._parse({
|
|
@@ -2747,27 +2747,27 @@ class le extends v {
|
|
|
2747
2747
|
le.create = (s, e) => new le({
|
|
2748
2748
|
innerType: s,
|
|
2749
2749
|
typeName: p.ZodReadonly,
|
|
2750
|
-
...
|
|
2750
|
+
...y(e)
|
|
2751
2751
|
});
|
|
2752
|
-
function
|
|
2753
|
-
return s ?
|
|
2752
|
+
function Ue(s, e = {}, t) {
|
|
2753
|
+
return s ? Y.create().superRefine((n, r) => {
|
|
2754
2754
|
var a, i;
|
|
2755
2755
|
if (!s(n)) {
|
|
2756
2756
|
const o = typeof e == "function" ? e(n) : typeof e == "string" ? { message: e } : e, u = (i = (a = o.fatal) !== null && a !== void 0 ? a : t) !== null && i !== void 0 ? i : !0, c = typeof o == "string" ? { message: o } : o;
|
|
2757
2757
|
r.addIssue({ code: "custom", ...c, fatal: u });
|
|
2758
2758
|
}
|
|
2759
|
-
}) :
|
|
2759
|
+
}) : Y.create();
|
|
2760
2760
|
}
|
|
2761
|
-
const
|
|
2762
|
-
object:
|
|
2761
|
+
const vt = {
|
|
2762
|
+
object: k.lazycreate
|
|
2763
2763
|
};
|
|
2764
2764
|
var p;
|
|
2765
2765
|
(function(s) {
|
|
2766
2766
|
s.ZodString = "ZodString", s.ZodNumber = "ZodNumber", s.ZodNaN = "ZodNaN", s.ZodBigInt = "ZodBigInt", s.ZodBoolean = "ZodBoolean", s.ZodDate = "ZodDate", s.ZodSymbol = "ZodSymbol", s.ZodUndefined = "ZodUndefined", s.ZodNull = "ZodNull", s.ZodAny = "ZodAny", s.ZodUnknown = "ZodUnknown", s.ZodNever = "ZodNever", s.ZodVoid = "ZodVoid", s.ZodArray = "ZodArray", s.ZodObject = "ZodObject", s.ZodUnion = "ZodUnion", s.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", s.ZodIntersection = "ZodIntersection", s.ZodTuple = "ZodTuple", s.ZodRecord = "ZodRecord", s.ZodMap = "ZodMap", s.ZodSet = "ZodSet", s.ZodFunction = "ZodFunction", s.ZodLazy = "ZodLazy", s.ZodLiteral = "ZodLiteral", s.ZodEnum = "ZodEnum", s.ZodEffects = "ZodEffects", s.ZodNativeEnum = "ZodNativeEnum", s.ZodOptional = "ZodOptional", s.ZodNullable = "ZodNullable", s.ZodDefault = "ZodDefault", s.ZodCatch = "ZodCatch", s.ZodPromise = "ZodPromise", s.ZodBranded = "ZodBranded", s.ZodPipeline = "ZodPipeline", s.ZodReadonly = "ZodReadonly";
|
|
2767
2767
|
})(p || (p = {}));
|
|
2768
|
-
const
|
|
2768
|
+
const _t = (s, e = {
|
|
2769
2769
|
message: `Input not instance of ${s.name}`
|
|
2770
|
-
}) =>
|
|
2770
|
+
}) => Ue((t) => t instanceof s, e), ze = C.create, qe = P.create, xt = xe.create, kt = $.create, Be = ee.create, bt = z.create, wt = ye.create, Tt = te.create, St = se.create, Zt = Y.create, Ct = U.create, Et = M.create, Rt = ve.create, Nt = E.create, Ot = k.create, It = k.strictCreate, jt = ne.create, Mt = ke.create, At = re.create, Pt = I.create, $t = ae.create, Vt = _e.create, Dt = q.create, Lt = G.create, Ut = ie.create, zt = oe.create, qt = V.create, Bt = de.create, Wt = H.create, Me = R.create, Gt = N.create, Qt = D.create, Yt = R.createWithPreprocess, Ht = fe.create, Jt = () => ze().optional(), Xt = () => qe().optional(), Kt = () => Be().optional(), Ft = {
|
|
2771
2771
|
string: (s) => C.create({ ...s, coerce: !0 }),
|
|
2772
2772
|
number: (s) => P.create({ ...s, coerce: !0 }),
|
|
2773
2773
|
boolean: (s) => ee.create({
|
|
@@ -2775,207 +2775,229 @@ const vt = (s, e = {
|
|
|
2775
2775
|
coerce: !0
|
|
2776
2776
|
}),
|
|
2777
2777
|
bigint: (s) => $.create({ ...s, coerce: !0 }),
|
|
2778
|
-
date: (s) =>
|
|
2779
|
-
},
|
|
2780
|
-
var
|
|
2778
|
+
date: (s) => z.create({ ...s, coerce: !0 })
|
|
2779
|
+
}, es = m;
|
|
2780
|
+
var x = /* @__PURE__ */ Object.freeze({
|
|
2781
2781
|
__proto__: null,
|
|
2782
|
-
defaultErrorMap:
|
|
2783
|
-
setErrorMap:
|
|
2782
|
+
defaultErrorMap: Q,
|
|
2783
|
+
setErrorMap: et,
|
|
2784
2784
|
getErrorMap: pe,
|
|
2785
2785
|
makeIssue: me,
|
|
2786
|
-
EMPTY_PATH:
|
|
2786
|
+
EMPTY_PATH: tt,
|
|
2787
2787
|
addIssueToContext: l,
|
|
2788
2788
|
ParseStatus: w,
|
|
2789
2789
|
INVALID: m,
|
|
2790
2790
|
DIRTY: W,
|
|
2791
2791
|
OK: T,
|
|
2792
|
-
isAborted:
|
|
2793
|
-
isDirty:
|
|
2792
|
+
isAborted: Ze,
|
|
2793
|
+
isDirty: Ce,
|
|
2794
2794
|
isValid: K,
|
|
2795
2795
|
isAsync: F,
|
|
2796
2796
|
get util() {
|
|
2797
2797
|
return _;
|
|
2798
2798
|
},
|
|
2799
2799
|
get objectUtil() {
|
|
2800
|
-
return
|
|
2800
|
+
return Se;
|
|
2801
2801
|
},
|
|
2802
2802
|
ZodParsedType: f,
|
|
2803
|
-
getParsedType:
|
|
2803
|
+
getParsedType: A,
|
|
2804
2804
|
ZodType: v,
|
|
2805
|
-
datetimeRegex:
|
|
2805
|
+
datetimeRegex: De,
|
|
2806
2806
|
ZodString: C,
|
|
2807
2807
|
ZodNumber: P,
|
|
2808
2808
|
ZodBigInt: $,
|
|
2809
2809
|
ZodBoolean: ee,
|
|
2810
|
-
ZodDate:
|
|
2811
|
-
ZodSymbol:
|
|
2810
|
+
ZodDate: z,
|
|
2811
|
+
ZodSymbol: ye,
|
|
2812
2812
|
ZodUndefined: te,
|
|
2813
2813
|
ZodNull: se,
|
|
2814
|
-
ZodAny:
|
|
2815
|
-
ZodUnknown:
|
|
2816
|
-
ZodNever:
|
|
2814
|
+
ZodAny: Y,
|
|
2815
|
+
ZodUnknown: U,
|
|
2816
|
+
ZodNever: M,
|
|
2817
2817
|
ZodVoid: ve,
|
|
2818
2818
|
ZodArray: E,
|
|
2819
|
-
ZodObject:
|
|
2819
|
+
ZodObject: k,
|
|
2820
2820
|
ZodUnion: ne,
|
|
2821
2821
|
ZodDiscriminatedUnion: ke,
|
|
2822
2822
|
ZodIntersection: re,
|
|
2823
2823
|
ZodTuple: I,
|
|
2824
2824
|
ZodRecord: ae,
|
|
2825
2825
|
ZodMap: _e,
|
|
2826
|
-
ZodSet:
|
|
2827
|
-
ZodFunction:
|
|
2826
|
+
ZodSet: q,
|
|
2827
|
+
ZodFunction: G,
|
|
2828
2828
|
ZodLazy: ie,
|
|
2829
2829
|
ZodLiteral: oe,
|
|
2830
2830
|
ZodEnum: V,
|
|
2831
2831
|
ZodNativeEnum: de,
|
|
2832
2832
|
ZodPromise: H,
|
|
2833
|
-
ZodEffects:
|
|
2834
|
-
ZodTransformer:
|
|
2835
|
-
ZodOptional:
|
|
2833
|
+
ZodEffects: R,
|
|
2834
|
+
ZodTransformer: R,
|
|
2835
|
+
ZodOptional: N,
|
|
2836
2836
|
ZodNullable: D,
|
|
2837
2837
|
ZodDefault: ce,
|
|
2838
2838
|
ZodCatch: ue,
|
|
2839
2839
|
ZodNaN: xe,
|
|
2840
2840
|
BRAND: yt,
|
|
2841
|
-
ZodBranded:
|
|
2841
|
+
ZodBranded: Re,
|
|
2842
2842
|
ZodPipeline: fe,
|
|
2843
2843
|
ZodReadonly: le,
|
|
2844
|
-
custom:
|
|
2844
|
+
custom: Ue,
|
|
2845
2845
|
Schema: v,
|
|
2846
2846
|
ZodSchema: v,
|
|
2847
|
-
late:
|
|
2847
|
+
late: vt,
|
|
2848
2848
|
get ZodFirstPartyTypeKind() {
|
|
2849
2849
|
return p;
|
|
2850
2850
|
},
|
|
2851
|
-
coerce:
|
|
2852
|
-
any:
|
|
2851
|
+
coerce: Ft,
|
|
2852
|
+
any: Zt,
|
|
2853
2853
|
array: Nt,
|
|
2854
|
-
bigint:
|
|
2855
|
-
boolean:
|
|
2856
|
-
date:
|
|
2857
|
-
discriminatedUnion:
|
|
2858
|
-
effect:
|
|
2859
|
-
enum:
|
|
2860
|
-
function:
|
|
2861
|
-
instanceof:
|
|
2854
|
+
bigint: kt,
|
|
2855
|
+
boolean: Be,
|
|
2856
|
+
date: bt,
|
|
2857
|
+
discriminatedUnion: Mt,
|
|
2858
|
+
effect: Me,
|
|
2859
|
+
enum: qt,
|
|
2860
|
+
function: Lt,
|
|
2861
|
+
instanceof: _t,
|
|
2862
2862
|
intersection: At,
|
|
2863
|
-
lazy:
|
|
2864
|
-
literal:
|
|
2865
|
-
map:
|
|
2866
|
-
nan:
|
|
2867
|
-
nativeEnum:
|
|
2868
|
-
never:
|
|
2869
|
-
null:
|
|
2863
|
+
lazy: Ut,
|
|
2864
|
+
literal: zt,
|
|
2865
|
+
map: Vt,
|
|
2866
|
+
nan: xt,
|
|
2867
|
+
nativeEnum: Bt,
|
|
2868
|
+
never: Et,
|
|
2869
|
+
null: St,
|
|
2870
2870
|
nullable: Qt,
|
|
2871
|
-
number:
|
|
2871
|
+
number: qe,
|
|
2872
2872
|
object: Ot,
|
|
2873
|
-
oboolean:
|
|
2874
|
-
onumber:
|
|
2875
|
-
optional:
|
|
2876
|
-
ostring:
|
|
2877
|
-
pipeline:
|
|
2873
|
+
oboolean: Kt,
|
|
2874
|
+
onumber: Xt,
|
|
2875
|
+
optional: Gt,
|
|
2876
|
+
ostring: Jt,
|
|
2877
|
+
pipeline: Ht,
|
|
2878
2878
|
preprocess: Yt,
|
|
2879
|
-
promise:
|
|
2880
|
-
record:
|
|
2881
|
-
set:
|
|
2882
|
-
strictObject:
|
|
2883
|
-
string:
|
|
2884
|
-
symbol:
|
|
2885
|
-
transformer:
|
|
2886
|
-
tuple:
|
|
2887
|
-
undefined:
|
|
2888
|
-
union:
|
|
2889
|
-
unknown:
|
|
2890
|
-
void:
|
|
2891
|
-
NEVER:
|
|
2879
|
+
promise: Wt,
|
|
2880
|
+
record: $t,
|
|
2881
|
+
set: Dt,
|
|
2882
|
+
strictObject: It,
|
|
2883
|
+
string: ze,
|
|
2884
|
+
symbol: wt,
|
|
2885
|
+
transformer: Me,
|
|
2886
|
+
tuple: Pt,
|
|
2887
|
+
undefined: Tt,
|
|
2888
|
+
union: jt,
|
|
2889
|
+
unknown: Ct,
|
|
2890
|
+
void: Rt,
|
|
2891
|
+
NEVER: es,
|
|
2892
2892
|
ZodIssueCode: d,
|
|
2893
|
-
quotelessJson:
|
|
2893
|
+
quotelessJson: Fe,
|
|
2894
2894
|
ZodError: S
|
|
2895
2895
|
});
|
|
2896
|
-
const
|
|
2897
|
-
type:
|
|
2898
|
-
id:
|
|
2899
|
-
}),
|
|
2900
|
-
status:
|
|
2901
|
-
question:
|
|
2902
|
-
answer:
|
|
2903
|
-
}),
|
|
2904
|
-
status:
|
|
2905
|
-
}),
|
|
2906
|
-
status:
|
|
2907
|
-
message:
|
|
2908
|
-
}), We =
|
|
2909
|
-
semanticColor:
|
|
2910
|
-
label:
|
|
2911
|
-
description:
|
|
2912
|
-
disabled:
|
|
2913
|
-
required:
|
|
2914
|
-
hidden:
|
|
2915
|
-
}),
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2896
|
+
const L = x.object({
|
|
2897
|
+
type: x.literal("qp-bridge"),
|
|
2898
|
+
id: x.string().optional()
|
|
2899
|
+
}), ts = L.extend({
|
|
2900
|
+
status: x.literal("answerChanged"),
|
|
2901
|
+
question: x.string(),
|
|
2902
|
+
answer: x.unknown()
|
|
2903
|
+
}), Ne = L.extend({
|
|
2904
|
+
status: x.literal("success")
|
|
2905
|
+
}), ss = L.extend({
|
|
2906
|
+
status: x.literal("error"),
|
|
2907
|
+
message: x.string()
|
|
2908
|
+
}), We = x.object({
|
|
2909
|
+
semanticColor: x.string().optional(),
|
|
2910
|
+
label: x.string(),
|
|
2911
|
+
description: x.string(),
|
|
2912
|
+
disabled: x.boolean(),
|
|
2913
|
+
required: x.boolean(),
|
|
2914
|
+
hidden: x.boolean()
|
|
2915
|
+
}), ns = We.partial(), Ge = x.object({
|
|
2916
|
+
label: x.string(),
|
|
2917
|
+
hidden: x.boolean(),
|
|
2918
|
+
collapsed: x.boolean()
|
|
2919
|
+
}), _s = Ge.partial(), rs = L.extend({
|
|
2920
|
+
action: x.literal("getQuestion"),
|
|
2921
|
+
question: x.string()
|
|
2922
|
+
}), as = Ne.extend({
|
|
2919
2923
|
question: We
|
|
2920
|
-
}),
|
|
2921
|
-
action:
|
|
2922
|
-
question:
|
|
2923
|
-
questionData:
|
|
2924
|
-
}),
|
|
2925
|
-
action:
|
|
2926
|
-
|
|
2927
|
-
|
|
2924
|
+
}), is = L.extend({
|
|
2925
|
+
action: x.literal("setQuestion"),
|
|
2926
|
+
question: x.string(),
|
|
2927
|
+
questionData: ns
|
|
2928
|
+
}), os = L.extend({
|
|
2929
|
+
action: x.literal("getGroup"),
|
|
2930
|
+
group: x.string()
|
|
2931
|
+
}), ds = Ne.extend({
|
|
2932
|
+
group: Ge
|
|
2933
|
+
}), cs = L.extend({
|
|
2934
|
+
action: x.literal("setAnswer"),
|
|
2935
|
+
question: x.string(),
|
|
2936
|
+
answer: x.unknown()
|
|
2928
2937
|
});
|
|
2929
|
-
function
|
|
2930
|
-
return
|
|
2938
|
+
function us(s) {
|
|
2939
|
+
return ts.safeParse(s).success;
|
|
2931
2940
|
}
|
|
2932
|
-
function
|
|
2933
|
-
return
|
|
2941
|
+
function ls(s) {
|
|
2942
|
+
return L.safeParse(s).success;
|
|
2934
2943
|
}
|
|
2935
2944
|
function Qe(s) {
|
|
2936
|
-
return
|
|
2945
|
+
return Ne.safeParse(s).success;
|
|
2937
2946
|
}
|
|
2938
|
-
function
|
|
2939
|
-
return
|
|
2947
|
+
function fs(s) {
|
|
2948
|
+
return ss.safeParse(s).success;
|
|
2940
2949
|
}
|
|
2941
|
-
function
|
|
2942
|
-
return ns.safeParse(s).success;
|
|
2943
|
-
}
|
|
2944
|
-
function us(s) {
|
|
2950
|
+
function xs(s) {
|
|
2945
2951
|
return rs.safeParse(s).success;
|
|
2946
2952
|
}
|
|
2947
|
-
function
|
|
2953
|
+
function hs(s) {
|
|
2954
|
+
return as.safeParse(s).success;
|
|
2955
|
+
}
|
|
2956
|
+
function ks(s) {
|
|
2957
|
+
return cs.safeParse(s).success;
|
|
2958
|
+
}
|
|
2959
|
+
function bs(s) {
|
|
2948
2960
|
return is.safeParse(s).success;
|
|
2949
2961
|
}
|
|
2950
|
-
function
|
|
2951
|
-
return
|
|
2962
|
+
function ws(s) {
|
|
2963
|
+
return os.safeParse(s).success;
|
|
2964
|
+
}
|
|
2965
|
+
function ps(s) {
|
|
2966
|
+
return ds.safeParse(s).success;
|
|
2952
2967
|
}
|
|
2953
|
-
async function
|
|
2954
|
-
await
|
|
2968
|
+
async function Ts(s, e) {
|
|
2969
|
+
await ms({
|
|
2955
2970
|
type: "qp-bridge",
|
|
2956
2971
|
action: "setAnswer",
|
|
2957
2972
|
question: s,
|
|
2958
2973
|
answer: e
|
|
2959
2974
|
});
|
|
2960
2975
|
}
|
|
2961
|
-
async function
|
|
2962
|
-
return await
|
|
2976
|
+
async function Ss(s) {
|
|
2977
|
+
return await gs({
|
|
2963
2978
|
type: "qp-bridge",
|
|
2964
2979
|
action: "getQuestion",
|
|
2965
2980
|
question: s
|
|
2966
2981
|
});
|
|
2967
2982
|
}
|
|
2968
|
-
async function
|
|
2969
|
-
await
|
|
2983
|
+
async function Zs(s, e) {
|
|
2984
|
+
await vs({
|
|
2970
2985
|
type: "qp-bridge",
|
|
2971
2986
|
action: "setQuestion",
|
|
2972
2987
|
question: s,
|
|
2973
2988
|
questionData: e
|
|
2974
2989
|
});
|
|
2975
2990
|
}
|
|
2976
|
-
function
|
|
2991
|
+
async function Cs(s) {
|
|
2992
|
+
return await ys({
|
|
2993
|
+
type: "qp-bridge",
|
|
2994
|
+
action: "getGroup",
|
|
2995
|
+
group: s
|
|
2996
|
+
});
|
|
2997
|
+
}
|
|
2998
|
+
function Es(s) {
|
|
2977
2999
|
const e = (t) => {
|
|
2978
|
-
|
|
3000
|
+
us(t.data) && s(t.data.question, t.data.answer);
|
|
2979
3001
|
};
|
|
2980
3002
|
return window.addEventListener("message", e), {
|
|
2981
3003
|
cancelSubscription: () => {
|
|
@@ -2983,53 +3005,63 @@ function xs(s) {
|
|
|
2983
3005
|
}
|
|
2984
3006
|
};
|
|
2985
3007
|
}
|
|
2986
|
-
async function
|
|
3008
|
+
async function be(s, e) {
|
|
2987
3009
|
return new Promise((t, n) => {
|
|
2988
|
-
const r =
|
|
2989
|
-
if (!
|
|
3010
|
+
const r = Ke(), a = (i) => {
|
|
3011
|
+
if (!ls(i.data) || i.data.id !== r)
|
|
2990
3012
|
return;
|
|
2991
3013
|
const u = e(i.data);
|
|
2992
|
-
u !== null ? t(u) :
|
|
3014
|
+
u !== null ? t(u) : fs(i.data) ? n(new Error(i.data.message)) : n(new Error("Unknown message received")), window.removeEventListener("message", a);
|
|
2993
3015
|
};
|
|
2994
3016
|
window.addEventListener("message", a), window.parent.postMessage({ ...s, id: r }, "*");
|
|
2995
3017
|
});
|
|
2996
3018
|
}
|
|
2997
|
-
async function
|
|
2998
|
-
return
|
|
3019
|
+
async function ms(s) {
|
|
3020
|
+
return be(s, (e) => {
|
|
2999
3021
|
if (!Qe(e))
|
|
3000
3022
|
return null;
|
|
3001
3023
|
});
|
|
3002
3024
|
}
|
|
3003
|
-
async function
|
|
3004
|
-
return
|
|
3025
|
+
async function gs(s) {
|
|
3026
|
+
return be(s, (e) => hs(e) ? e.question : null);
|
|
3005
3027
|
}
|
|
3006
|
-
async function
|
|
3007
|
-
return
|
|
3028
|
+
async function ys(s) {
|
|
3029
|
+
return be(s, (e) => ps(e) ? e.group : null);
|
|
3030
|
+
}
|
|
3031
|
+
async function vs(s) {
|
|
3032
|
+
return be(s, (e) => {
|
|
3008
3033
|
if (!Qe(e))
|
|
3009
3034
|
return null;
|
|
3010
3035
|
});
|
|
3011
3036
|
}
|
|
3012
3037
|
export {
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3038
|
+
Cs as getGroup,
|
|
3039
|
+
os as getGroupRequestMessageSchema,
|
|
3040
|
+
ds as getGroupSuccessResponseMessageSchema,
|
|
3041
|
+
Ss as getQuestion,
|
|
3042
|
+
rs as getQuestionRequestMessageSchema,
|
|
3043
|
+
as as getQuestionSuccessResponseMessageSchema,
|
|
3044
|
+
_s as groupOptionalScheme,
|
|
3045
|
+
Ge as groupSchema,
|
|
3046
|
+
fs as isErrorMessage,
|
|
3047
|
+
ws as isGetGroupRequestMessage,
|
|
3048
|
+
ps as isGetGroupSuccessResponseMessage,
|
|
3049
|
+
xs as isGetQuestionRequestMessage,
|
|
3050
|
+
hs as isGetQuestionSuccessResponseMessage,
|
|
3051
|
+
us as isOnAnswerChangeMessage,
|
|
3052
|
+
ls as isQpBridgeMessage,
|
|
3053
|
+
ks as isSetAnswerRequestMessage,
|
|
3054
|
+
bs as isSetQuestionRequestMessage,
|
|
3023
3055
|
Qe as isSuccessMessage,
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3056
|
+
Es as onAnswerChange,
|
|
3057
|
+
ts as onAnswerChangeMessageSchema,
|
|
3058
|
+
L as qpBridgeMessageSchema,
|
|
3059
|
+
ns as questionOptionalScheme,
|
|
3028
3060
|
We as questionSchema,
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3061
|
+
ss as responseErrorMessageSchema,
|
|
3062
|
+
Ne as responseSuccessMessageSchema,
|
|
3063
|
+
Ts as setAnswer,
|
|
3064
|
+
cs as setAnswerRequestMessageSchema,
|
|
3065
|
+
Zs as setQuestion,
|
|
3066
|
+
is as setQuestionRequestMessageSchema
|
|
3035
3067
|
};
|