@resconet/qp-bridge 0.0.1-alpha.20 → 0.0.1-alpha.21
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 +85 -2
- package/index.js +1 -1
- package/index.mjs +368 -316
- package/lib/qp-bridge-types.d.ts +63 -0
- package/lib/qp-bridge.d.ts +45 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -11,12 +11,12 @@ for (let t = 0; t < 256; ++t)
|
|
|
11
11
|
function tt(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 st = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto),
|
|
14
|
+
const st = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Ae = {
|
|
15
15
|
randomUUID: st
|
|
16
16
|
};
|
|
17
17
|
function qe(t, e, s) {
|
|
18
|
-
if (
|
|
19
|
-
return
|
|
18
|
+
if (Ae.randomUUID && !e && !t)
|
|
19
|
+
return Ae.randomUUID();
|
|
20
20
|
t = t || {};
|
|
21
21
|
const n = t.random || (t.rng || et)();
|
|
22
22
|
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, tt(n);
|
|
@@ -86,7 +86,7 @@ const f = x.arrayToEnum([
|
|
|
86
86
|
"never",
|
|
87
87
|
"map",
|
|
88
88
|
"set"
|
|
89
|
-
]),
|
|
89
|
+
]), q = (t) => {
|
|
90
90
|
switch (typeof t) {
|
|
91
91
|
case "undefined":
|
|
92
92
|
return f.undefined;
|
|
@@ -327,7 +327,7 @@ class S {
|
|
|
327
327
|
}
|
|
328
328
|
const y = Object.freeze({
|
|
329
329
|
status: "aborted"
|
|
330
|
-
}), W = (t) => ({ status: "dirty", value: t }), T = (t) => ({ status: "valid", value: t }),
|
|
330
|
+
}), W = (t) => ({ status: "dirty", value: t }), T = (t) => ({ status: "valid", value: t }), Ne = (t) => t.status === "aborted", Me = (t) => t.status === "dirty", se = (t) => t.status === "valid", ne = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
331
331
|
function be(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");
|
|
@@ -338,12 +338,12 @@ function Ue(t, e, s, n, r) {
|
|
|
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;
|
|
340
340
|
}
|
|
341
|
-
var
|
|
341
|
+
var p;
|
|
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
|
+
})(p || (p = {}));
|
|
345
345
|
var F, ee;
|
|
346
|
-
class
|
|
346
|
+
class O {
|
|
347
347
|
constructor(e, s, n, r) {
|
|
348
348
|
this._cachedPath = [], this.parent = e, this.data = s, this._path = n, this._key = r;
|
|
349
349
|
}
|
|
@@ -351,7 +351,7 @@ class M {
|
|
|
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 = (t, e) => {
|
|
355
355
|
if (se(e))
|
|
356
356
|
return { success: !0, data: e.value };
|
|
357
357
|
if (!t.common.issues.length)
|
|
@@ -386,13 +386,13 @@ class _ {
|
|
|
386
386
|
return this._def.description;
|
|
387
387
|
}
|
|
388
388
|
_getType(e) {
|
|
389
|
-
return
|
|
389
|
+
return q(e.data);
|
|
390
390
|
}
|
|
391
391
|
_getOrReturnCtx(e, s) {
|
|
392
392
|
return s || {
|
|
393
393
|
common: e.parent.common,
|
|
394
394
|
data: e.data,
|
|
395
|
-
parsedType:
|
|
395
|
+
parsedType: q(e.data),
|
|
396
396
|
schemaErrorMap: this._def.errorMap,
|
|
397
397
|
path: e.path,
|
|
398
398
|
parent: e.parent
|
|
@@ -404,7 +404,7 @@ class _ {
|
|
|
404
404
|
ctx: {
|
|
405
405
|
common: e.parent.common,
|
|
406
406
|
data: e.data,
|
|
407
|
-
parsedType:
|
|
407
|
+
parsedType: q(e.data),
|
|
408
408
|
schemaErrorMap: this._def.errorMap,
|
|
409
409
|
path: e.path,
|
|
410
410
|
parent: e.parent
|
|
@@ -439,9 +439,9 @@ class _ {
|
|
|
439
439
|
schemaErrorMap: this._def.errorMap,
|
|
440
440
|
parent: null,
|
|
441
441
|
data: e,
|
|
442
|
-
parsedType:
|
|
442
|
+
parsedType: q(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, s) {
|
|
447
447
|
const n = await this.safeParseAsync(e, s);
|
|
@@ -460,9 +460,9 @@ class _ {
|
|
|
460
460
|
schemaErrorMap: this._def.errorMap,
|
|
461
461
|
parent: null,
|
|
462
462
|
data: e,
|
|
463
|
-
parsedType:
|
|
463
|
+
parsedType: q(e)
|
|
464
464
|
}, r = this._parse({ data: e, path: n.path, parent: n }), a = await (ne(r) ? r : Promise.resolve(r));
|
|
465
|
-
return
|
|
465
|
+
return je(n, a);
|
|
466
466
|
}
|
|
467
467
|
refine(e, s) {
|
|
468
468
|
const n = (r) => typeof s == "string" || typeof s > "u" ? { message: s } : typeof s == "function" ? s(r) : s;
|
|
@@ -478,7 +478,7 @@ class _ {
|
|
|
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: m.ZodEffects,
|
|
484
484
|
effect: { type: "refinement", refinement: e }
|
|
@@ -491,7 +491,7 @@ class _ {
|
|
|
491
491
|
return I.create(this, this._def);
|
|
492
492
|
}
|
|
493
493
|
nullable() {
|
|
494
|
-
return
|
|
494
|
+
return V.create(this, this._def);
|
|
495
495
|
}
|
|
496
496
|
nullish() {
|
|
497
497
|
return this.nullable().optional();
|
|
@@ -509,7 +509,7 @@ class _ {
|
|
|
509
509
|
return ce.create(this, e, this._def);
|
|
510
510
|
}
|
|
511
511
|
transform(e) {
|
|
512
|
-
return new
|
|
512
|
+
return new N({
|
|
513
513
|
...v(this._def),
|
|
514
514
|
schema: this,
|
|
515
515
|
typeName: m.ZodEffects,
|
|
@@ -526,7 +526,7 @@ class _ {
|
|
|
526
526
|
});
|
|
527
527
|
}
|
|
528
528
|
brand() {
|
|
529
|
-
return new
|
|
529
|
+
return new Oe({
|
|
530
530
|
typeName: m.ZodBranded,
|
|
531
531
|
type: this,
|
|
532
532
|
...v(this._def)
|
|
@@ -727,7 +727,7 @@ class C extends _ {
|
|
|
727
727
|
return this.refinement((r) => e.test(r), {
|
|
728
728
|
validation: s,
|
|
729
729
|
code: c.invalid_string,
|
|
730
|
-
...
|
|
730
|
+
...p.errToObj(n)
|
|
731
731
|
});
|
|
732
732
|
}
|
|
733
733
|
_addCheck(e) {
|
|
@@ -737,34 +737,34 @@ class C extends _ {
|
|
|
737
737
|
});
|
|
738
738
|
}
|
|
739
739
|
email(e) {
|
|
740
|
-
return this._addCheck({ kind: "email", ...
|
|
740
|
+
return this._addCheck({ kind: "email", ...p.errToObj(e) });
|
|
741
741
|
}
|
|
742
742
|
url(e) {
|
|
743
|
-
return this._addCheck({ kind: "url", ...
|
|
743
|
+
return this._addCheck({ kind: "url", ...p.errToObj(e) });
|
|
744
744
|
}
|
|
745
745
|
emoji(e) {
|
|
746
|
-
return this._addCheck({ kind: "emoji", ...
|
|
746
|
+
return this._addCheck({ kind: "emoji", ...p.errToObj(e) });
|
|
747
747
|
}
|
|
748
748
|
uuid(e) {
|
|
749
|
-
return this._addCheck({ kind: "uuid", ...
|
|
749
|
+
return this._addCheck({ kind: "uuid", ...p.errToObj(e) });
|
|
750
750
|
}
|
|
751
751
|
nanoid(e) {
|
|
752
|
-
return this._addCheck({ kind: "nanoid", ...
|
|
752
|
+
return this._addCheck({ kind: "nanoid", ...p.errToObj(e) });
|
|
753
753
|
}
|
|
754
754
|
cuid(e) {
|
|
755
|
-
return this._addCheck({ kind: "cuid", ...
|
|
755
|
+
return this._addCheck({ kind: "cuid", ...p.errToObj(e) });
|
|
756
756
|
}
|
|
757
757
|
cuid2(e) {
|
|
758
|
-
return this._addCheck({ kind: "cuid2", ...
|
|
758
|
+
return this._addCheck({ kind: "cuid2", ...p.errToObj(e) });
|
|
759
759
|
}
|
|
760
760
|
ulid(e) {
|
|
761
|
-
return this._addCheck({ kind: "ulid", ...
|
|
761
|
+
return this._addCheck({ kind: "ulid", ...p.errToObj(e) });
|
|
762
762
|
}
|
|
763
763
|
base64(e) {
|
|
764
|
-
return this._addCheck({ kind: "base64", ...
|
|
764
|
+
return this._addCheck({ kind: "base64", ...p.errToObj(e) });
|
|
765
765
|
}
|
|
766
766
|
ip(e) {
|
|
767
|
-
return this._addCheck({ kind: "ip", ...
|
|
767
|
+
return this._addCheck({ kind: "ip", ...p.errToObj(e) });
|
|
768
768
|
}
|
|
769
769
|
datetime(e) {
|
|
770
770
|
var s, n;
|
|
@@ -779,7 +779,7 @@ class C extends _ {
|
|
|
779
779
|
precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
|
|
780
780
|
offset: (s = e == null ? void 0 : e.offset) !== null && s !== void 0 ? s : !1,
|
|
781
781
|
local: (n = e == null ? void 0 : e.local) !== null && n !== void 0 ? n : !1,
|
|
782
|
-
...
|
|
782
|
+
...p.errToObj(e == null ? void 0 : e.message)
|
|
783
783
|
});
|
|
784
784
|
}
|
|
785
785
|
date(e) {
|
|
@@ -793,17 +793,17 @@ class C extends _ {
|
|
|
793
793
|
}) : this._addCheck({
|
|
794
794
|
kind: "time",
|
|
795
795
|
precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
|
|
796
|
-
...
|
|
796
|
+
...p.errToObj(e == null ? void 0 : e.message)
|
|
797
797
|
});
|
|
798
798
|
}
|
|
799
799
|
duration(e) {
|
|
800
|
-
return this._addCheck({ kind: "duration", ...
|
|
800
|
+
return this._addCheck({ kind: "duration", ...p.errToObj(e) });
|
|
801
801
|
}
|
|
802
802
|
regex(e, s) {
|
|
803
803
|
return this._addCheck({
|
|
804
804
|
kind: "regex",
|
|
805
805
|
regex: e,
|
|
806
|
-
...
|
|
806
|
+
...p.errToObj(s)
|
|
807
807
|
});
|
|
808
808
|
}
|
|
809
809
|
includes(e, s) {
|
|
@@ -811,42 +811,42 @@ class C extends _ {
|
|
|
811
811
|
kind: "includes",
|
|
812
812
|
value: e,
|
|
813
813
|
position: s == null ? void 0 : s.position,
|
|
814
|
-
...
|
|
814
|
+
...p.errToObj(s == null ? void 0 : s.message)
|
|
815
815
|
});
|
|
816
816
|
}
|
|
817
817
|
startsWith(e, s) {
|
|
818
818
|
return this._addCheck({
|
|
819
819
|
kind: "startsWith",
|
|
820
820
|
value: e,
|
|
821
|
-
...
|
|
821
|
+
...p.errToObj(s)
|
|
822
822
|
});
|
|
823
823
|
}
|
|
824
824
|
endsWith(e, s) {
|
|
825
825
|
return this._addCheck({
|
|
826
826
|
kind: "endsWith",
|
|
827
827
|
value: e,
|
|
828
|
-
...
|
|
828
|
+
...p.errToObj(s)
|
|
829
829
|
});
|
|
830
830
|
}
|
|
831
831
|
min(e, s) {
|
|
832
832
|
return this._addCheck({
|
|
833
833
|
kind: "min",
|
|
834
834
|
value: e,
|
|
835
|
-
...
|
|
835
|
+
...p.errToObj(s)
|
|
836
836
|
});
|
|
837
837
|
}
|
|
838
838
|
max(e, s) {
|
|
839
839
|
return this._addCheck({
|
|
840
840
|
kind: "max",
|
|
841
841
|
value: e,
|
|
842
|
-
...
|
|
842
|
+
...p.errToObj(s)
|
|
843
843
|
});
|
|
844
844
|
}
|
|
845
845
|
length(e, s) {
|
|
846
846
|
return this._addCheck({
|
|
847
847
|
kind: "length",
|
|
848
848
|
value: e,
|
|
849
|
-
...
|
|
849
|
+
...p.errToObj(s)
|
|
850
850
|
});
|
|
851
851
|
}
|
|
852
852
|
/**
|
|
@@ -854,7 +854,7 @@ class C extends _ {
|
|
|
854
854
|
* @see {@link ZodString.min}
|
|
855
855
|
*/
|
|
856
856
|
nonempty(e) {
|
|
857
|
-
return this.min(1,
|
|
857
|
+
return this.min(1, p.errToObj(e));
|
|
858
858
|
}
|
|
859
859
|
trim() {
|
|
860
860
|
return new C({
|
|
@@ -942,7 +942,7 @@ function xt(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
|
|
945
|
+
class $ extends _ {
|
|
946
946
|
constructor() {
|
|
947
947
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
948
948
|
}
|
|
@@ -988,19 +988,19 @@ class q extends _ {
|
|
|
988
988
|
return { status: r.value, value: e.data };
|
|
989
989
|
}
|
|
990
990
|
gte(e, s) {
|
|
991
|
-
return this.setLimit("min", e, !0,
|
|
991
|
+
return this.setLimit("min", e, !0, p.toString(s));
|
|
992
992
|
}
|
|
993
993
|
gt(e, s) {
|
|
994
|
-
return this.setLimit("min", e, !1,
|
|
994
|
+
return this.setLimit("min", e, !1, p.toString(s));
|
|
995
995
|
}
|
|
996
996
|
lte(e, s) {
|
|
997
|
-
return this.setLimit("max", e, !0,
|
|
997
|
+
return this.setLimit("max", e, !0, p.toString(s));
|
|
998
998
|
}
|
|
999
999
|
lt(e, s) {
|
|
1000
|
-
return this.setLimit("max", e, !1,
|
|
1000
|
+
return this.setLimit("max", e, !1, p.toString(s));
|
|
1001
1001
|
}
|
|
1002
1002
|
setLimit(e, s, n, r) {
|
|
1003
|
-
return new
|
|
1003
|
+
return new $({
|
|
1004
1004
|
...this._def,
|
|
1005
1005
|
checks: [
|
|
1006
1006
|
...this._def.checks,
|
|
@@ -1008,13 +1008,13 @@ class q extends _ {
|
|
|
1008
1008
|
kind: e,
|
|
1009
1009
|
value: s,
|
|
1010
1010
|
inclusive: n,
|
|
1011
|
-
message:
|
|
1011
|
+
message: p.toString(r)
|
|
1012
1012
|
}
|
|
1013
1013
|
]
|
|
1014
1014
|
});
|
|
1015
1015
|
}
|
|
1016
1016
|
_addCheck(e) {
|
|
1017
|
-
return new
|
|
1017
|
+
return new $({
|
|
1018
1018
|
...this._def,
|
|
1019
1019
|
checks: [...this._def.checks, e]
|
|
1020
1020
|
});
|
|
@@ -1022,7 +1022,7 @@ class q extends _ {
|
|
|
1022
1022
|
int(e) {
|
|
1023
1023
|
return this._addCheck({
|
|
1024
1024
|
kind: "int",
|
|
1025
|
-
message:
|
|
1025
|
+
message: p.toString(e)
|
|
1026
1026
|
});
|
|
1027
1027
|
}
|
|
1028
1028
|
positive(e) {
|
|
@@ -1030,7 +1030,7 @@ class q extends _ {
|
|
|
1030
1030
|
kind: "min",
|
|
1031
1031
|
value: 0,
|
|
1032
1032
|
inclusive: !1,
|
|
1033
|
-
message:
|
|
1033
|
+
message: p.toString(e)
|
|
1034
1034
|
});
|
|
1035
1035
|
}
|
|
1036
1036
|
negative(e) {
|
|
@@ -1038,7 +1038,7 @@ class q extends _ {
|
|
|
1038
1038
|
kind: "max",
|
|
1039
1039
|
value: 0,
|
|
1040
1040
|
inclusive: !1,
|
|
1041
|
-
message:
|
|
1041
|
+
message: p.toString(e)
|
|
1042
1042
|
});
|
|
1043
1043
|
}
|
|
1044
1044
|
nonpositive(e) {
|
|
@@ -1046,7 +1046,7 @@ class q extends _ {
|
|
|
1046
1046
|
kind: "max",
|
|
1047
1047
|
value: 0,
|
|
1048
1048
|
inclusive: !0,
|
|
1049
|
-
message:
|
|
1049
|
+
message: p.toString(e)
|
|
1050
1050
|
});
|
|
1051
1051
|
}
|
|
1052
1052
|
nonnegative(e) {
|
|
@@ -1054,20 +1054,20 @@ class q extends _ {
|
|
|
1054
1054
|
kind: "min",
|
|
1055
1055
|
value: 0,
|
|
1056
1056
|
inclusive: !0,
|
|
1057
|
-
message:
|
|
1057
|
+
message: p.toString(e)
|
|
1058
1058
|
});
|
|
1059
1059
|
}
|
|
1060
1060
|
multipleOf(e, s) {
|
|
1061
1061
|
return this._addCheck({
|
|
1062
1062
|
kind: "multipleOf",
|
|
1063
1063
|
value: e,
|
|
1064
|
-
message:
|
|
1064
|
+
message: p.toString(s)
|
|
1065
1065
|
});
|
|
1066
1066
|
}
|
|
1067
1067
|
finite(e) {
|
|
1068
1068
|
return this._addCheck({
|
|
1069
1069
|
kind: "finite",
|
|
1070
|
-
message:
|
|
1070
|
+
message: p.toString(e)
|
|
1071
1071
|
});
|
|
1072
1072
|
}
|
|
1073
1073
|
safe(e) {
|
|
@@ -1075,12 +1075,12 @@ class q extends _ {
|
|
|
1075
1075
|
kind: "min",
|
|
1076
1076
|
inclusive: !0,
|
|
1077
1077
|
value: Number.MIN_SAFE_INTEGER,
|
|
1078
|
-
message:
|
|
1078
|
+
message: p.toString(e)
|
|
1079
1079
|
})._addCheck({
|
|
1080
1080
|
kind: "max",
|
|
1081
1081
|
inclusive: !0,
|
|
1082
1082
|
value: Number.MAX_SAFE_INTEGER,
|
|
1083
|
-
message:
|
|
1083
|
+
message: p.toString(e)
|
|
1084
1084
|
});
|
|
1085
1085
|
}
|
|
1086
1086
|
get minValue() {
|
|
@@ -1108,13 +1108,13 @@ class q extends _ {
|
|
|
1108
1108
|
return Number.isFinite(s) && Number.isFinite(e);
|
|
1109
1109
|
}
|
|
1110
1110
|
}
|
|
1111
|
-
|
|
1111
|
+
$.create = (t) => new $({
|
|
1112
1112
|
checks: [],
|
|
1113
1113
|
typeName: m.ZodNumber,
|
|
1114
1114
|
coerce: (t == null ? void 0 : t.coerce) || !1,
|
|
1115
1115
|
...v(t)
|
|
1116
1116
|
});
|
|
1117
|
-
class
|
|
1117
|
+
class U extends _ {
|
|
1118
1118
|
constructor() {
|
|
1119
1119
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1120
1120
|
}
|
|
@@ -1150,19 +1150,19 @@ class $ extends _ {
|
|
|
1150
1150
|
return { status: r.value, value: e.data };
|
|
1151
1151
|
}
|
|
1152
1152
|
gte(e, s) {
|
|
1153
|
-
return this.setLimit("min", e, !0,
|
|
1153
|
+
return this.setLimit("min", e, !0, p.toString(s));
|
|
1154
1154
|
}
|
|
1155
1155
|
gt(e, s) {
|
|
1156
|
-
return this.setLimit("min", e, !1,
|
|
1156
|
+
return this.setLimit("min", e, !1, p.toString(s));
|
|
1157
1157
|
}
|
|
1158
1158
|
lte(e, s) {
|
|
1159
|
-
return this.setLimit("max", e, !0,
|
|
1159
|
+
return this.setLimit("max", e, !0, p.toString(s));
|
|
1160
1160
|
}
|
|
1161
1161
|
lt(e, s) {
|
|
1162
|
-
return this.setLimit("max", e, !1,
|
|
1162
|
+
return this.setLimit("max", e, !1, p.toString(s));
|
|
1163
1163
|
}
|
|
1164
1164
|
setLimit(e, s, n, r) {
|
|
1165
|
-
return new
|
|
1165
|
+
return new U({
|
|
1166
1166
|
...this._def,
|
|
1167
1167
|
checks: [
|
|
1168
1168
|
...this._def.checks,
|
|
@@ -1170,13 +1170,13 @@ class $ extends _ {
|
|
|
1170
1170
|
kind: e,
|
|
1171
1171
|
value: s,
|
|
1172
1172
|
inclusive: n,
|
|
1173
|
-
message:
|
|
1173
|
+
message: p.toString(r)
|
|
1174
1174
|
}
|
|
1175
1175
|
]
|
|
1176
1176
|
});
|
|
1177
1177
|
}
|
|
1178
1178
|
_addCheck(e) {
|
|
1179
|
-
return new
|
|
1179
|
+
return new U({
|
|
1180
1180
|
...this._def,
|
|
1181
1181
|
checks: [...this._def.checks, e]
|
|
1182
1182
|
});
|
|
@@ -1186,7 +1186,7 @@ class $ extends _ {
|
|
|
1186
1186
|
kind: "min",
|
|
1187
1187
|
value: BigInt(0),
|
|
1188
1188
|
inclusive: !1,
|
|
1189
|
-
message:
|
|
1189
|
+
message: p.toString(e)
|
|
1190
1190
|
});
|
|
1191
1191
|
}
|
|
1192
1192
|
negative(e) {
|
|
@@ -1194,7 +1194,7 @@ class $ extends _ {
|
|
|
1194
1194
|
kind: "max",
|
|
1195
1195
|
value: BigInt(0),
|
|
1196
1196
|
inclusive: !1,
|
|
1197
|
-
message:
|
|
1197
|
+
message: p.toString(e)
|
|
1198
1198
|
});
|
|
1199
1199
|
}
|
|
1200
1200
|
nonpositive(e) {
|
|
@@ -1202,7 +1202,7 @@ class $ extends _ {
|
|
|
1202
1202
|
kind: "max",
|
|
1203
1203
|
value: BigInt(0),
|
|
1204
1204
|
inclusive: !0,
|
|
1205
|
-
message:
|
|
1205
|
+
message: p.toString(e)
|
|
1206
1206
|
});
|
|
1207
1207
|
}
|
|
1208
1208
|
nonnegative(e) {
|
|
@@ -1210,14 +1210,14 @@ class $ extends _ {
|
|
|
1210
1210
|
kind: "min",
|
|
1211
1211
|
value: BigInt(0),
|
|
1212
1212
|
inclusive: !0,
|
|
1213
|
-
message:
|
|
1213
|
+
message: p.toString(e)
|
|
1214
1214
|
});
|
|
1215
1215
|
}
|
|
1216
1216
|
multipleOf(e, s) {
|
|
1217
1217
|
return this._addCheck({
|
|
1218
1218
|
kind: "multipleOf",
|
|
1219
1219
|
value: e,
|
|
1220
|
-
message:
|
|
1220
|
+
message: p.toString(s)
|
|
1221
1221
|
});
|
|
1222
1222
|
}
|
|
1223
1223
|
get minValue() {
|
|
@@ -1233,9 +1233,9 @@ class $ extends _ {
|
|
|
1233
1233
|
return e;
|
|
1234
1234
|
}
|
|
1235
1235
|
}
|
|
1236
|
-
|
|
1236
|
+
U.create = (t) => {
|
|
1237
1237
|
var e;
|
|
1238
|
-
return new
|
|
1238
|
+
return new U({
|
|
1239
1239
|
checks: [],
|
|
1240
1240
|
typeName: m.ZodBigInt,
|
|
1241
1241
|
coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1,
|
|
@@ -1309,14 +1309,14 @@ class z extends _ {
|
|
|
1309
1309
|
return this._addCheck({
|
|
1310
1310
|
kind: "min",
|
|
1311
1311
|
value: e.getTime(),
|
|
1312
|
-
message:
|
|
1312
|
+
message: p.toString(s)
|
|
1313
1313
|
});
|
|
1314
1314
|
}
|
|
1315
1315
|
max(e, s) {
|
|
1316
1316
|
return this._addCheck({
|
|
1317
1317
|
kind: "max",
|
|
1318
1318
|
value: e.getTime(),
|
|
1319
|
-
message:
|
|
1319
|
+
message: p.toString(s)
|
|
1320
1320
|
});
|
|
1321
1321
|
}
|
|
1322
1322
|
get minDate() {
|
|
@@ -1338,7 +1338,7 @@ z.create = (t) => new z({
|
|
|
1338
1338
|
typeName: m.ZodDate,
|
|
1339
1339
|
...v(t)
|
|
1340
1340
|
});
|
|
1341
|
-
class
|
|
1341
|
+
class we extends _ {
|
|
1342
1342
|
_parse(e) {
|
|
1343
1343
|
if (this._getType(e) !== f.symbol) {
|
|
1344
1344
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1351,7 +1351,7 @@ class ke extends _ {
|
|
|
1351
1351
|
return T(e.data);
|
|
1352
1352
|
}
|
|
1353
1353
|
}
|
|
1354
|
-
|
|
1354
|
+
we.create = (t) => new we({
|
|
1355
1355
|
typeName: m.ZodSymbol,
|
|
1356
1356
|
...v(t)
|
|
1357
1357
|
});
|
|
@@ -1413,7 +1413,7 @@ B.create = (t) => new B({
|
|
|
1413
1413
|
typeName: m.ZodUnknown,
|
|
1414
1414
|
...v(t)
|
|
1415
1415
|
});
|
|
1416
|
-
class
|
|
1416
|
+
class P extends _ {
|
|
1417
1417
|
_parse(e) {
|
|
1418
1418
|
const s = this._getOrReturnCtx(e);
|
|
1419
1419
|
return l(s, {
|
|
@@ -1423,11 +1423,11 @@ class A extends _ {
|
|
|
1423
1423
|
}), y;
|
|
1424
1424
|
}
|
|
1425
1425
|
}
|
|
1426
|
-
|
|
1426
|
+
P.create = (t) => new P({
|
|
1427
1427
|
typeName: m.ZodNever,
|
|
1428
1428
|
...v(t)
|
|
1429
1429
|
});
|
|
1430
|
-
class
|
|
1430
|
+
class ke extends _ {
|
|
1431
1431
|
_parse(e) {
|
|
1432
1432
|
if (this._getType(e) !== f.undefined) {
|
|
1433
1433
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1440,7 +1440,7 @@ class we extends _ {
|
|
|
1440
1440
|
return T(e.data);
|
|
1441
1441
|
}
|
|
1442
1442
|
}
|
|
1443
|
-
|
|
1443
|
+
ke.create = (t) => new ke({
|
|
1444
1444
|
typeName: m.ZodVoid,
|
|
1445
1445
|
...v(t)
|
|
1446
1446
|
});
|
|
@@ -1480,8 +1480,8 @@ class Z extends _ {
|
|
|
1480
1480
|
exact: !1,
|
|
1481
1481
|
message: r.maxLength.message
|
|
1482
1482
|
}), n.dirty()), s.common.async)
|
|
1483
|
-
return Promise.all([...s.data].map((i, o) => r.type._parseAsync(new
|
|
1484
|
-
const a = [...s.data].map((i, o) => r.type._parseSync(new
|
|
1483
|
+
return Promise.all([...s.data].map((i, o) => r.type._parseAsync(new O(s, i, s.path, o)))).then((i) => S.mergeArray(n, i));
|
|
1484
|
+
const a = [...s.data].map((i, o) => r.type._parseSync(new O(s, i, s.path, o)));
|
|
1485
1485
|
return S.mergeArray(n, a);
|
|
1486
1486
|
}
|
|
1487
1487
|
get element() {
|
|
@@ -1490,19 +1490,19 @@ class Z extends _ {
|
|
|
1490
1490
|
min(e, s) {
|
|
1491
1491
|
return new Z({
|
|
1492
1492
|
...this._def,
|
|
1493
|
-
minLength: { value: e, message:
|
|
1493
|
+
minLength: { value: e, message: p.toString(s) }
|
|
1494
1494
|
});
|
|
1495
1495
|
}
|
|
1496
1496
|
max(e, s) {
|
|
1497
1497
|
return new Z({
|
|
1498
1498
|
...this._def,
|
|
1499
|
-
maxLength: { value: e, message:
|
|
1499
|
+
maxLength: { value: e, message: p.toString(s) }
|
|
1500
1500
|
});
|
|
1501
1501
|
}
|
|
1502
1502
|
length(e, s) {
|
|
1503
1503
|
return new Z({
|
|
1504
1504
|
...this._def,
|
|
1505
|
-
exactLength: { value: e, message:
|
|
1505
|
+
exactLength: { value: e, message: p.toString(s) }
|
|
1506
1506
|
});
|
|
1507
1507
|
}
|
|
1508
1508
|
nonempty(e) {
|
|
@@ -1532,7 +1532,7 @@ function Q(t) {
|
|
|
1532
1532
|
return t instanceof Z ? new Z({
|
|
1533
1533
|
...t._def,
|
|
1534
1534
|
type: Q(t.element)
|
|
1535
|
-
}) : t instanceof I ? I.create(Q(t.unwrap())) : t instanceof
|
|
1535
|
+
}) : t instanceof I ? I.create(Q(t.unwrap())) : t instanceof V ? V.create(Q(t.unwrap())) : t instanceof A ? A.create(t.items.map((e) => Q(e))) : t;
|
|
1536
1536
|
}
|
|
1537
1537
|
class b extends _ {
|
|
1538
1538
|
constructor() {
|
|
@@ -1554,7 +1554,7 @@ class b extends _ {
|
|
|
1554
1554
|
}), y;
|
|
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 P && this._def.unknownKeys === "strip"))
|
|
1558
1558
|
for (const u in r.data)
|
|
1559
1559
|
i.includes(u) || o.push(u);
|
|
1560
1560
|
const d = [];
|
|
@@ -1562,11 +1562,11 @@ class b extends _ {
|
|
|
1562
1562
|
const g = a[u], R = r.data[u];
|
|
1563
1563
|
d.push({
|
|
1564
1564
|
key: { status: "valid", value: u },
|
|
1565
|
-
value: g._parse(new
|
|
1565
|
+
value: g._parse(new O(r, R, r.path, u)),
|
|
1566
1566
|
alwaysSet: u in r.data
|
|
1567
1567
|
});
|
|
1568
1568
|
}
|
|
1569
|
-
if (this._def.catchall instanceof
|
|
1569
|
+
if (this._def.catchall instanceof P) {
|
|
1570
1570
|
const u = this._def.unknownKeys;
|
|
1571
1571
|
if (u === "passthrough")
|
|
1572
1572
|
for (const g of o)
|
|
@@ -1588,7 +1588,7 @@ class b extends _ {
|
|
|
1588
1588
|
d.push({
|
|
1589
1589
|
key: { status: "valid", value: g },
|
|
1590
1590
|
value: u._parse(
|
|
1591
|
-
new
|
|
1591
|
+
new O(r, R, r.path, g)
|
|
1592
1592
|
//, ctx.child(key), value, getParsedType(value)
|
|
1593
1593
|
),
|
|
1594
1594
|
alwaysSet: g in r.data
|
|
@@ -1612,7 +1612,7 @@ class b extends _ {
|
|
|
1612
1612
|
return this._def.shape();
|
|
1613
1613
|
}
|
|
1614
1614
|
strict(e) {
|
|
1615
|
-
return
|
|
1615
|
+
return p.errToObj, new b({
|
|
1616
1616
|
...this._def,
|
|
1617
1617
|
unknownKeys: "strict",
|
|
1618
1618
|
...e !== void 0 ? {
|
|
@@ -1620,7 +1620,7 @@ class b extends _ {
|
|
|
1620
1620
|
var r, a, i, o;
|
|
1621
1621
|
const d = (i = (a = (r = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(r, s, n).message) !== null && i !== void 0 ? i : n.defaultError;
|
|
1622
1622
|
return s.code === "unrecognized_keys" ? {
|
|
1623
|
-
message: (o =
|
|
1623
|
+
message: (o = p.errToObj(e).message) !== null && o !== void 0 ? o : d
|
|
1624
1624
|
} : {
|
|
1625
1625
|
message: d
|
|
1626
1626
|
};
|
|
@@ -1804,21 +1804,21 @@ class b extends _ {
|
|
|
1804
1804
|
b.create = (t, e) => new b({
|
|
1805
1805
|
shape: () => t,
|
|
1806
1806
|
unknownKeys: "strip",
|
|
1807
|
-
catchall:
|
|
1807
|
+
catchall: P.create(),
|
|
1808
1808
|
typeName: m.ZodObject,
|
|
1809
1809
|
...v(e)
|
|
1810
1810
|
});
|
|
1811
1811
|
b.strictCreate = (t, e) => new b({
|
|
1812
1812
|
shape: () => t,
|
|
1813
1813
|
unknownKeys: "strict",
|
|
1814
|
-
catchall:
|
|
1814
|
+
catchall: P.create(),
|
|
1815
1815
|
typeName: m.ZodObject,
|
|
1816
1816
|
...v(e)
|
|
1817
1817
|
});
|
|
1818
1818
|
b.lazycreate = (t, e) => new b({
|
|
1819
1819
|
shape: t,
|
|
1820
1820
|
unknownKeys: "strip",
|
|
1821
|
-
catchall:
|
|
1821
|
+
catchall: P.create(),
|
|
1822
1822
|
typeName: m.ZodObject,
|
|
1823
1823
|
...v(e)
|
|
1824
1824
|
});
|
|
@@ -1895,7 +1895,7 @@ oe.create = (t, e) => new oe({
|
|
|
1895
1895
|
typeName: m.ZodUnion,
|
|
1896
1896
|
...v(e)
|
|
1897
1897
|
});
|
|
1898
|
-
const j = (t) => t instanceof ue ? j(t.schema) : t instanceof
|
|
1898
|
+
const j = (t) => t instanceof ue ? j(t.schema) : t instanceof N ? j(t.innerType()) : t instanceof le ? [t.value] : t instanceof L ? t.options : t instanceof fe ? x.objectValues(t.enum) : t instanceof he ? j(t._def.innerType) : t instanceof ae ? [void 0] : t instanceof ie ? [null] : t instanceof I ? [void 0, ...j(t.unwrap())] : t instanceof V ? [null, ...j(t.unwrap())] : t instanceof Oe || t instanceof me ? j(t.unwrap()) : t instanceof pe ? j(t._def.innerType) : [];
|
|
1899
1899
|
class Re extends _ {
|
|
1900
1900
|
_parse(e) {
|
|
1901
1901
|
const { ctx: s } = this._processInputParams(e);
|
|
@@ -1958,14 +1958,14 @@ class Re extends _ {
|
|
|
1958
1958
|
});
|
|
1959
1959
|
}
|
|
1960
1960
|
}
|
|
1961
|
-
function
|
|
1962
|
-
const s =
|
|
1961
|
+
function Ie(t, e) {
|
|
1962
|
+
const s = q(t), n = q(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 d =
|
|
1968
|
+
const d = Ie(t[o], e[o]);
|
|
1969
1969
|
if (!d.valid)
|
|
1970
1970
|
return { valid: !1 };
|
|
1971
1971
|
i[o] = d.data;
|
|
@@ -1976,7 +1976,7 @@ function Me(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], d =
|
|
1979
|
+
const i = t[a], o = e[a], d = Ie(i, o);
|
|
1980
1980
|
if (!d.valid)
|
|
1981
1981
|
return { valid: !1 };
|
|
1982
1982
|
r.push(d.data);
|
|
@@ -1988,10 +1988,10 @@ function Me(t, e) {
|
|
|
1988
1988
|
class ce extends _ {
|
|
1989
1989
|
_parse(e) {
|
|
1990
1990
|
const { status: s, ctx: n } = this._processInputParams(e), r = (a, i) => {
|
|
1991
|
-
if (
|
|
1991
|
+
if (Ne(a) || Ne(i))
|
|
1992
1992
|
return y;
|
|
1993
|
-
const o =
|
|
1994
|
-
return o.valid ? ((
|
|
1993
|
+
const o = Ie(a.value, i.value);
|
|
1994
|
+
return o.valid ? ((Me(a) || Me(i)) && s.dirty(), { status: s.value, value: o.data }) : (l(n, {
|
|
1995
1995
|
code: c.invalid_intersection_types
|
|
1996
1996
|
}), y);
|
|
1997
1997
|
};
|
|
@@ -2023,7 +2023,7 @@ ce.create = (t, e, s) => new ce({
|
|
|
2023
2023
|
typeName: m.ZodIntersection,
|
|
2024
2024
|
...v(s)
|
|
2025
2025
|
});
|
|
2026
|
-
class
|
|
2026
|
+
class A extends _ {
|
|
2027
2027
|
_parse(e) {
|
|
2028
2028
|
const { status: s, ctx: n } = this._processInputParams(e);
|
|
2029
2029
|
if (n.parsedType !== f.array)
|
|
@@ -2049,7 +2049,7 @@ class N extends _ {
|
|
|
2049
2049
|
}), s.dirty());
|
|
2050
2050
|
const a = [...n.data].map((i, o) => {
|
|
2051
2051
|
const d = this._def.items[o] || this._def.rest;
|
|
2052
|
-
return d ? d._parse(new
|
|
2052
|
+
return d ? d._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) => S.mergeArray(s, i)) : S.mergeArray(s, a);
|
|
2055
2055
|
}
|
|
@@ -2057,16 +2057,16 @@ class N extends _ {
|
|
|
2057
2057
|
return this._def.items;
|
|
2058
2058
|
}
|
|
2059
2059
|
rest(e) {
|
|
2060
|
-
return new
|
|
2060
|
+
return new A({
|
|
2061
2061
|
...this._def,
|
|
2062
2062
|
rest: e
|
|
2063
2063
|
});
|
|
2064
2064
|
}
|
|
2065
2065
|
}
|
|
2066
|
-
|
|
2066
|
+
A.create = (t, e) => {
|
|
2067
2067
|
if (!Array.isArray(t))
|
|
2068
2068
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2069
|
-
return new
|
|
2069
|
+
return new A({
|
|
2070
2070
|
items: t,
|
|
2071
2071
|
typeName: m.ZodTuple,
|
|
2072
2072
|
rest: null,
|
|
@@ -2091,8 +2091,8 @@ class de extends _ {
|
|
|
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 ? S.mergeObjectAsync(s, r) : S.mergeObjectSync(s, r);
|
|
@@ -2130,8 +2130,8 @@ class Se extends _ {
|
|
|
2130
2130
|
received: n.parsedType
|
|
2131
2131
|
}), y;
|
|
2132
2132
|
const r = this._def.keyType, a = this._def.valueType, i = [...n.data.entries()].map(([o, d], u) => ({
|
|
2133
|
-
key: r._parse(new
|
|
2134
|
-
value: a._parse(new
|
|
2133
|
+
key: r._parse(new O(n, o, n.path, [u, "key"])),
|
|
2134
|
+
value: a._parse(new O(n, d, n.path, [u, "value"]))
|
|
2135
2135
|
}));
|
|
2136
2136
|
if (n.common.async) {
|
|
2137
2137
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -2197,19 +2197,19 @@ class G extends _ {
|
|
|
2197
2197
|
}
|
|
2198
2198
|
return { status: s.value, value: u };
|
|
2199
2199
|
}
|
|
2200
|
-
const o = [...n.data.values()].map((d, u) => a._parse(new
|
|
2200
|
+
const o = [...n.data.values()].map((d, u) => a._parse(new O(n, d, n.path, u)));
|
|
2201
2201
|
return n.common.async ? Promise.all(o).then((d) => i(d)) : i(o);
|
|
2202
2202
|
}
|
|
2203
2203
|
min(e, s) {
|
|
2204
2204
|
return new G({
|
|
2205
2205
|
...this._def,
|
|
2206
|
-
minSize: { value: e, message:
|
|
2206
|
+
minSize: { value: e, message: p.toString(s) }
|
|
2207
2207
|
});
|
|
2208
2208
|
}
|
|
2209
2209
|
max(e, s) {
|
|
2210
2210
|
return new G({
|
|
2211
2211
|
...this._def,
|
|
2212
|
-
maxSize: { value: e, message:
|
|
2212
|
+
maxSize: { value: e, message: p.toString(s) }
|
|
2213
2213
|
});
|
|
2214
2214
|
}
|
|
2215
2215
|
size(e, s) {
|
|
@@ -2303,7 +2303,7 @@ class H extends _ {
|
|
|
2303
2303
|
args(...e) {
|
|
2304
2304
|
return new H({
|
|
2305
2305
|
...this._def,
|
|
2306
|
-
args:
|
|
2306
|
+
args: A.create(e).rest(B.create())
|
|
2307
2307
|
});
|
|
2308
2308
|
}
|
|
2309
2309
|
returns(e) {
|
|
@@ -2320,7 +2320,7 @@ class H extends _ {
|
|
|
2320
2320
|
}
|
|
2321
2321
|
static create(e, s, n) {
|
|
2322
2322
|
return new H({
|
|
2323
|
-
args: e ||
|
|
2323
|
+
args: e || A.create([]).rest(B.create()),
|
|
2324
2324
|
returns: s || B.create(),
|
|
2325
2325
|
typeName: m.ZodFunction,
|
|
2326
2326
|
...v(n)
|
|
@@ -2363,13 +2363,13 @@ le.create = (t, e) => new le({
|
|
|
2363
2363
|
...v(e)
|
|
2364
2364
|
});
|
|
2365
2365
|
function Be(t, e) {
|
|
2366
|
-
return new
|
|
2366
|
+
return new L({
|
|
2367
2367
|
values: t,
|
|
2368
2368
|
typeName: m.ZodEnum,
|
|
2369
2369
|
...v(e)
|
|
2370
2370
|
});
|
|
2371
2371
|
}
|
|
2372
|
-
class
|
|
2372
|
+
class L extends _ {
|
|
2373
2373
|
constructor() {
|
|
2374
2374
|
super(...arguments), F.set(this, void 0);
|
|
2375
2375
|
}
|
|
@@ -2414,20 +2414,20 @@ class U extends _ {
|
|
|
2414
2414
|
return e;
|
|
2415
2415
|
}
|
|
2416
2416
|
extract(e, s = this._def) {
|
|
2417
|
-
return
|
|
2417
|
+
return L.create(e, {
|
|
2418
2418
|
...this._def,
|
|
2419
2419
|
...s
|
|
2420
2420
|
});
|
|
2421
2421
|
}
|
|
2422
2422
|
exclude(e, s = this._def) {
|
|
2423
|
-
return
|
|
2423
|
+
return L.create(this.options.filter((n) => !e.includes(n)), {
|
|
2424
2424
|
...this._def,
|
|
2425
2425
|
...s
|
|
2426
2426
|
});
|
|
2427
2427
|
}
|
|
2428
2428
|
}
|
|
2429
2429
|
F = /* @__PURE__ */ new WeakMap();
|
|
2430
|
-
|
|
2430
|
+
L.create = Be;
|
|
2431
2431
|
class fe extends _ {
|
|
2432
2432
|
constructor() {
|
|
2433
2433
|
super(...arguments), ee.set(this, void 0);
|
|
@@ -2486,7 +2486,7 @@ X.create = (t, e) => new X({
|
|
|
2486
2486
|
typeName: m.ZodPromise,
|
|
2487
2487
|
...v(e)
|
|
2488
2488
|
});
|
|
2489
|
-
class
|
|
2489
|
+
class N extends _ {
|
|
2490
2490
|
innerType() {
|
|
2491
2491
|
return this._def.schema;
|
|
2492
2492
|
}
|
|
@@ -2563,13 +2563,13 @@ class O extends _ {
|
|
|
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: m.ZodEffects,
|
|
2569
2569
|
effect: e,
|
|
2570
2570
|
...v(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: m.ZodEffects,
|
|
@@ -2588,7 +2588,7 @@ I.create = (t, e) => new I({
|
|
|
2588
2588
|
typeName: m.ZodOptional,
|
|
2589
2589
|
...v(e)
|
|
2590
2590
|
});
|
|
2591
|
-
class
|
|
2591
|
+
class V extends _ {
|
|
2592
2592
|
_parse(e) {
|
|
2593
2593
|
return this._getType(e) === f.null ? T(null) : this._def.innerType._parse(e);
|
|
2594
2594
|
}
|
|
@@ -2596,7 +2596,7 @@ class L extends _ {
|
|
|
2596
2596
|
return this._def.innerType;
|
|
2597
2597
|
}
|
|
2598
2598
|
}
|
|
2599
|
-
|
|
2599
|
+
V.create = (t, e) => new V({
|
|
2600
2600
|
innerType: t,
|
|
2601
2601
|
typeName: m.ZodNullable,
|
|
2602
2602
|
...v(e)
|
|
@@ -2682,7 +2682,7 @@ Te.create = (t) => new Te({
|
|
|
2682
2682
|
...v(t)
|
|
2683
2683
|
});
|
|
2684
2684
|
const bt = Symbol("zod_brand");
|
|
2685
|
-
class
|
|
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({
|
|
@@ -2758,26 +2758,26 @@ function ze(t, e = {}, s) {
|
|
|
2758
2758
|
}
|
|
2759
2759
|
}) : J.create();
|
|
2760
2760
|
}
|
|
2761
|
-
const
|
|
2761
|
+
const wt = {
|
|
2762
2762
|
object: b.lazycreate
|
|
2763
2763
|
};
|
|
2764
2764
|
var m;
|
|
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
|
})(m || (m = {}));
|
|
2768
|
-
const
|
|
2768
|
+
const kt = (t, e = {
|
|
2769
2769
|
message: `Input not instance of ${t.name}`
|
|
2770
|
-
}) => ze((s) => s instanceof t, e), Ge = C.create, Qe =
|
|
2770
|
+
}) => ze((s) => s instanceof t, e), Ge = C.create, Qe = $.create, St = Te.create, Tt = U.create, We = re.create, Rt = z.create, Et = we.create, Ct = ae.create, Zt = ie.create, Nt = J.create, Mt = B.create, It = P.create, Ot = ke.create, At = Z.create, jt = b.create, Pt = b.strictCreate, qt = oe.create, $t = Re.create, Ut = ce.create, Lt = A.create, Vt = de.create, Dt = Se.create, Bt = G.create, zt = H.create, Gt = ue.create, Qt = le.create, Wt = L.create, Ht = fe.create, Yt = X.create, Pe = N.create, Jt = I.create, Xt = V.create, Kt = N.createWithPreprocess, Ft = ge.create, es = () => Ge().optional(), ts = () => Qe().optional(), ss = () => We().optional(), ns = {
|
|
2771
2771
|
string: (t) => C.create({ ...t, coerce: !0 }),
|
|
2772
|
-
number: (t) =>
|
|
2772
|
+
number: (t) => $.create({ ...t, coerce: !0 }),
|
|
2773
2773
|
boolean: (t) => re.create({
|
|
2774
2774
|
...t,
|
|
2775
2775
|
coerce: !0
|
|
2776
2776
|
}),
|
|
2777
|
-
bigint: (t) =>
|
|
2777
|
+
bigint: (t) => U.create({ ...t, coerce: !0 }),
|
|
2778
2778
|
date: (t) => z.create({ ...t, coerce: !0 })
|
|
2779
2779
|
}, rs = y;
|
|
2780
|
-
var
|
|
2780
|
+
var h = /* @__PURE__ */ Object.freeze({
|
|
2781
2781
|
__proto__: null,
|
|
2782
2782
|
defaultErrorMap: Y,
|
|
2783
2783
|
setErrorMap: rt,
|
|
@@ -2789,8 +2789,8 @@ var p = /* @__PURE__ */ Object.freeze({
|
|
|
2789
2789
|
INVALID: y,
|
|
2790
2790
|
DIRTY: W,
|
|
2791
2791
|
OK: T,
|
|
2792
|
-
isAborted:
|
|
2793
|
-
isDirty:
|
|
2792
|
+
isAborted: Ne,
|
|
2793
|
+
isDirty: Me,
|
|
2794
2794
|
isValid: se,
|
|
2795
2795
|
isAsync: ne,
|
|
2796
2796
|
get util() {
|
|
@@ -2800,57 +2800,57 @@ var p = /* @__PURE__ */ Object.freeze({
|
|
|
2800
2800
|
return Ze;
|
|
2801
2801
|
},
|
|
2802
2802
|
ZodParsedType: f,
|
|
2803
|
-
getParsedType:
|
|
2803
|
+
getParsedType: q,
|
|
2804
2804
|
ZodType: _,
|
|
2805
2805
|
datetimeRegex: De,
|
|
2806
2806
|
ZodString: C,
|
|
2807
|
-
ZodNumber:
|
|
2808
|
-
ZodBigInt:
|
|
2807
|
+
ZodNumber: $,
|
|
2808
|
+
ZodBigInt: U,
|
|
2809
2809
|
ZodBoolean: re,
|
|
2810
2810
|
ZodDate: z,
|
|
2811
|
-
ZodSymbol:
|
|
2811
|
+
ZodSymbol: we,
|
|
2812
2812
|
ZodUndefined: ae,
|
|
2813
2813
|
ZodNull: ie,
|
|
2814
2814
|
ZodAny: J,
|
|
2815
2815
|
ZodUnknown: B,
|
|
2816
|
-
ZodNever:
|
|
2817
|
-
ZodVoid:
|
|
2816
|
+
ZodNever: P,
|
|
2817
|
+
ZodVoid: ke,
|
|
2818
2818
|
ZodArray: Z,
|
|
2819
2819
|
ZodObject: b,
|
|
2820
2820
|
ZodUnion: oe,
|
|
2821
2821
|
ZodDiscriminatedUnion: Re,
|
|
2822
2822
|
ZodIntersection: ce,
|
|
2823
|
-
ZodTuple:
|
|
2823
|
+
ZodTuple: A,
|
|
2824
2824
|
ZodRecord: de,
|
|
2825
2825
|
ZodMap: Se,
|
|
2826
2826
|
ZodSet: G,
|
|
2827
2827
|
ZodFunction: H,
|
|
2828
2828
|
ZodLazy: ue,
|
|
2829
2829
|
ZodLiteral: le,
|
|
2830
|
-
ZodEnum:
|
|
2830
|
+
ZodEnum: L,
|
|
2831
2831
|
ZodNativeEnum: fe,
|
|
2832
2832
|
ZodPromise: X,
|
|
2833
|
-
ZodEffects:
|
|
2834
|
-
ZodTransformer:
|
|
2833
|
+
ZodEffects: N,
|
|
2834
|
+
ZodTransformer: N,
|
|
2835
2835
|
ZodOptional: I,
|
|
2836
|
-
ZodNullable:
|
|
2836
|
+
ZodNullable: V,
|
|
2837
2837
|
ZodDefault: he,
|
|
2838
2838
|
ZodCatch: pe,
|
|
2839
2839
|
ZodNaN: Te,
|
|
2840
2840
|
BRAND: bt,
|
|
2841
|
-
ZodBranded:
|
|
2841
|
+
ZodBranded: Oe,
|
|
2842
2842
|
ZodPipeline: ge,
|
|
2843
2843
|
ZodReadonly: me,
|
|
2844
2844
|
custom: ze,
|
|
2845
2845
|
Schema: _,
|
|
2846
2846
|
ZodSchema: _,
|
|
2847
|
-
late:
|
|
2847
|
+
late: wt,
|
|
2848
2848
|
get ZodFirstPartyTypeKind() {
|
|
2849
2849
|
return m;
|
|
2850
2850
|
},
|
|
2851
2851
|
coerce: ns,
|
|
2852
|
-
any:
|
|
2853
|
-
array:
|
|
2852
|
+
any: Nt,
|
|
2853
|
+
array: At,
|
|
2854
2854
|
bigint: Tt,
|
|
2855
2855
|
boolean: We,
|
|
2856
2856
|
date: Rt,
|
|
@@ -2858,18 +2858,18 @@ var p = /* @__PURE__ */ Object.freeze({
|
|
|
2858
2858
|
effect: Pe,
|
|
2859
2859
|
enum: Wt,
|
|
2860
2860
|
function: zt,
|
|
2861
|
-
instanceof:
|
|
2861
|
+
instanceof: kt,
|
|
2862
2862
|
intersection: Ut,
|
|
2863
2863
|
lazy: Gt,
|
|
2864
2864
|
literal: Qt,
|
|
2865
2865
|
map: Dt,
|
|
2866
2866
|
nan: St,
|
|
2867
2867
|
nativeEnum: Ht,
|
|
2868
|
-
never:
|
|
2868
|
+
never: It,
|
|
2869
2869
|
null: Zt,
|
|
2870
2870
|
nullable: Xt,
|
|
2871
2871
|
number: Qe,
|
|
2872
|
-
object:
|
|
2872
|
+
object: jt,
|
|
2873
2873
|
oboolean: ss,
|
|
2874
2874
|
onumber: ts,
|
|
2875
2875
|
optional: Jt,
|
|
@@ -2886,163 +2886,183 @@ var p = /* @__PURE__ */ Object.freeze({
|
|
|
2886
2886
|
tuple: Lt,
|
|
2887
2887
|
undefined: Ct,
|
|
2888
2888
|
union: qt,
|
|
2889
|
-
unknown:
|
|
2890
|
-
void:
|
|
2889
|
+
unknown: Mt,
|
|
2890
|
+
void: Ot,
|
|
2891
2891
|
NEVER: rs,
|
|
2892
2892
|
ZodIssueCode: c,
|
|
2893
2893
|
quotelessJson: nt,
|
|
2894
2894
|
ZodError: E
|
|
2895
2895
|
});
|
|
2896
|
-
const w =
|
|
2897
|
-
type:
|
|
2898
|
-
id:
|
|
2896
|
+
const w = h.object({
|
|
2897
|
+
type: h.literal("qp-bridge"),
|
|
2898
|
+
id: h.string().optional()
|
|
2899
2899
|
}), as = w.extend({
|
|
2900
|
-
status:
|
|
2901
|
-
question:
|
|
2902
|
-
answer:
|
|
2900
|
+
status: h.literal("answerChanged"),
|
|
2901
|
+
question: h.string(),
|
|
2902
|
+
answer: h.unknown()
|
|
2903
2903
|
}), K = w.extend({
|
|
2904
|
-
status:
|
|
2904
|
+
status: h.literal("success")
|
|
2905
2905
|
}), is = w.extend({
|
|
2906
|
-
status:
|
|
2907
|
-
message:
|
|
2908
|
-
}), He =
|
|
2909
|
-
semanticColor:
|
|
2910
|
-
label:
|
|
2911
|
-
description:
|
|
2912
|
-
disabled:
|
|
2913
|
-
required:
|
|
2914
|
-
hidden:
|
|
2915
|
-
errorMessage:
|
|
2916
|
-
}), os = He.partial(), cs =
|
|
2917
|
-
id:
|
|
2918
|
-
name:
|
|
2919
|
-
mimeType:
|
|
2920
|
-
blobUrl:
|
|
2921
|
-
}), Ye =
|
|
2922
|
-
label:
|
|
2923
|
-
hidden:
|
|
2924
|
-
collapsed:
|
|
2906
|
+
status: h.literal("error"),
|
|
2907
|
+
message: h.string()
|
|
2908
|
+
}), He = h.object({
|
|
2909
|
+
semanticColor: h.string().optional(),
|
|
2910
|
+
label: h.string(),
|
|
2911
|
+
description: h.string(),
|
|
2912
|
+
disabled: h.boolean(),
|
|
2913
|
+
required: h.boolean(),
|
|
2914
|
+
hidden: h.boolean(),
|
|
2915
|
+
errorMessage: h.string().optional()
|
|
2916
|
+
}), os = He.partial(), cs = h.object({
|
|
2917
|
+
id: h.string().uuid(),
|
|
2918
|
+
name: h.string(),
|
|
2919
|
+
mimeType: h.string(),
|
|
2920
|
+
blobUrl: h.string()
|
|
2921
|
+
}), Ye = h.record(h.unknown()), Je = h.object({
|
|
2922
|
+
label: h.string(),
|
|
2923
|
+
hidden: h.boolean(),
|
|
2924
|
+
collapsed: h.boolean()
|
|
2925
2925
|
}), ds = Je.partial(), us = w.extend({
|
|
2926
|
-
action:
|
|
2927
|
-
question:
|
|
2926
|
+
action: h.literal("getQuestion"),
|
|
2927
|
+
question: h.string()
|
|
2928
2928
|
}), ls = K.extend({
|
|
2929
2929
|
question: He
|
|
2930
2930
|
}), fs = w.extend({
|
|
2931
|
-
action:
|
|
2932
|
-
question:
|
|
2931
|
+
action: h.literal("setQuestion"),
|
|
2932
|
+
question: h.string(),
|
|
2933
2933
|
questionData: os
|
|
2934
2934
|
}), hs = w.extend({
|
|
2935
|
-
action:
|
|
2936
|
-
group:
|
|
2935
|
+
action: h.literal("getGroup"),
|
|
2936
|
+
group: h.string()
|
|
2937
2937
|
}), ps = K.extend({
|
|
2938
2938
|
group: Je
|
|
2939
2939
|
}), ms = K.extend({
|
|
2940
|
-
canSave:
|
|
2940
|
+
canSave: h.boolean()
|
|
2941
2941
|
}), gs = w.extend({
|
|
2942
|
-
action:
|
|
2942
|
+
action: h.literal("canSave")
|
|
2943
2943
|
}), ys = w.extend({
|
|
2944
|
-
action:
|
|
2945
|
-
group:
|
|
2944
|
+
action: h.literal("setGroup"),
|
|
2945
|
+
group: h.string(),
|
|
2946
2946
|
groupData: ds
|
|
2947
2947
|
}), vs = w.extend({
|
|
2948
|
-
action:
|
|
2949
|
-
question:
|
|
2950
|
-
answer:
|
|
2948
|
+
action: h.literal("setAnswer"),
|
|
2949
|
+
question: h.string(),
|
|
2950
|
+
answer: h.unknown()
|
|
2951
2951
|
}), _s = w.extend({
|
|
2952
|
-
action:
|
|
2952
|
+
action: h.literal("busyIndicatorStart")
|
|
2953
2953
|
}), xs = w.extend({
|
|
2954
|
-
action:
|
|
2954
|
+
action: h.literal("busyIndicatorEnd")
|
|
2955
2955
|
}), bs = w.extend({
|
|
2956
|
-
action:
|
|
2957
|
-
}), ks = w.extend({
|
|
2958
|
-
action: p.literal("completeAndCloseQuestionnaire")
|
|
2956
|
+
action: h.literal("saveQuestionnaire")
|
|
2959
2957
|
}), ws = w.extend({
|
|
2960
|
-
action:
|
|
2961
|
-
|
|
2958
|
+
action: h.literal("completeAndCloseQuestionnaire")
|
|
2959
|
+
}), ks = w.extend({
|
|
2960
|
+
action: h.literal("executeCustomCommand"),
|
|
2961
|
+
commandName: h.string()
|
|
2962
2962
|
}), Ss = w.extend({
|
|
2963
|
-
action:
|
|
2964
|
-
fetchXml:
|
|
2963
|
+
action: h.literal("fetchEntities"),
|
|
2964
|
+
fetchXml: h.string()
|
|
2965
2965
|
}), Ts = K.extend({
|
|
2966
|
-
entities:
|
|
2966
|
+
entities: h.array(Ye)
|
|
2967
2967
|
}), Rs = w.extend({
|
|
2968
|
-
action:
|
|
2969
|
-
entityName:
|
|
2970
|
-
entityId:
|
|
2968
|
+
action: h.literal("getEntityById"),
|
|
2969
|
+
entityName: h.string(),
|
|
2970
|
+
entityId: h.string()
|
|
2971
2971
|
}), Es = K.extend({
|
|
2972
2972
|
entity: Ye
|
|
2973
|
+
}), Cs = w.extend({
|
|
2974
|
+
action: h.literal("repeatGroup"),
|
|
2975
|
+
parentGroupName: h.string(),
|
|
2976
|
+
groupIndex: h.number()
|
|
2977
|
+
}), Zs = w.extend({
|
|
2978
|
+
action: h.literal("addNewGroup"),
|
|
2979
|
+
groupName: h.string()
|
|
2980
|
+
}), Ns = w.extend({
|
|
2981
|
+
action: h.literal("deleteGroup"),
|
|
2982
|
+
parentGroupName: h.string(),
|
|
2983
|
+
groupIndex: h.number()
|
|
2973
2984
|
});
|
|
2974
|
-
function
|
|
2985
|
+
function Qs(t) {
|
|
2975
2986
|
return cs.safeParse(t).success;
|
|
2976
2987
|
}
|
|
2977
|
-
function
|
|
2988
|
+
function Ms(t) {
|
|
2978
2989
|
return as.safeParse(t).success;
|
|
2979
2990
|
}
|
|
2980
2991
|
function Xe(t) {
|
|
2981
2992
|
return w.safeParse(t).success;
|
|
2982
2993
|
}
|
|
2983
|
-
function
|
|
2994
|
+
function Is(t) {
|
|
2984
2995
|
return K.safeParse(t).success;
|
|
2985
2996
|
}
|
|
2986
2997
|
function Os(t) {
|
|
2987
2998
|
return is.safeParse(t).success;
|
|
2988
2999
|
}
|
|
2989
|
-
function
|
|
3000
|
+
function Ws(t) {
|
|
2990
3001
|
return us.safeParse(t).success;
|
|
2991
3002
|
}
|
|
2992
|
-
function
|
|
3003
|
+
function As(t) {
|
|
2993
3004
|
return ls.safeParse(t).success;
|
|
2994
3005
|
}
|
|
2995
|
-
function
|
|
3006
|
+
function Hs(t) {
|
|
2996
3007
|
return vs.safeParse(t).success;
|
|
2997
3008
|
}
|
|
2998
|
-
function
|
|
3009
|
+
function Ys(t) {
|
|
2999
3010
|
return fs.safeParse(t).success;
|
|
3000
3011
|
}
|
|
3001
|
-
function
|
|
3012
|
+
function Js(t) {
|
|
3002
3013
|
return ys.safeParse(t).success;
|
|
3003
3014
|
}
|
|
3004
|
-
function
|
|
3015
|
+
function Xs(t) {
|
|
3005
3016
|
return hs.safeParse(t).success;
|
|
3006
3017
|
}
|
|
3007
|
-
function
|
|
3018
|
+
function js(t) {
|
|
3008
3019
|
return ps.safeParse(t).success;
|
|
3009
3020
|
}
|
|
3010
|
-
function
|
|
3021
|
+
function Ks(t) {
|
|
3011
3022
|
return ms.safeParse(t).success;
|
|
3012
3023
|
}
|
|
3013
|
-
function
|
|
3024
|
+
function Ps(t) {
|
|
3014
3025
|
return gs.safeParse(t).success;
|
|
3015
3026
|
}
|
|
3016
|
-
function
|
|
3027
|
+
function qs(t) {
|
|
3017
3028
|
return _s.safeParse(t).success;
|
|
3018
3029
|
}
|
|
3019
|
-
function
|
|
3030
|
+
function $s(t) {
|
|
3020
3031
|
return xs.safeParse(t).success;
|
|
3021
3032
|
}
|
|
3022
|
-
function
|
|
3033
|
+
function Fs(t) {
|
|
3023
3034
|
return bs.safeParse(t).success;
|
|
3024
3035
|
}
|
|
3025
|
-
function
|
|
3026
|
-
return ks.safeParse(t).success;
|
|
3027
|
-
}
|
|
3028
|
-
function Ks(t) {
|
|
3036
|
+
function en(t) {
|
|
3029
3037
|
return ws.safeParse(t).success;
|
|
3030
3038
|
}
|
|
3031
|
-
function
|
|
3032
|
-
return
|
|
3039
|
+
function tn(t) {
|
|
3040
|
+
return ks.safeParse(t).success;
|
|
3033
3041
|
}
|
|
3034
|
-
function
|
|
3042
|
+
function sn(t) {
|
|
3043
|
+
return qs(t) || $s(t);
|
|
3044
|
+
}
|
|
3045
|
+
function nn(t) {
|
|
3035
3046
|
return Ss.safeParse(t).success;
|
|
3036
3047
|
}
|
|
3037
|
-
function
|
|
3048
|
+
function Us(t) {
|
|
3038
3049
|
return Ts.safeParse(t).success;
|
|
3039
3050
|
}
|
|
3040
|
-
function
|
|
3051
|
+
function rn(t) {
|
|
3041
3052
|
return Rs.safeParse(t).success;
|
|
3042
3053
|
}
|
|
3043
|
-
function
|
|
3054
|
+
function Ls(t) {
|
|
3044
3055
|
return Es.safeParse(t).success;
|
|
3045
3056
|
}
|
|
3057
|
+
function an(t) {
|
|
3058
|
+
return Cs.safeParse(t).success;
|
|
3059
|
+
}
|
|
3060
|
+
function on(t) {
|
|
3061
|
+
return Zs.safeParse(t).success;
|
|
3062
|
+
}
|
|
3063
|
+
function cn(t) {
|
|
3064
|
+
return Ns.safeParse(t).success;
|
|
3065
|
+
}
|
|
3046
3066
|
function Ke(t) {
|
|
3047
3067
|
if (t instanceof File || t instanceof Blob)
|
|
3048
3068
|
return URL.createObjectURL(t);
|
|
@@ -3070,7 +3090,7 @@ function Ke(t) {
|
|
|
3070
3090
|
}
|
|
3071
3091
|
throw new Error("Unsupported content type for blobUrl");
|
|
3072
3092
|
}
|
|
3073
|
-
function
|
|
3093
|
+
function dn(t, e, s, n) {
|
|
3074
3094
|
return {
|
|
3075
3095
|
id: n ?? qe(),
|
|
3076
3096
|
name: t,
|
|
@@ -3078,7 +3098,7 @@ function sn(t, e, s, n) {
|
|
|
3078
3098
|
blobUrl: Ke(s)
|
|
3079
3099
|
};
|
|
3080
3100
|
}
|
|
3081
|
-
function
|
|
3101
|
+
function un(t, e) {
|
|
3082
3102
|
let s = t.blobUrl;
|
|
3083
3103
|
return e.content !== void 0 && (s = Ke(e.content)), {
|
|
3084
3104
|
...t,
|
|
@@ -3086,48 +3106,48 @@ function nn(t, e) {
|
|
|
3086
3106
|
blobUrl: s
|
|
3087
3107
|
};
|
|
3088
3108
|
}
|
|
3089
|
-
window.addEventListener("message",
|
|
3090
|
-
async function
|
|
3091
|
-
await
|
|
3109
|
+
window.addEventListener("message", Vs);
|
|
3110
|
+
async function ln(t, e) {
|
|
3111
|
+
await M({
|
|
3092
3112
|
type: "qp-bridge",
|
|
3093
3113
|
action: "setAnswer",
|
|
3094
3114
|
question: t,
|
|
3095
3115
|
answer: e
|
|
3096
3116
|
});
|
|
3097
3117
|
}
|
|
3098
|
-
async function
|
|
3099
|
-
return await
|
|
3118
|
+
async function fn(t) {
|
|
3119
|
+
return await Ds({
|
|
3100
3120
|
type: "qp-bridge",
|
|
3101
3121
|
action: "getQuestion",
|
|
3102
3122
|
question: t
|
|
3103
3123
|
});
|
|
3104
3124
|
}
|
|
3105
|
-
async function
|
|
3106
|
-
await
|
|
3125
|
+
async function hn(t, e) {
|
|
3126
|
+
await M({
|
|
3107
3127
|
type: "qp-bridge",
|
|
3108
3128
|
action: "setQuestion",
|
|
3109
3129
|
question: t,
|
|
3110
3130
|
questionData: e
|
|
3111
3131
|
});
|
|
3112
3132
|
}
|
|
3113
|
-
async function
|
|
3114
|
-
return await
|
|
3133
|
+
async function pn(t) {
|
|
3134
|
+
return await Bs({
|
|
3115
3135
|
type: "qp-bridge",
|
|
3116
3136
|
action: "getGroup",
|
|
3117
3137
|
group: t
|
|
3118
3138
|
});
|
|
3119
3139
|
}
|
|
3120
|
-
async function
|
|
3121
|
-
await
|
|
3140
|
+
async function mn(t, e) {
|
|
3141
|
+
await M({
|
|
3122
3142
|
type: "qp-bridge",
|
|
3123
3143
|
action: "setGroup",
|
|
3124
3144
|
group: t,
|
|
3125
3145
|
groupData: e
|
|
3126
3146
|
});
|
|
3127
3147
|
}
|
|
3128
|
-
function
|
|
3148
|
+
function gn(t) {
|
|
3129
3149
|
const e = (s) => {
|
|
3130
|
-
|
|
3150
|
+
Ms(s.data) && t(s.data.question, s.data.answer);
|
|
3131
3151
|
};
|
|
3132
3152
|
return window.addEventListener("message", e), {
|
|
3133
3153
|
cancelSubscription: () => {
|
|
@@ -3135,41 +3155,41 @@ function un(t) {
|
|
|
3135
3155
|
}
|
|
3136
3156
|
};
|
|
3137
3157
|
}
|
|
3138
|
-
async function
|
|
3139
|
-
await
|
|
3158
|
+
async function yn(t) {
|
|
3159
|
+
await M({
|
|
3140
3160
|
type: "qp-bridge",
|
|
3141
3161
|
action: "busyIndicatorStart"
|
|
3142
3162
|
});
|
|
3143
3163
|
try {
|
|
3144
3164
|
return await t();
|
|
3145
3165
|
} finally {
|
|
3146
|
-
await
|
|
3166
|
+
await M({
|
|
3147
3167
|
type: "qp-bridge",
|
|
3148
3168
|
action: "busyIndicatorEnd"
|
|
3149
3169
|
});
|
|
3150
3170
|
}
|
|
3151
3171
|
}
|
|
3152
|
-
async function
|
|
3153
|
-
await
|
|
3172
|
+
async function vn() {
|
|
3173
|
+
await M({
|
|
3154
3174
|
type: "qp-bridge",
|
|
3155
3175
|
action: "saveQuestionnaire"
|
|
3156
3176
|
});
|
|
3157
3177
|
}
|
|
3158
|
-
async function
|
|
3159
|
-
await
|
|
3178
|
+
async function _n() {
|
|
3179
|
+
await M({
|
|
3160
3180
|
type: "qp-bridge",
|
|
3161
3181
|
action: "completeAndCloseQuestionnaire"
|
|
3162
3182
|
});
|
|
3163
3183
|
}
|
|
3164
|
-
async function
|
|
3165
|
-
await
|
|
3184
|
+
async function xn(t) {
|
|
3185
|
+
await M({
|
|
3166
3186
|
type: "qp-bridge",
|
|
3167
3187
|
action: "executeCustomCommand",
|
|
3168
3188
|
commandName: t
|
|
3169
3189
|
});
|
|
3170
3190
|
}
|
|
3171
3191
|
const te = [];
|
|
3172
|
-
function
|
|
3192
|
+
function bn(t) {
|
|
3173
3193
|
return te.includes(t) || te.push(t), {
|
|
3174
3194
|
cancelSubscription: () => {
|
|
3175
3195
|
const e = te.indexOf(t);
|
|
@@ -3177,9 +3197,9 @@ function mn(t) {
|
|
|
3177
3197
|
}
|
|
3178
3198
|
};
|
|
3179
3199
|
}
|
|
3180
|
-
async function
|
|
3200
|
+
async function Vs(t) {
|
|
3181
3201
|
try {
|
|
3182
|
-
if (
|
|
3202
|
+
if (Ps(t.data)) {
|
|
3183
3203
|
const e = await Promise.all(te.map((n) => n())), s = {
|
|
3184
3204
|
type: "qp-bridge",
|
|
3185
3205
|
status: "success",
|
|
@@ -3198,21 +3218,44 @@ async function $s(t) {
|
|
|
3198
3218
|
window.parent.postMessage(s, "*");
|
|
3199
3219
|
}
|
|
3200
3220
|
}
|
|
3201
|
-
async function
|
|
3202
|
-
return await
|
|
3221
|
+
async function wn(t) {
|
|
3222
|
+
return await zs({
|
|
3203
3223
|
type: "qp-bridge",
|
|
3204
3224
|
action: "fetchEntities",
|
|
3205
3225
|
fetchXml: t
|
|
3206
3226
|
});
|
|
3207
3227
|
}
|
|
3208
|
-
async function
|
|
3209
|
-
return await
|
|
3228
|
+
async function kn(t, e) {
|
|
3229
|
+
return await Gs({
|
|
3210
3230
|
type: "qp-bridge",
|
|
3211
3231
|
action: "getEntityById",
|
|
3212
3232
|
entityName: t,
|
|
3213
3233
|
entityId: e
|
|
3214
3234
|
});
|
|
3215
3235
|
}
|
|
3236
|
+
async function Sn(t, e) {
|
|
3237
|
+
await M({
|
|
3238
|
+
type: "qp-bridge",
|
|
3239
|
+
action: "repeatGroup",
|
|
3240
|
+
parentGroupName: t,
|
|
3241
|
+
groupIndex: e
|
|
3242
|
+
});
|
|
3243
|
+
}
|
|
3244
|
+
async function Tn(t) {
|
|
3245
|
+
await M({
|
|
3246
|
+
type: "qp-bridge",
|
|
3247
|
+
action: "addNewGroup",
|
|
3248
|
+
groupName: t
|
|
3249
|
+
});
|
|
3250
|
+
}
|
|
3251
|
+
async function Rn(t, e) {
|
|
3252
|
+
await M({
|
|
3253
|
+
type: "qp-bridge",
|
|
3254
|
+
action: "deleteGroup",
|
|
3255
|
+
parentGroupName: t,
|
|
3256
|
+
groupIndex: e
|
|
3257
|
+
});
|
|
3258
|
+
}
|
|
3216
3259
|
async function ye(t, e) {
|
|
3217
3260
|
return new Promise((s, n) => {
|
|
3218
3261
|
const r = qe(), a = (i) => {
|
|
@@ -3224,87 +3267,96 @@ async function ye(t, e) {
|
|
|
3224
3267
|
window.addEventListener("message", a), window.parent.postMessage({ ...t, id: r }, "*");
|
|
3225
3268
|
});
|
|
3226
3269
|
}
|
|
3227
|
-
async function
|
|
3228
|
-
return ye(t, (e) =>
|
|
3270
|
+
async function Ds(t) {
|
|
3271
|
+
return ye(t, (e) => As(e) ? { success: !0, data: e.question } : { success: !1 });
|
|
3229
3272
|
}
|
|
3230
|
-
async function
|
|
3231
|
-
return ye(t, (e) =>
|
|
3273
|
+
async function Bs(t) {
|
|
3274
|
+
return ye(t, (e) => js(e) ? { success: !0, data: e.group } : { success: !1 });
|
|
3232
3275
|
}
|
|
3233
|
-
function
|
|
3234
|
-
return ye(t, (e) =>
|
|
3276
|
+
function M(t) {
|
|
3277
|
+
return ye(t, (e) => Is(e) ? { success: !0, data: void 0 } : { success: !1 });
|
|
3235
3278
|
}
|
|
3236
|
-
async function
|
|
3237
|
-
return ye(t, (e) =>
|
|
3279
|
+
async function zs(t) {
|
|
3280
|
+
return ye(t, (e) => Us(e) ? { success: !0, data: e.entities } : { success: !1 });
|
|
3238
3281
|
}
|
|
3239
|
-
async function
|
|
3240
|
-
return ye(t, (e) =>
|
|
3282
|
+
async function Gs(t) {
|
|
3283
|
+
return ye(t, (e) => Ls(e) ? { success: !0, data: e.entity } : { success: !1 });
|
|
3241
3284
|
}
|
|
3242
3285
|
export {
|
|
3286
|
+
Tn as addNewGroup,
|
|
3287
|
+
Zs as addNewGroupRequestMessageSchema,
|
|
3243
3288
|
xs as busyIndicatorEndRequestMessageSchema,
|
|
3244
3289
|
_s as busyIndicatorStartRequestMessageSchema,
|
|
3245
3290
|
gs as canSaveRequestMessageSchema,
|
|
3246
3291
|
ms as canSaveSuccessResponseMessageSchema,
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3292
|
+
_n as completeAndCloseQuestionnaire,
|
|
3293
|
+
ws as completeAndCloseQuestionnaireRequestMessageSchema,
|
|
3294
|
+
dn as createMediaItem,
|
|
3295
|
+
Rn as deleteGroup,
|
|
3296
|
+
Ns as deleteGroupRequestMessageSchema,
|
|
3250
3297
|
Ye as entitySchema,
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3298
|
+
xn as executeCustomCommand,
|
|
3299
|
+
ks as executeCustomCommandRequestMessageSchema,
|
|
3300
|
+
wn as fetchEntities,
|
|
3254
3301
|
Ss as fetchEntitiesRequestMessageSchema,
|
|
3255
3302
|
Ts as fetchEntitiesSuccessResponseMessageSchema,
|
|
3256
|
-
|
|
3303
|
+
kn as getEntityById,
|
|
3257
3304
|
Rs as getEntityByIdRequestMessageSchema,
|
|
3258
3305
|
Es as getEntityByIdSuccessResponseMessageSchema,
|
|
3259
|
-
|
|
3306
|
+
pn as getGroup,
|
|
3260
3307
|
hs as getGroupRequestMessageSchema,
|
|
3261
3308
|
ps as getGroupSuccessResponseMessageSchema,
|
|
3262
|
-
|
|
3309
|
+
fn as getQuestion,
|
|
3263
3310
|
us as getQuestionRequestMessageSchema,
|
|
3264
3311
|
ls as getQuestionSuccessResponseMessageSchema,
|
|
3265
3312
|
ds as groupOptionalScheme,
|
|
3266
3313
|
Je as groupSchema,
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3314
|
+
on as isAddNewGroupRequestMessage,
|
|
3315
|
+
$s as isBusyIndicatorEndRequestMessage,
|
|
3316
|
+
qs as isBusyIndicatorStartRequestMessage,
|
|
3317
|
+
Ps as isCanSaveRequestMessage,
|
|
3318
|
+
Ks as isCanSaveSuccessResponseMessage,
|
|
3319
|
+
en as isCompleteAndCloseQuestionnaireRequestMessage,
|
|
3320
|
+
cn as isDeleteGroupRequestMessage,
|
|
3272
3321
|
Os as isErrorMessage,
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3322
|
+
tn as isExecuteCustomCommandRequestMessage,
|
|
3323
|
+
nn as isFetchEntitiesRequestMessage,
|
|
3324
|
+
Us as isFetchEntitiesSuccessResponseMessage,
|
|
3325
|
+
rn as isGetEntityByIdRequestMessage,
|
|
3326
|
+
Ls as isGetEntityByIdSuccessResponseMessage,
|
|
3327
|
+
Xs as isGetGroupRequestMessage,
|
|
3328
|
+
js as isGetGroupSuccessResponseMessage,
|
|
3329
|
+
Ws as isGetQuestionRequestMessage,
|
|
3330
|
+
As as isGetQuestionSuccessResponseMessage,
|
|
3331
|
+
Qs as isMediaItem,
|
|
3332
|
+
Ms as isOnAnswerChangeMessage,
|
|
3284
3333
|
Xe as isQpBridgeMessage,
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3334
|
+
an as isRepeatGroupRequestMessage,
|
|
3335
|
+
Fs as isSaveQuestionnaireRequestMessage,
|
|
3336
|
+
Hs as isSetAnswerRequestMessage,
|
|
3337
|
+
Js as isSetGroupRequestMessage,
|
|
3338
|
+
Ys as isSetQuestionRequestMessage,
|
|
3339
|
+
Is as isSuccessMessage,
|
|
3340
|
+
sn as isWithBusyIndicatorRequestMessage,
|
|
3291
3341
|
cs as mediaItemSchema,
|
|
3292
|
-
|
|
3342
|
+
gn as onAnswerChange,
|
|
3293
3343
|
as as onAnswerChangeMessageSchema,
|
|
3294
|
-
|
|
3344
|
+
bn as onSave,
|
|
3295
3345
|
w as qpBridgeMessageSchema,
|
|
3296
3346
|
os as questionOptionalScheme,
|
|
3297
3347
|
He as questionSchema,
|
|
3348
|
+
Sn as repeatGroup,
|
|
3349
|
+
Cs as repeatGroupRequestMessageSchema,
|
|
3298
3350
|
is as responseErrorMessageSchema,
|
|
3299
3351
|
K as responseSuccessMessageSchema,
|
|
3300
|
-
|
|
3352
|
+
vn as saveQuestionnaire,
|
|
3301
3353
|
bs as saveQuestionnaireRequestMessageSchema,
|
|
3302
|
-
|
|
3354
|
+
ln as setAnswer,
|
|
3303
3355
|
vs as setAnswerRequestMessageSchema,
|
|
3304
|
-
|
|
3356
|
+
mn as setGroup,
|
|
3305
3357
|
ys as setGroupRequestMessageSchema,
|
|
3306
|
-
|
|
3358
|
+
hn as setQuestion,
|
|
3307
3359
|
fs as setQuestionRequestMessageSchema,
|
|
3308
|
-
|
|
3309
|
-
|
|
3360
|
+
un as updateMediaItem,
|
|
3361
|
+
yn as withBusyIndicator
|
|
3310
3362
|
};
|