@telemetryos/sdk 1.4.4 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +38 -23
- package/dist/index.js +628 -574
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -8,31 +8,31 @@ var w;
|
|
|
8
8
|
throw new Error();
|
|
9
9
|
}
|
|
10
10
|
a.assertNever = t, a.arrayToEnum = (n) => {
|
|
11
|
-
const
|
|
12
|
-
for (const
|
|
13
|
-
i
|
|
14
|
-
return
|
|
11
|
+
const r = {};
|
|
12
|
+
for (const i of n)
|
|
13
|
+
r[i] = i;
|
|
14
|
+
return r;
|
|
15
15
|
}, a.getValidEnumValues = (n) => {
|
|
16
|
-
const
|
|
17
|
-
for (const o of
|
|
18
|
-
|
|
19
|
-
return a.objectValues(
|
|
20
|
-
}, a.objectValues = (n) => a.objectKeys(n).map(function(
|
|
21
|
-
return n[
|
|
16
|
+
const r = a.objectKeys(n).filter((o) => typeof n[n[o]] != "number"), i = {};
|
|
17
|
+
for (const o of r)
|
|
18
|
+
i[o] = n[o];
|
|
19
|
+
return a.objectValues(i);
|
|
20
|
+
}, a.objectValues = (n) => a.objectKeys(n).map(function(r) {
|
|
21
|
+
return n[r];
|
|
22
22
|
}), a.objectKeys = typeof Object.keys == "function" ? (n) => Object.keys(n) : (n) => {
|
|
23
|
-
const
|
|
24
|
-
for (const
|
|
25
|
-
Object.prototype.hasOwnProperty.call(n,
|
|
26
|
-
return
|
|
27
|
-
}, a.find = (n,
|
|
28
|
-
for (const
|
|
29
|
-
if (i
|
|
30
|
-
return
|
|
23
|
+
const r = [];
|
|
24
|
+
for (const i in n)
|
|
25
|
+
Object.prototype.hasOwnProperty.call(n, i) && r.push(i);
|
|
26
|
+
return r;
|
|
27
|
+
}, a.find = (n, r) => {
|
|
28
|
+
for (const i of n)
|
|
29
|
+
if (r(i))
|
|
30
|
+
return i;
|
|
31
31
|
}, a.isInteger = typeof Number.isInteger == "function" ? (n) => Number.isInteger(n) : (n) => typeof n == "number" && isFinite(n) && Math.floor(n) === n;
|
|
32
|
-
function s(n,
|
|
33
|
-
return n.map((
|
|
32
|
+
function s(n, r = " | ") {
|
|
33
|
+
return n.map((i) => typeof i == "string" ? `'${i}'` : i).join(r);
|
|
34
34
|
}
|
|
35
|
-
a.joinValues = s, a.jsonStringifyReplacer = (n,
|
|
35
|
+
a.joinValues = s, a.jsonStringifyReplacer = (n, r) => typeof r == "bigint" ? r.toString() : r;
|
|
36
36
|
})(w || (w = {}));
|
|
37
37
|
var $e;
|
|
38
38
|
(function(a) {
|
|
@@ -63,7 +63,7 @@ const h = w.arrayToEnum([
|
|
|
63
63
|
"never",
|
|
64
64
|
"map",
|
|
65
65
|
"set"
|
|
66
|
-
]),
|
|
66
|
+
]), j = (a) => {
|
|
67
67
|
switch (typeof a) {
|
|
68
68
|
case "undefined":
|
|
69
69
|
return h.undefined;
|
|
@@ -101,8 +101,8 @@ const h = w.arrayToEnum([
|
|
|
101
101
|
"invalid_intersection_types",
|
|
102
102
|
"not_multiple_of",
|
|
103
103
|
"not_finite"
|
|
104
|
-
]),
|
|
105
|
-
let
|
|
104
|
+
]), rt = (a) => JSON.stringify(a, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
105
|
+
let O = class He extends Error {
|
|
106
106
|
get errors() {
|
|
107
107
|
return this.issues;
|
|
108
108
|
}
|
|
@@ -116,23 +116,23 @@ let C = class He extends Error {
|
|
|
116
116
|
Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
|
|
117
117
|
}
|
|
118
118
|
format(e) {
|
|
119
|
-
const t = e || function(
|
|
120
|
-
return
|
|
121
|
-
}, s = { _errors: [] }, n = (
|
|
122
|
-
for (const
|
|
123
|
-
if (
|
|
124
|
-
|
|
125
|
-
else if (
|
|
126
|
-
n(
|
|
127
|
-
else if (
|
|
128
|
-
n(
|
|
129
|
-
else if (
|
|
130
|
-
s._errors.push(t(
|
|
119
|
+
const t = e || function(r) {
|
|
120
|
+
return r.message;
|
|
121
|
+
}, s = { _errors: [] }, n = (r) => {
|
|
122
|
+
for (const i of r.issues)
|
|
123
|
+
if (i.code === "invalid_union")
|
|
124
|
+
i.unionErrors.map(n);
|
|
125
|
+
else if (i.code === "invalid_return_type")
|
|
126
|
+
n(i.returnTypeError);
|
|
127
|
+
else if (i.code === "invalid_arguments")
|
|
128
|
+
n(i.argumentsError);
|
|
129
|
+
else if (i.path.length === 0)
|
|
130
|
+
s._errors.push(t(i));
|
|
131
131
|
else {
|
|
132
132
|
let o = s, c = 0;
|
|
133
|
-
for (; c <
|
|
134
|
-
const u =
|
|
135
|
-
c ===
|
|
133
|
+
for (; c < i.path.length; ) {
|
|
134
|
+
const u = i.path[c];
|
|
135
|
+
c === i.path.length - 1 ? (o[u] = o[u] || { _errors: [] }, o[u]._errors.push(t(i))) : o[u] = o[u] || { _errors: [] }, o = o[u], c++;
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
};
|
|
@@ -161,7 +161,7 @@ let C = class He extends Error {
|
|
|
161
161
|
return this.flatten();
|
|
162
162
|
}
|
|
163
163
|
};
|
|
164
|
-
|
|
164
|
+
O.create = (a) => new O(a);
|
|
165
165
|
const H = (a, e) => {
|
|
166
166
|
let t;
|
|
167
167
|
switch (a.code) {
|
|
@@ -219,33 +219,33 @@ const H = (a, e) => {
|
|
|
219
219
|
return { message: t };
|
|
220
220
|
};
|
|
221
221
|
let Ke = H;
|
|
222
|
-
function
|
|
222
|
+
function ot(a) {
|
|
223
223
|
Ke = a;
|
|
224
224
|
}
|
|
225
225
|
function be() {
|
|
226
226
|
return Ke;
|
|
227
227
|
}
|
|
228
228
|
const ke = (a) => {
|
|
229
|
-
const { data: e, path: t, errorMaps: s, issueData: n } = a,
|
|
229
|
+
const { data: e, path: t, errorMaps: s, issueData: n } = a, r = [...t, ...n.path || []], i = {
|
|
230
230
|
...n,
|
|
231
|
-
path:
|
|
231
|
+
path: r
|
|
232
232
|
};
|
|
233
233
|
if (n.message !== void 0)
|
|
234
234
|
return {
|
|
235
235
|
...n,
|
|
236
|
-
path:
|
|
236
|
+
path: r,
|
|
237
237
|
message: n.message
|
|
238
238
|
};
|
|
239
239
|
let o = "";
|
|
240
240
|
const c = s.filter((u) => !!u).slice().reverse();
|
|
241
241
|
for (const u of c)
|
|
242
|
-
o = u(
|
|
242
|
+
o = u(i, { data: e, defaultError: o }).message;
|
|
243
243
|
return {
|
|
244
244
|
...n,
|
|
245
|
-
path:
|
|
245
|
+
path: r,
|
|
246
246
|
message: o
|
|
247
247
|
};
|
|
248
|
-
},
|
|
248
|
+
}, ct = [];
|
|
249
249
|
function l(a, e) {
|
|
250
250
|
const t = be(), s = ke({
|
|
251
251
|
issueData: e,
|
|
@@ -264,7 +264,7 @@ function l(a, e) {
|
|
|
264
264
|
});
|
|
265
265
|
a.common.issues.push(s);
|
|
266
266
|
}
|
|
267
|
-
let
|
|
267
|
+
let S = class We {
|
|
268
268
|
constructor() {
|
|
269
269
|
this.value = "valid";
|
|
270
270
|
}
|
|
@@ -286,10 +286,10 @@ let Z = class We {
|
|
|
286
286
|
static async mergeObjectAsync(e, t) {
|
|
287
287
|
const s = [];
|
|
288
288
|
for (const n of t) {
|
|
289
|
-
const
|
|
289
|
+
const r = await n.key, i = await n.value;
|
|
290
290
|
s.push({
|
|
291
|
-
key:
|
|
292
|
-
value:
|
|
291
|
+
key: r,
|
|
292
|
+
value: i
|
|
293
293
|
});
|
|
294
294
|
}
|
|
295
295
|
return We.mergeObjectSync(e, s);
|
|
@@ -297,17 +297,17 @@ let Z = class We {
|
|
|
297
297
|
static mergeObjectSync(e, t) {
|
|
298
298
|
const s = {};
|
|
299
299
|
for (const n of t) {
|
|
300
|
-
const { key:
|
|
301
|
-
if (
|
|
300
|
+
const { key: r, value: i } = n;
|
|
301
|
+
if (r.status === "aborted" || i.status === "aborted")
|
|
302
302
|
return y;
|
|
303
|
-
|
|
303
|
+
r.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), r.value !== "__proto__" && (typeof i.value < "u" || n.alwaysSet) && (s[r.value] = i.value);
|
|
304
304
|
}
|
|
305
305
|
return { status: e.value, value: s };
|
|
306
306
|
}
|
|
307
307
|
};
|
|
308
308
|
const y = Object.freeze({
|
|
309
309
|
status: "aborted"
|
|
310
|
-
}), xe = (a) => ({ status: "dirty", value: a }), x = (a) => ({ status: "valid", value: a }), Pe = (a) => a.status === "aborted", Re = (a) => a.status === "dirty",
|
|
310
|
+
}), xe = (a) => ({ status: "dirty", value: a }), x = (a) => ({ status: "valid", value: a }), Pe = (a) => a.status === "aborted", Re = (a) => a.status === "dirty", q = (a) => a.status === "valid", G = (a) => typeof Promise < "u" && a instanceof Promise;
|
|
311
311
|
function Ze(a, e, t, s) {
|
|
312
312
|
if (typeof e == "function" ? a !== e || !0 : !e.has(a)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
313
313
|
return e.get(a);
|
|
@@ -321,7 +321,7 @@ var p;
|
|
|
321
321
|
a.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, a.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
322
322
|
})(p || (p = {}));
|
|
323
323
|
var J, Y;
|
|
324
|
-
class
|
|
324
|
+
class I {
|
|
325
325
|
constructor(e, t, s, n) {
|
|
326
326
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = n;
|
|
327
327
|
}
|
|
@@ -330,7 +330,7 @@ class E {
|
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
332
|
const Ve = (a, e) => {
|
|
333
|
-
if (
|
|
333
|
+
if (q(e))
|
|
334
334
|
return { success: !0, data: e.value };
|
|
335
335
|
if (!a.common.issues.length)
|
|
336
336
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -339,7 +339,7 @@ const Ve = (a, e) => {
|
|
|
339
339
|
get error() {
|
|
340
340
|
if (this._error)
|
|
341
341
|
return this._error;
|
|
342
|
-
const t = new
|
|
342
|
+
const t = new O(a.common.issues);
|
|
343
343
|
return this._error = t, this._error;
|
|
344
344
|
}
|
|
345
345
|
};
|
|
@@ -350,24 +350,24 @@ function g(a) {
|
|
|
350
350
|
const { errorMap: e, invalid_type_error: t, required_error: s, description: n } = a;
|
|
351
351
|
if (e && (t || s))
|
|
352
352
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
353
|
-
return e ? { errorMap: e, description: n } : { errorMap: (
|
|
353
|
+
return e ? { errorMap: e, description: n } : { errorMap: (r, i) => {
|
|
354
354
|
var o, c;
|
|
355
355
|
const { message: u } = a;
|
|
356
|
-
return
|
|
356
|
+
return r.code === "invalid_enum_value" ? { message: u ?? i.defaultError } : typeof i.data > "u" ? { message: (o = u ?? s) !== null && o !== void 0 ? o : i.defaultError } : r.code !== "invalid_type" ? { message: i.defaultError } : { message: (c = u ?? t) !== null && c !== void 0 ? c : i.defaultError };
|
|
357
357
|
}, description: n };
|
|
358
358
|
}
|
|
359
|
-
class
|
|
359
|
+
let v = class {
|
|
360
360
|
get description() {
|
|
361
361
|
return this._def.description;
|
|
362
362
|
}
|
|
363
363
|
_getType(e) {
|
|
364
|
-
return
|
|
364
|
+
return j(e.data);
|
|
365
365
|
}
|
|
366
366
|
_getOrReturnCtx(e, t) {
|
|
367
367
|
return t || {
|
|
368
368
|
common: e.parent.common,
|
|
369
369
|
data: e.data,
|
|
370
|
-
parsedType:
|
|
370
|
+
parsedType: j(e.data),
|
|
371
371
|
schemaErrorMap: this._def.errorMap,
|
|
372
372
|
path: e.path,
|
|
373
373
|
parent: e.parent
|
|
@@ -375,11 +375,11 @@ class _ {
|
|
|
375
375
|
}
|
|
376
376
|
_processInputParams(e) {
|
|
377
377
|
return {
|
|
378
|
-
status: new
|
|
378
|
+
status: new S(),
|
|
379
379
|
ctx: {
|
|
380
380
|
common: e.parent.common,
|
|
381
381
|
data: e.data,
|
|
382
|
-
parsedType:
|
|
382
|
+
parsedType: j(e.data),
|
|
383
383
|
schemaErrorMap: this._def.errorMap,
|
|
384
384
|
path: e.path,
|
|
385
385
|
parent: e.parent
|
|
@@ -414,9 +414,9 @@ class _ {
|
|
|
414
414
|
schemaErrorMap: this._def.errorMap,
|
|
415
415
|
parent: null,
|
|
416
416
|
data: e,
|
|
417
|
-
parsedType:
|
|
418
|
-
},
|
|
419
|
-
return Ve(n,
|
|
417
|
+
parsedType: j(e)
|
|
418
|
+
}, r = this._parseSync({ data: e, path: n.path, parent: n });
|
|
419
|
+
return Ve(n, r);
|
|
420
420
|
}
|
|
421
421
|
"~validate"(e) {
|
|
422
422
|
var t, s;
|
|
@@ -429,24 +429,24 @@ class _ {
|
|
|
429
429
|
schemaErrorMap: this._def.errorMap,
|
|
430
430
|
parent: null,
|
|
431
431
|
data: e,
|
|
432
|
-
parsedType:
|
|
432
|
+
parsedType: j(e)
|
|
433
433
|
};
|
|
434
434
|
if (!this["~standard"].async)
|
|
435
435
|
try {
|
|
436
|
-
const
|
|
437
|
-
return
|
|
438
|
-
value:
|
|
436
|
+
const r = this._parseSync({ data: e, path: [], parent: n });
|
|
437
|
+
return q(r) ? {
|
|
438
|
+
value: r.value
|
|
439
439
|
} : {
|
|
440
440
|
issues: n.common.issues
|
|
441
441
|
};
|
|
442
|
-
} catch (
|
|
443
|
-
!((s = (t =
|
|
442
|
+
} catch (r) {
|
|
443
|
+
!((s = (t = r == null ? void 0 : r.message) === null || t === void 0 ? void 0 : t.toLowerCase()) === null || s === void 0) && s.includes("encountered") && (this["~standard"].async = !0), n.common = {
|
|
444
444
|
issues: [],
|
|
445
445
|
async: !0
|
|
446
446
|
};
|
|
447
447
|
}
|
|
448
|
-
return this._parseAsync({ data: e, path: [], parent: n }).then((
|
|
449
|
-
value:
|
|
448
|
+
return this._parseAsync({ data: e, path: [], parent: n }).then((r) => q(r) ? {
|
|
449
|
+
value: r.value
|
|
450
450
|
} : {
|
|
451
451
|
issues: n.common.issues
|
|
452
452
|
});
|
|
@@ -468,25 +468,25 @@ class _ {
|
|
|
468
468
|
schemaErrorMap: this._def.errorMap,
|
|
469
469
|
parent: null,
|
|
470
470
|
data: e,
|
|
471
|
-
parsedType:
|
|
472
|
-
}, n = this._parse({ data: e, path: s.path, parent: s }),
|
|
473
|
-
return Ve(s,
|
|
471
|
+
parsedType: j(e)
|
|
472
|
+
}, n = this._parse({ data: e, path: s.path, parent: s }), r = await (G(n) ? n : Promise.resolve(n));
|
|
473
|
+
return Ve(s, r);
|
|
474
474
|
}
|
|
475
475
|
refine(e, t) {
|
|
476
476
|
const s = (n) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(n) : t;
|
|
477
|
-
return this._refinement((n,
|
|
478
|
-
const
|
|
477
|
+
return this._refinement((n, r) => {
|
|
478
|
+
const i = e(n), o = () => r.addIssue({
|
|
479
479
|
code: d.custom,
|
|
480
480
|
...s(n)
|
|
481
481
|
});
|
|
482
|
-
return typeof Promise < "u" &&
|
|
482
|
+
return typeof Promise < "u" && i instanceof Promise ? i.then((c) => c ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
|
|
483
483
|
});
|
|
484
484
|
}
|
|
485
485
|
refinement(e, t) {
|
|
486
486
|
return this._refinement((s, n) => e(s) ? !0 : (n.addIssue(typeof t == "function" ? t(s, n) : t), !1));
|
|
487
487
|
}
|
|
488
488
|
_refinement(e) {
|
|
489
|
-
return new
|
|
489
|
+
return new A({
|
|
490
490
|
schema: this,
|
|
491
491
|
typeName: m.ZodEffects,
|
|
492
492
|
effect: { type: "refinement", refinement: e }
|
|
@@ -503,7 +503,7 @@ class _ {
|
|
|
503
503
|
};
|
|
504
504
|
}
|
|
505
505
|
optional() {
|
|
506
|
-
return
|
|
506
|
+
return E.create(this, this._def);
|
|
507
507
|
}
|
|
508
508
|
nullable() {
|
|
509
509
|
return M.create(this, this._def);
|
|
@@ -524,7 +524,7 @@ class _ {
|
|
|
524
524
|
return ne.create(this, e, this._def);
|
|
525
525
|
}
|
|
526
526
|
transform(e) {
|
|
527
|
-
return new
|
|
527
|
+
return new A({
|
|
528
528
|
...g(this._def),
|
|
529
529
|
schema: this,
|
|
530
530
|
typeName: m.ZodEffects,
|
|
@@ -541,7 +541,7 @@ class _ {
|
|
|
541
541
|
});
|
|
542
542
|
}
|
|
543
543
|
brand() {
|
|
544
|
-
return new
|
|
544
|
+
return new ze({
|
|
545
545
|
typeName: m.ZodBranded,
|
|
546
546
|
type: this,
|
|
547
547
|
...g(this._def)
|
|
@@ -575,17 +575,17 @@ class _ {
|
|
|
575
575
|
isNullable() {
|
|
576
576
|
return this.safeParse(null).success;
|
|
577
577
|
}
|
|
578
|
-
}
|
|
579
|
-
const
|
|
578
|
+
};
|
|
579
|
+
const dt = /^c[^\s-]{8,}$/i, ut = /^[0-9a-z]+$/, lt = /^[0-9A-HJKMNP-TV-Z]{26}$/i, ht = /^[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, pt = /^[a-z0-9_-]{21}$/i, ft = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, mt = /^[-+]?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)?)??$/, yt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, gt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
580
580
|
let je;
|
|
581
|
-
const
|
|
581
|
+
const _t = /^(?:(?: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])$/, vt = /^(?:(?: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])$/, wt = /^(([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]))$/, bt = /^(([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])$/, kt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, xt = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Ye = "((\\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])))", Zt = new RegExp(`^${Ye}$`);
|
|
582
582
|
function Ge(a) {
|
|
583
583
|
let e = "[0-5]\\d";
|
|
584
584
|
a.precision ? e = `${e}\\.\\d{${a.precision}}` : a.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
585
585
|
const t = a.precision ? "+" : "?";
|
|
586
586
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
|
|
587
587
|
}
|
|
588
|
-
function
|
|
588
|
+
function St(a) {
|
|
589
589
|
return new RegExp(`^${Ge(a)}$`);
|
|
590
590
|
}
|
|
591
591
|
function Xe(a) {
|
|
@@ -593,11 +593,11 @@ function Xe(a) {
|
|
|
593
593
|
const t = [];
|
|
594
594
|
return t.push(a.local ? "Z?" : "Z"), a.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
595
595
|
}
|
|
596
|
-
function St(a, e) {
|
|
597
|
-
return !!((e === "v4" || !e) && gt.test(a) || (e === "v6" || !e) && vt.test(a));
|
|
598
|
-
}
|
|
599
596
|
function Tt(a, e) {
|
|
600
|
-
|
|
597
|
+
return !!((e === "v4" || !e) && _t.test(a) || (e === "v6" || !e) && wt.test(a));
|
|
598
|
+
}
|
|
599
|
+
function Nt(a, e) {
|
|
600
|
+
if (!ft.test(a))
|
|
601
601
|
return !1;
|
|
602
602
|
try {
|
|
603
603
|
const [t] = a.split("."), s = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), n = JSON.parse(atob(s));
|
|
@@ -606,10 +606,10 @@ function Tt(a, e) {
|
|
|
606
606
|
return !1;
|
|
607
607
|
}
|
|
608
608
|
}
|
|
609
|
-
function
|
|
610
|
-
return !!((e === "v4" || !e) &&
|
|
609
|
+
function Ct(a, e) {
|
|
610
|
+
return !!((e === "v4" || !e) && vt.test(a) || (e === "v6" || !e) && bt.test(a));
|
|
611
611
|
}
|
|
612
|
-
class
|
|
612
|
+
class C extends v {
|
|
613
613
|
_parse(e) {
|
|
614
614
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== h.string) {
|
|
615
615
|
const n = this._getOrReturnCtx(e);
|
|
@@ -619,7 +619,7 @@ class N extends _ {
|
|
|
619
619
|
received: n.parsedType
|
|
620
620
|
}), y;
|
|
621
621
|
}
|
|
622
|
-
const t = new
|
|
622
|
+
const t = new S();
|
|
623
623
|
let s;
|
|
624
624
|
for (const n of this._def.checks)
|
|
625
625
|
if (n.kind === "min")
|
|
@@ -641,15 +641,15 @@ class N extends _ {
|
|
|
641
641
|
message: n.message
|
|
642
642
|
}), t.dirty());
|
|
643
643
|
else if (n.kind === "length") {
|
|
644
|
-
const
|
|
645
|
-
(
|
|
644
|
+
const r = e.data.length > n.value, i = e.data.length < n.value;
|
|
645
|
+
(r || i) && (s = this._getOrReturnCtx(e, s), r ? l(s, {
|
|
646
646
|
code: d.too_big,
|
|
647
647
|
maximum: n.value,
|
|
648
648
|
type: "string",
|
|
649
649
|
inclusive: !0,
|
|
650
650
|
exact: !0,
|
|
651
651
|
message: n.message
|
|
652
|
-
}) :
|
|
652
|
+
}) : i && l(s, {
|
|
653
653
|
code: d.too_small,
|
|
654
654
|
minimum: n.value,
|
|
655
655
|
type: "string",
|
|
@@ -658,43 +658,43 @@ class N extends _ {
|
|
|
658
658
|
message: n.message
|
|
659
659
|
}), t.dirty());
|
|
660
660
|
} else if (n.kind === "email")
|
|
661
|
-
|
|
661
|
+
yt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
662
662
|
validation: "email",
|
|
663
663
|
code: d.invalid_string,
|
|
664
664
|
message: n.message
|
|
665
665
|
}), t.dirty());
|
|
666
666
|
else if (n.kind === "emoji")
|
|
667
|
-
je || (je = new RegExp(
|
|
667
|
+
je || (je = new RegExp(gt, "u")), je.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
668
668
|
validation: "emoji",
|
|
669
669
|
code: d.invalid_string,
|
|
670
670
|
message: n.message
|
|
671
671
|
}), t.dirty());
|
|
672
672
|
else if (n.kind === "uuid")
|
|
673
|
-
|
|
673
|
+
ht.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
674
674
|
validation: "uuid",
|
|
675
675
|
code: d.invalid_string,
|
|
676
676
|
message: n.message
|
|
677
677
|
}), t.dirty());
|
|
678
678
|
else if (n.kind === "nanoid")
|
|
679
|
-
|
|
679
|
+
pt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
680
680
|
validation: "nanoid",
|
|
681
681
|
code: d.invalid_string,
|
|
682
682
|
message: n.message
|
|
683
683
|
}), t.dirty());
|
|
684
684
|
else if (n.kind === "cuid")
|
|
685
|
-
|
|
685
|
+
dt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
686
686
|
validation: "cuid",
|
|
687
687
|
code: d.invalid_string,
|
|
688
688
|
message: n.message
|
|
689
689
|
}), t.dirty());
|
|
690
690
|
else if (n.kind === "cuid2")
|
|
691
|
-
|
|
691
|
+
ut.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
692
692
|
validation: "cuid2",
|
|
693
693
|
code: d.invalid_string,
|
|
694
694
|
message: n.message
|
|
695
695
|
}), t.dirty());
|
|
696
696
|
else if (n.kind === "ulid")
|
|
697
|
-
|
|
697
|
+
lt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
698
698
|
validation: "ulid",
|
|
699
699
|
code: d.invalid_string,
|
|
700
700
|
message: n.message
|
|
@@ -729,35 +729,35 @@ class N extends _ {
|
|
|
729
729
|
code: d.invalid_string,
|
|
730
730
|
validation: "datetime",
|
|
731
731
|
message: n.message
|
|
732
|
-
}), t.dirty()) : n.kind === "date" ?
|
|
732
|
+
}), t.dirty()) : n.kind === "date" ? Zt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
733
733
|
code: d.invalid_string,
|
|
734
734
|
validation: "date",
|
|
735
735
|
message: n.message
|
|
736
|
-
}), t.dirty()) : n.kind === "time" ?
|
|
736
|
+
}), t.dirty()) : n.kind === "time" ? St(n).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
737
737
|
code: d.invalid_string,
|
|
738
738
|
validation: "time",
|
|
739
739
|
message: n.message
|
|
740
|
-
}), t.dirty()) : n.kind === "duration" ?
|
|
740
|
+
}), t.dirty()) : n.kind === "duration" ? mt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
741
741
|
validation: "duration",
|
|
742
742
|
code: d.invalid_string,
|
|
743
743
|
message: n.message
|
|
744
|
-
}), t.dirty()) : n.kind === "ip" ?
|
|
744
|
+
}), t.dirty()) : n.kind === "ip" ? Tt(e.data, n.version) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
745
745
|
validation: "ip",
|
|
746
746
|
code: d.invalid_string,
|
|
747
747
|
message: n.message
|
|
748
|
-
}), t.dirty()) : n.kind === "jwt" ?
|
|
748
|
+
}), t.dirty()) : n.kind === "jwt" ? Nt(e.data, n.alg) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
749
749
|
validation: "jwt",
|
|
750
750
|
code: d.invalid_string,
|
|
751
751
|
message: n.message
|
|
752
|
-
}), t.dirty()) : n.kind === "cidr" ?
|
|
752
|
+
}), t.dirty()) : n.kind === "cidr" ? Ct(e.data, n.version) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
753
753
|
validation: "cidr",
|
|
754
754
|
code: d.invalid_string,
|
|
755
755
|
message: n.message
|
|
756
|
-
}), t.dirty()) : n.kind === "base64" ?
|
|
756
|
+
}), t.dirty()) : n.kind === "base64" ? kt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
757
757
|
validation: "base64",
|
|
758
758
|
code: d.invalid_string,
|
|
759
759
|
message: n.message
|
|
760
|
-
}), t.dirty()) : n.kind === "base64url" ?
|
|
760
|
+
}), t.dirty()) : n.kind === "base64url" ? xt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
761
761
|
validation: "base64url",
|
|
762
762
|
code: d.invalid_string,
|
|
763
763
|
message: n.message
|
|
@@ -772,7 +772,7 @@ class N extends _ {
|
|
|
772
772
|
});
|
|
773
773
|
}
|
|
774
774
|
_addCheck(e) {
|
|
775
|
-
return new
|
|
775
|
+
return new C({
|
|
776
776
|
...this._def,
|
|
777
777
|
checks: [...this._def.checks, e]
|
|
778
778
|
});
|
|
@@ -909,19 +909,19 @@ class N extends _ {
|
|
|
909
909
|
return this.min(1, p.errToObj(e));
|
|
910
910
|
}
|
|
911
911
|
trim() {
|
|
912
|
-
return new
|
|
912
|
+
return new C({
|
|
913
913
|
...this._def,
|
|
914
914
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
915
915
|
});
|
|
916
916
|
}
|
|
917
917
|
toLowerCase() {
|
|
918
|
-
return new
|
|
918
|
+
return new C({
|
|
919
919
|
...this._def,
|
|
920
920
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
921
921
|
});
|
|
922
922
|
}
|
|
923
923
|
toUpperCase() {
|
|
924
|
-
return new
|
|
924
|
+
return new C({
|
|
925
925
|
...this._def,
|
|
926
926
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
927
927
|
});
|
|
@@ -987,20 +987,20 @@ class N extends _ {
|
|
|
987
987
|
return e;
|
|
988
988
|
}
|
|
989
989
|
}
|
|
990
|
-
|
|
990
|
+
C.create = (a) => {
|
|
991
991
|
var e;
|
|
992
|
-
return new
|
|
992
|
+
return new C({
|
|
993
993
|
checks: [],
|
|
994
994
|
typeName: m.ZodString,
|
|
995
995
|
coerce: (e = a == null ? void 0 : a.coerce) !== null && e !== void 0 ? e : !1,
|
|
996
996
|
...g(a)
|
|
997
997
|
});
|
|
998
998
|
};
|
|
999
|
-
function
|
|
1000
|
-
const t = (a.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, n = t > s ? t : s,
|
|
1001
|
-
return
|
|
999
|
+
function Ot(a, e) {
|
|
1000
|
+
const t = (a.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, n = t > s ? t : s, r = parseInt(a.toFixed(n).replace(".", "")), i = parseInt(e.toFixed(n).replace(".", ""));
|
|
1001
|
+
return r % i / Math.pow(10, n);
|
|
1002
1002
|
}
|
|
1003
|
-
let X = class Me extends
|
|
1003
|
+
let X = class Me extends v {
|
|
1004
1004
|
constructor() {
|
|
1005
1005
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1006
1006
|
}
|
|
@@ -1014,7 +1014,7 @@ let X = class Me extends _ {
|
|
|
1014
1014
|
}), y;
|
|
1015
1015
|
}
|
|
1016
1016
|
let t;
|
|
1017
|
-
const s = new
|
|
1017
|
+
const s = new S();
|
|
1018
1018
|
for (const n of this._def.checks)
|
|
1019
1019
|
n.kind === "int" ? w.isInteger(e.data) || (t = this._getOrReturnCtx(e, t), l(t, {
|
|
1020
1020
|
code: d.invalid_type,
|
|
@@ -1035,7 +1035,7 @@ let X = class Me extends _ {
|
|
|
1035
1035
|
inclusive: n.inclusive,
|
|
1036
1036
|
exact: !1,
|
|
1037
1037
|
message: n.message
|
|
1038
|
-
}), s.dirty()) : n.kind === "multipleOf" ?
|
|
1038
|
+
}), s.dirty()) : n.kind === "multipleOf" ? Ot(e.data, n.value) !== 0 && (t = this._getOrReturnCtx(e, t), l(t, {
|
|
1039
1039
|
code: d.not_multiple_of,
|
|
1040
1040
|
multipleOf: n.value,
|
|
1041
1041
|
message: n.message
|
|
@@ -1172,7 +1172,7 @@ X.create = (a) => new X({
|
|
|
1172
1172
|
coerce: (a == null ? void 0 : a.coerce) || !1,
|
|
1173
1173
|
...g(a)
|
|
1174
1174
|
});
|
|
1175
|
-
let Q = class Fe extends
|
|
1175
|
+
let Q = class Fe extends v {
|
|
1176
1176
|
constructor() {
|
|
1177
1177
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1178
1178
|
}
|
|
@@ -1186,7 +1186,7 @@ let Q = class Fe extends _ {
|
|
|
1186
1186
|
if (this._getType(e) !== h.bigint)
|
|
1187
1187
|
return this._getInvalidInput(e);
|
|
1188
1188
|
let t;
|
|
1189
|
-
const s = new
|
|
1189
|
+
const s = new S();
|
|
1190
1190
|
for (const n of this._def.checks)
|
|
1191
1191
|
n.kind === "min" ? (n.inclusive ? e.data < n.value : e.data <= n.value) && (t = this._getOrReturnCtx(e, t), l(t, {
|
|
1192
1192
|
code: d.too_small,
|
|
@@ -1308,7 +1308,7 @@ Q.create = (a) => {
|
|
|
1308
1308
|
...g(a)
|
|
1309
1309
|
});
|
|
1310
1310
|
};
|
|
1311
|
-
class ee extends
|
|
1311
|
+
class ee extends v {
|
|
1312
1312
|
_parse(e) {
|
|
1313
1313
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== h.boolean) {
|
|
1314
1314
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1326,7 +1326,7 @@ ee.create = (a) => new ee({
|
|
|
1326
1326
|
coerce: (a == null ? void 0 : a.coerce) || !1,
|
|
1327
1327
|
...g(a)
|
|
1328
1328
|
});
|
|
1329
|
-
class
|
|
1329
|
+
class z extends v {
|
|
1330
1330
|
_parse(e) {
|
|
1331
1331
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== h.date) {
|
|
1332
1332
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1342,7 +1342,7 @@ class q extends _ {
|
|
|
1342
1342
|
code: d.invalid_date
|
|
1343
1343
|
}), y;
|
|
1344
1344
|
}
|
|
1345
|
-
const t = new
|
|
1345
|
+
const t = new S();
|
|
1346
1346
|
let s;
|
|
1347
1347
|
for (const n of this._def.checks)
|
|
1348
1348
|
n.kind === "min" ? e.data.getTime() < n.value && (s = this._getOrReturnCtx(e, s), l(s, {
|
|
@@ -1366,7 +1366,7 @@ class q extends _ {
|
|
|
1366
1366
|
};
|
|
1367
1367
|
}
|
|
1368
1368
|
_addCheck(e) {
|
|
1369
|
-
return new
|
|
1369
|
+
return new z({
|
|
1370
1370
|
...this._def,
|
|
1371
1371
|
checks: [...this._def.checks, e]
|
|
1372
1372
|
});
|
|
@@ -1398,13 +1398,13 @@ class q extends _ {
|
|
|
1398
1398
|
return e != null ? new Date(e) : null;
|
|
1399
1399
|
}
|
|
1400
1400
|
}
|
|
1401
|
-
|
|
1401
|
+
z.create = (a) => new z({
|
|
1402
1402
|
checks: [],
|
|
1403
1403
|
coerce: (a == null ? void 0 : a.coerce) || !1,
|
|
1404
1404
|
typeName: m.ZodDate,
|
|
1405
1405
|
...g(a)
|
|
1406
1406
|
});
|
|
1407
|
-
class Se extends
|
|
1407
|
+
class Se extends v {
|
|
1408
1408
|
_parse(e) {
|
|
1409
1409
|
if (this._getType(e) !== h.symbol) {
|
|
1410
1410
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1421,7 +1421,7 @@ Se.create = (a) => new Se({
|
|
|
1421
1421
|
typeName: m.ZodSymbol,
|
|
1422
1422
|
...g(a)
|
|
1423
1423
|
});
|
|
1424
|
-
class te extends
|
|
1424
|
+
class te extends v {
|
|
1425
1425
|
_parse(e) {
|
|
1426
1426
|
if (this._getType(e) !== h.undefined) {
|
|
1427
1427
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1438,7 +1438,7 @@ te.create = (a) => new te({
|
|
|
1438
1438
|
typeName: m.ZodUndefined,
|
|
1439
1439
|
...g(a)
|
|
1440
1440
|
});
|
|
1441
|
-
class se extends
|
|
1441
|
+
class se extends v {
|
|
1442
1442
|
_parse(e) {
|
|
1443
1443
|
if (this._getType(e) !== h.null) {
|
|
1444
1444
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1455,19 +1455,19 @@ se.create = (a) => new se({
|
|
|
1455
1455
|
typeName: m.ZodNull,
|
|
1456
1456
|
...g(a)
|
|
1457
1457
|
});
|
|
1458
|
-
|
|
1458
|
+
let K = class extends v {
|
|
1459
1459
|
constructor() {
|
|
1460
1460
|
super(...arguments), this._any = !0;
|
|
1461
1461
|
}
|
|
1462
1462
|
_parse(e) {
|
|
1463
1463
|
return x(e.data);
|
|
1464
1464
|
}
|
|
1465
|
-
}
|
|
1465
|
+
};
|
|
1466
1466
|
K.create = (a) => new K({
|
|
1467
1467
|
typeName: m.ZodAny,
|
|
1468
1468
|
...g(a)
|
|
1469
1469
|
});
|
|
1470
|
-
class D extends
|
|
1470
|
+
class D extends v {
|
|
1471
1471
|
constructor() {
|
|
1472
1472
|
super(...arguments), this._unknown = !0;
|
|
1473
1473
|
}
|
|
@@ -1479,7 +1479,7 @@ D.create = (a) => new D({
|
|
|
1479
1479
|
typeName: m.ZodUnknown,
|
|
1480
1480
|
...g(a)
|
|
1481
1481
|
});
|
|
1482
|
-
|
|
1482
|
+
class $ extends v {
|
|
1483
1483
|
_parse(e) {
|
|
1484
1484
|
const t = this._getOrReturnCtx(e);
|
|
1485
1485
|
return l(t, {
|
|
@@ -1488,12 +1488,12 @@ let P = class extends _ {
|
|
|
1488
1488
|
received: t.parsedType
|
|
1489
1489
|
}), y;
|
|
1490
1490
|
}
|
|
1491
|
-
}
|
|
1492
|
-
|
|
1491
|
+
}
|
|
1492
|
+
$.create = (a) => new $({
|
|
1493
1493
|
typeName: m.ZodNever,
|
|
1494
1494
|
...g(a)
|
|
1495
1495
|
});
|
|
1496
|
-
class Te extends
|
|
1496
|
+
class Te extends v {
|
|
1497
1497
|
_parse(e) {
|
|
1498
1498
|
if (this._getType(e) !== h.undefined) {
|
|
1499
1499
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1510,7 +1510,7 @@ Te.create = (a) => new Te({
|
|
|
1510
1510
|
typeName: m.ZodVoid,
|
|
1511
1511
|
...g(a)
|
|
1512
1512
|
});
|
|
1513
|
-
let V = class ve extends
|
|
1513
|
+
let V = class ve extends v {
|
|
1514
1514
|
_parse(e) {
|
|
1515
1515
|
const { ctx: t, status: s } = this._processInputParams(e), n = this._def;
|
|
1516
1516
|
if (t.parsedType !== h.array)
|
|
@@ -1520,11 +1520,11 @@ let V = class ve extends _ {
|
|
|
1520
1520
|
received: t.parsedType
|
|
1521
1521
|
}), y;
|
|
1522
1522
|
if (n.exactLength !== null) {
|
|
1523
|
-
const
|
|
1524
|
-
(
|
|
1525
|
-
code:
|
|
1523
|
+
const i = t.data.length > n.exactLength.value, o = t.data.length < n.exactLength.value;
|
|
1524
|
+
(i || o) && (l(t, {
|
|
1525
|
+
code: i ? d.too_big : d.too_small,
|
|
1526
1526
|
minimum: o ? n.exactLength.value : void 0,
|
|
1527
|
-
maximum:
|
|
1527
|
+
maximum: i ? n.exactLength.value : void 0,
|
|
1528
1528
|
type: "array",
|
|
1529
1529
|
inclusive: !0,
|
|
1530
1530
|
exact: !0,
|
|
@@ -1546,9 +1546,9 @@ let V = class ve extends _ {
|
|
|
1546
1546
|
exact: !1,
|
|
1547
1547
|
message: n.maxLength.message
|
|
1548
1548
|
}), s.dirty()), t.common.async)
|
|
1549
|
-
return Promise.all([...t.data].map((
|
|
1550
|
-
const
|
|
1551
|
-
return
|
|
1549
|
+
return Promise.all([...t.data].map((i, o) => n.type._parseAsync(new I(t, i, t.path, o)))).then((i) => S.mergeArray(s, i));
|
|
1550
|
+
const r = [...t.data].map((i, o) => n.type._parseSync(new I(t, i, t.path, o)));
|
|
1551
|
+
return S.mergeArray(s, r);
|
|
1552
1552
|
}
|
|
1553
1553
|
get element() {
|
|
1554
1554
|
return this._def.type;
|
|
@@ -1584,22 +1584,22 @@ V.create = (a, e) => new V({
|
|
|
1584
1584
|
...g(e)
|
|
1585
1585
|
});
|
|
1586
1586
|
function U(a) {
|
|
1587
|
-
if (a instanceof
|
|
1587
|
+
if (a instanceof T) {
|
|
1588
1588
|
const e = {};
|
|
1589
1589
|
for (const t in a.shape) {
|
|
1590
1590
|
const s = a.shape[t];
|
|
1591
|
-
e[t] =
|
|
1591
|
+
e[t] = E.create(U(s));
|
|
1592
1592
|
}
|
|
1593
|
-
return new
|
|
1593
|
+
return new T({
|
|
1594
1594
|
...a._def,
|
|
1595
1595
|
shape: () => e
|
|
1596
1596
|
});
|
|
1597
1597
|
} else return a instanceof V ? new V({
|
|
1598
1598
|
...a._def,
|
|
1599
1599
|
type: U(a.element)
|
|
1600
|
-
}) : a instanceof
|
|
1600
|
+
}) : a instanceof E ? E.create(U(a.unwrap())) : a instanceof M ? M.create(U(a.unwrap())) : a instanceof R ? R.create(a.items.map((e) => U(e))) : a;
|
|
1601
1601
|
}
|
|
1602
|
-
let
|
|
1602
|
+
let T = class N extends v {
|
|
1603
1603
|
constructor() {
|
|
1604
1604
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1605
1605
|
}
|
|
@@ -1618,41 +1618,41 @@ let S = class T extends _ {
|
|
|
1618
1618
|
received: c.parsedType
|
|
1619
1619
|
}), y;
|
|
1620
1620
|
}
|
|
1621
|
-
const { status: t, ctx: s } = this._processInputParams(e), { shape: n, keys:
|
|
1622
|
-
if (!(this._def.catchall instanceof
|
|
1621
|
+
const { status: t, ctx: s } = this._processInputParams(e), { shape: n, keys: r } = this._getCached(), i = [];
|
|
1622
|
+
if (!(this._def.catchall instanceof $ && this._def.unknownKeys === "strip"))
|
|
1623
1623
|
for (const c in s.data)
|
|
1624
|
-
|
|
1624
|
+
r.includes(c) || i.push(c);
|
|
1625
1625
|
const o = [];
|
|
1626
|
-
for (const c of
|
|
1626
|
+
for (const c of r) {
|
|
1627
1627
|
const u = n[c], f = s.data[c];
|
|
1628
1628
|
o.push({
|
|
1629
1629
|
key: { status: "valid", value: c },
|
|
1630
|
-
value: u._parse(new
|
|
1630
|
+
value: u._parse(new I(s, f, s.path, c)),
|
|
1631
1631
|
alwaysSet: c in s.data
|
|
1632
1632
|
});
|
|
1633
1633
|
}
|
|
1634
|
-
if (this._def.catchall instanceof
|
|
1634
|
+
if (this._def.catchall instanceof $) {
|
|
1635
1635
|
const c = this._def.unknownKeys;
|
|
1636
1636
|
if (c === "passthrough")
|
|
1637
|
-
for (const u of
|
|
1637
|
+
for (const u of i)
|
|
1638
1638
|
o.push({
|
|
1639
1639
|
key: { status: "valid", value: u },
|
|
1640
1640
|
value: { status: "valid", value: s.data[u] }
|
|
1641
1641
|
});
|
|
1642
1642
|
else if (c === "strict")
|
|
1643
|
-
|
|
1643
|
+
i.length > 0 && (l(s, {
|
|
1644
1644
|
code: d.unrecognized_keys,
|
|
1645
|
-
keys:
|
|
1645
|
+
keys: i
|
|
1646
1646
|
}), t.dirty());
|
|
1647
1647
|
else if (c !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
1648
1648
|
} else {
|
|
1649
1649
|
const c = this._def.catchall;
|
|
1650
|
-
for (const u of
|
|
1650
|
+
for (const u of i) {
|
|
1651
1651
|
const f = s.data[u];
|
|
1652
1652
|
o.push({
|
|
1653
1653
|
key: { status: "valid", value: u },
|
|
1654
1654
|
value: c._parse(
|
|
1655
|
-
new
|
|
1655
|
+
new I(s, f, s.path, u)
|
|
1656
1656
|
//, ctx.child(key), value, getParsedType(value)
|
|
1657
1657
|
),
|
|
1658
1658
|
alwaysSet: u in s.data
|
|
@@ -1670,19 +1670,19 @@ let S = class T extends _ {
|
|
|
1670
1670
|
});
|
|
1671
1671
|
}
|
|
1672
1672
|
return c;
|
|
1673
|
-
}).then((c) =>
|
|
1673
|
+
}).then((c) => S.mergeObjectSync(t, c)) : S.mergeObjectSync(t, o);
|
|
1674
1674
|
}
|
|
1675
1675
|
get shape() {
|
|
1676
1676
|
return this._def.shape();
|
|
1677
1677
|
}
|
|
1678
1678
|
strict(e) {
|
|
1679
|
-
return p.errToObj, new
|
|
1679
|
+
return p.errToObj, new N({
|
|
1680
1680
|
...this._def,
|
|
1681
1681
|
unknownKeys: "strict",
|
|
1682
1682
|
...e !== void 0 ? {
|
|
1683
1683
|
errorMap: (t, s) => {
|
|
1684
|
-
var n,
|
|
1685
|
-
const c = (
|
|
1684
|
+
var n, r, i, o;
|
|
1685
|
+
const c = (i = (r = (n = this._def).errorMap) === null || r === void 0 ? void 0 : r.call(n, t, s).message) !== null && i !== void 0 ? i : s.defaultError;
|
|
1686
1686
|
return t.code === "unrecognized_keys" ? {
|
|
1687
1687
|
message: (o = p.errToObj(e).message) !== null && o !== void 0 ? o : c
|
|
1688
1688
|
} : {
|
|
@@ -1693,13 +1693,13 @@ let S = class T extends _ {
|
|
|
1693
1693
|
});
|
|
1694
1694
|
}
|
|
1695
1695
|
strip() {
|
|
1696
|
-
return new
|
|
1696
|
+
return new N({
|
|
1697
1697
|
...this._def,
|
|
1698
1698
|
unknownKeys: "strip"
|
|
1699
1699
|
});
|
|
1700
1700
|
}
|
|
1701
1701
|
passthrough() {
|
|
1702
|
-
return new
|
|
1702
|
+
return new N({
|
|
1703
1703
|
...this._def,
|
|
1704
1704
|
unknownKeys: "passthrough"
|
|
1705
1705
|
});
|
|
@@ -1722,7 +1722,7 @@ let S = class T extends _ {
|
|
|
1722
1722
|
// }) as any;
|
|
1723
1723
|
// };
|
|
1724
1724
|
extend(e) {
|
|
1725
|
-
return new
|
|
1725
|
+
return new N({
|
|
1726
1726
|
...this._def,
|
|
1727
1727
|
shape: () => ({
|
|
1728
1728
|
...this._def.shape(),
|
|
@@ -1736,7 +1736,7 @@ let S = class T extends _ {
|
|
|
1736
1736
|
* upgrade if you are experiencing issues.
|
|
1737
1737
|
*/
|
|
1738
1738
|
merge(e) {
|
|
1739
|
-
return new
|
|
1739
|
+
return new N({
|
|
1740
1740
|
unknownKeys: e._def.unknownKeys,
|
|
1741
1741
|
catchall: e._def.catchall,
|
|
1742
1742
|
shape: () => ({
|
|
@@ -1806,7 +1806,7 @@ let S = class T extends _ {
|
|
|
1806
1806
|
// return merged;
|
|
1807
1807
|
// }
|
|
1808
1808
|
catchall(e) {
|
|
1809
|
-
return new
|
|
1809
|
+
return new N({
|
|
1810
1810
|
...this._def,
|
|
1811
1811
|
catchall: e
|
|
1812
1812
|
});
|
|
@@ -1815,7 +1815,7 @@ let S = class T extends _ {
|
|
|
1815
1815
|
const t = {};
|
|
1816
1816
|
return w.objectKeys(e).forEach((s) => {
|
|
1817
1817
|
e[s] && this.shape[s] && (t[s] = this.shape[s]);
|
|
1818
|
-
}), new
|
|
1818
|
+
}), new N({
|
|
1819
1819
|
...this._def,
|
|
1820
1820
|
shape: () => t
|
|
1821
1821
|
});
|
|
@@ -1824,7 +1824,7 @@ let S = class T extends _ {
|
|
|
1824
1824
|
const t = {};
|
|
1825
1825
|
return w.objectKeys(this.shape).forEach((s) => {
|
|
1826
1826
|
e[s] || (t[s] = this.shape[s]);
|
|
1827
|
-
}), new
|
|
1827
|
+
}), new N({
|
|
1828
1828
|
...this._def,
|
|
1829
1829
|
shape: () => t
|
|
1830
1830
|
});
|
|
@@ -1840,7 +1840,7 @@ let S = class T extends _ {
|
|
|
1840
1840
|
return w.objectKeys(this.shape).forEach((s) => {
|
|
1841
1841
|
const n = this.shape[s];
|
|
1842
1842
|
e && !e[s] ? t[s] = n : t[s] = n.optional();
|
|
1843
|
-
}), new
|
|
1843
|
+
}), new N({
|
|
1844
1844
|
...this._def,
|
|
1845
1845
|
shape: () => t
|
|
1846
1846
|
});
|
|
@@ -1852,59 +1852,59 @@ let S = class T extends _ {
|
|
|
1852
1852
|
t[s] = this.shape[s];
|
|
1853
1853
|
else {
|
|
1854
1854
|
let n = this.shape[s];
|
|
1855
|
-
for (; n instanceof
|
|
1855
|
+
for (; n instanceof E; )
|
|
1856
1856
|
n = n._def.innerType;
|
|
1857
1857
|
t[s] = n;
|
|
1858
1858
|
}
|
|
1859
|
-
}), new
|
|
1859
|
+
}), new N({
|
|
1860
1860
|
...this._def,
|
|
1861
1861
|
shape: () => t
|
|
1862
1862
|
});
|
|
1863
1863
|
}
|
|
1864
1864
|
keyof() {
|
|
1865
|
-
return
|
|
1865
|
+
return tt(w.objectKeys(this.shape));
|
|
1866
1866
|
}
|
|
1867
1867
|
};
|
|
1868
|
-
|
|
1868
|
+
T.create = (a, e) => new T({
|
|
1869
1869
|
shape: () => a,
|
|
1870
1870
|
unknownKeys: "strip",
|
|
1871
|
-
catchall:
|
|
1871
|
+
catchall: $.create(),
|
|
1872
1872
|
typeName: m.ZodObject,
|
|
1873
1873
|
...g(e)
|
|
1874
1874
|
});
|
|
1875
|
-
|
|
1875
|
+
T.strictCreate = (a, e) => new T({
|
|
1876
1876
|
shape: () => a,
|
|
1877
1877
|
unknownKeys: "strict",
|
|
1878
|
-
catchall:
|
|
1878
|
+
catchall: $.create(),
|
|
1879
1879
|
typeName: m.ZodObject,
|
|
1880
1880
|
...g(e)
|
|
1881
1881
|
});
|
|
1882
|
-
|
|
1882
|
+
T.lazycreate = (a, e) => new T({
|
|
1883
1883
|
shape: a,
|
|
1884
1884
|
unknownKeys: "strip",
|
|
1885
|
-
catchall:
|
|
1885
|
+
catchall: $.create(),
|
|
1886
1886
|
typeName: m.ZodObject,
|
|
1887
1887
|
...g(e)
|
|
1888
1888
|
});
|
|
1889
|
-
class ae extends
|
|
1889
|
+
class ae extends v {
|
|
1890
1890
|
_parse(e) {
|
|
1891
1891
|
const { ctx: t } = this._processInputParams(e), s = this._def.options;
|
|
1892
|
-
function n(
|
|
1893
|
-
for (const o of
|
|
1892
|
+
function n(r) {
|
|
1893
|
+
for (const o of r)
|
|
1894
1894
|
if (o.result.status === "valid")
|
|
1895
1895
|
return o.result;
|
|
1896
|
-
for (const o of
|
|
1896
|
+
for (const o of r)
|
|
1897
1897
|
if (o.result.status === "dirty")
|
|
1898
1898
|
return t.common.issues.push(...o.ctx.common.issues), o.result;
|
|
1899
|
-
const
|
|
1899
|
+
const i = r.map((o) => new O(o.ctx.common.issues));
|
|
1900
1900
|
return l(t, {
|
|
1901
1901
|
code: d.invalid_union,
|
|
1902
|
-
unionErrors:
|
|
1902
|
+
unionErrors: i
|
|
1903
1903
|
}), y;
|
|
1904
1904
|
}
|
|
1905
1905
|
if (t.common.async)
|
|
1906
|
-
return Promise.all(s.map(async (
|
|
1907
|
-
const
|
|
1906
|
+
return Promise.all(s.map(async (r) => {
|
|
1907
|
+
const i = {
|
|
1908
1908
|
...t,
|
|
1909
1909
|
common: {
|
|
1910
1910
|
...t.common,
|
|
@@ -1913,17 +1913,17 @@ class ae extends _ {
|
|
|
1913
1913
|
parent: null
|
|
1914
1914
|
};
|
|
1915
1915
|
return {
|
|
1916
|
-
result: await
|
|
1916
|
+
result: await r._parseAsync({
|
|
1917
1917
|
data: t.data,
|
|
1918
1918
|
path: t.path,
|
|
1919
|
-
parent:
|
|
1919
|
+
parent: i
|
|
1920
1920
|
}),
|
|
1921
|
-
ctx:
|
|
1921
|
+
ctx: i
|
|
1922
1922
|
};
|
|
1923
1923
|
})).then(n);
|
|
1924
1924
|
{
|
|
1925
|
-
let
|
|
1926
|
-
const
|
|
1925
|
+
let r;
|
|
1926
|
+
const i = [];
|
|
1927
1927
|
for (const c of s) {
|
|
1928
1928
|
const u = {
|
|
1929
1929
|
...t,
|
|
@@ -1939,11 +1939,11 @@ class ae extends _ {
|
|
|
1939
1939
|
});
|
|
1940
1940
|
if (f.status === "valid")
|
|
1941
1941
|
return f;
|
|
1942
|
-
f.status === "dirty" && !
|
|
1942
|
+
f.status === "dirty" && !r && (r = { result: f, ctx: u }), u.common.issues.length && i.push(u.common.issues);
|
|
1943
1943
|
}
|
|
1944
|
-
if (
|
|
1945
|
-
return t.common.issues.push(...
|
|
1946
|
-
const o =
|
|
1944
|
+
if (r)
|
|
1945
|
+
return t.common.issues.push(...r.ctx.common.issues), r.result;
|
|
1946
|
+
const o = i.map((c) => new O(c));
|
|
1947
1947
|
return l(t, {
|
|
1948
1948
|
code: d.invalid_union,
|
|
1949
1949
|
unionErrors: o
|
|
@@ -1959,8 +1959,8 @@ ae.create = (a, e) => new ae({
|
|
|
1959
1959
|
typeName: m.ZodUnion,
|
|
1960
1960
|
...g(e)
|
|
1961
1961
|
});
|
|
1962
|
-
const
|
|
1963
|
-
class Ae extends
|
|
1962
|
+
const P = (a) => a instanceof re ? P(a.schema) : a instanceof A ? P(a.innerType()) : a instanceof oe ? [a.value] : a instanceof he ? a.options : a instanceof ce ? w.objectValues(a.enum) : a instanceof de ? P(a._def.innerType) : a instanceof te ? [void 0] : a instanceof se ? [null] : a instanceof E ? [void 0, ...P(a.unwrap())] : a instanceof M ? [null, ...P(a.unwrap())] : a instanceof ze || a instanceof le ? P(a.unwrap()) : a instanceof ue ? P(a._def.innerType) : [];
|
|
1963
|
+
class Ae extends v {
|
|
1964
1964
|
_parse(e) {
|
|
1965
1965
|
const { ctx: t } = this._processInputParams(e);
|
|
1966
1966
|
if (t.parsedType !== h.object)
|
|
@@ -1969,12 +1969,12 @@ class Ae extends _ {
|
|
|
1969
1969
|
expected: h.object,
|
|
1970
1970
|
received: t.parsedType
|
|
1971
1971
|
}), y;
|
|
1972
|
-
const s = this.discriminator, n = t.data[s],
|
|
1973
|
-
return
|
|
1972
|
+
const s = this.discriminator, n = t.data[s], r = this.optionsMap.get(n);
|
|
1973
|
+
return r ? t.common.async ? r._parseAsync({
|
|
1974
1974
|
data: t.data,
|
|
1975
1975
|
path: t.path,
|
|
1976
1976
|
parent: t
|
|
1977
|
-
}) :
|
|
1977
|
+
}) : r._parseSync({
|
|
1978
1978
|
data: t.data,
|
|
1979
1979
|
path: t.path,
|
|
1980
1980
|
parent: t
|
|
@@ -2003,14 +2003,14 @@ class Ae extends _ {
|
|
|
2003
2003
|
*/
|
|
2004
2004
|
static create(e, t, s) {
|
|
2005
2005
|
const n = /* @__PURE__ */ new Map();
|
|
2006
|
-
for (const
|
|
2007
|
-
const
|
|
2008
|
-
if (!
|
|
2006
|
+
for (const r of t) {
|
|
2007
|
+
const i = P(r.shape[e]);
|
|
2008
|
+
if (!i.length)
|
|
2009
2009
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
2010
|
-
for (const o of
|
|
2010
|
+
for (const o of i) {
|
|
2011
2011
|
if (n.has(o))
|
|
2012
2012
|
throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);
|
|
2013
|
-
n.set(o,
|
|
2013
|
+
n.set(o, r);
|
|
2014
2014
|
}
|
|
2015
2015
|
}
|
|
2016
2016
|
return new Ae({
|
|
@@ -2023,24 +2023,24 @@ class Ae extends _ {
|
|
|
2023
2023
|
}
|
|
2024
2024
|
}
|
|
2025
2025
|
function Le(a, e) {
|
|
2026
|
-
const t =
|
|
2026
|
+
const t = j(a), s = j(e);
|
|
2027
2027
|
if (a === e)
|
|
2028
2028
|
return { valid: !0, data: a };
|
|
2029
2029
|
if (t === h.object && s === h.object) {
|
|
2030
|
-
const n = w.objectKeys(e),
|
|
2031
|
-
for (const o of
|
|
2030
|
+
const n = w.objectKeys(e), r = w.objectKeys(a).filter((o) => n.indexOf(o) !== -1), i = { ...a, ...e };
|
|
2031
|
+
for (const o of r) {
|
|
2032
2032
|
const c = Le(a[o], e[o]);
|
|
2033
2033
|
if (!c.valid)
|
|
2034
2034
|
return { valid: !1 };
|
|
2035
|
-
|
|
2035
|
+
i[o] = c.data;
|
|
2036
2036
|
}
|
|
2037
|
-
return { valid: !0, data:
|
|
2037
|
+
return { valid: !0, data: i };
|
|
2038
2038
|
} else if (t === h.array && s === h.array) {
|
|
2039
2039
|
if (a.length !== e.length)
|
|
2040
2040
|
return { valid: !1 };
|
|
2041
2041
|
const n = [];
|
|
2042
|
-
for (let
|
|
2043
|
-
const
|
|
2042
|
+
for (let r = 0; r < a.length; r++) {
|
|
2043
|
+
const i = a[r], o = e[r], c = Le(i, o);
|
|
2044
2044
|
if (!c.valid)
|
|
2045
2045
|
return { valid: !1 };
|
|
2046
2046
|
n.push(c.data);
|
|
@@ -2048,13 +2048,13 @@ function Le(a, e) {
|
|
|
2048
2048
|
return { valid: !0, data: n };
|
|
2049
2049
|
} else return t === h.date && s === h.date && +a == +e ? { valid: !0, data: a } : { valid: !1 };
|
|
2050
2050
|
}
|
|
2051
|
-
class ne extends
|
|
2051
|
+
class ne extends v {
|
|
2052
2052
|
_parse(e) {
|
|
2053
|
-
const { status: t, ctx: s } = this._processInputParams(e), n = (
|
|
2054
|
-
if (Pe(
|
|
2053
|
+
const { status: t, ctx: s } = this._processInputParams(e), n = (r, i) => {
|
|
2054
|
+
if (Pe(r) || Pe(i))
|
|
2055
2055
|
return y;
|
|
2056
|
-
const o = Le(
|
|
2057
|
-
return o.valid ? ((Re(
|
|
2056
|
+
const o = Le(r.value, i.value);
|
|
2057
|
+
return o.valid ? ((Re(r) || Re(i)) && t.dirty(), { status: t.value, value: o.data }) : (l(s, {
|
|
2058
2058
|
code: d.invalid_intersection_types
|
|
2059
2059
|
}), y);
|
|
2060
2060
|
};
|
|
@@ -2069,7 +2069,7 @@ class ne extends _ {
|
|
|
2069
2069
|
path: s.path,
|
|
2070
2070
|
parent: s
|
|
2071
2071
|
})
|
|
2072
|
-
]).then(([
|
|
2072
|
+
]).then(([r, i]) => n(r, i)) : n(this._def.left._parseSync({
|
|
2073
2073
|
data: s.data,
|
|
2074
2074
|
path: s.path,
|
|
2075
2075
|
parent: s
|
|
@@ -2086,7 +2086,7 @@ ne.create = (a, e, t) => new ne({
|
|
|
2086
2086
|
typeName: m.ZodIntersection,
|
|
2087
2087
|
...g(t)
|
|
2088
2088
|
});
|
|
2089
|
-
class
|
|
2089
|
+
let R = class Qe extends v {
|
|
2090
2090
|
_parse(e) {
|
|
2091
2091
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2092
2092
|
if (s.parsedType !== h.array)
|
|
@@ -2110,33 +2110,33 @@ class I extends _ {
|
|
|
2110
2110
|
exact: !1,
|
|
2111
2111
|
type: "array"
|
|
2112
2112
|
}), t.dirty());
|
|
2113
|
-
const n = [...s.data].map((
|
|
2114
|
-
const o = this._def.items[
|
|
2115
|
-
return o ? o._parse(new
|
|
2116
|
-
}).filter((
|
|
2117
|
-
return s.common.async ? Promise.all(n).then((
|
|
2113
|
+
const n = [...s.data].map((r, i) => {
|
|
2114
|
+
const o = this._def.items[i] || this._def.rest;
|
|
2115
|
+
return o ? o._parse(new I(s, r, s.path, i)) : null;
|
|
2116
|
+
}).filter((r) => !!r);
|
|
2117
|
+
return s.common.async ? Promise.all(n).then((r) => S.mergeArray(t, r)) : S.mergeArray(t, n);
|
|
2118
2118
|
}
|
|
2119
2119
|
get items() {
|
|
2120
2120
|
return this._def.items;
|
|
2121
2121
|
}
|
|
2122
2122
|
rest(e) {
|
|
2123
|
-
return new
|
|
2123
|
+
return new Qe({
|
|
2124
2124
|
...this._def,
|
|
2125
2125
|
rest: e
|
|
2126
2126
|
});
|
|
2127
2127
|
}
|
|
2128
|
-
}
|
|
2129
|
-
|
|
2128
|
+
};
|
|
2129
|
+
R.create = (a, e) => {
|
|
2130
2130
|
if (!Array.isArray(a))
|
|
2131
2131
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2132
|
-
return new
|
|
2132
|
+
return new R({
|
|
2133
2133
|
items: a,
|
|
2134
2134
|
typeName: m.ZodTuple,
|
|
2135
2135
|
rest: null,
|
|
2136
2136
|
...g(e)
|
|
2137
2137
|
});
|
|
2138
2138
|
};
|
|
2139
|
-
class ie extends
|
|
2139
|
+
class ie extends v {
|
|
2140
2140
|
get keySchema() {
|
|
2141
2141
|
return this._def.keyType;
|
|
2142
2142
|
}
|
|
@@ -2151,33 +2151,33 @@ class ie extends _ {
|
|
|
2151
2151
|
expected: h.object,
|
|
2152
2152
|
received: s.parsedType
|
|
2153
2153
|
}), y;
|
|
2154
|
-
const n = [],
|
|
2154
|
+
const n = [], r = this._def.keyType, i = this._def.valueType;
|
|
2155
2155
|
for (const o in s.data)
|
|
2156
2156
|
n.push({
|
|
2157
|
-
key:
|
|
2158
|
-
value:
|
|
2157
|
+
key: r._parse(new I(s, o, s.path, o)),
|
|
2158
|
+
value: i._parse(new I(s, s.data[o], s.path, o)),
|
|
2159
2159
|
alwaysSet: o in s.data
|
|
2160
2160
|
});
|
|
2161
|
-
return s.common.async ?
|
|
2161
|
+
return s.common.async ? S.mergeObjectAsync(t, n) : S.mergeObjectSync(t, n);
|
|
2162
2162
|
}
|
|
2163
2163
|
get element() {
|
|
2164
2164
|
return this._def.valueType;
|
|
2165
2165
|
}
|
|
2166
2166
|
static create(e, t, s) {
|
|
2167
|
-
return t instanceof
|
|
2167
|
+
return t instanceof v ? new ie({
|
|
2168
2168
|
keyType: e,
|
|
2169
2169
|
valueType: t,
|
|
2170
2170
|
typeName: m.ZodRecord,
|
|
2171
2171
|
...g(s)
|
|
2172
2172
|
}) : new ie({
|
|
2173
|
-
keyType:
|
|
2173
|
+
keyType: C.create(),
|
|
2174
2174
|
valueType: e,
|
|
2175
2175
|
typeName: m.ZodRecord,
|
|
2176
2176
|
...g(t)
|
|
2177
2177
|
});
|
|
2178
2178
|
}
|
|
2179
2179
|
}
|
|
2180
|
-
class Ne extends
|
|
2180
|
+
class Ne extends v {
|
|
2181
2181
|
get keySchema() {
|
|
2182
2182
|
return this._def.keyType;
|
|
2183
2183
|
}
|
|
@@ -2192,14 +2192,14 @@ class Ne extends _ {
|
|
|
2192
2192
|
expected: h.map,
|
|
2193
2193
|
received: s.parsedType
|
|
2194
2194
|
}), y;
|
|
2195
|
-
const n = this._def.keyType,
|
|
2196
|
-
key: n._parse(new
|
|
2197
|
-
value:
|
|
2195
|
+
const n = this._def.keyType, r = this._def.valueType, i = [...s.data.entries()].map(([o, c], u) => ({
|
|
2196
|
+
key: n._parse(new I(s, o, s.path, [u, "key"])),
|
|
2197
|
+
value: r._parse(new I(s, c, s.path, [u, "value"]))
|
|
2198
2198
|
}));
|
|
2199
2199
|
if (s.common.async) {
|
|
2200
2200
|
const o = /* @__PURE__ */ new Map();
|
|
2201
2201
|
return Promise.resolve().then(async () => {
|
|
2202
|
-
for (const c of
|
|
2202
|
+
for (const c of i) {
|
|
2203
2203
|
const u = await c.key, f = await c.value;
|
|
2204
2204
|
if (u.status === "aborted" || f.status === "aborted")
|
|
2205
2205
|
return y;
|
|
@@ -2209,7 +2209,7 @@ class Ne extends _ {
|
|
|
2209
2209
|
});
|
|
2210
2210
|
} else {
|
|
2211
2211
|
const o = /* @__PURE__ */ new Map();
|
|
2212
|
-
for (const c of
|
|
2212
|
+
for (const c of i) {
|
|
2213
2213
|
const u = c.key, f = c.value;
|
|
2214
2214
|
if (u.status === "aborted" || f.status === "aborted")
|
|
2215
2215
|
return y;
|
|
@@ -2225,7 +2225,7 @@ Ne.create = (a, e, t) => new Ne({
|
|
|
2225
2225
|
typeName: m.ZodMap,
|
|
2226
2226
|
...g(t)
|
|
2227
2227
|
});
|
|
2228
|
-
let Ce = class De extends
|
|
2228
|
+
let Ce = class De extends v {
|
|
2229
2229
|
_parse(e) {
|
|
2230
2230
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2231
2231
|
if (s.parsedType !== h.set)
|
|
@@ -2250,8 +2250,8 @@ let Ce = class De extends _ {
|
|
|
2250
2250
|
exact: !1,
|
|
2251
2251
|
message: n.maxSize.message
|
|
2252
2252
|
}), t.dirty());
|
|
2253
|
-
const
|
|
2254
|
-
function
|
|
2253
|
+
const r = this._def.valueType;
|
|
2254
|
+
function i(c) {
|
|
2255
2255
|
const u = /* @__PURE__ */ new Set();
|
|
2256
2256
|
for (const f of c) {
|
|
2257
2257
|
if (f.status === "aborted")
|
|
@@ -2260,8 +2260,8 @@ let Ce = class De extends _ {
|
|
|
2260
2260
|
}
|
|
2261
2261
|
return { status: t.value, value: u };
|
|
2262
2262
|
}
|
|
2263
|
-
const o = [...s.data.values()].map((c, u) =>
|
|
2264
|
-
return s.common.async ? Promise.all(o).then((c) =>
|
|
2263
|
+
const o = [...s.data.values()].map((c, u) => r._parse(new I(s, c, s.path, u)));
|
|
2264
|
+
return s.common.async ? Promise.all(o).then((c) => i(c)) : i(o);
|
|
2265
2265
|
}
|
|
2266
2266
|
min(e, t) {
|
|
2267
2267
|
return new De({
|
|
@@ -2289,7 +2289,7 @@ Ce.create = (a, e) => new Ce({
|
|
|
2289
2289
|
typeName: m.ZodSet,
|
|
2290
2290
|
...g(e)
|
|
2291
2291
|
});
|
|
2292
|
-
let
|
|
2292
|
+
let et = class we extends v {
|
|
2293
2293
|
constructor() {
|
|
2294
2294
|
super(...arguments), this.validate = this.implement;
|
|
2295
2295
|
}
|
|
@@ -2333,26 +2333,26 @@ let Qe = class we extends _ {
|
|
|
2333
2333
|
}
|
|
2334
2334
|
});
|
|
2335
2335
|
}
|
|
2336
|
-
const
|
|
2336
|
+
const r = { errorMap: t.common.contextualErrorMap }, i = t.data;
|
|
2337
2337
|
if (this._def.returns instanceof W) {
|
|
2338
2338
|
const o = this;
|
|
2339
2339
|
return x(async function(...c) {
|
|
2340
|
-
const u = new
|
|
2341
|
-
throw u.addIssue(s(c,
|
|
2342
|
-
}), b = await Reflect.apply(
|
|
2343
|
-
return await o._def.returns._def.type.parseAsync(b,
|
|
2344
|
-
throw u.addIssue(n(b,
|
|
2340
|
+
const u = new O([]), f = await o._def.args.parseAsync(c, r).catch((Z) => {
|
|
2341
|
+
throw u.addIssue(s(c, Z)), u;
|
|
2342
|
+
}), b = await Reflect.apply(i, this, f);
|
|
2343
|
+
return await o._def.returns._def.type.parseAsync(b, r).catch((Z) => {
|
|
2344
|
+
throw u.addIssue(n(b, Z)), u;
|
|
2345
2345
|
});
|
|
2346
2346
|
});
|
|
2347
2347
|
} else {
|
|
2348
2348
|
const o = this;
|
|
2349
2349
|
return x(function(...c) {
|
|
2350
|
-
const u = o._def.args.safeParse(c,
|
|
2350
|
+
const u = o._def.args.safeParse(c, r);
|
|
2351
2351
|
if (!u.success)
|
|
2352
|
-
throw new
|
|
2353
|
-
const f = Reflect.apply(
|
|
2352
|
+
throw new O([s(c, u.error)]);
|
|
2353
|
+
const f = Reflect.apply(i, this, u.data), b = o._def.returns.safeParse(f, r);
|
|
2354
2354
|
if (!b.success)
|
|
2355
|
-
throw new
|
|
2355
|
+
throw new O([n(f, b.error)]);
|
|
2356
2356
|
return b.data;
|
|
2357
2357
|
});
|
|
2358
2358
|
}
|
|
@@ -2366,7 +2366,7 @@ let Qe = class we extends _ {
|
|
|
2366
2366
|
args(...e) {
|
|
2367
2367
|
return new we({
|
|
2368
2368
|
...this._def,
|
|
2369
|
-
args:
|
|
2369
|
+
args: R.create(e).rest(D.create())
|
|
2370
2370
|
});
|
|
2371
2371
|
}
|
|
2372
2372
|
returns(e) {
|
|
@@ -2383,14 +2383,14 @@ let Qe = class we extends _ {
|
|
|
2383
2383
|
}
|
|
2384
2384
|
static create(e, t, s) {
|
|
2385
2385
|
return new we({
|
|
2386
|
-
args: e ||
|
|
2386
|
+
args: e || R.create([]).rest(D.create()),
|
|
2387
2387
|
returns: t || D.create(),
|
|
2388
2388
|
typeName: m.ZodFunction,
|
|
2389
2389
|
...g(s)
|
|
2390
2390
|
});
|
|
2391
2391
|
}
|
|
2392
2392
|
};
|
|
2393
|
-
class re extends
|
|
2393
|
+
class re extends v {
|
|
2394
2394
|
get schema() {
|
|
2395
2395
|
return this._def.getter();
|
|
2396
2396
|
}
|
|
@@ -2404,7 +2404,7 @@ re.create = (a, e) => new re({
|
|
|
2404
2404
|
typeName: m.ZodLazy,
|
|
2405
2405
|
...g(e)
|
|
2406
2406
|
});
|
|
2407
|
-
class oe extends
|
|
2407
|
+
class oe extends v {
|
|
2408
2408
|
_parse(e) {
|
|
2409
2409
|
if (e.data !== this._def.value) {
|
|
2410
2410
|
const t = this._getOrReturnCtx(e);
|
|
@@ -2425,14 +2425,14 @@ oe.create = (a, e) => new oe({
|
|
|
2425
2425
|
typeName: m.ZodLiteral,
|
|
2426
2426
|
...g(e)
|
|
2427
2427
|
});
|
|
2428
|
-
function
|
|
2428
|
+
function tt(a, e) {
|
|
2429
2429
|
return new he({
|
|
2430
2430
|
values: a,
|
|
2431
2431
|
typeName: m.ZodEnum,
|
|
2432
2432
|
...g(e)
|
|
2433
2433
|
});
|
|
2434
2434
|
}
|
|
2435
|
-
let he = class
|
|
2435
|
+
let he = class qe extends v {
|
|
2436
2436
|
constructor() {
|
|
2437
2437
|
super(...arguments), J.set(this, void 0);
|
|
2438
2438
|
}
|
|
@@ -2477,21 +2477,21 @@ let he = class ze extends _ {
|
|
|
2477
2477
|
return e;
|
|
2478
2478
|
}
|
|
2479
2479
|
extract(e, t = this._def) {
|
|
2480
|
-
return
|
|
2480
|
+
return qe.create(e, {
|
|
2481
2481
|
...this._def,
|
|
2482
2482
|
...t
|
|
2483
2483
|
});
|
|
2484
2484
|
}
|
|
2485
2485
|
exclude(e, t = this._def) {
|
|
2486
|
-
return
|
|
2486
|
+
return qe.create(this.options.filter((s) => !e.includes(s)), {
|
|
2487
2487
|
...this._def,
|
|
2488
2488
|
...t
|
|
2489
2489
|
});
|
|
2490
2490
|
}
|
|
2491
2491
|
};
|
|
2492
2492
|
J = /* @__PURE__ */ new WeakMap();
|
|
2493
|
-
he.create =
|
|
2494
|
-
class ce extends
|
|
2493
|
+
he.create = tt;
|
|
2494
|
+
class ce extends v {
|
|
2495
2495
|
constructor() {
|
|
2496
2496
|
super(...arguments), Y.set(this, void 0);
|
|
2497
2497
|
}
|
|
@@ -2525,7 +2525,7 @@ ce.create = (a, e) => new ce({
|
|
|
2525
2525
|
typeName: m.ZodNativeEnum,
|
|
2526
2526
|
...g(e)
|
|
2527
2527
|
});
|
|
2528
|
-
class W extends
|
|
2528
|
+
class W extends v {
|
|
2529
2529
|
unwrap() {
|
|
2530
2530
|
return this._def.type;
|
|
2531
2531
|
}
|
|
@@ -2549,7 +2549,7 @@ W.create = (a, e) => new W({
|
|
|
2549
2549
|
typeName: m.ZodPromise,
|
|
2550
2550
|
...g(e)
|
|
2551
2551
|
});
|
|
2552
|
-
let
|
|
2552
|
+
let A = class extends v {
|
|
2553
2553
|
innerType() {
|
|
2554
2554
|
return this._def.schema;
|
|
2555
2555
|
}
|
|
@@ -2557,18 +2557,18 @@ let O = class extends _ {
|
|
|
2557
2557
|
return this._def.schema._def.typeName === m.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
2558
2558
|
}
|
|
2559
2559
|
_parse(e) {
|
|
2560
|
-
const { status: t, ctx: s } = this._processInputParams(e), n = this._def.effect || null,
|
|
2561
|
-
addIssue: (
|
|
2562
|
-
l(s,
|
|
2560
|
+
const { status: t, ctx: s } = this._processInputParams(e), n = this._def.effect || null, r = {
|
|
2561
|
+
addIssue: (i) => {
|
|
2562
|
+
l(s, i), i.fatal ? t.abort() : t.dirty();
|
|
2563
2563
|
},
|
|
2564
2564
|
get path() {
|
|
2565
2565
|
return s.path;
|
|
2566
2566
|
}
|
|
2567
2567
|
};
|
|
2568
|
-
if (
|
|
2569
|
-
const
|
|
2568
|
+
if (r.addIssue = r.addIssue.bind(r), n.type === "preprocess") {
|
|
2569
|
+
const i = n.transform(s.data, r);
|
|
2570
2570
|
if (s.common.async)
|
|
2571
|
-
return Promise.resolve(
|
|
2571
|
+
return Promise.resolve(i).then(async (o) => {
|
|
2572
2572
|
if (t.value === "aborted")
|
|
2573
2573
|
return y;
|
|
2574
2574
|
const c = await this._def.schema._parseAsync({
|
|
@@ -2582,7 +2582,7 @@ let O = class extends _ {
|
|
|
2582
2582
|
if (t.value === "aborted")
|
|
2583
2583
|
return y;
|
|
2584
2584
|
const o = this._def.schema._parseSync({
|
|
2585
|
-
data:
|
|
2585
|
+
data: i,
|
|
2586
2586
|
path: s.path,
|
|
2587
2587
|
parent: s
|
|
2588
2588
|
});
|
|
@@ -2590,8 +2590,8 @@ let O = class extends _ {
|
|
|
2590
2590
|
}
|
|
2591
2591
|
}
|
|
2592
2592
|
if (n.type === "refinement") {
|
|
2593
|
-
const
|
|
2594
|
-
const c = n.refinement(o,
|
|
2593
|
+
const i = (o) => {
|
|
2594
|
+
const c = n.refinement(o, r);
|
|
2595
2595
|
if (s.common.async)
|
|
2596
2596
|
return Promise.resolve(c);
|
|
2597
2597
|
if (c instanceof Promise)
|
|
@@ -2604,41 +2604,41 @@ let O = class extends _ {
|
|
|
2604
2604
|
path: s.path,
|
|
2605
2605
|
parent: s
|
|
2606
2606
|
});
|
|
2607
|
-
return o.status === "aborted" ? y : (o.status === "dirty" && t.dirty(),
|
|
2607
|
+
return o.status === "aborted" ? y : (o.status === "dirty" && t.dirty(), i(o.value), { status: t.value, value: o.value });
|
|
2608
2608
|
} else
|
|
2609
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => o.status === "aborted" ? y : (o.status === "dirty" && t.dirty(),
|
|
2609
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => o.status === "aborted" ? y : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
|
|
2610
2610
|
}
|
|
2611
2611
|
if (n.type === "transform")
|
|
2612
2612
|
if (s.common.async === !1) {
|
|
2613
|
-
const
|
|
2613
|
+
const i = this._def.schema._parseSync({
|
|
2614
2614
|
data: s.data,
|
|
2615
2615
|
path: s.path,
|
|
2616
2616
|
parent: s
|
|
2617
2617
|
});
|
|
2618
|
-
if (!
|
|
2619
|
-
return
|
|
2620
|
-
const o = n.transform(
|
|
2618
|
+
if (!q(i))
|
|
2619
|
+
return i;
|
|
2620
|
+
const o = n.transform(i.value, r);
|
|
2621
2621
|
if (o instanceof Promise)
|
|
2622
2622
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2623
2623
|
return { status: t.value, value: o };
|
|
2624
2624
|
} else
|
|
2625
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((
|
|
2625
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => q(i) ? Promise.resolve(n.transform(i.value, r)).then((o) => ({ status: t.value, value: o })) : i);
|
|
2626
2626
|
w.assertNever(n);
|
|
2627
2627
|
}
|
|
2628
2628
|
};
|
|
2629
|
-
|
|
2629
|
+
A.create = (a, e, t) => new A({
|
|
2630
2630
|
schema: a,
|
|
2631
2631
|
typeName: m.ZodEffects,
|
|
2632
2632
|
effect: e,
|
|
2633
2633
|
...g(t)
|
|
2634
2634
|
});
|
|
2635
|
-
|
|
2635
|
+
A.createWithPreprocess = (a, e, t) => new A({
|
|
2636
2636
|
schema: e,
|
|
2637
2637
|
effect: { type: "preprocess", transform: a },
|
|
2638
2638
|
typeName: m.ZodEffects,
|
|
2639
2639
|
...g(t)
|
|
2640
2640
|
});
|
|
2641
|
-
let
|
|
2641
|
+
let E = class extends v {
|
|
2642
2642
|
_parse(e) {
|
|
2643
2643
|
return this._getType(e) === h.undefined ? x(void 0) : this._def.innerType._parse(e);
|
|
2644
2644
|
}
|
|
@@ -2646,12 +2646,12 @@ let A = class extends _ {
|
|
|
2646
2646
|
return this._def.innerType;
|
|
2647
2647
|
}
|
|
2648
2648
|
};
|
|
2649
|
-
|
|
2649
|
+
E.create = (a, e) => new E({
|
|
2650
2650
|
innerType: a,
|
|
2651
2651
|
typeName: m.ZodOptional,
|
|
2652
2652
|
...g(e)
|
|
2653
2653
|
});
|
|
2654
|
-
let M = class extends
|
|
2654
|
+
let M = class extends v {
|
|
2655
2655
|
_parse(e) {
|
|
2656
2656
|
return this._getType(e) === h.null ? x(null) : this._def.innerType._parse(e);
|
|
2657
2657
|
}
|
|
@@ -2664,7 +2664,7 @@ M.create = (a, e) => new M({
|
|
|
2664
2664
|
typeName: m.ZodNullable,
|
|
2665
2665
|
...g(e)
|
|
2666
2666
|
});
|
|
2667
|
-
class de extends
|
|
2667
|
+
class de extends v {
|
|
2668
2668
|
_parse(e) {
|
|
2669
2669
|
const { ctx: t } = this._processInputParams(e);
|
|
2670
2670
|
let s = t.data;
|
|
@@ -2684,7 +2684,7 @@ de.create = (a, e) => new de({
|
|
|
2684
2684
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2685
2685
|
...g(e)
|
|
2686
2686
|
});
|
|
2687
|
-
class ue extends
|
|
2687
|
+
class ue extends v {
|
|
2688
2688
|
_parse(e) {
|
|
2689
2689
|
const { ctx: t } = this._processInputParams(e), s = {
|
|
2690
2690
|
...t,
|
|
@@ -2699,11 +2699,11 @@ class ue extends _ {
|
|
|
2699
2699
|
...s
|
|
2700
2700
|
}
|
|
2701
2701
|
});
|
|
2702
|
-
return G(n) ? n.then((
|
|
2702
|
+
return G(n) ? n.then((r) => ({
|
|
2703
2703
|
status: "valid",
|
|
2704
|
-
value:
|
|
2704
|
+
value: r.status === "valid" ? r.value : this._def.catchValue({
|
|
2705
2705
|
get error() {
|
|
2706
|
-
return new
|
|
2706
|
+
return new O(s.common.issues);
|
|
2707
2707
|
},
|
|
2708
2708
|
input: s.data
|
|
2709
2709
|
})
|
|
@@ -2711,7 +2711,7 @@ class ue extends _ {
|
|
|
2711
2711
|
status: "valid",
|
|
2712
2712
|
value: n.status === "valid" ? n.value : this._def.catchValue({
|
|
2713
2713
|
get error() {
|
|
2714
|
-
return new
|
|
2714
|
+
return new O(s.common.issues);
|
|
2715
2715
|
},
|
|
2716
2716
|
input: s.data
|
|
2717
2717
|
})
|
|
@@ -2727,7 +2727,7 @@ ue.create = (a, e) => new ue({
|
|
|
2727
2727
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2728
2728
|
...g(e)
|
|
2729
2729
|
});
|
|
2730
|
-
class Oe extends
|
|
2730
|
+
class Oe extends v {
|
|
2731
2731
|
_parse(e) {
|
|
2732
2732
|
if (this._getType(e) !== h.nan) {
|
|
2733
2733
|
const t = this._getOrReturnCtx(e);
|
|
@@ -2744,8 +2744,8 @@ Oe.create = (a) => new Oe({
|
|
|
2744
2744
|
typeName: m.ZodNaN,
|
|
2745
2745
|
...g(a)
|
|
2746
2746
|
});
|
|
2747
|
-
const
|
|
2748
|
-
class
|
|
2747
|
+
const At = Symbol("zod_brand");
|
|
2748
|
+
class ze extends v {
|
|
2749
2749
|
_parse(e) {
|
|
2750
2750
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
2751
2751
|
return this._def.type._parse({
|
|
@@ -2758,7 +2758,7 @@ class qe extends _ {
|
|
|
2758
2758
|
return this._def.type;
|
|
2759
2759
|
}
|
|
2760
2760
|
}
|
|
2761
|
-
class pe extends
|
|
2761
|
+
class pe extends v {
|
|
2762
2762
|
_parse(e) {
|
|
2763
2763
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2764
2764
|
if (s.common.async)
|
|
@@ -2798,9 +2798,9 @@ class pe extends _ {
|
|
|
2798
2798
|
});
|
|
2799
2799
|
}
|
|
2800
2800
|
}
|
|
2801
|
-
class le extends
|
|
2801
|
+
class le extends v {
|
|
2802
2802
|
_parse(e) {
|
|
2803
|
-
const t = this._def.innerType._parse(e), s = (n) => (
|
|
2803
|
+
const t = this._def.innerType._parse(e), s = (n) => (q(n) && (n.value = Object.freeze(n.value)), n);
|
|
2804
2804
|
return G(t) ? t.then((n) => s(n)) : s(t);
|
|
2805
2805
|
}
|
|
2806
2806
|
unwrap() {
|
|
@@ -2816,58 +2816,58 @@ function Be(a, e) {
|
|
|
2816
2816
|
const t = typeof a == "function" ? a(e) : typeof a == "string" ? { message: a } : a;
|
|
2817
2817
|
return typeof t == "string" ? { message: t } : t;
|
|
2818
2818
|
}
|
|
2819
|
-
function
|
|
2819
|
+
function st(a, e = {}, t) {
|
|
2820
2820
|
return a ? K.create().superRefine((s, n) => {
|
|
2821
|
-
var
|
|
2821
|
+
var r, i;
|
|
2822
2822
|
const o = a(s);
|
|
2823
2823
|
if (o instanceof Promise)
|
|
2824
2824
|
return o.then((c) => {
|
|
2825
2825
|
var u, f;
|
|
2826
2826
|
if (!c) {
|
|
2827
|
-
const b = Be(e, s),
|
|
2828
|
-
n.addIssue({ code: "custom", ...b, fatal:
|
|
2827
|
+
const b = Be(e, s), Z = (f = (u = b.fatal) !== null && u !== void 0 ? u : t) !== null && f !== void 0 ? f : !0;
|
|
2828
|
+
n.addIssue({ code: "custom", ...b, fatal: Z });
|
|
2829
2829
|
}
|
|
2830
2830
|
});
|
|
2831
2831
|
if (!o) {
|
|
2832
|
-
const c = Be(e, s), u = (
|
|
2832
|
+
const c = Be(e, s), u = (i = (r = c.fatal) !== null && r !== void 0 ? r : t) !== null && i !== void 0 ? i : !0;
|
|
2833
2833
|
n.addIssue({ code: "custom", ...c, fatal: u });
|
|
2834
2834
|
}
|
|
2835
2835
|
}) : K.create();
|
|
2836
2836
|
}
|
|
2837
|
-
const
|
|
2838
|
-
object:
|
|
2837
|
+
const Et = {
|
|
2838
|
+
object: T.lazycreate
|
|
2839
2839
|
};
|
|
2840
2840
|
var m;
|
|
2841
2841
|
(function(a) {
|
|
2842
2842
|
a.ZodString = "ZodString", a.ZodNumber = "ZodNumber", a.ZodNaN = "ZodNaN", a.ZodBigInt = "ZodBigInt", a.ZodBoolean = "ZodBoolean", a.ZodDate = "ZodDate", a.ZodSymbol = "ZodSymbol", a.ZodUndefined = "ZodUndefined", a.ZodNull = "ZodNull", a.ZodAny = "ZodAny", a.ZodUnknown = "ZodUnknown", a.ZodNever = "ZodNever", a.ZodVoid = "ZodVoid", a.ZodArray = "ZodArray", a.ZodObject = "ZodObject", a.ZodUnion = "ZodUnion", a.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", a.ZodIntersection = "ZodIntersection", a.ZodTuple = "ZodTuple", a.ZodRecord = "ZodRecord", a.ZodMap = "ZodMap", a.ZodSet = "ZodSet", a.ZodFunction = "ZodFunction", a.ZodLazy = "ZodLazy", a.ZodLiteral = "ZodLiteral", a.ZodEnum = "ZodEnum", a.ZodEffects = "ZodEffects", a.ZodNativeEnum = "ZodNativeEnum", a.ZodOptional = "ZodOptional", a.ZodNullable = "ZodNullable", a.ZodDefault = "ZodDefault", a.ZodCatch = "ZodCatch", a.ZodPromise = "ZodPromise", a.ZodBranded = "ZodBranded", a.ZodPipeline = "ZodPipeline", a.ZodReadonly = "ZodReadonly";
|
|
2843
2843
|
})(m || (m = {}));
|
|
2844
|
-
const
|
|
2844
|
+
const It = (a, e = {
|
|
2845
2845
|
message: `Input not instance of ${a.name}`
|
|
2846
|
-
}) =>
|
|
2847
|
-
string: (a) =>
|
|
2846
|
+
}) => st((t) => t instanceof a, e), at = C.create, nt = X.create, jt = Oe.create, $t = Q.create, it = ee.create, Pt = z.create, Rt = Se.create, Mt = te.create, Ft = se.create, Lt = K.create, Dt = D.create, qt = $.create, zt = Te.create, Vt = V.create, Bt = T.create, Ut = T.strictCreate, Ht = ae.create, Kt = Ae.create, Wt = ne.create, Jt = R.create, Yt = ie.create, Gt = Ne.create, Xt = Ce.create, Qt = et.create, es = re.create, ts = oe.create, ss = he.create, as = ce.create, ns = W.create, Ue = A.create, is = E.create, rs = M.create, os = A.createWithPreprocess, cs = pe.create, ds = () => at().optional(), us = () => nt().optional(), ls = () => it().optional(), hs = {
|
|
2847
|
+
string: (a) => C.create({ ...a, coerce: !0 }),
|
|
2848
2848
|
number: (a) => X.create({ ...a, coerce: !0 }),
|
|
2849
2849
|
boolean: (a) => ee.create({
|
|
2850
2850
|
...a,
|
|
2851
2851
|
coerce: !0
|
|
2852
2852
|
}),
|
|
2853
2853
|
bigint: (a) => Q.create({ ...a, coerce: !0 }),
|
|
2854
|
-
date: (a) =>
|
|
2855
|
-
},
|
|
2854
|
+
date: (a) => z.create({ ...a, coerce: !0 })
|
|
2855
|
+
}, ps = y;
|
|
2856
2856
|
var fe = /* @__PURE__ */ Object.freeze({
|
|
2857
2857
|
__proto__: null,
|
|
2858
2858
|
defaultErrorMap: H,
|
|
2859
|
-
setErrorMap:
|
|
2859
|
+
setErrorMap: ot,
|
|
2860
2860
|
getErrorMap: be,
|
|
2861
2861
|
makeIssue: ke,
|
|
2862
|
-
EMPTY_PATH:
|
|
2862
|
+
EMPTY_PATH: ct,
|
|
2863
2863
|
addIssueToContext: l,
|
|
2864
|
-
ParseStatus:
|
|
2864
|
+
ParseStatus: S,
|
|
2865
2865
|
INVALID: y,
|
|
2866
2866
|
DIRTY: xe,
|
|
2867
2867
|
OK: x,
|
|
2868
2868
|
isAborted: Pe,
|
|
2869
2869
|
isDirty: Re,
|
|
2870
|
-
isValid:
|
|
2870
|
+
isValid: q,
|
|
2871
2871
|
isAsync: G,
|
|
2872
2872
|
get util() {
|
|
2873
2873
|
return w;
|
|
@@ -2876,103 +2876,103 @@ var fe = /* @__PURE__ */ Object.freeze({
|
|
|
2876
2876
|
return $e;
|
|
2877
2877
|
},
|
|
2878
2878
|
ZodParsedType: h,
|
|
2879
|
-
getParsedType:
|
|
2880
|
-
ZodType:
|
|
2879
|
+
getParsedType: j,
|
|
2880
|
+
ZodType: v,
|
|
2881
2881
|
datetimeRegex: Xe,
|
|
2882
|
-
ZodString:
|
|
2882
|
+
ZodString: C,
|
|
2883
2883
|
ZodNumber: X,
|
|
2884
2884
|
ZodBigInt: Q,
|
|
2885
2885
|
ZodBoolean: ee,
|
|
2886
|
-
ZodDate:
|
|
2886
|
+
ZodDate: z,
|
|
2887
2887
|
ZodSymbol: Se,
|
|
2888
2888
|
ZodUndefined: te,
|
|
2889
2889
|
ZodNull: se,
|
|
2890
2890
|
ZodAny: K,
|
|
2891
2891
|
ZodUnknown: D,
|
|
2892
|
-
ZodNever:
|
|
2892
|
+
ZodNever: $,
|
|
2893
2893
|
ZodVoid: Te,
|
|
2894
2894
|
ZodArray: V,
|
|
2895
|
-
ZodObject:
|
|
2895
|
+
ZodObject: T,
|
|
2896
2896
|
ZodUnion: ae,
|
|
2897
2897
|
ZodDiscriminatedUnion: Ae,
|
|
2898
2898
|
ZodIntersection: ne,
|
|
2899
|
-
ZodTuple:
|
|
2899
|
+
ZodTuple: R,
|
|
2900
2900
|
ZodRecord: ie,
|
|
2901
2901
|
ZodMap: Ne,
|
|
2902
2902
|
ZodSet: Ce,
|
|
2903
|
-
ZodFunction:
|
|
2903
|
+
ZodFunction: et,
|
|
2904
2904
|
ZodLazy: re,
|
|
2905
2905
|
ZodLiteral: oe,
|
|
2906
2906
|
ZodEnum: he,
|
|
2907
2907
|
ZodNativeEnum: ce,
|
|
2908
2908
|
ZodPromise: W,
|
|
2909
|
-
ZodEffects:
|
|
2910
|
-
ZodTransformer:
|
|
2911
|
-
ZodOptional:
|
|
2909
|
+
ZodEffects: A,
|
|
2910
|
+
ZodTransformer: A,
|
|
2911
|
+
ZodOptional: E,
|
|
2912
2912
|
ZodNullable: M,
|
|
2913
2913
|
ZodDefault: de,
|
|
2914
2914
|
ZodCatch: ue,
|
|
2915
2915
|
ZodNaN: Oe,
|
|
2916
|
-
BRAND:
|
|
2917
|
-
ZodBranded:
|
|
2916
|
+
BRAND: At,
|
|
2917
|
+
ZodBranded: ze,
|
|
2918
2918
|
ZodPipeline: pe,
|
|
2919
2919
|
ZodReadonly: le,
|
|
2920
|
-
custom:
|
|
2921
|
-
Schema:
|
|
2922
|
-
ZodSchema:
|
|
2923
|
-
late:
|
|
2920
|
+
custom: st,
|
|
2921
|
+
Schema: v,
|
|
2922
|
+
ZodSchema: v,
|
|
2923
|
+
late: Et,
|
|
2924
2924
|
get ZodFirstPartyTypeKind() {
|
|
2925
2925
|
return m;
|
|
2926
2926
|
},
|
|
2927
|
-
coerce:
|
|
2928
|
-
any:
|
|
2929
|
-
array:
|
|
2930
|
-
bigint:
|
|
2931
|
-
boolean:
|
|
2932
|
-
date:
|
|
2933
|
-
discriminatedUnion:
|
|
2927
|
+
coerce: hs,
|
|
2928
|
+
any: Lt,
|
|
2929
|
+
array: Vt,
|
|
2930
|
+
bigint: $t,
|
|
2931
|
+
boolean: it,
|
|
2932
|
+
date: Pt,
|
|
2933
|
+
discriminatedUnion: Kt,
|
|
2934
2934
|
effect: Ue,
|
|
2935
|
-
enum:
|
|
2936
|
-
function:
|
|
2937
|
-
instanceof:
|
|
2938
|
-
intersection:
|
|
2939
|
-
lazy:
|
|
2940
|
-
literal:
|
|
2941
|
-
map:
|
|
2942
|
-
nan:
|
|
2943
|
-
nativeEnum:
|
|
2944
|
-
never:
|
|
2945
|
-
null:
|
|
2946
|
-
nullable:
|
|
2947
|
-
number:
|
|
2948
|
-
object:
|
|
2949
|
-
oboolean:
|
|
2950
|
-
onumber:
|
|
2951
|
-
optional:
|
|
2952
|
-
ostring:
|
|
2953
|
-
pipeline:
|
|
2954
|
-
preprocess:
|
|
2955
|
-
promise:
|
|
2956
|
-
record:
|
|
2957
|
-
set:
|
|
2958
|
-
strictObject:
|
|
2959
|
-
string:
|
|
2960
|
-
symbol:
|
|
2935
|
+
enum: ss,
|
|
2936
|
+
function: Qt,
|
|
2937
|
+
instanceof: It,
|
|
2938
|
+
intersection: Wt,
|
|
2939
|
+
lazy: es,
|
|
2940
|
+
literal: ts,
|
|
2941
|
+
map: Gt,
|
|
2942
|
+
nan: jt,
|
|
2943
|
+
nativeEnum: as,
|
|
2944
|
+
never: qt,
|
|
2945
|
+
null: Ft,
|
|
2946
|
+
nullable: rs,
|
|
2947
|
+
number: nt,
|
|
2948
|
+
object: Bt,
|
|
2949
|
+
oboolean: ls,
|
|
2950
|
+
onumber: us,
|
|
2951
|
+
optional: is,
|
|
2952
|
+
ostring: ds,
|
|
2953
|
+
pipeline: cs,
|
|
2954
|
+
preprocess: os,
|
|
2955
|
+
promise: ns,
|
|
2956
|
+
record: Yt,
|
|
2957
|
+
set: Xt,
|
|
2958
|
+
strictObject: Ut,
|
|
2959
|
+
string: at,
|
|
2960
|
+
symbol: Rt,
|
|
2961
2961
|
transformer: Ue,
|
|
2962
|
-
tuple:
|
|
2963
|
-
undefined:
|
|
2964
|
-
union:
|
|
2965
|
-
unknown:
|
|
2962
|
+
tuple: Jt,
|
|
2963
|
+
undefined: Mt,
|
|
2964
|
+
union: Ht,
|
|
2965
|
+
unknown: Dt,
|
|
2966
2966
|
void: zt,
|
|
2967
|
-
NEVER:
|
|
2967
|
+
NEVER: ps,
|
|
2968
2968
|
ZodIssueCode: d,
|
|
2969
|
-
quotelessJson:
|
|
2970
|
-
ZodError:
|
|
2969
|
+
quotelessJson: rt,
|
|
2970
|
+
ZodError: O
|
|
2971
2971
|
});
|
|
2972
|
-
const
|
|
2973
|
-
version:
|
|
2972
|
+
const fs = "1.5.0", ms = {
|
|
2973
|
+
version: fs
|
|
2974
2974
|
};
|
|
2975
|
-
class
|
|
2975
|
+
class ys {
|
|
2976
2976
|
constructor(e) {
|
|
2977
2977
|
this._client = e;
|
|
2978
2978
|
}
|
|
@@ -2991,7 +2991,7 @@ class ms {
|
|
|
2991
2991
|
return e.account;
|
|
2992
2992
|
}
|
|
2993
2993
|
}
|
|
2994
|
-
class
|
|
2994
|
+
class gs {
|
|
2995
2995
|
constructor(e) {
|
|
2996
2996
|
this._client = e;
|
|
2997
2997
|
}
|
|
@@ -3052,8 +3052,43 @@ class ys {
|
|
|
3052
3052
|
applicationSpecifiers: e
|
|
3053
3053
|
});
|
|
3054
3054
|
}
|
|
3055
|
+
/**
|
|
3056
|
+
* Registers a message interceptor for client messages from sub-applications.
|
|
3057
|
+
*
|
|
3058
|
+
* Interceptors allow a root application to handle messages from embedded child applications
|
|
3059
|
+
* before they bubble up to the parent window. When an interceptor is registered, client messages
|
|
3060
|
+
* with the specified name will be transformed into bridge messages that are handled locally
|
|
3061
|
+
* and forwarded to child frames.
|
|
3062
|
+
*
|
|
3063
|
+
* This is useful for implementing custom communication patterns between root applications
|
|
3064
|
+
* and their embedded sub-applications, such as coordinating theme changes, state
|
|
3065
|
+
* synchronization, or custom routing logic.
|
|
3066
|
+
*
|
|
3067
|
+
* @param name The message name to intercept
|
|
3068
|
+
* @param interceptor A function that receives the message data and returns a BridgeMessage
|
|
3069
|
+
* @throws Error if an interceptor is already bound for the specified message name
|
|
3070
|
+
*
|
|
3071
|
+
* @example
|
|
3072
|
+
* ```typescript
|
|
3073
|
+
* import { applications } from '@telemetryos/root-sdk'
|
|
3074
|
+
*
|
|
3075
|
+
* // Intercept color scheme requests from sub-applications
|
|
3076
|
+
* applications().bind('theme.getColorScheme', (data) => {
|
|
3077
|
+
* const colors = getCurrentColorScheme()
|
|
3078
|
+
* return {
|
|
3079
|
+
* name: 'theme.colorScheme',
|
|
3080
|
+
* data: { primary: colors.primary, secondary: colors.secondary }
|
|
3081
|
+
* }
|
|
3082
|
+
* })
|
|
3083
|
+
* ```
|
|
3084
|
+
*/
|
|
3085
|
+
bind(e, t) {
|
|
3086
|
+
if (this._client._messageInterceptors.has(e))
|
|
3087
|
+
throw new Error(`Interceptor already bound for message ${e}`);
|
|
3088
|
+
this._client._messageInterceptors.set(e, t);
|
|
3089
|
+
}
|
|
3055
3090
|
}
|
|
3056
|
-
class
|
|
3091
|
+
class _s {
|
|
3057
3092
|
constructor(e) {
|
|
3058
3093
|
this._client = e;
|
|
3059
3094
|
}
|
|
@@ -3077,10 +3112,10 @@ class gs {
|
|
|
3077
3112
|
return e.deviceInformation;
|
|
3078
3113
|
}
|
|
3079
3114
|
}
|
|
3080
|
-
function
|
|
3115
|
+
function vs(a, e = console.error) {
|
|
3081
3116
|
a().catch(e);
|
|
3082
3117
|
}
|
|
3083
|
-
class
|
|
3118
|
+
class Rs {
|
|
3084
3119
|
constructor(e) {
|
|
3085
3120
|
this._client = e;
|
|
3086
3121
|
}
|
|
@@ -3088,7 +3123,7 @@ class $s {
|
|
|
3088
3123
|
return (await this._client.request("environment.getColorScheme", {})).colorScheme;
|
|
3089
3124
|
}
|
|
3090
3125
|
subscribeColorScheme(e) {
|
|
3091
|
-
|
|
3126
|
+
vs(async () => {
|
|
3092
3127
|
this._client.on("environment.colorSchemeChanged", e), e(await this.getColorScheme());
|
|
3093
3128
|
});
|
|
3094
3129
|
}
|
|
@@ -3096,7 +3131,7 @@ class $s {
|
|
|
3096
3131
|
this._client.off("environment.colorSchemeChanged", e);
|
|
3097
3132
|
}
|
|
3098
3133
|
}
|
|
3099
|
-
class
|
|
3134
|
+
class ws {
|
|
3100
3135
|
constructor(e) {
|
|
3101
3136
|
this._client = e;
|
|
3102
3137
|
}
|
|
@@ -3142,7 +3177,56 @@ class vs {
|
|
|
3142
3177
|
})).content;
|
|
3143
3178
|
}
|
|
3144
3179
|
}
|
|
3145
|
-
class
|
|
3180
|
+
class bs {
|
|
3181
|
+
constructor(e) {
|
|
3182
|
+
this._client = e;
|
|
3183
|
+
}
|
|
3184
|
+
async fetch(e, t) {
|
|
3185
|
+
var s;
|
|
3186
|
+
let n;
|
|
3187
|
+
typeof e == "string" ? n = e : e instanceof URL ? n = e.toString() : (n = e.url, t || (t = {
|
|
3188
|
+
method: e.method,
|
|
3189
|
+
headers: e.headers,
|
|
3190
|
+
body: e.body,
|
|
3191
|
+
credentials: e.credentials,
|
|
3192
|
+
cache: e.cache,
|
|
3193
|
+
redirect: e.redirect,
|
|
3194
|
+
referrer: e.referrer,
|
|
3195
|
+
integrity: e.integrity
|
|
3196
|
+
}));
|
|
3197
|
+
let r = {};
|
|
3198
|
+
t != null && t.headers && (t.headers instanceof Headers ? t.headers.forEach((f, b) => {
|
|
3199
|
+
r[b] = f;
|
|
3200
|
+
}) : Array.isArray(t.headers) ? t.headers.forEach(([f, b]) => {
|
|
3201
|
+
r[f] = b;
|
|
3202
|
+
}) : r = t.headers);
|
|
3203
|
+
const i = await this._client.request("proxy.fetch", {
|
|
3204
|
+
url: n,
|
|
3205
|
+
method: (t == null ? void 0 : t.method) || "GET",
|
|
3206
|
+
headers: r,
|
|
3207
|
+
body: (s = t == null ? void 0 : t.body) !== null && s !== void 0 ? s : null
|
|
3208
|
+
});
|
|
3209
|
+
if (!i.success)
|
|
3210
|
+
throw new TypeError(i.errorMessage, {
|
|
3211
|
+
cause: i.errorCause ? Error(i.errorCause) : void 0
|
|
3212
|
+
});
|
|
3213
|
+
const o = new Headers(i.headers), c = {
|
|
3214
|
+
status: i.status,
|
|
3215
|
+
statusText: i.statusText,
|
|
3216
|
+
headers: o
|
|
3217
|
+
};
|
|
3218
|
+
let u = null;
|
|
3219
|
+
if (i.body !== null && i.body !== void 0)
|
|
3220
|
+
if (i.bodyType === "binary") {
|
|
3221
|
+
const f = atob(i.body), b = new Uint8Array(f.length);
|
|
3222
|
+
for (let Z = 0; Z < f.length; Z++)
|
|
3223
|
+
b[Z] = f.charCodeAt(Z);
|
|
3224
|
+
u = b;
|
|
3225
|
+
} else i.bodyType === "text" ? u = i.body : i.bodyType === "json" && (u = JSON.stringify(i.body));
|
|
3226
|
+
return new Response(u, c);
|
|
3227
|
+
}
|
|
3228
|
+
}
|
|
3229
|
+
class ks {
|
|
3146
3230
|
constructor(e) {
|
|
3147
3231
|
this._client = e;
|
|
3148
3232
|
}
|
|
@@ -3170,7 +3254,7 @@ class ws {
|
|
|
3170
3254
|
* @returns A StoreSlice instance for the instance scope
|
|
3171
3255
|
*/
|
|
3172
3256
|
get instance() {
|
|
3173
|
-
return new me("instance", this._client.
|
|
3257
|
+
return new me("instance", this._client.applicationInstance, this._client);
|
|
3174
3258
|
}
|
|
3175
3259
|
/**
|
|
3176
3260
|
* Provides access to the device store scope.
|
|
@@ -3185,7 +3269,7 @@ class ws {
|
|
|
3185
3269
|
* @returns A StoreSlice instance for the device scope
|
|
3186
3270
|
*/
|
|
3187
3271
|
get device() {
|
|
3188
|
-
return new me("device", this._client.
|
|
3272
|
+
return new me("device", this._client.applicationInstance, this._client);
|
|
3189
3273
|
}
|
|
3190
3274
|
/**
|
|
3191
3275
|
* Provides access to the shared store scope with a specified namespace.
|
|
@@ -3298,7 +3382,7 @@ class me {
|
|
|
3298
3382
|
})).success;
|
|
3299
3383
|
}
|
|
3300
3384
|
}
|
|
3301
|
-
class
|
|
3385
|
+
class xs {
|
|
3302
3386
|
constructor(e) {
|
|
3303
3387
|
this._client = e;
|
|
3304
3388
|
}
|
|
@@ -3321,7 +3405,7 @@ class bs {
|
|
|
3321
3405
|
return e.user;
|
|
3322
3406
|
}
|
|
3323
3407
|
}
|
|
3324
|
-
class
|
|
3408
|
+
class Zs {
|
|
3325
3409
|
constructor(e) {
|
|
3326
3410
|
this._client = e;
|
|
3327
3411
|
}
|
|
@@ -3400,12 +3484,12 @@ class ks {
|
|
|
3400
3484
|
function ye(a) {
|
|
3401
3485
|
return { ...a, type: "client" };
|
|
3402
3486
|
}
|
|
3403
|
-
const
|
|
3487
|
+
const Ss = fe.object({
|
|
3404
3488
|
type: fe.literal("bridge"),
|
|
3405
3489
|
name: fe.string(),
|
|
3406
3490
|
data: fe.any()
|
|
3407
3491
|
});
|
|
3408
|
-
class
|
|
3492
|
+
class Ts {
|
|
3409
3493
|
/**
|
|
3410
3494
|
* Creates a new RootSettingsNavigation API instance.
|
|
3411
3495
|
*
|
|
@@ -3429,9 +3513,9 @@ class Zs {
|
|
|
3429
3513
|
*/
|
|
3430
3514
|
async setRootSettingsNavigation(e) {
|
|
3431
3515
|
var t;
|
|
3432
|
-
const s = this._store.shared("root-settings-navigation"), n = (t = await s.get("navigation")) !== null && t !== void 0 ? t : {},
|
|
3433
|
-
n[
|
|
3434
|
-
applicationSpecifier:
|
|
3516
|
+
const s = this._store.shared("root-settings-navigation"), n = (t = await s.get("navigation")) !== null && t !== void 0 ? t : {}, r = this._store._client._applicationSpecifier;
|
|
3517
|
+
n[r] = {
|
|
3518
|
+
applicationSpecifier: r,
|
|
3435
3519
|
entries: e.entries
|
|
3436
3520
|
}, s.set("navigation", n);
|
|
3437
3521
|
}
|
|
@@ -3462,47 +3546,8 @@ class Zs {
|
|
|
3462
3546
|
return (e = await this._store.shared("root-settings-navigation").get("navigation")) !== null && e !== void 0 ? e : {};
|
|
3463
3547
|
}
|
|
3464
3548
|
}
|
|
3465
|
-
class Ss {
|
|
3466
|
-
constructor(e) {
|
|
3467
|
-
this._client = e;
|
|
3468
|
-
}
|
|
3469
|
-
async fetch(e, t) {
|
|
3470
|
-
let s;
|
|
3471
|
-
typeof e == "string" ? s = e : e instanceof URL ? s = e.toString() : (s = e.url, t || (t = {
|
|
3472
|
-
method: e.method,
|
|
3473
|
-
headers: e.headers,
|
|
3474
|
-
body: e.body,
|
|
3475
|
-
credentials: e.credentials,
|
|
3476
|
-
cache: e.cache,
|
|
3477
|
-
redirect: e.redirect,
|
|
3478
|
-
referrer: e.referrer,
|
|
3479
|
-
integrity: e.integrity
|
|
3480
|
-
}));
|
|
3481
|
-
let n = {};
|
|
3482
|
-
t != null && t.headers && (t.headers instanceof Headers ? t.headers.forEach((u, f) => {
|
|
3483
|
-
n[f] = u;
|
|
3484
|
-
}) : Array.isArray(t.headers) ? t.headers.forEach(([u, f]) => {
|
|
3485
|
-
n[u] = f;
|
|
3486
|
-
}) : n = t.headers);
|
|
3487
|
-
const i = await this._client.request("proxy.fetch", {
|
|
3488
|
-
url: s,
|
|
3489
|
-
method: (t == null ? void 0 : t.method) || "GET",
|
|
3490
|
-
headers: n,
|
|
3491
|
-
body: (t == null ? void 0 : t.body) || null
|
|
3492
|
-
});
|
|
3493
|
-
if (!i.success)
|
|
3494
|
-
throw new Error(`Proxy fetch failed: ${i.statusText}`);
|
|
3495
|
-
const r = new Headers(i.headers), o = {
|
|
3496
|
-
status: i.status,
|
|
3497
|
-
statusText: i.statusText,
|
|
3498
|
-
headers: r
|
|
3499
|
-
};
|
|
3500
|
-
let c = null;
|
|
3501
|
-
return i.body !== null && i.body !== void 0 && (typeof i.body == "string" || i.body instanceof ArrayBuffer ? c = i.body : typeof i.body == "object" && (c = JSON.stringify(i.body))), new Response(c, o);
|
|
3502
|
-
}
|
|
3503
|
-
}
|
|
3504
3549
|
const B = 1e3 * 30;
|
|
3505
|
-
class
|
|
3550
|
+
class Ns {
|
|
3506
3551
|
/**
|
|
3507
3552
|
* Creates a new Client instance for communicating with the TelemetryOS platform.
|
|
3508
3553
|
*
|
|
@@ -3514,7 +3559,7 @@ class Ts {
|
|
|
3514
3559
|
* in your application's telemetry.config.json file
|
|
3515
3560
|
*/
|
|
3516
3561
|
constructor(e) {
|
|
3517
|
-
this._applicationName = e, this._applicationInstance = "", this._applicationSpecifier = "", this._onHandlers = /* @__PURE__ */ new Map(), this._onceHandlers = /* @__PURE__ */ new Map(), this._subscriptionNamesByHandler = /* @__PURE__ */ new Map(), this._subscriptionNamesBySubjectName = /* @__PURE__ */ new Map();
|
|
3562
|
+
this._applicationName = e, this._applicationInstance = "", this._applicationSpecifier = "", 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();
|
|
3518
3563
|
}
|
|
3519
3564
|
/**
|
|
3520
3565
|
* Provides access to the accounts API for retrieving TelemetryOS account information.
|
|
@@ -3528,7 +3573,7 @@ class Ts {
|
|
|
3528
3573
|
* @returns An Accounts instance bound to this client
|
|
3529
3574
|
*/
|
|
3530
3575
|
get accounts() {
|
|
3531
|
-
return new
|
|
3576
|
+
return new ys(this);
|
|
3532
3577
|
}
|
|
3533
3578
|
/**
|
|
3534
3579
|
* Provides access to the users API for retrieving TelemetryOS user information.
|
|
@@ -3542,7 +3587,7 @@ class Ts {
|
|
|
3542
3587
|
* @returns A Users instance bound to this client
|
|
3543
3588
|
*/
|
|
3544
3589
|
get users() {
|
|
3545
|
-
return new
|
|
3590
|
+
return new xs(this);
|
|
3546
3591
|
}
|
|
3547
3592
|
/**
|
|
3548
3593
|
* Provides access to the store API for data persistence with multiple storage scopes.
|
|
@@ -3556,7 +3601,7 @@ class Ts {
|
|
|
3556
3601
|
* @returns A Store instance bound to this client
|
|
3557
3602
|
*/
|
|
3558
3603
|
get store() {
|
|
3559
|
-
return new
|
|
3604
|
+
return new ks(this);
|
|
3560
3605
|
}
|
|
3561
3606
|
/**
|
|
3562
3607
|
* Provides access to the applications API for discovering other TelemetryOS applications.
|
|
@@ -3570,7 +3615,7 @@ class Ts {
|
|
|
3570
3615
|
* @returns An Applications instance bound to this client
|
|
3571
3616
|
*/
|
|
3572
3617
|
get applications() {
|
|
3573
|
-
return new
|
|
3618
|
+
return new gs(this);
|
|
3574
3619
|
}
|
|
3575
3620
|
/**
|
|
3576
3621
|
* Provides access to the media API for working with content hosted on the TelemetryOS platform.
|
|
@@ -3585,7 +3630,7 @@ class Ts {
|
|
|
3585
3630
|
* @returns A Media instance bound to this client
|
|
3586
3631
|
*/
|
|
3587
3632
|
get media() {
|
|
3588
|
-
return new
|
|
3633
|
+
return new ws(this);
|
|
3589
3634
|
}
|
|
3590
3635
|
/**
|
|
3591
3636
|
* Provides access to the proxy API for fetching third-party content through the TelemetryOS API.
|
|
@@ -3599,7 +3644,7 @@ class Ts {
|
|
|
3599
3644
|
* @returns A Proxy instance bound to this client
|
|
3600
3645
|
*/
|
|
3601
3646
|
get proxy() {
|
|
3602
|
-
return new
|
|
3647
|
+
return new bs(this);
|
|
3603
3648
|
}
|
|
3604
3649
|
/**
|
|
3605
3650
|
* Provides access to the devices API for interacting with the current device.
|
|
@@ -3614,7 +3659,7 @@ class Ts {
|
|
|
3614
3659
|
* @returns A Devices instance bound to this client
|
|
3615
3660
|
*/
|
|
3616
3661
|
get devices() {
|
|
3617
|
-
return new
|
|
3662
|
+
return new _s(this);
|
|
3618
3663
|
}
|
|
3619
3664
|
/**
|
|
3620
3665
|
* Provides access to the root settings navigation API for TelemetryOS administration UI integration.
|
|
@@ -3632,7 +3677,7 @@ class Ts {
|
|
|
3632
3677
|
* @throws {Error} If used by an application not mounted at the 'rootSettingsNavigation' mount point
|
|
3633
3678
|
*/
|
|
3634
3679
|
get rootSettingsNavigation() {
|
|
3635
|
-
return new
|
|
3680
|
+
return new Ts(this.store);
|
|
3636
3681
|
}
|
|
3637
3682
|
/**
|
|
3638
3683
|
* Provides access to the weather API for retrieving weather data.
|
|
@@ -3646,7 +3691,7 @@ class Ts {
|
|
|
3646
3691
|
* @returns A Weather instance bound to this client
|
|
3647
3692
|
*/
|
|
3648
3693
|
get weather() {
|
|
3649
|
-
return new
|
|
3694
|
+
return new Zs(this);
|
|
3650
3695
|
}
|
|
3651
3696
|
get applicationName() {
|
|
3652
3697
|
return this._applicationName;
|
|
@@ -3673,41 +3718,45 @@ class Ts {
|
|
|
3673
3718
|
* of creating and binding their own Client instances.
|
|
3674
3719
|
*/
|
|
3675
3720
|
bind() {
|
|
3676
|
-
var e;
|
|
3677
|
-
const
|
|
3678
|
-
this._applicationInstance = (e =
|
|
3679
|
-
|
|
3680
|
-
if (
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
const i = t.hostname.split(".");
|
|
3684
|
-
this._applicationSpecifier = i[0] || "";
|
|
3721
|
+
var e, t, s;
|
|
3722
|
+
const n = new URL(window.location.href), r = n.searchParams;
|
|
3723
|
+
if (this._applicationInstance = (e = r.get("applicationInstance")) !== null && e !== void 0 ? e : "", !this._applicationInstance)
|
|
3724
|
+
throw new Error("Missing applicationInstance query parameter");
|
|
3725
|
+
if (this._applicationSpecifier = (t = r.get("applicationSpecifier")) !== null && t !== void 0 ? t : "", !this._applicationSpecifier) {
|
|
3726
|
+
const i = n.hostname.split(".");
|
|
3727
|
+
this._applicationSpecifier = (s = i[0]) !== null && s !== void 0 ? s : "";
|
|
3685
3728
|
}
|
|
3686
3729
|
if (!this._applicationSpecifier || this._applicationSpecifier.length !== 40)
|
|
3687
3730
|
throw new Error(`Invalid applicationSpecifier: expected 40-character hash, got "${this._applicationSpecifier}"`);
|
|
3688
|
-
if (!this._applicationInstance)
|
|
3689
|
-
throw new Error("Missing telemetryApplicationId query parameter");
|
|
3690
3731
|
this._windowMessageHandler = (i) => {
|
|
3691
3732
|
if (i.source === window || !i.data || !("type" in i.data) || i.data.type !== "client" && i.data.type !== "bridge")
|
|
3692
3733
|
return;
|
|
3734
|
+
let o;
|
|
3693
3735
|
if (i.data.type === "client") {
|
|
3694
|
-
|
|
3695
|
-
|
|
3736
|
+
const c = this._messageInterceptors.get(i.data.name);
|
|
3737
|
+
if (!c) {
|
|
3738
|
+
window.parent.postMessage(i.data, "*");
|
|
3739
|
+
return;
|
|
3740
|
+
}
|
|
3741
|
+
o = { ...c(i.data.data), type: "bridge" };
|
|
3696
3742
|
}
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3743
|
+
if (!o) {
|
|
3744
|
+
const c = Ss.safeParse(i.data);
|
|
3745
|
+
if (!c.success)
|
|
3746
|
+
return;
|
|
3747
|
+
o = c.data;
|
|
3748
|
+
const u = this._onHandlers.get(o.name), f = this._onceHandlers.get(o.name);
|
|
3749
|
+
if (u)
|
|
3750
|
+
for (const b of u)
|
|
3751
|
+
b(o.data);
|
|
3752
|
+
if (f) {
|
|
3753
|
+
for (const b of f)
|
|
3754
|
+
b(o.data);
|
|
3755
|
+
this._onceHandlers.delete(o.name);
|
|
3756
|
+
}
|
|
3708
3757
|
}
|
|
3709
|
-
for (let
|
|
3710
|
-
window.frames[
|
|
3758
|
+
for (let c = 0; c < window.frames.length; c += 1)
|
|
3759
|
+
window.frames[c].postMessage(o, "*");
|
|
3711
3760
|
}, window.addEventListener("message", this._windowMessageHandler);
|
|
3712
3761
|
}
|
|
3713
3762
|
/**
|
|
@@ -3778,25 +3827,25 @@ class Ts {
|
|
|
3778
3827
|
responseName: s
|
|
3779
3828
|
});
|
|
3780
3829
|
window.parent.postMessage(n, "*");
|
|
3781
|
-
let
|
|
3830
|
+
let r = !1, i;
|
|
3782
3831
|
const o = new Promise((u, f) => {
|
|
3783
3832
|
const b = new Error(`${e} message request with response name of ${s} timed out after ${B}`);
|
|
3784
3833
|
setTimeout(() => {
|
|
3785
|
-
|
|
3834
|
+
r = !0, this.off(s, i), f(b);
|
|
3786
3835
|
}, B);
|
|
3787
3836
|
}), c = new Promise((u) => {
|
|
3788
|
-
|
|
3789
|
-
|
|
3837
|
+
i = (f) => {
|
|
3838
|
+
r || u(f);
|
|
3790
3839
|
}, this.once(s, u);
|
|
3791
3840
|
});
|
|
3792
3841
|
return Promise.race([o, c]);
|
|
3793
3842
|
}
|
|
3794
3843
|
async subscribe(e, t, s) {
|
|
3795
|
-
let n,
|
|
3796
|
-
typeof t == "function" ?
|
|
3797
|
-
const
|
|
3844
|
+
let n, r;
|
|
3845
|
+
typeof t == "function" ? r = t : (n = t, r = s);
|
|
3846
|
+
const i = ge(), o = ge();
|
|
3798
3847
|
let c = this._subscriptionNamesBySubjectName.get(e);
|
|
3799
|
-
c || (c = [], this._subscriptionNamesBySubjectName.set(e, c)), c.push(
|
|
3848
|
+
c || (c = [], this._subscriptionNamesBySubjectName.set(e, c)), c.push(i), this._subscriptionNamesByHandler.set(r, i), this.on(i, r);
|
|
3800
3849
|
const u = ye({
|
|
3801
3850
|
telemetrySdkVersion: _e,
|
|
3802
3851
|
applicationName: this._applicationName,
|
|
@@ -3805,12 +3854,12 @@ class Ts {
|
|
|
3805
3854
|
name: e,
|
|
3806
3855
|
data: n,
|
|
3807
3856
|
responseName: o,
|
|
3808
|
-
subscriptionName:
|
|
3857
|
+
subscriptionName: i
|
|
3809
3858
|
});
|
|
3810
3859
|
window.parent.postMessage(u, "*");
|
|
3811
3860
|
let f = !1, b;
|
|
3812
|
-
const
|
|
3813
|
-
const Ie = new Error(`${e} subscribe request with subscription name of ${
|
|
3861
|
+
const Z = new Promise((F, L) => {
|
|
3862
|
+
const Ie = new Error(`${e} subscribe request with subscription name of ${i} and response name of ${o} timed out after ${B}`);
|
|
3814
3863
|
setTimeout(() => {
|
|
3815
3864
|
f = !0, this.off(o, b), L(Ie);
|
|
3816
3865
|
}, B);
|
|
@@ -3819,22 +3868,22 @@ class Ts {
|
|
|
3819
3868
|
f || F(L);
|
|
3820
3869
|
}, this.on(o, F);
|
|
3821
3870
|
});
|
|
3822
|
-
return Promise.race([
|
|
3871
|
+
return Promise.race([Z, Ee]);
|
|
3823
3872
|
}
|
|
3824
3873
|
async unsubscribe(e, t, s) {
|
|
3825
|
-
let n,
|
|
3826
|
-
typeof t == "function" ?
|
|
3827
|
-
const
|
|
3874
|
+
let n, r;
|
|
3875
|
+
typeof t == "function" ? r = t : (n = t, r = s);
|
|
3876
|
+
const i = ge();
|
|
3828
3877
|
let o = [];
|
|
3829
|
-
if (
|
|
3830
|
-
const c = this._subscriptionNamesByHandler.get(
|
|
3878
|
+
if (r) {
|
|
3879
|
+
const c = this._subscriptionNamesByHandler.get(r);
|
|
3831
3880
|
if (!c)
|
|
3832
3881
|
return { success: !1 };
|
|
3833
|
-
o = [c], this._subscriptionNamesByHandler.delete(
|
|
3882
|
+
o = [c], this._subscriptionNamesByHandler.delete(r);
|
|
3834
3883
|
} else if (!this._subscriptionNamesBySubjectName.get(e))
|
|
3835
3884
|
return { success: !1 };
|
|
3836
3885
|
for await (const c of o) {
|
|
3837
|
-
this.off(c,
|
|
3886
|
+
this.off(c, r);
|
|
3838
3887
|
const u = ye({
|
|
3839
3888
|
telemetrySdkVersion: _e,
|
|
3840
3889
|
applicationInstance: this._applicationInstance,
|
|
@@ -3842,22 +3891,22 @@ class Ts {
|
|
|
3842
3891
|
applicationSpecifier: this._applicationSpecifier,
|
|
3843
3892
|
name: e,
|
|
3844
3893
|
data: n,
|
|
3845
|
-
responseName:
|
|
3894
|
+
responseName: i,
|
|
3846
3895
|
unsubscribeName: c
|
|
3847
3896
|
});
|
|
3848
3897
|
window.parent.postMessage(u, "*");
|
|
3849
3898
|
let f = !1, b;
|
|
3850
|
-
const
|
|
3851
|
-
const Ie = new Error(`${e} unsubscribe request with unsubscribe name of ${c} and response name of ${
|
|
3899
|
+
const Z = new Promise((F, L) => {
|
|
3900
|
+
const Ie = new Error(`${e} unsubscribe request with unsubscribe name of ${c} and response name of ${i} timed out after ${B}`);
|
|
3852
3901
|
setTimeout(() => {
|
|
3853
|
-
f = !0, this.off(
|
|
3902
|
+
f = !0, this.off(i, b), L(Ie);
|
|
3854
3903
|
}, B);
|
|
3855
3904
|
}), Ee = new Promise((F) => {
|
|
3856
3905
|
b = (L) => {
|
|
3857
3906
|
f || F(L);
|
|
3858
|
-
}, this.once(
|
|
3907
|
+
}, this.once(i, F);
|
|
3859
3908
|
});
|
|
3860
|
-
if (!(await Promise.race([
|
|
3909
|
+
if (!(await Promise.race([Z, Ee])).success)
|
|
3861
3910
|
return { success: !1 };
|
|
3862
3911
|
}
|
|
3863
3912
|
return { success: !0 };
|
|
@@ -3922,13 +3971,13 @@ class Ts {
|
|
|
3922
3971
|
const s = this._onHandlers.get(e), n = this._onceHandlers.get(e);
|
|
3923
3972
|
if (!(!s && !n)) {
|
|
3924
3973
|
if (s) {
|
|
3925
|
-
for (let
|
|
3926
|
-
t && s[
|
|
3974
|
+
for (let r = 0; r < s.length; r += 1)
|
|
3975
|
+
t && s[r] !== t || (s.splice(r, 1), r -= 1);
|
|
3927
3976
|
s.length === 0 && this._onHandlers.delete(e);
|
|
3928
3977
|
}
|
|
3929
3978
|
if (n) {
|
|
3930
|
-
for (let
|
|
3931
|
-
t && n[
|
|
3979
|
+
for (let r = 0; r < n.length; r += 1)
|
|
3980
|
+
t && n[r] !== t || (n.splice(r, 1), r -= 1);
|
|
3932
3981
|
n.length === 0 && this._onceHandlers.delete(e);
|
|
3933
3982
|
}
|
|
3934
3983
|
}
|
|
@@ -3937,8 +3986,8 @@ class Ts {
|
|
|
3937
3986
|
function ge() {
|
|
3938
3987
|
return Math.random().toString(36).slice(2, 9);
|
|
3939
3988
|
}
|
|
3940
|
-
const _e =
|
|
3941
|
-
class
|
|
3989
|
+
const _e = ms.version;
|
|
3990
|
+
class Cs {
|
|
3942
3991
|
constructor(e) {
|
|
3943
3992
|
this._client = e;
|
|
3944
3993
|
}
|
|
@@ -3987,7 +4036,7 @@ class Ns {
|
|
|
3987
4036
|
return !0;
|
|
3988
4037
|
}
|
|
3989
4038
|
}
|
|
3990
|
-
class
|
|
4039
|
+
class Os {
|
|
3991
4040
|
constructor(e) {
|
|
3992
4041
|
this._client = e;
|
|
3993
4042
|
}
|
|
@@ -4043,103 +4092,108 @@ class Cs {
|
|
|
4043
4092
|
return !0;
|
|
4044
4093
|
}
|
|
4045
4094
|
}
|
|
4046
|
-
class
|
|
4095
|
+
class As extends Ns {
|
|
4047
4096
|
get playlist() {
|
|
4048
|
-
return new
|
|
4097
|
+
return new Os(this);
|
|
4049
4098
|
}
|
|
4050
4099
|
get overrides() {
|
|
4051
|
-
return new
|
|
4100
|
+
return new Cs(this);
|
|
4052
4101
|
}
|
|
4053
4102
|
}
|
|
4054
|
-
let
|
|
4055
|
-
function Ps() {
|
|
4056
|
-
return v;
|
|
4057
|
-
}
|
|
4058
|
-
function Rs(a) {
|
|
4059
|
-
v = new Os(a), v.bind();
|
|
4060
|
-
}
|
|
4103
|
+
let _ = null;
|
|
4061
4104
|
function Ms() {
|
|
4062
|
-
|
|
4105
|
+
return _;
|
|
4063
4106
|
}
|
|
4064
|
-
function Fs(
|
|
4065
|
-
|
|
4107
|
+
function Fs(a) {
|
|
4108
|
+
_ = new As(a), _.bind();
|
|
4066
4109
|
}
|
|
4067
|
-
function Ls(
|
|
4068
|
-
|
|
4110
|
+
function Ls() {
|
|
4111
|
+
_ == null || _.unbind(), _ = null;
|
|
4069
4112
|
}
|
|
4070
4113
|
function Ds(...a) {
|
|
4071
|
-
return k(
|
|
4072
|
-
}
|
|
4073
|
-
function zs(...a) {
|
|
4074
|
-
return k(v), v.send(...a);
|
|
4114
|
+
return k(_), _.on(...a);
|
|
4075
4115
|
}
|
|
4076
4116
|
function qs(...a) {
|
|
4077
|
-
return k(
|
|
4117
|
+
return k(_), _.once(...a);
|
|
4118
|
+
}
|
|
4119
|
+
function zs(...a) {
|
|
4120
|
+
return k(_), _.off(...a);
|
|
4078
4121
|
}
|
|
4079
4122
|
function Vs(...a) {
|
|
4080
|
-
return k(
|
|
4123
|
+
return k(_), _.send(...a);
|
|
4081
4124
|
}
|
|
4082
4125
|
function Bs(...a) {
|
|
4083
|
-
return k(
|
|
4126
|
+
return k(_), _.request(...a);
|
|
4084
4127
|
}
|
|
4085
|
-
function Us() {
|
|
4086
|
-
return k(
|
|
4128
|
+
function Us(...a) {
|
|
4129
|
+
return k(_), _.subscribe(...a);
|
|
4087
4130
|
}
|
|
4088
|
-
function Hs() {
|
|
4089
|
-
return k(
|
|
4131
|
+
function Hs(...a) {
|
|
4132
|
+
return k(_), _.unsubscribe(...a);
|
|
4090
4133
|
}
|
|
4091
4134
|
function Ks() {
|
|
4092
|
-
return k(
|
|
4135
|
+
return k(_), _.accounts;
|
|
4093
4136
|
}
|
|
4094
4137
|
function Ws() {
|
|
4095
|
-
return k(
|
|
4138
|
+
return k(_), _.users;
|
|
4096
4139
|
}
|
|
4097
4140
|
function Js() {
|
|
4098
|
-
return k(
|
|
4141
|
+
return k(_), _.store;
|
|
4099
4142
|
}
|
|
4100
4143
|
function Ys() {
|
|
4101
|
-
return k(
|
|
4144
|
+
return k(_), _.applications;
|
|
4102
4145
|
}
|
|
4103
4146
|
function Gs() {
|
|
4104
|
-
return k(
|
|
4147
|
+
return k(_), _.media;
|
|
4105
4148
|
}
|
|
4106
4149
|
function Xs() {
|
|
4107
|
-
return k(
|
|
4150
|
+
return k(_), _.proxy;
|
|
4108
4151
|
}
|
|
4109
4152
|
function Qs() {
|
|
4110
|
-
return k(
|
|
4153
|
+
return k(_), _.devices;
|
|
4154
|
+
}
|
|
4155
|
+
function ea() {
|
|
4156
|
+
return k(_), _.weather;
|
|
4157
|
+
}
|
|
4158
|
+
function ta() {
|
|
4159
|
+
return k(_), _.playlist;
|
|
4160
|
+
}
|
|
4161
|
+
function sa() {
|
|
4162
|
+
return k(_), _.overrides;
|
|
4111
4163
|
}
|
|
4112
4164
|
function k(a) {
|
|
4113
4165
|
if (!a)
|
|
4114
4166
|
throw new Error("SDK is not configured");
|
|
4115
4167
|
}
|
|
4116
4168
|
export {
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
Vs as
|
|
4169
|
+
ys as Accounts,
|
|
4170
|
+
gs as Applications,
|
|
4171
|
+
_s as Devices,
|
|
4172
|
+
Rs as Environment,
|
|
4173
|
+
ws as Media,
|
|
4174
|
+
bs as Proxy,
|
|
4175
|
+
ks as Store,
|
|
4176
|
+
xs as Users,
|
|
4177
|
+
Zs as Weather,
|
|
4178
|
+
Ks as accounts,
|
|
4179
|
+
Ys as applications,
|
|
4180
|
+
Fs as configure,
|
|
4181
|
+
Ls as destroy,
|
|
4182
|
+
Qs as devices,
|
|
4183
|
+
Ms as globalClient,
|
|
4184
|
+
Gs as media,
|
|
4185
|
+
zs as off,
|
|
4186
|
+
Ds as on,
|
|
4187
|
+
qs as once,
|
|
4188
|
+
sa as overrides,
|
|
4189
|
+
ta as playlist,
|
|
4190
|
+
Xs as proxy,
|
|
4191
|
+
Bs as request,
|
|
4192
|
+
Vs as send,
|
|
4193
|
+
Js as store,
|
|
4194
|
+
Us as subscribe,
|
|
4141
4195
|
_e as telemetrySdkVersion,
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4196
|
+
Hs as unsubscribe,
|
|
4197
|
+
Ws as users,
|
|
4198
|
+
ea as weather
|
|
4145
4199
|
};
|