@telemetryos/sdk 1.6.1 → 1.7.1
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/CHANGELOG.md +19 -1
- package/README.md +12 -18
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1242 -1606
- package/dist/react/Settings.d.ts +50 -0
- package/dist/react/hooks.d.ts +6 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/inject-styles.d.ts +1 -0
- package/dist/react.cjs +295 -0
- package/dist/react.js +655 -0
- package/package.json +20 -6
package/dist/index.js
CHANGED
|
@@ -1,48 +1,49 @@
|
|
|
1
|
-
var
|
|
2
|
-
(function(
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
var b;
|
|
2
|
+
(function(n) {
|
|
3
|
+
n.assertEqual = (s) => {
|
|
4
|
+
};
|
|
5
|
+
function e(s) {
|
|
5
6
|
}
|
|
6
|
-
|
|
7
|
-
function t(
|
|
7
|
+
n.assertIs = e;
|
|
8
|
+
function t(s) {
|
|
8
9
|
throw new Error();
|
|
9
10
|
}
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
for (const
|
|
13
|
-
r
|
|
14
|
-
return
|
|
15
|
-
},
|
|
16
|
-
const
|
|
17
|
-
for (const o of
|
|
18
|
-
|
|
19
|
-
return
|
|
20
|
-
},
|
|
21
|
-
return
|
|
22
|
-
}),
|
|
23
|
-
const
|
|
24
|
-
for (const
|
|
25
|
-
Object.prototype.hasOwnProperty.call(
|
|
26
|
-
return
|
|
27
|
-
},
|
|
28
|
-
for (const
|
|
29
|
-
if (r
|
|
30
|
-
return
|
|
31
|
-
},
|
|
32
|
-
function s
|
|
33
|
-
return
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
})(
|
|
37
|
-
var
|
|
38
|
-
(function(
|
|
39
|
-
|
|
11
|
+
n.assertNever = t, n.arrayToEnum = (s) => {
|
|
12
|
+
const i = {};
|
|
13
|
+
for (const r of s)
|
|
14
|
+
i[r] = r;
|
|
15
|
+
return i;
|
|
16
|
+
}, n.getValidEnumValues = (s) => {
|
|
17
|
+
const i = n.objectKeys(s).filter((o) => typeof s[s[o]] != "number"), r = {};
|
|
18
|
+
for (const o of i)
|
|
19
|
+
r[o] = s[o];
|
|
20
|
+
return n.objectValues(r);
|
|
21
|
+
}, n.objectValues = (s) => n.objectKeys(s).map(function(i) {
|
|
22
|
+
return s[i];
|
|
23
|
+
}), n.objectKeys = typeof Object.keys == "function" ? (s) => Object.keys(s) : (s) => {
|
|
24
|
+
const i = [];
|
|
25
|
+
for (const r in s)
|
|
26
|
+
Object.prototype.hasOwnProperty.call(s, r) && i.push(r);
|
|
27
|
+
return i;
|
|
28
|
+
}, n.find = (s, i) => {
|
|
29
|
+
for (const r of s)
|
|
30
|
+
if (i(r))
|
|
31
|
+
return r;
|
|
32
|
+
}, n.isInteger = typeof Number.isInteger == "function" ? (s) => Number.isInteger(s) : (s) => typeof s == "number" && Number.isFinite(s) && Math.floor(s) === s;
|
|
33
|
+
function a(s, i = " | ") {
|
|
34
|
+
return s.map((r) => typeof r == "string" ? `'${r}'` : r).join(i);
|
|
35
|
+
}
|
|
36
|
+
n.joinValues = a, n.jsonStringifyReplacer = (s, i) => typeof i == "bigint" ? i.toString() : i;
|
|
37
|
+
})(b || (b = {}));
|
|
38
|
+
var ye;
|
|
39
|
+
(function(n) {
|
|
40
|
+
n.mergeShapes = (e, t) => ({
|
|
40
41
|
...e,
|
|
41
42
|
...t
|
|
42
43
|
// second overwrites first
|
|
43
44
|
});
|
|
44
|
-
})(
|
|
45
|
-
const
|
|
45
|
+
})(ye || (ye = {}));
|
|
46
|
+
const l = b.arrayToEnum([
|
|
46
47
|
"string",
|
|
47
48
|
"nan",
|
|
48
49
|
"number",
|
|
@@ -63,28 +64,28 @@ const h = w.arrayToEnum([
|
|
|
63
64
|
"never",
|
|
64
65
|
"map",
|
|
65
66
|
"set"
|
|
66
|
-
]),
|
|
67
|
-
switch (typeof
|
|
67
|
+
]), O = (n) => {
|
|
68
|
+
switch (typeof n) {
|
|
68
69
|
case "undefined":
|
|
69
|
-
return
|
|
70
|
+
return l.undefined;
|
|
70
71
|
case "string":
|
|
71
|
-
return
|
|
72
|
+
return l.string;
|
|
72
73
|
case "number":
|
|
73
|
-
return isNaN(
|
|
74
|
+
return Number.isNaN(n) ? l.nan : l.number;
|
|
74
75
|
case "boolean":
|
|
75
|
-
return
|
|
76
|
+
return l.boolean;
|
|
76
77
|
case "function":
|
|
77
|
-
return
|
|
78
|
+
return l.function;
|
|
78
79
|
case "bigint":
|
|
79
|
-
return
|
|
80
|
+
return l.bigint;
|
|
80
81
|
case "symbol":
|
|
81
|
-
return
|
|
82
|
+
return l.symbol;
|
|
82
83
|
case "object":
|
|
83
|
-
return Array.isArray(
|
|
84
|
+
return Array.isArray(n) ? l.array : n === null ? l.null : n.then && typeof n.then == "function" && n.catch && typeof n.catch == "function" ? l.promise : typeof Map < "u" && n instanceof Map ? l.map : typeof Set < "u" && n instanceof Set ? l.set : typeof Date < "u" && n instanceof Date ? l.date : l.object;
|
|
84
85
|
default:
|
|
85
|
-
return
|
|
86
|
+
return l.unknown;
|
|
86
87
|
}
|
|
87
|
-
}, d =
|
|
88
|
+
}, d = b.arrayToEnum([
|
|
88
89
|
"invalid_type",
|
|
89
90
|
"invalid_literal",
|
|
90
91
|
"custom",
|
|
@@ -101,87 +102,91 @@ const h = w.arrayToEnum([
|
|
|
101
102
|
"invalid_intersection_types",
|
|
102
103
|
"not_multiple_of",
|
|
103
104
|
"not_finite"
|
|
104
|
-
])
|
|
105
|
-
|
|
105
|
+
]);
|
|
106
|
+
class C extends Error {
|
|
106
107
|
get errors() {
|
|
107
108
|
return this.issues;
|
|
108
109
|
}
|
|
109
110
|
constructor(e) {
|
|
110
|
-
super(), this.issues = [], this.addIssue = (
|
|
111
|
-
this.issues = [...this.issues,
|
|
112
|
-
}, this.addIssues = (
|
|
113
|
-
this.issues = [...this.issues, ...
|
|
111
|
+
super(), this.issues = [], this.addIssue = (a) => {
|
|
112
|
+
this.issues = [...this.issues, a];
|
|
113
|
+
}, this.addIssues = (a = []) => {
|
|
114
|
+
this.issues = [...this.issues, ...a];
|
|
114
115
|
};
|
|
115
116
|
const t = new.target.prototype;
|
|
116
117
|
Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
|
|
117
118
|
}
|
|
118
119
|
format(e) {
|
|
119
|
-
const t = e || function(
|
|
120
|
-
return
|
|
121
|
-
},
|
|
122
|
-
for (const
|
|
123
|
-
if (
|
|
124
|
-
|
|
125
|
-
else if (
|
|
126
|
-
|
|
127
|
-
else if (
|
|
128
|
-
|
|
129
|
-
else if (
|
|
130
|
-
|
|
120
|
+
const t = e || function(i) {
|
|
121
|
+
return i.message;
|
|
122
|
+
}, a = { _errors: [] }, s = (i) => {
|
|
123
|
+
for (const r of i.issues)
|
|
124
|
+
if (r.code === "invalid_union")
|
|
125
|
+
r.unionErrors.map(s);
|
|
126
|
+
else if (r.code === "invalid_return_type")
|
|
127
|
+
s(r.returnTypeError);
|
|
128
|
+
else if (r.code === "invalid_arguments")
|
|
129
|
+
s(r.argumentsError);
|
|
130
|
+
else if (r.path.length === 0)
|
|
131
|
+
a._errors.push(t(r));
|
|
131
132
|
else {
|
|
132
|
-
let o =
|
|
133
|
-
for (; c <
|
|
134
|
-
const
|
|
135
|
-
c ===
|
|
133
|
+
let o = a, c = 0;
|
|
134
|
+
for (; c < r.path.length; ) {
|
|
135
|
+
const h = r.path[c];
|
|
136
|
+
c === r.path.length - 1 ? (o[h] = o[h] || { _errors: [] }, o[h]._errors.push(t(r))) : o[h] = o[h] || { _errors: [] }, o = o[h], c++;
|
|
136
137
|
}
|
|
137
138
|
}
|
|
138
139
|
};
|
|
139
|
-
return
|
|
140
|
+
return s(this), a;
|
|
140
141
|
}
|
|
141
142
|
static assert(e) {
|
|
142
|
-
if (!(e instanceof
|
|
143
|
+
if (!(e instanceof C))
|
|
143
144
|
throw new Error(`Not a ZodError: ${e}`);
|
|
144
145
|
}
|
|
145
146
|
toString() {
|
|
146
147
|
return this.message;
|
|
147
148
|
}
|
|
148
149
|
get message() {
|
|
149
|
-
return JSON.stringify(this.issues,
|
|
150
|
+
return JSON.stringify(this.issues, b.jsonStringifyReplacer, 2);
|
|
150
151
|
}
|
|
151
152
|
get isEmpty() {
|
|
152
153
|
return this.issues.length === 0;
|
|
153
154
|
}
|
|
154
155
|
flatten(e = (t) => t.message) {
|
|
155
|
-
const t = {},
|
|
156
|
-
for (const
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
const t = {}, a = [];
|
|
157
|
+
for (const s of this.issues)
|
|
158
|
+
if (s.path.length > 0) {
|
|
159
|
+
const i = s.path[0];
|
|
160
|
+
t[i] = t[i] || [], t[i].push(e(s));
|
|
161
|
+
} else
|
|
162
|
+
a.push(e(s));
|
|
163
|
+
return { formErrors: a, fieldErrors: t };
|
|
159
164
|
}
|
|
160
165
|
get formErrors() {
|
|
161
166
|
return this.flatten();
|
|
162
167
|
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
const
|
|
168
|
+
}
|
|
169
|
+
C.create = (n) => new C(n);
|
|
170
|
+
const re = (n, e) => {
|
|
166
171
|
let t;
|
|
167
|
-
switch (
|
|
172
|
+
switch (n.code) {
|
|
168
173
|
case d.invalid_type:
|
|
169
|
-
|
|
174
|
+
n.received === l.undefined ? t = "Required" : t = `Expected ${n.expected}, received ${n.received}`;
|
|
170
175
|
break;
|
|
171
176
|
case d.invalid_literal:
|
|
172
|
-
t = `Invalid literal value, expected ${JSON.stringify(
|
|
177
|
+
t = `Invalid literal value, expected ${JSON.stringify(n.expected, b.jsonStringifyReplacer)}`;
|
|
173
178
|
break;
|
|
174
179
|
case d.unrecognized_keys:
|
|
175
|
-
t = `Unrecognized key(s) in object: ${
|
|
180
|
+
t = `Unrecognized key(s) in object: ${b.joinValues(n.keys, ", ")}`;
|
|
176
181
|
break;
|
|
177
182
|
case d.invalid_union:
|
|
178
183
|
t = "Invalid input";
|
|
179
184
|
break;
|
|
180
185
|
case d.invalid_union_discriminator:
|
|
181
|
-
t = `Invalid discriminator value. Expected ${
|
|
186
|
+
t = `Invalid discriminator value. Expected ${b.joinValues(n.options)}`;
|
|
182
187
|
break;
|
|
183
188
|
case d.invalid_enum_value:
|
|
184
|
-
t = `Invalid enum value. Expected ${
|
|
189
|
+
t = `Invalid enum value. Expected ${b.joinValues(n.options)}, received '${n.received}'`;
|
|
185
190
|
break;
|
|
186
191
|
case d.invalid_arguments:
|
|
187
192
|
t = "Invalid function arguments";
|
|
@@ -193,13 +198,13 @@ const H = (a, e) => {
|
|
|
193
198
|
t = "Invalid date";
|
|
194
199
|
break;
|
|
195
200
|
case d.invalid_string:
|
|
196
|
-
typeof
|
|
201
|
+
typeof n.validation == "object" ? "includes" in n.validation ? (t = `Invalid input: must include "${n.validation.includes}"`, typeof n.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${n.validation.position}`)) : "startsWith" in n.validation ? t = `Invalid input: must start with "${n.validation.startsWith}"` : "endsWith" in n.validation ? t = `Invalid input: must end with "${n.validation.endsWith}"` : b.assertNever(n.validation) : n.validation !== "regex" ? t = `Invalid ${n.validation}` : t = "Invalid";
|
|
197
202
|
break;
|
|
198
203
|
case d.too_small:
|
|
199
|
-
|
|
204
|
+
n.type === "array" ? t = `Array must contain ${n.exact ? "exactly" : n.inclusive ? "at least" : "more than"} ${n.minimum} element(s)` : n.type === "string" ? t = `String must contain ${n.exact ? "exactly" : n.inclusive ? "at least" : "over"} ${n.minimum} character(s)` : n.type === "number" ? t = `Number must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${n.minimum}` : n.type === "bigint" ? t = `Number must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${n.minimum}` : n.type === "date" ? t = `Date must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(n.minimum))}` : t = "Invalid input";
|
|
200
205
|
break;
|
|
201
206
|
case d.too_big:
|
|
202
|
-
|
|
207
|
+
n.type === "array" ? t = `Array must contain ${n.exact ? "exactly" : n.inclusive ? "at most" : "less than"} ${n.maximum} element(s)` : n.type === "string" ? t = `String must contain ${n.exact ? "exactly" : n.inclusive ? "at most" : "under"} ${n.maximum} character(s)` : n.type === "number" ? t = `Number must be ${n.exact ? "exactly" : n.inclusive ? "less than or equal to" : "less than"} ${n.maximum}` : n.type === "bigint" ? t = `BigInt must be ${n.exact ? "exactly" : n.inclusive ? "less than or equal to" : "less than"} ${n.maximum}` : n.type === "date" ? t = `Date must be ${n.exact ? "exactly" : n.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(n.maximum))}` : t = "Invalid input";
|
|
203
208
|
break;
|
|
204
209
|
case d.custom:
|
|
205
210
|
t = "Invalid input";
|
|
@@ -208,63 +213,60 @@ const H = (a, e) => {
|
|
|
208
213
|
t = "Intersection results could not be merged";
|
|
209
214
|
break;
|
|
210
215
|
case d.not_multiple_of:
|
|
211
|
-
t = `Number must be a multiple of ${
|
|
216
|
+
t = `Number must be a multiple of ${n.multipleOf}`;
|
|
212
217
|
break;
|
|
213
218
|
case d.not_finite:
|
|
214
219
|
t = "Number must be finite";
|
|
215
220
|
break;
|
|
216
221
|
default:
|
|
217
|
-
t = e.defaultError,
|
|
222
|
+
t = e.defaultError, b.assertNever(n);
|
|
218
223
|
}
|
|
219
224
|
return { message: t };
|
|
220
225
|
};
|
|
221
|
-
let
|
|
222
|
-
function
|
|
223
|
-
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
const { data: e, path: t, errorMaps: s, issueData: n } = a, r = [...t, ...n.path || []], i = {
|
|
230
|
-
...n,
|
|
231
|
-
path: r
|
|
226
|
+
let Le = re;
|
|
227
|
+
function qe() {
|
|
228
|
+
return Le;
|
|
229
|
+
}
|
|
230
|
+
const De = (n) => {
|
|
231
|
+
const { data: e, path: t, errorMaps: a, issueData: s } = n, i = [...t, ...s.path || []], r = {
|
|
232
|
+
...s,
|
|
233
|
+
path: i
|
|
232
234
|
};
|
|
233
|
-
if (
|
|
235
|
+
if (s.message !== void 0)
|
|
234
236
|
return {
|
|
235
|
-
...
|
|
236
|
-
path:
|
|
237
|
-
message:
|
|
237
|
+
...s,
|
|
238
|
+
path: i,
|
|
239
|
+
message: s.message
|
|
238
240
|
};
|
|
239
241
|
let o = "";
|
|
240
|
-
const c =
|
|
241
|
-
for (const
|
|
242
|
-
o =
|
|
242
|
+
const c = a.filter((h) => !!h).slice().reverse();
|
|
243
|
+
for (const h of c)
|
|
244
|
+
o = h(r, { data: e, defaultError: o }).message;
|
|
243
245
|
return {
|
|
244
|
-
...
|
|
245
|
-
path:
|
|
246
|
+
...s,
|
|
247
|
+
path: i,
|
|
246
248
|
message: o
|
|
247
249
|
};
|
|
248
|
-
}
|
|
249
|
-
function
|
|
250
|
-
const t =
|
|
250
|
+
};
|
|
251
|
+
function u(n, e) {
|
|
252
|
+
const t = qe(), a = De({
|
|
251
253
|
issueData: e,
|
|
252
|
-
data:
|
|
253
|
-
path:
|
|
254
|
+
data: n.data,
|
|
255
|
+
path: n.path,
|
|
254
256
|
errorMaps: [
|
|
255
|
-
|
|
257
|
+
n.common.contextualErrorMap,
|
|
256
258
|
// contextual error map is first priority
|
|
257
|
-
|
|
259
|
+
n.schemaErrorMap,
|
|
258
260
|
// then schema-bound map if available
|
|
259
261
|
t,
|
|
260
262
|
// then global override map
|
|
261
|
-
t ===
|
|
263
|
+
t === re ? void 0 : re
|
|
262
264
|
// then global default map
|
|
263
|
-
].filter((
|
|
265
|
+
].filter((s) => !!s)
|
|
264
266
|
});
|
|
265
|
-
|
|
267
|
+
n.common.issues.push(a);
|
|
266
268
|
}
|
|
267
|
-
let
|
|
269
|
+
let N = class je {
|
|
268
270
|
constructor() {
|
|
269
271
|
this.value = "valid";
|
|
270
272
|
}
|
|
@@ -275,99 +277,89 @@ let S = class Ke {
|
|
|
275
277
|
this.value !== "aborted" && (this.value = "aborted");
|
|
276
278
|
}
|
|
277
279
|
static mergeArray(e, t) {
|
|
278
|
-
const
|
|
279
|
-
for (const
|
|
280
|
-
if (
|
|
281
|
-
return
|
|
282
|
-
|
|
280
|
+
const a = [];
|
|
281
|
+
for (const s of t) {
|
|
282
|
+
if (s.status === "aborted")
|
|
283
|
+
return _;
|
|
284
|
+
s.status === "dirty" && e.dirty(), a.push(s.value);
|
|
283
285
|
}
|
|
284
|
-
return { status: e.value, value:
|
|
286
|
+
return { status: e.value, value: a };
|
|
285
287
|
}
|
|
286
288
|
static async mergeObjectAsync(e, t) {
|
|
287
|
-
const
|
|
288
|
-
for (const
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
-
key:
|
|
292
|
-
value:
|
|
289
|
+
const a = [];
|
|
290
|
+
for (const s of t) {
|
|
291
|
+
const i = await s.key, r = await s.value;
|
|
292
|
+
a.push({
|
|
293
|
+
key: i,
|
|
294
|
+
value: r
|
|
293
295
|
});
|
|
294
296
|
}
|
|
295
|
-
return
|
|
297
|
+
return je.mergeObjectSync(e, a);
|
|
296
298
|
}
|
|
297
299
|
static mergeObjectSync(e, t) {
|
|
298
|
-
const
|
|
299
|
-
for (const
|
|
300
|
-
const { key:
|
|
301
|
-
if (
|
|
302
|
-
return
|
|
303
|
-
|
|
300
|
+
const a = {};
|
|
301
|
+
for (const s of t) {
|
|
302
|
+
const { key: i, value: r } = s;
|
|
303
|
+
if (i.status === "aborted" || r.status === "aborted")
|
|
304
|
+
return _;
|
|
305
|
+
i.status === "dirty" && e.dirty(), r.status === "dirty" && e.dirty(), i.value !== "__proto__" && (typeof r.value < "u" || s.alwaysSet) && (a[i.value] = r.value);
|
|
304
306
|
}
|
|
305
|
-
return { status: e.value, value:
|
|
307
|
+
return { status: e.value, value: a };
|
|
306
308
|
}
|
|
307
309
|
};
|
|
308
|
-
const
|
|
310
|
+
const _ = Object.freeze({
|
|
309
311
|
status: "aborted"
|
|
310
|
-
}),
|
|
311
|
-
function Se(a, e, t, s) {
|
|
312
|
-
if (typeof e == "function" ? a !== e || !0 : !e.has(a)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
313
|
-
return e.get(a);
|
|
314
|
-
}
|
|
315
|
-
function We(a, e, t, s, n) {
|
|
316
|
-
if (typeof e == "function" ? a !== e || !0 : !e.has(a)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
317
|
-
return e.set(a, t), t;
|
|
318
|
-
}
|
|
312
|
+
}), ie = (n) => ({ status: "dirty", value: n }), x = (n) => ({ status: "valid", value: n }), ve = (n) => n.status === "aborted", be = (n) => n.status === "dirty", L = (n) => n.status === "valid", X = (n) => typeof Promise < "u" && n instanceof Promise;
|
|
319
313
|
var p;
|
|
320
|
-
(function(
|
|
321
|
-
|
|
314
|
+
(function(n) {
|
|
315
|
+
n.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, n.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
322
316
|
})(p || (p = {}));
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = n;
|
|
317
|
+
let $ = class {
|
|
318
|
+
constructor(e, t, a, s) {
|
|
319
|
+
this._cachedPath = [], this.parent = e, this.data = t, this._path = a, this._key = s;
|
|
327
320
|
}
|
|
328
321
|
get path() {
|
|
329
|
-
return this._cachedPath.length || (this._key
|
|
322
|
+
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
330
323
|
}
|
|
331
|
-
}
|
|
332
|
-
const
|
|
333
|
-
if (
|
|
324
|
+
};
|
|
325
|
+
const we = (n, e) => {
|
|
326
|
+
if (L(e))
|
|
334
327
|
return { success: !0, data: e.value };
|
|
335
|
-
if (!
|
|
328
|
+
if (!n.common.issues.length)
|
|
336
329
|
throw new Error("Validation failed but no issues detected.");
|
|
337
330
|
return {
|
|
338
331
|
success: !1,
|
|
339
332
|
get error() {
|
|
340
333
|
if (this._error)
|
|
341
334
|
return this._error;
|
|
342
|
-
const t = new
|
|
335
|
+
const t = new C(n.common.issues);
|
|
343
336
|
return this._error = t, this._error;
|
|
344
337
|
}
|
|
345
338
|
};
|
|
346
339
|
};
|
|
347
|
-
function
|
|
348
|
-
if (!
|
|
340
|
+
function y(n) {
|
|
341
|
+
if (!n)
|
|
349
342
|
return {};
|
|
350
|
-
const { errorMap: e, invalid_type_error: t, required_error:
|
|
351
|
-
if (e && (t ||
|
|
343
|
+
const { errorMap: e, invalid_type_error: t, required_error: a, description: s } = n;
|
|
344
|
+
if (e && (t || a))
|
|
352
345
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
353
|
-
return e ? { errorMap: e, description:
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
}, description: n };
|
|
346
|
+
return e ? { errorMap: e, description: s } : { errorMap: (i, r) => {
|
|
347
|
+
const { message: o } = n;
|
|
348
|
+
return i.code === "invalid_enum_value" ? { message: o ?? r.defaultError } : typeof r.data > "u" ? { message: o ?? a ?? r.defaultError } : i.code !== "invalid_type" ? { message: r.defaultError } : { message: o ?? t ?? r.defaultError };
|
|
349
|
+
}, description: s };
|
|
358
350
|
}
|
|
359
|
-
|
|
351
|
+
let v = class {
|
|
360
352
|
get description() {
|
|
361
353
|
return this._def.description;
|
|
362
354
|
}
|
|
363
355
|
_getType(e) {
|
|
364
|
-
return
|
|
356
|
+
return O(e.data);
|
|
365
357
|
}
|
|
366
358
|
_getOrReturnCtx(e, t) {
|
|
367
359
|
return t || {
|
|
368
360
|
common: e.parent.common,
|
|
369
361
|
data: e.data,
|
|
370
|
-
parsedType:
|
|
362
|
+
parsedType: O(e.data),
|
|
371
363
|
schemaErrorMap: this._def.errorMap,
|
|
372
364
|
path: e.path,
|
|
373
365
|
parent: e.parent
|
|
@@ -375,11 +367,11 @@ class v {
|
|
|
375
367
|
}
|
|
376
368
|
_processInputParams(e) {
|
|
377
369
|
return {
|
|
378
|
-
status: new
|
|
370
|
+
status: new N(),
|
|
379
371
|
ctx: {
|
|
380
372
|
common: e.parent.common,
|
|
381
373
|
data: e.data,
|
|
382
|
-
parsedType:
|
|
374
|
+
parsedType: O(e.data),
|
|
383
375
|
schemaErrorMap: this._def.errorMap,
|
|
384
376
|
path: e.path,
|
|
385
377
|
parent: e.parent
|
|
@@ -388,7 +380,7 @@ class v {
|
|
|
388
380
|
}
|
|
389
381
|
_parseSync(e) {
|
|
390
382
|
const t = this._parse(e);
|
|
391
|
-
if (
|
|
383
|
+
if (X(t))
|
|
392
384
|
throw new Error("Synchronous parse encountered promise.");
|
|
393
385
|
return t;
|
|
394
386
|
}
|
|
@@ -397,30 +389,29 @@ class v {
|
|
|
397
389
|
return Promise.resolve(t);
|
|
398
390
|
}
|
|
399
391
|
parse(e, t) {
|
|
400
|
-
const
|
|
401
|
-
if (
|
|
402
|
-
return
|
|
403
|
-
throw
|
|
392
|
+
const a = this.safeParse(e, t);
|
|
393
|
+
if (a.success)
|
|
394
|
+
return a.data;
|
|
395
|
+
throw a.error;
|
|
404
396
|
}
|
|
405
397
|
safeParse(e, t) {
|
|
406
|
-
|
|
407
|
-
const n = {
|
|
398
|
+
const a = {
|
|
408
399
|
common: {
|
|
409
400
|
issues: [],
|
|
410
|
-
async: (
|
|
401
|
+
async: (t == null ? void 0 : t.async) ?? !1,
|
|
411
402
|
contextualErrorMap: t == null ? void 0 : t.errorMap
|
|
412
403
|
},
|
|
413
404
|
path: (t == null ? void 0 : t.path) || [],
|
|
414
405
|
schemaErrorMap: this._def.errorMap,
|
|
415
406
|
parent: null,
|
|
416
407
|
data: e,
|
|
417
|
-
parsedType:
|
|
418
|
-
},
|
|
419
|
-
return
|
|
408
|
+
parsedType: O(e)
|
|
409
|
+
}, s = this._parseSync({ data: e, path: a.path, parent: a });
|
|
410
|
+
return we(a, s);
|
|
420
411
|
}
|
|
421
412
|
"~validate"(e) {
|
|
422
|
-
var t,
|
|
423
|
-
const
|
|
413
|
+
var t, a;
|
|
414
|
+
const s = {
|
|
424
415
|
common: {
|
|
425
416
|
issues: [],
|
|
426
417
|
async: !!this["~standard"].async
|
|
@@ -429,36 +420,36 @@ class v {
|
|
|
429
420
|
schemaErrorMap: this._def.errorMap,
|
|
430
421
|
parent: null,
|
|
431
422
|
data: e,
|
|
432
|
-
parsedType:
|
|
423
|
+
parsedType: O(e)
|
|
433
424
|
};
|
|
434
425
|
if (!this["~standard"].async)
|
|
435
426
|
try {
|
|
436
|
-
const
|
|
437
|
-
return
|
|
438
|
-
value:
|
|
427
|
+
const i = this._parseSync({ data: e, path: [], parent: s });
|
|
428
|
+
return L(i) ? {
|
|
429
|
+
value: i.value
|
|
439
430
|
} : {
|
|
440
|
-
issues:
|
|
431
|
+
issues: s.common.issues
|
|
441
432
|
};
|
|
442
|
-
} catch (
|
|
443
|
-
|
|
433
|
+
} catch (i) {
|
|
434
|
+
(a = (t = i == null ? void 0 : i.message) == null ? void 0 : t.toLowerCase()) != null && a.includes("encountered") && (this["~standard"].async = !0), s.common = {
|
|
444
435
|
issues: [],
|
|
445
436
|
async: !0
|
|
446
437
|
};
|
|
447
438
|
}
|
|
448
|
-
return this._parseAsync({ data: e, path: [], parent:
|
|
449
|
-
value:
|
|
439
|
+
return this._parseAsync({ data: e, path: [], parent: s }).then((i) => L(i) ? {
|
|
440
|
+
value: i.value
|
|
450
441
|
} : {
|
|
451
|
-
issues:
|
|
442
|
+
issues: s.common.issues
|
|
452
443
|
});
|
|
453
444
|
}
|
|
454
445
|
async parseAsync(e, t) {
|
|
455
|
-
const
|
|
456
|
-
if (
|
|
457
|
-
return
|
|
458
|
-
throw
|
|
446
|
+
const a = await this.safeParseAsync(e, t);
|
|
447
|
+
if (a.success)
|
|
448
|
+
return a.data;
|
|
449
|
+
throw a.error;
|
|
459
450
|
}
|
|
460
451
|
async safeParseAsync(e, t) {
|
|
461
|
-
const
|
|
452
|
+
const a = {
|
|
462
453
|
common: {
|
|
463
454
|
issues: [],
|
|
464
455
|
contextualErrorMap: t == null ? void 0 : t.errorMap,
|
|
@@ -468,27 +459,27 @@ class v {
|
|
|
468
459
|
schemaErrorMap: this._def.errorMap,
|
|
469
460
|
parent: null,
|
|
470
461
|
data: e,
|
|
471
|
-
parsedType:
|
|
472
|
-
},
|
|
473
|
-
return
|
|
462
|
+
parsedType: O(e)
|
|
463
|
+
}, s = this._parse({ data: e, path: a.path, parent: a }), i = await (X(s) ? s : Promise.resolve(s));
|
|
464
|
+
return we(a, i);
|
|
474
465
|
}
|
|
475
466
|
refine(e, t) {
|
|
476
|
-
const
|
|
477
|
-
return this._refinement((
|
|
478
|
-
const
|
|
467
|
+
const a = (s) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(s) : t;
|
|
468
|
+
return this._refinement((s, i) => {
|
|
469
|
+
const r = e(s), o = () => i.addIssue({
|
|
479
470
|
code: d.custom,
|
|
480
|
-
...s
|
|
471
|
+
...a(s)
|
|
481
472
|
});
|
|
482
|
-
return typeof Promise < "u" &&
|
|
473
|
+
return typeof Promise < "u" && r instanceof Promise ? r.then((c) => c ? !0 : (o(), !1)) : r ? !0 : (o(), !1);
|
|
483
474
|
});
|
|
484
475
|
}
|
|
485
476
|
refinement(e, t) {
|
|
486
|
-
return this._refinement((
|
|
477
|
+
return this._refinement((a, s) => e(a) ? !0 : (s.addIssue(typeof t == "function" ? t(a, s) : t), !1));
|
|
487
478
|
}
|
|
488
479
|
_refinement(e) {
|
|
489
|
-
return new
|
|
480
|
+
return new D({
|
|
490
481
|
schema: this,
|
|
491
|
-
typeName:
|
|
482
|
+
typeName: f.ZodEffects,
|
|
492
483
|
effect: { type: "refinement", refinement: e }
|
|
493
484
|
});
|
|
494
485
|
}
|
|
@@ -503,57 +494,57 @@ class v {
|
|
|
503
494
|
};
|
|
504
495
|
}
|
|
505
496
|
optional() {
|
|
506
|
-
return
|
|
497
|
+
return I.create(this, this._def);
|
|
507
498
|
}
|
|
508
499
|
nullable() {
|
|
509
|
-
return
|
|
500
|
+
return V.create(this, this._def);
|
|
510
501
|
}
|
|
511
502
|
nullish() {
|
|
512
503
|
return this.nullable().optional();
|
|
513
504
|
}
|
|
514
505
|
array() {
|
|
515
|
-
return
|
|
506
|
+
return q.create(this);
|
|
516
507
|
}
|
|
517
508
|
promise() {
|
|
518
|
-
return
|
|
509
|
+
return te.create(this, this._def);
|
|
519
510
|
}
|
|
520
511
|
or(e) {
|
|
521
|
-
return
|
|
512
|
+
return Q.create([this, e], this._def);
|
|
522
513
|
}
|
|
523
514
|
and(e) {
|
|
524
|
-
return
|
|
515
|
+
return ee.create(this, e, this._def);
|
|
525
516
|
}
|
|
526
517
|
transform(e) {
|
|
527
|
-
return new
|
|
528
|
-
...
|
|
518
|
+
return new D({
|
|
519
|
+
...y(this._def),
|
|
529
520
|
schema: this,
|
|
530
|
-
typeName:
|
|
521
|
+
typeName: f.ZodEffects,
|
|
531
522
|
effect: { type: "transform", transform: e }
|
|
532
523
|
});
|
|
533
524
|
}
|
|
534
525
|
default(e) {
|
|
535
526
|
const t = typeof e == "function" ? e : () => e;
|
|
536
|
-
return new
|
|
537
|
-
...
|
|
527
|
+
return new he({
|
|
528
|
+
...y(this._def),
|
|
538
529
|
innerType: this,
|
|
539
530
|
defaultValue: t,
|
|
540
|
-
typeName:
|
|
531
|
+
typeName: f.ZodDefault
|
|
541
532
|
});
|
|
542
533
|
}
|
|
543
534
|
brand() {
|
|
544
|
-
return new
|
|
545
|
-
typeName:
|
|
535
|
+
return new ut({
|
|
536
|
+
typeName: f.ZodBranded,
|
|
546
537
|
type: this,
|
|
547
|
-
...
|
|
538
|
+
...y(this._def)
|
|
548
539
|
});
|
|
549
540
|
}
|
|
550
541
|
catch(e) {
|
|
551
542
|
const t = typeof e == "function" ? e : () => e;
|
|
552
|
-
return new
|
|
553
|
-
...
|
|
543
|
+
return new pe({
|
|
544
|
+
...y(this._def),
|
|
554
545
|
innerType: this,
|
|
555
546
|
catchValue: t,
|
|
556
|
-
typeName:
|
|
547
|
+
typeName: f.ZodCatch
|
|
557
548
|
});
|
|
558
549
|
}
|
|
559
550
|
describe(e) {
|
|
@@ -564,10 +555,10 @@ class v {
|
|
|
564
555
|
});
|
|
565
556
|
}
|
|
566
557
|
pipe(e) {
|
|
567
|
-
return
|
|
558
|
+
return _e.create(this, e);
|
|
568
559
|
}
|
|
569
560
|
readonly() {
|
|
570
|
-
return
|
|
561
|
+
return fe.create(this);
|
|
571
562
|
}
|
|
572
563
|
isOptional() {
|
|
573
564
|
return this.safeParse(void 0).success;
|
|
@@ -575,204 +566,207 @@ class v {
|
|
|
575
566
|
isNullable() {
|
|
576
567
|
return this.safeParse(null).success;
|
|
577
568
|
}
|
|
578
|
-
}
|
|
579
|
-
const
|
|
580
|
-
let
|
|
581
|
-
const
|
|
582
|
-
function
|
|
569
|
+
};
|
|
570
|
+
const Ve = /^c[^\s-]{8,}$/i, ze = /^[0-9a-z]+$/, Be = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Ue = /^[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, He = /^[a-z0-9_-]{21}$/i, Ke = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, We = /^[-+]?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)?)??$/, Je = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ge = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
571
|
+
let ne;
|
|
572
|
+
const Ye = /^(?:(?: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])$/, Xe = /^(?:(?: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])$/, Qe = /^(([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]))$/, et = /^(([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])$/, tt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, at = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Pe = "((\\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])))", st = new RegExp(`^${Pe}$`);
|
|
573
|
+
function Re(n) {
|
|
583
574
|
let e = "[0-5]\\d";
|
|
584
|
-
|
|
585
|
-
const t =
|
|
575
|
+
n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
576
|
+
const t = n.precision ? "+" : "?";
|
|
586
577
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
|
|
587
578
|
}
|
|
588
|
-
function
|
|
589
|
-
return new RegExp(`^${
|
|
579
|
+
function nt(n) {
|
|
580
|
+
return new RegExp(`^${Re(n)}$`);
|
|
590
581
|
}
|
|
591
|
-
function
|
|
592
|
-
let e = `${
|
|
582
|
+
function rt(n) {
|
|
583
|
+
let e = `${Pe}T${Re(n)}`;
|
|
593
584
|
const t = [];
|
|
594
|
-
return t.push(
|
|
585
|
+
return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
595
586
|
}
|
|
596
|
-
function
|
|
597
|
-
return !!((e === "v4" || !e) &&
|
|
587
|
+
function it(n, e) {
|
|
588
|
+
return !!((e === "v4" || !e) && Ye.test(n) || (e === "v6" || !e) && Qe.test(n));
|
|
598
589
|
}
|
|
599
|
-
function
|
|
600
|
-
if (!
|
|
590
|
+
function ot(n, e) {
|
|
591
|
+
if (!Ke.test(n))
|
|
601
592
|
return !1;
|
|
602
593
|
try {
|
|
603
|
-
const [t] =
|
|
604
|
-
|
|
594
|
+
const [t] = n.split(".");
|
|
595
|
+
if (!t)
|
|
596
|
+
return !1;
|
|
597
|
+
const a = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), s = JSON.parse(atob(a));
|
|
598
|
+
return !(typeof s != "object" || s === null || "typ" in s && (s == null ? void 0 : s.typ) !== "JWT" || !s.alg || e && s.alg !== e);
|
|
605
599
|
} catch {
|
|
606
600
|
return !1;
|
|
607
601
|
}
|
|
608
602
|
}
|
|
609
|
-
function
|
|
610
|
-
return !!((e === "v4" || !e) &&
|
|
603
|
+
function ct(n, e) {
|
|
604
|
+
return !!((e === "v4" || !e) && Xe.test(n) || (e === "v6" || !e) && et.test(n));
|
|
611
605
|
}
|
|
612
|
-
class
|
|
606
|
+
class A extends v {
|
|
613
607
|
_parse(e) {
|
|
614
|
-
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !==
|
|
615
|
-
const
|
|
616
|
-
return
|
|
608
|
+
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== l.string) {
|
|
609
|
+
const s = this._getOrReturnCtx(e);
|
|
610
|
+
return u(s, {
|
|
617
611
|
code: d.invalid_type,
|
|
618
|
-
expected:
|
|
619
|
-
received:
|
|
620
|
-
}),
|
|
612
|
+
expected: l.string,
|
|
613
|
+
received: s.parsedType
|
|
614
|
+
}), _;
|
|
621
615
|
}
|
|
622
|
-
const t = new
|
|
623
|
-
let
|
|
624
|
-
for (const
|
|
625
|
-
if (
|
|
626
|
-
e.data.length <
|
|
616
|
+
const t = new N();
|
|
617
|
+
let a;
|
|
618
|
+
for (const s of this._def.checks)
|
|
619
|
+
if (s.kind === "min")
|
|
620
|
+
e.data.length < s.value && (a = this._getOrReturnCtx(e, a), u(a, {
|
|
627
621
|
code: d.too_small,
|
|
628
|
-
minimum:
|
|
622
|
+
minimum: s.value,
|
|
629
623
|
type: "string",
|
|
630
624
|
inclusive: !0,
|
|
631
625
|
exact: !1,
|
|
632
|
-
message:
|
|
626
|
+
message: s.message
|
|
633
627
|
}), t.dirty());
|
|
634
|
-
else if (
|
|
635
|
-
e.data.length >
|
|
628
|
+
else if (s.kind === "max")
|
|
629
|
+
e.data.length > s.value && (a = this._getOrReturnCtx(e, a), u(a, {
|
|
636
630
|
code: d.too_big,
|
|
637
|
-
maximum:
|
|
631
|
+
maximum: s.value,
|
|
638
632
|
type: "string",
|
|
639
633
|
inclusive: !0,
|
|
640
634
|
exact: !1,
|
|
641
|
-
message:
|
|
635
|
+
message: s.message
|
|
642
636
|
}), t.dirty());
|
|
643
|
-
else if (
|
|
644
|
-
const
|
|
645
|
-
(
|
|
637
|
+
else if (s.kind === "length") {
|
|
638
|
+
const i = e.data.length > s.value, r = e.data.length < s.value;
|
|
639
|
+
(i || r) && (a = this._getOrReturnCtx(e, a), i ? u(a, {
|
|
646
640
|
code: d.too_big,
|
|
647
|
-
maximum:
|
|
641
|
+
maximum: s.value,
|
|
648
642
|
type: "string",
|
|
649
643
|
inclusive: !0,
|
|
650
644
|
exact: !0,
|
|
651
|
-
message:
|
|
652
|
-
}) :
|
|
645
|
+
message: s.message
|
|
646
|
+
}) : r && u(a, {
|
|
653
647
|
code: d.too_small,
|
|
654
|
-
minimum:
|
|
648
|
+
minimum: s.value,
|
|
655
649
|
type: "string",
|
|
656
650
|
inclusive: !0,
|
|
657
651
|
exact: !0,
|
|
658
|
-
message:
|
|
652
|
+
message: s.message
|
|
659
653
|
}), t.dirty());
|
|
660
|
-
} else if (
|
|
661
|
-
|
|
654
|
+
} else if (s.kind === "email")
|
|
655
|
+
Je.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
662
656
|
validation: "email",
|
|
663
657
|
code: d.invalid_string,
|
|
664
|
-
message:
|
|
658
|
+
message: s.message
|
|
665
659
|
}), t.dirty());
|
|
666
|
-
else if (
|
|
667
|
-
|
|
660
|
+
else if (s.kind === "emoji")
|
|
661
|
+
ne || (ne = new RegExp(Ge, "u")), ne.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
668
662
|
validation: "emoji",
|
|
669
663
|
code: d.invalid_string,
|
|
670
|
-
message:
|
|
664
|
+
message: s.message
|
|
671
665
|
}), t.dirty());
|
|
672
|
-
else if (
|
|
673
|
-
|
|
666
|
+
else if (s.kind === "uuid")
|
|
667
|
+
Ue.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
674
668
|
validation: "uuid",
|
|
675
669
|
code: d.invalid_string,
|
|
676
|
-
message:
|
|
670
|
+
message: s.message
|
|
677
671
|
}), t.dirty());
|
|
678
|
-
else if (
|
|
679
|
-
|
|
672
|
+
else if (s.kind === "nanoid")
|
|
673
|
+
He.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
680
674
|
validation: "nanoid",
|
|
681
675
|
code: d.invalid_string,
|
|
682
|
-
message:
|
|
676
|
+
message: s.message
|
|
683
677
|
}), t.dirty());
|
|
684
|
-
else if (
|
|
685
|
-
|
|
678
|
+
else if (s.kind === "cuid")
|
|
679
|
+
Ve.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
686
680
|
validation: "cuid",
|
|
687
681
|
code: d.invalid_string,
|
|
688
|
-
message:
|
|
682
|
+
message: s.message
|
|
689
683
|
}), t.dirty());
|
|
690
|
-
else if (
|
|
691
|
-
|
|
684
|
+
else if (s.kind === "cuid2")
|
|
685
|
+
ze.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
692
686
|
validation: "cuid2",
|
|
693
687
|
code: d.invalid_string,
|
|
694
|
-
message:
|
|
688
|
+
message: s.message
|
|
695
689
|
}), t.dirty());
|
|
696
|
-
else if (
|
|
697
|
-
|
|
690
|
+
else if (s.kind === "ulid")
|
|
691
|
+
Be.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
698
692
|
validation: "ulid",
|
|
699
693
|
code: d.invalid_string,
|
|
700
|
-
message:
|
|
694
|
+
message: s.message
|
|
701
695
|
}), t.dirty());
|
|
702
|
-
else if (
|
|
696
|
+
else if (s.kind === "url")
|
|
703
697
|
try {
|
|
704
698
|
new URL(e.data);
|
|
705
699
|
} catch {
|
|
706
|
-
|
|
700
|
+
a = this._getOrReturnCtx(e, a), u(a, {
|
|
707
701
|
validation: "url",
|
|
708
702
|
code: d.invalid_string,
|
|
709
|
-
message:
|
|
703
|
+
message: s.message
|
|
710
704
|
}), t.dirty();
|
|
711
705
|
}
|
|
712
|
-
else
|
|
706
|
+
else s.kind === "regex" ? (s.regex.lastIndex = 0, s.regex.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
713
707
|
validation: "regex",
|
|
714
708
|
code: d.invalid_string,
|
|
715
|
-
message:
|
|
716
|
-
}), t.dirty())) :
|
|
709
|
+
message: s.message
|
|
710
|
+
}), t.dirty())) : s.kind === "trim" ? e.data = e.data.trim() : s.kind === "includes" ? e.data.includes(s.value, s.position) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
717
711
|
code: d.invalid_string,
|
|
718
|
-
validation: { includes:
|
|
719
|
-
message:
|
|
720
|
-
}), t.dirty()) :
|
|
712
|
+
validation: { includes: s.value, position: s.position },
|
|
713
|
+
message: s.message
|
|
714
|
+
}), t.dirty()) : s.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : s.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : s.kind === "startsWith" ? e.data.startsWith(s.value) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
721
715
|
code: d.invalid_string,
|
|
722
|
-
validation: { startsWith:
|
|
723
|
-
message:
|
|
724
|
-
}), t.dirty()) :
|
|
716
|
+
validation: { startsWith: s.value },
|
|
717
|
+
message: s.message
|
|
718
|
+
}), t.dirty()) : s.kind === "endsWith" ? e.data.endsWith(s.value) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
725
719
|
code: d.invalid_string,
|
|
726
|
-
validation: { endsWith:
|
|
727
|
-
message:
|
|
728
|
-
}), t.dirty()) :
|
|
720
|
+
validation: { endsWith: s.value },
|
|
721
|
+
message: s.message
|
|
722
|
+
}), t.dirty()) : s.kind === "datetime" ? rt(s).test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
729
723
|
code: d.invalid_string,
|
|
730
724
|
validation: "datetime",
|
|
731
|
-
message:
|
|
732
|
-
}), t.dirty()) :
|
|
725
|
+
message: s.message
|
|
726
|
+
}), t.dirty()) : s.kind === "date" ? st.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
733
727
|
code: d.invalid_string,
|
|
734
728
|
validation: "date",
|
|
735
|
-
message:
|
|
736
|
-
}), t.dirty()) :
|
|
729
|
+
message: s.message
|
|
730
|
+
}), t.dirty()) : s.kind === "time" ? nt(s).test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
737
731
|
code: d.invalid_string,
|
|
738
732
|
validation: "time",
|
|
739
|
-
message:
|
|
740
|
-
}), t.dirty()) :
|
|
733
|
+
message: s.message
|
|
734
|
+
}), t.dirty()) : s.kind === "duration" ? We.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
741
735
|
validation: "duration",
|
|
742
736
|
code: d.invalid_string,
|
|
743
|
-
message:
|
|
744
|
-
}), t.dirty()) :
|
|
737
|
+
message: s.message
|
|
738
|
+
}), t.dirty()) : s.kind === "ip" ? it(e.data, s.version) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
745
739
|
validation: "ip",
|
|
746
740
|
code: d.invalid_string,
|
|
747
|
-
message:
|
|
748
|
-
}), t.dirty()) :
|
|
741
|
+
message: s.message
|
|
742
|
+
}), t.dirty()) : s.kind === "jwt" ? ot(e.data, s.alg) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
749
743
|
validation: "jwt",
|
|
750
744
|
code: d.invalid_string,
|
|
751
|
-
message:
|
|
752
|
-
}), t.dirty()) :
|
|
745
|
+
message: s.message
|
|
746
|
+
}), t.dirty()) : s.kind === "cidr" ? ct(e.data, s.version) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
753
747
|
validation: "cidr",
|
|
754
748
|
code: d.invalid_string,
|
|
755
|
-
message:
|
|
756
|
-
}), t.dirty()) :
|
|
749
|
+
message: s.message
|
|
750
|
+
}), t.dirty()) : s.kind === "base64" ? tt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
757
751
|
validation: "base64",
|
|
758
752
|
code: d.invalid_string,
|
|
759
|
-
message:
|
|
760
|
-
}), t.dirty()) :
|
|
753
|
+
message: s.message
|
|
754
|
+
}), t.dirty()) : s.kind === "base64url" ? at.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
761
755
|
validation: "base64url",
|
|
762
756
|
code: d.invalid_string,
|
|
763
|
-
message:
|
|
764
|
-
}), t.dirty()) :
|
|
757
|
+
message: s.message
|
|
758
|
+
}), t.dirty()) : b.assertNever(s);
|
|
765
759
|
return { status: t.value, value: e.data };
|
|
766
760
|
}
|
|
767
|
-
_regex(e, t,
|
|
768
|
-
return this.refinement((
|
|
761
|
+
_regex(e, t, a) {
|
|
762
|
+
return this.refinement((s) => e.test(s), {
|
|
769
763
|
validation: t,
|
|
770
764
|
code: d.invalid_string,
|
|
771
|
-
...p.errToObj(
|
|
765
|
+
...p.errToObj(a)
|
|
772
766
|
});
|
|
773
767
|
}
|
|
774
768
|
_addCheck(e) {
|
|
775
|
-
return new
|
|
769
|
+
return new A({
|
|
776
770
|
...this._def,
|
|
777
771
|
checks: [...this._def.checks, e]
|
|
778
772
|
});
|
|
@@ -820,7 +814,6 @@ class C extends v {
|
|
|
820
814
|
return this._addCheck({ kind: "cidr", ...p.errToObj(e) });
|
|
821
815
|
}
|
|
822
816
|
datetime(e) {
|
|
823
|
-
var t, s;
|
|
824
817
|
return typeof e == "string" ? this._addCheck({
|
|
825
818
|
kind: "datetime",
|
|
826
819
|
precision: null,
|
|
@@ -830,8 +823,8 @@ class C extends v {
|
|
|
830
823
|
}) : this._addCheck({
|
|
831
824
|
kind: "datetime",
|
|
832
825
|
precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
|
|
833
|
-
offset: (
|
|
834
|
-
local: (
|
|
826
|
+
offset: (e == null ? void 0 : e.offset) ?? !1,
|
|
827
|
+
local: (e == null ? void 0 : e.local) ?? !1,
|
|
835
828
|
...p.errToObj(e == null ? void 0 : e.message)
|
|
836
829
|
});
|
|
837
830
|
}
|
|
@@ -909,19 +902,19 @@ class C extends v {
|
|
|
909
902
|
return this.min(1, p.errToObj(e));
|
|
910
903
|
}
|
|
911
904
|
trim() {
|
|
912
|
-
return new
|
|
905
|
+
return new A({
|
|
913
906
|
...this._def,
|
|
914
907
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
915
908
|
});
|
|
916
909
|
}
|
|
917
910
|
toLowerCase() {
|
|
918
|
-
return new
|
|
911
|
+
return new A({
|
|
919
912
|
...this._def,
|
|
920
913
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
921
914
|
});
|
|
922
915
|
}
|
|
923
916
|
toUpperCase() {
|
|
924
|
-
return new
|
|
917
|
+
return new A({
|
|
925
918
|
...this._def,
|
|
926
919
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
927
920
|
});
|
|
@@ -987,63 +980,60 @@ class C extends v {
|
|
|
987
980
|
return e;
|
|
988
981
|
}
|
|
989
982
|
}
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
function Ot(a, e) {
|
|
1000
|
-
const t = (a.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, n = t > s ? t : s, r = parseInt(a.toFixed(n).replace(".", "")), i = parseInt(e.toFixed(n).replace(".", ""));
|
|
1001
|
-
return r % i / Math.pow(10, n);
|
|
983
|
+
A.create = (n) => new A({
|
|
984
|
+
checks: [],
|
|
985
|
+
typeName: f.ZodString,
|
|
986
|
+
coerce: (n == null ? void 0 : n.coerce) ?? !1,
|
|
987
|
+
...y(n)
|
|
988
|
+
});
|
|
989
|
+
function dt(n, e) {
|
|
990
|
+
const t = (n.toString().split(".")[1] || "").length, a = (e.toString().split(".")[1] || "").length, s = t > a ? t : a, i = Number.parseInt(n.toFixed(s).replace(".", "")), r = Number.parseInt(e.toFixed(s).replace(".", ""));
|
|
991
|
+
return i % r / 10 ** s;
|
|
1002
992
|
}
|
|
1003
|
-
let
|
|
993
|
+
let ke = class oe extends v {
|
|
1004
994
|
constructor() {
|
|
1005
995
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1006
996
|
}
|
|
1007
997
|
_parse(e) {
|
|
1008
|
-
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !==
|
|
1009
|
-
const
|
|
1010
|
-
return
|
|
998
|
+
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== l.number) {
|
|
999
|
+
const s = this._getOrReturnCtx(e);
|
|
1000
|
+
return u(s, {
|
|
1011
1001
|
code: d.invalid_type,
|
|
1012
|
-
expected:
|
|
1013
|
-
received:
|
|
1014
|
-
}),
|
|
1002
|
+
expected: l.number,
|
|
1003
|
+
received: s.parsedType
|
|
1004
|
+
}), _;
|
|
1015
1005
|
}
|
|
1016
1006
|
let t;
|
|
1017
|
-
const
|
|
1018
|
-
for (const
|
|
1019
|
-
|
|
1007
|
+
const a = new N();
|
|
1008
|
+
for (const s of this._def.checks)
|
|
1009
|
+
s.kind === "int" ? b.isInteger(e.data) || (t = this._getOrReturnCtx(e, t), u(t, {
|
|
1020
1010
|
code: d.invalid_type,
|
|
1021
1011
|
expected: "integer",
|
|
1022
1012
|
received: "float",
|
|
1023
|
-
message:
|
|
1024
|
-
}),
|
|
1013
|
+
message: s.message
|
|
1014
|
+
}), a.dirty()) : s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (t = this._getOrReturnCtx(e, t), u(t, {
|
|
1025
1015
|
code: d.too_small,
|
|
1026
|
-
minimum:
|
|
1016
|
+
minimum: s.value,
|
|
1027
1017
|
type: "number",
|
|
1028
|
-
inclusive:
|
|
1018
|
+
inclusive: s.inclusive,
|
|
1029
1019
|
exact: !1,
|
|
1030
|
-
message:
|
|
1031
|
-
}),
|
|
1020
|
+
message: s.message
|
|
1021
|
+
}), a.dirty()) : s.kind === "max" ? (s.inclusive ? e.data > s.value : e.data >= s.value) && (t = this._getOrReturnCtx(e, t), u(t, {
|
|
1032
1022
|
code: d.too_big,
|
|
1033
|
-
maximum:
|
|
1023
|
+
maximum: s.value,
|
|
1034
1024
|
type: "number",
|
|
1035
|
-
inclusive:
|
|
1025
|
+
inclusive: s.inclusive,
|
|
1036
1026
|
exact: !1,
|
|
1037
|
-
message:
|
|
1038
|
-
}),
|
|
1027
|
+
message: s.message
|
|
1028
|
+
}), a.dirty()) : s.kind === "multipleOf" ? dt(e.data, s.value) !== 0 && (t = this._getOrReturnCtx(e, t), u(t, {
|
|
1039
1029
|
code: d.not_multiple_of,
|
|
1040
|
-
multipleOf:
|
|
1041
|
-
message:
|
|
1042
|
-
}),
|
|
1030
|
+
multipleOf: s.value,
|
|
1031
|
+
message: s.message
|
|
1032
|
+
}), a.dirty()) : s.kind === "finite" ? Number.isFinite(e.data) || (t = this._getOrReturnCtx(e, t), u(t, {
|
|
1043
1033
|
code: d.not_finite,
|
|
1044
|
-
message:
|
|
1045
|
-
}),
|
|
1046
|
-
return { status:
|
|
1034
|
+
message: s.message
|
|
1035
|
+
}), a.dirty()) : b.assertNever(s);
|
|
1036
|
+
return { status: a.value, value: e.data };
|
|
1047
1037
|
}
|
|
1048
1038
|
gte(e, t) {
|
|
1049
1039
|
return this.setLimit("min", e, !0, p.toString(t));
|
|
@@ -1057,22 +1047,22 @@ let X = class Me extends v {
|
|
|
1057
1047
|
lt(e, t) {
|
|
1058
1048
|
return this.setLimit("max", e, !1, p.toString(t));
|
|
1059
1049
|
}
|
|
1060
|
-
setLimit(e, t,
|
|
1061
|
-
return new
|
|
1050
|
+
setLimit(e, t, a, s) {
|
|
1051
|
+
return new oe({
|
|
1062
1052
|
...this._def,
|
|
1063
1053
|
checks: [
|
|
1064
1054
|
...this._def.checks,
|
|
1065
1055
|
{
|
|
1066
1056
|
kind: e,
|
|
1067
1057
|
value: t,
|
|
1068
|
-
inclusive:
|
|
1069
|
-
message: p.toString(
|
|
1058
|
+
inclusive: a,
|
|
1059
|
+
message: p.toString(s)
|
|
1070
1060
|
}
|
|
1071
1061
|
]
|
|
1072
1062
|
});
|
|
1073
1063
|
}
|
|
1074
1064
|
_addCheck(e) {
|
|
1075
|
-
return new
|
|
1065
|
+
return new oe({
|
|
1076
1066
|
...this._def,
|
|
1077
1067
|
checks: [...this._def.checks, e]
|
|
1078
1068
|
});
|
|
@@ -1154,25 +1144,25 @@ let X = class Me extends v {
|
|
|
1154
1144
|
return e;
|
|
1155
1145
|
}
|
|
1156
1146
|
get isInt() {
|
|
1157
|
-
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" &&
|
|
1147
|
+
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && b.isInteger(e.value));
|
|
1158
1148
|
}
|
|
1159
1149
|
get isFinite() {
|
|
1160
1150
|
let e = null, t = null;
|
|
1161
|
-
for (const
|
|
1162
|
-
if (
|
|
1151
|
+
for (const a of this._def.checks) {
|
|
1152
|
+
if (a.kind === "finite" || a.kind === "int" || a.kind === "multipleOf")
|
|
1163
1153
|
return !0;
|
|
1164
|
-
|
|
1154
|
+
a.kind === "min" ? (t === null || a.value > t) && (t = a.value) : a.kind === "max" && (e === null || a.value < e) && (e = a.value);
|
|
1165
1155
|
}
|
|
1166
1156
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
1167
1157
|
}
|
|
1168
1158
|
};
|
|
1169
|
-
|
|
1159
|
+
ke.create = (n) => new ke({
|
|
1170
1160
|
checks: [],
|
|
1171
|
-
typeName:
|
|
1172
|
-
coerce: (
|
|
1173
|
-
...
|
|
1161
|
+
typeName: f.ZodNumber,
|
|
1162
|
+
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
1163
|
+
...y(n)
|
|
1174
1164
|
});
|
|
1175
|
-
|
|
1165
|
+
class U extends v {
|
|
1176
1166
|
constructor() {
|
|
1177
1167
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1178
1168
|
}
|
|
@@ -1183,37 +1173,37 @@ let Q = class Fe extends v {
|
|
|
1183
1173
|
} catch {
|
|
1184
1174
|
return this._getInvalidInput(e);
|
|
1185
1175
|
}
|
|
1186
|
-
if (this._getType(e) !==
|
|
1176
|
+
if (this._getType(e) !== l.bigint)
|
|
1187
1177
|
return this._getInvalidInput(e);
|
|
1188
1178
|
let t;
|
|
1189
|
-
const
|
|
1190
|
-
for (const
|
|
1191
|
-
|
|
1179
|
+
const a = new N();
|
|
1180
|
+
for (const s of this._def.checks)
|
|
1181
|
+
s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (t = this._getOrReturnCtx(e, t), u(t, {
|
|
1192
1182
|
code: d.too_small,
|
|
1193
1183
|
type: "bigint",
|
|
1194
|
-
minimum:
|
|
1195
|
-
inclusive:
|
|
1196
|
-
message:
|
|
1197
|
-
}),
|
|
1184
|
+
minimum: s.value,
|
|
1185
|
+
inclusive: s.inclusive,
|
|
1186
|
+
message: s.message
|
|
1187
|
+
}), a.dirty()) : s.kind === "max" ? (s.inclusive ? e.data > s.value : e.data >= s.value) && (t = this._getOrReturnCtx(e, t), u(t, {
|
|
1198
1188
|
code: d.too_big,
|
|
1199
1189
|
type: "bigint",
|
|
1200
|
-
maximum:
|
|
1201
|
-
inclusive:
|
|
1202
|
-
message:
|
|
1203
|
-
}),
|
|
1190
|
+
maximum: s.value,
|
|
1191
|
+
inclusive: s.inclusive,
|
|
1192
|
+
message: s.message
|
|
1193
|
+
}), a.dirty()) : s.kind === "multipleOf" ? e.data % s.value !== BigInt(0) && (t = this._getOrReturnCtx(e, t), u(t, {
|
|
1204
1194
|
code: d.not_multiple_of,
|
|
1205
|
-
multipleOf:
|
|
1206
|
-
message:
|
|
1207
|
-
}),
|
|
1208
|
-
return { status:
|
|
1195
|
+
multipleOf: s.value,
|
|
1196
|
+
message: s.message
|
|
1197
|
+
}), a.dirty()) : b.assertNever(s);
|
|
1198
|
+
return { status: a.value, value: e.data };
|
|
1209
1199
|
}
|
|
1210
1200
|
_getInvalidInput(e) {
|
|
1211
1201
|
const t = this._getOrReturnCtx(e);
|
|
1212
|
-
return
|
|
1202
|
+
return u(t, {
|
|
1213
1203
|
code: d.invalid_type,
|
|
1214
|
-
expected:
|
|
1204
|
+
expected: l.bigint,
|
|
1215
1205
|
received: t.parsedType
|
|
1216
|
-
}),
|
|
1206
|
+
}), _;
|
|
1217
1207
|
}
|
|
1218
1208
|
gte(e, t) {
|
|
1219
1209
|
return this.setLimit("min", e, !0, p.toString(t));
|
|
@@ -1227,22 +1217,22 @@ let Q = class Fe extends v {
|
|
|
1227
1217
|
lt(e, t) {
|
|
1228
1218
|
return this.setLimit("max", e, !1, p.toString(t));
|
|
1229
1219
|
}
|
|
1230
|
-
setLimit(e, t,
|
|
1231
|
-
return new
|
|
1220
|
+
setLimit(e, t, a, s) {
|
|
1221
|
+
return new U({
|
|
1232
1222
|
...this._def,
|
|
1233
1223
|
checks: [
|
|
1234
1224
|
...this._def.checks,
|
|
1235
1225
|
{
|
|
1236
1226
|
kind: e,
|
|
1237
1227
|
value: t,
|
|
1238
|
-
inclusive:
|
|
1239
|
-
message: p.toString(
|
|
1228
|
+
inclusive: a,
|
|
1229
|
+
message: p.toString(s)
|
|
1240
1230
|
}
|
|
1241
1231
|
]
|
|
1242
1232
|
});
|
|
1243
1233
|
}
|
|
1244
1234
|
_addCheck(e) {
|
|
1245
|
-
return new
|
|
1235
|
+
return new U({
|
|
1246
1236
|
...this._def,
|
|
1247
1237
|
checks: [...this._def.checks, e]
|
|
1248
1238
|
});
|
|
@@ -1298,75 +1288,72 @@ let Q = class Fe extends v {
|
|
|
1298
1288
|
t.kind === "max" && (e === null || t.value < e) && (e = t.value);
|
|
1299
1289
|
return e;
|
|
1300
1290
|
}
|
|
1301
|
-
}
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
});
|
|
1310
|
-
};
|
|
1311
|
-
class ee extends v {
|
|
1291
|
+
}
|
|
1292
|
+
U.create = (n) => new U({
|
|
1293
|
+
checks: [],
|
|
1294
|
+
typeName: f.ZodBigInt,
|
|
1295
|
+
coerce: (n == null ? void 0 : n.coerce) ?? !1,
|
|
1296
|
+
...y(n)
|
|
1297
|
+
});
|
|
1298
|
+
class xe extends v {
|
|
1312
1299
|
_parse(e) {
|
|
1313
|
-
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !==
|
|
1300
|
+
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== l.boolean) {
|
|
1314
1301
|
const t = this._getOrReturnCtx(e);
|
|
1315
|
-
return
|
|
1302
|
+
return u(t, {
|
|
1316
1303
|
code: d.invalid_type,
|
|
1317
|
-
expected:
|
|
1304
|
+
expected: l.boolean,
|
|
1318
1305
|
received: t.parsedType
|
|
1319
|
-
}),
|
|
1306
|
+
}), _;
|
|
1320
1307
|
}
|
|
1321
1308
|
return x(e.data);
|
|
1322
1309
|
}
|
|
1323
1310
|
}
|
|
1324
|
-
|
|
1325
|
-
typeName:
|
|
1326
|
-
coerce: (
|
|
1327
|
-
...
|
|
1311
|
+
xe.create = (n) => new xe({
|
|
1312
|
+
typeName: f.ZodBoolean,
|
|
1313
|
+
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
1314
|
+
...y(n)
|
|
1328
1315
|
});
|
|
1329
|
-
let
|
|
1316
|
+
let Se = class Fe extends v {
|
|
1330
1317
|
_parse(e) {
|
|
1331
|
-
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !==
|
|
1332
|
-
const
|
|
1333
|
-
return
|
|
1318
|
+
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== l.date) {
|
|
1319
|
+
const s = this._getOrReturnCtx(e);
|
|
1320
|
+
return u(s, {
|
|
1334
1321
|
code: d.invalid_type,
|
|
1335
|
-
expected:
|
|
1336
|
-
received:
|
|
1337
|
-
}),
|
|
1322
|
+
expected: l.date,
|
|
1323
|
+
received: s.parsedType
|
|
1324
|
+
}), _;
|
|
1338
1325
|
}
|
|
1339
|
-
if (isNaN(e.data.getTime())) {
|
|
1340
|
-
const
|
|
1341
|
-
return
|
|
1326
|
+
if (Number.isNaN(e.data.getTime())) {
|
|
1327
|
+
const s = this._getOrReturnCtx(e);
|
|
1328
|
+
return u(s, {
|
|
1342
1329
|
code: d.invalid_date
|
|
1343
|
-
}),
|
|
1330
|
+
}), _;
|
|
1344
1331
|
}
|
|
1345
|
-
const t = new
|
|
1346
|
-
let
|
|
1347
|
-
for (const
|
|
1348
|
-
|
|
1332
|
+
const t = new N();
|
|
1333
|
+
let a;
|
|
1334
|
+
for (const s of this._def.checks)
|
|
1335
|
+
s.kind === "min" ? e.data.getTime() < s.value && (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1349
1336
|
code: d.too_small,
|
|
1350
|
-
message:
|
|
1337
|
+
message: s.message,
|
|
1351
1338
|
inclusive: !0,
|
|
1352
1339
|
exact: !1,
|
|
1353
|
-
minimum:
|
|
1340
|
+
minimum: s.value,
|
|
1354
1341
|
type: "date"
|
|
1355
|
-
}), t.dirty()) :
|
|
1342
|
+
}), t.dirty()) : s.kind === "max" ? e.data.getTime() > s.value && (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1356
1343
|
code: d.too_big,
|
|
1357
|
-
message:
|
|
1344
|
+
message: s.message,
|
|
1358
1345
|
inclusive: !0,
|
|
1359
1346
|
exact: !1,
|
|
1360
|
-
maximum:
|
|
1347
|
+
maximum: s.value,
|
|
1361
1348
|
type: "date"
|
|
1362
|
-
}), t.dirty()) :
|
|
1349
|
+
}), t.dirty()) : b.assertNever(s);
|
|
1363
1350
|
return {
|
|
1364
1351
|
status: t.value,
|
|
1365
1352
|
value: new Date(e.data.getTime())
|
|
1366
1353
|
};
|
|
1367
1354
|
}
|
|
1368
1355
|
_addCheck(e) {
|
|
1369
|
-
return new
|
|
1356
|
+
return new Fe({
|
|
1370
1357
|
...this._def,
|
|
1371
1358
|
checks: [...this._def.checks, e]
|
|
1372
1359
|
});
|
|
@@ -1398,76 +1385,76 @@ let te = class Xe extends v {
|
|
|
1398
1385
|
return e != null ? new Date(e) : null;
|
|
1399
1386
|
}
|
|
1400
1387
|
};
|
|
1401
|
-
|
|
1388
|
+
Se.create = (n) => new Se({
|
|
1402
1389
|
checks: [],
|
|
1403
|
-
coerce: (
|
|
1404
|
-
typeName:
|
|
1405
|
-
...
|
|
1390
|
+
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
1391
|
+
typeName: f.ZodDate,
|
|
1392
|
+
...y(n)
|
|
1406
1393
|
});
|
|
1407
|
-
class
|
|
1394
|
+
class Ne extends v {
|
|
1408
1395
|
_parse(e) {
|
|
1409
|
-
if (this._getType(e) !==
|
|
1396
|
+
if (this._getType(e) !== l.symbol) {
|
|
1410
1397
|
const t = this._getOrReturnCtx(e);
|
|
1411
|
-
return
|
|
1398
|
+
return u(t, {
|
|
1412
1399
|
code: d.invalid_type,
|
|
1413
|
-
expected:
|
|
1400
|
+
expected: l.symbol,
|
|
1414
1401
|
received: t.parsedType
|
|
1415
|
-
}),
|
|
1402
|
+
}), _;
|
|
1416
1403
|
}
|
|
1417
1404
|
return x(e.data);
|
|
1418
1405
|
}
|
|
1419
1406
|
}
|
|
1420
|
-
|
|
1421
|
-
typeName:
|
|
1422
|
-
...
|
|
1407
|
+
Ne.create = (n) => new Ne({
|
|
1408
|
+
typeName: f.ZodSymbol,
|
|
1409
|
+
...y(n)
|
|
1423
1410
|
});
|
|
1424
|
-
class
|
|
1411
|
+
class Ce extends v {
|
|
1425
1412
|
_parse(e) {
|
|
1426
|
-
if (this._getType(e) !==
|
|
1413
|
+
if (this._getType(e) !== l.undefined) {
|
|
1427
1414
|
const t = this._getOrReturnCtx(e);
|
|
1428
|
-
return
|
|
1415
|
+
return u(t, {
|
|
1429
1416
|
code: d.invalid_type,
|
|
1430
|
-
expected:
|
|
1417
|
+
expected: l.undefined,
|
|
1431
1418
|
received: t.parsedType
|
|
1432
|
-
}),
|
|
1419
|
+
}), _;
|
|
1433
1420
|
}
|
|
1434
1421
|
return x(e.data);
|
|
1435
1422
|
}
|
|
1436
1423
|
}
|
|
1437
|
-
|
|
1438
|
-
typeName:
|
|
1439
|
-
...
|
|
1424
|
+
Ce.create = (n) => new Ce({
|
|
1425
|
+
typeName: f.ZodUndefined,
|
|
1426
|
+
...y(n)
|
|
1440
1427
|
});
|
|
1441
|
-
class
|
|
1428
|
+
class Te extends v {
|
|
1442
1429
|
_parse(e) {
|
|
1443
|
-
if (this._getType(e) !==
|
|
1430
|
+
if (this._getType(e) !== l.null) {
|
|
1444
1431
|
const t = this._getOrReturnCtx(e);
|
|
1445
|
-
return
|
|
1432
|
+
return u(t, {
|
|
1446
1433
|
code: d.invalid_type,
|
|
1447
|
-
expected:
|
|
1434
|
+
expected: l.null,
|
|
1448
1435
|
received: t.parsedType
|
|
1449
|
-
}),
|
|
1436
|
+
}), _;
|
|
1450
1437
|
}
|
|
1451
1438
|
return x(e.data);
|
|
1452
1439
|
}
|
|
1453
1440
|
}
|
|
1454
|
-
|
|
1455
|
-
typeName:
|
|
1456
|
-
...
|
|
1441
|
+
Te.create = (n) => new Te({
|
|
1442
|
+
typeName: f.ZodNull,
|
|
1443
|
+
...y(n)
|
|
1457
1444
|
});
|
|
1458
|
-
|
|
1445
|
+
class ce extends v {
|
|
1459
1446
|
constructor() {
|
|
1460
1447
|
super(...arguments), this._any = !0;
|
|
1461
1448
|
}
|
|
1462
1449
|
_parse(e) {
|
|
1463
1450
|
return x(e.data);
|
|
1464
1451
|
}
|
|
1465
|
-
}
|
|
1466
|
-
|
|
1467
|
-
typeName:
|
|
1468
|
-
...
|
|
1452
|
+
}
|
|
1453
|
+
ce.create = (n) => new ce({
|
|
1454
|
+
typeName: f.ZodAny,
|
|
1455
|
+
...y(n)
|
|
1469
1456
|
});
|
|
1470
|
-
class
|
|
1457
|
+
class Ze extends v {
|
|
1471
1458
|
constructor() {
|
|
1472
1459
|
super(...arguments), this._unknown = !0;
|
|
1473
1460
|
}
|
|
@@ -1475,98 +1462,98 @@ class L extends v {
|
|
|
1475
1462
|
return x(e.data);
|
|
1476
1463
|
}
|
|
1477
1464
|
}
|
|
1478
|
-
|
|
1479
|
-
typeName:
|
|
1480
|
-
...
|
|
1465
|
+
Ze.create = (n) => new Ze({
|
|
1466
|
+
typeName: f.ZodUnknown,
|
|
1467
|
+
...y(n)
|
|
1481
1468
|
});
|
|
1482
|
-
class
|
|
1469
|
+
let E = class extends v {
|
|
1483
1470
|
_parse(e) {
|
|
1484
1471
|
const t = this._getOrReturnCtx(e);
|
|
1485
|
-
return
|
|
1472
|
+
return u(t, {
|
|
1486
1473
|
code: d.invalid_type,
|
|
1487
|
-
expected:
|
|
1474
|
+
expected: l.never,
|
|
1488
1475
|
received: t.parsedType
|
|
1489
|
-
}),
|
|
1476
|
+
}), _;
|
|
1490
1477
|
}
|
|
1491
|
-
}
|
|
1492
|
-
|
|
1493
|
-
typeName:
|
|
1494
|
-
...
|
|
1478
|
+
};
|
|
1479
|
+
E.create = (n) => new E({
|
|
1480
|
+
typeName: f.ZodNever,
|
|
1481
|
+
...y(n)
|
|
1495
1482
|
});
|
|
1496
|
-
class
|
|
1483
|
+
class Oe extends v {
|
|
1497
1484
|
_parse(e) {
|
|
1498
|
-
if (this._getType(e) !==
|
|
1485
|
+
if (this._getType(e) !== l.undefined) {
|
|
1499
1486
|
const t = this._getOrReturnCtx(e);
|
|
1500
|
-
return
|
|
1487
|
+
return u(t, {
|
|
1501
1488
|
code: d.invalid_type,
|
|
1502
|
-
expected:
|
|
1489
|
+
expected: l.void,
|
|
1503
1490
|
received: t.parsedType
|
|
1504
|
-
}),
|
|
1491
|
+
}), _;
|
|
1505
1492
|
}
|
|
1506
1493
|
return x(e.data);
|
|
1507
1494
|
}
|
|
1508
1495
|
}
|
|
1509
|
-
|
|
1510
|
-
typeName:
|
|
1511
|
-
...
|
|
1496
|
+
Oe.create = (n) => new Oe({
|
|
1497
|
+
typeName: f.ZodVoid,
|
|
1498
|
+
...y(n)
|
|
1512
1499
|
});
|
|
1513
|
-
let
|
|
1500
|
+
let q = class Y extends v {
|
|
1514
1501
|
_parse(e) {
|
|
1515
|
-
const { ctx: t, status:
|
|
1516
|
-
if (t.parsedType !==
|
|
1517
|
-
return
|
|
1502
|
+
const { ctx: t, status: a } = this._processInputParams(e), s = this._def;
|
|
1503
|
+
if (t.parsedType !== l.array)
|
|
1504
|
+
return u(t, {
|
|
1518
1505
|
code: d.invalid_type,
|
|
1519
|
-
expected:
|
|
1506
|
+
expected: l.array,
|
|
1520
1507
|
received: t.parsedType
|
|
1521
|
-
}),
|
|
1522
|
-
if (
|
|
1523
|
-
const
|
|
1524
|
-
(
|
|
1525
|
-
code:
|
|
1526
|
-
minimum: o ?
|
|
1527
|
-
maximum:
|
|
1508
|
+
}), _;
|
|
1509
|
+
if (s.exactLength !== null) {
|
|
1510
|
+
const r = t.data.length > s.exactLength.value, o = t.data.length < s.exactLength.value;
|
|
1511
|
+
(r || o) && (u(t, {
|
|
1512
|
+
code: r ? d.too_big : d.too_small,
|
|
1513
|
+
minimum: o ? s.exactLength.value : void 0,
|
|
1514
|
+
maximum: r ? s.exactLength.value : void 0,
|
|
1528
1515
|
type: "array",
|
|
1529
1516
|
inclusive: !0,
|
|
1530
1517
|
exact: !0,
|
|
1531
|
-
message:
|
|
1532
|
-
}),
|
|
1518
|
+
message: s.exactLength.message
|
|
1519
|
+
}), a.dirty());
|
|
1533
1520
|
}
|
|
1534
|
-
if (
|
|
1521
|
+
if (s.minLength !== null && t.data.length < s.minLength.value && (u(t, {
|
|
1535
1522
|
code: d.too_small,
|
|
1536
|
-
minimum:
|
|
1523
|
+
minimum: s.minLength.value,
|
|
1537
1524
|
type: "array",
|
|
1538
1525
|
inclusive: !0,
|
|
1539
1526
|
exact: !1,
|
|
1540
|
-
message:
|
|
1541
|
-
}),
|
|
1527
|
+
message: s.minLength.message
|
|
1528
|
+
}), a.dirty()), s.maxLength !== null && t.data.length > s.maxLength.value && (u(t, {
|
|
1542
1529
|
code: d.too_big,
|
|
1543
|
-
maximum:
|
|
1530
|
+
maximum: s.maxLength.value,
|
|
1544
1531
|
type: "array",
|
|
1545
1532
|
inclusive: !0,
|
|
1546
1533
|
exact: !1,
|
|
1547
|
-
message:
|
|
1548
|
-
}),
|
|
1549
|
-
return Promise.all([...t.data].map((
|
|
1550
|
-
const
|
|
1551
|
-
return
|
|
1534
|
+
message: s.maxLength.message
|
|
1535
|
+
}), a.dirty()), t.common.async)
|
|
1536
|
+
return Promise.all([...t.data].map((r, o) => s.type._parseAsync(new $(t, r, t.path, o)))).then((r) => N.mergeArray(a, r));
|
|
1537
|
+
const i = [...t.data].map((r, o) => s.type._parseSync(new $(t, r, t.path, o)));
|
|
1538
|
+
return N.mergeArray(a, i);
|
|
1552
1539
|
}
|
|
1553
1540
|
get element() {
|
|
1554
1541
|
return this._def.type;
|
|
1555
1542
|
}
|
|
1556
1543
|
min(e, t) {
|
|
1557
|
-
return new
|
|
1544
|
+
return new Y({
|
|
1558
1545
|
...this._def,
|
|
1559
1546
|
minLength: { value: e, message: p.toString(t) }
|
|
1560
1547
|
});
|
|
1561
1548
|
}
|
|
1562
1549
|
max(e, t) {
|
|
1563
|
-
return new
|
|
1550
|
+
return new Y({
|
|
1564
1551
|
...this._def,
|
|
1565
1552
|
maxLength: { value: e, message: p.toString(t) }
|
|
1566
1553
|
});
|
|
1567
1554
|
}
|
|
1568
1555
|
length(e, t) {
|
|
1569
|
-
return new
|
|
1556
|
+
return new Y({
|
|
1570
1557
|
...this._def,
|
|
1571
1558
|
exactLength: { value: e, message: p.toString(t) }
|
|
1572
1559
|
});
|
|
@@ -1575,131 +1562,131 @@ let z = class we extends v {
|
|
|
1575
1562
|
return this.min(1, e);
|
|
1576
1563
|
}
|
|
1577
1564
|
};
|
|
1578
|
-
|
|
1579
|
-
type:
|
|
1565
|
+
q.create = (n, e) => new q({
|
|
1566
|
+
type: n,
|
|
1580
1567
|
minLength: null,
|
|
1581
1568
|
maxLength: null,
|
|
1582
1569
|
exactLength: null,
|
|
1583
|
-
typeName:
|
|
1584
|
-
...
|
|
1570
|
+
typeName: f.ZodArray,
|
|
1571
|
+
...y(e)
|
|
1585
1572
|
});
|
|
1586
|
-
function
|
|
1587
|
-
if (
|
|
1573
|
+
function M(n) {
|
|
1574
|
+
if (n instanceof T) {
|
|
1588
1575
|
const e = {};
|
|
1589
|
-
for (const t in
|
|
1590
|
-
const
|
|
1591
|
-
e[t] =
|
|
1576
|
+
for (const t in n.shape) {
|
|
1577
|
+
const a = n.shape[t];
|
|
1578
|
+
e[t] = I.create(M(a));
|
|
1592
1579
|
}
|
|
1593
1580
|
return new T({
|
|
1594
|
-
...
|
|
1581
|
+
...n._def,
|
|
1595
1582
|
shape: () => e
|
|
1596
1583
|
});
|
|
1597
|
-
} else return
|
|
1598
|
-
...
|
|
1599
|
-
type:
|
|
1600
|
-
}) :
|
|
1584
|
+
} else return n instanceof q ? new q({
|
|
1585
|
+
...n._def,
|
|
1586
|
+
type: M(n.element)
|
|
1587
|
+
}) : n instanceof I ? I.create(M(n.unwrap())) : n instanceof V ? V.create(M(n.unwrap())) : n instanceof R ? R.create(n.items.map((e) => M(e))) : n;
|
|
1601
1588
|
}
|
|
1602
|
-
let T = class
|
|
1589
|
+
let T = class S extends v {
|
|
1603
1590
|
constructor() {
|
|
1604
1591
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1605
1592
|
}
|
|
1606
1593
|
_getCached() {
|
|
1607
1594
|
if (this._cached !== null)
|
|
1608
1595
|
return this._cached;
|
|
1609
|
-
const e = this._def.shape(), t =
|
|
1610
|
-
return this._cached = { shape: e, keys: t };
|
|
1596
|
+
const e = this._def.shape(), t = b.objectKeys(e);
|
|
1597
|
+
return this._cached = { shape: e, keys: t }, this._cached;
|
|
1611
1598
|
}
|
|
1612
1599
|
_parse(e) {
|
|
1613
|
-
if (this._getType(e) !==
|
|
1600
|
+
if (this._getType(e) !== l.object) {
|
|
1614
1601
|
const c = this._getOrReturnCtx(e);
|
|
1615
|
-
return
|
|
1602
|
+
return u(c, {
|
|
1616
1603
|
code: d.invalid_type,
|
|
1617
|
-
expected:
|
|
1604
|
+
expected: l.object,
|
|
1618
1605
|
received: c.parsedType
|
|
1619
|
-
}),
|
|
1606
|
+
}), _;
|
|
1620
1607
|
}
|
|
1621
|
-
const { status: t, ctx:
|
|
1622
|
-
if (!(this._def.catchall instanceof
|
|
1623
|
-
for (const c in
|
|
1624
|
-
|
|
1608
|
+
const { status: t, ctx: a } = this._processInputParams(e), { shape: s, keys: i } = this._getCached(), r = [];
|
|
1609
|
+
if (!(this._def.catchall instanceof E && this._def.unknownKeys === "strip"))
|
|
1610
|
+
for (const c in a.data)
|
|
1611
|
+
i.includes(c) || r.push(c);
|
|
1625
1612
|
const o = [];
|
|
1626
|
-
for (const c of
|
|
1627
|
-
const
|
|
1613
|
+
for (const c of i) {
|
|
1614
|
+
const h = s[c], m = a.data[c];
|
|
1628
1615
|
o.push({
|
|
1629
1616
|
key: { status: "valid", value: c },
|
|
1630
|
-
value:
|
|
1631
|
-
alwaysSet: c in
|
|
1617
|
+
value: h._parse(new $(a, m, a.path, c)),
|
|
1618
|
+
alwaysSet: c in a.data
|
|
1632
1619
|
});
|
|
1633
1620
|
}
|
|
1634
|
-
if (this._def.catchall instanceof
|
|
1621
|
+
if (this._def.catchall instanceof E) {
|
|
1635
1622
|
const c = this._def.unknownKeys;
|
|
1636
1623
|
if (c === "passthrough")
|
|
1637
|
-
for (const
|
|
1624
|
+
for (const h of r)
|
|
1638
1625
|
o.push({
|
|
1639
|
-
key: { status: "valid", value:
|
|
1640
|
-
value: { status: "valid", value:
|
|
1626
|
+
key: { status: "valid", value: h },
|
|
1627
|
+
value: { status: "valid", value: a.data[h] }
|
|
1641
1628
|
});
|
|
1642
1629
|
else if (c === "strict")
|
|
1643
|
-
|
|
1630
|
+
r.length > 0 && (u(a, {
|
|
1644
1631
|
code: d.unrecognized_keys,
|
|
1645
|
-
keys:
|
|
1632
|
+
keys: r
|
|
1646
1633
|
}), t.dirty());
|
|
1647
1634
|
else if (c !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
1648
1635
|
} else {
|
|
1649
1636
|
const c = this._def.catchall;
|
|
1650
|
-
for (const
|
|
1651
|
-
const
|
|
1637
|
+
for (const h of r) {
|
|
1638
|
+
const m = a.data[h];
|
|
1652
1639
|
o.push({
|
|
1653
|
-
key: { status: "valid", value:
|
|
1640
|
+
key: { status: "valid", value: h },
|
|
1654
1641
|
value: c._parse(
|
|
1655
|
-
new
|
|
1642
|
+
new $(a, m, a.path, h)
|
|
1656
1643
|
//, ctx.child(key), value, getParsedType(value)
|
|
1657
1644
|
),
|
|
1658
|
-
alwaysSet:
|
|
1645
|
+
alwaysSet: h in a.data
|
|
1659
1646
|
});
|
|
1660
1647
|
}
|
|
1661
1648
|
}
|
|
1662
|
-
return
|
|
1649
|
+
return a.common.async ? Promise.resolve().then(async () => {
|
|
1663
1650
|
const c = [];
|
|
1664
|
-
for (const
|
|
1665
|
-
const
|
|
1651
|
+
for (const h of o) {
|
|
1652
|
+
const m = await h.key, w = await h.value;
|
|
1666
1653
|
c.push({
|
|
1667
|
-
key:
|
|
1668
|
-
value:
|
|
1669
|
-
alwaysSet:
|
|
1654
|
+
key: m,
|
|
1655
|
+
value: w,
|
|
1656
|
+
alwaysSet: h.alwaysSet
|
|
1670
1657
|
});
|
|
1671
1658
|
}
|
|
1672
1659
|
return c;
|
|
1673
|
-
}).then((c) =>
|
|
1660
|
+
}).then((c) => N.mergeObjectSync(t, c)) : N.mergeObjectSync(t, o);
|
|
1674
1661
|
}
|
|
1675
1662
|
get shape() {
|
|
1676
1663
|
return this._def.shape();
|
|
1677
1664
|
}
|
|
1678
1665
|
strict(e) {
|
|
1679
|
-
return p.errToObj, new
|
|
1666
|
+
return p.errToObj, new S({
|
|
1680
1667
|
...this._def,
|
|
1681
1668
|
unknownKeys: "strict",
|
|
1682
1669
|
...e !== void 0 ? {
|
|
1683
|
-
errorMap: (t,
|
|
1684
|
-
var
|
|
1685
|
-
const
|
|
1670
|
+
errorMap: (t, a) => {
|
|
1671
|
+
var s, i;
|
|
1672
|
+
const r = ((i = (s = this._def).errorMap) == null ? void 0 : i.call(s, t, a).message) ?? a.defaultError;
|
|
1686
1673
|
return t.code === "unrecognized_keys" ? {
|
|
1687
|
-
message:
|
|
1674
|
+
message: p.errToObj(e).message ?? r
|
|
1688
1675
|
} : {
|
|
1689
|
-
message:
|
|
1676
|
+
message: r
|
|
1690
1677
|
};
|
|
1691
1678
|
}
|
|
1692
1679
|
} : {}
|
|
1693
1680
|
});
|
|
1694
1681
|
}
|
|
1695
1682
|
strip() {
|
|
1696
|
-
return new
|
|
1683
|
+
return new S({
|
|
1697
1684
|
...this._def,
|
|
1698
1685
|
unknownKeys: "strip"
|
|
1699
1686
|
});
|
|
1700
1687
|
}
|
|
1701
1688
|
passthrough() {
|
|
1702
|
-
return new
|
|
1689
|
+
return new S({
|
|
1703
1690
|
...this._def,
|
|
1704
1691
|
unknownKeys: "passthrough"
|
|
1705
1692
|
});
|
|
@@ -1722,7 +1709,7 @@ let T = class N extends v {
|
|
|
1722
1709
|
// }) as any;
|
|
1723
1710
|
// };
|
|
1724
1711
|
extend(e) {
|
|
1725
|
-
return new
|
|
1712
|
+
return new S({
|
|
1726
1713
|
...this._def,
|
|
1727
1714
|
shape: () => ({
|
|
1728
1715
|
...this._def.shape(),
|
|
@@ -1736,14 +1723,14 @@ let T = class N extends v {
|
|
|
1736
1723
|
* upgrade if you are experiencing issues.
|
|
1737
1724
|
*/
|
|
1738
1725
|
merge(e) {
|
|
1739
|
-
return new
|
|
1726
|
+
return new S({
|
|
1740
1727
|
unknownKeys: e._def.unknownKeys,
|
|
1741
1728
|
catchall: e._def.catchall,
|
|
1742
1729
|
shape: () => ({
|
|
1743
1730
|
...this._def.shape(),
|
|
1744
1731
|
...e._def.shape()
|
|
1745
1732
|
}),
|
|
1746
|
-
typeName:
|
|
1733
|
+
typeName: f.ZodObject
|
|
1747
1734
|
});
|
|
1748
1735
|
}
|
|
1749
1736
|
// merge<
|
|
@@ -1806,25 +1793,25 @@ let T = class N extends v {
|
|
|
1806
1793
|
// return merged;
|
|
1807
1794
|
// }
|
|
1808
1795
|
catchall(e) {
|
|
1809
|
-
return new
|
|
1796
|
+
return new S({
|
|
1810
1797
|
...this._def,
|
|
1811
1798
|
catchall: e
|
|
1812
1799
|
});
|
|
1813
1800
|
}
|
|
1814
1801
|
pick(e) {
|
|
1815
1802
|
const t = {};
|
|
1816
|
-
|
|
1817
|
-
e[
|
|
1818
|
-
|
|
1803
|
+
for (const a of b.objectKeys(e))
|
|
1804
|
+
e[a] && this.shape[a] && (t[a] = this.shape[a]);
|
|
1805
|
+
return new S({
|
|
1819
1806
|
...this._def,
|
|
1820
1807
|
shape: () => t
|
|
1821
1808
|
});
|
|
1822
1809
|
}
|
|
1823
1810
|
omit(e) {
|
|
1824
1811
|
const t = {};
|
|
1825
|
-
|
|
1826
|
-
e[
|
|
1827
|
-
|
|
1812
|
+
for (const a of b.objectKeys(this.shape))
|
|
1813
|
+
e[a] || (t[a] = this.shape[a]);
|
|
1814
|
+
return new S({
|
|
1828
1815
|
...this._def,
|
|
1829
1816
|
shape: () => t
|
|
1830
1817
|
});
|
|
@@ -1833,78 +1820,79 @@ let T = class N extends v {
|
|
|
1833
1820
|
* @deprecated
|
|
1834
1821
|
*/
|
|
1835
1822
|
deepPartial() {
|
|
1836
|
-
return
|
|
1823
|
+
return M(this);
|
|
1837
1824
|
}
|
|
1838
1825
|
partial(e) {
|
|
1839
1826
|
const t = {};
|
|
1840
|
-
|
|
1841
|
-
const
|
|
1842
|
-
e && !e[
|
|
1843
|
-
}
|
|
1827
|
+
for (const a of b.objectKeys(this.shape)) {
|
|
1828
|
+
const s = this.shape[a];
|
|
1829
|
+
e && !e[a] ? t[a] = s : t[a] = s.optional();
|
|
1830
|
+
}
|
|
1831
|
+
return new S({
|
|
1844
1832
|
...this._def,
|
|
1845
1833
|
shape: () => t
|
|
1846
1834
|
});
|
|
1847
1835
|
}
|
|
1848
1836
|
required(e) {
|
|
1849
1837
|
const t = {};
|
|
1850
|
-
|
|
1851
|
-
if (e && !e[
|
|
1852
|
-
t[
|
|
1838
|
+
for (const a of b.objectKeys(this.shape))
|
|
1839
|
+
if (e && !e[a])
|
|
1840
|
+
t[a] = this.shape[a];
|
|
1853
1841
|
else {
|
|
1854
|
-
let
|
|
1855
|
-
for (;
|
|
1856
|
-
|
|
1857
|
-
t[
|
|
1842
|
+
let s = this.shape[a];
|
|
1843
|
+
for (; s instanceof I; )
|
|
1844
|
+
s = s._def.innerType;
|
|
1845
|
+
t[a] = s;
|
|
1858
1846
|
}
|
|
1859
|
-
|
|
1847
|
+
return new S({
|
|
1860
1848
|
...this._def,
|
|
1861
1849
|
shape: () => t
|
|
1862
1850
|
});
|
|
1863
1851
|
}
|
|
1864
1852
|
keyof() {
|
|
1865
|
-
return
|
|
1853
|
+
return Me(b.objectKeys(this.shape));
|
|
1866
1854
|
}
|
|
1867
1855
|
};
|
|
1868
|
-
T.create = (
|
|
1869
|
-
shape: () =>
|
|
1856
|
+
T.create = (n, e) => new T({
|
|
1857
|
+
shape: () => n,
|
|
1870
1858
|
unknownKeys: "strip",
|
|
1871
|
-
catchall:
|
|
1872
|
-
typeName:
|
|
1873
|
-
...
|
|
1859
|
+
catchall: E.create(),
|
|
1860
|
+
typeName: f.ZodObject,
|
|
1861
|
+
...y(e)
|
|
1874
1862
|
});
|
|
1875
|
-
T.strictCreate = (
|
|
1876
|
-
shape: () =>
|
|
1863
|
+
T.strictCreate = (n, e) => new T({
|
|
1864
|
+
shape: () => n,
|
|
1877
1865
|
unknownKeys: "strict",
|
|
1878
|
-
catchall:
|
|
1879
|
-
typeName:
|
|
1880
|
-
...
|
|
1866
|
+
catchall: E.create(),
|
|
1867
|
+
typeName: f.ZodObject,
|
|
1868
|
+
...y(e)
|
|
1881
1869
|
});
|
|
1882
|
-
T.lazycreate = (
|
|
1883
|
-
shape:
|
|
1870
|
+
T.lazycreate = (n, e) => new T({
|
|
1871
|
+
shape: n,
|
|
1884
1872
|
unknownKeys: "strip",
|
|
1885
|
-
catchall:
|
|
1886
|
-
typeName:
|
|
1887
|
-
...
|
|
1873
|
+
catchall: E.create(),
|
|
1874
|
+
typeName: f.ZodObject,
|
|
1875
|
+
...y(e)
|
|
1888
1876
|
});
|
|
1889
|
-
class
|
|
1877
|
+
let Q = class extends v {
|
|
1890
1878
|
_parse(e) {
|
|
1891
|
-
const { ctx: t } = this._processInputParams(e),
|
|
1892
|
-
function
|
|
1893
|
-
for (const o of
|
|
1879
|
+
const { ctx: t } = this._processInputParams(e), a = this._def.options;
|
|
1880
|
+
function s(i) {
|
|
1881
|
+
for (const o of i)
|
|
1894
1882
|
if (o.result.status === "valid")
|
|
1895
1883
|
return o.result;
|
|
1896
|
-
for (const o of
|
|
1884
|
+
for (const o of i)
|
|
1897
1885
|
if (o.result.status === "dirty")
|
|
1898
1886
|
return t.common.issues.push(...o.ctx.common.issues), o.result;
|
|
1899
|
-
const
|
|
1900
|
-
return
|
|
1887
|
+
const r = i.map((o) => new C(o.ctx.common.issues));
|
|
1888
|
+
return u(t, {
|
|
1901
1889
|
code: d.invalid_union,
|
|
1902
|
-
unionErrors:
|
|
1903
|
-
}),
|
|
1890
|
+
unionErrors: r
|
|
1891
|
+
}), _;
|
|
1904
1892
|
}
|
|
1905
1893
|
if (t.common.async)
|
|
1906
|
-
return Promise.all(
|
|
1907
|
-
const
|
|
1894
|
+
return Promise.all(a.map(async (i) => {
|
|
1895
|
+
const r = {
|
|
1908
1896
|
...t,
|
|
1909
1897
|
common: {
|
|
1910
1898
|
...t.common,
|
|
@@ -1913,271 +1901,167 @@ class ne extends v {
|
|
|
1913
1901
|
parent: null
|
|
1914
1902
|
};
|
|
1915
1903
|
return {
|
|
1916
|
-
result: await
|
|
1904
|
+
result: await i._parseAsync({
|
|
1917
1905
|
data: t.data,
|
|
1918
1906
|
path: t.path,
|
|
1919
|
-
parent:
|
|
1907
|
+
parent: r
|
|
1920
1908
|
}),
|
|
1921
|
-
ctx:
|
|
1909
|
+
ctx: r
|
|
1922
1910
|
};
|
|
1923
|
-
})).then(
|
|
1911
|
+
})).then(s);
|
|
1924
1912
|
{
|
|
1925
|
-
let
|
|
1926
|
-
const
|
|
1927
|
-
for (const c of
|
|
1928
|
-
const
|
|
1913
|
+
let i;
|
|
1914
|
+
const r = [];
|
|
1915
|
+
for (const c of a) {
|
|
1916
|
+
const h = {
|
|
1929
1917
|
...t,
|
|
1930
1918
|
common: {
|
|
1931
1919
|
...t.common,
|
|
1932
1920
|
issues: []
|
|
1933
1921
|
},
|
|
1934
1922
|
parent: null
|
|
1935
|
-
},
|
|
1923
|
+
}, m = c._parseSync({
|
|
1936
1924
|
data: t.data,
|
|
1937
1925
|
path: t.path,
|
|
1938
|
-
parent:
|
|
1926
|
+
parent: h
|
|
1939
1927
|
});
|
|
1940
|
-
if (
|
|
1941
|
-
return
|
|
1942
|
-
|
|
1928
|
+
if (m.status === "valid")
|
|
1929
|
+
return m;
|
|
1930
|
+
m.status === "dirty" && !i && (i = { result: m, ctx: h }), h.common.issues.length && r.push(h.common.issues);
|
|
1943
1931
|
}
|
|
1944
|
-
if (
|
|
1945
|
-
return t.common.issues.push(...
|
|
1946
|
-
const o =
|
|
1947
|
-
return
|
|
1932
|
+
if (i)
|
|
1933
|
+
return t.common.issues.push(...i.ctx.common.issues), i.result;
|
|
1934
|
+
const o = r.map((c) => new C(c));
|
|
1935
|
+
return u(t, {
|
|
1948
1936
|
code: d.invalid_union,
|
|
1949
1937
|
unionErrors: o
|
|
1950
|
-
}),
|
|
1938
|
+
}), _;
|
|
1951
1939
|
}
|
|
1952
1940
|
}
|
|
1953
1941
|
get options() {
|
|
1954
1942
|
return this._def.options;
|
|
1955
1943
|
}
|
|
1956
|
-
}
|
|
1957
|
-
|
|
1958
|
-
options:
|
|
1959
|
-
typeName:
|
|
1960
|
-
...
|
|
1944
|
+
};
|
|
1945
|
+
Q.create = (n, e) => new Q({
|
|
1946
|
+
options: n,
|
|
1947
|
+
typeName: f.ZodUnion,
|
|
1948
|
+
...y(e)
|
|
1961
1949
|
});
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
received: t.parsedType
|
|
1971
|
-
}), y;
|
|
1972
|
-
const s = this.discriminator, n = t.data[s], r = this.optionsMap.get(n);
|
|
1973
|
-
return r ? t.common.async ? r._parseAsync({
|
|
1974
|
-
data: t.data,
|
|
1975
|
-
path: t.path,
|
|
1976
|
-
parent: t
|
|
1977
|
-
}) : r._parseSync({
|
|
1978
|
-
data: t.data,
|
|
1979
|
-
path: t.path,
|
|
1980
|
-
parent: t
|
|
1981
|
-
}) : (l(t, {
|
|
1982
|
-
code: d.invalid_union_discriminator,
|
|
1983
|
-
options: Array.from(this.optionsMap.keys()),
|
|
1984
|
-
path: [s]
|
|
1985
|
-
}), y);
|
|
1986
|
-
}
|
|
1987
|
-
get discriminator() {
|
|
1988
|
-
return this._def.discriminator;
|
|
1989
|
-
}
|
|
1990
|
-
get options() {
|
|
1991
|
-
return this._def.options;
|
|
1992
|
-
}
|
|
1993
|
-
get optionsMap() {
|
|
1994
|
-
return this._def.optionsMap;
|
|
1995
|
-
}
|
|
1996
|
-
/**
|
|
1997
|
-
* The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
|
|
1998
|
-
* However, it only allows a union of objects, all of which need to share a discriminator property. This property must
|
|
1999
|
-
* have a different value for each object in the union.
|
|
2000
|
-
* @param discriminator the name of the discriminator property
|
|
2001
|
-
* @param types an array of object schemas
|
|
2002
|
-
* @param params
|
|
2003
|
-
*/
|
|
2004
|
-
static create(e, t, s) {
|
|
2005
|
-
const n = /* @__PURE__ */ new Map();
|
|
2006
|
-
for (const r of t) {
|
|
2007
|
-
const i = P(r.shape[e]);
|
|
2008
|
-
if (!i.length)
|
|
2009
|
-
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
2010
|
-
for (const o of i) {
|
|
2011
|
-
if (n.has(o))
|
|
2012
|
-
throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);
|
|
2013
|
-
n.set(o, r);
|
|
2014
|
-
}
|
|
2015
|
-
}
|
|
2016
|
-
return new Ae({
|
|
2017
|
-
typeName: m.ZodDiscriminatedUnion,
|
|
2018
|
-
discriminator: e,
|
|
2019
|
-
options: t,
|
|
2020
|
-
optionsMap: n,
|
|
2021
|
-
..._(s)
|
|
2022
|
-
});
|
|
2023
|
-
}
|
|
2024
|
-
}
|
|
2025
|
-
function De(a, e) {
|
|
2026
|
-
const t = j(a), s = j(e);
|
|
2027
|
-
if (a === e)
|
|
2028
|
-
return { valid: !0, data: a };
|
|
2029
|
-
if (t === h.object && s === h.object) {
|
|
2030
|
-
const n = w.objectKeys(e), r = w.objectKeys(a).filter((o) => n.indexOf(o) !== -1), i = { ...a, ...e };
|
|
2031
|
-
for (const o of r) {
|
|
2032
|
-
const c = De(a[o], e[o]);
|
|
1950
|
+
function de(n, e) {
|
|
1951
|
+
const t = O(n), a = O(e);
|
|
1952
|
+
if (n === e)
|
|
1953
|
+
return { valid: !0, data: n };
|
|
1954
|
+
if (t === l.object && a === l.object) {
|
|
1955
|
+
const s = b.objectKeys(e), i = b.objectKeys(n).filter((o) => s.indexOf(o) !== -1), r = { ...n, ...e };
|
|
1956
|
+
for (const o of i) {
|
|
1957
|
+
const c = de(n[o], e[o]);
|
|
2033
1958
|
if (!c.valid)
|
|
2034
1959
|
return { valid: !1 };
|
|
2035
|
-
|
|
1960
|
+
r[o] = c.data;
|
|
2036
1961
|
}
|
|
2037
|
-
return { valid: !0, data:
|
|
2038
|
-
} else if (t ===
|
|
2039
|
-
if (
|
|
1962
|
+
return { valid: !0, data: r };
|
|
1963
|
+
} else if (t === l.array && a === l.array) {
|
|
1964
|
+
if (n.length !== e.length)
|
|
2040
1965
|
return { valid: !1 };
|
|
2041
|
-
const
|
|
2042
|
-
for (let
|
|
2043
|
-
const
|
|
1966
|
+
const s = [];
|
|
1967
|
+
for (let i = 0; i < n.length; i++) {
|
|
1968
|
+
const r = n[i], o = e[i], c = de(r, o);
|
|
2044
1969
|
if (!c.valid)
|
|
2045
1970
|
return { valid: !1 };
|
|
2046
|
-
|
|
1971
|
+
s.push(c.data);
|
|
2047
1972
|
}
|
|
2048
|
-
return { valid: !0, data:
|
|
2049
|
-
} else return t ===
|
|
1973
|
+
return { valid: !0, data: s };
|
|
1974
|
+
} else return t === l.date && a === l.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
|
|
2050
1975
|
}
|
|
2051
|
-
class
|
|
1976
|
+
let ee = class extends v {
|
|
2052
1977
|
_parse(e) {
|
|
2053
|
-
const { status: t, ctx:
|
|
2054
|
-
if (
|
|
2055
|
-
return
|
|
2056
|
-
const o =
|
|
2057
|
-
return o.valid ? ((
|
|
1978
|
+
const { status: t, ctx: a } = this._processInputParams(e), s = (i, r) => {
|
|
1979
|
+
if (ve(i) || ve(r))
|
|
1980
|
+
return _;
|
|
1981
|
+
const o = de(i.value, r.value);
|
|
1982
|
+
return o.valid ? ((be(i) || be(r)) && t.dirty(), { status: t.value, value: o.data }) : (u(a, {
|
|
2058
1983
|
code: d.invalid_intersection_types
|
|
2059
|
-
}),
|
|
1984
|
+
}), _);
|
|
2060
1985
|
};
|
|
2061
|
-
return
|
|
1986
|
+
return a.common.async ? Promise.all([
|
|
2062
1987
|
this._def.left._parseAsync({
|
|
2063
|
-
data:
|
|
2064
|
-
path:
|
|
2065
|
-
parent:
|
|
1988
|
+
data: a.data,
|
|
1989
|
+
path: a.path,
|
|
1990
|
+
parent: a
|
|
2066
1991
|
}),
|
|
2067
1992
|
this._def.right._parseAsync({
|
|
2068
|
-
data:
|
|
2069
|
-
path:
|
|
2070
|
-
parent:
|
|
1993
|
+
data: a.data,
|
|
1994
|
+
path: a.path,
|
|
1995
|
+
parent: a
|
|
2071
1996
|
})
|
|
2072
|
-
]).then(([
|
|
2073
|
-
data:
|
|
2074
|
-
path:
|
|
2075
|
-
parent:
|
|
1997
|
+
]).then(([i, r]) => s(i, r)) : s(this._def.left._parseSync({
|
|
1998
|
+
data: a.data,
|
|
1999
|
+
path: a.path,
|
|
2000
|
+
parent: a
|
|
2076
2001
|
}), this._def.right._parseSync({
|
|
2077
|
-
data:
|
|
2078
|
-
path:
|
|
2079
|
-
parent:
|
|
2002
|
+
data: a.data,
|
|
2003
|
+
path: a.path,
|
|
2004
|
+
parent: a
|
|
2080
2005
|
}));
|
|
2081
2006
|
}
|
|
2082
|
-
}
|
|
2083
|
-
|
|
2084
|
-
left:
|
|
2007
|
+
};
|
|
2008
|
+
ee.create = (n, e, t) => new ee({
|
|
2009
|
+
left: n,
|
|
2085
2010
|
right: e,
|
|
2086
|
-
typeName:
|
|
2087
|
-
...
|
|
2011
|
+
typeName: f.ZodIntersection,
|
|
2012
|
+
...y(t)
|
|
2088
2013
|
});
|
|
2089
|
-
|
|
2014
|
+
class R extends v {
|
|
2090
2015
|
_parse(e) {
|
|
2091
|
-
const { status: t, ctx:
|
|
2092
|
-
if (
|
|
2093
|
-
return
|
|
2016
|
+
const { status: t, ctx: a } = this._processInputParams(e);
|
|
2017
|
+
if (a.parsedType !== l.array)
|
|
2018
|
+
return u(a, {
|
|
2094
2019
|
code: d.invalid_type,
|
|
2095
|
-
expected:
|
|
2096
|
-
received:
|
|
2097
|
-
}),
|
|
2098
|
-
if (
|
|
2099
|
-
return
|
|
2020
|
+
expected: l.array,
|
|
2021
|
+
received: a.parsedType
|
|
2022
|
+
}), _;
|
|
2023
|
+
if (a.data.length < this._def.items.length)
|
|
2024
|
+
return u(a, {
|
|
2100
2025
|
code: d.too_small,
|
|
2101
2026
|
minimum: this._def.items.length,
|
|
2102
2027
|
inclusive: !0,
|
|
2103
2028
|
exact: !1,
|
|
2104
2029
|
type: "array"
|
|
2105
|
-
}),
|
|
2106
|
-
!this._def.rest &&
|
|
2030
|
+
}), _;
|
|
2031
|
+
!this._def.rest && a.data.length > this._def.items.length && (u(a, {
|
|
2107
2032
|
code: d.too_big,
|
|
2108
2033
|
maximum: this._def.items.length,
|
|
2109
2034
|
inclusive: !0,
|
|
2110
2035
|
exact: !1,
|
|
2111
2036
|
type: "array"
|
|
2112
2037
|
}), t.dirty());
|
|
2113
|
-
const
|
|
2114
|
-
const o = this._def.items[
|
|
2115
|
-
return o ? o._parse(new
|
|
2116
|
-
}).filter((
|
|
2117
|
-
return
|
|
2038
|
+
const s = [...a.data].map((i, r) => {
|
|
2039
|
+
const o = this._def.items[r] || this._def.rest;
|
|
2040
|
+
return o ? o._parse(new $(a, i, a.path, r)) : null;
|
|
2041
|
+
}).filter((i) => !!i);
|
|
2042
|
+
return a.common.async ? Promise.all(s).then((i) => N.mergeArray(t, i)) : N.mergeArray(t, s);
|
|
2118
2043
|
}
|
|
2119
2044
|
get items() {
|
|
2120
2045
|
return this._def.items;
|
|
2121
2046
|
}
|
|
2122
2047
|
rest(e) {
|
|
2123
|
-
return new
|
|
2048
|
+
return new R({
|
|
2124
2049
|
...this._def,
|
|
2125
2050
|
rest: e
|
|
2126
2051
|
});
|
|
2127
2052
|
}
|
|
2128
|
-
}
|
|
2129
|
-
R.create = (
|
|
2130
|
-
if (!Array.isArray(
|
|
2053
|
+
}
|
|
2054
|
+
R.create = (n, e) => {
|
|
2055
|
+
if (!Array.isArray(n))
|
|
2131
2056
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2132
2057
|
return new R({
|
|
2133
|
-
items:
|
|
2134
|
-
typeName:
|
|
2058
|
+
items: n,
|
|
2059
|
+
typeName: f.ZodTuple,
|
|
2135
2060
|
rest: null,
|
|
2136
|
-
...
|
|
2061
|
+
...y(e)
|
|
2137
2062
|
});
|
|
2138
2063
|
};
|
|
2139
|
-
class
|
|
2140
|
-
get keySchema() {
|
|
2141
|
-
return this._def.keyType;
|
|
2142
|
-
}
|
|
2143
|
-
get valueSchema() {
|
|
2144
|
-
return this._def.valueType;
|
|
2145
|
-
}
|
|
2146
|
-
_parse(e) {
|
|
2147
|
-
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2148
|
-
if (s.parsedType !== h.object)
|
|
2149
|
-
return l(s, {
|
|
2150
|
-
code: d.invalid_type,
|
|
2151
|
-
expected: h.object,
|
|
2152
|
-
received: s.parsedType
|
|
2153
|
-
}), y;
|
|
2154
|
-
const n = [], r = this._def.keyType, i = this._def.valueType;
|
|
2155
|
-
for (const o in s.data)
|
|
2156
|
-
n.push({
|
|
2157
|
-
key: r._parse(new I(s, o, s.path, o)),
|
|
2158
|
-
value: i._parse(new I(s, s.data[o], s.path, o)),
|
|
2159
|
-
alwaysSet: o in s.data
|
|
2160
|
-
});
|
|
2161
|
-
return s.common.async ? S.mergeObjectAsync(t, n) : S.mergeObjectSync(t, n);
|
|
2162
|
-
}
|
|
2163
|
-
get element() {
|
|
2164
|
-
return this._def.valueType;
|
|
2165
|
-
}
|
|
2166
|
-
static create(e, t, s) {
|
|
2167
|
-
return t instanceof v ? new re({
|
|
2168
|
-
keyType: e,
|
|
2169
|
-
valueType: t,
|
|
2170
|
-
typeName: m.ZodRecord,
|
|
2171
|
-
..._(s)
|
|
2172
|
-
}) : new re({
|
|
2173
|
-
keyType: C.create(),
|
|
2174
|
-
valueType: e,
|
|
2175
|
-
typeName: m.ZodRecord,
|
|
2176
|
-
..._(t)
|
|
2177
|
-
});
|
|
2178
|
-
}
|
|
2179
|
-
}
|
|
2180
|
-
class Ce extends v {
|
|
2064
|
+
class Ae extends v {
|
|
2181
2065
|
get keySchema() {
|
|
2182
2066
|
return this._def.keyType;
|
|
2183
2067
|
}
|
|
@@ -2185,92 +2069,92 @@ class Ce extends v {
|
|
|
2185
2069
|
return this._def.valueType;
|
|
2186
2070
|
}
|
|
2187
2071
|
_parse(e) {
|
|
2188
|
-
const { status: t, ctx:
|
|
2189
|
-
if (
|
|
2190
|
-
return
|
|
2072
|
+
const { status: t, ctx: a } = this._processInputParams(e);
|
|
2073
|
+
if (a.parsedType !== l.map)
|
|
2074
|
+
return u(a, {
|
|
2191
2075
|
code: d.invalid_type,
|
|
2192
|
-
expected:
|
|
2193
|
-
received:
|
|
2194
|
-
}),
|
|
2195
|
-
const
|
|
2196
|
-
key:
|
|
2197
|
-
value:
|
|
2076
|
+
expected: l.map,
|
|
2077
|
+
received: a.parsedType
|
|
2078
|
+
}), _;
|
|
2079
|
+
const s = this._def.keyType, i = this._def.valueType, r = [...a.data.entries()].map(([o, c], h) => ({
|
|
2080
|
+
key: s._parse(new $(a, o, a.path, [h, "key"])),
|
|
2081
|
+
value: i._parse(new $(a, c, a.path, [h, "value"]))
|
|
2198
2082
|
}));
|
|
2199
|
-
if (
|
|
2083
|
+
if (a.common.async) {
|
|
2200
2084
|
const o = /* @__PURE__ */ new Map();
|
|
2201
2085
|
return Promise.resolve().then(async () => {
|
|
2202
|
-
for (const c of
|
|
2203
|
-
const
|
|
2204
|
-
if (
|
|
2205
|
-
return
|
|
2206
|
-
(
|
|
2086
|
+
for (const c of r) {
|
|
2087
|
+
const h = await c.key, m = await c.value;
|
|
2088
|
+
if (h.status === "aborted" || m.status === "aborted")
|
|
2089
|
+
return _;
|
|
2090
|
+
(h.status === "dirty" || m.status === "dirty") && t.dirty(), o.set(h.value, m.value);
|
|
2207
2091
|
}
|
|
2208
2092
|
return { status: t.value, value: o };
|
|
2209
2093
|
});
|
|
2210
2094
|
} else {
|
|
2211
2095
|
const o = /* @__PURE__ */ new Map();
|
|
2212
|
-
for (const c of
|
|
2213
|
-
const
|
|
2214
|
-
if (
|
|
2215
|
-
return
|
|
2216
|
-
(
|
|
2096
|
+
for (const c of r) {
|
|
2097
|
+
const h = c.key, m = c.value;
|
|
2098
|
+
if (h.status === "aborted" || m.status === "aborted")
|
|
2099
|
+
return _;
|
|
2100
|
+
(h.status === "dirty" || m.status === "dirty") && t.dirty(), o.set(h.value, m.value);
|
|
2217
2101
|
}
|
|
2218
2102
|
return { status: t.value, value: o };
|
|
2219
2103
|
}
|
|
2220
2104
|
}
|
|
2221
2105
|
}
|
|
2222
|
-
|
|
2106
|
+
Ae.create = (n, e, t) => new Ae({
|
|
2223
2107
|
valueType: e,
|
|
2224
|
-
keyType:
|
|
2225
|
-
typeName:
|
|
2226
|
-
...
|
|
2108
|
+
keyType: n,
|
|
2109
|
+
typeName: f.ZodMap,
|
|
2110
|
+
...y(t)
|
|
2227
2111
|
});
|
|
2228
|
-
class
|
|
2112
|
+
class H extends v {
|
|
2229
2113
|
_parse(e) {
|
|
2230
|
-
const { status: t, ctx:
|
|
2231
|
-
if (
|
|
2232
|
-
return
|
|
2114
|
+
const { status: t, ctx: a } = this._processInputParams(e);
|
|
2115
|
+
if (a.parsedType !== l.set)
|
|
2116
|
+
return u(a, {
|
|
2233
2117
|
code: d.invalid_type,
|
|
2234
|
-
expected:
|
|
2235
|
-
received:
|
|
2236
|
-
}),
|
|
2237
|
-
const
|
|
2238
|
-
|
|
2118
|
+
expected: l.set,
|
|
2119
|
+
received: a.parsedType
|
|
2120
|
+
}), _;
|
|
2121
|
+
const s = this._def;
|
|
2122
|
+
s.minSize !== null && a.data.size < s.minSize.value && (u(a, {
|
|
2239
2123
|
code: d.too_small,
|
|
2240
|
-
minimum:
|
|
2124
|
+
minimum: s.minSize.value,
|
|
2241
2125
|
type: "set",
|
|
2242
2126
|
inclusive: !0,
|
|
2243
2127
|
exact: !1,
|
|
2244
|
-
message:
|
|
2245
|
-
}), t.dirty()),
|
|
2128
|
+
message: s.minSize.message
|
|
2129
|
+
}), t.dirty()), s.maxSize !== null && a.data.size > s.maxSize.value && (u(a, {
|
|
2246
2130
|
code: d.too_big,
|
|
2247
|
-
maximum:
|
|
2131
|
+
maximum: s.maxSize.value,
|
|
2248
2132
|
type: "set",
|
|
2249
2133
|
inclusive: !0,
|
|
2250
2134
|
exact: !1,
|
|
2251
|
-
message:
|
|
2135
|
+
message: s.maxSize.message
|
|
2252
2136
|
}), t.dirty());
|
|
2253
|
-
const
|
|
2254
|
-
function
|
|
2255
|
-
const
|
|
2256
|
-
for (const
|
|
2257
|
-
if (
|
|
2258
|
-
return
|
|
2259
|
-
|
|
2137
|
+
const i = this._def.valueType;
|
|
2138
|
+
function r(c) {
|
|
2139
|
+
const h = /* @__PURE__ */ new Set();
|
|
2140
|
+
for (const m of c) {
|
|
2141
|
+
if (m.status === "aborted")
|
|
2142
|
+
return _;
|
|
2143
|
+
m.status === "dirty" && t.dirty(), h.add(m.value);
|
|
2260
2144
|
}
|
|
2261
|
-
return { status: t.value, value:
|
|
2145
|
+
return { status: t.value, value: h };
|
|
2262
2146
|
}
|
|
2263
|
-
const o = [...
|
|
2264
|
-
return
|
|
2147
|
+
const o = [...a.data.values()].map((c, h) => i._parse(new $(a, c, a.path, h)));
|
|
2148
|
+
return a.common.async ? Promise.all(o).then((c) => r(c)) : r(o);
|
|
2265
2149
|
}
|
|
2266
2150
|
min(e, t) {
|
|
2267
|
-
return new
|
|
2151
|
+
return new H({
|
|
2268
2152
|
...this._def,
|
|
2269
2153
|
minSize: { value: e, message: p.toString(t) }
|
|
2270
2154
|
});
|
|
2271
2155
|
}
|
|
2272
2156
|
max(e, t) {
|
|
2273
|
-
return new
|
|
2157
|
+
return new H({
|
|
2274
2158
|
...this._def,
|
|
2275
2159
|
maxSize: { value: e, message: p.toString(t) }
|
|
2276
2160
|
});
|
|
@@ -2282,115 +2166,14 @@ class V extends v {
|
|
|
2282
2166
|
return this.min(1, e);
|
|
2283
2167
|
}
|
|
2284
2168
|
}
|
|
2285
|
-
|
|
2286
|
-
valueType:
|
|
2169
|
+
H.create = (n, e) => new H({
|
|
2170
|
+
valueType: n,
|
|
2287
2171
|
minSize: null,
|
|
2288
2172
|
maxSize: null,
|
|
2289
|
-
typeName:
|
|
2290
|
-
...
|
|
2173
|
+
typeName: f.ZodSet,
|
|
2174
|
+
...y(e)
|
|
2291
2175
|
});
|
|
2292
|
-
|
|
2293
|
-
constructor() {
|
|
2294
|
-
super(...arguments), this.validate = this.implement;
|
|
2295
|
-
}
|
|
2296
|
-
_parse(e) {
|
|
2297
|
-
const { ctx: t } = this._processInputParams(e);
|
|
2298
|
-
if (t.parsedType !== h.function)
|
|
2299
|
-
return l(t, {
|
|
2300
|
-
code: d.invalid_type,
|
|
2301
|
-
expected: h.function,
|
|
2302
|
-
received: t.parsedType
|
|
2303
|
-
}), y;
|
|
2304
|
-
function s(o, c) {
|
|
2305
|
-
return xe({
|
|
2306
|
-
data: o,
|
|
2307
|
-
path: t.path,
|
|
2308
|
-
errorMaps: [
|
|
2309
|
-
t.common.contextualErrorMap,
|
|
2310
|
-
t.schemaErrorMap,
|
|
2311
|
-
ke(),
|
|
2312
|
-
H
|
|
2313
|
-
].filter((u) => !!u),
|
|
2314
|
-
issueData: {
|
|
2315
|
-
code: d.invalid_arguments,
|
|
2316
|
-
argumentsError: c
|
|
2317
|
-
}
|
|
2318
|
-
});
|
|
2319
|
-
}
|
|
2320
|
-
function n(o, c) {
|
|
2321
|
-
return xe({
|
|
2322
|
-
data: o,
|
|
2323
|
-
path: t.path,
|
|
2324
|
-
errorMaps: [
|
|
2325
|
-
t.common.contextualErrorMap,
|
|
2326
|
-
t.schemaErrorMap,
|
|
2327
|
-
ke(),
|
|
2328
|
-
H
|
|
2329
|
-
].filter((u) => !!u),
|
|
2330
|
-
issueData: {
|
|
2331
|
-
code: d.invalid_return_type,
|
|
2332
|
-
returnTypeError: c
|
|
2333
|
-
}
|
|
2334
|
-
});
|
|
2335
|
-
}
|
|
2336
|
-
const r = { errorMap: t.common.contextualErrorMap }, i = t.data;
|
|
2337
|
-
if (this._def.returns instanceof W) {
|
|
2338
|
-
const o = this;
|
|
2339
|
-
return x(async function(...c) {
|
|
2340
|
-
const u = new O([]), f = await o._def.args.parseAsync(c, r).catch((Z) => {
|
|
2341
|
-
throw u.addIssue(s(c, Z)), u;
|
|
2342
|
-
}), b = await Reflect.apply(i, this, f);
|
|
2343
|
-
return await o._def.returns._def.type.parseAsync(b, r).catch((Z) => {
|
|
2344
|
-
throw u.addIssue(n(b, Z)), u;
|
|
2345
|
-
});
|
|
2346
|
-
});
|
|
2347
|
-
} else {
|
|
2348
|
-
const o = this;
|
|
2349
|
-
return x(function(...c) {
|
|
2350
|
-
const u = o._def.args.safeParse(c, r);
|
|
2351
|
-
if (!u.success)
|
|
2352
|
-
throw new O([s(c, u.error)]);
|
|
2353
|
-
const f = Reflect.apply(i, this, u.data), b = o._def.returns.safeParse(f, r);
|
|
2354
|
-
if (!b.success)
|
|
2355
|
-
throw new O([n(f, b.error)]);
|
|
2356
|
-
return b.data;
|
|
2357
|
-
});
|
|
2358
|
-
}
|
|
2359
|
-
}
|
|
2360
|
-
parameters() {
|
|
2361
|
-
return this._def.args;
|
|
2362
|
-
}
|
|
2363
|
-
returnType() {
|
|
2364
|
-
return this._def.returns;
|
|
2365
|
-
}
|
|
2366
|
-
args(...e) {
|
|
2367
|
-
return new be({
|
|
2368
|
-
...this._def,
|
|
2369
|
-
args: R.create(e).rest(L.create())
|
|
2370
|
-
});
|
|
2371
|
-
}
|
|
2372
|
-
returns(e) {
|
|
2373
|
-
return new be({
|
|
2374
|
-
...this._def,
|
|
2375
|
-
returns: e
|
|
2376
|
-
});
|
|
2377
|
-
}
|
|
2378
|
-
implement(e) {
|
|
2379
|
-
return this.parse(e);
|
|
2380
|
-
}
|
|
2381
|
-
strictImplement(e) {
|
|
2382
|
-
return this.parse(e);
|
|
2383
|
-
}
|
|
2384
|
-
static create(e, t, s) {
|
|
2385
|
-
return new be({
|
|
2386
|
-
args: e || R.create([]).rest(L.create()),
|
|
2387
|
-
returns: t || L.create(),
|
|
2388
|
-
typeName: m.ZodFunction,
|
|
2389
|
-
..._(s)
|
|
2390
|
-
});
|
|
2391
|
-
}
|
|
2392
|
-
};
|
|
2393
|
-
class oe extends v {
|
|
2176
|
+
class Ie extends v {
|
|
2394
2177
|
get schema() {
|
|
2395
2178
|
return this._def.getter();
|
|
2396
2179
|
}
|
|
@@ -2399,59 +2182,56 @@ class oe extends v {
|
|
|
2399
2182
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
2400
2183
|
}
|
|
2401
2184
|
}
|
|
2402
|
-
|
|
2403
|
-
getter:
|
|
2404
|
-
typeName:
|
|
2405
|
-
...
|
|
2185
|
+
Ie.create = (n, e) => new Ie({
|
|
2186
|
+
getter: n,
|
|
2187
|
+
typeName: f.ZodLazy,
|
|
2188
|
+
...y(e)
|
|
2406
2189
|
});
|
|
2407
|
-
class
|
|
2190
|
+
let ue = class extends v {
|
|
2408
2191
|
_parse(e) {
|
|
2409
2192
|
if (e.data !== this._def.value) {
|
|
2410
2193
|
const t = this._getOrReturnCtx(e);
|
|
2411
|
-
return
|
|
2194
|
+
return u(t, {
|
|
2412
2195
|
received: t.data,
|
|
2413
2196
|
code: d.invalid_literal,
|
|
2414
2197
|
expected: this._def.value
|
|
2415
|
-
}),
|
|
2198
|
+
}), _;
|
|
2416
2199
|
}
|
|
2417
2200
|
return { status: "valid", value: e.data };
|
|
2418
2201
|
}
|
|
2419
2202
|
get value() {
|
|
2420
2203
|
return this._def.value;
|
|
2421
2204
|
}
|
|
2422
|
-
}
|
|
2423
|
-
|
|
2424
|
-
value:
|
|
2425
|
-
typeName:
|
|
2426
|
-
...
|
|
2205
|
+
};
|
|
2206
|
+
ue.create = (n, e) => new ue({
|
|
2207
|
+
value: n,
|
|
2208
|
+
typeName: f.ZodLiteral,
|
|
2209
|
+
...y(e)
|
|
2427
2210
|
});
|
|
2428
|
-
function
|
|
2429
|
-
return new
|
|
2430
|
-
values:
|
|
2431
|
-
typeName:
|
|
2432
|
-
...
|
|
2211
|
+
function Me(n, e) {
|
|
2212
|
+
return new me({
|
|
2213
|
+
values: n,
|
|
2214
|
+
typeName: f.ZodEnum,
|
|
2215
|
+
...y(e)
|
|
2433
2216
|
});
|
|
2434
2217
|
}
|
|
2435
|
-
let
|
|
2436
|
-
constructor() {
|
|
2437
|
-
super(...arguments), J.set(this, void 0);
|
|
2438
|
-
}
|
|
2218
|
+
let me = class le extends v {
|
|
2439
2219
|
_parse(e) {
|
|
2440
2220
|
if (typeof e.data != "string") {
|
|
2441
|
-
const t = this._getOrReturnCtx(e),
|
|
2442
|
-
return
|
|
2443
|
-
expected:
|
|
2221
|
+
const t = this._getOrReturnCtx(e), a = this._def.values;
|
|
2222
|
+
return u(t, {
|
|
2223
|
+
expected: b.joinValues(a),
|
|
2444
2224
|
received: t.parsedType,
|
|
2445
2225
|
code: d.invalid_type
|
|
2446
|
-
}),
|
|
2226
|
+
}), _;
|
|
2447
2227
|
}
|
|
2448
|
-
if (
|
|
2449
|
-
const t = this._getOrReturnCtx(e),
|
|
2450
|
-
return
|
|
2228
|
+
if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data)) {
|
|
2229
|
+
const t = this._getOrReturnCtx(e), a = this._def.values;
|
|
2230
|
+
return u(t, {
|
|
2451
2231
|
received: t.data,
|
|
2452
2232
|
code: d.invalid_enum_value,
|
|
2453
|
-
options:
|
|
2454
|
-
}),
|
|
2233
|
+
options: a
|
|
2234
|
+
}), _;
|
|
2455
2235
|
}
|
|
2456
2236
|
return x(e.data);
|
|
2457
2237
|
}
|
|
@@ -2477,41 +2257,37 @@ let pe = class Le extends v {
|
|
|
2477
2257
|
return e;
|
|
2478
2258
|
}
|
|
2479
2259
|
extract(e, t = this._def) {
|
|
2480
|
-
return
|
|
2260
|
+
return le.create(e, {
|
|
2481
2261
|
...this._def,
|
|
2482
2262
|
...t
|
|
2483
2263
|
});
|
|
2484
2264
|
}
|
|
2485
2265
|
exclude(e, t = this._def) {
|
|
2486
|
-
return
|
|
2266
|
+
return le.create(this.options.filter((a) => !e.includes(a)), {
|
|
2487
2267
|
...this._def,
|
|
2488
2268
|
...t
|
|
2489
2269
|
});
|
|
2490
2270
|
}
|
|
2491
2271
|
};
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
class de extends v {
|
|
2495
|
-
constructor() {
|
|
2496
|
-
super(...arguments), Y.set(this, void 0);
|
|
2497
|
-
}
|
|
2272
|
+
me.create = Me;
|
|
2273
|
+
class $e extends v {
|
|
2498
2274
|
_parse(e) {
|
|
2499
|
-
const t =
|
|
2500
|
-
if (
|
|
2501
|
-
const
|
|
2502
|
-
return
|
|
2503
|
-
expected:
|
|
2504
|
-
received:
|
|
2275
|
+
const t = b.getValidEnumValues(this._def.values), a = this._getOrReturnCtx(e);
|
|
2276
|
+
if (a.parsedType !== l.string && a.parsedType !== l.number) {
|
|
2277
|
+
const s = b.objectValues(t);
|
|
2278
|
+
return u(a, {
|
|
2279
|
+
expected: b.joinValues(s),
|
|
2280
|
+
received: a.parsedType,
|
|
2505
2281
|
code: d.invalid_type
|
|
2506
|
-
}),
|
|
2282
|
+
}), _;
|
|
2507
2283
|
}
|
|
2508
|
-
if (
|
|
2509
|
-
const
|
|
2510
|
-
return
|
|
2511
|
-
received:
|
|
2284
|
+
if (this._cache || (this._cache = new Set(b.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
|
|
2285
|
+
const s = b.objectValues(t);
|
|
2286
|
+
return u(a, {
|
|
2287
|
+
received: a.data,
|
|
2512
2288
|
code: d.invalid_enum_value,
|
|
2513
|
-
options:
|
|
2514
|
-
}),
|
|
2289
|
+
options: s
|
|
2290
|
+
}), _;
|
|
2515
2291
|
}
|
|
2516
2292
|
return x(e.data);
|
|
2517
2293
|
}
|
|
@@ -2519,157 +2295,159 @@ class de extends v {
|
|
|
2519
2295
|
return this._def.values;
|
|
2520
2296
|
}
|
|
2521
2297
|
}
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
..._(e)
|
|
2298
|
+
$e.create = (n, e) => new $e({
|
|
2299
|
+
values: n,
|
|
2300
|
+
typeName: f.ZodNativeEnum,
|
|
2301
|
+
...y(e)
|
|
2527
2302
|
});
|
|
2528
|
-
class
|
|
2303
|
+
let te = class extends v {
|
|
2529
2304
|
unwrap() {
|
|
2530
2305
|
return this._def.type;
|
|
2531
2306
|
}
|
|
2532
2307
|
_parse(e) {
|
|
2533
2308
|
const { ctx: t } = this._processInputParams(e);
|
|
2534
|
-
if (t.parsedType !==
|
|
2535
|
-
return
|
|
2309
|
+
if (t.parsedType !== l.promise && t.common.async === !1)
|
|
2310
|
+
return u(t, {
|
|
2536
2311
|
code: d.invalid_type,
|
|
2537
|
-
expected:
|
|
2312
|
+
expected: l.promise,
|
|
2538
2313
|
received: t.parsedType
|
|
2539
|
-
}),
|
|
2540
|
-
const
|
|
2541
|
-
return x(
|
|
2314
|
+
}), _;
|
|
2315
|
+
const a = t.parsedType === l.promise ? t.data : Promise.resolve(t.data);
|
|
2316
|
+
return x(a.then((s) => this._def.type.parseAsync(s, {
|
|
2542
2317
|
path: t.path,
|
|
2543
2318
|
errorMap: t.common.contextualErrorMap
|
|
2544
2319
|
})));
|
|
2545
2320
|
}
|
|
2546
|
-
}
|
|
2547
|
-
|
|
2548
|
-
type:
|
|
2549
|
-
typeName:
|
|
2550
|
-
...
|
|
2321
|
+
};
|
|
2322
|
+
te.create = (n, e) => new te({
|
|
2323
|
+
type: n,
|
|
2324
|
+
typeName: f.ZodPromise,
|
|
2325
|
+
...y(e)
|
|
2551
2326
|
});
|
|
2552
|
-
|
|
2327
|
+
class D extends v {
|
|
2553
2328
|
innerType() {
|
|
2554
2329
|
return this._def.schema;
|
|
2555
2330
|
}
|
|
2556
2331
|
sourceType() {
|
|
2557
|
-
return this._def.schema._def.typeName ===
|
|
2332
|
+
return this._def.schema._def.typeName === f.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
2558
2333
|
}
|
|
2559
2334
|
_parse(e) {
|
|
2560
|
-
const { status: t, ctx:
|
|
2561
|
-
addIssue: (
|
|
2562
|
-
|
|
2335
|
+
const { status: t, ctx: a } = this._processInputParams(e), s = this._def.effect || null, i = {
|
|
2336
|
+
addIssue: (r) => {
|
|
2337
|
+
u(a, r), r.fatal ? t.abort() : t.dirty();
|
|
2563
2338
|
},
|
|
2564
2339
|
get path() {
|
|
2565
|
-
return
|
|
2340
|
+
return a.path;
|
|
2566
2341
|
}
|
|
2567
2342
|
};
|
|
2568
|
-
if (
|
|
2569
|
-
const
|
|
2570
|
-
if (
|
|
2571
|
-
return Promise.resolve(
|
|
2343
|
+
if (i.addIssue = i.addIssue.bind(i), s.type === "preprocess") {
|
|
2344
|
+
const r = s.transform(a.data, i);
|
|
2345
|
+
if (a.common.async)
|
|
2346
|
+
return Promise.resolve(r).then(async (o) => {
|
|
2572
2347
|
if (t.value === "aborted")
|
|
2573
|
-
return
|
|
2348
|
+
return _;
|
|
2574
2349
|
const c = await this._def.schema._parseAsync({
|
|
2575
2350
|
data: o,
|
|
2576
|
-
path:
|
|
2577
|
-
parent:
|
|
2351
|
+
path: a.path,
|
|
2352
|
+
parent: a
|
|
2578
2353
|
});
|
|
2579
|
-
return c.status === "aborted" ?
|
|
2354
|
+
return c.status === "aborted" ? _ : c.status === "dirty" || t.value === "dirty" ? ie(c.value) : c;
|
|
2580
2355
|
});
|
|
2581
2356
|
{
|
|
2582
2357
|
if (t.value === "aborted")
|
|
2583
|
-
return
|
|
2358
|
+
return _;
|
|
2584
2359
|
const o = this._def.schema._parseSync({
|
|
2585
|
-
data:
|
|
2586
|
-
path:
|
|
2587
|
-
parent:
|
|
2360
|
+
data: r,
|
|
2361
|
+
path: a.path,
|
|
2362
|
+
parent: a
|
|
2588
2363
|
});
|
|
2589
|
-
return o.status === "aborted" ?
|
|
2364
|
+
return o.status === "aborted" ? _ : o.status === "dirty" || t.value === "dirty" ? ie(o.value) : o;
|
|
2590
2365
|
}
|
|
2591
2366
|
}
|
|
2592
|
-
if (
|
|
2593
|
-
const
|
|
2594
|
-
const c =
|
|
2595
|
-
if (
|
|
2367
|
+
if (s.type === "refinement") {
|
|
2368
|
+
const r = (o) => {
|
|
2369
|
+
const c = s.refinement(o, i);
|
|
2370
|
+
if (a.common.async)
|
|
2596
2371
|
return Promise.resolve(c);
|
|
2597
2372
|
if (c instanceof Promise)
|
|
2598
2373
|
throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2599
2374
|
return o;
|
|
2600
2375
|
};
|
|
2601
|
-
if (
|
|
2376
|
+
if (a.common.async === !1) {
|
|
2602
2377
|
const o = this._def.schema._parseSync({
|
|
2603
|
-
data:
|
|
2604
|
-
path:
|
|
2605
|
-
parent:
|
|
2378
|
+
data: a.data,
|
|
2379
|
+
path: a.path,
|
|
2380
|
+
parent: a
|
|
2606
2381
|
});
|
|
2607
|
-
return o.status === "aborted" ?
|
|
2382
|
+
return o.status === "aborted" ? _ : (o.status === "dirty" && t.dirty(), r(o.value), { status: t.value, value: o.value });
|
|
2608
2383
|
} else
|
|
2609
|
-
return this._def.schema._parseAsync({ data:
|
|
2384
|
+
return this._def.schema._parseAsync({ data: a.data, path: a.path, parent: a }).then((o) => o.status === "aborted" ? _ : (o.status === "dirty" && t.dirty(), r(o.value).then(() => ({ status: t.value, value: o.value }))));
|
|
2610
2385
|
}
|
|
2611
|
-
if (
|
|
2612
|
-
if (
|
|
2613
|
-
const
|
|
2614
|
-
data:
|
|
2615
|
-
path:
|
|
2616
|
-
parent:
|
|
2386
|
+
if (s.type === "transform")
|
|
2387
|
+
if (a.common.async === !1) {
|
|
2388
|
+
const r = this._def.schema._parseSync({
|
|
2389
|
+
data: a.data,
|
|
2390
|
+
path: a.path,
|
|
2391
|
+
parent: a
|
|
2617
2392
|
});
|
|
2618
|
-
if (!
|
|
2619
|
-
return
|
|
2620
|
-
const o =
|
|
2393
|
+
if (!L(r))
|
|
2394
|
+
return _;
|
|
2395
|
+
const o = s.transform(r.value, i);
|
|
2621
2396
|
if (o instanceof Promise)
|
|
2622
2397
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2623
2398
|
return { status: t.value, value: o };
|
|
2624
2399
|
} else
|
|
2625
|
-
return this._def.schema._parseAsync({ data:
|
|
2626
|
-
|
|
2400
|
+
return this._def.schema._parseAsync({ data: a.data, path: a.path, parent: a }).then((r) => L(r) ? Promise.resolve(s.transform(r.value, i)).then((o) => ({
|
|
2401
|
+
status: t.value,
|
|
2402
|
+
value: o
|
|
2403
|
+
})) : _);
|
|
2404
|
+
b.assertNever(s);
|
|
2627
2405
|
}
|
|
2628
|
-
}
|
|
2629
|
-
|
|
2630
|
-
schema:
|
|
2631
|
-
typeName:
|
|
2406
|
+
}
|
|
2407
|
+
D.create = (n, e, t) => new D({
|
|
2408
|
+
schema: n,
|
|
2409
|
+
typeName: f.ZodEffects,
|
|
2632
2410
|
effect: e,
|
|
2633
|
-
...
|
|
2411
|
+
...y(t)
|
|
2634
2412
|
});
|
|
2635
|
-
|
|
2413
|
+
D.createWithPreprocess = (n, e, t) => new D({
|
|
2636
2414
|
schema: e,
|
|
2637
|
-
effect: { type: "preprocess", transform:
|
|
2638
|
-
typeName:
|
|
2639
|
-
...
|
|
2415
|
+
effect: { type: "preprocess", transform: n },
|
|
2416
|
+
typeName: f.ZodEffects,
|
|
2417
|
+
...y(t)
|
|
2640
2418
|
});
|
|
2641
|
-
let
|
|
2419
|
+
let I = class extends v {
|
|
2642
2420
|
_parse(e) {
|
|
2643
|
-
return this._getType(e) ===
|
|
2421
|
+
return this._getType(e) === l.undefined ? x(void 0) : this._def.innerType._parse(e);
|
|
2644
2422
|
}
|
|
2645
2423
|
unwrap() {
|
|
2646
2424
|
return this._def.innerType;
|
|
2647
2425
|
}
|
|
2648
2426
|
};
|
|
2649
|
-
|
|
2650
|
-
innerType:
|
|
2651
|
-
typeName:
|
|
2652
|
-
...
|
|
2427
|
+
I.create = (n, e) => new I({
|
|
2428
|
+
innerType: n,
|
|
2429
|
+
typeName: f.ZodOptional,
|
|
2430
|
+
...y(e)
|
|
2653
2431
|
});
|
|
2654
|
-
let
|
|
2432
|
+
let V = class extends v {
|
|
2655
2433
|
_parse(e) {
|
|
2656
|
-
return this._getType(e) ===
|
|
2434
|
+
return this._getType(e) === l.null ? x(null) : this._def.innerType._parse(e);
|
|
2657
2435
|
}
|
|
2658
2436
|
unwrap() {
|
|
2659
2437
|
return this._def.innerType;
|
|
2660
2438
|
}
|
|
2661
2439
|
};
|
|
2662
|
-
|
|
2663
|
-
innerType:
|
|
2664
|
-
typeName:
|
|
2665
|
-
...
|
|
2440
|
+
V.create = (n, e) => new V({
|
|
2441
|
+
innerType: n,
|
|
2442
|
+
typeName: f.ZodNullable,
|
|
2443
|
+
...y(e)
|
|
2666
2444
|
});
|
|
2667
|
-
class
|
|
2445
|
+
class he extends v {
|
|
2668
2446
|
_parse(e) {
|
|
2669
2447
|
const { ctx: t } = this._processInputParams(e);
|
|
2670
|
-
let
|
|
2671
|
-
return t.parsedType ===
|
|
2672
|
-
data:
|
|
2448
|
+
let a = t.data;
|
|
2449
|
+
return t.parsedType === l.undefined && (a = this._def.defaultValue()), this._def.innerType._parse({
|
|
2450
|
+
data: a,
|
|
2673
2451
|
path: t.path,
|
|
2674
2452
|
parent: t
|
|
2675
2453
|
});
|
|
@@ -2678,42 +2456,42 @@ class ue extends v {
|
|
|
2678
2456
|
return this._def.innerType;
|
|
2679
2457
|
}
|
|
2680
2458
|
}
|
|
2681
|
-
|
|
2682
|
-
innerType:
|
|
2683
|
-
typeName:
|
|
2459
|
+
he.create = (n, e) => new he({
|
|
2460
|
+
innerType: n,
|
|
2461
|
+
typeName: f.ZodDefault,
|
|
2684
2462
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2685
|
-
...
|
|
2463
|
+
...y(e)
|
|
2686
2464
|
});
|
|
2687
|
-
class
|
|
2465
|
+
class pe extends v {
|
|
2688
2466
|
_parse(e) {
|
|
2689
|
-
const { ctx: t } = this._processInputParams(e),
|
|
2467
|
+
const { ctx: t } = this._processInputParams(e), a = {
|
|
2690
2468
|
...t,
|
|
2691
2469
|
common: {
|
|
2692
2470
|
...t.common,
|
|
2693
2471
|
issues: []
|
|
2694
2472
|
}
|
|
2695
|
-
},
|
|
2696
|
-
data:
|
|
2697
|
-
path:
|
|
2473
|
+
}, s = this._def.innerType._parse({
|
|
2474
|
+
data: a.data,
|
|
2475
|
+
path: a.path,
|
|
2698
2476
|
parent: {
|
|
2699
|
-
...
|
|
2477
|
+
...a
|
|
2700
2478
|
}
|
|
2701
2479
|
});
|
|
2702
|
-
return
|
|
2480
|
+
return X(s) ? s.then((i) => ({
|
|
2703
2481
|
status: "valid",
|
|
2704
|
-
value:
|
|
2482
|
+
value: i.status === "valid" ? i.value : this._def.catchValue({
|
|
2705
2483
|
get error() {
|
|
2706
|
-
return new
|
|
2484
|
+
return new C(a.common.issues);
|
|
2707
2485
|
},
|
|
2708
|
-
input:
|
|
2486
|
+
input: a.data
|
|
2709
2487
|
})
|
|
2710
2488
|
})) : {
|
|
2711
2489
|
status: "valid",
|
|
2712
|
-
value:
|
|
2490
|
+
value: s.status === "valid" ? s.value : this._def.catchValue({
|
|
2713
2491
|
get error() {
|
|
2714
|
-
return new
|
|
2492
|
+
return new C(a.common.issues);
|
|
2715
2493
|
},
|
|
2716
|
-
input:
|
|
2494
|
+
input: a.data
|
|
2717
2495
|
})
|
|
2718
2496
|
};
|
|
2719
2497
|
}
|
|
@@ -2721,35 +2499,34 @@ class le extends v {
|
|
|
2721
2499
|
return this._def.innerType;
|
|
2722
2500
|
}
|
|
2723
2501
|
}
|
|
2724
|
-
|
|
2725
|
-
innerType:
|
|
2726
|
-
typeName:
|
|
2502
|
+
pe.create = (n, e) => new pe({
|
|
2503
|
+
innerType: n,
|
|
2504
|
+
typeName: f.ZodCatch,
|
|
2727
2505
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2728
|
-
...
|
|
2506
|
+
...y(e)
|
|
2729
2507
|
});
|
|
2730
|
-
class
|
|
2508
|
+
class Ee extends v {
|
|
2731
2509
|
_parse(e) {
|
|
2732
|
-
if (this._getType(e) !==
|
|
2510
|
+
if (this._getType(e) !== l.nan) {
|
|
2733
2511
|
const t = this._getOrReturnCtx(e);
|
|
2734
|
-
return
|
|
2512
|
+
return u(t, {
|
|
2735
2513
|
code: d.invalid_type,
|
|
2736
|
-
expected:
|
|
2514
|
+
expected: l.nan,
|
|
2737
2515
|
received: t.parsedType
|
|
2738
|
-
}),
|
|
2516
|
+
}), _;
|
|
2739
2517
|
}
|
|
2740
2518
|
return { status: "valid", value: e.data };
|
|
2741
2519
|
}
|
|
2742
2520
|
}
|
|
2743
|
-
|
|
2744
|
-
typeName:
|
|
2745
|
-
...
|
|
2521
|
+
Ee.create = (n) => new Ee({
|
|
2522
|
+
typeName: f.ZodNaN,
|
|
2523
|
+
...y(n)
|
|
2746
2524
|
});
|
|
2747
|
-
|
|
2748
|
-
class qe extends v {
|
|
2525
|
+
class ut extends v {
|
|
2749
2526
|
_parse(e) {
|
|
2750
|
-
const { ctx: t } = this._processInputParams(e),
|
|
2527
|
+
const { ctx: t } = this._processInputParams(e), a = t.data;
|
|
2751
2528
|
return this._def.type._parse({
|
|
2752
|
-
data:
|
|
2529
|
+
data: a,
|
|
2753
2530
|
path: t.path,
|
|
2754
2531
|
parent: t
|
|
2755
2532
|
});
|
|
@@ -2758,221 +2535,80 @@ class qe extends v {
|
|
|
2758
2535
|
return this._def.type;
|
|
2759
2536
|
}
|
|
2760
2537
|
}
|
|
2761
|
-
class
|
|
2538
|
+
class _e extends v {
|
|
2762
2539
|
_parse(e) {
|
|
2763
|
-
const { status: t, ctx:
|
|
2764
|
-
if (
|
|
2540
|
+
const { status: t, ctx: a } = this._processInputParams(e);
|
|
2541
|
+
if (a.common.async)
|
|
2765
2542
|
return (async () => {
|
|
2766
|
-
const
|
|
2767
|
-
data:
|
|
2768
|
-
path:
|
|
2769
|
-
parent:
|
|
2543
|
+
const s = await this._def.in._parseAsync({
|
|
2544
|
+
data: a.data,
|
|
2545
|
+
path: a.path,
|
|
2546
|
+
parent: a
|
|
2770
2547
|
});
|
|
2771
|
-
return
|
|
2772
|
-
data:
|
|
2773
|
-
path:
|
|
2774
|
-
parent:
|
|
2548
|
+
return s.status === "aborted" ? _ : s.status === "dirty" ? (t.dirty(), ie(s.value)) : this._def.out._parseAsync({
|
|
2549
|
+
data: s.value,
|
|
2550
|
+
path: a.path,
|
|
2551
|
+
parent: a
|
|
2775
2552
|
});
|
|
2776
2553
|
})();
|
|
2777
2554
|
{
|
|
2778
|
-
const
|
|
2779
|
-
data:
|
|
2780
|
-
path:
|
|
2781
|
-
parent:
|
|
2555
|
+
const s = this._def.in._parseSync({
|
|
2556
|
+
data: a.data,
|
|
2557
|
+
path: a.path,
|
|
2558
|
+
parent: a
|
|
2782
2559
|
});
|
|
2783
|
-
return
|
|
2560
|
+
return s.status === "aborted" ? _ : s.status === "dirty" ? (t.dirty(), {
|
|
2784
2561
|
status: "dirty",
|
|
2785
|
-
value:
|
|
2562
|
+
value: s.value
|
|
2786
2563
|
}) : this._def.out._parseSync({
|
|
2787
|
-
data:
|
|
2788
|
-
path:
|
|
2789
|
-
parent:
|
|
2564
|
+
data: s.value,
|
|
2565
|
+
path: a.path,
|
|
2566
|
+
parent: a
|
|
2790
2567
|
});
|
|
2791
2568
|
}
|
|
2792
2569
|
}
|
|
2793
2570
|
static create(e, t) {
|
|
2794
|
-
return new
|
|
2571
|
+
return new _e({
|
|
2795
2572
|
in: e,
|
|
2796
2573
|
out: t,
|
|
2797
|
-
typeName:
|
|
2574
|
+
typeName: f.ZodPipeline
|
|
2798
2575
|
});
|
|
2799
2576
|
}
|
|
2800
2577
|
}
|
|
2801
|
-
class
|
|
2578
|
+
class fe extends v {
|
|
2802
2579
|
_parse(e) {
|
|
2803
|
-
const t = this._def.innerType._parse(e),
|
|
2804
|
-
return
|
|
2580
|
+
const t = this._def.innerType._parse(e), a = (s) => (L(s) && (s.value = Object.freeze(s.value)), s);
|
|
2581
|
+
return X(t) ? t.then((s) => a(s)) : a(t);
|
|
2805
2582
|
}
|
|
2806
2583
|
unwrap() {
|
|
2807
2584
|
return this._def.innerType;
|
|
2808
2585
|
}
|
|
2809
2586
|
}
|
|
2810
|
-
|
|
2811
|
-
innerType:
|
|
2812
|
-
typeName:
|
|
2813
|
-
...
|
|
2814
|
-
});
|
|
2815
|
-
function Ve(a, e) {
|
|
2816
|
-
const t = typeof a == "function" ? a(e) : typeof a == "string" ? { message: a } : a;
|
|
2817
|
-
return typeof t == "string" ? { message: t } : t;
|
|
2818
|
-
}
|
|
2819
|
-
function st(a, e = {}, t) {
|
|
2820
|
-
return a ? K.create().superRefine((s, n) => {
|
|
2821
|
-
var r, i;
|
|
2822
|
-
const o = a(s);
|
|
2823
|
-
if (o instanceof Promise)
|
|
2824
|
-
return o.then((c) => {
|
|
2825
|
-
var u, f;
|
|
2826
|
-
if (!c) {
|
|
2827
|
-
const b = Ve(e, s), Z = (f = (u = b.fatal) !== null && u !== void 0 ? u : t) !== null && f !== void 0 ? f : !0;
|
|
2828
|
-
n.addIssue({ code: "custom", ...b, fatal: Z });
|
|
2829
|
-
}
|
|
2830
|
-
});
|
|
2831
|
-
if (!o) {
|
|
2832
|
-
const c = Ve(e, s), u = (i = (r = c.fatal) !== null && r !== void 0 ? r : t) !== null && i !== void 0 ? i : !0;
|
|
2833
|
-
n.addIssue({ code: "custom", ...c, fatal: u });
|
|
2834
|
-
}
|
|
2835
|
-
}) : K.create();
|
|
2836
|
-
}
|
|
2837
|
-
const Et = {
|
|
2838
|
-
object: T.lazycreate
|
|
2839
|
-
};
|
|
2840
|
-
var m;
|
|
2841
|
-
(function(a) {
|
|
2842
|
-
a.ZodString = "ZodString", a.ZodNumber = "ZodNumber", a.ZodNaN = "ZodNaN", a.ZodBigInt = "ZodBigInt", a.ZodBoolean = "ZodBoolean", a.ZodDate = "ZodDate", a.ZodSymbol = "ZodSymbol", a.ZodUndefined = "ZodUndefined", a.ZodNull = "ZodNull", a.ZodAny = "ZodAny", a.ZodUnknown = "ZodUnknown", a.ZodNever = "ZodNever", a.ZodVoid = "ZodVoid", a.ZodArray = "ZodArray", a.ZodObject = "ZodObject", a.ZodUnion = "ZodUnion", a.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", a.ZodIntersection = "ZodIntersection", a.ZodTuple = "ZodTuple", a.ZodRecord = "ZodRecord", a.ZodMap = "ZodMap", a.ZodSet = "ZodSet", a.ZodFunction = "ZodFunction", a.ZodLazy = "ZodLazy", a.ZodLiteral = "ZodLiteral", a.ZodEnum = "ZodEnum", a.ZodEffects = "ZodEffects", a.ZodNativeEnum = "ZodNativeEnum", a.ZodOptional = "ZodOptional", a.ZodNullable = "ZodNullable", a.ZodDefault = "ZodDefault", a.ZodCatch = "ZodCatch", a.ZodPromise = "ZodPromise", a.ZodBranded = "ZodBranded", a.ZodPipeline = "ZodPipeline", a.ZodReadonly = "ZodReadonly";
|
|
2843
|
-
})(m || (m = {}));
|
|
2844
|
-
const It = (a, e = {
|
|
2845
|
-
message: `Input not instance of ${a.name}`
|
|
2846
|
-
}) => st((t) => t instanceof a, e), at = C.create, nt = X.create, jt = Oe.create, $t = Q.create, it = ee.create, Pt = te.create, Rt = Te.create, Mt = se.create, Ft = ae.create, Dt = K.create, Lt = L.create, qt = $.create, zt = Ne.create, Vt = z.create, Bt = T.create, Ut = T.strictCreate, Ht = ne.create, Kt = Ae.create, Wt = ie.create, Jt = R.create, Yt = re.create, Gt = Ce.create, Xt = V.create, Qt = et.create, es = oe.create, ts = ce.create, ss = pe.create, as = de.create, ns = W.create, Be = A.create, is = E.create, rs = M.create, os = A.createWithPreprocess, cs = fe.create, ds = () => at().optional(), us = () => nt().optional(), ls = () => it().optional(), hs = {
|
|
2847
|
-
string: (a) => C.create({ ...a, coerce: !0 }),
|
|
2848
|
-
number: (a) => X.create({ ...a, coerce: !0 }),
|
|
2849
|
-
boolean: (a) => ee.create({
|
|
2850
|
-
...a,
|
|
2851
|
-
coerce: !0
|
|
2852
|
-
}),
|
|
2853
|
-
bigint: (a) => Q.create({ ...a, coerce: !0 }),
|
|
2854
|
-
date: (a) => te.create({ ...a, coerce: !0 })
|
|
2855
|
-
}, ps = y;
|
|
2856
|
-
var me = /* @__PURE__ */ Object.freeze({
|
|
2857
|
-
__proto__: null,
|
|
2858
|
-
defaultErrorMap: H,
|
|
2859
|
-
setErrorMap: ot,
|
|
2860
|
-
getErrorMap: ke,
|
|
2861
|
-
makeIssue: xe,
|
|
2862
|
-
EMPTY_PATH: ct,
|
|
2863
|
-
addIssueToContext: l,
|
|
2864
|
-
ParseStatus: S,
|
|
2865
|
-
INVALID: y,
|
|
2866
|
-
DIRTY: Ze,
|
|
2867
|
-
OK: x,
|
|
2868
|
-
isAborted: Pe,
|
|
2869
|
-
isDirty: Re,
|
|
2870
|
-
isValid: q,
|
|
2871
|
-
isAsync: G,
|
|
2872
|
-
get util() {
|
|
2873
|
-
return w;
|
|
2874
|
-
},
|
|
2875
|
-
get objectUtil() {
|
|
2876
|
-
return $e;
|
|
2877
|
-
},
|
|
2878
|
-
ZodParsedType: h,
|
|
2879
|
-
getParsedType: j,
|
|
2880
|
-
ZodType: v,
|
|
2881
|
-
datetimeRegex: Ge,
|
|
2882
|
-
ZodString: C,
|
|
2883
|
-
ZodNumber: X,
|
|
2884
|
-
ZodBigInt: Q,
|
|
2885
|
-
ZodBoolean: ee,
|
|
2886
|
-
ZodDate: te,
|
|
2887
|
-
ZodSymbol: Te,
|
|
2888
|
-
ZodUndefined: se,
|
|
2889
|
-
ZodNull: ae,
|
|
2890
|
-
ZodAny: K,
|
|
2891
|
-
ZodUnknown: L,
|
|
2892
|
-
ZodNever: $,
|
|
2893
|
-
ZodVoid: Ne,
|
|
2894
|
-
ZodArray: z,
|
|
2895
|
-
ZodObject: T,
|
|
2896
|
-
ZodUnion: ne,
|
|
2897
|
-
ZodDiscriminatedUnion: Ae,
|
|
2898
|
-
ZodIntersection: ie,
|
|
2899
|
-
ZodTuple: R,
|
|
2900
|
-
ZodRecord: re,
|
|
2901
|
-
ZodMap: Ce,
|
|
2902
|
-
ZodSet: V,
|
|
2903
|
-
ZodFunction: et,
|
|
2904
|
-
ZodLazy: oe,
|
|
2905
|
-
ZodLiteral: ce,
|
|
2906
|
-
ZodEnum: pe,
|
|
2907
|
-
ZodNativeEnum: de,
|
|
2908
|
-
ZodPromise: W,
|
|
2909
|
-
ZodEffects: A,
|
|
2910
|
-
ZodTransformer: A,
|
|
2911
|
-
ZodOptional: E,
|
|
2912
|
-
ZodNullable: M,
|
|
2913
|
-
ZodDefault: ue,
|
|
2914
|
-
ZodCatch: le,
|
|
2915
|
-
ZodNaN: Oe,
|
|
2916
|
-
BRAND: At,
|
|
2917
|
-
ZodBranded: qe,
|
|
2918
|
-
ZodPipeline: fe,
|
|
2919
|
-
ZodReadonly: he,
|
|
2920
|
-
custom: st,
|
|
2921
|
-
Schema: v,
|
|
2922
|
-
ZodSchema: v,
|
|
2923
|
-
late: Et,
|
|
2924
|
-
get ZodFirstPartyTypeKind() {
|
|
2925
|
-
return m;
|
|
2926
|
-
},
|
|
2927
|
-
coerce: hs,
|
|
2928
|
-
any: Dt,
|
|
2929
|
-
array: Vt,
|
|
2930
|
-
bigint: $t,
|
|
2931
|
-
boolean: it,
|
|
2932
|
-
date: Pt,
|
|
2933
|
-
discriminatedUnion: Kt,
|
|
2934
|
-
effect: Be,
|
|
2935
|
-
enum: ss,
|
|
2936
|
-
function: Qt,
|
|
2937
|
-
instanceof: It,
|
|
2938
|
-
intersection: Wt,
|
|
2939
|
-
lazy: es,
|
|
2940
|
-
literal: ts,
|
|
2941
|
-
map: Gt,
|
|
2942
|
-
nan: jt,
|
|
2943
|
-
nativeEnum: as,
|
|
2944
|
-
never: qt,
|
|
2945
|
-
null: Ft,
|
|
2946
|
-
nullable: rs,
|
|
2947
|
-
number: nt,
|
|
2948
|
-
object: Bt,
|
|
2949
|
-
oboolean: ls,
|
|
2950
|
-
onumber: us,
|
|
2951
|
-
optional: is,
|
|
2952
|
-
ostring: ds,
|
|
2953
|
-
pipeline: cs,
|
|
2954
|
-
preprocess: os,
|
|
2955
|
-
promise: ns,
|
|
2956
|
-
record: Yt,
|
|
2957
|
-
set: Xt,
|
|
2958
|
-
strictObject: Ut,
|
|
2959
|
-
string: at,
|
|
2960
|
-
symbol: Rt,
|
|
2961
|
-
transformer: Be,
|
|
2962
|
-
tuple: Jt,
|
|
2963
|
-
undefined: Mt,
|
|
2964
|
-
union: Ht,
|
|
2965
|
-
unknown: Lt,
|
|
2966
|
-
void: zt,
|
|
2967
|
-
NEVER: ps,
|
|
2968
|
-
ZodIssueCode: d,
|
|
2969
|
-
quotelessJson: rt,
|
|
2970
|
-
ZodError: O
|
|
2587
|
+
fe.create = (n, e) => new fe({
|
|
2588
|
+
innerType: n,
|
|
2589
|
+
typeName: f.ZodReadonly,
|
|
2590
|
+
...y(e)
|
|
2971
2591
|
});
|
|
2972
|
-
|
|
2973
|
-
|
|
2592
|
+
var f;
|
|
2593
|
+
(function(n) {
|
|
2594
|
+
n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
|
|
2595
|
+
})(f || (f = {}));
|
|
2596
|
+
const lt = A.create, ht = ce.create;
|
|
2597
|
+
E.create;
|
|
2598
|
+
q.create;
|
|
2599
|
+
const pt = T.create;
|
|
2600
|
+
Q.create;
|
|
2601
|
+
ee.create;
|
|
2602
|
+
R.create;
|
|
2603
|
+
const ft = ue.create;
|
|
2604
|
+
me.create;
|
|
2605
|
+
te.create;
|
|
2606
|
+
I.create;
|
|
2607
|
+
V.create;
|
|
2608
|
+
const mt = "1.7.1", _t = {
|
|
2609
|
+
version: mt
|
|
2974
2610
|
};
|
|
2975
|
-
class
|
|
2611
|
+
class gt {
|
|
2976
2612
|
constructor(e) {
|
|
2977
2613
|
this._client = e;
|
|
2978
2614
|
}
|
|
@@ -2991,7 +2627,7 @@ class ys {
|
|
|
2991
2627
|
return e.account;
|
|
2992
2628
|
}
|
|
2993
2629
|
}
|
|
2994
|
-
class
|
|
2630
|
+
class yt {
|
|
2995
2631
|
constructor(e) {
|
|
2996
2632
|
this._client = e;
|
|
2997
2633
|
}
|
|
@@ -3088,7 +2724,7 @@ class gs {
|
|
|
3088
2724
|
this._client._messageInterceptors.set(e, t);
|
|
3089
2725
|
}
|
|
3090
2726
|
}
|
|
3091
|
-
class
|
|
2727
|
+
class vt {
|
|
3092
2728
|
constructor(e) {
|
|
3093
2729
|
this._client = e;
|
|
3094
2730
|
}
|
|
@@ -3112,26 +2748,21 @@ class _s {
|
|
|
3112
2748
|
return e.deviceInformation;
|
|
3113
2749
|
}
|
|
3114
2750
|
}
|
|
3115
|
-
|
|
3116
|
-
a().catch(e);
|
|
3117
|
-
}
|
|
3118
|
-
class ws {
|
|
2751
|
+
class bt {
|
|
3119
2752
|
constructor(e) {
|
|
3120
2753
|
this._client = e;
|
|
3121
2754
|
}
|
|
3122
2755
|
async getColorScheme() {
|
|
3123
2756
|
return (await this._client.request("environment.getColorScheme", {})).colorScheme;
|
|
3124
2757
|
}
|
|
3125
|
-
subscribeColorScheme(e) {
|
|
3126
|
-
|
|
3127
|
-
this._client.on("environment.colorSchemeChanged", e), e(await this.getColorScheme());
|
|
3128
|
-
});
|
|
2758
|
+
async subscribeColorScheme(e) {
|
|
2759
|
+
return (await this._client.subscribe("environment.subscribeColorScheme", {}, e)).success;
|
|
3129
2760
|
}
|
|
3130
|
-
unsubscribeColorScheme(e) {
|
|
3131
|
-
this._client.
|
|
2761
|
+
async unsubscribeColorScheme(e) {
|
|
2762
|
+
return (await this._client.unsubscribe("environment.unsubscribeColorScheme", {}, e)).success;
|
|
3132
2763
|
}
|
|
3133
2764
|
}
|
|
3134
|
-
class
|
|
2765
|
+
class wt {
|
|
3135
2766
|
constructor(e) {
|
|
3136
2767
|
this._client = e;
|
|
3137
2768
|
}
|
|
@@ -3177,14 +2808,14 @@ class bs {
|
|
|
3177
2808
|
})).content;
|
|
3178
2809
|
}
|
|
3179
2810
|
}
|
|
3180
|
-
class
|
|
2811
|
+
class kt {
|
|
3181
2812
|
constructor(e) {
|
|
3182
2813
|
this._client = e;
|
|
3183
2814
|
}
|
|
3184
2815
|
async fetch(e, t) {
|
|
3185
|
-
var
|
|
3186
|
-
let
|
|
3187
|
-
typeof e == "string" ?
|
|
2816
|
+
var a;
|
|
2817
|
+
let s;
|
|
2818
|
+
typeof e == "string" ? s = e : e instanceof URL ? s = e.toString() : (s = e.url, t || (t = {
|
|
3188
2819
|
method: e.method,
|
|
3189
2820
|
headers: e.headers,
|
|
3190
2821
|
body: e.body,
|
|
@@ -3194,39 +2825,39 @@ class ks {
|
|
|
3194
2825
|
referrer: e.referrer,
|
|
3195
2826
|
integrity: e.integrity
|
|
3196
2827
|
}));
|
|
3197
|
-
let
|
|
3198
|
-
t != null && t.headers && (t.headers instanceof Headers ? t.headers.forEach((
|
|
3199
|
-
|
|
3200
|
-
}) : Array.isArray(t.headers) ? t.headers.forEach(([
|
|
3201
|
-
|
|
3202
|
-
}) :
|
|
3203
|
-
const
|
|
3204
|
-
url:
|
|
2828
|
+
let i = {};
|
|
2829
|
+
t != null && t.headers && (t.headers instanceof Headers ? t.headers.forEach((m, w) => {
|
|
2830
|
+
i[w] = m;
|
|
2831
|
+
}) : Array.isArray(t.headers) ? t.headers.forEach(([m, w]) => {
|
|
2832
|
+
i[m] = w;
|
|
2833
|
+
}) : i = t.headers);
|
|
2834
|
+
const r = await this._client.request("proxy.fetch", {
|
|
2835
|
+
url: s,
|
|
3205
2836
|
method: (t == null ? void 0 : t.method) || "GET",
|
|
3206
|
-
headers:
|
|
3207
|
-
body: (
|
|
2837
|
+
headers: i,
|
|
2838
|
+
body: (a = t == null ? void 0 : t.body) !== null && a !== void 0 ? a : null
|
|
3208
2839
|
});
|
|
3209
|
-
if (!
|
|
3210
|
-
throw new TypeError(
|
|
3211
|
-
cause:
|
|
2840
|
+
if (!r.success)
|
|
2841
|
+
throw new TypeError(r.errorMessage, {
|
|
2842
|
+
cause: r.errorCause ? Error(r.errorCause) : void 0
|
|
3212
2843
|
});
|
|
3213
|
-
const o = new Headers(
|
|
3214
|
-
status:
|
|
3215
|
-
statusText:
|
|
2844
|
+
const o = new Headers(r.headers), c = {
|
|
2845
|
+
status: r.status,
|
|
2846
|
+
statusText: r.statusText,
|
|
3216
2847
|
headers: o
|
|
3217
2848
|
};
|
|
3218
|
-
let
|
|
3219
|
-
if (
|
|
3220
|
-
if (
|
|
3221
|
-
const
|
|
3222
|
-
for (let Z = 0; Z <
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
} else
|
|
3226
|
-
return new Response(
|
|
3227
|
-
}
|
|
3228
|
-
}
|
|
3229
|
-
class
|
|
2849
|
+
let h = null;
|
|
2850
|
+
if (r.body !== null && r.body !== void 0)
|
|
2851
|
+
if (r.bodyType === "binary") {
|
|
2852
|
+
const m = atob(r.body), w = new Uint8Array(m.length);
|
|
2853
|
+
for (let Z = 0; Z < m.length; Z++)
|
|
2854
|
+
w[Z] = m.charCodeAt(Z);
|
|
2855
|
+
h = w;
|
|
2856
|
+
} else r.bodyType === "text" ? h = r.body : r.bodyType === "json" && (h = JSON.stringify(r.body));
|
|
2857
|
+
return new Response(h, c);
|
|
2858
|
+
}
|
|
2859
|
+
}
|
|
2860
|
+
class xt {
|
|
3230
2861
|
constructor(e) {
|
|
3231
2862
|
this._client = e;
|
|
3232
2863
|
}
|
|
@@ -3240,7 +2871,7 @@ class xs {
|
|
|
3240
2871
|
* @returns A StoreSlice instance for the application scope
|
|
3241
2872
|
*/
|
|
3242
2873
|
get application() {
|
|
3243
|
-
return new
|
|
2874
|
+
return new K("application", "", this._client);
|
|
3244
2875
|
}
|
|
3245
2876
|
/**
|
|
3246
2877
|
* Provides access to the instance store scope.
|
|
@@ -3254,7 +2885,7 @@ class xs {
|
|
|
3254
2885
|
* @returns A StoreSlice instance for the instance scope
|
|
3255
2886
|
*/
|
|
3256
2887
|
get instance() {
|
|
3257
|
-
return new
|
|
2888
|
+
return new K("instance", this._client.applicationInstance, this._client);
|
|
3258
2889
|
}
|
|
3259
2890
|
/**
|
|
3260
2891
|
* Provides access to the device store scope.
|
|
@@ -3269,7 +2900,7 @@ class xs {
|
|
|
3269
2900
|
* @returns A StoreSlice instance for the device scope
|
|
3270
2901
|
*/
|
|
3271
2902
|
get device() {
|
|
3272
|
-
return new
|
|
2903
|
+
return new K("device", this._client.applicationInstance, this._client);
|
|
3273
2904
|
}
|
|
3274
2905
|
/**
|
|
3275
2906
|
* Provides access to the shared store scope with a specified namespace.
|
|
@@ -3285,12 +2916,12 @@ class xs {
|
|
|
3285
2916
|
* @returns A StoreSlice instance for the specified shared namespace
|
|
3286
2917
|
*/
|
|
3287
2918
|
shared(e) {
|
|
3288
|
-
return new
|
|
2919
|
+
return new K("shared", e, this._client);
|
|
3289
2920
|
}
|
|
3290
2921
|
}
|
|
3291
|
-
class
|
|
3292
|
-
constructor(e, t,
|
|
3293
|
-
this._kind = e, this._namespace = t, this._client =
|
|
2922
|
+
class K {
|
|
2923
|
+
constructor(e, t, a) {
|
|
2924
|
+
this._kind = e, this._namespace = t, this._client = a;
|
|
3294
2925
|
}
|
|
3295
2926
|
/**
|
|
3296
2927
|
* Saves a value in the store.
|
|
@@ -3382,7 +3013,7 @@ class ye {
|
|
|
3382
3013
|
})).success;
|
|
3383
3014
|
}
|
|
3384
3015
|
}
|
|
3385
|
-
class
|
|
3016
|
+
class St {
|
|
3386
3017
|
constructor(e) {
|
|
3387
3018
|
this._client = e;
|
|
3388
3019
|
}
|
|
@@ -3405,7 +3036,7 @@ class Zs {
|
|
|
3405
3036
|
return e.user;
|
|
3406
3037
|
}
|
|
3407
3038
|
}
|
|
3408
|
-
class
|
|
3039
|
+
class Nt {
|
|
3409
3040
|
constructor(e) {
|
|
3410
3041
|
this._client = e;
|
|
3411
3042
|
}
|
|
@@ -3481,15 +3112,15 @@ class Ss {
|
|
|
3481
3112
|
return t.forecast;
|
|
3482
3113
|
}
|
|
3483
3114
|
}
|
|
3484
|
-
function
|
|
3485
|
-
return { ...
|
|
3115
|
+
function W(n) {
|
|
3116
|
+
return { ...n, type: "client" };
|
|
3486
3117
|
}
|
|
3487
|
-
const
|
|
3488
|
-
type:
|
|
3489
|
-
name:
|
|
3490
|
-
data:
|
|
3118
|
+
const Ct = pt({
|
|
3119
|
+
type: ft("bridge"),
|
|
3120
|
+
name: lt(),
|
|
3121
|
+
data: ht()
|
|
3491
3122
|
});
|
|
3492
|
-
class
|
|
3123
|
+
class Tt {
|
|
3493
3124
|
/**
|
|
3494
3125
|
* Creates a new RootSettingsNavigation API instance.
|
|
3495
3126
|
*
|
|
@@ -3513,11 +3144,11 @@ class Ns {
|
|
|
3513
3144
|
*/
|
|
3514
3145
|
async setRootSettingsNavigation(e) {
|
|
3515
3146
|
var t;
|
|
3516
|
-
const
|
|
3517
|
-
|
|
3518
|
-
applicationSpecifier:
|
|
3147
|
+
const a = this._store.shared("root-settings-navigation"), s = (t = await a.get("navigation")) !== null && t !== void 0 ? t : {}, i = this._store._client._applicationSpecifier;
|
|
3148
|
+
s[i] = {
|
|
3149
|
+
applicationSpecifier: i,
|
|
3519
3150
|
entries: e.entries
|
|
3520
|
-
},
|
|
3151
|
+
}, a.set("navigation", s);
|
|
3521
3152
|
}
|
|
3522
3153
|
/**
|
|
3523
3154
|
* Retrieves the current navigation entries for this root application.
|
|
@@ -3529,8 +3160,8 @@ class Ns {
|
|
|
3529
3160
|
*/
|
|
3530
3161
|
async getRootSettingsNavigation() {
|
|
3531
3162
|
var e;
|
|
3532
|
-
const t = (e = await this._store.shared("root-settings-navigation").get("navigation")) !== null && e !== void 0 ? e : {},
|
|
3533
|
-
return t[
|
|
3163
|
+
const t = (e = await this._store.shared("root-settings-navigation").get("navigation")) !== null && e !== void 0 ? e : {}, a = this._store._client._applicationSpecifier;
|
|
3164
|
+
return t[a];
|
|
3534
3165
|
}
|
|
3535
3166
|
/**
|
|
3536
3167
|
* Retrieves the navigation entries for all root applications.
|
|
@@ -3546,8 +3177,11 @@ class Ns {
|
|
|
3546
3177
|
return (e = await this._store.shared("root-settings-navigation").get("navigation")) !== null && e !== void 0 ? e : {};
|
|
3547
3178
|
}
|
|
3548
3179
|
}
|
|
3549
|
-
const
|
|
3550
|
-
|
|
3180
|
+
const F = 1e3 * 30, ge = typeof window > "u" && typeof self < "u", B = ge ? self : window;
|
|
3181
|
+
function z(n) {
|
|
3182
|
+
ge ? self.postMessage(n) : B.parent.postMessage(n, "*");
|
|
3183
|
+
}
|
|
3184
|
+
class Zt {
|
|
3551
3185
|
/**
|
|
3552
3186
|
* Creates a new Client instance for communicating with the TelemetryOS platform.
|
|
3553
3187
|
*
|
|
@@ -3573,7 +3207,7 @@ class Cs {
|
|
|
3573
3207
|
* @returns An Accounts instance bound to this client
|
|
3574
3208
|
*/
|
|
3575
3209
|
get accounts() {
|
|
3576
|
-
return new
|
|
3210
|
+
return new gt(this);
|
|
3577
3211
|
}
|
|
3578
3212
|
/**
|
|
3579
3213
|
* Provides access to the users API for retrieving TelemetryOS user information.
|
|
@@ -3587,7 +3221,7 @@ class Cs {
|
|
|
3587
3221
|
* @returns A Users instance bound to this client
|
|
3588
3222
|
*/
|
|
3589
3223
|
get users() {
|
|
3590
|
-
return new
|
|
3224
|
+
return new St(this);
|
|
3591
3225
|
}
|
|
3592
3226
|
/**
|
|
3593
3227
|
* Provides access to the store API for data persistence with multiple storage scopes.
|
|
@@ -3601,7 +3235,7 @@ class Cs {
|
|
|
3601
3235
|
* @returns A Store instance bound to this client
|
|
3602
3236
|
*/
|
|
3603
3237
|
get store() {
|
|
3604
|
-
return new
|
|
3238
|
+
return new xt(this);
|
|
3605
3239
|
}
|
|
3606
3240
|
/**
|
|
3607
3241
|
* Provides access to the applications API for discovering other TelemetryOS applications.
|
|
@@ -3615,7 +3249,7 @@ class Cs {
|
|
|
3615
3249
|
* @returns An Applications instance bound to this client
|
|
3616
3250
|
*/
|
|
3617
3251
|
get applications() {
|
|
3618
|
-
return new
|
|
3252
|
+
return new yt(this);
|
|
3619
3253
|
}
|
|
3620
3254
|
/**
|
|
3621
3255
|
* Provides access to the media API for working with content hosted on the TelemetryOS platform.
|
|
@@ -3630,7 +3264,7 @@ class Cs {
|
|
|
3630
3264
|
* @returns A Media instance bound to this client
|
|
3631
3265
|
*/
|
|
3632
3266
|
get media() {
|
|
3633
|
-
return new
|
|
3267
|
+
return new wt(this);
|
|
3634
3268
|
}
|
|
3635
3269
|
/**
|
|
3636
3270
|
* Provides access to the proxy API for fetching third-party content through the TelemetryOS API.
|
|
@@ -3644,7 +3278,7 @@ class Cs {
|
|
|
3644
3278
|
* @returns A Proxy instance bound to this client
|
|
3645
3279
|
*/
|
|
3646
3280
|
get proxy() {
|
|
3647
|
-
return new
|
|
3281
|
+
return new kt(this);
|
|
3648
3282
|
}
|
|
3649
3283
|
/**
|
|
3650
3284
|
* Provides access to the devices API for interacting with the current device.
|
|
@@ -3659,7 +3293,7 @@ class Cs {
|
|
|
3659
3293
|
* @returns A Devices instance bound to this client
|
|
3660
3294
|
*/
|
|
3661
3295
|
get devices() {
|
|
3662
|
-
return new
|
|
3296
|
+
return new vt(this);
|
|
3663
3297
|
}
|
|
3664
3298
|
/**
|
|
3665
3299
|
* Provides access to the root settings navigation API for TelemetryOS administration UI integration.
|
|
@@ -3677,7 +3311,7 @@ class Cs {
|
|
|
3677
3311
|
* @throws {Error} If used by an application not mounted at the 'rootSettingsNavigation' mount point
|
|
3678
3312
|
*/
|
|
3679
3313
|
get rootSettingsNavigation() {
|
|
3680
|
-
return new
|
|
3314
|
+
return new Tt(this.store);
|
|
3681
3315
|
}
|
|
3682
3316
|
/**
|
|
3683
3317
|
* Provides access to the weather API for retrieving weather data.
|
|
@@ -3691,7 +3325,7 @@ class Cs {
|
|
|
3691
3325
|
* @returns A Weather instance bound to this client
|
|
3692
3326
|
*/
|
|
3693
3327
|
get weather() {
|
|
3694
|
-
return new
|
|
3328
|
+
return new Nt(this);
|
|
3695
3329
|
}
|
|
3696
3330
|
/**
|
|
3697
3331
|
* Provides access to the environment API for accessing environment settings.
|
|
@@ -3705,7 +3339,7 @@ class Cs {
|
|
|
3705
3339
|
* @returns An Environment instance bound to this client
|
|
3706
3340
|
*/
|
|
3707
3341
|
get environment() {
|
|
3708
|
-
return new
|
|
3342
|
+
return new bt(this);
|
|
3709
3343
|
}
|
|
3710
3344
|
get applicationName() {
|
|
3711
3345
|
return this._applicationName;
|
|
@@ -3732,46 +3366,47 @@ class Cs {
|
|
|
3732
3366
|
* of creating and binding their own Client instances.
|
|
3733
3367
|
*/
|
|
3734
3368
|
bind() {
|
|
3735
|
-
var e, t,
|
|
3736
|
-
const
|
|
3737
|
-
if (this._applicationInstance = (e =
|
|
3369
|
+
var e, t, a;
|
|
3370
|
+
const s = new URL(B.location.href), i = s.searchParams;
|
|
3371
|
+
if (this._applicationInstance = (e = i.get("applicationInstance")) !== null && e !== void 0 ? e : "", !this._applicationInstance)
|
|
3738
3372
|
throw new Error("Missing applicationInstance query parameter");
|
|
3739
|
-
if (this._applicationSpecifier = (t =
|
|
3740
|
-
const
|
|
3741
|
-
this._applicationSpecifier = (
|
|
3373
|
+
if (this._applicationSpecifier = (t = i.get("applicationSpecifier")) !== null && t !== void 0 ? t : "", !this._applicationSpecifier) {
|
|
3374
|
+
const r = s.hostname.split(".");
|
|
3375
|
+
this._applicationSpecifier = (a = r[0]) !== null && a !== void 0 ? a : "";
|
|
3742
3376
|
}
|
|
3743
3377
|
if (!this._applicationSpecifier || this._applicationSpecifier.length !== 40)
|
|
3744
3378
|
throw new Error(`Invalid applicationSpecifier: expected 40-character hash, got "${this._applicationSpecifier}"`);
|
|
3745
|
-
this._windowMessageHandler = (
|
|
3746
|
-
if (
|
|
3379
|
+
this._windowMessageHandler = (r) => {
|
|
3380
|
+
if (r.source === B || !r.data || !("type" in r.data) || r.data.type !== "client" && r.data.type !== "bridge")
|
|
3747
3381
|
return;
|
|
3748
3382
|
let o;
|
|
3749
|
-
if (
|
|
3750
|
-
const c = this._messageInterceptors.get(
|
|
3383
|
+
if (r.data.type === "client") {
|
|
3384
|
+
const c = this._messageInterceptors.get(r.data.name);
|
|
3751
3385
|
if (!c) {
|
|
3752
|
-
|
|
3386
|
+
z(r.data);
|
|
3753
3387
|
return;
|
|
3754
3388
|
}
|
|
3755
|
-
o = { ...c(
|
|
3389
|
+
o = { ...c(r.data.data), type: "bridge" };
|
|
3756
3390
|
}
|
|
3757
3391
|
if (!o) {
|
|
3758
|
-
const c =
|
|
3392
|
+
const c = Ct.safeParse(r.data);
|
|
3759
3393
|
if (!c.success)
|
|
3760
3394
|
return;
|
|
3761
3395
|
o = c.data;
|
|
3762
|
-
const
|
|
3763
|
-
if (
|
|
3764
|
-
for (const
|
|
3765
|
-
|
|
3766
|
-
if (
|
|
3767
|
-
for (const
|
|
3768
|
-
|
|
3396
|
+
const h = this._onHandlers.get(o.name), m = this._onceHandlers.get(o.name);
|
|
3397
|
+
if (h)
|
|
3398
|
+
for (const w of h)
|
|
3399
|
+
w(o.data);
|
|
3400
|
+
if (m) {
|
|
3401
|
+
for (const w of m)
|
|
3402
|
+
w(o.data);
|
|
3769
3403
|
this._onceHandlers.delete(o.name);
|
|
3770
3404
|
}
|
|
3771
3405
|
}
|
|
3772
|
-
|
|
3773
|
-
window.frames
|
|
3774
|
-
|
|
3406
|
+
if (!ge)
|
|
3407
|
+
for (let c = 0; c < window.frames.length; c += 1)
|
|
3408
|
+
window.frames[c].postMessage(o, "*");
|
|
3409
|
+
}, B.addEventListener("message", this._windowMessageHandler);
|
|
3775
3410
|
}
|
|
3776
3411
|
/**
|
|
3777
3412
|
* Removes the message event listener and cleans up resources.
|
|
@@ -3787,7 +3422,7 @@ class Cs {
|
|
|
3787
3422
|
* of managing their own Client instances.
|
|
3788
3423
|
*/
|
|
3789
3424
|
unbind() {
|
|
3790
|
-
this._windowMessageHandler &&
|
|
3425
|
+
this._windowMessageHandler && B.removeEventListener("message", this._windowMessageHandler);
|
|
3791
3426
|
}
|
|
3792
3427
|
/**
|
|
3793
3428
|
* Sends a one-way message to the TelemetryOS platform.
|
|
@@ -3803,15 +3438,15 @@ class Cs {
|
|
|
3803
3438
|
* @param data The data payload to include with the message
|
|
3804
3439
|
*/
|
|
3805
3440
|
send(e, t) {
|
|
3806
|
-
const
|
|
3807
|
-
telemetrySdkVersion:
|
|
3441
|
+
const a = W({
|
|
3442
|
+
telemetrySdkVersion: G,
|
|
3808
3443
|
applicationName: this._applicationName,
|
|
3809
3444
|
applicationSpecifier: this._applicationSpecifier,
|
|
3810
3445
|
applicationInstance: this._applicationInstance,
|
|
3811
3446
|
name: e,
|
|
3812
3447
|
data: t
|
|
3813
3448
|
});
|
|
3814
|
-
|
|
3449
|
+
z(a);
|
|
3815
3450
|
}
|
|
3816
3451
|
/**
|
|
3817
3452
|
* Sends a message to the TelemetryOS platform and waits for a response.
|
|
@@ -3831,96 +3466,96 @@ class Cs {
|
|
|
3831
3466
|
* @throws {Error} If the request times out
|
|
3832
3467
|
*/
|
|
3833
3468
|
request(e, t) {
|
|
3834
|
-
const
|
|
3835
|
-
telemetrySdkVersion:
|
|
3469
|
+
const a = J(), s = W({
|
|
3470
|
+
telemetrySdkVersion: G,
|
|
3836
3471
|
applicationName: this._applicationName,
|
|
3837
3472
|
applicationSpecifier: this._applicationSpecifier,
|
|
3838
3473
|
applicationInstance: this._applicationInstance,
|
|
3839
3474
|
name: e,
|
|
3840
3475
|
data: t,
|
|
3841
|
-
responseName:
|
|
3476
|
+
responseName: a
|
|
3842
3477
|
});
|
|
3843
|
-
|
|
3844
|
-
let
|
|
3845
|
-
const o = new Promise((
|
|
3846
|
-
const
|
|
3478
|
+
z(s);
|
|
3479
|
+
let i = !1, r;
|
|
3480
|
+
const o = new Promise((h, m) => {
|
|
3481
|
+
const w = new Error(`${e} message request with response name of ${a} timed out after ${F}`);
|
|
3847
3482
|
setTimeout(() => {
|
|
3848
|
-
|
|
3849
|
-
},
|
|
3850
|
-
}), c = new Promise((
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
}, this.once(
|
|
3483
|
+
i = !0, this.off(a, r), m(w);
|
|
3484
|
+
}, F);
|
|
3485
|
+
}), c = new Promise((h) => {
|
|
3486
|
+
r = (m) => {
|
|
3487
|
+
i || h(m);
|
|
3488
|
+
}, this.once(a, h);
|
|
3854
3489
|
});
|
|
3855
3490
|
return Promise.race([o, c]);
|
|
3856
3491
|
}
|
|
3857
|
-
async subscribe(e, t,
|
|
3858
|
-
let
|
|
3859
|
-
typeof t == "function" ?
|
|
3860
|
-
const
|
|
3492
|
+
async subscribe(e, t, a) {
|
|
3493
|
+
let s, i;
|
|
3494
|
+
typeof t == "function" ? i = t : (s = t, i = a);
|
|
3495
|
+
const r = J(), o = J();
|
|
3861
3496
|
let c = this._subscriptionNamesBySubjectName.get(e);
|
|
3862
|
-
c || (c = [], this._subscriptionNamesBySubjectName.set(e, c)), c.push(
|
|
3863
|
-
const
|
|
3864
|
-
telemetrySdkVersion:
|
|
3497
|
+
c || (c = [], this._subscriptionNamesBySubjectName.set(e, c)), c.push(r), this._subscriptionNamesByHandler.set(i, r), this.on(r, i);
|
|
3498
|
+
const h = W({
|
|
3499
|
+
telemetrySdkVersion: G,
|
|
3865
3500
|
applicationName: this._applicationName,
|
|
3866
3501
|
applicationSpecifier: this._applicationSpecifier,
|
|
3867
3502
|
applicationInstance: this._applicationInstance,
|
|
3868
3503
|
name: e,
|
|
3869
|
-
data:
|
|
3504
|
+
data: s,
|
|
3870
3505
|
responseName: o,
|
|
3871
|
-
subscriptionName:
|
|
3506
|
+
subscriptionName: r
|
|
3872
3507
|
});
|
|
3873
|
-
|
|
3874
|
-
let
|
|
3875
|
-
const Z = new Promise((
|
|
3876
|
-
const
|
|
3508
|
+
z(h);
|
|
3509
|
+
let m = !1, w;
|
|
3510
|
+
const Z = new Promise((j, P) => {
|
|
3511
|
+
const se = new Error(`${e} subscribe request with subscription name of ${r} and response name of ${o} timed out after ${F}`);
|
|
3877
3512
|
setTimeout(() => {
|
|
3878
|
-
|
|
3879
|
-
},
|
|
3880
|
-
}),
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
}, this.on(o,
|
|
3884
|
-
});
|
|
3885
|
-
return Promise.race([Z,
|
|
3886
|
-
}
|
|
3887
|
-
async unsubscribe(e, t,
|
|
3888
|
-
let
|
|
3889
|
-
typeof t == "function" ?
|
|
3890
|
-
const
|
|
3513
|
+
m = !0, this.off(o, w), P(se);
|
|
3514
|
+
}, F);
|
|
3515
|
+
}), ae = new Promise((j) => {
|
|
3516
|
+
w = (P) => {
|
|
3517
|
+
m || j(P);
|
|
3518
|
+
}, this.on(o, j);
|
|
3519
|
+
});
|
|
3520
|
+
return Promise.race([Z, ae]);
|
|
3521
|
+
}
|
|
3522
|
+
async unsubscribe(e, t, a) {
|
|
3523
|
+
let s, i;
|
|
3524
|
+
typeof t == "function" ? i = t : (s = t, i = a);
|
|
3525
|
+
const r = J();
|
|
3891
3526
|
let o = [];
|
|
3892
|
-
if (
|
|
3893
|
-
const c = this._subscriptionNamesByHandler.get(
|
|
3527
|
+
if (i) {
|
|
3528
|
+
const c = this._subscriptionNamesByHandler.get(i);
|
|
3894
3529
|
if (!c)
|
|
3895
3530
|
return { success: !1 };
|
|
3896
|
-
o = [c], this._subscriptionNamesByHandler.delete(
|
|
3531
|
+
o = [c], this._subscriptionNamesByHandler.delete(i);
|
|
3897
3532
|
} else if (!this._subscriptionNamesBySubjectName.get(e))
|
|
3898
3533
|
return { success: !1 };
|
|
3899
3534
|
for await (const c of o) {
|
|
3900
|
-
this.off(c,
|
|
3901
|
-
const
|
|
3902
|
-
telemetrySdkVersion:
|
|
3535
|
+
this.off(c, i);
|
|
3536
|
+
const h = W({
|
|
3537
|
+
telemetrySdkVersion: G,
|
|
3903
3538
|
applicationInstance: this._applicationInstance,
|
|
3904
3539
|
applicationName: this._applicationName,
|
|
3905
3540
|
applicationSpecifier: this._applicationSpecifier,
|
|
3906
3541
|
name: e,
|
|
3907
|
-
data:
|
|
3908
|
-
responseName:
|
|
3542
|
+
data: s,
|
|
3543
|
+
responseName: r,
|
|
3909
3544
|
unsubscribeName: c
|
|
3910
3545
|
});
|
|
3911
|
-
|
|
3912
|
-
let
|
|
3913
|
-
const Z = new Promise((
|
|
3914
|
-
const
|
|
3546
|
+
z(h);
|
|
3547
|
+
let m = !1, w;
|
|
3548
|
+
const Z = new Promise((j, P) => {
|
|
3549
|
+
const se = new Error(`${e} unsubscribe request with unsubscribe name of ${c} and response name of ${r} timed out after ${F}`);
|
|
3915
3550
|
setTimeout(() => {
|
|
3916
|
-
|
|
3917
|
-
},
|
|
3918
|
-
}),
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
}, this.once(
|
|
3551
|
+
m = !0, this.off(r, w), P(se);
|
|
3552
|
+
}, F);
|
|
3553
|
+
}), ae = new Promise((j) => {
|
|
3554
|
+
w = (P) => {
|
|
3555
|
+
m || j(P);
|
|
3556
|
+
}, this.once(r, j);
|
|
3922
3557
|
});
|
|
3923
|
-
if (!(await Promise.race([Z,
|
|
3558
|
+
if (!(await Promise.race([Z, ae])).success)
|
|
3924
3559
|
return { success: !1 };
|
|
3925
3560
|
}
|
|
3926
3561
|
return { success: !0 };
|
|
@@ -3943,9 +3578,9 @@ class Cs {
|
|
|
3943
3578
|
* @param handler The callback function to execute when messages are received
|
|
3944
3579
|
*/
|
|
3945
3580
|
on(e, t) {
|
|
3946
|
-
var
|
|
3947
|
-
const
|
|
3948
|
-
|
|
3581
|
+
var a;
|
|
3582
|
+
const s = (a = this._onHandlers.get(e)) !== null && a !== void 0 ? a : [];
|
|
3583
|
+
s.length === 0 && this._onHandlers.set(e, s), s.push(t);
|
|
3949
3584
|
}
|
|
3950
3585
|
/**
|
|
3951
3586
|
* Registers a one-time handler for a specific message type.
|
|
@@ -3962,9 +3597,9 @@ class Cs {
|
|
|
3962
3597
|
* @param handler The callback function to execute when the message is received
|
|
3963
3598
|
*/
|
|
3964
3599
|
once(e, t) {
|
|
3965
|
-
var
|
|
3966
|
-
const
|
|
3967
|
-
|
|
3600
|
+
var a;
|
|
3601
|
+
const s = (a = this._onceHandlers.get(e)) !== null && a !== void 0 ? a : [];
|
|
3602
|
+
s.length === 0 && this._onceHandlers.set(e, s), s.push(t);
|
|
3968
3603
|
}
|
|
3969
3604
|
/**
|
|
3970
3605
|
* Removes previously registered message handlers.
|
|
@@ -3982,26 +3617,26 @@ class Cs {
|
|
|
3982
3617
|
* all handlers for this message type will be removed.
|
|
3983
3618
|
*/
|
|
3984
3619
|
off(e, t) {
|
|
3985
|
-
const
|
|
3986
|
-
if (!(!
|
|
3987
|
-
if (
|
|
3988
|
-
for (let
|
|
3989
|
-
t &&
|
|
3990
|
-
|
|
3620
|
+
const a = this._onHandlers.get(e), s = this._onceHandlers.get(e);
|
|
3621
|
+
if (!(!a && !s)) {
|
|
3622
|
+
if (a) {
|
|
3623
|
+
for (let i = 0; i < a.length; i += 1)
|
|
3624
|
+
t && a[i] !== t || (a.splice(i, 1), i -= 1);
|
|
3625
|
+
a.length === 0 && this._onHandlers.delete(e);
|
|
3991
3626
|
}
|
|
3992
|
-
if (
|
|
3993
|
-
for (let
|
|
3994
|
-
t &&
|
|
3995
|
-
|
|
3627
|
+
if (s) {
|
|
3628
|
+
for (let i = 0; i < s.length; i += 1)
|
|
3629
|
+
t && s[i] !== t || (s.splice(i, 1), i -= 1);
|
|
3630
|
+
s.length === 0 && this._onceHandlers.delete(e);
|
|
3996
3631
|
}
|
|
3997
3632
|
}
|
|
3998
3633
|
}
|
|
3999
3634
|
}
|
|
4000
|
-
function
|
|
3635
|
+
function J() {
|
|
4001
3636
|
return Math.random().toString(36).slice(2, 9);
|
|
4002
3637
|
}
|
|
4003
|
-
const
|
|
4004
|
-
class
|
|
3638
|
+
const G = _t.version;
|
|
3639
|
+
class Ot {
|
|
4005
3640
|
constructor(e) {
|
|
4006
3641
|
this._client = e;
|
|
4007
3642
|
}
|
|
@@ -4050,7 +3685,7 @@ class Os {
|
|
|
4050
3685
|
return !0;
|
|
4051
3686
|
}
|
|
4052
3687
|
}
|
|
4053
|
-
class
|
|
3688
|
+
class At {
|
|
4054
3689
|
constructor(e) {
|
|
4055
3690
|
this._client = e;
|
|
4056
3691
|
}
|
|
@@ -4106,112 +3741,113 @@ class As {
|
|
|
4106
3741
|
return !0;
|
|
4107
3742
|
}
|
|
4108
3743
|
}
|
|
4109
|
-
class
|
|
3744
|
+
class It extends Zt {
|
|
4110
3745
|
get playlist() {
|
|
4111
|
-
return new
|
|
3746
|
+
return new At(this);
|
|
4112
3747
|
}
|
|
4113
3748
|
get overrides() {
|
|
4114
|
-
return new
|
|
3749
|
+
return new Ot(this);
|
|
4115
3750
|
}
|
|
4116
3751
|
}
|
|
4117
3752
|
let g = null;
|
|
4118
|
-
function
|
|
3753
|
+
function Dt() {
|
|
4119
3754
|
return g;
|
|
4120
3755
|
}
|
|
4121
|
-
function
|
|
4122
|
-
g = new
|
|
3756
|
+
function Vt(n) {
|
|
3757
|
+
g = new It(n), g.bind();
|
|
4123
3758
|
}
|
|
4124
|
-
function
|
|
3759
|
+
function zt() {
|
|
4125
3760
|
g == null || g.unbind(), g = null;
|
|
4126
3761
|
}
|
|
4127
|
-
function
|
|
4128
|
-
return k(g), g.on(...
|
|
3762
|
+
function Bt(...n) {
|
|
3763
|
+
return k(g), g.on(...n);
|
|
4129
3764
|
}
|
|
4130
|
-
function
|
|
4131
|
-
return k(g), g.once(...
|
|
3765
|
+
function Ut(...n) {
|
|
3766
|
+
return k(g), g.once(...n);
|
|
4132
3767
|
}
|
|
4133
|
-
function
|
|
4134
|
-
return k(g), g.off(...
|
|
3768
|
+
function Ht(...n) {
|
|
3769
|
+
return k(g), g.off(...n);
|
|
4135
3770
|
}
|
|
4136
|
-
function
|
|
4137
|
-
return k(g), g.send(...
|
|
3771
|
+
function Kt(...n) {
|
|
3772
|
+
return k(g), g.send(...n);
|
|
4138
3773
|
}
|
|
4139
|
-
function
|
|
4140
|
-
return k(g), g.request(...
|
|
3774
|
+
function Wt(...n) {
|
|
3775
|
+
return k(g), g.request(...n);
|
|
4141
3776
|
}
|
|
4142
|
-
function
|
|
4143
|
-
return k(g), g.subscribe(...
|
|
3777
|
+
function Jt(...n) {
|
|
3778
|
+
return k(g), g.subscribe(...n);
|
|
4144
3779
|
}
|
|
4145
|
-
function
|
|
4146
|
-
return k(g), g.unsubscribe(...
|
|
3780
|
+
function Gt(...n) {
|
|
3781
|
+
return k(g), g.unsubscribe(...n);
|
|
4147
3782
|
}
|
|
4148
|
-
function
|
|
3783
|
+
function Yt() {
|
|
4149
3784
|
return k(g), g.store;
|
|
4150
3785
|
}
|
|
4151
|
-
function
|
|
3786
|
+
function Xt() {
|
|
4152
3787
|
return k(g), g.applications;
|
|
4153
3788
|
}
|
|
4154
|
-
function
|
|
3789
|
+
function Qt() {
|
|
4155
3790
|
return k(g), g.media;
|
|
4156
3791
|
}
|
|
4157
|
-
function
|
|
3792
|
+
function ea() {
|
|
4158
3793
|
return k(g), g.accounts;
|
|
4159
3794
|
}
|
|
4160
|
-
function
|
|
3795
|
+
function ta() {
|
|
4161
3796
|
return k(g), g.users;
|
|
4162
3797
|
}
|
|
4163
|
-
function
|
|
3798
|
+
function aa() {
|
|
4164
3799
|
return k(g), g.devices;
|
|
4165
3800
|
}
|
|
4166
|
-
function
|
|
3801
|
+
function sa() {
|
|
4167
3802
|
return k(g), g.proxy;
|
|
4168
3803
|
}
|
|
4169
|
-
function
|
|
3804
|
+
function na() {
|
|
4170
3805
|
return k(g), g.weather;
|
|
4171
3806
|
}
|
|
4172
|
-
function
|
|
3807
|
+
function ra() {
|
|
4173
3808
|
return k(g), g.environment;
|
|
4174
3809
|
}
|
|
4175
|
-
function
|
|
3810
|
+
function ia() {
|
|
4176
3811
|
return k(g), g.playlist;
|
|
4177
3812
|
}
|
|
4178
|
-
function
|
|
3813
|
+
function oa() {
|
|
4179
3814
|
return k(g), g.overrides;
|
|
4180
3815
|
}
|
|
4181
|
-
function k(
|
|
4182
|
-
if (!
|
|
3816
|
+
function k(n) {
|
|
3817
|
+
if (!n)
|
|
4183
3818
|
throw new Error("SDK is not configured");
|
|
4184
3819
|
}
|
|
4185
3820
|
export {
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
3821
|
+
gt as Accounts,
|
|
3822
|
+
yt as Applications,
|
|
3823
|
+
vt as Devices,
|
|
3824
|
+
bt as Environment,
|
|
3825
|
+
wt as Media,
|
|
3826
|
+
kt as Proxy,
|
|
3827
|
+
xt as Store,
|
|
3828
|
+
K as StoreSlice,
|
|
3829
|
+
St as Users,
|
|
3830
|
+
Nt as Weather,
|
|
3831
|
+
ea as accounts,
|
|
3832
|
+
Xt as applications,
|
|
3833
|
+
Vt as configure,
|
|
3834
|
+
zt as destroy,
|
|
3835
|
+
aa as devices,
|
|
3836
|
+
ra as environment,
|
|
3837
|
+
Dt as globalClient,
|
|
3838
|
+
Qt as media,
|
|
3839
|
+
Ht as off,
|
|
3840
|
+
Bt as on,
|
|
3841
|
+
Ut as once,
|
|
3842
|
+
oa as overrides,
|
|
3843
|
+
ia as playlist,
|
|
3844
|
+
sa as proxy,
|
|
3845
|
+
Wt as request,
|
|
3846
|
+
Kt as send,
|
|
3847
|
+
Yt as store,
|
|
3848
|
+
Jt as subscribe,
|
|
3849
|
+
G as telemetrySdkVersion,
|
|
3850
|
+
Gt as unsubscribe,
|
|
3851
|
+
ta as users,
|
|
3852
|
+
na as weather
|
|
4217
3853
|
};
|