@telemetryos/sdk 1.4.3 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +40 -13
- package/dist/index.js +829 -754
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -8,40 +8,40 @@ 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
|
-
var
|
|
37
|
+
var $e;
|
|
38
38
|
(function(a) {
|
|
39
39
|
a.mergeShapes = (e, t) => ({
|
|
40
40
|
...e,
|
|
41
41
|
...t
|
|
42
42
|
// second overwrites first
|
|
43
43
|
});
|
|
44
|
-
})(
|
|
44
|
+
})($e || ($e = {}));
|
|
45
45
|
const h = w.arrayToEnum([
|
|
46
46
|
"string",
|
|
47
47
|
"nan",
|
|
@@ -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,30 +116,30 @@ let C = class Ve 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
|
};
|
|
139
139
|
return n(this), s;
|
|
140
140
|
}
|
|
141
141
|
static assert(e) {
|
|
142
|
-
if (!(e instanceof
|
|
142
|
+
if (!(e instanceof He))
|
|
143
143
|
throw new Error(`Not a ZodError: ${e}`);
|
|
144
144
|
}
|
|
145
145
|
toString() {
|
|
@@ -161,8 +161,8 @@ let C = class Ve extends Error {
|
|
|
161
161
|
return this.flatten();
|
|
162
162
|
}
|
|
163
163
|
};
|
|
164
|
-
|
|
165
|
-
const
|
|
164
|
+
O.create = (a) => new O(a);
|
|
165
|
+
const H = (a, e) => {
|
|
166
166
|
let t;
|
|
167
167
|
switch (a.code) {
|
|
168
168
|
case d.invalid_type:
|
|
@@ -218,36 +218,36 @@ const K = (a, e) => {
|
|
|
218
218
|
}
|
|
219
219
|
return { message: t };
|
|
220
220
|
};
|
|
221
|
-
let
|
|
222
|
-
function
|
|
223
|
-
|
|
221
|
+
let Ke = H;
|
|
222
|
+
function ot(a) {
|
|
223
|
+
Ke = a;
|
|
224
224
|
}
|
|
225
|
-
function
|
|
226
|
-
return
|
|
225
|
+
function be() {
|
|
226
|
+
return Ke;
|
|
227
227
|
}
|
|
228
|
-
const
|
|
229
|
-
const { data: e, path: t, errorMaps: s, issueData: n } = a,
|
|
228
|
+
const ke = (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
|
-
const t =
|
|
250
|
+
const t = be(), s = ke({
|
|
251
251
|
issueData: e,
|
|
252
252
|
data: a.data,
|
|
253
253
|
path: a.path,
|
|
@@ -258,13 +258,13 @@ function l(a, e) {
|
|
|
258
258
|
// then schema-bound map if available
|
|
259
259
|
t,
|
|
260
260
|
// then global override map
|
|
261
|
-
t ===
|
|
261
|
+
t === H ? void 0 : H
|
|
262
262
|
// then global default map
|
|
263
263
|
].filter((n) => !!n)
|
|
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,33 +286,33 @@ let x = class Ue {
|
|
|
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
|
-
return
|
|
295
|
+
return We.mergeObjectSync(e, s);
|
|
296
296
|
}
|
|
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
|
-
}),
|
|
311
|
-
function
|
|
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
|
+
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);
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function Je(a, e, t, s, n) {
|
|
316
316
|
if (typeof e == "function" ? a !== e || !0 : !e.has(a)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
317
317
|
return e.set(a, t), t;
|
|
318
318
|
}
|
|
@@ -320,8 +320,8 @@ var p;
|
|
|
320
320
|
(function(a) {
|
|
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
|
-
var
|
|
324
|
-
class
|
|
323
|
+
var J, Y;
|
|
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
|
}
|
|
@@ -329,8 +329,8 @@ class E {
|
|
|
329
329
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
|
-
const
|
|
333
|
-
if (
|
|
332
|
+
const Ve = (a, e) => {
|
|
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 Le = (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
|
|
@@ -388,7 +388,7 @@ class _ {
|
|
|
388
388
|
}
|
|
389
389
|
_parseSync(e) {
|
|
390
390
|
const t = this._parse(e);
|
|
391
|
-
if (
|
|
391
|
+
if (G(t))
|
|
392
392
|
throw new Error("Synchronous parse encountered promise.");
|
|
393
393
|
return t;
|
|
394
394
|
}
|
|
@@ -414,9 +414,9 @@ class _ {
|
|
|
414
414
|
schemaErrorMap: this._def.errorMap,
|
|
415
415
|
parent: null,
|
|
416
416
|
data: e,
|
|
417
|
-
parsedType:
|
|
418
|
-
},
|
|
419
|
-
return
|
|
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
|
|
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,10 +503,10 @@ class _ {
|
|
|
503
503
|
};
|
|
504
504
|
}
|
|
505
505
|
optional() {
|
|
506
|
-
return
|
|
506
|
+
return E.create(this, this._def);
|
|
507
507
|
}
|
|
508
508
|
nullable() {
|
|
509
|
-
return
|
|
509
|
+
return M.create(this, this._def);
|
|
510
510
|
}
|
|
511
511
|
nullish() {
|
|
512
512
|
return this.nullable().optional();
|
|
@@ -515,16 +515,16 @@ class _ {
|
|
|
515
515
|
return V.create(this);
|
|
516
516
|
}
|
|
517
517
|
promise() {
|
|
518
|
-
return
|
|
518
|
+
return W.create(this, this._def);
|
|
519
519
|
}
|
|
520
520
|
or(e) {
|
|
521
|
-
return
|
|
521
|
+
return ae.create([this, e], this._def);
|
|
522
522
|
}
|
|
523
523
|
and(e) {
|
|
524
|
-
return
|
|
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,
|
|
@@ -533,7 +533,7 @@ class _ {
|
|
|
533
533
|
}
|
|
534
534
|
default(e) {
|
|
535
535
|
const t = typeof e == "function" ? e : () => e;
|
|
536
|
-
return new
|
|
536
|
+
return new de({
|
|
537
537
|
...g(this._def),
|
|
538
538
|
innerType: this,
|
|
539
539
|
defaultValue: t,
|
|
@@ -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)
|
|
@@ -549,7 +549,7 @@ class _ {
|
|
|
549
549
|
}
|
|
550
550
|
catch(e) {
|
|
551
551
|
const t = typeof e == "function" ? e : () => e;
|
|
552
|
-
return new
|
|
552
|
+
return new ue({
|
|
553
553
|
...g(this._def),
|
|
554
554
|
innerType: this,
|
|
555
555
|
catchValue: t,
|
|
@@ -564,10 +564,10 @@ class _ {
|
|
|
564
564
|
});
|
|
565
565
|
}
|
|
566
566
|
pipe(e) {
|
|
567
|
-
return
|
|
567
|
+
return pe.create(this, e);
|
|
568
568
|
}
|
|
569
569
|
readonly() {
|
|
570
|
-
return
|
|
570
|
+
return le.create(this);
|
|
571
571
|
}
|
|
572
572
|
isOptional() {
|
|
573
573
|
return this.safeParse(void 0).success;
|
|
@@ -575,29 +575,29 @@ class _ {
|
|
|
575
575
|
isNullable() {
|
|
576
576
|
return this.safeParse(null).success;
|
|
577
577
|
}
|
|
578
|
-
}
|
|
579
|
-
const
|
|
580
|
-
let
|
|
581
|
-
const
|
|
582
|
-
function
|
|
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
|
+
let je;
|
|
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
|
+
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
|
|
589
|
-
return new RegExp(`^${
|
|
588
|
+
function St(a) {
|
|
589
|
+
return new RegExp(`^${Ge(a)}$`);
|
|
590
590
|
}
|
|
591
|
-
function
|
|
592
|
-
let e = `${
|
|
591
|
+
function Xe(a) {
|
|
592
|
+
let e = `${Ye}T${Ge(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
|
|
597
|
-
return !!((e === "v4" || !e) &&
|
|
596
|
+
function Tt(a, e) {
|
|
597
|
+
return !!((e === "v4" || !e) && _t.test(a) || (e === "v6" || !e) && wt.test(a));
|
|
598
598
|
}
|
|
599
|
-
function
|
|
600
|
-
if (!
|
|
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 Zt(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
|
-
|
|
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
|
|
@@ -725,39 +725,39 @@ class N extends _ {
|
|
|
725
725
|
code: d.invalid_string,
|
|
726
726
|
validation: { endsWith: n.value },
|
|
727
727
|
message: n.message
|
|
728
|
-
}), t.dirty()) : n.kind === "datetime" ?
|
|
728
|
+
}), t.dirty()) : n.kind === "datetime" ? Xe(n).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
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
|
-
class
|
|
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 @@ class M 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 @@ class M 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
|
|
@@ -1058,7 +1058,7 @@ class M extends _ {
|
|
|
1058
1058
|
return this.setLimit("max", e, !1, p.toString(t));
|
|
1059
1059
|
}
|
|
1060
1060
|
setLimit(e, t, s, n) {
|
|
1061
|
-
return new
|
|
1061
|
+
return new Me({
|
|
1062
1062
|
...this._def,
|
|
1063
1063
|
checks: [
|
|
1064
1064
|
...this._def.checks,
|
|
@@ -1072,7 +1072,7 @@ class M extends _ {
|
|
|
1072
1072
|
});
|
|
1073
1073
|
}
|
|
1074
1074
|
_addCheck(e) {
|
|
1075
|
-
return new
|
|
1075
|
+
return new Me({
|
|
1076
1076
|
...this._def,
|
|
1077
1077
|
checks: [...this._def.checks, e]
|
|
1078
1078
|
});
|
|
@@ -1165,14 +1165,14 @@ class M extends _ {
|
|
|
1165
1165
|
}
|
|
1166
1166
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
1167
1167
|
}
|
|
1168
|
-
}
|
|
1169
|
-
|
|
1168
|
+
};
|
|
1169
|
+
X.create = (a) => new X({
|
|
1170
1170
|
checks: [],
|
|
1171
1171
|
typeName: m.ZodNumber,
|
|
1172
1172
|
coerce: (a == null ? void 0 : a.coerce) || !1,
|
|
1173
1173
|
...g(a)
|
|
1174
1174
|
});
|
|
1175
|
-
let Q = class
|
|
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 Re 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,
|
|
@@ -1228,7 +1228,7 @@ let Q = class Re extends _ {
|
|
|
1228
1228
|
return this.setLimit("max", e, !1, p.toString(t));
|
|
1229
1229
|
}
|
|
1230
1230
|
setLimit(e, t, s, n) {
|
|
1231
|
-
return new
|
|
1231
|
+
return new Fe({
|
|
1232
1232
|
...this._def,
|
|
1233
1233
|
checks: [
|
|
1234
1234
|
...this._def.checks,
|
|
@@ -1242,7 +1242,7 @@ let Q = class Re extends _ {
|
|
|
1242
1242
|
});
|
|
1243
1243
|
}
|
|
1244
1244
|
_addCheck(e) {
|
|
1245
|
-
return new
|
|
1245
|
+
return new Fe({
|
|
1246
1246
|
...this._def,
|
|
1247
1247
|
checks: [...this._def.checks, e]
|
|
1248
1248
|
});
|
|
@@ -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);
|
|
@@ -1318,7 +1318,7 @@ class ee extends _ {
|
|
|
1318
1318
|
received: t.parsedType
|
|
1319
1319
|
}), y;
|
|
1320
1320
|
}
|
|
1321
|
-
return
|
|
1321
|
+
return x(e.data);
|
|
1322
1322
|
}
|
|
1323
1323
|
}
|
|
1324
1324
|
ee.create = (a) => new ee({
|
|
@@ -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
|
-
|
|
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 @@ let te = class Ye 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 @@ let te = class Ye 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
|
});
|
|
@@ -1397,14 +1397,14 @@ let te = class Ye extends _ {
|
|
|
1397
1397
|
t.kind === "max" && (e === null || t.value < e) && (e = t.value);
|
|
1398
1398
|
return e != null ? new Date(e) : null;
|
|
1399
1399
|
}
|
|
1400
|
-
}
|
|
1401
|
-
|
|
1400
|
+
}
|
|
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
|
|
1407
|
+
class Se extends v {
|
|
1408
1408
|
_parse(e) {
|
|
1409
1409
|
if (this._getType(e) !== h.symbol) {
|
|
1410
1410
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1414,14 +1414,14 @@ class Ze extends _ {
|
|
|
1414
1414
|
received: t.parsedType
|
|
1415
1415
|
}), y;
|
|
1416
1416
|
}
|
|
1417
|
-
return
|
|
1417
|
+
return x(e.data);
|
|
1418
1418
|
}
|
|
1419
1419
|
}
|
|
1420
|
-
|
|
1420
|
+
Se.create = (a) => new Se({
|
|
1421
1421
|
typeName: m.ZodSymbol,
|
|
1422
1422
|
...g(a)
|
|
1423
1423
|
});
|
|
1424
|
-
class
|
|
1424
|
+
class te extends v {
|
|
1425
1425
|
_parse(e) {
|
|
1426
1426
|
if (this._getType(e) !== h.undefined) {
|
|
1427
1427
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1431,14 +1431,14 @@ class se extends _ {
|
|
|
1431
1431
|
received: t.parsedType
|
|
1432
1432
|
}), y;
|
|
1433
1433
|
}
|
|
1434
|
-
return
|
|
1434
|
+
return x(e.data);
|
|
1435
1435
|
}
|
|
1436
1436
|
}
|
|
1437
|
-
|
|
1437
|
+
te.create = (a) => new te({
|
|
1438
1438
|
typeName: m.ZodUndefined,
|
|
1439
1439
|
...g(a)
|
|
1440
1440
|
});
|
|
1441
|
-
class
|
|
1441
|
+
class se extends v {
|
|
1442
1442
|
_parse(e) {
|
|
1443
1443
|
if (this._getType(e) !== h.null) {
|
|
1444
1444
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1448,38 +1448,38 @@ class ae extends _ {
|
|
|
1448
1448
|
received: t.parsedType
|
|
1449
1449
|
}), y;
|
|
1450
1450
|
}
|
|
1451
|
-
return
|
|
1451
|
+
return x(e.data);
|
|
1452
1452
|
}
|
|
1453
1453
|
}
|
|
1454
|
-
|
|
1454
|
+
se.create = (a) => new se({
|
|
1455
1455
|
typeName: m.ZodNull,
|
|
1456
1456
|
...g(a)
|
|
1457
1457
|
});
|
|
1458
|
-
let
|
|
1458
|
+
let K = class extends v {
|
|
1459
1459
|
constructor() {
|
|
1460
1460
|
super(...arguments), this._any = !0;
|
|
1461
1461
|
}
|
|
1462
1462
|
_parse(e) {
|
|
1463
|
-
return
|
|
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
|
|
1470
|
+
class D extends v {
|
|
1471
1471
|
constructor() {
|
|
1472
1472
|
super(...arguments), this._unknown = !0;
|
|
1473
1473
|
}
|
|
1474
1474
|
_parse(e) {
|
|
1475
|
-
return
|
|
1475
|
+
return x(e.data);
|
|
1476
1476
|
}
|
|
1477
1477
|
}
|
|
1478
|
-
|
|
1478
|
+
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
|
|
1496
|
+
class Te extends v {
|
|
1497
1497
|
_parse(e) {
|
|
1498
1498
|
if (this._getType(e) !== h.undefined) {
|
|
1499
1499
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1503,14 +1503,14 @@ class Se extends _ {
|
|
|
1503
1503
|
received: t.parsedType
|
|
1504
1504
|
}), y;
|
|
1505
1505
|
}
|
|
1506
|
-
return
|
|
1506
|
+
return x(e.data);
|
|
1507
1507
|
}
|
|
1508
1508
|
}
|
|
1509
|
-
|
|
1509
|
+
Te.create = (a) => new Te({
|
|
1510
1510
|
typeName: m.ZodVoid,
|
|
1511
1511
|
...g(a)
|
|
1512
1512
|
});
|
|
1513
|
-
let V = class
|
|
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 _e 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,27 +1546,27 @@ let V = class _e 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;
|
|
1555
1555
|
}
|
|
1556
1556
|
min(e, t) {
|
|
1557
|
-
return new
|
|
1557
|
+
return new ve({
|
|
1558
1558
|
...this._def,
|
|
1559
1559
|
minLength: { value: e, message: p.toString(t) }
|
|
1560
1560
|
});
|
|
1561
1561
|
}
|
|
1562
1562
|
max(e, t) {
|
|
1563
|
-
return new
|
|
1563
|
+
return new ve({
|
|
1564
1564
|
...this._def,
|
|
1565
1565
|
maxLength: { value: e, message: p.toString(t) }
|
|
1566
1566
|
});
|
|
1567
1567
|
}
|
|
1568
1568
|
length(e, t) {
|
|
1569
|
-
return new
|
|
1569
|
+
return new ve({
|
|
1570
1570
|
...this._def,
|
|
1571
1571
|
exactLength: { value: e, message: p.toString(t) }
|
|
1572
1572
|
});
|
|
@@ -1583,23 +1583,23 @@ V.create = (a, e) => new V({
|
|
|
1583
1583
|
typeName: m.ZodArray,
|
|
1584
1584
|
...g(e)
|
|
1585
1585
|
});
|
|
1586
|
-
function
|
|
1587
|
-
if (a instanceof
|
|
1586
|
+
function U(a) {
|
|
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
|
-
type:
|
|
1600
|
-
}) : a instanceof
|
|
1599
|
+
type: U(a.element)
|
|
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
|
});
|
|
@@ -1833,14 +1833,14 @@ let S = class T extends _ {
|
|
|
1833
1833
|
* @deprecated
|
|
1834
1834
|
*/
|
|
1835
1835
|
deepPartial() {
|
|
1836
|
-
return
|
|
1836
|
+
return U(this);
|
|
1837
1837
|
}
|
|
1838
1838
|
partial(e) {
|
|
1839
1839
|
const t = {};
|
|
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
|
|
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 ne 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 ne 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
|
|
@@ -1954,13 +1954,13 @@ class ne extends _ {
|
|
|
1954
1954
|
return this._def.options;
|
|
1955
1955
|
}
|
|
1956
1956
|
}
|
|
1957
|
-
|
|
1957
|
+
ae.create = (a, e) => new ae({
|
|
1958
1958
|
options: a,
|
|
1959
1959
|
typeName: m.ZodUnion,
|
|
1960
1960
|
...g(e)
|
|
1961
1961
|
});
|
|
1962
|
-
const
|
|
1963
|
-
class
|
|
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 Ce 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,17 +2003,17 @@ class Ce 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
|
-
return new
|
|
2016
|
+
return new Ae({
|
|
2017
2017
|
typeName: m.ZodDiscriminatedUnion,
|
|
2018
2018
|
discriminator: e,
|
|
2019
2019
|
options: t,
|
|
@@ -2022,25 +2022,25 @@ class Ce extends _ {
|
|
|
2022
2022
|
});
|
|
2023
2023
|
}
|
|
2024
2024
|
}
|
|
2025
|
-
function
|
|
2026
|
-
const t =
|
|
2025
|
+
function Le(a, e) {
|
|
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
|
|
2032
|
-
const c =
|
|
2030
|
+
const n = w.objectKeys(e), r = w.objectKeys(a).filter((o) => n.indexOf(o) !== -1), i = { ...a, ...e };
|
|
2031
|
+
for (const o of r) {
|
|
2032
|
+
const c = 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 Me(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
|
|
2051
|
+
class ne extends v {
|
|
2052
2052
|
_parse(e) {
|
|
2053
|
-
const { status: t, ctx: s } = this._processInputParams(e), n = (
|
|
2054
|
-
if (
|
|
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 =
|
|
2057
|
-
return o.valid ? ((
|
|
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 ie 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
|
|
@@ -2080,13 +2080,13 @@ class ie extends _ {
|
|
|
2080
2080
|
}));
|
|
2081
2081
|
}
|
|
2082
2082
|
}
|
|
2083
|
-
|
|
2083
|
+
ne.create = (a, e, t) => new ne({
|
|
2084
2084
|
left: a,
|
|
2085
2085
|
right: e,
|
|
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
|
|
2139
|
+
class ie extends v {
|
|
2140
2140
|
get keySchema() {
|
|
2141
2141
|
return this._def.keyType;
|
|
2142
2142
|
}
|
|
@@ -2151,33 +2151,33 @@ class re 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
|
-
}) : new
|
|
2173
|
-
keyType:
|
|
2172
|
+
}) : new ie({
|
|
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
|
|
2180
|
+
class Ne extends v {
|
|
2181
2181
|
get keySchema() {
|
|
2182
2182
|
return this._def.keyType;
|
|
2183
2183
|
}
|
|
@@ -2192,14 +2192,14 @@ class Te 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 Te 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;
|
|
@@ -2219,13 +2219,13 @@ class Te extends _ {
|
|
|
2219
2219
|
}
|
|
2220
2220
|
}
|
|
2221
2221
|
}
|
|
2222
|
-
|
|
2222
|
+
Ne.create = (a, e, t) => new Ne({
|
|
2223
2223
|
valueType: e,
|
|
2224
2224
|
keyType: a,
|
|
2225
2225
|
typeName: m.ZodMap,
|
|
2226
2226
|
...g(t)
|
|
2227
2227
|
});
|
|
2228
|
-
class
|
|
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 @@ class B 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,17 +2260,17 @@ class B 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
|
-
return new
|
|
2267
|
+
return new De({
|
|
2268
2268
|
...this._def,
|
|
2269
2269
|
minSize: { value: e, message: p.toString(t) }
|
|
2270
2270
|
});
|
|
2271
2271
|
}
|
|
2272
2272
|
max(e, t) {
|
|
2273
|
-
return new
|
|
2273
|
+
return new De({
|
|
2274
2274
|
...this._def,
|
|
2275
2275
|
maxSize: { value: e, message: p.toString(t) }
|
|
2276
2276
|
});
|
|
@@ -2281,15 +2281,15 @@ class B extends _ {
|
|
|
2281
2281
|
nonempty(e) {
|
|
2282
2282
|
return this.min(1, e);
|
|
2283
2283
|
}
|
|
2284
|
-
}
|
|
2285
|
-
|
|
2284
|
+
};
|
|
2285
|
+
Ce.create = (a, e) => new Ce({
|
|
2286
2286
|
valueType: a,
|
|
2287
2287
|
minSize: null,
|
|
2288
2288
|
maxSize: null,
|
|
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
|
}
|
|
@@ -2302,14 +2302,14 @@ let Ge = class ve extends _ {
|
|
|
2302
2302
|
received: t.parsedType
|
|
2303
2303
|
}), y;
|
|
2304
2304
|
function s(o, c) {
|
|
2305
|
-
return
|
|
2305
|
+
return ke({
|
|
2306
2306
|
data: o,
|
|
2307
2307
|
path: t.path,
|
|
2308
2308
|
errorMaps: [
|
|
2309
2309
|
t.common.contextualErrorMap,
|
|
2310
2310
|
t.schemaErrorMap,
|
|
2311
|
-
|
|
2312
|
-
|
|
2311
|
+
be(),
|
|
2312
|
+
H
|
|
2313
2313
|
].filter((u) => !!u),
|
|
2314
2314
|
issueData: {
|
|
2315
2315
|
code: d.invalid_arguments,
|
|
@@ -2318,14 +2318,14 @@ let Ge = class ve extends _ {
|
|
|
2318
2318
|
});
|
|
2319
2319
|
}
|
|
2320
2320
|
function n(o, c) {
|
|
2321
|
-
return
|
|
2321
|
+
return ke({
|
|
2322
2322
|
data: o,
|
|
2323
2323
|
path: t.path,
|
|
2324
2324
|
errorMaps: [
|
|
2325
2325
|
t.common.contextualErrorMap,
|
|
2326
2326
|
t.schemaErrorMap,
|
|
2327
|
-
|
|
2328
|
-
|
|
2327
|
+
be(),
|
|
2328
|
+
H
|
|
2329
2329
|
].filter((u) => !!u),
|
|
2330
2330
|
issueData: {
|
|
2331
2331
|
code: d.invalid_return_type,
|
|
@@ -2333,26 +2333,26 @@ let Ge = class ve extends _ {
|
|
|
2333
2333
|
}
|
|
2334
2334
|
});
|
|
2335
2335
|
}
|
|
2336
|
-
const
|
|
2337
|
-
if (this._def.returns instanceof
|
|
2336
|
+
const r = { errorMap: t.common.contextualErrorMap }, i = t.data;
|
|
2337
|
+
if (this._def.returns instanceof W) {
|
|
2338
2338
|
const o = this;
|
|
2339
|
-
return
|
|
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,
|
|
2339
|
+
return x(async function(...c) {
|
|
2340
|
+
const u = new O([]), f = await o._def.args.parseAsync(c, r).catch((Z) => {
|
|
2341
|
+
throw u.addIssue(s(c, Z)), u;
|
|
2342
|
+
}), b = await Reflect.apply(i, this, f);
|
|
2343
|
+
return await o._def.returns._def.type.parseAsync(b, r).catch((Z) => {
|
|
2344
|
+
throw u.addIssue(n(b, Z)), u;
|
|
2345
2345
|
});
|
|
2346
2346
|
});
|
|
2347
2347
|
} else {
|
|
2348
2348
|
const o = this;
|
|
2349
|
-
return
|
|
2350
|
-
const u = o._def.args.safeParse(c,
|
|
2349
|
+
return x(function(...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
|
}
|
|
@@ -2364,13 +2364,13 @@ let Ge = class ve extends _ {
|
|
|
2364
2364
|
return this._def.returns;
|
|
2365
2365
|
}
|
|
2366
2366
|
args(...e) {
|
|
2367
|
-
return new
|
|
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) {
|
|
2373
|
-
return new
|
|
2373
|
+
return new we({
|
|
2374
2374
|
...this._def,
|
|
2375
2375
|
returns: e
|
|
2376
2376
|
});
|
|
@@ -2382,15 +2382,15 @@ let Ge = class ve extends _ {
|
|
|
2382
2382
|
return this.parse(e);
|
|
2383
2383
|
}
|
|
2384
2384
|
static create(e, t, s) {
|
|
2385
|
-
return new
|
|
2386
|
-
args: e ||
|
|
2387
|
-
returns: t ||
|
|
2385
|
+
return new we({
|
|
2386
|
+
args: e || R.create([]).rest(D.create()),
|
|
2387
|
+
returns: t || D.create(),
|
|
2388
2388
|
typeName: m.ZodFunction,
|
|
2389
2389
|
...g(s)
|
|
2390
2390
|
});
|
|
2391
2391
|
}
|
|
2392
2392
|
};
|
|
2393
|
-
class
|
|
2393
|
+
class re extends v {
|
|
2394
2394
|
get schema() {
|
|
2395
2395
|
return this._def.getter();
|
|
2396
2396
|
}
|
|
@@ -2399,12 +2399,12 @@ class oe extends _ {
|
|
|
2399
2399
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
2400
2400
|
}
|
|
2401
2401
|
}
|
|
2402
|
-
|
|
2402
|
+
re.create = (a, e) => new re({
|
|
2403
2403
|
getter: a,
|
|
2404
2404
|
typeName: m.ZodLazy,
|
|
2405
2405
|
...g(e)
|
|
2406
2406
|
});
|
|
2407
|
-
class
|
|
2407
|
+
class oe extends v {
|
|
2408
2408
|
_parse(e) {
|
|
2409
2409
|
if (e.data !== this._def.value) {
|
|
2410
2410
|
const t = this._getOrReturnCtx(e);
|
|
@@ -2420,21 +2420,21 @@ class ce extends _ {
|
|
|
2420
2420
|
return this._def.value;
|
|
2421
2421
|
}
|
|
2422
2422
|
}
|
|
2423
|
-
|
|
2423
|
+
oe.create = (a, e) => new oe({
|
|
2424
2424
|
value: a,
|
|
2425
2425
|
typeName: m.ZodLiteral,
|
|
2426
2426
|
...g(e)
|
|
2427
2427
|
});
|
|
2428
|
-
function
|
|
2429
|
-
return new
|
|
2428
|
+
function tt(a, e) {
|
|
2429
|
+
return new he({
|
|
2430
2430
|
values: a,
|
|
2431
2431
|
typeName: m.ZodEnum,
|
|
2432
2432
|
...g(e)
|
|
2433
2433
|
});
|
|
2434
2434
|
}
|
|
2435
|
-
let
|
|
2435
|
+
let he = class qe extends v {
|
|
2436
2436
|
constructor() {
|
|
2437
|
-
super(...arguments),
|
|
2437
|
+
super(...arguments), J.set(this, void 0);
|
|
2438
2438
|
}
|
|
2439
2439
|
_parse(e) {
|
|
2440
2440
|
if (typeof e.data != "string") {
|
|
@@ -2445,7 +2445,7 @@ let pe = class Fe extends _ {
|
|
|
2445
2445
|
code: d.invalid_type
|
|
2446
2446
|
}), y;
|
|
2447
2447
|
}
|
|
2448
|
-
if (
|
|
2448
|
+
if (Ze(this, J) || Je(this, J, new Set(this._def.values)), !Ze(this, J).has(e.data)) {
|
|
2449
2449
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
2450
2450
|
return l(t, {
|
|
2451
2451
|
received: t.data,
|
|
@@ -2453,7 +2453,7 @@ let pe = class Fe extends _ {
|
|
|
2453
2453
|
options: s
|
|
2454
2454
|
}), y;
|
|
2455
2455
|
}
|
|
2456
|
-
return
|
|
2456
|
+
return x(e.data);
|
|
2457
2457
|
}
|
|
2458
2458
|
get options() {
|
|
2459
2459
|
return this._def.values;
|
|
@@ -2477,23 +2477,23 @@ let pe = class Fe 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
|
-
|
|
2493
|
-
|
|
2494
|
-
class
|
|
2492
|
+
J = /* @__PURE__ */ new WeakMap();
|
|
2493
|
+
he.create = tt;
|
|
2494
|
+
class ce extends v {
|
|
2495
2495
|
constructor() {
|
|
2496
|
-
super(...arguments),
|
|
2496
|
+
super(...arguments), Y.set(this, void 0);
|
|
2497
2497
|
}
|
|
2498
2498
|
_parse(e) {
|
|
2499
2499
|
const t = w.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
@@ -2505,7 +2505,7 @@ class de extends _ {
|
|
|
2505
2505
|
code: d.invalid_type
|
|
2506
2506
|
}), y;
|
|
2507
2507
|
}
|
|
2508
|
-
if (
|
|
2508
|
+
if (Ze(this, Y) || Je(this, Y, new Set(w.getValidEnumValues(this._def.values))), !Ze(this, Y).has(e.data)) {
|
|
2509
2509
|
const n = w.objectValues(t);
|
|
2510
2510
|
return l(s, {
|
|
2511
2511
|
received: s.data,
|
|
@@ -2513,19 +2513,19 @@ class de extends _ {
|
|
|
2513
2513
|
options: n
|
|
2514
2514
|
}), y;
|
|
2515
2515
|
}
|
|
2516
|
-
return
|
|
2516
|
+
return x(e.data);
|
|
2517
2517
|
}
|
|
2518
2518
|
get enum() {
|
|
2519
2519
|
return this._def.values;
|
|
2520
2520
|
}
|
|
2521
2521
|
}
|
|
2522
|
-
|
|
2523
|
-
|
|
2522
|
+
Y = /* @__PURE__ */ new WeakMap();
|
|
2523
|
+
ce.create = (a, e) => new ce({
|
|
2524
2524
|
values: a,
|
|
2525
2525
|
typeName: m.ZodNativeEnum,
|
|
2526
2526
|
...g(e)
|
|
2527
2527
|
});
|
|
2528
|
-
class
|
|
2528
|
+
class W extends v {
|
|
2529
2529
|
unwrap() {
|
|
2530
2530
|
return this._def.type;
|
|
2531
2531
|
}
|
|
@@ -2538,18 +2538,18 @@ class J extends _ {
|
|
|
2538
2538
|
received: t.parsedType
|
|
2539
2539
|
}), y;
|
|
2540
2540
|
const s = t.parsedType === h.promise ? t.data : Promise.resolve(t.data);
|
|
2541
|
-
return
|
|
2541
|
+
return x(s.then((n) => this._def.type.parseAsync(n, {
|
|
2542
2542
|
path: t.path,
|
|
2543
2543
|
errorMap: t.common.contextualErrorMap
|
|
2544
2544
|
})));
|
|
2545
2545
|
}
|
|
2546
2546
|
}
|
|
2547
|
-
|
|
2547
|
+
W.create = (a, e) => new W({
|
|
2548
2548
|
type: a,
|
|
2549
2549
|
typeName: m.ZodPromise,
|
|
2550
2550
|
...g(e)
|
|
2551
2551
|
});
|
|
2552
|
-
class
|
|
2552
|
+
let A = class extends v {
|
|
2553
2553
|
innerType() {
|
|
2554
2554
|
return this._def.schema;
|
|
2555
2555
|
}
|
|
@@ -2557,18 +2557,18 @@ class O 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({
|
|
@@ -2576,22 +2576,22 @@ class O extends _ {
|
|
|
2576
2576
|
path: s.path,
|
|
2577
2577
|
parent: s
|
|
2578
2578
|
});
|
|
2579
|
-
return c.status === "aborted" ? y : c.status === "dirty" || t.value === "dirty" ?
|
|
2579
|
+
return c.status === "aborted" ? y : c.status === "dirty" || t.value === "dirty" ? xe(c.value) : c;
|
|
2580
2580
|
});
|
|
2581
2581
|
{
|
|
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
|
});
|
|
2589
|
-
return o.status === "aborted" ? y : o.status === "dirty" || t.value === "dirty" ?
|
|
2589
|
+
return o.status === "aborted" ? y : o.status === "dirty" || t.value === "dirty" ? xe(o.value) : o;
|
|
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,67 +2604,67 @@ class O 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
|
-
}
|
|
2629
|
-
|
|
2628
|
+
};
|
|
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
|
-
return this._getType(e) === h.undefined ?
|
|
2643
|
+
return this._getType(e) === h.undefined ? x(void 0) : this._def.innerType._parse(e);
|
|
2644
2644
|
}
|
|
2645
2645
|
unwrap() {
|
|
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
|
|
2654
|
+
let M = class extends v {
|
|
2655
2655
|
_parse(e) {
|
|
2656
|
-
return this._getType(e) === h.null ?
|
|
2656
|
+
return this._getType(e) === h.null ? x(null) : this._def.innerType._parse(e);
|
|
2657
2657
|
}
|
|
2658
2658
|
unwrap() {
|
|
2659
2659
|
return this._def.innerType;
|
|
2660
2660
|
}
|
|
2661
2661
|
};
|
|
2662
|
-
|
|
2662
|
+
M.create = (a, e) => new M({
|
|
2663
2663
|
innerType: a,
|
|
2664
2664
|
typeName: m.ZodNullable,
|
|
2665
2665
|
...g(e)
|
|
2666
2666
|
});
|
|
2667
|
-
class
|
|
2667
|
+
class de extends v {
|
|
2668
2668
|
_parse(e) {
|
|
2669
2669
|
const { ctx: t } = this._processInputParams(e);
|
|
2670
2670
|
let s = t.data;
|
|
@@ -2678,13 +2678,13 @@ class ue extends _ {
|
|
|
2678
2678
|
return this._def.innerType;
|
|
2679
2679
|
}
|
|
2680
2680
|
}
|
|
2681
|
-
|
|
2681
|
+
de.create = (a, e) => new de({
|
|
2682
2682
|
innerType: a,
|
|
2683
2683
|
typeName: m.ZodDefault,
|
|
2684
2684
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2685
2685
|
...g(e)
|
|
2686
2686
|
});
|
|
2687
|
-
class
|
|
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 le extends _ {
|
|
|
2699
2699
|
...s
|
|
2700
2700
|
}
|
|
2701
2701
|
});
|
|
2702
|
-
return
|
|
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 le 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
|
})
|
|
@@ -2721,13 +2721,13 @@ class le extends _ {
|
|
|
2721
2721
|
return this._def.innerType;
|
|
2722
2722
|
}
|
|
2723
2723
|
}
|
|
2724
|
-
|
|
2724
|
+
ue.create = (a, e) => new ue({
|
|
2725
2725
|
innerType: a,
|
|
2726
2726
|
typeName: m.ZodCatch,
|
|
2727
2727
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2728
2728
|
...g(e)
|
|
2729
2729
|
});
|
|
2730
|
-
class
|
|
2730
|
+
class Oe extends v {
|
|
2731
2731
|
_parse(e) {
|
|
2732
2732
|
if (this._getType(e) !== h.nan) {
|
|
2733
2733
|
const t = this._getOrReturnCtx(e);
|
|
@@ -2740,12 +2740,12 @@ class Ne extends _ {
|
|
|
2740
2740
|
return { status: "valid", value: e.data };
|
|
2741
2741
|
}
|
|
2742
2742
|
}
|
|
2743
|
-
|
|
2743
|
+
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 De extends _ {
|
|
|
2758
2758
|
return this._def.type;
|
|
2759
2759
|
}
|
|
2760
2760
|
}
|
|
2761
|
-
class
|
|
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)
|
|
@@ -2768,7 +2768,7 @@ class fe extends _ {
|
|
|
2768
2768
|
path: s.path,
|
|
2769
2769
|
parent: s
|
|
2770
2770
|
});
|
|
2771
|
-
return n.status === "aborted" ? y : n.status === "dirty" ? (t.dirty(),
|
|
2771
|
+
return n.status === "aborted" ? y : n.status === "dirty" ? (t.dirty(), xe(n.value)) : this._def.out._parseAsync({
|
|
2772
2772
|
data: n.value,
|
|
2773
2773
|
path: s.path,
|
|
2774
2774
|
parent: s
|
|
@@ -2791,188 +2791,188 @@ class fe extends _ {
|
|
|
2791
2791
|
}
|
|
2792
2792
|
}
|
|
2793
2793
|
static create(e, t) {
|
|
2794
|
-
return new
|
|
2794
|
+
return new pe({
|
|
2795
2795
|
in: e,
|
|
2796
2796
|
out: t,
|
|
2797
2797
|
typeName: m.ZodPipeline
|
|
2798
2798
|
});
|
|
2799
2799
|
}
|
|
2800
2800
|
}
|
|
2801
|
-
class
|
|
2801
|
+
class le extends v {
|
|
2802
2802
|
_parse(e) {
|
|
2803
|
-
const t = this._def.innerType._parse(e), s = (n) => (
|
|
2804
|
-
return
|
|
2803
|
+
const t = this._def.innerType._parse(e), s = (n) => (q(n) && (n.value = Object.freeze(n.value)), n);
|
|
2804
|
+
return G(t) ? t.then((n) => s(n)) : s(t);
|
|
2805
2805
|
}
|
|
2806
2806
|
unwrap() {
|
|
2807
2807
|
return this._def.innerType;
|
|
2808
2808
|
}
|
|
2809
2809
|
}
|
|
2810
|
-
|
|
2810
|
+
le.create = (a, e) => new le({
|
|
2811
2811
|
innerType: a,
|
|
2812
2812
|
typeName: m.ZodReadonly,
|
|
2813
2813
|
...g(e)
|
|
2814
2814
|
});
|
|
2815
|
-
function
|
|
2815
|
+
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
|
|
2820
|
-
return a ?
|
|
2821
|
-
var
|
|
2819
|
+
function st(a, e = {}, t) {
|
|
2820
|
+
return a ? K.create().superRefine((s, n) => {
|
|
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 =
|
|
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 =
|
|
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) =>
|
|
2848
|
-
number: (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
|
+
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
|
-
},
|
|
2856
|
-
var
|
|
2854
|
+
date: (a) => z.create({ ...a, coerce: !0 })
|
|
2855
|
+
}, ps = y;
|
|
2856
|
+
var fe = /* @__PURE__ */ Object.freeze({
|
|
2857
2857
|
__proto__: null,
|
|
2858
|
-
defaultErrorMap:
|
|
2859
|
-
setErrorMap:
|
|
2860
|
-
getErrorMap:
|
|
2861
|
-
makeIssue:
|
|
2862
|
-
EMPTY_PATH:
|
|
2858
|
+
defaultErrorMap: H,
|
|
2859
|
+
setErrorMap: ot,
|
|
2860
|
+
getErrorMap: be,
|
|
2861
|
+
makeIssue: ke,
|
|
2862
|
+
EMPTY_PATH: ct,
|
|
2863
2863
|
addIssueToContext: l,
|
|
2864
|
-
ParseStatus:
|
|
2864
|
+
ParseStatus: S,
|
|
2865
2865
|
INVALID: y,
|
|
2866
|
-
DIRTY:
|
|
2867
|
-
OK:
|
|
2868
|
-
isAborted:
|
|
2869
|
-
isDirty:
|
|
2870
|
-
isValid:
|
|
2871
|
-
isAsync:
|
|
2866
|
+
DIRTY: xe,
|
|
2867
|
+
OK: x,
|
|
2868
|
+
isAborted: Pe,
|
|
2869
|
+
isDirty: Re,
|
|
2870
|
+
isValid: q,
|
|
2871
|
+
isAsync: G,
|
|
2872
2872
|
get util() {
|
|
2873
2873
|
return w;
|
|
2874
2874
|
},
|
|
2875
2875
|
get objectUtil() {
|
|
2876
|
-
return
|
|
2876
|
+
return $e;
|
|
2877
2877
|
},
|
|
2878
2878
|
ZodParsedType: h,
|
|
2879
|
-
getParsedType:
|
|
2880
|
-
ZodType:
|
|
2881
|
-
datetimeRegex:
|
|
2882
|
-
ZodString:
|
|
2883
|
-
ZodNumber:
|
|
2879
|
+
getParsedType: j,
|
|
2880
|
+
ZodType: v,
|
|
2881
|
+
datetimeRegex: Xe,
|
|
2882
|
+
ZodString: C,
|
|
2883
|
+
ZodNumber: X,
|
|
2884
2884
|
ZodBigInt: Q,
|
|
2885
2885
|
ZodBoolean: ee,
|
|
2886
|
-
ZodDate:
|
|
2887
|
-
ZodSymbol:
|
|
2888
|
-
ZodUndefined:
|
|
2889
|
-
ZodNull:
|
|
2890
|
-
ZodAny:
|
|
2891
|
-
ZodUnknown:
|
|
2892
|
-
ZodNever:
|
|
2893
|
-
ZodVoid:
|
|
2886
|
+
ZodDate: z,
|
|
2887
|
+
ZodSymbol: Se,
|
|
2888
|
+
ZodUndefined: te,
|
|
2889
|
+
ZodNull: se,
|
|
2890
|
+
ZodAny: K,
|
|
2891
|
+
ZodUnknown: D,
|
|
2892
|
+
ZodNever: $,
|
|
2893
|
+
ZodVoid: Te,
|
|
2894
2894
|
ZodArray: V,
|
|
2895
|
-
ZodObject:
|
|
2896
|
-
ZodUnion:
|
|
2897
|
-
ZodDiscriminatedUnion:
|
|
2898
|
-
ZodIntersection:
|
|
2899
|
-
ZodTuple:
|
|
2900
|
-
ZodRecord:
|
|
2901
|
-
ZodMap:
|
|
2902
|
-
ZodSet:
|
|
2903
|
-
ZodFunction:
|
|
2904
|
-
ZodLazy:
|
|
2905
|
-
ZodLiteral:
|
|
2906
|
-
ZodEnum:
|
|
2907
|
-
ZodNativeEnum:
|
|
2908
|
-
ZodPromise:
|
|
2909
|
-
ZodEffects:
|
|
2910
|
-
ZodTransformer:
|
|
2911
|
-
ZodOptional:
|
|
2912
|
-
ZodNullable:
|
|
2913
|
-
ZodDefault:
|
|
2914
|
-
ZodCatch:
|
|
2915
|
-
ZodNaN:
|
|
2916
|
-
BRAND:
|
|
2917
|
-
ZodBranded:
|
|
2918
|
-
ZodPipeline:
|
|
2919
|
-
ZodReadonly:
|
|
2920
|
-
custom:
|
|
2921
|
-
Schema:
|
|
2922
|
-
ZodSchema:
|
|
2923
|
-
late:
|
|
2895
|
+
ZodObject: T,
|
|
2896
|
+
ZodUnion: ae,
|
|
2897
|
+
ZodDiscriminatedUnion: Ae,
|
|
2898
|
+
ZodIntersection: ne,
|
|
2899
|
+
ZodTuple: R,
|
|
2900
|
+
ZodRecord: ie,
|
|
2901
|
+
ZodMap: Ne,
|
|
2902
|
+
ZodSet: Ce,
|
|
2903
|
+
ZodFunction: et,
|
|
2904
|
+
ZodLazy: re,
|
|
2905
|
+
ZodLiteral: oe,
|
|
2906
|
+
ZodEnum: he,
|
|
2907
|
+
ZodNativeEnum: ce,
|
|
2908
|
+
ZodPromise: W,
|
|
2909
|
+
ZodEffects: A,
|
|
2910
|
+
ZodTransformer: A,
|
|
2911
|
+
ZodOptional: E,
|
|
2912
|
+
ZodNullable: M,
|
|
2913
|
+
ZodDefault: de,
|
|
2914
|
+
ZodCatch: ue,
|
|
2915
|
+
ZodNaN: Oe,
|
|
2916
|
+
BRAND: At,
|
|
2917
|
+
ZodBranded: ze,
|
|
2918
|
+
ZodPipeline: pe,
|
|
2919
|
+
ZodReadonly: le,
|
|
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:
|
|
2934
|
-
effect:
|
|
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:
|
|
2961
|
-
transformer:
|
|
2962
|
-
tuple:
|
|
2963
|
-
undefined:
|
|
2964
|
-
union:
|
|
2965
|
-
unknown:
|
|
2966
|
-
void:
|
|
2967
|
-
NEVER:
|
|
2927
|
+
coerce: hs,
|
|
2928
|
+
any: Lt,
|
|
2929
|
+
array: Vt,
|
|
2930
|
+
bigint: $t,
|
|
2931
|
+
boolean: it,
|
|
2932
|
+
date: Pt,
|
|
2933
|
+
discriminatedUnion: Kt,
|
|
2934
|
+
effect: Ue,
|
|
2935
|
+
enum: ss,
|
|
2936
|
+
function: Qt,
|
|
2937
|
+
instanceof: It,
|
|
2938
|
+
intersection: Wt,
|
|
2939
|
+
lazy: es,
|
|
2940
|
+
literal: ts,
|
|
2941
|
+
map: Gt,
|
|
2942
|
+
nan: jt,
|
|
2943
|
+
nativeEnum: as,
|
|
2944
|
+
never: qt,
|
|
2945
|
+
null: Ft,
|
|
2946
|
+
nullable: rs,
|
|
2947
|
+
number: nt,
|
|
2948
|
+
object: Bt,
|
|
2949
|
+
oboolean: ls,
|
|
2950
|
+
onumber: us,
|
|
2951
|
+
optional: is,
|
|
2952
|
+
ostring: ds,
|
|
2953
|
+
pipeline: cs,
|
|
2954
|
+
preprocess: os,
|
|
2955
|
+
promise: ns,
|
|
2956
|
+
record: Yt,
|
|
2957
|
+
set: Xt,
|
|
2958
|
+
strictObject: Ut,
|
|
2959
|
+
string: at,
|
|
2960
|
+
symbol: Rt,
|
|
2961
|
+
transformer: Ue,
|
|
2962
|
+
tuple: Jt,
|
|
2963
|
+
undefined: Mt,
|
|
2964
|
+
union: Ht,
|
|
2965
|
+
unknown: Dt,
|
|
2966
|
+
void: zt,
|
|
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.4.4", 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 ps {
|
|
|
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 fs {
|
|
|
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 ms {
|
|
|
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 Is {
|
|
|
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 Is {
|
|
|
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 gs {
|
|
|
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 _s {
|
|
|
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 _s {
|
|
|
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.
|
|
@@ -3272,7 +3356,7 @@ class me {
|
|
|
3272
3356
|
*
|
|
3273
3357
|
* @param key The key to unsubscribe from
|
|
3274
3358
|
* @param handler Optional. The specific handler to remove. If not provided, all handlers for this key will be removed.
|
|
3275
|
-
* @returns A promise that resolves to true if the
|
|
3359
|
+
* @returns A promise that resolves to true if the unsubscribe was successful
|
|
3276
3360
|
*/
|
|
3277
3361
|
async unsubscribe(e, t) {
|
|
3278
3362
|
return (await this._client.unsubscribe("store.unsubscribe", {
|
|
@@ -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 vs {
|
|
|
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
|
}
|
|
@@ -3397,11 +3481,15 @@ class ws {
|
|
|
3397
3481
|
return t.forecast;
|
|
3398
3482
|
}
|
|
3399
3483
|
}
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3484
|
+
function ye(a) {
|
|
3485
|
+
return { ...a, type: "client" };
|
|
3486
|
+
}
|
|
3487
|
+
const Ss = fe.object({
|
|
3488
|
+
type: fe.literal("bridge"),
|
|
3489
|
+
name: fe.string(),
|
|
3490
|
+
data: fe.any()
|
|
3403
3491
|
});
|
|
3404
|
-
class
|
|
3492
|
+
class Ts {
|
|
3405
3493
|
/**
|
|
3406
3494
|
* Creates a new RootSettingsNavigation API instance.
|
|
3407
3495
|
*
|
|
@@ -3424,11 +3512,12 @@ class ks {
|
|
|
3424
3512
|
* @returns A promise that resolves when the navigation has been registered
|
|
3425
3513
|
*/
|
|
3426
3514
|
async setRootSettingsNavigation(e) {
|
|
3427
|
-
|
|
3428
|
-
s
|
|
3429
|
-
|
|
3515
|
+
var t;
|
|
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,
|
|
3430
3519
|
entries: e.entries
|
|
3431
|
-
},
|
|
3520
|
+
}, s.set("navigation", n);
|
|
3432
3521
|
}
|
|
3433
3522
|
/**
|
|
3434
3523
|
* Retrieves the current navigation entries for this root application.
|
|
@@ -3439,8 +3528,9 @@ class ks {
|
|
|
3439
3528
|
* @returns A promise that resolves to the navigation state for this application
|
|
3440
3529
|
*/
|
|
3441
3530
|
async getRootSettingsNavigation() {
|
|
3442
|
-
|
|
3443
|
-
|
|
3531
|
+
var e;
|
|
3532
|
+
const t = (e = await this._store.shared("root-settings-navigation").get("navigation")) !== null && e !== void 0 ? e : {}, s = this._store._client._applicationSpecifier;
|
|
3533
|
+
return t[s];
|
|
3444
3534
|
}
|
|
3445
3535
|
/**
|
|
3446
3536
|
* Retrieves the navigation entries for all root applications.
|
|
@@ -3452,50 +3542,12 @@ class ks {
|
|
|
3452
3542
|
* @returns A promise that resolves to the navigation state for all applications
|
|
3453
3543
|
*/
|
|
3454
3544
|
async getAllRootSettingsNavigation() {
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
}
|
|
3458
|
-
class xs {
|
|
3459
|
-
constructor(e) {
|
|
3460
|
-
this._client = e;
|
|
3461
|
-
}
|
|
3462
|
-
async fetch(e, t) {
|
|
3463
|
-
let s;
|
|
3464
|
-
typeof e == "string" ? s = e : e instanceof URL ? s = e.toString() : (s = e.url, t || (t = {
|
|
3465
|
-
method: e.method,
|
|
3466
|
-
headers: e.headers,
|
|
3467
|
-
body: e.body,
|
|
3468
|
-
credentials: e.credentials,
|
|
3469
|
-
cache: e.cache,
|
|
3470
|
-
redirect: e.redirect,
|
|
3471
|
-
referrer: e.referrer,
|
|
3472
|
-
integrity: e.integrity
|
|
3473
|
-
}));
|
|
3474
|
-
let n = {};
|
|
3475
|
-
t != null && t.headers && (t.headers instanceof Headers ? t.headers.forEach((u, f) => {
|
|
3476
|
-
n[f] = u;
|
|
3477
|
-
}) : Array.isArray(t.headers) ? t.headers.forEach(([u, f]) => {
|
|
3478
|
-
n[u] = f;
|
|
3479
|
-
}) : n = t.headers);
|
|
3480
|
-
const i = await this._client.request("proxy.fetch", {
|
|
3481
|
-
url: s,
|
|
3482
|
-
method: (t == null ? void 0 : t.method) || "GET",
|
|
3483
|
-
headers: n,
|
|
3484
|
-
body: (t == null ? void 0 : t.body) || null
|
|
3485
|
-
});
|
|
3486
|
-
if (!i.success)
|
|
3487
|
-
throw new Error(`Proxy fetch failed: ${i.statusText}`);
|
|
3488
|
-
const r = new Headers(i.headers), o = {
|
|
3489
|
-
status: i.status,
|
|
3490
|
-
statusText: i.statusText,
|
|
3491
|
-
headers: r
|
|
3492
|
-
};
|
|
3493
|
-
let c = null;
|
|
3494
|
-
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);
|
|
3545
|
+
var e;
|
|
3546
|
+
return (e = await this._store.shared("root-settings-navigation").get("navigation")) !== null && e !== void 0 ? e : {};
|
|
3495
3547
|
}
|
|
3496
3548
|
}
|
|
3497
|
-
const
|
|
3498
|
-
class
|
|
3549
|
+
const B = 1e3 * 30;
|
|
3550
|
+
class Ns {
|
|
3499
3551
|
/**
|
|
3500
3552
|
* Creates a new Client instance for communicating with the TelemetryOS platform.
|
|
3501
3553
|
*
|
|
@@ -3507,7 +3559,7 @@ class Zs {
|
|
|
3507
3559
|
* in your application's telemetry.config.json file
|
|
3508
3560
|
*/
|
|
3509
3561
|
constructor(e) {
|
|
3510
|
-
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();
|
|
3511
3563
|
}
|
|
3512
3564
|
/**
|
|
3513
3565
|
* Provides access to the accounts API for retrieving TelemetryOS account information.
|
|
@@ -3521,7 +3573,7 @@ class Zs {
|
|
|
3521
3573
|
* @returns An Accounts instance bound to this client
|
|
3522
3574
|
*/
|
|
3523
3575
|
get accounts() {
|
|
3524
|
-
return new
|
|
3576
|
+
return new ys(this);
|
|
3525
3577
|
}
|
|
3526
3578
|
/**
|
|
3527
3579
|
* Provides access to the users API for retrieving TelemetryOS user information.
|
|
@@ -3535,7 +3587,7 @@ class Zs {
|
|
|
3535
3587
|
* @returns A Users instance bound to this client
|
|
3536
3588
|
*/
|
|
3537
3589
|
get users() {
|
|
3538
|
-
return new
|
|
3590
|
+
return new xs(this);
|
|
3539
3591
|
}
|
|
3540
3592
|
/**
|
|
3541
3593
|
* Provides access to the store API for data persistence with multiple storage scopes.
|
|
@@ -3549,7 +3601,7 @@ class Zs {
|
|
|
3549
3601
|
* @returns A Store instance bound to this client
|
|
3550
3602
|
*/
|
|
3551
3603
|
get store() {
|
|
3552
|
-
return new
|
|
3604
|
+
return new ks(this);
|
|
3553
3605
|
}
|
|
3554
3606
|
/**
|
|
3555
3607
|
* Provides access to the applications API for discovering other TelemetryOS applications.
|
|
@@ -3563,7 +3615,7 @@ class Zs {
|
|
|
3563
3615
|
* @returns An Applications instance bound to this client
|
|
3564
3616
|
*/
|
|
3565
3617
|
get applications() {
|
|
3566
|
-
return new
|
|
3618
|
+
return new gs(this);
|
|
3567
3619
|
}
|
|
3568
3620
|
/**
|
|
3569
3621
|
* Provides access to the media API for working with content hosted on the TelemetryOS platform.
|
|
@@ -3578,7 +3630,7 @@ class Zs {
|
|
|
3578
3630
|
* @returns A Media instance bound to this client
|
|
3579
3631
|
*/
|
|
3580
3632
|
get media() {
|
|
3581
|
-
return new
|
|
3633
|
+
return new ws(this);
|
|
3582
3634
|
}
|
|
3583
3635
|
/**
|
|
3584
3636
|
* Provides access to the proxy API for fetching third-party content through the TelemetryOS API.
|
|
@@ -3592,7 +3644,7 @@ class Zs {
|
|
|
3592
3644
|
* @returns A Proxy instance bound to this client
|
|
3593
3645
|
*/
|
|
3594
3646
|
get proxy() {
|
|
3595
|
-
return new
|
|
3647
|
+
return new bs(this);
|
|
3596
3648
|
}
|
|
3597
3649
|
/**
|
|
3598
3650
|
* Provides access to the devices API for interacting with the current device.
|
|
@@ -3607,7 +3659,7 @@ class Zs {
|
|
|
3607
3659
|
* @returns A Devices instance bound to this client
|
|
3608
3660
|
*/
|
|
3609
3661
|
get devices() {
|
|
3610
|
-
return new
|
|
3662
|
+
return new _s(this);
|
|
3611
3663
|
}
|
|
3612
3664
|
/**
|
|
3613
3665
|
* Provides access to the root settings navigation API for TelemetryOS administration UI integration.
|
|
@@ -3625,7 +3677,7 @@ class Zs {
|
|
|
3625
3677
|
* @throws {Error} If used by an application not mounted at the 'rootSettingsNavigation' mount point
|
|
3626
3678
|
*/
|
|
3627
3679
|
get rootSettingsNavigation() {
|
|
3628
|
-
return new
|
|
3680
|
+
return new Ts(this.store);
|
|
3629
3681
|
}
|
|
3630
3682
|
/**
|
|
3631
3683
|
* Provides access to the weather API for retrieving weather data.
|
|
@@ -3639,7 +3691,7 @@ class Zs {
|
|
|
3639
3691
|
* @returns A Weather instance bound to this client
|
|
3640
3692
|
*/
|
|
3641
3693
|
get weather() {
|
|
3642
|
-
return new
|
|
3694
|
+
return new Zs(this);
|
|
3643
3695
|
}
|
|
3644
3696
|
get applicationName() {
|
|
3645
3697
|
return this._applicationName;
|
|
@@ -3666,37 +3718,45 @@ class Zs {
|
|
|
3666
3718
|
* of creating and binding their own Client instances.
|
|
3667
3719
|
*/
|
|
3668
3720
|
bind() {
|
|
3669
|
-
var e;
|
|
3670
|
-
const
|
|
3671
|
-
this._applicationInstance = (e =
|
|
3672
|
-
|
|
3673
|
-
if (
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
const i = t.hostname.split(".");
|
|
3677
|
-
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 : "";
|
|
3678
3728
|
}
|
|
3679
3729
|
if (!this._applicationSpecifier || this._applicationSpecifier.length !== 40)
|
|
3680
3730
|
throw new Error(`Invalid applicationSpecifier: expected 40-character hash, got "${this._applicationSpecifier}"`);
|
|
3681
|
-
if (!this._applicationInstance)
|
|
3682
|
-
throw new Error("Missing telemetryApplicationId query parameter");
|
|
3683
3731
|
this._windowMessageHandler = (i) => {
|
|
3684
|
-
if (i.source === window)
|
|
3685
|
-
return;
|
|
3686
|
-
for (let f = 0; f < window.frames.length; f += 1)
|
|
3687
|
-
window.frames[f].postMessage(i.data, "*");
|
|
3688
|
-
const r = bs.safeParse(i.data);
|
|
3689
|
-
if (!r.success)
|
|
3732
|
+
if (i.source === window || !i.data || !("type" in i.data) || i.data.type !== "client" && i.data.type !== "bridge")
|
|
3690
3733
|
return;
|
|
3691
|
-
|
|
3692
|
-
if (
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3734
|
+
let o;
|
|
3735
|
+
if (i.data.type === "client") {
|
|
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" };
|
|
3742
|
+
}
|
|
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
|
+
}
|
|
3699
3757
|
}
|
|
3758
|
+
for (let c = 0; c < window.frames.length; c += 1)
|
|
3759
|
+
window.frames[c].postMessage(o, "*");
|
|
3700
3760
|
}, window.addEventListener("message", this._windowMessageHandler);
|
|
3701
3761
|
}
|
|
3702
3762
|
/**
|
|
@@ -3729,14 +3789,14 @@ class Zs {
|
|
|
3729
3789
|
* @param data The data payload to include with the message
|
|
3730
3790
|
*/
|
|
3731
3791
|
send(e, t) {
|
|
3732
|
-
const s = {
|
|
3733
|
-
telemetrySdkVersion:
|
|
3792
|
+
const s = ye({
|
|
3793
|
+
telemetrySdkVersion: _e,
|
|
3734
3794
|
applicationName: this._applicationName,
|
|
3735
3795
|
applicationSpecifier: this._applicationSpecifier,
|
|
3736
3796
|
applicationInstance: this._applicationInstance,
|
|
3737
3797
|
name: e,
|
|
3738
3798
|
data: t
|
|
3739
|
-
};
|
|
3799
|
+
});
|
|
3740
3800
|
window.parent.postMessage(s, "*");
|
|
3741
3801
|
}
|
|
3742
3802
|
/**
|
|
@@ -3757,96 +3817,96 @@ class Zs {
|
|
|
3757
3817
|
* @throws {Error} If the request times out
|
|
3758
3818
|
*/
|
|
3759
3819
|
request(e, t) {
|
|
3760
|
-
const s =
|
|
3761
|
-
telemetrySdkVersion:
|
|
3820
|
+
const s = ge(), n = ye({
|
|
3821
|
+
telemetrySdkVersion: _e,
|
|
3762
3822
|
applicationName: this._applicationName,
|
|
3763
3823
|
applicationSpecifier: this._applicationSpecifier,
|
|
3764
3824
|
applicationInstance: this._applicationInstance,
|
|
3765
3825
|
name: e,
|
|
3766
3826
|
data: t,
|
|
3767
3827
|
responseName: s
|
|
3768
|
-
};
|
|
3828
|
+
});
|
|
3769
3829
|
window.parent.postMessage(n, "*");
|
|
3770
|
-
let
|
|
3830
|
+
let r = !1, i;
|
|
3771
3831
|
const o = new Promise((u, f) => {
|
|
3772
|
-
const b = new Error(`${e} message request with response name of ${s} timed out after ${
|
|
3832
|
+
const b = new Error(`${e} message request with response name of ${s} timed out after ${B}`);
|
|
3773
3833
|
setTimeout(() => {
|
|
3774
|
-
|
|
3775
|
-
},
|
|
3834
|
+
r = !0, this.off(s, i), f(b);
|
|
3835
|
+
}, B);
|
|
3776
3836
|
}), c = new Promise((u) => {
|
|
3777
|
-
|
|
3778
|
-
|
|
3837
|
+
i = (f) => {
|
|
3838
|
+
r || u(f);
|
|
3779
3839
|
}, this.once(s, u);
|
|
3780
3840
|
});
|
|
3781
3841
|
return Promise.race([o, c]);
|
|
3782
3842
|
}
|
|
3783
3843
|
async subscribe(e, t, s) {
|
|
3784
|
-
let n,
|
|
3785
|
-
typeof t == "function" ?
|
|
3786
|
-
const
|
|
3844
|
+
let n, r;
|
|
3845
|
+
typeof t == "function" ? r = t : (n = t, r = s);
|
|
3846
|
+
const i = ge(), o = ge();
|
|
3787
3847
|
let c = this._subscriptionNamesBySubjectName.get(e);
|
|
3788
|
-
c || (c = [], this._subscriptionNamesBySubjectName.set(e, c)), c.push(
|
|
3789
|
-
const u = {
|
|
3790
|
-
telemetrySdkVersion:
|
|
3848
|
+
c || (c = [], this._subscriptionNamesBySubjectName.set(e, c)), c.push(i), this._subscriptionNamesByHandler.set(r, i), this.on(i, r);
|
|
3849
|
+
const u = ye({
|
|
3850
|
+
telemetrySdkVersion: _e,
|
|
3791
3851
|
applicationName: this._applicationName,
|
|
3792
3852
|
applicationSpecifier: this._applicationSpecifier,
|
|
3793
3853
|
applicationInstance: this._applicationInstance,
|
|
3794
3854
|
name: e,
|
|
3795
3855
|
data: n,
|
|
3796
3856
|
responseName: o,
|
|
3797
|
-
subscriptionName:
|
|
3798
|
-
};
|
|
3857
|
+
subscriptionName: i
|
|
3858
|
+
});
|
|
3799
3859
|
window.parent.postMessage(u, "*");
|
|
3800
3860
|
let f = !1, b;
|
|
3801
|
-
const
|
|
3802
|
-
const
|
|
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}`);
|
|
3803
3863
|
setTimeout(() => {
|
|
3804
|
-
f = !0, this.off(o, b), L(
|
|
3805
|
-
},
|
|
3806
|
-
}),
|
|
3864
|
+
f = !0, this.off(o, b), L(Ie);
|
|
3865
|
+
}, B);
|
|
3866
|
+
}), Ee = new Promise((F) => {
|
|
3807
3867
|
b = (L) => {
|
|
3808
|
-
f ||
|
|
3809
|
-
}, this.on(o,
|
|
3868
|
+
f || F(L);
|
|
3869
|
+
}, this.on(o, F);
|
|
3810
3870
|
});
|
|
3811
|
-
return Promise.race([
|
|
3871
|
+
return Promise.race([Z, Ee]);
|
|
3812
3872
|
}
|
|
3813
3873
|
async unsubscribe(e, t, s) {
|
|
3814
|
-
let n,
|
|
3815
|
-
typeof t == "function" ?
|
|
3816
|
-
const
|
|
3874
|
+
let n, r;
|
|
3875
|
+
typeof t == "function" ? r = t : (n = t, r = s);
|
|
3876
|
+
const i = ge();
|
|
3817
3877
|
let o = [];
|
|
3818
|
-
if (
|
|
3819
|
-
const c = this._subscriptionNamesByHandler.get(
|
|
3878
|
+
if (r) {
|
|
3879
|
+
const c = this._subscriptionNamesByHandler.get(r);
|
|
3820
3880
|
if (!c)
|
|
3821
3881
|
return { success: !1 };
|
|
3822
|
-
o = [c], this._subscriptionNamesByHandler.delete(
|
|
3882
|
+
o = [c], this._subscriptionNamesByHandler.delete(r);
|
|
3823
3883
|
} else if (!this._subscriptionNamesBySubjectName.get(e))
|
|
3824
3884
|
return { success: !1 };
|
|
3825
3885
|
for await (const c of o) {
|
|
3826
|
-
this.off(c,
|
|
3827
|
-
const u = {
|
|
3828
|
-
telemetrySdkVersion:
|
|
3886
|
+
this.off(c, r);
|
|
3887
|
+
const u = ye({
|
|
3888
|
+
telemetrySdkVersion: _e,
|
|
3829
3889
|
applicationInstance: this._applicationInstance,
|
|
3830
3890
|
applicationName: this._applicationName,
|
|
3831
3891
|
applicationSpecifier: this._applicationSpecifier,
|
|
3832
3892
|
name: e,
|
|
3833
3893
|
data: n,
|
|
3834
|
-
responseName:
|
|
3894
|
+
responseName: i,
|
|
3835
3895
|
unsubscribeName: c
|
|
3836
|
-
};
|
|
3896
|
+
});
|
|
3837
3897
|
window.parent.postMessage(u, "*");
|
|
3838
3898
|
let f = !1, b;
|
|
3839
|
-
const
|
|
3840
|
-
const
|
|
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}`);
|
|
3841
3901
|
setTimeout(() => {
|
|
3842
|
-
f = !0, this.off(
|
|
3843
|
-
},
|
|
3844
|
-
}),
|
|
3902
|
+
f = !0, this.off(i, b), L(Ie);
|
|
3903
|
+
}, B);
|
|
3904
|
+
}), Ee = new Promise((F) => {
|
|
3845
3905
|
b = (L) => {
|
|
3846
|
-
f ||
|
|
3847
|
-
}, this.once(
|
|
3906
|
+
f || F(L);
|
|
3907
|
+
}, this.once(i, F);
|
|
3848
3908
|
});
|
|
3849
|
-
if (!(await Promise.race([
|
|
3909
|
+
if (!(await Promise.race([Z, Ee])).success)
|
|
3850
3910
|
return { success: !1 };
|
|
3851
3911
|
}
|
|
3852
3912
|
return { success: !0 };
|
|
@@ -3911,23 +3971,23 @@ class Zs {
|
|
|
3911
3971
|
const s = this._onHandlers.get(e), n = this._onceHandlers.get(e);
|
|
3912
3972
|
if (!(!s && !n)) {
|
|
3913
3973
|
if (s) {
|
|
3914
|
-
for (let
|
|
3915
|
-
t && s[
|
|
3974
|
+
for (let r = 0; r < s.length; r += 1)
|
|
3975
|
+
t && s[r] !== t || (s.splice(r, 1), r -= 1);
|
|
3916
3976
|
s.length === 0 && this._onHandlers.delete(e);
|
|
3917
3977
|
}
|
|
3918
3978
|
if (n) {
|
|
3919
|
-
for (let
|
|
3920
|
-
t && n[
|
|
3979
|
+
for (let r = 0; r < n.length; r += 1)
|
|
3980
|
+
t && n[r] !== t || (n.splice(r, 1), r -= 1);
|
|
3921
3981
|
n.length === 0 && this._onceHandlers.delete(e);
|
|
3922
3982
|
}
|
|
3923
3983
|
}
|
|
3924
3984
|
}
|
|
3925
3985
|
}
|
|
3926
|
-
function
|
|
3986
|
+
function ge() {
|
|
3927
3987
|
return Math.random().toString(36).slice(2, 9);
|
|
3928
3988
|
}
|
|
3929
|
-
const
|
|
3930
|
-
class
|
|
3989
|
+
const _e = ms.version;
|
|
3990
|
+
class Cs {
|
|
3931
3991
|
constructor(e) {
|
|
3932
3992
|
this._client = e;
|
|
3933
3993
|
}
|
|
@@ -3976,7 +4036,7 @@ class Ss {
|
|
|
3976
4036
|
return !0;
|
|
3977
4037
|
}
|
|
3978
4038
|
}
|
|
3979
|
-
class
|
|
4039
|
+
class Os {
|
|
3980
4040
|
constructor(e) {
|
|
3981
4041
|
this._client = e;
|
|
3982
4042
|
}
|
|
@@ -4032,93 +4092,108 @@ class Ts {
|
|
|
4032
4092
|
return !0;
|
|
4033
4093
|
}
|
|
4034
4094
|
}
|
|
4035
|
-
class
|
|
4095
|
+
class As extends Ns {
|
|
4036
4096
|
get playlist() {
|
|
4037
|
-
return new
|
|
4097
|
+
return new Os(this);
|
|
4038
4098
|
}
|
|
4039
4099
|
get overrides() {
|
|
4040
|
-
return new
|
|
4100
|
+
return new Cs(this);
|
|
4041
4101
|
}
|
|
4042
4102
|
}
|
|
4043
|
-
let
|
|
4044
|
-
function
|
|
4045
|
-
return
|
|
4103
|
+
let _ = null;
|
|
4104
|
+
function Ms() {
|
|
4105
|
+
return _;
|
|
4046
4106
|
}
|
|
4047
|
-
function
|
|
4048
|
-
|
|
4107
|
+
function Fs(a) {
|
|
4108
|
+
_ = new As(a), _.bind();
|
|
4049
4109
|
}
|
|
4050
|
-
function
|
|
4051
|
-
|
|
4052
|
-
}
|
|
4053
|
-
function Rs(...a) {
|
|
4054
|
-
return Z(v), v.on(...a);
|
|
4055
|
-
}
|
|
4056
|
-
function Ms(...a) {
|
|
4057
|
-
return Z(v), v.once(...a);
|
|
4058
|
-
}
|
|
4059
|
-
function Fs(...a) {
|
|
4060
|
-
return Z(v), v.off(...a);
|
|
4110
|
+
function Ls() {
|
|
4111
|
+
_ == null || _.unbind(), _ = null;
|
|
4061
4112
|
}
|
|
4062
4113
|
function Ds(...a) {
|
|
4063
|
-
return
|
|
4064
|
-
}
|
|
4065
|
-
function Ls(...a) {
|
|
4066
|
-
return Z(v), v.request(...a);
|
|
4114
|
+
return k(_), _.on(...a);
|
|
4067
4115
|
}
|
|
4068
4116
|
function qs(...a) {
|
|
4069
|
-
return
|
|
4117
|
+
return k(_), _.once(...a);
|
|
4070
4118
|
}
|
|
4071
4119
|
function zs(...a) {
|
|
4072
|
-
return
|
|
4120
|
+
return k(_), _.off(...a);
|
|
4073
4121
|
}
|
|
4074
|
-
function Vs() {
|
|
4075
|
-
return
|
|
4122
|
+
function Vs(...a) {
|
|
4123
|
+
return k(_), _.send(...a);
|
|
4076
4124
|
}
|
|
4077
|
-
function Bs() {
|
|
4078
|
-
return
|
|
4125
|
+
function Bs(...a) {
|
|
4126
|
+
return k(_), _.request(...a);
|
|
4079
4127
|
}
|
|
4080
|
-
function Us() {
|
|
4081
|
-
return
|
|
4128
|
+
function Us(...a) {
|
|
4129
|
+
return k(_), _.subscribe(...a);
|
|
4082
4130
|
}
|
|
4083
|
-
function Hs() {
|
|
4084
|
-
return
|
|
4131
|
+
function Hs(...a) {
|
|
4132
|
+
return k(_), _.unsubscribe(...a);
|
|
4085
4133
|
}
|
|
4086
4134
|
function Ks() {
|
|
4087
|
-
return
|
|
4135
|
+
return k(_), _.accounts;
|
|
4088
4136
|
}
|
|
4089
4137
|
function Ws() {
|
|
4090
|
-
return
|
|
4138
|
+
return k(_), _.users;
|
|
4091
4139
|
}
|
|
4092
4140
|
function Js() {
|
|
4093
|
-
return
|
|
4141
|
+
return k(_), _.store;
|
|
4142
|
+
}
|
|
4143
|
+
function Ys() {
|
|
4144
|
+
return k(_), _.applications;
|
|
4145
|
+
}
|
|
4146
|
+
function Gs() {
|
|
4147
|
+
return k(_), _.media;
|
|
4148
|
+
}
|
|
4149
|
+
function Xs() {
|
|
4150
|
+
return k(_), _.proxy;
|
|
4151
|
+
}
|
|
4152
|
+
function Qs() {
|
|
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;
|
|
4094
4163
|
}
|
|
4095
|
-
function
|
|
4164
|
+
function k(a) {
|
|
4096
4165
|
if (!a)
|
|
4097
4166
|
throw new Error("SDK is not configured");
|
|
4098
4167
|
}
|
|
4099
4168
|
export {
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
Ms as
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
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,
|
|
4195
|
+
_e as telemetrySdkVersion,
|
|
4196
|
+
Hs as unsubscribe,
|
|
4197
|
+
Ws as users,
|
|
4198
|
+
ea as weather
|
|
4124
4199
|
};
|