@telemetryos/sdk 1.10.0 → 1.12.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.js +244 -231
- package/dist/react/SettingsMediaSelect.d.ts +17 -0
- package/dist/react/hooks/store.d.ts +2 -0
- package/dist/react/index.d.ts +2 -1
- package/dist/react.cjs +97 -5
- package/dist/react.js +396 -265
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -64,7 +64,7 @@ const l = b.arrayToEnum([
|
|
|
64
64
|
"never",
|
|
65
65
|
"map",
|
|
66
66
|
"set"
|
|
67
|
-
]),
|
|
67
|
+
]), A = (a) => {
|
|
68
68
|
switch (typeof a) {
|
|
69
69
|
case "undefined":
|
|
70
70
|
return l.undefined;
|
|
@@ -103,7 +103,7 @@ const l = b.arrayToEnum([
|
|
|
103
103
|
"not_multiple_of",
|
|
104
104
|
"not_finite"
|
|
105
105
|
]);
|
|
106
|
-
class
|
|
106
|
+
class Z extends Error {
|
|
107
107
|
get errors() {
|
|
108
108
|
return this.issues;
|
|
109
109
|
}
|
|
@@ -140,7 +140,7 @@ class O extends Error {
|
|
|
140
140
|
return n(this), s;
|
|
141
141
|
}
|
|
142
142
|
static assert(e) {
|
|
143
|
-
if (!(e instanceof
|
|
143
|
+
if (!(e instanceof Z))
|
|
144
144
|
throw new Error(`Not a ZodError: ${e}`);
|
|
145
145
|
}
|
|
146
146
|
toString() {
|
|
@@ -166,8 +166,8 @@ class O extends Error {
|
|
|
166
166
|
return this.flatten();
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
|
|
170
|
-
const
|
|
169
|
+
Z.create = (a) => new Z(a);
|
|
170
|
+
const ae = (a, e) => {
|
|
171
171
|
let t;
|
|
172
172
|
switch (a.code) {
|
|
173
173
|
case u.invalid_type:
|
|
@@ -223,11 +223,11 @@ const ne = (a, e) => {
|
|
|
223
223
|
}
|
|
224
224
|
return { message: t };
|
|
225
225
|
};
|
|
226
|
-
let
|
|
227
|
-
function
|
|
228
|
-
return
|
|
226
|
+
let qe = ae;
|
|
227
|
+
function Me() {
|
|
228
|
+
return qe;
|
|
229
229
|
}
|
|
230
|
-
const
|
|
230
|
+
const Le = (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 De = (a) => {
|
|
|
249
249
|
};
|
|
250
250
|
};
|
|
251
251
|
function d(a, e) {
|
|
252
|
-
const t =
|
|
252
|
+
const t = Me(), s = Le({
|
|
253
253
|
issueData: e,
|
|
254
254
|
data: a.data,
|
|
255
255
|
path: a.path,
|
|
@@ -260,13 +260,13 @@ 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 === ae ? void 0 : ae
|
|
264
264
|
// then global default map
|
|
265
265
|
].filter((n) => !!n)
|
|
266
266
|
});
|
|
267
267
|
a.common.issues.push(s);
|
|
268
268
|
}
|
|
269
|
-
let C = class
|
|
269
|
+
let C = class $e {
|
|
270
270
|
constructor() {
|
|
271
271
|
this.value = "valid";
|
|
272
272
|
}
|
|
@@ -294,7 +294,7 @@ let C = class je {
|
|
|
294
294
|
value: i
|
|
295
295
|
});
|
|
296
296
|
}
|
|
297
|
-
return
|
|
297
|
+
return $e.mergeObjectSync(e, s);
|
|
298
298
|
}
|
|
299
299
|
static mergeObjectSync(e, t) {
|
|
300
300
|
const s = {};
|
|
@@ -309,12 +309,12 @@ let C = class je {
|
|
|
309
309
|
};
|
|
310
310
|
const _ = Object.freeze({
|
|
311
311
|
status: "aborted"
|
|
312
|
-
}),
|
|
312
|
+
}), re = (a) => ({ status: "dirty", value: a }), x = (a) => ({ status: "valid", value: a }), ye = (a) => a.status === "aborted", ve = (a) => a.status === "dirty", L = (a) => a.status === "valid", Y = (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 $ = 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
|
}
|
|
@@ -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 Z(a.common.issues);
|
|
336
336
|
return this._error = t, this._error;
|
|
337
337
|
}
|
|
338
338
|
};
|
|
@@ -353,13 +353,13 @@ let v = class {
|
|
|
353
353
|
return this._def.description;
|
|
354
354
|
}
|
|
355
355
|
_getType(e) {
|
|
356
|
-
return
|
|
356
|
+
return A(e.data);
|
|
357
357
|
}
|
|
358
358
|
_getOrReturnCtx(e, t) {
|
|
359
359
|
return t || {
|
|
360
360
|
common: e.parent.common,
|
|
361
361
|
data: e.data,
|
|
362
|
-
parsedType:
|
|
362
|
+
parsedType: A(e.data),
|
|
363
363
|
schemaErrorMap: this._def.errorMap,
|
|
364
364
|
path: e.path,
|
|
365
365
|
parent: e.parent
|
|
@@ -371,7 +371,7 @@ let v = class {
|
|
|
371
371
|
ctx: {
|
|
372
372
|
common: e.parent.common,
|
|
373
373
|
data: e.data,
|
|
374
|
-
parsedType:
|
|
374
|
+
parsedType: A(e.data),
|
|
375
375
|
schemaErrorMap: this._def.errorMap,
|
|
376
376
|
path: e.path,
|
|
377
377
|
parent: e.parent
|
|
@@ -380,7 +380,7 @@ let v = class {
|
|
|
380
380
|
}
|
|
381
381
|
_parseSync(e) {
|
|
382
382
|
const t = this._parse(e);
|
|
383
|
-
if (
|
|
383
|
+
if (Y(t))
|
|
384
384
|
throw new Error("Synchronous parse encountered promise.");
|
|
385
385
|
return t;
|
|
386
386
|
}
|
|
@@ -405,7 +405,7 @@ let v = class {
|
|
|
405
405
|
schemaErrorMap: this._def.errorMap,
|
|
406
406
|
parent: null,
|
|
407
407
|
data: e,
|
|
408
|
-
parsedType:
|
|
408
|
+
parsedType: A(e)
|
|
409
409
|
}, n = this._parseSync({ data: e, path: s.path, parent: s });
|
|
410
410
|
return be(s, n);
|
|
411
411
|
}
|
|
@@ -420,7 +420,7 @@ let v = class {
|
|
|
420
420
|
schemaErrorMap: this._def.errorMap,
|
|
421
421
|
parent: null,
|
|
422
422
|
data: e,
|
|
423
|
-
parsedType:
|
|
423
|
+
parsedType: A(e)
|
|
424
424
|
};
|
|
425
425
|
if (!this["~standard"].async)
|
|
426
426
|
try {
|
|
@@ -459,8 +459,8 @@ let v = class {
|
|
|
459
459
|
schemaErrorMap: this._def.errorMap,
|
|
460
460
|
parent: null,
|
|
461
461
|
data: e,
|
|
462
|
-
parsedType:
|
|
463
|
-
}, n = this._parse({ data: e, path: s.path, parent: s }), r = await (
|
|
462
|
+
parsedType: A(e)
|
|
463
|
+
}, n = this._parse({ data: e, path: s.path, parent: s }), r = await (Y(n) ? n : Promise.resolve(n));
|
|
464
464
|
return be(s, r);
|
|
465
465
|
}
|
|
466
466
|
refine(e, t) {
|
|
@@ -494,7 +494,7 @@ let v = class {
|
|
|
494
494
|
};
|
|
495
495
|
}
|
|
496
496
|
optional() {
|
|
497
|
-
return
|
|
497
|
+
return E.create(this, this._def);
|
|
498
498
|
}
|
|
499
499
|
nullable() {
|
|
500
500
|
return V.create(this, this._def);
|
|
@@ -506,13 +506,13 @@ let v = class {
|
|
|
506
506
|
return T.create(this);
|
|
507
507
|
}
|
|
508
508
|
promise() {
|
|
509
|
-
return
|
|
509
|
+
return te.create(this, this._def);
|
|
510
510
|
}
|
|
511
511
|
or(e) {
|
|
512
|
-
return
|
|
512
|
+
return X.create([this, e], this._def);
|
|
513
513
|
}
|
|
514
514
|
and(e) {
|
|
515
|
-
return
|
|
515
|
+
return ee.create(this, e, this._def);
|
|
516
516
|
}
|
|
517
517
|
transform(e) {
|
|
518
518
|
return new D({
|
|
@@ -532,7 +532,7 @@ let v = class {
|
|
|
532
532
|
});
|
|
533
533
|
}
|
|
534
534
|
brand() {
|
|
535
|
-
return new
|
|
535
|
+
return new ut({
|
|
536
536
|
typeName: m.ZodBranded,
|
|
537
537
|
type: this,
|
|
538
538
|
...y(this._def)
|
|
@@ -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 De = /^c[^\s-]{8,}$/i, Ve = /^[0-9a-z]+$/, ze = /^[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, He = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Ke = /^[-+]?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)?)??$/, We = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Je = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
571
|
+
let ne;
|
|
572
|
+
const Qe = /^(?:(?: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])$/, 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])\/(3[0-2]|[12]?[0-9])$/, Ye = /^(([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]))$/, 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]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, et = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, tt = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, je = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", st = new RegExp(`^${je}$`);
|
|
573
|
+
function Pe(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 nt(a) {
|
|
580
|
+
return new RegExp(`^${Pe(a)}$`);
|
|
581
581
|
}
|
|
582
|
-
function
|
|
583
|
-
let e = `${
|
|
582
|
+
function at(a) {
|
|
583
|
+
let e = `${je}T${Pe(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) && Qe.test(a) || (e === "v6" || !e) && Ye.test(a));
|
|
589
589
|
}
|
|
590
|
-
function
|
|
591
|
-
if (!
|
|
590
|
+
function it(a, e) {
|
|
591
|
+
if (!He.test(a))
|
|
592
592
|
return !1;
|
|
593
593
|
try {
|
|
594
594
|
const [t] = a.split(".");
|
|
@@ -600,10 +600,10 @@ function ot(a, e) {
|
|
|
600
600
|
return !1;
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
|
-
function
|
|
604
|
-
return !!((e === "v4" || !e) &&
|
|
603
|
+
function ot(a, e) {
|
|
604
|
+
return !!((e === "v4" || !e) && Ge.test(a) || (e === "v6" || !e) && Xe.test(a));
|
|
605
605
|
}
|
|
606
|
-
class
|
|
606
|
+
class I 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
|
+
We.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
|
+
ne || (ne = new RegExp(Je, "u")), ne.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
|
+
De.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
|
+
Ve.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
|
+
ze.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" ? at(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" ? st.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" ? nt(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" ? Ke.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" ? it(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" ? ot(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" ? et.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" ? tt.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 I({
|
|
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 I({
|
|
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 I({
|
|
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 I({
|
|
918
918
|
...this._def,
|
|
919
919
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
920
920
|
});
|
|
@@ -980,17 +980,17 @@ class E extends v {
|
|
|
980
980
|
return e;
|
|
981
981
|
}
|
|
982
982
|
}
|
|
983
|
-
|
|
983
|
+
I.create = (a) => new I({
|
|
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 ct(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 we = class
|
|
993
|
+
let we = class ie 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" ? ct(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
|
|
@@ -1048,7 +1048,7 @@ let we = class re extends v {
|
|
|
1048
1048
|
return this.setLimit("max", e, !1, p.toString(t));
|
|
1049
1049
|
}
|
|
1050
1050
|
setLimit(e, t, s, n) {
|
|
1051
|
-
return new
|
|
1051
|
+
return new ie({
|
|
1052
1052
|
...this._def,
|
|
1053
1053
|
checks: [
|
|
1054
1054
|
...this._def.checks,
|
|
@@ -1062,7 +1062,7 @@ let we = class re extends v {
|
|
|
1062
1062
|
});
|
|
1063
1063
|
}
|
|
1064
1064
|
_addCheck(e) {
|
|
1065
|
-
return new
|
|
1065
|
+
return new ie({
|
|
1066
1066
|
...this._def,
|
|
1067
1067
|
checks: [...this._def.checks, e]
|
|
1068
1068
|
});
|
|
@@ -1442,7 +1442,7 @@ Ce.create = (a) => new Ce({
|
|
|
1442
1442
|
typeName: m.ZodNull,
|
|
1443
1443
|
...y(a)
|
|
1444
1444
|
});
|
|
1445
|
-
class
|
|
1445
|
+
class oe extends v {
|
|
1446
1446
|
constructor() {
|
|
1447
1447
|
super(...arguments), this._any = !0;
|
|
1448
1448
|
}
|
|
@@ -1450,7 +1450,7 @@ class ie extends v {
|
|
|
1450
1450
|
return x(e.data);
|
|
1451
1451
|
}
|
|
1452
1452
|
}
|
|
1453
|
-
|
|
1453
|
+
oe.create = (a) => new oe({
|
|
1454
1454
|
typeName: m.ZodAny,
|
|
1455
1455
|
...y(a)
|
|
1456
1456
|
});
|
|
@@ -1466,7 +1466,7 @@ Te.create = (a) => new Te({
|
|
|
1466
1466
|
typeName: m.ZodUnknown,
|
|
1467
1467
|
...y(a)
|
|
1468
1468
|
});
|
|
1469
|
-
let
|
|
1469
|
+
let j = class extends v {
|
|
1470
1470
|
_parse(e) {
|
|
1471
1471
|
const t = this._getOrReturnCtx(e);
|
|
1472
1472
|
return d(t, {
|
|
@@ -1476,7 +1476,7 @@ let P = class extends v {
|
|
|
1476
1476
|
}), _;
|
|
1477
1477
|
}
|
|
1478
1478
|
};
|
|
1479
|
-
|
|
1479
|
+
j.create = (a) => new j({
|
|
1480
1480
|
typeName: m.ZodNever,
|
|
1481
1481
|
...y(a)
|
|
1482
1482
|
});
|
|
@@ -1533,8 +1533,8 @@ 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 $(t, i, t.path, o)))).then((i) => C.mergeArray(s, i));
|
|
1537
|
+
const r = [...t.data].map((i, o) => n.type._parseSync(new $(t, i, t.path, o)));
|
|
1538
1538
|
return C.mergeArray(s, r);
|
|
1539
1539
|
}
|
|
1540
1540
|
get element() {
|
|
@@ -1571,22 +1571,22 @@ T.create = (a, e) => new T({
|
|
|
1571
1571
|
...y(e)
|
|
1572
1572
|
});
|
|
1573
1573
|
function M(a) {
|
|
1574
|
-
if (a instanceof
|
|
1574
|
+
if (a instanceof O) {
|
|
1575
1575
|
const e = {};
|
|
1576
1576
|
for (const t in a.shape) {
|
|
1577
1577
|
const s = a.shape[t];
|
|
1578
|
-
e[t] =
|
|
1578
|
+
e[t] = E.create(M(s));
|
|
1579
1579
|
}
|
|
1580
|
-
return new
|
|
1580
|
+
return new O({
|
|
1581
1581
|
...a._def,
|
|
1582
1582
|
shape: () => e
|
|
1583
1583
|
});
|
|
1584
1584
|
} else return a instanceof T ? new T({
|
|
1585
1585
|
...a._def,
|
|
1586
1586
|
type: M(a.element)
|
|
1587
|
-
}) : a instanceof
|
|
1587
|
+
}) : a instanceof E ? E.create(M(a.unwrap())) : a instanceof V ? V.create(M(a.unwrap())) : a instanceof q ? q.create(a.items.map((e) => M(e))) : a;
|
|
1588
1588
|
}
|
|
1589
|
-
let
|
|
1589
|
+
let O = class N 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 A = 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 j && 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 A = 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 $(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 j) {
|
|
1622
1622
|
const c = this._def.unknownKeys;
|
|
1623
1623
|
if (c === "passthrough")
|
|
1624
1624
|
for (const h of i)
|
|
@@ -1639,7 +1639,7 @@ let A = class N extends v {
|
|
|
1639
1639
|
o.push({
|
|
1640
1640
|
key: { status: "valid", value: h },
|
|
1641
1641
|
value: c._parse(
|
|
1642
|
-
new
|
|
1642
|
+
new $(s, g, s.path, h)
|
|
1643
1643
|
//, ctx.child(key), value, getParsedType(value)
|
|
1644
1644
|
),
|
|
1645
1645
|
alwaysSet: h in s.data
|
|
@@ -1840,7 +1840,7 @@ let A = class N extends v {
|
|
|
1840
1840
|
t[s] = this.shape[s];
|
|
1841
1841
|
else {
|
|
1842
1842
|
let n = this.shape[s];
|
|
1843
|
-
for (; n instanceof
|
|
1843
|
+
for (; n instanceof E; )
|
|
1844
1844
|
n = n._def.innerType;
|
|
1845
1845
|
t[s] = n;
|
|
1846
1846
|
}
|
|
@@ -1850,31 +1850,31 @@ let A = class N extends v {
|
|
|
1850
1850
|
});
|
|
1851
1851
|
}
|
|
1852
1852
|
keyof() {
|
|
1853
|
-
return
|
|
1853
|
+
return Re(b.objectKeys(this.shape));
|
|
1854
1854
|
}
|
|
1855
1855
|
};
|
|
1856
|
-
|
|
1856
|
+
O.create = (a, e) => new O({
|
|
1857
1857
|
shape: () => a,
|
|
1858
1858
|
unknownKeys: "strip",
|
|
1859
|
-
catchall:
|
|
1859
|
+
catchall: j.create(),
|
|
1860
1860
|
typeName: m.ZodObject,
|
|
1861
1861
|
...y(e)
|
|
1862
1862
|
});
|
|
1863
|
-
|
|
1863
|
+
O.strictCreate = (a, e) => new O({
|
|
1864
1864
|
shape: () => a,
|
|
1865
1865
|
unknownKeys: "strict",
|
|
1866
|
-
catchall:
|
|
1866
|
+
catchall: j.create(),
|
|
1867
1867
|
typeName: m.ZodObject,
|
|
1868
1868
|
...y(e)
|
|
1869
1869
|
});
|
|
1870
|
-
|
|
1870
|
+
O.lazycreate = (a, e) => new O({
|
|
1871
1871
|
shape: a,
|
|
1872
1872
|
unknownKeys: "strip",
|
|
1873
|
-
catchall:
|
|
1873
|
+
catchall: j.create(),
|
|
1874
1874
|
typeName: m.ZodObject,
|
|
1875
1875
|
...y(e)
|
|
1876
1876
|
});
|
|
1877
|
-
let
|
|
1877
|
+
let X = 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 Y = 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 Z(o.ctx.common.issues));
|
|
1888
1888
|
return d(t, {
|
|
1889
1889
|
code: u.invalid_union,
|
|
1890
1890
|
unionErrors: i
|
|
@@ -1931,7 +1931,7 @@ let Y = 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 Z(c));
|
|
1935
1935
|
return d(t, {
|
|
1936
1936
|
code: u.invalid_union,
|
|
1937
1937
|
unionErrors: o
|
|
@@ -1942,19 +1942,19 @@ let Y = class extends v {
|
|
|
1942
1942
|
return this._def.options;
|
|
1943
1943
|
}
|
|
1944
1944
|
};
|
|
1945
|
-
|
|
1945
|
+
X.create = (a, e) => new X({
|
|
1946
1946
|
options: a,
|
|
1947
1947
|
typeName: m.ZodUnion,
|
|
1948
1948
|
...y(e)
|
|
1949
1949
|
});
|
|
1950
|
-
function
|
|
1951
|
-
const t =
|
|
1950
|
+
function ce(a, e) {
|
|
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 = ce(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 oe(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 = ce(i, o);
|
|
1969
1969
|
if (!c.valid)
|
|
1970
1970
|
return { valid: !1 };
|
|
1971
1971
|
n.push(c.data);
|
|
@@ -1973,12 +1973,12 @@ function oe(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
|
-
class
|
|
1976
|
+
let ee = class extends v {
|
|
1977
1977
|
_parse(e) {
|
|
1978
1978
|
const { status: t, ctx: s } = this._processInputParams(e), n = (r, i) => {
|
|
1979
1979
|
if (ye(r) || ye(i))
|
|
1980
1980
|
return _;
|
|
1981
|
-
const o =
|
|
1981
|
+
const o = ce(r.value, i.value);
|
|
1982
1982
|
return o.valid ? ((ve(r) || ve(i)) && t.dirty(), { status: t.value, value: o.data }) : (d(s, {
|
|
1983
1983
|
code: u.invalid_intersection_types
|
|
1984
1984
|
}), _);
|
|
@@ -2004,8 +2004,8 @@ class X extends v {
|
|
|
2004
2004
|
parent: s
|
|
2005
2005
|
}));
|
|
2006
2006
|
}
|
|
2007
|
-
}
|
|
2008
|
-
|
|
2007
|
+
};
|
|
2008
|
+
ee.create = (a, e, t) => new ee({
|
|
2009
2009
|
left: a,
|
|
2010
2010
|
right: e,
|
|
2011
2011
|
typeName: m.ZodIntersection,
|
|
@@ -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 $(s, r, s.path, i)) : null;
|
|
2041
2041
|
}).filter((r) => !!r);
|
|
2042
2042
|
return s.common.async ? Promise.all(n).then((r) => C.mergeArray(t, r)) : C.mergeArray(t, n);
|
|
2043
2043
|
}
|
|
@@ -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 $(s, o, s.path, [h, "key"])),
|
|
2081
|
+
value: r._parse(new $(s, c, s.path, [h, "value"]))
|
|
2082
2082
|
}));
|
|
2083
2083
|
if (s.common.async) {
|
|
2084
2084
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -2109,7 +2109,7 @@ Oe.create = (a, e, t) => new Oe({
|
|
|
2109
2109
|
typeName: m.ZodMap,
|
|
2110
2110
|
...y(t)
|
|
2111
2111
|
});
|
|
2112
|
-
|
|
2112
|
+
class K 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 @@ let Ae = class ce 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 $(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 K({
|
|
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 K({
|
|
2158
2158
|
...this._def,
|
|
2159
2159
|
maxSize: { value: e, message: p.toString(t) }
|
|
2160
2160
|
});
|
|
@@ -2165,15 +2165,15 @@ let Ae = class ce extends v {
|
|
|
2165
2165
|
nonempty(e) {
|
|
2166
2166
|
return this.min(1, e);
|
|
2167
2167
|
}
|
|
2168
|
-
}
|
|
2169
|
-
|
|
2168
|
+
}
|
|
2169
|
+
K.create = (a, e) => new K({
|
|
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 Ae extends v {
|
|
2177
2177
|
get schema() {
|
|
2178
2178
|
return this._def.getter();
|
|
2179
2179
|
}
|
|
@@ -2182,7 +2182,7 @@ class Ie extends v {
|
|
|
2182
2182
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
2183
2183
|
}
|
|
2184
2184
|
}
|
|
2185
|
-
|
|
2185
|
+
Ae.create = (a, e) => new Ae({
|
|
2186
2186
|
getter: a,
|
|
2187
2187
|
typeName: m.ZodLazy,
|
|
2188
2188
|
...y(e)
|
|
@@ -2208,7 +2208,7 @@ ue.create = (a, e) => new ue({
|
|
|
2208
2208
|
typeName: m.ZodLiteral,
|
|
2209
2209
|
...y(e)
|
|
2210
2210
|
});
|
|
2211
|
-
function
|
|
2211
|
+
function Re(a, e) {
|
|
2212
2212
|
return new fe({
|
|
2213
2213
|
values: a,
|
|
2214
2214
|
typeName: m.ZodEnum,
|
|
@@ -2269,8 +2269,8 @@ let fe = class de extends v {
|
|
|
2269
2269
|
});
|
|
2270
2270
|
}
|
|
2271
2271
|
};
|
|
2272
|
-
fe.create =
|
|
2273
|
-
class
|
|
2272
|
+
fe.create = Re;
|
|
2273
|
+
class Ie 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
|
+
Ie.create = (a, e) => new Ie({
|
|
2299
2299
|
values: a,
|
|
2300
2300
|
typeName: m.ZodNativeEnum,
|
|
2301
2301
|
...y(e)
|
|
2302
2302
|
});
|
|
2303
|
-
let
|
|
2303
|
+
let te = class extends v {
|
|
2304
2304
|
unwrap() {
|
|
2305
2305
|
return this._def.type;
|
|
2306
2306
|
}
|
|
@@ -2319,7 +2319,7 @@ let ee = class extends v {
|
|
|
2319
2319
|
})));
|
|
2320
2320
|
}
|
|
2321
2321
|
};
|
|
2322
|
-
|
|
2322
|
+
te.create = (a, e) => new te({
|
|
2323
2323
|
type: a,
|
|
2324
2324
|
typeName: m.ZodPromise,
|
|
2325
2325
|
...y(e)
|
|
@@ -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" ? re(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" ? re(o.value) : o;
|
|
2365
2365
|
}
|
|
2366
2366
|
}
|
|
2367
2367
|
if (n.type === "refinement") {
|
|
@@ -2416,7 +2416,7 @@ D.createWithPreprocess = (a, e, t) => new D({
|
|
|
2416
2416
|
typeName: m.ZodEffects,
|
|
2417
2417
|
...y(t)
|
|
2418
2418
|
});
|
|
2419
|
-
let
|
|
2419
|
+
let E = class extends v {
|
|
2420
2420
|
_parse(e) {
|
|
2421
2421
|
return this._getType(e) === l.undefined ? x(void 0) : this._def.innerType._parse(e);
|
|
2422
2422
|
}
|
|
@@ -2424,7 +2424,7 @@ let $ = class extends v {
|
|
|
2424
2424
|
return this._def.innerType;
|
|
2425
2425
|
}
|
|
2426
2426
|
};
|
|
2427
|
-
|
|
2427
|
+
E.create = (a, e) => new E({
|
|
2428
2428
|
innerType: a,
|
|
2429
2429
|
typeName: m.ZodOptional,
|
|
2430
2430
|
...y(e)
|
|
@@ -2477,11 +2477,11 @@ class he extends v {
|
|
|
2477
2477
|
...s
|
|
2478
2478
|
}
|
|
2479
2479
|
});
|
|
2480
|
-
return
|
|
2480
|
+
return Y(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 Z(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 Z(s.common.issues);
|
|
2493
2493
|
},
|
|
2494
2494
|
input: s.data
|
|
2495
2495
|
})
|
|
@@ -2505,7 +2505,7 @@ he.create = (a, e) => new he({
|
|
|
2505
2505
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2506
2506
|
...y(e)
|
|
2507
2507
|
});
|
|
2508
|
-
class
|
|
2508
|
+
class Ee 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 $e extends v {
|
|
|
2518
2518
|
return { status: "valid", value: e.data };
|
|
2519
2519
|
}
|
|
2520
2520
|
}
|
|
2521
|
-
|
|
2521
|
+
Ee.create = (a) => new Ee({
|
|
2522
2522
|
typeName: m.ZodNaN,
|
|
2523
2523
|
...y(a)
|
|
2524
2524
|
});
|
|
2525
|
-
class
|
|
2525
|
+
class ut extends v {
|
|
2526
2526
|
_parse(e) {
|
|
2527
2527
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
2528
2528
|
return this._def.type._parse({
|
|
@@ -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(), re(n.value)) : this._def.out._parseAsync({
|
|
2549
2549
|
data: n.value,
|
|
2550
2550
|
path: s.path,
|
|
2551
2551
|
parent: s
|
|
@@ -2578,7 +2578,7 @@ class me extends v {
|
|
|
2578
2578
|
class pe extends v {
|
|
2579
2579
|
_parse(e) {
|
|
2580
2580
|
const t = this._def.innerType._parse(e), s = (n) => (L(n) && (n.value = Object.freeze(n.value)), n);
|
|
2581
|
-
return
|
|
2581
|
+
return Y(t) ? t.then((n) => s(n)) : s(t);
|
|
2582
2582
|
}
|
|
2583
2583
|
unwrap() {
|
|
2584
2584
|
return this._def.innerType;
|
|
@@ -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
|
-
|
|
2596
|
+
const dt = I.create, lt = oe.create;
|
|
2597
|
+
j.create;
|
|
2598
2598
|
T.create;
|
|
2599
|
-
const
|
|
2600
|
-
Y.create;
|
|
2599
|
+
const ht = O.create;
|
|
2601
2600
|
X.create;
|
|
2601
|
+
ee.create;
|
|
2602
2602
|
q.create;
|
|
2603
|
-
const
|
|
2603
|
+
const pt = ue.create;
|
|
2604
2604
|
fe.create;
|
|
2605
|
-
|
|
2606
|
-
|
|
2605
|
+
te.create;
|
|
2606
|
+
E.create;
|
|
2607
2607
|
V.create;
|
|
2608
|
-
const
|
|
2609
|
-
version:
|
|
2608
|
+
const ft = "1.12.0", mt = {
|
|
2609
|
+
version: ft
|
|
2610
2610
|
};
|
|
2611
|
-
class
|
|
2611
|
+
class _t {
|
|
2612
2612
|
constructor(e) {
|
|
2613
2613
|
this._client = e;
|
|
2614
2614
|
}
|
|
@@ -2627,7 +2627,7 @@ class gt {
|
|
|
2627
2627
|
return e.account;
|
|
2628
2628
|
}
|
|
2629
2629
|
}
|
|
2630
|
-
class
|
|
2630
|
+
class gt {
|
|
2631
2631
|
constructor(e) {
|
|
2632
2632
|
this._client = e;
|
|
2633
2633
|
}
|
|
@@ -2722,7 +2722,7 @@ class yt {
|
|
|
2722
2722
|
this._client._messageInterceptors.set(e, t);
|
|
2723
2723
|
}
|
|
2724
2724
|
}
|
|
2725
|
-
class
|
|
2725
|
+
class yt {
|
|
2726
2726
|
constructor(e) {
|
|
2727
2727
|
this._client = e;
|
|
2728
2728
|
}
|
|
@@ -2766,7 +2766,7 @@ class vt {
|
|
|
2766
2766
|
return e.capabilities;
|
|
2767
2767
|
}
|
|
2768
2768
|
}
|
|
2769
|
-
class
|
|
2769
|
+
class vt {
|
|
2770
2770
|
constructor(e) {
|
|
2771
2771
|
this._client = e;
|
|
2772
2772
|
}
|
|
@@ -2780,7 +2780,7 @@ class bt {
|
|
|
2780
2780
|
return (await this._client.unsubscribe("environment.unsubscribeColorScheme", {}, e)).success;
|
|
2781
2781
|
}
|
|
2782
2782
|
}
|
|
2783
|
-
class
|
|
2783
|
+
class bt {
|
|
2784
2784
|
constructor(e) {
|
|
2785
2785
|
this._client = e;
|
|
2786
2786
|
}
|
|
@@ -2825,8 +2825,21 @@ class wt {
|
|
|
2825
2825
|
id: e
|
|
2826
2826
|
})).content;
|
|
2827
2827
|
}
|
|
2828
|
+
/**
|
|
2829
|
+
* Opens a full-screen media picker dialog in the host window.
|
|
2830
|
+
* This allows users to browse folders, view media, and select an item.
|
|
2831
|
+
*
|
|
2832
|
+
* @param options Optional picker options including content type filter and current value
|
|
2833
|
+
* @returns A promise that resolves to the selected media, or null if cancelled
|
|
2834
|
+
*/
|
|
2835
|
+
async openPicker(e) {
|
|
2836
|
+
return (await this._client.request("media.openPicker", {
|
|
2837
|
+
accept: e == null ? void 0 : e.accept,
|
|
2838
|
+
currentValue: e == null ? void 0 : e.currentValue
|
|
2839
|
+
})).selection;
|
|
2840
|
+
}
|
|
2828
2841
|
}
|
|
2829
|
-
class
|
|
2842
|
+
class wt {
|
|
2830
2843
|
constructor(e) {
|
|
2831
2844
|
this._client = e;
|
|
2832
2845
|
}
|
|
@@ -2875,7 +2888,7 @@ class kt {
|
|
|
2875
2888
|
return new Response(h, c);
|
|
2876
2889
|
}
|
|
2877
2890
|
}
|
|
2878
|
-
class
|
|
2891
|
+
class kt {
|
|
2879
2892
|
constructor(e) {
|
|
2880
2893
|
this._client = e;
|
|
2881
2894
|
}
|
|
@@ -2889,7 +2902,7 @@ class xt {
|
|
|
2889
2902
|
* @returns A StoreSlice instance for the application scope
|
|
2890
2903
|
*/
|
|
2891
2904
|
get application() {
|
|
2892
|
-
return new
|
|
2905
|
+
return new W("application", "", this._client);
|
|
2893
2906
|
}
|
|
2894
2907
|
/**
|
|
2895
2908
|
* Provides access to the instance store scope.
|
|
@@ -2903,7 +2916,7 @@ class xt {
|
|
|
2903
2916
|
* @returns A StoreSlice instance for the instance scope
|
|
2904
2917
|
*/
|
|
2905
2918
|
get instance() {
|
|
2906
|
-
return new
|
|
2919
|
+
return new W("instance", this._client.applicationInstance, this._client);
|
|
2907
2920
|
}
|
|
2908
2921
|
/**
|
|
2909
2922
|
* Provides access to the device store scope.
|
|
@@ -2918,7 +2931,7 @@ class xt {
|
|
|
2918
2931
|
* @returns A StoreSlice instance for the device scope
|
|
2919
2932
|
*/
|
|
2920
2933
|
get device() {
|
|
2921
|
-
return new
|
|
2934
|
+
return new W("device", this._client.applicationInstance, this._client);
|
|
2922
2935
|
}
|
|
2923
2936
|
/**
|
|
2924
2937
|
* Provides access to the shared store scope with a specified namespace.
|
|
@@ -2934,10 +2947,10 @@ class xt {
|
|
|
2934
2947
|
* @returns A StoreSlice instance for the specified shared namespace
|
|
2935
2948
|
*/
|
|
2936
2949
|
shared(e) {
|
|
2937
|
-
return new
|
|
2950
|
+
return new W("shared", e, this._client);
|
|
2938
2951
|
}
|
|
2939
2952
|
}
|
|
2940
|
-
class
|
|
2953
|
+
class W {
|
|
2941
2954
|
constructor(e, t, s) {
|
|
2942
2955
|
this._kind = e, this._namespace = t, this._client = s;
|
|
2943
2956
|
}
|
|
@@ -3031,7 +3044,7 @@ class K {
|
|
|
3031
3044
|
})).success;
|
|
3032
3045
|
}
|
|
3033
3046
|
}
|
|
3034
|
-
class
|
|
3047
|
+
class xt {
|
|
3035
3048
|
constructor(e) {
|
|
3036
3049
|
this._client = e;
|
|
3037
3050
|
}
|
|
@@ -3054,7 +3067,7 @@ class St {
|
|
|
3054
3067
|
return e.user;
|
|
3055
3068
|
}
|
|
3056
3069
|
}
|
|
3057
|
-
class
|
|
3070
|
+
class St {
|
|
3058
3071
|
constructor(e) {
|
|
3059
3072
|
this._client = e;
|
|
3060
3073
|
}
|
|
@@ -3197,7 +3210,7 @@ class Nt {
|
|
|
3197
3210
|
return t;
|
|
3198
3211
|
}
|
|
3199
3212
|
}
|
|
3200
|
-
class
|
|
3213
|
+
class Nt {
|
|
3201
3214
|
constructor(e) {
|
|
3202
3215
|
this._client = e;
|
|
3203
3216
|
}
|
|
@@ -3244,7 +3257,7 @@ class Ct {
|
|
|
3244
3257
|
return r.rates;
|
|
3245
3258
|
}
|
|
3246
3259
|
}
|
|
3247
|
-
class
|
|
3260
|
+
class Ct {
|
|
3248
3261
|
constructor(e) {
|
|
3249
3262
|
this._client = e;
|
|
3250
3263
|
}
|
|
@@ -3308,15 +3321,15 @@ class Tt {
|
|
|
3308
3321
|
}, t)).success;
|
|
3309
3322
|
}
|
|
3310
3323
|
}
|
|
3311
|
-
function
|
|
3324
|
+
function J(a) {
|
|
3312
3325
|
return { ...a, type: "client" };
|
|
3313
3326
|
}
|
|
3314
|
-
const
|
|
3315
|
-
type:
|
|
3316
|
-
name:
|
|
3317
|
-
data:
|
|
3327
|
+
const Tt = ht({
|
|
3328
|
+
type: pt("bridge"),
|
|
3329
|
+
name: dt(),
|
|
3330
|
+
data: lt()
|
|
3318
3331
|
});
|
|
3319
|
-
class
|
|
3332
|
+
class Zt {
|
|
3320
3333
|
/**
|
|
3321
3334
|
* Creates a new RootSettingsNavigation API instance.
|
|
3322
3335
|
*
|
|
@@ -3377,7 +3390,7 @@ const z = 1e3 * 30, _e = typeof window > "u" && typeof self < "u", U = _e ? self
|
|
|
3377
3390
|
function B(a) {
|
|
3378
3391
|
_e ? self.postMessage(a) : U.parent.postMessage(a, "*");
|
|
3379
3392
|
}
|
|
3380
|
-
class
|
|
3393
|
+
class Ot {
|
|
3381
3394
|
/**
|
|
3382
3395
|
* Creates a new Client instance for communicating with the TelemetryOS platform.
|
|
3383
3396
|
*
|
|
@@ -3403,7 +3416,7 @@ class At {
|
|
|
3403
3416
|
* @returns An Accounts instance bound to this client
|
|
3404
3417
|
*/
|
|
3405
3418
|
get accounts() {
|
|
3406
|
-
return new
|
|
3419
|
+
return new _t(this);
|
|
3407
3420
|
}
|
|
3408
3421
|
/**
|
|
3409
3422
|
* Provides access to the users API for retrieving TelemetryOS user information.
|
|
@@ -3417,7 +3430,7 @@ class At {
|
|
|
3417
3430
|
* @returns A Users instance bound to this client
|
|
3418
3431
|
*/
|
|
3419
3432
|
get users() {
|
|
3420
|
-
return new
|
|
3433
|
+
return new xt(this);
|
|
3421
3434
|
}
|
|
3422
3435
|
/**
|
|
3423
3436
|
* Provides access to the store API for data persistence with multiple storage scopes.
|
|
@@ -3431,7 +3444,7 @@ class At {
|
|
|
3431
3444
|
* @returns A Store instance bound to this client
|
|
3432
3445
|
*/
|
|
3433
3446
|
get store() {
|
|
3434
|
-
return new
|
|
3447
|
+
return new kt(this);
|
|
3435
3448
|
}
|
|
3436
3449
|
/**
|
|
3437
3450
|
* Provides access to the applications API for discovering other TelemetryOS applications.
|
|
@@ -3445,7 +3458,7 @@ class At {
|
|
|
3445
3458
|
* @returns An Applications instance bound to this client
|
|
3446
3459
|
*/
|
|
3447
3460
|
get applications() {
|
|
3448
|
-
return new
|
|
3461
|
+
return new gt(this);
|
|
3449
3462
|
}
|
|
3450
3463
|
/**
|
|
3451
3464
|
* Provides access to the media API for working with content hosted on the TelemetryOS platform.
|
|
@@ -3460,7 +3473,7 @@ class At {
|
|
|
3460
3473
|
* @returns A Media instance bound to this client
|
|
3461
3474
|
*/
|
|
3462
3475
|
get media() {
|
|
3463
|
-
return new
|
|
3476
|
+
return new bt(this);
|
|
3464
3477
|
}
|
|
3465
3478
|
/**
|
|
3466
3479
|
* Provides access to the proxy API for fetching third-party content through the TelemetryOS API.
|
|
@@ -3474,7 +3487,7 @@ class At {
|
|
|
3474
3487
|
* @returns A Proxy instance bound to this client
|
|
3475
3488
|
*/
|
|
3476
3489
|
get proxy() {
|
|
3477
|
-
return new
|
|
3490
|
+
return new wt(this);
|
|
3478
3491
|
}
|
|
3479
3492
|
/**
|
|
3480
3493
|
* Provides access to the devices API for interacting with the current device.
|
|
@@ -3489,7 +3502,7 @@ class At {
|
|
|
3489
3502
|
* @returns A Devices instance bound to this client
|
|
3490
3503
|
*/
|
|
3491
3504
|
get devices() {
|
|
3492
|
-
return new
|
|
3505
|
+
return new yt(this);
|
|
3493
3506
|
}
|
|
3494
3507
|
/**
|
|
3495
3508
|
* Provides access to the root settings navigation API for TelemetryOS administration UI integration.
|
|
@@ -3507,7 +3520,7 @@ class At {
|
|
|
3507
3520
|
* @throws {Error} If used by an application not mounted at the 'rootSettingsNavigation' mount point
|
|
3508
3521
|
*/
|
|
3509
3522
|
get rootSettingsNavigation() {
|
|
3510
|
-
return new
|
|
3523
|
+
return new Zt(this.store);
|
|
3511
3524
|
}
|
|
3512
3525
|
/**
|
|
3513
3526
|
* Provides access to the weather API for retrieving weather data.
|
|
@@ -3521,7 +3534,7 @@ class At {
|
|
|
3521
3534
|
* @returns A Weather instance bound to this client
|
|
3522
3535
|
*/
|
|
3523
3536
|
get weather() {
|
|
3524
|
-
return new
|
|
3537
|
+
return new St(this);
|
|
3525
3538
|
}
|
|
3526
3539
|
/**
|
|
3527
3540
|
* Provides access to the currency API for retrieving currency exchange rates.
|
|
@@ -3535,7 +3548,7 @@ class At {
|
|
|
3535
3548
|
* @returns A Currency instance bound to this client
|
|
3536
3549
|
*/
|
|
3537
3550
|
get currency() {
|
|
3538
|
-
return new
|
|
3551
|
+
return new Nt(this);
|
|
3539
3552
|
}
|
|
3540
3553
|
/**
|
|
3541
3554
|
* Provides access to the environment API for accessing environment settings.
|
|
@@ -3549,10 +3562,10 @@ class At {
|
|
|
3549
3562
|
* @returns An Environment instance bound to this client
|
|
3550
3563
|
*/
|
|
3551
3564
|
get environment() {
|
|
3552
|
-
return new
|
|
3565
|
+
return new vt(this);
|
|
3553
3566
|
}
|
|
3554
3567
|
get mqtt() {
|
|
3555
|
-
return new
|
|
3568
|
+
return new Ct(this);
|
|
3556
3569
|
}
|
|
3557
3570
|
get applicationName() {
|
|
3558
3571
|
return this._applicationName;
|
|
@@ -3602,7 +3615,7 @@ class At {
|
|
|
3602
3615
|
o = { ...c(i.data.data), type: "bridge" };
|
|
3603
3616
|
}
|
|
3604
3617
|
if (!o) {
|
|
3605
|
-
const c =
|
|
3618
|
+
const c = Tt.safeParse(i.data);
|
|
3606
3619
|
if (!c.success)
|
|
3607
3620
|
return;
|
|
3608
3621
|
o = c.data;
|
|
@@ -3651,8 +3664,8 @@ class At {
|
|
|
3651
3664
|
* @param data The data payload to include with the message
|
|
3652
3665
|
*/
|
|
3653
3666
|
send(e, t) {
|
|
3654
|
-
const s =
|
|
3655
|
-
telemetrySdkVersion:
|
|
3667
|
+
const s = J({
|
|
3668
|
+
telemetrySdkVersion: G,
|
|
3656
3669
|
applicationName: this._applicationName,
|
|
3657
3670
|
applicationSpecifier: this._applicationSpecifier,
|
|
3658
3671
|
applicationInstance: this._applicationInstance,
|
|
@@ -3682,8 +3695,8 @@ class At {
|
|
|
3682
3695
|
*/
|
|
3683
3696
|
request(e, t, s) {
|
|
3684
3697
|
var n;
|
|
3685
|
-
const r =
|
|
3686
|
-
telemetrySdkVersion:
|
|
3698
|
+
const r = Q(), i = J({
|
|
3699
|
+
telemetrySdkVersion: G,
|
|
3687
3700
|
applicationName: this._applicationName,
|
|
3688
3701
|
applicationSpecifier: this._applicationSpecifier,
|
|
3689
3702
|
applicationInstance: this._applicationInstance,
|
|
@@ -3695,16 +3708,16 @@ class At {
|
|
|
3695
3708
|
const o = (n = s == null ? void 0 : s.timeout) !== null && n !== void 0 ? n : z;
|
|
3696
3709
|
let c = !1, h;
|
|
3697
3710
|
const g = new Promise((S) => {
|
|
3698
|
-
h = (
|
|
3699
|
-
c || S(
|
|
3711
|
+
h = (P) => {
|
|
3712
|
+
c || S(P);
|
|
3700
3713
|
}, this.once(r, h);
|
|
3701
3714
|
});
|
|
3702
3715
|
if (o === 0)
|
|
3703
3716
|
return g;
|
|
3704
|
-
const w = new Promise((S,
|
|
3705
|
-
const
|
|
3717
|
+
const w = new Promise((S, P) => {
|
|
3718
|
+
const F = new Error(`${e} message request with response name of ${r} timed out after ${o}`);
|
|
3706
3719
|
setTimeout(() => {
|
|
3707
|
-
c = !0, this.off(r, h),
|
|
3720
|
+
c = !0, this.off(r, h), P(F);
|
|
3708
3721
|
}, o);
|
|
3709
3722
|
});
|
|
3710
3723
|
return Promise.race([w, g]);
|
|
@@ -3712,11 +3725,11 @@ class At {
|
|
|
3712
3725
|
async subscribe(e, t, s) {
|
|
3713
3726
|
let n, r;
|
|
3714
3727
|
typeof t == "function" ? r = t : (n = t, r = s);
|
|
3715
|
-
const i =
|
|
3728
|
+
const i = Q(), o = Q();
|
|
3716
3729
|
let c = this._subscriptionNamesBySubjectName.get(e);
|
|
3717
3730
|
c || (c = [], this._subscriptionNamesBySubjectName.set(e, c)), c.push(i), this._subscriptionNamesByHandler.set(r, i), this.on(i, r);
|
|
3718
|
-
const h =
|
|
3719
|
-
telemetrySdkVersion:
|
|
3731
|
+
const h = J({
|
|
3732
|
+
telemetrySdkVersion: G,
|
|
3720
3733
|
applicationName: this._applicationName,
|
|
3721
3734
|
applicationSpecifier: this._applicationSpecifier,
|
|
3722
3735
|
applicationInstance: this._applicationInstance,
|
|
@@ -3727,22 +3740,22 @@ class At {
|
|
|
3727
3740
|
});
|
|
3728
3741
|
B(h);
|
|
3729
3742
|
let g = !1, w;
|
|
3730
|
-
const S = new Promise((
|
|
3731
|
-
const
|
|
3743
|
+
const S = new Promise((F, R) => {
|
|
3744
|
+
const se = new Error(`${e} subscribe request with subscription name of ${i} and response name of ${o} timed out after ${z}`);
|
|
3732
3745
|
setTimeout(() => {
|
|
3733
|
-
g = !0, this.off(o, w),
|
|
3746
|
+
g = !0, this.off(o, w), R(se);
|
|
3734
3747
|
}, z);
|
|
3735
|
-
}),
|
|
3736
|
-
w = (
|
|
3737
|
-
g ||
|
|
3738
|
-
}, this.
|
|
3748
|
+
}), P = new Promise((F) => {
|
|
3749
|
+
w = (R) => {
|
|
3750
|
+
g || F(R);
|
|
3751
|
+
}, this.once(o, w);
|
|
3739
3752
|
});
|
|
3740
|
-
return Promise.race([S,
|
|
3753
|
+
return Promise.race([S, P]);
|
|
3741
3754
|
}
|
|
3742
3755
|
async unsubscribe(e, t, s) {
|
|
3743
3756
|
let n, r;
|
|
3744
3757
|
typeof t == "function" ? r = t : (n = t, r = s);
|
|
3745
|
-
const i =
|
|
3758
|
+
const i = Q();
|
|
3746
3759
|
let o = [];
|
|
3747
3760
|
if (r) {
|
|
3748
3761
|
const c = this._subscriptionNamesByHandler.get(r);
|
|
@@ -3753,8 +3766,8 @@ class At {
|
|
|
3753
3766
|
return { success: !1 };
|
|
3754
3767
|
for await (const c of o) {
|
|
3755
3768
|
this.off(c, r);
|
|
3756
|
-
const h =
|
|
3757
|
-
telemetrySdkVersion:
|
|
3769
|
+
const h = J({
|
|
3770
|
+
telemetrySdkVersion: G,
|
|
3758
3771
|
applicationInstance: this._applicationInstance,
|
|
3759
3772
|
applicationName: this._applicationName,
|
|
3760
3773
|
applicationSpecifier: this._applicationSpecifier,
|
|
@@ -3765,17 +3778,17 @@ class At {
|
|
|
3765
3778
|
});
|
|
3766
3779
|
B(h);
|
|
3767
3780
|
let g = !1, w;
|
|
3768
|
-
const S = new Promise((
|
|
3769
|
-
const
|
|
3781
|
+
const S = new Promise((F, R) => {
|
|
3782
|
+
const se = new Error(`${e} unsubscribe request with unsubscribe name of ${c} and response name of ${i} timed out after ${z}`);
|
|
3770
3783
|
setTimeout(() => {
|
|
3771
|
-
g = !0, this.off(i, w),
|
|
3784
|
+
g = !0, this.off(i, w), R(se);
|
|
3772
3785
|
}, z);
|
|
3773
|
-
}),
|
|
3774
|
-
w = (
|
|
3775
|
-
g ||
|
|
3776
|
-
}, this.once(i,
|
|
3786
|
+
}), P = new Promise((F) => {
|
|
3787
|
+
w = (R) => {
|
|
3788
|
+
g || F(R);
|
|
3789
|
+
}, this.once(i, w);
|
|
3777
3790
|
});
|
|
3778
|
-
if (!(await Promise.race([S,
|
|
3791
|
+
if (!(await Promise.race([S, P])).success)
|
|
3779
3792
|
return { success: !1 };
|
|
3780
3793
|
}
|
|
3781
3794
|
return { success: !0 };
|
|
@@ -3852,11 +3865,11 @@ class At {
|
|
|
3852
3865
|
}
|
|
3853
3866
|
}
|
|
3854
3867
|
}
|
|
3855
|
-
function
|
|
3868
|
+
function Q() {
|
|
3856
3869
|
return Math.random().toString(36).slice(2, 9);
|
|
3857
3870
|
}
|
|
3858
|
-
const
|
|
3859
|
-
class
|
|
3871
|
+
const G = mt.version;
|
|
3872
|
+
class At {
|
|
3860
3873
|
constructor(e) {
|
|
3861
3874
|
this._client = e;
|
|
3862
3875
|
}
|
|
@@ -3905,7 +3918,7 @@ class It {
|
|
|
3905
3918
|
return !0;
|
|
3906
3919
|
}
|
|
3907
3920
|
}
|
|
3908
|
-
class
|
|
3921
|
+
class It {
|
|
3909
3922
|
constructor(e) {
|
|
3910
3923
|
this._client = e;
|
|
3911
3924
|
}
|
|
@@ -3961,12 +3974,12 @@ class Et {
|
|
|
3961
3974
|
return !0;
|
|
3962
3975
|
}
|
|
3963
3976
|
}
|
|
3964
|
-
class
|
|
3977
|
+
class Et extends Ot {
|
|
3965
3978
|
get playlist() {
|
|
3966
|
-
return new
|
|
3979
|
+
return new It(this);
|
|
3967
3980
|
}
|
|
3968
3981
|
get overrides() {
|
|
3969
|
-
return new
|
|
3982
|
+
return new At(this);
|
|
3970
3983
|
}
|
|
3971
3984
|
}
|
|
3972
3985
|
let f = null;
|
|
@@ -3974,7 +3987,7 @@ function Bt() {
|
|
|
3974
3987
|
return f;
|
|
3975
3988
|
}
|
|
3976
3989
|
function Ut(a) {
|
|
3977
|
-
f = new
|
|
3990
|
+
f = new Et(a), f.bind();
|
|
3978
3991
|
}
|
|
3979
3992
|
function Ht() {
|
|
3980
3993
|
f == null || f.unbind(), f = null;
|
|
@@ -4044,18 +4057,18 @@ function k(a) {
|
|
|
4044
4057
|
throw new Error("SDK is not configured");
|
|
4045
4058
|
}
|
|
4046
4059
|
export {
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4060
|
+
_t as Accounts,
|
|
4061
|
+
gt as Applications,
|
|
4062
|
+
Nt as Currency,
|
|
4063
|
+
yt as Devices,
|
|
4064
|
+
vt as Environment,
|
|
4065
|
+
bt as Media,
|
|
4066
|
+
Ct as Mqtt,
|
|
4067
|
+
wt as Proxy,
|
|
4068
|
+
kt as Store,
|
|
4069
|
+
W as StoreSlice,
|
|
4070
|
+
xt as Users,
|
|
4071
|
+
St as Weather,
|
|
4059
4072
|
ns as accounts,
|
|
4060
4073
|
ts as applications,
|
|
4061
4074
|
Ut as configure,
|
|
@@ -4076,7 +4089,7 @@ export {
|
|
|
4076
4089
|
Qt as send,
|
|
4077
4090
|
es as store,
|
|
4078
4091
|
Yt as subscribe,
|
|
4079
|
-
|
|
4092
|
+
G as telemetrySdkVersion,
|
|
4080
4093
|
Xt as unsubscribe,
|
|
4081
4094
|
as as users,
|
|
4082
4095
|
os as weather
|