@esposter/shared 2.15.0 → 2.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +33 -224
- package/dist/index.js +115 -1552
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,20 +1,41 @@
|
|
|
1
|
-
//#region src/models/
|
|
2
|
-
let
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
BinaryOperator$1["lt"] = "lt";
|
|
8
|
-
BinaryOperator$1["ne"] = "ne";
|
|
9
|
-
return BinaryOperator$1;
|
|
1
|
+
//#region src/models/environment/Environment.ts
|
|
2
|
+
let Environment = /* @__PURE__ */ function(Environment$2) {
|
|
3
|
+
Environment$2["development"] = "development";
|
|
4
|
+
Environment$2["production"] = "production";
|
|
5
|
+
Environment$2["test"] = "test";
|
|
6
|
+
return Environment$2;
|
|
10
7
|
}({});
|
|
11
8
|
|
|
12
9
|
//#endregion
|
|
13
|
-
//#region src/models/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
//#region src/models/error/InvalidOperationError.ts
|
|
11
|
+
var InvalidOperationError = class extends Error {
|
|
12
|
+
constructor(operation, name, message) {
|
|
13
|
+
super(`Invalid operation: ${operation}, name: ${name}, ${message}`);
|
|
14
|
+
this.name = "InvalidOperationError";
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/models/error/NotFoundError.ts
|
|
20
|
+
var NotFoundError = class extends Error {
|
|
21
|
+
constructor(name, id) {
|
|
22
|
+
super(`${name} is not found for id: ${id}`);
|
|
23
|
+
this.name = "NotFoundError";
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/models/error/NotInitializedError.ts
|
|
29
|
+
var NotInitializedError = class extends Error {
|
|
30
|
+
constructor(name) {
|
|
31
|
+
super(`${name} is not initialized`);
|
|
32
|
+
this.name = "NotInitializedError";
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/util/object/getPropertyNames.ts
|
|
38
|
+
const getPropertyNames = () => new Proxy({}, { get: (_target, property) => property });
|
|
18
39
|
|
|
19
40
|
//#endregion
|
|
20
41
|
//#region ../../node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/core.js
|
|
@@ -99,17 +120,6 @@ function cleanRegex(source) {
|
|
|
99
120
|
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
100
121
|
return source.slice(start, end);
|
|
101
122
|
}
|
|
102
|
-
function floatSafeRemainder(val, step) {
|
|
103
|
-
const valDecCount = (val.toString().split(".")[1] || "").length;
|
|
104
|
-
const stepString = step.toString();
|
|
105
|
-
let stepDecCount = (stepString.split(".")[1] || "").length;
|
|
106
|
-
if (stepDecCount === 0 && /\d?e-\d?/.test(stepString)) {
|
|
107
|
-
const match = stepString.match(/\d?e-(\d?)/);
|
|
108
|
-
if (match?.[1]) stepDecCount = Number.parseInt(match[1]);
|
|
109
|
-
}
|
|
110
|
-
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
|
111
|
-
return Number.parseInt(val.toFixed(decCount).replace(".", "")) % Number.parseInt(step.toFixed(decCount).replace(".", "")) / 10 ** decCount;
|
|
112
|
-
}
|
|
113
123
|
const EVALUATING = Symbol("evaluating");
|
|
114
124
|
function defineLazy(object$1, key, getter) {
|
|
115
125
|
let value = void 0;
|
|
@@ -544,67 +554,6 @@ const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
544
554
|
};
|
|
545
555
|
const safeDecodeAsync$1 = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
|
|
546
556
|
|
|
547
|
-
//#endregion
|
|
548
|
-
//#region ../../node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/regexes.js
|
|
549
|
-
const cuid = /^[cC][^\s-]{8,}$/;
|
|
550
|
-
const cuid2 = /^[0-9a-z]+$/;
|
|
551
|
-
const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
|
|
552
|
-
const xid = /^[0-9a-vA-V]{20}$/;
|
|
553
|
-
const ksuid = /^[A-Za-z0-9]{27}$/;
|
|
554
|
-
const nanoid = /^[a-zA-Z0-9_-]{21}$/;
|
|
555
|
-
/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */
|
|
556
|
-
const duration$1 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
|
|
557
|
-
/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
|
|
558
|
-
const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
|
|
559
|
-
/** Returns a regex for validating an RFC 9562/4122 UUID.
|
|
560
|
-
*
|
|
561
|
-
* @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
|
|
562
|
-
const uuid$1 = (version$1) => {
|
|
563
|
-
if (!version$1) return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
|
|
564
|
-
return /* @__PURE__ */ new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version$1}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
|
|
565
|
-
};
|
|
566
|
-
/** Practical email validation */
|
|
567
|
-
const email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
568
|
-
const _emoji$1 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
|
569
|
-
function emoji() {
|
|
570
|
-
return new RegExp(_emoji$1, "u");
|
|
571
|
-
}
|
|
572
|
-
const ipv4 = /^(?:(?: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])$/;
|
|
573
|
-
const ipv6 = /^(([0-9a-fA-F]{1,4}:){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}|:))$/;
|
|
574
|
-
const cidrv4 = /^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/;
|
|
575
|
-
const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
|
576
|
-
const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
577
|
-
const base64url = /^[A-Za-z0-9_-]*$/;
|
|
578
|
-
const hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
|
|
579
|
-
const e164 = /^\+(?:[0-9]){6,14}[0-9]$/;
|
|
580
|
-
const dateSource = `(?:(?:\\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])))`;
|
|
581
|
-
const date$2 = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
|
|
582
|
-
function timeSource(args) {
|
|
583
|
-
const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
|
|
584
|
-
return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
585
|
-
}
|
|
586
|
-
function time$1(args) {
|
|
587
|
-
return /* @__PURE__ */ new RegExp(`^${timeSource(args)}$`);
|
|
588
|
-
}
|
|
589
|
-
function datetime$1(args) {
|
|
590
|
-
const time$2 = timeSource({ precision: args.precision });
|
|
591
|
-
const opts = ["Z"];
|
|
592
|
-
if (args.local) opts.push("");
|
|
593
|
-
if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
|
|
594
|
-
const timeRegex = `${time$2}(?:${opts.join("|")})`;
|
|
595
|
-
return /* @__PURE__ */ new RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
|
596
|
-
}
|
|
597
|
-
const string$1 = (params) => {
|
|
598
|
-
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
599
|
-
return /* @__PURE__ */ new RegExp(`^${regex}$`);
|
|
600
|
-
};
|
|
601
|
-
const integer = /^-?\d+$/;
|
|
602
|
-
const number$1 = /^-?\d+(?:\.\d+)?/;
|
|
603
|
-
const boolean$1 = /^(?:true|false)$/i;
|
|
604
|
-
const _null$2 = /^null$/i;
|
|
605
|
-
const lowercase = /^[^A-Z]*$/;
|
|
606
|
-
const uppercase = /^[^a-z]*$/;
|
|
607
|
-
|
|
608
557
|
//#endregion
|
|
609
558
|
//#region ../../node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/checks.js
|
|
610
559
|
const $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def$1) => {
|
|
@@ -662,92 +611,6 @@ const $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan"
|
|
|
662
611
|
});
|
|
663
612
|
};
|
|
664
613
|
});
|
|
665
|
-
const $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def$1) => {
|
|
666
|
-
$ZodCheck.init(inst, def$1);
|
|
667
|
-
inst._zod.onattach.push((inst$1) => {
|
|
668
|
-
var _a;
|
|
669
|
-
(_a = inst$1._zod.bag).multipleOf ?? (_a.multipleOf = def$1.value);
|
|
670
|
-
});
|
|
671
|
-
inst._zod.check = (payload) => {
|
|
672
|
-
if (typeof payload.value !== typeof def$1.value) throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
673
|
-
if (typeof payload.value === "bigint" ? payload.value % def$1.value === BigInt(0) : floatSafeRemainder(payload.value, def$1.value) === 0) return;
|
|
674
|
-
payload.issues.push({
|
|
675
|
-
origin: typeof payload.value,
|
|
676
|
-
code: "not_multiple_of",
|
|
677
|
-
divisor: def$1.value,
|
|
678
|
-
input: payload.value,
|
|
679
|
-
inst,
|
|
680
|
-
continue: !def$1.abort
|
|
681
|
-
});
|
|
682
|
-
};
|
|
683
|
-
});
|
|
684
|
-
const $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat", (inst, def$1) => {
|
|
685
|
-
$ZodCheck.init(inst, def$1);
|
|
686
|
-
def$1.format = def$1.format || "float64";
|
|
687
|
-
const isInt = def$1.format?.includes("int");
|
|
688
|
-
const origin = isInt ? "int" : "number";
|
|
689
|
-
const [minimum, maximum] = NUMBER_FORMAT_RANGES[def$1.format];
|
|
690
|
-
inst._zod.onattach.push((inst$1) => {
|
|
691
|
-
const bag = inst$1._zod.bag;
|
|
692
|
-
bag.format = def$1.format;
|
|
693
|
-
bag.minimum = minimum;
|
|
694
|
-
bag.maximum = maximum;
|
|
695
|
-
if (isInt) bag.pattern = integer;
|
|
696
|
-
});
|
|
697
|
-
inst._zod.check = (payload) => {
|
|
698
|
-
const input = payload.value;
|
|
699
|
-
if (isInt) {
|
|
700
|
-
if (!Number.isInteger(input)) {
|
|
701
|
-
payload.issues.push({
|
|
702
|
-
expected: origin,
|
|
703
|
-
format: def$1.format,
|
|
704
|
-
code: "invalid_type",
|
|
705
|
-
continue: false,
|
|
706
|
-
input,
|
|
707
|
-
inst
|
|
708
|
-
});
|
|
709
|
-
return;
|
|
710
|
-
}
|
|
711
|
-
if (!Number.isSafeInteger(input)) {
|
|
712
|
-
if (input > 0) payload.issues.push({
|
|
713
|
-
input,
|
|
714
|
-
code: "too_big",
|
|
715
|
-
maximum: Number.MAX_SAFE_INTEGER,
|
|
716
|
-
note: "Integers must be within the safe integer range.",
|
|
717
|
-
inst,
|
|
718
|
-
origin,
|
|
719
|
-
continue: !def$1.abort
|
|
720
|
-
});
|
|
721
|
-
else payload.issues.push({
|
|
722
|
-
input,
|
|
723
|
-
code: "too_small",
|
|
724
|
-
minimum: Number.MIN_SAFE_INTEGER,
|
|
725
|
-
note: "Integers must be within the safe integer range.",
|
|
726
|
-
inst,
|
|
727
|
-
origin,
|
|
728
|
-
continue: !def$1.abort
|
|
729
|
-
});
|
|
730
|
-
return;
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
if (input < minimum) payload.issues.push({
|
|
734
|
-
origin: "number",
|
|
735
|
-
input,
|
|
736
|
-
code: "too_small",
|
|
737
|
-
minimum,
|
|
738
|
-
inclusive: true,
|
|
739
|
-
inst,
|
|
740
|
-
continue: !def$1.abort
|
|
741
|
-
});
|
|
742
|
-
if (input > maximum) payload.issues.push({
|
|
743
|
-
origin: "number",
|
|
744
|
-
input,
|
|
745
|
-
code: "too_big",
|
|
746
|
-
maximum,
|
|
747
|
-
inst
|
|
748
|
-
});
|
|
749
|
-
};
|
|
750
|
-
});
|
|
751
614
|
const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def$1) => {
|
|
752
615
|
var _a;
|
|
753
616
|
$ZodCheck.init(inst, def$1);
|
|
@@ -836,123 +699,6 @@ const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEqual
|
|
|
836
699
|
});
|
|
837
700
|
};
|
|
838
701
|
});
|
|
839
|
-
const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def$1) => {
|
|
840
|
-
var _a, _b;
|
|
841
|
-
$ZodCheck.init(inst, def$1);
|
|
842
|
-
inst._zod.onattach.push((inst$1) => {
|
|
843
|
-
const bag = inst$1._zod.bag;
|
|
844
|
-
bag.format = def$1.format;
|
|
845
|
-
if (def$1.pattern) {
|
|
846
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
847
|
-
bag.patterns.add(def$1.pattern);
|
|
848
|
-
}
|
|
849
|
-
});
|
|
850
|
-
if (def$1.pattern) (_a = inst._zod).check ?? (_a.check = (payload) => {
|
|
851
|
-
def$1.pattern.lastIndex = 0;
|
|
852
|
-
if (def$1.pattern.test(payload.value)) return;
|
|
853
|
-
payload.issues.push({
|
|
854
|
-
origin: "string",
|
|
855
|
-
code: "invalid_format",
|
|
856
|
-
format: def$1.format,
|
|
857
|
-
input: payload.value,
|
|
858
|
-
...def$1.pattern ? { pattern: def$1.pattern.toString() } : {},
|
|
859
|
-
inst,
|
|
860
|
-
continue: !def$1.abort
|
|
861
|
-
});
|
|
862
|
-
});
|
|
863
|
-
else (_b = inst._zod).check ?? (_b.check = () => {});
|
|
864
|
-
});
|
|
865
|
-
const $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def$1) => {
|
|
866
|
-
$ZodCheckStringFormat.init(inst, def$1);
|
|
867
|
-
inst._zod.check = (payload) => {
|
|
868
|
-
def$1.pattern.lastIndex = 0;
|
|
869
|
-
if (def$1.pattern.test(payload.value)) return;
|
|
870
|
-
payload.issues.push({
|
|
871
|
-
origin: "string",
|
|
872
|
-
code: "invalid_format",
|
|
873
|
-
format: "regex",
|
|
874
|
-
input: payload.value,
|
|
875
|
-
pattern: def$1.pattern.toString(),
|
|
876
|
-
inst,
|
|
877
|
-
continue: !def$1.abort
|
|
878
|
-
});
|
|
879
|
-
};
|
|
880
|
-
});
|
|
881
|
-
const $ZodCheckLowerCase = /* @__PURE__ */ $constructor("$ZodCheckLowerCase", (inst, def$1) => {
|
|
882
|
-
def$1.pattern ?? (def$1.pattern = lowercase);
|
|
883
|
-
$ZodCheckStringFormat.init(inst, def$1);
|
|
884
|
-
});
|
|
885
|
-
const $ZodCheckUpperCase = /* @__PURE__ */ $constructor("$ZodCheckUpperCase", (inst, def$1) => {
|
|
886
|
-
def$1.pattern ?? (def$1.pattern = uppercase);
|
|
887
|
-
$ZodCheckStringFormat.init(inst, def$1);
|
|
888
|
-
});
|
|
889
|
-
const $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst, def$1) => {
|
|
890
|
-
$ZodCheck.init(inst, def$1);
|
|
891
|
-
const escapedRegex = escapeRegex(def$1.includes);
|
|
892
|
-
const pattern = new RegExp(typeof def$1.position === "number" ? `^.{${def$1.position}}${escapedRegex}` : escapedRegex);
|
|
893
|
-
def$1.pattern = pattern;
|
|
894
|
-
inst._zod.onattach.push((inst$1) => {
|
|
895
|
-
const bag = inst$1._zod.bag;
|
|
896
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
897
|
-
bag.patterns.add(pattern);
|
|
898
|
-
});
|
|
899
|
-
inst._zod.check = (payload) => {
|
|
900
|
-
if (payload.value.includes(def$1.includes, def$1.position)) return;
|
|
901
|
-
payload.issues.push({
|
|
902
|
-
origin: "string",
|
|
903
|
-
code: "invalid_format",
|
|
904
|
-
format: "includes",
|
|
905
|
-
includes: def$1.includes,
|
|
906
|
-
input: payload.value,
|
|
907
|
-
inst,
|
|
908
|
-
continue: !def$1.abort
|
|
909
|
-
});
|
|
910
|
-
};
|
|
911
|
-
});
|
|
912
|
-
const $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (inst, def$1) => {
|
|
913
|
-
$ZodCheck.init(inst, def$1);
|
|
914
|
-
const pattern = /* @__PURE__ */ new RegExp(`^${escapeRegex(def$1.prefix)}.*`);
|
|
915
|
-
def$1.pattern ?? (def$1.pattern = pattern);
|
|
916
|
-
inst._zod.onattach.push((inst$1) => {
|
|
917
|
-
const bag = inst$1._zod.bag;
|
|
918
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
919
|
-
bag.patterns.add(pattern);
|
|
920
|
-
});
|
|
921
|
-
inst._zod.check = (payload) => {
|
|
922
|
-
if (payload.value.startsWith(def$1.prefix)) return;
|
|
923
|
-
payload.issues.push({
|
|
924
|
-
origin: "string",
|
|
925
|
-
code: "invalid_format",
|
|
926
|
-
format: "starts_with",
|
|
927
|
-
prefix: def$1.prefix,
|
|
928
|
-
input: payload.value,
|
|
929
|
-
inst,
|
|
930
|
-
continue: !def$1.abort
|
|
931
|
-
});
|
|
932
|
-
};
|
|
933
|
-
});
|
|
934
|
-
const $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst, def$1) => {
|
|
935
|
-
$ZodCheck.init(inst, def$1);
|
|
936
|
-
const pattern = /* @__PURE__ */ new RegExp(`.*${escapeRegex(def$1.suffix)}$`);
|
|
937
|
-
def$1.pattern ?? (def$1.pattern = pattern);
|
|
938
|
-
inst._zod.onattach.push((inst$1) => {
|
|
939
|
-
const bag = inst$1._zod.bag;
|
|
940
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
941
|
-
bag.patterns.add(pattern);
|
|
942
|
-
});
|
|
943
|
-
inst._zod.check = (payload) => {
|
|
944
|
-
if (payload.value.endsWith(def$1.suffix)) return;
|
|
945
|
-
payload.issues.push({
|
|
946
|
-
origin: "string",
|
|
947
|
-
code: "invalid_format",
|
|
948
|
-
format: "ends_with",
|
|
949
|
-
suffix: def$1.suffix,
|
|
950
|
-
input: payload.value,
|
|
951
|
-
inst,
|
|
952
|
-
continue: !def$1.abort
|
|
953
|
-
});
|
|
954
|
-
};
|
|
955
|
-
});
|
|
956
702
|
const $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (inst, def$1) => {
|
|
957
703
|
$ZodCheck.init(inst, def$1);
|
|
958
704
|
inst._zod.check = (payload) => {
|
|
@@ -1090,336 +836,6 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def$1) => {
|
|
|
1090
836
|
version: 1
|
|
1091
837
|
};
|
|
1092
838
|
});
|
|
1093
|
-
const $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def$1) => {
|
|
1094
|
-
$ZodType.init(inst, def$1);
|
|
1095
|
-
inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$1(inst._zod.bag);
|
|
1096
|
-
inst._zod.parse = (payload, _) => {
|
|
1097
|
-
if (def$1.coerce) try {
|
|
1098
|
-
payload.value = String(payload.value);
|
|
1099
|
-
} catch (_$1) {}
|
|
1100
|
-
if (typeof payload.value === "string") return payload;
|
|
1101
|
-
payload.issues.push({
|
|
1102
|
-
expected: "string",
|
|
1103
|
-
code: "invalid_type",
|
|
1104
|
-
input: payload.value,
|
|
1105
|
-
inst
|
|
1106
|
-
});
|
|
1107
|
-
return payload;
|
|
1108
|
-
};
|
|
1109
|
-
});
|
|
1110
|
-
const $ZodStringFormat = /* @__PURE__ */ $constructor("$ZodStringFormat", (inst, def$1) => {
|
|
1111
|
-
$ZodCheckStringFormat.init(inst, def$1);
|
|
1112
|
-
$ZodString.init(inst, def$1);
|
|
1113
|
-
});
|
|
1114
|
-
const $ZodGUID = /* @__PURE__ */ $constructor("$ZodGUID", (inst, def$1) => {
|
|
1115
|
-
def$1.pattern ?? (def$1.pattern = guid);
|
|
1116
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1117
|
-
});
|
|
1118
|
-
const $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def$1) => {
|
|
1119
|
-
if (def$1.version) {
|
|
1120
|
-
const v = {
|
|
1121
|
-
v1: 1,
|
|
1122
|
-
v2: 2,
|
|
1123
|
-
v3: 3,
|
|
1124
|
-
v4: 4,
|
|
1125
|
-
v5: 5,
|
|
1126
|
-
v6: 6,
|
|
1127
|
-
v7: 7,
|
|
1128
|
-
v8: 8
|
|
1129
|
-
}[def$1.version];
|
|
1130
|
-
if (v === void 0) throw new Error(`Invalid UUID version: "${def$1.version}"`);
|
|
1131
|
-
def$1.pattern ?? (def$1.pattern = uuid$1(v));
|
|
1132
|
-
} else def$1.pattern ?? (def$1.pattern = uuid$1());
|
|
1133
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1134
|
-
});
|
|
1135
|
-
const $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def$1) => {
|
|
1136
|
-
def$1.pattern ?? (def$1.pattern = email);
|
|
1137
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1138
|
-
});
|
|
1139
|
-
const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def$1) => {
|
|
1140
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1141
|
-
inst._zod.check = (payload) => {
|
|
1142
|
-
try {
|
|
1143
|
-
const trimmed = payload.value.trim();
|
|
1144
|
-
const url$1 = new URL(trimmed);
|
|
1145
|
-
if (def$1.hostname) {
|
|
1146
|
-
def$1.hostname.lastIndex = 0;
|
|
1147
|
-
if (!def$1.hostname.test(url$1.hostname)) payload.issues.push({
|
|
1148
|
-
code: "invalid_format",
|
|
1149
|
-
format: "url",
|
|
1150
|
-
note: "Invalid hostname",
|
|
1151
|
-
pattern: hostname.source,
|
|
1152
|
-
input: payload.value,
|
|
1153
|
-
inst,
|
|
1154
|
-
continue: !def$1.abort
|
|
1155
|
-
});
|
|
1156
|
-
}
|
|
1157
|
-
if (def$1.protocol) {
|
|
1158
|
-
def$1.protocol.lastIndex = 0;
|
|
1159
|
-
if (!def$1.protocol.test(url$1.protocol.endsWith(":") ? url$1.protocol.slice(0, -1) : url$1.protocol)) payload.issues.push({
|
|
1160
|
-
code: "invalid_format",
|
|
1161
|
-
format: "url",
|
|
1162
|
-
note: "Invalid protocol",
|
|
1163
|
-
pattern: def$1.protocol.source,
|
|
1164
|
-
input: payload.value,
|
|
1165
|
-
inst,
|
|
1166
|
-
continue: !def$1.abort
|
|
1167
|
-
});
|
|
1168
|
-
}
|
|
1169
|
-
if (def$1.normalize) payload.value = url$1.href;
|
|
1170
|
-
else payload.value = trimmed;
|
|
1171
|
-
return;
|
|
1172
|
-
} catch (_) {
|
|
1173
|
-
payload.issues.push({
|
|
1174
|
-
code: "invalid_format",
|
|
1175
|
-
format: "url",
|
|
1176
|
-
input: payload.value,
|
|
1177
|
-
inst,
|
|
1178
|
-
continue: !def$1.abort
|
|
1179
|
-
});
|
|
1180
|
-
}
|
|
1181
|
-
};
|
|
1182
|
-
});
|
|
1183
|
-
const $ZodEmoji = /* @__PURE__ */ $constructor("$ZodEmoji", (inst, def$1) => {
|
|
1184
|
-
def$1.pattern ?? (def$1.pattern = emoji());
|
|
1185
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1186
|
-
});
|
|
1187
|
-
const $ZodNanoID = /* @__PURE__ */ $constructor("$ZodNanoID", (inst, def$1) => {
|
|
1188
|
-
def$1.pattern ?? (def$1.pattern = nanoid);
|
|
1189
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1190
|
-
});
|
|
1191
|
-
const $ZodCUID = /* @__PURE__ */ $constructor("$ZodCUID", (inst, def$1) => {
|
|
1192
|
-
def$1.pattern ?? (def$1.pattern = cuid);
|
|
1193
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1194
|
-
});
|
|
1195
|
-
const $ZodCUID2 = /* @__PURE__ */ $constructor("$ZodCUID2", (inst, def$1) => {
|
|
1196
|
-
def$1.pattern ?? (def$1.pattern = cuid2);
|
|
1197
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1198
|
-
});
|
|
1199
|
-
const $ZodULID = /* @__PURE__ */ $constructor("$ZodULID", (inst, def$1) => {
|
|
1200
|
-
def$1.pattern ?? (def$1.pattern = ulid);
|
|
1201
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1202
|
-
});
|
|
1203
|
-
const $ZodXID = /* @__PURE__ */ $constructor("$ZodXID", (inst, def$1) => {
|
|
1204
|
-
def$1.pattern ?? (def$1.pattern = xid);
|
|
1205
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1206
|
-
});
|
|
1207
|
-
const $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def$1) => {
|
|
1208
|
-
def$1.pattern ?? (def$1.pattern = ksuid);
|
|
1209
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1210
|
-
});
|
|
1211
|
-
const $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def$1) => {
|
|
1212
|
-
def$1.pattern ?? (def$1.pattern = datetime$1(def$1));
|
|
1213
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1214
|
-
});
|
|
1215
|
-
const $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def$1) => {
|
|
1216
|
-
def$1.pattern ?? (def$1.pattern = date$2);
|
|
1217
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1218
|
-
});
|
|
1219
|
-
const $ZodISOTime = /* @__PURE__ */ $constructor("$ZodISOTime", (inst, def$1) => {
|
|
1220
|
-
def$1.pattern ?? (def$1.pattern = time$1(def$1));
|
|
1221
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1222
|
-
});
|
|
1223
|
-
const $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def$1) => {
|
|
1224
|
-
def$1.pattern ?? (def$1.pattern = duration$1);
|
|
1225
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1226
|
-
});
|
|
1227
|
-
const $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def$1) => {
|
|
1228
|
-
def$1.pattern ?? (def$1.pattern = ipv4);
|
|
1229
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1230
|
-
inst._zod.onattach.push((inst$1) => {
|
|
1231
|
-
const bag = inst$1._zod.bag;
|
|
1232
|
-
bag.format = `ipv4`;
|
|
1233
|
-
});
|
|
1234
|
-
});
|
|
1235
|
-
const $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def$1) => {
|
|
1236
|
-
def$1.pattern ?? (def$1.pattern = ipv6);
|
|
1237
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1238
|
-
inst._zod.onattach.push((inst$1) => {
|
|
1239
|
-
const bag = inst$1._zod.bag;
|
|
1240
|
-
bag.format = `ipv6`;
|
|
1241
|
-
});
|
|
1242
|
-
inst._zod.check = (payload) => {
|
|
1243
|
-
try {
|
|
1244
|
-
new URL(`http://[${payload.value}]`);
|
|
1245
|
-
} catch {
|
|
1246
|
-
payload.issues.push({
|
|
1247
|
-
code: "invalid_format",
|
|
1248
|
-
format: "ipv6",
|
|
1249
|
-
input: payload.value,
|
|
1250
|
-
inst,
|
|
1251
|
-
continue: !def$1.abort
|
|
1252
|
-
});
|
|
1253
|
-
}
|
|
1254
|
-
};
|
|
1255
|
-
});
|
|
1256
|
-
const $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def$1) => {
|
|
1257
|
-
def$1.pattern ?? (def$1.pattern = cidrv4);
|
|
1258
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1259
|
-
});
|
|
1260
|
-
const $ZodCIDRv6 = /* @__PURE__ */ $constructor("$ZodCIDRv6", (inst, def$1) => {
|
|
1261
|
-
def$1.pattern ?? (def$1.pattern = cidrv6);
|
|
1262
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1263
|
-
inst._zod.check = (payload) => {
|
|
1264
|
-
const parts = payload.value.split("/");
|
|
1265
|
-
try {
|
|
1266
|
-
if (parts.length !== 2) throw new Error();
|
|
1267
|
-
const [address, prefix] = parts;
|
|
1268
|
-
if (!prefix) throw new Error();
|
|
1269
|
-
const prefixNum = Number(prefix);
|
|
1270
|
-
if (`${prefixNum}` !== prefix) throw new Error();
|
|
1271
|
-
if (prefixNum < 0 || prefixNum > 128) throw new Error();
|
|
1272
|
-
new URL(`http://[${address}]`);
|
|
1273
|
-
} catch {
|
|
1274
|
-
payload.issues.push({
|
|
1275
|
-
code: "invalid_format",
|
|
1276
|
-
format: "cidrv6",
|
|
1277
|
-
input: payload.value,
|
|
1278
|
-
inst,
|
|
1279
|
-
continue: !def$1.abort
|
|
1280
|
-
});
|
|
1281
|
-
}
|
|
1282
|
-
};
|
|
1283
|
-
});
|
|
1284
|
-
function isValidBase64(data) {
|
|
1285
|
-
if (data === "") return true;
|
|
1286
|
-
if (data.length % 4 !== 0) return false;
|
|
1287
|
-
try {
|
|
1288
|
-
atob(data);
|
|
1289
|
-
return true;
|
|
1290
|
-
} catch {
|
|
1291
|
-
return false;
|
|
1292
|
-
}
|
|
1293
|
-
}
|
|
1294
|
-
const $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def$1) => {
|
|
1295
|
-
def$1.pattern ?? (def$1.pattern = base64);
|
|
1296
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1297
|
-
inst._zod.onattach.push((inst$1) => {
|
|
1298
|
-
inst$1._zod.bag.contentEncoding = "base64";
|
|
1299
|
-
});
|
|
1300
|
-
inst._zod.check = (payload) => {
|
|
1301
|
-
if (isValidBase64(payload.value)) return;
|
|
1302
|
-
payload.issues.push({
|
|
1303
|
-
code: "invalid_format",
|
|
1304
|
-
format: "base64",
|
|
1305
|
-
input: payload.value,
|
|
1306
|
-
inst,
|
|
1307
|
-
continue: !def$1.abort
|
|
1308
|
-
});
|
|
1309
|
-
};
|
|
1310
|
-
});
|
|
1311
|
-
function isValidBase64URL(data) {
|
|
1312
|
-
if (!base64url.test(data)) return false;
|
|
1313
|
-
const base64$1 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
1314
|
-
return isValidBase64(base64$1.padEnd(Math.ceil(base64$1.length / 4) * 4, "="));
|
|
1315
|
-
}
|
|
1316
|
-
const $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def$1) => {
|
|
1317
|
-
def$1.pattern ?? (def$1.pattern = base64url);
|
|
1318
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1319
|
-
inst._zod.onattach.push((inst$1) => {
|
|
1320
|
-
inst$1._zod.bag.contentEncoding = "base64url";
|
|
1321
|
-
});
|
|
1322
|
-
inst._zod.check = (payload) => {
|
|
1323
|
-
if (isValidBase64URL(payload.value)) return;
|
|
1324
|
-
payload.issues.push({
|
|
1325
|
-
code: "invalid_format",
|
|
1326
|
-
format: "base64url",
|
|
1327
|
-
input: payload.value,
|
|
1328
|
-
inst,
|
|
1329
|
-
continue: !def$1.abort
|
|
1330
|
-
});
|
|
1331
|
-
};
|
|
1332
|
-
});
|
|
1333
|
-
const $ZodE164 = /* @__PURE__ */ $constructor("$ZodE164", (inst, def$1) => {
|
|
1334
|
-
def$1.pattern ?? (def$1.pattern = e164);
|
|
1335
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1336
|
-
});
|
|
1337
|
-
function isValidJWT(token, algorithm = null) {
|
|
1338
|
-
try {
|
|
1339
|
-
const tokensParts = token.split(".");
|
|
1340
|
-
if (tokensParts.length !== 3) return false;
|
|
1341
|
-
const [header] = tokensParts;
|
|
1342
|
-
if (!header) return false;
|
|
1343
|
-
const parsedHeader = JSON.parse(atob(header));
|
|
1344
|
-
if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT") return false;
|
|
1345
|
-
if (!parsedHeader.alg) return false;
|
|
1346
|
-
if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm)) return false;
|
|
1347
|
-
return true;
|
|
1348
|
-
} catch {
|
|
1349
|
-
return false;
|
|
1350
|
-
}
|
|
1351
|
-
}
|
|
1352
|
-
const $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def$1) => {
|
|
1353
|
-
$ZodStringFormat.init(inst, def$1);
|
|
1354
|
-
inst._zod.check = (payload) => {
|
|
1355
|
-
if (isValidJWT(payload.value, def$1.alg)) return;
|
|
1356
|
-
payload.issues.push({
|
|
1357
|
-
code: "invalid_format",
|
|
1358
|
-
format: "jwt",
|
|
1359
|
-
input: payload.value,
|
|
1360
|
-
inst,
|
|
1361
|
-
continue: !def$1.abort
|
|
1362
|
-
});
|
|
1363
|
-
};
|
|
1364
|
-
});
|
|
1365
|
-
const $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def$1) => {
|
|
1366
|
-
$ZodType.init(inst, def$1);
|
|
1367
|
-
inst._zod.pattern = inst._zod.bag.pattern ?? number$1;
|
|
1368
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
1369
|
-
if (def$1.coerce) try {
|
|
1370
|
-
payload.value = Number(payload.value);
|
|
1371
|
-
} catch (_) {}
|
|
1372
|
-
const input = payload.value;
|
|
1373
|
-
if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) return payload;
|
|
1374
|
-
const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0;
|
|
1375
|
-
payload.issues.push({
|
|
1376
|
-
expected: "number",
|
|
1377
|
-
code: "invalid_type",
|
|
1378
|
-
input,
|
|
1379
|
-
inst,
|
|
1380
|
-
...received ? { received } : {}
|
|
1381
|
-
});
|
|
1382
|
-
return payload;
|
|
1383
|
-
};
|
|
1384
|
-
});
|
|
1385
|
-
const $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def$1) => {
|
|
1386
|
-
$ZodCheckNumberFormat.init(inst, def$1);
|
|
1387
|
-
$ZodNumber.init(inst, def$1);
|
|
1388
|
-
});
|
|
1389
|
-
const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def$1) => {
|
|
1390
|
-
$ZodType.init(inst, def$1);
|
|
1391
|
-
inst._zod.pattern = boolean$1;
|
|
1392
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
1393
|
-
if (def$1.coerce) try {
|
|
1394
|
-
payload.value = Boolean(payload.value);
|
|
1395
|
-
} catch (_) {}
|
|
1396
|
-
const input = payload.value;
|
|
1397
|
-
if (typeof input === "boolean") return payload;
|
|
1398
|
-
payload.issues.push({
|
|
1399
|
-
expected: "boolean",
|
|
1400
|
-
code: "invalid_type",
|
|
1401
|
-
input,
|
|
1402
|
-
inst
|
|
1403
|
-
});
|
|
1404
|
-
return payload;
|
|
1405
|
-
};
|
|
1406
|
-
});
|
|
1407
|
-
const $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def$1) => {
|
|
1408
|
-
$ZodType.init(inst, def$1);
|
|
1409
|
-
inst._zod.pattern = _null$2;
|
|
1410
|
-
inst._zod.values = new Set([null]);
|
|
1411
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
1412
|
-
const input = payload.value;
|
|
1413
|
-
if (input === null) return payload;
|
|
1414
|
-
payload.issues.push({
|
|
1415
|
-
expected: "null",
|
|
1416
|
-
code: "invalid_type",
|
|
1417
|
-
input,
|
|
1418
|
-
inst
|
|
1419
|
-
});
|
|
1420
|
-
return payload;
|
|
1421
|
-
};
|
|
1422
|
-
});
|
|
1423
839
|
const $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def$1) => {
|
|
1424
840
|
$ZodType.init(inst, def$1);
|
|
1425
841
|
inst._zod.parse = (payload) => payload;
|
|
@@ -2061,302 +1477,31 @@ var $ZodRegistry = class {
|
|
|
2061
1477
|
if (meta && typeof meta === "object" && "id" in meta) this._idmap.delete(meta.id);
|
|
2062
1478
|
this._map.delete(schema);
|
|
2063
1479
|
return this;
|
|
2064
|
-
}
|
|
2065
|
-
get(schema) {
|
|
2066
|
-
const p = schema._zod.parent;
|
|
2067
|
-
if (p) {
|
|
2068
|
-
const pm = { ...this.get(p) ?? {} };
|
|
2069
|
-
delete pm.id;
|
|
2070
|
-
const f = {
|
|
2071
|
-
...pm,
|
|
2072
|
-
...this._map.get(schema)
|
|
2073
|
-
};
|
|
2074
|
-
return Object.keys(f).length ? f : void 0;
|
|
2075
|
-
}
|
|
2076
|
-
return this._map.get(schema);
|
|
2077
|
-
}
|
|
2078
|
-
has(schema) {
|
|
2079
|
-
return this._map.has(schema);
|
|
2080
|
-
}
|
|
2081
|
-
};
|
|
2082
|
-
function registry() {
|
|
2083
|
-
return new $ZodRegistry();
|
|
2084
|
-
}
|
|
2085
|
-
const globalRegistry = /* @__PURE__ */ registry();
|
|
2086
|
-
|
|
2087
|
-
//#endregion
|
|
2088
|
-
//#region ../../node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/api.js
|
|
2089
|
-
function _string(Class, params) {
|
|
2090
|
-
return new Class({
|
|
2091
|
-
type: "string",
|
|
2092
|
-
...normalizeParams(params)
|
|
2093
|
-
});
|
|
2094
|
-
}
|
|
2095
|
-
function _email(Class, params) {
|
|
2096
|
-
return new Class({
|
|
2097
|
-
type: "string",
|
|
2098
|
-
format: "email",
|
|
2099
|
-
check: "string_format",
|
|
2100
|
-
abort: false,
|
|
2101
|
-
...normalizeParams(params)
|
|
2102
|
-
});
|
|
2103
|
-
}
|
|
2104
|
-
function _guid(Class, params) {
|
|
2105
|
-
return new Class({
|
|
2106
|
-
type: "string",
|
|
2107
|
-
format: "guid",
|
|
2108
|
-
check: "string_format",
|
|
2109
|
-
abort: false,
|
|
2110
|
-
...normalizeParams(params)
|
|
2111
|
-
});
|
|
2112
|
-
}
|
|
2113
|
-
function _uuid(Class, params) {
|
|
2114
|
-
return new Class({
|
|
2115
|
-
type: "string",
|
|
2116
|
-
format: "uuid",
|
|
2117
|
-
check: "string_format",
|
|
2118
|
-
abort: false,
|
|
2119
|
-
...normalizeParams(params)
|
|
2120
|
-
});
|
|
2121
|
-
}
|
|
2122
|
-
function _uuidv4(Class, params) {
|
|
2123
|
-
return new Class({
|
|
2124
|
-
type: "string",
|
|
2125
|
-
format: "uuid",
|
|
2126
|
-
check: "string_format",
|
|
2127
|
-
abort: false,
|
|
2128
|
-
version: "v4",
|
|
2129
|
-
...normalizeParams(params)
|
|
2130
|
-
});
|
|
2131
|
-
}
|
|
2132
|
-
function _uuidv6(Class, params) {
|
|
2133
|
-
return new Class({
|
|
2134
|
-
type: "string",
|
|
2135
|
-
format: "uuid",
|
|
2136
|
-
check: "string_format",
|
|
2137
|
-
abort: false,
|
|
2138
|
-
version: "v6",
|
|
2139
|
-
...normalizeParams(params)
|
|
2140
|
-
});
|
|
2141
|
-
}
|
|
2142
|
-
function _uuidv7(Class, params) {
|
|
2143
|
-
return new Class({
|
|
2144
|
-
type: "string",
|
|
2145
|
-
format: "uuid",
|
|
2146
|
-
check: "string_format",
|
|
2147
|
-
abort: false,
|
|
2148
|
-
version: "v7",
|
|
2149
|
-
...normalizeParams(params)
|
|
2150
|
-
});
|
|
2151
|
-
}
|
|
2152
|
-
function _url(Class, params) {
|
|
2153
|
-
return new Class({
|
|
2154
|
-
type: "string",
|
|
2155
|
-
format: "url",
|
|
2156
|
-
check: "string_format",
|
|
2157
|
-
abort: false,
|
|
2158
|
-
...normalizeParams(params)
|
|
2159
|
-
});
|
|
2160
|
-
}
|
|
2161
|
-
function _emoji(Class, params) {
|
|
2162
|
-
return new Class({
|
|
2163
|
-
type: "string",
|
|
2164
|
-
format: "emoji",
|
|
2165
|
-
check: "string_format",
|
|
2166
|
-
abort: false,
|
|
2167
|
-
...normalizeParams(params)
|
|
2168
|
-
});
|
|
2169
|
-
}
|
|
2170
|
-
function _nanoid(Class, params) {
|
|
2171
|
-
return new Class({
|
|
2172
|
-
type: "string",
|
|
2173
|
-
format: "nanoid",
|
|
2174
|
-
check: "string_format",
|
|
2175
|
-
abort: false,
|
|
2176
|
-
...normalizeParams(params)
|
|
2177
|
-
});
|
|
2178
|
-
}
|
|
2179
|
-
function _cuid(Class, params) {
|
|
2180
|
-
return new Class({
|
|
2181
|
-
type: "string",
|
|
2182
|
-
format: "cuid",
|
|
2183
|
-
check: "string_format",
|
|
2184
|
-
abort: false,
|
|
2185
|
-
...normalizeParams(params)
|
|
2186
|
-
});
|
|
2187
|
-
}
|
|
2188
|
-
function _cuid2(Class, params) {
|
|
2189
|
-
return new Class({
|
|
2190
|
-
type: "string",
|
|
2191
|
-
format: "cuid2",
|
|
2192
|
-
check: "string_format",
|
|
2193
|
-
abort: false,
|
|
2194
|
-
...normalizeParams(params)
|
|
2195
|
-
});
|
|
2196
|
-
}
|
|
2197
|
-
function _ulid(Class, params) {
|
|
2198
|
-
return new Class({
|
|
2199
|
-
type: "string",
|
|
2200
|
-
format: "ulid",
|
|
2201
|
-
check: "string_format",
|
|
2202
|
-
abort: false,
|
|
2203
|
-
...normalizeParams(params)
|
|
2204
|
-
});
|
|
2205
|
-
}
|
|
2206
|
-
function _xid(Class, params) {
|
|
2207
|
-
return new Class({
|
|
2208
|
-
type: "string",
|
|
2209
|
-
format: "xid",
|
|
2210
|
-
check: "string_format",
|
|
2211
|
-
abort: false,
|
|
2212
|
-
...normalizeParams(params)
|
|
2213
|
-
});
|
|
2214
|
-
}
|
|
2215
|
-
function _ksuid(Class, params) {
|
|
2216
|
-
return new Class({
|
|
2217
|
-
type: "string",
|
|
2218
|
-
format: "ksuid",
|
|
2219
|
-
check: "string_format",
|
|
2220
|
-
abort: false,
|
|
2221
|
-
...normalizeParams(params)
|
|
2222
|
-
});
|
|
2223
|
-
}
|
|
2224
|
-
function _ipv4(Class, params) {
|
|
2225
|
-
return new Class({
|
|
2226
|
-
type: "string",
|
|
2227
|
-
format: "ipv4",
|
|
2228
|
-
check: "string_format",
|
|
2229
|
-
abort: false,
|
|
2230
|
-
...normalizeParams(params)
|
|
2231
|
-
});
|
|
2232
|
-
}
|
|
2233
|
-
function _ipv6(Class, params) {
|
|
2234
|
-
return new Class({
|
|
2235
|
-
type: "string",
|
|
2236
|
-
format: "ipv6",
|
|
2237
|
-
check: "string_format",
|
|
2238
|
-
abort: false,
|
|
2239
|
-
...normalizeParams(params)
|
|
2240
|
-
});
|
|
2241
|
-
}
|
|
2242
|
-
function _cidrv4(Class, params) {
|
|
2243
|
-
return new Class({
|
|
2244
|
-
type: "string",
|
|
2245
|
-
format: "cidrv4",
|
|
2246
|
-
check: "string_format",
|
|
2247
|
-
abort: false,
|
|
2248
|
-
...normalizeParams(params)
|
|
2249
|
-
});
|
|
2250
|
-
}
|
|
2251
|
-
function _cidrv6(Class, params) {
|
|
2252
|
-
return new Class({
|
|
2253
|
-
type: "string",
|
|
2254
|
-
format: "cidrv6",
|
|
2255
|
-
check: "string_format",
|
|
2256
|
-
abort: false,
|
|
2257
|
-
...normalizeParams(params)
|
|
2258
|
-
});
|
|
2259
|
-
}
|
|
2260
|
-
function _base64(Class, params) {
|
|
2261
|
-
return new Class({
|
|
2262
|
-
type: "string",
|
|
2263
|
-
format: "base64",
|
|
2264
|
-
check: "string_format",
|
|
2265
|
-
abort: false,
|
|
2266
|
-
...normalizeParams(params)
|
|
2267
|
-
});
|
|
2268
|
-
}
|
|
2269
|
-
function _base64url(Class, params) {
|
|
2270
|
-
return new Class({
|
|
2271
|
-
type: "string",
|
|
2272
|
-
format: "base64url",
|
|
2273
|
-
check: "string_format",
|
|
2274
|
-
abort: false,
|
|
2275
|
-
...normalizeParams(params)
|
|
2276
|
-
});
|
|
2277
|
-
}
|
|
2278
|
-
function _e164(Class, params) {
|
|
2279
|
-
return new Class({
|
|
2280
|
-
type: "string",
|
|
2281
|
-
format: "e164",
|
|
2282
|
-
check: "string_format",
|
|
2283
|
-
abort: false,
|
|
2284
|
-
...normalizeParams(params)
|
|
2285
|
-
});
|
|
2286
|
-
}
|
|
2287
|
-
function _jwt(Class, params) {
|
|
2288
|
-
return new Class({
|
|
2289
|
-
type: "string",
|
|
2290
|
-
format: "jwt",
|
|
2291
|
-
check: "string_format",
|
|
2292
|
-
abort: false,
|
|
2293
|
-
...normalizeParams(params)
|
|
2294
|
-
});
|
|
2295
|
-
}
|
|
2296
|
-
function _isoDateTime(Class, params) {
|
|
2297
|
-
return new Class({
|
|
2298
|
-
type: "string",
|
|
2299
|
-
format: "datetime",
|
|
2300
|
-
check: "string_format",
|
|
2301
|
-
offset: false,
|
|
2302
|
-
local: false,
|
|
2303
|
-
precision: null,
|
|
2304
|
-
...normalizeParams(params)
|
|
2305
|
-
});
|
|
2306
|
-
}
|
|
2307
|
-
function _isoDate(Class, params) {
|
|
2308
|
-
return new Class({
|
|
2309
|
-
type: "string",
|
|
2310
|
-
format: "date",
|
|
2311
|
-
check: "string_format",
|
|
2312
|
-
...normalizeParams(params)
|
|
2313
|
-
});
|
|
2314
|
-
}
|
|
2315
|
-
function _isoTime(Class, params) {
|
|
2316
|
-
return new Class({
|
|
2317
|
-
type: "string",
|
|
2318
|
-
format: "time",
|
|
2319
|
-
check: "string_format",
|
|
2320
|
-
precision: null,
|
|
2321
|
-
...normalizeParams(params)
|
|
2322
|
-
});
|
|
2323
|
-
}
|
|
2324
|
-
function _isoDuration(Class, params) {
|
|
2325
|
-
return new Class({
|
|
2326
|
-
type: "string",
|
|
2327
|
-
format: "duration",
|
|
2328
|
-
check: "string_format",
|
|
2329
|
-
...normalizeParams(params)
|
|
2330
|
-
});
|
|
2331
|
-
}
|
|
2332
|
-
function _number(Class, params) {
|
|
2333
|
-
return new Class({
|
|
2334
|
-
type: "number",
|
|
2335
|
-
checks: [],
|
|
2336
|
-
...normalizeParams(params)
|
|
2337
|
-
});
|
|
2338
|
-
}
|
|
2339
|
-
function _int(Class, params) {
|
|
2340
|
-
return new Class({
|
|
2341
|
-
type: "number",
|
|
2342
|
-
check: "number_format",
|
|
2343
|
-
abort: false,
|
|
2344
|
-
format: "safeint",
|
|
2345
|
-
...normalizeParams(params)
|
|
2346
|
-
});
|
|
2347
|
-
}
|
|
2348
|
-
function _boolean(Class, params) {
|
|
2349
|
-
return new Class({
|
|
2350
|
-
type: "boolean",
|
|
2351
|
-
...normalizeParams(params)
|
|
2352
|
-
});
|
|
2353
|
-
}
|
|
2354
|
-
function _null$1(Class, params) {
|
|
2355
|
-
return new Class({
|
|
2356
|
-
type: "null",
|
|
2357
|
-
...normalizeParams(params)
|
|
2358
|
-
});
|
|
1480
|
+
}
|
|
1481
|
+
get(schema) {
|
|
1482
|
+
const p = schema._zod.parent;
|
|
1483
|
+
if (p) {
|
|
1484
|
+
const pm = { ...this.get(p) ?? {} };
|
|
1485
|
+
delete pm.id;
|
|
1486
|
+
const f = {
|
|
1487
|
+
...pm,
|
|
1488
|
+
...this._map.get(schema)
|
|
1489
|
+
};
|
|
1490
|
+
return Object.keys(f).length ? f : void 0;
|
|
1491
|
+
}
|
|
1492
|
+
return this._map.get(schema);
|
|
1493
|
+
}
|
|
1494
|
+
has(schema) {
|
|
1495
|
+
return this._map.has(schema);
|
|
1496
|
+
}
|
|
1497
|
+
};
|
|
1498
|
+
function registry() {
|
|
1499
|
+
return new $ZodRegistry();
|
|
2359
1500
|
}
|
|
1501
|
+
const globalRegistry = /* @__PURE__ */ registry();
|
|
1502
|
+
|
|
1503
|
+
//#endregion
|
|
1504
|
+
//#region ../../node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/api.js
|
|
2360
1505
|
function _unknown(Class) {
|
|
2361
1506
|
return new Class({ type: "unknown" });
|
|
2362
1507
|
}
|
|
@@ -2372,14 +1517,6 @@ function _date(Class, params) {
|
|
|
2372
1517
|
...normalizeParams(params)
|
|
2373
1518
|
});
|
|
2374
1519
|
}
|
|
2375
|
-
function _lt(value, params) {
|
|
2376
|
-
return new $ZodCheckLessThan({
|
|
2377
|
-
check: "less_than",
|
|
2378
|
-
...normalizeParams(params),
|
|
2379
|
-
value,
|
|
2380
|
-
inclusive: false
|
|
2381
|
-
});
|
|
2382
|
-
}
|
|
2383
1520
|
function _lte(value, params) {
|
|
2384
1521
|
return new $ZodCheckLessThan({
|
|
2385
1522
|
check: "less_than",
|
|
@@ -2388,14 +1525,6 @@ function _lte(value, params) {
|
|
|
2388
1525
|
inclusive: true
|
|
2389
1526
|
});
|
|
2390
1527
|
}
|
|
2391
|
-
function _gt(value, params) {
|
|
2392
|
-
return new $ZodCheckGreaterThan({
|
|
2393
|
-
check: "greater_than",
|
|
2394
|
-
...normalizeParams(params),
|
|
2395
|
-
value,
|
|
2396
|
-
inclusive: false
|
|
2397
|
-
});
|
|
2398
|
-
}
|
|
2399
1528
|
function _gte(value, params) {
|
|
2400
1529
|
return new $ZodCheckGreaterThan({
|
|
2401
1530
|
check: "greater_than",
|
|
@@ -2404,13 +1533,6 @@ function _gte(value, params) {
|
|
|
2404
1533
|
inclusive: true
|
|
2405
1534
|
});
|
|
2406
1535
|
}
|
|
2407
|
-
function _multipleOf(value, params) {
|
|
2408
|
-
return new $ZodCheckMultipleOf({
|
|
2409
|
-
check: "multiple_of",
|
|
2410
|
-
...normalizeParams(params),
|
|
2411
|
-
value
|
|
2412
|
-
});
|
|
2413
|
-
}
|
|
2414
1536
|
function _maxLength(maximum, params) {
|
|
2415
1537
|
return new $ZodCheckMaxLength({
|
|
2416
1538
|
check: "max_length",
|
|
@@ -2432,70 +1554,12 @@ function _length(length, params) {
|
|
|
2432
1554
|
length
|
|
2433
1555
|
});
|
|
2434
1556
|
}
|
|
2435
|
-
function _regex(pattern, params) {
|
|
2436
|
-
return new $ZodCheckRegex({
|
|
2437
|
-
check: "string_format",
|
|
2438
|
-
format: "regex",
|
|
2439
|
-
...normalizeParams(params),
|
|
2440
|
-
pattern
|
|
2441
|
-
});
|
|
2442
|
-
}
|
|
2443
|
-
function _lowercase(params) {
|
|
2444
|
-
return new $ZodCheckLowerCase({
|
|
2445
|
-
check: "string_format",
|
|
2446
|
-
format: "lowercase",
|
|
2447
|
-
...normalizeParams(params)
|
|
2448
|
-
});
|
|
2449
|
-
}
|
|
2450
|
-
function _uppercase(params) {
|
|
2451
|
-
return new $ZodCheckUpperCase({
|
|
2452
|
-
check: "string_format",
|
|
2453
|
-
format: "uppercase",
|
|
2454
|
-
...normalizeParams(params)
|
|
2455
|
-
});
|
|
2456
|
-
}
|
|
2457
|
-
function _includes(includes, params) {
|
|
2458
|
-
return new $ZodCheckIncludes({
|
|
2459
|
-
check: "string_format",
|
|
2460
|
-
format: "includes",
|
|
2461
|
-
...normalizeParams(params),
|
|
2462
|
-
includes
|
|
2463
|
-
});
|
|
2464
|
-
}
|
|
2465
|
-
function _startsWith(prefix, params) {
|
|
2466
|
-
return new $ZodCheckStartsWith({
|
|
2467
|
-
check: "string_format",
|
|
2468
|
-
format: "starts_with",
|
|
2469
|
-
...normalizeParams(params),
|
|
2470
|
-
prefix
|
|
2471
|
-
});
|
|
2472
|
-
}
|
|
2473
|
-
function _endsWith(suffix, params) {
|
|
2474
|
-
return new $ZodCheckEndsWith({
|
|
2475
|
-
check: "string_format",
|
|
2476
|
-
format: "ends_with",
|
|
2477
|
-
...normalizeParams(params),
|
|
2478
|
-
suffix
|
|
2479
|
-
});
|
|
2480
|
-
}
|
|
2481
1557
|
function _overwrite(tx) {
|
|
2482
1558
|
return new $ZodCheckOverwrite({
|
|
2483
1559
|
check: "overwrite",
|
|
2484
1560
|
tx
|
|
2485
1561
|
});
|
|
2486
1562
|
}
|
|
2487
|
-
function _normalize(form) {
|
|
2488
|
-
return _overwrite((input) => input.normalize(form));
|
|
2489
|
-
}
|
|
2490
|
-
function _trim() {
|
|
2491
|
-
return _overwrite((input) => input.trim());
|
|
2492
|
-
}
|
|
2493
|
-
function _toLowerCase() {
|
|
2494
|
-
return _overwrite((input) => input.toLowerCase());
|
|
2495
|
-
}
|
|
2496
|
-
function _toUpperCase() {
|
|
2497
|
-
return _overwrite((input) => input.toUpperCase());
|
|
2498
|
-
}
|
|
2499
1563
|
function _array(Class, element, params) {
|
|
2500
1564
|
return new Class({
|
|
2501
1565
|
type: "array",
|
|
@@ -2538,37 +1602,6 @@ function _check(fn, params) {
|
|
|
2538
1602
|
return ch;
|
|
2539
1603
|
}
|
|
2540
1604
|
|
|
2541
|
-
//#endregion
|
|
2542
|
-
//#region ../../node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/iso.js
|
|
2543
|
-
const ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def$1) => {
|
|
2544
|
-
$ZodISODateTime.init(inst, def$1);
|
|
2545
|
-
ZodStringFormat.init(inst, def$1);
|
|
2546
|
-
});
|
|
2547
|
-
function datetime(params) {
|
|
2548
|
-
return _isoDateTime(ZodISODateTime, params);
|
|
2549
|
-
}
|
|
2550
|
-
const ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def$1) => {
|
|
2551
|
-
$ZodISODate.init(inst, def$1);
|
|
2552
|
-
ZodStringFormat.init(inst, def$1);
|
|
2553
|
-
});
|
|
2554
|
-
function date$1(params) {
|
|
2555
|
-
return _isoDate(ZodISODate, params);
|
|
2556
|
-
}
|
|
2557
|
-
const ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def$1) => {
|
|
2558
|
-
$ZodISOTime.init(inst, def$1);
|
|
2559
|
-
ZodStringFormat.init(inst, def$1);
|
|
2560
|
-
});
|
|
2561
|
-
function time(params) {
|
|
2562
|
-
return _isoTime(ZodISOTime, params);
|
|
2563
|
-
}
|
|
2564
|
-
const ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def$1) => {
|
|
2565
|
-
$ZodISODuration.init(inst, def$1);
|
|
2566
|
-
ZodStringFormat.init(inst, def$1);
|
|
2567
|
-
});
|
|
2568
|
-
function duration(params) {
|
|
2569
|
-
return _isoDuration(ZodISODuration, params);
|
|
2570
|
-
}
|
|
2571
|
-
|
|
2572
1605
|
//#endregion
|
|
2573
1606
|
//#region ../../node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/errors.js
|
|
2574
1607
|
const initializer = (inst, issues) => {
|
|
@@ -2678,198 +1711,6 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def$1) => {
|
|
|
2678
1711
|
inst.isNullable = () => inst.safeParse(null).success;
|
|
2679
1712
|
return inst;
|
|
2680
1713
|
});
|
|
2681
|
-
/** @internal */
|
|
2682
|
-
const _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def$1) => {
|
|
2683
|
-
$ZodString.init(inst, def$1);
|
|
2684
|
-
ZodType.init(inst, def$1);
|
|
2685
|
-
const bag = inst._zod.bag;
|
|
2686
|
-
inst.format = bag.format ?? null;
|
|
2687
|
-
inst.minLength = bag.minimum ?? null;
|
|
2688
|
-
inst.maxLength = bag.maximum ?? null;
|
|
2689
|
-
inst.regex = (...args) => inst.check(_regex(...args));
|
|
2690
|
-
inst.includes = (...args) => inst.check(_includes(...args));
|
|
2691
|
-
inst.startsWith = (...args) => inst.check(_startsWith(...args));
|
|
2692
|
-
inst.endsWith = (...args) => inst.check(_endsWith(...args));
|
|
2693
|
-
inst.min = (...args) => inst.check(_minLength(...args));
|
|
2694
|
-
inst.max = (...args) => inst.check(_maxLength(...args));
|
|
2695
|
-
inst.length = (...args) => inst.check(_length(...args));
|
|
2696
|
-
inst.nonempty = (...args) => inst.check(_minLength(1, ...args));
|
|
2697
|
-
inst.lowercase = (params) => inst.check(_lowercase(params));
|
|
2698
|
-
inst.uppercase = (params) => inst.check(_uppercase(params));
|
|
2699
|
-
inst.trim = () => inst.check(_trim());
|
|
2700
|
-
inst.normalize = (...args) => inst.check(_normalize(...args));
|
|
2701
|
-
inst.toLowerCase = () => inst.check(_toLowerCase());
|
|
2702
|
-
inst.toUpperCase = () => inst.check(_toUpperCase());
|
|
2703
|
-
});
|
|
2704
|
-
const ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def$1) => {
|
|
2705
|
-
$ZodString.init(inst, def$1);
|
|
2706
|
-
_ZodString.init(inst, def$1);
|
|
2707
|
-
inst.email = (params) => inst.check(_email(ZodEmail, params));
|
|
2708
|
-
inst.url = (params) => inst.check(_url(ZodURL, params));
|
|
2709
|
-
inst.jwt = (params) => inst.check(_jwt(ZodJWT, params));
|
|
2710
|
-
inst.emoji = (params) => inst.check(_emoji(ZodEmoji, params));
|
|
2711
|
-
inst.guid = (params) => inst.check(_guid(ZodGUID, params));
|
|
2712
|
-
inst.uuid = (params) => inst.check(_uuid(ZodUUID, params));
|
|
2713
|
-
inst.uuidv4 = (params) => inst.check(_uuidv4(ZodUUID, params));
|
|
2714
|
-
inst.uuidv6 = (params) => inst.check(_uuidv6(ZodUUID, params));
|
|
2715
|
-
inst.uuidv7 = (params) => inst.check(_uuidv7(ZodUUID, params));
|
|
2716
|
-
inst.nanoid = (params) => inst.check(_nanoid(ZodNanoID, params));
|
|
2717
|
-
inst.guid = (params) => inst.check(_guid(ZodGUID, params));
|
|
2718
|
-
inst.cuid = (params) => inst.check(_cuid(ZodCUID, params));
|
|
2719
|
-
inst.cuid2 = (params) => inst.check(_cuid2(ZodCUID2, params));
|
|
2720
|
-
inst.ulid = (params) => inst.check(_ulid(ZodULID, params));
|
|
2721
|
-
inst.base64 = (params) => inst.check(_base64(ZodBase64, params));
|
|
2722
|
-
inst.base64url = (params) => inst.check(_base64url(ZodBase64URL, params));
|
|
2723
|
-
inst.xid = (params) => inst.check(_xid(ZodXID, params));
|
|
2724
|
-
inst.ksuid = (params) => inst.check(_ksuid(ZodKSUID, params));
|
|
2725
|
-
inst.ipv4 = (params) => inst.check(_ipv4(ZodIPv4, params));
|
|
2726
|
-
inst.ipv6 = (params) => inst.check(_ipv6(ZodIPv6, params));
|
|
2727
|
-
inst.cidrv4 = (params) => inst.check(_cidrv4(ZodCIDRv4, params));
|
|
2728
|
-
inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params));
|
|
2729
|
-
inst.e164 = (params) => inst.check(_e164(ZodE164, params));
|
|
2730
|
-
inst.datetime = (params) => inst.check(datetime(params));
|
|
2731
|
-
inst.date = (params) => inst.check(date$1(params));
|
|
2732
|
-
inst.time = (params) => inst.check(time(params));
|
|
2733
|
-
inst.duration = (params) => inst.check(duration(params));
|
|
2734
|
-
});
|
|
2735
|
-
function string(params) {
|
|
2736
|
-
return _string(ZodString, params);
|
|
2737
|
-
}
|
|
2738
|
-
const ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def$1) => {
|
|
2739
|
-
$ZodStringFormat.init(inst, def$1);
|
|
2740
|
-
_ZodString.init(inst, def$1);
|
|
2741
|
-
});
|
|
2742
|
-
const ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def$1) => {
|
|
2743
|
-
$ZodEmail.init(inst, def$1);
|
|
2744
|
-
ZodStringFormat.init(inst, def$1);
|
|
2745
|
-
});
|
|
2746
|
-
const ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def$1) => {
|
|
2747
|
-
$ZodGUID.init(inst, def$1);
|
|
2748
|
-
ZodStringFormat.init(inst, def$1);
|
|
2749
|
-
});
|
|
2750
|
-
const ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def$1) => {
|
|
2751
|
-
$ZodUUID.init(inst, def$1);
|
|
2752
|
-
ZodStringFormat.init(inst, def$1);
|
|
2753
|
-
});
|
|
2754
|
-
function uuid(params) {
|
|
2755
|
-
return _uuid(ZodUUID, params);
|
|
2756
|
-
}
|
|
2757
|
-
const ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def$1) => {
|
|
2758
|
-
$ZodURL.init(inst, def$1);
|
|
2759
|
-
ZodStringFormat.init(inst, def$1);
|
|
2760
|
-
});
|
|
2761
|
-
function url(params) {
|
|
2762
|
-
return _url(ZodURL, params);
|
|
2763
|
-
}
|
|
2764
|
-
const ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def$1) => {
|
|
2765
|
-
$ZodEmoji.init(inst, def$1);
|
|
2766
|
-
ZodStringFormat.init(inst, def$1);
|
|
2767
|
-
});
|
|
2768
|
-
const ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def$1) => {
|
|
2769
|
-
$ZodNanoID.init(inst, def$1);
|
|
2770
|
-
ZodStringFormat.init(inst, def$1);
|
|
2771
|
-
});
|
|
2772
|
-
const ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def$1) => {
|
|
2773
|
-
$ZodCUID.init(inst, def$1);
|
|
2774
|
-
ZodStringFormat.init(inst, def$1);
|
|
2775
|
-
});
|
|
2776
|
-
const ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def$1) => {
|
|
2777
|
-
$ZodCUID2.init(inst, def$1);
|
|
2778
|
-
ZodStringFormat.init(inst, def$1);
|
|
2779
|
-
});
|
|
2780
|
-
const ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def$1) => {
|
|
2781
|
-
$ZodULID.init(inst, def$1);
|
|
2782
|
-
ZodStringFormat.init(inst, def$1);
|
|
2783
|
-
});
|
|
2784
|
-
const ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def$1) => {
|
|
2785
|
-
$ZodXID.init(inst, def$1);
|
|
2786
|
-
ZodStringFormat.init(inst, def$1);
|
|
2787
|
-
});
|
|
2788
|
-
const ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def$1) => {
|
|
2789
|
-
$ZodKSUID.init(inst, def$1);
|
|
2790
|
-
ZodStringFormat.init(inst, def$1);
|
|
2791
|
-
});
|
|
2792
|
-
const ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def$1) => {
|
|
2793
|
-
$ZodIPv4.init(inst, def$1);
|
|
2794
|
-
ZodStringFormat.init(inst, def$1);
|
|
2795
|
-
});
|
|
2796
|
-
const ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def$1) => {
|
|
2797
|
-
$ZodIPv6.init(inst, def$1);
|
|
2798
|
-
ZodStringFormat.init(inst, def$1);
|
|
2799
|
-
});
|
|
2800
|
-
const ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def$1) => {
|
|
2801
|
-
$ZodCIDRv4.init(inst, def$1);
|
|
2802
|
-
ZodStringFormat.init(inst, def$1);
|
|
2803
|
-
});
|
|
2804
|
-
const ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def$1) => {
|
|
2805
|
-
$ZodCIDRv6.init(inst, def$1);
|
|
2806
|
-
ZodStringFormat.init(inst, def$1);
|
|
2807
|
-
});
|
|
2808
|
-
const ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def$1) => {
|
|
2809
|
-
$ZodBase64.init(inst, def$1);
|
|
2810
|
-
ZodStringFormat.init(inst, def$1);
|
|
2811
|
-
});
|
|
2812
|
-
const ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def$1) => {
|
|
2813
|
-
$ZodBase64URL.init(inst, def$1);
|
|
2814
|
-
ZodStringFormat.init(inst, def$1);
|
|
2815
|
-
});
|
|
2816
|
-
const ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def$1) => {
|
|
2817
|
-
$ZodE164.init(inst, def$1);
|
|
2818
|
-
ZodStringFormat.init(inst, def$1);
|
|
2819
|
-
});
|
|
2820
|
-
const ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def$1) => {
|
|
2821
|
-
$ZodJWT.init(inst, def$1);
|
|
2822
|
-
ZodStringFormat.init(inst, def$1);
|
|
2823
|
-
});
|
|
2824
|
-
const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def$1) => {
|
|
2825
|
-
$ZodNumber.init(inst, def$1);
|
|
2826
|
-
ZodType.init(inst, def$1);
|
|
2827
|
-
inst.gt = (value, params) => inst.check(_gt(value, params));
|
|
2828
|
-
inst.gte = (value, params) => inst.check(_gte(value, params));
|
|
2829
|
-
inst.min = (value, params) => inst.check(_gte(value, params));
|
|
2830
|
-
inst.lt = (value, params) => inst.check(_lt(value, params));
|
|
2831
|
-
inst.lte = (value, params) => inst.check(_lte(value, params));
|
|
2832
|
-
inst.max = (value, params) => inst.check(_lte(value, params));
|
|
2833
|
-
inst.int = (params) => inst.check(int(params));
|
|
2834
|
-
inst.safe = (params) => inst.check(int(params));
|
|
2835
|
-
inst.positive = (params) => inst.check(_gt(0, params));
|
|
2836
|
-
inst.nonnegative = (params) => inst.check(_gte(0, params));
|
|
2837
|
-
inst.negative = (params) => inst.check(_lt(0, params));
|
|
2838
|
-
inst.nonpositive = (params) => inst.check(_lte(0, params));
|
|
2839
|
-
inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params));
|
|
2840
|
-
inst.step = (value, params) => inst.check(_multipleOf(value, params));
|
|
2841
|
-
inst.finite = () => inst;
|
|
2842
|
-
const bag = inst._zod.bag;
|
|
2843
|
-
inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
|
|
2844
|
-
inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
|
|
2845
|
-
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? .5);
|
|
2846
|
-
inst.isFinite = true;
|
|
2847
|
-
inst.format = bag.format ?? null;
|
|
2848
|
-
});
|
|
2849
|
-
function number(params) {
|
|
2850
|
-
return _number(ZodNumber, params);
|
|
2851
|
-
}
|
|
2852
|
-
const ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def$1) => {
|
|
2853
|
-
$ZodNumberFormat.init(inst, def$1);
|
|
2854
|
-
ZodNumber.init(inst, def$1);
|
|
2855
|
-
});
|
|
2856
|
-
function int(params) {
|
|
2857
|
-
return _int(ZodNumberFormat, params);
|
|
2858
|
-
}
|
|
2859
|
-
const ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def$1) => {
|
|
2860
|
-
$ZodBoolean.init(inst, def$1);
|
|
2861
|
-
ZodType.init(inst, def$1);
|
|
2862
|
-
});
|
|
2863
|
-
function boolean(params) {
|
|
2864
|
-
return _boolean(ZodBoolean, params);
|
|
2865
|
-
}
|
|
2866
|
-
const ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def$1) => {
|
|
2867
|
-
$ZodNull.init(inst, def$1);
|
|
2868
|
-
ZodType.init(inst, def$1);
|
|
2869
|
-
});
|
|
2870
|
-
function _null(params) {
|
|
2871
|
-
return _null$1(ZodNull, params);
|
|
2872
|
-
}
|
|
2873
1714
|
const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def$1) => {
|
|
2874
1715
|
$ZodUnknown.init(inst, def$1);
|
|
2875
1716
|
ZodType.init(inst, def$1);
|
|
@@ -3157,55 +1998,9 @@ function superRefine(fn) {
|
|
|
3157
1998
|
}
|
|
3158
1999
|
|
|
3159
2000
|
//#endregion
|
|
3160
|
-
//#region src/models/
|
|
3161
|
-
const
|
|
3162
|
-
const
|
|
3163
|
-
boolean(),
|
|
3164
|
-
date(),
|
|
3165
|
-
_null(),
|
|
3166
|
-
number(),
|
|
3167
|
-
string().min(1).max(SERIALIZABLE_VALUE_MAX_LENGTH)
|
|
3168
|
-
]);
|
|
3169
|
-
|
|
3170
|
-
//#endregion
|
|
3171
|
-
//#region src/models/azure/UnaryOperator.ts
|
|
3172
|
-
let UnaryOperator = /* @__PURE__ */ function(UnaryOperator$1) {
|
|
3173
|
-
UnaryOperator$1["and"] = "and";
|
|
3174
|
-
UnaryOperator$1["not"] = "not";
|
|
3175
|
-
UnaryOperator$1["or"] = "or";
|
|
3176
|
-
return UnaryOperator$1;
|
|
3177
|
-
}({});
|
|
3178
|
-
|
|
3179
|
-
//#endregion
|
|
3180
|
-
//#region src/models/error/InvalidOperationError.ts
|
|
3181
|
-
var InvalidOperationError = class extends Error {
|
|
3182
|
-
constructor(operation, name, message) {
|
|
3183
|
-
super(`Invalid operation: ${operation}, name: ${name}, ${message}`);
|
|
3184
|
-
this.name = "InvalidOperationError";
|
|
3185
|
-
}
|
|
3186
|
-
};
|
|
3187
|
-
|
|
3188
|
-
//#endregion
|
|
3189
|
-
//#region src/models/error/NotFoundError.ts
|
|
3190
|
-
var NotFoundError = class extends Error {
|
|
3191
|
-
constructor(name, id) {
|
|
3192
|
-
super(`${name} is not found for id: ${id}`);
|
|
3193
|
-
this.name = "NotFoundError";
|
|
3194
|
-
}
|
|
3195
|
-
};
|
|
3196
|
-
|
|
3197
|
-
//#endregion
|
|
3198
|
-
//#region src/models/error/NotInitializedError.ts
|
|
3199
|
-
var NotInitializedError = class extends Error {
|
|
3200
|
-
constructor(name) {
|
|
3201
|
-
super(`${name} is not initialized`);
|
|
3202
|
-
this.name = "NotInitializedError";
|
|
3203
|
-
}
|
|
3204
|
-
};
|
|
3205
|
-
|
|
3206
|
-
//#endregion
|
|
3207
|
-
//#region src/util/object/getPropertyNames.ts
|
|
3208
|
-
const getPropertyNames = () => new Proxy({}, { get: (_target, property) => property });
|
|
2001
|
+
//#region src/models/shared/ItemEntityType.ts
|
|
2002
|
+
const ItemEntityTypePropertyNames = getPropertyNames();
|
|
2003
|
+
const createItemEntityTypeSchema = (schema) => object({ type: schema });
|
|
3209
2004
|
|
|
3210
2005
|
//#endregion
|
|
3211
2006
|
//#region src/models/shared/ItemMetadata.ts
|
|
@@ -5414,137 +4209,6 @@ var Serializable = class {
|
|
|
5414
4209
|
}
|
|
5415
4210
|
};
|
|
5416
4211
|
|
|
5417
|
-
//#endregion
|
|
5418
|
-
//#region src/services/azure/constants.ts
|
|
5419
|
-
const RangeOperators = [
|
|
5420
|
-
BinaryOperator.ge,
|
|
5421
|
-
BinaryOperator.gt,
|
|
5422
|
-
BinaryOperator.le,
|
|
5423
|
-
BinaryOperator.lt
|
|
5424
|
-
];
|
|
5425
|
-
const VALUE_REGEX = [
|
|
5426
|
-
true,
|
|
5427
|
-
false,
|
|
5428
|
-
String.raw`\d{4}-\d{2}-\d{2}T[^\s]+`,
|
|
5429
|
-
String(null),
|
|
5430
|
-
String.raw`-?\d+(?:\.\d+)?`,
|
|
5431
|
-
String(NaN),
|
|
5432
|
-
"'[^']*'"
|
|
5433
|
-
].join("|");
|
|
5434
|
-
const CLAUSE_REGEX = new RegExp(`^(?<not>not\\s+)?(?<key>[A-Za-z0-9_]+)\\s+(?<operator>${Object.values(BinaryOperator).join("|")})\\s+(?<value>${VALUE_REGEX})$`, "i");
|
|
5435
|
-
|
|
5436
|
-
//#endregion
|
|
5437
|
-
//#region src/services/azure/deserializeValue.ts
|
|
5438
|
-
const deserializeValue = (string$2) => {
|
|
5439
|
-
if (string$2 === String(true)) return true;
|
|
5440
|
-
else if (string$2 === String(false)) return false;
|
|
5441
|
-
else if (string$2 === String(null)) return null;
|
|
5442
|
-
else if (Number.isFinite(+string$2)) return Number(string$2);
|
|
5443
|
-
else if (string$2 === String(NaN)) return NaN;
|
|
5444
|
-
else if (string$2.startsWith("'") && string$2.endsWith("'")) return string$2.slice(1, -1);
|
|
5445
|
-
else {
|
|
5446
|
-
const date$3 = new Date(string$2);
|
|
5447
|
-
if (Number.isNaN(date$3)) return string$2;
|
|
5448
|
-
else return date$3;
|
|
5449
|
-
}
|
|
5450
|
-
};
|
|
5451
|
-
|
|
5452
|
-
//#endregion
|
|
5453
|
-
//#region src/models/azure/table/CompositeKey.ts
|
|
5454
|
-
var CompositeKey = class {
|
|
5455
|
-
partitionKey;
|
|
5456
|
-
rowKey;
|
|
5457
|
-
};
|
|
5458
|
-
const CompositeKeyPropertyNames = getPropertyNames();
|
|
5459
|
-
|
|
5460
|
-
//#endregion
|
|
5461
|
-
//#region src/util/text/capitalize.ts
|
|
5462
|
-
const capitalize = (string$2) => `${string$2.charAt(0).toUpperCase()}${string$2.slice(1)}`;
|
|
5463
|
-
|
|
5464
|
-
//#endregion
|
|
5465
|
-
//#region src/services/azure/table/constants.ts
|
|
5466
|
-
const AZURE_SELF_DESTRUCT_TIMER = "9".repeat(30);
|
|
5467
|
-
const AZURE_SELF_DESTRUCT_TIMER_SMALL = "9".repeat(15);
|
|
5468
|
-
const KeysToCapitalize = new Set([CompositeKeyPropertyNames.partitionKey, CompositeKeyPropertyNames.rowKey]);
|
|
5469
|
-
const KeysToUncapitalize = new Set([capitalize(CompositeKeyPropertyNames.partitionKey), capitalize(CompositeKeyPropertyNames.rowKey)]);
|
|
5470
|
-
|
|
5471
|
-
//#endregion
|
|
5472
|
-
//#region src/util/text/uncapitalize.ts
|
|
5473
|
-
const uncapitalize = (string$2) => `${string$2.charAt(0).toLowerCase()}${string$2.slice(1)}`;
|
|
5474
|
-
|
|
5475
|
-
//#endregion
|
|
5476
|
-
//#region src/services/azure/table/deserializeKey.ts
|
|
5477
|
-
const deserializeKey = (key) => KeysToUncapitalize.has(key) ? uncapitalize(key) : key;
|
|
5478
|
-
|
|
5479
|
-
//#endregion
|
|
5480
|
-
//#region src/services/azure/deserializeClause.ts
|
|
5481
|
-
const deserializeClause = (string$2) => {
|
|
5482
|
-
const trimmedString = string$2.trim();
|
|
5483
|
-
const match = CLAUSE_REGEX.exec(trimmedString);
|
|
5484
|
-
if (!match) throw new NotFoundError(deserializeClause.name, trimmedString);
|
|
5485
|
-
const groups = match.groups;
|
|
5486
|
-
if (!groups) throw new NotFoundError(deserializeClause.name, trimmedString);
|
|
5487
|
-
return {
|
|
5488
|
-
key: deserializeKey(groups.key),
|
|
5489
|
-
not: Boolean(groups.not),
|
|
5490
|
-
operator: groups.operator,
|
|
5491
|
-
value: deserializeValue(groups.value)
|
|
5492
|
-
};
|
|
5493
|
-
};
|
|
5494
|
-
|
|
5495
|
-
//#endregion
|
|
5496
|
-
//#region src/services/azure/escapeValue.ts
|
|
5497
|
-
const escapeValue = (value) => `'${value}'`;
|
|
5498
|
-
|
|
5499
|
-
//#endregion
|
|
5500
|
-
//#region src/services/azure/serializeValue.ts
|
|
5501
|
-
const serializeValue = (value) => {
|
|
5502
|
-
if (value instanceof Date) return value.toISOString();
|
|
5503
|
-
else if (typeof value === "string") return escapeValue(value);
|
|
5504
|
-
else return String(value);
|
|
5505
|
-
};
|
|
5506
|
-
|
|
5507
|
-
//#endregion
|
|
5508
|
-
//#region src/services/azure/table/serializeKey.ts
|
|
5509
|
-
const serializeKey = (key) => KeysToCapitalize.has(key) ? capitalize(key) : key;
|
|
5510
|
-
|
|
5511
|
-
//#endregion
|
|
5512
|
-
//#region src/services/azure/serializeClause.ts
|
|
5513
|
-
const serializeClause = (clause) => {
|
|
5514
|
-
clause.key = serializeKey(clause.key);
|
|
5515
|
-
if (clause.operator === SearchOperator.arrayContains) {
|
|
5516
|
-
const keys = clause.key.split("/").map((key$1) => serializeKey(key$1));
|
|
5517
|
-
if (keys.length === 1) return `${keys[0]}/any(x: search.in(x, ${serializeValue(clause.value.join(","))}))`;
|
|
5518
|
-
else if (keys.length === 2) {
|
|
5519
|
-
const [collectionName, propertyName] = keys;
|
|
5520
|
-
return `${collectionName}/any(x: search.in(x/${propertyName}, ${serializeValue(clause.value.join(","))}))`;
|
|
5521
|
-
} else throw new InvalidOperationError(Operation.Read, serializeClause.name, clause.key);
|
|
5522
|
-
}
|
|
5523
|
-
const { key, not, operator, value } = clause;
|
|
5524
|
-
const baseClause = `${key} ${operator} ${serializeValue(value)}`;
|
|
5525
|
-
return not ? `${UnaryOperator.not}(${baseClause})` : baseClause;
|
|
5526
|
-
};
|
|
5527
|
-
|
|
5528
|
-
//#endregion
|
|
5529
|
-
//#region src/services/azure/serializeClauses.ts
|
|
5530
|
-
const serializeClauses = (clauses) => {
|
|
5531
|
-
if (clauses.length === 0) return "";
|
|
5532
|
-
else if (clauses.length === 1) return serializeClause(clauses[0]);
|
|
5533
|
-
const groupedClauses = Object.groupBy(clauses, ({ key }) => key);
|
|
5534
|
-
const groupedStrings = [];
|
|
5535
|
-
for (const clauses$1 of Object.values(groupedClauses)) if (clauses$1.length === 1) groupedStrings.push(serializeClause(clauses$1[0]));
|
|
5536
|
-
else {
|
|
5537
|
-
const serializedClauses = clauses$1.map((c) => serializeClause(c));
|
|
5538
|
-
const groupedString = clauses$1.some(({ operator }) => RangeOperators.includes(operator)) ? serializedClauses.join(` ${UnaryOperator.and} `) : `(${serializedClauses.join(` ${UnaryOperator.or} `)})`;
|
|
5539
|
-
groupedStrings.push(groupedString);
|
|
5540
|
-
}
|
|
5541
|
-
return groupedStrings.join(` ${UnaryOperator.and} `);
|
|
5542
|
-
};
|
|
5543
|
-
|
|
5544
|
-
//#endregion
|
|
5545
|
-
//#region src/services/message/constants.ts
|
|
5546
|
-
const MENTION_MAX_LENGTH = 100;
|
|
5547
|
-
|
|
5548
4212
|
//#endregion
|
|
5549
4213
|
//#region src/services/prettier/css.ts
|
|
5550
4214
|
const css = String.raw;
|
|
@@ -5562,8 +4226,24 @@ const applyItemMetadataMixin = (Base) => class ItemWithMetadata extends Base {
|
|
|
5562
4226
|
};
|
|
5563
4227
|
|
|
5564
4228
|
//#endregion
|
|
5565
|
-
//#region src/
|
|
5566
|
-
const
|
|
4229
|
+
//#region src/models/environment/Environment.js
|
|
4230
|
+
const Environment$1 = {
|
|
4231
|
+
development: "development",
|
|
4232
|
+
production: "production",
|
|
4233
|
+
test: "test"
|
|
4234
|
+
};
|
|
4235
|
+
|
|
4236
|
+
//#endregion
|
|
4237
|
+
//#region src/util/environment/constants.js
|
|
4238
|
+
const IS_PRODUCTION$1 = "development" === Environment$1.production;
|
|
4239
|
+
const IS_TEST$1 = "development" === Environment$1.test;
|
|
4240
|
+
const IS_DEVELOPMENT$1 = "development" === Environment$1.development;
|
|
4241
|
+
|
|
4242
|
+
//#endregion
|
|
4243
|
+
//#region src/util/environment/constants.ts
|
|
4244
|
+
const IS_PRODUCTION = IS_PRODUCTION$1;
|
|
4245
|
+
const IS_TEST = IS_TEST$1;
|
|
4246
|
+
const IS_DEVELOPMENT = IS_DEVELOPMENT$1;
|
|
5567
4247
|
|
|
5568
4248
|
//#endregion
|
|
5569
4249
|
//#region src/util/environment/getIsServer.ts
|
|
@@ -5581,10 +4261,38 @@ const isPlainObject = (data) => {
|
|
|
5581
4261
|
return prototype === null || prototype === Object.prototype;
|
|
5582
4262
|
};
|
|
5583
4263
|
|
|
4264
|
+
//#endregion
|
|
4265
|
+
//#region src/util/object/jsonDateParse.ts
|
|
4266
|
+
const reISO = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.{0,1}\d*))(?:Z|(\+|-)([\d|:]*))?$/;
|
|
4267
|
+
const reMsAjax = /^\/Date\((d|-|.*)\)[/|\\]$/;
|
|
4268
|
+
const jsonDateParse = (text) => JSON.parse(text, (_key, value) => {
|
|
4269
|
+
let parsedValue = value;
|
|
4270
|
+
if (typeof value === "string") {
|
|
4271
|
+
let a = reISO.exec(value);
|
|
4272
|
+
if (a) parsedValue = new Date(value);
|
|
4273
|
+
else {
|
|
4274
|
+
a = reMsAjax.exec(value);
|
|
4275
|
+
if (a) {
|
|
4276
|
+
const b = a[1].split(/[-+,.]/);
|
|
4277
|
+
parsedValue = /* @__PURE__ */ new Date(b[0] ? +b[0] : 0 - +b[1]);
|
|
4278
|
+
}
|
|
4279
|
+
}
|
|
4280
|
+
}
|
|
4281
|
+
return parsedValue;
|
|
4282
|
+
});
|
|
4283
|
+
|
|
5584
4284
|
//#endregion
|
|
5585
4285
|
//#region src/util/object/mergeObjectsStrict.ts
|
|
5586
4286
|
const mergeObjectsStrict = (...objects) => Object.assign({}, ...objects);
|
|
5587
4287
|
|
|
4288
|
+
//#endregion
|
|
4289
|
+
//#region src/util/regex/escapeRegExp.ts
|
|
4290
|
+
const escapeRegExp = (string) => string.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`);
|
|
4291
|
+
|
|
4292
|
+
//#endregion
|
|
4293
|
+
//#region src/util/text/capitalize.ts
|
|
4294
|
+
const capitalize = (string) => `${string.charAt(0).toUpperCase()}${string.slice(1)}`;
|
|
4295
|
+
|
|
5588
4296
|
//#endregion
|
|
5589
4297
|
//#region src/util/text/streamToText.ts
|
|
5590
4298
|
const streamToText = async (readable) => {
|
|
@@ -5596,7 +4304,11 @@ const streamToText = async (readable) => {
|
|
|
5596
4304
|
|
|
5597
4305
|
//#endregion
|
|
5598
4306
|
//#region src/util/text/toKebabCase.ts
|
|
5599
|
-
const toKebabCase = (string
|
|
4307
|
+
const toKebabCase = (string) => string.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)?.map((x) => x.toLowerCase()).join("-") ?? "";
|
|
4308
|
+
|
|
4309
|
+
//#endregion
|
|
4310
|
+
//#region src/util/text/uncapitalize.ts
|
|
4311
|
+
const uncapitalize = (string) => `${string.charAt(0).toLowerCase()}${string.slice(1)}`;
|
|
5600
4312
|
|
|
5601
4313
|
//#endregion
|
|
5602
4314
|
//#region src/util/time/hrtime.ts
|
|
@@ -5631,155 +4343,6 @@ const exhaustiveGuard = (value) => {
|
|
|
5631
4343
|
throw new InvalidOperationError(Operation.Read, exhaustiveGuard.name, JSON.stringify(value));
|
|
5632
4344
|
};
|
|
5633
4345
|
|
|
5634
|
-
//#endregion
|
|
5635
|
-
//#region src/models/azure/table/CompositeKeyEntity.ts
|
|
5636
|
-
var CompositeKeyEntity = class extends Serializable {
|
|
5637
|
-
partitionKey;
|
|
5638
|
-
rowKey;
|
|
5639
|
-
};
|
|
5640
|
-
const createCompositeKeyEntitySchema = (schema) => schema;
|
|
5641
|
-
|
|
5642
|
-
//#endregion
|
|
5643
|
-
//#region src/models/azure/table/AzureEntity.ts
|
|
5644
|
-
const AzureEntity = applyItemMetadataMixin(CompositeKeyEntity);
|
|
5645
|
-
const createAzureEntitySchema = (schema) => object({
|
|
5646
|
-
...createCompositeKeyEntitySchema(schema).shape,
|
|
5647
|
-
...itemMetadataSchema.shape
|
|
5648
|
-
});
|
|
5649
|
-
|
|
5650
|
-
//#endregion
|
|
5651
|
-
//#region src/services/azure/container/constants.ts
|
|
5652
|
-
const FILENAME_MAX_LENGTH = 1e3;
|
|
5653
|
-
const FILE_MAX_LENGTH = 10;
|
|
5654
|
-
|
|
5655
|
-
//#endregion
|
|
5656
|
-
//#region src/models/azure/table/FileEntity.ts
|
|
5657
|
-
var FileEntity = class {
|
|
5658
|
-
filename;
|
|
5659
|
-
id;
|
|
5660
|
-
mimetype;
|
|
5661
|
-
size;
|
|
5662
|
-
constructor(init) {
|
|
5663
|
-
Object.assign(this, init);
|
|
5664
|
-
}
|
|
5665
|
-
};
|
|
5666
|
-
const FileEntityPropertyNames = getPropertyNames();
|
|
5667
|
-
const fileEntitySchema = object({
|
|
5668
|
-
filename: string().min(1).max(FILENAME_MAX_LENGTH),
|
|
5669
|
-
id: uuid(),
|
|
5670
|
-
mimetype: string(),
|
|
5671
|
-
size: int().positive()
|
|
5672
|
-
});
|
|
5673
|
-
|
|
5674
|
-
//#endregion
|
|
5675
|
-
//#region src/models/message/filter/FilterType.ts
|
|
5676
|
-
let FilterType = /* @__PURE__ */ function(FilterType$1) {
|
|
5677
|
-
FilterType$1["From"] = "From";
|
|
5678
|
-
FilterType$1["Mentions"] = "Mentions";
|
|
5679
|
-
FilterType$1["Has"] = "Has";
|
|
5680
|
-
FilterType$1["Before"] = "Before";
|
|
5681
|
-
FilterType$1["During"] = "During";
|
|
5682
|
-
FilterType$1["After"] = "After";
|
|
5683
|
-
FilterType$1["Pinned"] = "Pinned";
|
|
5684
|
-
return FilterType$1;
|
|
5685
|
-
}({});
|
|
5686
|
-
const filterTypeSchema = _enum(FilterType);
|
|
5687
|
-
|
|
5688
|
-
//#endregion
|
|
5689
|
-
//#region src/models/message/filter/Filter.ts
|
|
5690
|
-
const filterSchema = object({
|
|
5691
|
-
type: filterTypeSchema,
|
|
5692
|
-
value: serializableValueSchema
|
|
5693
|
-
});
|
|
5694
|
-
|
|
5695
|
-
//#endregion
|
|
5696
|
-
//#region src/models/message/filter/FilterTypeHas.ts
|
|
5697
|
-
let FilterTypeHas = /* @__PURE__ */ function(FilterTypeHas$1) {
|
|
5698
|
-
FilterTypeHas$1["Link"] = "Link";
|
|
5699
|
-
FilterTypeHas$1["Embed"] = "Embed";
|
|
5700
|
-
FilterTypeHas$1["Image"] = "Image";
|
|
5701
|
-
FilterTypeHas$1["Video"] = "Video";
|
|
5702
|
-
FilterTypeHas$1["Sound"] = "Sound";
|
|
5703
|
-
FilterTypeHas$1["Forward"] = "Forward";
|
|
5704
|
-
return FilterTypeHas$1;
|
|
5705
|
-
}({});
|
|
5706
|
-
|
|
5707
|
-
//#endregion
|
|
5708
|
-
//#region src/models/message/webhook/EmbedAuthor.ts
|
|
5709
|
-
const embedAuthorSchema = object({
|
|
5710
|
-
icon_url: url().optional(),
|
|
5711
|
-
name: string().max(256),
|
|
5712
|
-
url: url().optional()
|
|
5713
|
-
});
|
|
5714
|
-
|
|
5715
|
-
//#endregion
|
|
5716
|
-
//#region src/models/message/webhook/EmbedField.ts
|
|
5717
|
-
const embedFieldSchema = object({
|
|
5718
|
-
inline: boolean().optional(),
|
|
5719
|
-
name: string().min(1).max(256),
|
|
5720
|
-
value: string().min(1).max(1024)
|
|
5721
|
-
});
|
|
5722
|
-
|
|
5723
|
-
//#endregion
|
|
5724
|
-
//#region src/models/message/webhook/EmbedFooter.ts
|
|
5725
|
-
const embedFooterSchema = object({
|
|
5726
|
-
icon_url: url().optional(),
|
|
5727
|
-
text: string().max(2048)
|
|
5728
|
-
});
|
|
5729
|
-
|
|
5730
|
-
//#endregion
|
|
5731
|
-
//#region src/models/message/webhook/Embed.ts
|
|
5732
|
-
const embedSchema = object({
|
|
5733
|
-
author: embedAuthorSchema.optional(),
|
|
5734
|
-
color: number().int().min(0).max(256 ** 3 - 1).optional(),
|
|
5735
|
-
description: string().max(4096).optional(),
|
|
5736
|
-
fields: embedFieldSchema.array().max(25).optional(),
|
|
5737
|
-
footer: embedFooterSchema.optional(),
|
|
5738
|
-
image: object({ url: url() }).optional(),
|
|
5739
|
-
thumbnail: object({ url: url() }).optional(),
|
|
5740
|
-
timestamp: datetime().optional(),
|
|
5741
|
-
title: string().max(256).optional(),
|
|
5742
|
-
url: url().optional()
|
|
5743
|
-
});
|
|
5744
|
-
|
|
5745
|
-
//#endregion
|
|
5746
|
-
//#region src/models/message/webhook/WebhookPayload.ts
|
|
5747
|
-
const webhookPayloadSchema = object({
|
|
5748
|
-
avatarUrl: url().optional(),
|
|
5749
|
-
content: string().max(2e3).optional(),
|
|
5750
|
-
embeds: embedSchema.array().max(FILE_MAX_LENGTH).optional(),
|
|
5751
|
-
username: string().max(USER_NAME_MAX_LENGTH).optional()
|
|
5752
|
-
}).refine((data) => data.content || data.embeds && data.embeds.length > 0, { message: "Webhook must have either \"content\" or \"embeds\"." });
|
|
5753
|
-
|
|
5754
|
-
//#endregion
|
|
5755
|
-
//#region src/services/azure/search/getSearchNonNullClause.ts
|
|
5756
|
-
const getSearchNonNullClause = (key) => ({
|
|
5757
|
-
key,
|
|
5758
|
-
operator: BinaryOperator.ne,
|
|
5759
|
-
value: null
|
|
5760
|
-
});
|
|
5761
|
-
|
|
5762
|
-
//#endregion
|
|
5763
|
-
//#region src/services/azure/search/getSearchNullClause.ts
|
|
5764
|
-
const getSearchNullClause = (key) => ({
|
|
5765
|
-
key,
|
|
5766
|
-
operator: BinaryOperator.eq,
|
|
5767
|
-
value: null
|
|
5768
|
-
});
|
|
5769
|
-
|
|
5770
|
-
//#endregion
|
|
5771
|
-
//#region src/services/azure/table/getReverseTickedTimestamp.ts
|
|
5772
|
-
const getReverseTickedTimestamp = (timestamp = now()) => (BigInt(AZURE_SELF_DESTRUCT_TIMER) - BigInt(timestamp)).toString();
|
|
5773
|
-
|
|
5774
|
-
//#endregion
|
|
5775
|
-
//#region src/services/azure/table/getTableNullClause.ts
|
|
5776
|
-
const getTableNullClause = (key) => ({
|
|
5777
|
-
key,
|
|
5778
|
-
not: true,
|
|
5779
|
-
operator: BinaryOperator.ne,
|
|
5780
|
-
value: NaN
|
|
5781
|
-
});
|
|
5782
|
-
|
|
5783
4346
|
//#endregion
|
|
5784
4347
|
//#region src/util/id/uuid/constants.ts
|
|
5785
4348
|
const NIL = "00000000-0000-0000-0000-000000000000";
|
|
@@ -5787,7 +4350,7 @@ const UUIDV4_REGEX = /^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-
|
|
|
5787
4350
|
|
|
5788
4351
|
//#endregion
|
|
5789
4352
|
//#region src/util/id/uuid/uuidValidateV4.ts
|
|
5790
|
-
const uuidValidateV4 = (uuid
|
|
4353
|
+
const uuidValidateV4 = (uuid) => UUIDV4_REGEX.test(uuid);
|
|
5791
4354
|
|
|
5792
4355
|
//#endregion
|
|
5793
|
-
export {
|
|
4356
|
+
export { Environment, ID_SEPARATOR, IS_DEVELOPMENT, IS_PRODUCTION, IS_TEST, InvalidOperationError, ItemEntityTypePropertyNames, ItemMetadata, ItemMetadataPropertyNames, NIL, NotFoundError, NotInitializedError, Operation, Serializable, UUIDV4_REGEX, applyItemMetadataMixin, capitalize, createItemEntityTypeSchema, css, escapeRegExp, exhaustiveGuard, getIsServer, getPropertyNames, getRawData, hrtime, html, isPlainObject, itemMetadataSchema, jsonDateParse, mergeObjectsStrict, now, streamToText, toKebabCase, toRawDeep, uncapitalize, uuidValidateV4 };
|