@resconet/qp-bridge 1.1.0 → 1.1.1-alpha.31
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/index.js +1 -1
- package/index.mjs +1400 -1569
- package/lib/qp-bridge-types.d.ts +114 -79
- package/lib/qp-bridge.d.ts +40 -0
- package/package.json +6 -6
package/index.mjs
CHANGED
|
@@ -1,71 +1,72 @@
|
|
|
1
|
-
let
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
if (!
|
|
1
|
+
let ee;
|
|
2
|
+
const Be = new Uint8Array(16);
|
|
3
|
+
function ze() {
|
|
4
|
+
if (!ee && (ee = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !ee))
|
|
5
5
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
6
|
-
return
|
|
6
|
+
return ee(Be);
|
|
7
7
|
}
|
|
8
|
-
const
|
|
8
|
+
const S = [];
|
|
9
9
|
for (let t = 0; t < 256; ++t)
|
|
10
|
-
|
|
11
|
-
function
|
|
12
|
-
return
|
|
10
|
+
S.push((t + 256).toString(16).slice(1));
|
|
11
|
+
function De(t, e = 0) {
|
|
12
|
+
return S[t[e + 0]] + S[t[e + 1]] + S[t[e + 2]] + S[t[e + 3]] + "-" + S[t[e + 4]] + S[t[e + 5]] + "-" + S[t[e + 6]] + S[t[e + 7]] + "-" + S[t[e + 8]] + S[t[e + 9]] + "-" + S[t[e + 10]] + S[t[e + 11]] + S[t[e + 12]] + S[t[e + 13]] + S[t[e + 14]] + S[t[e + 15]];
|
|
13
13
|
}
|
|
14
|
-
const
|
|
15
|
-
randomUUID:
|
|
14
|
+
const Ge = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Ae = {
|
|
15
|
+
randomUUID: Ge
|
|
16
16
|
};
|
|
17
|
-
function
|
|
18
|
-
if (
|
|
19
|
-
return
|
|
17
|
+
function Me(t, e, s) {
|
|
18
|
+
if (Ae.randomUUID && !e && !t)
|
|
19
|
+
return Ae.randomUUID();
|
|
20
20
|
t = t || {};
|
|
21
|
-
const n = t.random || (t.rng ||
|
|
22
|
-
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128,
|
|
21
|
+
const n = t.random || (t.rng || ze)();
|
|
22
|
+
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, De(n);
|
|
23
23
|
}
|
|
24
|
-
var
|
|
24
|
+
var v;
|
|
25
25
|
(function(t) {
|
|
26
|
-
t.assertEqual = (
|
|
27
|
-
|
|
26
|
+
t.assertEqual = (a) => {
|
|
27
|
+
};
|
|
28
|
+
function e(a) {
|
|
28
29
|
}
|
|
29
30
|
t.assertIs = e;
|
|
30
|
-
function s(
|
|
31
|
+
function s(a) {
|
|
31
32
|
throw new Error();
|
|
32
33
|
}
|
|
33
|
-
t.assertNever = s, t.arrayToEnum = (
|
|
34
|
-
const
|
|
35
|
-
for (const i of
|
|
36
|
-
|
|
37
|
-
return
|
|
38
|
-
}, t.getValidEnumValues = (
|
|
39
|
-
const
|
|
40
|
-
for (const
|
|
41
|
-
i[
|
|
34
|
+
t.assertNever = s, t.arrayToEnum = (a) => {
|
|
35
|
+
const r = {};
|
|
36
|
+
for (const i of a)
|
|
37
|
+
r[i] = i;
|
|
38
|
+
return r;
|
|
39
|
+
}, t.getValidEnumValues = (a) => {
|
|
40
|
+
const r = t.objectKeys(a).filter((c) => typeof a[a[c]] != "number"), i = {};
|
|
41
|
+
for (const c of r)
|
|
42
|
+
i[c] = a[c];
|
|
42
43
|
return t.objectValues(i);
|
|
43
|
-
}, t.objectValues = (
|
|
44
|
-
return r
|
|
45
|
-
}), t.objectKeys = typeof Object.keys == "function" ? (
|
|
46
|
-
const
|
|
47
|
-
for (const i in
|
|
48
|
-
Object.prototype.hasOwnProperty.call(
|
|
49
|
-
return
|
|
50
|
-
}, t.find = (
|
|
51
|
-
for (const i of
|
|
52
|
-
if (
|
|
44
|
+
}, t.objectValues = (a) => t.objectKeys(a).map(function(r) {
|
|
45
|
+
return a[r];
|
|
46
|
+
}), t.objectKeys = typeof Object.keys == "function" ? (a) => Object.keys(a) : (a) => {
|
|
47
|
+
const r = [];
|
|
48
|
+
for (const i in a)
|
|
49
|
+
Object.prototype.hasOwnProperty.call(a, i) && r.push(i);
|
|
50
|
+
return r;
|
|
51
|
+
}, t.find = (a, r) => {
|
|
52
|
+
for (const i of a)
|
|
53
|
+
if (r(i))
|
|
53
54
|
return i;
|
|
54
|
-
}, t.isInteger = typeof Number.isInteger == "function" ? (
|
|
55
|
-
function n(
|
|
56
|
-
return
|
|
55
|
+
}, t.isInteger = typeof Number.isInteger == "function" ? (a) => Number.isInteger(a) : (a) => typeof a == "number" && Number.isFinite(a) && Math.floor(a) === a;
|
|
56
|
+
function n(a, r = " | ") {
|
|
57
|
+
return a.map((i) => typeof i == "string" ? `'${i}'` : i).join(r);
|
|
57
58
|
}
|
|
58
|
-
t.joinValues = n, t.jsonStringifyReplacer = (
|
|
59
|
-
})(
|
|
60
|
-
var
|
|
59
|
+
t.joinValues = n, t.jsonStringifyReplacer = (a, r) => typeof r == "bigint" ? r.toString() : r;
|
|
60
|
+
})(v || (v = {}));
|
|
61
|
+
var Ne;
|
|
61
62
|
(function(t) {
|
|
62
63
|
t.mergeShapes = (e, s) => ({
|
|
63
64
|
...e,
|
|
64
65
|
...s
|
|
65
66
|
// second overwrites first
|
|
66
67
|
});
|
|
67
|
-
})(
|
|
68
|
-
const
|
|
68
|
+
})(Ne || (Ne = {}));
|
|
69
|
+
const d = v.arrayToEnum([
|
|
69
70
|
"string",
|
|
70
71
|
"nan",
|
|
71
72
|
"number",
|
|
@@ -86,28 +87,28 @@ const f = x.arrayToEnum([
|
|
|
86
87
|
"never",
|
|
87
88
|
"map",
|
|
88
89
|
"set"
|
|
89
|
-
]),
|
|
90
|
+
]), I = (t) => {
|
|
90
91
|
switch (typeof t) {
|
|
91
92
|
case "undefined":
|
|
92
|
-
return
|
|
93
|
+
return d.undefined;
|
|
93
94
|
case "string":
|
|
94
|
-
return
|
|
95
|
+
return d.string;
|
|
95
96
|
case "number":
|
|
96
|
-
return isNaN(t) ?
|
|
97
|
+
return Number.isNaN(t) ? d.nan : d.number;
|
|
97
98
|
case "boolean":
|
|
98
|
-
return
|
|
99
|
+
return d.boolean;
|
|
99
100
|
case "function":
|
|
100
|
-
return
|
|
101
|
+
return d.function;
|
|
101
102
|
case "bigint":
|
|
102
|
-
return
|
|
103
|
+
return d.bigint;
|
|
103
104
|
case "symbol":
|
|
104
|
-
return
|
|
105
|
+
return d.symbol;
|
|
105
106
|
case "object":
|
|
106
|
-
return Array.isArray(t) ?
|
|
107
|
+
return Array.isArray(t) ? d.array : t === null ? d.null : t.then && typeof t.then == "function" && t.catch && typeof t.catch == "function" ? d.promise : typeof Map < "u" && t instanceof Map ? d.map : typeof Set < "u" && t instanceof Set ? d.set : typeof Date < "u" && t instanceof Date ? d.date : d.object;
|
|
107
108
|
default:
|
|
108
|
-
return
|
|
109
|
+
return d.unknown;
|
|
109
110
|
}
|
|
110
|
-
},
|
|
111
|
+
}, o = v.arrayToEnum([
|
|
111
112
|
"invalid_type",
|
|
112
113
|
"invalid_literal",
|
|
113
114
|
"custom",
|
|
@@ -124,8 +125,11 @@ const f = x.arrayToEnum([
|
|
|
124
125
|
"invalid_intersection_types",
|
|
125
126
|
"not_multiple_of",
|
|
126
127
|
"not_finite"
|
|
127
|
-
])
|
|
128
|
-
class
|
|
128
|
+
]);
|
|
129
|
+
class O extends Error {
|
|
130
|
+
get errors() {
|
|
131
|
+
return this.issues;
|
|
132
|
+
}
|
|
129
133
|
constructor(e) {
|
|
130
134
|
super(), this.issues = [], this.addIssue = (n) => {
|
|
131
135
|
this.issues = [...this.issues, n];
|
|
@@ -135,156 +139,157 @@ class E extends Error {
|
|
|
135
139
|
const s = new.target.prototype;
|
|
136
140
|
Object.setPrototypeOf ? Object.setPrototypeOf(this, s) : this.__proto__ = s, this.name = "ZodError", this.issues = e;
|
|
137
141
|
}
|
|
138
|
-
get errors() {
|
|
139
|
-
return this.issues;
|
|
140
|
-
}
|
|
141
142
|
format(e) {
|
|
142
|
-
const s = e || function(
|
|
143
|
-
return
|
|
144
|
-
}, n = { _errors: [] },
|
|
145
|
-
for (const i of
|
|
143
|
+
const s = e || function(r) {
|
|
144
|
+
return r.message;
|
|
145
|
+
}, n = { _errors: [] }, a = (r) => {
|
|
146
|
+
for (const i of r.issues)
|
|
146
147
|
if (i.code === "invalid_union")
|
|
147
|
-
i.unionErrors.map(
|
|
148
|
+
i.unionErrors.map(a);
|
|
148
149
|
else if (i.code === "invalid_return_type")
|
|
149
|
-
|
|
150
|
+
a(i.returnTypeError);
|
|
150
151
|
else if (i.code === "invalid_arguments")
|
|
151
|
-
|
|
152
|
+
a(i.argumentsError);
|
|
152
153
|
else if (i.path.length === 0)
|
|
153
154
|
n._errors.push(s(i));
|
|
154
155
|
else {
|
|
155
|
-
let
|
|
156
|
-
for (;
|
|
157
|
-
const
|
|
158
|
-
|
|
156
|
+
let c = n, f = 0;
|
|
157
|
+
for (; f < i.path.length; ) {
|
|
158
|
+
const h = i.path[f];
|
|
159
|
+
f === i.path.length - 1 ? (c[h] = c[h] || { _errors: [] }, c[h]._errors.push(s(i))) : c[h] = c[h] || { _errors: [] }, c = c[h], f++;
|
|
159
160
|
}
|
|
160
161
|
}
|
|
161
162
|
};
|
|
162
|
-
return
|
|
163
|
+
return a(this), n;
|
|
163
164
|
}
|
|
164
165
|
static assert(e) {
|
|
165
|
-
if (!(e instanceof
|
|
166
|
+
if (!(e instanceof O))
|
|
166
167
|
throw new Error(`Not a ZodError: ${e}`);
|
|
167
168
|
}
|
|
168
169
|
toString() {
|
|
169
170
|
return this.message;
|
|
170
171
|
}
|
|
171
172
|
get message() {
|
|
172
|
-
return JSON.stringify(this.issues,
|
|
173
|
+
return JSON.stringify(this.issues, v.jsonStringifyReplacer, 2);
|
|
173
174
|
}
|
|
174
175
|
get isEmpty() {
|
|
175
176
|
return this.issues.length === 0;
|
|
176
177
|
}
|
|
177
178
|
flatten(e = (s) => s.message) {
|
|
178
179
|
const s = {}, n = [];
|
|
179
|
-
for (const
|
|
180
|
-
|
|
180
|
+
for (const a of this.issues)
|
|
181
|
+
if (a.path.length > 0) {
|
|
182
|
+
const r = a.path[0];
|
|
183
|
+
s[r] = s[r] || [], s[r].push(e(a));
|
|
184
|
+
} else
|
|
185
|
+
n.push(e(a));
|
|
181
186
|
return { formErrors: n, fieldErrors: s };
|
|
182
187
|
}
|
|
183
188
|
get formErrors() {
|
|
184
189
|
return this.flatten();
|
|
185
190
|
}
|
|
186
191
|
}
|
|
187
|
-
|
|
188
|
-
const
|
|
192
|
+
O.create = (t) => new O(t);
|
|
193
|
+
const ue = (t, e) => {
|
|
189
194
|
let s;
|
|
190
195
|
switch (t.code) {
|
|
191
|
-
case
|
|
192
|
-
t.received ===
|
|
196
|
+
case o.invalid_type:
|
|
197
|
+
t.received === d.undefined ? s = "Required" : s = `Expected ${t.expected}, received ${t.received}`;
|
|
193
198
|
break;
|
|
194
|
-
case
|
|
195
|
-
s = `Invalid literal value, expected ${JSON.stringify(t.expected,
|
|
199
|
+
case o.invalid_literal:
|
|
200
|
+
s = `Invalid literal value, expected ${JSON.stringify(t.expected, v.jsonStringifyReplacer)}`;
|
|
196
201
|
break;
|
|
197
|
-
case
|
|
198
|
-
s = `Unrecognized key(s) in object: ${
|
|
202
|
+
case o.unrecognized_keys:
|
|
203
|
+
s = `Unrecognized key(s) in object: ${v.joinValues(t.keys, ", ")}`;
|
|
199
204
|
break;
|
|
200
|
-
case
|
|
205
|
+
case o.invalid_union:
|
|
201
206
|
s = "Invalid input";
|
|
202
207
|
break;
|
|
203
|
-
case
|
|
204
|
-
s = `Invalid discriminator value. Expected ${
|
|
208
|
+
case o.invalid_union_discriminator:
|
|
209
|
+
s = `Invalid discriminator value. Expected ${v.joinValues(t.options)}`;
|
|
205
210
|
break;
|
|
206
|
-
case
|
|
207
|
-
s = `Invalid enum value. Expected ${
|
|
211
|
+
case o.invalid_enum_value:
|
|
212
|
+
s = `Invalid enum value. Expected ${v.joinValues(t.options)}, received '${t.received}'`;
|
|
208
213
|
break;
|
|
209
|
-
case
|
|
214
|
+
case o.invalid_arguments:
|
|
210
215
|
s = "Invalid function arguments";
|
|
211
216
|
break;
|
|
212
|
-
case
|
|
217
|
+
case o.invalid_return_type:
|
|
213
218
|
s = "Invalid function return type";
|
|
214
219
|
break;
|
|
215
|
-
case
|
|
220
|
+
case o.invalid_date:
|
|
216
221
|
s = "Invalid date";
|
|
217
222
|
break;
|
|
218
|
-
case
|
|
219
|
-
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}"` :
|
|
223
|
+
case o.invalid_string:
|
|
224
|
+
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}"` : v.assertNever(t.validation) : t.validation !== "regex" ? s = `Invalid ${t.validation}` : s = "Invalid";
|
|
220
225
|
break;
|
|
221
|
-
case
|
|
222
|
-
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 === "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";
|
|
226
|
+
case o.too_small:
|
|
227
|
+
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";
|
|
223
228
|
break;
|
|
224
|
-
case
|
|
229
|
+
case o.too_big:
|
|
225
230
|
t.type === "array" ? s = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at most" : "less than"} ${t.maximum} element(s)` : t.type === "string" ? s = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at most" : "under"} ${t.maximum} character(s)` : t.type === "number" ? s = `Number must be ${t.exact ? "exactly" : t.inclusive ? "less than or equal to" : "less than"} ${t.maximum}` : t.type === "bigint" ? s = `BigInt must be ${t.exact ? "exactly" : t.inclusive ? "less than or equal to" : "less than"} ${t.maximum}` : t.type === "date" ? s = `Date must be ${t.exact ? "exactly" : t.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(t.maximum))}` : s = "Invalid input";
|
|
226
231
|
break;
|
|
227
|
-
case
|
|
232
|
+
case o.custom:
|
|
228
233
|
s = "Invalid input";
|
|
229
234
|
break;
|
|
230
|
-
case
|
|
235
|
+
case o.invalid_intersection_types:
|
|
231
236
|
s = "Intersection results could not be merged";
|
|
232
237
|
break;
|
|
233
|
-
case
|
|
238
|
+
case o.not_multiple_of:
|
|
234
239
|
s = `Number must be a multiple of ${t.multipleOf}`;
|
|
235
240
|
break;
|
|
236
|
-
case
|
|
241
|
+
case o.not_finite:
|
|
237
242
|
s = "Number must be finite";
|
|
238
243
|
break;
|
|
239
244
|
default:
|
|
240
|
-
s = e.defaultError,
|
|
245
|
+
s = e.defaultError, v.assertNever(t);
|
|
241
246
|
}
|
|
242
247
|
return { message: s };
|
|
243
248
|
};
|
|
244
|
-
let
|
|
245
|
-
function
|
|
246
|
-
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
const { data: e, path: s, errorMaps: n, issueData: r } = t, a = [...s, ...r.path || []], i = {
|
|
253
|
-
...r,
|
|
254
|
-
path: a
|
|
249
|
+
let Qe = ue;
|
|
250
|
+
function Fe() {
|
|
251
|
+
return Qe;
|
|
252
|
+
}
|
|
253
|
+
const We = (t) => {
|
|
254
|
+
const { data: e, path: s, errorMaps: n, issueData: a } = t, r = [...s, ...a.path || []], i = {
|
|
255
|
+
...a,
|
|
256
|
+
path: r
|
|
255
257
|
};
|
|
256
|
-
if (
|
|
258
|
+
if (a.message !== void 0)
|
|
257
259
|
return {
|
|
258
|
-
...
|
|
259
|
-
path:
|
|
260
|
-
message:
|
|
260
|
+
...a,
|
|
261
|
+
path: r,
|
|
262
|
+
message: a.message
|
|
261
263
|
};
|
|
262
|
-
let
|
|
263
|
-
const
|
|
264
|
-
for (const
|
|
265
|
-
|
|
264
|
+
let c = "";
|
|
265
|
+
const f = n.filter((h) => !!h).slice().reverse();
|
|
266
|
+
for (const h of f)
|
|
267
|
+
c = h(i, { data: e, defaultError: c }).message;
|
|
266
268
|
return {
|
|
267
|
-
...
|
|
268
|
-
path:
|
|
269
|
-
message:
|
|
269
|
+
...a,
|
|
270
|
+
path: r,
|
|
271
|
+
message: c
|
|
270
272
|
};
|
|
271
|
-
}
|
|
272
|
-
function
|
|
273
|
-
const s =
|
|
273
|
+
};
|
|
274
|
+
function u(t, e) {
|
|
275
|
+
const s = Fe(), n = We({
|
|
274
276
|
issueData: e,
|
|
275
277
|
data: t.data,
|
|
276
278
|
path: t.path,
|
|
277
279
|
errorMaps: [
|
|
278
280
|
t.common.contextualErrorMap,
|
|
281
|
+
// contextual error map is first priority
|
|
279
282
|
t.schemaErrorMap,
|
|
283
|
+
// then schema-bound map if available
|
|
280
284
|
s,
|
|
281
|
-
|
|
285
|
+
// then global override map
|
|
286
|
+
s === ue ? void 0 : ue
|
|
282
287
|
// then global default map
|
|
283
|
-
].filter((
|
|
288
|
+
].filter((a) => !!a)
|
|
284
289
|
});
|
|
285
290
|
t.common.issues.push(n);
|
|
286
291
|
}
|
|
287
|
-
class
|
|
292
|
+
class R {
|
|
288
293
|
constructor() {
|
|
289
294
|
this.value = "valid";
|
|
290
295
|
}
|
|
@@ -296,63 +301,52 @@ class S {
|
|
|
296
301
|
}
|
|
297
302
|
static mergeArray(e, s) {
|
|
298
303
|
const n = [];
|
|
299
|
-
for (const
|
|
300
|
-
if (
|
|
301
|
-
return
|
|
302
|
-
|
|
304
|
+
for (const a of s) {
|
|
305
|
+
if (a.status === "aborted")
|
|
306
|
+
return p;
|
|
307
|
+
a.status === "dirty" && e.dirty(), n.push(a.value);
|
|
303
308
|
}
|
|
304
309
|
return { status: e.value, value: n };
|
|
305
310
|
}
|
|
306
311
|
static async mergeObjectAsync(e, s) {
|
|
307
312
|
const n = [];
|
|
308
|
-
for (const
|
|
309
|
-
const
|
|
313
|
+
for (const a of s) {
|
|
314
|
+
const r = await a.key, i = await a.value;
|
|
310
315
|
n.push({
|
|
311
|
-
key:
|
|
316
|
+
key: r,
|
|
312
317
|
value: i
|
|
313
318
|
});
|
|
314
319
|
}
|
|
315
|
-
return
|
|
320
|
+
return R.mergeObjectSync(e, n);
|
|
316
321
|
}
|
|
317
322
|
static mergeObjectSync(e, s) {
|
|
318
323
|
const n = {};
|
|
319
|
-
for (const
|
|
320
|
-
const { key:
|
|
321
|
-
if (
|
|
322
|
-
return
|
|
323
|
-
|
|
324
|
+
for (const a of s) {
|
|
325
|
+
const { key: r, value: i } = a;
|
|
326
|
+
if (r.status === "aborted" || i.status === "aborted")
|
|
327
|
+
return p;
|
|
328
|
+
r.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), r.value !== "__proto__" && (typeof i.value < "u" || a.alwaysSet) && (n[r.value] = i.value);
|
|
324
329
|
}
|
|
325
330
|
return { status: e.value, value: n };
|
|
326
331
|
}
|
|
327
332
|
}
|
|
328
|
-
const
|
|
333
|
+
const p = Object.freeze({
|
|
329
334
|
status: "aborted"
|
|
330
|
-
}), W = (t) => ({ status: "dirty", value: t }), T = (t) => ({ status: "valid", value: t }),
|
|
331
|
-
|
|
332
|
-
if (typeof e == "function" ? t !== e || !n : !e.has(t))
|
|
333
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
334
|
-
return e.get(t);
|
|
335
|
-
}
|
|
336
|
-
function Le(t, e, s, n, r) {
|
|
337
|
-
if (typeof e == "function" ? t !== e || !r : !e.has(t))
|
|
338
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
339
|
-
return e.set(t, s), s;
|
|
340
|
-
}
|
|
341
|
-
var p;
|
|
335
|
+
}), W = (t) => ({ status: "dirty", value: t }), T = (t) => ({ status: "valid", value: t }), Ee = (t) => t.status === "aborted", Oe = (t) => t.status === "dirty", V = (t) => t.status === "valid", te = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
336
|
+
var l;
|
|
342
337
|
(function(t) {
|
|
343
338
|
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
344
|
-
})(
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
this._cachedPath = [], this.parent = e, this.data = s, this._path = n, this._key = r;
|
|
339
|
+
})(l || (l = {}));
|
|
340
|
+
class N {
|
|
341
|
+
constructor(e, s, n, a) {
|
|
342
|
+
this._cachedPath = [], this.parent = e, this.data = s, this._path = n, this._key = a;
|
|
349
343
|
}
|
|
350
344
|
get path() {
|
|
351
|
-
return this._cachedPath.length || (this._key
|
|
345
|
+
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
352
346
|
}
|
|
353
347
|
}
|
|
354
|
-
const
|
|
355
|
-
if (
|
|
348
|
+
const Ie = (t, e) => {
|
|
349
|
+
if (V(e))
|
|
356
350
|
return { success: !0, data: e.value };
|
|
357
351
|
if (!t.common.issues.length)
|
|
358
352
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -361,38 +355,34 @@ const Pe = (t, e) => {
|
|
|
361
355
|
get error() {
|
|
362
356
|
if (this._error)
|
|
363
357
|
return this._error;
|
|
364
|
-
const s = new
|
|
358
|
+
const s = new O(t.common.issues);
|
|
365
359
|
return this._error = s, this._error;
|
|
366
360
|
}
|
|
367
361
|
};
|
|
368
362
|
};
|
|
369
|
-
function
|
|
363
|
+
function g(t) {
|
|
370
364
|
if (!t)
|
|
371
365
|
return {};
|
|
372
|
-
const { errorMap: e, invalid_type_error: s, required_error: n, description:
|
|
366
|
+
const { errorMap: e, invalid_type_error: s, required_error: n, description: a } = t;
|
|
373
367
|
if (e && (s || n))
|
|
374
368
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
375
|
-
return e ? { errorMap: e, description:
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
}, description: r };
|
|
369
|
+
return e ? { errorMap: e, description: a } : { errorMap: (i, c) => {
|
|
370
|
+
const { message: f } = t;
|
|
371
|
+
return i.code === "invalid_enum_value" ? { message: f ?? c.defaultError } : typeof c.data > "u" ? { message: f ?? n ?? c.defaultError } : i.code !== "invalid_type" ? { message: c.defaultError } : { message: f ?? s ?? c.defaultError };
|
|
372
|
+
}, description: a };
|
|
380
373
|
}
|
|
381
|
-
class
|
|
382
|
-
constructor(e) {
|
|
383
|
-
this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this);
|
|
384
|
-
}
|
|
374
|
+
class y {
|
|
385
375
|
get description() {
|
|
386
376
|
return this._def.description;
|
|
387
377
|
}
|
|
388
378
|
_getType(e) {
|
|
389
|
-
return
|
|
379
|
+
return I(e.data);
|
|
390
380
|
}
|
|
391
381
|
_getOrReturnCtx(e, s) {
|
|
392
382
|
return s || {
|
|
393
383
|
common: e.parent.common,
|
|
394
384
|
data: e.data,
|
|
395
|
-
parsedType:
|
|
385
|
+
parsedType: I(e.data),
|
|
396
386
|
schemaErrorMap: this._def.errorMap,
|
|
397
387
|
path: e.path,
|
|
398
388
|
parent: e.parent
|
|
@@ -400,11 +390,11 @@ class _ {
|
|
|
400
390
|
}
|
|
401
391
|
_processInputParams(e) {
|
|
402
392
|
return {
|
|
403
|
-
status: new
|
|
393
|
+
status: new R(),
|
|
404
394
|
ctx: {
|
|
405
395
|
common: e.parent.common,
|
|
406
396
|
data: e.data,
|
|
407
|
-
parsedType:
|
|
397
|
+
parsedType: I(e.data),
|
|
408
398
|
schemaErrorMap: this._def.errorMap,
|
|
409
399
|
path: e.path,
|
|
410
400
|
parent: e.parent
|
|
@@ -413,7 +403,7 @@ class _ {
|
|
|
413
403
|
}
|
|
414
404
|
_parseSync(e) {
|
|
415
405
|
const s = this._parse(e);
|
|
416
|
-
if (
|
|
406
|
+
if (te(s))
|
|
417
407
|
throw new Error("Synchronous parse encountered promise.");
|
|
418
408
|
return s;
|
|
419
409
|
}
|
|
@@ -428,20 +418,52 @@ class _ {
|
|
|
428
418
|
throw n.error;
|
|
429
419
|
}
|
|
430
420
|
safeParse(e, s) {
|
|
431
|
-
|
|
432
|
-
const r = {
|
|
421
|
+
const n = {
|
|
433
422
|
common: {
|
|
434
423
|
issues: [],
|
|
435
|
-
async: (
|
|
424
|
+
async: (s == null ? void 0 : s.async) ?? !1,
|
|
436
425
|
contextualErrorMap: s == null ? void 0 : s.errorMap
|
|
437
426
|
},
|
|
438
427
|
path: (s == null ? void 0 : s.path) || [],
|
|
439
428
|
schemaErrorMap: this._def.errorMap,
|
|
440
429
|
parent: null,
|
|
441
430
|
data: e,
|
|
442
|
-
parsedType:
|
|
443
|
-
}, a = this._parseSync({ data: e, path:
|
|
444
|
-
return
|
|
431
|
+
parsedType: I(e)
|
|
432
|
+
}, a = this._parseSync({ data: e, path: n.path, parent: n });
|
|
433
|
+
return Ie(n, a);
|
|
434
|
+
}
|
|
435
|
+
"~validate"(e) {
|
|
436
|
+
var n, a;
|
|
437
|
+
const s = {
|
|
438
|
+
common: {
|
|
439
|
+
issues: [],
|
|
440
|
+
async: !!this["~standard"].async
|
|
441
|
+
},
|
|
442
|
+
path: [],
|
|
443
|
+
schemaErrorMap: this._def.errorMap,
|
|
444
|
+
parent: null,
|
|
445
|
+
data: e,
|
|
446
|
+
parsedType: I(e)
|
|
447
|
+
};
|
|
448
|
+
if (!this["~standard"].async)
|
|
449
|
+
try {
|
|
450
|
+
const r = this._parseSync({ data: e, path: [], parent: s });
|
|
451
|
+
return V(r) ? {
|
|
452
|
+
value: r.value
|
|
453
|
+
} : {
|
|
454
|
+
issues: s.common.issues
|
|
455
|
+
};
|
|
456
|
+
} catch (r) {
|
|
457
|
+
(a = (n = r == null ? void 0 : r.message) == null ? void 0 : n.toLowerCase()) != null && a.includes("encountered") && (this["~standard"].async = !0), s.common = {
|
|
458
|
+
issues: [],
|
|
459
|
+
async: !0
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
return this._parseAsync({ data: e, path: [], parent: s }).then((r) => V(r) ? {
|
|
463
|
+
value: r.value
|
|
464
|
+
} : {
|
|
465
|
+
issues: s.common.issues
|
|
466
|
+
});
|
|
445
467
|
}
|
|
446
468
|
async parseAsync(e, s) {
|
|
447
469
|
const n = await this.safeParseAsync(e, s);
|
|
@@ -460,25 +482,25 @@ class _ {
|
|
|
460
482
|
schemaErrorMap: this._def.errorMap,
|
|
461
483
|
parent: null,
|
|
462
484
|
data: e,
|
|
463
|
-
parsedType:
|
|
464
|
-
},
|
|
465
|
-
return
|
|
485
|
+
parsedType: I(e)
|
|
486
|
+
}, a = this._parse({ data: e, path: n.path, parent: n }), r = await (te(a) ? a : Promise.resolve(a));
|
|
487
|
+
return Ie(n, r);
|
|
466
488
|
}
|
|
467
489
|
refine(e, s) {
|
|
468
|
-
const n = (
|
|
469
|
-
return this._refinement((
|
|
470
|
-
const i = e(
|
|
471
|
-
code:
|
|
472
|
-
...n(
|
|
490
|
+
const n = (a) => typeof s == "string" || typeof s > "u" ? { message: s } : typeof s == "function" ? s(a) : s;
|
|
491
|
+
return this._refinement((a, r) => {
|
|
492
|
+
const i = e(a), c = () => r.addIssue({
|
|
493
|
+
code: o.custom,
|
|
494
|
+
...n(a)
|
|
473
495
|
});
|
|
474
|
-
return typeof Promise < "u" && i instanceof Promise ? i.then((
|
|
496
|
+
return typeof Promise < "u" && i instanceof Promise ? i.then((f) => f ? !0 : (c(), !1)) : i ? !0 : (c(), !1);
|
|
475
497
|
});
|
|
476
498
|
}
|
|
477
499
|
refinement(e, s) {
|
|
478
|
-
return this._refinement((n,
|
|
500
|
+
return this._refinement((n, a) => e(n) ? !0 : (a.addIssue(typeof s == "function" ? s(n, a) : s), !1));
|
|
479
501
|
}
|
|
480
502
|
_refinement(e) {
|
|
481
|
-
return new
|
|
503
|
+
return new j({
|
|
482
504
|
schema: this,
|
|
483
505
|
typeName: m.ZodEffects,
|
|
484
506
|
effect: { type: "refinement", refinement: e }
|
|
@@ -487,30 +509,37 @@ class _ {
|
|
|
487
509
|
superRefine(e) {
|
|
488
510
|
return this._refinement(e);
|
|
489
511
|
}
|
|
512
|
+
constructor(e) {
|
|
513
|
+
this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this), this["~standard"] = {
|
|
514
|
+
version: 1,
|
|
515
|
+
vendor: "zod",
|
|
516
|
+
validate: (s) => this["~validate"](s)
|
|
517
|
+
};
|
|
518
|
+
}
|
|
490
519
|
optional() {
|
|
491
|
-
return
|
|
520
|
+
return M.create(this, this._def);
|
|
492
521
|
}
|
|
493
522
|
nullable() {
|
|
494
|
-
return
|
|
523
|
+
return Q.create(this, this._def);
|
|
495
524
|
}
|
|
496
525
|
nullish() {
|
|
497
526
|
return this.nullable().optional();
|
|
498
527
|
}
|
|
499
528
|
array() {
|
|
500
|
-
return
|
|
529
|
+
return A.create(this);
|
|
501
530
|
}
|
|
502
531
|
promise() {
|
|
503
|
-
return
|
|
532
|
+
return re.create(this, this._def);
|
|
504
533
|
}
|
|
505
534
|
or(e) {
|
|
506
|
-
return
|
|
535
|
+
return se.create([this, e], this._def);
|
|
507
536
|
}
|
|
508
537
|
and(e) {
|
|
509
|
-
return
|
|
538
|
+
return ne.create(this, e, this._def);
|
|
510
539
|
}
|
|
511
540
|
transform(e) {
|
|
512
|
-
return new
|
|
513
|
-
...
|
|
541
|
+
return new j({
|
|
542
|
+
...g(this._def),
|
|
514
543
|
schema: this,
|
|
515
544
|
typeName: m.ZodEffects,
|
|
516
545
|
effect: { type: "transform", transform: e }
|
|
@@ -518,24 +547,24 @@ class _ {
|
|
|
518
547
|
}
|
|
519
548
|
default(e) {
|
|
520
549
|
const s = typeof e == "function" ? e : () => e;
|
|
521
|
-
return new
|
|
522
|
-
...
|
|
550
|
+
return new ke({
|
|
551
|
+
...g(this._def),
|
|
523
552
|
innerType: this,
|
|
524
553
|
defaultValue: s,
|
|
525
554
|
typeName: m.ZodDefault
|
|
526
555
|
});
|
|
527
556
|
}
|
|
528
557
|
brand() {
|
|
529
|
-
return new
|
|
558
|
+
return new yt({
|
|
530
559
|
typeName: m.ZodBranded,
|
|
531
560
|
type: this,
|
|
532
|
-
...
|
|
561
|
+
...g(this._def)
|
|
533
562
|
});
|
|
534
563
|
}
|
|
535
564
|
catch(e) {
|
|
536
565
|
const s = typeof e == "function" ? e : () => e;
|
|
537
|
-
return new
|
|
538
|
-
...
|
|
566
|
+
return new we({
|
|
567
|
+
...g(this._def),
|
|
539
568
|
innerType: this,
|
|
540
569
|
catchValue: s,
|
|
541
570
|
typeName: m.ZodCatch
|
|
@@ -549,10 +578,10 @@ class _ {
|
|
|
549
578
|
});
|
|
550
579
|
}
|
|
551
580
|
pipe(e) {
|
|
552
|
-
return
|
|
581
|
+
return Ce.create(this, e);
|
|
553
582
|
}
|
|
554
583
|
readonly() {
|
|
555
|
-
return
|
|
584
|
+
return Re.create(this);
|
|
556
585
|
}
|
|
557
586
|
isOptional() {
|
|
558
587
|
return this.safeParse(void 0).success;
|
|
@@ -561,213 +590,254 @@ class _ {
|
|
|
561
590
|
return this.safeParse(null).success;
|
|
562
591
|
}
|
|
563
592
|
}
|
|
564
|
-
const
|
|
565
|
-
let
|
|
566
|
-
const
|
|
567
|
-
function
|
|
568
|
-
let e = "
|
|
569
|
-
|
|
593
|
+
const He = /^c[^\s-]{8,}$/i, Je = /^[0-9a-z]+$/, Ye = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Xe = /^[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, Ke = /^[a-z0-9_-]{21}$/i, et = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, tt = /^[-+]?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)?)??$/, st = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, nt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
594
|
+
let oe;
|
|
595
|
+
const at = /^(?:(?: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])$/, rt = /^(?:(?: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])$/, it = /^(([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]))$/, ct = /^(([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])$/, ot = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, ut = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Ze = "((\\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])))", dt = new RegExp(`^${Ze}$`);
|
|
596
|
+
function je(t) {
|
|
597
|
+
let e = "[0-5]\\d";
|
|
598
|
+
t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
599
|
+
const s = t.precision ? "+" : "?";
|
|
600
|
+
return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${s}`;
|
|
570
601
|
}
|
|
571
|
-
function
|
|
572
|
-
return new RegExp(`^${
|
|
602
|
+
function lt(t) {
|
|
603
|
+
return new RegExp(`^${je(t)}$`);
|
|
573
604
|
}
|
|
574
|
-
function
|
|
575
|
-
let e = `${
|
|
605
|
+
function ft(t) {
|
|
606
|
+
let e = `${Ze}T${je(t)}`;
|
|
576
607
|
const s = [];
|
|
577
608
|
return s.push(t.local ? "Z?" : "Z"), t.offset && s.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${s.join("|")})`, new RegExp(`^${e}$`);
|
|
578
609
|
}
|
|
579
|
-
function
|
|
580
|
-
return !!((e === "v4" || !e) &&
|
|
610
|
+
function ht(t, e) {
|
|
611
|
+
return !!((e === "v4" || !e) && at.test(t) || (e === "v6" || !e) && it.test(t));
|
|
581
612
|
}
|
|
582
|
-
|
|
613
|
+
function mt(t, e) {
|
|
614
|
+
if (!et.test(t))
|
|
615
|
+
return !1;
|
|
616
|
+
try {
|
|
617
|
+
const [s] = t.split(".");
|
|
618
|
+
if (!s)
|
|
619
|
+
return !1;
|
|
620
|
+
const n = s.replace(/-/g, "+").replace(/_/g, "/").padEnd(s.length + (4 - s.length % 4) % 4, "="), a = JSON.parse(atob(n));
|
|
621
|
+
return !(typeof a != "object" || a === null || "typ" in a && (a == null ? void 0 : a.typ) !== "JWT" || !a.alg || e && a.alg !== e);
|
|
622
|
+
} catch {
|
|
623
|
+
return !1;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
function pt(t, e) {
|
|
627
|
+
return !!((e === "v4" || !e) && rt.test(t) || (e === "v6" || !e) && ct.test(t));
|
|
628
|
+
}
|
|
629
|
+
class E extends y {
|
|
583
630
|
_parse(e) {
|
|
584
|
-
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !==
|
|
585
|
-
const
|
|
586
|
-
return
|
|
587
|
-
code:
|
|
588
|
-
expected:
|
|
589
|
-
received:
|
|
590
|
-
}),
|
|
631
|
+
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== d.string) {
|
|
632
|
+
const r = this._getOrReturnCtx(e);
|
|
633
|
+
return u(r, {
|
|
634
|
+
code: o.invalid_type,
|
|
635
|
+
expected: d.string,
|
|
636
|
+
received: r.parsedType
|
|
637
|
+
}), p;
|
|
591
638
|
}
|
|
592
|
-
const n = new
|
|
593
|
-
let
|
|
594
|
-
for (const
|
|
595
|
-
if (
|
|
596
|
-
e.data.length <
|
|
597
|
-
code:
|
|
598
|
-
minimum:
|
|
639
|
+
const n = new R();
|
|
640
|
+
let a;
|
|
641
|
+
for (const r of this._def.checks)
|
|
642
|
+
if (r.kind === "min")
|
|
643
|
+
e.data.length < r.value && (a = this._getOrReturnCtx(e, a), u(a, {
|
|
644
|
+
code: o.too_small,
|
|
645
|
+
minimum: r.value,
|
|
599
646
|
type: "string",
|
|
600
647
|
inclusive: !0,
|
|
601
648
|
exact: !1,
|
|
602
|
-
message:
|
|
649
|
+
message: r.message
|
|
603
650
|
}), n.dirty());
|
|
604
|
-
else if (
|
|
605
|
-
e.data.length >
|
|
606
|
-
code:
|
|
607
|
-
maximum:
|
|
651
|
+
else if (r.kind === "max")
|
|
652
|
+
e.data.length > r.value && (a = this._getOrReturnCtx(e, a), u(a, {
|
|
653
|
+
code: o.too_big,
|
|
654
|
+
maximum: r.value,
|
|
608
655
|
type: "string",
|
|
609
656
|
inclusive: !0,
|
|
610
657
|
exact: !1,
|
|
611
|
-
message:
|
|
658
|
+
message: r.message
|
|
612
659
|
}), n.dirty());
|
|
613
|
-
else if (
|
|
614
|
-
const i = e.data.length >
|
|
615
|
-
(i ||
|
|
616
|
-
code:
|
|
617
|
-
maximum:
|
|
660
|
+
else if (r.kind === "length") {
|
|
661
|
+
const i = e.data.length > r.value, c = e.data.length < r.value;
|
|
662
|
+
(i || c) && (a = this._getOrReturnCtx(e, a), i ? u(a, {
|
|
663
|
+
code: o.too_big,
|
|
664
|
+
maximum: r.value,
|
|
618
665
|
type: "string",
|
|
619
666
|
inclusive: !0,
|
|
620
667
|
exact: !0,
|
|
621
|
-
message:
|
|
622
|
-
}) :
|
|
623
|
-
code:
|
|
624
|
-
minimum:
|
|
668
|
+
message: r.message
|
|
669
|
+
}) : c && u(a, {
|
|
670
|
+
code: o.too_small,
|
|
671
|
+
minimum: r.value,
|
|
625
672
|
type: "string",
|
|
626
673
|
inclusive: !0,
|
|
627
674
|
exact: !0,
|
|
628
|
-
message:
|
|
675
|
+
message: r.message
|
|
629
676
|
}), n.dirty());
|
|
630
|
-
} else if (
|
|
631
|
-
|
|
677
|
+
} else if (r.kind === "email")
|
|
678
|
+
st.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
632
679
|
validation: "email",
|
|
633
|
-
code:
|
|
634
|
-
message:
|
|
680
|
+
code: o.invalid_string,
|
|
681
|
+
message: r.message
|
|
635
682
|
}), n.dirty());
|
|
636
|
-
else if (
|
|
637
|
-
|
|
683
|
+
else if (r.kind === "emoji")
|
|
684
|
+
oe || (oe = new RegExp(nt, "u")), oe.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
638
685
|
validation: "emoji",
|
|
639
|
-
code:
|
|
640
|
-
message:
|
|
686
|
+
code: o.invalid_string,
|
|
687
|
+
message: r.message
|
|
641
688
|
}), n.dirty());
|
|
642
|
-
else if (
|
|
643
|
-
|
|
689
|
+
else if (r.kind === "uuid")
|
|
690
|
+
Xe.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
644
691
|
validation: "uuid",
|
|
645
|
-
code:
|
|
646
|
-
message:
|
|
692
|
+
code: o.invalid_string,
|
|
693
|
+
message: r.message
|
|
647
694
|
}), n.dirty());
|
|
648
|
-
else if (
|
|
649
|
-
|
|
695
|
+
else if (r.kind === "nanoid")
|
|
696
|
+
Ke.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
650
697
|
validation: "nanoid",
|
|
651
|
-
code:
|
|
652
|
-
message:
|
|
698
|
+
code: o.invalid_string,
|
|
699
|
+
message: r.message
|
|
653
700
|
}), n.dirty());
|
|
654
|
-
else if (
|
|
655
|
-
|
|
701
|
+
else if (r.kind === "cuid")
|
|
702
|
+
He.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
656
703
|
validation: "cuid",
|
|
657
|
-
code:
|
|
658
|
-
message:
|
|
704
|
+
code: o.invalid_string,
|
|
705
|
+
message: r.message
|
|
659
706
|
}), n.dirty());
|
|
660
|
-
else if (
|
|
661
|
-
|
|
707
|
+
else if (r.kind === "cuid2")
|
|
708
|
+
Je.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
662
709
|
validation: "cuid2",
|
|
663
|
-
code:
|
|
664
|
-
message:
|
|
710
|
+
code: o.invalid_string,
|
|
711
|
+
message: r.message
|
|
665
712
|
}), n.dirty());
|
|
666
|
-
else if (
|
|
667
|
-
|
|
713
|
+
else if (r.kind === "ulid")
|
|
714
|
+
Ye.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
668
715
|
validation: "ulid",
|
|
669
|
-
code:
|
|
670
|
-
message:
|
|
716
|
+
code: o.invalid_string,
|
|
717
|
+
message: r.message
|
|
671
718
|
}), n.dirty());
|
|
672
|
-
else if (
|
|
719
|
+
else if (r.kind === "url")
|
|
673
720
|
try {
|
|
674
721
|
new URL(e.data);
|
|
675
722
|
} catch {
|
|
676
|
-
|
|
723
|
+
a = this._getOrReturnCtx(e, a), u(a, {
|
|
677
724
|
validation: "url",
|
|
678
|
-
code:
|
|
679
|
-
message:
|
|
725
|
+
code: o.invalid_string,
|
|
726
|
+
message: r.message
|
|
680
727
|
}), n.dirty();
|
|
681
728
|
}
|
|
682
729
|
else
|
|
683
|
-
|
|
730
|
+
r.kind === "regex" ? (r.regex.lastIndex = 0, r.regex.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
684
731
|
validation: "regex",
|
|
685
|
-
code:
|
|
686
|
-
message:
|
|
687
|
-
}), n.dirty())) :
|
|
688
|
-
code:
|
|
689
|
-
validation: { includes:
|
|
690
|
-
message:
|
|
691
|
-
}), n.dirty()) :
|
|
692
|
-
code:
|
|
693
|
-
validation: { startsWith:
|
|
694
|
-
message:
|
|
695
|
-
}), n.dirty()) :
|
|
696
|
-
code:
|
|
697
|
-
validation: { endsWith:
|
|
698
|
-
message:
|
|
699
|
-
}), n.dirty()) :
|
|
700
|
-
code:
|
|
732
|
+
code: o.invalid_string,
|
|
733
|
+
message: r.message
|
|
734
|
+
}), n.dirty())) : r.kind === "trim" ? e.data = e.data.trim() : r.kind === "includes" ? e.data.includes(r.value, r.position) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
735
|
+
code: o.invalid_string,
|
|
736
|
+
validation: { includes: r.value, position: r.position },
|
|
737
|
+
message: r.message
|
|
738
|
+
}), n.dirty()) : r.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : r.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : r.kind === "startsWith" ? e.data.startsWith(r.value) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
739
|
+
code: o.invalid_string,
|
|
740
|
+
validation: { startsWith: r.value },
|
|
741
|
+
message: r.message
|
|
742
|
+
}), n.dirty()) : r.kind === "endsWith" ? e.data.endsWith(r.value) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
743
|
+
code: o.invalid_string,
|
|
744
|
+
validation: { endsWith: r.value },
|
|
745
|
+
message: r.message
|
|
746
|
+
}), n.dirty()) : r.kind === "datetime" ? ft(r).test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
747
|
+
code: o.invalid_string,
|
|
701
748
|
validation: "datetime",
|
|
702
|
-
message:
|
|
703
|
-
}), n.dirty()) :
|
|
704
|
-
code:
|
|
749
|
+
message: r.message
|
|
750
|
+
}), n.dirty()) : r.kind === "date" ? dt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
751
|
+
code: o.invalid_string,
|
|
705
752
|
validation: "date",
|
|
706
|
-
message:
|
|
707
|
-
}), n.dirty()) :
|
|
708
|
-
code:
|
|
753
|
+
message: r.message
|
|
754
|
+
}), n.dirty()) : r.kind === "time" ? lt(r).test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
755
|
+
code: o.invalid_string,
|
|
709
756
|
validation: "time",
|
|
710
|
-
message:
|
|
711
|
-
}), n.dirty()) :
|
|
757
|
+
message: r.message
|
|
758
|
+
}), n.dirty()) : r.kind === "duration" ? tt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
712
759
|
validation: "duration",
|
|
713
|
-
code:
|
|
714
|
-
message:
|
|
715
|
-
}), n.dirty()) :
|
|
760
|
+
code: o.invalid_string,
|
|
761
|
+
message: r.message
|
|
762
|
+
}), n.dirty()) : r.kind === "ip" ? ht(e.data, r.version) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
716
763
|
validation: "ip",
|
|
717
|
-
code:
|
|
718
|
-
message:
|
|
719
|
-
}), n.dirty()) :
|
|
764
|
+
code: o.invalid_string,
|
|
765
|
+
message: r.message
|
|
766
|
+
}), n.dirty()) : r.kind === "jwt" ? mt(e.data, r.alg) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
767
|
+
validation: "jwt",
|
|
768
|
+
code: o.invalid_string,
|
|
769
|
+
message: r.message
|
|
770
|
+
}), n.dirty()) : r.kind === "cidr" ? pt(e.data, r.version) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
771
|
+
validation: "cidr",
|
|
772
|
+
code: o.invalid_string,
|
|
773
|
+
message: r.message
|
|
774
|
+
}), n.dirty()) : r.kind === "base64" ? ot.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
720
775
|
validation: "base64",
|
|
721
|
-
code:
|
|
722
|
-
message:
|
|
723
|
-
}), n.dirty()) :
|
|
776
|
+
code: o.invalid_string,
|
|
777
|
+
message: r.message
|
|
778
|
+
}), n.dirty()) : r.kind === "base64url" ? ut.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
779
|
+
validation: "base64url",
|
|
780
|
+
code: o.invalid_string,
|
|
781
|
+
message: r.message
|
|
782
|
+
}), n.dirty()) : v.assertNever(r);
|
|
724
783
|
return { status: n.value, value: e.data };
|
|
725
784
|
}
|
|
726
785
|
_regex(e, s, n) {
|
|
727
|
-
return this.refinement((
|
|
786
|
+
return this.refinement((a) => e.test(a), {
|
|
728
787
|
validation: s,
|
|
729
|
-
code:
|
|
730
|
-
...
|
|
788
|
+
code: o.invalid_string,
|
|
789
|
+
...l.errToObj(n)
|
|
731
790
|
});
|
|
732
791
|
}
|
|
733
792
|
_addCheck(e) {
|
|
734
|
-
return new
|
|
793
|
+
return new E({
|
|
735
794
|
...this._def,
|
|
736
795
|
checks: [...this._def.checks, e]
|
|
737
796
|
});
|
|
738
797
|
}
|
|
739
798
|
email(e) {
|
|
740
|
-
return this._addCheck({ kind: "email", ...
|
|
799
|
+
return this._addCheck({ kind: "email", ...l.errToObj(e) });
|
|
741
800
|
}
|
|
742
801
|
url(e) {
|
|
743
|
-
return this._addCheck({ kind: "url", ...
|
|
802
|
+
return this._addCheck({ kind: "url", ...l.errToObj(e) });
|
|
744
803
|
}
|
|
745
804
|
emoji(e) {
|
|
746
|
-
return this._addCheck({ kind: "emoji", ...
|
|
805
|
+
return this._addCheck({ kind: "emoji", ...l.errToObj(e) });
|
|
747
806
|
}
|
|
748
807
|
uuid(e) {
|
|
749
|
-
return this._addCheck({ kind: "uuid", ...
|
|
808
|
+
return this._addCheck({ kind: "uuid", ...l.errToObj(e) });
|
|
750
809
|
}
|
|
751
810
|
nanoid(e) {
|
|
752
|
-
return this._addCheck({ kind: "nanoid", ...
|
|
811
|
+
return this._addCheck({ kind: "nanoid", ...l.errToObj(e) });
|
|
753
812
|
}
|
|
754
813
|
cuid(e) {
|
|
755
|
-
return this._addCheck({ kind: "cuid", ...
|
|
814
|
+
return this._addCheck({ kind: "cuid", ...l.errToObj(e) });
|
|
756
815
|
}
|
|
757
816
|
cuid2(e) {
|
|
758
|
-
return this._addCheck({ kind: "cuid2", ...
|
|
817
|
+
return this._addCheck({ kind: "cuid2", ...l.errToObj(e) });
|
|
759
818
|
}
|
|
760
819
|
ulid(e) {
|
|
761
|
-
return this._addCheck({ kind: "ulid", ...
|
|
820
|
+
return this._addCheck({ kind: "ulid", ...l.errToObj(e) });
|
|
762
821
|
}
|
|
763
822
|
base64(e) {
|
|
764
|
-
return this._addCheck({ kind: "base64", ...
|
|
823
|
+
return this._addCheck({ kind: "base64", ...l.errToObj(e) });
|
|
824
|
+
}
|
|
825
|
+
base64url(e) {
|
|
826
|
+
return this._addCheck({
|
|
827
|
+
kind: "base64url",
|
|
828
|
+
...l.errToObj(e)
|
|
829
|
+
});
|
|
830
|
+
}
|
|
831
|
+
jwt(e) {
|
|
832
|
+
return this._addCheck({ kind: "jwt", ...l.errToObj(e) });
|
|
765
833
|
}
|
|
766
834
|
ip(e) {
|
|
767
|
-
return this._addCheck({ kind: "ip", ...
|
|
835
|
+
return this._addCheck({ kind: "ip", ...l.errToObj(e) });
|
|
836
|
+
}
|
|
837
|
+
cidr(e) {
|
|
838
|
+
return this._addCheck({ kind: "cidr", ...l.errToObj(e) });
|
|
768
839
|
}
|
|
769
840
|
datetime(e) {
|
|
770
|
-
var s, n;
|
|
771
841
|
return typeof e == "string" ? this._addCheck({
|
|
772
842
|
kind: "datetime",
|
|
773
843
|
precision: null,
|
|
@@ -777,9 +847,9 @@ class Z extends _ {
|
|
|
777
847
|
}) : this._addCheck({
|
|
778
848
|
kind: "datetime",
|
|
779
849
|
precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
|
|
780
|
-
offset: (
|
|
781
|
-
local: (
|
|
782
|
-
...
|
|
850
|
+
offset: (e == null ? void 0 : e.offset) ?? !1,
|
|
851
|
+
local: (e == null ? void 0 : e.local) ?? !1,
|
|
852
|
+
...l.errToObj(e == null ? void 0 : e.message)
|
|
783
853
|
});
|
|
784
854
|
}
|
|
785
855
|
date(e) {
|
|
@@ -793,17 +863,17 @@ class Z extends _ {
|
|
|
793
863
|
}) : this._addCheck({
|
|
794
864
|
kind: "time",
|
|
795
865
|
precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
|
|
796
|
-
...
|
|
866
|
+
...l.errToObj(e == null ? void 0 : e.message)
|
|
797
867
|
});
|
|
798
868
|
}
|
|
799
869
|
duration(e) {
|
|
800
|
-
return this._addCheck({ kind: "duration", ...
|
|
870
|
+
return this._addCheck({ kind: "duration", ...l.errToObj(e) });
|
|
801
871
|
}
|
|
802
872
|
regex(e, s) {
|
|
803
873
|
return this._addCheck({
|
|
804
874
|
kind: "regex",
|
|
805
875
|
regex: e,
|
|
806
|
-
...
|
|
876
|
+
...l.errToObj(s)
|
|
807
877
|
});
|
|
808
878
|
}
|
|
809
879
|
includes(e, s) {
|
|
@@ -811,65 +881,64 @@ class Z extends _ {
|
|
|
811
881
|
kind: "includes",
|
|
812
882
|
value: e,
|
|
813
883
|
position: s == null ? void 0 : s.position,
|
|
814
|
-
...
|
|
884
|
+
...l.errToObj(s == null ? void 0 : s.message)
|
|
815
885
|
});
|
|
816
886
|
}
|
|
817
887
|
startsWith(e, s) {
|
|
818
888
|
return this._addCheck({
|
|
819
889
|
kind: "startsWith",
|
|
820
890
|
value: e,
|
|
821
|
-
...
|
|
891
|
+
...l.errToObj(s)
|
|
822
892
|
});
|
|
823
893
|
}
|
|
824
894
|
endsWith(e, s) {
|
|
825
895
|
return this._addCheck({
|
|
826
896
|
kind: "endsWith",
|
|
827
897
|
value: e,
|
|
828
|
-
...
|
|
898
|
+
...l.errToObj(s)
|
|
829
899
|
});
|
|
830
900
|
}
|
|
831
901
|
min(e, s) {
|
|
832
902
|
return this._addCheck({
|
|
833
903
|
kind: "min",
|
|
834
904
|
value: e,
|
|
835
|
-
...
|
|
905
|
+
...l.errToObj(s)
|
|
836
906
|
});
|
|
837
907
|
}
|
|
838
908
|
max(e, s) {
|
|
839
909
|
return this._addCheck({
|
|
840
910
|
kind: "max",
|
|
841
911
|
value: e,
|
|
842
|
-
...
|
|
912
|
+
...l.errToObj(s)
|
|
843
913
|
});
|
|
844
914
|
}
|
|
845
915
|
length(e, s) {
|
|
846
916
|
return this._addCheck({
|
|
847
917
|
kind: "length",
|
|
848
918
|
value: e,
|
|
849
|
-
...
|
|
919
|
+
...l.errToObj(s)
|
|
850
920
|
});
|
|
851
921
|
}
|
|
852
922
|
/**
|
|
853
|
-
*
|
|
854
|
-
* @see {@link ZodString.min}
|
|
923
|
+
* Equivalent to `.min(1)`
|
|
855
924
|
*/
|
|
856
925
|
nonempty(e) {
|
|
857
|
-
return this.min(1,
|
|
926
|
+
return this.min(1, l.errToObj(e));
|
|
858
927
|
}
|
|
859
928
|
trim() {
|
|
860
|
-
return new
|
|
929
|
+
return new E({
|
|
861
930
|
...this._def,
|
|
862
931
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
863
932
|
});
|
|
864
933
|
}
|
|
865
934
|
toLowerCase() {
|
|
866
|
-
return new
|
|
935
|
+
return new E({
|
|
867
936
|
...this._def,
|
|
868
937
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
869
938
|
});
|
|
870
939
|
}
|
|
871
940
|
toUpperCase() {
|
|
872
|
-
return new
|
|
941
|
+
return new E({
|
|
873
942
|
...this._def,
|
|
874
943
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
875
944
|
});
|
|
@@ -913,9 +982,15 @@ class Z extends _ {
|
|
|
913
982
|
get isIP() {
|
|
914
983
|
return !!this._def.checks.find((e) => e.kind === "ip");
|
|
915
984
|
}
|
|
985
|
+
get isCIDR() {
|
|
986
|
+
return !!this._def.checks.find((e) => e.kind === "cidr");
|
|
987
|
+
}
|
|
916
988
|
get isBase64() {
|
|
917
989
|
return !!this._def.checks.find((e) => e.kind === "base64");
|
|
918
990
|
}
|
|
991
|
+
get isBase64url() {
|
|
992
|
+
return !!this._def.checks.find((e) => e.kind === "base64url");
|
|
993
|
+
}
|
|
919
994
|
get minLength() {
|
|
920
995
|
let e = null;
|
|
921
996
|
for (const s of this._def.checks)
|
|
@@ -929,78 +1004,75 @@ class Z extends _ {
|
|
|
929
1004
|
return e;
|
|
930
1005
|
}
|
|
931
1006
|
}
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
function xt(t, e) {
|
|
942
|
-
const s = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, r = s > n ? s : n, a = parseInt(t.toFixed(r).replace(".", "")), i = parseInt(e.toFixed(r).replace(".", ""));
|
|
943
|
-
return a % i / Math.pow(10, r);
|
|
1007
|
+
E.create = (t) => new E({
|
|
1008
|
+
checks: [],
|
|
1009
|
+
typeName: m.ZodString,
|
|
1010
|
+
coerce: (t == null ? void 0 : t.coerce) ?? !1,
|
|
1011
|
+
...g(t)
|
|
1012
|
+
});
|
|
1013
|
+
function gt(t, e) {
|
|
1014
|
+
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(".", ""));
|
|
1015
|
+
return r % i / 10 ** a;
|
|
944
1016
|
}
|
|
945
|
-
class
|
|
1017
|
+
class B extends y {
|
|
946
1018
|
constructor() {
|
|
947
1019
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
948
1020
|
}
|
|
949
1021
|
_parse(e) {
|
|
950
|
-
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !==
|
|
951
|
-
const
|
|
952
|
-
return
|
|
953
|
-
code:
|
|
954
|
-
expected:
|
|
955
|
-
received:
|
|
956
|
-
}),
|
|
1022
|
+
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== d.number) {
|
|
1023
|
+
const r = this._getOrReturnCtx(e);
|
|
1024
|
+
return u(r, {
|
|
1025
|
+
code: o.invalid_type,
|
|
1026
|
+
expected: d.number,
|
|
1027
|
+
received: r.parsedType
|
|
1028
|
+
}), p;
|
|
957
1029
|
}
|
|
958
1030
|
let n;
|
|
959
|
-
const
|
|
960
|
-
for (const
|
|
961
|
-
|
|
962
|
-
code:
|
|
1031
|
+
const a = new R();
|
|
1032
|
+
for (const r of this._def.checks)
|
|
1033
|
+
r.kind === "int" ? v.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1034
|
+
code: o.invalid_type,
|
|
963
1035
|
expected: "integer",
|
|
964
1036
|
received: "float",
|
|
965
|
-
message:
|
|
966
|
-
}),
|
|
967
|
-
code:
|
|
968
|
-
minimum:
|
|
1037
|
+
message: r.message
|
|
1038
|
+
}), a.dirty()) : r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1039
|
+
code: o.too_small,
|
|
1040
|
+
minimum: r.value,
|
|
969
1041
|
type: "number",
|
|
970
|
-
inclusive:
|
|
1042
|
+
inclusive: r.inclusive,
|
|
971
1043
|
exact: !1,
|
|
972
|
-
message:
|
|
973
|
-
}),
|
|
974
|
-
code:
|
|
975
|
-
maximum:
|
|
1044
|
+
message: r.message
|
|
1045
|
+
}), a.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1046
|
+
code: o.too_big,
|
|
1047
|
+
maximum: r.value,
|
|
976
1048
|
type: "number",
|
|
977
|
-
inclusive:
|
|
1049
|
+
inclusive: r.inclusive,
|
|
978
1050
|
exact: !1,
|
|
979
|
-
message:
|
|
980
|
-
}),
|
|
981
|
-
code:
|
|
982
|
-
multipleOf:
|
|
983
|
-
message:
|
|
984
|
-
}),
|
|
985
|
-
code:
|
|
986
|
-
message:
|
|
987
|
-
}),
|
|
988
|
-
return { status:
|
|
1051
|
+
message: r.message
|
|
1052
|
+
}), a.dirty()) : r.kind === "multipleOf" ? gt(e.data, r.value) !== 0 && (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1053
|
+
code: o.not_multiple_of,
|
|
1054
|
+
multipleOf: r.value,
|
|
1055
|
+
message: r.message
|
|
1056
|
+
}), a.dirty()) : r.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1057
|
+
code: o.not_finite,
|
|
1058
|
+
message: r.message
|
|
1059
|
+
}), a.dirty()) : v.assertNever(r);
|
|
1060
|
+
return { status: a.value, value: e.data };
|
|
989
1061
|
}
|
|
990
1062
|
gte(e, s) {
|
|
991
|
-
return this.setLimit("min", e, !0,
|
|
1063
|
+
return this.setLimit("min", e, !0, l.toString(s));
|
|
992
1064
|
}
|
|
993
1065
|
gt(e, s) {
|
|
994
|
-
return this.setLimit("min", e, !1,
|
|
1066
|
+
return this.setLimit("min", e, !1, l.toString(s));
|
|
995
1067
|
}
|
|
996
1068
|
lte(e, s) {
|
|
997
|
-
return this.setLimit("max", e, !0,
|
|
1069
|
+
return this.setLimit("max", e, !0, l.toString(s));
|
|
998
1070
|
}
|
|
999
1071
|
lt(e, s) {
|
|
1000
|
-
return this.setLimit("max", e, !1,
|
|
1072
|
+
return this.setLimit("max", e, !1, l.toString(s));
|
|
1001
1073
|
}
|
|
1002
|
-
setLimit(e, s, n,
|
|
1003
|
-
return new
|
|
1074
|
+
setLimit(e, s, n, a) {
|
|
1075
|
+
return new B({
|
|
1004
1076
|
...this._def,
|
|
1005
1077
|
checks: [
|
|
1006
1078
|
...this._def.checks,
|
|
@@ -1008,13 +1080,13 @@ class $ extends _ {
|
|
|
1008
1080
|
kind: e,
|
|
1009
1081
|
value: s,
|
|
1010
1082
|
inclusive: n,
|
|
1011
|
-
message:
|
|
1083
|
+
message: l.toString(a)
|
|
1012
1084
|
}
|
|
1013
1085
|
]
|
|
1014
1086
|
});
|
|
1015
1087
|
}
|
|
1016
1088
|
_addCheck(e) {
|
|
1017
|
-
return new
|
|
1089
|
+
return new B({
|
|
1018
1090
|
...this._def,
|
|
1019
1091
|
checks: [...this._def.checks, e]
|
|
1020
1092
|
});
|
|
@@ -1022,7 +1094,7 @@ class $ extends _ {
|
|
|
1022
1094
|
int(e) {
|
|
1023
1095
|
return this._addCheck({
|
|
1024
1096
|
kind: "int",
|
|
1025
|
-
message:
|
|
1097
|
+
message: l.toString(e)
|
|
1026
1098
|
});
|
|
1027
1099
|
}
|
|
1028
1100
|
positive(e) {
|
|
@@ -1030,7 +1102,7 @@ class $ extends _ {
|
|
|
1030
1102
|
kind: "min",
|
|
1031
1103
|
value: 0,
|
|
1032
1104
|
inclusive: !1,
|
|
1033
|
-
message:
|
|
1105
|
+
message: l.toString(e)
|
|
1034
1106
|
});
|
|
1035
1107
|
}
|
|
1036
1108
|
negative(e) {
|
|
@@ -1038,7 +1110,7 @@ class $ extends _ {
|
|
|
1038
1110
|
kind: "max",
|
|
1039
1111
|
value: 0,
|
|
1040
1112
|
inclusive: !1,
|
|
1041
|
-
message:
|
|
1113
|
+
message: l.toString(e)
|
|
1042
1114
|
});
|
|
1043
1115
|
}
|
|
1044
1116
|
nonpositive(e) {
|
|
@@ -1046,7 +1118,7 @@ class $ extends _ {
|
|
|
1046
1118
|
kind: "max",
|
|
1047
1119
|
value: 0,
|
|
1048
1120
|
inclusive: !0,
|
|
1049
|
-
message:
|
|
1121
|
+
message: l.toString(e)
|
|
1050
1122
|
});
|
|
1051
1123
|
}
|
|
1052
1124
|
nonnegative(e) {
|
|
@@ -1054,20 +1126,20 @@ class $ extends _ {
|
|
|
1054
1126
|
kind: "min",
|
|
1055
1127
|
value: 0,
|
|
1056
1128
|
inclusive: !0,
|
|
1057
|
-
message:
|
|
1129
|
+
message: l.toString(e)
|
|
1058
1130
|
});
|
|
1059
1131
|
}
|
|
1060
1132
|
multipleOf(e, s) {
|
|
1061
1133
|
return this._addCheck({
|
|
1062
1134
|
kind: "multipleOf",
|
|
1063
1135
|
value: e,
|
|
1064
|
-
message:
|
|
1136
|
+
message: l.toString(s)
|
|
1065
1137
|
});
|
|
1066
1138
|
}
|
|
1067
1139
|
finite(e) {
|
|
1068
1140
|
return this._addCheck({
|
|
1069
1141
|
kind: "finite",
|
|
1070
|
-
message:
|
|
1142
|
+
message: l.toString(e)
|
|
1071
1143
|
});
|
|
1072
1144
|
}
|
|
1073
1145
|
safe(e) {
|
|
@@ -1075,12 +1147,12 @@ class $ extends _ {
|
|
|
1075
1147
|
kind: "min",
|
|
1076
1148
|
inclusive: !0,
|
|
1077
1149
|
value: Number.MIN_SAFE_INTEGER,
|
|
1078
|
-
message:
|
|
1150
|
+
message: l.toString(e)
|
|
1079
1151
|
})._addCheck({
|
|
1080
1152
|
kind: "max",
|
|
1081
1153
|
inclusive: !0,
|
|
1082
1154
|
value: Number.MAX_SAFE_INTEGER,
|
|
1083
|
-
message:
|
|
1155
|
+
message: l.toString(e)
|
|
1084
1156
|
});
|
|
1085
1157
|
}
|
|
1086
1158
|
get minValue() {
|
|
@@ -1096,7 +1168,7 @@ class $ extends _ {
|
|
|
1096
1168
|
return e;
|
|
1097
1169
|
}
|
|
1098
1170
|
get isInt() {
|
|
1099
|
-
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" &&
|
|
1171
|
+
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && v.isInteger(e.value));
|
|
1100
1172
|
}
|
|
1101
1173
|
get isFinite() {
|
|
1102
1174
|
let e = null, s = null;
|
|
@@ -1108,61 +1180,69 @@ class $ extends _ {
|
|
|
1108
1180
|
return Number.isFinite(s) && Number.isFinite(e);
|
|
1109
1181
|
}
|
|
1110
1182
|
}
|
|
1111
|
-
|
|
1183
|
+
B.create = (t) => new B({
|
|
1112
1184
|
checks: [],
|
|
1113
1185
|
typeName: m.ZodNumber,
|
|
1114
1186
|
coerce: (t == null ? void 0 : t.coerce) || !1,
|
|
1115
|
-
...
|
|
1187
|
+
...g(t)
|
|
1116
1188
|
});
|
|
1117
|
-
class
|
|
1189
|
+
class z extends y {
|
|
1118
1190
|
constructor() {
|
|
1119
1191
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1120
1192
|
}
|
|
1121
1193
|
_parse(e) {
|
|
1122
|
-
if (this._def.coerce
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1194
|
+
if (this._def.coerce)
|
|
1195
|
+
try {
|
|
1196
|
+
e.data = BigInt(e.data);
|
|
1197
|
+
} catch {
|
|
1198
|
+
return this._getInvalidInput(e);
|
|
1199
|
+
}
|
|
1200
|
+
if (this._getType(e) !== d.bigint)
|
|
1201
|
+
return this._getInvalidInput(e);
|
|
1130
1202
|
let n;
|
|
1131
|
-
const
|
|
1132
|
-
for (const
|
|
1133
|
-
|
|
1134
|
-
code:
|
|
1203
|
+
const a = new R();
|
|
1204
|
+
for (const r of this._def.checks)
|
|
1205
|
+
r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1206
|
+
code: o.too_small,
|
|
1135
1207
|
type: "bigint",
|
|
1136
|
-
minimum:
|
|
1137
|
-
inclusive:
|
|
1138
|
-
message:
|
|
1139
|
-
}),
|
|
1140
|
-
code:
|
|
1208
|
+
minimum: r.value,
|
|
1209
|
+
inclusive: r.inclusive,
|
|
1210
|
+
message: r.message
|
|
1211
|
+
}), a.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1212
|
+
code: o.too_big,
|
|
1141
1213
|
type: "bigint",
|
|
1142
|
-
maximum:
|
|
1143
|
-
inclusive:
|
|
1144
|
-
message:
|
|
1145
|
-
}),
|
|
1146
|
-
code:
|
|
1147
|
-
multipleOf:
|
|
1148
|
-
message:
|
|
1149
|
-
}),
|
|
1150
|
-
return { status:
|
|
1214
|
+
maximum: r.value,
|
|
1215
|
+
inclusive: r.inclusive,
|
|
1216
|
+
message: r.message
|
|
1217
|
+
}), a.dirty()) : r.kind === "multipleOf" ? e.data % r.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1218
|
+
code: o.not_multiple_of,
|
|
1219
|
+
multipleOf: r.value,
|
|
1220
|
+
message: r.message
|
|
1221
|
+
}), a.dirty()) : v.assertNever(r);
|
|
1222
|
+
return { status: a.value, value: e.data };
|
|
1223
|
+
}
|
|
1224
|
+
_getInvalidInput(e) {
|
|
1225
|
+
const s = this._getOrReturnCtx(e);
|
|
1226
|
+
return u(s, {
|
|
1227
|
+
code: o.invalid_type,
|
|
1228
|
+
expected: d.bigint,
|
|
1229
|
+
received: s.parsedType
|
|
1230
|
+
}), p;
|
|
1151
1231
|
}
|
|
1152
1232
|
gte(e, s) {
|
|
1153
|
-
return this.setLimit("min", e, !0,
|
|
1233
|
+
return this.setLimit("min", e, !0, l.toString(s));
|
|
1154
1234
|
}
|
|
1155
1235
|
gt(e, s) {
|
|
1156
|
-
return this.setLimit("min", e, !1,
|
|
1236
|
+
return this.setLimit("min", e, !1, l.toString(s));
|
|
1157
1237
|
}
|
|
1158
1238
|
lte(e, s) {
|
|
1159
|
-
return this.setLimit("max", e, !0,
|
|
1239
|
+
return this.setLimit("max", e, !0, l.toString(s));
|
|
1160
1240
|
}
|
|
1161
1241
|
lt(e, s) {
|
|
1162
|
-
return this.setLimit("max", e, !1,
|
|
1242
|
+
return this.setLimit("max", e, !1, l.toString(s));
|
|
1163
1243
|
}
|
|
1164
|
-
setLimit(e, s, n,
|
|
1165
|
-
return new
|
|
1244
|
+
setLimit(e, s, n, a) {
|
|
1245
|
+
return new z({
|
|
1166
1246
|
...this._def,
|
|
1167
1247
|
checks: [
|
|
1168
1248
|
...this._def.checks,
|
|
@@ -1170,13 +1250,13 @@ class U extends _ {
|
|
|
1170
1250
|
kind: e,
|
|
1171
1251
|
value: s,
|
|
1172
1252
|
inclusive: n,
|
|
1173
|
-
message:
|
|
1253
|
+
message: l.toString(a)
|
|
1174
1254
|
}
|
|
1175
1255
|
]
|
|
1176
1256
|
});
|
|
1177
1257
|
}
|
|
1178
1258
|
_addCheck(e) {
|
|
1179
|
-
return new
|
|
1259
|
+
return new z({
|
|
1180
1260
|
...this._def,
|
|
1181
1261
|
checks: [...this._def.checks, e]
|
|
1182
1262
|
});
|
|
@@ -1186,7 +1266,7 @@ class U extends _ {
|
|
|
1186
1266
|
kind: "min",
|
|
1187
1267
|
value: BigInt(0),
|
|
1188
1268
|
inclusive: !1,
|
|
1189
|
-
message:
|
|
1269
|
+
message: l.toString(e)
|
|
1190
1270
|
});
|
|
1191
1271
|
}
|
|
1192
1272
|
negative(e) {
|
|
@@ -1194,7 +1274,7 @@ class U extends _ {
|
|
|
1194
1274
|
kind: "max",
|
|
1195
1275
|
value: BigInt(0),
|
|
1196
1276
|
inclusive: !1,
|
|
1197
|
-
message:
|
|
1277
|
+
message: l.toString(e)
|
|
1198
1278
|
});
|
|
1199
1279
|
}
|
|
1200
1280
|
nonpositive(e) {
|
|
@@ -1202,7 +1282,7 @@ class U extends _ {
|
|
|
1202
1282
|
kind: "max",
|
|
1203
1283
|
value: BigInt(0),
|
|
1204
1284
|
inclusive: !0,
|
|
1205
|
-
message:
|
|
1285
|
+
message: l.toString(e)
|
|
1206
1286
|
});
|
|
1207
1287
|
}
|
|
1208
1288
|
nonnegative(e) {
|
|
@@ -1210,14 +1290,14 @@ class U extends _ {
|
|
|
1210
1290
|
kind: "min",
|
|
1211
1291
|
value: BigInt(0),
|
|
1212
1292
|
inclusive: !0,
|
|
1213
|
-
message:
|
|
1293
|
+
message: l.toString(e)
|
|
1214
1294
|
});
|
|
1215
1295
|
}
|
|
1216
1296
|
multipleOf(e, s) {
|
|
1217
1297
|
return this._addCheck({
|
|
1218
1298
|
kind: "multipleOf",
|
|
1219
1299
|
value: e,
|
|
1220
|
-
message:
|
|
1300
|
+
message: l.toString(s)
|
|
1221
1301
|
});
|
|
1222
1302
|
}
|
|
1223
1303
|
get minValue() {
|
|
@@ -1233,74 +1313,71 @@ class U extends _ {
|
|
|
1233
1313
|
return e;
|
|
1234
1314
|
}
|
|
1235
1315
|
}
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
});
|
|
1244
|
-
};
|
|
1245
|
-
class re extends _ {
|
|
1316
|
+
z.create = (t) => new z({
|
|
1317
|
+
checks: [],
|
|
1318
|
+
typeName: m.ZodBigInt,
|
|
1319
|
+
coerce: (t == null ? void 0 : t.coerce) ?? !1,
|
|
1320
|
+
...g(t)
|
|
1321
|
+
});
|
|
1322
|
+
class de extends y {
|
|
1246
1323
|
_parse(e) {
|
|
1247
|
-
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !==
|
|
1324
|
+
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== d.boolean) {
|
|
1248
1325
|
const n = this._getOrReturnCtx(e);
|
|
1249
|
-
return
|
|
1250
|
-
code:
|
|
1251
|
-
expected:
|
|
1326
|
+
return u(n, {
|
|
1327
|
+
code: o.invalid_type,
|
|
1328
|
+
expected: d.boolean,
|
|
1252
1329
|
received: n.parsedType
|
|
1253
|
-
}),
|
|
1330
|
+
}), p;
|
|
1254
1331
|
}
|
|
1255
1332
|
return T(e.data);
|
|
1256
1333
|
}
|
|
1257
1334
|
}
|
|
1258
|
-
|
|
1335
|
+
de.create = (t) => new de({
|
|
1259
1336
|
typeName: m.ZodBoolean,
|
|
1260
1337
|
coerce: (t == null ? void 0 : t.coerce) || !1,
|
|
1261
|
-
...
|
|
1338
|
+
...g(t)
|
|
1262
1339
|
});
|
|
1263
|
-
class
|
|
1340
|
+
class X extends y {
|
|
1264
1341
|
_parse(e) {
|
|
1265
|
-
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !==
|
|
1266
|
-
const
|
|
1267
|
-
return
|
|
1268
|
-
code:
|
|
1269
|
-
expected:
|
|
1270
|
-
received:
|
|
1271
|
-
}),
|
|
1342
|
+
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== d.date) {
|
|
1343
|
+
const r = this._getOrReturnCtx(e);
|
|
1344
|
+
return u(r, {
|
|
1345
|
+
code: o.invalid_type,
|
|
1346
|
+
expected: d.date,
|
|
1347
|
+
received: r.parsedType
|
|
1348
|
+
}), p;
|
|
1272
1349
|
}
|
|
1273
|
-
if (isNaN(e.data.getTime())) {
|
|
1274
|
-
const
|
|
1275
|
-
return
|
|
1276
|
-
code:
|
|
1277
|
-
}),
|
|
1350
|
+
if (Number.isNaN(e.data.getTime())) {
|
|
1351
|
+
const r = this._getOrReturnCtx(e);
|
|
1352
|
+
return u(r, {
|
|
1353
|
+
code: o.invalid_date
|
|
1354
|
+
}), p;
|
|
1278
1355
|
}
|
|
1279
|
-
const n = new
|
|
1280
|
-
let
|
|
1281
|
-
for (const
|
|
1282
|
-
|
|
1283
|
-
code:
|
|
1284
|
-
message:
|
|
1356
|
+
const n = new R();
|
|
1357
|
+
let a;
|
|
1358
|
+
for (const r of this._def.checks)
|
|
1359
|
+
r.kind === "min" ? e.data.getTime() < r.value && (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1360
|
+
code: o.too_small,
|
|
1361
|
+
message: r.message,
|
|
1285
1362
|
inclusive: !0,
|
|
1286
1363
|
exact: !1,
|
|
1287
|
-
minimum:
|
|
1364
|
+
minimum: r.value,
|
|
1288
1365
|
type: "date"
|
|
1289
|
-
}), n.dirty()) :
|
|
1290
|
-
code:
|
|
1291
|
-
message:
|
|
1366
|
+
}), n.dirty()) : r.kind === "max" ? e.data.getTime() > r.value && (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1367
|
+
code: o.too_big,
|
|
1368
|
+
message: r.message,
|
|
1292
1369
|
inclusive: !0,
|
|
1293
1370
|
exact: !1,
|
|
1294
|
-
maximum:
|
|
1371
|
+
maximum: r.value,
|
|
1295
1372
|
type: "date"
|
|
1296
|
-
}), n.dirty()) :
|
|
1373
|
+
}), n.dirty()) : v.assertNever(r);
|
|
1297
1374
|
return {
|
|
1298
1375
|
status: n.value,
|
|
1299
1376
|
value: new Date(e.data.getTime())
|
|
1300
1377
|
};
|
|
1301
1378
|
}
|
|
1302
1379
|
_addCheck(e) {
|
|
1303
|
-
return new
|
|
1380
|
+
return new X({
|
|
1304
1381
|
...this._def,
|
|
1305
1382
|
checks: [...this._def.checks, e]
|
|
1306
1383
|
});
|
|
@@ -1309,14 +1386,14 @@ class z extends _ {
|
|
|
1309
1386
|
return this._addCheck({
|
|
1310
1387
|
kind: "min",
|
|
1311
1388
|
value: e.getTime(),
|
|
1312
|
-
message:
|
|
1389
|
+
message: l.toString(s)
|
|
1313
1390
|
});
|
|
1314
1391
|
}
|
|
1315
1392
|
max(e, s) {
|
|
1316
1393
|
return this._addCheck({
|
|
1317
1394
|
kind: "max",
|
|
1318
1395
|
value: e.getTime(),
|
|
1319
|
-
message:
|
|
1396
|
+
message: l.toString(s)
|
|
1320
1397
|
});
|
|
1321
1398
|
}
|
|
1322
1399
|
get minDate() {
|
|
@@ -1332,64 +1409,64 @@ class z extends _ {
|
|
|
1332
1409
|
return e != null ? new Date(e) : null;
|
|
1333
1410
|
}
|
|
1334
1411
|
}
|
|
1335
|
-
|
|
1412
|
+
X.create = (t) => new X({
|
|
1336
1413
|
checks: [],
|
|
1337
1414
|
coerce: (t == null ? void 0 : t.coerce) || !1,
|
|
1338
1415
|
typeName: m.ZodDate,
|
|
1339
|
-
...
|
|
1416
|
+
...g(t)
|
|
1340
1417
|
});
|
|
1341
|
-
class
|
|
1418
|
+
class le extends y {
|
|
1342
1419
|
_parse(e) {
|
|
1343
|
-
if (this._getType(e) !==
|
|
1420
|
+
if (this._getType(e) !== d.symbol) {
|
|
1344
1421
|
const n = this._getOrReturnCtx(e);
|
|
1345
|
-
return
|
|
1346
|
-
code:
|
|
1347
|
-
expected:
|
|
1422
|
+
return u(n, {
|
|
1423
|
+
code: o.invalid_type,
|
|
1424
|
+
expected: d.symbol,
|
|
1348
1425
|
received: n.parsedType
|
|
1349
|
-
}),
|
|
1426
|
+
}), p;
|
|
1350
1427
|
}
|
|
1351
1428
|
return T(e.data);
|
|
1352
1429
|
}
|
|
1353
1430
|
}
|
|
1354
|
-
|
|
1431
|
+
le.create = (t) => new le({
|
|
1355
1432
|
typeName: m.ZodSymbol,
|
|
1356
|
-
...
|
|
1433
|
+
...g(t)
|
|
1357
1434
|
});
|
|
1358
|
-
class
|
|
1435
|
+
class fe extends y {
|
|
1359
1436
|
_parse(e) {
|
|
1360
|
-
if (this._getType(e) !==
|
|
1437
|
+
if (this._getType(e) !== d.undefined) {
|
|
1361
1438
|
const n = this._getOrReturnCtx(e);
|
|
1362
|
-
return
|
|
1363
|
-
code:
|
|
1364
|
-
expected:
|
|
1439
|
+
return u(n, {
|
|
1440
|
+
code: o.invalid_type,
|
|
1441
|
+
expected: d.undefined,
|
|
1365
1442
|
received: n.parsedType
|
|
1366
|
-
}),
|
|
1443
|
+
}), p;
|
|
1367
1444
|
}
|
|
1368
1445
|
return T(e.data);
|
|
1369
1446
|
}
|
|
1370
1447
|
}
|
|
1371
|
-
|
|
1448
|
+
fe.create = (t) => new fe({
|
|
1372
1449
|
typeName: m.ZodUndefined,
|
|
1373
|
-
...
|
|
1450
|
+
...g(t)
|
|
1374
1451
|
});
|
|
1375
|
-
class
|
|
1452
|
+
class he extends y {
|
|
1376
1453
|
_parse(e) {
|
|
1377
|
-
if (this._getType(e) !==
|
|
1454
|
+
if (this._getType(e) !== d.null) {
|
|
1378
1455
|
const n = this._getOrReturnCtx(e);
|
|
1379
|
-
return
|
|
1380
|
-
code:
|
|
1381
|
-
expected:
|
|
1456
|
+
return u(n, {
|
|
1457
|
+
code: o.invalid_type,
|
|
1458
|
+
expected: d.null,
|
|
1382
1459
|
received: n.parsedType
|
|
1383
|
-
}),
|
|
1460
|
+
}), p;
|
|
1384
1461
|
}
|
|
1385
1462
|
return T(e.data);
|
|
1386
1463
|
}
|
|
1387
1464
|
}
|
|
1388
|
-
|
|
1465
|
+
he.create = (t) => new he({
|
|
1389
1466
|
typeName: m.ZodNull,
|
|
1390
|
-
...
|
|
1467
|
+
...g(t)
|
|
1391
1468
|
});
|
|
1392
|
-
class
|
|
1469
|
+
class me extends y {
|
|
1393
1470
|
constructor() {
|
|
1394
1471
|
super(...arguments), this._any = !0;
|
|
1395
1472
|
}
|
|
@@ -1397,11 +1474,11 @@ class J extends _ {
|
|
|
1397
1474
|
return T(e.data);
|
|
1398
1475
|
}
|
|
1399
1476
|
}
|
|
1400
|
-
|
|
1477
|
+
me.create = (t) => new me({
|
|
1401
1478
|
typeName: m.ZodAny,
|
|
1402
|
-
...
|
|
1479
|
+
...g(t)
|
|
1403
1480
|
});
|
|
1404
|
-
class
|
|
1481
|
+
class pe extends y {
|
|
1405
1482
|
constructor() {
|
|
1406
1483
|
super(...arguments), this._unknown = !0;
|
|
1407
1484
|
}
|
|
@@ -1409,233 +1486,233 @@ class B extends _ {
|
|
|
1409
1486
|
return T(e.data);
|
|
1410
1487
|
}
|
|
1411
1488
|
}
|
|
1412
|
-
|
|
1489
|
+
pe.create = (t) => new pe({
|
|
1413
1490
|
typeName: m.ZodUnknown,
|
|
1414
|
-
...
|
|
1491
|
+
...g(t)
|
|
1415
1492
|
});
|
|
1416
|
-
class
|
|
1493
|
+
class Z extends y {
|
|
1417
1494
|
_parse(e) {
|
|
1418
1495
|
const s = this._getOrReturnCtx(e);
|
|
1419
|
-
return
|
|
1420
|
-
code:
|
|
1421
|
-
expected:
|
|
1496
|
+
return u(s, {
|
|
1497
|
+
code: o.invalid_type,
|
|
1498
|
+
expected: d.never,
|
|
1422
1499
|
received: s.parsedType
|
|
1423
|
-
}),
|
|
1500
|
+
}), p;
|
|
1424
1501
|
}
|
|
1425
1502
|
}
|
|
1426
|
-
|
|
1503
|
+
Z.create = (t) => new Z({
|
|
1427
1504
|
typeName: m.ZodNever,
|
|
1428
|
-
...
|
|
1505
|
+
...g(t)
|
|
1429
1506
|
});
|
|
1430
|
-
class
|
|
1507
|
+
class ge extends y {
|
|
1431
1508
|
_parse(e) {
|
|
1432
|
-
if (this._getType(e) !==
|
|
1509
|
+
if (this._getType(e) !== d.undefined) {
|
|
1433
1510
|
const n = this._getOrReturnCtx(e);
|
|
1434
|
-
return
|
|
1435
|
-
code:
|
|
1436
|
-
expected:
|
|
1511
|
+
return u(n, {
|
|
1512
|
+
code: o.invalid_type,
|
|
1513
|
+
expected: d.void,
|
|
1437
1514
|
received: n.parsedType
|
|
1438
|
-
}),
|
|
1515
|
+
}), p;
|
|
1439
1516
|
}
|
|
1440
1517
|
return T(e.data);
|
|
1441
1518
|
}
|
|
1442
1519
|
}
|
|
1443
|
-
|
|
1520
|
+
ge.create = (t) => new ge({
|
|
1444
1521
|
typeName: m.ZodVoid,
|
|
1445
|
-
...
|
|
1522
|
+
...g(t)
|
|
1446
1523
|
});
|
|
1447
|
-
class
|
|
1524
|
+
class A extends y {
|
|
1448
1525
|
_parse(e) {
|
|
1449
|
-
const { ctx: s, status: n } = this._processInputParams(e),
|
|
1450
|
-
if (s.parsedType !==
|
|
1451
|
-
return
|
|
1452
|
-
code:
|
|
1453
|
-
expected:
|
|
1526
|
+
const { ctx: s, status: n } = this._processInputParams(e), a = this._def;
|
|
1527
|
+
if (s.parsedType !== d.array)
|
|
1528
|
+
return u(s, {
|
|
1529
|
+
code: o.invalid_type,
|
|
1530
|
+
expected: d.array,
|
|
1454
1531
|
received: s.parsedType
|
|
1455
|
-
}),
|
|
1456
|
-
if (
|
|
1457
|
-
const i = s.data.length >
|
|
1458
|
-
(i ||
|
|
1459
|
-
code: i ?
|
|
1460
|
-
minimum:
|
|
1461
|
-
maximum: i ?
|
|
1532
|
+
}), p;
|
|
1533
|
+
if (a.exactLength !== null) {
|
|
1534
|
+
const i = s.data.length > a.exactLength.value, c = s.data.length < a.exactLength.value;
|
|
1535
|
+
(i || c) && (u(s, {
|
|
1536
|
+
code: i ? o.too_big : o.too_small,
|
|
1537
|
+
minimum: c ? a.exactLength.value : void 0,
|
|
1538
|
+
maximum: i ? a.exactLength.value : void 0,
|
|
1462
1539
|
type: "array",
|
|
1463
1540
|
inclusive: !0,
|
|
1464
1541
|
exact: !0,
|
|
1465
|
-
message:
|
|
1542
|
+
message: a.exactLength.message
|
|
1466
1543
|
}), n.dirty());
|
|
1467
1544
|
}
|
|
1468
|
-
if (
|
|
1469
|
-
code:
|
|
1470
|
-
minimum:
|
|
1545
|
+
if (a.minLength !== null && s.data.length < a.minLength.value && (u(s, {
|
|
1546
|
+
code: o.too_small,
|
|
1547
|
+
minimum: a.minLength.value,
|
|
1471
1548
|
type: "array",
|
|
1472
1549
|
inclusive: !0,
|
|
1473
1550
|
exact: !1,
|
|
1474
|
-
message:
|
|
1475
|
-
}), n.dirty()),
|
|
1476
|
-
code:
|
|
1477
|
-
maximum:
|
|
1551
|
+
message: a.minLength.message
|
|
1552
|
+
}), n.dirty()), a.maxLength !== null && s.data.length > a.maxLength.value && (u(s, {
|
|
1553
|
+
code: o.too_big,
|
|
1554
|
+
maximum: a.maxLength.value,
|
|
1478
1555
|
type: "array",
|
|
1479
1556
|
inclusive: !0,
|
|
1480
1557
|
exact: !1,
|
|
1481
|
-
message:
|
|
1558
|
+
message: a.maxLength.message
|
|
1482
1559
|
}), n.dirty()), s.common.async)
|
|
1483
|
-
return Promise.all([...s.data].map((i,
|
|
1484
|
-
const
|
|
1485
|
-
return
|
|
1560
|
+
return Promise.all([...s.data].map((i, c) => a.type._parseAsync(new N(s, i, s.path, c)))).then((i) => R.mergeArray(n, i));
|
|
1561
|
+
const r = [...s.data].map((i, c) => a.type._parseSync(new N(s, i, s.path, c)));
|
|
1562
|
+
return R.mergeArray(n, r);
|
|
1486
1563
|
}
|
|
1487
1564
|
get element() {
|
|
1488
1565
|
return this._def.type;
|
|
1489
1566
|
}
|
|
1490
1567
|
min(e, s) {
|
|
1491
|
-
return new
|
|
1568
|
+
return new A({
|
|
1492
1569
|
...this._def,
|
|
1493
|
-
minLength: { value: e, message:
|
|
1570
|
+
minLength: { value: e, message: l.toString(s) }
|
|
1494
1571
|
});
|
|
1495
1572
|
}
|
|
1496
1573
|
max(e, s) {
|
|
1497
|
-
return new
|
|
1574
|
+
return new A({
|
|
1498
1575
|
...this._def,
|
|
1499
|
-
maxLength: { value: e, message:
|
|
1576
|
+
maxLength: { value: e, message: l.toString(s) }
|
|
1500
1577
|
});
|
|
1501
1578
|
}
|
|
1502
1579
|
length(e, s) {
|
|
1503
|
-
return new
|
|
1580
|
+
return new A({
|
|
1504
1581
|
...this._def,
|
|
1505
|
-
exactLength: { value: e, message:
|
|
1582
|
+
exactLength: { value: e, message: l.toString(s) }
|
|
1506
1583
|
});
|
|
1507
1584
|
}
|
|
1508
1585
|
nonempty(e) {
|
|
1509
1586
|
return this.min(1, e);
|
|
1510
1587
|
}
|
|
1511
1588
|
}
|
|
1512
|
-
|
|
1589
|
+
A.create = (t, e) => new A({
|
|
1513
1590
|
type: t,
|
|
1514
1591
|
minLength: null,
|
|
1515
1592
|
maxLength: null,
|
|
1516
1593
|
exactLength: null,
|
|
1517
1594
|
typeName: m.ZodArray,
|
|
1518
|
-
...
|
|
1595
|
+
...g(e)
|
|
1519
1596
|
});
|
|
1520
|
-
function
|
|
1521
|
-
if (t instanceof
|
|
1597
|
+
function L(t) {
|
|
1598
|
+
if (t instanceof w) {
|
|
1522
1599
|
const e = {};
|
|
1523
1600
|
for (const s in t.shape) {
|
|
1524
1601
|
const n = t.shape[s];
|
|
1525
|
-
e[s] =
|
|
1602
|
+
e[s] = M.create(L(n));
|
|
1526
1603
|
}
|
|
1527
|
-
return new
|
|
1604
|
+
return new w({
|
|
1528
1605
|
...t._def,
|
|
1529
1606
|
shape: () => e
|
|
1530
1607
|
});
|
|
1531
1608
|
} else
|
|
1532
|
-
return t instanceof
|
|
1609
|
+
return t instanceof A ? new A({
|
|
1533
1610
|
...t._def,
|
|
1534
|
-
type:
|
|
1535
|
-
}) : t instanceof
|
|
1611
|
+
type: L(t.element)
|
|
1612
|
+
}) : t instanceof M ? M.create(L(t.unwrap())) : t instanceof Q ? Q.create(L(t.unwrap())) : t instanceof P ? P.create(t.items.map((e) => L(e))) : t;
|
|
1536
1613
|
}
|
|
1537
|
-
class
|
|
1614
|
+
class w extends y {
|
|
1538
1615
|
constructor() {
|
|
1539
1616
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1540
1617
|
}
|
|
1541
1618
|
_getCached() {
|
|
1542
1619
|
if (this._cached !== null)
|
|
1543
1620
|
return this._cached;
|
|
1544
|
-
const e = this._def.shape(), s =
|
|
1545
|
-
return this._cached = { shape: e, keys: s };
|
|
1621
|
+
const e = this._def.shape(), s = v.objectKeys(e);
|
|
1622
|
+
return this._cached = { shape: e, keys: s }, this._cached;
|
|
1546
1623
|
}
|
|
1547
1624
|
_parse(e) {
|
|
1548
|
-
if (this._getType(e) !==
|
|
1549
|
-
const
|
|
1550
|
-
return
|
|
1551
|
-
code:
|
|
1552
|
-
expected:
|
|
1553
|
-
received:
|
|
1554
|
-
}),
|
|
1625
|
+
if (this._getType(e) !== d.object) {
|
|
1626
|
+
const h = this._getOrReturnCtx(e);
|
|
1627
|
+
return u(h, {
|
|
1628
|
+
code: o.invalid_type,
|
|
1629
|
+
expected: d.object,
|
|
1630
|
+
received: h.parsedType
|
|
1631
|
+
}), p;
|
|
1555
1632
|
}
|
|
1556
|
-
const { status: n, ctx:
|
|
1557
|
-
if (!(this._def.catchall instanceof
|
|
1558
|
-
for (const
|
|
1559
|
-
i.includes(
|
|
1560
|
-
const
|
|
1561
|
-
for (const
|
|
1562
|
-
const
|
|
1563
|
-
|
|
1564
|
-
key: { status: "valid", value:
|
|
1565
|
-
value:
|
|
1566
|
-
alwaysSet:
|
|
1633
|
+
const { status: n, ctx: a } = this._processInputParams(e), { shape: r, keys: i } = this._getCached(), c = [];
|
|
1634
|
+
if (!(this._def.catchall instanceof Z && this._def.unknownKeys === "strip"))
|
|
1635
|
+
for (const h in a.data)
|
|
1636
|
+
i.includes(h) || c.push(h);
|
|
1637
|
+
const f = [];
|
|
1638
|
+
for (const h of i) {
|
|
1639
|
+
const _ = r[h], q = a.data[h];
|
|
1640
|
+
f.push({
|
|
1641
|
+
key: { status: "valid", value: h },
|
|
1642
|
+
value: _._parse(new N(a, q, a.path, h)),
|
|
1643
|
+
alwaysSet: h in a.data
|
|
1567
1644
|
});
|
|
1568
1645
|
}
|
|
1569
|
-
if (this._def.catchall instanceof
|
|
1570
|
-
const
|
|
1571
|
-
if (
|
|
1572
|
-
for (const
|
|
1573
|
-
|
|
1574
|
-
key: { status: "valid", value:
|
|
1575
|
-
value: { status: "valid", value:
|
|
1646
|
+
if (this._def.catchall instanceof Z) {
|
|
1647
|
+
const h = this._def.unknownKeys;
|
|
1648
|
+
if (h === "passthrough")
|
|
1649
|
+
for (const _ of c)
|
|
1650
|
+
f.push({
|
|
1651
|
+
key: { status: "valid", value: _ },
|
|
1652
|
+
value: { status: "valid", value: a.data[_] }
|
|
1576
1653
|
});
|
|
1577
|
-
else if (
|
|
1578
|
-
|
|
1579
|
-
code:
|
|
1580
|
-
keys:
|
|
1654
|
+
else if (h === "strict")
|
|
1655
|
+
c.length > 0 && (u(a, {
|
|
1656
|
+
code: o.unrecognized_keys,
|
|
1657
|
+
keys: c
|
|
1581
1658
|
}), n.dirty());
|
|
1582
|
-
else if (
|
|
1659
|
+
else if (h !== "strip")
|
|
1583
1660
|
throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
1584
1661
|
} else {
|
|
1585
|
-
const
|
|
1586
|
-
for (const
|
|
1587
|
-
const
|
|
1588
|
-
|
|
1589
|
-
key: { status: "valid", value:
|
|
1590
|
-
value:
|
|
1591
|
-
new
|
|
1662
|
+
const h = this._def.catchall;
|
|
1663
|
+
for (const _ of c) {
|
|
1664
|
+
const q = a.data[_];
|
|
1665
|
+
f.push({
|
|
1666
|
+
key: { status: "valid", value: _ },
|
|
1667
|
+
value: h._parse(
|
|
1668
|
+
new N(a, q, a.path, _)
|
|
1592
1669
|
//, ctx.child(key), value, getParsedType(value)
|
|
1593
1670
|
),
|
|
1594
|
-
alwaysSet:
|
|
1671
|
+
alwaysSet: _ in a.data
|
|
1595
1672
|
});
|
|
1596
1673
|
}
|
|
1597
1674
|
}
|
|
1598
|
-
return
|
|
1599
|
-
const
|
|
1600
|
-
for (const
|
|
1601
|
-
const
|
|
1602
|
-
|
|
1603
|
-
key:
|
|
1604
|
-
value:
|
|
1605
|
-
alwaysSet:
|
|
1675
|
+
return a.common.async ? Promise.resolve().then(async () => {
|
|
1676
|
+
const h = [];
|
|
1677
|
+
for (const _ of f) {
|
|
1678
|
+
const q = await _.key, $ = await _.value;
|
|
1679
|
+
h.push({
|
|
1680
|
+
key: q,
|
|
1681
|
+
value: $,
|
|
1682
|
+
alwaysSet: _.alwaysSet
|
|
1606
1683
|
});
|
|
1607
1684
|
}
|
|
1608
|
-
return
|
|
1609
|
-
}).then((
|
|
1685
|
+
return h;
|
|
1686
|
+
}).then((h) => R.mergeObjectSync(n, h)) : R.mergeObjectSync(n, f);
|
|
1610
1687
|
}
|
|
1611
1688
|
get shape() {
|
|
1612
1689
|
return this._def.shape();
|
|
1613
1690
|
}
|
|
1614
1691
|
strict(e) {
|
|
1615
|
-
return
|
|
1692
|
+
return l.errToObj, new w({
|
|
1616
1693
|
...this._def,
|
|
1617
1694
|
unknownKeys: "strict",
|
|
1618
1695
|
...e !== void 0 ? {
|
|
1619
1696
|
errorMap: (s, n) => {
|
|
1620
|
-
var r,
|
|
1621
|
-
const
|
|
1697
|
+
var r, i;
|
|
1698
|
+
const a = ((i = (r = this._def).errorMap) == null ? void 0 : i.call(r, s, n).message) ?? n.defaultError;
|
|
1622
1699
|
return s.code === "unrecognized_keys" ? {
|
|
1623
|
-
message:
|
|
1700
|
+
message: l.errToObj(e).message ?? a
|
|
1624
1701
|
} : {
|
|
1625
|
-
message:
|
|
1702
|
+
message: a
|
|
1626
1703
|
};
|
|
1627
1704
|
}
|
|
1628
1705
|
} : {}
|
|
1629
1706
|
});
|
|
1630
1707
|
}
|
|
1631
1708
|
strip() {
|
|
1632
|
-
return new
|
|
1709
|
+
return new w({
|
|
1633
1710
|
...this._def,
|
|
1634
1711
|
unknownKeys: "strip"
|
|
1635
1712
|
});
|
|
1636
1713
|
}
|
|
1637
1714
|
passthrough() {
|
|
1638
|
-
return new
|
|
1715
|
+
return new w({
|
|
1639
1716
|
...this._def,
|
|
1640
1717
|
unknownKeys: "passthrough"
|
|
1641
1718
|
});
|
|
@@ -1658,7 +1735,7 @@ class b extends _ {
|
|
|
1658
1735
|
// }) as any;
|
|
1659
1736
|
// };
|
|
1660
1737
|
extend(e) {
|
|
1661
|
-
return new
|
|
1738
|
+
return new w({
|
|
1662
1739
|
...this._def,
|
|
1663
1740
|
shape: () => ({
|
|
1664
1741
|
...this._def.shape(),
|
|
@@ -1672,7 +1749,7 @@ class b extends _ {
|
|
|
1672
1749
|
* upgrade if you are experiencing issues.
|
|
1673
1750
|
*/
|
|
1674
1751
|
merge(e) {
|
|
1675
|
-
return new
|
|
1752
|
+
return new w({
|
|
1676
1753
|
unknownKeys: e._def.unknownKeys,
|
|
1677
1754
|
catchall: e._def.catchall,
|
|
1678
1755
|
shape: () => ({
|
|
@@ -1742,25 +1819,25 @@ class b extends _ {
|
|
|
1742
1819
|
// return merged;
|
|
1743
1820
|
// }
|
|
1744
1821
|
catchall(e) {
|
|
1745
|
-
return new
|
|
1822
|
+
return new w({
|
|
1746
1823
|
...this._def,
|
|
1747
1824
|
catchall: e
|
|
1748
1825
|
});
|
|
1749
1826
|
}
|
|
1750
1827
|
pick(e) {
|
|
1751
1828
|
const s = {};
|
|
1752
|
-
|
|
1829
|
+
for (const n of v.objectKeys(e))
|
|
1753
1830
|
e[n] && this.shape[n] && (s[n] = this.shape[n]);
|
|
1754
|
-
|
|
1831
|
+
return new w({
|
|
1755
1832
|
...this._def,
|
|
1756
1833
|
shape: () => s
|
|
1757
1834
|
});
|
|
1758
1835
|
}
|
|
1759
1836
|
omit(e) {
|
|
1760
1837
|
const s = {};
|
|
1761
|
-
|
|
1838
|
+
for (const n of v.objectKeys(this.shape))
|
|
1762
1839
|
e[n] || (s[n] = this.shape[n]);
|
|
1763
|
-
|
|
1840
|
+
return new w({
|
|
1764
1841
|
...this._def,
|
|
1765
1842
|
shape: () => s
|
|
1766
1843
|
});
|
|
@@ -1769,77 +1846,78 @@ class b extends _ {
|
|
|
1769
1846
|
* @deprecated
|
|
1770
1847
|
*/
|
|
1771
1848
|
deepPartial() {
|
|
1772
|
-
return
|
|
1849
|
+
return L(this);
|
|
1773
1850
|
}
|
|
1774
1851
|
partial(e) {
|
|
1775
1852
|
const s = {};
|
|
1776
|
-
|
|
1777
|
-
const
|
|
1778
|
-
e && !e[n] ? s[n] =
|
|
1779
|
-
}
|
|
1853
|
+
for (const n of v.objectKeys(this.shape)) {
|
|
1854
|
+
const a = this.shape[n];
|
|
1855
|
+
e && !e[n] ? s[n] = a : s[n] = a.optional();
|
|
1856
|
+
}
|
|
1857
|
+
return new w({
|
|
1780
1858
|
...this._def,
|
|
1781
1859
|
shape: () => s
|
|
1782
1860
|
});
|
|
1783
1861
|
}
|
|
1784
1862
|
required(e) {
|
|
1785
1863
|
const s = {};
|
|
1786
|
-
|
|
1864
|
+
for (const n of v.objectKeys(this.shape))
|
|
1787
1865
|
if (e && !e[n])
|
|
1788
1866
|
s[n] = this.shape[n];
|
|
1789
1867
|
else {
|
|
1790
|
-
let
|
|
1791
|
-
for (;
|
|
1792
|
-
|
|
1793
|
-
s[n] =
|
|
1868
|
+
let r = this.shape[n];
|
|
1869
|
+
for (; r instanceof M; )
|
|
1870
|
+
r = r._def.innerType;
|
|
1871
|
+
s[n] = r;
|
|
1794
1872
|
}
|
|
1795
|
-
|
|
1873
|
+
return new w({
|
|
1796
1874
|
...this._def,
|
|
1797
1875
|
shape: () => s
|
|
1798
1876
|
});
|
|
1799
1877
|
}
|
|
1800
1878
|
keyof() {
|
|
1801
|
-
return
|
|
1879
|
+
return qe(v.objectKeys(this.shape));
|
|
1802
1880
|
}
|
|
1803
1881
|
}
|
|
1804
|
-
|
|
1882
|
+
w.create = (t, e) => new w({
|
|
1805
1883
|
shape: () => t,
|
|
1806
1884
|
unknownKeys: "strip",
|
|
1807
|
-
catchall:
|
|
1885
|
+
catchall: Z.create(),
|
|
1808
1886
|
typeName: m.ZodObject,
|
|
1809
|
-
...
|
|
1887
|
+
...g(e)
|
|
1810
1888
|
});
|
|
1811
|
-
|
|
1889
|
+
w.strictCreate = (t, e) => new w({
|
|
1812
1890
|
shape: () => t,
|
|
1813
1891
|
unknownKeys: "strict",
|
|
1814
|
-
catchall:
|
|
1892
|
+
catchall: Z.create(),
|
|
1815
1893
|
typeName: m.ZodObject,
|
|
1816
|
-
...
|
|
1894
|
+
...g(e)
|
|
1817
1895
|
});
|
|
1818
|
-
|
|
1896
|
+
w.lazycreate = (t, e) => new w({
|
|
1819
1897
|
shape: t,
|
|
1820
1898
|
unknownKeys: "strip",
|
|
1821
|
-
catchall:
|
|
1899
|
+
catchall: Z.create(),
|
|
1822
1900
|
typeName: m.ZodObject,
|
|
1823
|
-
...
|
|
1901
|
+
...g(e)
|
|
1824
1902
|
});
|
|
1825
|
-
class
|
|
1903
|
+
class se extends y {
|
|
1826
1904
|
_parse(e) {
|
|
1827
1905
|
const { ctx: s } = this._processInputParams(e), n = this._def.options;
|
|
1828
|
-
function r
|
|
1829
|
-
for (const
|
|
1830
|
-
if (
|
|
1831
|
-
return
|
|
1832
|
-
for (const
|
|
1833
|
-
if (
|
|
1834
|
-
return s.common.issues.push(...
|
|
1835
|
-
const i =
|
|
1836
|
-
return
|
|
1837
|
-
code:
|
|
1906
|
+
function a(r) {
|
|
1907
|
+
for (const c of r)
|
|
1908
|
+
if (c.result.status === "valid")
|
|
1909
|
+
return c.result;
|
|
1910
|
+
for (const c of r)
|
|
1911
|
+
if (c.result.status === "dirty")
|
|
1912
|
+
return s.common.issues.push(...c.ctx.common.issues), c.result;
|
|
1913
|
+
const i = r.map((c) => new O(c.ctx.common.issues));
|
|
1914
|
+
return u(s, {
|
|
1915
|
+
code: o.invalid_union,
|
|
1838
1916
|
unionErrors: i
|
|
1839
|
-
}),
|
|
1917
|
+
}), p;
|
|
1840
1918
|
}
|
|
1841
1919
|
if (s.common.async)
|
|
1842
|
-
return Promise.all(n.map(async (
|
|
1920
|
+
return Promise.all(n.map(async (r) => {
|
|
1843
1921
|
const i = {
|
|
1844
1922
|
...s,
|
|
1845
1923
|
common: {
|
|
@@ -1849,151 +1927,88 @@ class oe extends _ {
|
|
|
1849
1927
|
parent: null
|
|
1850
1928
|
};
|
|
1851
1929
|
return {
|
|
1852
|
-
result: await
|
|
1930
|
+
result: await r._parseAsync({
|
|
1853
1931
|
data: s.data,
|
|
1854
1932
|
path: s.path,
|
|
1855
1933
|
parent: i
|
|
1856
1934
|
}),
|
|
1857
1935
|
ctx: i
|
|
1858
1936
|
};
|
|
1859
|
-
})).then(
|
|
1937
|
+
})).then(a);
|
|
1860
1938
|
{
|
|
1861
|
-
let
|
|
1939
|
+
let r;
|
|
1862
1940
|
const i = [];
|
|
1863
|
-
for (const
|
|
1864
|
-
const
|
|
1941
|
+
for (const f of n) {
|
|
1942
|
+
const h = {
|
|
1865
1943
|
...s,
|
|
1866
1944
|
common: {
|
|
1867
1945
|
...s.common,
|
|
1868
1946
|
issues: []
|
|
1869
1947
|
},
|
|
1870
1948
|
parent: null
|
|
1871
|
-
},
|
|
1949
|
+
}, _ = f._parseSync({
|
|
1872
1950
|
data: s.data,
|
|
1873
1951
|
path: s.path,
|
|
1874
|
-
parent:
|
|
1952
|
+
parent: h
|
|
1875
1953
|
});
|
|
1876
|
-
if (
|
|
1877
|
-
return
|
|
1878
|
-
|
|
1954
|
+
if (_.status === "valid")
|
|
1955
|
+
return _;
|
|
1956
|
+
_.status === "dirty" && !r && (r = { result: _, ctx: h }), h.common.issues.length && i.push(h.common.issues);
|
|
1879
1957
|
}
|
|
1880
|
-
if (
|
|
1881
|
-
return s.common.issues.push(...
|
|
1882
|
-
const
|
|
1883
|
-
return
|
|
1884
|
-
code:
|
|
1885
|
-
unionErrors:
|
|
1886
|
-
}),
|
|
1958
|
+
if (r)
|
|
1959
|
+
return s.common.issues.push(...r.ctx.common.issues), r.result;
|
|
1960
|
+
const c = i.map((f) => new O(f));
|
|
1961
|
+
return u(s, {
|
|
1962
|
+
code: o.invalid_union,
|
|
1963
|
+
unionErrors: c
|
|
1964
|
+
}), p;
|
|
1887
1965
|
}
|
|
1888
1966
|
}
|
|
1889
1967
|
get options() {
|
|
1890
1968
|
return this._def.options;
|
|
1891
1969
|
}
|
|
1892
1970
|
}
|
|
1893
|
-
|
|
1971
|
+
se.create = (t, e) => new se({
|
|
1894
1972
|
options: t,
|
|
1895
1973
|
typeName: m.ZodUnion,
|
|
1896
|
-
...
|
|
1974
|
+
...g(e)
|
|
1897
1975
|
});
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
_parse(e) {
|
|
1901
|
-
const { ctx: s } = this._processInputParams(e);
|
|
1902
|
-
if (s.parsedType !== f.object)
|
|
1903
|
-
return l(s, {
|
|
1904
|
-
code: c.invalid_type,
|
|
1905
|
-
expected: f.object,
|
|
1906
|
-
received: s.parsedType
|
|
1907
|
-
}), y;
|
|
1908
|
-
const n = this.discriminator, r = s.data[n], a = this.optionsMap.get(r);
|
|
1909
|
-
return a ? s.common.async ? a._parseAsync({
|
|
1910
|
-
data: s.data,
|
|
1911
|
-
path: s.path,
|
|
1912
|
-
parent: s
|
|
1913
|
-
}) : a._parseSync({
|
|
1914
|
-
data: s.data,
|
|
1915
|
-
path: s.path,
|
|
1916
|
-
parent: s
|
|
1917
|
-
}) : (l(s, {
|
|
1918
|
-
code: c.invalid_union_discriminator,
|
|
1919
|
-
options: Array.from(this.optionsMap.keys()),
|
|
1920
|
-
path: [n]
|
|
1921
|
-
}), y);
|
|
1922
|
-
}
|
|
1923
|
-
get discriminator() {
|
|
1924
|
-
return this._def.discriminator;
|
|
1925
|
-
}
|
|
1926
|
-
get options() {
|
|
1927
|
-
return this._def.options;
|
|
1928
|
-
}
|
|
1929
|
-
get optionsMap() {
|
|
1930
|
-
return this._def.optionsMap;
|
|
1931
|
-
}
|
|
1932
|
-
/**
|
|
1933
|
-
* The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
|
|
1934
|
-
* However, it only allows a union of objects, all of which need to share a discriminator property. This property must
|
|
1935
|
-
* have a different value for each object in the union.
|
|
1936
|
-
* @param discriminator the name of the discriminator property
|
|
1937
|
-
* @param types an array of object schemas
|
|
1938
|
-
* @param params
|
|
1939
|
-
*/
|
|
1940
|
-
static create(e, s, n) {
|
|
1941
|
-
const r = /* @__PURE__ */ new Map();
|
|
1942
|
-
for (const a of s) {
|
|
1943
|
-
const i = j(a.shape[e]);
|
|
1944
|
-
if (!i.length)
|
|
1945
|
-
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
1946
|
-
for (const o of i) {
|
|
1947
|
-
if (r.has(o))
|
|
1948
|
-
throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);
|
|
1949
|
-
r.set(o, a);
|
|
1950
|
-
}
|
|
1951
|
-
}
|
|
1952
|
-
return new Re({
|
|
1953
|
-
typeName: m.ZodDiscriminatedUnion,
|
|
1954
|
-
discriminator: e,
|
|
1955
|
-
options: s,
|
|
1956
|
-
optionsMap: r,
|
|
1957
|
-
...v(n)
|
|
1958
|
-
});
|
|
1959
|
-
}
|
|
1960
|
-
}
|
|
1961
|
-
function Ie(t, e) {
|
|
1962
|
-
const s = q(t), n = q(e);
|
|
1976
|
+
function ye(t, e) {
|
|
1977
|
+
const s = I(t), n = I(e);
|
|
1963
1978
|
if (t === e)
|
|
1964
1979
|
return { valid: !0, data: t };
|
|
1965
|
-
if (s ===
|
|
1966
|
-
const
|
|
1967
|
-
for (const
|
|
1968
|
-
const
|
|
1969
|
-
if (!
|
|
1980
|
+
if (s === d.object && n === d.object) {
|
|
1981
|
+
const a = v.objectKeys(e), r = v.objectKeys(t).filter((c) => a.indexOf(c) !== -1), i = { ...t, ...e };
|
|
1982
|
+
for (const c of r) {
|
|
1983
|
+
const f = ye(t[c], e[c]);
|
|
1984
|
+
if (!f.valid)
|
|
1970
1985
|
return { valid: !1 };
|
|
1971
|
-
i[
|
|
1986
|
+
i[c] = f.data;
|
|
1972
1987
|
}
|
|
1973
1988
|
return { valid: !0, data: i };
|
|
1974
|
-
} else if (s ===
|
|
1989
|
+
} else if (s === d.array && n === d.array) {
|
|
1975
1990
|
if (t.length !== e.length)
|
|
1976
1991
|
return { valid: !1 };
|
|
1977
|
-
const
|
|
1978
|
-
for (let
|
|
1979
|
-
const i = t[
|
|
1980
|
-
if (!
|
|
1992
|
+
const a = [];
|
|
1993
|
+
for (let r = 0; r < t.length; r++) {
|
|
1994
|
+
const i = t[r], c = e[r], f = ye(i, c);
|
|
1995
|
+
if (!f.valid)
|
|
1981
1996
|
return { valid: !1 };
|
|
1982
|
-
|
|
1997
|
+
a.push(f.data);
|
|
1983
1998
|
}
|
|
1984
|
-
return { valid: !0, data:
|
|
1999
|
+
return { valid: !0, data: a };
|
|
1985
2000
|
} else
|
|
1986
|
-
return s ===
|
|
2001
|
+
return s === d.date && n === d.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
|
|
1987
2002
|
}
|
|
1988
|
-
class
|
|
2003
|
+
class ne extends y {
|
|
1989
2004
|
_parse(e) {
|
|
1990
|
-
const { status: s, ctx: n } = this._processInputParams(e),
|
|
1991
|
-
if (
|
|
1992
|
-
return
|
|
1993
|
-
const
|
|
1994
|
-
return
|
|
1995
|
-
code:
|
|
1996
|
-
}),
|
|
2005
|
+
const { status: s, ctx: n } = this._processInputParams(e), a = (r, i) => {
|
|
2006
|
+
if (Ee(r) || Ee(i))
|
|
2007
|
+
return p;
|
|
2008
|
+
const c = ye(r.value, i.value);
|
|
2009
|
+
return c.valid ? ((Oe(r) || Oe(i)) && s.dirty(), { status: s.value, value: c.data }) : (u(n, {
|
|
2010
|
+
code: o.invalid_intersection_types
|
|
2011
|
+
}), p);
|
|
1997
2012
|
};
|
|
1998
2013
|
return n.common.async ? Promise.all([
|
|
1999
2014
|
this._def.left._parseAsync({
|
|
@@ -2006,7 +2021,7 @@ class ce extends _ {
|
|
|
2006
2021
|
path: n.path,
|
|
2007
2022
|
parent: n
|
|
2008
2023
|
})
|
|
2009
|
-
]).then(([
|
|
2024
|
+
]).then(([r, i]) => a(r, i)) : a(this._def.left._parseSync({
|
|
2010
2025
|
data: n.data,
|
|
2011
2026
|
path: n.path,
|
|
2012
2027
|
parent: n
|
|
@@ -2017,63 +2032,63 @@ class ce extends _ {
|
|
|
2017
2032
|
}));
|
|
2018
2033
|
}
|
|
2019
2034
|
}
|
|
2020
|
-
|
|
2035
|
+
ne.create = (t, e, s) => new ne({
|
|
2021
2036
|
left: t,
|
|
2022
2037
|
right: e,
|
|
2023
2038
|
typeName: m.ZodIntersection,
|
|
2024
|
-
...
|
|
2039
|
+
...g(s)
|
|
2025
2040
|
});
|
|
2026
|
-
class
|
|
2041
|
+
class P extends y {
|
|
2027
2042
|
_parse(e) {
|
|
2028
2043
|
const { status: s, ctx: n } = this._processInputParams(e);
|
|
2029
|
-
if (n.parsedType !==
|
|
2030
|
-
return
|
|
2031
|
-
code:
|
|
2032
|
-
expected:
|
|
2044
|
+
if (n.parsedType !== d.array)
|
|
2045
|
+
return u(n, {
|
|
2046
|
+
code: o.invalid_type,
|
|
2047
|
+
expected: d.array,
|
|
2033
2048
|
received: n.parsedType
|
|
2034
|
-
}),
|
|
2049
|
+
}), p;
|
|
2035
2050
|
if (n.data.length < this._def.items.length)
|
|
2036
|
-
return
|
|
2037
|
-
code:
|
|
2051
|
+
return u(n, {
|
|
2052
|
+
code: o.too_small,
|
|
2038
2053
|
minimum: this._def.items.length,
|
|
2039
2054
|
inclusive: !0,
|
|
2040
2055
|
exact: !1,
|
|
2041
2056
|
type: "array"
|
|
2042
|
-
}),
|
|
2043
|
-
!this._def.rest && n.data.length > this._def.items.length && (
|
|
2044
|
-
code:
|
|
2057
|
+
}), p;
|
|
2058
|
+
!this._def.rest && n.data.length > this._def.items.length && (u(n, {
|
|
2059
|
+
code: o.too_big,
|
|
2045
2060
|
maximum: this._def.items.length,
|
|
2046
2061
|
inclusive: !0,
|
|
2047
2062
|
exact: !1,
|
|
2048
2063
|
type: "array"
|
|
2049
2064
|
}), s.dirty());
|
|
2050
|
-
const
|
|
2051
|
-
const
|
|
2052
|
-
return
|
|
2065
|
+
const r = [...n.data].map((i, c) => {
|
|
2066
|
+
const f = this._def.items[c] || this._def.rest;
|
|
2067
|
+
return f ? f._parse(new N(n, i, n.path, c)) : null;
|
|
2053
2068
|
}).filter((i) => !!i);
|
|
2054
|
-
return n.common.async ? Promise.all(
|
|
2069
|
+
return n.common.async ? Promise.all(r).then((i) => R.mergeArray(s, i)) : R.mergeArray(s, r);
|
|
2055
2070
|
}
|
|
2056
2071
|
get items() {
|
|
2057
2072
|
return this._def.items;
|
|
2058
2073
|
}
|
|
2059
2074
|
rest(e) {
|
|
2060
|
-
return new
|
|
2075
|
+
return new P({
|
|
2061
2076
|
...this._def,
|
|
2062
2077
|
rest: e
|
|
2063
2078
|
});
|
|
2064
2079
|
}
|
|
2065
2080
|
}
|
|
2066
|
-
|
|
2081
|
+
P.create = (t, e) => {
|
|
2067
2082
|
if (!Array.isArray(t))
|
|
2068
2083
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2069
|
-
return new
|
|
2084
|
+
return new P({
|
|
2070
2085
|
items: t,
|
|
2071
2086
|
typeName: m.ZodTuple,
|
|
2072
2087
|
rest: null,
|
|
2073
|
-
...
|
|
2088
|
+
...g(e)
|
|
2074
2089
|
});
|
|
2075
2090
|
};
|
|
2076
|
-
class
|
|
2091
|
+
class ae extends y {
|
|
2077
2092
|
get keySchema() {
|
|
2078
2093
|
return this._def.keyType;
|
|
2079
2094
|
}
|
|
@@ -2082,39 +2097,39 @@ class ue extends _ {
|
|
|
2082
2097
|
}
|
|
2083
2098
|
_parse(e) {
|
|
2084
2099
|
const { status: s, ctx: n } = this._processInputParams(e);
|
|
2085
|
-
if (n.parsedType !==
|
|
2086
|
-
return
|
|
2087
|
-
code:
|
|
2088
|
-
expected:
|
|
2100
|
+
if (n.parsedType !== d.object)
|
|
2101
|
+
return u(n, {
|
|
2102
|
+
code: o.invalid_type,
|
|
2103
|
+
expected: d.object,
|
|
2089
2104
|
received: n.parsedType
|
|
2090
|
-
}),
|
|
2091
|
-
const
|
|
2092
|
-
for (const
|
|
2093
|
-
|
|
2094
|
-
key:
|
|
2095
|
-
value: i._parse(new
|
|
2096
|
-
alwaysSet:
|
|
2105
|
+
}), p;
|
|
2106
|
+
const a = [], r = this._def.keyType, i = this._def.valueType;
|
|
2107
|
+
for (const c in n.data)
|
|
2108
|
+
a.push({
|
|
2109
|
+
key: r._parse(new N(n, c, n.path, c)),
|
|
2110
|
+
value: i._parse(new N(n, n.data[c], n.path, c)),
|
|
2111
|
+
alwaysSet: c in n.data
|
|
2097
2112
|
});
|
|
2098
|
-
return n.common.async ?
|
|
2113
|
+
return n.common.async ? R.mergeObjectAsync(s, a) : R.mergeObjectSync(s, a);
|
|
2099
2114
|
}
|
|
2100
2115
|
get element() {
|
|
2101
2116
|
return this._def.valueType;
|
|
2102
2117
|
}
|
|
2103
2118
|
static create(e, s, n) {
|
|
2104
|
-
return s instanceof
|
|
2119
|
+
return s instanceof y ? new ae({
|
|
2105
2120
|
keyType: e,
|
|
2106
2121
|
valueType: s,
|
|
2107
2122
|
typeName: m.ZodRecord,
|
|
2108
|
-
...
|
|
2109
|
-
}) : new
|
|
2110
|
-
keyType:
|
|
2123
|
+
...g(n)
|
|
2124
|
+
}) : new ae({
|
|
2125
|
+
keyType: E.create(),
|
|
2111
2126
|
valueType: e,
|
|
2112
2127
|
typeName: m.ZodRecord,
|
|
2113
|
-
...
|
|
2128
|
+
...g(s)
|
|
2114
2129
|
});
|
|
2115
2130
|
}
|
|
2116
2131
|
}
|
|
2117
|
-
class
|
|
2132
|
+
class _e extends y {
|
|
2118
2133
|
get keySchema() {
|
|
2119
2134
|
return this._def.keyType;
|
|
2120
2135
|
}
|
|
@@ -2123,93 +2138,93 @@ class Se extends _ {
|
|
|
2123
2138
|
}
|
|
2124
2139
|
_parse(e) {
|
|
2125
2140
|
const { status: s, ctx: n } = this._processInputParams(e);
|
|
2126
|
-
if (n.parsedType !==
|
|
2127
|
-
return
|
|
2128
|
-
code:
|
|
2129
|
-
expected:
|
|
2141
|
+
if (n.parsedType !== d.map)
|
|
2142
|
+
return u(n, {
|
|
2143
|
+
code: o.invalid_type,
|
|
2144
|
+
expected: d.map,
|
|
2130
2145
|
received: n.parsedType
|
|
2131
|
-
}),
|
|
2132
|
-
const
|
|
2133
|
-
key:
|
|
2134
|
-
value:
|
|
2146
|
+
}), p;
|
|
2147
|
+
const a = this._def.keyType, r = this._def.valueType, i = [...n.data.entries()].map(([c, f], h) => ({
|
|
2148
|
+
key: a._parse(new N(n, c, n.path, [h, "key"])),
|
|
2149
|
+
value: r._parse(new N(n, f, n.path, [h, "value"]))
|
|
2135
2150
|
}));
|
|
2136
2151
|
if (n.common.async) {
|
|
2137
|
-
const
|
|
2152
|
+
const c = /* @__PURE__ */ new Map();
|
|
2138
2153
|
return Promise.resolve().then(async () => {
|
|
2139
|
-
for (const
|
|
2140
|
-
const
|
|
2141
|
-
if (
|
|
2142
|
-
return
|
|
2143
|
-
(
|
|
2154
|
+
for (const f of i) {
|
|
2155
|
+
const h = await f.key, _ = await f.value;
|
|
2156
|
+
if (h.status === "aborted" || _.status === "aborted")
|
|
2157
|
+
return p;
|
|
2158
|
+
(h.status === "dirty" || _.status === "dirty") && s.dirty(), c.set(h.value, _.value);
|
|
2144
2159
|
}
|
|
2145
|
-
return { status: s.value, value:
|
|
2160
|
+
return { status: s.value, value: c };
|
|
2146
2161
|
});
|
|
2147
2162
|
} else {
|
|
2148
|
-
const
|
|
2149
|
-
for (const
|
|
2150
|
-
const
|
|
2151
|
-
if (
|
|
2152
|
-
return
|
|
2153
|
-
(
|
|
2163
|
+
const c = /* @__PURE__ */ new Map();
|
|
2164
|
+
for (const f of i) {
|
|
2165
|
+
const h = f.key, _ = f.value;
|
|
2166
|
+
if (h.status === "aborted" || _.status === "aborted")
|
|
2167
|
+
return p;
|
|
2168
|
+
(h.status === "dirty" || _.status === "dirty") && s.dirty(), c.set(h.value, _.value);
|
|
2154
2169
|
}
|
|
2155
|
-
return { status: s.value, value:
|
|
2170
|
+
return { status: s.value, value: c };
|
|
2156
2171
|
}
|
|
2157
2172
|
}
|
|
2158
2173
|
}
|
|
2159
|
-
|
|
2174
|
+
_e.create = (t, e, s) => new _e({
|
|
2160
2175
|
valueType: e,
|
|
2161
2176
|
keyType: t,
|
|
2162
2177
|
typeName: m.ZodMap,
|
|
2163
|
-
...
|
|
2178
|
+
...g(s)
|
|
2164
2179
|
});
|
|
2165
|
-
class
|
|
2180
|
+
class D extends y {
|
|
2166
2181
|
_parse(e) {
|
|
2167
2182
|
const { status: s, ctx: n } = this._processInputParams(e);
|
|
2168
|
-
if (n.parsedType !==
|
|
2169
|
-
return
|
|
2170
|
-
code:
|
|
2171
|
-
expected:
|
|
2183
|
+
if (n.parsedType !== d.set)
|
|
2184
|
+
return u(n, {
|
|
2185
|
+
code: o.invalid_type,
|
|
2186
|
+
expected: d.set,
|
|
2172
2187
|
received: n.parsedType
|
|
2173
|
-
}),
|
|
2174
|
-
const
|
|
2175
|
-
|
|
2176
|
-
code:
|
|
2177
|
-
minimum:
|
|
2188
|
+
}), p;
|
|
2189
|
+
const a = this._def;
|
|
2190
|
+
a.minSize !== null && n.data.size < a.minSize.value && (u(n, {
|
|
2191
|
+
code: o.too_small,
|
|
2192
|
+
minimum: a.minSize.value,
|
|
2178
2193
|
type: "set",
|
|
2179
2194
|
inclusive: !0,
|
|
2180
2195
|
exact: !1,
|
|
2181
|
-
message:
|
|
2182
|
-
}), s.dirty()),
|
|
2183
|
-
code:
|
|
2184
|
-
maximum:
|
|
2196
|
+
message: a.minSize.message
|
|
2197
|
+
}), s.dirty()), a.maxSize !== null && n.data.size > a.maxSize.value && (u(n, {
|
|
2198
|
+
code: o.too_big,
|
|
2199
|
+
maximum: a.maxSize.value,
|
|
2185
2200
|
type: "set",
|
|
2186
2201
|
inclusive: !0,
|
|
2187
2202
|
exact: !1,
|
|
2188
|
-
message:
|
|
2203
|
+
message: a.maxSize.message
|
|
2189
2204
|
}), s.dirty());
|
|
2190
|
-
const
|
|
2191
|
-
function i(
|
|
2192
|
-
const
|
|
2193
|
-
for (const
|
|
2194
|
-
if (
|
|
2195
|
-
return
|
|
2196
|
-
|
|
2205
|
+
const r = this._def.valueType;
|
|
2206
|
+
function i(f) {
|
|
2207
|
+
const h = /* @__PURE__ */ new Set();
|
|
2208
|
+
for (const _ of f) {
|
|
2209
|
+
if (_.status === "aborted")
|
|
2210
|
+
return p;
|
|
2211
|
+
_.status === "dirty" && s.dirty(), h.add(_.value);
|
|
2197
2212
|
}
|
|
2198
|
-
return { status: s.value, value:
|
|
2213
|
+
return { status: s.value, value: h };
|
|
2199
2214
|
}
|
|
2200
|
-
const
|
|
2201
|
-
return n.common.async ? Promise.all(
|
|
2215
|
+
const c = [...n.data.values()].map((f, h) => r._parse(new N(n, f, n.path, h)));
|
|
2216
|
+
return n.common.async ? Promise.all(c).then((f) => i(f)) : i(c);
|
|
2202
2217
|
}
|
|
2203
2218
|
min(e, s) {
|
|
2204
|
-
return new
|
|
2219
|
+
return new D({
|
|
2205
2220
|
...this._def,
|
|
2206
|
-
minSize: { value: e, message:
|
|
2221
|
+
minSize: { value: e, message: l.toString(s) }
|
|
2207
2222
|
});
|
|
2208
2223
|
}
|
|
2209
2224
|
max(e, s) {
|
|
2210
|
-
return new
|
|
2225
|
+
return new D({
|
|
2211
2226
|
...this._def,
|
|
2212
|
-
maxSize: { value: e, message:
|
|
2227
|
+
maxSize: { value: e, message: l.toString(s) }
|
|
2213
2228
|
});
|
|
2214
2229
|
}
|
|
2215
2230
|
size(e, s) {
|
|
@@ -2219,115 +2234,14 @@ class G extends _ {
|
|
|
2219
2234
|
return this.min(1, e);
|
|
2220
2235
|
}
|
|
2221
2236
|
}
|
|
2222
|
-
|
|
2237
|
+
D.create = (t, e) => new D({
|
|
2223
2238
|
valueType: t,
|
|
2224
2239
|
minSize: null,
|
|
2225
2240
|
maxSize: null,
|
|
2226
2241
|
typeName: m.ZodSet,
|
|
2227
|
-
...
|
|
2242
|
+
...g(e)
|
|
2228
2243
|
});
|
|
2229
|
-
class
|
|
2230
|
-
constructor() {
|
|
2231
|
-
super(...arguments), this.validate = this.implement;
|
|
2232
|
-
}
|
|
2233
|
-
_parse(e) {
|
|
2234
|
-
const { ctx: s } = this._processInputParams(e);
|
|
2235
|
-
if (s.parsedType !== f.function)
|
|
2236
|
-
return l(s, {
|
|
2237
|
-
code: c.invalid_type,
|
|
2238
|
-
expected: f.function,
|
|
2239
|
-
received: s.parsedType
|
|
2240
|
-
}), y;
|
|
2241
|
-
function n(o, d) {
|
|
2242
|
-
return xe({
|
|
2243
|
-
data: o,
|
|
2244
|
-
path: s.path,
|
|
2245
|
-
errorMaps: [
|
|
2246
|
-
s.common.contextualErrorMap,
|
|
2247
|
-
s.schemaErrorMap,
|
|
2248
|
-
_e(),
|
|
2249
|
-
Y
|
|
2250
|
-
].filter((u) => !!u),
|
|
2251
|
-
issueData: {
|
|
2252
|
-
code: c.invalid_arguments,
|
|
2253
|
-
argumentsError: d
|
|
2254
|
-
}
|
|
2255
|
-
});
|
|
2256
|
-
}
|
|
2257
|
-
function r(o, d) {
|
|
2258
|
-
return xe({
|
|
2259
|
-
data: o,
|
|
2260
|
-
path: s.path,
|
|
2261
|
-
errorMaps: [
|
|
2262
|
-
s.common.contextualErrorMap,
|
|
2263
|
-
s.schemaErrorMap,
|
|
2264
|
-
_e(),
|
|
2265
|
-
Y
|
|
2266
|
-
].filter((u) => !!u),
|
|
2267
|
-
issueData: {
|
|
2268
|
-
code: c.invalid_return_type,
|
|
2269
|
-
returnTypeError: d
|
|
2270
|
-
}
|
|
2271
|
-
});
|
|
2272
|
-
}
|
|
2273
|
-
const a = { errorMap: s.common.contextualErrorMap }, i = s.data;
|
|
2274
|
-
if (this._def.returns instanceof X) {
|
|
2275
|
-
const o = this;
|
|
2276
|
-
return T(async function(...d) {
|
|
2277
|
-
const u = new E([]), g = await o._def.args.parseAsync(d, a).catch((Ee) => {
|
|
2278
|
-
throw u.addIssue(n(d, Ee)), u;
|
|
2279
|
-
}), R = await Reflect.apply(i, this, g);
|
|
2280
|
-
return await o._def.returns._def.type.parseAsync(R, a).catch((Ee) => {
|
|
2281
|
-
throw u.addIssue(r(R, Ee)), u;
|
|
2282
|
-
});
|
|
2283
|
-
});
|
|
2284
|
-
} else {
|
|
2285
|
-
const o = this;
|
|
2286
|
-
return T(function(...d) {
|
|
2287
|
-
const u = o._def.args.safeParse(d, a);
|
|
2288
|
-
if (!u.success)
|
|
2289
|
-
throw new E([n(d, u.error)]);
|
|
2290
|
-
const g = Reflect.apply(i, this, u.data), R = o._def.returns.safeParse(g, a);
|
|
2291
|
-
if (!R.success)
|
|
2292
|
-
throw new E([r(g, R.error)]);
|
|
2293
|
-
return R.data;
|
|
2294
|
-
});
|
|
2295
|
-
}
|
|
2296
|
-
}
|
|
2297
|
-
parameters() {
|
|
2298
|
-
return this._def.args;
|
|
2299
|
-
}
|
|
2300
|
-
returnType() {
|
|
2301
|
-
return this._def.returns;
|
|
2302
|
-
}
|
|
2303
|
-
args(...e) {
|
|
2304
|
-
return new H({
|
|
2305
|
-
...this._def,
|
|
2306
|
-
args: A.create(e).rest(B.create())
|
|
2307
|
-
});
|
|
2308
|
-
}
|
|
2309
|
-
returns(e) {
|
|
2310
|
-
return new H({
|
|
2311
|
-
...this._def,
|
|
2312
|
-
returns: e
|
|
2313
|
-
});
|
|
2314
|
-
}
|
|
2315
|
-
implement(e) {
|
|
2316
|
-
return this.parse(e);
|
|
2317
|
-
}
|
|
2318
|
-
strictImplement(e) {
|
|
2319
|
-
return this.parse(e);
|
|
2320
|
-
}
|
|
2321
|
-
static create(e, s, n) {
|
|
2322
|
-
return new H({
|
|
2323
|
-
args: e || A.create([]).rest(B.create()),
|
|
2324
|
-
returns: s || B.create(),
|
|
2325
|
-
typeName: m.ZodFunction,
|
|
2326
|
-
...v(n)
|
|
2327
|
-
});
|
|
2328
|
-
}
|
|
2329
|
-
}
|
|
2330
|
-
class de extends _ {
|
|
2244
|
+
class ve extends y {
|
|
2331
2245
|
get schema() {
|
|
2332
2246
|
return this._def.getter();
|
|
2333
2247
|
}
|
|
@@ -2336,20 +2250,20 @@ class de extends _ {
|
|
|
2336
2250
|
return this._def.getter()._parse({ data: s.data, path: s.path, parent: s });
|
|
2337
2251
|
}
|
|
2338
2252
|
}
|
|
2339
|
-
|
|
2253
|
+
ve.create = (t, e) => new ve({
|
|
2340
2254
|
getter: t,
|
|
2341
2255
|
typeName: m.ZodLazy,
|
|
2342
|
-
...
|
|
2256
|
+
...g(e)
|
|
2343
2257
|
});
|
|
2344
|
-
class
|
|
2258
|
+
class xe extends y {
|
|
2345
2259
|
_parse(e) {
|
|
2346
2260
|
if (e.data !== this._def.value) {
|
|
2347
2261
|
const s = this._getOrReturnCtx(e);
|
|
2348
|
-
return
|
|
2262
|
+
return u(s, {
|
|
2349
2263
|
received: s.data,
|
|
2350
|
-
code:
|
|
2264
|
+
code: o.invalid_literal,
|
|
2351
2265
|
expected: this._def.value
|
|
2352
|
-
}),
|
|
2266
|
+
}), p;
|
|
2353
2267
|
}
|
|
2354
2268
|
return { status: "valid", value: e.data };
|
|
2355
2269
|
}
|
|
@@ -2357,38 +2271,35 @@ class le extends _ {
|
|
|
2357
2271
|
return this._def.value;
|
|
2358
2272
|
}
|
|
2359
2273
|
}
|
|
2360
|
-
|
|
2274
|
+
xe.create = (t, e) => new xe({
|
|
2361
2275
|
value: t,
|
|
2362
2276
|
typeName: m.ZodLiteral,
|
|
2363
|
-
...
|
|
2277
|
+
...g(e)
|
|
2364
2278
|
});
|
|
2365
|
-
function
|
|
2366
|
-
return new
|
|
2279
|
+
function qe(t, e) {
|
|
2280
|
+
return new G({
|
|
2367
2281
|
values: t,
|
|
2368
2282
|
typeName: m.ZodEnum,
|
|
2369
|
-
...
|
|
2283
|
+
...g(e)
|
|
2370
2284
|
});
|
|
2371
2285
|
}
|
|
2372
|
-
class
|
|
2373
|
-
constructor() {
|
|
2374
|
-
super(...arguments), F.set(this, void 0);
|
|
2375
|
-
}
|
|
2286
|
+
class G extends y {
|
|
2376
2287
|
_parse(e) {
|
|
2377
2288
|
if (typeof e.data != "string") {
|
|
2378
2289
|
const s = this._getOrReturnCtx(e), n = this._def.values;
|
|
2379
|
-
return
|
|
2380
|
-
expected:
|
|
2290
|
+
return u(s, {
|
|
2291
|
+
expected: v.joinValues(n),
|
|
2381
2292
|
received: s.parsedType,
|
|
2382
|
-
code:
|
|
2383
|
-
}),
|
|
2293
|
+
code: o.invalid_type
|
|
2294
|
+
}), p;
|
|
2384
2295
|
}
|
|
2385
|
-
if (
|
|
2296
|
+
if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data)) {
|
|
2386
2297
|
const s = this._getOrReturnCtx(e), n = this._def.values;
|
|
2387
|
-
return
|
|
2298
|
+
return u(s, {
|
|
2388
2299
|
received: s.data,
|
|
2389
|
-
code:
|
|
2300
|
+
code: o.invalid_enum_value,
|
|
2390
2301
|
options: n
|
|
2391
|
-
}),
|
|
2302
|
+
}), p;
|
|
2392
2303
|
}
|
|
2393
2304
|
return T(e.data);
|
|
2394
2305
|
}
|
|
@@ -2414,41 +2325,37 @@ class L extends _ {
|
|
|
2414
2325
|
return e;
|
|
2415
2326
|
}
|
|
2416
2327
|
extract(e, s = this._def) {
|
|
2417
|
-
return
|
|
2328
|
+
return G.create(e, {
|
|
2418
2329
|
...this._def,
|
|
2419
2330
|
...s
|
|
2420
2331
|
});
|
|
2421
2332
|
}
|
|
2422
2333
|
exclude(e, s = this._def) {
|
|
2423
|
-
return
|
|
2334
|
+
return G.create(this.options.filter((n) => !e.includes(n)), {
|
|
2424
2335
|
...this._def,
|
|
2425
2336
|
...s
|
|
2426
2337
|
});
|
|
2427
2338
|
}
|
|
2428
2339
|
}
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
class fe extends _ {
|
|
2432
|
-
constructor() {
|
|
2433
|
-
super(...arguments), ee.set(this, void 0);
|
|
2434
|
-
}
|
|
2340
|
+
G.create = qe;
|
|
2341
|
+
class be extends y {
|
|
2435
2342
|
_parse(e) {
|
|
2436
|
-
const s =
|
|
2437
|
-
if (n.parsedType !==
|
|
2438
|
-
const
|
|
2439
|
-
return
|
|
2440
|
-
expected:
|
|
2343
|
+
const s = v.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
2344
|
+
if (n.parsedType !== d.string && n.parsedType !== d.number) {
|
|
2345
|
+
const a = v.objectValues(s);
|
|
2346
|
+
return u(n, {
|
|
2347
|
+
expected: v.joinValues(a),
|
|
2441
2348
|
received: n.parsedType,
|
|
2442
|
-
code:
|
|
2443
|
-
}),
|
|
2349
|
+
code: o.invalid_type
|
|
2350
|
+
}), p;
|
|
2444
2351
|
}
|
|
2445
|
-
if (
|
|
2446
|
-
const
|
|
2447
|
-
return
|
|
2352
|
+
if (this._cache || (this._cache = new Set(v.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
|
|
2353
|
+
const a = v.objectValues(s);
|
|
2354
|
+
return u(n, {
|
|
2448
2355
|
received: n.data,
|
|
2449
|
-
code:
|
|
2450
|
-
options:
|
|
2451
|
-
}),
|
|
2356
|
+
code: o.invalid_enum_value,
|
|
2357
|
+
options: a
|
|
2358
|
+
}), p;
|
|
2452
2359
|
}
|
|
2453
2360
|
return T(e.data);
|
|
2454
2361
|
}
|
|
@@ -2456,37 +2363,36 @@ class fe extends _ {
|
|
|
2456
2363
|
return this._def.values;
|
|
2457
2364
|
}
|
|
2458
2365
|
}
|
|
2459
|
-
|
|
2460
|
-
fe.create = (t, e) => new fe({
|
|
2366
|
+
be.create = (t, e) => new be({
|
|
2461
2367
|
values: t,
|
|
2462
2368
|
typeName: m.ZodNativeEnum,
|
|
2463
|
-
...
|
|
2369
|
+
...g(e)
|
|
2464
2370
|
});
|
|
2465
|
-
class
|
|
2371
|
+
class re extends y {
|
|
2466
2372
|
unwrap() {
|
|
2467
2373
|
return this._def.type;
|
|
2468
2374
|
}
|
|
2469
2375
|
_parse(e) {
|
|
2470
2376
|
const { ctx: s } = this._processInputParams(e);
|
|
2471
|
-
if (s.parsedType !==
|
|
2472
|
-
return
|
|
2473
|
-
code:
|
|
2474
|
-
expected:
|
|
2377
|
+
if (s.parsedType !== d.promise && s.common.async === !1)
|
|
2378
|
+
return u(s, {
|
|
2379
|
+
code: o.invalid_type,
|
|
2380
|
+
expected: d.promise,
|
|
2475
2381
|
received: s.parsedType
|
|
2476
|
-
}),
|
|
2477
|
-
const n = s.parsedType ===
|
|
2478
|
-
return T(n.then((
|
|
2382
|
+
}), p;
|
|
2383
|
+
const n = s.parsedType === d.promise ? s.data : Promise.resolve(s.data);
|
|
2384
|
+
return T(n.then((a) => this._def.type.parseAsync(a, {
|
|
2479
2385
|
path: s.path,
|
|
2480
2386
|
errorMap: s.common.contextualErrorMap
|
|
2481
2387
|
})));
|
|
2482
2388
|
}
|
|
2483
2389
|
}
|
|
2484
|
-
|
|
2390
|
+
re.create = (t, e) => new re({
|
|
2485
2391
|
type: t,
|
|
2486
2392
|
typeName: m.ZodPromise,
|
|
2487
|
-
...
|
|
2393
|
+
...g(e)
|
|
2488
2394
|
});
|
|
2489
|
-
class
|
|
2395
|
+
class j extends y {
|
|
2490
2396
|
innerType() {
|
|
2491
2397
|
return this._def.schema;
|
|
2492
2398
|
}
|
|
@@ -2494,118 +2400,121 @@ class M extends _ {
|
|
|
2494
2400
|
return this._def.schema._def.typeName === m.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
2495
2401
|
}
|
|
2496
2402
|
_parse(e) {
|
|
2497
|
-
const { status: s, ctx: n } = this._processInputParams(e),
|
|
2403
|
+
const { status: s, ctx: n } = this._processInputParams(e), a = this._def.effect || null, r = {
|
|
2498
2404
|
addIssue: (i) => {
|
|
2499
|
-
|
|
2405
|
+
u(n, i), i.fatal ? s.abort() : s.dirty();
|
|
2500
2406
|
},
|
|
2501
2407
|
get path() {
|
|
2502
2408
|
return n.path;
|
|
2503
2409
|
}
|
|
2504
2410
|
};
|
|
2505
|
-
if (
|
|
2506
|
-
const i =
|
|
2411
|
+
if (r.addIssue = r.addIssue.bind(r), a.type === "preprocess") {
|
|
2412
|
+
const i = a.transform(n.data, r);
|
|
2507
2413
|
if (n.common.async)
|
|
2508
|
-
return Promise.resolve(i).then(async (
|
|
2414
|
+
return Promise.resolve(i).then(async (c) => {
|
|
2509
2415
|
if (s.value === "aborted")
|
|
2510
|
-
return
|
|
2511
|
-
const
|
|
2512
|
-
data:
|
|
2416
|
+
return p;
|
|
2417
|
+
const f = await this._def.schema._parseAsync({
|
|
2418
|
+
data: c,
|
|
2513
2419
|
path: n.path,
|
|
2514
2420
|
parent: n
|
|
2515
2421
|
});
|
|
2516
|
-
return
|
|
2422
|
+
return f.status === "aborted" ? p : f.status === "dirty" || s.value === "dirty" ? W(f.value) : f;
|
|
2517
2423
|
});
|
|
2518
2424
|
{
|
|
2519
2425
|
if (s.value === "aborted")
|
|
2520
|
-
return
|
|
2521
|
-
const
|
|
2426
|
+
return p;
|
|
2427
|
+
const c = this._def.schema._parseSync({
|
|
2522
2428
|
data: i,
|
|
2523
2429
|
path: n.path,
|
|
2524
2430
|
parent: n
|
|
2525
2431
|
});
|
|
2526
|
-
return
|
|
2432
|
+
return c.status === "aborted" ? p : c.status === "dirty" || s.value === "dirty" ? W(c.value) : c;
|
|
2527
2433
|
}
|
|
2528
2434
|
}
|
|
2529
|
-
if (
|
|
2530
|
-
const i = (
|
|
2531
|
-
const
|
|
2435
|
+
if (a.type === "refinement") {
|
|
2436
|
+
const i = (c) => {
|
|
2437
|
+
const f = a.refinement(c, r);
|
|
2532
2438
|
if (n.common.async)
|
|
2533
|
-
return Promise.resolve(
|
|
2534
|
-
if (
|
|
2439
|
+
return Promise.resolve(f);
|
|
2440
|
+
if (f instanceof Promise)
|
|
2535
2441
|
throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2536
|
-
return
|
|
2442
|
+
return c;
|
|
2537
2443
|
};
|
|
2538
2444
|
if (n.common.async === !1) {
|
|
2539
|
-
const
|
|
2445
|
+
const c = this._def.schema._parseSync({
|
|
2540
2446
|
data: n.data,
|
|
2541
2447
|
path: n.path,
|
|
2542
2448
|
parent: n
|
|
2543
2449
|
});
|
|
2544
|
-
return
|
|
2450
|
+
return c.status === "aborted" ? p : (c.status === "dirty" && s.dirty(), i(c.value), { status: s.value, value: c.value });
|
|
2545
2451
|
} else
|
|
2546
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((
|
|
2452
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((c) => c.status === "aborted" ? p : (c.status === "dirty" && s.dirty(), i(c.value).then(() => ({ status: s.value, value: c.value }))));
|
|
2547
2453
|
}
|
|
2548
|
-
if (
|
|
2454
|
+
if (a.type === "transform")
|
|
2549
2455
|
if (n.common.async === !1) {
|
|
2550
2456
|
const i = this._def.schema._parseSync({
|
|
2551
2457
|
data: n.data,
|
|
2552
2458
|
path: n.path,
|
|
2553
2459
|
parent: n
|
|
2554
2460
|
});
|
|
2555
|
-
if (!
|
|
2556
|
-
return
|
|
2557
|
-
const
|
|
2558
|
-
if (
|
|
2461
|
+
if (!V(i))
|
|
2462
|
+
return p;
|
|
2463
|
+
const c = a.transform(i.value, r);
|
|
2464
|
+
if (c instanceof Promise)
|
|
2559
2465
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2560
|
-
return { status: s.value, value:
|
|
2466
|
+
return { status: s.value, value: c };
|
|
2561
2467
|
} else
|
|
2562
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) =>
|
|
2563
|
-
|
|
2468
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => V(i) ? Promise.resolve(a.transform(i.value, r)).then((c) => ({
|
|
2469
|
+
status: s.value,
|
|
2470
|
+
value: c
|
|
2471
|
+
})) : p);
|
|
2472
|
+
v.assertNever(a);
|
|
2564
2473
|
}
|
|
2565
2474
|
}
|
|
2566
|
-
|
|
2475
|
+
j.create = (t, e, s) => new j({
|
|
2567
2476
|
schema: t,
|
|
2568
2477
|
typeName: m.ZodEffects,
|
|
2569
2478
|
effect: e,
|
|
2570
|
-
...
|
|
2479
|
+
...g(s)
|
|
2571
2480
|
});
|
|
2572
|
-
|
|
2481
|
+
j.createWithPreprocess = (t, e, s) => new j({
|
|
2573
2482
|
schema: e,
|
|
2574
2483
|
effect: { type: "preprocess", transform: t },
|
|
2575
2484
|
typeName: m.ZodEffects,
|
|
2576
|
-
...
|
|
2485
|
+
...g(s)
|
|
2577
2486
|
});
|
|
2578
|
-
class
|
|
2487
|
+
class M extends y {
|
|
2579
2488
|
_parse(e) {
|
|
2580
|
-
return this._getType(e) ===
|
|
2489
|
+
return this._getType(e) === d.undefined ? T(void 0) : this._def.innerType._parse(e);
|
|
2581
2490
|
}
|
|
2582
2491
|
unwrap() {
|
|
2583
2492
|
return this._def.innerType;
|
|
2584
2493
|
}
|
|
2585
2494
|
}
|
|
2586
|
-
|
|
2495
|
+
M.create = (t, e) => new M({
|
|
2587
2496
|
innerType: t,
|
|
2588
2497
|
typeName: m.ZodOptional,
|
|
2589
|
-
...
|
|
2498
|
+
...g(e)
|
|
2590
2499
|
});
|
|
2591
|
-
class
|
|
2500
|
+
class Q extends y {
|
|
2592
2501
|
_parse(e) {
|
|
2593
|
-
return this._getType(e) ===
|
|
2502
|
+
return this._getType(e) === d.null ? T(null) : this._def.innerType._parse(e);
|
|
2594
2503
|
}
|
|
2595
2504
|
unwrap() {
|
|
2596
2505
|
return this._def.innerType;
|
|
2597
2506
|
}
|
|
2598
2507
|
}
|
|
2599
|
-
|
|
2508
|
+
Q.create = (t, e) => new Q({
|
|
2600
2509
|
innerType: t,
|
|
2601
2510
|
typeName: m.ZodNullable,
|
|
2602
|
-
...
|
|
2511
|
+
...g(e)
|
|
2603
2512
|
});
|
|
2604
|
-
class
|
|
2513
|
+
class ke extends y {
|
|
2605
2514
|
_parse(e) {
|
|
2606
2515
|
const { ctx: s } = this._processInputParams(e);
|
|
2607
2516
|
let n = s.data;
|
|
2608
|
-
return s.parsedType ===
|
|
2517
|
+
return s.parsedType === d.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
|
|
2609
2518
|
data: n,
|
|
2610
2519
|
path: s.path,
|
|
2611
2520
|
parent: s
|
|
@@ -2615,13 +2524,13 @@ class he extends _ {
|
|
|
2615
2524
|
return this._def.innerType;
|
|
2616
2525
|
}
|
|
2617
2526
|
}
|
|
2618
|
-
|
|
2527
|
+
ke.create = (t, e) => new ke({
|
|
2619
2528
|
innerType: t,
|
|
2620
2529
|
typeName: m.ZodDefault,
|
|
2621
2530
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2622
|
-
...
|
|
2531
|
+
...g(e)
|
|
2623
2532
|
});
|
|
2624
|
-
class
|
|
2533
|
+
class we extends y {
|
|
2625
2534
|
_parse(e) {
|
|
2626
2535
|
const { ctx: s } = this._processInputParams(e), n = {
|
|
2627
2536
|
...s,
|
|
@@ -2629,26 +2538,26 @@ class pe extends _ {
|
|
|
2629
2538
|
...s.common,
|
|
2630
2539
|
issues: []
|
|
2631
2540
|
}
|
|
2632
|
-
},
|
|
2541
|
+
}, a = this._def.innerType._parse({
|
|
2633
2542
|
data: n.data,
|
|
2634
2543
|
path: n.path,
|
|
2635
2544
|
parent: {
|
|
2636
2545
|
...n
|
|
2637
2546
|
}
|
|
2638
2547
|
});
|
|
2639
|
-
return
|
|
2548
|
+
return te(a) ? a.then((r) => ({
|
|
2640
2549
|
status: "valid",
|
|
2641
|
-
value:
|
|
2550
|
+
value: r.status === "valid" ? r.value : this._def.catchValue({
|
|
2642
2551
|
get error() {
|
|
2643
|
-
return new
|
|
2552
|
+
return new O(n.common.issues);
|
|
2644
2553
|
},
|
|
2645
2554
|
input: n.data
|
|
2646
2555
|
})
|
|
2647
2556
|
})) : {
|
|
2648
2557
|
status: "valid",
|
|
2649
|
-
value:
|
|
2558
|
+
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2650
2559
|
get error() {
|
|
2651
|
-
return new
|
|
2560
|
+
return new O(n.common.issues);
|
|
2652
2561
|
},
|
|
2653
2562
|
input: n.data
|
|
2654
2563
|
})
|
|
@@ -2658,31 +2567,30 @@ class pe extends _ {
|
|
|
2658
2567
|
return this._def.innerType;
|
|
2659
2568
|
}
|
|
2660
2569
|
}
|
|
2661
|
-
|
|
2570
|
+
we.create = (t, e) => new we({
|
|
2662
2571
|
innerType: t,
|
|
2663
2572
|
typeName: m.ZodCatch,
|
|
2664
2573
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2665
|
-
...
|
|
2574
|
+
...g(e)
|
|
2666
2575
|
});
|
|
2667
|
-
class
|
|
2576
|
+
class Se extends y {
|
|
2668
2577
|
_parse(e) {
|
|
2669
|
-
if (this._getType(e) !==
|
|
2578
|
+
if (this._getType(e) !== d.nan) {
|
|
2670
2579
|
const n = this._getOrReturnCtx(e);
|
|
2671
|
-
return
|
|
2672
|
-
code:
|
|
2673
|
-
expected:
|
|
2580
|
+
return u(n, {
|
|
2581
|
+
code: o.invalid_type,
|
|
2582
|
+
expected: d.nan,
|
|
2674
2583
|
received: n.parsedType
|
|
2675
|
-
}),
|
|
2584
|
+
}), p;
|
|
2676
2585
|
}
|
|
2677
2586
|
return { status: "valid", value: e.data };
|
|
2678
2587
|
}
|
|
2679
2588
|
}
|
|
2680
|
-
|
|
2589
|
+
Se.create = (t) => new Se({
|
|
2681
2590
|
typeName: m.ZodNaN,
|
|
2682
|
-
...
|
|
2591
|
+
...g(t)
|
|
2683
2592
|
});
|
|
2684
|
-
|
|
2685
|
-
class Oe extends _ {
|
|
2593
|
+
class yt extends y {
|
|
2686
2594
|
_parse(e) {
|
|
2687
2595
|
const { ctx: s } = this._processInputParams(e), n = s.data;
|
|
2688
2596
|
return this._def.type._parse({
|
|
@@ -2695,404 +2603,305 @@ class Oe extends _ {
|
|
|
2695
2603
|
return this._def.type;
|
|
2696
2604
|
}
|
|
2697
2605
|
}
|
|
2698
|
-
class
|
|
2606
|
+
class Ce extends y {
|
|
2699
2607
|
_parse(e) {
|
|
2700
2608
|
const { status: s, ctx: n } = this._processInputParams(e);
|
|
2701
2609
|
if (n.common.async)
|
|
2702
2610
|
return (async () => {
|
|
2703
|
-
const
|
|
2611
|
+
const r = await this._def.in._parseAsync({
|
|
2704
2612
|
data: n.data,
|
|
2705
2613
|
path: n.path,
|
|
2706
2614
|
parent: n
|
|
2707
2615
|
});
|
|
2708
|
-
return
|
|
2709
|
-
data:
|
|
2616
|
+
return r.status === "aborted" ? p : r.status === "dirty" ? (s.dirty(), W(r.value)) : this._def.out._parseAsync({
|
|
2617
|
+
data: r.value,
|
|
2710
2618
|
path: n.path,
|
|
2711
2619
|
parent: n
|
|
2712
2620
|
});
|
|
2713
2621
|
})();
|
|
2714
2622
|
{
|
|
2715
|
-
const
|
|
2623
|
+
const a = this._def.in._parseSync({
|
|
2716
2624
|
data: n.data,
|
|
2717
2625
|
path: n.path,
|
|
2718
2626
|
parent: n
|
|
2719
2627
|
});
|
|
2720
|
-
return
|
|
2628
|
+
return a.status === "aborted" ? p : a.status === "dirty" ? (s.dirty(), {
|
|
2721
2629
|
status: "dirty",
|
|
2722
|
-
value:
|
|
2630
|
+
value: a.value
|
|
2723
2631
|
}) : this._def.out._parseSync({
|
|
2724
|
-
data:
|
|
2632
|
+
data: a.value,
|
|
2725
2633
|
path: n.path,
|
|
2726
2634
|
parent: n
|
|
2727
2635
|
});
|
|
2728
2636
|
}
|
|
2729
2637
|
}
|
|
2730
2638
|
static create(e, s) {
|
|
2731
|
-
return new
|
|
2639
|
+
return new Ce({
|
|
2732
2640
|
in: e,
|
|
2733
2641
|
out: s,
|
|
2734
2642
|
typeName: m.ZodPipeline
|
|
2735
2643
|
});
|
|
2736
2644
|
}
|
|
2737
2645
|
}
|
|
2738
|
-
class
|
|
2646
|
+
class Re extends y {
|
|
2739
2647
|
_parse(e) {
|
|
2740
|
-
const s = this._def.innerType._parse(e), n = (
|
|
2741
|
-
return
|
|
2648
|
+
const s = this._def.innerType._parse(e), n = (a) => (V(a) && (a.value = Object.freeze(a.value)), a);
|
|
2649
|
+
return te(s) ? s.then((a) => n(a)) : n(s);
|
|
2742
2650
|
}
|
|
2743
2651
|
unwrap() {
|
|
2744
2652
|
return this._def.innerType;
|
|
2745
2653
|
}
|
|
2746
2654
|
}
|
|
2747
|
-
|
|
2655
|
+
Re.create = (t, e) => new Re({
|
|
2748
2656
|
innerType: t,
|
|
2749
2657
|
typeName: m.ZodReadonly,
|
|
2750
|
-
...
|
|
2658
|
+
...g(e)
|
|
2751
2659
|
});
|
|
2752
|
-
|
|
2753
|
-
return t ? J.create().superRefine((n, r) => {
|
|
2754
|
-
var a, i;
|
|
2755
|
-
if (!t(n)) {
|
|
2756
|
-
const o = typeof e == "function" ? e(n) : typeof e == "string" ? { message: e } : e, d = (i = (a = o.fatal) !== null && a !== void 0 ? a : s) !== null && i !== void 0 ? i : !0, u = typeof o == "string" ? { message: o } : o;
|
|
2757
|
-
r.addIssue({ code: "custom", ...u, fatal: d });
|
|
2758
|
-
}
|
|
2759
|
-
}) : J.create();
|
|
2760
|
-
}
|
|
2761
|
-
const wt = {
|
|
2762
|
-
object: b.lazycreate
|
|
2763
|
-
};
|
|
2660
|
+
w.lazycreate;
|
|
2764
2661
|
var m;
|
|
2765
2662
|
(function(t) {
|
|
2766
2663
|
t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
|
|
2767
2664
|
})(m || (m = {}));
|
|
2768
|
-
const
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
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
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
ZodError: E
|
|
2665
|
+
const x = E.create, Pe = B.create;
|
|
2666
|
+
Se.create;
|
|
2667
|
+
z.create;
|
|
2668
|
+
const U = de.create;
|
|
2669
|
+
X.create;
|
|
2670
|
+
le.create;
|
|
2671
|
+
fe.create;
|
|
2672
|
+
he.create;
|
|
2673
|
+
me.create;
|
|
2674
|
+
const ie = pe.create;
|
|
2675
|
+
Z.create;
|
|
2676
|
+
ge.create;
|
|
2677
|
+
const _t = A.create, ce = w.create;
|
|
2678
|
+
w.strictCreate;
|
|
2679
|
+
se.create;
|
|
2680
|
+
ne.create;
|
|
2681
|
+
P.create;
|
|
2682
|
+
const vt = ae.create;
|
|
2683
|
+
_e.create;
|
|
2684
|
+
D.create;
|
|
2685
|
+
ve.create;
|
|
2686
|
+
const b = xe.create;
|
|
2687
|
+
G.create;
|
|
2688
|
+
be.create;
|
|
2689
|
+
re.create;
|
|
2690
|
+
j.create;
|
|
2691
|
+
M.create;
|
|
2692
|
+
Q.create;
|
|
2693
|
+
j.createWithPreprocess;
|
|
2694
|
+
const k = ce({
|
|
2695
|
+
type: b("qp-bridge"),
|
|
2696
|
+
id: x().optional()
|
|
2697
|
+
}), xt = k.extend({
|
|
2698
|
+
status: b("answerChanged"),
|
|
2699
|
+
question: x(),
|
|
2700
|
+
answer: ie()
|
|
2701
|
+
}), bt = k.extend({
|
|
2702
|
+
action: b("commandExecuted"),
|
|
2703
|
+
commandName: x()
|
|
2704
|
+
}), kt = k.extend({
|
|
2705
|
+
action: b("questionnaireLoaded")
|
|
2706
|
+
}), F = k.extend({
|
|
2707
|
+
status: b("success")
|
|
2708
|
+
}), wt = k.extend({
|
|
2709
|
+
status: b("error"),
|
|
2710
|
+
message: x()
|
|
2711
|
+
}), $e = ce({
|
|
2712
|
+
semanticColor: x().optional(),
|
|
2713
|
+
label: x(),
|
|
2714
|
+
description: x(),
|
|
2715
|
+
disabled: U(),
|
|
2716
|
+
required: U(),
|
|
2717
|
+
hidden: U(),
|
|
2718
|
+
errorMessage: x().optional(),
|
|
2719
|
+
answer: ie().optional()
|
|
2720
|
+
}), St = $e.partial(), Rt = ce({
|
|
2721
|
+
id: x().uuid(),
|
|
2722
|
+
name: x(),
|
|
2723
|
+
mimeType: x(),
|
|
2724
|
+
blobUrl: x()
|
|
2725
|
+
}), Te = vt(ie()), Le = ce({
|
|
2726
|
+
label: x(),
|
|
2727
|
+
hidden: U(),
|
|
2728
|
+
collapsed: U()
|
|
2729
|
+
}), Ct = Le.partial(), Tt = k.extend({
|
|
2730
|
+
action: b("getQuestion"),
|
|
2731
|
+
question: x()
|
|
2732
|
+
}), At = F.extend({
|
|
2733
|
+
question: $e
|
|
2734
|
+
}), Nt = k.extend({
|
|
2735
|
+
action: b("setQuestion"),
|
|
2736
|
+
question: x(),
|
|
2737
|
+
questionData: St
|
|
2738
|
+
}), Et = k.extend({
|
|
2739
|
+
action: b("getGroup"),
|
|
2740
|
+
group: x()
|
|
2741
|
+
}), Ot = F.extend({
|
|
2742
|
+
group: Le
|
|
2743
|
+
}), It = F.extend({
|
|
2744
|
+
canSave: U()
|
|
2745
|
+
}), Mt = k.extend({
|
|
2746
|
+
action: b("canSave")
|
|
2747
|
+
}), Zt = k.extend({
|
|
2748
|
+
action: b("setGroup"),
|
|
2749
|
+
group: x(),
|
|
2750
|
+
groupData: Ct
|
|
2751
|
+
}), jt = k.extend({
|
|
2752
|
+
action: b("setAnswer"),
|
|
2753
|
+
question: x(),
|
|
2754
|
+
answer: ie()
|
|
2755
|
+
}), qt = k.extend({
|
|
2756
|
+
action: b("busyIndicatorStart")
|
|
2757
|
+
}), Pt = k.extend({
|
|
2758
|
+
action: b("busyIndicatorEnd")
|
|
2759
|
+
}), $t = k.extend({
|
|
2760
|
+
action: b("saveQuestionnaire")
|
|
2761
|
+
}), Lt = k.extend({
|
|
2762
|
+
action: b("completeAndCloseQuestionnaire")
|
|
2763
|
+
}), Ut = k.extend({
|
|
2764
|
+
action: b("executeCustomCommand"),
|
|
2765
|
+
commandName: x()
|
|
2766
|
+
}), Vt = k.extend({
|
|
2767
|
+
action: b("fetchEntities"),
|
|
2768
|
+
fetchXml: x()
|
|
2769
|
+
}), Bt = F.extend({
|
|
2770
|
+
entities: _t(Te)
|
|
2771
|
+
}), zt = k.extend({
|
|
2772
|
+
action: b("getEntityById"),
|
|
2773
|
+
entityName: x(),
|
|
2774
|
+
entityId: x()
|
|
2775
|
+
}), Dt = F.extend({
|
|
2776
|
+
entity: Te
|
|
2777
|
+
}), Gt = k.extend({
|
|
2778
|
+
action: b("saveEntity"),
|
|
2779
|
+
entity: Te
|
|
2780
|
+
}), Qt = k.extend({
|
|
2781
|
+
action: b("repeatGroup"),
|
|
2782
|
+
parentGroupName: x(),
|
|
2783
|
+
groupIndex: Pe()
|
|
2784
|
+
}), Ft = k.extend({
|
|
2785
|
+
action: b("addNewGroup"),
|
|
2786
|
+
groupName: x()
|
|
2787
|
+
}), Wt = k.extend({
|
|
2788
|
+
action: b("deleteGroup"),
|
|
2789
|
+
parentGroupName: x(),
|
|
2790
|
+
groupIndex: Pe()
|
|
2895
2791
|
});
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
id: h.string().optional()
|
|
2899
|
-
}), as = w.extend({
|
|
2900
|
-
status: h.literal("answerChanged"),
|
|
2901
|
-
question: h.string(),
|
|
2902
|
-
answer: h.unknown()
|
|
2903
|
-
}), K = w.extend({
|
|
2904
|
-
status: h.literal("success")
|
|
2905
|
-
}), is = w.extend({
|
|
2906
|
-
status: h.literal("error"),
|
|
2907
|
-
message: h.string()
|
|
2908
|
-
}), Ye = h.object({
|
|
2909
|
-
semanticColor: h.string().optional(),
|
|
2910
|
-
label: h.string(),
|
|
2911
|
-
description: h.string(),
|
|
2912
|
-
disabled: h.boolean(),
|
|
2913
|
-
required: h.boolean(),
|
|
2914
|
-
hidden: h.boolean(),
|
|
2915
|
-
errorMessage: h.string().optional(),
|
|
2916
|
-
answer: h.unknown().optional()
|
|
2917
|
-
}), os = Ye.partial(), cs = h.object({
|
|
2918
|
-
id: h.string().uuid(),
|
|
2919
|
-
name: h.string(),
|
|
2920
|
-
mimeType: h.string(),
|
|
2921
|
-
blobUrl: h.string()
|
|
2922
|
-
}), Ae = h.record(h.unknown()), Je = h.object({
|
|
2923
|
-
label: h.string(),
|
|
2924
|
-
hidden: h.boolean(),
|
|
2925
|
-
collapsed: h.boolean()
|
|
2926
|
-
}), us = Je.partial(), ds = w.extend({
|
|
2927
|
-
action: h.literal("getQuestion"),
|
|
2928
|
-
question: h.string()
|
|
2929
|
-
}), ls = K.extend({
|
|
2930
|
-
question: Ye
|
|
2931
|
-
}), fs = w.extend({
|
|
2932
|
-
action: h.literal("setQuestion"),
|
|
2933
|
-
question: h.string(),
|
|
2934
|
-
questionData: os
|
|
2935
|
-
}), hs = w.extend({
|
|
2936
|
-
action: h.literal("getGroup"),
|
|
2937
|
-
group: h.string()
|
|
2938
|
-
}), ps = K.extend({
|
|
2939
|
-
group: Je
|
|
2940
|
-
}), ms = K.extend({
|
|
2941
|
-
canSave: h.boolean()
|
|
2942
|
-
}), gs = w.extend({
|
|
2943
|
-
action: h.literal("canSave")
|
|
2944
|
-
}), ys = w.extend({
|
|
2945
|
-
action: h.literal("setGroup"),
|
|
2946
|
-
group: h.string(),
|
|
2947
|
-
groupData: us
|
|
2948
|
-
}), vs = w.extend({
|
|
2949
|
-
action: h.literal("setAnswer"),
|
|
2950
|
-
question: h.string(),
|
|
2951
|
-
answer: h.unknown()
|
|
2952
|
-
}), _s = w.extend({
|
|
2953
|
-
action: h.literal("busyIndicatorStart")
|
|
2954
|
-
}), xs = w.extend({
|
|
2955
|
-
action: h.literal("busyIndicatorEnd")
|
|
2956
|
-
}), bs = w.extend({
|
|
2957
|
-
action: h.literal("saveQuestionnaire")
|
|
2958
|
-
}), ws = w.extend({
|
|
2959
|
-
action: h.literal("completeAndCloseQuestionnaire")
|
|
2960
|
-
}), ks = w.extend({
|
|
2961
|
-
action: h.literal("executeCustomCommand"),
|
|
2962
|
-
commandName: h.string()
|
|
2963
|
-
}), Ss = w.extend({
|
|
2964
|
-
action: h.literal("fetchEntities"),
|
|
2965
|
-
fetchXml: h.string()
|
|
2966
|
-
}), Ts = K.extend({
|
|
2967
|
-
entities: h.array(Ae)
|
|
2968
|
-
}), Rs = w.extend({
|
|
2969
|
-
action: h.literal("getEntityById"),
|
|
2970
|
-
entityName: h.string(),
|
|
2971
|
-
entityId: h.string()
|
|
2972
|
-
}), Es = K.extend({
|
|
2973
|
-
entity: Ae
|
|
2974
|
-
}), Cs = w.extend({
|
|
2975
|
-
action: h.literal("saveEntity"),
|
|
2976
|
-
entity: Ae
|
|
2977
|
-
}), Zs = w.extend({
|
|
2978
|
-
action: h.literal("repeatGroup"),
|
|
2979
|
-
parentGroupName: h.string(),
|
|
2980
|
-
groupIndex: h.number()
|
|
2981
|
-
}), Ns = w.extend({
|
|
2982
|
-
action: h.literal("addNewGroup"),
|
|
2983
|
-
groupName: h.string()
|
|
2984
|
-
}), Ms = w.extend({
|
|
2985
|
-
action: h.literal("deleteGroup"),
|
|
2986
|
-
parentGroupName: h.string(),
|
|
2987
|
-
groupIndex: h.number()
|
|
2988
|
-
});
|
|
2989
|
-
function Hs(t) {
|
|
2990
|
-
return cs.safeParse(t).success;
|
|
2792
|
+
function hs(t) {
|
|
2793
|
+
return Rt.safeParse(t).success;
|
|
2991
2794
|
}
|
|
2992
|
-
function
|
|
2993
|
-
return
|
|
2795
|
+
function Ht(t) {
|
|
2796
|
+
return xt.safeParse(t).success;
|
|
2994
2797
|
}
|
|
2995
|
-
function
|
|
2996
|
-
return
|
|
2798
|
+
function Jt(t) {
|
|
2799
|
+
return bt.safeParse(t).success;
|
|
2997
2800
|
}
|
|
2998
|
-
function
|
|
2999
|
-
return
|
|
2801
|
+
function Yt(t) {
|
|
2802
|
+
return kt.safeParse(t).success;
|
|
3000
2803
|
}
|
|
3001
|
-
function
|
|
3002
|
-
return
|
|
2804
|
+
function Ue(t) {
|
|
2805
|
+
return k.safeParse(t).success;
|
|
3003
2806
|
}
|
|
3004
|
-
function
|
|
3005
|
-
return
|
|
2807
|
+
function Xt(t) {
|
|
2808
|
+
return F.safeParse(t).success;
|
|
3006
2809
|
}
|
|
3007
|
-
function
|
|
3008
|
-
return
|
|
2810
|
+
function Kt(t) {
|
|
2811
|
+
return wt.safeParse(t).success;
|
|
3009
2812
|
}
|
|
3010
|
-
function
|
|
3011
|
-
return
|
|
2813
|
+
function ms(t) {
|
|
2814
|
+
return Tt.safeParse(t).success;
|
|
3012
2815
|
}
|
|
3013
|
-
function
|
|
3014
|
-
return
|
|
2816
|
+
function es(t) {
|
|
2817
|
+
return At.safeParse(t).success;
|
|
3015
2818
|
}
|
|
3016
|
-
function
|
|
3017
|
-
return
|
|
2819
|
+
function ps(t) {
|
|
2820
|
+
return jt.safeParse(t).success;
|
|
3018
2821
|
}
|
|
3019
|
-
function
|
|
3020
|
-
return
|
|
2822
|
+
function gs(t) {
|
|
2823
|
+
return Nt.safeParse(t).success;
|
|
3021
2824
|
}
|
|
3022
|
-
function
|
|
3023
|
-
return
|
|
2825
|
+
function ys(t) {
|
|
2826
|
+
return Zt.safeParse(t).success;
|
|
3024
2827
|
}
|
|
3025
|
-
function
|
|
3026
|
-
return
|
|
2828
|
+
function _s(t) {
|
|
2829
|
+
return Et.safeParse(t).success;
|
|
3027
2830
|
}
|
|
3028
|
-
function
|
|
3029
|
-
return
|
|
2831
|
+
function ts(t) {
|
|
2832
|
+
return Ot.safeParse(t).success;
|
|
3030
2833
|
}
|
|
3031
|
-
function
|
|
3032
|
-
return
|
|
2834
|
+
function vs(t) {
|
|
2835
|
+
return It.safeParse(t).success;
|
|
3033
2836
|
}
|
|
3034
|
-
function
|
|
3035
|
-
return
|
|
2837
|
+
function ss(t) {
|
|
2838
|
+
return Mt.safeParse(t).success;
|
|
3036
2839
|
}
|
|
3037
|
-
function
|
|
3038
|
-
return
|
|
2840
|
+
function ns(t) {
|
|
2841
|
+
return qt.safeParse(t).success;
|
|
3039
2842
|
}
|
|
3040
|
-
function
|
|
3041
|
-
return
|
|
2843
|
+
function as(t) {
|
|
2844
|
+
return Pt.safeParse(t).success;
|
|
3042
2845
|
}
|
|
3043
|
-
function
|
|
3044
|
-
return
|
|
2846
|
+
function xs(t) {
|
|
2847
|
+
return $t.safeParse(t).success;
|
|
3045
2848
|
}
|
|
3046
|
-
function
|
|
3047
|
-
return
|
|
2849
|
+
function bs(t) {
|
|
2850
|
+
return Lt.safeParse(t).success;
|
|
3048
2851
|
}
|
|
3049
|
-
function
|
|
3050
|
-
return
|
|
2852
|
+
function ks(t) {
|
|
2853
|
+
return Ut.safeParse(t).success;
|
|
3051
2854
|
}
|
|
3052
|
-
function
|
|
3053
|
-
return
|
|
2855
|
+
function ws(t) {
|
|
2856
|
+
return ns(t) || as(t);
|
|
3054
2857
|
}
|
|
3055
|
-
function
|
|
3056
|
-
return
|
|
2858
|
+
function rs(t, e) {
|
|
2859
|
+
return !Ue(t) || t.id !== e || !("status" in t);
|
|
3057
2860
|
}
|
|
3058
|
-
function
|
|
3059
|
-
return
|
|
2861
|
+
function Ss(t) {
|
|
2862
|
+
return Vt.safeParse(t).success;
|
|
3060
2863
|
}
|
|
3061
|
-
function
|
|
3062
|
-
return
|
|
2864
|
+
function is(t) {
|
|
2865
|
+
return Bt.safeParse(t).success;
|
|
2866
|
+
}
|
|
2867
|
+
function Rs(t) {
|
|
2868
|
+
return zt.safeParse(t).success;
|
|
3063
2869
|
}
|
|
3064
|
-
function
|
|
3065
|
-
return
|
|
2870
|
+
function cs(t) {
|
|
2871
|
+
return Dt.safeParse(t).success;
|
|
3066
2872
|
}
|
|
3067
|
-
function
|
|
3068
|
-
return
|
|
2873
|
+
function Cs(t) {
|
|
2874
|
+
return Gt.safeParse(t).success;
|
|
3069
2875
|
}
|
|
3070
|
-
function
|
|
3071
|
-
return
|
|
2876
|
+
function Ts(t) {
|
|
2877
|
+
return Qt.safeParse(t).success;
|
|
2878
|
+
}
|
|
2879
|
+
function As(t) {
|
|
2880
|
+
return Ft.safeParse(t).success;
|
|
3072
2881
|
}
|
|
3073
|
-
function
|
|
3074
|
-
return
|
|
2882
|
+
function Ns(t) {
|
|
2883
|
+
return Wt.safeParse(t).success;
|
|
3075
2884
|
}
|
|
3076
|
-
function
|
|
2885
|
+
function Ve(t) {
|
|
3077
2886
|
if (t instanceof File || t instanceof Blob)
|
|
3078
2887
|
return URL.createObjectURL(t);
|
|
3079
2888
|
if (typeof t == "string") {
|
|
3080
2889
|
if (/^data:/.test(t)) {
|
|
3081
|
-
const
|
|
3082
|
-
if (
|
|
3083
|
-
const i =
|
|
3084
|
-
for (let
|
|
3085
|
-
|
|
3086
|
-
const
|
|
3087
|
-
return URL.createObjectURL(
|
|
2890
|
+
const r = t.match(/^data:([^;]+);base64,(.*)$/);
|
|
2891
|
+
if (r) {
|
|
2892
|
+
const i = r[1], c = r[2], f = atob(c), h = new ArrayBuffer(f.length), _ = new Uint8Array(h);
|
|
2893
|
+
for (let $ = 0; $ < f.length; $++)
|
|
2894
|
+
_[$] = f.charCodeAt($);
|
|
2895
|
+
const q = new Blob([h], { type: i });
|
|
2896
|
+
return URL.createObjectURL(q);
|
|
3088
2897
|
}
|
|
3089
2898
|
throw new Error("Invalid data URL format. Only base64 data URLs are supported.");
|
|
3090
2899
|
}
|
|
3091
2900
|
const e = atob(t), s = new ArrayBuffer(e.length), n = new Uint8Array(s);
|
|
3092
|
-
for (let
|
|
3093
|
-
n[
|
|
3094
|
-
const
|
|
3095
|
-
return URL.createObjectURL(
|
|
2901
|
+
for (let r = 0; r < e.length; r++)
|
|
2902
|
+
n[r] = e.charCodeAt(r);
|
|
2903
|
+
const a = new Blob([s]);
|
|
2904
|
+
return URL.createObjectURL(a);
|
|
3096
2905
|
}
|
|
3097
2906
|
if (t instanceof ArrayBuffer) {
|
|
3098
2907
|
const e = new Blob([t]);
|
|
@@ -3100,24 +2909,24 @@ function Ke(t) {
|
|
|
3100
2909
|
}
|
|
3101
2910
|
throw new Error("Unsupported content type for blobUrl");
|
|
3102
2911
|
}
|
|
3103
|
-
function
|
|
2912
|
+
function Es(t, e, s, n) {
|
|
3104
2913
|
return {
|
|
3105
|
-
id: n ??
|
|
2914
|
+
id: n ?? Me(),
|
|
3106
2915
|
name: t,
|
|
3107
2916
|
mimeType: e,
|
|
3108
|
-
blobUrl:
|
|
2917
|
+
blobUrl: Ve(s)
|
|
3109
2918
|
};
|
|
3110
2919
|
}
|
|
3111
|
-
function
|
|
2920
|
+
function Os(t, e) {
|
|
3112
2921
|
let s = t.blobUrl;
|
|
3113
|
-
return e.content !== void 0 && (s =
|
|
2922
|
+
return e.content !== void 0 && (s = Ve(e.content)), {
|
|
3114
2923
|
...t,
|
|
3115
2924
|
...e,
|
|
3116
2925
|
blobUrl: s
|
|
3117
2926
|
};
|
|
3118
2927
|
}
|
|
3119
|
-
window.addEventListener("message",
|
|
3120
|
-
async function
|
|
2928
|
+
window.addEventListener("message", os);
|
|
2929
|
+
async function Is(t, e) {
|
|
3121
2930
|
await C({
|
|
3122
2931
|
type: "qp-bridge",
|
|
3123
2932
|
action: "setAnswer",
|
|
@@ -3125,14 +2934,14 @@ async function pn(t, e) {
|
|
|
3125
2934
|
answer: e
|
|
3126
2935
|
});
|
|
3127
2936
|
}
|
|
3128
|
-
async function
|
|
3129
|
-
return await
|
|
2937
|
+
async function Ms(t) {
|
|
2938
|
+
return await us({
|
|
3130
2939
|
type: "qp-bridge",
|
|
3131
2940
|
action: "getQuestion",
|
|
3132
2941
|
question: t
|
|
3133
2942
|
});
|
|
3134
2943
|
}
|
|
3135
|
-
async function
|
|
2944
|
+
async function Zs(t, e) {
|
|
3136
2945
|
await C({
|
|
3137
2946
|
type: "qp-bridge",
|
|
3138
2947
|
action: "setQuestion",
|
|
@@ -3140,14 +2949,14 @@ async function gn(t, e) {
|
|
|
3140
2949
|
questionData: e
|
|
3141
2950
|
});
|
|
3142
2951
|
}
|
|
3143
|
-
async function
|
|
3144
|
-
return await
|
|
2952
|
+
async function js(t) {
|
|
2953
|
+
return await ds({
|
|
3145
2954
|
type: "qp-bridge",
|
|
3146
2955
|
action: "getGroup",
|
|
3147
2956
|
group: t
|
|
3148
2957
|
});
|
|
3149
2958
|
}
|
|
3150
|
-
async function
|
|
2959
|
+
async function qs(t, e) {
|
|
3151
2960
|
await C({
|
|
3152
2961
|
type: "qp-bridge",
|
|
3153
2962
|
action: "setGroup",
|
|
@@ -3155,9 +2964,9 @@ async function vn(t, e) {
|
|
|
3155
2964
|
groupData: e
|
|
3156
2965
|
});
|
|
3157
2966
|
}
|
|
3158
|
-
function
|
|
2967
|
+
function Ps(t) {
|
|
3159
2968
|
const e = (s) => {
|
|
3160
|
-
|
|
2969
|
+
Ht(s.data) && t(s.data.question, s.data.answer);
|
|
3161
2970
|
};
|
|
3162
2971
|
return window.addEventListener("message", e), {
|
|
3163
2972
|
cancelSubscription: () => {
|
|
@@ -3165,7 +2974,7 @@ function _n(t) {
|
|
|
3165
2974
|
}
|
|
3166
2975
|
};
|
|
3167
2976
|
}
|
|
3168
|
-
async function
|
|
2977
|
+
async function $s(t) {
|
|
3169
2978
|
await C({
|
|
3170
2979
|
type: "qp-bridge",
|
|
3171
2980
|
action: "busyIndicatorStart"
|
|
@@ -3179,38 +2988,54 @@ async function xn(t) {
|
|
|
3179
2988
|
});
|
|
3180
2989
|
}
|
|
3181
2990
|
}
|
|
3182
|
-
async function
|
|
2991
|
+
async function Ls() {
|
|
3183
2992
|
await C({
|
|
3184
2993
|
type: "qp-bridge",
|
|
3185
2994
|
action: "saveQuestionnaire"
|
|
3186
2995
|
});
|
|
3187
2996
|
}
|
|
3188
|
-
async function
|
|
2997
|
+
async function Us() {
|
|
3189
2998
|
await C({
|
|
3190
2999
|
type: "qp-bridge",
|
|
3191
3000
|
action: "completeAndCloseQuestionnaire"
|
|
3192
3001
|
});
|
|
3193
3002
|
}
|
|
3194
|
-
async function
|
|
3003
|
+
async function Vs(t) {
|
|
3195
3004
|
await C({
|
|
3196
3005
|
type: "qp-bridge",
|
|
3197
3006
|
action: "executeCustomCommand",
|
|
3198
3007
|
commandName: t
|
|
3199
3008
|
});
|
|
3200
3009
|
}
|
|
3201
|
-
const
|
|
3202
|
-
function
|
|
3203
|
-
return
|
|
3010
|
+
const H = [], J = [], Y = [];
|
|
3011
|
+
function Bs(t) {
|
|
3012
|
+
return Y.includes(t) || Y.push(t), {
|
|
3013
|
+
cancelSubscription: () => {
|
|
3014
|
+
const e = Y.indexOf(t);
|
|
3015
|
+
e !== -1 && Y.splice(e, 1);
|
|
3016
|
+
}
|
|
3017
|
+
};
|
|
3018
|
+
}
|
|
3019
|
+
function zs(t) {
|
|
3020
|
+
return J.includes(t) || J.push(t), {
|
|
3204
3021
|
cancelSubscription: () => {
|
|
3205
|
-
const e =
|
|
3206
|
-
e !== -1 &&
|
|
3022
|
+
const e = J.indexOf(t);
|
|
3023
|
+
e !== -1 && J.splice(e, 1);
|
|
3207
3024
|
}
|
|
3208
3025
|
};
|
|
3209
3026
|
}
|
|
3210
|
-
|
|
3027
|
+
function Ds(t) {
|
|
3028
|
+
return H.includes(t) || H.push(t), {
|
|
3029
|
+
cancelSubscription: () => {
|
|
3030
|
+
const e = H.indexOf(t);
|
|
3031
|
+
e !== -1 && H.splice(e, 1);
|
|
3032
|
+
}
|
|
3033
|
+
};
|
|
3034
|
+
}
|
|
3035
|
+
async function os(t) {
|
|
3211
3036
|
try {
|
|
3212
|
-
if (
|
|
3213
|
-
const e = await Promise.all(
|
|
3037
|
+
if (Jt(t.data) && J.forEach((e) => e(t.data.commandName)), Yt(t.data) && Y.forEach((e) => e()), ss(t.data)) {
|
|
3038
|
+
const e = await Promise.all(H.map((n) => n())), s = {
|
|
3214
3039
|
type: "qp-bridge",
|
|
3215
3040
|
status: "success",
|
|
3216
3041
|
id: t.data.id,
|
|
@@ -3222,38 +3047,38 @@ async function Bs(t) {
|
|
|
3222
3047
|
const s = {
|
|
3223
3048
|
type: "qp-bridge",
|
|
3224
3049
|
status: "error",
|
|
3225
|
-
id:
|
|
3050
|
+
id: Ue(t.data) ? t.data.id : void 0,
|
|
3226
3051
|
message: e instanceof Error ? e.message : "Unknown error"
|
|
3227
3052
|
};
|
|
3228
3053
|
window.parent.postMessage(s, "*");
|
|
3229
3054
|
}
|
|
3230
3055
|
}
|
|
3231
|
-
async function
|
|
3232
|
-
return await
|
|
3056
|
+
async function Gs(t) {
|
|
3057
|
+
return await ls({
|
|
3233
3058
|
type: "qp-bridge",
|
|
3234
3059
|
action: "fetchEntities",
|
|
3235
3060
|
fetchXml: t
|
|
3236
3061
|
});
|
|
3237
3062
|
}
|
|
3238
|
-
async function
|
|
3239
|
-
return await
|
|
3063
|
+
async function Qs(t, e) {
|
|
3064
|
+
return await fs({
|
|
3240
3065
|
type: "qp-bridge",
|
|
3241
3066
|
action: "getEntityById",
|
|
3242
3067
|
entityName: t,
|
|
3243
3068
|
entityId: e
|
|
3244
3069
|
});
|
|
3245
3070
|
}
|
|
3246
|
-
function
|
|
3071
|
+
function Fs() {
|
|
3247
3072
|
return { isNew: !0 };
|
|
3248
3073
|
}
|
|
3249
|
-
async function
|
|
3074
|
+
async function Ws(t) {
|
|
3250
3075
|
await C({
|
|
3251
3076
|
type: "qp-bridge",
|
|
3252
3077
|
action: "saveEntity",
|
|
3253
3078
|
entity: t
|
|
3254
3079
|
});
|
|
3255
3080
|
}
|
|
3256
|
-
async function
|
|
3081
|
+
async function Hs(t, e) {
|
|
3257
3082
|
await C({
|
|
3258
3083
|
type: "qp-bridge",
|
|
3259
3084
|
action: "repeatGroup",
|
|
@@ -3261,14 +3086,14 @@ async function Zn(t, e) {
|
|
|
3261
3086
|
groupIndex: e
|
|
3262
3087
|
});
|
|
3263
3088
|
}
|
|
3264
|
-
async function
|
|
3089
|
+
async function Js(t) {
|
|
3265
3090
|
await C({
|
|
3266
3091
|
type: "qp-bridge",
|
|
3267
3092
|
action: "addNewGroup",
|
|
3268
3093
|
groupName: t
|
|
3269
3094
|
});
|
|
3270
3095
|
}
|
|
3271
|
-
async function
|
|
3096
|
+
async function Ys(t, e) {
|
|
3272
3097
|
await C({
|
|
3273
3098
|
type: "qp-bridge",
|
|
3274
3099
|
action: "deleteGroup",
|
|
@@ -3276,112 +3101,118 @@ async function Mn(t, e) {
|
|
|
3276
3101
|
groupIndex: e
|
|
3277
3102
|
});
|
|
3278
3103
|
}
|
|
3279
|
-
async function
|
|
3104
|
+
async function K(t, e) {
|
|
3280
3105
|
return new Promise((s, n) => {
|
|
3281
|
-
const
|
|
3282
|
-
if (
|
|
3106
|
+
const a = Me(), r = (i) => {
|
|
3107
|
+
if (rs(i.data, a))
|
|
3283
3108
|
return;
|
|
3284
|
-
const
|
|
3285
|
-
|
|
3109
|
+
const c = e(i.data);
|
|
3110
|
+
c.success ? s(c.data) : Kt(i.data) ? n(new Error(i.data.message)) : n(new Error("Unknown message received")), window.removeEventListener("message", r);
|
|
3286
3111
|
};
|
|
3287
|
-
window.addEventListener("message",
|
|
3112
|
+
window.addEventListener("message", r), window.parent.postMessage({ ...t, id: a }, "*");
|
|
3288
3113
|
});
|
|
3289
3114
|
}
|
|
3290
|
-
async function
|
|
3291
|
-
return
|
|
3115
|
+
async function us(t) {
|
|
3116
|
+
return K(t, (e) => es(e) ? { success: !0, data: e.question } : { success: !1 });
|
|
3292
3117
|
}
|
|
3293
|
-
async function
|
|
3294
|
-
return
|
|
3118
|
+
async function ds(t) {
|
|
3119
|
+
return K(t, (e) => ts(e) ? { success: !0, data: e.group } : { success: !1 });
|
|
3295
3120
|
}
|
|
3296
3121
|
function C(t) {
|
|
3297
|
-
return
|
|
3122
|
+
return K(t, (e) => Xt(e) ? { success: !0, data: void 0 } : { success: !1 });
|
|
3298
3123
|
}
|
|
3299
|
-
async function
|
|
3300
|
-
return
|
|
3124
|
+
async function ls(t) {
|
|
3125
|
+
return K(t, (e) => is(e) ? { success: !0, data: e.entities } : { success: !1 });
|
|
3301
3126
|
}
|
|
3302
|
-
async function
|
|
3303
|
-
return
|
|
3127
|
+
async function fs(t) {
|
|
3128
|
+
return K(t, (e) => cs(e) ? { success: !0, data: e.entity } : { success: !1 });
|
|
3304
3129
|
}
|
|
3305
3130
|
export {
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
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
|
-
|
|
3131
|
+
Js as addNewGroup,
|
|
3132
|
+
Ft as addNewGroupRequestMessageSchema,
|
|
3133
|
+
Pt as busyIndicatorEndRequestMessageSchema,
|
|
3134
|
+
qt as busyIndicatorStartRequestMessageSchema,
|
|
3135
|
+
Mt as canSaveRequestMessageSchema,
|
|
3136
|
+
It as canSaveSuccessResponseMessageSchema,
|
|
3137
|
+
bt as commandExecutedMessageSchema,
|
|
3138
|
+
Us as completeAndCloseQuestionnaire,
|
|
3139
|
+
Lt as completeAndCloseQuestionnaireRequestMessageSchema,
|
|
3140
|
+
Es as createMediaItem,
|
|
3141
|
+
Fs as createNewEntity,
|
|
3142
|
+
Ys as deleteGroup,
|
|
3143
|
+
Wt as deleteGroupRequestMessageSchema,
|
|
3144
|
+
Te as entitySchema,
|
|
3145
|
+
Vs as executeCustomCommand,
|
|
3146
|
+
Ut as executeCustomCommandRequestMessageSchema,
|
|
3147
|
+
Gs as fetchEntities,
|
|
3148
|
+
Vt as fetchEntitiesRequestMessageSchema,
|
|
3149
|
+
Bt as fetchEntitiesSuccessResponseMessageSchema,
|
|
3150
|
+
Qs as getEntityById,
|
|
3151
|
+
zt as getEntityByIdRequestMessageSchema,
|
|
3152
|
+
Dt as getEntityByIdSuccessResponseMessageSchema,
|
|
3153
|
+
js as getGroup,
|
|
3154
|
+
Et as getGroupRequestMessageSchema,
|
|
3155
|
+
Ot as getGroupSuccessResponseMessageSchema,
|
|
3156
|
+
Ms as getQuestion,
|
|
3157
|
+
Tt as getQuestionRequestMessageSchema,
|
|
3158
|
+
At as getQuestionSuccessResponseMessageSchema,
|
|
3159
|
+
Ct as groupOptionalScheme,
|
|
3160
|
+
Le as groupSchema,
|
|
3161
|
+
As as isAddNewGroupRequestMessage,
|
|
3162
|
+
as as isBusyIndicatorEndRequestMessage,
|
|
3163
|
+
ns as isBusyIndicatorStartRequestMessage,
|
|
3164
|
+
ss as isCanSaveRequestMessage,
|
|
3165
|
+
vs as isCanSaveSuccessResponseMessage,
|
|
3166
|
+
Jt as isCommandExecutedMessage,
|
|
3167
|
+
bs as isCompleteAndCloseQuestionnaireRequestMessage,
|
|
3168
|
+
Ns as isDeleteGroupRequestMessage,
|
|
3169
|
+
Kt as isErrorMessage,
|
|
3170
|
+
ks as isExecuteCustomCommandRequestMessage,
|
|
3171
|
+
Ss as isFetchEntitiesRequestMessage,
|
|
3172
|
+
is as isFetchEntitiesSuccessResponseMessage,
|
|
3173
|
+
Rs as isGetEntityByIdRequestMessage,
|
|
3174
|
+
cs as isGetEntityByIdSuccessResponseMessage,
|
|
3175
|
+
_s as isGetGroupRequestMessage,
|
|
3176
|
+
ts as isGetGroupSuccessResponseMessage,
|
|
3177
|
+
ms as isGetQuestionRequestMessage,
|
|
3178
|
+
es as isGetQuestionSuccessResponseMessage,
|
|
3179
|
+
hs as isMediaItem,
|
|
3180
|
+
rs as isNotRelevantMessage,
|
|
3181
|
+
Ht as isOnAnswerChangeMessage,
|
|
3182
|
+
Ue as isQpBridgeMessage,
|
|
3183
|
+
Yt as isQuestionnaireLoadedMessage,
|
|
3184
|
+
Ts as isRepeatGroupRequestMessage,
|
|
3185
|
+
Cs as isSaveEntityRequestMessage,
|
|
3186
|
+
xs as isSaveQuestionnaireRequestMessage,
|
|
3187
|
+
ps as isSetAnswerRequestMessage,
|
|
3188
|
+
ys as isSetGroupRequestMessage,
|
|
3189
|
+
gs as isSetQuestionRequestMessage,
|
|
3190
|
+
Xt as isSuccessMessage,
|
|
3191
|
+
ws as isWithBusyIndicatorRequestMessage,
|
|
3192
|
+
Rt as mediaItemSchema,
|
|
3193
|
+
Ps as onAnswerChange,
|
|
3194
|
+
xt as onAnswerChangeMessageSchema,
|
|
3195
|
+
zs as onCommandExecuted,
|
|
3196
|
+
Bs as onQuestionnaireLoaded,
|
|
3197
|
+
Ds as onSave,
|
|
3198
|
+
k as qpBridgeMessageSchema,
|
|
3199
|
+
St as questionOptionalScheme,
|
|
3200
|
+
$e as questionSchema,
|
|
3201
|
+
kt as questionnaireLoadedMessageSchema,
|
|
3202
|
+
Hs as repeatGroup,
|
|
3203
|
+
Qt as repeatGroupRequestMessageSchema,
|
|
3204
|
+
wt as responseErrorMessageSchema,
|
|
3205
|
+
F as responseSuccessMessageSchema,
|
|
3206
|
+
Ws as saveEntity,
|
|
3207
|
+
Gt as saveEntityRequestMessageSchema,
|
|
3208
|
+
Ls as saveQuestionnaire,
|
|
3209
|
+
$t as saveQuestionnaireRequestMessageSchema,
|
|
3210
|
+
Is as setAnswer,
|
|
3211
|
+
jt as setAnswerRequestMessageSchema,
|
|
3212
|
+
qs as setGroup,
|
|
3213
|
+
Zt as setGroupRequestMessageSchema,
|
|
3214
|
+
Zs as setQuestion,
|
|
3215
|
+
Nt as setQuestionRequestMessageSchema,
|
|
3216
|
+
Os as updateMediaItem,
|
|
3217
|
+
$s as withBusyIndicator
|
|
3387
3218
|
};
|