@telemetryos/sdk 1.13.0 → 1.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/README.md +68 -6
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.js +323 -332
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -35,14 +35,14 @@ var b;
|
|
|
35
35
|
}
|
|
36
36
|
a.joinValues = s, a.jsonStringifyReplacer = (n, r) => typeof r == "bigint" ? r.toString() : r;
|
|
37
37
|
})(b || (b = {}));
|
|
38
|
-
var
|
|
38
|
+
var ye;
|
|
39
39
|
(function(a) {
|
|
40
40
|
a.mergeShapes = (e, t) => ({
|
|
41
41
|
...e,
|
|
42
42
|
...t
|
|
43
43
|
// second overwrites first
|
|
44
44
|
});
|
|
45
|
-
})(
|
|
45
|
+
})(ye || (ye = {}));
|
|
46
46
|
const l = b.arrayToEnum([
|
|
47
47
|
"string",
|
|
48
48
|
"nan",
|
|
@@ -103,7 +103,7 @@ const l = b.arrayToEnum([
|
|
|
103
103
|
"not_multiple_of",
|
|
104
104
|
"not_finite"
|
|
105
105
|
]);
|
|
106
|
-
class
|
|
106
|
+
class O extends Error {
|
|
107
107
|
get errors() {
|
|
108
108
|
return this.issues;
|
|
109
109
|
}
|
|
@@ -140,7 +140,7 @@ class Z extends Error {
|
|
|
140
140
|
return n(this), s;
|
|
141
141
|
}
|
|
142
142
|
static assert(e) {
|
|
143
|
-
if (!(e instanceof
|
|
143
|
+
if (!(e instanceof O))
|
|
144
144
|
throw new Error(`Not a ZodError: ${e}`);
|
|
145
145
|
}
|
|
146
146
|
toString() {
|
|
@@ -166,8 +166,8 @@ class Z extends Error {
|
|
|
166
166
|
return this.flatten();
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
|
|
170
|
-
const
|
|
169
|
+
O.create = (a) => new O(a);
|
|
170
|
+
const ne = (a, e) => {
|
|
171
171
|
let t;
|
|
172
172
|
switch (a.code) {
|
|
173
173
|
case u.invalid_type:
|
|
@@ -223,11 +223,11 @@ const ae = (a, e) => {
|
|
|
223
223
|
}
|
|
224
224
|
return { message: t };
|
|
225
225
|
};
|
|
226
|
-
let
|
|
227
|
-
function
|
|
228
|
-
return
|
|
226
|
+
let Me = ne;
|
|
227
|
+
function Le() {
|
|
228
|
+
return Me;
|
|
229
229
|
}
|
|
230
|
-
const
|
|
230
|
+
const De = (a) => {
|
|
231
231
|
const { data: e, path: t, errorMaps: s, issueData: n } = a, r = [...t, ...n.path || []], i = {
|
|
232
232
|
...n,
|
|
233
233
|
path: r
|
|
@@ -249,7 +249,7 @@ const Me = (a) => {
|
|
|
249
249
|
};
|
|
250
250
|
};
|
|
251
251
|
function d(a, e) {
|
|
252
|
-
const t =
|
|
252
|
+
const t = Le(), s = De({
|
|
253
253
|
issueData: e,
|
|
254
254
|
data: a.data,
|
|
255
255
|
path: a.path,
|
|
@@ -260,7 +260,7 @@ function d(a, e) {
|
|
|
260
260
|
// then schema-bound map if available
|
|
261
261
|
t,
|
|
262
262
|
// then global override map
|
|
263
|
-
t ===
|
|
263
|
+
t === ne ? void 0 : ne
|
|
264
264
|
// then global default map
|
|
265
265
|
].filter((n) => !!n)
|
|
266
266
|
});
|
|
@@ -309,12 +309,12 @@ class x {
|
|
|
309
309
|
}
|
|
310
310
|
const _ = Object.freeze({
|
|
311
311
|
status: "aborted"
|
|
312
|
-
}),
|
|
312
|
+
}), ae = (a) => ({ status: "dirty", value: a }), S = (a) => ({ status: "valid", value: a }), ve = (a) => a.status === "aborted", be = (a) => a.status === "dirty", M = (a) => a.status === "valid", G = (a) => typeof Promise < "u" && a instanceof Promise;
|
|
313
313
|
var p;
|
|
314
314
|
(function(a) {
|
|
315
315
|
a.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, a.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
316
316
|
})(p || (p = {}));
|
|
317
|
-
let
|
|
317
|
+
let E = class {
|
|
318
318
|
constructor(e, t, s, n) {
|
|
319
319
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = n;
|
|
320
320
|
}
|
|
@@ -322,8 +322,8 @@ let $ = class {
|
|
|
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;
|
|
323
323
|
}
|
|
324
324
|
};
|
|
325
|
-
const
|
|
326
|
-
if (
|
|
325
|
+
const we = (a, e) => {
|
|
326
|
+
if (M(e))
|
|
327
327
|
return { success: !0, data: e.value };
|
|
328
328
|
if (!a.common.issues.length)
|
|
329
329
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -332,7 +332,7 @@ const be = (a, e) => {
|
|
|
332
332
|
get error() {
|
|
333
333
|
if (this._error)
|
|
334
334
|
return this._error;
|
|
335
|
-
const t = new
|
|
335
|
+
const t = new O(a.common.issues);
|
|
336
336
|
return this._error = t, this._error;
|
|
337
337
|
}
|
|
338
338
|
};
|
|
@@ -380,7 +380,7 @@ let v = class {
|
|
|
380
380
|
}
|
|
381
381
|
_parseSync(e) {
|
|
382
382
|
const t = this._parse(e);
|
|
383
|
-
if (
|
|
383
|
+
if (G(t))
|
|
384
384
|
throw new Error("Synchronous parse encountered promise.");
|
|
385
385
|
return t;
|
|
386
386
|
}
|
|
@@ -407,7 +407,7 @@ let v = class {
|
|
|
407
407
|
data: e,
|
|
408
408
|
parsedType: A(e)
|
|
409
409
|
}, n = this._parseSync({ data: e, path: s.path, parent: s });
|
|
410
|
-
return
|
|
410
|
+
return we(s, n);
|
|
411
411
|
}
|
|
412
412
|
"~validate"(e) {
|
|
413
413
|
var t, s;
|
|
@@ -425,7 +425,7 @@ let v = class {
|
|
|
425
425
|
if (!this["~standard"].async)
|
|
426
426
|
try {
|
|
427
427
|
const r = this._parseSync({ data: e, path: [], parent: n });
|
|
428
|
-
return
|
|
428
|
+
return M(r) ? {
|
|
429
429
|
value: r.value
|
|
430
430
|
} : {
|
|
431
431
|
issues: n.common.issues
|
|
@@ -436,7 +436,7 @@ let v = class {
|
|
|
436
436
|
async: !0
|
|
437
437
|
};
|
|
438
438
|
}
|
|
439
|
-
return this._parseAsync({ data: e, path: [], parent: n }).then((r) =>
|
|
439
|
+
return this._parseAsync({ data: e, path: [], parent: n }).then((r) => M(r) ? {
|
|
440
440
|
value: r.value
|
|
441
441
|
} : {
|
|
442
442
|
issues: n.common.issues
|
|
@@ -460,8 +460,8 @@ let v = class {
|
|
|
460
460
|
parent: null,
|
|
461
461
|
data: e,
|
|
462
462
|
parsedType: A(e)
|
|
463
|
-
}, n = this._parse({ data: e, path: s.path, parent: s }), r = await (
|
|
464
|
-
return
|
|
463
|
+
}, n = this._parse({ data: e, path: s.path, parent: s }), r = await (G(n) ? n : Promise.resolve(n));
|
|
464
|
+
return we(s, r);
|
|
465
465
|
}
|
|
466
466
|
refine(e, t) {
|
|
467
467
|
const s = (n) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(n) : t;
|
|
@@ -477,7 +477,7 @@ let v = class {
|
|
|
477
477
|
return this._refinement((s, n) => e(s) ? !0 : (n.addIssue(typeof t == "function" ? t(s, n) : t), !1));
|
|
478
478
|
}
|
|
479
479
|
_refinement(e) {
|
|
480
|
-
return new
|
|
480
|
+
return new L({
|
|
481
481
|
schema: this,
|
|
482
482
|
typeName: m.ZodEffects,
|
|
483
483
|
effect: { type: "refinement", refinement: e }
|
|
@@ -497,25 +497,25 @@ let v = class {
|
|
|
497
497
|
return I.create(this, this._def);
|
|
498
498
|
}
|
|
499
499
|
nullable() {
|
|
500
|
-
return
|
|
500
|
+
return D.create(this, this._def);
|
|
501
501
|
}
|
|
502
502
|
nullish() {
|
|
503
503
|
return this.nullable().optional();
|
|
504
504
|
}
|
|
505
505
|
array() {
|
|
506
|
-
return
|
|
506
|
+
return N.create(this);
|
|
507
507
|
}
|
|
508
508
|
promise() {
|
|
509
|
-
return
|
|
509
|
+
return ee.create(this, this._def);
|
|
510
510
|
}
|
|
511
511
|
or(e) {
|
|
512
|
-
return
|
|
512
|
+
return Y.create([this, e], this._def);
|
|
513
513
|
}
|
|
514
514
|
and(e) {
|
|
515
|
-
return
|
|
515
|
+
return X.create(this, e, this._def);
|
|
516
516
|
}
|
|
517
517
|
transform(e) {
|
|
518
|
-
return new
|
|
518
|
+
return new L({
|
|
519
519
|
...y(this._def),
|
|
520
520
|
schema: this,
|
|
521
521
|
typeName: m.ZodEffects,
|
|
@@ -524,7 +524,7 @@ let v = class {
|
|
|
524
524
|
}
|
|
525
525
|
default(e) {
|
|
526
526
|
const t = typeof e == "function" ? e : () => e;
|
|
527
|
-
return new
|
|
527
|
+
return new he({
|
|
528
528
|
...y(this._def),
|
|
529
529
|
innerType: this,
|
|
530
530
|
defaultValue: t,
|
|
@@ -532,7 +532,7 @@ let v = class {
|
|
|
532
532
|
});
|
|
533
533
|
}
|
|
534
534
|
brand() {
|
|
535
|
-
return new
|
|
535
|
+
return new dt({
|
|
536
536
|
typeName: m.ZodBranded,
|
|
537
537
|
type: this,
|
|
538
538
|
...y(this._def)
|
|
@@ -540,7 +540,7 @@ let v = class {
|
|
|
540
540
|
}
|
|
541
541
|
catch(e) {
|
|
542
542
|
const t = typeof e == "function" ? e : () => e;
|
|
543
|
-
return new
|
|
543
|
+
return new pe({
|
|
544
544
|
...y(this._def),
|
|
545
545
|
innerType: this,
|
|
546
546
|
catchValue: t,
|
|
@@ -555,10 +555,10 @@ let v = class {
|
|
|
555
555
|
});
|
|
556
556
|
}
|
|
557
557
|
pipe(e) {
|
|
558
|
-
return
|
|
558
|
+
return _e.create(this, e);
|
|
559
559
|
}
|
|
560
560
|
readonly() {
|
|
561
|
-
return
|
|
561
|
+
return fe.create(this);
|
|
562
562
|
}
|
|
563
563
|
isOptional() {
|
|
564
564
|
return this.safeParse(void 0).success;
|
|
@@ -567,28 +567,28 @@ let v = class {
|
|
|
567
567
|
return this.safeParse(null).success;
|
|
568
568
|
}
|
|
569
569
|
};
|
|
570
|
-
const
|
|
571
|
-
let
|
|
572
|
-
const
|
|
573
|
-
function
|
|
570
|
+
const He = /^c[^\s-]{8,}$/i, ze = /^[0-9a-z]+$/, Ve = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Be = /^[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, Ue = /^[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, Qe = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
571
|
+
let se;
|
|
572
|
+
const Ge = /^(?:(?: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])$/, 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])\/(3[0-2]|[12]?[0-9])$/, Xe = /^(([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])))", nt = new RegExp(`^${Pe}$`);
|
|
573
|
+
function Re(a) {
|
|
574
574
|
let e = "[0-5]\\d";
|
|
575
575
|
a.precision ? e = `${e}\\.\\d{${a.precision}}` : a.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
576
576
|
const t = a.precision ? "+" : "?";
|
|
577
577
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
|
|
578
578
|
}
|
|
579
|
-
function
|
|
580
|
-
return new RegExp(`^${
|
|
579
|
+
function at(a) {
|
|
580
|
+
return new RegExp(`^${Re(a)}$`);
|
|
581
581
|
}
|
|
582
|
-
function
|
|
583
|
-
let e = `${
|
|
582
|
+
function it(a) {
|
|
583
|
+
let e = `${Pe}T${Re(a)}`;
|
|
584
584
|
const t = [];
|
|
585
585
|
return t.push(a.local ? "Z?" : "Z"), a.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
586
586
|
}
|
|
587
|
-
function
|
|
588
|
-
return !!((e === "v4" || !e) &&
|
|
587
|
+
function rt(a, e) {
|
|
588
|
+
return !!((e === "v4" || !e) && Ge.test(a) || (e === "v6" || !e) && Xe.test(a));
|
|
589
589
|
}
|
|
590
|
-
function
|
|
591
|
-
if (!
|
|
590
|
+
function ot(a, e) {
|
|
591
|
+
if (!Ke.test(a))
|
|
592
592
|
return !1;
|
|
593
593
|
try {
|
|
594
594
|
const [t] = a.split(".");
|
|
@@ -600,10 +600,10 @@ function it(a, e) {
|
|
|
600
600
|
return !1;
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
|
-
function
|
|
604
|
-
return !!((e === "v4" || !e) &&
|
|
603
|
+
function ct(a, e) {
|
|
604
|
+
return !!((e === "v4" || !e) && Ye.test(a) || (e === "v6" || !e) && et.test(a));
|
|
605
605
|
}
|
|
606
|
-
class
|
|
606
|
+
let ie = class V extends v {
|
|
607
607
|
_parse(e) {
|
|
608
608
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== l.string) {
|
|
609
609
|
const n = this._getOrReturnCtx(e);
|
|
@@ -652,43 +652,43 @@ class E extends v {
|
|
|
652
652
|
message: n.message
|
|
653
653
|
}), t.dirty());
|
|
654
654
|
} else if (n.kind === "email")
|
|
655
|
-
|
|
655
|
+
Je.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
|
|
656
656
|
validation: "email",
|
|
657
657
|
code: u.invalid_string,
|
|
658
658
|
message: n.message
|
|
659
659
|
}), t.dirty());
|
|
660
660
|
else if (n.kind === "emoji")
|
|
661
|
-
|
|
661
|
+
se || (se = new RegExp(Qe, "u")), se.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
|
|
662
662
|
validation: "emoji",
|
|
663
663
|
code: u.invalid_string,
|
|
664
664
|
message: n.message
|
|
665
665
|
}), t.dirty());
|
|
666
666
|
else if (n.kind === "uuid")
|
|
667
|
-
|
|
667
|
+
Be.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
|
|
668
668
|
validation: "uuid",
|
|
669
669
|
code: u.invalid_string,
|
|
670
670
|
message: n.message
|
|
671
671
|
}), t.dirty());
|
|
672
672
|
else if (n.kind === "nanoid")
|
|
673
|
-
|
|
673
|
+
Ue.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
|
|
674
674
|
validation: "nanoid",
|
|
675
675
|
code: u.invalid_string,
|
|
676
676
|
message: n.message
|
|
677
677
|
}), t.dirty());
|
|
678
678
|
else if (n.kind === "cuid")
|
|
679
|
-
|
|
679
|
+
He.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
|
|
680
680
|
validation: "cuid",
|
|
681
681
|
code: u.invalid_string,
|
|
682
682
|
message: n.message
|
|
683
683
|
}), t.dirty());
|
|
684
684
|
else if (n.kind === "cuid2")
|
|
685
|
-
|
|
685
|
+
ze.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
|
|
686
686
|
validation: "cuid2",
|
|
687
687
|
code: u.invalid_string,
|
|
688
688
|
message: n.message
|
|
689
689
|
}), t.dirty());
|
|
690
690
|
else if (n.kind === "ulid")
|
|
691
|
-
|
|
691
|
+
Ve.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
|
|
692
692
|
validation: "ulid",
|
|
693
693
|
code: u.invalid_string,
|
|
694
694
|
message: n.message
|
|
@@ -719,39 +719,39 @@ class E extends v {
|
|
|
719
719
|
code: u.invalid_string,
|
|
720
720
|
validation: { endsWith: n.value },
|
|
721
721
|
message: n.message
|
|
722
|
-
}), t.dirty()) : n.kind === "datetime" ?
|
|
722
|
+
}), t.dirty()) : n.kind === "datetime" ? it(n).test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
|
|
723
723
|
code: u.invalid_string,
|
|
724
724
|
validation: "datetime",
|
|
725
725
|
message: n.message
|
|
726
|
-
}), t.dirty()) : n.kind === "date" ?
|
|
726
|
+
}), t.dirty()) : n.kind === "date" ? nt.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
|
|
727
727
|
code: u.invalid_string,
|
|
728
728
|
validation: "date",
|
|
729
729
|
message: n.message
|
|
730
|
-
}), t.dirty()) : n.kind === "time" ?
|
|
730
|
+
}), t.dirty()) : n.kind === "time" ? at(n).test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
|
|
731
731
|
code: u.invalid_string,
|
|
732
732
|
validation: "time",
|
|
733
733
|
message: n.message
|
|
734
|
-
}), t.dirty()) : n.kind === "duration" ?
|
|
734
|
+
}), t.dirty()) : n.kind === "duration" ? We.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
|
|
735
735
|
validation: "duration",
|
|
736
736
|
code: u.invalid_string,
|
|
737
737
|
message: n.message
|
|
738
|
-
}), t.dirty()) : n.kind === "ip" ?
|
|
738
|
+
}), t.dirty()) : n.kind === "ip" ? rt(e.data, n.version) || (s = this._getOrReturnCtx(e, s), d(s, {
|
|
739
739
|
validation: "ip",
|
|
740
740
|
code: u.invalid_string,
|
|
741
741
|
message: n.message
|
|
742
|
-
}), t.dirty()) : n.kind === "jwt" ?
|
|
742
|
+
}), t.dirty()) : n.kind === "jwt" ? ot(e.data, n.alg) || (s = this._getOrReturnCtx(e, s), d(s, {
|
|
743
743
|
validation: "jwt",
|
|
744
744
|
code: u.invalid_string,
|
|
745
745
|
message: n.message
|
|
746
|
-
}), t.dirty()) : n.kind === "cidr" ?
|
|
746
|
+
}), t.dirty()) : n.kind === "cidr" ? ct(e.data, n.version) || (s = this._getOrReturnCtx(e, s), d(s, {
|
|
747
747
|
validation: "cidr",
|
|
748
748
|
code: u.invalid_string,
|
|
749
749
|
message: n.message
|
|
750
|
-
}), t.dirty()) : n.kind === "base64" ?
|
|
750
|
+
}), t.dirty()) : n.kind === "base64" ? tt.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
|
|
751
751
|
validation: "base64",
|
|
752
752
|
code: u.invalid_string,
|
|
753
753
|
message: n.message
|
|
754
|
-
}), t.dirty()) : n.kind === "base64url" ?
|
|
754
|
+
}), t.dirty()) : n.kind === "base64url" ? st.test(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
|
|
755
755
|
validation: "base64url",
|
|
756
756
|
code: u.invalid_string,
|
|
757
757
|
message: n.message
|
|
@@ -766,7 +766,7 @@ class E extends v {
|
|
|
766
766
|
});
|
|
767
767
|
}
|
|
768
768
|
_addCheck(e) {
|
|
769
|
-
return new
|
|
769
|
+
return new V({
|
|
770
770
|
...this._def,
|
|
771
771
|
checks: [...this._def.checks, e]
|
|
772
772
|
});
|
|
@@ -902,19 +902,19 @@ class E extends v {
|
|
|
902
902
|
return this.min(1, p.errToObj(e));
|
|
903
903
|
}
|
|
904
904
|
trim() {
|
|
905
|
-
return new
|
|
905
|
+
return new V({
|
|
906
906
|
...this._def,
|
|
907
907
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
908
908
|
});
|
|
909
909
|
}
|
|
910
910
|
toLowerCase() {
|
|
911
|
-
return new
|
|
911
|
+
return new V({
|
|
912
912
|
...this._def,
|
|
913
913
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
914
914
|
});
|
|
915
915
|
}
|
|
916
916
|
toUpperCase() {
|
|
917
|
-
return new
|
|
917
|
+
return new V({
|
|
918
918
|
...this._def,
|
|
919
919
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
920
920
|
});
|
|
@@ -979,18 +979,18 @@ class E extends v {
|
|
|
979
979
|
t.kind === "max" && (e === null || t.value < e) && (e = t.value);
|
|
980
980
|
return e;
|
|
981
981
|
}
|
|
982
|
-
}
|
|
983
|
-
|
|
982
|
+
};
|
|
983
|
+
ie.create = (a) => new ie({
|
|
984
984
|
checks: [],
|
|
985
985
|
typeName: m.ZodString,
|
|
986
986
|
coerce: (a == null ? void 0 : a.coerce) ?? !1,
|
|
987
987
|
...y(a)
|
|
988
988
|
});
|
|
989
|
-
function
|
|
989
|
+
function ut(a, e) {
|
|
990
990
|
const t = (a.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, n = t > s ? t : s, r = Number.parseInt(a.toFixed(n).replace(".", "")), i = Number.parseInt(e.toFixed(n).replace(".", ""));
|
|
991
991
|
return r % i / 10 ** n;
|
|
992
992
|
}
|
|
993
|
-
let
|
|
993
|
+
let ke = class re extends v {
|
|
994
994
|
constructor() {
|
|
995
995
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
996
996
|
}
|
|
@@ -1025,7 +1025,7 @@ let we = class re extends v {
|
|
|
1025
1025
|
inclusive: n.inclusive,
|
|
1026
1026
|
exact: !1,
|
|
1027
1027
|
message: n.message
|
|
1028
|
-
}), s.dirty()) : n.kind === "multipleOf" ?
|
|
1028
|
+
}), s.dirty()) : n.kind === "multipleOf" ? ut(e.data, n.value) !== 0 && (t = this._getOrReturnCtx(e, t), d(t, {
|
|
1029
1029
|
code: u.not_multiple_of,
|
|
1030
1030
|
multipleOf: n.value,
|
|
1031
1031
|
message: n.message
|
|
@@ -1156,13 +1156,13 @@ let we = class re extends v {
|
|
|
1156
1156
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
1157
1157
|
}
|
|
1158
1158
|
};
|
|
1159
|
-
|
|
1159
|
+
ke.create = (a) => new ke({
|
|
1160
1160
|
checks: [],
|
|
1161
1161
|
typeName: m.ZodNumber,
|
|
1162
1162
|
coerce: (a == null ? void 0 : a.coerce) || !1,
|
|
1163
1163
|
...y(a)
|
|
1164
1164
|
});
|
|
1165
|
-
class
|
|
1165
|
+
let xe = class oe extends v {
|
|
1166
1166
|
constructor() {
|
|
1167
1167
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1168
1168
|
}
|
|
@@ -1218,7 +1218,7 @@ class U extends v {
|
|
|
1218
1218
|
return this.setLimit("max", e, !1, p.toString(t));
|
|
1219
1219
|
}
|
|
1220
1220
|
setLimit(e, t, s, n) {
|
|
1221
|
-
return new
|
|
1221
|
+
return new oe({
|
|
1222
1222
|
...this._def,
|
|
1223
1223
|
checks: [
|
|
1224
1224
|
...this._def.checks,
|
|
@@ -1232,7 +1232,7 @@ class U extends v {
|
|
|
1232
1232
|
});
|
|
1233
1233
|
}
|
|
1234
1234
|
_addCheck(e) {
|
|
1235
|
-
return new
|
|
1235
|
+
return new oe({
|
|
1236
1236
|
...this._def,
|
|
1237
1237
|
checks: [...this._def.checks, e]
|
|
1238
1238
|
});
|
|
@@ -1288,14 +1288,14 @@ class U extends v {
|
|
|
1288
1288
|
t.kind === "max" && (e === null || t.value < e) && (e = t.value);
|
|
1289
1289
|
return e;
|
|
1290
1290
|
}
|
|
1291
|
-
}
|
|
1292
|
-
|
|
1291
|
+
};
|
|
1292
|
+
xe.create = (a) => new xe({
|
|
1293
1293
|
checks: [],
|
|
1294
1294
|
typeName: m.ZodBigInt,
|
|
1295
1295
|
coerce: (a == null ? void 0 : a.coerce) ?? !1,
|
|
1296
1296
|
...y(a)
|
|
1297
1297
|
});
|
|
1298
|
-
class
|
|
1298
|
+
class Se extends v {
|
|
1299
1299
|
_parse(e) {
|
|
1300
1300
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== l.boolean) {
|
|
1301
1301
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1308,12 +1308,12 @@ class ke extends v {
|
|
|
1308
1308
|
return S(e.data);
|
|
1309
1309
|
}
|
|
1310
1310
|
}
|
|
1311
|
-
|
|
1311
|
+
Se.create = (a) => new Se({
|
|
1312
1312
|
typeName: m.ZodBoolean,
|
|
1313
1313
|
coerce: (a == null ? void 0 : a.coerce) || !1,
|
|
1314
1314
|
...y(a)
|
|
1315
1315
|
});
|
|
1316
|
-
let
|
|
1316
|
+
let Ce = 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
1319
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1353,7 +1353,7 @@ let xe = class Pe extends v {
|
|
|
1353
1353
|
};
|
|
1354
1354
|
}
|
|
1355
1355
|
_addCheck(e) {
|
|
1356
|
-
return new
|
|
1356
|
+
return new Fe({
|
|
1357
1357
|
...this._def,
|
|
1358
1358
|
checks: [...this._def.checks, e]
|
|
1359
1359
|
});
|
|
@@ -1385,13 +1385,13 @@ let xe = class Pe extends v {
|
|
|
1385
1385
|
return e != null ? new Date(e) : null;
|
|
1386
1386
|
}
|
|
1387
1387
|
};
|
|
1388
|
-
|
|
1388
|
+
Ce.create = (a) => new Ce({
|
|
1389
1389
|
checks: [],
|
|
1390
1390
|
coerce: (a == null ? void 0 : a.coerce) || !1,
|
|
1391
1391
|
typeName: m.ZodDate,
|
|
1392
1392
|
...y(a)
|
|
1393
1393
|
});
|
|
1394
|
-
class
|
|
1394
|
+
class Te extends v {
|
|
1395
1395
|
_parse(e) {
|
|
1396
1396
|
if (this._getType(e) !== l.symbol) {
|
|
1397
1397
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1404,11 +1404,11 @@ class Se extends v {
|
|
|
1404
1404
|
return S(e.data);
|
|
1405
1405
|
}
|
|
1406
1406
|
}
|
|
1407
|
-
|
|
1407
|
+
Te.create = (a) => new Te({
|
|
1408
1408
|
typeName: m.ZodSymbol,
|
|
1409
1409
|
...y(a)
|
|
1410
1410
|
});
|
|
1411
|
-
class
|
|
1411
|
+
class Ne extends v {
|
|
1412
1412
|
_parse(e) {
|
|
1413
1413
|
if (this._getType(e) !== l.undefined) {
|
|
1414
1414
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1421,11 +1421,11 @@ class Ce extends v {
|
|
|
1421
1421
|
return S(e.data);
|
|
1422
1422
|
}
|
|
1423
1423
|
}
|
|
1424
|
-
|
|
1424
|
+
Ne.create = (a) => new Ne({
|
|
1425
1425
|
typeName: m.ZodUndefined,
|
|
1426
1426
|
...y(a)
|
|
1427
1427
|
});
|
|
1428
|
-
class
|
|
1428
|
+
class Oe extends v {
|
|
1429
1429
|
_parse(e) {
|
|
1430
1430
|
if (this._getType(e) !== l.null) {
|
|
1431
1431
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1438,11 +1438,11 @@ class Ne extends v {
|
|
|
1438
1438
|
return S(e.data);
|
|
1439
1439
|
}
|
|
1440
1440
|
}
|
|
1441
|
-
|
|
1441
|
+
Oe.create = (a) => new Oe({
|
|
1442
1442
|
typeName: m.ZodNull,
|
|
1443
1443
|
...y(a)
|
|
1444
1444
|
});
|
|
1445
|
-
class
|
|
1445
|
+
class ce extends v {
|
|
1446
1446
|
constructor() {
|
|
1447
1447
|
super(...arguments), this._any = !0;
|
|
1448
1448
|
}
|
|
@@ -1450,11 +1450,11 @@ class oe extends v {
|
|
|
1450
1450
|
return S(e.data);
|
|
1451
1451
|
}
|
|
1452
1452
|
}
|
|
1453
|
-
|
|
1453
|
+
ce.create = (a) => new ce({
|
|
1454
1454
|
typeName: m.ZodAny,
|
|
1455
1455
|
...y(a)
|
|
1456
1456
|
});
|
|
1457
|
-
class
|
|
1457
|
+
class Ze extends v {
|
|
1458
1458
|
constructor() {
|
|
1459
1459
|
super(...arguments), this._unknown = !0;
|
|
1460
1460
|
}
|
|
@@ -1462,11 +1462,11 @@ class Te extends v {
|
|
|
1462
1462
|
return S(e.data);
|
|
1463
1463
|
}
|
|
1464
1464
|
}
|
|
1465
|
-
|
|
1465
|
+
Ze.create = (a) => new Ze({
|
|
1466
1466
|
typeName: m.ZodUnknown,
|
|
1467
1467
|
...y(a)
|
|
1468
1468
|
});
|
|
1469
|
-
let
|
|
1469
|
+
let $ = class extends v {
|
|
1470
1470
|
_parse(e) {
|
|
1471
1471
|
const t = this._getOrReturnCtx(e);
|
|
1472
1472
|
return d(t, {
|
|
@@ -1476,11 +1476,11 @@ let j = class extends v {
|
|
|
1476
1476
|
}), _;
|
|
1477
1477
|
}
|
|
1478
1478
|
};
|
|
1479
|
-
|
|
1479
|
+
$.create = (a) => new $({
|
|
1480
1480
|
typeName: m.ZodNever,
|
|
1481
1481
|
...y(a)
|
|
1482
1482
|
});
|
|
1483
|
-
class
|
|
1483
|
+
class Ae extends v {
|
|
1484
1484
|
_parse(e) {
|
|
1485
1485
|
if (this._getType(e) !== l.undefined) {
|
|
1486
1486
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1493,11 +1493,11 @@ class Ze extends v {
|
|
|
1493
1493
|
return S(e.data);
|
|
1494
1494
|
}
|
|
1495
1495
|
}
|
|
1496
|
-
|
|
1496
|
+
Ae.create = (a) => new Ae({
|
|
1497
1497
|
typeName: m.ZodVoid,
|
|
1498
1498
|
...y(a)
|
|
1499
1499
|
});
|
|
1500
|
-
class
|
|
1500
|
+
class N extends v {
|
|
1501
1501
|
_parse(e) {
|
|
1502
1502
|
const { ctx: t, status: s } = this._processInputParams(e), n = this._def;
|
|
1503
1503
|
if (t.parsedType !== l.array)
|
|
@@ -1533,27 +1533,27 @@ class T extends v {
|
|
|
1533
1533
|
exact: !1,
|
|
1534
1534
|
message: n.maxLength.message
|
|
1535
1535
|
}), s.dirty()), t.common.async)
|
|
1536
|
-
return Promise.all([...t.data].map((i, o) => n.type._parseAsync(new
|
|
1537
|
-
const r = [...t.data].map((i, o) => n.type._parseSync(new
|
|
1536
|
+
return Promise.all([...t.data].map((i, o) => n.type._parseAsync(new E(t, i, t.path, o)))).then((i) => x.mergeArray(s, i));
|
|
1537
|
+
const r = [...t.data].map((i, o) => n.type._parseSync(new E(t, i, t.path, o)));
|
|
1538
1538
|
return x.mergeArray(s, r);
|
|
1539
1539
|
}
|
|
1540
1540
|
get element() {
|
|
1541
1541
|
return this._def.type;
|
|
1542
1542
|
}
|
|
1543
1543
|
min(e, t) {
|
|
1544
|
-
return new
|
|
1544
|
+
return new N({
|
|
1545
1545
|
...this._def,
|
|
1546
1546
|
minLength: { value: e, message: p.toString(t) }
|
|
1547
1547
|
});
|
|
1548
1548
|
}
|
|
1549
1549
|
max(e, t) {
|
|
1550
|
-
return new
|
|
1550
|
+
return new N({
|
|
1551
1551
|
...this._def,
|
|
1552
1552
|
maxLength: { value: e, message: p.toString(t) }
|
|
1553
1553
|
});
|
|
1554
1554
|
}
|
|
1555
1555
|
length(e, t) {
|
|
1556
|
-
return new
|
|
1556
|
+
return new N({
|
|
1557
1557
|
...this._def,
|
|
1558
1558
|
exactLength: { value: e, message: p.toString(t) }
|
|
1559
1559
|
});
|
|
@@ -1562,7 +1562,7 @@ class T extends v {
|
|
|
1562
1562
|
return this.min(1, e);
|
|
1563
1563
|
}
|
|
1564
1564
|
}
|
|
1565
|
-
|
|
1565
|
+
N.create = (a, e) => new N({
|
|
1566
1566
|
type: a,
|
|
1567
1567
|
minLength: null,
|
|
1568
1568
|
maxLength: null,
|
|
@@ -1570,23 +1570,23 @@ T.create = (a, e) => new T({
|
|
|
1570
1570
|
typeName: m.ZodArray,
|
|
1571
1571
|
...y(e)
|
|
1572
1572
|
});
|
|
1573
|
-
function
|
|
1574
|
-
if (a instanceof
|
|
1573
|
+
function q(a) {
|
|
1574
|
+
if (a instanceof Z) {
|
|
1575
1575
|
const e = {};
|
|
1576
1576
|
for (const t in a.shape) {
|
|
1577
1577
|
const s = a.shape[t];
|
|
1578
|
-
e[t] = I.create(
|
|
1578
|
+
e[t] = I.create(q(s));
|
|
1579
1579
|
}
|
|
1580
|
-
return new
|
|
1580
|
+
return new Z({
|
|
1581
1581
|
...a._def,
|
|
1582
1582
|
shape: () => e
|
|
1583
1583
|
});
|
|
1584
|
-
} else return a instanceof
|
|
1584
|
+
} else return a instanceof N ? new N({
|
|
1585
1585
|
...a._def,
|
|
1586
|
-
type:
|
|
1587
|
-
}) : a instanceof I ? I.create(
|
|
1586
|
+
type: q(a.element)
|
|
1587
|
+
}) : a instanceof I ? I.create(q(a.unwrap())) : a instanceof D ? D.create(q(a.unwrap())) : a instanceof F ? F.create(a.items.map((e) => q(e))) : a;
|
|
1588
1588
|
}
|
|
1589
|
-
let
|
|
1589
|
+
let Z = class T extends v {
|
|
1590
1590
|
constructor() {
|
|
1591
1591
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1592
1592
|
}
|
|
@@ -1606,7 +1606,7 @@ let O = class N extends v {
|
|
|
1606
1606
|
}), _;
|
|
1607
1607
|
}
|
|
1608
1608
|
const { status: t, ctx: s } = this._processInputParams(e), { shape: n, keys: r } = this._getCached(), i = [];
|
|
1609
|
-
if (!(this._def.catchall instanceof
|
|
1609
|
+
if (!(this._def.catchall instanceof $ && this._def.unknownKeys === "strip"))
|
|
1610
1610
|
for (const c in s.data)
|
|
1611
1611
|
r.includes(c) || i.push(c);
|
|
1612
1612
|
const o = [];
|
|
@@ -1614,11 +1614,11 @@ let O = class N extends v {
|
|
|
1614
1614
|
const h = n[c], g = s.data[c];
|
|
1615
1615
|
o.push({
|
|
1616
1616
|
key: { status: "valid", value: c },
|
|
1617
|
-
value: h._parse(new
|
|
1617
|
+
value: h._parse(new E(s, g, s.path, c)),
|
|
1618
1618
|
alwaysSet: c in s.data
|
|
1619
1619
|
});
|
|
1620
1620
|
}
|
|
1621
|
-
if (this._def.catchall instanceof
|
|
1621
|
+
if (this._def.catchall instanceof $) {
|
|
1622
1622
|
const c = this._def.unknownKeys;
|
|
1623
1623
|
if (c === "passthrough")
|
|
1624
1624
|
for (const h of i)
|
|
@@ -1639,7 +1639,7 @@ let O = class N extends v {
|
|
|
1639
1639
|
o.push({
|
|
1640
1640
|
key: { status: "valid", value: h },
|
|
1641
1641
|
value: c._parse(
|
|
1642
|
-
new
|
|
1642
|
+
new E(s, g, s.path, h)
|
|
1643
1643
|
//, ctx.child(key), value, getParsedType(value)
|
|
1644
1644
|
),
|
|
1645
1645
|
alwaysSet: h in s.data
|
|
@@ -1663,7 +1663,7 @@ let O = class N extends v {
|
|
|
1663
1663
|
return this._def.shape();
|
|
1664
1664
|
}
|
|
1665
1665
|
strict(e) {
|
|
1666
|
-
return p.errToObj, new
|
|
1666
|
+
return p.errToObj, new T({
|
|
1667
1667
|
...this._def,
|
|
1668
1668
|
unknownKeys: "strict",
|
|
1669
1669
|
...e !== void 0 ? {
|
|
@@ -1680,13 +1680,13 @@ let O = class N extends v {
|
|
|
1680
1680
|
});
|
|
1681
1681
|
}
|
|
1682
1682
|
strip() {
|
|
1683
|
-
return new
|
|
1683
|
+
return new T({
|
|
1684
1684
|
...this._def,
|
|
1685
1685
|
unknownKeys: "strip"
|
|
1686
1686
|
});
|
|
1687
1687
|
}
|
|
1688
1688
|
passthrough() {
|
|
1689
|
-
return new
|
|
1689
|
+
return new T({
|
|
1690
1690
|
...this._def,
|
|
1691
1691
|
unknownKeys: "passthrough"
|
|
1692
1692
|
});
|
|
@@ -1709,7 +1709,7 @@ let O = class N extends v {
|
|
|
1709
1709
|
// }) as any;
|
|
1710
1710
|
// };
|
|
1711
1711
|
extend(e) {
|
|
1712
|
-
return new
|
|
1712
|
+
return new T({
|
|
1713
1713
|
...this._def,
|
|
1714
1714
|
shape: () => ({
|
|
1715
1715
|
...this._def.shape(),
|
|
@@ -1723,7 +1723,7 @@ let O = class N extends v {
|
|
|
1723
1723
|
* upgrade if you are experiencing issues.
|
|
1724
1724
|
*/
|
|
1725
1725
|
merge(e) {
|
|
1726
|
-
return new
|
|
1726
|
+
return new T({
|
|
1727
1727
|
unknownKeys: e._def.unknownKeys,
|
|
1728
1728
|
catchall: e._def.catchall,
|
|
1729
1729
|
shape: () => ({
|
|
@@ -1793,7 +1793,7 @@ let O = class N extends v {
|
|
|
1793
1793
|
// return merged;
|
|
1794
1794
|
// }
|
|
1795
1795
|
catchall(e) {
|
|
1796
|
-
return new
|
|
1796
|
+
return new T({
|
|
1797
1797
|
...this._def,
|
|
1798
1798
|
catchall: e
|
|
1799
1799
|
});
|
|
@@ -1802,7 +1802,7 @@ let O = class N extends v {
|
|
|
1802
1802
|
const t = {};
|
|
1803
1803
|
for (const s of b.objectKeys(e))
|
|
1804
1804
|
e[s] && this.shape[s] && (t[s] = this.shape[s]);
|
|
1805
|
-
return new
|
|
1805
|
+
return new T({
|
|
1806
1806
|
...this._def,
|
|
1807
1807
|
shape: () => t
|
|
1808
1808
|
});
|
|
@@ -1811,7 +1811,7 @@ let O = class N extends v {
|
|
|
1811
1811
|
const t = {};
|
|
1812
1812
|
for (const s of b.objectKeys(this.shape))
|
|
1813
1813
|
e[s] || (t[s] = this.shape[s]);
|
|
1814
|
-
return new
|
|
1814
|
+
return new T({
|
|
1815
1815
|
...this._def,
|
|
1816
1816
|
shape: () => t
|
|
1817
1817
|
});
|
|
@@ -1820,7 +1820,7 @@ let O = class N extends v {
|
|
|
1820
1820
|
* @deprecated
|
|
1821
1821
|
*/
|
|
1822
1822
|
deepPartial() {
|
|
1823
|
-
return
|
|
1823
|
+
return q(this);
|
|
1824
1824
|
}
|
|
1825
1825
|
partial(e) {
|
|
1826
1826
|
const t = {};
|
|
@@ -1828,7 +1828,7 @@ let O = class N extends v {
|
|
|
1828
1828
|
const n = this.shape[s];
|
|
1829
1829
|
e && !e[s] ? t[s] = n : t[s] = n.optional();
|
|
1830
1830
|
}
|
|
1831
|
-
return new
|
|
1831
|
+
return new T({
|
|
1832
1832
|
...this._def,
|
|
1833
1833
|
shape: () => t
|
|
1834
1834
|
});
|
|
@@ -1844,37 +1844,37 @@ let O = class N extends v {
|
|
|
1844
1844
|
n = n._def.innerType;
|
|
1845
1845
|
t[s] = n;
|
|
1846
1846
|
}
|
|
1847
|
-
return new
|
|
1847
|
+
return new T({
|
|
1848
1848
|
...this._def,
|
|
1849
1849
|
shape: () => t
|
|
1850
1850
|
});
|
|
1851
1851
|
}
|
|
1852
1852
|
keyof() {
|
|
1853
|
-
return
|
|
1853
|
+
return qe(b.objectKeys(this.shape));
|
|
1854
1854
|
}
|
|
1855
1855
|
};
|
|
1856
|
-
|
|
1856
|
+
Z.create = (a, e) => new Z({
|
|
1857
1857
|
shape: () => a,
|
|
1858
1858
|
unknownKeys: "strip",
|
|
1859
|
-
catchall:
|
|
1859
|
+
catchall: $.create(),
|
|
1860
1860
|
typeName: m.ZodObject,
|
|
1861
1861
|
...y(e)
|
|
1862
1862
|
});
|
|
1863
|
-
|
|
1863
|
+
Z.strictCreate = (a, e) => new Z({
|
|
1864
1864
|
shape: () => a,
|
|
1865
1865
|
unknownKeys: "strict",
|
|
1866
|
-
catchall:
|
|
1866
|
+
catchall: $.create(),
|
|
1867
1867
|
typeName: m.ZodObject,
|
|
1868
1868
|
...y(e)
|
|
1869
1869
|
});
|
|
1870
|
-
|
|
1870
|
+
Z.lazycreate = (a, e) => new Z({
|
|
1871
1871
|
shape: a,
|
|
1872
1872
|
unknownKeys: "strip",
|
|
1873
|
-
catchall:
|
|
1873
|
+
catchall: $.create(),
|
|
1874
1874
|
typeName: m.ZodObject,
|
|
1875
1875
|
...y(e)
|
|
1876
1876
|
});
|
|
1877
|
-
let
|
|
1877
|
+
let Y = class extends v {
|
|
1878
1878
|
_parse(e) {
|
|
1879
1879
|
const { ctx: t } = this._processInputParams(e), s = this._def.options;
|
|
1880
1880
|
function n(r) {
|
|
@@ -1884,7 +1884,7 @@ let X = class extends v {
|
|
|
1884
1884
|
for (const o of r)
|
|
1885
1885
|
if (o.result.status === "dirty")
|
|
1886
1886
|
return t.common.issues.push(...o.ctx.common.issues), o.result;
|
|
1887
|
-
const i = r.map((o) => new
|
|
1887
|
+
const i = r.map((o) => new O(o.ctx.common.issues));
|
|
1888
1888
|
return d(t, {
|
|
1889
1889
|
code: u.invalid_union,
|
|
1890
1890
|
unionErrors: i
|
|
@@ -1931,7 +1931,7 @@ let X = class extends v {
|
|
|
1931
1931
|
}
|
|
1932
1932
|
if (r)
|
|
1933
1933
|
return t.common.issues.push(...r.ctx.common.issues), r.result;
|
|
1934
|
-
const o = i.map((c) => new
|
|
1934
|
+
const o = i.map((c) => new O(c));
|
|
1935
1935
|
return d(t, {
|
|
1936
1936
|
code: u.invalid_union,
|
|
1937
1937
|
unionErrors: o
|
|
@@ -1942,19 +1942,19 @@ let X = class extends v {
|
|
|
1942
1942
|
return this._def.options;
|
|
1943
1943
|
}
|
|
1944
1944
|
};
|
|
1945
|
-
|
|
1945
|
+
Y.create = (a, e) => new Y({
|
|
1946
1946
|
options: a,
|
|
1947
1947
|
typeName: m.ZodUnion,
|
|
1948
1948
|
...y(e)
|
|
1949
1949
|
});
|
|
1950
|
-
function
|
|
1950
|
+
function ue(a, e) {
|
|
1951
1951
|
const t = A(a), s = A(e);
|
|
1952
1952
|
if (a === e)
|
|
1953
1953
|
return { valid: !0, data: a };
|
|
1954
1954
|
if (t === l.object && s === l.object) {
|
|
1955
1955
|
const n = b.objectKeys(e), r = b.objectKeys(a).filter((o) => n.indexOf(o) !== -1), i = { ...a, ...e };
|
|
1956
1956
|
for (const o of r) {
|
|
1957
|
-
const c =
|
|
1957
|
+
const c = ue(a[o], e[o]);
|
|
1958
1958
|
if (!c.valid)
|
|
1959
1959
|
return { valid: !1 };
|
|
1960
1960
|
i[o] = c.data;
|
|
@@ -1965,7 +1965,7 @@ function ce(a, e) {
|
|
|
1965
1965
|
return { valid: !1 };
|
|
1966
1966
|
const n = [];
|
|
1967
1967
|
for (let r = 0; r < a.length; r++) {
|
|
1968
|
-
const i = a[r], o = e[r], c =
|
|
1968
|
+
const i = a[r], o = e[r], c = ue(i, o);
|
|
1969
1969
|
if (!c.valid)
|
|
1970
1970
|
return { valid: !1 };
|
|
1971
1971
|
n.push(c.data);
|
|
@@ -1973,13 +1973,13 @@ function ce(a, e) {
|
|
|
1973
1973
|
return { valid: !0, data: n };
|
|
1974
1974
|
} else return t === l.date && s === l.date && +a == +e ? { valid: !0, data: a } : { valid: !1 };
|
|
1975
1975
|
}
|
|
1976
|
-
let
|
|
1976
|
+
let X = class extends v {
|
|
1977
1977
|
_parse(e) {
|
|
1978
1978
|
const { status: t, ctx: s } = this._processInputParams(e), n = (r, i) => {
|
|
1979
|
-
if (
|
|
1979
|
+
if (ve(r) || ve(i))
|
|
1980
1980
|
return _;
|
|
1981
|
-
const o =
|
|
1982
|
-
return o.valid ? ((
|
|
1981
|
+
const o = ue(r.value, i.value);
|
|
1982
|
+
return o.valid ? ((be(r) || be(i)) && t.dirty(), { status: t.value, value: o.data }) : (d(s, {
|
|
1983
1983
|
code: u.invalid_intersection_types
|
|
1984
1984
|
}), _);
|
|
1985
1985
|
};
|
|
@@ -2005,13 +2005,13 @@ let ee = class extends v {
|
|
|
2005
2005
|
}));
|
|
2006
2006
|
}
|
|
2007
2007
|
};
|
|
2008
|
-
|
|
2008
|
+
X.create = (a, e, t) => new X({
|
|
2009
2009
|
left: a,
|
|
2010
2010
|
right: e,
|
|
2011
2011
|
typeName: m.ZodIntersection,
|
|
2012
2012
|
...y(t)
|
|
2013
2013
|
});
|
|
2014
|
-
class
|
|
2014
|
+
class F extends v {
|
|
2015
2015
|
_parse(e) {
|
|
2016
2016
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2017
2017
|
if (s.parsedType !== l.array)
|
|
@@ -2037,7 +2037,7 @@ class q extends v {
|
|
|
2037
2037
|
}), t.dirty());
|
|
2038
2038
|
const n = [...s.data].map((r, i) => {
|
|
2039
2039
|
const o = this._def.items[i] || this._def.rest;
|
|
2040
|
-
return o ? o._parse(new
|
|
2040
|
+
return o ? o._parse(new E(s, r, s.path, i)) : null;
|
|
2041
2041
|
}).filter((r) => !!r);
|
|
2042
2042
|
return s.common.async ? Promise.all(n).then((r) => x.mergeArray(t, r)) : x.mergeArray(t, n);
|
|
2043
2043
|
}
|
|
@@ -2045,23 +2045,23 @@ class q extends v {
|
|
|
2045
2045
|
return this._def.items;
|
|
2046
2046
|
}
|
|
2047
2047
|
rest(e) {
|
|
2048
|
-
return new
|
|
2048
|
+
return new F({
|
|
2049
2049
|
...this._def,
|
|
2050
2050
|
rest: e
|
|
2051
2051
|
});
|
|
2052
2052
|
}
|
|
2053
2053
|
}
|
|
2054
|
-
|
|
2054
|
+
F.create = (a, e) => {
|
|
2055
2055
|
if (!Array.isArray(a))
|
|
2056
2056
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2057
|
-
return new
|
|
2057
|
+
return new F({
|
|
2058
2058
|
items: a,
|
|
2059
2059
|
typeName: m.ZodTuple,
|
|
2060
2060
|
rest: null,
|
|
2061
2061
|
...y(e)
|
|
2062
2062
|
});
|
|
2063
2063
|
};
|
|
2064
|
-
class
|
|
2064
|
+
class Ie extends v {
|
|
2065
2065
|
get keySchema() {
|
|
2066
2066
|
return this._def.keyType;
|
|
2067
2067
|
}
|
|
@@ -2077,8 +2077,8 @@ class Oe extends v {
|
|
|
2077
2077
|
received: s.parsedType
|
|
2078
2078
|
}), _;
|
|
2079
2079
|
const n = this._def.keyType, r = this._def.valueType, i = [...s.data.entries()].map(([o, c], h) => ({
|
|
2080
|
-
key: n._parse(new
|
|
2081
|
-
value: r._parse(new
|
|
2080
|
+
key: n._parse(new E(s, o, s.path, [h, "key"])),
|
|
2081
|
+
value: r._parse(new E(s, c, s.path, [h, "value"]))
|
|
2082
2082
|
}));
|
|
2083
2083
|
if (s.common.async) {
|
|
2084
2084
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -2103,13 +2103,13 @@ class Oe extends v {
|
|
|
2103
2103
|
}
|
|
2104
2104
|
}
|
|
2105
2105
|
}
|
|
2106
|
-
|
|
2106
|
+
Ie.create = (a, e, t) => new Ie({
|
|
2107
2107
|
valueType: e,
|
|
2108
2108
|
keyType: a,
|
|
2109
2109
|
typeName: m.ZodMap,
|
|
2110
2110
|
...y(t)
|
|
2111
2111
|
});
|
|
2112
|
-
class
|
|
2112
|
+
class U extends v {
|
|
2113
2113
|
_parse(e) {
|
|
2114
2114
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2115
2115
|
if (s.parsedType !== l.set)
|
|
@@ -2144,17 +2144,17 @@ class K extends v {
|
|
|
2144
2144
|
}
|
|
2145
2145
|
return { status: t.value, value: h };
|
|
2146
2146
|
}
|
|
2147
|
-
const o = [...s.data.values()].map((c, h) => r._parse(new
|
|
2147
|
+
const o = [...s.data.values()].map((c, h) => r._parse(new E(s, c, s.path, h)));
|
|
2148
2148
|
return s.common.async ? Promise.all(o).then((c) => i(c)) : i(o);
|
|
2149
2149
|
}
|
|
2150
2150
|
min(e, t) {
|
|
2151
|
-
return new
|
|
2151
|
+
return new U({
|
|
2152
2152
|
...this._def,
|
|
2153
2153
|
minSize: { value: e, message: p.toString(t) }
|
|
2154
2154
|
});
|
|
2155
2155
|
}
|
|
2156
2156
|
max(e, t) {
|
|
2157
|
-
return new
|
|
2157
|
+
return new U({
|
|
2158
2158
|
...this._def,
|
|
2159
2159
|
maxSize: { value: e, message: p.toString(t) }
|
|
2160
2160
|
});
|
|
@@ -2166,14 +2166,14 @@ class K extends v {
|
|
|
2166
2166
|
return this.min(1, e);
|
|
2167
2167
|
}
|
|
2168
2168
|
}
|
|
2169
|
-
|
|
2169
|
+
U.create = (a, e) => new U({
|
|
2170
2170
|
valueType: a,
|
|
2171
2171
|
minSize: null,
|
|
2172
2172
|
maxSize: null,
|
|
2173
2173
|
typeName: m.ZodSet,
|
|
2174
2174
|
...y(e)
|
|
2175
2175
|
});
|
|
2176
|
-
class
|
|
2176
|
+
class Ee extends v {
|
|
2177
2177
|
get schema() {
|
|
2178
2178
|
return this._def.getter();
|
|
2179
2179
|
}
|
|
@@ -2182,12 +2182,12 @@ class Ae extends v {
|
|
|
2182
2182
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
2183
2183
|
}
|
|
2184
2184
|
}
|
|
2185
|
-
|
|
2185
|
+
Ee.create = (a, e) => new Ee({
|
|
2186
2186
|
getter: a,
|
|
2187
2187
|
typeName: m.ZodLazy,
|
|
2188
2188
|
...y(e)
|
|
2189
2189
|
});
|
|
2190
|
-
let
|
|
2190
|
+
let de = class extends v {
|
|
2191
2191
|
_parse(e) {
|
|
2192
2192
|
if (e.data !== this._def.value) {
|
|
2193
2193
|
const t = this._getOrReturnCtx(e);
|
|
@@ -2203,19 +2203,19 @@ let ue = class extends v {
|
|
|
2203
2203
|
return this._def.value;
|
|
2204
2204
|
}
|
|
2205
2205
|
};
|
|
2206
|
-
|
|
2206
|
+
de.create = (a, e) => new de({
|
|
2207
2207
|
value: a,
|
|
2208
2208
|
typeName: m.ZodLiteral,
|
|
2209
2209
|
...y(e)
|
|
2210
2210
|
});
|
|
2211
|
-
function
|
|
2212
|
-
return new
|
|
2211
|
+
function qe(a, e) {
|
|
2212
|
+
return new me({
|
|
2213
2213
|
values: a,
|
|
2214
2214
|
typeName: m.ZodEnum,
|
|
2215
2215
|
...y(e)
|
|
2216
2216
|
});
|
|
2217
2217
|
}
|
|
2218
|
-
let
|
|
2218
|
+
let me = class le extends v {
|
|
2219
2219
|
_parse(e) {
|
|
2220
2220
|
if (typeof e.data != "string") {
|
|
2221
2221
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
@@ -2257,20 +2257,20 @@ let fe = class de extends v {
|
|
|
2257
2257
|
return e;
|
|
2258
2258
|
}
|
|
2259
2259
|
extract(e, t = this._def) {
|
|
2260
|
-
return
|
|
2260
|
+
return le.create(e, {
|
|
2261
2261
|
...this._def,
|
|
2262
2262
|
...t
|
|
2263
2263
|
});
|
|
2264
2264
|
}
|
|
2265
2265
|
exclude(e, t = this._def) {
|
|
2266
|
-
return
|
|
2266
|
+
return le.create(this.options.filter((s) => !e.includes(s)), {
|
|
2267
2267
|
...this._def,
|
|
2268
2268
|
...t
|
|
2269
2269
|
});
|
|
2270
2270
|
}
|
|
2271
2271
|
};
|
|
2272
|
-
|
|
2273
|
-
class
|
|
2272
|
+
me.create = qe;
|
|
2273
|
+
class $e extends v {
|
|
2274
2274
|
_parse(e) {
|
|
2275
2275
|
const t = b.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
2276
2276
|
if (s.parsedType !== l.string && s.parsedType !== l.number) {
|
|
@@ -2295,12 +2295,12 @@ class Ee extends v {
|
|
|
2295
2295
|
return this._def.values;
|
|
2296
2296
|
}
|
|
2297
2297
|
}
|
|
2298
|
-
|
|
2298
|
+
$e.create = (a, e) => new $e({
|
|
2299
2299
|
values: a,
|
|
2300
2300
|
typeName: m.ZodNativeEnum,
|
|
2301
2301
|
...y(e)
|
|
2302
2302
|
});
|
|
2303
|
-
let
|
|
2303
|
+
let ee = class extends v {
|
|
2304
2304
|
unwrap() {
|
|
2305
2305
|
return this._def.type;
|
|
2306
2306
|
}
|
|
@@ -2319,12 +2319,12 @@ let te = class extends v {
|
|
|
2319
2319
|
})));
|
|
2320
2320
|
}
|
|
2321
2321
|
};
|
|
2322
|
-
|
|
2322
|
+
ee.create = (a, e) => new ee({
|
|
2323
2323
|
type: a,
|
|
2324
2324
|
typeName: m.ZodPromise,
|
|
2325
2325
|
...y(e)
|
|
2326
2326
|
});
|
|
2327
|
-
|
|
2327
|
+
class L extends v {
|
|
2328
2328
|
innerType() {
|
|
2329
2329
|
return this._def.schema;
|
|
2330
2330
|
}
|
|
@@ -2351,7 +2351,7 @@ let D = class extends v {
|
|
|
2351
2351
|
path: s.path,
|
|
2352
2352
|
parent: s
|
|
2353
2353
|
});
|
|
2354
|
-
return c.status === "aborted" ? _ : c.status === "dirty" || t.value === "dirty" ?
|
|
2354
|
+
return c.status === "aborted" ? _ : c.status === "dirty" || t.value === "dirty" ? ae(c.value) : c;
|
|
2355
2355
|
});
|
|
2356
2356
|
{
|
|
2357
2357
|
if (t.value === "aborted")
|
|
@@ -2361,7 +2361,7 @@ let D = class extends v {
|
|
|
2361
2361
|
path: s.path,
|
|
2362
2362
|
parent: s
|
|
2363
2363
|
});
|
|
2364
|
-
return o.status === "aborted" ? _ : o.status === "dirty" || t.value === "dirty" ?
|
|
2364
|
+
return o.status === "aborted" ? _ : o.status === "dirty" || t.value === "dirty" ? ae(o.value) : o;
|
|
2365
2365
|
}
|
|
2366
2366
|
}
|
|
2367
2367
|
if (n.type === "refinement") {
|
|
@@ -2390,27 +2390,27 @@ let D = class extends v {
|
|
|
2390
2390
|
path: s.path,
|
|
2391
2391
|
parent: s
|
|
2392
2392
|
});
|
|
2393
|
-
if (!
|
|
2393
|
+
if (!M(i))
|
|
2394
2394
|
return _;
|
|
2395
2395
|
const o = n.transform(i.value, r);
|
|
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: s.data, path: s.path, parent: s }).then((i) =>
|
|
2400
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => M(i) ? Promise.resolve(n.transform(i.value, r)).then((o) => ({
|
|
2401
2401
|
status: t.value,
|
|
2402
2402
|
value: o
|
|
2403
2403
|
})) : _);
|
|
2404
2404
|
b.assertNever(n);
|
|
2405
2405
|
}
|
|
2406
|
-
}
|
|
2407
|
-
|
|
2406
|
+
}
|
|
2407
|
+
L.create = (a, e, t) => new L({
|
|
2408
2408
|
schema: a,
|
|
2409
2409
|
typeName: m.ZodEffects,
|
|
2410
2410
|
effect: e,
|
|
2411
2411
|
...y(t)
|
|
2412
2412
|
});
|
|
2413
|
-
|
|
2413
|
+
L.createWithPreprocess = (a, e, t) => new L({
|
|
2414
2414
|
schema: e,
|
|
2415
2415
|
effect: { type: "preprocess", transform: a },
|
|
2416
2416
|
typeName: m.ZodEffects,
|
|
@@ -2429,7 +2429,7 @@ I.create = (a, e) => new I({
|
|
|
2429
2429
|
typeName: m.ZodOptional,
|
|
2430
2430
|
...y(e)
|
|
2431
2431
|
});
|
|
2432
|
-
let
|
|
2432
|
+
let D = class extends v {
|
|
2433
2433
|
_parse(e) {
|
|
2434
2434
|
return this._getType(e) === l.null ? S(null) : this._def.innerType._parse(e);
|
|
2435
2435
|
}
|
|
@@ -2437,12 +2437,12 @@ let H = class extends v {
|
|
|
2437
2437
|
return this._def.innerType;
|
|
2438
2438
|
}
|
|
2439
2439
|
};
|
|
2440
|
-
|
|
2440
|
+
D.create = (a, e) => new D({
|
|
2441
2441
|
innerType: a,
|
|
2442
2442
|
typeName: m.ZodNullable,
|
|
2443
2443
|
...y(e)
|
|
2444
2444
|
});
|
|
2445
|
-
let
|
|
2445
|
+
let he = class extends v {
|
|
2446
2446
|
_parse(e) {
|
|
2447
2447
|
const { ctx: t } = this._processInputParams(e);
|
|
2448
2448
|
let s = t.data;
|
|
@@ -2456,13 +2456,13 @@ let le = class extends v {
|
|
|
2456
2456
|
return this._def.innerType;
|
|
2457
2457
|
}
|
|
2458
2458
|
};
|
|
2459
|
-
|
|
2459
|
+
he.create = (a, e) => new he({
|
|
2460
2460
|
innerType: a,
|
|
2461
2461
|
typeName: m.ZodDefault,
|
|
2462
2462
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2463
2463
|
...y(e)
|
|
2464
2464
|
});
|
|
2465
|
-
class
|
|
2465
|
+
class pe extends v {
|
|
2466
2466
|
_parse(e) {
|
|
2467
2467
|
const { ctx: t } = this._processInputParams(e), s = {
|
|
2468
2468
|
...t,
|
|
@@ -2477,11 +2477,11 @@ class he extends v {
|
|
|
2477
2477
|
...s
|
|
2478
2478
|
}
|
|
2479
2479
|
});
|
|
2480
|
-
return
|
|
2480
|
+
return G(n) ? n.then((r) => ({
|
|
2481
2481
|
status: "valid",
|
|
2482
2482
|
value: r.status === "valid" ? r.value : this._def.catchValue({
|
|
2483
2483
|
get error() {
|
|
2484
|
-
return new
|
|
2484
|
+
return new O(s.common.issues);
|
|
2485
2485
|
},
|
|
2486
2486
|
input: s.data
|
|
2487
2487
|
})
|
|
@@ -2489,7 +2489,7 @@ class he extends v {
|
|
|
2489
2489
|
status: "valid",
|
|
2490
2490
|
value: n.status === "valid" ? n.value : this._def.catchValue({
|
|
2491
2491
|
get error() {
|
|
2492
|
-
return new
|
|
2492
|
+
return new O(s.common.issues);
|
|
2493
2493
|
},
|
|
2494
2494
|
input: s.data
|
|
2495
2495
|
})
|
|
@@ -2499,13 +2499,13 @@ class he extends v {
|
|
|
2499
2499
|
return this._def.innerType;
|
|
2500
2500
|
}
|
|
2501
2501
|
}
|
|
2502
|
-
|
|
2502
|
+
pe.create = (a, e) => new pe({
|
|
2503
2503
|
innerType: a,
|
|
2504
2504
|
typeName: m.ZodCatch,
|
|
2505
2505
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2506
2506
|
...y(e)
|
|
2507
2507
|
});
|
|
2508
|
-
class
|
|
2508
|
+
class je extends v {
|
|
2509
2509
|
_parse(e) {
|
|
2510
2510
|
if (this._getType(e) !== l.nan) {
|
|
2511
2511
|
const t = this._getOrReturnCtx(e);
|
|
@@ -2518,11 +2518,11 @@ class Ie extends v {
|
|
|
2518
2518
|
return { status: "valid", value: e.data };
|
|
2519
2519
|
}
|
|
2520
2520
|
}
|
|
2521
|
-
|
|
2521
|
+
je.create = (a) => new je({
|
|
2522
2522
|
typeName: m.ZodNaN,
|
|
2523
2523
|
...y(a)
|
|
2524
2524
|
});
|
|
2525
|
-
class
|
|
2525
|
+
class dt extends v {
|
|
2526
2526
|
_parse(e) {
|
|
2527
2527
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
2528
2528
|
return this._def.type._parse({
|
|
@@ -2535,7 +2535,7 @@ class ct extends v {
|
|
|
2535
2535
|
return this._def.type;
|
|
2536
2536
|
}
|
|
2537
2537
|
}
|
|
2538
|
-
class
|
|
2538
|
+
class _e extends v {
|
|
2539
2539
|
_parse(e) {
|
|
2540
2540
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2541
2541
|
if (s.common.async)
|
|
@@ -2545,7 +2545,7 @@ class me extends v {
|
|
|
2545
2545
|
path: s.path,
|
|
2546
2546
|
parent: s
|
|
2547
2547
|
});
|
|
2548
|
-
return n.status === "aborted" ? _ : n.status === "dirty" ? (t.dirty(),
|
|
2548
|
+
return n.status === "aborted" ? _ : n.status === "dirty" ? (t.dirty(), ae(n.value)) : this._def.out._parseAsync({
|
|
2549
2549
|
data: n.value,
|
|
2550
2550
|
path: s.path,
|
|
2551
2551
|
parent: s
|
|
@@ -2568,23 +2568,23 @@ class me extends v {
|
|
|
2568
2568
|
}
|
|
2569
2569
|
}
|
|
2570
2570
|
static create(e, t) {
|
|
2571
|
-
return new
|
|
2571
|
+
return new _e({
|
|
2572
2572
|
in: e,
|
|
2573
2573
|
out: t,
|
|
2574
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), s = (n) => (
|
|
2581
|
-
return
|
|
2580
|
+
const t = this._def.innerType._parse(e), s = (n) => (M(n) && (n.value = Object.freeze(n.value)), n);
|
|
2581
|
+
return G(t) ? t.then((n) => s(n)) : s(t);
|
|
2582
2582
|
}
|
|
2583
2583
|
unwrap() {
|
|
2584
2584
|
return this._def.innerType;
|
|
2585
2585
|
}
|
|
2586
|
-
}
|
|
2587
|
-
|
|
2586
|
+
}
|
|
2587
|
+
fe.create = (a, e) => new fe({
|
|
2588
2588
|
innerType: a,
|
|
2589
2589
|
typeName: m.ZodReadonly,
|
|
2590
2590
|
...y(e)
|
|
@@ -2593,22 +2593,22 @@ var m;
|
|
|
2593
2593
|
(function(a) {
|
|
2594
2594
|
a.ZodString = "ZodString", a.ZodNumber = "ZodNumber", a.ZodNaN = "ZodNaN", a.ZodBigInt = "ZodBigInt", a.ZodBoolean = "ZodBoolean", a.ZodDate = "ZodDate", a.ZodSymbol = "ZodSymbol", a.ZodUndefined = "ZodUndefined", a.ZodNull = "ZodNull", a.ZodAny = "ZodAny", a.ZodUnknown = "ZodUnknown", a.ZodNever = "ZodNever", a.ZodVoid = "ZodVoid", a.ZodArray = "ZodArray", a.ZodObject = "ZodObject", a.ZodUnion = "ZodUnion", a.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", a.ZodIntersection = "ZodIntersection", a.ZodTuple = "ZodTuple", a.ZodRecord = "ZodRecord", a.ZodMap = "ZodMap", a.ZodSet = "ZodSet", a.ZodFunction = "ZodFunction", a.ZodLazy = "ZodLazy", a.ZodLiteral = "ZodLiteral", a.ZodEnum = "ZodEnum", a.ZodEffects = "ZodEffects", a.ZodNativeEnum = "ZodNativeEnum", a.ZodOptional = "ZodOptional", a.ZodNullable = "ZodNullable", a.ZodDefault = "ZodDefault", a.ZodCatch = "ZodCatch", a.ZodPromise = "ZodPromise", a.ZodBranded = "ZodBranded", a.ZodPipeline = "ZodPipeline", a.ZodReadonly = "ZodReadonly";
|
|
2595
2595
|
})(m || (m = {}));
|
|
2596
|
-
const
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
const
|
|
2596
|
+
const lt = ie.create, ht = ce.create;
|
|
2597
|
+
$.create;
|
|
2598
|
+
N.create;
|
|
2599
|
+
const pt = Z.create;
|
|
2600
|
+
Y.create;
|
|
2600
2601
|
X.create;
|
|
2602
|
+
F.create;
|
|
2603
|
+
const ft = de.create;
|
|
2604
|
+
me.create;
|
|
2601
2605
|
ee.create;
|
|
2602
|
-
q.create;
|
|
2603
|
-
const ht = ue.create;
|
|
2604
|
-
fe.create;
|
|
2605
|
-
te.create;
|
|
2606
2606
|
I.create;
|
|
2607
|
-
|
|
2608
|
-
const
|
|
2609
|
-
version:
|
|
2607
|
+
D.create;
|
|
2608
|
+
const mt = "1.13.2", _t = {
|
|
2609
|
+
version: mt
|
|
2610
2610
|
};
|
|
2611
|
-
class
|
|
2611
|
+
class gt {
|
|
2612
2612
|
constructor(e) {
|
|
2613
2613
|
this._client = e;
|
|
2614
2614
|
}
|
|
@@ -2627,7 +2627,7 @@ class mt {
|
|
|
2627
2627
|
return e.account;
|
|
2628
2628
|
}
|
|
2629
2629
|
}
|
|
2630
|
-
class
|
|
2630
|
+
class yt {
|
|
2631
2631
|
constructor(e) {
|
|
2632
2632
|
this._client = e;
|
|
2633
2633
|
}
|
|
@@ -2722,7 +2722,7 @@ class _t {
|
|
|
2722
2722
|
this._client._messageInterceptors.set(e, t);
|
|
2723
2723
|
}
|
|
2724
2724
|
}
|
|
2725
|
-
class
|
|
2725
|
+
class vt {
|
|
2726
2726
|
constructor(e) {
|
|
2727
2727
|
this._client = e;
|
|
2728
2728
|
}
|
|
@@ -2766,7 +2766,7 @@ class gt {
|
|
|
2766
2766
|
return e.capabilities;
|
|
2767
2767
|
}
|
|
2768
2768
|
}
|
|
2769
|
-
class
|
|
2769
|
+
class bt {
|
|
2770
2770
|
constructor(e) {
|
|
2771
2771
|
this._client = e;
|
|
2772
2772
|
}
|
|
@@ -2780,7 +2780,7 @@ class yt {
|
|
|
2780
2780
|
return (await this._client.unsubscribe("environment.unsubscribeColorScheme", {}, e)).success;
|
|
2781
2781
|
}
|
|
2782
2782
|
}
|
|
2783
|
-
class
|
|
2783
|
+
class wt {
|
|
2784
2784
|
constructor(e) {
|
|
2785
2785
|
this._client = e;
|
|
2786
2786
|
}
|
|
@@ -2839,7 +2839,7 @@ class vt {
|
|
|
2839
2839
|
})).selection;
|
|
2840
2840
|
}
|
|
2841
2841
|
}
|
|
2842
|
-
class
|
|
2842
|
+
class kt {
|
|
2843
2843
|
constructor(e) {
|
|
2844
2844
|
this._client = e;
|
|
2845
2845
|
}
|
|
@@ -2888,7 +2888,7 @@ class bt {
|
|
|
2888
2888
|
return new Response(h, c);
|
|
2889
2889
|
}
|
|
2890
2890
|
}
|
|
2891
|
-
class
|
|
2891
|
+
class xt {
|
|
2892
2892
|
constructor(e) {
|
|
2893
2893
|
this._client = e;
|
|
2894
2894
|
}
|
|
@@ -2902,7 +2902,7 @@ class wt {
|
|
|
2902
2902
|
* @returns A StoreSlice instance for the application scope
|
|
2903
2903
|
*/
|
|
2904
2904
|
get application() {
|
|
2905
|
-
return new
|
|
2905
|
+
return new K("application", void 0, this._client);
|
|
2906
2906
|
}
|
|
2907
2907
|
/**
|
|
2908
2908
|
* Provides access to the instance store scope.
|
|
@@ -2911,12 +2911,10 @@ class wt {
|
|
|
2911
2911
|
* application. This is ideal for instance-specific settings, UI state, temporary data,
|
|
2912
2912
|
* or any information that shouldn't be shared with other instances.
|
|
2913
2913
|
*
|
|
2914
|
-
* The namespace for instance data includes both the application name and the instance ID.
|
|
2915
|
-
*
|
|
2916
2914
|
* @returns A StoreSlice instance for the instance scope
|
|
2917
2915
|
*/
|
|
2918
2916
|
get instance() {
|
|
2919
|
-
return new
|
|
2917
|
+
return new K("instance", this._client.applicationInstance, this._client);
|
|
2920
2918
|
}
|
|
2921
2919
|
/**
|
|
2922
2920
|
* Provides access to the device store scope.
|
|
@@ -2931,7 +2929,7 @@ class wt {
|
|
|
2931
2929
|
* @returns A StoreSlice instance for the device scope
|
|
2932
2930
|
*/
|
|
2933
2931
|
get device() {
|
|
2934
|
-
return new
|
|
2932
|
+
return new K("device", this._client.deviceId, this._client);
|
|
2935
2933
|
}
|
|
2936
2934
|
/**
|
|
2937
2935
|
* Provides access to the shared store scope with a specified namespace.
|
|
@@ -2947,10 +2945,10 @@ class wt {
|
|
|
2947
2945
|
* @returns A StoreSlice instance for the specified shared namespace
|
|
2948
2946
|
*/
|
|
2949
2947
|
shared(e) {
|
|
2950
|
-
return new
|
|
2948
|
+
return new K("shared", e, this._client);
|
|
2951
2949
|
}
|
|
2952
2950
|
}
|
|
2953
|
-
class
|
|
2951
|
+
class K {
|
|
2954
2952
|
constructor(e, t, s) {
|
|
2955
2953
|
this._kind = e, this._namespace = t, this._client = s;
|
|
2956
2954
|
}
|
|
@@ -3044,7 +3042,7 @@ class W {
|
|
|
3044
3042
|
})).success;
|
|
3045
3043
|
}
|
|
3046
3044
|
}
|
|
3047
|
-
class
|
|
3045
|
+
class St {
|
|
3048
3046
|
constructor(e) {
|
|
3049
3047
|
this._client = e;
|
|
3050
3048
|
}
|
|
@@ -3067,7 +3065,7 @@ class kt {
|
|
|
3067
3065
|
return e.user;
|
|
3068
3066
|
}
|
|
3069
3067
|
}
|
|
3070
|
-
class
|
|
3068
|
+
class Ct {
|
|
3071
3069
|
constructor(e) {
|
|
3072
3070
|
this._client = e;
|
|
3073
3071
|
}
|
|
@@ -3210,7 +3208,7 @@ class xt {
|
|
|
3210
3208
|
return t;
|
|
3211
3209
|
}
|
|
3212
3210
|
}
|
|
3213
|
-
class
|
|
3211
|
+
class Tt {
|
|
3214
3212
|
constructor(e) {
|
|
3215
3213
|
this._client = e;
|
|
3216
3214
|
}
|
|
@@ -3257,7 +3255,7 @@ class St {
|
|
|
3257
3255
|
return r.rates;
|
|
3258
3256
|
}
|
|
3259
3257
|
}
|
|
3260
|
-
class
|
|
3258
|
+
class Nt {
|
|
3261
3259
|
constructor(e) {
|
|
3262
3260
|
this._client = e;
|
|
3263
3261
|
}
|
|
@@ -3321,7 +3319,7 @@ class Ct {
|
|
|
3321
3319
|
}, t)).success;
|
|
3322
3320
|
}
|
|
3323
3321
|
}
|
|
3324
|
-
class
|
|
3322
|
+
class Ot {
|
|
3325
3323
|
constructor(e) {
|
|
3326
3324
|
this._originalPushState = null, this._originalReplaceState = null, this._popstateHandler = null, this._backHandler = null, this._forwardHandler = null, this._client = e;
|
|
3327
3325
|
}
|
|
@@ -3341,15 +3339,15 @@ class Nt {
|
|
|
3341
3339
|
});
|
|
3342
3340
|
}
|
|
3343
3341
|
}
|
|
3344
|
-
function
|
|
3342
|
+
function W(a) {
|
|
3345
3343
|
return { ...a, type: "client" };
|
|
3346
3344
|
}
|
|
3347
|
-
const
|
|
3348
|
-
type:
|
|
3349
|
-
name:
|
|
3350
|
-
data:
|
|
3345
|
+
const Zt = pt({
|
|
3346
|
+
type: ft("bridge"),
|
|
3347
|
+
name: lt(),
|
|
3348
|
+
data: ht()
|
|
3351
3349
|
});
|
|
3352
|
-
class
|
|
3350
|
+
class At {
|
|
3353
3351
|
/**
|
|
3354
3352
|
* Creates a new RootSettingsNavigation API instance.
|
|
3355
3353
|
*
|
|
@@ -3406,23 +3404,20 @@ class Zt {
|
|
|
3406
3404
|
return (e = await this._store.shared("root-settings-navigation").get("navigation")) !== null && e !== void 0 ? e : {};
|
|
3407
3405
|
}
|
|
3408
3406
|
}
|
|
3409
|
-
const
|
|
3407
|
+
const H = 1e3 * 30, ge = typeof window > "u" && typeof self < "u", B = ge ? self : window;
|
|
3410
3408
|
function z(a) {
|
|
3411
|
-
|
|
3409
|
+
ge ? self.postMessage(a) : B.parent.postMessage(a, "*");
|
|
3412
3410
|
}
|
|
3413
|
-
class
|
|
3411
|
+
class It {
|
|
3414
3412
|
/**
|
|
3415
3413
|
* Creates a new Client instance for communicating with the TelemetryOS platform.
|
|
3416
3414
|
*
|
|
3417
3415
|
* Note that creating a Client instance alone is not sufficient to begin communication.
|
|
3418
3416
|
* You must also call the bind() method to initialize event listeners and extract
|
|
3419
3417
|
* the application ID from the URL.
|
|
3420
|
-
*
|
|
3421
|
-
* @param applicationName The name of your application - must match the 'name' property
|
|
3422
|
-
* in your application's telemetry.config.json file
|
|
3423
3418
|
*/
|
|
3424
|
-
constructor(
|
|
3425
|
-
this.
|
|
3419
|
+
constructor() {
|
|
3420
|
+
this._applicationInstance = "", this._applicationSpecifier = "", this._deviceId = "", this._navigation = new Ot(this), this._messageInterceptors = /* @__PURE__ */ new Map(), this._onHandlers = /* @__PURE__ */ new Map(), this._onceHandlers = /* @__PURE__ */ new Map(), this._subscriptionNamesByHandler = /* @__PURE__ */ new Map(), this._subscriptionNamesBySubjectName = /* @__PURE__ */ new Map();
|
|
3426
3421
|
}
|
|
3427
3422
|
/**
|
|
3428
3423
|
* Provides access to the accounts API for retrieving TelemetryOS account information.
|
|
@@ -3436,7 +3431,7 @@ class Ot {
|
|
|
3436
3431
|
* @returns An Accounts instance bound to this client
|
|
3437
3432
|
*/
|
|
3438
3433
|
get accounts() {
|
|
3439
|
-
return new
|
|
3434
|
+
return new gt(this);
|
|
3440
3435
|
}
|
|
3441
3436
|
/**
|
|
3442
3437
|
* Provides access to the users API for retrieving TelemetryOS user information.
|
|
@@ -3450,7 +3445,7 @@ class Ot {
|
|
|
3450
3445
|
* @returns A Users instance bound to this client
|
|
3451
3446
|
*/
|
|
3452
3447
|
get users() {
|
|
3453
|
-
return new
|
|
3448
|
+
return new St(this);
|
|
3454
3449
|
}
|
|
3455
3450
|
/**
|
|
3456
3451
|
* Provides access to the store API for data persistence with multiple storage scopes.
|
|
@@ -3464,7 +3459,7 @@ class Ot {
|
|
|
3464
3459
|
* @returns A Store instance bound to this client
|
|
3465
3460
|
*/
|
|
3466
3461
|
get store() {
|
|
3467
|
-
return new
|
|
3462
|
+
return new xt(this);
|
|
3468
3463
|
}
|
|
3469
3464
|
/**
|
|
3470
3465
|
* Provides access to the applications API for discovering other TelemetryOS applications.
|
|
@@ -3478,7 +3473,7 @@ class Ot {
|
|
|
3478
3473
|
* @returns An Applications instance bound to this client
|
|
3479
3474
|
*/
|
|
3480
3475
|
get applications() {
|
|
3481
|
-
return new
|
|
3476
|
+
return new yt(this);
|
|
3482
3477
|
}
|
|
3483
3478
|
/**
|
|
3484
3479
|
* Provides access to the media API for working with content hosted on the TelemetryOS platform.
|
|
@@ -3493,7 +3488,7 @@ class Ot {
|
|
|
3493
3488
|
* @returns A Media instance bound to this client
|
|
3494
3489
|
*/
|
|
3495
3490
|
get media() {
|
|
3496
|
-
return new
|
|
3491
|
+
return new wt(this);
|
|
3497
3492
|
}
|
|
3498
3493
|
/**
|
|
3499
3494
|
* Provides access to the proxy API for fetching third-party content through the TelemetryOS API.
|
|
@@ -3507,7 +3502,7 @@ class Ot {
|
|
|
3507
3502
|
* @returns A Proxy instance bound to this client
|
|
3508
3503
|
*/
|
|
3509
3504
|
get proxy() {
|
|
3510
|
-
return new
|
|
3505
|
+
return new kt(this);
|
|
3511
3506
|
}
|
|
3512
3507
|
/**
|
|
3513
3508
|
* Provides access to the devices API for interacting with the current device.
|
|
@@ -3522,7 +3517,7 @@ class Ot {
|
|
|
3522
3517
|
* @returns A Devices instance bound to this client
|
|
3523
3518
|
*/
|
|
3524
3519
|
get devices() {
|
|
3525
|
-
return new
|
|
3520
|
+
return new vt(this);
|
|
3526
3521
|
}
|
|
3527
3522
|
/**
|
|
3528
3523
|
* Provides access to the root settings navigation API for TelemetryOS administration UI integration.
|
|
@@ -3540,7 +3535,7 @@ class Ot {
|
|
|
3540
3535
|
* @throws {Error} If used by an application not mounted at the 'rootSettingsNavigation' mount point
|
|
3541
3536
|
*/
|
|
3542
3537
|
get rootSettingsNavigation() {
|
|
3543
|
-
return new
|
|
3538
|
+
return new At(this.store);
|
|
3544
3539
|
}
|
|
3545
3540
|
/**
|
|
3546
3541
|
* Provides access to the weather API for retrieving weather data.
|
|
@@ -3554,7 +3549,7 @@ class Ot {
|
|
|
3554
3549
|
* @returns A Weather instance bound to this client
|
|
3555
3550
|
*/
|
|
3556
3551
|
get weather() {
|
|
3557
|
-
return new
|
|
3552
|
+
return new Ct(this);
|
|
3558
3553
|
}
|
|
3559
3554
|
/**
|
|
3560
3555
|
* Provides access to the currency API for retrieving currency exchange rates.
|
|
@@ -3568,7 +3563,7 @@ class Ot {
|
|
|
3568
3563
|
* @returns A Currency instance bound to this client
|
|
3569
3564
|
*/
|
|
3570
3565
|
get currency() {
|
|
3571
|
-
return new
|
|
3566
|
+
return new Tt(this);
|
|
3572
3567
|
}
|
|
3573
3568
|
/**
|
|
3574
3569
|
* Provides access to the environment API for accessing environment settings.
|
|
@@ -3582,13 +3577,10 @@ class Ot {
|
|
|
3582
3577
|
* @returns An Environment instance bound to this client
|
|
3583
3578
|
*/
|
|
3584
3579
|
get environment() {
|
|
3585
|
-
return new
|
|
3580
|
+
return new bt(this);
|
|
3586
3581
|
}
|
|
3587
3582
|
get mqtt() {
|
|
3588
|
-
return new
|
|
3589
|
-
}
|
|
3590
|
-
get applicationName() {
|
|
3591
|
-
return this._applicationName;
|
|
3583
|
+
return new Nt(this);
|
|
3592
3584
|
}
|
|
3593
3585
|
get applicationSpecifier() {
|
|
3594
3586
|
return this._applicationSpecifier;
|
|
@@ -3596,6 +3588,9 @@ class Ot {
|
|
|
3596
3588
|
get applicationInstance() {
|
|
3597
3589
|
return this._applicationInstance;
|
|
3598
3590
|
}
|
|
3591
|
+
get deviceId() {
|
|
3592
|
+
return this._deviceId;
|
|
3593
|
+
}
|
|
3599
3594
|
/**
|
|
3600
3595
|
* Initializes the client by setting up message listeners and extracting the application ID.
|
|
3601
3596
|
*
|
|
@@ -3612,16 +3607,16 @@ class Ot {
|
|
|
3612
3607
|
* of creating and binding their own Client instances.
|
|
3613
3608
|
*/
|
|
3614
3609
|
bind() {
|
|
3615
|
-
var e, t
|
|
3616
|
-
const
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
if (this._applicationSpecifier = (
|
|
3620
|
-
const i =
|
|
3621
|
-
this._applicationSpecifier = (
|
|
3610
|
+
var e, t;
|
|
3611
|
+
const s = new URL(B.location.href), n = s.searchParams;
|
|
3612
|
+
this._applicationInstance = n.get("applicationInstance") || "single", this._deviceId = n.get("deviceId") || this._applicationInstance;
|
|
3613
|
+
const r = /^[a-z0-9-]{40}$/i;
|
|
3614
|
+
if (this._applicationSpecifier = (e = n.get("applicationSpecifier")) !== null && e !== void 0 ? e : "", !this._applicationSpecifier || !r.test(this._applicationSpecifier)) {
|
|
3615
|
+
const i = s.hostname.split(".");
|
|
3616
|
+
this._applicationSpecifier = (t = i[0]) !== null && t !== void 0 ? t : "";
|
|
3622
3617
|
}
|
|
3623
|
-
if (!this._applicationSpecifier || this._applicationSpecifier
|
|
3624
|
-
throw new Error(`Invalid applicationSpecifier: expected 40-character hash, got "${this._applicationSpecifier}"`);
|
|
3618
|
+
if (!this._applicationSpecifier || !r.test(this._applicationSpecifier))
|
|
3619
|
+
throw console.error("TelemetryOS apps require an applicationSpecifier in the URL query parameters or subdomain. Make sure your app is being served correctly through the TelemetryOS platform or development environment."), new Error(`Invalid applicationSpecifier: expected 40-character hash, got "${this._applicationSpecifier}"`);
|
|
3625
3620
|
this._windowMessageHandler = (i) => {
|
|
3626
3621
|
if (i.source === B || !i.data || typeof i.data != "object" || !("type" in i.data) || i.data.type !== "client" && i.data.type !== "bridge")
|
|
3627
3622
|
return;
|
|
@@ -3639,7 +3634,7 @@ class Ot {
|
|
|
3639
3634
|
};
|
|
3640
3635
|
}
|
|
3641
3636
|
if (!o) {
|
|
3642
|
-
const c =
|
|
3637
|
+
const c = Zt.safeParse(i.data);
|
|
3643
3638
|
if (!c.success)
|
|
3644
3639
|
return;
|
|
3645
3640
|
o = c.data;
|
|
@@ -3653,7 +3648,7 @@ class Ot {
|
|
|
3653
3648
|
this._onceHandlers.delete(o.name);
|
|
3654
3649
|
}
|
|
3655
3650
|
}
|
|
3656
|
-
if (!
|
|
3651
|
+
if (!ge)
|
|
3657
3652
|
for (let c = 0; c < window.frames.length; c += 1)
|
|
3658
3653
|
window.frames[c].postMessage(o, "*");
|
|
3659
3654
|
}, B.addEventListener("message", this._windowMessageHandler), this._navigation.bind();
|
|
@@ -3688,9 +3683,8 @@ class Ot {
|
|
|
3688
3683
|
* @param data The data payload to include with the message
|
|
3689
3684
|
*/
|
|
3690
3685
|
send(e, t) {
|
|
3691
|
-
const s =
|
|
3692
|
-
telemetrySdkVersion:
|
|
3693
|
-
applicationName: this._applicationName,
|
|
3686
|
+
const s = W({
|
|
3687
|
+
telemetrySdkVersion: Q,
|
|
3694
3688
|
applicationSpecifier: this._applicationSpecifier,
|
|
3695
3689
|
applicationInstance: this._applicationInstance,
|
|
3696
3690
|
name: e,
|
|
@@ -3719,9 +3713,8 @@ class Ot {
|
|
|
3719
3713
|
*/
|
|
3720
3714
|
request(e, t, s) {
|
|
3721
3715
|
var n;
|
|
3722
|
-
const r =
|
|
3723
|
-
telemetrySdkVersion:
|
|
3724
|
-
applicationName: this._applicationName,
|
|
3716
|
+
const r = J(), i = W({
|
|
3717
|
+
telemetrySdkVersion: Q,
|
|
3725
3718
|
applicationSpecifier: this._applicationSpecifier,
|
|
3726
3719
|
applicationInstance: this._applicationInstance,
|
|
3727
3720
|
name: e,
|
|
@@ -3729,19 +3722,19 @@ class Ot {
|
|
|
3729
3722
|
responseName: r
|
|
3730
3723
|
});
|
|
3731
3724
|
z(i);
|
|
3732
|
-
const o = (n = s == null ? void 0 : s.timeout) !== null && n !== void 0 ? n :
|
|
3725
|
+
const o = (n = s == null ? void 0 : s.timeout) !== null && n !== void 0 ? n : H;
|
|
3733
3726
|
let c = !1, h;
|
|
3734
3727
|
const g = new Promise((C) => {
|
|
3735
|
-
h = (
|
|
3736
|
-
c || C(
|
|
3728
|
+
h = (j) => {
|
|
3729
|
+
c || C(j);
|
|
3737
3730
|
}, this.once(r, h);
|
|
3738
3731
|
});
|
|
3739
3732
|
if (o === 0)
|
|
3740
3733
|
return g;
|
|
3741
|
-
const w = new Promise((C,
|
|
3742
|
-
const
|
|
3734
|
+
const w = new Promise((C, j) => {
|
|
3735
|
+
const P = new Error(`${e} message request with response name of ${r} timed out after ${o}`);
|
|
3743
3736
|
setTimeout(() => {
|
|
3744
|
-
c = !0, this.off(r, h), P
|
|
3737
|
+
c = !0, this.off(r, h), j(P);
|
|
3745
3738
|
}, o);
|
|
3746
3739
|
});
|
|
3747
3740
|
return Promise.race([w, g]);
|
|
@@ -3749,12 +3742,11 @@ class Ot {
|
|
|
3749
3742
|
async subscribe(e, t, s) {
|
|
3750
3743
|
let n, r;
|
|
3751
3744
|
typeof t == "function" ? r = t : (n = t, r = s);
|
|
3752
|
-
const i =
|
|
3745
|
+
const i = J(), o = J();
|
|
3753
3746
|
let c = this._subscriptionNamesBySubjectName.get(e);
|
|
3754
3747
|
c || (c = [], this._subscriptionNamesBySubjectName.set(e, c)), c.push(i), this._subscriptionNamesByHandler.set(r, i), this.on(i, r);
|
|
3755
|
-
const h =
|
|
3756
|
-
telemetrySdkVersion:
|
|
3757
|
-
applicationName: this._applicationName,
|
|
3748
|
+
const h = W({
|
|
3749
|
+
telemetrySdkVersion: Q,
|
|
3758
3750
|
applicationSpecifier: this._applicationSpecifier,
|
|
3759
3751
|
applicationInstance: this._applicationInstance,
|
|
3760
3752
|
name: e,
|
|
@@ -3764,22 +3756,22 @@ class Ot {
|
|
|
3764
3756
|
});
|
|
3765
3757
|
z(h);
|
|
3766
3758
|
let g = !1, w;
|
|
3767
|
-
const C = new Promise((
|
|
3768
|
-
const
|
|
3759
|
+
const C = new Promise((P, R) => {
|
|
3760
|
+
const te = new Error(`${e} subscribe request with subscription name of ${i} and response name of ${o} timed out after ${H}`);
|
|
3769
3761
|
setTimeout(() => {
|
|
3770
|
-
g = !0, this.off(o, w),
|
|
3771
|
-
},
|
|
3772
|
-
}),
|
|
3773
|
-
w = (
|
|
3774
|
-
g || R
|
|
3762
|
+
g = !0, this.off(o, w), R(te);
|
|
3763
|
+
}, H);
|
|
3764
|
+
}), j = new Promise((P) => {
|
|
3765
|
+
w = (R) => {
|
|
3766
|
+
g || P(R);
|
|
3775
3767
|
}, this.once(o, w);
|
|
3776
3768
|
});
|
|
3777
|
-
return Promise.race([C,
|
|
3769
|
+
return Promise.race([C, j]);
|
|
3778
3770
|
}
|
|
3779
3771
|
async unsubscribe(e, t, s) {
|
|
3780
3772
|
let n, r;
|
|
3781
3773
|
typeof t == "function" ? r = t : (n = t, r = s);
|
|
3782
|
-
const i =
|
|
3774
|
+
const i = J();
|
|
3783
3775
|
let o = [];
|
|
3784
3776
|
if (r) {
|
|
3785
3777
|
const c = this._subscriptionNamesByHandler.get(r);
|
|
@@ -3790,10 +3782,9 @@ class Ot {
|
|
|
3790
3782
|
return { success: !1 };
|
|
3791
3783
|
for await (const c of o) {
|
|
3792
3784
|
this.off(c, r);
|
|
3793
|
-
const h =
|
|
3794
|
-
telemetrySdkVersion:
|
|
3785
|
+
const h = W({
|
|
3786
|
+
telemetrySdkVersion: Q,
|
|
3795
3787
|
applicationInstance: this._applicationInstance,
|
|
3796
|
-
applicationName: this._applicationName,
|
|
3797
3788
|
applicationSpecifier: this._applicationSpecifier,
|
|
3798
3789
|
name: e,
|
|
3799
3790
|
data: n,
|
|
@@ -3802,17 +3793,17 @@ class Ot {
|
|
|
3802
3793
|
});
|
|
3803
3794
|
z(h);
|
|
3804
3795
|
let g = !1, w;
|
|
3805
|
-
const C = new Promise((
|
|
3806
|
-
const
|
|
3796
|
+
const C = new Promise((P, R) => {
|
|
3797
|
+
const te = new Error(`${e} unsubscribe request with unsubscribe name of ${c} and response name of ${i} timed out after ${H}`);
|
|
3807
3798
|
setTimeout(() => {
|
|
3808
|
-
g = !0, this.off(i, w),
|
|
3809
|
-
},
|
|
3810
|
-
}),
|
|
3811
|
-
w = (
|
|
3812
|
-
g || R
|
|
3799
|
+
g = !0, this.off(i, w), R(te);
|
|
3800
|
+
}, H);
|
|
3801
|
+
}), j = new Promise((P) => {
|
|
3802
|
+
w = (R) => {
|
|
3803
|
+
g || P(R);
|
|
3813
3804
|
}, this.once(i, w);
|
|
3814
3805
|
});
|
|
3815
|
-
if (!(await Promise.race([C,
|
|
3806
|
+
if (!(await Promise.race([C, j])).success)
|
|
3816
3807
|
return { success: !1 };
|
|
3817
3808
|
}
|
|
3818
3809
|
return { success: !0 };
|
|
@@ -3889,11 +3880,11 @@ class Ot {
|
|
|
3889
3880
|
}
|
|
3890
3881
|
}
|
|
3891
3882
|
}
|
|
3892
|
-
function
|
|
3883
|
+
function J() {
|
|
3893
3884
|
return Math.random().toString(36).slice(2, 9);
|
|
3894
3885
|
}
|
|
3895
|
-
const
|
|
3896
|
-
class
|
|
3886
|
+
const Q = _t.version;
|
|
3887
|
+
class Et {
|
|
3897
3888
|
constructor(e) {
|
|
3898
3889
|
this._client = e;
|
|
3899
3890
|
}
|
|
@@ -3942,7 +3933,7 @@ class At {
|
|
|
3942
3933
|
return !0;
|
|
3943
3934
|
}
|
|
3944
3935
|
}
|
|
3945
|
-
class
|
|
3936
|
+
class $t {
|
|
3946
3937
|
constructor(e) {
|
|
3947
3938
|
this._client = e;
|
|
3948
3939
|
}
|
|
@@ -4013,12 +4004,12 @@ class Et {
|
|
|
4013
4004
|
return { success: !0, duration: e.duration };
|
|
4014
4005
|
}
|
|
4015
4006
|
}
|
|
4016
|
-
class
|
|
4007
|
+
class jt extends It {
|
|
4017
4008
|
get playlist() {
|
|
4018
|
-
return new
|
|
4009
|
+
return new $t(this);
|
|
4019
4010
|
}
|
|
4020
4011
|
get overrides() {
|
|
4021
|
-
return new
|
|
4012
|
+
return new Et(this);
|
|
4022
4013
|
}
|
|
4023
4014
|
}
|
|
4024
4015
|
let f = null;
|
|
@@ -4026,7 +4017,7 @@ function Bt() {
|
|
|
4026
4017
|
return f;
|
|
4027
4018
|
}
|
|
4028
4019
|
function Ut(a) {
|
|
4029
|
-
f = new
|
|
4020
|
+
f = new jt(), f.bind();
|
|
4030
4021
|
}
|
|
4031
4022
|
function Kt() {
|
|
4032
4023
|
f == null || f.unbind(), f = null;
|
|
@@ -4096,18 +4087,18 @@ function k(a) {
|
|
|
4096
4087
|
throw new Error("SDK is not configured");
|
|
4097
4088
|
}
|
|
4098
4089
|
export {
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4090
|
+
gt as Accounts,
|
|
4091
|
+
yt as Applications,
|
|
4092
|
+
Tt as Currency,
|
|
4093
|
+
vt as Devices,
|
|
4094
|
+
bt as Environment,
|
|
4095
|
+
wt as Media,
|
|
4096
|
+
Nt as Mqtt,
|
|
4097
|
+
kt as Proxy,
|
|
4098
|
+
xt as Store,
|
|
4099
|
+
K as StoreSlice,
|
|
4100
|
+
St as Users,
|
|
4101
|
+
Ct as Weather,
|
|
4111
4102
|
as as accounts,
|
|
4112
4103
|
ss as applications,
|
|
4113
4104
|
Ut as configure,
|
|
@@ -4128,7 +4119,7 @@ export {
|
|
|
4128
4119
|
Gt as send,
|
|
4129
4120
|
ts as store,
|
|
4130
4121
|
Xt as subscribe,
|
|
4131
|
-
|
|
4122
|
+
Q as telemetrySdkVersion,
|
|
4132
4123
|
es as unsubscribe,
|
|
4133
4124
|
is as users,
|
|
4134
4125
|
cs as weather
|