@resconet/qp-bridge 1.4.0 → 1.4.1-alpha.11
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 +36 -4
- package/index.js +1 -1
- package/index.mjs +853 -697
- package/lib/qp-bridge-types.d.ts +192 -22
- package/lib/qp-bridge.d.ts +22 -4
- package/package.json +2 -2
package/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
function
|
|
3
|
-
if (
|
|
4
|
-
|
|
5
|
-
var t =
|
|
1
|
+
var xe = { exports: {} }, $e;
|
|
2
|
+
function rt() {
|
|
3
|
+
if ($e) return xe.exports;
|
|
4
|
+
$e = 1;
|
|
5
|
+
var t = xe.exports = {}, e, s;
|
|
6
6
|
function n() {
|
|
7
7
|
throw new Error("setTimeout has not been defined");
|
|
8
8
|
}
|
|
@@ -51,38 +51,38 @@ function Xe() {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
var o = [], d = !1, l,
|
|
55
|
-
function O() {
|
|
56
|
-
!d || !l || (d = !1, l.length ? o = l.concat(o) : y = -1, o.length && M());
|
|
57
|
-
}
|
|
54
|
+
var o = [], d = !1, l, _ = -1;
|
|
58
55
|
function M() {
|
|
56
|
+
!d || !l || (d = !1, l.length ? o = l.concat(o) : _ = -1, o.length && Z());
|
|
57
|
+
}
|
|
58
|
+
function Z() {
|
|
59
59
|
if (!d) {
|
|
60
|
-
var k = r(
|
|
60
|
+
var k = r(M);
|
|
61
61
|
d = !0;
|
|
62
|
-
for (var
|
|
63
|
-
for (l = o, o = []; ++
|
|
64
|
-
l && l[
|
|
65
|
-
|
|
62
|
+
for (var N = o.length; N; ) {
|
|
63
|
+
for (l = o, o = []; ++_ < N; )
|
|
64
|
+
l && l[_].run();
|
|
65
|
+
_ = -1, N = o.length;
|
|
66
66
|
}
|
|
67
67
|
l = null, d = !1, i(k);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
t.nextTick = function(k) {
|
|
71
|
-
var
|
|
71
|
+
var N = new Array(arguments.length - 1);
|
|
72
72
|
if (arguments.length > 1)
|
|
73
|
-
for (var
|
|
74
|
-
|
|
75
|
-
o.push(new
|
|
73
|
+
for (var H = 1; H < arguments.length; H++)
|
|
74
|
+
N[H - 1] = arguments[H];
|
|
75
|
+
o.push(new Pe(k, N)), o.length === 1 && !d && r(Z);
|
|
76
76
|
};
|
|
77
|
-
function
|
|
78
|
-
this.fun = k, this.array =
|
|
77
|
+
function Pe(k, N) {
|
|
78
|
+
this.fun = k, this.array = N;
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
Pe.prototype.run = function() {
|
|
81
81
|
this.fun.apply(null, this.array);
|
|
82
82
|
}, t.title = "browser", t.browser = !0, t.env = {}, t.argv = [], t.version = "", t.versions = {};
|
|
83
|
-
function
|
|
83
|
+
function q() {
|
|
84
84
|
}
|
|
85
|
-
return t.on =
|
|
85
|
+
return t.on = q, t.addListener = q, t.once = q, t.off = q, t.removeListener = q, t.removeAllListeners = q, t.emit = q, t.prependListener = q, t.prependOnceListener = q, t.listeners = function(k) {
|
|
86
86
|
return [];
|
|
87
87
|
}, t.binding = function(k) {
|
|
88
88
|
throw new Error("process.binding is not supported");
|
|
@@ -92,33 +92,30 @@ function Xe() {
|
|
|
92
92
|
throw new Error("process.chdir is not supported");
|
|
93
93
|
}, t.umask = function() {
|
|
94
94
|
return 0;
|
|
95
|
-
},
|
|
95
|
+
}, xe.exports;
|
|
96
96
|
}
|
|
97
|
-
var
|
|
98
|
-
|
|
99
|
-
const et = new Uint8Array(16);
|
|
100
|
-
function tt() {
|
|
101
|
-
if (!ie && (ie = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !ie))
|
|
102
|
-
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
103
|
-
return ie(et);
|
|
104
|
-
}
|
|
105
|
-
const R = [];
|
|
97
|
+
var it = rt();
|
|
98
|
+
const T = [];
|
|
106
99
|
for (let t = 0; t < 256; ++t)
|
|
107
|
-
|
|
108
|
-
function
|
|
109
|
-
return
|
|
100
|
+
T.push((t + 256).toString(16).slice(1));
|
|
101
|
+
function ot(t, e = 0) {
|
|
102
|
+
return (T[t[e + 0]] + T[t[e + 1]] + T[t[e + 2]] + T[t[e + 3]] + "-" + T[t[e + 4]] + T[t[e + 5]] + "-" + T[t[e + 6]] + T[t[e + 7]] + "-" + T[t[e + 8]] + T[t[e + 9]] + "-" + T[t[e + 10]] + T[t[e + 11]] + T[t[e + 12]] + T[t[e + 13]] + T[t[e + 14]] + T[t[e + 15]]).toLowerCase();
|
|
110
103
|
}
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
104
|
+
const ct = new Uint8Array(16);
|
|
105
|
+
function ut() {
|
|
106
|
+
return crypto.getRandomValues(ct);
|
|
107
|
+
}
|
|
108
|
+
function We(t, e, s) {
|
|
109
|
+
return crypto.randomUUID ? crypto.randomUUID() : dt(t);
|
|
110
|
+
}
|
|
111
|
+
function dt(t, e, s) {
|
|
117
112
|
t = t || {};
|
|
118
|
-
const n = t.random
|
|
119
|
-
|
|
113
|
+
const n = t.random ?? t.rng?.() ?? ut();
|
|
114
|
+
if (n.length < 16)
|
|
115
|
+
throw new Error("Random bytes length must be >= 16");
|
|
116
|
+
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, ot(n);
|
|
120
117
|
}
|
|
121
|
-
var
|
|
118
|
+
var x;
|
|
122
119
|
(function(t) {
|
|
123
120
|
t.assertEqual = (a) => {
|
|
124
121
|
};
|
|
@@ -154,16 +151,16 @@ var v;
|
|
|
154
151
|
return a.map((i) => typeof i == "string" ? `'${i}'` : i).join(r);
|
|
155
152
|
}
|
|
156
153
|
t.joinValues = n, t.jsonStringifyReplacer = (a, r) => typeof r == "bigint" ? r.toString() : r;
|
|
157
|
-
})(
|
|
158
|
-
var
|
|
154
|
+
})(x || (x = {}));
|
|
155
|
+
var Le;
|
|
159
156
|
(function(t) {
|
|
160
157
|
t.mergeShapes = (e, s) => ({
|
|
161
158
|
...e,
|
|
162
159
|
...s
|
|
163
160
|
// second overwrites first
|
|
164
161
|
});
|
|
165
|
-
})(
|
|
166
|
-
const f =
|
|
162
|
+
})(Le || (Le = {}));
|
|
163
|
+
const f = x.arrayToEnum([
|
|
167
164
|
"string",
|
|
168
165
|
"nan",
|
|
169
166
|
"number",
|
|
@@ -184,7 +181,7 @@ const f = v.arrayToEnum([
|
|
|
184
181
|
"never",
|
|
185
182
|
"map",
|
|
186
183
|
"set"
|
|
187
|
-
]),
|
|
184
|
+
]), U = (t) => {
|
|
188
185
|
switch (typeof t) {
|
|
189
186
|
case "undefined":
|
|
190
187
|
return f.undefined;
|
|
@@ -205,7 +202,7 @@ const f = v.arrayToEnum([
|
|
|
205
202
|
default:
|
|
206
203
|
return f.unknown;
|
|
207
204
|
}
|
|
208
|
-
}, c =
|
|
205
|
+
}, c = x.arrayToEnum([
|
|
209
206
|
"invalid_type",
|
|
210
207
|
"invalid_literal",
|
|
211
208
|
"custom",
|
|
@@ -223,7 +220,7 @@ const f = v.arrayToEnum([
|
|
|
223
220
|
"not_multiple_of",
|
|
224
221
|
"not_finite"
|
|
225
222
|
]);
|
|
226
|
-
class
|
|
223
|
+
class L extends Error {
|
|
227
224
|
get errors() {
|
|
228
225
|
return this.issues;
|
|
229
226
|
}
|
|
@@ -260,14 +257,14 @@ class j extends Error {
|
|
|
260
257
|
return a(this), n;
|
|
261
258
|
}
|
|
262
259
|
static assert(e) {
|
|
263
|
-
if (!(e instanceof
|
|
260
|
+
if (!(e instanceof L))
|
|
264
261
|
throw new Error(`Not a ZodError: ${e}`);
|
|
265
262
|
}
|
|
266
263
|
toString() {
|
|
267
264
|
return this.message;
|
|
268
265
|
}
|
|
269
266
|
get message() {
|
|
270
|
-
return JSON.stringify(this.issues,
|
|
267
|
+
return JSON.stringify(this.issues, x.jsonStringifyReplacer, 2);
|
|
271
268
|
}
|
|
272
269
|
get isEmpty() {
|
|
273
270
|
return this.issues.length === 0;
|
|
@@ -286,27 +283,27 @@ class j extends Error {
|
|
|
286
283
|
return this.flatten();
|
|
287
284
|
}
|
|
288
285
|
}
|
|
289
|
-
|
|
290
|
-
const
|
|
286
|
+
L.create = (t) => new L(t);
|
|
287
|
+
const ke = (t, e) => {
|
|
291
288
|
let s;
|
|
292
289
|
switch (t.code) {
|
|
293
290
|
case c.invalid_type:
|
|
294
291
|
t.received === f.undefined ? s = "Required" : s = `Expected ${t.expected}, received ${t.received}`;
|
|
295
292
|
break;
|
|
296
293
|
case c.invalid_literal:
|
|
297
|
-
s = `Invalid literal value, expected ${JSON.stringify(t.expected,
|
|
294
|
+
s = `Invalid literal value, expected ${JSON.stringify(t.expected, x.jsonStringifyReplacer)}`;
|
|
298
295
|
break;
|
|
299
296
|
case c.unrecognized_keys:
|
|
300
|
-
s = `Unrecognized key(s) in object: ${
|
|
297
|
+
s = `Unrecognized key(s) in object: ${x.joinValues(t.keys, ", ")}`;
|
|
301
298
|
break;
|
|
302
299
|
case c.invalid_union:
|
|
303
300
|
s = "Invalid input";
|
|
304
301
|
break;
|
|
305
302
|
case c.invalid_union_discriminator:
|
|
306
|
-
s = `Invalid discriminator value. Expected ${
|
|
303
|
+
s = `Invalid discriminator value. Expected ${x.joinValues(t.options)}`;
|
|
307
304
|
break;
|
|
308
305
|
case c.invalid_enum_value:
|
|
309
|
-
s = `Invalid enum value. Expected ${
|
|
306
|
+
s = `Invalid enum value. Expected ${x.joinValues(t.options)}, received '${t.received}'`;
|
|
310
307
|
break;
|
|
311
308
|
case c.invalid_arguments:
|
|
312
309
|
s = "Invalid function arguments";
|
|
@@ -318,7 +315,7 @@ const ge = (t, e) => {
|
|
|
318
315
|
s = "Invalid date";
|
|
319
316
|
break;
|
|
320
317
|
case c.invalid_string:
|
|
321
|
-
typeof t.validation == "object" ? "includes" in t.validation ? (s = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (s = `${s} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? s = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? s = `Invalid input: must end with "${t.validation.endsWith}"` :
|
|
318
|
+
typeof t.validation == "object" ? "includes" in t.validation ? (s = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (s = `${s} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? s = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? s = `Invalid input: must end with "${t.validation.endsWith}"` : x.assertNever(t.validation) : t.validation !== "regex" ? s = `Invalid ${t.validation}` : s = "Invalid";
|
|
322
319
|
break;
|
|
323
320
|
case c.too_small:
|
|
324
321
|
t.type === "array" ? s = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "more than"} ${t.minimum} element(s)` : t.type === "string" ? s = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "over"} ${t.minimum} character(s)` : t.type === "number" ? s = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "bigint" ? s = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "date" ? s = `Date must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(t.minimum))}` : s = "Invalid input";
|
|
@@ -339,15 +336,15 @@ const ge = (t, e) => {
|
|
|
339
336
|
s = "Number must be finite";
|
|
340
337
|
break;
|
|
341
338
|
default:
|
|
342
|
-
s = e.defaultError,
|
|
339
|
+
s = e.defaultError, x.assertNever(t);
|
|
343
340
|
}
|
|
344
341
|
return { message: s };
|
|
345
342
|
};
|
|
346
|
-
let
|
|
347
|
-
function
|
|
348
|
-
return
|
|
343
|
+
let lt = ke;
|
|
344
|
+
function ft() {
|
|
345
|
+
return lt;
|
|
349
346
|
}
|
|
350
|
-
const
|
|
347
|
+
const ht = (t) => {
|
|
351
348
|
const { data: e, path: s, errorMaps: n, issueData: a } = t, r = [...s, ...a.path || []], i = {
|
|
352
349
|
...a,
|
|
353
350
|
path: r
|
|
@@ -369,7 +366,7 @@ const it = (t) => {
|
|
|
369
366
|
};
|
|
370
367
|
};
|
|
371
368
|
function u(t, e) {
|
|
372
|
-
const s =
|
|
369
|
+
const s = ft(), n = ht({
|
|
373
370
|
issueData: e,
|
|
374
371
|
data: t.data,
|
|
375
372
|
path: t.path,
|
|
@@ -380,13 +377,13 @@ function u(t, e) {
|
|
|
380
377
|
// then schema-bound map if available
|
|
381
378
|
s,
|
|
382
379
|
// then global override map
|
|
383
|
-
s ===
|
|
380
|
+
s === ke ? void 0 : ke
|
|
384
381
|
// then global default map
|
|
385
382
|
].filter((a) => !!a)
|
|
386
383
|
});
|
|
387
384
|
t.common.issues.push(n);
|
|
388
385
|
}
|
|
389
|
-
class
|
|
386
|
+
class R {
|
|
390
387
|
constructor() {
|
|
391
388
|
this.value = "valid";
|
|
392
389
|
}
|
|
@@ -414,7 +411,7 @@ class T {
|
|
|
414
411
|
value: i
|
|
415
412
|
});
|
|
416
413
|
}
|
|
417
|
-
return
|
|
414
|
+
return R.mergeObjectSync(e, n);
|
|
418
415
|
}
|
|
419
416
|
static mergeObjectSync(e, s) {
|
|
420
417
|
const n = {};
|
|
@@ -429,12 +426,12 @@ class T {
|
|
|
429
426
|
}
|
|
430
427
|
const m = Object.freeze({
|
|
431
428
|
status: "aborted"
|
|
432
|
-
}),
|
|
429
|
+
}), ee = (t) => ({ status: "dirty", value: t }), I = (t) => ({ status: "valid", value: t }), Ve = (t) => t.status === "aborted", Ue = (t) => t.status === "dirty", Y = (t) => t.status === "valid", oe = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
433
430
|
var h;
|
|
434
431
|
(function(t) {
|
|
435
432
|
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
436
433
|
})(h || (h = {}));
|
|
437
|
-
class
|
|
434
|
+
class O {
|
|
438
435
|
constructor(e, s, n, a) {
|
|
439
436
|
this._cachedPath = [], this.parent = e, this.data = s, this._path = n, this._key = a;
|
|
440
437
|
}
|
|
@@ -442,8 +439,8 @@ class A {
|
|
|
442
439
|
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
443
440
|
}
|
|
444
441
|
}
|
|
445
|
-
const
|
|
446
|
-
if (
|
|
442
|
+
const Be = (t, e) => {
|
|
443
|
+
if (Y(e))
|
|
447
444
|
return { success: !0, data: e.value };
|
|
448
445
|
if (!t.common.issues.length)
|
|
449
446
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -452,12 +449,12 @@ const Ze = (t, e) => {
|
|
|
452
449
|
get error() {
|
|
453
450
|
if (this._error)
|
|
454
451
|
return this._error;
|
|
455
|
-
const s = new
|
|
452
|
+
const s = new L(t.common.issues);
|
|
456
453
|
return this._error = s, this._error;
|
|
457
454
|
}
|
|
458
455
|
};
|
|
459
456
|
};
|
|
460
|
-
function
|
|
457
|
+
function y(t) {
|
|
461
458
|
if (!t)
|
|
462
459
|
return {};
|
|
463
460
|
const { errorMap: e, invalid_type_error: s, required_error: n, description: a } = t;
|
|
@@ -468,18 +465,18 @@ function g(t) {
|
|
|
468
465
|
return i.code === "invalid_enum_value" ? { message: d ?? o.defaultError } : typeof o.data > "u" ? { message: d ?? n ?? o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: d ?? s ?? o.defaultError };
|
|
469
466
|
}, description: a };
|
|
470
467
|
}
|
|
471
|
-
class
|
|
468
|
+
class v {
|
|
472
469
|
get description() {
|
|
473
470
|
return this._def.description;
|
|
474
471
|
}
|
|
475
472
|
_getType(e) {
|
|
476
|
-
return
|
|
473
|
+
return U(e.data);
|
|
477
474
|
}
|
|
478
475
|
_getOrReturnCtx(e, s) {
|
|
479
476
|
return s || {
|
|
480
477
|
common: e.parent.common,
|
|
481
478
|
data: e.data,
|
|
482
|
-
parsedType:
|
|
479
|
+
parsedType: U(e.data),
|
|
483
480
|
schemaErrorMap: this._def.errorMap,
|
|
484
481
|
path: e.path,
|
|
485
482
|
parent: e.parent
|
|
@@ -487,11 +484,11 @@ class _ {
|
|
|
487
484
|
}
|
|
488
485
|
_processInputParams(e) {
|
|
489
486
|
return {
|
|
490
|
-
status: new
|
|
487
|
+
status: new R(),
|
|
491
488
|
ctx: {
|
|
492
489
|
common: e.parent.common,
|
|
493
490
|
data: e.data,
|
|
494
|
-
parsedType:
|
|
491
|
+
parsedType: U(e.data),
|
|
495
492
|
schemaErrorMap: this._def.errorMap,
|
|
496
493
|
path: e.path,
|
|
497
494
|
parent: e.parent
|
|
@@ -525,9 +522,9 @@ class _ {
|
|
|
525
522
|
schemaErrorMap: this._def.errorMap,
|
|
526
523
|
parent: null,
|
|
527
524
|
data: e,
|
|
528
|
-
parsedType:
|
|
525
|
+
parsedType: U(e)
|
|
529
526
|
}, a = this._parseSync({ data: e, path: n.path, parent: n });
|
|
530
|
-
return
|
|
527
|
+
return Be(n, a);
|
|
531
528
|
}
|
|
532
529
|
"~validate"(e) {
|
|
533
530
|
const s = {
|
|
@@ -539,12 +536,12 @@ class _ {
|
|
|
539
536
|
schemaErrorMap: this._def.errorMap,
|
|
540
537
|
parent: null,
|
|
541
538
|
data: e,
|
|
542
|
-
parsedType:
|
|
539
|
+
parsedType: U(e)
|
|
543
540
|
};
|
|
544
541
|
if (!this["~standard"].async)
|
|
545
542
|
try {
|
|
546
543
|
const n = this._parseSync({ data: e, path: [], parent: s });
|
|
547
|
-
return
|
|
544
|
+
return Y(n) ? {
|
|
548
545
|
value: n.value
|
|
549
546
|
} : {
|
|
550
547
|
issues: s.common.issues
|
|
@@ -555,7 +552,7 @@ class _ {
|
|
|
555
552
|
async: !0
|
|
556
553
|
};
|
|
557
554
|
}
|
|
558
|
-
return this._parseAsync({ data: e, path: [], parent: s }).then((n) =>
|
|
555
|
+
return this._parseAsync({ data: e, path: [], parent: s }).then((n) => Y(n) ? {
|
|
559
556
|
value: n.value
|
|
560
557
|
} : {
|
|
561
558
|
issues: s.common.issues
|
|
@@ -578,9 +575,9 @@ class _ {
|
|
|
578
575
|
schemaErrorMap: this._def.errorMap,
|
|
579
576
|
parent: null,
|
|
580
577
|
data: e,
|
|
581
|
-
parsedType:
|
|
578
|
+
parsedType: U(e)
|
|
582
579
|
}, a = this._parse({ data: e, path: n.path, parent: n }), r = await (oe(a) ? a : Promise.resolve(a));
|
|
583
|
-
return
|
|
580
|
+
return Be(n, r);
|
|
584
581
|
}
|
|
585
582
|
refine(e, s) {
|
|
586
583
|
const n = (a) => typeof s == "string" || typeof s > "u" ? { message: s } : typeof s == "function" ? s(a) : s;
|
|
@@ -596,7 +593,7 @@ class _ {
|
|
|
596
593
|
return this._refinement((n, a) => e(n) ? !0 : (a.addIssue(typeof s == "function" ? s(n, a) : s), !1));
|
|
597
594
|
}
|
|
598
595
|
_refinement(e) {
|
|
599
|
-
return new
|
|
596
|
+
return new D({
|
|
600
597
|
schema: this,
|
|
601
598
|
typeName: p.ZodEffects,
|
|
602
599
|
effect: { type: "refinement", refinement: e }
|
|
@@ -613,19 +610,19 @@ class _ {
|
|
|
613
610
|
};
|
|
614
611
|
}
|
|
615
612
|
optional() {
|
|
616
|
-
return
|
|
613
|
+
return $.create(this, this._def);
|
|
617
614
|
}
|
|
618
615
|
nullable() {
|
|
619
|
-
return
|
|
616
|
+
return Q.create(this, this._def);
|
|
620
617
|
}
|
|
621
618
|
nullish() {
|
|
622
619
|
return this.nullable().optional();
|
|
623
620
|
}
|
|
624
621
|
array() {
|
|
625
|
-
return
|
|
622
|
+
return A.create(this);
|
|
626
623
|
}
|
|
627
624
|
promise() {
|
|
628
|
-
return
|
|
625
|
+
return me.create(this, this._def);
|
|
629
626
|
}
|
|
630
627
|
or(e) {
|
|
631
628
|
return ue.create([this, e], this._def);
|
|
@@ -634,8 +631,8 @@ class _ {
|
|
|
634
631
|
return de.create(this, e, this._def);
|
|
635
632
|
}
|
|
636
633
|
transform(e) {
|
|
637
|
-
return new
|
|
638
|
-
...
|
|
634
|
+
return new D({
|
|
635
|
+
...y(this._def),
|
|
639
636
|
schema: this,
|
|
640
637
|
typeName: p.ZodEffects,
|
|
641
638
|
effect: { type: "transform", transform: e }
|
|
@@ -643,24 +640,24 @@ class _ {
|
|
|
643
640
|
}
|
|
644
641
|
default(e) {
|
|
645
642
|
const s = typeof e == "function" ? e : () => e;
|
|
646
|
-
return new
|
|
647
|
-
...
|
|
643
|
+
return new pe({
|
|
644
|
+
...y(this._def),
|
|
648
645
|
innerType: this,
|
|
649
646
|
defaultValue: s,
|
|
650
647
|
typeName: p.ZodDefault
|
|
651
648
|
});
|
|
652
649
|
}
|
|
653
650
|
brand() {
|
|
654
|
-
return new
|
|
651
|
+
return new Xe({
|
|
655
652
|
typeName: p.ZodBranded,
|
|
656
653
|
type: this,
|
|
657
|
-
...
|
|
654
|
+
...y(this._def)
|
|
658
655
|
});
|
|
659
656
|
}
|
|
660
657
|
catch(e) {
|
|
661
658
|
const s = typeof e == "function" ? e : () => e;
|
|
662
|
-
return new
|
|
663
|
-
...
|
|
659
|
+
return new ge({
|
|
660
|
+
...y(this._def),
|
|
664
661
|
innerType: this,
|
|
665
662
|
catchValue: s,
|
|
666
663
|
typeName: p.ZodCatch
|
|
@@ -674,10 +671,10 @@ class _ {
|
|
|
674
671
|
});
|
|
675
672
|
}
|
|
676
673
|
pipe(e) {
|
|
677
|
-
return
|
|
674
|
+
return Oe.create(this, e);
|
|
678
675
|
}
|
|
679
676
|
readonly() {
|
|
680
|
-
return
|
|
677
|
+
return ye.create(this);
|
|
681
678
|
}
|
|
682
679
|
isOptional() {
|
|
683
680
|
return this.safeParse(void 0).success;
|
|
@@ -686,28 +683,28 @@ class _ {
|
|
|
686
683
|
return this.safeParse(null).success;
|
|
687
684
|
}
|
|
688
685
|
}
|
|
689
|
-
const
|
|
690
|
-
let
|
|
691
|
-
const
|
|
692
|
-
function
|
|
686
|
+
const mt = /^c[^\s-]{8,}$/i, pt = /^[0-9a-z]+$/, gt = /^[0-9A-HJKMNP-TV-Z]{26}$/i, yt = /^[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, _t = /^[a-z0-9_-]{21}$/i, vt = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, xt = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, bt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, kt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
687
|
+
let be;
|
|
688
|
+
const wt = /^(?:(?: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])$/, St = /^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/, Tt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Rt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Ct = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, It = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, He = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Et = new RegExp(`^${He}$`);
|
|
689
|
+
function Je(t) {
|
|
693
690
|
let e = "[0-5]\\d";
|
|
694
691
|
t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
695
692
|
const s = t.precision ? "+" : "?";
|
|
696
693
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${s}`;
|
|
697
694
|
}
|
|
698
|
-
function
|
|
699
|
-
return new RegExp(`^${
|
|
695
|
+
function Nt(t) {
|
|
696
|
+
return new RegExp(`^${Je(t)}$`);
|
|
700
697
|
}
|
|
701
|
-
function
|
|
702
|
-
let e = `${
|
|
698
|
+
function At(t) {
|
|
699
|
+
let e = `${He}T${Je(t)}`;
|
|
703
700
|
const s = [];
|
|
704
701
|
return s.push(t.local ? "Z?" : "Z"), t.offset && s.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${s.join("|")})`, new RegExp(`^${e}$`);
|
|
705
702
|
}
|
|
706
|
-
function
|
|
707
|
-
return !!((e === "v4" || !e) &&
|
|
703
|
+
function Ot(t, e) {
|
|
704
|
+
return !!((e === "v4" || !e) && wt.test(t) || (e === "v6" || !e) && Tt.test(t));
|
|
708
705
|
}
|
|
709
|
-
function
|
|
710
|
-
if (!
|
|
706
|
+
function Mt(t, e) {
|
|
707
|
+
if (!vt.test(t))
|
|
711
708
|
return !1;
|
|
712
709
|
try {
|
|
713
710
|
const [s] = t.split(".");
|
|
@@ -719,10 +716,10 @@ function Tt(t, e) {
|
|
|
719
716
|
return !1;
|
|
720
717
|
}
|
|
721
718
|
}
|
|
722
|
-
function
|
|
723
|
-
return !!((e === "v4" || !e) &&
|
|
719
|
+
function Zt(t, e) {
|
|
720
|
+
return !!((e === "v4" || !e) && St.test(t) || (e === "v6" || !e) && Rt.test(t));
|
|
724
721
|
}
|
|
725
|
-
class
|
|
722
|
+
class P extends v {
|
|
726
723
|
_parse(e) {
|
|
727
724
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== f.string) {
|
|
728
725
|
const r = this._getOrReturnCtx(e);
|
|
@@ -732,7 +729,7 @@ class q extends _ {
|
|
|
732
729
|
received: r.parsedType
|
|
733
730
|
}), m;
|
|
734
731
|
}
|
|
735
|
-
const n = new
|
|
732
|
+
const n = new R();
|
|
736
733
|
let a;
|
|
737
734
|
for (const r of this._def.checks)
|
|
738
735
|
if (r.kind === "min")
|
|
@@ -771,43 +768,43 @@ class q extends _ {
|
|
|
771
768
|
message: r.message
|
|
772
769
|
}), n.dirty());
|
|
773
770
|
} else if (r.kind === "email")
|
|
774
|
-
|
|
771
|
+
bt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
775
772
|
validation: "email",
|
|
776
773
|
code: c.invalid_string,
|
|
777
774
|
message: r.message
|
|
778
775
|
}), n.dirty());
|
|
779
776
|
else if (r.kind === "emoji")
|
|
780
|
-
|
|
777
|
+
be || (be = new RegExp(kt, "u")), be.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
781
778
|
validation: "emoji",
|
|
782
779
|
code: c.invalid_string,
|
|
783
780
|
message: r.message
|
|
784
781
|
}), n.dirty());
|
|
785
782
|
else if (r.kind === "uuid")
|
|
786
|
-
|
|
783
|
+
yt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
787
784
|
validation: "uuid",
|
|
788
785
|
code: c.invalid_string,
|
|
789
786
|
message: r.message
|
|
790
787
|
}), n.dirty());
|
|
791
788
|
else if (r.kind === "nanoid")
|
|
792
|
-
|
|
789
|
+
_t.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
793
790
|
validation: "nanoid",
|
|
794
791
|
code: c.invalid_string,
|
|
795
792
|
message: r.message
|
|
796
793
|
}), n.dirty());
|
|
797
794
|
else if (r.kind === "cuid")
|
|
798
|
-
|
|
795
|
+
mt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
799
796
|
validation: "cuid",
|
|
800
797
|
code: c.invalid_string,
|
|
801
798
|
message: r.message
|
|
802
799
|
}), n.dirty());
|
|
803
800
|
else if (r.kind === "cuid2")
|
|
804
|
-
|
|
801
|
+
pt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
805
802
|
validation: "cuid2",
|
|
806
803
|
code: c.invalid_string,
|
|
807
804
|
message: r.message
|
|
808
805
|
}), n.dirty());
|
|
809
806
|
else if (r.kind === "ulid")
|
|
810
|
-
|
|
807
|
+
gt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
811
808
|
validation: "ulid",
|
|
812
809
|
code: c.invalid_string,
|
|
813
810
|
message: r.message
|
|
@@ -838,43 +835,43 @@ class q extends _ {
|
|
|
838
835
|
code: c.invalid_string,
|
|
839
836
|
validation: { endsWith: r.value },
|
|
840
837
|
message: r.message
|
|
841
|
-
}), n.dirty()) : r.kind === "datetime" ?
|
|
838
|
+
}), n.dirty()) : r.kind === "datetime" ? At(r).test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
842
839
|
code: c.invalid_string,
|
|
843
840
|
validation: "datetime",
|
|
844
841
|
message: r.message
|
|
845
|
-
}), n.dirty()) : r.kind === "date" ?
|
|
842
|
+
}), n.dirty()) : r.kind === "date" ? Et.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
846
843
|
code: c.invalid_string,
|
|
847
844
|
validation: "date",
|
|
848
845
|
message: r.message
|
|
849
|
-
}), n.dirty()) : r.kind === "time" ?
|
|
846
|
+
}), n.dirty()) : r.kind === "time" ? Nt(r).test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
850
847
|
code: c.invalid_string,
|
|
851
848
|
validation: "time",
|
|
852
849
|
message: r.message
|
|
853
|
-
}), n.dirty()) : r.kind === "duration" ?
|
|
850
|
+
}), n.dirty()) : r.kind === "duration" ? xt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
854
851
|
validation: "duration",
|
|
855
852
|
code: c.invalid_string,
|
|
856
853
|
message: r.message
|
|
857
|
-
}), n.dirty()) : r.kind === "ip" ?
|
|
854
|
+
}), n.dirty()) : r.kind === "ip" ? Ot(e.data, r.version) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
858
855
|
validation: "ip",
|
|
859
856
|
code: c.invalid_string,
|
|
860
857
|
message: r.message
|
|
861
|
-
}), n.dirty()) : r.kind === "jwt" ?
|
|
858
|
+
}), n.dirty()) : r.kind === "jwt" ? Mt(e.data, r.alg) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
862
859
|
validation: "jwt",
|
|
863
860
|
code: c.invalid_string,
|
|
864
861
|
message: r.message
|
|
865
|
-
}), n.dirty()) : r.kind === "cidr" ?
|
|
862
|
+
}), n.dirty()) : r.kind === "cidr" ? Zt(e.data, r.version) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
866
863
|
validation: "cidr",
|
|
867
864
|
code: c.invalid_string,
|
|
868
865
|
message: r.message
|
|
869
|
-
}), n.dirty()) : r.kind === "base64" ?
|
|
866
|
+
}), n.dirty()) : r.kind === "base64" ? Ct.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
870
867
|
validation: "base64",
|
|
871
868
|
code: c.invalid_string,
|
|
872
869
|
message: r.message
|
|
873
|
-
}), n.dirty()) : r.kind === "base64url" ?
|
|
870
|
+
}), n.dirty()) : r.kind === "base64url" ? It.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
874
871
|
validation: "base64url",
|
|
875
872
|
code: c.invalid_string,
|
|
876
873
|
message: r.message
|
|
877
|
-
}), n.dirty()) :
|
|
874
|
+
}), n.dirty()) : x.assertNever(r);
|
|
878
875
|
return { status: n.value, value: e.data };
|
|
879
876
|
}
|
|
880
877
|
_regex(e, s, n) {
|
|
@@ -885,7 +882,7 @@ class q extends _ {
|
|
|
885
882
|
});
|
|
886
883
|
}
|
|
887
884
|
_addCheck(e) {
|
|
888
|
-
return new
|
|
885
|
+
return new P({
|
|
889
886
|
...this._def,
|
|
890
887
|
checks: [...this._def.checks, e]
|
|
891
888
|
});
|
|
@@ -1021,19 +1018,19 @@ class q extends _ {
|
|
|
1021
1018
|
return this.min(1, h.errToObj(e));
|
|
1022
1019
|
}
|
|
1023
1020
|
trim() {
|
|
1024
|
-
return new
|
|
1021
|
+
return new P({
|
|
1025
1022
|
...this._def,
|
|
1026
1023
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
1027
1024
|
});
|
|
1028
1025
|
}
|
|
1029
1026
|
toLowerCase() {
|
|
1030
|
-
return new
|
|
1027
|
+
return new P({
|
|
1031
1028
|
...this._def,
|
|
1032
1029
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
1033
1030
|
});
|
|
1034
1031
|
}
|
|
1035
1032
|
toUpperCase() {
|
|
1036
|
-
return new
|
|
1033
|
+
return new P({
|
|
1037
1034
|
...this._def,
|
|
1038
1035
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
1039
1036
|
});
|
|
@@ -1099,17 +1096,17 @@ class q extends _ {
|
|
|
1099
1096
|
return e;
|
|
1100
1097
|
}
|
|
1101
1098
|
}
|
|
1102
|
-
|
|
1099
|
+
P.create = (t) => new P({
|
|
1103
1100
|
checks: [],
|
|
1104
1101
|
typeName: p.ZodString,
|
|
1105
1102
|
coerce: t?.coerce ?? !1,
|
|
1106
|
-
...
|
|
1103
|
+
...y(t)
|
|
1107
1104
|
});
|
|
1108
|
-
function
|
|
1105
|
+
function qt(t, e) {
|
|
1109
1106
|
const s = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, a = s > n ? s : n, r = Number.parseInt(t.toFixed(a).replace(".", "")), i = Number.parseInt(e.toFixed(a).replace(".", ""));
|
|
1110
1107
|
return r % i / 10 ** a;
|
|
1111
1108
|
}
|
|
1112
|
-
class
|
|
1109
|
+
class X extends v {
|
|
1113
1110
|
constructor() {
|
|
1114
1111
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1115
1112
|
}
|
|
@@ -1123,9 +1120,9 @@ class F extends _ {
|
|
|
1123
1120
|
}), m;
|
|
1124
1121
|
}
|
|
1125
1122
|
let n;
|
|
1126
|
-
const a = new
|
|
1123
|
+
const a = new R();
|
|
1127
1124
|
for (const r of this._def.checks)
|
|
1128
|
-
r.kind === "int" ?
|
|
1125
|
+
r.kind === "int" ? x.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1129
1126
|
code: c.invalid_type,
|
|
1130
1127
|
expected: "integer",
|
|
1131
1128
|
received: "float",
|
|
@@ -1144,14 +1141,14 @@ class F extends _ {
|
|
|
1144
1141
|
inclusive: r.inclusive,
|
|
1145
1142
|
exact: !1,
|
|
1146
1143
|
message: r.message
|
|
1147
|
-
}), a.dirty()) : r.kind === "multipleOf" ?
|
|
1144
|
+
}), a.dirty()) : r.kind === "multipleOf" ? qt(e.data, r.value) !== 0 && (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1148
1145
|
code: c.not_multiple_of,
|
|
1149
1146
|
multipleOf: r.value,
|
|
1150
1147
|
message: r.message
|
|
1151
1148
|
}), a.dirty()) : r.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1152
1149
|
code: c.not_finite,
|
|
1153
1150
|
message: r.message
|
|
1154
|
-
}), a.dirty()) :
|
|
1151
|
+
}), a.dirty()) : x.assertNever(r);
|
|
1155
1152
|
return { status: a.value, value: e.data };
|
|
1156
1153
|
}
|
|
1157
1154
|
gte(e, s) {
|
|
@@ -1167,7 +1164,7 @@ class F extends _ {
|
|
|
1167
1164
|
return this.setLimit("max", e, !1, h.toString(s));
|
|
1168
1165
|
}
|
|
1169
1166
|
setLimit(e, s, n, a) {
|
|
1170
|
-
return new
|
|
1167
|
+
return new X({
|
|
1171
1168
|
...this._def,
|
|
1172
1169
|
checks: [
|
|
1173
1170
|
...this._def.checks,
|
|
@@ -1181,7 +1178,7 @@ class F extends _ {
|
|
|
1181
1178
|
});
|
|
1182
1179
|
}
|
|
1183
1180
|
_addCheck(e) {
|
|
1184
|
-
return new
|
|
1181
|
+
return new X({
|
|
1185
1182
|
...this._def,
|
|
1186
1183
|
checks: [...this._def.checks, e]
|
|
1187
1184
|
});
|
|
@@ -1263,7 +1260,7 @@ class F extends _ {
|
|
|
1263
1260
|
return e;
|
|
1264
1261
|
}
|
|
1265
1262
|
get isInt() {
|
|
1266
|
-
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" &&
|
|
1263
|
+
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && x.isInteger(e.value));
|
|
1267
1264
|
}
|
|
1268
1265
|
get isFinite() {
|
|
1269
1266
|
let e = null, s = null;
|
|
@@ -1275,13 +1272,13 @@ class F extends _ {
|
|
|
1275
1272
|
return Number.isFinite(s) && Number.isFinite(e);
|
|
1276
1273
|
}
|
|
1277
1274
|
}
|
|
1278
|
-
|
|
1275
|
+
X.create = (t) => new X({
|
|
1279
1276
|
checks: [],
|
|
1280
1277
|
typeName: p.ZodNumber,
|
|
1281
1278
|
coerce: t?.coerce || !1,
|
|
1282
|
-
...
|
|
1279
|
+
...y(t)
|
|
1283
1280
|
});
|
|
1284
|
-
class
|
|
1281
|
+
class ae extends v {
|
|
1285
1282
|
constructor() {
|
|
1286
1283
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1287
1284
|
}
|
|
@@ -1295,7 +1292,7 @@ class ne extends _ {
|
|
|
1295
1292
|
if (this._getType(e) !== f.bigint)
|
|
1296
1293
|
return this._getInvalidInput(e);
|
|
1297
1294
|
let n;
|
|
1298
|
-
const a = new
|
|
1295
|
+
const a = new R();
|
|
1299
1296
|
for (const r of this._def.checks)
|
|
1300
1297
|
r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1301
1298
|
code: c.too_small,
|
|
@@ -1313,7 +1310,7 @@ class ne extends _ {
|
|
|
1313
1310
|
code: c.not_multiple_of,
|
|
1314
1311
|
multipleOf: r.value,
|
|
1315
1312
|
message: r.message
|
|
1316
|
-
}), a.dirty()) :
|
|
1313
|
+
}), a.dirty()) : x.assertNever(r);
|
|
1317
1314
|
return { status: a.value, value: e.data };
|
|
1318
1315
|
}
|
|
1319
1316
|
_getInvalidInput(e) {
|
|
@@ -1337,7 +1334,7 @@ class ne extends _ {
|
|
|
1337
1334
|
return this.setLimit("max", e, !1, h.toString(s));
|
|
1338
1335
|
}
|
|
1339
1336
|
setLimit(e, s, n, a) {
|
|
1340
|
-
return new
|
|
1337
|
+
return new ae({
|
|
1341
1338
|
...this._def,
|
|
1342
1339
|
checks: [
|
|
1343
1340
|
...this._def.checks,
|
|
@@ -1351,7 +1348,7 @@ class ne extends _ {
|
|
|
1351
1348
|
});
|
|
1352
1349
|
}
|
|
1353
1350
|
_addCheck(e) {
|
|
1354
|
-
return new
|
|
1351
|
+
return new ae({
|
|
1355
1352
|
...this._def,
|
|
1356
1353
|
checks: [...this._def.checks, e]
|
|
1357
1354
|
});
|
|
@@ -1408,13 +1405,13 @@ class ne extends _ {
|
|
|
1408
1405
|
return e;
|
|
1409
1406
|
}
|
|
1410
1407
|
}
|
|
1411
|
-
|
|
1408
|
+
ae.create = (t) => new ae({
|
|
1412
1409
|
checks: [],
|
|
1413
1410
|
typeName: p.ZodBigInt,
|
|
1414
1411
|
coerce: t?.coerce ?? !1,
|
|
1415
|
-
...
|
|
1412
|
+
...y(t)
|
|
1416
1413
|
});
|
|
1417
|
-
class
|
|
1414
|
+
class we extends v {
|
|
1418
1415
|
_parse(e) {
|
|
1419
1416
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
|
|
1420
1417
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1427,12 +1424,12 @@ class ye extends _ {
|
|
|
1427
1424
|
return I(e.data);
|
|
1428
1425
|
}
|
|
1429
1426
|
}
|
|
1430
|
-
|
|
1427
|
+
we.create = (t) => new we({
|
|
1431
1428
|
typeName: p.ZodBoolean,
|
|
1432
1429
|
coerce: t?.coerce || !1,
|
|
1433
|
-
...
|
|
1430
|
+
...y(t)
|
|
1434
1431
|
});
|
|
1435
|
-
class ce extends
|
|
1432
|
+
class ce extends v {
|
|
1436
1433
|
_parse(e) {
|
|
1437
1434
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
|
|
1438
1435
|
const r = this._getOrReturnCtx(e);
|
|
@@ -1448,7 +1445,7 @@ class ce extends _ {
|
|
|
1448
1445
|
code: c.invalid_date
|
|
1449
1446
|
}), m;
|
|
1450
1447
|
}
|
|
1451
|
-
const n = new
|
|
1448
|
+
const n = new R();
|
|
1452
1449
|
let a;
|
|
1453
1450
|
for (const r of this._def.checks)
|
|
1454
1451
|
r.kind === "min" ? e.data.getTime() < r.value && (a = this._getOrReturnCtx(e, a), u(a, {
|
|
@@ -1465,7 +1462,7 @@ class ce extends _ {
|
|
|
1465
1462
|
exact: !1,
|
|
1466
1463
|
maximum: r.value,
|
|
1467
1464
|
type: "date"
|
|
1468
|
-
}), n.dirty()) :
|
|
1465
|
+
}), n.dirty()) : x.assertNever(r);
|
|
1469
1466
|
return {
|
|
1470
1467
|
status: n.value,
|
|
1471
1468
|
value: new Date(e.data.getTime())
|
|
@@ -1508,9 +1505,9 @@ ce.create = (t) => new ce({
|
|
|
1508
1505
|
checks: [],
|
|
1509
1506
|
coerce: t?.coerce || !1,
|
|
1510
1507
|
typeName: p.ZodDate,
|
|
1511
|
-
...
|
|
1508
|
+
...y(t)
|
|
1512
1509
|
});
|
|
1513
|
-
class
|
|
1510
|
+
class Ge extends v {
|
|
1514
1511
|
_parse(e) {
|
|
1515
1512
|
if (this._getType(e) !== f.symbol) {
|
|
1516
1513
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1523,11 +1520,11 @@ class qe extends _ {
|
|
|
1523
1520
|
return I(e.data);
|
|
1524
1521
|
}
|
|
1525
1522
|
}
|
|
1526
|
-
|
|
1523
|
+
Ge.create = (t) => new Ge({
|
|
1527
1524
|
typeName: p.ZodSymbol,
|
|
1528
|
-
...
|
|
1525
|
+
...y(t)
|
|
1529
1526
|
});
|
|
1530
|
-
class
|
|
1527
|
+
class Se extends v {
|
|
1531
1528
|
_parse(e) {
|
|
1532
1529
|
if (this._getType(e) !== f.undefined) {
|
|
1533
1530
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1540,11 +1537,11 @@ class je extends _ {
|
|
|
1540
1537
|
return I(e.data);
|
|
1541
1538
|
}
|
|
1542
1539
|
}
|
|
1543
|
-
|
|
1540
|
+
Se.create = (t) => new Se({
|
|
1544
1541
|
typeName: p.ZodUndefined,
|
|
1545
|
-
...
|
|
1542
|
+
...y(t)
|
|
1546
1543
|
});
|
|
1547
|
-
class
|
|
1544
|
+
class Te extends v {
|
|
1548
1545
|
_parse(e) {
|
|
1549
1546
|
if (this._getType(e) !== f.null) {
|
|
1550
1547
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1557,11 +1554,11 @@ class Pe extends _ {
|
|
|
1557
1554
|
return I(e.data);
|
|
1558
1555
|
}
|
|
1559
1556
|
}
|
|
1560
|
-
|
|
1557
|
+
Te.create = (t) => new Te({
|
|
1561
1558
|
typeName: p.ZodNull,
|
|
1562
|
-
...
|
|
1559
|
+
...y(t)
|
|
1563
1560
|
});
|
|
1564
|
-
class
|
|
1561
|
+
class ze extends v {
|
|
1565
1562
|
constructor() {
|
|
1566
1563
|
super(...arguments), this._any = !0;
|
|
1567
1564
|
}
|
|
@@ -1569,11 +1566,11 @@ class Le extends _ {
|
|
|
1569
1566
|
return I(e.data);
|
|
1570
1567
|
}
|
|
1571
1568
|
}
|
|
1572
|
-
|
|
1569
|
+
ze.create = (t) => new ze({
|
|
1573
1570
|
typeName: p.ZodAny,
|
|
1574
|
-
...
|
|
1571
|
+
...y(t)
|
|
1575
1572
|
});
|
|
1576
|
-
class
|
|
1573
|
+
class Re extends v {
|
|
1577
1574
|
constructor() {
|
|
1578
1575
|
super(...arguments), this._unknown = !0;
|
|
1579
1576
|
}
|
|
@@ -1581,11 +1578,11 @@ class _e extends _ {
|
|
|
1581
1578
|
return I(e.data);
|
|
1582
1579
|
}
|
|
1583
1580
|
}
|
|
1584
|
-
|
|
1581
|
+
Re.create = (t) => new Re({
|
|
1585
1582
|
typeName: p.ZodUnknown,
|
|
1586
|
-
...
|
|
1583
|
+
...y(t)
|
|
1587
1584
|
});
|
|
1588
|
-
class
|
|
1585
|
+
class B extends v {
|
|
1589
1586
|
_parse(e) {
|
|
1590
1587
|
const s = this._getOrReturnCtx(e);
|
|
1591
1588
|
return u(s, {
|
|
@@ -1595,11 +1592,11 @@ class $ extends _ {
|
|
|
1595
1592
|
}), m;
|
|
1596
1593
|
}
|
|
1597
1594
|
}
|
|
1598
|
-
|
|
1595
|
+
B.create = (t) => new B({
|
|
1599
1596
|
typeName: p.ZodNever,
|
|
1600
|
-
...
|
|
1597
|
+
...y(t)
|
|
1601
1598
|
});
|
|
1602
|
-
class
|
|
1599
|
+
class De extends v {
|
|
1603
1600
|
_parse(e) {
|
|
1604
1601
|
if (this._getType(e) !== f.undefined) {
|
|
1605
1602
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1612,11 +1609,11 @@ class $e extends _ {
|
|
|
1612
1609
|
return I(e.data);
|
|
1613
1610
|
}
|
|
1614
1611
|
}
|
|
1615
|
-
|
|
1612
|
+
De.create = (t) => new De({
|
|
1616
1613
|
typeName: p.ZodVoid,
|
|
1617
|
-
...
|
|
1614
|
+
...y(t)
|
|
1618
1615
|
});
|
|
1619
|
-
class
|
|
1616
|
+
class A extends v {
|
|
1620
1617
|
_parse(e) {
|
|
1621
1618
|
const { ctx: s, status: n } = this._processInputParams(e), a = this._def;
|
|
1622
1619
|
if (s.parsedType !== f.array)
|
|
@@ -1652,27 +1649,27 @@ class N extends _ {
|
|
|
1652
1649
|
exact: !1,
|
|
1653
1650
|
message: a.maxLength.message
|
|
1654
1651
|
}), n.dirty()), s.common.async)
|
|
1655
|
-
return Promise.all([...s.data].map((i, o) => a.type._parseAsync(new
|
|
1656
|
-
const r = [...s.data].map((i, o) => a.type._parseSync(new
|
|
1657
|
-
return
|
|
1652
|
+
return Promise.all([...s.data].map((i, o) => a.type._parseAsync(new O(s, i, s.path, o)))).then((i) => R.mergeArray(n, i));
|
|
1653
|
+
const r = [...s.data].map((i, o) => a.type._parseSync(new O(s, i, s.path, o)));
|
|
1654
|
+
return R.mergeArray(n, r);
|
|
1658
1655
|
}
|
|
1659
1656
|
get element() {
|
|
1660
1657
|
return this._def.type;
|
|
1661
1658
|
}
|
|
1662
1659
|
min(e, s) {
|
|
1663
|
-
return new
|
|
1660
|
+
return new A({
|
|
1664
1661
|
...this._def,
|
|
1665
1662
|
minLength: { value: e, message: h.toString(s) }
|
|
1666
1663
|
});
|
|
1667
1664
|
}
|
|
1668
1665
|
max(e, s) {
|
|
1669
|
-
return new
|
|
1666
|
+
return new A({
|
|
1670
1667
|
...this._def,
|
|
1671
1668
|
maxLength: { value: e, message: h.toString(s) }
|
|
1672
1669
|
});
|
|
1673
1670
|
}
|
|
1674
1671
|
length(e, s) {
|
|
1675
|
-
return new
|
|
1672
|
+
return new A({
|
|
1676
1673
|
...this._def,
|
|
1677
1674
|
exactLength: { value: e, message: h.toString(s) }
|
|
1678
1675
|
});
|
|
@@ -1681,38 +1678,38 @@ class N extends _ {
|
|
|
1681
1678
|
return this.min(1, e);
|
|
1682
1679
|
}
|
|
1683
1680
|
}
|
|
1684
|
-
|
|
1681
|
+
A.create = (t, e) => new A({
|
|
1685
1682
|
type: t,
|
|
1686
1683
|
minLength: null,
|
|
1687
1684
|
maxLength: null,
|
|
1688
1685
|
exactLength: null,
|
|
1689
1686
|
typeName: p.ZodArray,
|
|
1690
|
-
...
|
|
1687
|
+
...y(e)
|
|
1691
1688
|
});
|
|
1692
|
-
function
|
|
1689
|
+
function J(t) {
|
|
1693
1690
|
if (t instanceof w) {
|
|
1694
1691
|
const e = {};
|
|
1695
1692
|
for (const s in t.shape) {
|
|
1696
1693
|
const n = t.shape[s];
|
|
1697
|
-
e[s] =
|
|
1694
|
+
e[s] = $.create(J(n));
|
|
1698
1695
|
}
|
|
1699
1696
|
return new w({
|
|
1700
1697
|
...t._def,
|
|
1701
1698
|
shape: () => e
|
|
1702
1699
|
});
|
|
1703
|
-
} else return t instanceof
|
|
1700
|
+
} else return t instanceof A ? new A({
|
|
1704
1701
|
...t._def,
|
|
1705
|
-
type:
|
|
1706
|
-
}) : t instanceof
|
|
1702
|
+
type: J(t.element)
|
|
1703
|
+
}) : t instanceof $ ? $.create(J(t.unwrap())) : t instanceof Q ? Q.create(J(t.unwrap())) : t instanceof G ? G.create(t.items.map((e) => J(e))) : t;
|
|
1707
1704
|
}
|
|
1708
|
-
class w extends
|
|
1705
|
+
class w extends v {
|
|
1709
1706
|
constructor() {
|
|
1710
1707
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1711
1708
|
}
|
|
1712
1709
|
_getCached() {
|
|
1713
1710
|
if (this._cached !== null)
|
|
1714
1711
|
return this._cached;
|
|
1715
|
-
const e = this._def.shape(), s =
|
|
1712
|
+
const e = this._def.shape(), s = x.objectKeys(e);
|
|
1716
1713
|
return this._cached = { shape: e, keys: s }, this._cached;
|
|
1717
1714
|
}
|
|
1718
1715
|
_parse(e) {
|
|
@@ -1725,25 +1722,25 @@ class w extends _ {
|
|
|
1725
1722
|
}), m;
|
|
1726
1723
|
}
|
|
1727
1724
|
const { status: n, ctx: a } = this._processInputParams(e), { shape: r, keys: i } = this._getCached(), o = [];
|
|
1728
|
-
if (!(this._def.catchall instanceof
|
|
1725
|
+
if (!(this._def.catchall instanceof B && this._def.unknownKeys === "strip"))
|
|
1729
1726
|
for (const l in a.data)
|
|
1730
1727
|
i.includes(l) || o.push(l);
|
|
1731
1728
|
const d = [];
|
|
1732
1729
|
for (const l of i) {
|
|
1733
|
-
const
|
|
1730
|
+
const _ = r[l], M = a.data[l];
|
|
1734
1731
|
d.push({
|
|
1735
1732
|
key: { status: "valid", value: l },
|
|
1736
|
-
value:
|
|
1733
|
+
value: _._parse(new O(a, M, a.path, l)),
|
|
1737
1734
|
alwaysSet: l in a.data
|
|
1738
1735
|
});
|
|
1739
1736
|
}
|
|
1740
|
-
if (this._def.catchall instanceof
|
|
1737
|
+
if (this._def.catchall instanceof B) {
|
|
1741
1738
|
const l = this._def.unknownKeys;
|
|
1742
1739
|
if (l === "passthrough")
|
|
1743
|
-
for (const
|
|
1740
|
+
for (const _ of o)
|
|
1744
1741
|
d.push({
|
|
1745
|
-
key: { status: "valid", value:
|
|
1746
|
-
value: { status: "valid", value: a.data[
|
|
1742
|
+
key: { status: "valid", value: _ },
|
|
1743
|
+
value: { status: "valid", value: a.data[_] }
|
|
1747
1744
|
});
|
|
1748
1745
|
else if (l === "strict")
|
|
1749
1746
|
o.length > 0 && (u(a, {
|
|
@@ -1753,30 +1750,30 @@ class w extends _ {
|
|
|
1753
1750
|
else if (l !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
1754
1751
|
} else {
|
|
1755
1752
|
const l = this._def.catchall;
|
|
1756
|
-
for (const
|
|
1757
|
-
const
|
|
1753
|
+
for (const _ of o) {
|
|
1754
|
+
const M = a.data[_];
|
|
1758
1755
|
d.push({
|
|
1759
|
-
key: { status: "valid", value:
|
|
1756
|
+
key: { status: "valid", value: _ },
|
|
1760
1757
|
value: l._parse(
|
|
1761
|
-
new
|
|
1758
|
+
new O(a, M, a.path, _)
|
|
1762
1759
|
//, ctx.child(key), value, getParsedType(value)
|
|
1763
1760
|
),
|
|
1764
|
-
alwaysSet:
|
|
1761
|
+
alwaysSet: _ in a.data
|
|
1765
1762
|
});
|
|
1766
1763
|
}
|
|
1767
1764
|
}
|
|
1768
1765
|
return a.common.async ? Promise.resolve().then(async () => {
|
|
1769
1766
|
const l = [];
|
|
1770
|
-
for (const
|
|
1771
|
-
const
|
|
1767
|
+
for (const _ of d) {
|
|
1768
|
+
const M = await _.key, Z = await _.value;
|
|
1772
1769
|
l.push({
|
|
1773
|
-
key:
|
|
1774
|
-
value:
|
|
1775
|
-
alwaysSet:
|
|
1770
|
+
key: M,
|
|
1771
|
+
value: Z,
|
|
1772
|
+
alwaysSet: _.alwaysSet
|
|
1776
1773
|
});
|
|
1777
1774
|
}
|
|
1778
1775
|
return l;
|
|
1779
|
-
}).then((l) =>
|
|
1776
|
+
}).then((l) => R.mergeObjectSync(n, l)) : R.mergeObjectSync(n, d);
|
|
1780
1777
|
}
|
|
1781
1778
|
get shape() {
|
|
1782
1779
|
return this._def.shape();
|
|
@@ -1918,7 +1915,7 @@ class w extends _ {
|
|
|
1918
1915
|
}
|
|
1919
1916
|
pick(e) {
|
|
1920
1917
|
const s = {};
|
|
1921
|
-
for (const n of
|
|
1918
|
+
for (const n of x.objectKeys(e))
|
|
1922
1919
|
e[n] && this.shape[n] && (s[n] = this.shape[n]);
|
|
1923
1920
|
return new w({
|
|
1924
1921
|
...this._def,
|
|
@@ -1927,7 +1924,7 @@ class w extends _ {
|
|
|
1927
1924
|
}
|
|
1928
1925
|
omit(e) {
|
|
1929
1926
|
const s = {};
|
|
1930
|
-
for (const n of
|
|
1927
|
+
for (const n of x.objectKeys(this.shape))
|
|
1931
1928
|
e[n] || (s[n] = this.shape[n]);
|
|
1932
1929
|
return new w({
|
|
1933
1930
|
...this._def,
|
|
@@ -1938,11 +1935,11 @@ class w extends _ {
|
|
|
1938
1935
|
* @deprecated
|
|
1939
1936
|
*/
|
|
1940
1937
|
deepPartial() {
|
|
1941
|
-
return
|
|
1938
|
+
return J(this);
|
|
1942
1939
|
}
|
|
1943
1940
|
partial(e) {
|
|
1944
1941
|
const s = {};
|
|
1945
|
-
for (const n of
|
|
1942
|
+
for (const n of x.objectKeys(this.shape)) {
|
|
1946
1943
|
const a = this.shape[n];
|
|
1947
1944
|
e && !e[n] ? s[n] = a : s[n] = a.optional();
|
|
1948
1945
|
}
|
|
@@ -1953,12 +1950,12 @@ class w extends _ {
|
|
|
1953
1950
|
}
|
|
1954
1951
|
required(e) {
|
|
1955
1952
|
const s = {};
|
|
1956
|
-
for (const n of
|
|
1953
|
+
for (const n of x.objectKeys(this.shape))
|
|
1957
1954
|
if (e && !e[n])
|
|
1958
1955
|
s[n] = this.shape[n];
|
|
1959
1956
|
else {
|
|
1960
1957
|
let r = this.shape[n];
|
|
1961
|
-
for (; r instanceof
|
|
1958
|
+
for (; r instanceof $; )
|
|
1962
1959
|
r = r._def.innerType;
|
|
1963
1960
|
s[n] = r;
|
|
1964
1961
|
}
|
|
@@ -1968,31 +1965,31 @@ class w extends _ {
|
|
|
1968
1965
|
});
|
|
1969
1966
|
}
|
|
1970
1967
|
keyof() {
|
|
1971
|
-
return
|
|
1968
|
+
return Ye(x.objectKeys(this.shape));
|
|
1972
1969
|
}
|
|
1973
1970
|
}
|
|
1974
1971
|
w.create = (t, e) => new w({
|
|
1975
1972
|
shape: () => t,
|
|
1976
1973
|
unknownKeys: "strip",
|
|
1977
|
-
catchall:
|
|
1974
|
+
catchall: B.create(),
|
|
1978
1975
|
typeName: p.ZodObject,
|
|
1979
|
-
...
|
|
1976
|
+
...y(e)
|
|
1980
1977
|
});
|
|
1981
1978
|
w.strictCreate = (t, e) => new w({
|
|
1982
1979
|
shape: () => t,
|
|
1983
1980
|
unknownKeys: "strict",
|
|
1984
|
-
catchall:
|
|
1981
|
+
catchall: B.create(),
|
|
1985
1982
|
typeName: p.ZodObject,
|
|
1986
|
-
...
|
|
1983
|
+
...y(e)
|
|
1987
1984
|
});
|
|
1988
1985
|
w.lazycreate = (t, e) => new w({
|
|
1989
1986
|
shape: t,
|
|
1990
1987
|
unknownKeys: "strip",
|
|
1991
|
-
catchall:
|
|
1988
|
+
catchall: B.create(),
|
|
1992
1989
|
typeName: p.ZodObject,
|
|
1993
|
-
...
|
|
1990
|
+
...y(e)
|
|
1994
1991
|
});
|
|
1995
|
-
class ue extends
|
|
1992
|
+
class ue extends v {
|
|
1996
1993
|
_parse(e) {
|
|
1997
1994
|
const { ctx: s } = this._processInputParams(e), n = this._def.options;
|
|
1998
1995
|
function a(r) {
|
|
@@ -2002,7 +1999,7 @@ class ue extends _ {
|
|
|
2002
1999
|
for (const o of r)
|
|
2003
2000
|
if (o.result.status === "dirty")
|
|
2004
2001
|
return s.common.issues.push(...o.ctx.common.issues), o.result;
|
|
2005
|
-
const i = r.map((o) => new
|
|
2002
|
+
const i = r.map((o) => new L(o.ctx.common.issues));
|
|
2006
2003
|
return u(s, {
|
|
2007
2004
|
code: c.invalid_union,
|
|
2008
2005
|
unionErrors: i
|
|
@@ -2038,18 +2035,18 @@ class ue extends _ {
|
|
|
2038
2035
|
issues: []
|
|
2039
2036
|
},
|
|
2040
2037
|
parent: null
|
|
2041
|
-
},
|
|
2038
|
+
}, _ = d._parseSync({
|
|
2042
2039
|
data: s.data,
|
|
2043
2040
|
path: s.path,
|
|
2044
2041
|
parent: l
|
|
2045
2042
|
});
|
|
2046
|
-
if (
|
|
2047
|
-
return
|
|
2048
|
-
|
|
2043
|
+
if (_.status === "valid")
|
|
2044
|
+
return _;
|
|
2045
|
+
_.status === "dirty" && !r && (r = { result: _, ctx: l }), l.common.issues.length && i.push(l.common.issues);
|
|
2049
2046
|
}
|
|
2050
2047
|
if (r)
|
|
2051
2048
|
return s.common.issues.push(...r.ctx.common.issues), r.result;
|
|
2052
|
-
const o = i.map((d) => new
|
|
2049
|
+
const o = i.map((d) => new L(d));
|
|
2053
2050
|
return u(s, {
|
|
2054
2051
|
code: c.invalid_union,
|
|
2055
2052
|
unionErrors: o
|
|
@@ -2063,16 +2060,79 @@ class ue extends _ {
|
|
|
2063
2060
|
ue.create = (t, e) => new ue({
|
|
2064
2061
|
options: t,
|
|
2065
2062
|
typeName: p.ZodUnion,
|
|
2066
|
-
...
|
|
2063
|
+
...y(e)
|
|
2067
2064
|
});
|
|
2068
|
-
|
|
2069
|
-
|
|
2065
|
+
const j = (t) => t instanceof fe ? j(t.schema) : t instanceof D ? j(t.innerType()) : t instanceof he ? [t.value] : t instanceof z ? t.options : t instanceof Ie ? x.objectValues(t.enum) : t instanceof pe ? j(t._def.innerType) : t instanceof Se ? [void 0] : t instanceof Te ? [null] : t instanceof $ ? [void 0, ...j(t.unwrap())] : t instanceof Q ? [null, ...j(t.unwrap())] : t instanceof Xe || t instanceof ye ? j(t.unwrap()) : t instanceof ge ? j(t._def.innerType) : [];
|
|
2066
|
+
class Ae extends v {
|
|
2067
|
+
_parse(e) {
|
|
2068
|
+
const { ctx: s } = this._processInputParams(e);
|
|
2069
|
+
if (s.parsedType !== f.object)
|
|
2070
|
+
return u(s, {
|
|
2071
|
+
code: c.invalid_type,
|
|
2072
|
+
expected: f.object,
|
|
2073
|
+
received: s.parsedType
|
|
2074
|
+
}), m;
|
|
2075
|
+
const n = this.discriminator, a = s.data[n], r = this.optionsMap.get(a);
|
|
2076
|
+
return r ? s.common.async ? r._parseAsync({
|
|
2077
|
+
data: s.data,
|
|
2078
|
+
path: s.path,
|
|
2079
|
+
parent: s
|
|
2080
|
+
}) : r._parseSync({
|
|
2081
|
+
data: s.data,
|
|
2082
|
+
path: s.path,
|
|
2083
|
+
parent: s
|
|
2084
|
+
}) : (u(s, {
|
|
2085
|
+
code: c.invalid_union_discriminator,
|
|
2086
|
+
options: Array.from(this.optionsMap.keys()),
|
|
2087
|
+
path: [n]
|
|
2088
|
+
}), m);
|
|
2089
|
+
}
|
|
2090
|
+
get discriminator() {
|
|
2091
|
+
return this._def.discriminator;
|
|
2092
|
+
}
|
|
2093
|
+
get options() {
|
|
2094
|
+
return this._def.options;
|
|
2095
|
+
}
|
|
2096
|
+
get optionsMap() {
|
|
2097
|
+
return this._def.optionsMap;
|
|
2098
|
+
}
|
|
2099
|
+
/**
|
|
2100
|
+
* The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
|
|
2101
|
+
* However, it only allows a union of objects, all of which need to share a discriminator property. This property must
|
|
2102
|
+
* have a different value for each object in the union.
|
|
2103
|
+
* @param discriminator the name of the discriminator property
|
|
2104
|
+
* @param types an array of object schemas
|
|
2105
|
+
* @param params
|
|
2106
|
+
*/
|
|
2107
|
+
static create(e, s, n) {
|
|
2108
|
+
const a = /* @__PURE__ */ new Map();
|
|
2109
|
+
for (const r of s) {
|
|
2110
|
+
const i = j(r.shape[e]);
|
|
2111
|
+
if (!i.length)
|
|
2112
|
+
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
2113
|
+
for (const o of i) {
|
|
2114
|
+
if (a.has(o))
|
|
2115
|
+
throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);
|
|
2116
|
+
a.set(o, r);
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2119
|
+
return new Ae({
|
|
2120
|
+
typeName: p.ZodDiscriminatedUnion,
|
|
2121
|
+
discriminator: e,
|
|
2122
|
+
options: s,
|
|
2123
|
+
optionsMap: a,
|
|
2124
|
+
...y(n)
|
|
2125
|
+
});
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
function Ce(t, e) {
|
|
2129
|
+
const s = U(t), n = U(e);
|
|
2070
2130
|
if (t === e)
|
|
2071
2131
|
return { valid: !0, data: t };
|
|
2072
2132
|
if (s === f.object && n === f.object) {
|
|
2073
|
-
const a =
|
|
2133
|
+
const a = x.objectKeys(e), r = x.objectKeys(t).filter((o) => a.indexOf(o) !== -1), i = { ...t, ...e };
|
|
2074
2134
|
for (const o of r) {
|
|
2075
|
-
const d =
|
|
2135
|
+
const d = Ce(t[o], e[o]);
|
|
2076
2136
|
if (!d.valid)
|
|
2077
2137
|
return { valid: !1 };
|
|
2078
2138
|
i[o] = d.data;
|
|
@@ -2083,7 +2143,7 @@ function ve(t, e) {
|
|
|
2083
2143
|
return { valid: !1 };
|
|
2084
2144
|
const a = [];
|
|
2085
2145
|
for (let r = 0; r < t.length; r++) {
|
|
2086
|
-
const i = t[r], o = e[r], d =
|
|
2146
|
+
const i = t[r], o = e[r], d = Ce(i, o);
|
|
2087
2147
|
if (!d.valid)
|
|
2088
2148
|
return { valid: !1 };
|
|
2089
2149
|
a.push(d.data);
|
|
@@ -2091,13 +2151,13 @@ function ve(t, e) {
|
|
|
2091
2151
|
return { valid: !0, data: a };
|
|
2092
2152
|
} else return s === f.date && n === f.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
|
|
2093
2153
|
}
|
|
2094
|
-
class de extends
|
|
2154
|
+
class de extends v {
|
|
2095
2155
|
_parse(e) {
|
|
2096
2156
|
const { status: s, ctx: n } = this._processInputParams(e), a = (r, i) => {
|
|
2097
|
-
if (
|
|
2157
|
+
if (Ve(r) || Ve(i))
|
|
2098
2158
|
return m;
|
|
2099
|
-
const o =
|
|
2100
|
-
return o.valid ? ((
|
|
2159
|
+
const o = Ce(r.value, i.value);
|
|
2160
|
+
return o.valid ? ((Ue(r) || Ue(i)) && s.dirty(), { status: s.value, value: o.data }) : (u(n, {
|
|
2101
2161
|
code: c.invalid_intersection_types
|
|
2102
2162
|
}), m);
|
|
2103
2163
|
};
|
|
@@ -2127,9 +2187,9 @@ de.create = (t, e, s) => new de({
|
|
|
2127
2187
|
left: t,
|
|
2128
2188
|
right: e,
|
|
2129
2189
|
typeName: p.ZodIntersection,
|
|
2130
|
-
...
|
|
2190
|
+
...y(s)
|
|
2131
2191
|
});
|
|
2132
|
-
class
|
|
2192
|
+
class G extends v {
|
|
2133
2193
|
_parse(e) {
|
|
2134
2194
|
const { status: s, ctx: n } = this._processInputParams(e);
|
|
2135
2195
|
if (n.parsedType !== f.array)
|
|
@@ -2155,31 +2215,31 @@ class U extends _ {
|
|
|
2155
2215
|
}), s.dirty());
|
|
2156
2216
|
const r = [...n.data].map((i, o) => {
|
|
2157
2217
|
const d = this._def.items[o] || this._def.rest;
|
|
2158
|
-
return d ? d._parse(new
|
|
2218
|
+
return d ? d._parse(new O(n, i, n.path, o)) : null;
|
|
2159
2219
|
}).filter((i) => !!i);
|
|
2160
|
-
return n.common.async ? Promise.all(r).then((i) =>
|
|
2220
|
+
return n.common.async ? Promise.all(r).then((i) => R.mergeArray(s, i)) : R.mergeArray(s, r);
|
|
2161
2221
|
}
|
|
2162
2222
|
get items() {
|
|
2163
2223
|
return this._def.items;
|
|
2164
2224
|
}
|
|
2165
2225
|
rest(e) {
|
|
2166
|
-
return new
|
|
2226
|
+
return new G({
|
|
2167
2227
|
...this._def,
|
|
2168
2228
|
rest: e
|
|
2169
2229
|
});
|
|
2170
2230
|
}
|
|
2171
2231
|
}
|
|
2172
|
-
|
|
2232
|
+
G.create = (t, e) => {
|
|
2173
2233
|
if (!Array.isArray(t))
|
|
2174
2234
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2175
|
-
return new
|
|
2235
|
+
return new G({
|
|
2176
2236
|
items: t,
|
|
2177
2237
|
typeName: p.ZodTuple,
|
|
2178
2238
|
rest: null,
|
|
2179
|
-
...
|
|
2239
|
+
...y(e)
|
|
2180
2240
|
});
|
|
2181
2241
|
};
|
|
2182
|
-
class le extends
|
|
2242
|
+
class le extends v {
|
|
2183
2243
|
get keySchema() {
|
|
2184
2244
|
return this._def.keyType;
|
|
2185
2245
|
}
|
|
@@ -2197,30 +2257,30 @@ class le extends _ {
|
|
|
2197
2257
|
const a = [], r = this._def.keyType, i = this._def.valueType;
|
|
2198
2258
|
for (const o in n.data)
|
|
2199
2259
|
a.push({
|
|
2200
|
-
key: r._parse(new
|
|
2201
|
-
value: i._parse(new
|
|
2260
|
+
key: r._parse(new O(n, o, n.path, o)),
|
|
2261
|
+
value: i._parse(new O(n, n.data[o], n.path, o)),
|
|
2202
2262
|
alwaysSet: o in n.data
|
|
2203
2263
|
});
|
|
2204
|
-
return n.common.async ?
|
|
2264
|
+
return n.common.async ? R.mergeObjectAsync(s, a) : R.mergeObjectSync(s, a);
|
|
2205
2265
|
}
|
|
2206
2266
|
get element() {
|
|
2207
2267
|
return this._def.valueType;
|
|
2208
2268
|
}
|
|
2209
2269
|
static create(e, s, n) {
|
|
2210
|
-
return s instanceof
|
|
2270
|
+
return s instanceof v ? new le({
|
|
2211
2271
|
keyType: e,
|
|
2212
2272
|
valueType: s,
|
|
2213
2273
|
typeName: p.ZodRecord,
|
|
2214
|
-
...
|
|
2274
|
+
...y(n)
|
|
2215
2275
|
}) : new le({
|
|
2216
|
-
keyType:
|
|
2276
|
+
keyType: P.create(),
|
|
2217
2277
|
valueType: e,
|
|
2218
2278
|
typeName: p.ZodRecord,
|
|
2219
|
-
...
|
|
2279
|
+
...y(s)
|
|
2220
2280
|
});
|
|
2221
2281
|
}
|
|
2222
2282
|
}
|
|
2223
|
-
class
|
|
2283
|
+
class Qe extends v {
|
|
2224
2284
|
get keySchema() {
|
|
2225
2285
|
return this._def.keyType;
|
|
2226
2286
|
}
|
|
@@ -2236,39 +2296,39 @@ class Ve extends _ {
|
|
|
2236
2296
|
received: n.parsedType
|
|
2237
2297
|
}), m;
|
|
2238
2298
|
const a = this._def.keyType, r = this._def.valueType, i = [...n.data.entries()].map(([o, d], l) => ({
|
|
2239
|
-
key: a._parse(new
|
|
2240
|
-
value: r._parse(new
|
|
2299
|
+
key: a._parse(new O(n, o, n.path, [l, "key"])),
|
|
2300
|
+
value: r._parse(new O(n, d, n.path, [l, "value"]))
|
|
2241
2301
|
}));
|
|
2242
2302
|
if (n.common.async) {
|
|
2243
2303
|
const o = /* @__PURE__ */ new Map();
|
|
2244
2304
|
return Promise.resolve().then(async () => {
|
|
2245
2305
|
for (const d of i) {
|
|
2246
|
-
const l = await d.key,
|
|
2247
|
-
if (l.status === "aborted" ||
|
|
2306
|
+
const l = await d.key, _ = await d.value;
|
|
2307
|
+
if (l.status === "aborted" || _.status === "aborted")
|
|
2248
2308
|
return m;
|
|
2249
|
-
(l.status === "dirty" ||
|
|
2309
|
+
(l.status === "dirty" || _.status === "dirty") && s.dirty(), o.set(l.value, _.value);
|
|
2250
2310
|
}
|
|
2251
2311
|
return { status: s.value, value: o };
|
|
2252
2312
|
});
|
|
2253
2313
|
} else {
|
|
2254
2314
|
const o = /* @__PURE__ */ new Map();
|
|
2255
2315
|
for (const d of i) {
|
|
2256
|
-
const l = d.key,
|
|
2257
|
-
if (l.status === "aborted" ||
|
|
2316
|
+
const l = d.key, _ = d.value;
|
|
2317
|
+
if (l.status === "aborted" || _.status === "aborted")
|
|
2258
2318
|
return m;
|
|
2259
|
-
(l.status === "dirty" ||
|
|
2319
|
+
(l.status === "dirty" || _.status === "dirty") && s.dirty(), o.set(l.value, _.value);
|
|
2260
2320
|
}
|
|
2261
2321
|
return { status: s.value, value: o };
|
|
2262
2322
|
}
|
|
2263
2323
|
}
|
|
2264
2324
|
}
|
|
2265
|
-
|
|
2325
|
+
Qe.create = (t, e, s) => new Qe({
|
|
2266
2326
|
valueType: e,
|
|
2267
2327
|
keyType: t,
|
|
2268
2328
|
typeName: p.ZodMap,
|
|
2269
|
-
...
|
|
2329
|
+
...y(s)
|
|
2270
2330
|
});
|
|
2271
|
-
class
|
|
2331
|
+
class re extends v {
|
|
2272
2332
|
_parse(e) {
|
|
2273
2333
|
const { status: s, ctx: n } = this._processInputParams(e);
|
|
2274
2334
|
if (n.parsedType !== f.set)
|
|
@@ -2296,24 +2356,24 @@ class ae extends _ {
|
|
|
2296
2356
|
const r = this._def.valueType;
|
|
2297
2357
|
function i(d) {
|
|
2298
2358
|
const l = /* @__PURE__ */ new Set();
|
|
2299
|
-
for (const
|
|
2300
|
-
if (
|
|
2359
|
+
for (const _ of d) {
|
|
2360
|
+
if (_.status === "aborted")
|
|
2301
2361
|
return m;
|
|
2302
|
-
|
|
2362
|
+
_.status === "dirty" && s.dirty(), l.add(_.value);
|
|
2303
2363
|
}
|
|
2304
2364
|
return { status: s.value, value: l };
|
|
2305
2365
|
}
|
|
2306
|
-
const o = [...n.data.values()].map((d, l) => r._parse(new
|
|
2366
|
+
const o = [...n.data.values()].map((d, l) => r._parse(new O(n, d, n.path, l)));
|
|
2307
2367
|
return n.common.async ? Promise.all(o).then((d) => i(d)) : i(o);
|
|
2308
2368
|
}
|
|
2309
2369
|
min(e, s) {
|
|
2310
|
-
return new
|
|
2370
|
+
return new re({
|
|
2311
2371
|
...this._def,
|
|
2312
2372
|
minSize: { value: e, message: h.toString(s) }
|
|
2313
2373
|
});
|
|
2314
2374
|
}
|
|
2315
2375
|
max(e, s) {
|
|
2316
|
-
return new
|
|
2376
|
+
return new re({
|
|
2317
2377
|
...this._def,
|
|
2318
2378
|
maxSize: { value: e, message: h.toString(s) }
|
|
2319
2379
|
});
|
|
@@ -2325,14 +2385,14 @@ class ae extends _ {
|
|
|
2325
2385
|
return this.min(1, e);
|
|
2326
2386
|
}
|
|
2327
2387
|
}
|
|
2328
|
-
|
|
2388
|
+
re.create = (t, e) => new re({
|
|
2329
2389
|
valueType: t,
|
|
2330
2390
|
minSize: null,
|
|
2331
2391
|
maxSize: null,
|
|
2332
2392
|
typeName: p.ZodSet,
|
|
2333
|
-
...
|
|
2393
|
+
...y(e)
|
|
2334
2394
|
});
|
|
2335
|
-
class
|
|
2395
|
+
class fe extends v {
|
|
2336
2396
|
get schema() {
|
|
2337
2397
|
return this._def.getter();
|
|
2338
2398
|
}
|
|
@@ -2341,12 +2401,12 @@ class Ue extends _ {
|
|
|
2341
2401
|
return this._def.getter()._parse({ data: s.data, path: s.path, parent: s });
|
|
2342
2402
|
}
|
|
2343
2403
|
}
|
|
2344
|
-
|
|
2404
|
+
fe.create = (t, e) => new fe({
|
|
2345
2405
|
getter: t,
|
|
2346
2406
|
typeName: p.ZodLazy,
|
|
2347
|
-
...
|
|
2407
|
+
...y(e)
|
|
2348
2408
|
});
|
|
2349
|
-
class
|
|
2409
|
+
class he extends v {
|
|
2350
2410
|
_parse(e) {
|
|
2351
2411
|
if (e.data !== this._def.value) {
|
|
2352
2412
|
const s = this._getOrReturnCtx(e);
|
|
@@ -2362,24 +2422,24 @@ class xe extends _ {
|
|
|
2362
2422
|
return this._def.value;
|
|
2363
2423
|
}
|
|
2364
2424
|
}
|
|
2365
|
-
|
|
2425
|
+
he.create = (t, e) => new he({
|
|
2366
2426
|
value: t,
|
|
2367
2427
|
typeName: p.ZodLiteral,
|
|
2368
|
-
...
|
|
2428
|
+
...y(e)
|
|
2369
2429
|
});
|
|
2370
|
-
function
|
|
2371
|
-
return new
|
|
2430
|
+
function Ye(t, e) {
|
|
2431
|
+
return new z({
|
|
2372
2432
|
values: t,
|
|
2373
2433
|
typeName: p.ZodEnum,
|
|
2374
|
-
...
|
|
2434
|
+
...y(e)
|
|
2375
2435
|
});
|
|
2376
2436
|
}
|
|
2377
|
-
class
|
|
2437
|
+
class z extends v {
|
|
2378
2438
|
_parse(e) {
|
|
2379
2439
|
if (typeof e.data != "string") {
|
|
2380
2440
|
const s = this._getOrReturnCtx(e), n = this._def.values;
|
|
2381
2441
|
return u(s, {
|
|
2382
|
-
expected:
|
|
2442
|
+
expected: x.joinValues(n),
|
|
2383
2443
|
received: s.parsedType,
|
|
2384
2444
|
code: c.invalid_type
|
|
2385
2445
|
}), m;
|
|
@@ -2416,32 +2476,32 @@ class W extends _ {
|
|
|
2416
2476
|
return e;
|
|
2417
2477
|
}
|
|
2418
2478
|
extract(e, s = this._def) {
|
|
2419
|
-
return
|
|
2479
|
+
return z.create(e, {
|
|
2420
2480
|
...this._def,
|
|
2421
2481
|
...s
|
|
2422
2482
|
});
|
|
2423
2483
|
}
|
|
2424
2484
|
exclude(e, s = this._def) {
|
|
2425
|
-
return
|
|
2485
|
+
return z.create(this.options.filter((n) => !e.includes(n)), {
|
|
2426
2486
|
...this._def,
|
|
2427
2487
|
...s
|
|
2428
2488
|
});
|
|
2429
2489
|
}
|
|
2430
2490
|
}
|
|
2431
|
-
|
|
2432
|
-
class
|
|
2491
|
+
z.create = Ye;
|
|
2492
|
+
class Ie extends v {
|
|
2433
2493
|
_parse(e) {
|
|
2434
|
-
const s =
|
|
2494
|
+
const s = x.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
2435
2495
|
if (n.parsedType !== f.string && n.parsedType !== f.number) {
|
|
2436
|
-
const a =
|
|
2496
|
+
const a = x.objectValues(s);
|
|
2437
2497
|
return u(n, {
|
|
2438
|
-
expected:
|
|
2498
|
+
expected: x.joinValues(a),
|
|
2439
2499
|
received: n.parsedType,
|
|
2440
2500
|
code: c.invalid_type
|
|
2441
2501
|
}), m;
|
|
2442
2502
|
}
|
|
2443
|
-
if (this._cache || (this._cache = new Set(
|
|
2444
|
-
const a =
|
|
2503
|
+
if (this._cache || (this._cache = new Set(x.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
|
|
2504
|
+
const a = x.objectValues(s);
|
|
2445
2505
|
return u(n, {
|
|
2446
2506
|
received: n.data,
|
|
2447
2507
|
code: c.invalid_enum_value,
|
|
@@ -2454,12 +2514,12 @@ class Be extends _ {
|
|
|
2454
2514
|
return this._def.values;
|
|
2455
2515
|
}
|
|
2456
2516
|
}
|
|
2457
|
-
|
|
2517
|
+
Ie.create = (t, e) => new Ie({
|
|
2458
2518
|
values: t,
|
|
2459
2519
|
typeName: p.ZodNativeEnum,
|
|
2460
|
-
...
|
|
2520
|
+
...y(e)
|
|
2461
2521
|
});
|
|
2462
|
-
class
|
|
2522
|
+
class me extends v {
|
|
2463
2523
|
unwrap() {
|
|
2464
2524
|
return this._def.type;
|
|
2465
2525
|
}
|
|
@@ -2478,12 +2538,12 @@ class fe extends _ {
|
|
|
2478
2538
|
})));
|
|
2479
2539
|
}
|
|
2480
2540
|
}
|
|
2481
|
-
|
|
2541
|
+
me.create = (t, e) => new me({
|
|
2482
2542
|
type: t,
|
|
2483
2543
|
typeName: p.ZodPromise,
|
|
2484
|
-
...
|
|
2544
|
+
...y(e)
|
|
2485
2545
|
});
|
|
2486
|
-
class
|
|
2546
|
+
class D extends v {
|
|
2487
2547
|
innerType() {
|
|
2488
2548
|
return this._def.schema;
|
|
2489
2549
|
}
|
|
@@ -2510,7 +2570,7 @@ class H extends _ {
|
|
|
2510
2570
|
path: n.path,
|
|
2511
2571
|
parent: n
|
|
2512
2572
|
});
|
|
2513
|
-
return d.status === "aborted" ? m : d.status === "dirty" || s.value === "dirty" ?
|
|
2573
|
+
return d.status === "aborted" ? m : d.status === "dirty" || s.value === "dirty" ? ee(d.value) : d;
|
|
2514
2574
|
});
|
|
2515
2575
|
{
|
|
2516
2576
|
if (s.value === "aborted")
|
|
@@ -2520,7 +2580,7 @@ class H extends _ {
|
|
|
2520
2580
|
path: n.path,
|
|
2521
2581
|
parent: n
|
|
2522
2582
|
});
|
|
2523
|
-
return o.status === "aborted" ? m : o.status === "dirty" || s.value === "dirty" ?
|
|
2583
|
+
return o.status === "aborted" ? m : o.status === "dirty" || s.value === "dirty" ? ee(o.value) : o;
|
|
2524
2584
|
}
|
|
2525
2585
|
}
|
|
2526
2586
|
if (a.type === "refinement") {
|
|
@@ -2549,33 +2609,33 @@ class H extends _ {
|
|
|
2549
2609
|
path: n.path,
|
|
2550
2610
|
parent: n
|
|
2551
2611
|
});
|
|
2552
|
-
if (!
|
|
2612
|
+
if (!Y(i))
|
|
2553
2613
|
return m;
|
|
2554
2614
|
const o = a.transform(i.value, r);
|
|
2555
2615
|
if (o instanceof Promise)
|
|
2556
2616
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2557
2617
|
return { status: s.value, value: o };
|
|
2558
2618
|
} else
|
|
2559
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) =>
|
|
2619
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => Y(i) ? Promise.resolve(a.transform(i.value, r)).then((o) => ({
|
|
2560
2620
|
status: s.value,
|
|
2561
2621
|
value: o
|
|
2562
2622
|
})) : m);
|
|
2563
|
-
|
|
2623
|
+
x.assertNever(a);
|
|
2564
2624
|
}
|
|
2565
2625
|
}
|
|
2566
|
-
|
|
2626
|
+
D.create = (t, e, s) => new D({
|
|
2567
2627
|
schema: t,
|
|
2568
2628
|
typeName: p.ZodEffects,
|
|
2569
2629
|
effect: e,
|
|
2570
|
-
...
|
|
2630
|
+
...y(s)
|
|
2571
2631
|
});
|
|
2572
|
-
|
|
2632
|
+
D.createWithPreprocess = (t, e, s) => new D({
|
|
2573
2633
|
schema: e,
|
|
2574
2634
|
effect: { type: "preprocess", transform: t },
|
|
2575
2635
|
typeName: p.ZodEffects,
|
|
2576
|
-
...
|
|
2636
|
+
...y(s)
|
|
2577
2637
|
});
|
|
2578
|
-
class
|
|
2638
|
+
class $ extends v {
|
|
2579
2639
|
_parse(e) {
|
|
2580
2640
|
return this._getType(e) === f.undefined ? I(void 0) : this._def.innerType._parse(e);
|
|
2581
2641
|
}
|
|
@@ -2583,12 +2643,12 @@ class L extends _ {
|
|
|
2583
2643
|
return this._def.innerType;
|
|
2584
2644
|
}
|
|
2585
2645
|
}
|
|
2586
|
-
|
|
2646
|
+
$.create = (t, e) => new $({
|
|
2587
2647
|
innerType: t,
|
|
2588
2648
|
typeName: p.ZodOptional,
|
|
2589
|
-
...
|
|
2649
|
+
...y(e)
|
|
2590
2650
|
});
|
|
2591
|
-
class
|
|
2651
|
+
class Q extends v {
|
|
2592
2652
|
_parse(e) {
|
|
2593
2653
|
return this._getType(e) === f.null ? I(null) : this._def.innerType._parse(e);
|
|
2594
2654
|
}
|
|
@@ -2596,12 +2656,12 @@ class J extends _ {
|
|
|
2596
2656
|
return this._def.innerType;
|
|
2597
2657
|
}
|
|
2598
2658
|
}
|
|
2599
|
-
|
|
2659
|
+
Q.create = (t, e) => new Q({
|
|
2600
2660
|
innerType: t,
|
|
2601
2661
|
typeName: p.ZodNullable,
|
|
2602
|
-
...
|
|
2662
|
+
...y(e)
|
|
2603
2663
|
});
|
|
2604
|
-
class
|
|
2664
|
+
class pe extends v {
|
|
2605
2665
|
_parse(e) {
|
|
2606
2666
|
const { ctx: s } = this._processInputParams(e);
|
|
2607
2667
|
let n = s.data;
|
|
@@ -2615,13 +2675,13 @@ class be extends _ {
|
|
|
2615
2675
|
return this._def.innerType;
|
|
2616
2676
|
}
|
|
2617
2677
|
}
|
|
2618
|
-
|
|
2678
|
+
pe.create = (t, e) => new pe({
|
|
2619
2679
|
innerType: t,
|
|
2620
2680
|
typeName: p.ZodDefault,
|
|
2621
2681
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2622
|
-
...
|
|
2682
|
+
...y(e)
|
|
2623
2683
|
});
|
|
2624
|
-
class
|
|
2684
|
+
class ge extends v {
|
|
2625
2685
|
_parse(e) {
|
|
2626
2686
|
const { ctx: s } = this._processInputParams(e), n = {
|
|
2627
2687
|
...s,
|
|
@@ -2640,7 +2700,7 @@ class ke extends _ {
|
|
|
2640
2700
|
status: "valid",
|
|
2641
2701
|
value: r.status === "valid" ? r.value : this._def.catchValue({
|
|
2642
2702
|
get error() {
|
|
2643
|
-
return new
|
|
2703
|
+
return new L(n.common.issues);
|
|
2644
2704
|
},
|
|
2645
2705
|
input: n.data
|
|
2646
2706
|
})
|
|
@@ -2648,7 +2708,7 @@ class ke extends _ {
|
|
|
2648
2708
|
status: "valid",
|
|
2649
2709
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2650
2710
|
get error() {
|
|
2651
|
-
return new
|
|
2711
|
+
return new L(n.common.issues);
|
|
2652
2712
|
},
|
|
2653
2713
|
input: n.data
|
|
2654
2714
|
})
|
|
@@ -2658,13 +2718,13 @@ class ke extends _ {
|
|
|
2658
2718
|
return this._def.innerType;
|
|
2659
2719
|
}
|
|
2660
2720
|
}
|
|
2661
|
-
|
|
2721
|
+
ge.create = (t, e) => new ge({
|
|
2662
2722
|
innerType: t,
|
|
2663
2723
|
typeName: p.ZodCatch,
|
|
2664
2724
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2665
|
-
...
|
|
2725
|
+
...y(e)
|
|
2666
2726
|
});
|
|
2667
|
-
class
|
|
2727
|
+
class Fe extends v {
|
|
2668
2728
|
_parse(e) {
|
|
2669
2729
|
if (this._getType(e) !== f.nan) {
|
|
2670
2730
|
const n = this._getOrReturnCtx(e);
|
|
@@ -2677,11 +2737,11 @@ class Ge extends _ {
|
|
|
2677
2737
|
return { status: "valid", value: e.data };
|
|
2678
2738
|
}
|
|
2679
2739
|
}
|
|
2680
|
-
|
|
2740
|
+
Fe.create = (t) => new Fe({
|
|
2681
2741
|
typeName: p.ZodNaN,
|
|
2682
|
-
...
|
|
2742
|
+
...y(t)
|
|
2683
2743
|
});
|
|
2684
|
-
class
|
|
2744
|
+
class Xe extends v {
|
|
2685
2745
|
_parse(e) {
|
|
2686
2746
|
const { ctx: s } = this._processInputParams(e), n = s.data;
|
|
2687
2747
|
return this._def.type._parse({
|
|
@@ -2694,7 +2754,7 @@ class Et extends _ {
|
|
|
2694
2754
|
return this._def.type;
|
|
2695
2755
|
}
|
|
2696
2756
|
}
|
|
2697
|
-
class
|
|
2757
|
+
class Oe extends v {
|
|
2698
2758
|
_parse(e) {
|
|
2699
2759
|
const { status: s, ctx: n } = this._processInputParams(e);
|
|
2700
2760
|
if (n.common.async)
|
|
@@ -2704,7 +2764,7 @@ class Re extends _ {
|
|
|
2704
2764
|
path: n.path,
|
|
2705
2765
|
parent: n
|
|
2706
2766
|
});
|
|
2707
|
-
return r.status === "aborted" ? m : r.status === "dirty" ? (s.dirty(),
|
|
2767
|
+
return r.status === "aborted" ? m : r.status === "dirty" ? (s.dirty(), ee(r.value)) : this._def.out._parseAsync({
|
|
2708
2768
|
data: r.value,
|
|
2709
2769
|
path: n.path,
|
|
2710
2770
|
parent: n
|
|
@@ -2727,277 +2787,335 @@ class Re extends _ {
|
|
|
2727
2787
|
}
|
|
2728
2788
|
}
|
|
2729
2789
|
static create(e, s) {
|
|
2730
|
-
return new
|
|
2790
|
+
return new Oe({
|
|
2731
2791
|
in: e,
|
|
2732
2792
|
out: s,
|
|
2733
2793
|
typeName: p.ZodPipeline
|
|
2734
2794
|
});
|
|
2735
2795
|
}
|
|
2736
2796
|
}
|
|
2737
|
-
class
|
|
2797
|
+
class ye extends v {
|
|
2738
2798
|
_parse(e) {
|
|
2739
|
-
const s = this._def.innerType._parse(e), n = (a) => (
|
|
2799
|
+
const s = this._def.innerType._parse(e), n = (a) => (Y(a) && (a.value = Object.freeze(a.value)), a);
|
|
2740
2800
|
return oe(s) ? s.then((a) => n(a)) : n(s);
|
|
2741
2801
|
}
|
|
2742
2802
|
unwrap() {
|
|
2743
2803
|
return this._def.innerType;
|
|
2744
2804
|
}
|
|
2745
2805
|
}
|
|
2746
|
-
|
|
2806
|
+
ye.create = (t, e) => new ye({
|
|
2747
2807
|
innerType: t,
|
|
2748
2808
|
typeName: p.ZodReadonly,
|
|
2749
|
-
...
|
|
2809
|
+
...y(e)
|
|
2750
2810
|
});
|
|
2751
2811
|
var p;
|
|
2752
2812
|
(function(t) {
|
|
2753
2813
|
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";
|
|
2754
2814
|
})(p || (p = {}));
|
|
2755
|
-
const
|
|
2756
|
-
|
|
2757
|
-
const
|
|
2758
|
-
ue.create;
|
|
2815
|
+
const g = P.create, Me = X.create, E = we.create, _e = Re.create;
|
|
2816
|
+
B.create;
|
|
2817
|
+
const ve = A.create, V = w.create, jt = ue.create, Pt = Ae.create;
|
|
2759
2818
|
de.create;
|
|
2760
|
-
|
|
2761
|
-
const
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
const Ot = 1, B = Y({
|
|
2819
|
+
G.create;
|
|
2820
|
+
const $t = le.create, Ze = fe.create, b = he.create, Lt = z.create;
|
|
2821
|
+
me.create;
|
|
2822
|
+
$.create;
|
|
2823
|
+
Q.create;
|
|
2824
|
+
const Vt = 2, F = V({
|
|
2767
2825
|
type: b("qp-bridge"),
|
|
2768
|
-
id:
|
|
2769
|
-
instanceId:
|
|
2770
|
-
}), S =
|
|
2771
|
-
featureVersion:
|
|
2772
|
-
}),
|
|
2826
|
+
id: g().optional(),
|
|
2827
|
+
instanceId: g().optional()
|
|
2828
|
+
}), S = F.extend({
|
|
2829
|
+
featureVersion: Me().optional()
|
|
2830
|
+
}), Ut = F.extend({
|
|
2773
2831
|
status: b("answerChanged"),
|
|
2774
|
-
question:
|
|
2775
|
-
answer:
|
|
2776
|
-
}),
|
|
2832
|
+
question: g(),
|
|
2833
|
+
answer: _e()
|
|
2834
|
+
}), Bt = F.extend({
|
|
2777
2835
|
action: b("commandExecuted"),
|
|
2778
|
-
commandName:
|
|
2779
|
-
}),
|
|
2836
|
+
commandName: g()
|
|
2837
|
+
}), Gt = F.extend({
|
|
2780
2838
|
action: b("questionnaireLoaded")
|
|
2781
|
-
}),
|
|
2839
|
+
}), W = F.extend({
|
|
2782
2840
|
status: b("success")
|
|
2783
|
-
}),
|
|
2841
|
+
}), zt = F.extend({
|
|
2784
2842
|
status: b("error"),
|
|
2785
|
-
message:
|
|
2786
|
-
}),
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2843
|
+
message: g()
|
|
2844
|
+
}), Dt = Lt([
|
|
2845
|
+
"imageMedia",
|
|
2846
|
+
"shortText",
|
|
2847
|
+
"longText",
|
|
2848
|
+
"url",
|
|
2849
|
+
"email",
|
|
2850
|
+
"wholeNumber",
|
|
2851
|
+
"decimalNumber",
|
|
2852
|
+
"date",
|
|
2853
|
+
"dateTime",
|
|
2854
|
+
"singleSelect",
|
|
2855
|
+
"multiSelect",
|
|
2856
|
+
"optionSet",
|
|
2857
|
+
"rating",
|
|
2858
|
+
"yesNo",
|
|
2859
|
+
"signature",
|
|
2860
|
+
"lookup"
|
|
2861
|
+
]), qe = V({
|
|
2862
|
+
type: Dt,
|
|
2863
|
+
semanticColor: g().optional(),
|
|
2864
|
+
label: g().optional(),
|
|
2865
|
+
description: g().optional(),
|
|
2866
|
+
disabled: E(),
|
|
2867
|
+
required: E(),
|
|
2868
|
+
hidden: E(),
|
|
2869
|
+
errorMessage: g().optional(),
|
|
2870
|
+
answer: _e().optional()
|
|
2871
|
+
}), Qt = qe.partial(), Ft = qe.extend({
|
|
2872
|
+
itemType: b("question"),
|
|
2873
|
+
name: g()
|
|
2874
|
+
}), Wt = V({
|
|
2875
|
+
id: g().uuid(),
|
|
2876
|
+
name: g(),
|
|
2877
|
+
mimeType: g(),
|
|
2878
|
+
blobUrl: g()
|
|
2879
|
+
}), je = $t(_e()), Ke = V({
|
|
2880
|
+
label: g(),
|
|
2881
|
+
hidden: E(),
|
|
2882
|
+
collapsed: E()
|
|
2883
|
+
}), et = Ke.partial(), Ht = Pt("type", [
|
|
2884
|
+
V({
|
|
2885
|
+
itemType: b("staticComponent"),
|
|
2886
|
+
type: b("staticDescription"),
|
|
2887
|
+
name: g(),
|
|
2888
|
+
hidden: E().optional(),
|
|
2889
|
+
content: g()
|
|
2890
|
+
}),
|
|
2891
|
+
V({
|
|
2892
|
+
itemType: b("staticComponent"),
|
|
2893
|
+
type: b("button"),
|
|
2894
|
+
name: g(),
|
|
2895
|
+
hidden: E().optional(),
|
|
2896
|
+
clickText: g(),
|
|
2897
|
+
disabled: E().optional(),
|
|
2898
|
+
semanticColor: g().optional(),
|
|
2899
|
+
commandName: g().optional(),
|
|
2900
|
+
commandLabel: g().optional()
|
|
2901
|
+
})
|
|
2902
|
+
]), Jt = et.extend({
|
|
2903
|
+
itemType: b("group"),
|
|
2904
|
+
name: g()
|
|
2905
|
+
}), Yt = V({
|
|
2906
|
+
itemType: b("repeatableGroup"),
|
|
2907
|
+
name: g(),
|
|
2908
|
+
label: g().optional(),
|
|
2909
|
+
hidden: E().optional()
|
|
2910
|
+
}), tt = Ze(
|
|
2911
|
+
() => jt([Ft, st, Xt, Ht])
|
|
2912
|
+
), st = Ze(
|
|
2913
|
+
() => Jt.extend({
|
|
2914
|
+
items: ve(tt)
|
|
2915
|
+
})
|
|
2916
|
+
), Xt = Ze(
|
|
2917
|
+
() => Yt.extend({
|
|
2918
|
+
groups: ve(st)
|
|
2919
|
+
})
|
|
2920
|
+
), Kt = V({
|
|
2921
|
+
entityName: g(),
|
|
2922
|
+
id: g(),
|
|
2923
|
+
name: g()
|
|
2924
|
+
}), es = V({
|
|
2925
|
+
isNew: E(),
|
|
2926
|
+
id: g().uuid(),
|
|
2927
|
+
name: g(),
|
|
2928
|
+
label: g(),
|
|
2929
|
+
description: g().optional(),
|
|
2930
|
+
regarding: Kt.optional(),
|
|
2931
|
+
items: ve(tt)
|
|
2932
|
+
}), ts = S.extend({
|
|
2815
2933
|
action: b("getQuestion"),
|
|
2816
|
-
question:
|
|
2817
|
-
}),
|
|
2818
|
-
question:
|
|
2819
|
-
}),
|
|
2934
|
+
question: g()
|
|
2935
|
+
}), ss = W.extend({
|
|
2936
|
+
question: qe
|
|
2937
|
+
}), ns = S.extend({
|
|
2820
2938
|
action: b("setQuestion"),
|
|
2821
|
-
question:
|
|
2822
|
-
questionData:
|
|
2823
|
-
}),
|
|
2939
|
+
question: g(),
|
|
2940
|
+
questionData: Qt
|
|
2941
|
+
}), as = S.extend({
|
|
2824
2942
|
action: b("getGroup"),
|
|
2825
|
-
group:
|
|
2826
|
-
}),
|
|
2827
|
-
group:
|
|
2828
|
-
}),
|
|
2943
|
+
group: g()
|
|
2944
|
+
}), rs = W.extend({
|
|
2945
|
+
group: Ke
|
|
2946
|
+
}), is = S.extend({
|
|
2829
2947
|
action: b("getQuestionnaire")
|
|
2830
|
-
}),
|
|
2831
|
-
questionnaire:
|
|
2832
|
-
}),
|
|
2833
|
-
canSave:
|
|
2834
|
-
}),
|
|
2948
|
+
}), os = W.extend({
|
|
2949
|
+
questionnaire: es
|
|
2950
|
+
}), cs = W.extend({
|
|
2951
|
+
canSave: E()
|
|
2952
|
+
}), us = S.extend({
|
|
2835
2953
|
action: b("canSave")
|
|
2836
|
-
}),
|
|
2954
|
+
}), ds = S.extend({
|
|
2837
2955
|
action: b("setGroup"),
|
|
2838
|
-
group:
|
|
2839
|
-
groupData:
|
|
2840
|
-
}),
|
|
2956
|
+
group: g(),
|
|
2957
|
+
groupData: et
|
|
2958
|
+
}), ls = S.extend({
|
|
2841
2959
|
action: b("setAnswer"),
|
|
2842
|
-
question:
|
|
2843
|
-
answer:
|
|
2844
|
-
}),
|
|
2960
|
+
question: g(),
|
|
2961
|
+
answer: _e()
|
|
2962
|
+
}), fs = S.extend({
|
|
2845
2963
|
action: b("busyIndicatorStart")
|
|
2846
|
-
}),
|
|
2964
|
+
}), hs = S.extend({
|
|
2847
2965
|
action: b("busyIndicatorEnd")
|
|
2848
|
-
}),
|
|
2966
|
+
}), ms = S.extend({
|
|
2849
2967
|
action: b("saveQuestionnaire")
|
|
2850
|
-
}),
|
|
2968
|
+
}), ps = S.extend({
|
|
2851
2969
|
action: b("completeAndCloseQuestionnaire")
|
|
2852
|
-
}),
|
|
2970
|
+
}), gs = S.extend({
|
|
2853
2971
|
action: b("executeCustomCommand"),
|
|
2854
|
-
commandName:
|
|
2855
|
-
}),
|
|
2972
|
+
commandName: g()
|
|
2973
|
+
}), ys = S.extend({
|
|
2856
2974
|
action: b("fetchEntities"),
|
|
2857
|
-
fetchXml:
|
|
2858
|
-
}),
|
|
2859
|
-
entities:
|
|
2860
|
-
}),
|
|
2975
|
+
fetchXml: g()
|
|
2976
|
+
}), _s = W.extend({
|
|
2977
|
+
entities: ve(je)
|
|
2978
|
+
}), vs = S.extend({
|
|
2861
2979
|
action: b("getEntityById"),
|
|
2862
|
-
entityName:
|
|
2863
|
-
entityId:
|
|
2864
|
-
}),
|
|
2865
|
-
entity:
|
|
2866
|
-
}),
|
|
2980
|
+
entityName: g(),
|
|
2981
|
+
entityId: g()
|
|
2982
|
+
}), xs = W.extend({
|
|
2983
|
+
entity: je
|
|
2984
|
+
}), bs = S.extend({
|
|
2867
2985
|
action: b("saveEntity"),
|
|
2868
|
-
entity:
|
|
2869
|
-
}),
|
|
2986
|
+
entity: je
|
|
2987
|
+
}), ks = S.extend({
|
|
2870
2988
|
action: b("repeatGroup"),
|
|
2871
|
-
parentGroupName:
|
|
2872
|
-
groupIndex:
|
|
2873
|
-
}),
|
|
2989
|
+
parentGroupName: g(),
|
|
2990
|
+
groupIndex: Me()
|
|
2991
|
+
}), ws = S.extend({
|
|
2874
2992
|
action: b("addNewGroup"),
|
|
2875
|
-
groupName:
|
|
2876
|
-
}),
|
|
2993
|
+
groupName: g()
|
|
2994
|
+
}), Ss = S.extend({
|
|
2877
2995
|
action: b("deleteGroup"),
|
|
2878
|
-
parentGroupName:
|
|
2879
|
-
groupIndex:
|
|
2996
|
+
parentGroupName: g(),
|
|
2997
|
+
groupIndex: Me()
|
|
2880
2998
|
});
|
|
2881
|
-
function
|
|
2882
|
-
return
|
|
2999
|
+
function Ws(t) {
|
|
3000
|
+
return Wt.safeParse(t).success;
|
|
2883
3001
|
}
|
|
2884
|
-
function
|
|
2885
|
-
return
|
|
3002
|
+
function Ts(t) {
|
|
3003
|
+
return Ut.safeParse(t).success;
|
|
2886
3004
|
}
|
|
2887
|
-
function
|
|
2888
|
-
return
|
|
3005
|
+
function Rs(t) {
|
|
3006
|
+
return Bt.safeParse(t).success;
|
|
2889
3007
|
}
|
|
2890
|
-
function
|
|
2891
|
-
return
|
|
3008
|
+
function Cs(t) {
|
|
3009
|
+
return Gt.safeParse(t).success;
|
|
2892
3010
|
}
|
|
2893
|
-
function
|
|
2894
|
-
return
|
|
3011
|
+
function Ee(t) {
|
|
3012
|
+
return F.safeParse(t).success;
|
|
2895
3013
|
}
|
|
2896
|
-
function
|
|
3014
|
+
function Hs(t) {
|
|
2897
3015
|
return S.safeParse(t).success;
|
|
2898
3016
|
}
|
|
2899
|
-
function
|
|
2900
|
-
return
|
|
3017
|
+
function Is(t) {
|
|
3018
|
+
return W.safeParse(t).success;
|
|
2901
3019
|
}
|
|
2902
|
-
function
|
|
2903
|
-
return
|
|
3020
|
+
function Es(t) {
|
|
3021
|
+
return zt.safeParse(t).success;
|
|
2904
3022
|
}
|
|
2905
|
-
function
|
|
2906
|
-
return
|
|
3023
|
+
function Js(t) {
|
|
3024
|
+
return ts.safeParse(t).success;
|
|
2907
3025
|
}
|
|
2908
|
-
function
|
|
2909
|
-
return
|
|
3026
|
+
function Ns(t) {
|
|
3027
|
+
return ss.safeParse(t).success;
|
|
2910
3028
|
}
|
|
2911
|
-
function
|
|
2912
|
-
return
|
|
3029
|
+
function Ys(t) {
|
|
3030
|
+
return ls.safeParse(t).success;
|
|
2913
3031
|
}
|
|
2914
|
-
function
|
|
2915
|
-
return
|
|
3032
|
+
function Xs(t) {
|
|
3033
|
+
return ns.safeParse(t).success;
|
|
2916
3034
|
}
|
|
2917
|
-
function
|
|
2918
|
-
return
|
|
3035
|
+
function Ks(t) {
|
|
3036
|
+
return ds.safeParse(t).success;
|
|
2919
3037
|
}
|
|
2920
|
-
function
|
|
2921
|
-
return
|
|
3038
|
+
function en(t) {
|
|
3039
|
+
return as.safeParse(t).success;
|
|
2922
3040
|
}
|
|
2923
|
-
function
|
|
2924
|
-
return
|
|
3041
|
+
function tn(t) {
|
|
3042
|
+
return is.safeParse(t).success;
|
|
2925
3043
|
}
|
|
2926
|
-
function
|
|
2927
|
-
return
|
|
3044
|
+
function As(t) {
|
|
3045
|
+
return rs.safeParse(t).success;
|
|
2928
3046
|
}
|
|
2929
|
-
function
|
|
2930
|
-
return
|
|
3047
|
+
function Os(t) {
|
|
3048
|
+
return os.safeParse(t).success;
|
|
2931
3049
|
}
|
|
2932
|
-
function
|
|
2933
|
-
return
|
|
3050
|
+
function sn(t) {
|
|
3051
|
+
return cs.safeParse(t).success;
|
|
2934
3052
|
}
|
|
2935
|
-
function
|
|
2936
|
-
return
|
|
3053
|
+
function Ms(t) {
|
|
3054
|
+
return us.safeParse(t).success;
|
|
2937
3055
|
}
|
|
2938
|
-
function
|
|
2939
|
-
return
|
|
3056
|
+
function Zs(t) {
|
|
3057
|
+
return fs.safeParse(t).success;
|
|
2940
3058
|
}
|
|
2941
|
-
function
|
|
2942
|
-
return
|
|
3059
|
+
function qs(t) {
|
|
3060
|
+
return hs.safeParse(t).success;
|
|
2943
3061
|
}
|
|
2944
|
-
function
|
|
2945
|
-
return
|
|
3062
|
+
function nn(t) {
|
|
3063
|
+
return ms.safeParse(t).success;
|
|
2946
3064
|
}
|
|
2947
|
-
function
|
|
2948
|
-
return
|
|
3065
|
+
function an(t) {
|
|
3066
|
+
return ps.safeParse(t).success;
|
|
2949
3067
|
}
|
|
2950
|
-
function
|
|
2951
|
-
return
|
|
3068
|
+
function rn(t) {
|
|
3069
|
+
return gs.safeParse(t).success;
|
|
2952
3070
|
}
|
|
2953
|
-
function
|
|
2954
|
-
return
|
|
3071
|
+
function on(t) {
|
|
3072
|
+
return Zs(t) || qs(t);
|
|
2955
3073
|
}
|
|
2956
|
-
function
|
|
2957
|
-
return !
|
|
3074
|
+
function js(t, e, s) {
|
|
3075
|
+
return !Ee(t) || t.id !== e || s !== void 0 && t.instanceId !== s || !("status" in t);
|
|
2958
3076
|
}
|
|
2959
|
-
function
|
|
2960
|
-
return
|
|
3077
|
+
function cn(t) {
|
|
3078
|
+
return ys.safeParse(t).success;
|
|
2961
3079
|
}
|
|
2962
|
-
function
|
|
2963
|
-
return
|
|
3080
|
+
function Ps(t) {
|
|
3081
|
+
return _s.safeParse(t).success;
|
|
2964
3082
|
}
|
|
2965
|
-
function
|
|
2966
|
-
return
|
|
3083
|
+
function un(t) {
|
|
3084
|
+
return vs.safeParse(t).success;
|
|
2967
3085
|
}
|
|
2968
|
-
function
|
|
2969
|
-
return
|
|
3086
|
+
function $s(t) {
|
|
3087
|
+
return xs.safeParse(t).success;
|
|
2970
3088
|
}
|
|
2971
|
-
function
|
|
2972
|
-
return
|
|
3089
|
+
function dn(t) {
|
|
3090
|
+
return bs.safeParse(t).success;
|
|
2973
3091
|
}
|
|
2974
|
-
function
|
|
2975
|
-
return
|
|
3092
|
+
function ln(t) {
|
|
3093
|
+
return ks.safeParse(t).success;
|
|
2976
3094
|
}
|
|
2977
|
-
function
|
|
2978
|
-
return
|
|
3095
|
+
function fn(t) {
|
|
3096
|
+
return ws.safeParse(t).success;
|
|
2979
3097
|
}
|
|
2980
|
-
function
|
|
2981
|
-
return
|
|
3098
|
+
function hn(t) {
|
|
3099
|
+
return Ss.safeParse(t).success;
|
|
2982
3100
|
}
|
|
2983
|
-
function
|
|
3101
|
+
function ie(t) {
|
|
2984
3102
|
if (t?.instanceId != null)
|
|
2985
3103
|
return t.instanceId;
|
|
2986
3104
|
const e = globalThis.__RESCO_QP_BRIDGE_INSTANCE_ID;
|
|
2987
3105
|
return typeof e == "string" ? e : void 0;
|
|
2988
3106
|
}
|
|
2989
|
-
function
|
|
3107
|
+
function nt(t) {
|
|
2990
3108
|
if (t instanceof File || t instanceof Blob)
|
|
2991
3109
|
return URL.createObjectURL(t);
|
|
2992
3110
|
if (typeof t == "string") {
|
|
2993
3111
|
if (/^data:/.test(t)) {
|
|
2994
3112
|
const r = t.match(/^data:([^;]+);base64,(.*)$/);
|
|
2995
3113
|
if (r) {
|
|
2996
|
-
const i = r[1], o = r[2], d = atob(o), l = new ArrayBuffer(d.length),
|
|
2997
|
-
for (let
|
|
2998
|
-
|
|
2999
|
-
const
|
|
3000
|
-
return URL.createObjectURL(
|
|
3114
|
+
const i = r[1], o = r[2], d = atob(o), l = new ArrayBuffer(d.length), _ = new Uint8Array(l);
|
|
3115
|
+
for (let Z = 0; Z < d.length; Z++)
|
|
3116
|
+
_[Z] = d.charCodeAt(Z);
|
|
3117
|
+
const M = new Blob([l], { type: i });
|
|
3118
|
+
return URL.createObjectURL(M);
|
|
3001
3119
|
}
|
|
3002
3120
|
throw new Error("Invalid data URL format. Only base64 data URLs are supported.");
|
|
3003
3121
|
}
|
|
@@ -3013,31 +3131,31 @@ function Je(t) {
|
|
|
3013
3131
|
}
|
|
3014
3132
|
throw new Error("Unsupported content type for blobUrl");
|
|
3015
3133
|
}
|
|
3016
|
-
function
|
|
3134
|
+
function mn(t, e, s, n) {
|
|
3017
3135
|
return {
|
|
3018
|
-
id: n ??
|
|
3136
|
+
id: n ?? We(),
|
|
3019
3137
|
name: t,
|
|
3020
3138
|
mimeType: e,
|
|
3021
|
-
blobUrl:
|
|
3139
|
+
blobUrl: nt(s)
|
|
3022
3140
|
};
|
|
3023
3141
|
}
|
|
3024
|
-
function
|
|
3142
|
+
function pn(t, e) {
|
|
3025
3143
|
let s = t.blobUrl;
|
|
3026
|
-
return e.content !== void 0 && (s =
|
|
3144
|
+
return e.content !== void 0 && (s = nt(e.content)), {
|
|
3027
3145
|
...t,
|
|
3028
3146
|
...e,
|
|
3029
3147
|
blobUrl: s
|
|
3030
3148
|
};
|
|
3031
3149
|
}
|
|
3032
|
-
|
|
3033
|
-
function
|
|
3034
|
-
window.addEventListener("message",
|
|
3150
|
+
it.env?.NODE_ENV !== "test" && Ls();
|
|
3151
|
+
function Ls() {
|
|
3152
|
+
window.addEventListener("message", at);
|
|
3035
3153
|
}
|
|
3036
|
-
function
|
|
3037
|
-
window.removeEventListener("message",
|
|
3154
|
+
function gn() {
|
|
3155
|
+
window.removeEventListener("message", at);
|
|
3038
3156
|
}
|
|
3039
|
-
async function
|
|
3040
|
-
return await
|
|
3157
|
+
async function yn(t) {
|
|
3158
|
+
return await Ds(
|
|
3041
3159
|
{
|
|
3042
3160
|
type: "qp-bridge",
|
|
3043
3161
|
action: "getQuestionnaire"
|
|
@@ -3045,7 +3163,36 @@ async function en(t) {
|
|
|
3045
3163
|
t
|
|
3046
3164
|
);
|
|
3047
3165
|
}
|
|
3048
|
-
|
|
3166
|
+
function Vs(t, e) {
|
|
3167
|
+
Ne(t.items, [], e);
|
|
3168
|
+
}
|
|
3169
|
+
function Us(t) {
|
|
3170
|
+
const e = [];
|
|
3171
|
+
return Vs(t, (s) => e.push(s)), e;
|
|
3172
|
+
}
|
|
3173
|
+
function _n(t) {
|
|
3174
|
+
return Us(t).filter(Bs);
|
|
3175
|
+
}
|
|
3176
|
+
function Bs(t) {
|
|
3177
|
+
return t.itemType === "question";
|
|
3178
|
+
}
|
|
3179
|
+
function Ne(t, e, s) {
|
|
3180
|
+
for (const n of t)
|
|
3181
|
+
switch (s(n, e), n.itemType) {
|
|
3182
|
+
case "question":
|
|
3183
|
+
case "staticComponent":
|
|
3184
|
+
break;
|
|
3185
|
+
case "group":
|
|
3186
|
+
Ne(n.items, [...e, n], s);
|
|
3187
|
+
break;
|
|
3188
|
+
case "repeatableGroup":
|
|
3189
|
+
Ne(n.groups, [...e, n], s);
|
|
3190
|
+
break;
|
|
3191
|
+
default:
|
|
3192
|
+
return n;
|
|
3193
|
+
}
|
|
3194
|
+
}
|
|
3195
|
+
async function vn(t, e, s) {
|
|
3049
3196
|
await C(
|
|
3050
3197
|
{
|
|
3051
3198
|
type: "qp-bridge",
|
|
@@ -3056,8 +3203,8 @@ async function tn(t, e, s) {
|
|
|
3056
3203
|
s
|
|
3057
3204
|
);
|
|
3058
3205
|
}
|
|
3059
|
-
async function
|
|
3060
|
-
return await
|
|
3206
|
+
async function xn(t, e) {
|
|
3207
|
+
return await Gs(
|
|
3061
3208
|
{
|
|
3062
3209
|
type: "qp-bridge",
|
|
3063
3210
|
action: "getQuestion",
|
|
@@ -3066,7 +3213,7 @@ async function sn(t, e) {
|
|
|
3066
3213
|
e
|
|
3067
3214
|
);
|
|
3068
3215
|
}
|
|
3069
|
-
async function
|
|
3216
|
+
async function bn(t, e, s) {
|
|
3070
3217
|
await C(
|
|
3071
3218
|
{
|
|
3072
3219
|
type: "qp-bridge",
|
|
@@ -3077,8 +3224,8 @@ async function nn(t, e, s) {
|
|
|
3077
3224
|
s
|
|
3078
3225
|
);
|
|
3079
3226
|
}
|
|
3080
|
-
async function
|
|
3081
|
-
return await
|
|
3227
|
+
async function kn(t, e) {
|
|
3228
|
+
return await zs(
|
|
3082
3229
|
{
|
|
3083
3230
|
type: "qp-bridge",
|
|
3084
3231
|
action: "getGroup",
|
|
@@ -3087,7 +3234,7 @@ async function an(t, e) {
|
|
|
3087
3234
|
e
|
|
3088
3235
|
);
|
|
3089
3236
|
}
|
|
3090
|
-
async function
|
|
3237
|
+
async function wn(t, e, s) {
|
|
3091
3238
|
await C(
|
|
3092
3239
|
{
|
|
3093
3240
|
type: "qp-bridge",
|
|
@@ -3098,9 +3245,9 @@ async function rn(t, e, s) {
|
|
|
3098
3245
|
s
|
|
3099
3246
|
);
|
|
3100
3247
|
}
|
|
3101
|
-
function
|
|
3102
|
-
const s =
|
|
3103
|
-
|
|
3248
|
+
function Sn(t, e) {
|
|
3249
|
+
const s = ie(e), n = (a) => {
|
|
3250
|
+
Ts(a.data) && a.data.instanceId === s && t(a.data.question, a.data.answer);
|
|
3104
3251
|
};
|
|
3105
3252
|
return window.addEventListener("message", n), {
|
|
3106
3253
|
cancelSubscription: () => {
|
|
@@ -3108,7 +3255,7 @@ function on(t, e) {
|
|
|
3108
3255
|
}
|
|
3109
3256
|
};
|
|
3110
3257
|
}
|
|
3111
|
-
async function
|
|
3258
|
+
async function Tn(t, e) {
|
|
3112
3259
|
await C(
|
|
3113
3260
|
{
|
|
3114
3261
|
type: "qp-bridge",
|
|
@@ -3128,7 +3275,7 @@ async function cn(t, e) {
|
|
|
3128
3275
|
);
|
|
3129
3276
|
}
|
|
3130
3277
|
}
|
|
3131
|
-
async function
|
|
3278
|
+
async function Rn(t) {
|
|
3132
3279
|
await C(
|
|
3133
3280
|
{
|
|
3134
3281
|
type: "qp-bridge",
|
|
@@ -3137,7 +3284,7 @@ async function un(t) {
|
|
|
3137
3284
|
t
|
|
3138
3285
|
);
|
|
3139
3286
|
}
|
|
3140
|
-
async function
|
|
3287
|
+
async function Cn(t) {
|
|
3141
3288
|
await C(
|
|
3142
3289
|
{
|
|
3143
3290
|
type: "qp-bridge",
|
|
@@ -3146,7 +3293,7 @@ async function dn(t) {
|
|
|
3146
3293
|
t
|
|
3147
3294
|
);
|
|
3148
3295
|
}
|
|
3149
|
-
async function
|
|
3296
|
+
async function In(t, e) {
|
|
3150
3297
|
await C(
|
|
3151
3298
|
{
|
|
3152
3299
|
type: "qp-bridge",
|
|
@@ -3156,38 +3303,38 @@ async function ln(t, e) {
|
|
|
3156
3303
|
e
|
|
3157
3304
|
);
|
|
3158
3305
|
}
|
|
3159
|
-
const
|
|
3160
|
-
function
|
|
3161
|
-
const s =
|
|
3162
|
-
return
|
|
3306
|
+
const te = [], se = [], ne = [];
|
|
3307
|
+
function En(t, e) {
|
|
3308
|
+
const s = ie(e);
|
|
3309
|
+
return ne.some((n) => n.handler === t && n.instanceId === s) || ne.push({ handler: t, instanceId: s }), {
|
|
3163
3310
|
cancelSubscription: () => {
|
|
3164
|
-
const n =
|
|
3165
|
-
n !== -1 &&
|
|
3311
|
+
const n = ne.findIndex((a) => a.handler === t && a.instanceId === s);
|
|
3312
|
+
n !== -1 && ne.splice(n, 1);
|
|
3166
3313
|
}
|
|
3167
3314
|
};
|
|
3168
3315
|
}
|
|
3169
|
-
function
|
|
3170
|
-
const s =
|
|
3171
|
-
return
|
|
3316
|
+
function Nn(t, e) {
|
|
3317
|
+
const s = ie(e);
|
|
3318
|
+
return se.some((n) => n.handler === t && n.instanceId === s) || se.push({ handler: t, instanceId: s }), {
|
|
3172
3319
|
cancelSubscription: () => {
|
|
3173
|
-
const n =
|
|
3174
|
-
n !== -1 &&
|
|
3320
|
+
const n = se.findIndex((a) => a.handler === t && a.instanceId === s);
|
|
3321
|
+
n !== -1 && se.splice(n, 1);
|
|
3175
3322
|
}
|
|
3176
3323
|
};
|
|
3177
3324
|
}
|
|
3178
|
-
function
|
|
3179
|
-
const s =
|
|
3180
|
-
return
|
|
3325
|
+
function An(t, e) {
|
|
3326
|
+
const s = ie(e);
|
|
3327
|
+
return te.some((n) => n.validator === t && n.instanceId === s) || te.push({ validator: t, instanceId: s }), {
|
|
3181
3328
|
cancelSubscription: () => {
|
|
3182
|
-
const n =
|
|
3183
|
-
n !== -1 &&
|
|
3329
|
+
const n = te.findIndex((a) => a.validator === t && a.instanceId === s);
|
|
3330
|
+
n !== -1 && te.splice(n, 1);
|
|
3184
3331
|
}
|
|
3185
3332
|
};
|
|
3186
3333
|
}
|
|
3187
|
-
async function
|
|
3334
|
+
async function at(t) {
|
|
3188
3335
|
try {
|
|
3189
|
-
if (
|
|
3190
|
-
const e =
|
|
3336
|
+
if (Rs(t.data) && se.filter((e) => e.instanceId === t.data.instanceId).forEach((e) => e.handler(t.data.commandName)), Cs(t.data) && ne.filter((e) => e.instanceId === t.data.instanceId).forEach((e) => e.handler()), Ms(t.data)) {
|
|
3337
|
+
const e = te.filter((a) => a.instanceId === t.data.instanceId), s = await Promise.all(e.map((a) => a.validator())), n = {
|
|
3191
3338
|
type: "qp-bridge",
|
|
3192
3339
|
status: "success",
|
|
3193
3340
|
id: t.data.id,
|
|
@@ -3200,15 +3347,15 @@ async function Ye(t) {
|
|
|
3200
3347
|
const s = {
|
|
3201
3348
|
type: "qp-bridge",
|
|
3202
3349
|
status: "error",
|
|
3203
|
-
id:
|
|
3204
|
-
instanceId:
|
|
3350
|
+
id: Ee(t.data) ? t.data.id : void 0,
|
|
3351
|
+
instanceId: Ee(t.data) ? t.data.instanceId : void 0,
|
|
3205
3352
|
message: e instanceof Error ? e.message : "Unknown error"
|
|
3206
3353
|
};
|
|
3207
3354
|
window.parent.postMessage(s, "*");
|
|
3208
3355
|
}
|
|
3209
3356
|
}
|
|
3210
|
-
async function
|
|
3211
|
-
return await
|
|
3357
|
+
async function On(t, e) {
|
|
3358
|
+
return await Qs(
|
|
3212
3359
|
{
|
|
3213
3360
|
type: "qp-bridge",
|
|
3214
3361
|
action: "fetchEntities",
|
|
@@ -3217,8 +3364,8 @@ async function mn(t, e) {
|
|
|
3217
3364
|
e
|
|
3218
3365
|
);
|
|
3219
3366
|
}
|
|
3220
|
-
async function
|
|
3221
|
-
return await
|
|
3367
|
+
async function Mn(t, e, s) {
|
|
3368
|
+
return await Fs(
|
|
3222
3369
|
{
|
|
3223
3370
|
type: "qp-bridge",
|
|
3224
3371
|
action: "getEntityById",
|
|
@@ -3228,10 +3375,10 @@ async function gn(t, e, s) {
|
|
|
3228
3375
|
s
|
|
3229
3376
|
);
|
|
3230
3377
|
}
|
|
3231
|
-
function
|
|
3378
|
+
function Zn() {
|
|
3232
3379
|
return { isNew: !0 };
|
|
3233
3380
|
}
|
|
3234
|
-
async function
|
|
3381
|
+
async function qn(t, e) {
|
|
3235
3382
|
await C(
|
|
3236
3383
|
{
|
|
3237
3384
|
type: "qp-bridge",
|
|
@@ -3241,7 +3388,7 @@ async function _n(t, e) {
|
|
|
3241
3388
|
e
|
|
3242
3389
|
);
|
|
3243
3390
|
}
|
|
3244
|
-
async function
|
|
3391
|
+
async function jn(t, e, s) {
|
|
3245
3392
|
await C(
|
|
3246
3393
|
{
|
|
3247
3394
|
type: "qp-bridge",
|
|
@@ -3252,7 +3399,7 @@ async function vn(t, e, s) {
|
|
|
3252
3399
|
s
|
|
3253
3400
|
);
|
|
3254
3401
|
}
|
|
3255
|
-
async function
|
|
3402
|
+
async function Pn(t, e) {
|
|
3256
3403
|
await C(
|
|
3257
3404
|
{
|
|
3258
3405
|
type: "qp-bridge",
|
|
@@ -3262,7 +3409,7 @@ async function xn(t, e) {
|
|
|
3262
3409
|
e
|
|
3263
3410
|
);
|
|
3264
3411
|
}
|
|
3265
|
-
async function
|
|
3412
|
+
async function $n(t, e, s) {
|
|
3266
3413
|
await C(
|
|
3267
3414
|
{
|
|
3268
3415
|
type: "qp-bridge",
|
|
@@ -3273,156 +3420,165 @@ async function bn(t, e, s) {
|
|
|
3273
3420
|
s
|
|
3274
3421
|
);
|
|
3275
3422
|
}
|
|
3276
|
-
async function
|
|
3423
|
+
async function K(t, e, s) {
|
|
3277
3424
|
return new Promise((n, a) => {
|
|
3278
|
-
const r =
|
|
3279
|
-
if (
|
|
3425
|
+
const r = We(), i = ie(s), o = (d) => {
|
|
3426
|
+
if (js(d.data, r, i))
|
|
3280
3427
|
return;
|
|
3281
3428
|
const l = e(d.data);
|
|
3282
|
-
l.success ? n(l.data) :
|
|
3429
|
+
l.success ? n(l.data) : Es(d.data) ? a(new Error(d.data.message)) : a(new Error("Unknown message received")), window.removeEventListener("message", o);
|
|
3283
3430
|
};
|
|
3284
|
-
window.addEventListener("message", o), window.parent.postMessage({ ...t, id: r, instanceId: i, featureVersion:
|
|
3431
|
+
window.addEventListener("message", o), window.parent.postMessage({ ...t, id: r, instanceId: i, featureVersion: Vt }, "*");
|
|
3285
3432
|
});
|
|
3286
3433
|
}
|
|
3287
|
-
async function
|
|
3288
|
-
return
|
|
3434
|
+
async function Gs(t, e) {
|
|
3435
|
+
return K(
|
|
3289
3436
|
t,
|
|
3290
|
-
(s) =>
|
|
3437
|
+
(s) => Ns(s) ? { success: !0, data: s.question } : { success: !1 },
|
|
3291
3438
|
e
|
|
3292
3439
|
);
|
|
3293
3440
|
}
|
|
3294
|
-
async function
|
|
3295
|
-
return
|
|
3441
|
+
async function zs(t, e) {
|
|
3442
|
+
return K(
|
|
3296
3443
|
t,
|
|
3297
|
-
(s) =>
|
|
3444
|
+
(s) => As(s) ? { success: !0, data: s.group } : { success: !1 },
|
|
3298
3445
|
e
|
|
3299
3446
|
);
|
|
3300
3447
|
}
|
|
3301
|
-
async function
|
|
3302
|
-
return
|
|
3448
|
+
async function Ds(t, e) {
|
|
3449
|
+
return K(
|
|
3303
3450
|
t,
|
|
3304
|
-
(s) =>
|
|
3451
|
+
(s) => Os(s) ? { success: !0, data: s.questionnaire } : { success: !1 },
|
|
3305
3452
|
e
|
|
3306
3453
|
);
|
|
3307
3454
|
}
|
|
3308
3455
|
function C(t, e) {
|
|
3309
|
-
return
|
|
3456
|
+
return K(
|
|
3310
3457
|
t,
|
|
3311
|
-
(s) =>
|
|
3458
|
+
(s) => Is(s) ? { success: !0, data: void 0 } : { success: !1 },
|
|
3312
3459
|
e
|
|
3313
3460
|
);
|
|
3314
3461
|
}
|
|
3315
|
-
async function
|
|
3316
|
-
return
|
|
3462
|
+
async function Qs(t, e) {
|
|
3463
|
+
return K(
|
|
3317
3464
|
t,
|
|
3318
|
-
(s) =>
|
|
3465
|
+
(s) => Ps(s) ? { success: !0, data: s.entities } : { success: !1 },
|
|
3319
3466
|
e
|
|
3320
3467
|
);
|
|
3321
3468
|
}
|
|
3322
|
-
async function
|
|
3323
|
-
return
|
|
3469
|
+
async function Fs(t, e) {
|
|
3470
|
+
return K(
|
|
3324
3471
|
t,
|
|
3325
|
-
(s) =>
|
|
3472
|
+
(s) => $s(s) ? { success: !0, data: s.entity } : { success: !1 },
|
|
3326
3473
|
e
|
|
3327
3474
|
);
|
|
3328
3475
|
}
|
|
3329
3476
|
export {
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
on as
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3477
|
+
Vt as QP_BRIDGE_FEATURE_VERSION,
|
|
3478
|
+
Pn as addNewGroup,
|
|
3479
|
+
ws as addNewGroupRequestMessageSchema,
|
|
3480
|
+
hs as busyIndicatorEndRequestMessageSchema,
|
|
3481
|
+
fs as busyIndicatorStartRequestMessageSchema,
|
|
3482
|
+
us as canSaveRequestMessageSchema,
|
|
3483
|
+
cs as canSaveSuccessResponseMessageSchema,
|
|
3484
|
+
Bt as commandExecutedMessageSchema,
|
|
3485
|
+
Cn as completeAndCloseQuestionnaire,
|
|
3486
|
+
ps as completeAndCloseQuestionnaireRequestMessageSchema,
|
|
3487
|
+
mn as createMediaItem,
|
|
3488
|
+
Zn as createNewEntity,
|
|
3489
|
+
$n as deleteGroup,
|
|
3490
|
+
Ss as deleteGroupRequestMessageSchema,
|
|
3491
|
+
je as entitySchema,
|
|
3492
|
+
In as executeCustomCommand,
|
|
3493
|
+
gs as executeCustomCommandRequestMessageSchema,
|
|
3494
|
+
On as fetchEntities,
|
|
3495
|
+
ys as fetchEntitiesRequestMessageSchema,
|
|
3496
|
+
_s as fetchEntitiesSuccessResponseMessageSchema,
|
|
3497
|
+
Us as flattenQuestionnaireItems,
|
|
3498
|
+
_n as flattenQuestions,
|
|
3499
|
+
Mn as getEntityById,
|
|
3500
|
+
vs as getEntityByIdRequestMessageSchema,
|
|
3501
|
+
xs as getEntityByIdSuccessResponseMessageSchema,
|
|
3502
|
+
kn as getGroup,
|
|
3503
|
+
as as getGroupRequestMessageSchema,
|
|
3504
|
+
rs as getGroupSuccessResponseMessageSchema,
|
|
3505
|
+
xn as getQuestion,
|
|
3506
|
+
ts as getQuestionRequestMessageSchema,
|
|
3507
|
+
ss as getQuestionSuccessResponseMessageSchema,
|
|
3508
|
+
yn as getQuestionnaire,
|
|
3509
|
+
is as getQuestionnaireRequestMessageSchema,
|
|
3510
|
+
os as getQuestionnaireSuccessResponseMessageSchema,
|
|
3511
|
+
et as groupOptionalScheme,
|
|
3512
|
+
Ke as groupSchema,
|
|
3513
|
+
Ls as initOnSaveMessageHandler,
|
|
3514
|
+
fn as isAddNewGroupRequestMessage,
|
|
3515
|
+
qs as isBusyIndicatorEndRequestMessage,
|
|
3516
|
+
Zs as isBusyIndicatorStartRequestMessage,
|
|
3517
|
+
Ms as isCanSaveRequestMessage,
|
|
3518
|
+
sn as isCanSaveSuccessResponseMessage,
|
|
3519
|
+
Rs as isCommandExecutedMessage,
|
|
3520
|
+
an as isCompleteAndCloseQuestionnaireRequestMessage,
|
|
3521
|
+
hn as isDeleteGroupRequestMessage,
|
|
3522
|
+
Es as isErrorMessage,
|
|
3523
|
+
rn as isExecuteCustomCommandRequestMessage,
|
|
3524
|
+
cn as isFetchEntitiesRequestMessage,
|
|
3525
|
+
Ps as isFetchEntitiesSuccessResponseMessage,
|
|
3526
|
+
un as isGetEntityByIdRequestMessage,
|
|
3527
|
+
$s as isGetEntityByIdSuccessResponseMessage,
|
|
3528
|
+
en as isGetGroupRequestMessage,
|
|
3529
|
+
As as isGetGroupSuccessResponseMessage,
|
|
3530
|
+
Js as isGetQuestionRequestMessage,
|
|
3531
|
+
Ns as isGetQuestionSuccessResponseMessage,
|
|
3532
|
+
tn as isGetQuestionnaireRequestMessage,
|
|
3533
|
+
Os as isGetQuestionnaireSuccessResponseMessage,
|
|
3534
|
+
Ws as isMediaItem,
|
|
3535
|
+
js as isNotRelevantMessage,
|
|
3536
|
+
Ts as isOnAnswerChangeMessage,
|
|
3537
|
+
Ee as isQpBridgeMessage,
|
|
3538
|
+
Hs as isQpBridgeRequestMessage,
|
|
3539
|
+
Cs as isQuestionnaireLoadedMessage,
|
|
3540
|
+
ln as isRepeatGroupRequestMessage,
|
|
3541
|
+
dn as isSaveEntityRequestMessage,
|
|
3542
|
+
nn as isSaveQuestionnaireRequestMessage,
|
|
3543
|
+
Ys as isSetAnswerRequestMessage,
|
|
3544
|
+
Ks as isSetGroupRequestMessage,
|
|
3545
|
+
Xs as isSetQuestionRequestMessage,
|
|
3546
|
+
Is as isSuccessMessage,
|
|
3547
|
+
on as isWithBusyIndicatorRequestMessage,
|
|
3548
|
+
Wt as mediaItemSchema,
|
|
3549
|
+
Sn as onAnswerChange,
|
|
3550
|
+
Ut as onAnswerChangeMessageSchema,
|
|
3551
|
+
Nn as onCommandExecuted,
|
|
3552
|
+
En as onQuestionnaireLoaded,
|
|
3553
|
+
An as onSave,
|
|
3554
|
+
F as qpBridgeBaseMessageSchema,
|
|
3406
3555
|
S as qpBridgeRequestMessageSchema,
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3556
|
+
Qt as questionOptionalScheme,
|
|
3557
|
+
qe as questionSchema,
|
|
3558
|
+
Dt as questionTypeSchema,
|
|
3559
|
+
st as questionnaireGroupSchema,
|
|
3560
|
+
tt as questionnaireItemSchema,
|
|
3561
|
+
Gt as questionnaireLoadedMessageSchema,
|
|
3562
|
+
Ft as questionnaireQuestionSchema,
|
|
3563
|
+
Xt as questionnaireRepeatableGroupSchema,
|
|
3564
|
+
es as questionnaireSchema,
|
|
3565
|
+
Ht as questionnaireStaticComponentSchema,
|
|
3566
|
+
gn as removeOnSaveMessageHandler,
|
|
3567
|
+
jn as repeatGroup,
|
|
3568
|
+
ks as repeatGroupRequestMessageSchema,
|
|
3569
|
+
zt as responseErrorMessageSchema,
|
|
3570
|
+
W as responseSuccessMessageSchema,
|
|
3571
|
+
qn as saveEntity,
|
|
3572
|
+
bs as saveEntityRequestMessageSchema,
|
|
3573
|
+
Rn as saveQuestionnaire,
|
|
3574
|
+
ms as saveQuestionnaireRequestMessageSchema,
|
|
3575
|
+
vn as setAnswer,
|
|
3576
|
+
ls as setAnswerRequestMessageSchema,
|
|
3577
|
+
wn as setGroup,
|
|
3578
|
+
ds as setGroupRequestMessageSchema,
|
|
3579
|
+
bn as setQuestion,
|
|
3580
|
+
ns as setQuestionRequestMessageSchema,
|
|
3581
|
+
Vs as traverseQuestionnaireItems,
|
|
3582
|
+
pn as updateMediaItem,
|
|
3583
|
+
Tn as withBusyIndicator
|
|
3428
3584
|
};
|