@telemetryos/sdk 1.7.4 → 1.8.0
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 +22 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.js +734 -668
- package/dist/react/Settings.d.ts +20 -0
- package/dist/react/hooks/store.d.ts +14 -0
- package/dist/react/hooks/ui-scale.d.ts +6 -0
- package/dist/react/index.d.ts +2 -2
- package/dist/react.cjs +80 -12
- package/dist/react.js +377 -261
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
var b;
|
|
2
2
|
(function(n) {
|
|
3
|
-
n.assertEqual = (
|
|
3
|
+
n.assertEqual = (a) => {
|
|
4
4
|
};
|
|
5
|
-
function e(
|
|
5
|
+
function e(a) {
|
|
6
6
|
}
|
|
7
7
|
n.assertIs = e;
|
|
8
|
-
function t(
|
|
8
|
+
function t(a) {
|
|
9
9
|
throw new Error();
|
|
10
10
|
}
|
|
11
|
-
n.assertNever = t, n.arrayToEnum = (
|
|
11
|
+
n.assertNever = t, n.arrayToEnum = (a) => {
|
|
12
12
|
const i = {};
|
|
13
|
-
for (const r of
|
|
13
|
+
for (const r of a)
|
|
14
14
|
i[r] = r;
|
|
15
15
|
return i;
|
|
16
|
-
}, n.getValidEnumValues = (
|
|
17
|
-
const i = n.objectKeys(
|
|
16
|
+
}, n.getValidEnumValues = (a) => {
|
|
17
|
+
const i = n.objectKeys(a).filter((o) => typeof a[a[o]] != "number"), r = {};
|
|
18
18
|
for (const o of i)
|
|
19
|
-
r[o] =
|
|
19
|
+
r[o] = a[o];
|
|
20
20
|
return n.objectValues(r);
|
|
21
|
-
}, n.objectValues = (
|
|
22
|
-
return
|
|
23
|
-
}), n.objectKeys = typeof Object.keys == "function" ? (
|
|
21
|
+
}, n.objectValues = (a) => n.objectKeys(a).map(function(i) {
|
|
22
|
+
return a[i];
|
|
23
|
+
}), n.objectKeys = typeof Object.keys == "function" ? (a) => Object.keys(a) : (a) => {
|
|
24
24
|
const i = [];
|
|
25
|
-
for (const r in
|
|
26
|
-
Object.prototype.hasOwnProperty.call(
|
|
25
|
+
for (const r in a)
|
|
26
|
+
Object.prototype.hasOwnProperty.call(a, r) && i.push(r);
|
|
27
27
|
return i;
|
|
28
|
-
}, n.find = (
|
|
29
|
-
for (const r of
|
|
28
|
+
}, n.find = (a, i) => {
|
|
29
|
+
for (const r of a)
|
|
30
30
|
if (i(r))
|
|
31
31
|
return r;
|
|
32
|
-
}, n.isInteger = typeof Number.isInteger == "function" ? (
|
|
33
|
-
function a
|
|
34
|
-
return
|
|
32
|
+
}, n.isInteger = typeof Number.isInteger == "function" ? (a) => Number.isInteger(a) : (a) => typeof a == "number" && Number.isFinite(a) && Math.floor(a) === a;
|
|
33
|
+
function s(a, i = " | ") {
|
|
34
|
+
return a.map((r) => typeof r == "string" ? `'${r}'` : r).join(i);
|
|
35
35
|
}
|
|
36
|
-
n.joinValues =
|
|
36
|
+
n.joinValues = s, n.jsonStringifyReplacer = (a, i) => typeof i == "bigint" ? i.toString() : i;
|
|
37
37
|
})(b || (b = {}));
|
|
38
38
|
var ye;
|
|
39
39
|
(function(n) {
|
|
@@ -108,10 +108,10 @@ class C extends Error {
|
|
|
108
108
|
return this.issues;
|
|
109
109
|
}
|
|
110
110
|
constructor(e) {
|
|
111
|
-
super(), this.issues = [], this.addIssue = (
|
|
112
|
-
this.issues = [...this.issues,
|
|
113
|
-
}, this.addIssues = (
|
|
114
|
-
this.issues = [...this.issues, ...
|
|
111
|
+
super(), this.issues = [], this.addIssue = (s) => {
|
|
112
|
+
this.issues = [...this.issues, s];
|
|
113
|
+
}, this.addIssues = (s = []) => {
|
|
114
|
+
this.issues = [...this.issues, ...s];
|
|
115
115
|
};
|
|
116
116
|
const t = new.target.prototype;
|
|
117
117
|
Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
|
|
@@ -119,25 +119,25 @@ class C extends Error {
|
|
|
119
119
|
format(e) {
|
|
120
120
|
const t = e || function(i) {
|
|
121
121
|
return i.message;
|
|
122
|
-
},
|
|
122
|
+
}, s = { _errors: [] }, a = (i) => {
|
|
123
123
|
for (const r of i.issues)
|
|
124
124
|
if (r.code === "invalid_union")
|
|
125
|
-
r.unionErrors.map(
|
|
125
|
+
r.unionErrors.map(a);
|
|
126
126
|
else if (r.code === "invalid_return_type")
|
|
127
|
-
|
|
127
|
+
a(r.returnTypeError);
|
|
128
128
|
else if (r.code === "invalid_arguments")
|
|
129
|
-
|
|
129
|
+
a(r.argumentsError);
|
|
130
130
|
else if (r.path.length === 0)
|
|
131
|
-
|
|
131
|
+
s._errors.push(t(r));
|
|
132
132
|
else {
|
|
133
|
-
let o =
|
|
133
|
+
let o = s, c = 0;
|
|
134
134
|
for (; c < r.path.length; ) {
|
|
135
135
|
const h = r.path[c];
|
|
136
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++;
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
};
|
|
140
|
-
return
|
|
140
|
+
return a(this), s;
|
|
141
141
|
}
|
|
142
142
|
static assert(e) {
|
|
143
143
|
if (!(e instanceof C))
|
|
@@ -153,14 +153,14 @@ class C extends Error {
|
|
|
153
153
|
return this.issues.length === 0;
|
|
154
154
|
}
|
|
155
155
|
flatten(e = (t) => t.message) {
|
|
156
|
-
const t = {},
|
|
157
|
-
for (const
|
|
158
|
-
if (
|
|
159
|
-
const i =
|
|
160
|
-
t[i] = t[i] || [], t[i].push(e(
|
|
156
|
+
const t = {}, s = [];
|
|
157
|
+
for (const a of this.issues)
|
|
158
|
+
if (a.path.length > 0) {
|
|
159
|
+
const i = a.path[0];
|
|
160
|
+
t[i] = t[i] || [], t[i].push(e(a));
|
|
161
161
|
} else
|
|
162
|
-
|
|
163
|
-
return { formErrors:
|
|
162
|
+
s.push(e(a));
|
|
163
|
+
return { formErrors: s, fieldErrors: t };
|
|
164
164
|
}
|
|
165
165
|
get formErrors() {
|
|
166
166
|
return this.flatten();
|
|
@@ -228,28 +228,28 @@ function qe() {
|
|
|
228
228
|
return Le;
|
|
229
229
|
}
|
|
230
230
|
const De = (n) => {
|
|
231
|
-
const { data: e, path: t, errorMaps:
|
|
232
|
-
...
|
|
231
|
+
const { data: e, path: t, errorMaps: s, issueData: a } = n, i = [...t, ...a.path || []], r = {
|
|
232
|
+
...a,
|
|
233
233
|
path: i
|
|
234
234
|
};
|
|
235
|
-
if (
|
|
235
|
+
if (a.message !== void 0)
|
|
236
236
|
return {
|
|
237
|
-
...
|
|
237
|
+
...a,
|
|
238
238
|
path: i,
|
|
239
|
-
message:
|
|
239
|
+
message: a.message
|
|
240
240
|
};
|
|
241
241
|
let o = "";
|
|
242
|
-
const c =
|
|
242
|
+
const c = s.filter((h) => !!h).slice().reverse();
|
|
243
243
|
for (const h of c)
|
|
244
244
|
o = h(r, { data: e, defaultError: o }).message;
|
|
245
245
|
return {
|
|
246
|
-
...
|
|
246
|
+
...a,
|
|
247
247
|
path: i,
|
|
248
248
|
message: o
|
|
249
249
|
};
|
|
250
250
|
};
|
|
251
251
|
function u(n, e) {
|
|
252
|
-
const t = qe(),
|
|
252
|
+
const t = qe(), s = De({
|
|
253
253
|
issueData: e,
|
|
254
254
|
data: n.data,
|
|
255
255
|
path: n.path,
|
|
@@ -262,9 +262,9 @@ function u(n, e) {
|
|
|
262
262
|
// then global override map
|
|
263
263
|
t === re ? void 0 : re
|
|
264
264
|
// then global default map
|
|
265
|
-
].filter((
|
|
265
|
+
].filter((a) => !!a)
|
|
266
266
|
});
|
|
267
|
-
n.common.issues.push(
|
|
267
|
+
n.common.issues.push(s);
|
|
268
268
|
}
|
|
269
269
|
let N = class je {
|
|
270
270
|
constructor() {
|
|
@@ -277,37 +277,37 @@ let N = class je {
|
|
|
277
277
|
this.value !== "aborted" && (this.value = "aborted");
|
|
278
278
|
}
|
|
279
279
|
static mergeArray(e, t) {
|
|
280
|
-
const
|
|
281
|
-
for (const
|
|
282
|
-
if (
|
|
283
|
-
return
|
|
284
|
-
|
|
280
|
+
const s = [];
|
|
281
|
+
for (const a of t) {
|
|
282
|
+
if (a.status === "aborted")
|
|
283
|
+
return g;
|
|
284
|
+
a.status === "dirty" && e.dirty(), s.push(a.value);
|
|
285
285
|
}
|
|
286
|
-
return { status: e.value, value:
|
|
286
|
+
return { status: e.value, value: s };
|
|
287
287
|
}
|
|
288
288
|
static async mergeObjectAsync(e, t) {
|
|
289
|
-
const
|
|
290
|
-
for (const
|
|
291
|
-
const i = await
|
|
292
|
-
|
|
289
|
+
const s = [];
|
|
290
|
+
for (const a of t) {
|
|
291
|
+
const i = await a.key, r = await a.value;
|
|
292
|
+
s.push({
|
|
293
293
|
key: i,
|
|
294
294
|
value: r
|
|
295
295
|
});
|
|
296
296
|
}
|
|
297
|
-
return je.mergeObjectSync(e,
|
|
297
|
+
return je.mergeObjectSync(e, s);
|
|
298
298
|
}
|
|
299
299
|
static mergeObjectSync(e, t) {
|
|
300
|
-
const
|
|
301
|
-
for (const
|
|
302
|
-
const { key: i, value: r } =
|
|
300
|
+
const s = {};
|
|
301
|
+
for (const a of t) {
|
|
302
|
+
const { key: i, value: r } = a;
|
|
303
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" ||
|
|
304
|
+
return g;
|
|
305
|
+
i.status === "dirty" && e.dirty(), r.status === "dirty" && e.dirty(), i.value !== "__proto__" && (typeof r.value < "u" || a.alwaysSet) && (s[i.value] = r.value);
|
|
306
306
|
}
|
|
307
|
-
return { status: e.value, value:
|
|
307
|
+
return { status: e.value, value: s };
|
|
308
308
|
}
|
|
309
309
|
};
|
|
310
|
-
const
|
|
310
|
+
const g = Object.freeze({
|
|
311
311
|
status: "aborted"
|
|
312
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;
|
|
313
313
|
var p;
|
|
@@ -315,8 +315,8 @@ var p;
|
|
|
315
315
|
n.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, n.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
316
316
|
})(p || (p = {}));
|
|
317
317
|
let $ = class {
|
|
318
|
-
constructor(e, t,
|
|
319
|
-
this._cachedPath = [], this.parent = e, this.data = t, this._path =
|
|
318
|
+
constructor(e, t, s, a) {
|
|
319
|
+
this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = a;
|
|
320
320
|
}
|
|
321
321
|
get path() {
|
|
322
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;
|
|
@@ -340,13 +340,13 @@ const we = (n, e) => {
|
|
|
340
340
|
function y(n) {
|
|
341
341
|
if (!n)
|
|
342
342
|
return {};
|
|
343
|
-
const { errorMap: e, invalid_type_error: t, required_error:
|
|
344
|
-
if (e && (t ||
|
|
343
|
+
const { errorMap: e, invalid_type_error: t, required_error: s, description: a } = n;
|
|
344
|
+
if (e && (t || s))
|
|
345
345
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
346
|
-
return e ? { errorMap: e, description:
|
|
346
|
+
return e ? { errorMap: e, description: a } : { errorMap: (i, r) => {
|
|
347
347
|
const { message: o } = n;
|
|
348
|
-
return i.code === "invalid_enum_value" ? { message: o ?? r.defaultError } : typeof r.data > "u" ? { message: o ??
|
|
349
|
-
}, description:
|
|
348
|
+
return i.code === "invalid_enum_value" ? { message: o ?? r.defaultError } : typeof r.data > "u" ? { message: o ?? s ?? r.defaultError } : i.code !== "invalid_type" ? { message: r.defaultError } : { message: o ?? t ?? r.defaultError };
|
|
349
|
+
}, description: a };
|
|
350
350
|
}
|
|
351
351
|
let v = class {
|
|
352
352
|
get description() {
|
|
@@ -389,13 +389,13 @@ let v = class {
|
|
|
389
389
|
return Promise.resolve(t);
|
|
390
390
|
}
|
|
391
391
|
parse(e, t) {
|
|
392
|
-
const
|
|
393
|
-
if (
|
|
394
|
-
return
|
|
395
|
-
throw
|
|
392
|
+
const s = this.safeParse(e, t);
|
|
393
|
+
if (s.success)
|
|
394
|
+
return s.data;
|
|
395
|
+
throw s.error;
|
|
396
396
|
}
|
|
397
397
|
safeParse(e, t) {
|
|
398
|
-
const
|
|
398
|
+
const s = {
|
|
399
399
|
common: {
|
|
400
400
|
issues: [],
|
|
401
401
|
async: (t == null ? void 0 : t.async) ?? !1,
|
|
@@ -406,12 +406,12 @@ let v = class {
|
|
|
406
406
|
parent: null,
|
|
407
407
|
data: e,
|
|
408
408
|
parsedType: O(e)
|
|
409
|
-
},
|
|
410
|
-
return we(
|
|
409
|
+
}, a = this._parseSync({ data: e, path: s.path, parent: s });
|
|
410
|
+
return we(s, a);
|
|
411
411
|
}
|
|
412
412
|
"~validate"(e) {
|
|
413
|
-
var t,
|
|
414
|
-
const
|
|
413
|
+
var t, s;
|
|
414
|
+
const a = {
|
|
415
415
|
common: {
|
|
416
416
|
issues: [],
|
|
417
417
|
async: !!this["~standard"].async
|
|
@@ -424,32 +424,32 @@ let v = class {
|
|
|
424
424
|
};
|
|
425
425
|
if (!this["~standard"].async)
|
|
426
426
|
try {
|
|
427
|
-
const i = this._parseSync({ data: e, path: [], parent:
|
|
427
|
+
const i = this._parseSync({ data: e, path: [], parent: a });
|
|
428
428
|
return L(i) ? {
|
|
429
429
|
value: i.value
|
|
430
430
|
} : {
|
|
431
|
-
issues:
|
|
431
|
+
issues: a.common.issues
|
|
432
432
|
};
|
|
433
433
|
} catch (i) {
|
|
434
|
-
(
|
|
434
|
+
(s = (t = i == null ? void 0 : i.message) == null ? void 0 : t.toLowerCase()) != null && s.includes("encountered") && (this["~standard"].async = !0), a.common = {
|
|
435
435
|
issues: [],
|
|
436
436
|
async: !0
|
|
437
437
|
};
|
|
438
438
|
}
|
|
439
|
-
return this._parseAsync({ data: e, path: [], parent:
|
|
439
|
+
return this._parseAsync({ data: e, path: [], parent: a }).then((i) => L(i) ? {
|
|
440
440
|
value: i.value
|
|
441
441
|
} : {
|
|
442
|
-
issues:
|
|
442
|
+
issues: a.common.issues
|
|
443
443
|
});
|
|
444
444
|
}
|
|
445
445
|
async parseAsync(e, t) {
|
|
446
|
-
const
|
|
447
|
-
if (
|
|
448
|
-
return
|
|
449
|
-
throw
|
|
446
|
+
const s = await this.safeParseAsync(e, t);
|
|
447
|
+
if (s.success)
|
|
448
|
+
return s.data;
|
|
449
|
+
throw s.error;
|
|
450
450
|
}
|
|
451
451
|
async safeParseAsync(e, t) {
|
|
452
|
-
const
|
|
452
|
+
const s = {
|
|
453
453
|
common: {
|
|
454
454
|
issues: [],
|
|
455
455
|
contextualErrorMap: t == null ? void 0 : t.errorMap,
|
|
@@ -460,26 +460,26 @@ let v = class {
|
|
|
460
460
|
parent: null,
|
|
461
461
|
data: e,
|
|
462
462
|
parsedType: O(e)
|
|
463
|
-
},
|
|
464
|
-
return we(
|
|
463
|
+
}, a = this._parse({ data: e, path: s.path, parent: s }), i = await (X(a) ? a : Promise.resolve(a));
|
|
464
|
+
return we(s, i);
|
|
465
465
|
}
|
|
466
466
|
refine(e, t) {
|
|
467
|
-
const
|
|
468
|
-
return this._refinement((
|
|
469
|
-
const r = e(
|
|
467
|
+
const s = (a) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(a) : t;
|
|
468
|
+
return this._refinement((a, i) => {
|
|
469
|
+
const r = e(a), o = () => i.addIssue({
|
|
470
470
|
code: d.custom,
|
|
471
|
-
...a
|
|
471
|
+
...s(a)
|
|
472
472
|
});
|
|
473
473
|
return typeof Promise < "u" && r instanceof Promise ? r.then((c) => c ? !0 : (o(), !1)) : r ? !0 : (o(), !1);
|
|
474
474
|
});
|
|
475
475
|
}
|
|
476
476
|
refinement(e, t) {
|
|
477
|
-
return this._refinement((
|
|
477
|
+
return this._refinement((s, a) => e(s) ? !0 : (a.addIssue(typeof t == "function" ? t(s, a) : t), !1));
|
|
478
478
|
}
|
|
479
479
|
_refinement(e) {
|
|
480
480
|
return new D({
|
|
481
481
|
schema: this,
|
|
482
|
-
typeName:
|
|
482
|
+
typeName: m.ZodEffects,
|
|
483
483
|
effect: { type: "refinement", refinement: e }
|
|
484
484
|
});
|
|
485
485
|
}
|
|
@@ -518,7 +518,7 @@ let v = class {
|
|
|
518
518
|
return new D({
|
|
519
519
|
...y(this._def),
|
|
520
520
|
schema: this,
|
|
521
|
-
typeName:
|
|
521
|
+
typeName: m.ZodEffects,
|
|
522
522
|
effect: { type: "transform", transform: e }
|
|
523
523
|
});
|
|
524
524
|
}
|
|
@@ -528,12 +528,12 @@ let v = class {
|
|
|
528
528
|
...y(this._def),
|
|
529
529
|
innerType: this,
|
|
530
530
|
defaultValue: t,
|
|
531
|
-
typeName:
|
|
531
|
+
typeName: m.ZodDefault
|
|
532
532
|
});
|
|
533
533
|
}
|
|
534
534
|
brand() {
|
|
535
535
|
return new ut({
|
|
536
|
-
typeName:
|
|
536
|
+
typeName: m.ZodBranded,
|
|
537
537
|
type: this,
|
|
538
538
|
...y(this._def)
|
|
539
539
|
});
|
|
@@ -544,7 +544,7 @@ let v = class {
|
|
|
544
544
|
...y(this._def),
|
|
545
545
|
innerType: this,
|
|
546
546
|
catchValue: t,
|
|
547
|
-
typeName:
|
|
547
|
+
typeName: m.ZodCatch
|
|
548
548
|
});
|
|
549
549
|
}
|
|
550
550
|
describe(e) {
|
|
@@ -569,7 +569,7 @@ let v = class {
|
|
|
569
569
|
};
|
|
570
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
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}=))?$/,
|
|
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}=))?$/, st = /^([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])))", at = new RegExp(`^${Pe}$`);
|
|
573
573
|
function Re(n) {
|
|
574
574
|
let e = "[0-5]\\d";
|
|
575
575
|
n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
@@ -594,8 +594,8 @@ function ot(n, e) {
|
|
|
594
594
|
const [t] = n.split(".");
|
|
595
595
|
if (!t)
|
|
596
596
|
return !1;
|
|
597
|
-
const
|
|
598
|
-
return !(typeof
|
|
597
|
+
const s = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), a = JSON.parse(atob(s));
|
|
598
|
+
return !(typeof a != "object" || a === null || "typ" in a && (a == null ? void 0 : a.typ) !== "JWT" || !a.alg || e && a.alg !== e);
|
|
599
599
|
} catch {
|
|
600
600
|
return !1;
|
|
601
601
|
}
|
|
@@ -606,163 +606,163 @@ function ct(n, e) {
|
|
|
606
606
|
class A extends v {
|
|
607
607
|
_parse(e) {
|
|
608
608
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== l.string) {
|
|
609
|
-
const
|
|
610
|
-
return u(
|
|
609
|
+
const a = this._getOrReturnCtx(e);
|
|
610
|
+
return u(a, {
|
|
611
611
|
code: d.invalid_type,
|
|
612
612
|
expected: l.string,
|
|
613
|
-
received:
|
|
614
|
-
}),
|
|
613
|
+
received: a.parsedType
|
|
614
|
+
}), g;
|
|
615
615
|
}
|
|
616
616
|
const t = new N();
|
|
617
|
-
let
|
|
618
|
-
for (const
|
|
619
|
-
if (
|
|
620
|
-
e.data.length <
|
|
617
|
+
let s;
|
|
618
|
+
for (const a of this._def.checks)
|
|
619
|
+
if (a.kind === "min")
|
|
620
|
+
e.data.length < a.value && (s = this._getOrReturnCtx(e, s), u(s, {
|
|
621
621
|
code: d.too_small,
|
|
622
|
-
minimum:
|
|
622
|
+
minimum: a.value,
|
|
623
623
|
type: "string",
|
|
624
624
|
inclusive: !0,
|
|
625
625
|
exact: !1,
|
|
626
|
-
message:
|
|
626
|
+
message: a.message
|
|
627
627
|
}), t.dirty());
|
|
628
|
-
else if (
|
|
629
|
-
e.data.length >
|
|
628
|
+
else if (a.kind === "max")
|
|
629
|
+
e.data.length > a.value && (s = this._getOrReturnCtx(e, s), u(s, {
|
|
630
630
|
code: d.too_big,
|
|
631
|
-
maximum:
|
|
631
|
+
maximum: a.value,
|
|
632
632
|
type: "string",
|
|
633
633
|
inclusive: !0,
|
|
634
634
|
exact: !1,
|
|
635
|
-
message:
|
|
635
|
+
message: a.message
|
|
636
636
|
}), t.dirty());
|
|
637
|
-
else if (
|
|
638
|
-
const i = e.data.length >
|
|
639
|
-
(i || r) && (
|
|
637
|
+
else if (a.kind === "length") {
|
|
638
|
+
const i = e.data.length > a.value, r = e.data.length < a.value;
|
|
639
|
+
(i || r) && (s = this._getOrReturnCtx(e, s), i ? u(s, {
|
|
640
640
|
code: d.too_big,
|
|
641
|
-
maximum:
|
|
641
|
+
maximum: a.value,
|
|
642
642
|
type: "string",
|
|
643
643
|
inclusive: !0,
|
|
644
644
|
exact: !0,
|
|
645
|
-
message:
|
|
646
|
-
}) : r && u(
|
|
645
|
+
message: a.message
|
|
646
|
+
}) : r && u(s, {
|
|
647
647
|
code: d.too_small,
|
|
648
|
-
minimum:
|
|
648
|
+
minimum: a.value,
|
|
649
649
|
type: "string",
|
|
650
650
|
inclusive: !0,
|
|
651
651
|
exact: !0,
|
|
652
|
-
message:
|
|
652
|
+
message: a.message
|
|
653
653
|
}), t.dirty());
|
|
654
|
-
} else if (
|
|
655
|
-
Je.test(e.data) || (
|
|
654
|
+
} else if (a.kind === "email")
|
|
655
|
+
Je.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
|
|
656
656
|
validation: "email",
|
|
657
657
|
code: d.invalid_string,
|
|
658
|
-
message:
|
|
658
|
+
message: a.message
|
|
659
659
|
}), t.dirty());
|
|
660
|
-
else if (
|
|
661
|
-
ne || (ne = new RegExp(Ge, "u")), ne.test(e.data) || (
|
|
660
|
+
else if (a.kind === "emoji")
|
|
661
|
+
ne || (ne = new RegExp(Ge, "u")), ne.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
|
|
662
662
|
validation: "emoji",
|
|
663
663
|
code: d.invalid_string,
|
|
664
|
-
message:
|
|
664
|
+
message: a.message
|
|
665
665
|
}), t.dirty());
|
|
666
|
-
else if (
|
|
667
|
-
Ue.test(e.data) || (
|
|
666
|
+
else if (a.kind === "uuid")
|
|
667
|
+
Ue.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
|
|
668
668
|
validation: "uuid",
|
|
669
669
|
code: d.invalid_string,
|
|
670
|
-
message:
|
|
670
|
+
message: a.message
|
|
671
671
|
}), t.dirty());
|
|
672
|
-
else if (
|
|
673
|
-
He.test(e.data) || (
|
|
672
|
+
else if (a.kind === "nanoid")
|
|
673
|
+
He.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
|
|
674
674
|
validation: "nanoid",
|
|
675
675
|
code: d.invalid_string,
|
|
676
|
-
message:
|
|
676
|
+
message: a.message
|
|
677
677
|
}), t.dirty());
|
|
678
|
-
else if (
|
|
679
|
-
Ve.test(e.data) || (
|
|
678
|
+
else if (a.kind === "cuid")
|
|
679
|
+
Ve.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
|
|
680
680
|
validation: "cuid",
|
|
681
681
|
code: d.invalid_string,
|
|
682
|
-
message:
|
|
682
|
+
message: a.message
|
|
683
683
|
}), t.dirty());
|
|
684
|
-
else if (
|
|
685
|
-
ze.test(e.data) || (
|
|
684
|
+
else if (a.kind === "cuid2")
|
|
685
|
+
ze.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
|
|
686
686
|
validation: "cuid2",
|
|
687
687
|
code: d.invalid_string,
|
|
688
|
-
message:
|
|
688
|
+
message: a.message
|
|
689
689
|
}), t.dirty());
|
|
690
|
-
else if (
|
|
691
|
-
Be.test(e.data) || (
|
|
690
|
+
else if (a.kind === "ulid")
|
|
691
|
+
Be.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
|
|
692
692
|
validation: "ulid",
|
|
693
693
|
code: d.invalid_string,
|
|
694
|
-
message:
|
|
694
|
+
message: a.message
|
|
695
695
|
}), t.dirty());
|
|
696
|
-
else if (
|
|
696
|
+
else if (a.kind === "url")
|
|
697
697
|
try {
|
|
698
698
|
new URL(e.data);
|
|
699
699
|
} catch {
|
|
700
|
-
|
|
700
|
+
s = this._getOrReturnCtx(e, s), u(s, {
|
|
701
701
|
validation: "url",
|
|
702
702
|
code: d.invalid_string,
|
|
703
|
-
message:
|
|
703
|
+
message: a.message
|
|
704
704
|
}), t.dirty();
|
|
705
705
|
}
|
|
706
|
-
else
|
|
706
|
+
else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
|
|
707
707
|
validation: "regex",
|
|
708
708
|
code: d.invalid_string,
|
|
709
|
-
message:
|
|
710
|
-
}), t.dirty())) :
|
|
709
|
+
message: a.message
|
|
710
|
+
}), t.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (s = this._getOrReturnCtx(e, s), u(s, {
|
|
711
711
|
code: d.invalid_string,
|
|
712
|
-
validation: { includes:
|
|
713
|
-
message:
|
|
714
|
-
}), t.dirty()) :
|
|
712
|
+
validation: { includes: a.value, position: a.position },
|
|
713
|
+
message: a.message
|
|
714
|
+
}), t.dirty()) : a.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : a.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : a.kind === "startsWith" ? e.data.startsWith(a.value) || (s = this._getOrReturnCtx(e, s), u(s, {
|
|
715
715
|
code: d.invalid_string,
|
|
716
|
-
validation: { startsWith:
|
|
717
|
-
message:
|
|
718
|
-
}), t.dirty()) :
|
|
716
|
+
validation: { startsWith: a.value },
|
|
717
|
+
message: a.message
|
|
718
|
+
}), t.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (s = this._getOrReturnCtx(e, s), u(s, {
|
|
719
719
|
code: d.invalid_string,
|
|
720
|
-
validation: { endsWith:
|
|
721
|
-
message:
|
|
722
|
-
}), t.dirty()) :
|
|
720
|
+
validation: { endsWith: a.value },
|
|
721
|
+
message: a.message
|
|
722
|
+
}), t.dirty()) : a.kind === "datetime" ? rt(a).test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
|
|
723
723
|
code: d.invalid_string,
|
|
724
724
|
validation: "datetime",
|
|
725
|
-
message:
|
|
726
|
-
}), t.dirty()) :
|
|
725
|
+
message: a.message
|
|
726
|
+
}), t.dirty()) : a.kind === "date" ? at.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
|
|
727
727
|
code: d.invalid_string,
|
|
728
728
|
validation: "date",
|
|
729
|
-
message:
|
|
730
|
-
}), t.dirty()) :
|
|
729
|
+
message: a.message
|
|
730
|
+
}), t.dirty()) : a.kind === "time" ? nt(a).test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
|
|
731
731
|
code: d.invalid_string,
|
|
732
732
|
validation: "time",
|
|
733
|
-
message:
|
|
734
|
-
}), t.dirty()) :
|
|
733
|
+
message: a.message
|
|
734
|
+
}), t.dirty()) : a.kind === "duration" ? We.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
|
|
735
735
|
validation: "duration",
|
|
736
736
|
code: d.invalid_string,
|
|
737
|
-
message:
|
|
738
|
-
}), t.dirty()) :
|
|
737
|
+
message: a.message
|
|
738
|
+
}), t.dirty()) : a.kind === "ip" ? it(e.data, a.version) || (s = this._getOrReturnCtx(e, s), u(s, {
|
|
739
739
|
validation: "ip",
|
|
740
740
|
code: d.invalid_string,
|
|
741
|
-
message:
|
|
742
|
-
}), t.dirty()) :
|
|
741
|
+
message: a.message
|
|
742
|
+
}), t.dirty()) : a.kind === "jwt" ? ot(e.data, a.alg) || (s = this._getOrReturnCtx(e, s), u(s, {
|
|
743
743
|
validation: "jwt",
|
|
744
744
|
code: d.invalid_string,
|
|
745
|
-
message:
|
|
746
|
-
}), t.dirty()) :
|
|
745
|
+
message: a.message
|
|
746
|
+
}), t.dirty()) : a.kind === "cidr" ? ct(e.data, a.version) || (s = this._getOrReturnCtx(e, s), u(s, {
|
|
747
747
|
validation: "cidr",
|
|
748
748
|
code: d.invalid_string,
|
|
749
|
-
message:
|
|
750
|
-
}), t.dirty()) :
|
|
749
|
+
message: a.message
|
|
750
|
+
}), t.dirty()) : a.kind === "base64" ? tt.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
|
|
751
751
|
validation: "base64",
|
|
752
752
|
code: d.invalid_string,
|
|
753
|
-
message:
|
|
754
|
-
}), t.dirty()) :
|
|
753
|
+
message: a.message
|
|
754
|
+
}), t.dirty()) : a.kind === "base64url" ? st.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
|
|
755
755
|
validation: "base64url",
|
|
756
756
|
code: d.invalid_string,
|
|
757
|
-
message:
|
|
758
|
-
}), t.dirty()) : b.assertNever(
|
|
757
|
+
message: a.message
|
|
758
|
+
}), t.dirty()) : b.assertNever(a);
|
|
759
759
|
return { status: t.value, value: e.data };
|
|
760
760
|
}
|
|
761
|
-
_regex(e, t,
|
|
762
|
-
return this.refinement((
|
|
761
|
+
_regex(e, t, s) {
|
|
762
|
+
return this.refinement((a) => e.test(a), {
|
|
763
763
|
validation: t,
|
|
764
764
|
code: d.invalid_string,
|
|
765
|
-
...p.errToObj(
|
|
765
|
+
...p.errToObj(s)
|
|
766
766
|
});
|
|
767
767
|
}
|
|
768
768
|
_addCheck(e) {
|
|
@@ -982,13 +982,13 @@ class A extends v {
|
|
|
982
982
|
}
|
|
983
983
|
A.create = (n) => new A({
|
|
984
984
|
checks: [],
|
|
985
|
-
typeName:
|
|
985
|
+
typeName: m.ZodString,
|
|
986
986
|
coerce: (n == null ? void 0 : n.coerce) ?? !1,
|
|
987
987
|
...y(n)
|
|
988
988
|
});
|
|
989
989
|
function dt(n, e) {
|
|
990
|
-
const t = (n.toString().split(".")[1] || "").length,
|
|
991
|
-
return i % r / 10 **
|
|
990
|
+
const t = (n.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, a = t > s ? t : s, i = Number.parseInt(n.toFixed(a).replace(".", "")), r = Number.parseInt(e.toFixed(a).replace(".", ""));
|
|
991
|
+
return i % r / 10 ** a;
|
|
992
992
|
}
|
|
993
993
|
let ke = class oe extends v {
|
|
994
994
|
constructor() {
|
|
@@ -996,44 +996,44 @@ let ke = class oe extends v {
|
|
|
996
996
|
}
|
|
997
997
|
_parse(e) {
|
|
998
998
|
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== l.number) {
|
|
999
|
-
const
|
|
1000
|
-
return u(
|
|
999
|
+
const a = this._getOrReturnCtx(e);
|
|
1000
|
+
return u(a, {
|
|
1001
1001
|
code: d.invalid_type,
|
|
1002
1002
|
expected: l.number,
|
|
1003
|
-
received:
|
|
1004
|
-
}),
|
|
1003
|
+
received: a.parsedType
|
|
1004
|
+
}), g;
|
|
1005
1005
|
}
|
|
1006
1006
|
let t;
|
|
1007
|
-
const
|
|
1008
|
-
for (const
|
|
1009
|
-
|
|
1007
|
+
const s = new N();
|
|
1008
|
+
for (const a of this._def.checks)
|
|
1009
|
+
a.kind === "int" ? b.isInteger(e.data) || (t = this._getOrReturnCtx(e, t), u(t, {
|
|
1010
1010
|
code: d.invalid_type,
|
|
1011
1011
|
expected: "integer",
|
|
1012
1012
|
received: "float",
|
|
1013
|
-
message:
|
|
1014
|
-
}),
|
|
1013
|
+
message: a.message
|
|
1014
|
+
}), s.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (t = this._getOrReturnCtx(e, t), u(t, {
|
|
1015
1015
|
code: d.too_small,
|
|
1016
|
-
minimum:
|
|
1016
|
+
minimum: a.value,
|
|
1017
1017
|
type: "number",
|
|
1018
|
-
inclusive:
|
|
1018
|
+
inclusive: a.inclusive,
|
|
1019
1019
|
exact: !1,
|
|
1020
|
-
message:
|
|
1021
|
-
}),
|
|
1020
|
+
message: a.message
|
|
1021
|
+
}), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (t = this._getOrReturnCtx(e, t), u(t, {
|
|
1022
1022
|
code: d.too_big,
|
|
1023
|
-
maximum:
|
|
1023
|
+
maximum: a.value,
|
|
1024
1024
|
type: "number",
|
|
1025
|
-
inclusive:
|
|
1025
|
+
inclusive: a.inclusive,
|
|
1026
1026
|
exact: !1,
|
|
1027
|
-
message:
|
|
1028
|
-
}),
|
|
1027
|
+
message: a.message
|
|
1028
|
+
}), s.dirty()) : a.kind === "multipleOf" ? dt(e.data, a.value) !== 0 && (t = this._getOrReturnCtx(e, t), u(t, {
|
|
1029
1029
|
code: d.not_multiple_of,
|
|
1030
|
-
multipleOf:
|
|
1031
|
-
message:
|
|
1032
|
-
}),
|
|
1030
|
+
multipleOf: a.value,
|
|
1031
|
+
message: a.message
|
|
1032
|
+
}), s.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (t = this._getOrReturnCtx(e, t), u(t, {
|
|
1033
1033
|
code: d.not_finite,
|
|
1034
|
-
message:
|
|
1035
|
-
}),
|
|
1036
|
-
return { status:
|
|
1034
|
+
message: a.message
|
|
1035
|
+
}), s.dirty()) : b.assertNever(a);
|
|
1036
|
+
return { status: s.value, value: e.data };
|
|
1037
1037
|
}
|
|
1038
1038
|
gte(e, t) {
|
|
1039
1039
|
return this.setLimit("min", e, !0, p.toString(t));
|
|
@@ -1047,7 +1047,7 @@ let ke = class oe extends v {
|
|
|
1047
1047
|
lt(e, t) {
|
|
1048
1048
|
return this.setLimit("max", e, !1, p.toString(t));
|
|
1049
1049
|
}
|
|
1050
|
-
setLimit(e, t,
|
|
1050
|
+
setLimit(e, t, s, a) {
|
|
1051
1051
|
return new oe({
|
|
1052
1052
|
...this._def,
|
|
1053
1053
|
checks: [
|
|
@@ -1055,8 +1055,8 @@ let ke = class oe extends v {
|
|
|
1055
1055
|
{
|
|
1056
1056
|
kind: e,
|
|
1057
1057
|
value: t,
|
|
1058
|
-
inclusive:
|
|
1059
|
-
message: p.toString(
|
|
1058
|
+
inclusive: s,
|
|
1059
|
+
message: p.toString(a)
|
|
1060
1060
|
}
|
|
1061
1061
|
]
|
|
1062
1062
|
});
|
|
@@ -1148,17 +1148,17 @@ let ke = class oe extends v {
|
|
|
1148
1148
|
}
|
|
1149
1149
|
get isFinite() {
|
|
1150
1150
|
let e = null, t = null;
|
|
1151
|
-
for (const
|
|
1152
|
-
if (
|
|
1151
|
+
for (const s of this._def.checks) {
|
|
1152
|
+
if (s.kind === "finite" || s.kind === "int" || s.kind === "multipleOf")
|
|
1153
1153
|
return !0;
|
|
1154
|
-
|
|
1154
|
+
s.kind === "min" ? (t === null || s.value > t) && (t = s.value) : s.kind === "max" && (e === null || s.value < e) && (e = s.value);
|
|
1155
1155
|
}
|
|
1156
1156
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
1157
1157
|
}
|
|
1158
1158
|
};
|
|
1159
1159
|
ke.create = (n) => new ke({
|
|
1160
1160
|
checks: [],
|
|
1161
|
-
typeName:
|
|
1161
|
+
typeName: m.ZodNumber,
|
|
1162
1162
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
1163
1163
|
...y(n)
|
|
1164
1164
|
});
|
|
@@ -1176,26 +1176,26 @@ class U extends v {
|
|
|
1176
1176
|
if (this._getType(e) !== l.bigint)
|
|
1177
1177
|
return this._getInvalidInput(e);
|
|
1178
1178
|
let t;
|
|
1179
|
-
const
|
|
1180
|
-
for (const
|
|
1181
|
-
|
|
1179
|
+
const s = new N();
|
|
1180
|
+
for (const a of this._def.checks)
|
|
1181
|
+
a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (t = this._getOrReturnCtx(e, t), u(t, {
|
|
1182
1182
|
code: d.too_small,
|
|
1183
1183
|
type: "bigint",
|
|
1184
|
-
minimum:
|
|
1185
|
-
inclusive:
|
|
1186
|
-
message:
|
|
1187
|
-
}),
|
|
1184
|
+
minimum: a.value,
|
|
1185
|
+
inclusive: a.inclusive,
|
|
1186
|
+
message: a.message
|
|
1187
|
+
}), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (t = this._getOrReturnCtx(e, t), u(t, {
|
|
1188
1188
|
code: d.too_big,
|
|
1189
1189
|
type: "bigint",
|
|
1190
|
-
maximum:
|
|
1191
|
-
inclusive:
|
|
1192
|
-
message:
|
|
1193
|
-
}),
|
|
1190
|
+
maximum: a.value,
|
|
1191
|
+
inclusive: a.inclusive,
|
|
1192
|
+
message: a.message
|
|
1193
|
+
}), s.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (t = this._getOrReturnCtx(e, t), u(t, {
|
|
1194
1194
|
code: d.not_multiple_of,
|
|
1195
|
-
multipleOf:
|
|
1196
|
-
message:
|
|
1197
|
-
}),
|
|
1198
|
-
return { status:
|
|
1195
|
+
multipleOf: a.value,
|
|
1196
|
+
message: a.message
|
|
1197
|
+
}), s.dirty()) : b.assertNever(a);
|
|
1198
|
+
return { status: s.value, value: e.data };
|
|
1199
1199
|
}
|
|
1200
1200
|
_getInvalidInput(e) {
|
|
1201
1201
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1203,7 +1203,7 @@ class U extends v {
|
|
|
1203
1203
|
code: d.invalid_type,
|
|
1204
1204
|
expected: l.bigint,
|
|
1205
1205
|
received: t.parsedType
|
|
1206
|
-
}),
|
|
1206
|
+
}), g;
|
|
1207
1207
|
}
|
|
1208
1208
|
gte(e, t) {
|
|
1209
1209
|
return this.setLimit("min", e, !0, p.toString(t));
|
|
@@ -1217,7 +1217,7 @@ class U extends v {
|
|
|
1217
1217
|
lt(e, t) {
|
|
1218
1218
|
return this.setLimit("max", e, !1, p.toString(t));
|
|
1219
1219
|
}
|
|
1220
|
-
setLimit(e, t,
|
|
1220
|
+
setLimit(e, t, s, a) {
|
|
1221
1221
|
return new U({
|
|
1222
1222
|
...this._def,
|
|
1223
1223
|
checks: [
|
|
@@ -1225,8 +1225,8 @@ class U extends v {
|
|
|
1225
1225
|
{
|
|
1226
1226
|
kind: e,
|
|
1227
1227
|
value: t,
|
|
1228
|
-
inclusive:
|
|
1229
|
-
message: p.toString(
|
|
1228
|
+
inclusive: s,
|
|
1229
|
+
message: p.toString(a)
|
|
1230
1230
|
}
|
|
1231
1231
|
]
|
|
1232
1232
|
});
|
|
@@ -1291,7 +1291,7 @@ class U extends v {
|
|
|
1291
1291
|
}
|
|
1292
1292
|
U.create = (n) => new U({
|
|
1293
1293
|
checks: [],
|
|
1294
|
-
typeName:
|
|
1294
|
+
typeName: m.ZodBigInt,
|
|
1295
1295
|
coerce: (n == null ? void 0 : n.coerce) ?? !1,
|
|
1296
1296
|
...y(n)
|
|
1297
1297
|
});
|
|
@@ -1303,50 +1303,50 @@ class xe extends v {
|
|
|
1303
1303
|
code: d.invalid_type,
|
|
1304
1304
|
expected: l.boolean,
|
|
1305
1305
|
received: t.parsedType
|
|
1306
|
-
}),
|
|
1306
|
+
}), g;
|
|
1307
1307
|
}
|
|
1308
1308
|
return x(e.data);
|
|
1309
1309
|
}
|
|
1310
1310
|
}
|
|
1311
1311
|
xe.create = (n) => new xe({
|
|
1312
|
-
typeName:
|
|
1312
|
+
typeName: m.ZodBoolean,
|
|
1313
1313
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
1314
1314
|
...y(n)
|
|
1315
1315
|
});
|
|
1316
1316
|
let Se = class Fe extends v {
|
|
1317
1317
|
_parse(e) {
|
|
1318
1318
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== l.date) {
|
|
1319
|
-
const
|
|
1320
|
-
return u(
|
|
1319
|
+
const a = this._getOrReturnCtx(e);
|
|
1320
|
+
return u(a, {
|
|
1321
1321
|
code: d.invalid_type,
|
|
1322
1322
|
expected: l.date,
|
|
1323
|
-
received:
|
|
1324
|
-
}),
|
|
1323
|
+
received: a.parsedType
|
|
1324
|
+
}), g;
|
|
1325
1325
|
}
|
|
1326
1326
|
if (Number.isNaN(e.data.getTime())) {
|
|
1327
|
-
const
|
|
1328
|
-
return u(
|
|
1327
|
+
const a = this._getOrReturnCtx(e);
|
|
1328
|
+
return u(a, {
|
|
1329
1329
|
code: d.invalid_date
|
|
1330
|
-
}),
|
|
1330
|
+
}), g;
|
|
1331
1331
|
}
|
|
1332
1332
|
const t = new N();
|
|
1333
|
-
let
|
|
1334
|
-
for (const
|
|
1335
|
-
|
|
1333
|
+
let s;
|
|
1334
|
+
for (const a of this._def.checks)
|
|
1335
|
+
a.kind === "min" ? e.data.getTime() < a.value && (s = this._getOrReturnCtx(e, s), u(s, {
|
|
1336
1336
|
code: d.too_small,
|
|
1337
|
-
message:
|
|
1337
|
+
message: a.message,
|
|
1338
1338
|
inclusive: !0,
|
|
1339
1339
|
exact: !1,
|
|
1340
|
-
minimum:
|
|
1340
|
+
minimum: a.value,
|
|
1341
1341
|
type: "date"
|
|
1342
|
-
}), t.dirty()) :
|
|
1342
|
+
}), t.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (s = this._getOrReturnCtx(e, s), u(s, {
|
|
1343
1343
|
code: d.too_big,
|
|
1344
|
-
message:
|
|
1344
|
+
message: a.message,
|
|
1345
1345
|
inclusive: !0,
|
|
1346
1346
|
exact: !1,
|
|
1347
|
-
maximum:
|
|
1347
|
+
maximum: a.value,
|
|
1348
1348
|
type: "date"
|
|
1349
|
-
}), t.dirty()) : b.assertNever(
|
|
1349
|
+
}), t.dirty()) : b.assertNever(a);
|
|
1350
1350
|
return {
|
|
1351
1351
|
status: t.value,
|
|
1352
1352
|
value: new Date(e.data.getTime())
|
|
@@ -1388,7 +1388,7 @@ let Se = class Fe extends v {
|
|
|
1388
1388
|
Se.create = (n) => new Se({
|
|
1389
1389
|
checks: [],
|
|
1390
1390
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
1391
|
-
typeName:
|
|
1391
|
+
typeName: m.ZodDate,
|
|
1392
1392
|
...y(n)
|
|
1393
1393
|
});
|
|
1394
1394
|
class Ne extends v {
|
|
@@ -1399,13 +1399,13 @@ class Ne extends v {
|
|
|
1399
1399
|
code: d.invalid_type,
|
|
1400
1400
|
expected: l.symbol,
|
|
1401
1401
|
received: t.parsedType
|
|
1402
|
-
}),
|
|
1402
|
+
}), g;
|
|
1403
1403
|
}
|
|
1404
1404
|
return x(e.data);
|
|
1405
1405
|
}
|
|
1406
1406
|
}
|
|
1407
1407
|
Ne.create = (n) => new Ne({
|
|
1408
|
-
typeName:
|
|
1408
|
+
typeName: m.ZodSymbol,
|
|
1409
1409
|
...y(n)
|
|
1410
1410
|
});
|
|
1411
1411
|
class Ce extends v {
|
|
@@ -1416,13 +1416,13 @@ class Ce extends v {
|
|
|
1416
1416
|
code: d.invalid_type,
|
|
1417
1417
|
expected: l.undefined,
|
|
1418
1418
|
received: t.parsedType
|
|
1419
|
-
}),
|
|
1419
|
+
}), g;
|
|
1420
1420
|
}
|
|
1421
1421
|
return x(e.data);
|
|
1422
1422
|
}
|
|
1423
1423
|
}
|
|
1424
1424
|
Ce.create = (n) => new Ce({
|
|
1425
|
-
typeName:
|
|
1425
|
+
typeName: m.ZodUndefined,
|
|
1426
1426
|
...y(n)
|
|
1427
1427
|
});
|
|
1428
1428
|
class Te extends v {
|
|
@@ -1433,13 +1433,13 @@ class Te extends v {
|
|
|
1433
1433
|
code: d.invalid_type,
|
|
1434
1434
|
expected: l.null,
|
|
1435
1435
|
received: t.parsedType
|
|
1436
|
-
}),
|
|
1436
|
+
}), g;
|
|
1437
1437
|
}
|
|
1438
1438
|
return x(e.data);
|
|
1439
1439
|
}
|
|
1440
1440
|
}
|
|
1441
1441
|
Te.create = (n) => new Te({
|
|
1442
|
-
typeName:
|
|
1442
|
+
typeName: m.ZodNull,
|
|
1443
1443
|
...y(n)
|
|
1444
1444
|
});
|
|
1445
1445
|
class ce extends v {
|
|
@@ -1451,7 +1451,7 @@ class ce extends v {
|
|
|
1451
1451
|
}
|
|
1452
1452
|
}
|
|
1453
1453
|
ce.create = (n) => new ce({
|
|
1454
|
-
typeName:
|
|
1454
|
+
typeName: m.ZodAny,
|
|
1455
1455
|
...y(n)
|
|
1456
1456
|
});
|
|
1457
1457
|
class Ze extends v {
|
|
@@ -1463,7 +1463,7 @@ class Ze extends v {
|
|
|
1463
1463
|
}
|
|
1464
1464
|
}
|
|
1465
1465
|
Ze.create = (n) => new Ze({
|
|
1466
|
-
typeName:
|
|
1466
|
+
typeName: m.ZodUnknown,
|
|
1467
1467
|
...y(n)
|
|
1468
1468
|
});
|
|
1469
1469
|
let E = class extends v {
|
|
@@ -1473,11 +1473,11 @@ let E = class extends v {
|
|
|
1473
1473
|
code: d.invalid_type,
|
|
1474
1474
|
expected: l.never,
|
|
1475
1475
|
received: t.parsedType
|
|
1476
|
-
}),
|
|
1476
|
+
}), g;
|
|
1477
1477
|
}
|
|
1478
1478
|
};
|
|
1479
1479
|
E.create = (n) => new E({
|
|
1480
|
-
typeName:
|
|
1480
|
+
typeName: m.ZodNever,
|
|
1481
1481
|
...y(n)
|
|
1482
1482
|
});
|
|
1483
1483
|
class Oe extends v {
|
|
@@ -1488,54 +1488,54 @@ class Oe extends v {
|
|
|
1488
1488
|
code: d.invalid_type,
|
|
1489
1489
|
expected: l.void,
|
|
1490
1490
|
received: t.parsedType
|
|
1491
|
-
}),
|
|
1491
|
+
}), g;
|
|
1492
1492
|
}
|
|
1493
1493
|
return x(e.data);
|
|
1494
1494
|
}
|
|
1495
1495
|
}
|
|
1496
1496
|
Oe.create = (n) => new Oe({
|
|
1497
|
-
typeName:
|
|
1497
|
+
typeName: m.ZodVoid,
|
|
1498
1498
|
...y(n)
|
|
1499
1499
|
});
|
|
1500
1500
|
let q = class Y extends v {
|
|
1501
1501
|
_parse(e) {
|
|
1502
|
-
const { ctx: t, status:
|
|
1502
|
+
const { ctx: t, status: s } = this._processInputParams(e), a = this._def;
|
|
1503
1503
|
if (t.parsedType !== l.array)
|
|
1504
1504
|
return u(t, {
|
|
1505
1505
|
code: d.invalid_type,
|
|
1506
1506
|
expected: l.array,
|
|
1507
1507
|
received: t.parsedType
|
|
1508
|
-
}),
|
|
1509
|
-
if (
|
|
1510
|
-
const r = t.data.length >
|
|
1508
|
+
}), g;
|
|
1509
|
+
if (a.exactLength !== null) {
|
|
1510
|
+
const r = t.data.length > a.exactLength.value, o = t.data.length < a.exactLength.value;
|
|
1511
1511
|
(r || o) && (u(t, {
|
|
1512
1512
|
code: r ? d.too_big : d.too_small,
|
|
1513
|
-
minimum: o ?
|
|
1514
|
-
maximum: r ?
|
|
1513
|
+
minimum: o ? a.exactLength.value : void 0,
|
|
1514
|
+
maximum: r ? a.exactLength.value : void 0,
|
|
1515
1515
|
type: "array",
|
|
1516
1516
|
inclusive: !0,
|
|
1517
1517
|
exact: !0,
|
|
1518
|
-
message:
|
|
1519
|
-
}),
|
|
1518
|
+
message: a.exactLength.message
|
|
1519
|
+
}), s.dirty());
|
|
1520
1520
|
}
|
|
1521
|
-
if (
|
|
1521
|
+
if (a.minLength !== null && t.data.length < a.minLength.value && (u(t, {
|
|
1522
1522
|
code: d.too_small,
|
|
1523
|
-
minimum:
|
|
1523
|
+
minimum: a.minLength.value,
|
|
1524
1524
|
type: "array",
|
|
1525
1525
|
inclusive: !0,
|
|
1526
1526
|
exact: !1,
|
|
1527
|
-
message:
|
|
1528
|
-
}),
|
|
1527
|
+
message: a.minLength.message
|
|
1528
|
+
}), s.dirty()), a.maxLength !== null && t.data.length > a.maxLength.value && (u(t, {
|
|
1529
1529
|
code: d.too_big,
|
|
1530
|
-
maximum:
|
|
1530
|
+
maximum: a.maxLength.value,
|
|
1531
1531
|
type: "array",
|
|
1532
1532
|
inclusive: !0,
|
|
1533
1533
|
exact: !1,
|
|
1534
|
-
message:
|
|
1535
|
-
}),
|
|
1536
|
-
return Promise.all([...t.data].map((r, o) =>
|
|
1537
|
-
const i = [...t.data].map((r, o) =>
|
|
1538
|
-
return N.mergeArray(
|
|
1534
|
+
message: a.maxLength.message
|
|
1535
|
+
}), s.dirty()), t.common.async)
|
|
1536
|
+
return Promise.all([...t.data].map((r, o) => a.type._parseAsync(new $(t, r, t.path, o)))).then((r) => N.mergeArray(s, r));
|
|
1537
|
+
const i = [...t.data].map((r, o) => a.type._parseSync(new $(t, r, t.path, o)));
|
|
1538
|
+
return N.mergeArray(s, i);
|
|
1539
1539
|
}
|
|
1540
1540
|
get element() {
|
|
1541
1541
|
return this._def.type;
|
|
@@ -1567,15 +1567,15 @@ q.create = (n, e) => new q({
|
|
|
1567
1567
|
minLength: null,
|
|
1568
1568
|
maxLength: null,
|
|
1569
1569
|
exactLength: null,
|
|
1570
|
-
typeName:
|
|
1570
|
+
typeName: m.ZodArray,
|
|
1571
1571
|
...y(e)
|
|
1572
1572
|
});
|
|
1573
1573
|
function M(n) {
|
|
1574
1574
|
if (n instanceof T) {
|
|
1575
1575
|
const e = {};
|
|
1576
1576
|
for (const t in n.shape) {
|
|
1577
|
-
const
|
|
1578
|
-
e[t] = I.create(M(
|
|
1577
|
+
const s = n.shape[t];
|
|
1578
|
+
e[t] = I.create(M(s));
|
|
1579
1579
|
}
|
|
1580
1580
|
return new T({
|
|
1581
1581
|
...n._def,
|
|
@@ -1603,19 +1603,19 @@ let T = class S extends v {
|
|
|
1603
1603
|
code: d.invalid_type,
|
|
1604
1604
|
expected: l.object,
|
|
1605
1605
|
received: c.parsedType
|
|
1606
|
-
}),
|
|
1606
|
+
}), g;
|
|
1607
1607
|
}
|
|
1608
|
-
const { status: t, ctx:
|
|
1608
|
+
const { status: t, ctx: s } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), r = [];
|
|
1609
1609
|
if (!(this._def.catchall instanceof E && this._def.unknownKeys === "strip"))
|
|
1610
|
-
for (const c in
|
|
1610
|
+
for (const c in s.data)
|
|
1611
1611
|
i.includes(c) || r.push(c);
|
|
1612
1612
|
const o = [];
|
|
1613
1613
|
for (const c of i) {
|
|
1614
|
-
const h =
|
|
1614
|
+
const h = a[c], _ = s.data[c];
|
|
1615
1615
|
o.push({
|
|
1616
1616
|
key: { status: "valid", value: c },
|
|
1617
|
-
value: h._parse(new $(
|
|
1618
|
-
alwaysSet: c in
|
|
1617
|
+
value: h._parse(new $(s, _, s.path, c)),
|
|
1618
|
+
alwaysSet: c in s.data
|
|
1619
1619
|
});
|
|
1620
1620
|
}
|
|
1621
1621
|
if (this._def.catchall instanceof E) {
|
|
@@ -1624,10 +1624,10 @@ let T = class S extends v {
|
|
|
1624
1624
|
for (const h of r)
|
|
1625
1625
|
o.push({
|
|
1626
1626
|
key: { status: "valid", value: h },
|
|
1627
|
-
value: { status: "valid", value:
|
|
1627
|
+
value: { status: "valid", value: s.data[h] }
|
|
1628
1628
|
});
|
|
1629
1629
|
else if (c === "strict")
|
|
1630
|
-
r.length > 0 && (u(
|
|
1630
|
+
r.length > 0 && (u(s, {
|
|
1631
1631
|
code: d.unrecognized_keys,
|
|
1632
1632
|
keys: r
|
|
1633
1633
|
}), t.dirty());
|
|
@@ -1635,23 +1635,23 @@ let T = class S extends v {
|
|
|
1635
1635
|
} else {
|
|
1636
1636
|
const c = this._def.catchall;
|
|
1637
1637
|
for (const h of r) {
|
|
1638
|
-
const
|
|
1638
|
+
const _ = s.data[h];
|
|
1639
1639
|
o.push({
|
|
1640
1640
|
key: { status: "valid", value: h },
|
|
1641
1641
|
value: c._parse(
|
|
1642
|
-
new $(
|
|
1642
|
+
new $(s, _, s.path, h)
|
|
1643
1643
|
//, ctx.child(key), value, getParsedType(value)
|
|
1644
1644
|
),
|
|
1645
|
-
alwaysSet: h in
|
|
1645
|
+
alwaysSet: h in s.data
|
|
1646
1646
|
});
|
|
1647
1647
|
}
|
|
1648
1648
|
}
|
|
1649
|
-
return
|
|
1649
|
+
return s.common.async ? Promise.resolve().then(async () => {
|
|
1650
1650
|
const c = [];
|
|
1651
1651
|
for (const h of o) {
|
|
1652
|
-
const
|
|
1652
|
+
const _ = await h.key, w = await h.value;
|
|
1653
1653
|
c.push({
|
|
1654
|
-
key:
|
|
1654
|
+
key: _,
|
|
1655
1655
|
value: w,
|
|
1656
1656
|
alwaysSet: h.alwaysSet
|
|
1657
1657
|
});
|
|
@@ -1667,9 +1667,9 @@ let T = class S extends v {
|
|
|
1667
1667
|
...this._def,
|
|
1668
1668
|
unknownKeys: "strict",
|
|
1669
1669
|
...e !== void 0 ? {
|
|
1670
|
-
errorMap: (t,
|
|
1671
|
-
var
|
|
1672
|
-
const r = ((i = (
|
|
1670
|
+
errorMap: (t, s) => {
|
|
1671
|
+
var a, i;
|
|
1672
|
+
const r = ((i = (a = this._def).errorMap) == null ? void 0 : i.call(a, t, s).message) ?? s.defaultError;
|
|
1673
1673
|
return t.code === "unrecognized_keys" ? {
|
|
1674
1674
|
message: p.errToObj(e).message ?? r
|
|
1675
1675
|
} : {
|
|
@@ -1730,7 +1730,7 @@ let T = class S extends v {
|
|
|
1730
1730
|
...this._def.shape(),
|
|
1731
1731
|
...e._def.shape()
|
|
1732
1732
|
}),
|
|
1733
|
-
typeName:
|
|
1733
|
+
typeName: m.ZodObject
|
|
1734
1734
|
});
|
|
1735
1735
|
}
|
|
1736
1736
|
// merge<
|
|
@@ -1800,8 +1800,8 @@ let T = class S extends v {
|
|
|
1800
1800
|
}
|
|
1801
1801
|
pick(e) {
|
|
1802
1802
|
const t = {};
|
|
1803
|
-
for (const
|
|
1804
|
-
e[
|
|
1803
|
+
for (const s of b.objectKeys(e))
|
|
1804
|
+
e[s] && this.shape[s] && (t[s] = this.shape[s]);
|
|
1805
1805
|
return new S({
|
|
1806
1806
|
...this._def,
|
|
1807
1807
|
shape: () => t
|
|
@@ -1809,8 +1809,8 @@ let T = class S extends v {
|
|
|
1809
1809
|
}
|
|
1810
1810
|
omit(e) {
|
|
1811
1811
|
const t = {};
|
|
1812
|
-
for (const
|
|
1813
|
-
e[
|
|
1812
|
+
for (const s of b.objectKeys(this.shape))
|
|
1813
|
+
e[s] || (t[s] = this.shape[s]);
|
|
1814
1814
|
return new S({
|
|
1815
1815
|
...this._def,
|
|
1816
1816
|
shape: () => t
|
|
@@ -1824,9 +1824,9 @@ let T = class S extends v {
|
|
|
1824
1824
|
}
|
|
1825
1825
|
partial(e) {
|
|
1826
1826
|
const t = {};
|
|
1827
|
-
for (const
|
|
1828
|
-
const
|
|
1829
|
-
e && !e[
|
|
1827
|
+
for (const s of b.objectKeys(this.shape)) {
|
|
1828
|
+
const a = this.shape[s];
|
|
1829
|
+
e && !e[s] ? t[s] = a : t[s] = a.optional();
|
|
1830
1830
|
}
|
|
1831
1831
|
return new S({
|
|
1832
1832
|
...this._def,
|
|
@@ -1835,14 +1835,14 @@ let T = class S extends v {
|
|
|
1835
1835
|
}
|
|
1836
1836
|
required(e) {
|
|
1837
1837
|
const t = {};
|
|
1838
|
-
for (const
|
|
1839
|
-
if (e && !e[
|
|
1840
|
-
t[
|
|
1838
|
+
for (const s of b.objectKeys(this.shape))
|
|
1839
|
+
if (e && !e[s])
|
|
1840
|
+
t[s] = this.shape[s];
|
|
1841
1841
|
else {
|
|
1842
|
-
let
|
|
1843
|
-
for (;
|
|
1844
|
-
|
|
1845
|
-
t[
|
|
1842
|
+
let a = this.shape[s];
|
|
1843
|
+
for (; a instanceof I; )
|
|
1844
|
+
a = a._def.innerType;
|
|
1845
|
+
t[s] = a;
|
|
1846
1846
|
}
|
|
1847
1847
|
return new S({
|
|
1848
1848
|
...this._def,
|
|
@@ -1857,27 +1857,27 @@ T.create = (n, e) => new T({
|
|
|
1857
1857
|
shape: () => n,
|
|
1858
1858
|
unknownKeys: "strip",
|
|
1859
1859
|
catchall: E.create(),
|
|
1860
|
-
typeName:
|
|
1860
|
+
typeName: m.ZodObject,
|
|
1861
1861
|
...y(e)
|
|
1862
1862
|
});
|
|
1863
1863
|
T.strictCreate = (n, e) => new T({
|
|
1864
1864
|
shape: () => n,
|
|
1865
1865
|
unknownKeys: "strict",
|
|
1866
1866
|
catchall: E.create(),
|
|
1867
|
-
typeName:
|
|
1867
|
+
typeName: m.ZodObject,
|
|
1868
1868
|
...y(e)
|
|
1869
1869
|
});
|
|
1870
1870
|
T.lazycreate = (n, e) => new T({
|
|
1871
1871
|
shape: n,
|
|
1872
1872
|
unknownKeys: "strip",
|
|
1873
1873
|
catchall: E.create(),
|
|
1874
|
-
typeName:
|
|
1874
|
+
typeName: m.ZodObject,
|
|
1875
1875
|
...y(e)
|
|
1876
1876
|
});
|
|
1877
1877
|
let Q = class extends v {
|
|
1878
1878
|
_parse(e) {
|
|
1879
|
-
const { ctx: t } = this._processInputParams(e),
|
|
1880
|
-
function
|
|
1879
|
+
const { ctx: t } = this._processInputParams(e), s = this._def.options;
|
|
1880
|
+
function a(i) {
|
|
1881
1881
|
for (const o of i)
|
|
1882
1882
|
if (o.result.status === "valid")
|
|
1883
1883
|
return o.result;
|
|
@@ -1888,10 +1888,10 @@ let Q = class extends v {
|
|
|
1888
1888
|
return u(t, {
|
|
1889
1889
|
code: d.invalid_union,
|
|
1890
1890
|
unionErrors: r
|
|
1891
|
-
}),
|
|
1891
|
+
}), g;
|
|
1892
1892
|
}
|
|
1893
1893
|
if (t.common.async)
|
|
1894
|
-
return Promise.all(
|
|
1894
|
+
return Promise.all(s.map(async (i) => {
|
|
1895
1895
|
const r = {
|
|
1896
1896
|
...t,
|
|
1897
1897
|
common: {
|
|
@@ -1908,11 +1908,11 @@ let Q = class extends v {
|
|
|
1908
1908
|
}),
|
|
1909
1909
|
ctx: r
|
|
1910
1910
|
};
|
|
1911
|
-
})).then(
|
|
1911
|
+
})).then(a);
|
|
1912
1912
|
{
|
|
1913
1913
|
let i;
|
|
1914
1914
|
const r = [];
|
|
1915
|
-
for (const c of
|
|
1915
|
+
for (const c of s) {
|
|
1916
1916
|
const h = {
|
|
1917
1917
|
...t,
|
|
1918
1918
|
common: {
|
|
@@ -1920,14 +1920,14 @@ let Q = class extends v {
|
|
|
1920
1920
|
issues: []
|
|
1921
1921
|
},
|
|
1922
1922
|
parent: null
|
|
1923
|
-
},
|
|
1923
|
+
}, _ = c._parseSync({
|
|
1924
1924
|
data: t.data,
|
|
1925
1925
|
path: t.path,
|
|
1926
1926
|
parent: h
|
|
1927
1927
|
});
|
|
1928
|
-
if (
|
|
1929
|
-
return
|
|
1930
|
-
|
|
1928
|
+
if (_.status === "valid")
|
|
1929
|
+
return _;
|
|
1930
|
+
_.status === "dirty" && !i && (i = { result: _, ctx: h }), h.common.issues.length && r.push(h.common.issues);
|
|
1931
1931
|
}
|
|
1932
1932
|
if (i)
|
|
1933
1933
|
return t.common.issues.push(...i.ctx.common.issues), i.result;
|
|
@@ -1935,7 +1935,7 @@ let Q = class extends v {
|
|
|
1935
1935
|
return u(t, {
|
|
1936
1936
|
code: d.invalid_union,
|
|
1937
1937
|
unionErrors: o
|
|
1938
|
-
}),
|
|
1938
|
+
}), g;
|
|
1939
1939
|
}
|
|
1940
1940
|
}
|
|
1941
1941
|
get options() {
|
|
@@ -1944,15 +1944,15 @@ let Q = class extends v {
|
|
|
1944
1944
|
};
|
|
1945
1945
|
Q.create = (n, e) => new Q({
|
|
1946
1946
|
options: n,
|
|
1947
|
-
typeName:
|
|
1947
|
+
typeName: m.ZodUnion,
|
|
1948
1948
|
...y(e)
|
|
1949
1949
|
});
|
|
1950
1950
|
function de(n, e) {
|
|
1951
|
-
const t = O(n),
|
|
1951
|
+
const t = O(n), s = O(e);
|
|
1952
1952
|
if (n === e)
|
|
1953
1953
|
return { valid: !0, data: n };
|
|
1954
|
-
if (t === l.object &&
|
|
1955
|
-
const
|
|
1954
|
+
if (t === l.object && s === l.object) {
|
|
1955
|
+
const a = b.objectKeys(e), i = b.objectKeys(n).filter((o) => a.indexOf(o) !== -1), r = { ...n, ...e };
|
|
1956
1956
|
for (const o of i) {
|
|
1957
1957
|
const c = de(n[o], e[o]);
|
|
1958
1958
|
if (!c.valid)
|
|
@@ -1960,86 +1960,86 @@ function de(n, e) {
|
|
|
1960
1960
|
r[o] = c.data;
|
|
1961
1961
|
}
|
|
1962
1962
|
return { valid: !0, data: r };
|
|
1963
|
-
} else if (t === l.array &&
|
|
1963
|
+
} else if (t === l.array && s === l.array) {
|
|
1964
1964
|
if (n.length !== e.length)
|
|
1965
1965
|
return { valid: !1 };
|
|
1966
|
-
const
|
|
1966
|
+
const a = [];
|
|
1967
1967
|
for (let i = 0; i < n.length; i++) {
|
|
1968
1968
|
const r = n[i], o = e[i], c = de(r, o);
|
|
1969
1969
|
if (!c.valid)
|
|
1970
1970
|
return { valid: !1 };
|
|
1971
|
-
|
|
1971
|
+
a.push(c.data);
|
|
1972
1972
|
}
|
|
1973
|
-
return { valid: !0, data:
|
|
1974
|
-
} else return t === l.date &&
|
|
1973
|
+
return { valid: !0, data: a };
|
|
1974
|
+
} else return t === l.date && s === l.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
|
|
1975
1975
|
}
|
|
1976
1976
|
let ee = class extends v {
|
|
1977
1977
|
_parse(e) {
|
|
1978
|
-
const { status: t, ctx:
|
|
1978
|
+
const { status: t, ctx: s } = this._processInputParams(e), a = (i, r) => {
|
|
1979
1979
|
if (ve(i) || ve(r))
|
|
1980
|
-
return
|
|
1980
|
+
return g;
|
|
1981
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(
|
|
1982
|
+
return o.valid ? ((be(i) || be(r)) && t.dirty(), { status: t.value, value: o.data }) : (u(s, {
|
|
1983
1983
|
code: d.invalid_intersection_types
|
|
1984
|
-
}),
|
|
1984
|
+
}), g);
|
|
1985
1985
|
};
|
|
1986
|
-
return
|
|
1986
|
+
return s.common.async ? Promise.all([
|
|
1987
1987
|
this._def.left._parseAsync({
|
|
1988
|
-
data:
|
|
1989
|
-
path:
|
|
1990
|
-
parent:
|
|
1988
|
+
data: s.data,
|
|
1989
|
+
path: s.path,
|
|
1990
|
+
parent: s
|
|
1991
1991
|
}),
|
|
1992
1992
|
this._def.right._parseAsync({
|
|
1993
|
-
data:
|
|
1994
|
-
path:
|
|
1995
|
-
parent:
|
|
1993
|
+
data: s.data,
|
|
1994
|
+
path: s.path,
|
|
1995
|
+
parent: s
|
|
1996
1996
|
})
|
|
1997
|
-
]).then(([i, r]) =>
|
|
1998
|
-
data:
|
|
1999
|
-
path:
|
|
2000
|
-
parent:
|
|
1997
|
+
]).then(([i, r]) => a(i, r)) : a(this._def.left._parseSync({
|
|
1998
|
+
data: s.data,
|
|
1999
|
+
path: s.path,
|
|
2000
|
+
parent: s
|
|
2001
2001
|
}), this._def.right._parseSync({
|
|
2002
|
-
data:
|
|
2003
|
-
path:
|
|
2004
|
-
parent:
|
|
2002
|
+
data: s.data,
|
|
2003
|
+
path: s.path,
|
|
2004
|
+
parent: s
|
|
2005
2005
|
}));
|
|
2006
2006
|
}
|
|
2007
2007
|
};
|
|
2008
2008
|
ee.create = (n, e, t) => new ee({
|
|
2009
2009
|
left: n,
|
|
2010
2010
|
right: e,
|
|
2011
|
-
typeName:
|
|
2011
|
+
typeName: m.ZodIntersection,
|
|
2012
2012
|
...y(t)
|
|
2013
2013
|
});
|
|
2014
2014
|
class R extends v {
|
|
2015
2015
|
_parse(e) {
|
|
2016
|
-
const { status: t, ctx:
|
|
2017
|
-
if (
|
|
2018
|
-
return u(
|
|
2016
|
+
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2017
|
+
if (s.parsedType !== l.array)
|
|
2018
|
+
return u(s, {
|
|
2019
2019
|
code: d.invalid_type,
|
|
2020
2020
|
expected: l.array,
|
|
2021
|
-
received:
|
|
2022
|
-
}),
|
|
2023
|
-
if (
|
|
2024
|
-
return u(
|
|
2021
|
+
received: s.parsedType
|
|
2022
|
+
}), g;
|
|
2023
|
+
if (s.data.length < this._def.items.length)
|
|
2024
|
+
return u(s, {
|
|
2025
2025
|
code: d.too_small,
|
|
2026
2026
|
minimum: this._def.items.length,
|
|
2027
2027
|
inclusive: !0,
|
|
2028
2028
|
exact: !1,
|
|
2029
2029
|
type: "array"
|
|
2030
|
-
}),
|
|
2031
|
-
!this._def.rest &&
|
|
2030
|
+
}), g;
|
|
2031
|
+
!this._def.rest && s.data.length > this._def.items.length && (u(s, {
|
|
2032
2032
|
code: d.too_big,
|
|
2033
2033
|
maximum: this._def.items.length,
|
|
2034
2034
|
inclusive: !0,
|
|
2035
2035
|
exact: !1,
|
|
2036
2036
|
type: "array"
|
|
2037
2037
|
}), t.dirty());
|
|
2038
|
-
const
|
|
2038
|
+
const a = [...s.data].map((i, r) => {
|
|
2039
2039
|
const o = this._def.items[r] || this._def.rest;
|
|
2040
|
-
return o ? o._parse(new $(
|
|
2040
|
+
return o ? o._parse(new $(s, i, s.path, r)) : null;
|
|
2041
2041
|
}).filter((i) => !!i);
|
|
2042
|
-
return
|
|
2042
|
+
return s.common.async ? Promise.all(a).then((i) => N.mergeArray(t, i)) : N.mergeArray(t, a);
|
|
2043
2043
|
}
|
|
2044
2044
|
get items() {
|
|
2045
2045
|
return this._def.items;
|
|
@@ -2056,7 +2056,7 @@ R.create = (n, e) => {
|
|
|
2056
2056
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2057
2057
|
return new R({
|
|
2058
2058
|
items: n,
|
|
2059
|
-
typeName:
|
|
2059
|
+
typeName: m.ZodTuple,
|
|
2060
2060
|
rest: null,
|
|
2061
2061
|
...y(e)
|
|
2062
2062
|
});
|
|
@@ -2069,35 +2069,35 @@ class Ae extends v {
|
|
|
2069
2069
|
return this._def.valueType;
|
|
2070
2070
|
}
|
|
2071
2071
|
_parse(e) {
|
|
2072
|
-
const { status: t, ctx:
|
|
2073
|
-
if (
|
|
2074
|
-
return u(
|
|
2072
|
+
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2073
|
+
if (s.parsedType !== l.map)
|
|
2074
|
+
return u(s, {
|
|
2075
2075
|
code: d.invalid_type,
|
|
2076
2076
|
expected: l.map,
|
|
2077
|
-
received:
|
|
2078
|
-
}),
|
|
2079
|
-
const
|
|
2080
|
-
key:
|
|
2081
|
-
value: i._parse(new $(
|
|
2077
|
+
received: s.parsedType
|
|
2078
|
+
}), g;
|
|
2079
|
+
const a = this._def.keyType, i = this._def.valueType, r = [...s.data.entries()].map(([o, c], h) => ({
|
|
2080
|
+
key: a._parse(new $(s, o, s.path, [h, "key"])),
|
|
2081
|
+
value: i._parse(new $(s, c, s.path, [h, "value"]))
|
|
2082
2082
|
}));
|
|
2083
|
-
if (
|
|
2083
|
+
if (s.common.async) {
|
|
2084
2084
|
const o = /* @__PURE__ */ new Map();
|
|
2085
2085
|
return Promise.resolve().then(async () => {
|
|
2086
2086
|
for (const c of r) {
|
|
2087
|
-
const h = await c.key,
|
|
2088
|
-
if (h.status === "aborted" ||
|
|
2089
|
-
return
|
|
2090
|
-
(h.status === "dirty" ||
|
|
2087
|
+
const h = await c.key, _ = await c.value;
|
|
2088
|
+
if (h.status === "aborted" || _.status === "aborted")
|
|
2089
|
+
return g;
|
|
2090
|
+
(h.status === "dirty" || _.status === "dirty") && t.dirty(), o.set(h.value, _.value);
|
|
2091
2091
|
}
|
|
2092
2092
|
return { status: t.value, value: o };
|
|
2093
2093
|
});
|
|
2094
2094
|
} else {
|
|
2095
2095
|
const o = /* @__PURE__ */ new Map();
|
|
2096
2096
|
for (const c of r) {
|
|
2097
|
-
const h = c.key,
|
|
2098
|
-
if (h.status === "aborted" ||
|
|
2099
|
-
return
|
|
2100
|
-
(h.status === "dirty" ||
|
|
2097
|
+
const h = c.key, _ = c.value;
|
|
2098
|
+
if (h.status === "aborted" || _.status === "aborted")
|
|
2099
|
+
return g;
|
|
2100
|
+
(h.status === "dirty" || _.status === "dirty") && t.dirty(), o.set(h.value, _.value);
|
|
2101
2101
|
}
|
|
2102
2102
|
return { status: t.value, value: o };
|
|
2103
2103
|
}
|
|
@@ -2106,46 +2106,46 @@ class Ae extends v {
|
|
|
2106
2106
|
Ae.create = (n, e, t) => new Ae({
|
|
2107
2107
|
valueType: e,
|
|
2108
2108
|
keyType: n,
|
|
2109
|
-
typeName:
|
|
2109
|
+
typeName: m.ZodMap,
|
|
2110
2110
|
...y(t)
|
|
2111
2111
|
});
|
|
2112
2112
|
class H extends v {
|
|
2113
2113
|
_parse(e) {
|
|
2114
|
-
const { status: t, ctx:
|
|
2115
|
-
if (
|
|
2116
|
-
return u(
|
|
2114
|
+
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2115
|
+
if (s.parsedType !== l.set)
|
|
2116
|
+
return u(s, {
|
|
2117
2117
|
code: d.invalid_type,
|
|
2118
2118
|
expected: l.set,
|
|
2119
|
-
received:
|
|
2120
|
-
}),
|
|
2121
|
-
const
|
|
2122
|
-
|
|
2119
|
+
received: s.parsedType
|
|
2120
|
+
}), g;
|
|
2121
|
+
const a = this._def;
|
|
2122
|
+
a.minSize !== null && s.data.size < a.minSize.value && (u(s, {
|
|
2123
2123
|
code: d.too_small,
|
|
2124
|
-
minimum:
|
|
2124
|
+
minimum: a.minSize.value,
|
|
2125
2125
|
type: "set",
|
|
2126
2126
|
inclusive: !0,
|
|
2127
2127
|
exact: !1,
|
|
2128
|
-
message:
|
|
2129
|
-
}), t.dirty()),
|
|
2128
|
+
message: a.minSize.message
|
|
2129
|
+
}), t.dirty()), a.maxSize !== null && s.data.size > a.maxSize.value && (u(s, {
|
|
2130
2130
|
code: d.too_big,
|
|
2131
|
-
maximum:
|
|
2131
|
+
maximum: a.maxSize.value,
|
|
2132
2132
|
type: "set",
|
|
2133
2133
|
inclusive: !0,
|
|
2134
2134
|
exact: !1,
|
|
2135
|
-
message:
|
|
2135
|
+
message: a.maxSize.message
|
|
2136
2136
|
}), t.dirty());
|
|
2137
2137
|
const i = this._def.valueType;
|
|
2138
2138
|
function r(c) {
|
|
2139
2139
|
const h = /* @__PURE__ */ new Set();
|
|
2140
|
-
for (const
|
|
2141
|
-
if (
|
|
2142
|
-
return
|
|
2143
|
-
|
|
2140
|
+
for (const _ of c) {
|
|
2141
|
+
if (_.status === "aborted")
|
|
2142
|
+
return g;
|
|
2143
|
+
_.status === "dirty" && t.dirty(), h.add(_.value);
|
|
2144
2144
|
}
|
|
2145
2145
|
return { status: t.value, value: h };
|
|
2146
2146
|
}
|
|
2147
|
-
const o = [...
|
|
2148
|
-
return
|
|
2147
|
+
const o = [...s.data.values()].map((c, h) => i._parse(new $(s, c, s.path, h)));
|
|
2148
|
+
return s.common.async ? Promise.all(o).then((c) => r(c)) : r(o);
|
|
2149
2149
|
}
|
|
2150
2150
|
min(e, t) {
|
|
2151
2151
|
return new H({
|
|
@@ -2170,7 +2170,7 @@ H.create = (n, e) => new H({
|
|
|
2170
2170
|
valueType: n,
|
|
2171
2171
|
minSize: null,
|
|
2172
2172
|
maxSize: null,
|
|
2173
|
-
typeName:
|
|
2173
|
+
typeName: m.ZodSet,
|
|
2174
2174
|
...y(e)
|
|
2175
2175
|
});
|
|
2176
2176
|
class Ie extends v {
|
|
@@ -2184,7 +2184,7 @@ class Ie extends v {
|
|
|
2184
2184
|
}
|
|
2185
2185
|
Ie.create = (n, e) => new Ie({
|
|
2186
2186
|
getter: n,
|
|
2187
|
-
typeName:
|
|
2187
|
+
typeName: m.ZodLazy,
|
|
2188
2188
|
...y(e)
|
|
2189
2189
|
});
|
|
2190
2190
|
let ue = class extends v {
|
|
@@ -2195,7 +2195,7 @@ let ue = class extends v {
|
|
|
2195
2195
|
received: t.data,
|
|
2196
2196
|
code: d.invalid_literal,
|
|
2197
2197
|
expected: this._def.value
|
|
2198
|
-
}),
|
|
2198
|
+
}), g;
|
|
2199
2199
|
}
|
|
2200
2200
|
return { status: "valid", value: e.data };
|
|
2201
2201
|
}
|
|
@@ -2205,33 +2205,33 @@ let ue = class extends v {
|
|
|
2205
2205
|
};
|
|
2206
2206
|
ue.create = (n, e) => new ue({
|
|
2207
2207
|
value: n,
|
|
2208
|
-
typeName:
|
|
2208
|
+
typeName: m.ZodLiteral,
|
|
2209
2209
|
...y(e)
|
|
2210
2210
|
});
|
|
2211
2211
|
function Me(n, e) {
|
|
2212
2212
|
return new me({
|
|
2213
2213
|
values: n,
|
|
2214
|
-
typeName:
|
|
2214
|
+
typeName: m.ZodEnum,
|
|
2215
2215
|
...y(e)
|
|
2216
2216
|
});
|
|
2217
2217
|
}
|
|
2218
2218
|
let me = class le extends v {
|
|
2219
2219
|
_parse(e) {
|
|
2220
2220
|
if (typeof e.data != "string") {
|
|
2221
|
-
const t = this._getOrReturnCtx(e),
|
|
2221
|
+
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
2222
2222
|
return u(t, {
|
|
2223
|
-
expected: b.joinValues(
|
|
2223
|
+
expected: b.joinValues(s),
|
|
2224
2224
|
received: t.parsedType,
|
|
2225
2225
|
code: d.invalid_type
|
|
2226
|
-
}),
|
|
2226
|
+
}), g;
|
|
2227
2227
|
}
|
|
2228
2228
|
if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data)) {
|
|
2229
|
-
const t = this._getOrReturnCtx(e),
|
|
2229
|
+
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
2230
2230
|
return u(t, {
|
|
2231
2231
|
received: t.data,
|
|
2232
2232
|
code: d.invalid_enum_value,
|
|
2233
|
-
options:
|
|
2234
|
-
}),
|
|
2233
|
+
options: s
|
|
2234
|
+
}), g;
|
|
2235
2235
|
}
|
|
2236
2236
|
return x(e.data);
|
|
2237
2237
|
}
|
|
@@ -2263,7 +2263,7 @@ let me = class le extends v {
|
|
|
2263
2263
|
});
|
|
2264
2264
|
}
|
|
2265
2265
|
exclude(e, t = this._def) {
|
|
2266
|
-
return le.create(this.options.filter((
|
|
2266
|
+
return le.create(this.options.filter((s) => !e.includes(s)), {
|
|
2267
2267
|
...this._def,
|
|
2268
2268
|
...t
|
|
2269
2269
|
});
|
|
@@ -2272,22 +2272,22 @@ let me = class le extends v {
|
|
|
2272
2272
|
me.create = Me;
|
|
2273
2273
|
class $e extends v {
|
|
2274
2274
|
_parse(e) {
|
|
2275
|
-
const t = b.getValidEnumValues(this._def.values),
|
|
2276
|
-
if (
|
|
2277
|
-
const
|
|
2278
|
-
return u(
|
|
2279
|
-
expected: b.joinValues(
|
|
2280
|
-
received:
|
|
2275
|
+
const t = b.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
2276
|
+
if (s.parsedType !== l.string && s.parsedType !== l.number) {
|
|
2277
|
+
const a = b.objectValues(t);
|
|
2278
|
+
return u(s, {
|
|
2279
|
+
expected: b.joinValues(a),
|
|
2280
|
+
received: s.parsedType,
|
|
2281
2281
|
code: d.invalid_type
|
|
2282
|
-
}),
|
|
2282
|
+
}), g;
|
|
2283
2283
|
}
|
|
2284
2284
|
if (this._cache || (this._cache = new Set(b.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
|
|
2285
|
-
const
|
|
2286
|
-
return u(
|
|
2287
|
-
received:
|
|
2285
|
+
const a = b.objectValues(t);
|
|
2286
|
+
return u(s, {
|
|
2287
|
+
received: s.data,
|
|
2288
2288
|
code: d.invalid_enum_value,
|
|
2289
|
-
options:
|
|
2290
|
-
}),
|
|
2289
|
+
options: a
|
|
2290
|
+
}), g;
|
|
2291
2291
|
}
|
|
2292
2292
|
return x(e.data);
|
|
2293
2293
|
}
|
|
@@ -2297,7 +2297,7 @@ class $e extends v {
|
|
|
2297
2297
|
}
|
|
2298
2298
|
$e.create = (n, e) => new $e({
|
|
2299
2299
|
values: n,
|
|
2300
|
-
typeName:
|
|
2300
|
+
typeName: m.ZodNativeEnum,
|
|
2301
2301
|
...y(e)
|
|
2302
2302
|
});
|
|
2303
2303
|
let te = class extends v {
|
|
@@ -2311,9 +2311,9 @@ let te = class extends v {
|
|
|
2311
2311
|
code: d.invalid_type,
|
|
2312
2312
|
expected: l.promise,
|
|
2313
2313
|
received: t.parsedType
|
|
2314
|
-
}),
|
|
2315
|
-
const
|
|
2316
|
-
return x(
|
|
2314
|
+
}), g;
|
|
2315
|
+
const s = t.parsedType === l.promise ? t.data : Promise.resolve(t.data);
|
|
2316
|
+
return x(s.then((a) => this._def.type.parseAsync(a, {
|
|
2317
2317
|
path: t.path,
|
|
2318
2318
|
errorMap: t.common.contextualErrorMap
|
|
2319
2319
|
})));
|
|
@@ -2321,99 +2321,99 @@ let te = class extends v {
|
|
|
2321
2321
|
};
|
|
2322
2322
|
te.create = (n, e) => new te({
|
|
2323
2323
|
type: n,
|
|
2324
|
-
typeName:
|
|
2324
|
+
typeName: m.ZodPromise,
|
|
2325
2325
|
...y(e)
|
|
2326
2326
|
});
|
|
2327
|
-
|
|
2327
|
+
let D = class extends v {
|
|
2328
2328
|
innerType() {
|
|
2329
2329
|
return this._def.schema;
|
|
2330
2330
|
}
|
|
2331
2331
|
sourceType() {
|
|
2332
|
-
return this._def.schema._def.typeName ===
|
|
2332
|
+
return this._def.schema._def.typeName === m.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
2333
2333
|
}
|
|
2334
2334
|
_parse(e) {
|
|
2335
|
-
const { status: t, ctx:
|
|
2335
|
+
const { status: t, ctx: s } = this._processInputParams(e), a = this._def.effect || null, i = {
|
|
2336
2336
|
addIssue: (r) => {
|
|
2337
|
-
u(
|
|
2337
|
+
u(s, r), r.fatal ? t.abort() : t.dirty();
|
|
2338
2338
|
},
|
|
2339
2339
|
get path() {
|
|
2340
|
-
return
|
|
2340
|
+
return s.path;
|
|
2341
2341
|
}
|
|
2342
2342
|
};
|
|
2343
|
-
if (i.addIssue = i.addIssue.bind(i),
|
|
2344
|
-
const r =
|
|
2345
|
-
if (
|
|
2343
|
+
if (i.addIssue = i.addIssue.bind(i), a.type === "preprocess") {
|
|
2344
|
+
const r = a.transform(s.data, i);
|
|
2345
|
+
if (s.common.async)
|
|
2346
2346
|
return Promise.resolve(r).then(async (o) => {
|
|
2347
2347
|
if (t.value === "aborted")
|
|
2348
|
-
return
|
|
2348
|
+
return g;
|
|
2349
2349
|
const c = await this._def.schema._parseAsync({
|
|
2350
2350
|
data: o,
|
|
2351
|
-
path:
|
|
2352
|
-
parent:
|
|
2351
|
+
path: s.path,
|
|
2352
|
+
parent: s
|
|
2353
2353
|
});
|
|
2354
|
-
return c.status === "aborted" ?
|
|
2354
|
+
return c.status === "aborted" ? g : c.status === "dirty" || t.value === "dirty" ? ie(c.value) : c;
|
|
2355
2355
|
});
|
|
2356
2356
|
{
|
|
2357
2357
|
if (t.value === "aborted")
|
|
2358
|
-
return
|
|
2358
|
+
return g;
|
|
2359
2359
|
const o = this._def.schema._parseSync({
|
|
2360
2360
|
data: r,
|
|
2361
|
-
path:
|
|
2362
|
-
parent:
|
|
2361
|
+
path: s.path,
|
|
2362
|
+
parent: s
|
|
2363
2363
|
});
|
|
2364
|
-
return o.status === "aborted" ?
|
|
2364
|
+
return o.status === "aborted" ? g : o.status === "dirty" || t.value === "dirty" ? ie(o.value) : o;
|
|
2365
2365
|
}
|
|
2366
2366
|
}
|
|
2367
|
-
if (
|
|
2367
|
+
if (a.type === "refinement") {
|
|
2368
2368
|
const r = (o) => {
|
|
2369
|
-
const c =
|
|
2370
|
-
if (
|
|
2369
|
+
const c = a.refinement(o, i);
|
|
2370
|
+
if (s.common.async)
|
|
2371
2371
|
return Promise.resolve(c);
|
|
2372
2372
|
if (c instanceof Promise)
|
|
2373
2373
|
throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2374
2374
|
return o;
|
|
2375
2375
|
};
|
|
2376
|
-
if (
|
|
2376
|
+
if (s.common.async === !1) {
|
|
2377
2377
|
const o = this._def.schema._parseSync({
|
|
2378
|
-
data:
|
|
2379
|
-
path:
|
|
2380
|
-
parent:
|
|
2378
|
+
data: s.data,
|
|
2379
|
+
path: s.path,
|
|
2380
|
+
parent: s
|
|
2381
2381
|
});
|
|
2382
|
-
return o.status === "aborted" ?
|
|
2382
|
+
return o.status === "aborted" ? g : (o.status === "dirty" && t.dirty(), r(o.value), { status: t.value, value: o.value });
|
|
2383
2383
|
} else
|
|
2384
|
-
return this._def.schema._parseAsync({ data:
|
|
2384
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => o.status === "aborted" ? g : (o.status === "dirty" && t.dirty(), r(o.value).then(() => ({ status: t.value, value: o.value }))));
|
|
2385
2385
|
}
|
|
2386
|
-
if (
|
|
2387
|
-
if (
|
|
2386
|
+
if (a.type === "transform")
|
|
2387
|
+
if (s.common.async === !1) {
|
|
2388
2388
|
const r = this._def.schema._parseSync({
|
|
2389
|
-
data:
|
|
2390
|
-
path:
|
|
2391
|
-
parent:
|
|
2389
|
+
data: s.data,
|
|
2390
|
+
path: s.path,
|
|
2391
|
+
parent: s
|
|
2392
2392
|
});
|
|
2393
2393
|
if (!L(r))
|
|
2394
|
-
return
|
|
2395
|
-
const o =
|
|
2394
|
+
return g;
|
|
2395
|
+
const o = a.transform(r.value, i);
|
|
2396
2396
|
if (o instanceof Promise)
|
|
2397
2397
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2398
2398
|
return { status: t.value, value: o };
|
|
2399
2399
|
} else
|
|
2400
|
-
return this._def.schema._parseAsync({ data:
|
|
2400
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((r) => L(r) ? Promise.resolve(a.transform(r.value, i)).then((o) => ({
|
|
2401
2401
|
status: t.value,
|
|
2402
2402
|
value: o
|
|
2403
|
-
})) :
|
|
2404
|
-
b.assertNever(
|
|
2403
|
+
})) : g);
|
|
2404
|
+
b.assertNever(a);
|
|
2405
2405
|
}
|
|
2406
|
-
}
|
|
2406
|
+
};
|
|
2407
2407
|
D.create = (n, e, t) => new D({
|
|
2408
2408
|
schema: n,
|
|
2409
|
-
typeName:
|
|
2409
|
+
typeName: m.ZodEffects,
|
|
2410
2410
|
effect: e,
|
|
2411
2411
|
...y(t)
|
|
2412
2412
|
});
|
|
2413
2413
|
D.createWithPreprocess = (n, e, t) => new D({
|
|
2414
2414
|
schema: e,
|
|
2415
2415
|
effect: { type: "preprocess", transform: n },
|
|
2416
|
-
typeName:
|
|
2416
|
+
typeName: m.ZodEffects,
|
|
2417
2417
|
...y(t)
|
|
2418
2418
|
});
|
|
2419
2419
|
let I = class extends v {
|
|
@@ -2426,7 +2426,7 @@ let I = class extends v {
|
|
|
2426
2426
|
};
|
|
2427
2427
|
I.create = (n, e) => new I({
|
|
2428
2428
|
innerType: n,
|
|
2429
|
-
typeName:
|
|
2429
|
+
typeName: m.ZodOptional,
|
|
2430
2430
|
...y(e)
|
|
2431
2431
|
});
|
|
2432
2432
|
let V = class extends v {
|
|
@@ -2439,15 +2439,15 @@ let V = class extends v {
|
|
|
2439
2439
|
};
|
|
2440
2440
|
V.create = (n, e) => new V({
|
|
2441
2441
|
innerType: n,
|
|
2442
|
-
typeName:
|
|
2442
|
+
typeName: m.ZodNullable,
|
|
2443
2443
|
...y(e)
|
|
2444
2444
|
});
|
|
2445
2445
|
class he extends v {
|
|
2446
2446
|
_parse(e) {
|
|
2447
2447
|
const { ctx: t } = this._processInputParams(e);
|
|
2448
|
-
let
|
|
2449
|
-
return t.parsedType === l.undefined && (
|
|
2450
|
-
data:
|
|
2448
|
+
let s = t.data;
|
|
2449
|
+
return t.parsedType === l.undefined && (s = this._def.defaultValue()), this._def.innerType._parse({
|
|
2450
|
+
data: s,
|
|
2451
2451
|
path: t.path,
|
|
2452
2452
|
parent: t
|
|
2453
2453
|
});
|
|
@@ -2458,40 +2458,40 @@ class he extends v {
|
|
|
2458
2458
|
}
|
|
2459
2459
|
he.create = (n, e) => new he({
|
|
2460
2460
|
innerType: n,
|
|
2461
|
-
typeName:
|
|
2461
|
+
typeName: m.ZodDefault,
|
|
2462
2462
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2463
2463
|
...y(e)
|
|
2464
2464
|
});
|
|
2465
2465
|
class pe extends v {
|
|
2466
2466
|
_parse(e) {
|
|
2467
|
-
const { ctx: t } = this._processInputParams(e),
|
|
2467
|
+
const { ctx: t } = this._processInputParams(e), s = {
|
|
2468
2468
|
...t,
|
|
2469
2469
|
common: {
|
|
2470
2470
|
...t.common,
|
|
2471
2471
|
issues: []
|
|
2472
2472
|
}
|
|
2473
|
-
},
|
|
2474
|
-
data:
|
|
2475
|
-
path:
|
|
2473
|
+
}, a = this._def.innerType._parse({
|
|
2474
|
+
data: s.data,
|
|
2475
|
+
path: s.path,
|
|
2476
2476
|
parent: {
|
|
2477
|
-
...
|
|
2477
|
+
...s
|
|
2478
2478
|
}
|
|
2479
2479
|
});
|
|
2480
|
-
return X(
|
|
2480
|
+
return X(a) ? a.then((i) => ({
|
|
2481
2481
|
status: "valid",
|
|
2482
2482
|
value: i.status === "valid" ? i.value : this._def.catchValue({
|
|
2483
2483
|
get error() {
|
|
2484
|
-
return new C(
|
|
2484
|
+
return new C(s.common.issues);
|
|
2485
2485
|
},
|
|
2486
|
-
input:
|
|
2486
|
+
input: s.data
|
|
2487
2487
|
})
|
|
2488
2488
|
})) : {
|
|
2489
2489
|
status: "valid",
|
|
2490
|
-
value:
|
|
2490
|
+
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2491
2491
|
get error() {
|
|
2492
|
-
return new C(
|
|
2492
|
+
return new C(s.common.issues);
|
|
2493
2493
|
},
|
|
2494
|
-
input:
|
|
2494
|
+
input: s.data
|
|
2495
2495
|
})
|
|
2496
2496
|
};
|
|
2497
2497
|
}
|
|
@@ -2501,7 +2501,7 @@ class pe extends v {
|
|
|
2501
2501
|
}
|
|
2502
2502
|
pe.create = (n, e) => new pe({
|
|
2503
2503
|
innerType: n,
|
|
2504
|
-
typeName:
|
|
2504
|
+
typeName: m.ZodCatch,
|
|
2505
2505
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2506
2506
|
...y(e)
|
|
2507
2507
|
});
|
|
@@ -2513,20 +2513,20 @@ class Ee extends v {
|
|
|
2513
2513
|
code: d.invalid_type,
|
|
2514
2514
|
expected: l.nan,
|
|
2515
2515
|
received: t.parsedType
|
|
2516
|
-
}),
|
|
2516
|
+
}), g;
|
|
2517
2517
|
}
|
|
2518
2518
|
return { status: "valid", value: e.data };
|
|
2519
2519
|
}
|
|
2520
2520
|
}
|
|
2521
2521
|
Ee.create = (n) => new Ee({
|
|
2522
|
-
typeName:
|
|
2522
|
+
typeName: m.ZodNaN,
|
|
2523
2523
|
...y(n)
|
|
2524
2524
|
});
|
|
2525
2525
|
class ut extends v {
|
|
2526
2526
|
_parse(e) {
|
|
2527
|
-
const { ctx: t } = this._processInputParams(e),
|
|
2527
|
+
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
2528
2528
|
return this._def.type._parse({
|
|
2529
|
-
data:
|
|
2529
|
+
data: s,
|
|
2530
2530
|
path: t.path,
|
|
2531
2531
|
parent: t
|
|
2532
2532
|
});
|
|
@@ -2537,33 +2537,33 @@ class ut extends v {
|
|
|
2537
2537
|
}
|
|
2538
2538
|
class _e extends v {
|
|
2539
2539
|
_parse(e) {
|
|
2540
|
-
const { status: t, ctx:
|
|
2541
|
-
if (
|
|
2540
|
+
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2541
|
+
if (s.common.async)
|
|
2542
2542
|
return (async () => {
|
|
2543
|
-
const
|
|
2544
|
-
data:
|
|
2545
|
-
path:
|
|
2546
|
-
parent:
|
|
2543
|
+
const a = await this._def.in._parseAsync({
|
|
2544
|
+
data: s.data,
|
|
2545
|
+
path: s.path,
|
|
2546
|
+
parent: s
|
|
2547
2547
|
});
|
|
2548
|
-
return
|
|
2549
|
-
data:
|
|
2550
|
-
path:
|
|
2551
|
-
parent:
|
|
2548
|
+
return a.status === "aborted" ? g : a.status === "dirty" ? (t.dirty(), ie(a.value)) : this._def.out._parseAsync({
|
|
2549
|
+
data: a.value,
|
|
2550
|
+
path: s.path,
|
|
2551
|
+
parent: s
|
|
2552
2552
|
});
|
|
2553
2553
|
})();
|
|
2554
2554
|
{
|
|
2555
|
-
const
|
|
2556
|
-
data:
|
|
2557
|
-
path:
|
|
2558
|
-
parent:
|
|
2555
|
+
const a = this._def.in._parseSync({
|
|
2556
|
+
data: s.data,
|
|
2557
|
+
path: s.path,
|
|
2558
|
+
parent: s
|
|
2559
2559
|
});
|
|
2560
|
-
return
|
|
2560
|
+
return a.status === "aborted" ? g : a.status === "dirty" ? (t.dirty(), {
|
|
2561
2561
|
status: "dirty",
|
|
2562
|
-
value:
|
|
2562
|
+
value: a.value
|
|
2563
2563
|
}) : this._def.out._parseSync({
|
|
2564
|
-
data:
|
|
2565
|
-
path:
|
|
2566
|
-
parent:
|
|
2564
|
+
data: a.value,
|
|
2565
|
+
path: s.path,
|
|
2566
|
+
parent: s
|
|
2567
2567
|
});
|
|
2568
2568
|
}
|
|
2569
2569
|
}
|
|
@@ -2571,14 +2571,14 @@ class _e extends v {
|
|
|
2571
2571
|
return new _e({
|
|
2572
2572
|
in: e,
|
|
2573
2573
|
out: t,
|
|
2574
|
-
typeName:
|
|
2574
|
+
typeName: m.ZodPipeline
|
|
2575
2575
|
});
|
|
2576
2576
|
}
|
|
2577
2577
|
}
|
|
2578
2578
|
class fe extends v {
|
|
2579
2579
|
_parse(e) {
|
|
2580
|
-
const t = this._def.innerType._parse(e),
|
|
2581
|
-
return X(t) ? t.then((
|
|
2580
|
+
const t = this._def.innerType._parse(e), s = (a) => (L(a) && (a.value = Object.freeze(a.value)), a);
|
|
2581
|
+
return X(t) ? t.then((a) => s(a)) : s(t);
|
|
2582
2582
|
}
|
|
2583
2583
|
unwrap() {
|
|
2584
2584
|
return this._def.innerType;
|
|
@@ -2586,13 +2586,13 @@ class fe extends v {
|
|
|
2586
2586
|
}
|
|
2587
2587
|
fe.create = (n, e) => new fe({
|
|
2588
2588
|
innerType: n,
|
|
2589
|
-
typeName:
|
|
2589
|
+
typeName: m.ZodReadonly,
|
|
2590
2590
|
...y(e)
|
|
2591
2591
|
});
|
|
2592
|
-
var
|
|
2592
|
+
var m;
|
|
2593
2593
|
(function(n) {
|
|
2594
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
|
-
})(
|
|
2595
|
+
})(m || (m = {}));
|
|
2596
2596
|
const lt = A.create, ht = ce.create;
|
|
2597
2597
|
E.create;
|
|
2598
2598
|
q.create;
|
|
@@ -2605,7 +2605,7 @@ me.create;
|
|
|
2605
2605
|
te.create;
|
|
2606
2606
|
I.create;
|
|
2607
2607
|
V.create;
|
|
2608
|
-
const mt = "1.
|
|
2608
|
+
const mt = "1.8.0", _t = {
|
|
2609
2609
|
version: mt
|
|
2610
2610
|
};
|
|
2611
2611
|
class gt {
|
|
@@ -2813,9 +2813,9 @@ class kt {
|
|
|
2813
2813
|
this._client = e;
|
|
2814
2814
|
}
|
|
2815
2815
|
async fetch(e, t) {
|
|
2816
|
-
var
|
|
2817
|
-
let
|
|
2818
|
-
typeof e == "string" ?
|
|
2816
|
+
var s;
|
|
2817
|
+
let a;
|
|
2818
|
+
typeof e == "string" ? a = e : e instanceof URL ? a = e.toString() : (a = e.url, t || (t = {
|
|
2819
2819
|
method: e.method,
|
|
2820
2820
|
headers: e.headers,
|
|
2821
2821
|
body: e.body,
|
|
@@ -2826,16 +2826,16 @@ class kt {
|
|
|
2826
2826
|
integrity: e.integrity
|
|
2827
2827
|
}));
|
|
2828
2828
|
let i = {};
|
|
2829
|
-
t != null && t.headers && (t.headers instanceof Headers ? t.headers.forEach((
|
|
2830
|
-
i[w] =
|
|
2831
|
-
}) : Array.isArray(t.headers) ? t.headers.forEach(([
|
|
2832
|
-
i[
|
|
2829
|
+
t != null && t.headers && (t.headers instanceof Headers ? t.headers.forEach((_, w) => {
|
|
2830
|
+
i[w] = _;
|
|
2831
|
+
}) : Array.isArray(t.headers) ? t.headers.forEach(([_, w]) => {
|
|
2832
|
+
i[_] = w;
|
|
2833
2833
|
}) : i = t.headers);
|
|
2834
2834
|
const r = await this._client.request("proxy.fetch", {
|
|
2835
|
-
url:
|
|
2835
|
+
url: a,
|
|
2836
2836
|
method: (t == null ? void 0 : t.method) || "GET",
|
|
2837
2837
|
headers: i,
|
|
2838
|
-
body: (
|
|
2838
|
+
body: (s = t == null ? void 0 : t.body) !== null && s !== void 0 ? s : null
|
|
2839
2839
|
});
|
|
2840
2840
|
if (!r.success)
|
|
2841
2841
|
throw new TypeError(r.errorMessage, {
|
|
@@ -2849,9 +2849,9 @@ class kt {
|
|
|
2849
2849
|
let h = null;
|
|
2850
2850
|
if (r.body !== null && r.body !== void 0)
|
|
2851
2851
|
if (r.bodyType === "binary") {
|
|
2852
|
-
const
|
|
2853
|
-
for (let Z = 0; Z <
|
|
2854
|
-
w[Z] =
|
|
2852
|
+
const _ = atob(r.body), w = new Uint8Array(_.length);
|
|
2853
|
+
for (let Z = 0; Z < _.length; Z++)
|
|
2854
|
+
w[Z] = _.charCodeAt(Z);
|
|
2855
2855
|
h = w;
|
|
2856
2856
|
} else r.bodyType === "text" ? h = r.body : r.bodyType === "json" && (h = JSON.stringify(r.body));
|
|
2857
2857
|
return new Response(h, c);
|
|
@@ -2920,8 +2920,8 @@ class xt {
|
|
|
2920
2920
|
}
|
|
2921
2921
|
}
|
|
2922
2922
|
class K {
|
|
2923
|
-
constructor(e, t,
|
|
2924
|
-
this._kind = e, this._namespace = t, this._client =
|
|
2923
|
+
constructor(e, t, s) {
|
|
2924
|
+
this._kind = e, this._namespace = t, this._client = s;
|
|
2925
2925
|
}
|
|
2926
2926
|
/**
|
|
2927
2927
|
* Saves a value in the store.
|
|
@@ -3112,15 +3112,62 @@ class Nt {
|
|
|
3112
3112
|
return t.forecast;
|
|
3113
3113
|
}
|
|
3114
3114
|
}
|
|
3115
|
+
class Ct {
|
|
3116
|
+
constructor(e) {
|
|
3117
|
+
this._client = e;
|
|
3118
|
+
}
|
|
3119
|
+
/**
|
|
3120
|
+
* Retrieves all available currency symbols and their full names.
|
|
3121
|
+
*
|
|
3122
|
+
* @returns A promise that resolves to a mapping of currency codes to their full names
|
|
3123
|
+
* @throws {Error} If the request fails
|
|
3124
|
+
*
|
|
3125
|
+
* @example
|
|
3126
|
+
* ```typescript
|
|
3127
|
+
* const symbols = await currency().getSymbols()
|
|
3128
|
+
* // { "USD": "United States Dollar", "EUR": "Euro", ... }
|
|
3129
|
+
* ```
|
|
3130
|
+
*/
|
|
3131
|
+
async getSymbols() {
|
|
3132
|
+
const e = await this._client.request("currency.getSymbols", {});
|
|
3133
|
+
if (!e.success || !e.symbols)
|
|
3134
|
+
throw new Error("Failed to fetch currency symbols");
|
|
3135
|
+
return e.symbols;
|
|
3136
|
+
}
|
|
3137
|
+
/**
|
|
3138
|
+
* Retrieves current exchange rates for a base currency against target currencies.
|
|
3139
|
+
*
|
|
3140
|
+
* @param params - Currency rate request parameters including base currency and target symbols
|
|
3141
|
+
* @returns A promise that resolves to a mapping of currency codes to their exchange rates
|
|
3142
|
+
* @throws {Error} If the request fails or currencies are invalid
|
|
3143
|
+
*
|
|
3144
|
+
* @example
|
|
3145
|
+
* ```typescript
|
|
3146
|
+
* // Get exchange rates for USD against EUR, GBP, and JPY
|
|
3147
|
+
* const rates = await currency().getRates({
|
|
3148
|
+
* base: 'USD',
|
|
3149
|
+
* symbols: 'EUR,GBP,JPY'
|
|
3150
|
+
* })
|
|
3151
|
+
* // { "EUR": 0.92, "GBP": 0.79, "JPY": 149.50 }
|
|
3152
|
+
* ```
|
|
3153
|
+
*/
|
|
3154
|
+
async getRates(e) {
|
|
3155
|
+
var t, s, a;
|
|
3156
|
+
const i = await this._client.request("currency.getRates", e);
|
|
3157
|
+
if (!i.success || !i.rates)
|
|
3158
|
+
throw ((t = i.error) === null || t === void 0 ? void 0 : t.code) === 201 ? new Error(`Invalid base currency '${e.base}'`) : ((s = i.error) === null || s === void 0 ? void 0 : s.code) === 202 ? new Error(`Invalid target currency symbol '${e.symbols}'`) : new Error(((a = i.error) === null || a === void 0 ? void 0 : a.message) || "Failed to fetch currency rates");
|
|
3159
|
+
return i.rates;
|
|
3160
|
+
}
|
|
3161
|
+
}
|
|
3115
3162
|
function W(n) {
|
|
3116
3163
|
return { ...n, type: "client" };
|
|
3117
3164
|
}
|
|
3118
|
-
const
|
|
3165
|
+
const Tt = pt({
|
|
3119
3166
|
type: ft("bridge"),
|
|
3120
3167
|
name: lt(),
|
|
3121
3168
|
data: ht()
|
|
3122
3169
|
});
|
|
3123
|
-
class
|
|
3170
|
+
class Zt {
|
|
3124
3171
|
/**
|
|
3125
3172
|
* Creates a new RootSettingsNavigation API instance.
|
|
3126
3173
|
*
|
|
@@ -3144,11 +3191,11 @@ class Tt {
|
|
|
3144
3191
|
*/
|
|
3145
3192
|
async setRootSettingsNavigation(e) {
|
|
3146
3193
|
var t;
|
|
3147
|
-
const
|
|
3148
|
-
|
|
3194
|
+
const s = this._store.shared("root-settings-navigation"), a = (t = await s.get("navigation")) !== null && t !== void 0 ? t : {}, i = this._store._client._applicationSpecifier;
|
|
3195
|
+
a[i] = {
|
|
3149
3196
|
applicationSpecifier: i,
|
|
3150
3197
|
entries: e.entries
|
|
3151
|
-
},
|
|
3198
|
+
}, s.set("navigation", a);
|
|
3152
3199
|
}
|
|
3153
3200
|
/**
|
|
3154
3201
|
* Retrieves the current navigation entries for this root application.
|
|
@@ -3160,8 +3207,8 @@ class Tt {
|
|
|
3160
3207
|
*/
|
|
3161
3208
|
async getRootSettingsNavigation() {
|
|
3162
3209
|
var e;
|
|
3163
|
-
const t = (e = await this._store.shared("root-settings-navigation").get("navigation")) !== null && e !== void 0 ? e : {},
|
|
3164
|
-
return t[
|
|
3210
|
+
const t = (e = await this._store.shared("root-settings-navigation").get("navigation")) !== null && e !== void 0 ? e : {}, s = this._store._client._applicationSpecifier;
|
|
3211
|
+
return t[s];
|
|
3165
3212
|
}
|
|
3166
3213
|
/**
|
|
3167
3214
|
* Retrieves the navigation entries for all root applications.
|
|
@@ -3181,7 +3228,7 @@ const F = 1e3 * 30, ge = typeof window > "u" && typeof self < "u", B = ge ? self
|
|
|
3181
3228
|
function z(n) {
|
|
3182
3229
|
ge ? self.postMessage(n) : B.parent.postMessage(n, "*");
|
|
3183
3230
|
}
|
|
3184
|
-
class
|
|
3231
|
+
class Ot {
|
|
3185
3232
|
/**
|
|
3186
3233
|
* Creates a new Client instance for communicating with the TelemetryOS platform.
|
|
3187
3234
|
*
|
|
@@ -3311,7 +3358,7 @@ class Zt {
|
|
|
3311
3358
|
* @throws {Error} If used by an application not mounted at the 'rootSettingsNavigation' mount point
|
|
3312
3359
|
*/
|
|
3313
3360
|
get rootSettingsNavigation() {
|
|
3314
|
-
return new
|
|
3361
|
+
return new Zt(this.store);
|
|
3315
3362
|
}
|
|
3316
3363
|
/**
|
|
3317
3364
|
* Provides access to the weather API for retrieving weather data.
|
|
@@ -3327,6 +3374,20 @@ class Zt {
|
|
|
3327
3374
|
get weather() {
|
|
3328
3375
|
return new Nt(this);
|
|
3329
3376
|
}
|
|
3377
|
+
/**
|
|
3378
|
+
* Provides access to the currency API for retrieving currency exchange rates.
|
|
3379
|
+
*
|
|
3380
|
+
* This property returns a new Currency instance that allows applications to fetch
|
|
3381
|
+
* currency symbols and exchange rates through the TelemetryOS API.
|
|
3382
|
+
*
|
|
3383
|
+
* NOTE: Most application developers should use the global currency() function
|
|
3384
|
+
* instead of accessing this property directly.
|
|
3385
|
+
*
|
|
3386
|
+
* @returns A Currency instance bound to this client
|
|
3387
|
+
*/
|
|
3388
|
+
get currency() {
|
|
3389
|
+
return new Ct(this);
|
|
3390
|
+
}
|
|
3330
3391
|
/**
|
|
3331
3392
|
* Provides access to the environment API for accessing environment settings.
|
|
3332
3393
|
*
|
|
@@ -3366,13 +3427,13 @@ class Zt {
|
|
|
3366
3427
|
* of creating and binding their own Client instances.
|
|
3367
3428
|
*/
|
|
3368
3429
|
bind() {
|
|
3369
|
-
var e, t,
|
|
3370
|
-
const
|
|
3430
|
+
var e, t, s;
|
|
3431
|
+
const a = new URL(B.location.href), i = a.searchParams;
|
|
3371
3432
|
if (this._applicationInstance = (e = i.get("applicationInstance")) !== null && e !== void 0 ? e : "", !this._applicationInstance)
|
|
3372
3433
|
throw new Error("Missing applicationInstance query parameter");
|
|
3373
3434
|
if (this._applicationSpecifier = (t = i.get("applicationSpecifier")) !== null && t !== void 0 ? t : "", !this._applicationSpecifier) {
|
|
3374
|
-
const r =
|
|
3375
|
-
this._applicationSpecifier = (
|
|
3435
|
+
const r = a.hostname.split(".");
|
|
3436
|
+
this._applicationSpecifier = (s = r[0]) !== null && s !== void 0 ? s : "";
|
|
3376
3437
|
}
|
|
3377
3438
|
if (!this._applicationSpecifier || this._applicationSpecifier.length !== 40)
|
|
3378
3439
|
throw new Error(`Invalid applicationSpecifier: expected 40-character hash, got "${this._applicationSpecifier}"`);
|
|
@@ -3389,16 +3450,16 @@ class Zt {
|
|
|
3389
3450
|
o = { ...c(r.data.data), type: "bridge" };
|
|
3390
3451
|
}
|
|
3391
3452
|
if (!o) {
|
|
3392
|
-
const c =
|
|
3453
|
+
const c = Tt.safeParse(r.data);
|
|
3393
3454
|
if (!c.success)
|
|
3394
3455
|
return;
|
|
3395
3456
|
o = c.data;
|
|
3396
|
-
const h = this._onHandlers.get(o.name),
|
|
3457
|
+
const h = this._onHandlers.get(o.name), _ = this._onceHandlers.get(o.name);
|
|
3397
3458
|
if (h)
|
|
3398
3459
|
for (const w of h)
|
|
3399
3460
|
w(o.data);
|
|
3400
|
-
if (
|
|
3401
|
-
for (const w of
|
|
3461
|
+
if (_) {
|
|
3462
|
+
for (const w of _)
|
|
3402
3463
|
w(o.data);
|
|
3403
3464
|
this._onceHandlers.delete(o.name);
|
|
3404
3465
|
}
|
|
@@ -3438,7 +3499,7 @@ class Zt {
|
|
|
3438
3499
|
* @param data The data payload to include with the message
|
|
3439
3500
|
*/
|
|
3440
3501
|
send(e, t) {
|
|
3441
|
-
const
|
|
3502
|
+
const s = W({
|
|
3442
3503
|
telemetrySdkVersion: G,
|
|
3443
3504
|
applicationName: this._applicationName,
|
|
3444
3505
|
applicationSpecifier: this._applicationSpecifier,
|
|
@@ -3446,7 +3507,7 @@ class Zt {
|
|
|
3446
3507
|
name: e,
|
|
3447
3508
|
data: t
|
|
3448
3509
|
});
|
|
3449
|
-
z(
|
|
3510
|
+
z(s);
|
|
3450
3511
|
}
|
|
3451
3512
|
/**
|
|
3452
3513
|
* Sends a message to the TelemetryOS platform and waits for a response.
|
|
@@ -3466,32 +3527,32 @@ class Zt {
|
|
|
3466
3527
|
* @throws {Error} If the request times out
|
|
3467
3528
|
*/
|
|
3468
3529
|
request(e, t) {
|
|
3469
|
-
const
|
|
3530
|
+
const s = J(), a = W({
|
|
3470
3531
|
telemetrySdkVersion: G,
|
|
3471
3532
|
applicationName: this._applicationName,
|
|
3472
3533
|
applicationSpecifier: this._applicationSpecifier,
|
|
3473
3534
|
applicationInstance: this._applicationInstance,
|
|
3474
3535
|
name: e,
|
|
3475
3536
|
data: t,
|
|
3476
|
-
responseName:
|
|
3537
|
+
responseName: s
|
|
3477
3538
|
});
|
|
3478
|
-
z(
|
|
3539
|
+
z(a);
|
|
3479
3540
|
let i = !1, r;
|
|
3480
|
-
const o = new Promise((h,
|
|
3481
|
-
const w = new Error(`${e} message request with response name of ${
|
|
3541
|
+
const o = new Promise((h, _) => {
|
|
3542
|
+
const w = new Error(`${e} message request with response name of ${s} timed out after ${F}`);
|
|
3482
3543
|
setTimeout(() => {
|
|
3483
|
-
i = !0, this.off(
|
|
3544
|
+
i = !0, this.off(s, r), _(w);
|
|
3484
3545
|
}, F);
|
|
3485
3546
|
}), c = new Promise((h) => {
|
|
3486
|
-
r = (
|
|
3487
|
-
i || h(
|
|
3488
|
-
}, this.once(
|
|
3547
|
+
r = (_) => {
|
|
3548
|
+
i || h(_);
|
|
3549
|
+
}, this.once(s, h);
|
|
3489
3550
|
});
|
|
3490
3551
|
return Promise.race([o, c]);
|
|
3491
3552
|
}
|
|
3492
|
-
async subscribe(e, t,
|
|
3493
|
-
let
|
|
3494
|
-
typeof t == "function" ? i = t : (
|
|
3553
|
+
async subscribe(e, t, s) {
|
|
3554
|
+
let a, i;
|
|
3555
|
+
typeof t == "function" ? i = t : (a = t, i = s);
|
|
3495
3556
|
const r = J(), o = J();
|
|
3496
3557
|
let c = this._subscriptionNamesBySubjectName.get(e);
|
|
3497
3558
|
c || (c = [], this._subscriptionNamesBySubjectName.set(e, c)), c.push(r), this._subscriptionNamesByHandler.set(i, r), this.on(r, i);
|
|
@@ -3501,27 +3562,27 @@ class Zt {
|
|
|
3501
3562
|
applicationSpecifier: this._applicationSpecifier,
|
|
3502
3563
|
applicationInstance: this._applicationInstance,
|
|
3503
3564
|
name: e,
|
|
3504
|
-
data:
|
|
3565
|
+
data: a,
|
|
3505
3566
|
responseName: o,
|
|
3506
3567
|
subscriptionName: r
|
|
3507
3568
|
});
|
|
3508
3569
|
z(h);
|
|
3509
|
-
let
|
|
3570
|
+
let _ = !1, w;
|
|
3510
3571
|
const Z = new Promise((j, P) => {
|
|
3511
|
-
const
|
|
3572
|
+
const ae = new Error(`${e} subscribe request with subscription name of ${r} and response name of ${o} timed out after ${F}`);
|
|
3512
3573
|
setTimeout(() => {
|
|
3513
|
-
|
|
3574
|
+
_ = !0, this.off(o, w), P(ae);
|
|
3514
3575
|
}, F);
|
|
3515
|
-
}),
|
|
3576
|
+
}), se = new Promise((j) => {
|
|
3516
3577
|
w = (P) => {
|
|
3517
|
-
|
|
3578
|
+
_ || j(P);
|
|
3518
3579
|
}, this.on(o, j);
|
|
3519
3580
|
});
|
|
3520
|
-
return Promise.race([Z,
|
|
3581
|
+
return Promise.race([Z, se]);
|
|
3521
3582
|
}
|
|
3522
|
-
async unsubscribe(e, t,
|
|
3523
|
-
let
|
|
3524
|
-
typeof t == "function" ? i = t : (
|
|
3583
|
+
async unsubscribe(e, t, s) {
|
|
3584
|
+
let a, i;
|
|
3585
|
+
typeof t == "function" ? i = t : (a = t, i = s);
|
|
3525
3586
|
const r = J();
|
|
3526
3587
|
let o = [];
|
|
3527
3588
|
if (i) {
|
|
@@ -3539,23 +3600,23 @@ class Zt {
|
|
|
3539
3600
|
applicationName: this._applicationName,
|
|
3540
3601
|
applicationSpecifier: this._applicationSpecifier,
|
|
3541
3602
|
name: e,
|
|
3542
|
-
data:
|
|
3603
|
+
data: a,
|
|
3543
3604
|
responseName: r,
|
|
3544
3605
|
unsubscribeName: c
|
|
3545
3606
|
});
|
|
3546
3607
|
z(h);
|
|
3547
|
-
let
|
|
3608
|
+
let _ = !1, w;
|
|
3548
3609
|
const Z = new Promise((j, P) => {
|
|
3549
|
-
const
|
|
3610
|
+
const ae = new Error(`${e} unsubscribe request with unsubscribe name of ${c} and response name of ${r} timed out after ${F}`);
|
|
3550
3611
|
setTimeout(() => {
|
|
3551
|
-
|
|
3612
|
+
_ = !0, this.off(r, w), P(ae);
|
|
3552
3613
|
}, F);
|
|
3553
|
-
}),
|
|
3614
|
+
}), se = new Promise((j) => {
|
|
3554
3615
|
w = (P) => {
|
|
3555
|
-
|
|
3616
|
+
_ || j(P);
|
|
3556
3617
|
}, this.once(r, j);
|
|
3557
3618
|
});
|
|
3558
|
-
if (!(await Promise.race([Z,
|
|
3619
|
+
if (!(await Promise.race([Z, se])).success)
|
|
3559
3620
|
return { success: !1 };
|
|
3560
3621
|
}
|
|
3561
3622
|
return { success: !0 };
|
|
@@ -3578,9 +3639,9 @@ class Zt {
|
|
|
3578
3639
|
* @param handler The callback function to execute when messages are received
|
|
3579
3640
|
*/
|
|
3580
3641
|
on(e, t) {
|
|
3581
|
-
var
|
|
3582
|
-
const
|
|
3583
|
-
|
|
3642
|
+
var s;
|
|
3643
|
+
const a = (s = this._onHandlers.get(e)) !== null && s !== void 0 ? s : [];
|
|
3644
|
+
a.length === 0 && this._onHandlers.set(e, a), a.push(t);
|
|
3584
3645
|
}
|
|
3585
3646
|
/**
|
|
3586
3647
|
* Registers a one-time handler for a specific message type.
|
|
@@ -3597,9 +3658,9 @@ class Zt {
|
|
|
3597
3658
|
* @param handler The callback function to execute when the message is received
|
|
3598
3659
|
*/
|
|
3599
3660
|
once(e, t) {
|
|
3600
|
-
var
|
|
3601
|
-
const
|
|
3602
|
-
|
|
3661
|
+
var s;
|
|
3662
|
+
const a = (s = this._onceHandlers.get(e)) !== null && s !== void 0 ? s : [];
|
|
3663
|
+
a.length === 0 && this._onceHandlers.set(e, a), a.push(t);
|
|
3603
3664
|
}
|
|
3604
3665
|
/**
|
|
3605
3666
|
* Removes previously registered message handlers.
|
|
@@ -3617,17 +3678,17 @@ class Zt {
|
|
|
3617
3678
|
* all handlers for this message type will be removed.
|
|
3618
3679
|
*/
|
|
3619
3680
|
off(e, t) {
|
|
3620
|
-
const
|
|
3621
|
-
if (!(!
|
|
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);
|
|
3626
|
-
}
|
|
3681
|
+
const s = this._onHandlers.get(e), a = this._onceHandlers.get(e);
|
|
3682
|
+
if (!(!s && !a)) {
|
|
3627
3683
|
if (s) {
|
|
3628
3684
|
for (let i = 0; i < s.length; i += 1)
|
|
3629
3685
|
t && s[i] !== t || (s.splice(i, 1), i -= 1);
|
|
3630
|
-
s.length === 0 && this.
|
|
3686
|
+
s.length === 0 && this._onHandlers.delete(e);
|
|
3687
|
+
}
|
|
3688
|
+
if (a) {
|
|
3689
|
+
for (let i = 0; i < a.length; i += 1)
|
|
3690
|
+
t && a[i] !== t || (a.splice(i, 1), i -= 1);
|
|
3691
|
+
a.length === 0 && this._onceHandlers.delete(e);
|
|
3631
3692
|
}
|
|
3632
3693
|
}
|
|
3633
3694
|
}
|
|
@@ -3636,7 +3697,7 @@ function J() {
|
|
|
3636
3697
|
return Math.random().toString(36).slice(2, 9);
|
|
3637
3698
|
}
|
|
3638
3699
|
const G = _t.version;
|
|
3639
|
-
class
|
|
3700
|
+
class At {
|
|
3640
3701
|
constructor(e) {
|
|
3641
3702
|
this._client = e;
|
|
3642
3703
|
}
|
|
@@ -3685,7 +3746,7 @@ class Ot {
|
|
|
3685
3746
|
return !0;
|
|
3686
3747
|
}
|
|
3687
3748
|
}
|
|
3688
|
-
class
|
|
3749
|
+
class It {
|
|
3689
3750
|
constructor(e) {
|
|
3690
3751
|
this._client = e;
|
|
3691
3752
|
}
|
|
@@ -3741,77 +3802,80 @@ class At {
|
|
|
3741
3802
|
return !0;
|
|
3742
3803
|
}
|
|
3743
3804
|
}
|
|
3744
|
-
class
|
|
3805
|
+
class $t extends Ot {
|
|
3745
3806
|
get playlist() {
|
|
3746
|
-
return new
|
|
3807
|
+
return new It(this);
|
|
3747
3808
|
}
|
|
3748
3809
|
get overrides() {
|
|
3749
|
-
return new
|
|
3810
|
+
return new At(this);
|
|
3750
3811
|
}
|
|
3751
3812
|
}
|
|
3752
|
-
let
|
|
3753
|
-
function Dt() {
|
|
3754
|
-
return g;
|
|
3755
|
-
}
|
|
3756
|
-
function Vt(n) {
|
|
3757
|
-
g = new It(n), g.bind();
|
|
3758
|
-
}
|
|
3813
|
+
let f = null;
|
|
3759
3814
|
function zt() {
|
|
3760
|
-
|
|
3815
|
+
return f;
|
|
3761
3816
|
}
|
|
3762
|
-
function Bt(
|
|
3763
|
-
|
|
3817
|
+
function Bt(n) {
|
|
3818
|
+
f = new $t(n), f.bind();
|
|
3764
3819
|
}
|
|
3765
|
-
function Ut(
|
|
3766
|
-
|
|
3820
|
+
function Ut() {
|
|
3821
|
+
f == null || f.unbind(), f = null;
|
|
3767
3822
|
}
|
|
3768
3823
|
function Ht(...n) {
|
|
3769
|
-
return k(
|
|
3824
|
+
return k(f), f.on(...n);
|
|
3770
3825
|
}
|
|
3771
3826
|
function Kt(...n) {
|
|
3772
|
-
return k(
|
|
3827
|
+
return k(f), f.once(...n);
|
|
3773
3828
|
}
|
|
3774
3829
|
function Wt(...n) {
|
|
3775
|
-
return k(
|
|
3830
|
+
return k(f), f.off(...n);
|
|
3776
3831
|
}
|
|
3777
3832
|
function Jt(...n) {
|
|
3778
|
-
return k(
|
|
3833
|
+
return k(f), f.send(...n);
|
|
3779
3834
|
}
|
|
3780
3835
|
function Gt(...n) {
|
|
3781
|
-
return k(
|
|
3836
|
+
return k(f), f.request(...n);
|
|
3782
3837
|
}
|
|
3783
|
-
function Yt() {
|
|
3784
|
-
return k(
|
|
3838
|
+
function Yt(...n) {
|
|
3839
|
+
return k(f), f.subscribe(...n);
|
|
3785
3840
|
}
|
|
3786
|
-
function Xt() {
|
|
3787
|
-
return k(
|
|
3841
|
+
function Xt(...n) {
|
|
3842
|
+
return k(f), f.unsubscribe(...n);
|
|
3788
3843
|
}
|
|
3789
3844
|
function Qt() {
|
|
3790
|
-
return k(
|
|
3845
|
+
return k(f), f.store;
|
|
3846
|
+
}
|
|
3847
|
+
function es() {
|
|
3848
|
+
return k(f), f.applications;
|
|
3849
|
+
}
|
|
3850
|
+
function ts() {
|
|
3851
|
+
return k(f), f.media;
|
|
3852
|
+
}
|
|
3853
|
+
function ss() {
|
|
3854
|
+
return k(f), f.accounts;
|
|
3791
3855
|
}
|
|
3792
|
-
function
|
|
3793
|
-
return k(
|
|
3856
|
+
function as() {
|
|
3857
|
+
return k(f), f.users;
|
|
3794
3858
|
}
|
|
3795
|
-
function
|
|
3796
|
-
return k(
|
|
3859
|
+
function ns() {
|
|
3860
|
+
return k(f), f.devices;
|
|
3797
3861
|
}
|
|
3798
|
-
function
|
|
3799
|
-
return k(
|
|
3862
|
+
function rs() {
|
|
3863
|
+
return k(f), f.proxy;
|
|
3800
3864
|
}
|
|
3801
|
-
function
|
|
3802
|
-
return k(
|
|
3865
|
+
function is() {
|
|
3866
|
+
return k(f), f.weather;
|
|
3803
3867
|
}
|
|
3804
|
-
function
|
|
3805
|
-
return k(
|
|
3868
|
+
function os() {
|
|
3869
|
+
return k(f), f.currency;
|
|
3806
3870
|
}
|
|
3807
|
-
function
|
|
3808
|
-
return k(
|
|
3871
|
+
function cs() {
|
|
3872
|
+
return k(f), f.environment;
|
|
3809
3873
|
}
|
|
3810
|
-
function
|
|
3811
|
-
return k(
|
|
3874
|
+
function ds() {
|
|
3875
|
+
return k(f), f.playlist;
|
|
3812
3876
|
}
|
|
3813
|
-
function
|
|
3814
|
-
return k(
|
|
3877
|
+
function us() {
|
|
3878
|
+
return k(f), f.overrides;
|
|
3815
3879
|
}
|
|
3816
3880
|
function k(n) {
|
|
3817
3881
|
if (!n)
|
|
@@ -3820,6 +3884,7 @@ function k(n) {
|
|
|
3820
3884
|
export {
|
|
3821
3885
|
gt as Accounts,
|
|
3822
3886
|
yt as Applications,
|
|
3887
|
+
Ct as Currency,
|
|
3823
3888
|
vt as Devices,
|
|
3824
3889
|
bt as Environment,
|
|
3825
3890
|
wt as Media,
|
|
@@ -3828,26 +3893,27 @@ export {
|
|
|
3828
3893
|
K as StoreSlice,
|
|
3829
3894
|
St as Users,
|
|
3830
3895
|
Nt as Weather,
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3896
|
+
ss as accounts,
|
|
3897
|
+
es as applications,
|
|
3898
|
+
Bt as configure,
|
|
3899
|
+
os as currency,
|
|
3900
|
+
Ut as destroy,
|
|
3901
|
+
ns as devices,
|
|
3902
|
+
cs as environment,
|
|
3903
|
+
zt as globalClient,
|
|
3904
|
+
ts as media,
|
|
3905
|
+
Wt as off,
|
|
3906
|
+
Ht as on,
|
|
3907
|
+
Kt as once,
|
|
3908
|
+
us as overrides,
|
|
3909
|
+
ds as playlist,
|
|
3910
|
+
rs as proxy,
|
|
3911
|
+
Gt as request,
|
|
3912
|
+
Jt as send,
|
|
3913
|
+
Qt as store,
|
|
3914
|
+
Yt as subscribe,
|
|
3849
3915
|
G as telemetrySdkVersion,
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3916
|
+
Xt as unsubscribe,
|
|
3917
|
+
as as users,
|
|
3918
|
+
is as weather
|
|
3853
3919
|
};
|