@resconet/qp-bridge 0.0.1-alpha.16 → 0.0.1-alpha.18
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 +27 -0
- package/index.js +1 -1
- package/index.mjs +357 -346
- package/lib/qp-bridge-types.d.ts +19 -0
- package/lib/qp-bridge.d.ts +14 -0
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
let me;
|
|
2
|
-
const
|
|
3
|
-
function
|
|
2
|
+
const Je = new Uint8Array(16);
|
|
3
|
+
function Xe() {
|
|
4
4
|
if (!me && (me = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !me))
|
|
5
5
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
6
|
-
return me(
|
|
6
|
+
return me(Je);
|
|
7
7
|
}
|
|
8
8
|
const k = [];
|
|
9
9
|
for (let t = 0; t < 256; ++t)
|
|
10
10
|
k.push((t + 256).toString(16).slice(1));
|
|
11
|
-
function
|
|
11
|
+
function Ke(t, e = 0) {
|
|
12
12
|
return k[t[e + 0]] + k[t[e + 1]] + k[t[e + 2]] + k[t[e + 3]] + "-" + k[t[e + 4]] + k[t[e + 5]] + "-" + k[t[e + 6]] + k[t[e + 7]] + "-" + k[t[e + 8]] + k[t[e + 9]] + "-" + k[t[e + 10]] + k[t[e + 11]] + k[t[e + 12]] + k[t[e + 13]] + k[t[e + 14]] + k[t[e + 15]];
|
|
13
13
|
}
|
|
14
|
-
const
|
|
15
|
-
randomUUID:
|
|
14
|
+
const Fe = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), je = {
|
|
15
|
+
randomUUID: Fe
|
|
16
16
|
};
|
|
17
|
-
function
|
|
17
|
+
function et(t, e, s) {
|
|
18
18
|
if (je.randomUUID && !e && !t)
|
|
19
19
|
return je.randomUUID();
|
|
20
20
|
t = t || {};
|
|
21
|
-
const n = t.random || (t.rng ||
|
|
22
|
-
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128,
|
|
21
|
+
const n = t.random || (t.rng || Xe)();
|
|
22
|
+
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, Ke(n);
|
|
23
23
|
}
|
|
24
24
|
var x;
|
|
25
25
|
(function(t) {
|
|
@@ -57,14 +57,14 @@ var x;
|
|
|
57
57
|
}
|
|
58
58
|
t.joinValues = n, t.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
|
|
59
59
|
})(x || (x = {}));
|
|
60
|
-
var
|
|
60
|
+
var Ze;
|
|
61
61
|
(function(t) {
|
|
62
62
|
t.mergeShapes = (e, s) => ({
|
|
63
63
|
...e,
|
|
64
64
|
...s
|
|
65
65
|
// second overwrites first
|
|
66
66
|
});
|
|
67
|
-
})(
|
|
67
|
+
})(Ze || (Ze = {}));
|
|
68
68
|
const f = x.arrayToEnum([
|
|
69
69
|
"string",
|
|
70
70
|
"nan",
|
|
@@ -124,8 +124,8 @@ const f = x.arrayToEnum([
|
|
|
124
124
|
"invalid_intersection_types",
|
|
125
125
|
"not_multiple_of",
|
|
126
126
|
"not_finite"
|
|
127
|
-
]),
|
|
128
|
-
class
|
|
127
|
+
]), tt = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
128
|
+
class C extends Error {
|
|
129
129
|
constructor(e) {
|
|
130
130
|
super(), this.issues = [], this.addIssue = (n) => {
|
|
131
131
|
this.issues = [...this.issues, n];
|
|
@@ -162,7 +162,7 @@ class Z extends Error {
|
|
|
162
162
|
return r(this), n;
|
|
163
163
|
}
|
|
164
164
|
static assert(e) {
|
|
165
|
-
if (!(e instanceof
|
|
165
|
+
if (!(e instanceof C))
|
|
166
166
|
throw new Error(`Not a ZodError: ${e}`);
|
|
167
167
|
}
|
|
168
168
|
toString() {
|
|
@@ -184,8 +184,8 @@ class Z extends Error {
|
|
|
184
184
|
return this.flatten();
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
|
-
|
|
188
|
-
const
|
|
187
|
+
C.create = (t) => new C(t);
|
|
188
|
+
const H = (t, e) => {
|
|
189
189
|
let s;
|
|
190
190
|
switch (t.code) {
|
|
191
191
|
case c.invalid_type:
|
|
@@ -241,8 +241,8 @@ const Y = (t, e) => {
|
|
|
241
241
|
}
|
|
242
242
|
return { message: s };
|
|
243
243
|
};
|
|
244
|
-
let $e =
|
|
245
|
-
function
|
|
244
|
+
let $e = H;
|
|
245
|
+
function st(t) {
|
|
246
246
|
$e = t;
|
|
247
247
|
}
|
|
248
248
|
function ge() {
|
|
@@ -268,7 +268,7 @@ const ye = (t) => {
|
|
|
268
268
|
path: a,
|
|
269
269
|
message: o
|
|
270
270
|
};
|
|
271
|
-
},
|
|
271
|
+
}, nt = [];
|
|
272
272
|
function l(t, e) {
|
|
273
273
|
const s = ge(), n = ye({
|
|
274
274
|
issueData: e,
|
|
@@ -278,7 +278,7 @@ function l(t, e) {
|
|
|
278
278
|
t.common.contextualErrorMap,
|
|
279
279
|
t.schemaErrorMap,
|
|
280
280
|
s,
|
|
281
|
-
s ===
|
|
281
|
+
s === H ? void 0 : H
|
|
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
|
-
}),
|
|
330
|
+
}), G = (t) => ({ status: "dirty", value: t }), T = (t) => ({ status: "valid", value: t }), Re = (t) => t.status === "aborted", Ee = (t) => t.status === "dirty", ee = (t) => t.status === "valid", te = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
331
331
|
function ve(t, e, s, n) {
|
|
332
332
|
if (typeof e == "function" ? t !== e || !n : !e.has(t))
|
|
333
333
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
334
334
|
return e.get(t);
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function qe(t, e, s, n, r) {
|
|
337
337
|
if (typeof e == "function" ? t !== e || !r : !e.has(t))
|
|
338
338
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
339
339
|
return e.set(t, s), s;
|
|
@@ -342,7 +342,7 @@ var h;
|
|
|
342
342
|
(function(t) {
|
|
343
343
|
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
344
344
|
})(h || (h = {}));
|
|
345
|
-
var
|
|
345
|
+
var X, K;
|
|
346
346
|
class M {
|
|
347
347
|
constructor(e, s, n, r) {
|
|
348
348
|
this._cachedPath = [], this.parent = e, this.data = s, this._path = n, this._key = r;
|
|
@@ -361,7 +361,7 @@ const Ae = (t, e) => {
|
|
|
361
361
|
get error() {
|
|
362
362
|
if (this._error)
|
|
363
363
|
return this._error;
|
|
364
|
-
const s = new
|
|
364
|
+
const s = new C(t.common.issues);
|
|
365
365
|
return this._error = s, this._error;
|
|
366
366
|
}
|
|
367
367
|
};
|
|
@@ -378,7 +378,7 @@ function y(t) {
|
|
|
378
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: (d = g ?? s) !== null && d !== void 0 ? d : o.defaultError };
|
|
379
379
|
}, description: r };
|
|
380
380
|
}
|
|
381
|
-
class
|
|
381
|
+
class _ {
|
|
382
382
|
constructor(e) {
|
|
383
383
|
this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this);
|
|
384
384
|
}
|
|
@@ -478,7 +478,7 @@ class v {
|
|
|
478
478
|
return this._refinement((n, r) => e(n) ? !0 : (r.addIssue(typeof s == "function" ? s(n, r) : s), !1));
|
|
479
479
|
}
|
|
480
480
|
_refinement(e) {
|
|
481
|
-
return new
|
|
481
|
+
return new N({
|
|
482
482
|
schema: this,
|
|
483
483
|
typeName: p.ZodEffects,
|
|
484
484
|
effect: { type: "refinement", refinement: e }
|
|
@@ -488,10 +488,10 @@ class v {
|
|
|
488
488
|
return this._refinement(e);
|
|
489
489
|
}
|
|
490
490
|
optional() {
|
|
491
|
-
return
|
|
491
|
+
return O.create(this, this._def);
|
|
492
492
|
}
|
|
493
493
|
nullable() {
|
|
494
|
-
return
|
|
494
|
+
return D.create(this, this._def);
|
|
495
495
|
}
|
|
496
496
|
nullish() {
|
|
497
497
|
return this.nullable().optional();
|
|
@@ -500,7 +500,7 @@ class v {
|
|
|
500
500
|
return E.create(this, this._def);
|
|
501
501
|
}
|
|
502
502
|
promise() {
|
|
503
|
-
return
|
|
503
|
+
return J.create(this, this._def);
|
|
504
504
|
}
|
|
505
505
|
or(e) {
|
|
506
506
|
return ae.create([this, e], this._def);
|
|
@@ -509,7 +509,7 @@ class v {
|
|
|
509
509
|
return ie.create(this, e, this._def);
|
|
510
510
|
}
|
|
511
511
|
transform(e) {
|
|
512
|
-
return new
|
|
512
|
+
return new N({
|
|
513
513
|
...y(this._def),
|
|
514
514
|
schema: this,
|
|
515
515
|
typeName: p.ZodEffects,
|
|
@@ -526,7 +526,7 @@ class v {
|
|
|
526
526
|
});
|
|
527
527
|
}
|
|
528
528
|
brand() {
|
|
529
|
-
return new
|
|
529
|
+
return new Oe({
|
|
530
530
|
typeName: p.ZodBranded,
|
|
531
531
|
type: this,
|
|
532
532
|
...y(this._def)
|
|
@@ -561,25 +561,25 @@ class v {
|
|
|
561
561
|
return this.safeParse(null).success;
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
|
-
const
|
|
565
|
-
let
|
|
566
|
-
const
|
|
567
|
-
function
|
|
564
|
+
const rt = /^c[^\s-]{8,}$/i, at = /^[0-9a-z]+$/, it = /^[0-9A-HJKMNP-TV-Z]{26}$/, ot = /^[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, ct = /^[a-z0-9_-]{21}$/i, dt = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, ut = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, lt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
565
|
+
let Ce;
|
|
566
|
+
const ft = /^(?:(?: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])$/, ht = /^(([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})))$/, pt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Ve = "((\\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])))", mt = new RegExp(`^${Ve}$`);
|
|
567
|
+
function De(t) {
|
|
568
568
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
569
569
|
return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
570
570
|
}
|
|
571
|
-
function
|
|
572
|
-
return new RegExp(`^${
|
|
571
|
+
function gt(t) {
|
|
572
|
+
return new RegExp(`^${De(t)}$`);
|
|
573
573
|
}
|
|
574
|
-
function
|
|
575
|
-
let e = `${
|
|
574
|
+
function Le(t) {
|
|
575
|
+
let e = `${Ve}T${De(t)}`;
|
|
576
576
|
const s = [];
|
|
577
577
|
return s.push(t.local ? "Z?" : "Z"), t.offset && s.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${s.join("|")})`, new RegExp(`^${e}$`);
|
|
578
578
|
}
|
|
579
|
-
function
|
|
580
|
-
return !!((e === "v4" || !e) &&
|
|
579
|
+
function yt(t, e) {
|
|
580
|
+
return !!((e === "v4" || !e) && ft.test(t) || (e === "v6" || !e) && ht.test(t));
|
|
581
581
|
}
|
|
582
|
-
class
|
|
582
|
+
class R extends _ {
|
|
583
583
|
_parse(e) {
|
|
584
584
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== f.string) {
|
|
585
585
|
const a = this._getOrReturnCtx(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
|
+
ut.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
632
632
|
validation: "email",
|
|
633
633
|
code: c.invalid_string,
|
|
634
634
|
message: a.message
|
|
635
635
|
}), n.dirty());
|
|
636
636
|
else if (a.kind === "emoji")
|
|
637
|
-
|
|
637
|
+
Ce || (Ce = new RegExp(lt, "u")), Ce.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
638
638
|
validation: "emoji",
|
|
639
639
|
code: c.invalid_string,
|
|
640
640
|
message: a.message
|
|
641
641
|
}), n.dirty());
|
|
642
642
|
else if (a.kind === "uuid")
|
|
643
|
-
|
|
643
|
+
ot.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
644
644
|
validation: "uuid",
|
|
645
645
|
code: c.invalid_string,
|
|
646
646
|
message: a.message
|
|
647
647
|
}), n.dirty());
|
|
648
648
|
else if (a.kind === "nanoid")
|
|
649
|
-
|
|
649
|
+
ct.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
650
650
|
validation: "nanoid",
|
|
651
651
|
code: c.invalid_string,
|
|
652
652
|
message: a.message
|
|
653
653
|
}), n.dirty());
|
|
654
654
|
else if (a.kind === "cuid")
|
|
655
|
-
|
|
655
|
+
rt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
656
656
|
validation: "cuid",
|
|
657
657
|
code: c.invalid_string,
|
|
658
658
|
message: a.message
|
|
659
659
|
}), n.dirty());
|
|
660
660
|
else if (a.kind === "cuid2")
|
|
661
|
-
|
|
661
|
+
at.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
662
662
|
validation: "cuid2",
|
|
663
663
|
code: c.invalid_string,
|
|
664
664
|
message: a.message
|
|
665
665
|
}), n.dirty());
|
|
666
666
|
else if (a.kind === "ulid")
|
|
667
|
-
|
|
667
|
+
it.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
668
668
|
validation: "ulid",
|
|
669
669
|
code: c.invalid_string,
|
|
670
670
|
message: a.message
|
|
@@ -696,27 +696,27 @@ class C extends v {
|
|
|
696
696
|
code: c.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" ? Le(a).test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
700
700
|
code: c.invalid_string,
|
|
701
701
|
validation: "datetime",
|
|
702
702
|
message: a.message
|
|
703
|
-
}), n.dirty()) : a.kind === "date" ?
|
|
703
|
+
}), n.dirty()) : a.kind === "date" ? mt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
704
704
|
code: c.invalid_string,
|
|
705
705
|
validation: "date",
|
|
706
706
|
message: a.message
|
|
707
|
-
}), n.dirty()) : a.kind === "time" ?
|
|
707
|
+
}), n.dirty()) : a.kind === "time" ? gt(a).test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
708
708
|
code: c.invalid_string,
|
|
709
709
|
validation: "time",
|
|
710
710
|
message: a.message
|
|
711
|
-
}), n.dirty()) : a.kind === "duration" ?
|
|
711
|
+
}), n.dirty()) : a.kind === "duration" ? dt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
712
712
|
validation: "duration",
|
|
713
713
|
code: c.invalid_string,
|
|
714
714
|
message: a.message
|
|
715
|
-
}), n.dirty()) : a.kind === "ip" ?
|
|
715
|
+
}), n.dirty()) : a.kind === "ip" ? yt(e.data, a.version) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
716
716
|
validation: "ip",
|
|
717
717
|
code: c.invalid_string,
|
|
718
718
|
message: a.message
|
|
719
|
-
}), n.dirty()) : a.kind === "base64" ?
|
|
719
|
+
}), n.dirty()) : a.kind === "base64" ? pt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
720
720
|
validation: "base64",
|
|
721
721
|
code: c.invalid_string,
|
|
722
722
|
message: a.message
|
|
@@ -731,7 +731,7 @@ class C extends v {
|
|
|
731
731
|
});
|
|
732
732
|
}
|
|
733
733
|
_addCheck(e) {
|
|
734
|
-
return new
|
|
734
|
+
return new R({
|
|
735
735
|
...this._def,
|
|
736
736
|
checks: [...this._def.checks, e]
|
|
737
737
|
});
|
|
@@ -857,19 +857,19 @@ class C extends v {
|
|
|
857
857
|
return this.min(1, h.errToObj(e));
|
|
858
858
|
}
|
|
859
859
|
trim() {
|
|
860
|
-
return new
|
|
860
|
+
return new R({
|
|
861
861
|
...this._def,
|
|
862
862
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
863
863
|
});
|
|
864
864
|
}
|
|
865
865
|
toLowerCase() {
|
|
866
|
-
return new
|
|
866
|
+
return new R({
|
|
867
867
|
...this._def,
|
|
868
868
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
869
869
|
});
|
|
870
870
|
}
|
|
871
871
|
toUpperCase() {
|
|
872
|
-
return new
|
|
872
|
+
return new R({
|
|
873
873
|
...this._def,
|
|
874
874
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
875
875
|
});
|
|
@@ -929,20 +929,20 @@ class C extends v {
|
|
|
929
929
|
return e;
|
|
930
930
|
}
|
|
931
931
|
}
|
|
932
|
-
|
|
932
|
+
R.create = (t) => {
|
|
933
933
|
var e;
|
|
934
|
-
return new
|
|
934
|
+
return new R({
|
|
935
935
|
checks: [],
|
|
936
936
|
typeName: p.ZodString,
|
|
937
937
|
coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1,
|
|
938
938
|
...y(t)
|
|
939
939
|
});
|
|
940
940
|
};
|
|
941
|
-
function
|
|
941
|
+
function vt(t, e) {
|
|
942
942
|
const s = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, r = s > n ? s : n, a = parseInt(t.toFixed(r).replace(".", "")), i = parseInt(e.toFixed(r).replace(".", ""));
|
|
943
943
|
return a % i / Math.pow(10, r);
|
|
944
944
|
}
|
|
945
|
-
class $ extends
|
|
945
|
+
class $ extends _ {
|
|
946
946
|
constructor() {
|
|
947
947
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
948
948
|
}
|
|
@@ -977,7 +977,7 @@ class $ 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" ? vt(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), l(n, {
|
|
981
981
|
code: c.not_multiple_of,
|
|
982
982
|
multipleOf: a.value,
|
|
983
983
|
message: a.message
|
|
@@ -1114,7 +1114,7 @@ $.create = (t) => new $({
|
|
|
1114
1114
|
coerce: (t == null ? void 0 : t.coerce) || !1,
|
|
1115
1115
|
...y(t)
|
|
1116
1116
|
});
|
|
1117
|
-
class
|
|
1117
|
+
class q extends _ {
|
|
1118
1118
|
constructor() {
|
|
1119
1119
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1120
1120
|
}
|
|
@@ -1162,7 +1162,7 @@ class V extends v {
|
|
|
1162
1162
|
return this.setLimit("max", e, !1, h.toString(s));
|
|
1163
1163
|
}
|
|
1164
1164
|
setLimit(e, s, n, r) {
|
|
1165
|
-
return new
|
|
1165
|
+
return new q({
|
|
1166
1166
|
...this._def,
|
|
1167
1167
|
checks: [
|
|
1168
1168
|
...this._def.checks,
|
|
@@ -1176,7 +1176,7 @@ class V extends v {
|
|
|
1176
1176
|
});
|
|
1177
1177
|
}
|
|
1178
1178
|
_addCheck(e) {
|
|
1179
|
-
return new
|
|
1179
|
+
return new q({
|
|
1180
1180
|
...this._def,
|
|
1181
1181
|
checks: [...this._def.checks, e]
|
|
1182
1182
|
});
|
|
@@ -1233,16 +1233,16 @@ class V extends v {
|
|
|
1233
1233
|
return e;
|
|
1234
1234
|
}
|
|
1235
1235
|
}
|
|
1236
|
-
|
|
1236
|
+
q.create = (t) => {
|
|
1237
1237
|
var e;
|
|
1238
|
-
return new
|
|
1238
|
+
return new q({
|
|
1239
1239
|
checks: [],
|
|
1240
1240
|
typeName: p.ZodBigInt,
|
|
1241
1241
|
coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1,
|
|
1242
1242
|
...y(t)
|
|
1243
1243
|
});
|
|
1244
1244
|
};
|
|
1245
|
-
class se extends
|
|
1245
|
+
class se extends _ {
|
|
1246
1246
|
_parse(e) {
|
|
1247
1247
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
|
|
1248
1248
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1260,7 +1260,7 @@ se.create = (t) => new se({
|
|
|
1260
1260
|
coerce: (t == null ? void 0 : t.coerce) || !1,
|
|
1261
1261
|
...y(t)
|
|
1262
1262
|
});
|
|
1263
|
-
class z extends
|
|
1263
|
+
class z extends _ {
|
|
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);
|
|
@@ -1338,7 +1338,7 @@ z.create = (t) => new z({
|
|
|
1338
1338
|
typeName: p.ZodDate,
|
|
1339
1339
|
...y(t)
|
|
1340
1340
|
});
|
|
1341
|
-
class _e extends
|
|
1341
|
+
class _e extends _ {
|
|
1342
1342
|
_parse(e) {
|
|
1343
1343
|
if (this._getType(e) !== f.symbol) {
|
|
1344
1344
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1355,7 +1355,7 @@ _e.create = (t) => new _e({
|
|
|
1355
1355
|
typeName: p.ZodSymbol,
|
|
1356
1356
|
...y(t)
|
|
1357
1357
|
});
|
|
1358
|
-
class ne extends
|
|
1358
|
+
class ne extends _ {
|
|
1359
1359
|
_parse(e) {
|
|
1360
1360
|
if (this._getType(e) !== f.undefined) {
|
|
1361
1361
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1372,7 +1372,7 @@ ne.create = (t) => new ne({
|
|
|
1372
1372
|
typeName: p.ZodUndefined,
|
|
1373
1373
|
...y(t)
|
|
1374
1374
|
});
|
|
1375
|
-
class re extends
|
|
1375
|
+
class re extends _ {
|
|
1376
1376
|
_parse(e) {
|
|
1377
1377
|
if (this._getType(e) !== f.null) {
|
|
1378
1378
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1389,7 +1389,7 @@ re.create = (t) => new re({
|
|
|
1389
1389
|
typeName: p.ZodNull,
|
|
1390
1390
|
...y(t)
|
|
1391
1391
|
});
|
|
1392
|
-
class
|
|
1392
|
+
class Y extends _ {
|
|
1393
1393
|
constructor() {
|
|
1394
1394
|
super(...arguments), this._any = !0;
|
|
1395
1395
|
}
|
|
@@ -1397,11 +1397,11 @@ class J extends v {
|
|
|
1397
1397
|
return T(e.data);
|
|
1398
1398
|
}
|
|
1399
1399
|
}
|
|
1400
|
-
|
|
1400
|
+
Y.create = (t) => new Y({
|
|
1401
1401
|
typeName: p.ZodAny,
|
|
1402
1402
|
...y(t)
|
|
1403
1403
|
});
|
|
1404
|
-
class U extends
|
|
1404
|
+
class U extends _ {
|
|
1405
1405
|
constructor() {
|
|
1406
1406
|
super(...arguments), this._unknown = !0;
|
|
1407
1407
|
}
|
|
@@ -1413,7 +1413,7 @@ U.create = (t) => new U({
|
|
|
1413
1413
|
typeName: p.ZodUnknown,
|
|
1414
1414
|
...y(t)
|
|
1415
1415
|
});
|
|
1416
|
-
class A extends
|
|
1416
|
+
class A extends _ {
|
|
1417
1417
|
_parse(e) {
|
|
1418
1418
|
const s = this._getOrReturnCtx(e);
|
|
1419
1419
|
return l(s, {
|
|
@@ -1427,7 +1427,7 @@ A.create = (t) => new A({
|
|
|
1427
1427
|
typeName: p.ZodNever,
|
|
1428
1428
|
...y(t)
|
|
1429
1429
|
});
|
|
1430
|
-
class xe extends
|
|
1430
|
+
class xe extends _ {
|
|
1431
1431
|
_parse(e) {
|
|
1432
1432
|
if (this._getType(e) !== f.undefined) {
|
|
1433
1433
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1444,7 +1444,7 @@ xe.create = (t) => new xe({
|
|
|
1444
1444
|
typeName: p.ZodVoid,
|
|
1445
1445
|
...y(t)
|
|
1446
1446
|
});
|
|
1447
|
-
class E extends
|
|
1447
|
+
class E extends _ {
|
|
1448
1448
|
_parse(e) {
|
|
1449
1449
|
const { ctx: s, status: n } = this._processInputParams(e), r = this._def;
|
|
1450
1450
|
if (s.parsedType !== f.array)
|
|
@@ -1517,12 +1517,12 @@ E.create = (t, e) => new E({
|
|
|
1517
1517
|
typeName: p.ZodArray,
|
|
1518
1518
|
...y(e)
|
|
1519
1519
|
});
|
|
1520
|
-
function
|
|
1520
|
+
function Q(t) {
|
|
1521
1521
|
if (t instanceof b) {
|
|
1522
1522
|
const e = {};
|
|
1523
1523
|
for (const s in t.shape) {
|
|
1524
1524
|
const n = t.shape[s];
|
|
1525
|
-
e[s] =
|
|
1525
|
+
e[s] = O.create(Q(n));
|
|
1526
1526
|
}
|
|
1527
1527
|
return new b({
|
|
1528
1528
|
...t._def,
|
|
@@ -1531,10 +1531,10 @@ function G(t) {
|
|
|
1531
1531
|
} else
|
|
1532
1532
|
return t instanceof E ? new E({
|
|
1533
1533
|
...t._def,
|
|
1534
|
-
type:
|
|
1535
|
-
}) : t instanceof
|
|
1534
|
+
type: Q(t.element)
|
|
1535
|
+
}) : t instanceof O ? O.create(Q(t.unwrap())) : t instanceof D ? D.create(Q(t.unwrap())) : t instanceof I ? I.create(t.items.map((e) => Q(e))) : t;
|
|
1536
1536
|
}
|
|
1537
|
-
class b extends
|
|
1537
|
+
class b extends _ {
|
|
1538
1538
|
constructor() {
|
|
1539
1539
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1540
1540
|
}
|
|
@@ -1559,10 +1559,10 @@ class b extends v {
|
|
|
1559
1559
|
i.includes(d) || o.push(d);
|
|
1560
1560
|
const u = [];
|
|
1561
1561
|
for (const d of i) {
|
|
1562
|
-
const g = a[d],
|
|
1562
|
+
const g = a[d], Z = r.data[d];
|
|
1563
1563
|
u.push({
|
|
1564
1564
|
key: { status: "valid", value: d },
|
|
1565
|
-
value: g._parse(new M(r,
|
|
1565
|
+
value: g._parse(new M(r, Z, r.path, d)),
|
|
1566
1566
|
alwaysSet: d in r.data
|
|
1567
1567
|
});
|
|
1568
1568
|
}
|
|
@@ -1584,11 +1584,11 @@ class b extends v {
|
|
|
1584
1584
|
} else {
|
|
1585
1585
|
const d = this._def.catchall;
|
|
1586
1586
|
for (const g of o) {
|
|
1587
|
-
const
|
|
1587
|
+
const Z = r.data[g];
|
|
1588
1588
|
u.push({
|
|
1589
1589
|
key: { status: "valid", value: g },
|
|
1590
1590
|
value: d._parse(
|
|
1591
|
-
new M(r,
|
|
1591
|
+
new M(r, Z, r.path, g)
|
|
1592
1592
|
//, ctx.child(key), value, getParsedType(value)
|
|
1593
1593
|
),
|
|
1594
1594
|
alwaysSet: g in r.data
|
|
@@ -1598,9 +1598,9 @@ class b extends v {
|
|
|
1598
1598
|
return r.common.async ? Promise.resolve().then(async () => {
|
|
1599
1599
|
const d = [];
|
|
1600
1600
|
for (const g of u) {
|
|
1601
|
-
const
|
|
1601
|
+
const Z = await g.key, Ie = await g.value;
|
|
1602
1602
|
d.push({
|
|
1603
|
-
key:
|
|
1603
|
+
key: Z,
|
|
1604
1604
|
value: Ie,
|
|
1605
1605
|
alwaysSet: g.alwaysSet
|
|
1606
1606
|
});
|
|
@@ -1769,7 +1769,7 @@ class b extends v {
|
|
|
1769
1769
|
* @deprecated
|
|
1770
1770
|
*/
|
|
1771
1771
|
deepPartial() {
|
|
1772
|
-
return
|
|
1772
|
+
return Q(this);
|
|
1773
1773
|
}
|
|
1774
1774
|
partial(e) {
|
|
1775
1775
|
const s = {};
|
|
@@ -1788,7 +1788,7 @@ class b extends v {
|
|
|
1788
1788
|
s[n] = this.shape[n];
|
|
1789
1789
|
else {
|
|
1790
1790
|
let a = this.shape[n];
|
|
1791
|
-
for (; a instanceof
|
|
1791
|
+
for (; a instanceof O; )
|
|
1792
1792
|
a = a._def.innerType;
|
|
1793
1793
|
s[n] = a;
|
|
1794
1794
|
}
|
|
@@ -1822,7 +1822,7 @@ b.lazycreate = (t, e) => new b({
|
|
|
1822
1822
|
typeName: p.ZodObject,
|
|
1823
1823
|
...y(e)
|
|
1824
1824
|
});
|
|
1825
|
-
class ae extends
|
|
1825
|
+
class ae extends _ {
|
|
1826
1826
|
_parse(e) {
|
|
1827
1827
|
const { ctx: s } = this._processInputParams(e), n = this._def.options;
|
|
1828
1828
|
function r(a) {
|
|
@@ -1832,7 +1832,7 @@ class ae extends v {
|
|
|
1832
1832
|
for (const o of a)
|
|
1833
1833
|
if (o.result.status === "dirty")
|
|
1834
1834
|
return s.common.issues.push(...o.ctx.common.issues), o.result;
|
|
1835
|
-
const i = a.map((o) => new
|
|
1835
|
+
const i = a.map((o) => new C(o.ctx.common.issues));
|
|
1836
1836
|
return l(s, {
|
|
1837
1837
|
code: c.invalid_union,
|
|
1838
1838
|
unionErrors: i
|
|
@@ -1879,7 +1879,7 @@ class ae extends v {
|
|
|
1879
1879
|
}
|
|
1880
1880
|
if (a)
|
|
1881
1881
|
return s.common.issues.push(...a.ctx.common.issues), a.result;
|
|
1882
|
-
const o = i.map((u) => new
|
|
1882
|
+
const o = i.map((u) => new C(u));
|
|
1883
1883
|
return l(s, {
|
|
1884
1884
|
code: c.invalid_union,
|
|
1885
1885
|
unionErrors: o
|
|
@@ -1895,8 +1895,8 @@ ae.create = (t, e) => new ae({
|
|
|
1895
1895
|
typeName: p.ZodUnion,
|
|
1896
1896
|
...y(e)
|
|
1897
1897
|
});
|
|
1898
|
-
const j = (t) => t instanceof ce ? j(t.schema) : t instanceof
|
|
1899
|
-
class we extends
|
|
1898
|
+
const j = (t) => t instanceof ce ? j(t.schema) : t instanceof N ? j(t.innerType()) : t instanceof de ? [t.value] : t instanceof V ? t.options : t instanceof ue ? x.objectValues(t.enum) : t instanceof le ? j(t._def.innerType) : t instanceof ne ? [void 0] : t instanceof re ? [null] : t instanceof O ? [void 0, ...j(t.unwrap())] : t instanceof D ? [null, ...j(t.unwrap())] : t instanceof Oe || t instanceof he ? j(t.unwrap()) : t instanceof fe ? j(t._def.innerType) : [];
|
|
1899
|
+
class we extends _ {
|
|
1900
1900
|
_parse(e) {
|
|
1901
1901
|
const { ctx: s } = this._processInputParams(e);
|
|
1902
1902
|
if (s.parsedType !== f.object)
|
|
@@ -1958,14 +1958,14 @@ class we extends v {
|
|
|
1958
1958
|
});
|
|
1959
1959
|
}
|
|
1960
1960
|
}
|
|
1961
|
-
function
|
|
1961
|
+
function Ne(t, e) {
|
|
1962
1962
|
const s = P(t), n = P(e);
|
|
1963
1963
|
if (t === e)
|
|
1964
1964
|
return { valid: !0, data: t };
|
|
1965
1965
|
if (s === f.object && n === f.object) {
|
|
1966
1966
|
const r = x.objectKeys(e), a = x.objectKeys(t).filter((o) => r.indexOf(o) !== -1), i = { ...t, ...e };
|
|
1967
1967
|
for (const o of a) {
|
|
1968
|
-
const u =
|
|
1968
|
+
const u = Ne(t[o], e[o]);
|
|
1969
1969
|
if (!u.valid)
|
|
1970
1970
|
return { valid: !1 };
|
|
1971
1971
|
i[o] = u.data;
|
|
@@ -1976,7 +1976,7 @@ function Oe(t, e) {
|
|
|
1976
1976
|
return { valid: !1 };
|
|
1977
1977
|
const r = [];
|
|
1978
1978
|
for (let a = 0; a < t.length; a++) {
|
|
1979
|
-
const i = t[a], o = e[a], u =
|
|
1979
|
+
const i = t[a], o = e[a], u = Ne(i, o);
|
|
1980
1980
|
if (!u.valid)
|
|
1981
1981
|
return { valid: !1 };
|
|
1982
1982
|
r.push(u.data);
|
|
@@ -1985,12 +1985,12 @@ function Oe(t, e) {
|
|
|
1985
1985
|
} else
|
|
1986
1986
|
return s === f.date && n === f.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
|
|
1987
1987
|
}
|
|
1988
|
-
class ie extends
|
|
1988
|
+
class ie extends _ {
|
|
1989
1989
|
_parse(e) {
|
|
1990
1990
|
const { status: s, ctx: n } = this._processInputParams(e), r = (a, i) => {
|
|
1991
|
-
if (
|
|
1991
|
+
if (Re(a) || Re(i))
|
|
1992
1992
|
return m;
|
|
1993
|
-
const o =
|
|
1993
|
+
const o = Ne(a.value, i.value);
|
|
1994
1994
|
return o.valid ? ((Ee(a) || Ee(i)) && s.dirty(), { status: s.value, value: o.data }) : (l(n, {
|
|
1995
1995
|
code: c.invalid_intersection_types
|
|
1996
1996
|
}), m);
|
|
@@ -2023,7 +2023,7 @@ ie.create = (t, e, s) => new ie({
|
|
|
2023
2023
|
typeName: p.ZodIntersection,
|
|
2024
2024
|
...y(s)
|
|
2025
2025
|
});
|
|
2026
|
-
class I extends
|
|
2026
|
+
class I extends _ {
|
|
2027
2027
|
_parse(e) {
|
|
2028
2028
|
const { status: s, ctx: n } = this._processInputParams(e);
|
|
2029
2029
|
if (n.parsedType !== f.array)
|
|
@@ -2073,7 +2073,7 @@ I.create = (t, e) => {
|
|
|
2073
2073
|
...y(e)
|
|
2074
2074
|
});
|
|
2075
2075
|
};
|
|
2076
|
-
class oe extends
|
|
2076
|
+
class oe extends _ {
|
|
2077
2077
|
get keySchema() {
|
|
2078
2078
|
return this._def.keyType;
|
|
2079
2079
|
}
|
|
@@ -2101,20 +2101,20 @@ class oe extends v {
|
|
|
2101
2101
|
return this._def.valueType;
|
|
2102
2102
|
}
|
|
2103
2103
|
static create(e, s, n) {
|
|
2104
|
-
return s instanceof
|
|
2104
|
+
return s instanceof _ ? new oe({
|
|
2105
2105
|
keyType: e,
|
|
2106
2106
|
valueType: s,
|
|
2107
2107
|
typeName: p.ZodRecord,
|
|
2108
2108
|
...y(n)
|
|
2109
2109
|
}) : new oe({
|
|
2110
|
-
keyType:
|
|
2110
|
+
keyType: R.create(),
|
|
2111
2111
|
valueType: e,
|
|
2112
2112
|
typeName: p.ZodRecord,
|
|
2113
2113
|
...y(s)
|
|
2114
2114
|
});
|
|
2115
2115
|
}
|
|
2116
2116
|
}
|
|
2117
|
-
class be extends
|
|
2117
|
+
class be extends _ {
|
|
2118
2118
|
get keySchema() {
|
|
2119
2119
|
return this._def.keyType;
|
|
2120
2120
|
}
|
|
@@ -2162,7 +2162,7 @@ be.create = (t, e, s) => new be({
|
|
|
2162
2162
|
typeName: p.ZodMap,
|
|
2163
2163
|
...y(s)
|
|
2164
2164
|
});
|
|
2165
|
-
class B extends
|
|
2165
|
+
class B extends _ {
|
|
2166
2166
|
_parse(e) {
|
|
2167
2167
|
const { status: s, ctx: n } = this._processInputParams(e);
|
|
2168
2168
|
if (n.parsedType !== f.set)
|
|
@@ -2226,7 +2226,7 @@ B.create = (t, e) => new B({
|
|
|
2226
2226
|
typeName: p.ZodSet,
|
|
2227
2227
|
...y(e)
|
|
2228
2228
|
});
|
|
2229
|
-
class
|
|
2229
|
+
class W extends _ {
|
|
2230
2230
|
constructor() {
|
|
2231
2231
|
super(...arguments), this.validate = this.implement;
|
|
2232
2232
|
}
|
|
@@ -2246,7 +2246,7 @@ class H extends v {
|
|
|
2246
2246
|
s.common.contextualErrorMap,
|
|
2247
2247
|
s.schemaErrorMap,
|
|
2248
2248
|
ge(),
|
|
2249
|
-
|
|
2249
|
+
H
|
|
2250
2250
|
].filter((d) => !!d),
|
|
2251
2251
|
issueData: {
|
|
2252
2252
|
code: c.invalid_arguments,
|
|
@@ -2262,7 +2262,7 @@ class H extends v {
|
|
|
2262
2262
|
s.common.contextualErrorMap,
|
|
2263
2263
|
s.schemaErrorMap,
|
|
2264
2264
|
ge(),
|
|
2265
|
-
|
|
2265
|
+
H
|
|
2266
2266
|
].filter((d) => !!d),
|
|
2267
2267
|
issueData: {
|
|
2268
2268
|
code: c.invalid_return_type,
|
|
@@ -2271,14 +2271,14 @@ class H extends v {
|
|
|
2271
2271
|
});
|
|
2272
2272
|
}
|
|
2273
2273
|
const a = { errorMap: s.common.contextualErrorMap }, i = s.data;
|
|
2274
|
-
if (this._def.returns instanceof
|
|
2274
|
+
if (this._def.returns instanceof J) {
|
|
2275
2275
|
const o = this;
|
|
2276
2276
|
return T(async function(...u) {
|
|
2277
|
-
const d = new
|
|
2277
|
+
const d = new C([]), g = await o._def.args.parseAsync(u, a).catch((Se) => {
|
|
2278
2278
|
throw d.addIssue(n(u, Se)), d;
|
|
2279
|
-
}),
|
|
2280
|
-
return await o._def.returns._def.type.parseAsync(
|
|
2281
|
-
throw d.addIssue(r(
|
|
2279
|
+
}), Z = await Reflect.apply(i, this, g);
|
|
2280
|
+
return await o._def.returns._def.type.parseAsync(Z, a).catch((Se) => {
|
|
2281
|
+
throw d.addIssue(r(Z, Se)), d;
|
|
2282
2282
|
});
|
|
2283
2283
|
});
|
|
2284
2284
|
} else {
|
|
@@ -2286,11 +2286,11 @@ class H extends v {
|
|
|
2286
2286
|
return T(function(...u) {
|
|
2287
2287
|
const d = o._def.args.safeParse(u, a);
|
|
2288
2288
|
if (!d.success)
|
|
2289
|
-
throw new
|
|
2290
|
-
const g = Reflect.apply(i, this, d.data),
|
|
2291
|
-
if (!
|
|
2292
|
-
throw new
|
|
2293
|
-
return
|
|
2289
|
+
throw new C([n(u, d.error)]);
|
|
2290
|
+
const g = Reflect.apply(i, this, d.data), Z = o._def.returns.safeParse(g, a);
|
|
2291
|
+
if (!Z.success)
|
|
2292
|
+
throw new C([r(g, Z.error)]);
|
|
2293
|
+
return Z.data;
|
|
2294
2294
|
});
|
|
2295
2295
|
}
|
|
2296
2296
|
}
|
|
@@ -2301,13 +2301,13 @@ class H extends v {
|
|
|
2301
2301
|
return this._def.returns;
|
|
2302
2302
|
}
|
|
2303
2303
|
args(...e) {
|
|
2304
|
-
return new
|
|
2304
|
+
return new W({
|
|
2305
2305
|
...this._def,
|
|
2306
2306
|
args: I.create(e).rest(U.create())
|
|
2307
2307
|
});
|
|
2308
2308
|
}
|
|
2309
2309
|
returns(e) {
|
|
2310
|
-
return new
|
|
2310
|
+
return new W({
|
|
2311
2311
|
...this._def,
|
|
2312
2312
|
returns: e
|
|
2313
2313
|
});
|
|
@@ -2319,7 +2319,7 @@ class H extends v {
|
|
|
2319
2319
|
return this.parse(e);
|
|
2320
2320
|
}
|
|
2321
2321
|
static create(e, s, n) {
|
|
2322
|
-
return new
|
|
2322
|
+
return new W({
|
|
2323
2323
|
args: e || I.create([]).rest(U.create()),
|
|
2324
2324
|
returns: s || U.create(),
|
|
2325
2325
|
typeName: p.ZodFunction,
|
|
@@ -2327,7 +2327,7 @@ class H extends v {
|
|
|
2327
2327
|
});
|
|
2328
2328
|
}
|
|
2329
2329
|
}
|
|
2330
|
-
class ce extends
|
|
2330
|
+
class ce extends _ {
|
|
2331
2331
|
get schema() {
|
|
2332
2332
|
return this._def.getter();
|
|
2333
2333
|
}
|
|
@@ -2341,7 +2341,7 @@ ce.create = (t, e) => new ce({
|
|
|
2341
2341
|
typeName: p.ZodLazy,
|
|
2342
2342
|
...y(e)
|
|
2343
2343
|
});
|
|
2344
|
-
class de extends
|
|
2344
|
+
class de extends _ {
|
|
2345
2345
|
_parse(e) {
|
|
2346
2346
|
if (e.data !== this._def.value) {
|
|
2347
2347
|
const s = this._getOrReturnCtx(e);
|
|
@@ -2363,15 +2363,15 @@ de.create = (t, e) => new de({
|
|
|
2363
2363
|
...y(e)
|
|
2364
2364
|
});
|
|
2365
2365
|
function Ue(t, e) {
|
|
2366
|
-
return new
|
|
2366
|
+
return new V({
|
|
2367
2367
|
values: t,
|
|
2368
2368
|
typeName: p.ZodEnum,
|
|
2369
2369
|
...y(e)
|
|
2370
2370
|
});
|
|
2371
2371
|
}
|
|
2372
|
-
class
|
|
2372
|
+
class V extends _ {
|
|
2373
2373
|
constructor() {
|
|
2374
|
-
super(...arguments),
|
|
2374
|
+
super(...arguments), X.set(this, void 0);
|
|
2375
2375
|
}
|
|
2376
2376
|
_parse(e) {
|
|
2377
2377
|
if (typeof e.data != "string") {
|
|
@@ -2382,7 +2382,7 @@ class q extends v {
|
|
|
2382
2382
|
code: c.invalid_type
|
|
2383
2383
|
}), m;
|
|
2384
2384
|
}
|
|
2385
|
-
if (ve(this,
|
|
2385
|
+
if (ve(this, X) || qe(this, X, new Set(this._def.values)), !ve(this, X).has(e.data)) {
|
|
2386
2386
|
const s = this._getOrReturnCtx(e), n = this._def.values;
|
|
2387
2387
|
return l(s, {
|
|
2388
2388
|
received: s.data,
|
|
@@ -2414,23 +2414,23 @@ class q extends v {
|
|
|
2414
2414
|
return e;
|
|
2415
2415
|
}
|
|
2416
2416
|
extract(e, s = this._def) {
|
|
2417
|
-
return
|
|
2417
|
+
return V.create(e, {
|
|
2418
2418
|
...this._def,
|
|
2419
2419
|
...s
|
|
2420
2420
|
});
|
|
2421
2421
|
}
|
|
2422
2422
|
exclude(e, s = this._def) {
|
|
2423
|
-
return
|
|
2423
|
+
return V.create(this.options.filter((n) => !e.includes(n)), {
|
|
2424
2424
|
...this._def,
|
|
2425
2425
|
...s
|
|
2426
2426
|
});
|
|
2427
2427
|
}
|
|
2428
2428
|
}
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
class ue extends
|
|
2429
|
+
X = /* @__PURE__ */ new WeakMap();
|
|
2430
|
+
V.create = Ue;
|
|
2431
|
+
class ue extends _ {
|
|
2432
2432
|
constructor() {
|
|
2433
|
-
super(...arguments),
|
|
2433
|
+
super(...arguments), K.set(this, void 0);
|
|
2434
2434
|
}
|
|
2435
2435
|
_parse(e) {
|
|
2436
2436
|
const s = x.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
@@ -2442,7 +2442,7 @@ class ue extends v {
|
|
|
2442
2442
|
code: c.invalid_type
|
|
2443
2443
|
}), m;
|
|
2444
2444
|
}
|
|
2445
|
-
if (ve(this,
|
|
2445
|
+
if (ve(this, K) || qe(this, K, new Set(x.getValidEnumValues(this._def.values))), !ve(this, K).has(e.data)) {
|
|
2446
2446
|
const r = x.objectValues(s);
|
|
2447
2447
|
return l(n, {
|
|
2448
2448
|
received: n.data,
|
|
@@ -2456,13 +2456,13 @@ class ue extends v {
|
|
|
2456
2456
|
return this._def.values;
|
|
2457
2457
|
}
|
|
2458
2458
|
}
|
|
2459
|
-
|
|
2459
|
+
K = /* @__PURE__ */ new WeakMap();
|
|
2460
2460
|
ue.create = (t, e) => new ue({
|
|
2461
2461
|
values: t,
|
|
2462
2462
|
typeName: p.ZodNativeEnum,
|
|
2463
2463
|
...y(e)
|
|
2464
2464
|
});
|
|
2465
|
-
class
|
|
2465
|
+
class J extends _ {
|
|
2466
2466
|
unwrap() {
|
|
2467
2467
|
return this._def.type;
|
|
2468
2468
|
}
|
|
@@ -2481,12 +2481,12 @@ class X extends v {
|
|
|
2481
2481
|
})));
|
|
2482
2482
|
}
|
|
2483
2483
|
}
|
|
2484
|
-
|
|
2484
|
+
J.create = (t, e) => new J({
|
|
2485
2485
|
type: t,
|
|
2486
2486
|
typeName: p.ZodPromise,
|
|
2487
2487
|
...y(e)
|
|
2488
2488
|
});
|
|
2489
|
-
class
|
|
2489
|
+
class N extends _ {
|
|
2490
2490
|
innerType() {
|
|
2491
2491
|
return this._def.schema;
|
|
2492
2492
|
}
|
|
@@ -2513,7 +2513,7 @@ class O extends v {
|
|
|
2513
2513
|
path: n.path,
|
|
2514
2514
|
parent: n
|
|
2515
2515
|
});
|
|
2516
|
-
return u.status === "aborted" ? m : u.status === "dirty" || s.value === "dirty" ?
|
|
2516
|
+
return u.status === "aborted" ? m : u.status === "dirty" || s.value === "dirty" ? G(u.value) : u;
|
|
2517
2517
|
});
|
|
2518
2518
|
{
|
|
2519
2519
|
if (s.value === "aborted")
|
|
@@ -2523,7 +2523,7 @@ class O extends v {
|
|
|
2523
2523
|
path: n.path,
|
|
2524
2524
|
parent: n
|
|
2525
2525
|
});
|
|
2526
|
-
return o.status === "aborted" ? m : o.status === "dirty" || s.value === "dirty" ?
|
|
2526
|
+
return o.status === "aborted" ? m : o.status === "dirty" || s.value === "dirty" ? G(o.value) : o;
|
|
2527
2527
|
}
|
|
2528
2528
|
}
|
|
2529
2529
|
if (r.type === "refinement") {
|
|
@@ -2563,19 +2563,19 @@ class O extends v {
|
|
|
2563
2563
|
x.assertNever(r);
|
|
2564
2564
|
}
|
|
2565
2565
|
}
|
|
2566
|
-
|
|
2566
|
+
N.create = (t, e, s) => new N({
|
|
2567
2567
|
schema: t,
|
|
2568
2568
|
typeName: p.ZodEffects,
|
|
2569
2569
|
effect: e,
|
|
2570
2570
|
...y(s)
|
|
2571
2571
|
});
|
|
2572
|
-
|
|
2572
|
+
N.createWithPreprocess = (t, e, s) => new N({
|
|
2573
2573
|
schema: e,
|
|
2574
2574
|
effect: { type: "preprocess", transform: t },
|
|
2575
2575
|
typeName: p.ZodEffects,
|
|
2576
2576
|
...y(s)
|
|
2577
2577
|
});
|
|
2578
|
-
class
|
|
2578
|
+
class O extends _ {
|
|
2579
2579
|
_parse(e) {
|
|
2580
2580
|
return this._getType(e) === f.undefined ? T(void 0) : this._def.innerType._parse(e);
|
|
2581
2581
|
}
|
|
@@ -2583,12 +2583,12 @@ class N extends v {
|
|
|
2583
2583
|
return this._def.innerType;
|
|
2584
2584
|
}
|
|
2585
2585
|
}
|
|
2586
|
-
|
|
2586
|
+
O.create = (t, e) => new O({
|
|
2587
2587
|
innerType: t,
|
|
2588
2588
|
typeName: p.ZodOptional,
|
|
2589
2589
|
...y(e)
|
|
2590
2590
|
});
|
|
2591
|
-
class
|
|
2591
|
+
class D extends _ {
|
|
2592
2592
|
_parse(e) {
|
|
2593
2593
|
return this._getType(e) === f.null ? T(null) : this._def.innerType._parse(e);
|
|
2594
2594
|
}
|
|
@@ -2596,12 +2596,12 @@ class L extends v {
|
|
|
2596
2596
|
return this._def.innerType;
|
|
2597
2597
|
}
|
|
2598
2598
|
}
|
|
2599
|
-
|
|
2599
|
+
D.create = (t, e) => new D({
|
|
2600
2600
|
innerType: t,
|
|
2601
2601
|
typeName: p.ZodNullable,
|
|
2602
2602
|
...y(e)
|
|
2603
2603
|
});
|
|
2604
|
-
class le extends
|
|
2604
|
+
class le extends _ {
|
|
2605
2605
|
_parse(e) {
|
|
2606
2606
|
const { ctx: s } = this._processInputParams(e);
|
|
2607
2607
|
let n = s.data;
|
|
@@ -2621,7 +2621,7 @@ le.create = (t, e) => new le({
|
|
|
2621
2621
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2622
2622
|
...y(e)
|
|
2623
2623
|
});
|
|
2624
|
-
class fe extends
|
|
2624
|
+
class fe extends _ {
|
|
2625
2625
|
_parse(e) {
|
|
2626
2626
|
const { ctx: s } = this._processInputParams(e), n = {
|
|
2627
2627
|
...s,
|
|
@@ -2640,7 +2640,7 @@ class fe extends v {
|
|
|
2640
2640
|
status: "valid",
|
|
2641
2641
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2642
2642
|
get error() {
|
|
2643
|
-
return new
|
|
2643
|
+
return new C(n.common.issues);
|
|
2644
2644
|
},
|
|
2645
2645
|
input: n.data
|
|
2646
2646
|
})
|
|
@@ -2648,7 +2648,7 @@ class fe extends v {
|
|
|
2648
2648
|
status: "valid",
|
|
2649
2649
|
value: r.status === "valid" ? r.value : this._def.catchValue({
|
|
2650
2650
|
get error() {
|
|
2651
|
-
return new
|
|
2651
|
+
return new C(n.common.issues);
|
|
2652
2652
|
},
|
|
2653
2653
|
input: n.data
|
|
2654
2654
|
})
|
|
@@ -2664,7 +2664,7 @@ fe.create = (t, e) => new fe({
|
|
|
2664
2664
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2665
2665
|
...y(e)
|
|
2666
2666
|
});
|
|
2667
|
-
class ke extends
|
|
2667
|
+
class ke extends _ {
|
|
2668
2668
|
_parse(e) {
|
|
2669
2669
|
if (this._getType(e) !== f.nan) {
|
|
2670
2670
|
const n = this._getOrReturnCtx(e);
|
|
@@ -2681,8 +2681,8 @@ ke.create = (t) => new ke({
|
|
|
2681
2681
|
typeName: p.ZodNaN,
|
|
2682
2682
|
...y(t)
|
|
2683
2683
|
});
|
|
2684
|
-
const
|
|
2685
|
-
class
|
|
2684
|
+
const _t = Symbol("zod_brand");
|
|
2685
|
+
class Oe extends _ {
|
|
2686
2686
|
_parse(e) {
|
|
2687
2687
|
const { ctx: s } = this._processInputParams(e), n = s.data;
|
|
2688
2688
|
return this._def.type._parse({
|
|
@@ -2695,7 +2695,7 @@ class Ne extends v {
|
|
|
2695
2695
|
return this._def.type;
|
|
2696
2696
|
}
|
|
2697
2697
|
}
|
|
2698
|
-
class pe extends
|
|
2698
|
+
class pe extends _ {
|
|
2699
2699
|
_parse(e) {
|
|
2700
2700
|
const { status: s, ctx: n } = this._processInputParams(e);
|
|
2701
2701
|
if (n.common.async)
|
|
@@ -2705,7 +2705,7 @@ class pe extends v {
|
|
|
2705
2705
|
path: n.path,
|
|
2706
2706
|
parent: n
|
|
2707
2707
|
});
|
|
2708
|
-
return a.status === "aborted" ? m : a.status === "dirty" ? (s.dirty(),
|
|
2708
|
+
return a.status === "aborted" ? m : a.status === "dirty" ? (s.dirty(), G(a.value)) : this._def.out._parseAsync({
|
|
2709
2709
|
data: a.value,
|
|
2710
2710
|
path: n.path,
|
|
2711
2711
|
parent: n
|
|
@@ -2735,7 +2735,7 @@ class pe extends v {
|
|
|
2735
2735
|
});
|
|
2736
2736
|
}
|
|
2737
2737
|
}
|
|
2738
|
-
class he extends
|
|
2738
|
+
class he extends _ {
|
|
2739
2739
|
_parse(e) {
|
|
2740
2740
|
const s = this._def.innerType._parse(e), n = (r) => (ee(r) && (r.value = Object.freeze(r.value)), r);
|
|
2741
2741
|
return te(s) ? s.then((r) => n(r)) : n(s);
|
|
@@ -2750,46 +2750,46 @@ he.create = (t, e) => new he({
|
|
|
2750
2750
|
...y(e)
|
|
2751
2751
|
});
|
|
2752
2752
|
function ze(t, e = {}, s) {
|
|
2753
|
-
return t ?
|
|
2753
|
+
return t ? Y.create().superRefine((n, r) => {
|
|
2754
2754
|
var a, i;
|
|
2755
2755
|
if (!t(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 : s) !== null && i !== void 0 ? i : !0, d = typeof o == "string" ? { message: o } : o;
|
|
2757
2757
|
r.addIssue({ code: "custom", ...d, fatal: u });
|
|
2758
2758
|
}
|
|
2759
|
-
}) :
|
|
2759
|
+
}) : Y.create();
|
|
2760
2760
|
}
|
|
2761
|
-
const
|
|
2761
|
+
const xt = {
|
|
2762
2762
|
object: b.lazycreate
|
|
2763
2763
|
};
|
|
2764
2764
|
var p;
|
|
2765
2765
|
(function(t) {
|
|
2766
2766
|
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";
|
|
2767
2767
|
})(p || (p = {}));
|
|
2768
|
-
const
|
|
2768
|
+
const bt = (t, e = {
|
|
2769
2769
|
message: `Input not instance of ${t.name}`
|
|
2770
|
-
}) => ze((s) => s instanceof t, e), Be =
|
|
2771
|
-
string: (t) =>
|
|
2770
|
+
}) => ze((s) => s instanceof t, e), Be = R.create, Qe = $.create, kt = ke.create, wt = q.create, Ge = se.create, Tt = z.create, St = _e.create, Ct = ne.create, Zt = re.create, Rt = Y.create, Et = U.create, Nt = A.create, Ot = xe.create, Mt = E.create, It = b.create, jt = b.strictCreate, At = ae.create, Pt = we.create, $t = ie.create, qt = I.create, Vt = oe.create, Dt = be.create, Lt = B.create, Ut = W.create, zt = ce.create, Bt = de.create, Qt = V.create, Gt = ue.create, Wt = J.create, Pe = N.create, Ht = O.create, Yt = D.create, Jt = N.createWithPreprocess, Xt = pe.create, Kt = () => Be().optional(), Ft = () => Qe().optional(), es = () => Ge().optional(), ts = {
|
|
2771
|
+
string: (t) => R.create({ ...t, coerce: !0 }),
|
|
2772
2772
|
number: (t) => $.create({ ...t, coerce: !0 }),
|
|
2773
2773
|
boolean: (t) => se.create({
|
|
2774
2774
|
...t,
|
|
2775
2775
|
coerce: !0
|
|
2776
2776
|
}),
|
|
2777
|
-
bigint: (t) =>
|
|
2777
|
+
bigint: (t) => q.create({ ...t, coerce: !0 }),
|
|
2778
2778
|
date: (t) => z.create({ ...t, coerce: !0 })
|
|
2779
|
-
},
|
|
2780
|
-
var
|
|
2779
|
+
}, ss = m;
|
|
2780
|
+
var v = /* @__PURE__ */ Object.freeze({
|
|
2781
2781
|
__proto__: null,
|
|
2782
|
-
defaultErrorMap:
|
|
2783
|
-
setErrorMap:
|
|
2782
|
+
defaultErrorMap: H,
|
|
2783
|
+
setErrorMap: st,
|
|
2784
2784
|
getErrorMap: ge,
|
|
2785
2785
|
makeIssue: ye,
|
|
2786
|
-
EMPTY_PATH:
|
|
2786
|
+
EMPTY_PATH: nt,
|
|
2787
2787
|
addIssueToContext: l,
|
|
2788
2788
|
ParseStatus: w,
|
|
2789
2789
|
INVALID: m,
|
|
2790
|
-
DIRTY:
|
|
2790
|
+
DIRTY: G,
|
|
2791
2791
|
OK: T,
|
|
2792
|
-
isAborted:
|
|
2792
|
+
isAborted: Re,
|
|
2793
2793
|
isDirty: Ee,
|
|
2794
2794
|
isValid: ee,
|
|
2795
2795
|
isAsync: te,
|
|
@@ -2797,21 +2797,21 @@ var _ = /* @__PURE__ */ Object.freeze({
|
|
|
2797
2797
|
return x;
|
|
2798
2798
|
},
|
|
2799
2799
|
get objectUtil() {
|
|
2800
|
-
return
|
|
2800
|
+
return Ze;
|
|
2801
2801
|
},
|
|
2802
2802
|
ZodParsedType: f,
|
|
2803
2803
|
getParsedType: P,
|
|
2804
|
-
ZodType:
|
|
2805
|
-
datetimeRegex:
|
|
2806
|
-
ZodString:
|
|
2804
|
+
ZodType: _,
|
|
2805
|
+
datetimeRegex: Le,
|
|
2806
|
+
ZodString: R,
|
|
2807
2807
|
ZodNumber: $,
|
|
2808
|
-
ZodBigInt:
|
|
2808
|
+
ZodBigInt: q,
|
|
2809
2809
|
ZodBoolean: se,
|
|
2810
2810
|
ZodDate: z,
|
|
2811
2811
|
ZodSymbol: _e,
|
|
2812
2812
|
ZodUndefined: ne,
|
|
2813
2813
|
ZodNull: re,
|
|
2814
|
-
ZodAny:
|
|
2814
|
+
ZodAny: Y,
|
|
2815
2815
|
ZodUnknown: U,
|
|
2816
2816
|
ZodNever: A,
|
|
2817
2817
|
ZodVoid: xe,
|
|
@@ -2824,136 +2824,139 @@ var _ = /* @__PURE__ */ Object.freeze({
|
|
|
2824
2824
|
ZodRecord: oe,
|
|
2825
2825
|
ZodMap: be,
|
|
2826
2826
|
ZodSet: B,
|
|
2827
|
-
ZodFunction:
|
|
2827
|
+
ZodFunction: W,
|
|
2828
2828
|
ZodLazy: ce,
|
|
2829
2829
|
ZodLiteral: de,
|
|
2830
|
-
ZodEnum:
|
|
2830
|
+
ZodEnum: V,
|
|
2831
2831
|
ZodNativeEnum: ue,
|
|
2832
|
-
ZodPromise:
|
|
2833
|
-
ZodEffects:
|
|
2834
|
-
ZodTransformer:
|
|
2835
|
-
ZodOptional:
|
|
2836
|
-
ZodNullable:
|
|
2832
|
+
ZodPromise: J,
|
|
2833
|
+
ZodEffects: N,
|
|
2834
|
+
ZodTransformer: N,
|
|
2835
|
+
ZodOptional: O,
|
|
2836
|
+
ZodNullable: D,
|
|
2837
2837
|
ZodDefault: le,
|
|
2838
2838
|
ZodCatch: fe,
|
|
2839
2839
|
ZodNaN: ke,
|
|
2840
|
-
BRAND:
|
|
2841
|
-
ZodBranded:
|
|
2840
|
+
BRAND: _t,
|
|
2841
|
+
ZodBranded: Oe,
|
|
2842
2842
|
ZodPipeline: pe,
|
|
2843
2843
|
ZodReadonly: he,
|
|
2844
2844
|
custom: ze,
|
|
2845
|
-
Schema:
|
|
2846
|
-
ZodSchema:
|
|
2847
|
-
late:
|
|
2845
|
+
Schema: _,
|
|
2846
|
+
ZodSchema: _,
|
|
2847
|
+
late: xt,
|
|
2848
2848
|
get ZodFirstPartyTypeKind() {
|
|
2849
2849
|
return p;
|
|
2850
2850
|
},
|
|
2851
|
-
coerce:
|
|
2852
|
-
any:
|
|
2853
|
-
array:
|
|
2854
|
-
bigint:
|
|
2851
|
+
coerce: ts,
|
|
2852
|
+
any: Rt,
|
|
2853
|
+
array: Mt,
|
|
2854
|
+
bigint: wt,
|
|
2855
2855
|
boolean: Ge,
|
|
2856
|
-
date:
|
|
2857
|
-
discriminatedUnion:
|
|
2856
|
+
date: Tt,
|
|
2857
|
+
discriminatedUnion: Pt,
|
|
2858
2858
|
effect: Pe,
|
|
2859
|
-
enum:
|
|
2860
|
-
function:
|
|
2861
|
-
instanceof:
|
|
2862
|
-
intersection:
|
|
2863
|
-
lazy:
|
|
2864
|
-
literal:
|
|
2859
|
+
enum: Qt,
|
|
2860
|
+
function: Ut,
|
|
2861
|
+
instanceof: bt,
|
|
2862
|
+
intersection: $t,
|
|
2863
|
+
lazy: zt,
|
|
2864
|
+
literal: Bt,
|
|
2865
2865
|
map: Dt,
|
|
2866
|
-
nan:
|
|
2867
|
-
nativeEnum:
|
|
2866
|
+
nan: kt,
|
|
2867
|
+
nativeEnum: Gt,
|
|
2868
2868
|
never: Nt,
|
|
2869
|
-
null:
|
|
2870
|
-
nullable:
|
|
2869
|
+
null: Zt,
|
|
2870
|
+
nullable: Yt,
|
|
2871
2871
|
number: Qe,
|
|
2872
|
-
object:
|
|
2873
|
-
oboolean:
|
|
2874
|
-
onumber:
|
|
2875
|
-
optional:
|
|
2876
|
-
ostring:
|
|
2877
|
-
pipeline:
|
|
2878
|
-
preprocess:
|
|
2879
|
-
promise:
|
|
2880
|
-
record:
|
|
2881
|
-
set:
|
|
2882
|
-
strictObject:
|
|
2872
|
+
object: It,
|
|
2873
|
+
oboolean: es,
|
|
2874
|
+
onumber: Ft,
|
|
2875
|
+
optional: Ht,
|
|
2876
|
+
ostring: Kt,
|
|
2877
|
+
pipeline: Xt,
|
|
2878
|
+
preprocess: Jt,
|
|
2879
|
+
promise: Wt,
|
|
2880
|
+
record: Vt,
|
|
2881
|
+
set: Lt,
|
|
2882
|
+
strictObject: jt,
|
|
2883
2883
|
string: Be,
|
|
2884
|
-
symbol:
|
|
2884
|
+
symbol: St,
|
|
2885
2885
|
transformer: Pe,
|
|
2886
2886
|
tuple: qt,
|
|
2887
|
-
undefined:
|
|
2888
|
-
union:
|
|
2889
|
-
unknown:
|
|
2890
|
-
void:
|
|
2891
|
-
NEVER:
|
|
2887
|
+
undefined: Ct,
|
|
2888
|
+
union: At,
|
|
2889
|
+
unknown: Et,
|
|
2890
|
+
void: Ot,
|
|
2891
|
+
NEVER: ss,
|
|
2892
2892
|
ZodIssueCode: c,
|
|
2893
|
-
quotelessJson:
|
|
2894
|
-
ZodError:
|
|
2893
|
+
quotelessJson: tt,
|
|
2894
|
+
ZodError: C
|
|
2895
2895
|
});
|
|
2896
|
-
const S =
|
|
2897
|
-
type:
|
|
2898
|
-
id:
|
|
2899
|
-
}),
|
|
2900
|
-
status:
|
|
2901
|
-
question:
|
|
2902
|
-
answer:
|
|
2896
|
+
const S = v.object({
|
|
2897
|
+
type: v.literal("qp-bridge"),
|
|
2898
|
+
id: v.string().optional()
|
|
2899
|
+
}), ns = S.extend({
|
|
2900
|
+
status: v.literal("answerChanged"),
|
|
2901
|
+
question: v.string(),
|
|
2902
|
+
answer: v.unknown()
|
|
2903
2903
|
}), Te = S.extend({
|
|
2904
|
-
status:
|
|
2905
|
-
}),
|
|
2906
|
-
status:
|
|
2907
|
-
message:
|
|
2908
|
-
}), We =
|
|
2909
|
-
semanticColor:
|
|
2910
|
-
label:
|
|
2911
|
-
description:
|
|
2912
|
-
disabled:
|
|
2913
|
-
required:
|
|
2914
|
-
hidden:
|
|
2915
|
-
errorMessage:
|
|
2916
|
-
}),
|
|
2917
|
-
label:
|
|
2918
|
-
hidden:
|
|
2919
|
-
collapsed:
|
|
2920
|
-
}),
|
|
2921
|
-
action:
|
|
2922
|
-
question:
|
|
2923
|
-
}),
|
|
2904
|
+
status: v.literal("success")
|
|
2905
|
+
}), rs = S.extend({
|
|
2906
|
+
status: v.literal("error"),
|
|
2907
|
+
message: v.string()
|
|
2908
|
+
}), We = v.object({
|
|
2909
|
+
semanticColor: v.string().optional(),
|
|
2910
|
+
label: v.string(),
|
|
2911
|
+
description: v.string(),
|
|
2912
|
+
disabled: v.boolean(),
|
|
2913
|
+
required: v.boolean(),
|
|
2914
|
+
hidden: v.boolean(),
|
|
2915
|
+
errorMessage: v.string().optional()
|
|
2916
|
+
}), as = We.partial(), He = v.object({
|
|
2917
|
+
label: v.string(),
|
|
2918
|
+
hidden: v.boolean(),
|
|
2919
|
+
collapsed: v.boolean()
|
|
2920
|
+
}), is = He.partial(), os = S.extend({
|
|
2921
|
+
action: v.literal("getQuestion"),
|
|
2922
|
+
question: v.string()
|
|
2923
|
+
}), cs = Te.extend({
|
|
2924
2924
|
question: We
|
|
2925
|
+
}), ds = S.extend({
|
|
2926
|
+
action: v.literal("setQuestion"),
|
|
2927
|
+
question: v.string(),
|
|
2928
|
+
questionData: as
|
|
2925
2929
|
}), us = S.extend({
|
|
2926
|
-
action:
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
}), ls = S.extend({
|
|
2930
|
-
action: _.literal("getGroup"),
|
|
2931
|
-
group: _.string()
|
|
2932
|
-
}), fs = Te.extend({
|
|
2930
|
+
action: v.literal("getGroup"),
|
|
2931
|
+
group: v.string()
|
|
2932
|
+
}), ls = Te.extend({
|
|
2933
2933
|
group: He
|
|
2934
|
-
}),
|
|
2935
|
-
canSave:
|
|
2934
|
+
}), fs = Te.extend({
|
|
2935
|
+
canSave: v.boolean()
|
|
2936
|
+
}), hs = S.extend({
|
|
2937
|
+
action: v.literal("canSave")
|
|
2936
2938
|
}), ps = S.extend({
|
|
2937
|
-
action:
|
|
2939
|
+
action: v.literal("setGroup"),
|
|
2940
|
+
group: v.string(),
|
|
2941
|
+
groupData: is
|
|
2938
2942
|
}), ms = S.extend({
|
|
2939
|
-
action:
|
|
2940
|
-
|
|
2941
|
-
|
|
2943
|
+
action: v.literal("setAnswer"),
|
|
2944
|
+
question: v.string(),
|
|
2945
|
+
answer: v.unknown()
|
|
2942
2946
|
}), gs = S.extend({
|
|
2943
|
-
action:
|
|
2944
|
-
question: _.string(),
|
|
2945
|
-
answer: _.unknown()
|
|
2947
|
+
action: v.literal("busyIndicatorStart")
|
|
2946
2948
|
}), ys = S.extend({
|
|
2947
|
-
action:
|
|
2949
|
+
action: v.literal("busyIndicatorEnd")
|
|
2948
2950
|
}), vs = S.extend({
|
|
2949
|
-
action:
|
|
2951
|
+
action: v.literal("saveQuestionnaire")
|
|
2950
2952
|
}), _s = S.extend({
|
|
2951
|
-
action:
|
|
2953
|
+
action: v.literal("completeAndCloseQuestionnaire")
|
|
2952
2954
|
}), xs = S.extend({
|
|
2953
|
-
action:
|
|
2955
|
+
action: v.literal("executeCustomCommand"),
|
|
2956
|
+
commandName: v.string()
|
|
2954
2957
|
});
|
|
2955
2958
|
function bs(t) {
|
|
2956
|
-
return
|
|
2959
|
+
return ns.safeParse(t).success;
|
|
2957
2960
|
}
|
|
2958
2961
|
function Ye(t) {
|
|
2959
2962
|
return S.safeParse(t).success;
|
|
@@ -2962,52 +2965,56 @@ function ks(t) {
|
|
|
2962
2965
|
return Te.safeParse(t).success;
|
|
2963
2966
|
}
|
|
2964
2967
|
function ws(t) {
|
|
2965
|
-
return
|
|
2968
|
+
return rs.safeParse(t).success;
|
|
2966
2969
|
}
|
|
2967
|
-
function
|
|
2968
|
-
return
|
|
2970
|
+
function Ms(t) {
|
|
2971
|
+
return os.safeParse(t).success;
|
|
2969
2972
|
}
|
|
2970
2973
|
function Ts(t) {
|
|
2971
|
-
return
|
|
2974
|
+
return cs.safeParse(t).success;
|
|
2975
|
+
}
|
|
2976
|
+
function Is(t) {
|
|
2977
|
+
return ms.safeParse(t).success;
|
|
2972
2978
|
}
|
|
2973
2979
|
function js(t) {
|
|
2974
|
-
return
|
|
2980
|
+
return ds.safeParse(t).success;
|
|
2975
2981
|
}
|
|
2976
2982
|
function As(t) {
|
|
2977
|
-
return
|
|
2983
|
+
return ps.safeParse(t).success;
|
|
2978
2984
|
}
|
|
2979
2985
|
function Ps(t) {
|
|
2980
|
-
return
|
|
2986
|
+
return us.safeParse(t).success;
|
|
2981
2987
|
}
|
|
2982
|
-
function
|
|
2988
|
+
function Ss(t) {
|
|
2983
2989
|
return ls.safeParse(t).success;
|
|
2984
2990
|
}
|
|
2985
|
-
function
|
|
2991
|
+
function $s(t) {
|
|
2986
2992
|
return fs.safeParse(t).success;
|
|
2987
2993
|
}
|
|
2988
|
-
function
|
|
2994
|
+
function Cs(t) {
|
|
2989
2995
|
return hs.safeParse(t).success;
|
|
2990
2996
|
}
|
|
2991
2997
|
function Zs(t) {
|
|
2992
|
-
return
|
|
2998
|
+
return gs.safeParse(t).success;
|
|
2993
2999
|
}
|
|
2994
3000
|
function Rs(t) {
|
|
2995
3001
|
return ys.safeParse(t).success;
|
|
2996
3002
|
}
|
|
2997
|
-
function
|
|
3003
|
+
function qs(t) {
|
|
2998
3004
|
return vs.safeParse(t).success;
|
|
2999
3005
|
}
|
|
3000
|
-
function
|
|
3006
|
+
function Vs(t) {
|
|
3001
3007
|
return _s.safeParse(t).success;
|
|
3002
3008
|
}
|
|
3003
|
-
function
|
|
3009
|
+
function Ds(t) {
|
|
3004
3010
|
return xs.safeParse(t).success;
|
|
3005
3011
|
}
|
|
3006
|
-
function
|
|
3007
|
-
return
|
|
3012
|
+
function Ls(t) {
|
|
3013
|
+
return Zs(t) || Rs(t);
|
|
3008
3014
|
}
|
|
3015
|
+
window.addEventListener("message", Es);
|
|
3009
3016
|
async function Us(t, e) {
|
|
3010
|
-
await
|
|
3017
|
+
await L({
|
|
3011
3018
|
type: "qp-bridge",
|
|
3012
3019
|
action: "setAnswer",
|
|
3013
3020
|
question: t,
|
|
@@ -3022,7 +3029,7 @@ async function zs(t) {
|
|
|
3022
3029
|
});
|
|
3023
3030
|
}
|
|
3024
3031
|
async function Bs(t, e) {
|
|
3025
|
-
await
|
|
3032
|
+
await L({
|
|
3026
3033
|
type: "qp-bridge",
|
|
3027
3034
|
action: "setQuestion",
|
|
3028
3035
|
question: t,
|
|
@@ -3030,14 +3037,14 @@ async function Bs(t, e) {
|
|
|
3030
3037
|
});
|
|
3031
3038
|
}
|
|
3032
3039
|
async function Qs(t) {
|
|
3033
|
-
return await
|
|
3040
|
+
return await Os({
|
|
3034
3041
|
type: "qp-bridge",
|
|
3035
3042
|
action: "getGroup",
|
|
3036
3043
|
group: t
|
|
3037
3044
|
});
|
|
3038
3045
|
}
|
|
3039
3046
|
async function Gs(t, e) {
|
|
3040
|
-
await
|
|
3047
|
+
await L({
|
|
3041
3048
|
type: "qp-bridge",
|
|
3042
3049
|
action: "setGroup",
|
|
3043
3050
|
group: t,
|
|
@@ -3055,50 +3062,51 @@ function Ws(t) {
|
|
|
3055
3062
|
};
|
|
3056
3063
|
}
|
|
3057
3064
|
async function Hs(t) {
|
|
3058
|
-
await
|
|
3065
|
+
await L({
|
|
3059
3066
|
type: "qp-bridge",
|
|
3060
3067
|
action: "busyIndicatorStart"
|
|
3061
3068
|
});
|
|
3062
3069
|
try {
|
|
3063
3070
|
return await t();
|
|
3064
3071
|
} finally {
|
|
3065
|
-
await
|
|
3072
|
+
await L({
|
|
3066
3073
|
type: "qp-bridge",
|
|
3067
3074
|
action: "busyIndicatorEnd"
|
|
3068
3075
|
});
|
|
3069
3076
|
}
|
|
3070
3077
|
}
|
|
3071
3078
|
async function Ys() {
|
|
3072
|
-
await
|
|
3079
|
+
await L({
|
|
3073
3080
|
type: "qp-bridge",
|
|
3074
3081
|
action: "saveQuestionnaire"
|
|
3075
3082
|
});
|
|
3076
3083
|
}
|
|
3077
3084
|
async function Js() {
|
|
3078
|
-
await
|
|
3085
|
+
await L({
|
|
3079
3086
|
type: "qp-bridge",
|
|
3080
3087
|
action: "completeAndCloseQuestionnaire"
|
|
3081
3088
|
});
|
|
3082
3089
|
}
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3090
|
+
async function Xs(t) {
|
|
3091
|
+
await L({
|
|
3092
|
+
type: "qp-bridge",
|
|
3093
|
+
action: "executeCustomCommand",
|
|
3094
|
+
commandName: t
|
|
3095
|
+
});
|
|
3096
|
+
}
|
|
3097
|
+
const F = [];
|
|
3098
|
+
function Ks(t) {
|
|
3099
|
+
return F.includes(t) || F.push(t), {
|
|
3086
3100
|
cancelSubscription: () => {
|
|
3087
|
-
const e =
|
|
3088
|
-
e !== -1 &&
|
|
3101
|
+
const e = F.indexOf(t);
|
|
3102
|
+
e !== -1 && F.splice(e, 1);
|
|
3089
3103
|
}
|
|
3090
3104
|
};
|
|
3091
3105
|
}
|
|
3092
|
-
function Es() {
|
|
3093
|
-
window.addEventListener("message", Je);
|
|
3094
|
-
}
|
|
3095
|
-
function Os() {
|
|
3096
|
-
window.removeEventListener("message", Je);
|
|
3097
|
-
}
|
|
3098
|
-
async function Je(t) {
|
|
3106
|
+
async function Es(t) {
|
|
3099
3107
|
try {
|
|
3100
|
-
if (
|
|
3101
|
-
const e = await Promise.all(
|
|
3108
|
+
if (Cs(t.data)) {
|
|
3109
|
+
const e = await Promise.all(F.map((n) => n())), s = {
|
|
3102
3110
|
type: "qp-bridge",
|
|
3103
3111
|
status: "success",
|
|
3104
3112
|
id: t.data.id,
|
|
@@ -3118,7 +3126,7 @@ async function Je(t) {
|
|
|
3118
3126
|
}
|
|
3119
3127
|
async function Me(t, e) {
|
|
3120
3128
|
return new Promise((s, n) => {
|
|
3121
|
-
const r =
|
|
3129
|
+
const r = et(), a = (i) => {
|
|
3122
3130
|
if (!Ye(i.data) || i.data.id !== r)
|
|
3123
3131
|
return;
|
|
3124
3132
|
const u = e(i.data);
|
|
@@ -3130,60 +3138,63 @@ async function Me(t, e) {
|
|
|
3130
3138
|
async function Ns(t) {
|
|
3131
3139
|
return Me(t, (e) => Ts(e) ? { success: !0, data: e.question } : { success: !1 });
|
|
3132
3140
|
}
|
|
3133
|
-
async function
|
|
3141
|
+
async function Os(t) {
|
|
3134
3142
|
return Me(t, (e) => Ss(e) ? { success: !0, data: e.group } : { success: !1 });
|
|
3135
3143
|
}
|
|
3136
|
-
function
|
|
3144
|
+
function L(t) {
|
|
3137
3145
|
return Me(t, (e) => ks(e) ? { success: !0, data: void 0 } : { success: !1 });
|
|
3138
3146
|
}
|
|
3139
3147
|
export {
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3148
|
+
ys as busyIndicatorEndRequestMessageSchema,
|
|
3149
|
+
gs as busyIndicatorStartRequestMessageSchema,
|
|
3150
|
+
hs as canSaveRequestMessageSchema,
|
|
3151
|
+
fs as canSaveSuccessResponseMessageSchema,
|
|
3144
3152
|
Js as completeAndCloseQuestionnaire,
|
|
3145
|
-
|
|
3153
|
+
_s as completeAndCloseQuestionnaireRequestMessageSchema,
|
|
3154
|
+
Xs as executeCustomCommand,
|
|
3155
|
+
xs as executeCustomCommandRequestMessageSchema,
|
|
3146
3156
|
Qs as getGroup,
|
|
3147
|
-
|
|
3148
|
-
|
|
3157
|
+
us as getGroupRequestMessageSchema,
|
|
3158
|
+
ls as getGroupSuccessResponseMessageSchema,
|
|
3149
3159
|
zs as getQuestion,
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3160
|
+
os as getQuestionRequestMessageSchema,
|
|
3161
|
+
cs as getQuestionSuccessResponseMessageSchema,
|
|
3162
|
+
is as groupOptionalScheme,
|
|
3153
3163
|
He as groupSchema,
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3164
|
+
Rs as isBusyIndicatorEndRequestMessage,
|
|
3165
|
+
Zs as isBusyIndicatorStartRequestMessage,
|
|
3166
|
+
Cs as isCanSaveRequestMessage,
|
|
3167
|
+
$s as isCanSaveSuccessResponseMessage,
|
|
3168
|
+
Vs as isCompleteAndCloseQuestionnaireRequestMessage,
|
|
3159
3169
|
ws as isErrorMessage,
|
|
3160
|
-
|
|
3170
|
+
Ds as isExecuteCustomCommandRequestMessage,
|
|
3171
|
+
Ps as isGetGroupRequestMessage,
|
|
3161
3172
|
Ss as isGetGroupSuccessResponseMessage,
|
|
3162
|
-
|
|
3173
|
+
Ms as isGetQuestionRequestMessage,
|
|
3163
3174
|
Ts as isGetQuestionSuccessResponseMessage,
|
|
3164
3175
|
bs as isOnAnswerChangeMessage,
|
|
3165
3176
|
Ye as isQpBridgeMessage,
|
|
3166
3177
|
qs as isSaveQuestionnaireRequestMessage,
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3178
|
+
Is as isSetAnswerRequestMessage,
|
|
3179
|
+
As as isSetGroupRequestMessage,
|
|
3180
|
+
js as isSetQuestionRequestMessage,
|
|
3170
3181
|
ks as isSuccessMessage,
|
|
3171
|
-
|
|
3182
|
+
Ls as isWithBusyIndicatorRequestMessage,
|
|
3172
3183
|
Ws as onAnswerChange,
|
|
3173
|
-
|
|
3174
|
-
|
|
3184
|
+
ns as onAnswerChangeMessageSchema,
|
|
3185
|
+
Ks as onSave,
|
|
3175
3186
|
S as qpBridgeMessageSchema,
|
|
3176
|
-
|
|
3187
|
+
as as questionOptionalScheme,
|
|
3177
3188
|
We as questionSchema,
|
|
3178
|
-
|
|
3189
|
+
rs as responseErrorMessageSchema,
|
|
3179
3190
|
Te as responseSuccessMessageSchema,
|
|
3180
3191
|
Ys as saveQuestionnaire,
|
|
3181
|
-
|
|
3192
|
+
vs as saveQuestionnaireRequestMessageSchema,
|
|
3182
3193
|
Us as setAnswer,
|
|
3183
|
-
|
|
3194
|
+
ms as setAnswerRequestMessageSchema,
|
|
3184
3195
|
Gs as setGroup,
|
|
3185
|
-
|
|
3196
|
+
ps as setGroupRequestMessageSchema,
|
|
3186
3197
|
Bs as setQuestion,
|
|
3187
|
-
|
|
3198
|
+
ds as setQuestionRequestMessageSchema,
|
|
3188
3199
|
Hs as withBusyIndicator
|
|
3189
3200
|
};
|