@authhero/cloudflare-adapter 2.15.0 → 2.17.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/dist/cloudflare-adapter.cjs +38 -16
- package/dist/cloudflare-adapter.d.ts +48 -0
- package/dist/cloudflare-adapter.mjs +594 -506
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { verificationMethodsSchema as
|
|
2
|
-
import
|
|
3
|
-
function
|
|
1
|
+
import { verificationMethodsSchema as vt } from "@authhero/adapter-interfaces";
|
|
2
|
+
import bt from "wretch";
|
|
3
|
+
function xt(t, e) {
|
|
4
4
|
var n = {};
|
|
5
5
|
for (var s in t) Object.prototype.hasOwnProperty.call(t, s) && e.indexOf(s) < 0 && (n[s] = t[s]);
|
|
6
6
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -8,40 +8,40 @@ function gt(t, e) {
|
|
|
8
8
|
e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, s[r]) && (n[s[r]] = t[s[r]]);
|
|
9
9
|
return n;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function kt(t, e) {
|
|
12
12
|
var n;
|
|
13
13
|
return ((n = t?._def) === null || n === void 0 ? void 0 : n.typeName) === e;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function le(t, e) {
|
|
16
16
|
const n = t.ZodType.prototype[e];
|
|
17
17
|
t.ZodType.prototype[e] = function(...s) {
|
|
18
18
|
const r = n.apply(this, s);
|
|
19
19
|
return r._def.openapi = this._def.openapi, r;
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function wt(t) {
|
|
23
23
|
if (typeof t.ZodType.prototype.openapi < "u")
|
|
24
24
|
return;
|
|
25
25
|
t.ZodType.prototype.openapi = function(r, a) {
|
|
26
26
|
var i, o, c, d, h, x;
|
|
27
|
-
const
|
|
28
|
-
param: Object.assign(Object.assign({}, (x = (h = this._def.openapi) === null || h === void 0 ? void 0 : h.metadata) === null || x === void 0 ? void 0 : x.param),
|
|
29
|
-
} : void 0),
|
|
30
|
-
if (
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
var
|
|
34
|
-
const
|
|
35
|
-
return
|
|
27
|
+
const S = typeof r == "string" ? a : r, w = S ?? {}, { param: O } = w, Y = xt(w, ["param"]), k = Object.assign(Object.assign({}, (i = this._def.openapi) === null || i === void 0 ? void 0 : i._internal), typeof r == "string" ? { refId: r } : void 0), V = Object.assign(Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o.metadata), Y), !((d = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || d === void 0) && d.param || O ? {
|
|
28
|
+
param: Object.assign(Object.assign({}, (x = (h = this._def.openapi) === null || h === void 0 ? void 0 : h.metadata) === null || x === void 0 ? void 0 : x.param), O)
|
|
29
|
+
} : void 0), A = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(k).length > 0 ? { _internal: k } : void 0), Object.keys(V).length > 0 ? { metadata: V } : void 0) }));
|
|
30
|
+
if (kt(this, "ZodObject")) {
|
|
31
|
+
const D = this.extend;
|
|
32
|
+
A.extend = function(...K) {
|
|
33
|
+
var G, ue, Pe, Ve, ze, Be, Fe;
|
|
34
|
+
const Ue = D.apply(this, K);
|
|
35
|
+
return Ue._def.openapi = {
|
|
36
36
|
_internal: {
|
|
37
|
-
extendedFrom: !((
|
|
37
|
+
extendedFrom: !((ue = (G = this._def.openapi) === null || G === void 0 ? void 0 : G._internal) === null || ue === void 0) && ue.refId ? { refId: (Ve = (Pe = this._def.openapi) === null || Pe === void 0 ? void 0 : Pe._internal) === null || Ve === void 0 ? void 0 : Ve.refId, schema: this } : (Be = (ze = this._def.openapi) === null || ze === void 0 ? void 0 : ze._internal) === null || Be === void 0 ? void 0 : Be.extendedFrom
|
|
38
38
|
},
|
|
39
|
-
metadata: (
|
|
40
|
-
},
|
|
39
|
+
metadata: (Fe = Ue._def.openapi) === null || Fe === void 0 ? void 0 : Fe.metadata
|
|
40
|
+
}, Ue;
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
return
|
|
44
|
-
},
|
|
43
|
+
return A;
|
|
44
|
+
}, le(t, "optional"), le(t, "nullable"), le(t, "default"), le(t, "transform"), le(t, "refine");
|
|
45
45
|
const e = t.ZodObject.prototype.deepPartial;
|
|
46
46
|
t.ZodObject.prototype.deepPartial = function() {
|
|
47
47
|
const r = this._def.shape(), a = e.apply(this), i = a._def.shape();
|
|
@@ -61,7 +61,7 @@ function bt(t) {
|
|
|
61
61
|
return a._def.openapi = void 0, a;
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
var
|
|
64
|
+
var fe = class extends Error {
|
|
65
65
|
res;
|
|
66
66
|
status;
|
|
67
67
|
/**
|
|
@@ -124,14 +124,14 @@ var b;
|
|
|
124
124
|
}
|
|
125
125
|
t.joinValues = s, t.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
|
|
126
126
|
})(b || (b = {}));
|
|
127
|
-
var
|
|
127
|
+
var He;
|
|
128
128
|
(function(t) {
|
|
129
129
|
t.mergeShapes = (e, n) => ({
|
|
130
130
|
...e,
|
|
131
131
|
...n
|
|
132
132
|
// second overwrites first
|
|
133
133
|
});
|
|
134
|
-
})(
|
|
134
|
+
})(He || (He = {}));
|
|
135
135
|
const f = b.arrayToEnum([
|
|
136
136
|
"string",
|
|
137
137
|
"nan",
|
|
@@ -191,8 +191,8 @@ const f = b.arrayToEnum([
|
|
|
191
191
|
"invalid_intersection_types",
|
|
192
192
|
"not_multiple_of",
|
|
193
193
|
"not_finite"
|
|
194
|
-
]),
|
|
195
|
-
class
|
|
194
|
+
]), Tt = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
195
|
+
class N extends Error {
|
|
196
196
|
get errors() {
|
|
197
197
|
return this.issues;
|
|
198
198
|
}
|
|
@@ -229,7 +229,7 @@ class A extends Error {
|
|
|
229
229
|
return r(this), s;
|
|
230
230
|
}
|
|
231
231
|
static assert(e) {
|
|
232
|
-
if (!(e instanceof
|
|
232
|
+
if (!(e instanceof N))
|
|
233
233
|
throw new Error(`Not a ZodError: ${e}`);
|
|
234
234
|
}
|
|
235
235
|
toString() {
|
|
@@ -255,8 +255,8 @@ class A extends Error {
|
|
|
255
255
|
return this.flatten();
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
|
-
|
|
259
|
-
const
|
|
258
|
+
N.create = (t) => new N(t);
|
|
259
|
+
const oe = (t, e) => {
|
|
260
260
|
let n;
|
|
261
261
|
switch (t.code) {
|
|
262
262
|
case u.invalid_type:
|
|
@@ -312,14 +312,14 @@ const ie = (t, e) => {
|
|
|
312
312
|
}
|
|
313
313
|
return { message: n };
|
|
314
314
|
};
|
|
315
|
-
let
|
|
316
|
-
function
|
|
317
|
-
|
|
315
|
+
let ot = oe;
|
|
316
|
+
function St(t) {
|
|
317
|
+
ot = t;
|
|
318
318
|
}
|
|
319
|
-
function
|
|
320
|
-
return
|
|
319
|
+
function Ne() {
|
|
320
|
+
return ot;
|
|
321
321
|
}
|
|
322
|
-
const
|
|
322
|
+
const Re = (t) => {
|
|
323
323
|
const { data: e, path: n, errorMaps: s, issueData: r } = t, a = [...n, ...r.path || []], i = {
|
|
324
324
|
...r,
|
|
325
325
|
path: a
|
|
@@ -339,9 +339,9 @@ const Ae = (t) => {
|
|
|
339
339
|
path: a,
|
|
340
340
|
message: o
|
|
341
341
|
};
|
|
342
|
-
},
|
|
342
|
+
}, Et = [];
|
|
343
343
|
function l(t, e) {
|
|
344
|
-
const n =
|
|
344
|
+
const n = Ne(), s = Re({
|
|
345
345
|
issueData: e,
|
|
346
346
|
data: t.data,
|
|
347
347
|
path: t.path,
|
|
@@ -352,13 +352,13 @@ function l(t, e) {
|
|
|
352
352
|
// then schema-bound map if available
|
|
353
353
|
n,
|
|
354
354
|
// then global override map
|
|
355
|
-
n ===
|
|
355
|
+
n === oe ? void 0 : oe
|
|
356
356
|
// then global default map
|
|
357
357
|
].filter((r) => !!r)
|
|
358
358
|
});
|
|
359
359
|
t.common.issues.push(s);
|
|
360
360
|
}
|
|
361
|
-
class
|
|
361
|
+
class E {
|
|
362
362
|
constructor() {
|
|
363
363
|
this.value = "valid";
|
|
364
364
|
}
|
|
@@ -386,7 +386,7 @@ class S {
|
|
|
386
386
|
value: i
|
|
387
387
|
});
|
|
388
388
|
}
|
|
389
|
-
return
|
|
389
|
+
return E.mergeObjectSync(e, s);
|
|
390
390
|
}
|
|
391
391
|
static mergeObjectSync(e, n) {
|
|
392
392
|
const s = {};
|
|
@@ -401,12 +401,12 @@ class S {
|
|
|
401
401
|
}
|
|
402
402
|
const m = Object.freeze({
|
|
403
403
|
status: "aborted"
|
|
404
|
-
}),
|
|
404
|
+
}), ae = (t) => ({ status: "dirty", value: t }), C = (t) => ({ status: "valid", value: t }), Qe = (t) => t.status === "aborted", Je = (t) => t.status === "dirty", ee = (t) => t.status === "valid", he = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
405
405
|
var p;
|
|
406
406
|
(function(t) {
|
|
407
407
|
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
408
408
|
})(p || (p = {}));
|
|
409
|
-
class
|
|
409
|
+
class M {
|
|
410
410
|
constructor(e, n, s, r) {
|
|
411
411
|
this._cachedPath = [], this.parent = e, this.data = n, this._path = s, this._key = r;
|
|
412
412
|
}
|
|
@@ -415,7 +415,7 @@ class L {
|
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
417
|
const tt = (t, e) => {
|
|
418
|
-
if (
|
|
418
|
+
if (ee(e))
|
|
419
419
|
return { success: !0, data: e.value };
|
|
420
420
|
if (!t.common.issues.length)
|
|
421
421
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -424,7 +424,7 @@ const tt = (t, e) => {
|
|
|
424
424
|
get error() {
|
|
425
425
|
if (this._error)
|
|
426
426
|
return this._error;
|
|
427
|
-
const n = new
|
|
427
|
+
const n = new N(t.common.issues);
|
|
428
428
|
return this._error = n, this._error;
|
|
429
429
|
}
|
|
430
430
|
};
|
|
@@ -459,7 +459,7 @@ class v {
|
|
|
459
459
|
}
|
|
460
460
|
_processInputParams(e) {
|
|
461
461
|
return {
|
|
462
|
-
status: new
|
|
462
|
+
status: new E(),
|
|
463
463
|
ctx: {
|
|
464
464
|
common: e.parent.common,
|
|
465
465
|
data: e.data,
|
|
@@ -472,7 +472,7 @@ class v {
|
|
|
472
472
|
}
|
|
473
473
|
_parseSync(e) {
|
|
474
474
|
const n = this._parse(e);
|
|
475
|
-
if (
|
|
475
|
+
if (he(n))
|
|
476
476
|
throw new Error("Synchronous parse encountered promise.");
|
|
477
477
|
return n;
|
|
478
478
|
}
|
|
@@ -516,7 +516,7 @@ class v {
|
|
|
516
516
|
if (!this["~standard"].async)
|
|
517
517
|
try {
|
|
518
518
|
const s = this._parseSync({ data: e, path: [], parent: n });
|
|
519
|
-
return
|
|
519
|
+
return ee(s) ? {
|
|
520
520
|
value: s.value
|
|
521
521
|
} : {
|
|
522
522
|
issues: n.common.issues
|
|
@@ -527,7 +527,7 @@ class v {
|
|
|
527
527
|
async: !0
|
|
528
528
|
};
|
|
529
529
|
}
|
|
530
|
-
return this._parseAsync({ data: e, path: [], parent: n }).then((s) =>
|
|
530
|
+
return this._parseAsync({ data: e, path: [], parent: n }).then((s) => ee(s) ? {
|
|
531
531
|
value: s.value
|
|
532
532
|
} : {
|
|
533
533
|
issues: n.common.issues
|
|
@@ -551,7 +551,7 @@ class v {
|
|
|
551
551
|
parent: null,
|
|
552
552
|
data: e,
|
|
553
553
|
parsedType: B(e)
|
|
554
|
-
}, r = this._parse({ data: e, path: s.path, parent: s }), a = await (
|
|
554
|
+
}, r = this._parse({ data: e, path: s.path, parent: s }), a = await (he(r) ? r : Promise.resolve(r));
|
|
555
555
|
return tt(s, a);
|
|
556
556
|
}
|
|
557
557
|
refine(e, n) {
|
|
@@ -568,7 +568,7 @@ class v {
|
|
|
568
568
|
return this._refinement((s, r) => e(s) ? !0 : (r.addIssue(typeof n == "function" ? n(s, r) : n), !1));
|
|
569
569
|
}
|
|
570
570
|
_refinement(e) {
|
|
571
|
-
return new
|
|
571
|
+
return new j({
|
|
572
572
|
schema: this,
|
|
573
573
|
typeName: y.ZodEffects,
|
|
574
574
|
effect: { type: "refinement", refinement: e }
|
|
@@ -585,28 +585,28 @@ class v {
|
|
|
585
585
|
};
|
|
586
586
|
}
|
|
587
587
|
optional() {
|
|
588
|
-
return
|
|
588
|
+
return L.create(this, this._def);
|
|
589
589
|
}
|
|
590
590
|
nullable() {
|
|
591
|
-
return
|
|
591
|
+
return J.create(this, this._def);
|
|
592
592
|
}
|
|
593
593
|
nullish() {
|
|
594
594
|
return this.nullable().optional();
|
|
595
595
|
}
|
|
596
596
|
array() {
|
|
597
|
-
return
|
|
597
|
+
return I.create(this);
|
|
598
598
|
}
|
|
599
599
|
promise() {
|
|
600
|
-
return
|
|
600
|
+
return de.create(this, this._def);
|
|
601
601
|
}
|
|
602
602
|
or(e) {
|
|
603
|
-
return
|
|
603
|
+
return _e.create([this, e], this._def);
|
|
604
604
|
}
|
|
605
605
|
and(e) {
|
|
606
|
-
return
|
|
606
|
+
return ge.create(this, e, this._def);
|
|
607
607
|
}
|
|
608
608
|
transform(e) {
|
|
609
|
-
return new
|
|
609
|
+
return new j({
|
|
610
610
|
..._(this._def),
|
|
611
611
|
schema: this,
|
|
612
612
|
typeName: y.ZodEffects,
|
|
@@ -615,7 +615,7 @@ class v {
|
|
|
615
615
|
}
|
|
616
616
|
default(e) {
|
|
617
617
|
const n = typeof e == "function" ? e : () => e;
|
|
618
|
-
return new
|
|
618
|
+
return new we({
|
|
619
619
|
..._(this._def),
|
|
620
620
|
innerType: this,
|
|
621
621
|
defaultValue: n,
|
|
@@ -631,7 +631,7 @@ class v {
|
|
|
631
631
|
}
|
|
632
632
|
catch(e) {
|
|
633
633
|
const n = typeof e == "function" ? e : () => e;
|
|
634
|
-
return new
|
|
634
|
+
return new Te({
|
|
635
635
|
..._(this._def),
|
|
636
636
|
innerType: this,
|
|
637
637
|
catchValue: n,
|
|
@@ -646,10 +646,10 @@ class v {
|
|
|
646
646
|
});
|
|
647
647
|
}
|
|
648
648
|
pipe(e) {
|
|
649
|
-
return
|
|
649
|
+
return Ce.create(this, e);
|
|
650
650
|
}
|
|
651
651
|
readonly() {
|
|
652
|
-
return
|
|
652
|
+
return Se.create(this);
|
|
653
653
|
}
|
|
654
654
|
isOptional() {
|
|
655
655
|
return this.safeParse(void 0).success;
|
|
@@ -658,28 +658,28 @@ class v {
|
|
|
658
658
|
return this.safeParse(null).success;
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
|
-
const
|
|
661
|
+
const Ct = /^c[^\s-]{8,}$/i, Ot = /^[0-9a-z]+$/, At = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Nt = /^[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, Rt = /^[a-z0-9_-]{21}$/i, $t = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, It = /^[-+]?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)?)??$/, jt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Zt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
662
662
|
let qe;
|
|
663
|
-
const
|
|
664
|
-
function
|
|
663
|
+
const Dt = /^(?:(?: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])$/, Lt = /^(?:(?: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])$/, Mt = /^(([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]))$/, Pt = /^(([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])$/, Vt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, zt = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, ct = "((\\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])))", Bt = new RegExp(`^${ct}$`);
|
|
664
|
+
function dt(t) {
|
|
665
665
|
let e = "[0-5]\\d";
|
|
666
666
|
t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
667
667
|
const n = t.precision ? "+" : "?";
|
|
668
668
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`;
|
|
669
669
|
}
|
|
670
|
-
function
|
|
671
|
-
return new RegExp(`^${
|
|
670
|
+
function Ft(t) {
|
|
671
|
+
return new RegExp(`^${dt(t)}$`);
|
|
672
672
|
}
|
|
673
|
-
function
|
|
674
|
-
let e = `${
|
|
673
|
+
function ut(t) {
|
|
674
|
+
let e = `${ct}T${dt(t)}`;
|
|
675
675
|
const n = [];
|
|
676
676
|
return n.push(t.local ? "Z?" : "Z"), t.offset && n.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${n.join("|")})`, new RegExp(`^${e}$`);
|
|
677
677
|
}
|
|
678
|
-
function
|
|
679
|
-
return !!((e === "v4" || !e) &&
|
|
678
|
+
function Ut(t, e) {
|
|
679
|
+
return !!((e === "v4" || !e) && Dt.test(t) || (e === "v6" || !e) && Mt.test(t));
|
|
680
680
|
}
|
|
681
|
-
function
|
|
682
|
-
if (
|
|
681
|
+
function qt(t, e) {
|
|
682
|
+
if (!$t.test(t))
|
|
683
683
|
return !1;
|
|
684
684
|
try {
|
|
685
685
|
const [n] = t.split(".");
|
|
@@ -691,8 +691,8 @@ function Bt(t, e) {
|
|
|
691
691
|
return !1;
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
|
-
function
|
|
695
|
-
return !!((e === "v4" || !e) &&
|
|
694
|
+
function Wt(t, e) {
|
|
695
|
+
return !!((e === "v4" || !e) && Lt.test(t) || (e === "v6" || !e) && Pt.test(t));
|
|
696
696
|
}
|
|
697
697
|
class $ extends v {
|
|
698
698
|
_parse(e) {
|
|
@@ -704,7 +704,7 @@ class $ extends v {
|
|
|
704
704
|
received: a.parsedType
|
|
705
705
|
}), m;
|
|
706
706
|
}
|
|
707
|
-
const s = new
|
|
707
|
+
const s = new E();
|
|
708
708
|
let r;
|
|
709
709
|
for (const a of this._def.checks)
|
|
710
710
|
if (a.kind === "min")
|
|
@@ -743,43 +743,43 @@ class $ extends v {
|
|
|
743
743
|
message: a.message
|
|
744
744
|
}), s.dirty());
|
|
745
745
|
} else if (a.kind === "email")
|
|
746
|
-
|
|
746
|
+
jt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
747
747
|
validation: "email",
|
|
748
748
|
code: u.invalid_string,
|
|
749
749
|
message: a.message
|
|
750
750
|
}), s.dirty());
|
|
751
751
|
else if (a.kind === "emoji")
|
|
752
|
-
qe || (qe = new RegExp(
|
|
752
|
+
qe || (qe = new RegExp(Zt, "u")), qe.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
753
753
|
validation: "emoji",
|
|
754
754
|
code: u.invalid_string,
|
|
755
755
|
message: a.message
|
|
756
756
|
}), s.dirty());
|
|
757
757
|
else if (a.kind === "uuid")
|
|
758
|
-
|
|
758
|
+
Nt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
759
759
|
validation: "uuid",
|
|
760
760
|
code: u.invalid_string,
|
|
761
761
|
message: a.message
|
|
762
762
|
}), s.dirty());
|
|
763
763
|
else if (a.kind === "nanoid")
|
|
764
|
-
|
|
764
|
+
Rt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
765
765
|
validation: "nanoid",
|
|
766
766
|
code: u.invalid_string,
|
|
767
767
|
message: a.message
|
|
768
768
|
}), s.dirty());
|
|
769
769
|
else if (a.kind === "cuid")
|
|
770
|
-
|
|
770
|
+
Ct.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
771
771
|
validation: "cuid",
|
|
772
772
|
code: u.invalid_string,
|
|
773
773
|
message: a.message
|
|
774
774
|
}), s.dirty());
|
|
775
775
|
else if (a.kind === "cuid2")
|
|
776
|
-
|
|
776
|
+
Ot.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
777
777
|
validation: "cuid2",
|
|
778
778
|
code: u.invalid_string,
|
|
779
779
|
message: a.message
|
|
780
780
|
}), s.dirty());
|
|
781
781
|
else if (a.kind === "ulid")
|
|
782
|
-
|
|
782
|
+
At.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
783
783
|
validation: "ulid",
|
|
784
784
|
code: u.invalid_string,
|
|
785
785
|
message: a.message
|
|
@@ -810,39 +810,39 @@ class $ extends v {
|
|
|
810
810
|
code: u.invalid_string,
|
|
811
811
|
validation: { endsWith: a.value },
|
|
812
812
|
message: a.message
|
|
813
|
-
}), s.dirty()) : a.kind === "datetime" ?
|
|
813
|
+
}), s.dirty()) : a.kind === "datetime" ? ut(a).test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
814
814
|
code: u.invalid_string,
|
|
815
815
|
validation: "datetime",
|
|
816
816
|
message: a.message
|
|
817
|
-
}), s.dirty()) : a.kind === "date" ?
|
|
817
|
+
}), s.dirty()) : a.kind === "date" ? Bt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
818
818
|
code: u.invalid_string,
|
|
819
819
|
validation: "date",
|
|
820
820
|
message: a.message
|
|
821
|
-
}), s.dirty()) : a.kind === "time" ?
|
|
821
|
+
}), s.dirty()) : a.kind === "time" ? Ft(a).test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
822
822
|
code: u.invalid_string,
|
|
823
823
|
validation: "time",
|
|
824
824
|
message: a.message
|
|
825
|
-
}), s.dirty()) : a.kind === "duration" ?
|
|
825
|
+
}), s.dirty()) : a.kind === "duration" ? It.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
826
826
|
validation: "duration",
|
|
827
827
|
code: u.invalid_string,
|
|
828
828
|
message: a.message
|
|
829
|
-
}), s.dirty()) : a.kind === "ip" ?
|
|
829
|
+
}), s.dirty()) : a.kind === "ip" ? Ut(e.data, a.version) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
830
830
|
validation: "ip",
|
|
831
831
|
code: u.invalid_string,
|
|
832
832
|
message: a.message
|
|
833
|
-
}), s.dirty()) : a.kind === "jwt" ?
|
|
833
|
+
}), s.dirty()) : a.kind === "jwt" ? qt(e.data, a.alg) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
834
834
|
validation: "jwt",
|
|
835
835
|
code: u.invalid_string,
|
|
836
836
|
message: a.message
|
|
837
|
-
}), s.dirty()) : a.kind === "cidr" ?
|
|
837
|
+
}), s.dirty()) : a.kind === "cidr" ? Wt(e.data, a.version) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
838
838
|
validation: "cidr",
|
|
839
839
|
code: u.invalid_string,
|
|
840
840
|
message: a.message
|
|
841
|
-
}), s.dirty()) : a.kind === "base64" ?
|
|
841
|
+
}), s.dirty()) : a.kind === "base64" ? Vt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
842
842
|
validation: "base64",
|
|
843
843
|
code: u.invalid_string,
|
|
844
844
|
message: a.message
|
|
845
|
-
}), s.dirty()) : a.kind === "base64url" ?
|
|
845
|
+
}), s.dirty()) : a.kind === "base64url" ? zt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
846
846
|
validation: "base64url",
|
|
847
847
|
code: u.invalid_string,
|
|
848
848
|
message: a.message
|
|
@@ -1077,11 +1077,11 @@ $.create = (t) => new $({
|
|
|
1077
1077
|
coerce: t?.coerce ?? !1,
|
|
1078
1078
|
..._(t)
|
|
1079
1079
|
});
|
|
1080
|
-
function
|
|
1080
|
+
function Ht(t, e) {
|
|
1081
1081
|
const n = (t.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, r = n > s ? n : s, a = Number.parseInt(t.toFixed(r).replace(".", "")), i = Number.parseInt(e.toFixed(r).replace(".", ""));
|
|
1082
1082
|
return a % i / 10 ** r;
|
|
1083
1083
|
}
|
|
1084
|
-
class
|
|
1084
|
+
class W extends v {
|
|
1085
1085
|
constructor() {
|
|
1086
1086
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1087
1087
|
}
|
|
@@ -1095,7 +1095,7 @@ class U extends v {
|
|
|
1095
1095
|
}), m;
|
|
1096
1096
|
}
|
|
1097
1097
|
let s;
|
|
1098
|
-
const r = new
|
|
1098
|
+
const r = new E();
|
|
1099
1099
|
for (const a of this._def.checks)
|
|
1100
1100
|
a.kind === "int" ? b.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
1101
1101
|
code: u.invalid_type,
|
|
@@ -1116,7 +1116,7 @@ class U extends v {
|
|
|
1116
1116
|
inclusive: a.inclusive,
|
|
1117
1117
|
exact: !1,
|
|
1118
1118
|
message: a.message
|
|
1119
|
-
}), r.dirty()) : a.kind === "multipleOf" ?
|
|
1119
|
+
}), r.dirty()) : a.kind === "multipleOf" ? Ht(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), l(s, {
|
|
1120
1120
|
code: u.not_multiple_of,
|
|
1121
1121
|
multipleOf: a.value,
|
|
1122
1122
|
message: a.message
|
|
@@ -1139,7 +1139,7 @@ class U extends v {
|
|
|
1139
1139
|
return this.setLimit("max", e, !1, p.toString(n));
|
|
1140
1140
|
}
|
|
1141
1141
|
setLimit(e, n, s, r) {
|
|
1142
|
-
return new
|
|
1142
|
+
return new W({
|
|
1143
1143
|
...this._def,
|
|
1144
1144
|
checks: [
|
|
1145
1145
|
...this._def.checks,
|
|
@@ -1153,7 +1153,7 @@ class U extends v {
|
|
|
1153
1153
|
});
|
|
1154
1154
|
}
|
|
1155
1155
|
_addCheck(e) {
|
|
1156
|
-
return new
|
|
1156
|
+
return new W({
|
|
1157
1157
|
...this._def,
|
|
1158
1158
|
checks: [...this._def.checks, e]
|
|
1159
1159
|
});
|
|
@@ -1247,13 +1247,13 @@ class U extends v {
|
|
|
1247
1247
|
return Number.isFinite(n) && Number.isFinite(e);
|
|
1248
1248
|
}
|
|
1249
1249
|
}
|
|
1250
|
-
|
|
1250
|
+
W.create = (t) => new W({
|
|
1251
1251
|
checks: [],
|
|
1252
1252
|
typeName: y.ZodNumber,
|
|
1253
1253
|
coerce: t?.coerce || !1,
|
|
1254
1254
|
..._(t)
|
|
1255
1255
|
});
|
|
1256
|
-
class
|
|
1256
|
+
class H extends v {
|
|
1257
1257
|
constructor() {
|
|
1258
1258
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1259
1259
|
}
|
|
@@ -1267,7 +1267,7 @@ class W extends v {
|
|
|
1267
1267
|
if (this._getType(e) !== f.bigint)
|
|
1268
1268
|
return this._getInvalidInput(e);
|
|
1269
1269
|
let s;
|
|
1270
|
-
const r = new
|
|
1270
|
+
const r = new E();
|
|
1271
1271
|
for (const a of this._def.checks)
|
|
1272
1272
|
a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
|
|
1273
1273
|
code: u.too_small,
|
|
@@ -1309,7 +1309,7 @@ class W extends v {
|
|
|
1309
1309
|
return this.setLimit("max", e, !1, p.toString(n));
|
|
1310
1310
|
}
|
|
1311
1311
|
setLimit(e, n, s, r) {
|
|
1312
|
-
return new
|
|
1312
|
+
return new H({
|
|
1313
1313
|
...this._def,
|
|
1314
1314
|
checks: [
|
|
1315
1315
|
...this._def.checks,
|
|
@@ -1323,7 +1323,7 @@ class W extends v {
|
|
|
1323
1323
|
});
|
|
1324
1324
|
}
|
|
1325
1325
|
_addCheck(e) {
|
|
1326
|
-
return new
|
|
1326
|
+
return new H({
|
|
1327
1327
|
...this._def,
|
|
1328
1328
|
checks: [...this._def.checks, e]
|
|
1329
1329
|
});
|
|
@@ -1380,13 +1380,13 @@ class W extends v {
|
|
|
1380
1380
|
return e;
|
|
1381
1381
|
}
|
|
1382
1382
|
}
|
|
1383
|
-
|
|
1383
|
+
H.create = (t) => new H({
|
|
1384
1384
|
checks: [],
|
|
1385
1385
|
typeName: y.ZodBigInt,
|
|
1386
1386
|
coerce: t?.coerce ?? !1,
|
|
1387
1387
|
..._(t)
|
|
1388
1388
|
});
|
|
1389
|
-
class
|
|
1389
|
+
class pe extends v {
|
|
1390
1390
|
_parse(e) {
|
|
1391
1391
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
|
|
1392
1392
|
const s = this._getOrReturnCtx(e);
|
|
@@ -1399,12 +1399,12 @@ class he extends v {
|
|
|
1399
1399
|
return C(e.data);
|
|
1400
1400
|
}
|
|
1401
1401
|
}
|
|
1402
|
-
|
|
1402
|
+
pe.create = (t) => new pe({
|
|
1403
1403
|
typeName: y.ZodBoolean,
|
|
1404
1404
|
coerce: t?.coerce || !1,
|
|
1405
1405
|
..._(t)
|
|
1406
1406
|
});
|
|
1407
|
-
class
|
|
1407
|
+
class te extends v {
|
|
1408
1408
|
_parse(e) {
|
|
1409
1409
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
|
|
1410
1410
|
const a = this._getOrReturnCtx(e);
|
|
@@ -1420,7 +1420,7 @@ class X extends v {
|
|
|
1420
1420
|
code: u.invalid_date
|
|
1421
1421
|
}), m;
|
|
1422
1422
|
}
|
|
1423
|
-
const s = new
|
|
1423
|
+
const s = new E();
|
|
1424
1424
|
let r;
|
|
1425
1425
|
for (const a of this._def.checks)
|
|
1426
1426
|
a.kind === "min" ? e.data.getTime() < a.value && (r = this._getOrReturnCtx(e, r), l(r, {
|
|
@@ -1444,7 +1444,7 @@ class X extends v {
|
|
|
1444
1444
|
};
|
|
1445
1445
|
}
|
|
1446
1446
|
_addCheck(e) {
|
|
1447
|
-
return new
|
|
1447
|
+
return new te({
|
|
1448
1448
|
...this._def,
|
|
1449
1449
|
checks: [...this._def.checks, e]
|
|
1450
1450
|
});
|
|
@@ -1476,13 +1476,13 @@ class X extends v {
|
|
|
1476
1476
|
return e != null ? new Date(e) : null;
|
|
1477
1477
|
}
|
|
1478
1478
|
}
|
|
1479
|
-
|
|
1479
|
+
te.create = (t) => new te({
|
|
1480
1480
|
checks: [],
|
|
1481
1481
|
coerce: t?.coerce || !1,
|
|
1482
1482
|
typeName: y.ZodDate,
|
|
1483
1483
|
..._(t)
|
|
1484
1484
|
});
|
|
1485
|
-
class
|
|
1485
|
+
class $e extends v {
|
|
1486
1486
|
_parse(e) {
|
|
1487
1487
|
if (this._getType(e) !== f.symbol) {
|
|
1488
1488
|
const s = this._getOrReturnCtx(e);
|
|
@@ -1495,11 +1495,11 @@ class Re extends v {
|
|
|
1495
1495
|
return C(e.data);
|
|
1496
1496
|
}
|
|
1497
1497
|
}
|
|
1498
|
-
|
|
1498
|
+
$e.create = (t) => new $e({
|
|
1499
1499
|
typeName: y.ZodSymbol,
|
|
1500
1500
|
..._(t)
|
|
1501
1501
|
});
|
|
1502
|
-
class
|
|
1502
|
+
class me extends v {
|
|
1503
1503
|
_parse(e) {
|
|
1504
1504
|
if (this._getType(e) !== f.undefined) {
|
|
1505
1505
|
const s = this._getOrReturnCtx(e);
|
|
@@ -1512,11 +1512,11 @@ class pe extends v {
|
|
|
1512
1512
|
return C(e.data);
|
|
1513
1513
|
}
|
|
1514
1514
|
}
|
|
1515
|
-
|
|
1515
|
+
me.create = (t) => new me({
|
|
1516
1516
|
typeName: y.ZodUndefined,
|
|
1517
1517
|
..._(t)
|
|
1518
1518
|
});
|
|
1519
|
-
class
|
|
1519
|
+
class ye extends v {
|
|
1520
1520
|
_parse(e) {
|
|
1521
1521
|
if (this._getType(e) !== f.null) {
|
|
1522
1522
|
const s = this._getOrReturnCtx(e);
|
|
@@ -1529,11 +1529,11 @@ class me extends v {
|
|
|
1529
1529
|
return C(e.data);
|
|
1530
1530
|
}
|
|
1531
1531
|
}
|
|
1532
|
-
|
|
1532
|
+
ye.create = (t) => new ye({
|
|
1533
1533
|
typeName: y.ZodNull,
|
|
1534
1534
|
..._(t)
|
|
1535
1535
|
});
|
|
1536
|
-
class
|
|
1536
|
+
class ce extends v {
|
|
1537
1537
|
constructor() {
|
|
1538
1538
|
super(...arguments), this._any = !0;
|
|
1539
1539
|
}
|
|
@@ -1541,11 +1541,11 @@ class oe extends v {
|
|
|
1541
1541
|
return C(e.data);
|
|
1542
1542
|
}
|
|
1543
1543
|
}
|
|
1544
|
-
|
|
1544
|
+
ce.create = (t) => new ce({
|
|
1545
1545
|
typeName: y.ZodAny,
|
|
1546
1546
|
..._(t)
|
|
1547
1547
|
});
|
|
1548
|
-
class
|
|
1548
|
+
class X extends v {
|
|
1549
1549
|
constructor() {
|
|
1550
1550
|
super(...arguments), this._unknown = !0;
|
|
1551
1551
|
}
|
|
@@ -1553,11 +1553,11 @@ class G extends v {
|
|
|
1553
1553
|
return C(e.data);
|
|
1554
1554
|
}
|
|
1555
1555
|
}
|
|
1556
|
-
|
|
1556
|
+
X.create = (t) => new X({
|
|
1557
1557
|
typeName: y.ZodUnknown,
|
|
1558
1558
|
..._(t)
|
|
1559
1559
|
});
|
|
1560
|
-
class
|
|
1560
|
+
class U extends v {
|
|
1561
1561
|
_parse(e) {
|
|
1562
1562
|
const n = this._getOrReturnCtx(e);
|
|
1563
1563
|
return l(n, {
|
|
@@ -1567,11 +1567,11 @@ class F extends v {
|
|
|
1567
1567
|
}), m;
|
|
1568
1568
|
}
|
|
1569
1569
|
}
|
|
1570
|
-
|
|
1570
|
+
U.create = (t) => new U({
|
|
1571
1571
|
typeName: y.ZodNever,
|
|
1572
1572
|
..._(t)
|
|
1573
1573
|
});
|
|
1574
|
-
class
|
|
1574
|
+
class Ie extends v {
|
|
1575
1575
|
_parse(e) {
|
|
1576
1576
|
if (this._getType(e) !== f.undefined) {
|
|
1577
1577
|
const s = this._getOrReturnCtx(e);
|
|
@@ -1584,11 +1584,11 @@ class Ne extends v {
|
|
|
1584
1584
|
return C(e.data);
|
|
1585
1585
|
}
|
|
1586
1586
|
}
|
|
1587
|
-
|
|
1587
|
+
Ie.create = (t) => new Ie({
|
|
1588
1588
|
typeName: y.ZodVoid,
|
|
1589
1589
|
..._(t)
|
|
1590
1590
|
});
|
|
1591
|
-
class
|
|
1591
|
+
class I extends v {
|
|
1592
1592
|
_parse(e) {
|
|
1593
1593
|
const { ctx: n, status: s } = this._processInputParams(e), r = this._def;
|
|
1594
1594
|
if (n.parsedType !== f.array)
|
|
@@ -1624,27 +1624,27 @@ class j extends v {
|
|
|
1624
1624
|
exact: !1,
|
|
1625
1625
|
message: r.maxLength.message
|
|
1626
1626
|
}), s.dirty()), n.common.async)
|
|
1627
|
-
return Promise.all([...n.data].map((i, o) => r.type._parseAsync(new
|
|
1628
|
-
const a = [...n.data].map((i, o) => r.type._parseSync(new
|
|
1629
|
-
return
|
|
1627
|
+
return Promise.all([...n.data].map((i, o) => r.type._parseAsync(new M(n, i, n.path, o)))).then((i) => E.mergeArray(s, i));
|
|
1628
|
+
const a = [...n.data].map((i, o) => r.type._parseSync(new M(n, i, n.path, o)));
|
|
1629
|
+
return E.mergeArray(s, a);
|
|
1630
1630
|
}
|
|
1631
1631
|
get element() {
|
|
1632
1632
|
return this._def.type;
|
|
1633
1633
|
}
|
|
1634
1634
|
min(e, n) {
|
|
1635
|
-
return new
|
|
1635
|
+
return new I({
|
|
1636
1636
|
...this._def,
|
|
1637
1637
|
minLength: { value: e, message: p.toString(n) }
|
|
1638
1638
|
});
|
|
1639
1639
|
}
|
|
1640
1640
|
max(e, n) {
|
|
1641
|
-
return new
|
|
1641
|
+
return new I({
|
|
1642
1642
|
...this._def,
|
|
1643
1643
|
maxLength: { value: e, message: p.toString(n) }
|
|
1644
1644
|
});
|
|
1645
1645
|
}
|
|
1646
1646
|
length(e, n) {
|
|
1647
|
-
return new
|
|
1647
|
+
return new I({
|
|
1648
1648
|
...this._def,
|
|
1649
1649
|
exactLength: { value: e, message: p.toString(n) }
|
|
1650
1650
|
});
|
|
@@ -1653,7 +1653,7 @@ class j extends v {
|
|
|
1653
1653
|
return this.min(1, e);
|
|
1654
1654
|
}
|
|
1655
1655
|
}
|
|
1656
|
-
|
|
1656
|
+
I.create = (t, e) => new I({
|
|
1657
1657
|
type: t,
|
|
1658
1658
|
minLength: null,
|
|
1659
1659
|
maxLength: null,
|
|
@@ -1661,23 +1661,23 @@ j.create = (t, e) => new j({
|
|
|
1661
1661
|
typeName: y.ZodArray,
|
|
1662
1662
|
..._(e)
|
|
1663
1663
|
});
|
|
1664
|
-
function
|
|
1665
|
-
if (t instanceof
|
|
1664
|
+
function re(t) {
|
|
1665
|
+
if (t instanceof T) {
|
|
1666
1666
|
const e = {};
|
|
1667
1667
|
for (const n in t.shape) {
|
|
1668
1668
|
const s = t.shape[n];
|
|
1669
|
-
e[n] =
|
|
1669
|
+
e[n] = L.create(re(s));
|
|
1670
1670
|
}
|
|
1671
|
-
return new
|
|
1671
|
+
return new T({
|
|
1672
1672
|
...t._def,
|
|
1673
1673
|
shape: () => e
|
|
1674
1674
|
});
|
|
1675
|
-
} else return t instanceof
|
|
1675
|
+
} else return t instanceof I ? new I({
|
|
1676
1676
|
...t._def,
|
|
1677
|
-
type:
|
|
1678
|
-
}) : t instanceof
|
|
1677
|
+
type: re(t.element)
|
|
1678
|
+
}) : t instanceof L ? L.create(re(t.unwrap())) : t instanceof J ? J.create(re(t.unwrap())) : t instanceof P ? P.create(t.items.map((e) => re(e))) : t;
|
|
1679
1679
|
}
|
|
1680
|
-
class
|
|
1680
|
+
class T extends v {
|
|
1681
1681
|
constructor() {
|
|
1682
1682
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1683
1683
|
}
|
|
@@ -1697,7 +1697,7 @@ class k extends v {
|
|
|
1697
1697
|
}), m;
|
|
1698
1698
|
}
|
|
1699
1699
|
const { status: s, ctx: r } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
|
|
1700
|
-
if (!(this._def.catchall instanceof
|
|
1700
|
+
if (!(this._def.catchall instanceof U && this._def.unknownKeys === "strip"))
|
|
1701
1701
|
for (const d in r.data)
|
|
1702
1702
|
i.includes(d) || o.push(d);
|
|
1703
1703
|
const c = [];
|
|
@@ -1705,11 +1705,11 @@ class k extends v {
|
|
|
1705
1705
|
const h = a[d], x = r.data[d];
|
|
1706
1706
|
c.push({
|
|
1707
1707
|
key: { status: "valid", value: d },
|
|
1708
|
-
value: h._parse(new
|
|
1708
|
+
value: h._parse(new M(r, x, r.path, d)),
|
|
1709
1709
|
alwaysSet: d in r.data
|
|
1710
1710
|
});
|
|
1711
1711
|
}
|
|
1712
|
-
if (this._def.catchall instanceof
|
|
1712
|
+
if (this._def.catchall instanceof U) {
|
|
1713
1713
|
const d = this._def.unknownKeys;
|
|
1714
1714
|
if (d === "passthrough")
|
|
1715
1715
|
for (const h of o)
|
|
@@ -1730,7 +1730,7 @@ class k extends v {
|
|
|
1730
1730
|
c.push({
|
|
1731
1731
|
key: { status: "valid", value: h },
|
|
1732
1732
|
value: d._parse(
|
|
1733
|
-
new
|
|
1733
|
+
new M(r, x, r.path, h)
|
|
1734
1734
|
//, ctx.child(key), value, getParsedType(value)
|
|
1735
1735
|
),
|
|
1736
1736
|
alwaysSet: h in r.data
|
|
@@ -1740,21 +1740,21 @@ class k extends v {
|
|
|
1740
1740
|
return r.common.async ? Promise.resolve().then(async () => {
|
|
1741
1741
|
const d = [];
|
|
1742
1742
|
for (const h of c) {
|
|
1743
|
-
const x = await h.key,
|
|
1743
|
+
const x = await h.key, S = await h.value;
|
|
1744
1744
|
d.push({
|
|
1745
1745
|
key: x,
|
|
1746
|
-
value:
|
|
1746
|
+
value: S,
|
|
1747
1747
|
alwaysSet: h.alwaysSet
|
|
1748
1748
|
});
|
|
1749
1749
|
}
|
|
1750
1750
|
return d;
|
|
1751
|
-
}).then((d) =>
|
|
1751
|
+
}).then((d) => E.mergeObjectSync(s, d)) : E.mergeObjectSync(s, c);
|
|
1752
1752
|
}
|
|
1753
1753
|
get shape() {
|
|
1754
1754
|
return this._def.shape();
|
|
1755
1755
|
}
|
|
1756
1756
|
strict(e) {
|
|
1757
|
-
return p.errToObj, new
|
|
1757
|
+
return p.errToObj, new T({
|
|
1758
1758
|
...this._def,
|
|
1759
1759
|
unknownKeys: "strict",
|
|
1760
1760
|
...e !== void 0 ? {
|
|
@@ -1770,13 +1770,13 @@ class k extends v {
|
|
|
1770
1770
|
});
|
|
1771
1771
|
}
|
|
1772
1772
|
strip() {
|
|
1773
|
-
return new
|
|
1773
|
+
return new T({
|
|
1774
1774
|
...this._def,
|
|
1775
1775
|
unknownKeys: "strip"
|
|
1776
1776
|
});
|
|
1777
1777
|
}
|
|
1778
1778
|
passthrough() {
|
|
1779
|
-
return new
|
|
1779
|
+
return new T({
|
|
1780
1780
|
...this._def,
|
|
1781
1781
|
unknownKeys: "passthrough"
|
|
1782
1782
|
});
|
|
@@ -1799,7 +1799,7 @@ class k extends v {
|
|
|
1799
1799
|
// }) as any;
|
|
1800
1800
|
// };
|
|
1801
1801
|
extend(e) {
|
|
1802
|
-
return new
|
|
1802
|
+
return new T({
|
|
1803
1803
|
...this._def,
|
|
1804
1804
|
shape: () => ({
|
|
1805
1805
|
...this._def.shape(),
|
|
@@ -1813,7 +1813,7 @@ class k extends v {
|
|
|
1813
1813
|
* upgrade if you are experiencing issues.
|
|
1814
1814
|
*/
|
|
1815
1815
|
merge(e) {
|
|
1816
|
-
return new
|
|
1816
|
+
return new T({
|
|
1817
1817
|
unknownKeys: e._def.unknownKeys,
|
|
1818
1818
|
catchall: e._def.catchall,
|
|
1819
1819
|
shape: () => ({
|
|
@@ -1883,7 +1883,7 @@ class k extends v {
|
|
|
1883
1883
|
// return merged;
|
|
1884
1884
|
// }
|
|
1885
1885
|
catchall(e) {
|
|
1886
|
-
return new
|
|
1886
|
+
return new T({
|
|
1887
1887
|
...this._def,
|
|
1888
1888
|
catchall: e
|
|
1889
1889
|
});
|
|
@@ -1892,7 +1892,7 @@ class k extends v {
|
|
|
1892
1892
|
const n = {};
|
|
1893
1893
|
for (const s of b.objectKeys(e))
|
|
1894
1894
|
e[s] && this.shape[s] && (n[s] = this.shape[s]);
|
|
1895
|
-
return new
|
|
1895
|
+
return new T({
|
|
1896
1896
|
...this._def,
|
|
1897
1897
|
shape: () => n
|
|
1898
1898
|
});
|
|
@@ -1901,7 +1901,7 @@ class k extends v {
|
|
|
1901
1901
|
const n = {};
|
|
1902
1902
|
for (const s of b.objectKeys(this.shape))
|
|
1903
1903
|
e[s] || (n[s] = this.shape[s]);
|
|
1904
|
-
return new
|
|
1904
|
+
return new T({
|
|
1905
1905
|
...this._def,
|
|
1906
1906
|
shape: () => n
|
|
1907
1907
|
});
|
|
@@ -1910,7 +1910,7 @@ class k extends v {
|
|
|
1910
1910
|
* @deprecated
|
|
1911
1911
|
*/
|
|
1912
1912
|
deepPartial() {
|
|
1913
|
-
return
|
|
1913
|
+
return re(this);
|
|
1914
1914
|
}
|
|
1915
1915
|
partial(e) {
|
|
1916
1916
|
const n = {};
|
|
@@ -1918,7 +1918,7 @@ class k extends v {
|
|
|
1918
1918
|
const r = this.shape[s];
|
|
1919
1919
|
e && !e[s] ? n[s] = r : n[s] = r.optional();
|
|
1920
1920
|
}
|
|
1921
|
-
return new
|
|
1921
|
+
return new T({
|
|
1922
1922
|
...this._def,
|
|
1923
1923
|
shape: () => n
|
|
1924
1924
|
});
|
|
@@ -1930,41 +1930,41 @@ class k extends v {
|
|
|
1930
1930
|
n[s] = this.shape[s];
|
|
1931
1931
|
else {
|
|
1932
1932
|
let a = this.shape[s];
|
|
1933
|
-
for (; a instanceof
|
|
1933
|
+
for (; a instanceof L; )
|
|
1934
1934
|
a = a._def.innerType;
|
|
1935
1935
|
n[s] = a;
|
|
1936
1936
|
}
|
|
1937
|
-
return new
|
|
1937
|
+
return new T({
|
|
1938
1938
|
...this._def,
|
|
1939
1939
|
shape: () => n
|
|
1940
1940
|
});
|
|
1941
1941
|
}
|
|
1942
1942
|
keyof() {
|
|
1943
|
-
return
|
|
1943
|
+
return lt(b.objectKeys(this.shape));
|
|
1944
1944
|
}
|
|
1945
1945
|
}
|
|
1946
|
-
|
|
1946
|
+
T.create = (t, e) => new T({
|
|
1947
1947
|
shape: () => t,
|
|
1948
1948
|
unknownKeys: "strip",
|
|
1949
|
-
catchall:
|
|
1949
|
+
catchall: U.create(),
|
|
1950
1950
|
typeName: y.ZodObject,
|
|
1951
1951
|
..._(e)
|
|
1952
1952
|
});
|
|
1953
|
-
|
|
1953
|
+
T.strictCreate = (t, e) => new T({
|
|
1954
1954
|
shape: () => t,
|
|
1955
1955
|
unknownKeys: "strict",
|
|
1956
|
-
catchall:
|
|
1956
|
+
catchall: U.create(),
|
|
1957
1957
|
typeName: y.ZodObject,
|
|
1958
1958
|
..._(e)
|
|
1959
1959
|
});
|
|
1960
|
-
|
|
1960
|
+
T.lazycreate = (t, e) => new T({
|
|
1961
1961
|
shape: t,
|
|
1962
1962
|
unknownKeys: "strip",
|
|
1963
|
-
catchall:
|
|
1963
|
+
catchall: U.create(),
|
|
1964
1964
|
typeName: y.ZodObject,
|
|
1965
1965
|
..._(e)
|
|
1966
1966
|
});
|
|
1967
|
-
class
|
|
1967
|
+
class _e extends v {
|
|
1968
1968
|
_parse(e) {
|
|
1969
1969
|
const { ctx: n } = this._processInputParams(e), s = this._def.options;
|
|
1970
1970
|
function r(a) {
|
|
@@ -1974,7 +1974,7 @@ class ye extends v {
|
|
|
1974
1974
|
for (const o of a)
|
|
1975
1975
|
if (o.result.status === "dirty")
|
|
1976
1976
|
return n.common.issues.push(...o.ctx.common.issues), o.result;
|
|
1977
|
-
const i = a.map((o) => new
|
|
1977
|
+
const i = a.map((o) => new N(o.ctx.common.issues));
|
|
1978
1978
|
return l(n, {
|
|
1979
1979
|
code: u.invalid_union,
|
|
1980
1980
|
unionErrors: i
|
|
@@ -2021,7 +2021,7 @@ class ye extends v {
|
|
|
2021
2021
|
}
|
|
2022
2022
|
if (a)
|
|
2023
2023
|
return n.common.issues.push(...a.ctx.common.issues), a.result;
|
|
2024
|
-
const o = i.map((c) => new
|
|
2024
|
+
const o = i.map((c) => new N(c));
|
|
2025
2025
|
return l(n, {
|
|
2026
2026
|
code: u.invalid_union,
|
|
2027
2027
|
unionErrors: o
|
|
@@ -2032,12 +2032,12 @@ class ye extends v {
|
|
|
2032
2032
|
return this._def.options;
|
|
2033
2033
|
}
|
|
2034
2034
|
}
|
|
2035
|
-
|
|
2035
|
+
_e.create = (t, e) => new _e({
|
|
2036
2036
|
options: t,
|
|
2037
2037
|
typeName: y.ZodUnion,
|
|
2038
2038
|
..._(e)
|
|
2039
2039
|
});
|
|
2040
|
-
const z = (t) => t instanceof
|
|
2040
|
+
const z = (t) => t instanceof be ? z(t.schema) : t instanceof j ? z(t.innerType()) : t instanceof xe ? [t.value] : t instanceof Q ? t.options : t instanceof ke ? b.objectValues(t.enum) : t instanceof we ? z(t._def.innerType) : t instanceof me ? [void 0] : t instanceof ye ? [null] : t instanceof L ? [void 0, ...z(t.unwrap())] : t instanceof J ? [null, ...z(t.unwrap())] : t instanceof Xe || t instanceof Se ? z(t.unwrap()) : t instanceof Te ? z(t._def.innerType) : [];
|
|
2041
2041
|
class Me extends v {
|
|
2042
2042
|
_parse(e) {
|
|
2043
2043
|
const { ctx: n } = this._processInputParams(e);
|
|
@@ -2100,14 +2100,14 @@ class Me extends v {
|
|
|
2100
2100
|
});
|
|
2101
2101
|
}
|
|
2102
2102
|
}
|
|
2103
|
-
function
|
|
2103
|
+
function Ye(t, e) {
|
|
2104
2104
|
const n = B(t), s = B(e);
|
|
2105
2105
|
if (t === e)
|
|
2106
2106
|
return { valid: !0, data: t };
|
|
2107
2107
|
if (n === f.object && s === f.object) {
|
|
2108
2108
|
const r = b.objectKeys(e), a = b.objectKeys(t).filter((o) => r.indexOf(o) !== -1), i = { ...t, ...e };
|
|
2109
2109
|
for (const o of a) {
|
|
2110
|
-
const c =
|
|
2110
|
+
const c = Ye(t[o], e[o]);
|
|
2111
2111
|
if (!c.valid)
|
|
2112
2112
|
return { valid: !1 };
|
|
2113
2113
|
i[o] = c.data;
|
|
@@ -2118,7 +2118,7 @@ function He(t, e) {
|
|
|
2118
2118
|
return { valid: !1 };
|
|
2119
2119
|
const r = [];
|
|
2120
2120
|
for (let a = 0; a < t.length; a++) {
|
|
2121
|
-
const i = t[a], o = e[a], c =
|
|
2121
|
+
const i = t[a], o = e[a], c = Ye(i, o);
|
|
2122
2122
|
if (!c.valid)
|
|
2123
2123
|
return { valid: !1 };
|
|
2124
2124
|
r.push(c.data);
|
|
@@ -2126,13 +2126,13 @@ function He(t, e) {
|
|
|
2126
2126
|
return { valid: !0, data: r };
|
|
2127
2127
|
} else return n === f.date && s === f.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
|
|
2128
2128
|
}
|
|
2129
|
-
class
|
|
2129
|
+
class ge extends v {
|
|
2130
2130
|
_parse(e) {
|
|
2131
2131
|
const { status: n, ctx: s } = this._processInputParams(e), r = (a, i) => {
|
|
2132
|
-
if (
|
|
2132
|
+
if (Qe(a) || Qe(i))
|
|
2133
2133
|
return m;
|
|
2134
|
-
const o =
|
|
2135
|
-
return o.valid ? ((
|
|
2134
|
+
const o = Ye(a.value, i.value);
|
|
2135
|
+
return o.valid ? ((Je(a) || Je(i)) && n.dirty(), { status: n.value, value: o.data }) : (l(s, {
|
|
2136
2136
|
code: u.invalid_intersection_types
|
|
2137
2137
|
}), m);
|
|
2138
2138
|
};
|
|
@@ -2158,13 +2158,13 @@ class _e extends v {
|
|
|
2158
2158
|
}));
|
|
2159
2159
|
}
|
|
2160
2160
|
}
|
|
2161
|
-
|
|
2161
|
+
ge.create = (t, e, n) => new ge({
|
|
2162
2162
|
left: t,
|
|
2163
2163
|
right: e,
|
|
2164
2164
|
typeName: y.ZodIntersection,
|
|
2165
2165
|
..._(n)
|
|
2166
2166
|
});
|
|
2167
|
-
class
|
|
2167
|
+
class P extends v {
|
|
2168
2168
|
_parse(e) {
|
|
2169
2169
|
const { status: n, ctx: s } = this._processInputParams(e);
|
|
2170
2170
|
if (s.parsedType !== f.array)
|
|
@@ -2190,31 +2190,31 @@ class D extends v {
|
|
|
2190
2190
|
}), n.dirty());
|
|
2191
2191
|
const a = [...s.data].map((i, o) => {
|
|
2192
2192
|
const c = this._def.items[o] || this._def.rest;
|
|
2193
|
-
return c ? c._parse(new
|
|
2193
|
+
return c ? c._parse(new M(s, i, s.path, o)) : null;
|
|
2194
2194
|
}).filter((i) => !!i);
|
|
2195
|
-
return s.common.async ? Promise.all(a).then((i) =>
|
|
2195
|
+
return s.common.async ? Promise.all(a).then((i) => E.mergeArray(n, i)) : E.mergeArray(n, a);
|
|
2196
2196
|
}
|
|
2197
2197
|
get items() {
|
|
2198
2198
|
return this._def.items;
|
|
2199
2199
|
}
|
|
2200
2200
|
rest(e) {
|
|
2201
|
-
return new
|
|
2201
|
+
return new P({
|
|
2202
2202
|
...this._def,
|
|
2203
2203
|
rest: e
|
|
2204
2204
|
});
|
|
2205
2205
|
}
|
|
2206
2206
|
}
|
|
2207
|
-
|
|
2207
|
+
P.create = (t, e) => {
|
|
2208
2208
|
if (!Array.isArray(t))
|
|
2209
2209
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2210
|
-
return new
|
|
2210
|
+
return new P({
|
|
2211
2211
|
items: t,
|
|
2212
2212
|
typeName: y.ZodTuple,
|
|
2213
2213
|
rest: null,
|
|
2214
2214
|
..._(e)
|
|
2215
2215
|
});
|
|
2216
2216
|
};
|
|
2217
|
-
class
|
|
2217
|
+
class ve extends v {
|
|
2218
2218
|
get keySchema() {
|
|
2219
2219
|
return this._def.keyType;
|
|
2220
2220
|
}
|
|
@@ -2232,22 +2232,22 @@ class ge extends v {
|
|
|
2232
2232
|
const r = [], a = this._def.keyType, i = this._def.valueType;
|
|
2233
2233
|
for (const o in s.data)
|
|
2234
2234
|
r.push({
|
|
2235
|
-
key: a._parse(new
|
|
2236
|
-
value: i._parse(new
|
|
2235
|
+
key: a._parse(new M(s, o, s.path, o)),
|
|
2236
|
+
value: i._parse(new M(s, s.data[o], s.path, o)),
|
|
2237
2237
|
alwaysSet: o in s.data
|
|
2238
2238
|
});
|
|
2239
|
-
return s.common.async ?
|
|
2239
|
+
return s.common.async ? E.mergeObjectAsync(n, r) : E.mergeObjectSync(n, r);
|
|
2240
2240
|
}
|
|
2241
2241
|
get element() {
|
|
2242
2242
|
return this._def.valueType;
|
|
2243
2243
|
}
|
|
2244
2244
|
static create(e, n, s) {
|
|
2245
|
-
return n instanceof v ? new
|
|
2245
|
+
return n instanceof v ? new ve({
|
|
2246
2246
|
keyType: e,
|
|
2247
2247
|
valueType: n,
|
|
2248
2248
|
typeName: y.ZodRecord,
|
|
2249
2249
|
..._(s)
|
|
2250
|
-
}) : new
|
|
2250
|
+
}) : new ve({
|
|
2251
2251
|
keyType: $.create(),
|
|
2252
2252
|
valueType: e,
|
|
2253
2253
|
typeName: y.ZodRecord,
|
|
@@ -2255,7 +2255,7 @@ class ge extends v {
|
|
|
2255
2255
|
});
|
|
2256
2256
|
}
|
|
2257
2257
|
}
|
|
2258
|
-
class
|
|
2258
|
+
class je extends v {
|
|
2259
2259
|
get keySchema() {
|
|
2260
2260
|
return this._def.keyType;
|
|
2261
2261
|
}
|
|
@@ -2271,8 +2271,8 @@ class $e extends v {
|
|
|
2271
2271
|
received: s.parsedType
|
|
2272
2272
|
}), m;
|
|
2273
2273
|
const r = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, c], d) => ({
|
|
2274
|
-
key: r._parse(new
|
|
2275
|
-
value: a._parse(new
|
|
2274
|
+
key: r._parse(new M(s, o, s.path, [d, "key"])),
|
|
2275
|
+
value: a._parse(new M(s, c, s.path, [d, "value"]))
|
|
2276
2276
|
}));
|
|
2277
2277
|
if (s.common.async) {
|
|
2278
2278
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -2297,13 +2297,13 @@ class $e extends v {
|
|
|
2297
2297
|
}
|
|
2298
2298
|
}
|
|
2299
2299
|
}
|
|
2300
|
-
|
|
2300
|
+
je.create = (t, e, n) => new je({
|
|
2301
2301
|
valueType: e,
|
|
2302
2302
|
keyType: t,
|
|
2303
2303
|
typeName: y.ZodMap,
|
|
2304
2304
|
..._(n)
|
|
2305
2305
|
});
|
|
2306
|
-
class
|
|
2306
|
+
class ne extends v {
|
|
2307
2307
|
_parse(e) {
|
|
2308
2308
|
const { status: n, ctx: s } = this._processInputParams(e);
|
|
2309
2309
|
if (s.parsedType !== f.set)
|
|
@@ -2338,17 +2338,17 @@ class ee extends v {
|
|
|
2338
2338
|
}
|
|
2339
2339
|
return { status: n.value, value: d };
|
|
2340
2340
|
}
|
|
2341
|
-
const o = [...s.data.values()].map((c, d) => a._parse(new
|
|
2341
|
+
const o = [...s.data.values()].map((c, d) => a._parse(new M(s, c, s.path, d)));
|
|
2342
2342
|
return s.common.async ? Promise.all(o).then((c) => i(c)) : i(o);
|
|
2343
2343
|
}
|
|
2344
2344
|
min(e, n) {
|
|
2345
|
-
return new
|
|
2345
|
+
return new ne({
|
|
2346
2346
|
...this._def,
|
|
2347
2347
|
minSize: { value: e, message: p.toString(n) }
|
|
2348
2348
|
});
|
|
2349
2349
|
}
|
|
2350
2350
|
max(e, n) {
|
|
2351
|
-
return new
|
|
2351
|
+
return new ne({
|
|
2352
2352
|
...this._def,
|
|
2353
2353
|
maxSize: { value: e, message: p.toString(n) }
|
|
2354
2354
|
});
|
|
@@ -2360,14 +2360,14 @@ class ee extends v {
|
|
|
2360
2360
|
return this.min(1, e);
|
|
2361
2361
|
}
|
|
2362
2362
|
}
|
|
2363
|
-
|
|
2363
|
+
ne.create = (t, e) => new ne({
|
|
2364
2364
|
valueType: t,
|
|
2365
2365
|
minSize: null,
|
|
2366
2366
|
maxSize: null,
|
|
2367
2367
|
typeName: y.ZodSet,
|
|
2368
2368
|
..._(e)
|
|
2369
2369
|
});
|
|
2370
|
-
class
|
|
2370
|
+
class ie extends v {
|
|
2371
2371
|
constructor() {
|
|
2372
2372
|
super(...arguments), this.validate = this.implement;
|
|
2373
2373
|
}
|
|
@@ -2380,10 +2380,10 @@ class ae extends v {
|
|
|
2380
2380
|
received: n.parsedType
|
|
2381
2381
|
}), m;
|
|
2382
2382
|
function s(o, c) {
|
|
2383
|
-
return
|
|
2383
|
+
return Re({
|
|
2384
2384
|
data: o,
|
|
2385
2385
|
path: n.path,
|
|
2386
|
-
errorMaps: [n.common.contextualErrorMap, n.schemaErrorMap,
|
|
2386
|
+
errorMaps: [n.common.contextualErrorMap, n.schemaErrorMap, Ne(), oe].filter((d) => !!d),
|
|
2387
2387
|
issueData: {
|
|
2388
2388
|
code: u.invalid_arguments,
|
|
2389
2389
|
argumentsError: c
|
|
@@ -2391,10 +2391,10 @@ class ae extends v {
|
|
|
2391
2391
|
});
|
|
2392
2392
|
}
|
|
2393
2393
|
function r(o, c) {
|
|
2394
|
-
return
|
|
2394
|
+
return Re({
|
|
2395
2395
|
data: o,
|
|
2396
2396
|
path: n.path,
|
|
2397
|
-
errorMaps: [n.common.contextualErrorMap, n.schemaErrorMap,
|
|
2397
|
+
errorMaps: [n.common.contextualErrorMap, n.schemaErrorMap, Ne(), oe].filter((d) => !!d),
|
|
2398
2398
|
issueData: {
|
|
2399
2399
|
code: u.invalid_return_type,
|
|
2400
2400
|
returnTypeError: c
|
|
@@ -2402,10 +2402,10 @@ class ae extends v {
|
|
|
2402
2402
|
});
|
|
2403
2403
|
}
|
|
2404
2404
|
const a = { errorMap: n.common.contextualErrorMap }, i = n.data;
|
|
2405
|
-
if (this._def.returns instanceof
|
|
2405
|
+
if (this._def.returns instanceof de) {
|
|
2406
2406
|
const o = this;
|
|
2407
2407
|
return C(async function(...c) {
|
|
2408
|
-
const d = new
|
|
2408
|
+
const d = new N([]), h = await o._def.args.parseAsync(c, a).catch((w) => {
|
|
2409
2409
|
throw d.addIssue(s(c, w)), d;
|
|
2410
2410
|
}), x = await Reflect.apply(i, this, h);
|
|
2411
2411
|
return await o._def.returns._def.type.parseAsync(x, a).catch((w) => {
|
|
@@ -2417,10 +2417,10 @@ class ae extends v {
|
|
|
2417
2417
|
return C(function(...c) {
|
|
2418
2418
|
const d = o._def.args.safeParse(c, a);
|
|
2419
2419
|
if (!d.success)
|
|
2420
|
-
throw new
|
|
2420
|
+
throw new N([s(c, d.error)]);
|
|
2421
2421
|
const h = Reflect.apply(i, this, d.data), x = o._def.returns.safeParse(h, a);
|
|
2422
2422
|
if (!x.success)
|
|
2423
|
-
throw new
|
|
2423
|
+
throw new N([r(h, x.error)]);
|
|
2424
2424
|
return x.data;
|
|
2425
2425
|
});
|
|
2426
2426
|
}
|
|
@@ -2432,13 +2432,13 @@ class ae extends v {
|
|
|
2432
2432
|
return this._def.returns;
|
|
2433
2433
|
}
|
|
2434
2434
|
args(...e) {
|
|
2435
|
-
return new
|
|
2435
|
+
return new ie({
|
|
2436
2436
|
...this._def,
|
|
2437
|
-
args:
|
|
2437
|
+
args: P.create(e).rest(X.create())
|
|
2438
2438
|
});
|
|
2439
2439
|
}
|
|
2440
2440
|
returns(e) {
|
|
2441
|
-
return new
|
|
2441
|
+
return new ie({
|
|
2442
2442
|
...this._def,
|
|
2443
2443
|
returns: e
|
|
2444
2444
|
});
|
|
@@ -2450,15 +2450,15 @@ class ae extends v {
|
|
|
2450
2450
|
return this.parse(e);
|
|
2451
2451
|
}
|
|
2452
2452
|
static create(e, n, s) {
|
|
2453
|
-
return new
|
|
2454
|
-
args: e ||
|
|
2455
|
-
returns: n ||
|
|
2453
|
+
return new ie({
|
|
2454
|
+
args: e || P.create([]).rest(X.create()),
|
|
2455
|
+
returns: n || X.create(),
|
|
2456
2456
|
typeName: y.ZodFunction,
|
|
2457
2457
|
..._(s)
|
|
2458
2458
|
});
|
|
2459
2459
|
}
|
|
2460
2460
|
}
|
|
2461
|
-
class
|
|
2461
|
+
class be extends v {
|
|
2462
2462
|
get schema() {
|
|
2463
2463
|
return this._def.getter();
|
|
2464
2464
|
}
|
|
@@ -2467,12 +2467,12 @@ class ve extends v {
|
|
|
2467
2467
|
return this._def.getter()._parse({ data: n.data, path: n.path, parent: n });
|
|
2468
2468
|
}
|
|
2469
2469
|
}
|
|
2470
|
-
|
|
2470
|
+
be.create = (t, e) => new be({
|
|
2471
2471
|
getter: t,
|
|
2472
2472
|
typeName: y.ZodLazy,
|
|
2473
2473
|
..._(e)
|
|
2474
2474
|
});
|
|
2475
|
-
class
|
|
2475
|
+
class xe extends v {
|
|
2476
2476
|
_parse(e) {
|
|
2477
2477
|
if (e.data !== this._def.value) {
|
|
2478
2478
|
const n = this._getOrReturnCtx(e);
|
|
@@ -2488,19 +2488,19 @@ class be extends v {
|
|
|
2488
2488
|
return this._def.value;
|
|
2489
2489
|
}
|
|
2490
2490
|
}
|
|
2491
|
-
|
|
2491
|
+
xe.create = (t, e) => new xe({
|
|
2492
2492
|
value: t,
|
|
2493
2493
|
typeName: y.ZodLiteral,
|
|
2494
2494
|
..._(e)
|
|
2495
2495
|
});
|
|
2496
|
-
function
|
|
2497
|
-
return new
|
|
2496
|
+
function lt(t, e) {
|
|
2497
|
+
return new Q({
|
|
2498
2498
|
values: t,
|
|
2499
2499
|
typeName: y.ZodEnum,
|
|
2500
2500
|
..._(e)
|
|
2501
2501
|
});
|
|
2502
2502
|
}
|
|
2503
|
-
class
|
|
2503
|
+
class Q extends v {
|
|
2504
2504
|
_parse(e) {
|
|
2505
2505
|
if (typeof e.data != "string") {
|
|
2506
2506
|
const n = this._getOrReturnCtx(e), s = this._def.values;
|
|
@@ -2542,20 +2542,20 @@ class J extends v {
|
|
|
2542
2542
|
return e;
|
|
2543
2543
|
}
|
|
2544
2544
|
extract(e, n = this._def) {
|
|
2545
|
-
return
|
|
2545
|
+
return Q.create(e, {
|
|
2546
2546
|
...this._def,
|
|
2547
2547
|
...n
|
|
2548
2548
|
});
|
|
2549
2549
|
}
|
|
2550
2550
|
exclude(e, n = this._def) {
|
|
2551
|
-
return
|
|
2551
|
+
return Q.create(this.options.filter((s) => !e.includes(s)), {
|
|
2552
2552
|
...this._def,
|
|
2553
2553
|
...n
|
|
2554
2554
|
});
|
|
2555
2555
|
}
|
|
2556
2556
|
}
|
|
2557
|
-
|
|
2558
|
-
class
|
|
2557
|
+
Q.create = lt;
|
|
2558
|
+
class ke extends v {
|
|
2559
2559
|
_parse(e) {
|
|
2560
2560
|
const n = b.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
2561
2561
|
if (s.parsedType !== f.string && s.parsedType !== f.number) {
|
|
@@ -2580,12 +2580,12 @@ class xe extends v {
|
|
|
2580
2580
|
return this._def.values;
|
|
2581
2581
|
}
|
|
2582
2582
|
}
|
|
2583
|
-
|
|
2583
|
+
ke.create = (t, e) => new ke({
|
|
2584
2584
|
values: t,
|
|
2585
2585
|
typeName: y.ZodNativeEnum,
|
|
2586
2586
|
..._(e)
|
|
2587
2587
|
});
|
|
2588
|
-
class
|
|
2588
|
+
class de extends v {
|
|
2589
2589
|
unwrap() {
|
|
2590
2590
|
return this._def.type;
|
|
2591
2591
|
}
|
|
@@ -2604,12 +2604,12 @@ class ce extends v {
|
|
|
2604
2604
|
})));
|
|
2605
2605
|
}
|
|
2606
2606
|
}
|
|
2607
|
-
|
|
2607
|
+
de.create = (t, e) => new de({
|
|
2608
2608
|
type: t,
|
|
2609
2609
|
typeName: y.ZodPromise,
|
|
2610
2610
|
..._(e)
|
|
2611
2611
|
});
|
|
2612
|
-
class
|
|
2612
|
+
class j extends v {
|
|
2613
2613
|
innerType() {
|
|
2614
2614
|
return this._def.schema;
|
|
2615
2615
|
}
|
|
@@ -2636,7 +2636,7 @@ class I extends v {
|
|
|
2636
2636
|
path: s.path,
|
|
2637
2637
|
parent: s
|
|
2638
2638
|
});
|
|
2639
|
-
return c.status === "aborted" ? m : c.status === "dirty" || n.value === "dirty" ?
|
|
2639
|
+
return c.status === "aborted" ? m : c.status === "dirty" || n.value === "dirty" ? ae(c.value) : c;
|
|
2640
2640
|
});
|
|
2641
2641
|
{
|
|
2642
2642
|
if (n.value === "aborted")
|
|
@@ -2646,7 +2646,7 @@ class I extends v {
|
|
|
2646
2646
|
path: s.path,
|
|
2647
2647
|
parent: s
|
|
2648
2648
|
});
|
|
2649
|
-
return o.status === "aborted" ? m : o.status === "dirty" || n.value === "dirty" ?
|
|
2649
|
+
return o.status === "aborted" ? m : o.status === "dirty" || n.value === "dirty" ? ae(o.value) : o;
|
|
2650
2650
|
}
|
|
2651
2651
|
}
|
|
2652
2652
|
if (r.type === "refinement") {
|
|
@@ -2675,33 +2675,33 @@ class I extends v {
|
|
|
2675
2675
|
path: s.path,
|
|
2676
2676
|
parent: s
|
|
2677
2677
|
});
|
|
2678
|
-
if (!
|
|
2678
|
+
if (!ee(i))
|
|
2679
2679
|
return m;
|
|
2680
2680
|
const o = r.transform(i.value, a);
|
|
2681
2681
|
if (o instanceof Promise)
|
|
2682
2682
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2683
2683
|
return { status: n.value, value: o };
|
|
2684
2684
|
} else
|
|
2685
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) =>
|
|
2685
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => ee(i) ? Promise.resolve(r.transform(i.value, a)).then((o) => ({
|
|
2686
2686
|
status: n.value,
|
|
2687
2687
|
value: o
|
|
2688
2688
|
})) : m);
|
|
2689
2689
|
b.assertNever(r);
|
|
2690
2690
|
}
|
|
2691
2691
|
}
|
|
2692
|
-
|
|
2692
|
+
j.create = (t, e, n) => new j({
|
|
2693
2693
|
schema: t,
|
|
2694
2694
|
typeName: y.ZodEffects,
|
|
2695
2695
|
effect: e,
|
|
2696
2696
|
..._(n)
|
|
2697
2697
|
});
|
|
2698
|
-
|
|
2698
|
+
j.createWithPreprocess = (t, e, n) => new j({
|
|
2699
2699
|
schema: e,
|
|
2700
2700
|
effect: { type: "preprocess", transform: t },
|
|
2701
2701
|
typeName: y.ZodEffects,
|
|
2702
2702
|
..._(n)
|
|
2703
2703
|
});
|
|
2704
|
-
class
|
|
2704
|
+
class L extends v {
|
|
2705
2705
|
_parse(e) {
|
|
2706
2706
|
return this._getType(e) === f.undefined ? C(void 0) : this._def.innerType._parse(e);
|
|
2707
2707
|
}
|
|
@@ -2709,12 +2709,12 @@ class M extends v {
|
|
|
2709
2709
|
return this._def.innerType;
|
|
2710
2710
|
}
|
|
2711
2711
|
}
|
|
2712
|
-
|
|
2712
|
+
L.create = (t, e) => new L({
|
|
2713
2713
|
innerType: t,
|
|
2714
2714
|
typeName: y.ZodOptional,
|
|
2715
2715
|
..._(e)
|
|
2716
2716
|
});
|
|
2717
|
-
class
|
|
2717
|
+
class J extends v {
|
|
2718
2718
|
_parse(e) {
|
|
2719
2719
|
return this._getType(e) === f.null ? C(null) : this._def.innerType._parse(e);
|
|
2720
2720
|
}
|
|
@@ -2722,12 +2722,12 @@ class Q extends v {
|
|
|
2722
2722
|
return this._def.innerType;
|
|
2723
2723
|
}
|
|
2724
2724
|
}
|
|
2725
|
-
|
|
2725
|
+
J.create = (t, e) => new J({
|
|
2726
2726
|
innerType: t,
|
|
2727
2727
|
typeName: y.ZodNullable,
|
|
2728
2728
|
..._(e)
|
|
2729
2729
|
});
|
|
2730
|
-
class
|
|
2730
|
+
class we extends v {
|
|
2731
2731
|
_parse(e) {
|
|
2732
2732
|
const { ctx: n } = this._processInputParams(e);
|
|
2733
2733
|
let s = n.data;
|
|
@@ -2741,13 +2741,13 @@ class ke extends v {
|
|
|
2741
2741
|
return this._def.innerType;
|
|
2742
2742
|
}
|
|
2743
2743
|
}
|
|
2744
|
-
|
|
2744
|
+
we.create = (t, e) => new we({
|
|
2745
2745
|
innerType: t,
|
|
2746
2746
|
typeName: y.ZodDefault,
|
|
2747
2747
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2748
2748
|
..._(e)
|
|
2749
2749
|
});
|
|
2750
|
-
class
|
|
2750
|
+
class Te extends v {
|
|
2751
2751
|
_parse(e) {
|
|
2752
2752
|
const { ctx: n } = this._processInputParams(e), s = {
|
|
2753
2753
|
...n,
|
|
@@ -2762,11 +2762,11 @@ class we extends v {
|
|
|
2762
2762
|
...s
|
|
2763
2763
|
}
|
|
2764
2764
|
});
|
|
2765
|
-
return
|
|
2765
|
+
return he(r) ? r.then((a) => ({
|
|
2766
2766
|
status: "valid",
|
|
2767
2767
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2768
2768
|
get error() {
|
|
2769
|
-
return new
|
|
2769
|
+
return new N(s.common.issues);
|
|
2770
2770
|
},
|
|
2771
2771
|
input: s.data
|
|
2772
2772
|
})
|
|
@@ -2774,7 +2774,7 @@ class we extends v {
|
|
|
2774
2774
|
status: "valid",
|
|
2775
2775
|
value: r.status === "valid" ? r.value : this._def.catchValue({
|
|
2776
2776
|
get error() {
|
|
2777
|
-
return new
|
|
2777
|
+
return new N(s.common.issues);
|
|
2778
2778
|
},
|
|
2779
2779
|
input: s.data
|
|
2780
2780
|
})
|
|
@@ -2784,13 +2784,13 @@ class we extends v {
|
|
|
2784
2784
|
return this._def.innerType;
|
|
2785
2785
|
}
|
|
2786
2786
|
}
|
|
2787
|
-
|
|
2787
|
+
Te.create = (t, e) => new Te({
|
|
2788
2788
|
innerType: t,
|
|
2789
2789
|
typeName: y.ZodCatch,
|
|
2790
2790
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2791
2791
|
..._(e)
|
|
2792
2792
|
});
|
|
2793
|
-
class
|
|
2793
|
+
class Ze extends v {
|
|
2794
2794
|
_parse(e) {
|
|
2795
2795
|
if (this._getType(e) !== f.nan) {
|
|
2796
2796
|
const s = this._getOrReturnCtx(e);
|
|
@@ -2803,11 +2803,11 @@ class je extends v {
|
|
|
2803
2803
|
return { status: "valid", value: e.data };
|
|
2804
2804
|
}
|
|
2805
2805
|
}
|
|
2806
|
-
|
|
2806
|
+
Ze.create = (t) => new Ze({
|
|
2807
2807
|
typeName: y.ZodNaN,
|
|
2808
2808
|
..._(t)
|
|
2809
2809
|
});
|
|
2810
|
-
const
|
|
2810
|
+
const Qt = /* @__PURE__ */ Symbol("zod_brand");
|
|
2811
2811
|
class Xe extends v {
|
|
2812
2812
|
_parse(e) {
|
|
2813
2813
|
const { ctx: n } = this._processInputParams(e), s = n.data;
|
|
@@ -2821,7 +2821,7 @@ class Xe extends v {
|
|
|
2821
2821
|
return this._def.type;
|
|
2822
2822
|
}
|
|
2823
2823
|
}
|
|
2824
|
-
class
|
|
2824
|
+
class Ce extends v {
|
|
2825
2825
|
_parse(e) {
|
|
2826
2826
|
const { status: n, ctx: s } = this._processInputParams(e);
|
|
2827
2827
|
if (s.common.async)
|
|
@@ -2831,7 +2831,7 @@ class Se extends v {
|
|
|
2831
2831
|
path: s.path,
|
|
2832
2832
|
parent: s
|
|
2833
2833
|
});
|
|
2834
|
-
return a.status === "aborted" ? m : a.status === "dirty" ? (n.dirty(),
|
|
2834
|
+
return a.status === "aborted" ? m : a.status === "dirty" ? (n.dirty(), ae(a.value)) : this._def.out._parseAsync({
|
|
2835
2835
|
data: a.value,
|
|
2836
2836
|
path: s.path,
|
|
2837
2837
|
parent: s
|
|
@@ -2854,23 +2854,23 @@ class Se extends v {
|
|
|
2854
2854
|
}
|
|
2855
2855
|
}
|
|
2856
2856
|
static create(e, n) {
|
|
2857
|
-
return new
|
|
2857
|
+
return new Ce({
|
|
2858
2858
|
in: e,
|
|
2859
2859
|
out: n,
|
|
2860
2860
|
typeName: y.ZodPipeline
|
|
2861
2861
|
});
|
|
2862
2862
|
}
|
|
2863
2863
|
}
|
|
2864
|
-
class
|
|
2864
|
+
class Se extends v {
|
|
2865
2865
|
_parse(e) {
|
|
2866
|
-
const n = this._def.innerType._parse(e), s = (r) => (
|
|
2867
|
-
return
|
|
2866
|
+
const n = this._def.innerType._parse(e), s = (r) => (ee(r) && (r.value = Object.freeze(r.value)), r);
|
|
2867
|
+
return he(n) ? n.then((r) => s(r)) : s(n);
|
|
2868
2868
|
}
|
|
2869
2869
|
unwrap() {
|
|
2870
2870
|
return this._def.innerType;
|
|
2871
2871
|
}
|
|
2872
2872
|
}
|
|
2873
|
-
|
|
2873
|
+
Se.create = (t, e) => new Se({
|
|
2874
2874
|
innerType: t,
|
|
2875
2875
|
typeName: y.ZodReadonly,
|
|
2876
2876
|
..._(e)
|
|
@@ -2879,8 +2879,8 @@ function nt(t, e) {
|
|
|
2879
2879
|
const n = typeof t == "function" ? t(e) : typeof t == "string" ? { message: t } : t;
|
|
2880
2880
|
return typeof n == "string" ? { message: n } : n;
|
|
2881
2881
|
}
|
|
2882
|
-
function
|
|
2883
|
-
return t ?
|
|
2882
|
+
function ft(t, e = {}, n) {
|
|
2883
|
+
return t ? ce.create().superRefine((s, r) => {
|
|
2884
2884
|
const a = t(s);
|
|
2885
2885
|
if (a instanceof Promise)
|
|
2886
2886
|
return a.then((i) => {
|
|
@@ -2893,144 +2893,144 @@ function dt(t, e = {}, n) {
|
|
|
2893
2893
|
const i = nt(e, s), o = i.fatal ?? n ?? !0;
|
|
2894
2894
|
r.addIssue({ code: "custom", ...i, fatal: o });
|
|
2895
2895
|
}
|
|
2896
|
-
}) :
|
|
2896
|
+
}) : ce.create();
|
|
2897
2897
|
}
|
|
2898
|
-
const
|
|
2899
|
-
object:
|
|
2898
|
+
const Jt = {
|
|
2899
|
+
object: T.lazycreate
|
|
2900
2900
|
};
|
|
2901
2901
|
var y;
|
|
2902
2902
|
(function(t) {
|
|
2903
2903
|
t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
|
|
2904
2904
|
})(y || (y = {}));
|
|
2905
|
-
const
|
|
2905
|
+
const Yt = (t, e = {
|
|
2906
2906
|
message: `Input not instance of ${t.name}`
|
|
2907
|
-
}) =>
|
|
2907
|
+
}) => ft((n) => n instanceof t, e), g = $.create, et = W.create, Kt = Ze.create, Gt = H.create, Oe = pe.create, Xt = te.create, en = $e.create, tn = me.create, nn = ye.create, sn = ce.create, rn = X.create, an = U.create, on = Ie.create, R = I.create, Z = T.create, cn = T.strictCreate, dn = _e.create, un = Me.create, ln = ge.create, fn = P.create, ht = ve.create, hn = je.create, pn = ne.create, mn = ie.create, yn = be.create, _n = xe.create, gn = Q.create, vn = ke.create, bn = de.create, st = j.create, xn = L.create, kn = J.create, wn = j.createWithPreprocess, Tn = Ce.create, Sn = () => g().optional(), En = () => et().optional(), Cn = () => Oe().optional(), On = {
|
|
2908
2908
|
string: ((t) => $.create({ ...t, coerce: !0 })),
|
|
2909
|
-
number: ((t) =>
|
|
2910
|
-
boolean: ((t) =>
|
|
2909
|
+
number: ((t) => W.create({ ...t, coerce: !0 })),
|
|
2910
|
+
boolean: ((t) => pe.create({
|
|
2911
2911
|
...t,
|
|
2912
2912
|
coerce: !0
|
|
2913
2913
|
})),
|
|
2914
|
-
bigint: ((t) =>
|
|
2915
|
-
date: ((t) =>
|
|
2916
|
-
},
|
|
2914
|
+
bigint: ((t) => H.create({ ...t, coerce: !0 })),
|
|
2915
|
+
date: ((t) => te.create({ ...t, coerce: !0 }))
|
|
2916
|
+
}, An = m, Nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2917
2917
|
__proto__: null,
|
|
2918
|
-
BRAND:
|
|
2919
|
-
DIRTY:
|
|
2920
|
-
EMPTY_PATH:
|
|
2918
|
+
BRAND: Qt,
|
|
2919
|
+
DIRTY: ae,
|
|
2920
|
+
EMPTY_PATH: Et,
|
|
2921
2921
|
INVALID: m,
|
|
2922
|
-
NEVER:
|
|
2922
|
+
NEVER: An,
|
|
2923
2923
|
OK: C,
|
|
2924
|
-
ParseStatus:
|
|
2924
|
+
ParseStatus: E,
|
|
2925
2925
|
Schema: v,
|
|
2926
|
-
ZodAny:
|
|
2927
|
-
ZodArray:
|
|
2928
|
-
ZodBigInt:
|
|
2929
|
-
ZodBoolean:
|
|
2926
|
+
ZodAny: ce,
|
|
2927
|
+
ZodArray: I,
|
|
2928
|
+
ZodBigInt: H,
|
|
2929
|
+
ZodBoolean: pe,
|
|
2930
2930
|
ZodBranded: Xe,
|
|
2931
|
-
ZodCatch:
|
|
2932
|
-
ZodDate:
|
|
2933
|
-
ZodDefault:
|
|
2931
|
+
ZodCatch: Te,
|
|
2932
|
+
ZodDate: te,
|
|
2933
|
+
ZodDefault: we,
|
|
2934
2934
|
ZodDiscriminatedUnion: Me,
|
|
2935
|
-
ZodEffects:
|
|
2936
|
-
ZodEnum:
|
|
2937
|
-
ZodError:
|
|
2935
|
+
ZodEffects: j,
|
|
2936
|
+
ZodEnum: Q,
|
|
2937
|
+
ZodError: N,
|
|
2938
2938
|
get ZodFirstPartyTypeKind() {
|
|
2939
2939
|
return y;
|
|
2940
2940
|
},
|
|
2941
|
-
ZodFunction:
|
|
2942
|
-
ZodIntersection:
|
|
2941
|
+
ZodFunction: ie,
|
|
2942
|
+
ZodIntersection: ge,
|
|
2943
2943
|
ZodIssueCode: u,
|
|
2944
|
-
ZodLazy:
|
|
2945
|
-
ZodLiteral:
|
|
2946
|
-
ZodMap:
|
|
2947
|
-
ZodNaN:
|
|
2948
|
-
ZodNativeEnum:
|
|
2949
|
-
ZodNever:
|
|
2950
|
-
ZodNull:
|
|
2951
|
-
ZodNullable:
|
|
2952
|
-
ZodNumber:
|
|
2953
|
-
ZodObject:
|
|
2954
|
-
ZodOptional:
|
|
2944
|
+
ZodLazy: be,
|
|
2945
|
+
ZodLiteral: xe,
|
|
2946
|
+
ZodMap: je,
|
|
2947
|
+
ZodNaN: Ze,
|
|
2948
|
+
ZodNativeEnum: ke,
|
|
2949
|
+
ZodNever: U,
|
|
2950
|
+
ZodNull: ye,
|
|
2951
|
+
ZodNullable: J,
|
|
2952
|
+
ZodNumber: W,
|
|
2953
|
+
ZodObject: T,
|
|
2954
|
+
ZodOptional: L,
|
|
2955
2955
|
ZodParsedType: f,
|
|
2956
|
-
ZodPipeline:
|
|
2957
|
-
ZodPromise:
|
|
2958
|
-
ZodReadonly:
|
|
2959
|
-
ZodRecord:
|
|
2956
|
+
ZodPipeline: Ce,
|
|
2957
|
+
ZodPromise: de,
|
|
2958
|
+
ZodReadonly: Se,
|
|
2959
|
+
ZodRecord: ve,
|
|
2960
2960
|
ZodSchema: v,
|
|
2961
|
-
ZodSet:
|
|
2961
|
+
ZodSet: ne,
|
|
2962
2962
|
ZodString: $,
|
|
2963
|
-
ZodSymbol:
|
|
2964
|
-
ZodTransformer:
|
|
2965
|
-
ZodTuple:
|
|
2963
|
+
ZodSymbol: $e,
|
|
2964
|
+
ZodTransformer: j,
|
|
2965
|
+
ZodTuple: P,
|
|
2966
2966
|
ZodType: v,
|
|
2967
|
-
ZodUndefined:
|
|
2968
|
-
ZodUnion:
|
|
2969
|
-
ZodUnknown:
|
|
2970
|
-
ZodVoid:
|
|
2967
|
+
ZodUndefined: me,
|
|
2968
|
+
ZodUnion: _e,
|
|
2969
|
+
ZodUnknown: X,
|
|
2970
|
+
ZodVoid: Ie,
|
|
2971
2971
|
addIssueToContext: l,
|
|
2972
|
-
any:
|
|
2972
|
+
any: sn,
|
|
2973
2973
|
array: R,
|
|
2974
|
-
bigint:
|
|
2975
|
-
boolean:
|
|
2976
|
-
coerce:
|
|
2977
|
-
custom:
|
|
2978
|
-
date:
|
|
2979
|
-
datetimeRegex:
|
|
2980
|
-
defaultErrorMap:
|
|
2981
|
-
discriminatedUnion:
|
|
2974
|
+
bigint: Gt,
|
|
2975
|
+
boolean: Oe,
|
|
2976
|
+
coerce: On,
|
|
2977
|
+
custom: ft,
|
|
2978
|
+
date: Xt,
|
|
2979
|
+
datetimeRegex: ut,
|
|
2980
|
+
defaultErrorMap: oe,
|
|
2981
|
+
discriminatedUnion: un,
|
|
2982
2982
|
effect: st,
|
|
2983
|
-
enum:
|
|
2984
|
-
function:
|
|
2985
|
-
getErrorMap:
|
|
2983
|
+
enum: gn,
|
|
2984
|
+
function: mn,
|
|
2985
|
+
getErrorMap: Ne,
|
|
2986
2986
|
getParsedType: B,
|
|
2987
|
-
instanceof:
|
|
2988
|
-
intersection:
|
|
2989
|
-
isAborted:
|
|
2990
|
-
isAsync:
|
|
2991
|
-
isDirty:
|
|
2992
|
-
isValid:
|
|
2993
|
-
late:
|
|
2994
|
-
lazy:
|
|
2995
|
-
literal:
|
|
2996
|
-
makeIssue:
|
|
2997
|
-
map:
|
|
2998
|
-
nan:
|
|
2999
|
-
nativeEnum:
|
|
3000
|
-
never:
|
|
3001
|
-
null:
|
|
3002
|
-
nullable:
|
|
2987
|
+
instanceof: Yt,
|
|
2988
|
+
intersection: ln,
|
|
2989
|
+
isAborted: Qe,
|
|
2990
|
+
isAsync: he,
|
|
2991
|
+
isDirty: Je,
|
|
2992
|
+
isValid: ee,
|
|
2993
|
+
late: Jt,
|
|
2994
|
+
lazy: yn,
|
|
2995
|
+
literal: _n,
|
|
2996
|
+
makeIssue: Re,
|
|
2997
|
+
map: hn,
|
|
2998
|
+
nan: Kt,
|
|
2999
|
+
nativeEnum: vn,
|
|
3000
|
+
never: an,
|
|
3001
|
+
null: nn,
|
|
3002
|
+
nullable: kn,
|
|
3003
3003
|
number: et,
|
|
3004
3004
|
object: Z,
|
|
3005
3005
|
get objectUtil() {
|
|
3006
|
-
return
|
|
3006
|
+
return He;
|
|
3007
3007
|
},
|
|
3008
|
-
oboolean:
|
|
3009
|
-
onumber:
|
|
3010
|
-
optional:
|
|
3011
|
-
ostring:
|
|
3012
|
-
pipeline:
|
|
3013
|
-
preprocess:
|
|
3014
|
-
promise:
|
|
3015
|
-
quotelessJson:
|
|
3016
|
-
record:
|
|
3017
|
-
set:
|
|
3018
|
-
setErrorMap:
|
|
3019
|
-
strictObject:
|
|
3008
|
+
oboolean: Cn,
|
|
3009
|
+
onumber: En,
|
|
3010
|
+
optional: xn,
|
|
3011
|
+
ostring: Sn,
|
|
3012
|
+
pipeline: Tn,
|
|
3013
|
+
preprocess: wn,
|
|
3014
|
+
promise: bn,
|
|
3015
|
+
quotelessJson: Tt,
|
|
3016
|
+
record: ht,
|
|
3017
|
+
set: pn,
|
|
3018
|
+
setErrorMap: St,
|
|
3019
|
+
strictObject: cn,
|
|
3020
3020
|
string: g,
|
|
3021
|
-
symbol:
|
|
3021
|
+
symbol: en,
|
|
3022
3022
|
transformer: st,
|
|
3023
|
-
tuple:
|
|
3024
|
-
undefined:
|
|
3025
|
-
union:
|
|
3026
|
-
unknown:
|
|
3023
|
+
tuple: fn,
|
|
3024
|
+
undefined: tn,
|
|
3025
|
+
union: dn,
|
|
3026
|
+
unknown: rn,
|
|
3027
3027
|
get util() {
|
|
3028
3028
|
return b;
|
|
3029
3029
|
},
|
|
3030
|
-
void:
|
|
3030
|
+
void: on
|
|
3031
3031
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3032
|
-
|
|
3033
|
-
const
|
|
3032
|
+
wt(Nn);
|
|
3033
|
+
const Rn = (t, e) => e.skipDedupe || e.method !== "GET", $n = (t, e) => e.method + "@" + t, In = (t) => t.clone(), jn = ({ skip: t = Rn, key: e = $n, resolver: n = In } = {}) => {
|
|
3034
3034
|
const s = /* @__PURE__ */ new Map();
|
|
3035
3035
|
return (r) => (a, i) => {
|
|
3036
3036
|
if (t(a, i))
|
|
@@ -3050,38 +3050,38 @@ const En = (t, e) => e.skipDedupe || e.method !== "GET", An = (t, e) => e.method
|
|
|
3050
3050
|
return s.delete(o), Promise.reject(c);
|
|
3051
3051
|
}
|
|
3052
3052
|
};
|
|
3053
|
-
},
|
|
3053
|
+
}, Zn = (t, e) => t * e, Dn = (t) => t && (t.ok || t.status >= 400 && t.status < 500), Ln = ({ delayTimer: t = 500, delayRamp: e = Zn, maxAttempts: n = 10, until: s = Dn, onRetry: r = null, retryOnNetworkError: a = !1, resolveWithLatestResponse: i = !1, skip: o } = {}) => (c) => (d, h) => {
|
|
3054
3054
|
let x = 0;
|
|
3055
3055
|
if (o && o(d, h))
|
|
3056
3056
|
return c(d, h);
|
|
3057
|
-
const
|
|
3057
|
+
const S = (w, O) => Promise.resolve(s(w, O)).then((Y) => Y ? w && i ? w : O ? Promise.reject(O) : w : (x++, !n || x <= n ? new Promise((k) => {
|
|
3058
3058
|
const V = e(t, x);
|
|
3059
3059
|
setTimeout(() => {
|
|
3060
3060
|
typeof r == "function" ? Promise.resolve(r({
|
|
3061
3061
|
response: w,
|
|
3062
|
-
error:
|
|
3062
|
+
error: O,
|
|
3063
3063
|
url: d,
|
|
3064
3064
|
attempt: x,
|
|
3065
3065
|
options: h
|
|
3066
|
-
})).then((
|
|
3067
|
-
var
|
|
3068
|
-
|
|
3069
|
-
}) :
|
|
3066
|
+
})).then((A = {}) => {
|
|
3067
|
+
var D, K;
|
|
3068
|
+
k(c((D = A && A.url) !== null && D !== void 0 ? D : d, (K = A && A.options) !== null && K !== void 0 ? K : h));
|
|
3069
|
+
}) : k(c(d, h));
|
|
3070
3070
|
}, V);
|
|
3071
|
-
}).then(
|
|
3071
|
+
}).then(S).catch((k) => {
|
|
3072
3072
|
if (!a)
|
|
3073
|
-
throw
|
|
3074
|
-
return
|
|
3075
|
-
}) : w && i ? w : Promise.reject(
|
|
3076
|
-
return c(d, h).then(
|
|
3073
|
+
throw k;
|
|
3074
|
+
return S(null, k);
|
|
3075
|
+
}) : w && i ? w : Promise.reject(O || new Error("Number of attempts exceeded."))));
|
|
3076
|
+
return c(d, h).then(S).catch((w) => {
|
|
3077
3077
|
if (!a)
|
|
3078
3078
|
throw w;
|
|
3079
|
-
return
|
|
3079
|
+
return S(null, w);
|
|
3080
3080
|
});
|
|
3081
|
-
},
|
|
3081
|
+
}, De = Z({
|
|
3082
3082
|
code: et(),
|
|
3083
3083
|
message: g()
|
|
3084
|
-
}),
|
|
3084
|
+
}), Mn = Z({
|
|
3085
3085
|
message: g()
|
|
3086
3086
|
}), Pn = Z({
|
|
3087
3087
|
emails: R(g()).optional(),
|
|
@@ -3089,13 +3089,13 @@ const En = (t, e) => e.skipDedupe || e.method !== "GET", An = (t, e) => e.method
|
|
|
3089
3089
|
http_url: g().optional(),
|
|
3090
3090
|
txt_name: g().optional(),
|
|
3091
3091
|
txt_value: g().optional()
|
|
3092
|
-
}),
|
|
3092
|
+
}), Vn = Z({
|
|
3093
3093
|
ciphers: R(g()).optional(),
|
|
3094
3094
|
early_hints: g().optional(),
|
|
3095
3095
|
http2: g().optional(),
|
|
3096
3096
|
min_tls_version: g().optional(),
|
|
3097
3097
|
tls_1_3: g().optional()
|
|
3098
|
-
}),
|
|
3098
|
+
}), zn = Z({
|
|
3099
3099
|
id: g(),
|
|
3100
3100
|
bundle_method: g().optional(),
|
|
3101
3101
|
certificate_authority: g(),
|
|
@@ -3107,52 +3107,52 @@ const En = (t, e) => e.skipDedupe || e.method !== "GET", An = (t, e) => e.method
|
|
|
3107
3107
|
issuer: g().optional(),
|
|
3108
3108
|
method: g(),
|
|
3109
3109
|
serial_number: g().optional(),
|
|
3110
|
-
settings:
|
|
3110
|
+
settings: Vn.optional(),
|
|
3111
3111
|
signature: g().optional(),
|
|
3112
3112
|
type: g(),
|
|
3113
3113
|
uploaded_on: g().optional(),
|
|
3114
|
-
validation_errors: R(
|
|
3114
|
+
validation_errors: R(Mn).optional(),
|
|
3115
3115
|
validation_records: R(Pn).optional(),
|
|
3116
|
-
wildcard:
|
|
3117
|
-
}),
|
|
3116
|
+
wildcard: Oe()
|
|
3117
|
+
}), Bn = Z({
|
|
3118
3118
|
name: g(),
|
|
3119
3119
|
type: g(),
|
|
3120
3120
|
value: g()
|
|
3121
|
-
}),
|
|
3121
|
+
}), Fn = Z({
|
|
3122
3122
|
http_body: g().optional(),
|
|
3123
3123
|
http_url: g().optional()
|
|
3124
|
-
}),
|
|
3124
|
+
}), pt = Z({
|
|
3125
3125
|
id: g(),
|
|
3126
|
-
ssl:
|
|
3126
|
+
ssl: zn,
|
|
3127
3127
|
hostname: g(),
|
|
3128
|
-
custom_metadata:
|
|
3128
|
+
custom_metadata: ht(g()).optional(),
|
|
3129
3129
|
custom_origin_server: g().optional(),
|
|
3130
3130
|
custom_origin_sni: g().optional(),
|
|
3131
|
-
ownership_verification:
|
|
3132
|
-
ownership_verification_http:
|
|
3131
|
+
ownership_verification: Bn.optional(),
|
|
3132
|
+
ownership_verification_http: Fn.optional(),
|
|
3133
3133
|
status: g(),
|
|
3134
3134
|
verification_errors: R(g()).optional(),
|
|
3135
3135
|
created_at: g()
|
|
3136
|
-
}),
|
|
3137
|
-
errors: R(
|
|
3138
|
-
messages: R(
|
|
3139
|
-
success:
|
|
3140
|
-
result:
|
|
3136
|
+
}), Ae = Z({
|
|
3137
|
+
errors: R(De),
|
|
3138
|
+
messages: R(De),
|
|
3139
|
+
success: Oe(),
|
|
3140
|
+
result: pt
|
|
3141
3141
|
});
|
|
3142
3142
|
Z({
|
|
3143
|
-
errors: R(
|
|
3144
|
-
messages: R(
|
|
3145
|
-
success:
|
|
3146
|
-
result: R(
|
|
3143
|
+
errors: R(De),
|
|
3144
|
+
messages: R(De),
|
|
3145
|
+
success: Oe(),
|
|
3146
|
+
result: R(pt)
|
|
3147
3147
|
});
|
|
3148
|
-
function
|
|
3149
|
-
return
|
|
3148
|
+
function se(t) {
|
|
3149
|
+
return bt(`https://api.cloudflare.com/client/v4/zones/${t.zoneId}`).headers({
|
|
3150
3150
|
"X-Auth-Email": t.authEmail,
|
|
3151
3151
|
"X-Auth-Key": t.authKey,
|
|
3152
3152
|
"Content-Type": "application/json"
|
|
3153
|
-
}).middlewares([
|
|
3153
|
+
}).middlewares([Ln(), jn()]);
|
|
3154
3154
|
}
|
|
3155
|
-
function
|
|
3155
|
+
function We(t) {
|
|
3156
3156
|
const e = [];
|
|
3157
3157
|
if (t.ssl.validation_records)
|
|
3158
3158
|
for (const n of t.ssl.validation_records)
|
|
@@ -3172,15 +3172,15 @@ function Ue(t) {
|
|
|
3172
3172
|
status: t.status === "active" ? "ready" : "pending",
|
|
3173
3173
|
type: "auth0_managed_certs",
|
|
3174
3174
|
verification: {
|
|
3175
|
-
methods: R(
|
|
3175
|
+
methods: R(vt).parse(e)
|
|
3176
3176
|
}
|
|
3177
3177
|
};
|
|
3178
3178
|
}
|
|
3179
|
-
function
|
|
3179
|
+
function Un(t) {
|
|
3180
3180
|
return {
|
|
3181
3181
|
create: async (e, n) => {
|
|
3182
|
-
const { result: s, errors: r, success: a } =
|
|
3183
|
-
await
|
|
3182
|
+
const { result: s, errors: r, success: a } = Ae.parse(
|
|
3183
|
+
await se(t).post(
|
|
3184
3184
|
{
|
|
3185
3185
|
hostname: n.domain,
|
|
3186
3186
|
ssl: {
|
|
@@ -3196,7 +3196,7 @@ function zn(t) {
|
|
|
3196
3196
|
);
|
|
3197
3197
|
if (!a)
|
|
3198
3198
|
throw new Error(JSON.stringify(r));
|
|
3199
|
-
const i =
|
|
3199
|
+
const i = We({
|
|
3200
3200
|
...s,
|
|
3201
3201
|
primary: !1
|
|
3202
3202
|
});
|
|
@@ -3212,15 +3212,15 @@ function zn(t) {
|
|
|
3212
3212
|
n
|
|
3213
3213
|
);
|
|
3214
3214
|
if (!s)
|
|
3215
|
-
throw new
|
|
3216
|
-
const r = await
|
|
3215
|
+
throw new fe(404);
|
|
3216
|
+
const r = await se(t).get(`/custom_hostnames/${encodeURIComponent(n)}`).json(), { result: a, errors: i, success: o } = Ae.parse(r);
|
|
3217
3217
|
if (!o)
|
|
3218
|
-
throw new
|
|
3218
|
+
throw new fe(503, {
|
|
3219
3219
|
message: JSON.stringify(i)
|
|
3220
3220
|
});
|
|
3221
3221
|
if (t.enterprise && a.custom_metadata?.tenant_id !== e)
|
|
3222
|
-
throw new
|
|
3223
|
-
return
|
|
3222
|
+
throw new fe(404);
|
|
3223
|
+
return We({ ...s, ...a });
|
|
3224
3224
|
},
|
|
3225
3225
|
getByDomain: async (e) => t.customDomainAdapter.getByDomain(e),
|
|
3226
3226
|
list: async (e) => {
|
|
@@ -3228,10 +3228,10 @@ function zn(t) {
|
|
|
3228
3228
|
return (await Promise.all(
|
|
3229
3229
|
n.map(async (r) => {
|
|
3230
3230
|
try {
|
|
3231
|
-
const a = await
|
|
3231
|
+
const a = await se(t).get(
|
|
3232
3232
|
`/custom_hostnames/${encodeURIComponent(r.custom_domain_id)}`
|
|
3233
|
-
).json(), { result: i, success: o } =
|
|
3234
|
-
return !o || t.enterprise && i.custom_metadata?.tenant_id !== e ? null :
|
|
3233
|
+
).json(), { result: i, success: o } = Ae.parse(a);
|
|
3234
|
+
return !o || t.enterprise && i.custom_metadata?.tenant_id !== e ? null : We({
|
|
3235
3235
|
...r,
|
|
3236
3236
|
...i
|
|
3237
3237
|
});
|
|
@@ -3243,22 +3243,22 @@ function zn(t) {
|
|
|
3243
3243
|
},
|
|
3244
3244
|
remove: async (e, n) => {
|
|
3245
3245
|
if (t.enterprise) {
|
|
3246
|
-
const { result: r, success: a } =
|
|
3247
|
-
await
|
|
3246
|
+
const { result: r, success: a } = Ae.parse(
|
|
3247
|
+
await se(t).get(`/custom_hostnames/${encodeURIComponent(n)}`).json()
|
|
3248
3248
|
);
|
|
3249
3249
|
if (!a || r.custom_metadata?.tenant_id !== e)
|
|
3250
|
-
throw new
|
|
3250
|
+
throw new fe(404);
|
|
3251
3251
|
}
|
|
3252
|
-
const s = await
|
|
3252
|
+
const s = await se(t).delete(`/custom_hostnames/${encodeURIComponent(n)}`).res();
|
|
3253
3253
|
return s.ok && await t.customDomainAdapter.remove(e, n), s.ok;
|
|
3254
3254
|
},
|
|
3255
3255
|
update: async (e, n, s) => {
|
|
3256
|
-
const r = await
|
|
3256
|
+
const r = await se(t).patch(
|
|
3257
3257
|
s,
|
|
3258
3258
|
`/custom_hostnames/${encodeURIComponent(n)}`
|
|
3259
3259
|
).res();
|
|
3260
3260
|
if (!r.ok)
|
|
3261
|
-
throw new
|
|
3261
|
+
throw new fe(503, {
|
|
3262
3262
|
message: await r.text()
|
|
3263
3263
|
});
|
|
3264
3264
|
return t.customDomainAdapter.update(
|
|
@@ -3269,7 +3269,7 @@ function zn(t) {
|
|
|
3269
3269
|
}
|
|
3270
3270
|
};
|
|
3271
3271
|
}
|
|
3272
|
-
class
|
|
3272
|
+
class qn {
|
|
3273
3273
|
constructor(e) {
|
|
3274
3274
|
this.config = e;
|
|
3275
3275
|
}
|
|
@@ -3332,7 +3332,7 @@ class Bn {
|
|
|
3332
3332
|
);
|
|
3333
3333
|
}
|
|
3334
3334
|
}
|
|
3335
|
-
function
|
|
3335
|
+
function Wn(t = {}) {
|
|
3336
3336
|
const e = {
|
|
3337
3337
|
defaultTtlSeconds: 300,
|
|
3338
3338
|
// 5 minutes default
|
|
@@ -3341,16 +3341,16 @@ function Fn(t = {}) {
|
|
|
3341
3341
|
...t
|
|
3342
3342
|
// user config overrides defaults
|
|
3343
3343
|
};
|
|
3344
|
-
return new
|
|
3344
|
+
return new qn(e);
|
|
3345
3345
|
}
|
|
3346
|
-
const
|
|
3347
|
-
let
|
|
3346
|
+
const Hn = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
3347
|
+
let mt = (t = 21) => {
|
|
3348
3348
|
let e = "", n = crypto.getRandomValues(new Uint8Array(t |= 0));
|
|
3349
3349
|
for (; t--; )
|
|
3350
|
-
e +=
|
|
3350
|
+
e += Hn[n[t] & 63];
|
|
3351
3351
|
return e;
|
|
3352
3352
|
};
|
|
3353
|
-
async function
|
|
3353
|
+
async function Ke(t, e) {
|
|
3354
3354
|
const n = t.timeout || 3e4, s = new AbortController(), r = setTimeout(() => s.abort(), n);
|
|
3355
3355
|
try {
|
|
3356
3356
|
const a = `https://api.sql.cloudflarestorage.com/api/v1/accounts/${t.accountId}/r2-sql/query/${t.warehouseName}`, i = await fetch(a, {
|
|
@@ -3377,13 +3377,13 @@ async function Ye(t, e) {
|
|
|
3377
3377
|
clearTimeout(r);
|
|
3378
3378
|
}
|
|
3379
3379
|
}
|
|
3380
|
-
function
|
|
3380
|
+
function Le(t) {
|
|
3381
3381
|
return `'${t.replace(/'/g, "''")}'`;
|
|
3382
3382
|
}
|
|
3383
3383
|
function q(t) {
|
|
3384
3384
|
return `"${t.replace(/"/g, '""')}"`;
|
|
3385
3385
|
}
|
|
3386
|
-
function
|
|
3386
|
+
function yt(t) {
|
|
3387
3387
|
const e = (n) => {
|
|
3388
3388
|
if (!n)
|
|
3389
3389
|
return "";
|
|
@@ -3425,16 +3425,16 @@ function ht(t) {
|
|
|
3425
3425
|
} : void 0
|
|
3426
3426
|
};
|
|
3427
3427
|
}
|
|
3428
|
-
function
|
|
3428
|
+
function Qn(t) {
|
|
3429
3429
|
return async (e, n) => {
|
|
3430
|
-
const s = n.log_id ||
|
|
3430
|
+
const s = n.log_id || mt(), r = {
|
|
3431
3431
|
...n,
|
|
3432
3432
|
log_id: s
|
|
3433
3433
|
};
|
|
3434
|
-
return await
|
|
3434
|
+
return await Jn(t, e, r), r;
|
|
3435
3435
|
};
|
|
3436
3436
|
}
|
|
3437
|
-
async function
|
|
3437
|
+
async function Jn(t, e, n) {
|
|
3438
3438
|
const s = (a) => a ? JSON.stringify(a) : void 0, r = {
|
|
3439
3439
|
id: n.log_id,
|
|
3440
3440
|
tenant_id: e,
|
|
@@ -3496,58 +3496,58 @@ async function Wn(t, e, n) {
|
|
|
3496
3496
|
throw console.error("Failed to send log to Pipeline:", a), a;
|
|
3497
3497
|
}
|
|
3498
3498
|
}
|
|
3499
|
-
function
|
|
3499
|
+
function Yn(t) {
|
|
3500
3500
|
return async (e, n) => {
|
|
3501
3501
|
const s = t.namespace || "default", r = t.tableName || "logs", a = `
|
|
3502
3502
|
SELECT * FROM ${q(s)}.${q(r)}
|
|
3503
|
-
WHERE tenant_id = ${
|
|
3504
|
-
AND id = ${
|
|
3503
|
+
WHERE tenant_id = ${Le(e)}
|
|
3504
|
+
AND id = ${Le(n)}
|
|
3505
3505
|
LIMIT 1
|
|
3506
|
-
`, i = await
|
|
3506
|
+
`, i = await Ke(t, a);
|
|
3507
3507
|
if (i.length === 0)
|
|
3508
3508
|
return null;
|
|
3509
3509
|
const o = i[0];
|
|
3510
|
-
return o ?
|
|
3510
|
+
return o ? yt(o) : null;
|
|
3511
3511
|
};
|
|
3512
3512
|
}
|
|
3513
|
-
function
|
|
3513
|
+
function Kn(t) {
|
|
3514
3514
|
const e = {};
|
|
3515
3515
|
return (t.match(/(\w+):(\S+)/g) || []).forEach((s) => {
|
|
3516
3516
|
const [r, a] = s.split(":");
|
|
3517
3517
|
r && a && (e[r] = a);
|
|
3518
3518
|
}), e;
|
|
3519
3519
|
}
|
|
3520
|
-
function
|
|
3520
|
+
function Gn(t) {
|
|
3521
3521
|
const e = [];
|
|
3522
3522
|
for (const [n, s] of Object.entries(t)) {
|
|
3523
3523
|
const r = n.replace(/[^a-zA-Z0-9_]/g, "");
|
|
3524
3524
|
r && s && e.push(
|
|
3525
|
-
`${q(r)} = ${
|
|
3525
|
+
`${q(r)} = ${Le(s)}`
|
|
3526
3526
|
);
|
|
3527
3527
|
}
|
|
3528
3528
|
return e;
|
|
3529
3529
|
}
|
|
3530
|
-
function
|
|
3530
|
+
function Xn(t) {
|
|
3531
3531
|
return async (e, n = {}) => {
|
|
3532
3532
|
const { page: s = 0, per_page: r = 50, include_totals: a = !1, sort: i, q: o } = n, c = t.namespace || "default", d = t.tableName || "logs", h = [
|
|
3533
|
-
`tenant_id = ${
|
|
3533
|
+
`tenant_id = ${Le(e)}`
|
|
3534
3534
|
];
|
|
3535
3535
|
if (o) {
|
|
3536
|
-
const
|
|
3537
|
-
h.push(...
|
|
3536
|
+
const G = Kn(o);
|
|
3537
|
+
h.push(...Gn(G));
|
|
3538
3538
|
}
|
|
3539
3539
|
const x = h.join(" AND ");
|
|
3540
|
-
let
|
|
3540
|
+
let S = "ORDER BY date DESC";
|
|
3541
3541
|
if (i && i.sort_by) {
|
|
3542
|
-
const
|
|
3543
|
-
|
|
3542
|
+
const G = i.sort_by.replace(/[^a-zA-Z0-9_]/g, ""), ue = i.sort_order === "asc" ? "ASC" : "DESC";
|
|
3543
|
+
S = `ORDER BY ${q(G)} ${ue}`;
|
|
3544
3544
|
}
|
|
3545
|
-
const w = s * r,
|
|
3545
|
+
const w = s * r, O = `LIMIT ${r} OFFSET ${w}`, Y = `
|
|
3546
3546
|
SELECT * FROM ${q(c)}.${q(d)}
|
|
3547
3547
|
WHERE ${x}
|
|
3548
|
-
${
|
|
3549
|
-
${
|
|
3550
|
-
`, V = (await
|
|
3548
|
+
${S}
|
|
3549
|
+
${O}
|
|
3550
|
+
`, V = (await Ke(t, Y)).map(yt);
|
|
3551
3551
|
if (!a)
|
|
3552
3552
|
return {
|
|
3553
3553
|
logs: V,
|
|
@@ -3555,19 +3555,33 @@ function Yn(t) {
|
|
|
3555
3555
|
limit: 0,
|
|
3556
3556
|
length: 0
|
|
3557
3557
|
};
|
|
3558
|
-
const
|
|
3558
|
+
const A = `
|
|
3559
3559
|
SELECT COUNT(*) as count FROM ${q(c)}.${q(d)}
|
|
3560
3560
|
WHERE ${x}
|
|
3561
|
-
`,
|
|
3561
|
+
`, K = (await Ke(t, A))[0]?.count || 0;
|
|
3562
3562
|
return {
|
|
3563
3563
|
logs: V,
|
|
3564
3564
|
start: w,
|
|
3565
3565
|
limit: r,
|
|
3566
|
-
length: Number(
|
|
3566
|
+
length: Number(K)
|
|
3567
3567
|
};
|
|
3568
3568
|
};
|
|
3569
3569
|
}
|
|
3570
|
-
function
|
|
3570
|
+
function hs() {
|
|
3571
|
+
return {
|
|
3572
|
+
async getDaily() {
|
|
3573
|
+
throw new Error(
|
|
3574
|
+
"Stats queries are not supported by R2 SQL logs adapter. Use Analytics Engine or Kysely adapter instead."
|
|
3575
|
+
);
|
|
3576
|
+
},
|
|
3577
|
+
async getActiveUsers() {
|
|
3578
|
+
throw new Error(
|
|
3579
|
+
"Stats queries are not supported by R2 SQL logs adapter. Use Analytics Engine or Kysely adapter instead."
|
|
3580
|
+
);
|
|
3581
|
+
}
|
|
3582
|
+
};
|
|
3583
|
+
}
|
|
3584
|
+
function es(t) {
|
|
3571
3585
|
const e = !!t.pipelineEndpoint, n = !!t.pipelineBinding;
|
|
3572
3586
|
if (!e && !n)
|
|
3573
3587
|
throw new Error(
|
|
@@ -3580,12 +3594,12 @@ function Gn(t) {
|
|
|
3580
3594
|
'R2 SQL logs adapter requires "warehouseName" configuration'
|
|
3581
3595
|
);
|
|
3582
3596
|
return {
|
|
3583
|
-
create:
|
|
3584
|
-
list:
|
|
3585
|
-
get:
|
|
3597
|
+
create: Qn(t),
|
|
3598
|
+
list: Xn(t),
|
|
3599
|
+
get: Yn(t)
|
|
3586
3600
|
};
|
|
3587
3601
|
}
|
|
3588
|
-
async function
|
|
3602
|
+
async function Ee(t, e) {
|
|
3589
3603
|
const n = t.timeout || 3e4, s = new AbortController(), r = setTimeout(() => s.abort(), n);
|
|
3590
3604
|
try {
|
|
3591
3605
|
const a = `https://api.cloudflare.com/client/v4/accounts/${t.accountId}/analytics_engine/sql`, i = await fetch(a, {
|
|
@@ -3613,13 +3627,13 @@ async function Ge(t, e) {
|
|
|
3613
3627
|
clearTimeout(r);
|
|
3614
3628
|
}
|
|
3615
3629
|
}
|
|
3616
|
-
function
|
|
3630
|
+
function F(t) {
|
|
3617
3631
|
return `'${t.replace(/'/g, "''").replace(/\\/g, "\\\\")}'`;
|
|
3618
3632
|
}
|
|
3619
|
-
function
|
|
3633
|
+
function Ge(t) {
|
|
3620
3634
|
return `"${t.replace(/"/g, '""')}"`;
|
|
3621
3635
|
}
|
|
3622
|
-
function
|
|
3636
|
+
function _t(t) {
|
|
3623
3637
|
const e = (r) => {
|
|
3624
3638
|
if (r)
|
|
3625
3639
|
try {
|
|
@@ -3652,16 +3666,16 @@ function pt(t) {
|
|
|
3652
3666
|
isMobile: t.double1 === 1
|
|
3653
3667
|
};
|
|
3654
3668
|
}
|
|
3655
|
-
function
|
|
3669
|
+
function ts(t) {
|
|
3656
3670
|
return async (e, n) => {
|
|
3657
|
-
const s = n.log_id ||
|
|
3671
|
+
const s = n.log_id || mt(), r = {
|
|
3658
3672
|
...n,
|
|
3659
3673
|
log_id: s
|
|
3660
3674
|
};
|
|
3661
|
-
return
|
|
3675
|
+
return ns(t, e, r), r;
|
|
3662
3676
|
};
|
|
3663
3677
|
}
|
|
3664
|
-
function
|
|
3678
|
+
function ns(t, e, n) {
|
|
3665
3679
|
if (!t.analyticsEngineBinding) {
|
|
3666
3680
|
console.error("Analytics Engine binding not configured");
|
|
3667
3681
|
return;
|
|
@@ -3724,26 +3738,26 @@ function Xn(t, e, n) {
|
|
|
3724
3738
|
console.error("Failed to write log to Analytics Engine:", a);
|
|
3725
3739
|
}
|
|
3726
3740
|
}
|
|
3727
|
-
function
|
|
3741
|
+
function ss(t) {
|
|
3728
3742
|
return async (e, n) => {
|
|
3729
3743
|
const s = t.dataset || "authhero_logs", r = `
|
|
3730
3744
|
SELECT *
|
|
3731
|
-
FROM ${
|
|
3732
|
-
WHERE index1 = ${
|
|
3733
|
-
AND blob1 = ${
|
|
3745
|
+
FROM ${Ge(s)}
|
|
3746
|
+
WHERE index1 = ${F(e)}
|
|
3747
|
+
AND blob1 = ${F(n)}
|
|
3734
3748
|
LIMIT 1
|
|
3735
|
-
`, a = await
|
|
3736
|
-
return a.length === 0 || !a[0] ? null :
|
|
3749
|
+
`, a = await Ee(t, r);
|
|
3750
|
+
return a.length === 0 || !a[0] ? null : _t(a[0]);
|
|
3737
3751
|
};
|
|
3738
3752
|
}
|
|
3739
|
-
function
|
|
3753
|
+
function rs(t) {
|
|
3740
3754
|
const e = {};
|
|
3741
3755
|
return (t.match(/(\w+):(\S+)/g) || []).forEach((s) => {
|
|
3742
3756
|
const r = s.indexOf(":"), a = s.substring(0, r), i = s.substring(r + 1);
|
|
3743
3757
|
a && i && (e[a] = i);
|
|
3744
3758
|
}), e;
|
|
3745
3759
|
}
|
|
3746
|
-
function
|
|
3760
|
+
function gt(t) {
|
|
3747
3761
|
return {
|
|
3748
3762
|
log_id: "blob1",
|
|
3749
3763
|
tenant_id: "blob2",
|
|
@@ -3764,82 +3778,154 @@ function mt(t) {
|
|
|
3764
3778
|
hostname: "blob17"
|
|
3765
3779
|
}[t] || null;
|
|
3766
3780
|
}
|
|
3767
|
-
function
|
|
3781
|
+
function as(t) {
|
|
3768
3782
|
const e = [];
|
|
3769
3783
|
for (const [n, s] of Object.entries(t)) {
|
|
3770
|
-
const r =
|
|
3771
|
-
r && s && e.push(`${r} = ${
|
|
3784
|
+
const r = gt(n);
|
|
3785
|
+
r && s && e.push(`${r} = ${F(s)}`);
|
|
3772
3786
|
}
|
|
3773
3787
|
return e;
|
|
3774
3788
|
}
|
|
3775
|
-
function
|
|
3789
|
+
function is(t) {
|
|
3776
3790
|
if (t === "date")
|
|
3777
3791
|
return "double2";
|
|
3778
|
-
const e =
|
|
3792
|
+
const e = gt(t);
|
|
3779
3793
|
return e || "timestamp";
|
|
3780
3794
|
}
|
|
3781
|
-
function
|
|
3795
|
+
function os(t) {
|
|
3782
3796
|
return async (e, n = {}) => {
|
|
3783
|
-
const { page: s = 0, per_page: r = 50, include_totals: a = !1, sort: i, q: o } = n, c = t.dataset || "authhero_logs", d = [`index1 = ${
|
|
3797
|
+
const { page: s = 0, per_page: r = 50, include_totals: a = !1, sort: i, q: o } = n, c = t.dataset || "authhero_logs", d = [`index1 = ${F(e)}`];
|
|
3784
3798
|
if (o) {
|
|
3785
|
-
const
|
|
3786
|
-
d.push(...
|
|
3799
|
+
const A = rs(o);
|
|
3800
|
+
d.push(...as(A));
|
|
3787
3801
|
}
|
|
3788
3802
|
const h = d.join(" AND ");
|
|
3789
3803
|
let x = "ORDER BY timestamp DESC";
|
|
3790
3804
|
if (i && i.sort_by) {
|
|
3791
|
-
const
|
|
3792
|
-
x = `ORDER BY ${
|
|
3805
|
+
const A = is(i.sort_by), D = i.sort_order === "asc" ? "ASC" : "DESC";
|
|
3806
|
+
x = `ORDER BY ${A} ${D}`;
|
|
3793
3807
|
}
|
|
3794
|
-
const
|
|
3808
|
+
const S = s * r, w = `LIMIT ${r} OFFSET ${S}`, O = `
|
|
3795
3809
|
SELECT *
|
|
3796
|
-
FROM ${
|
|
3810
|
+
FROM ${Ge(c)}
|
|
3797
3811
|
WHERE ${h}
|
|
3798
3812
|
${x}
|
|
3799
3813
|
${w}
|
|
3800
|
-
`,
|
|
3814
|
+
`, k = (await Ee(t, O)).map(_t);
|
|
3801
3815
|
if (!a)
|
|
3802
3816
|
return {
|
|
3803
|
-
logs:
|
|
3817
|
+
logs: k,
|
|
3804
3818
|
start: 0,
|
|
3805
3819
|
limit: 0,
|
|
3806
3820
|
length: 0
|
|
3807
3821
|
};
|
|
3808
3822
|
const V = `
|
|
3809
3823
|
SELECT count() as count
|
|
3810
|
-
FROM ${
|
|
3824
|
+
FROM ${Ge(c)}
|
|
3811
3825
|
WHERE ${h}
|
|
3812
3826
|
`;
|
|
3813
3827
|
try {
|
|
3814
|
-
const
|
|
3828
|
+
const D = (await Ee(t, V))[0]?.count || 0;
|
|
3815
3829
|
return {
|
|
3816
|
-
logs:
|
|
3817
|
-
start:
|
|
3830
|
+
logs: k,
|
|
3831
|
+
start: S,
|
|
3818
3832
|
limit: r,
|
|
3819
|
-
length: Number(
|
|
3833
|
+
length: Number(D)
|
|
3820
3834
|
};
|
|
3821
3835
|
} catch {
|
|
3822
3836
|
return {
|
|
3823
|
-
logs:
|
|
3824
|
-
start:
|
|
3837
|
+
logs: k,
|
|
3838
|
+
start: S,
|
|
3825
3839
|
limit: r,
|
|
3826
|
-
length:
|
|
3840
|
+
length: k.length
|
|
3827
3841
|
};
|
|
3828
3842
|
}
|
|
3829
3843
|
};
|
|
3830
3844
|
}
|
|
3831
|
-
|
|
3845
|
+
const rt = [
|
|
3846
|
+
"s",
|
|
3847
|
+
// SUCCESS_LOGIN
|
|
3848
|
+
"seacft",
|
|
3849
|
+
// SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN
|
|
3850
|
+
"seccft",
|
|
3851
|
+
// SUCCESS_EXCHANGE_CLIENT_CREDENTIALS_FOR_ACCESS_TOKEN
|
|
3852
|
+
"sepft",
|
|
3853
|
+
// SUCCESS_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN
|
|
3854
|
+
"sertft",
|
|
3855
|
+
// SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN
|
|
3856
|
+
"ssa"
|
|
3857
|
+
// SUCCESS_SILENT_AUTH
|
|
3858
|
+
], cs = [
|
|
3859
|
+
"pwd_leak",
|
|
3860
|
+
"signup_pwd_leak",
|
|
3861
|
+
"reset_pwd_leak"
|
|
3862
|
+
];
|
|
3863
|
+
function at(t) {
|
|
3864
|
+
return `${t.slice(0, 4)}-${t.slice(4, 6)}-${t.slice(6, 8)}`;
|
|
3865
|
+
}
|
|
3866
|
+
function it(t) {
|
|
3867
|
+
return t.toISOString().split("T")[0];
|
|
3868
|
+
}
|
|
3869
|
+
function ps(t) {
|
|
3870
|
+
const e = t.dataset || "authhero_logs";
|
|
3871
|
+
return {
|
|
3872
|
+
async getDaily(n, s = {}) {
|
|
3873
|
+
const { from: r, to: a } = s, i = /* @__PURE__ */ new Date(), o = new Date(i);
|
|
3874
|
+
o.setDate(o.getDate() - 30);
|
|
3875
|
+
const c = r ? at(r) : it(o), d = a ? at(a) : it(i), h = (/* @__PURE__ */ new Date(`${c}T00:00:00Z`)).getTime(), x = (/* @__PURE__ */ new Date(`${d}T23:59:59.999Z`)).getTime(), S = rt.map((k) => F(k)).join(", "), w = cs.map(
|
|
3876
|
+
(k) => F(k)
|
|
3877
|
+
).join(", "), O = `
|
|
3878
|
+
SELECT
|
|
3879
|
+
toDate(toDateTime(double2 / 1000)) AS date,
|
|
3880
|
+
SUM(CASE WHEN blob3 IN (${S}) THEN 1 ELSE 0 END) AS logins,
|
|
3881
|
+
SUM(CASE WHEN blob3 = 'ss' THEN 1 ELSE 0 END) AS signups,
|
|
3882
|
+
SUM(CASE WHEN blob3 IN (${w}) THEN 1 ELSE 0 END) AS leaked_passwords,
|
|
3883
|
+
MIN(double2) AS first_event,
|
|
3884
|
+
MAX(double2) AS last_event
|
|
3885
|
+
FROM "${e}"
|
|
3886
|
+
WHERE index1 = ${F(n)}
|
|
3887
|
+
AND double2 >= ${h}
|
|
3888
|
+
AND double2 <= ${x}
|
|
3889
|
+
GROUP BY date
|
|
3890
|
+
ORDER BY date ASC
|
|
3891
|
+
`;
|
|
3892
|
+
return (await Ee(t, O)).map((k) => ({
|
|
3893
|
+
date: String(k.date),
|
|
3894
|
+
logins: Number(k.logins) || 0,
|
|
3895
|
+
signups: Number(k.signups) || 0,
|
|
3896
|
+
leaked_passwords: Number(k.leaked_passwords) || 0,
|
|
3897
|
+
created_at: k.first_event ? new Date(Number(k.first_event)).toISOString() : (/* @__PURE__ */ new Date()).toISOString(),
|
|
3898
|
+
updated_at: k.last_event ? new Date(Number(k.last_event)).toISOString() : (/* @__PURE__ */ new Date()).toISOString()
|
|
3899
|
+
}));
|
|
3900
|
+
},
|
|
3901
|
+
async getActiveUsers(n) {
|
|
3902
|
+
const s = /* @__PURE__ */ new Date();
|
|
3903
|
+
s.setDate(s.getDate() - 30);
|
|
3904
|
+
const r = s.getTime(), a = rt.map((d) => F(d)).join(", "), i = `
|
|
3905
|
+
SELECT COUNT(DISTINCT blob7) AS count
|
|
3906
|
+
FROM "${e}"
|
|
3907
|
+
WHERE index1 = ${F(n)}
|
|
3908
|
+
AND double2 >= ${r}
|
|
3909
|
+
AND blob3 IN (${a})
|
|
3910
|
+
AND blob7 IS NOT NULL
|
|
3911
|
+
AND blob7 != ''
|
|
3912
|
+
`, c = (await Ee(t, i))[0];
|
|
3913
|
+
return c && c.count !== void 0 && Number(c.count) || 0;
|
|
3914
|
+
}
|
|
3915
|
+
};
|
|
3916
|
+
}
|
|
3917
|
+
function ds(t) {
|
|
3832
3918
|
return t.analyticsEngineBinding || console.warn(
|
|
3833
3919
|
"Analytics Engine: No binding configured. Logs will not be written to Analytics Engine."
|
|
3834
3920
|
), (!t.accountId || !t.apiToken) && console.warn(
|
|
3835
3921
|
"Analytics Engine: accountId and apiToken are required for querying logs via SQL API."
|
|
3836
3922
|
), {
|
|
3837
|
-
create:
|
|
3838
|
-
list:
|
|
3839
|
-
get:
|
|
3923
|
+
create: ts(t),
|
|
3924
|
+
list: os(t),
|
|
3925
|
+
get: ss(t)
|
|
3840
3926
|
};
|
|
3841
3927
|
}
|
|
3842
|
-
function
|
|
3928
|
+
function us() {
|
|
3843
3929
|
return {
|
|
3844
3930
|
async getGeoInfo(t) {
|
|
3845
3931
|
try {
|
|
@@ -3858,11 +3944,11 @@ function is() {
|
|
|
3858
3944
|
}
|
|
3859
3945
|
};
|
|
3860
3946
|
}
|
|
3861
|
-
function
|
|
3947
|
+
function ms(t) {
|
|
3862
3948
|
const e = {
|
|
3863
|
-
customDomains:
|
|
3949
|
+
customDomains: Un(t),
|
|
3864
3950
|
// Always create a cache adapter (let createCloudflareCache apply defaults)
|
|
3865
|
-
cache:
|
|
3951
|
+
cache: Wn({
|
|
3866
3952
|
...t.cacheName && { cacheName: t.cacheName },
|
|
3867
3953
|
...t.defaultTtlSeconds !== void 0 && {
|
|
3868
3954
|
defaultTtlSeconds: t.defaultTtlSeconds
|
|
@@ -3871,14 +3957,16 @@ function ds(t) {
|
|
|
3871
3957
|
}),
|
|
3872
3958
|
// Always create the geo adapter - it extracts location from Cloudflare headers
|
|
3873
3959
|
// passed at request time via getGeoInfo(headers)
|
|
3874
|
-
geo:
|
|
3960
|
+
geo: us()
|
|
3875
3961
|
};
|
|
3876
|
-
return t.r2SqlLogs ? e.logs =
|
|
3962
|
+
return t.r2SqlLogs ? e.logs = es(t.r2SqlLogs) : t.analyticsEngineLogs && (e.logs = ds(
|
|
3877
3963
|
t.analyticsEngineLogs
|
|
3878
3964
|
)), e;
|
|
3879
3965
|
}
|
|
3880
3966
|
export {
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3967
|
+
ds as createAnalyticsEngineLogsAdapter,
|
|
3968
|
+
ps as createAnalyticsEngineStatsAdapter,
|
|
3969
|
+
es as createR2SQLLogsAdapter,
|
|
3970
|
+
hs as createR2SQLStatsAdapter,
|
|
3971
|
+
ms as default
|
|
3884
3972
|
};
|