@llmops/gateway 0.1.9 → 0.2.0-beta.2
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.cjs +309 -117
- package/dist/index.mjs +309 -117
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -315,7 +315,7 @@ let BatchEndpoints = /* @__PURE__ */ function(BatchEndpoints$1) {
|
|
|
315
315
|
}({});
|
|
316
316
|
|
|
317
317
|
//#endregion
|
|
318
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
318
|
+
//#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/core.js
|
|
319
319
|
/** A special constant with type `never` */
|
|
320
320
|
const NEVER = Object.freeze({ status: "aborted" });
|
|
321
321
|
function $constructor(name, initializer$2, params) {
|
|
@@ -375,7 +375,7 @@ function config(newConfig) {
|
|
|
375
375
|
}
|
|
376
376
|
|
|
377
377
|
//#endregion
|
|
378
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
378
|
+
//#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/util.js
|
|
379
379
|
function getEnumValues(entries) {
|
|
380
380
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
381
381
|
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
@@ -523,6 +523,8 @@ const NUMBER_FORMAT_RANGES = {
|
|
|
523
523
|
};
|
|
524
524
|
function pick(schema, mask) {
|
|
525
525
|
const currDef = schema._zod.def;
|
|
526
|
+
const checks = currDef.checks;
|
|
527
|
+
if (checks && checks.length > 0) throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
526
528
|
return clone(schema, mergeDefs(schema._zod.def, {
|
|
527
529
|
get shape() {
|
|
528
530
|
const newShape = {};
|
|
@@ -539,6 +541,8 @@ function pick(schema, mask) {
|
|
|
539
541
|
}
|
|
540
542
|
function omit(schema, mask) {
|
|
541
543
|
const currDef = schema._zod.def;
|
|
544
|
+
const checks = currDef.checks;
|
|
545
|
+
if (checks && checks.length > 0) throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
542
546
|
return clone(schema, mergeDefs(schema._zod.def, {
|
|
543
547
|
get shape() {
|
|
544
548
|
const newShape = { ...schema._zod.def.shape };
|
|
@@ -556,33 +560,29 @@ function omit(schema, mask) {
|
|
|
556
560
|
function extend(schema, shape) {
|
|
557
561
|
if (!isPlainObject(shape)) throw new Error("Invalid input to extend: expected a plain object");
|
|
558
562
|
const checks = schema._zod.def.checks;
|
|
559
|
-
if (checks && checks.length > 0)
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
}));
|
|
563
|
+
if (checks && checks.length > 0) {
|
|
564
|
+
const existingShape = schema._zod.def.shape;
|
|
565
|
+
for (const key in shape) if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
566
|
+
}
|
|
567
|
+
return clone(schema, mergeDefs(schema._zod.def, { get shape() {
|
|
568
|
+
const _shape = {
|
|
569
|
+
...schema._zod.def.shape,
|
|
570
|
+
...shape
|
|
571
|
+
};
|
|
572
|
+
assignProp(this, "shape", _shape);
|
|
573
|
+
return _shape;
|
|
574
|
+
} }));
|
|
571
575
|
}
|
|
572
576
|
function safeExtend(schema, shape) {
|
|
573
577
|
if (!isPlainObject(shape)) throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
574
|
-
return clone(schema, {
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
return _shape;
|
|
583
|
-
},
|
|
584
|
-
checks: schema._zod.def.checks
|
|
585
|
-
});
|
|
578
|
+
return clone(schema, mergeDefs(schema._zod.def, { get shape() {
|
|
579
|
+
const _shape = {
|
|
580
|
+
...schema._zod.def.shape,
|
|
581
|
+
...shape
|
|
582
|
+
};
|
|
583
|
+
assignProp(this, "shape", _shape);
|
|
584
|
+
return _shape;
|
|
585
|
+
} }));
|
|
586
586
|
}
|
|
587
587
|
function merge(a, b) {
|
|
588
588
|
return clone(a, mergeDefs(a._zod.def, {
|
|
@@ -601,6 +601,8 @@ function merge(a, b) {
|
|
|
601
601
|
}));
|
|
602
602
|
}
|
|
603
603
|
function partial(Class, schema, mask) {
|
|
604
|
+
const checks = schema._zod.def.checks;
|
|
605
|
+
if (checks && checks.length > 0) throw new Error(".partial() cannot be used on object schemas containing refinements");
|
|
604
606
|
return clone(schema, mergeDefs(schema._zod.def, {
|
|
605
607
|
get shape() {
|
|
606
608
|
const oldShape = schema._zod.def.shape;
|
|
@@ -624,27 +626,24 @@ function partial(Class, schema, mask) {
|
|
|
624
626
|
}));
|
|
625
627
|
}
|
|
626
628
|
function required(Class, schema, mask) {
|
|
627
|
-
return clone(schema, mergeDefs(schema._zod.def, {
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
if (
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
shape[key] = new Class({
|
|
635
|
-
type: "nonoptional",
|
|
636
|
-
innerType: oldShape[key]
|
|
637
|
-
});
|
|
638
|
-
}
|
|
639
|
-
else for (const key in oldShape) shape[key] = new Class({
|
|
629
|
+
return clone(schema, mergeDefs(schema._zod.def, { get shape() {
|
|
630
|
+
const oldShape = schema._zod.def.shape;
|
|
631
|
+
const shape = { ...oldShape };
|
|
632
|
+
if (mask) for (const key in mask) {
|
|
633
|
+
if (!(key in shape)) throw new Error(`Unrecognized key: "${key}"`);
|
|
634
|
+
if (!mask[key]) continue;
|
|
635
|
+
shape[key] = new Class({
|
|
640
636
|
type: "nonoptional",
|
|
641
637
|
innerType: oldShape[key]
|
|
642
638
|
});
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
639
|
+
}
|
|
640
|
+
else for (const key in oldShape) shape[key] = new Class({
|
|
641
|
+
type: "nonoptional",
|
|
642
|
+
innerType: oldShape[key]
|
|
643
|
+
});
|
|
644
|
+
assignProp(this, "shape", shape);
|
|
645
|
+
return shape;
|
|
646
|
+
} }));
|
|
648
647
|
}
|
|
649
648
|
function aborted(x, startIndex = 0) {
|
|
650
649
|
if (x.aborted === true) return true;
|
|
@@ -690,7 +689,7 @@ function issue(...args) {
|
|
|
690
689
|
}
|
|
691
690
|
|
|
692
691
|
//#endregion
|
|
693
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
692
|
+
//#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/errors.js
|
|
694
693
|
const initializer$1 = (inst, def) => {
|
|
695
694
|
inst.name = "$ZodError";
|
|
696
695
|
Object.defineProperty(inst, "_zod", {
|
|
@@ -748,7 +747,7 @@ function formatError(error, mapper = (issue$1) => issue$1.message) {
|
|
|
748
747
|
}
|
|
749
748
|
|
|
750
749
|
//#endregion
|
|
751
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
750
|
+
//#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/parse.js
|
|
752
751
|
const _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
753
752
|
const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
|
|
754
753
|
const result = schema._zod.run({
|
|
@@ -852,7 +851,7 @@ const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
852
851
|
const safeDecodeAsync$1 = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
|
|
853
852
|
|
|
854
853
|
//#endregion
|
|
855
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
854
|
+
//#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/regexes.js
|
|
856
855
|
const cuid = /^[cC][^\s-]{8,}$/;
|
|
857
856
|
const cuid2 = /^[0-9a-z]+$/;
|
|
858
857
|
const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
|
|
@@ -882,7 +881,7 @@ const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-
|
|
|
882
881
|
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])$/;
|
|
883
882
|
const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
884
883
|
const base64url = /^[A-Za-z0-9_-]*$/;
|
|
885
|
-
const e164 = /^\+
|
|
884
|
+
const e164 = /^\+[1-9]\d{6,14}$/;
|
|
886
885
|
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])))`;
|
|
887
886
|
const date$2 = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
|
|
888
887
|
function timeSource(args) {
|
|
@@ -905,13 +904,13 @@ const string$1 = (params) => {
|
|
|
905
904
|
return /* @__PURE__ */ new RegExp(`^${regex}$`);
|
|
906
905
|
};
|
|
907
906
|
const integer = /^-?\d+$/;
|
|
908
|
-
const number$1 = /^-?\d+(?:\.\d+)
|
|
907
|
+
const number$1 = /^-?\d+(?:\.\d+)?$/;
|
|
909
908
|
const boolean$1 = /^(?:true|false)$/i;
|
|
910
909
|
const lowercase = /^[^A-Z]*$/;
|
|
911
910
|
const uppercase = /^[^a-z]*$/;
|
|
912
911
|
|
|
913
912
|
//#endregion
|
|
914
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
913
|
+
//#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/checks.js
|
|
915
914
|
const $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
916
915
|
var _a$1;
|
|
917
916
|
inst._zod ?? (inst._zod = {});
|
|
@@ -937,7 +936,7 @@ const $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (ins
|
|
|
937
936
|
payload.issues.push({
|
|
938
937
|
origin,
|
|
939
938
|
code: "too_big",
|
|
940
|
-
maximum: def.value,
|
|
939
|
+
maximum: typeof def.value === "object" ? def.value.getTime() : def.value,
|
|
941
940
|
input: payload.value,
|
|
942
941
|
inclusive: def.inclusive,
|
|
943
942
|
inst,
|
|
@@ -959,7 +958,7 @@ const $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan"
|
|
|
959
958
|
payload.issues.push({
|
|
960
959
|
origin,
|
|
961
960
|
code: "too_small",
|
|
962
|
-
minimum: def.value,
|
|
961
|
+
minimum: typeof def.value === "object" ? def.value.getTime() : def.value,
|
|
963
962
|
input: payload.value,
|
|
964
963
|
inclusive: def.inclusive,
|
|
965
964
|
inst,
|
|
@@ -1021,6 +1020,7 @@ const $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberForma
|
|
|
1021
1020
|
note: "Integers must be within the safe integer range.",
|
|
1022
1021
|
inst,
|
|
1023
1022
|
origin,
|
|
1023
|
+
inclusive: true,
|
|
1024
1024
|
continue: !def.abort
|
|
1025
1025
|
});
|
|
1026
1026
|
else payload.issues.push({
|
|
@@ -1030,6 +1030,7 @@ const $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberForma
|
|
|
1030
1030
|
note: "Integers must be within the safe integer range.",
|
|
1031
1031
|
inst,
|
|
1032
1032
|
origin,
|
|
1033
|
+
inclusive: true,
|
|
1033
1034
|
continue: !def.abort
|
|
1034
1035
|
});
|
|
1035
1036
|
return;
|
|
@@ -1049,7 +1050,9 @@ const $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberForma
|
|
|
1049
1050
|
input,
|
|
1050
1051
|
code: "too_big",
|
|
1051
1052
|
maximum,
|
|
1052
|
-
|
|
1053
|
+
inclusive: true,
|
|
1054
|
+
inst,
|
|
1055
|
+
continue: !def.abort
|
|
1053
1056
|
});
|
|
1054
1057
|
};
|
|
1055
1058
|
});
|
|
@@ -1266,7 +1269,7 @@ const $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (i
|
|
|
1266
1269
|
});
|
|
1267
1270
|
|
|
1268
1271
|
//#endregion
|
|
1269
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
1272
|
+
//#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/doc.js
|
|
1270
1273
|
var Doc = class {
|
|
1271
1274
|
constructor(args = []) {
|
|
1272
1275
|
this.content = [];
|
|
@@ -1298,15 +1301,15 @@ var Doc = class {
|
|
|
1298
1301
|
};
|
|
1299
1302
|
|
|
1300
1303
|
//#endregion
|
|
1301
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
1304
|
+
//#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/versions.js
|
|
1302
1305
|
const version$1 = {
|
|
1303
1306
|
major: 4,
|
|
1304
|
-
minor:
|
|
1305
|
-
patch:
|
|
1307
|
+
minor: 3,
|
|
1308
|
+
patch: 5
|
|
1306
1309
|
};
|
|
1307
1310
|
|
|
1308
1311
|
//#endregion
|
|
1309
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
1312
|
+
//#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/schemas.js
|
|
1310
1313
|
const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
1311
1314
|
var _a$1;
|
|
1312
1315
|
inst ?? (inst = {});
|
|
@@ -1382,7 +1385,7 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
1382
1385
|
return runChecks(result, checks, ctx);
|
|
1383
1386
|
};
|
|
1384
1387
|
}
|
|
1385
|
-
inst
|
|
1388
|
+
defineLazy(inst, "~standard", () => ({
|
|
1386
1389
|
validate: (value) => {
|
|
1387
1390
|
try {
|
|
1388
1391
|
const r = safeParse$1(inst, value);
|
|
@@ -1393,7 +1396,7 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
1393
1396
|
},
|
|
1394
1397
|
vendor: "zod",
|
|
1395
1398
|
version: 1
|
|
1396
|
-
};
|
|
1399
|
+
}));
|
|
1397
1400
|
});
|
|
1398
1401
|
const $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
1399
1402
|
$ZodType.init(inst, def);
|
|
@@ -1770,8 +1773,11 @@ const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
1770
1773
|
return payload;
|
|
1771
1774
|
};
|
|
1772
1775
|
});
|
|
1773
|
-
function handlePropertyResult(result, final, key, input) {
|
|
1774
|
-
if (result.issues.length)
|
|
1776
|
+
function handlePropertyResult(result, final, key, input, isOptionalOut) {
|
|
1777
|
+
if (result.issues.length) {
|
|
1778
|
+
if (isOptionalOut && !(key in input)) return;
|
|
1779
|
+
final.issues.push(...prefixIssues(key, result.issues));
|
|
1780
|
+
}
|
|
1775
1781
|
if (result.value === void 0) {
|
|
1776
1782
|
if (key in input) final.value[key] = void 0;
|
|
1777
1783
|
} else final.value[key] = result.value;
|
|
@@ -1793,6 +1799,7 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
1793
1799
|
const keySet = def.keySet;
|
|
1794
1800
|
const _catchall = def.catchall._zod;
|
|
1795
1801
|
const t = _catchall.def.type;
|
|
1802
|
+
const isOptionalOut = _catchall.optout === "optional";
|
|
1796
1803
|
for (const key in input) {
|
|
1797
1804
|
if (keySet.has(key)) continue;
|
|
1798
1805
|
if (t === "never") {
|
|
@@ -1803,8 +1810,8 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
1803
1810
|
value: input[key],
|
|
1804
1811
|
issues: []
|
|
1805
1812
|
}, ctx);
|
|
1806
|
-
if (r instanceof Promise) proms.push(r.then((r$1) => handlePropertyResult(r$1, payload, key, input)));
|
|
1807
|
-
else handlePropertyResult(r, payload, key, input);
|
|
1813
|
+
if (r instanceof Promise) proms.push(r.then((r$1) => handlePropertyResult(r$1, payload, key, input, isOptionalOut)));
|
|
1814
|
+
else handlePropertyResult(r, payload, key, input, isOptionalOut);
|
|
1808
1815
|
}
|
|
1809
1816
|
if (unrecognized.length) payload.issues.push({
|
|
1810
1817
|
code: "unrecognized_keys",
|
|
@@ -1859,12 +1866,14 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
1859
1866
|
const proms = [];
|
|
1860
1867
|
const shape = value.shape;
|
|
1861
1868
|
for (const key of value.keys) {
|
|
1862
|
-
const
|
|
1869
|
+
const el = shape[key];
|
|
1870
|
+
const isOptionalOut = el._zod.optout === "optional";
|
|
1871
|
+
const r = el._zod.run({
|
|
1863
1872
|
value: input[key],
|
|
1864
1873
|
issues: []
|
|
1865
1874
|
}, ctx);
|
|
1866
|
-
if (r instanceof Promise) proms.push(r.then((r$1) => handlePropertyResult(r$1, payload, key, input)));
|
|
1867
|
-
else handlePropertyResult(r, payload, key, input);
|
|
1875
|
+
if (r instanceof Promise) proms.push(r.then((r$1) => handlePropertyResult(r$1, payload, key, input, isOptionalOut)));
|
|
1876
|
+
else handlePropertyResult(r, payload, key, input, isOptionalOut);
|
|
1868
1877
|
}
|
|
1869
1878
|
if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
1870
1879
|
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
|
|
@@ -1893,8 +1902,28 @@ const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def)
|
|
|
1893
1902
|
for (const key of normalized.keys) {
|
|
1894
1903
|
const id = ids[key];
|
|
1895
1904
|
const k = esc(key);
|
|
1905
|
+
const isOptionalOut = shape[key]?._zod?.optout === "optional";
|
|
1896
1906
|
doc.write(`const ${id} = ${parseStr(key)};`);
|
|
1897
|
-
doc.write(`
|
|
1907
|
+
if (isOptionalOut) doc.write(`
|
|
1908
|
+
if (${id}.issues.length) {
|
|
1909
|
+
if (${k} in input) {
|
|
1910
|
+
payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
|
1911
|
+
...iss,
|
|
1912
|
+
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
1913
|
+
})));
|
|
1914
|
+
}
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1917
|
+
if (${id}.value === undefined) {
|
|
1918
|
+
if (${k} in input) {
|
|
1919
|
+
newResult[${k}] = undefined;
|
|
1920
|
+
}
|
|
1921
|
+
} else {
|
|
1922
|
+
newResult[${k}] = ${id}.value;
|
|
1923
|
+
}
|
|
1924
|
+
|
|
1925
|
+
`);
|
|
1926
|
+
else doc.write(`
|
|
1898
1927
|
if (${id}.issues.length) {
|
|
1899
1928
|
payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
|
1900
1929
|
...iss,
|
|
@@ -1902,7 +1931,6 @@ const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def)
|
|
|
1902
1931
|
})));
|
|
1903
1932
|
}
|
|
1904
1933
|
|
|
1905
|
-
|
|
1906
1934
|
if (${id}.value === undefined) {
|
|
1907
1935
|
if (${k} in input) {
|
|
1908
1936
|
newResult[${k}] = undefined;
|
|
@@ -2076,8 +2104,25 @@ function mergeValues(a, b) {
|
|
|
2076
2104
|
};
|
|
2077
2105
|
}
|
|
2078
2106
|
function handleIntersectionResults(result, left, right) {
|
|
2079
|
-
|
|
2080
|
-
|
|
2107
|
+
const unrecKeys = /* @__PURE__ */ new Map();
|
|
2108
|
+
let unrecIssue;
|
|
2109
|
+
for (const iss of left.issues) if (iss.code === "unrecognized_keys") {
|
|
2110
|
+
unrecIssue ?? (unrecIssue = iss);
|
|
2111
|
+
for (const k of iss.keys) {
|
|
2112
|
+
if (!unrecKeys.has(k)) unrecKeys.set(k, {});
|
|
2113
|
+
unrecKeys.get(k).l = true;
|
|
2114
|
+
}
|
|
2115
|
+
} else result.issues.push(iss);
|
|
2116
|
+
for (const iss of right.issues) if (iss.code === "unrecognized_keys") for (const k of iss.keys) {
|
|
2117
|
+
if (!unrecKeys.has(k)) unrecKeys.set(k, {});
|
|
2118
|
+
unrecKeys.get(k).r = true;
|
|
2119
|
+
}
|
|
2120
|
+
else result.issues.push(iss);
|
|
2121
|
+
const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);
|
|
2122
|
+
if (bothKeys.length && unrecIssue) result.issues.push({
|
|
2123
|
+
...unrecIssue,
|
|
2124
|
+
keys: bothKeys
|
|
2125
|
+
});
|
|
2081
2126
|
if (aborted(result)) return result;
|
|
2082
2127
|
const merged = mergeValues(left.value, right.value);
|
|
2083
2128
|
if (!merged.valid) throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
|
|
@@ -2132,11 +2177,19 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
2132
2177
|
payload.value = {};
|
|
2133
2178
|
for (const key of Reflect.ownKeys(input)) {
|
|
2134
2179
|
if (key === "__proto__") continue;
|
|
2135
|
-
|
|
2180
|
+
let keyResult = def.keyType._zod.run({
|
|
2136
2181
|
value: key,
|
|
2137
2182
|
issues: []
|
|
2138
2183
|
}, ctx);
|
|
2139
2184
|
if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
2185
|
+
if (typeof key === "string" && number$1.test(key) && keyResult.issues.length && keyResult.issues.some((iss) => iss.code === "invalid_type" && iss.expected === "number")) {
|
|
2186
|
+
const retryResult = def.keyType._zod.run({
|
|
2187
|
+
value: Number(key),
|
|
2188
|
+
issues: []
|
|
2189
|
+
}, ctx);
|
|
2190
|
+
if (retryResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
2191
|
+
if (retryResult.issues.length === 0) keyResult = retryResult;
|
|
2192
|
+
}
|
|
2140
2193
|
if (keyResult.issues.length) {
|
|
2141
2194
|
if (def.mode === "loose") payload.value[key] = input[key];
|
|
2142
2195
|
else payload.issues.push({
|
|
@@ -2227,6 +2280,14 @@ const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) =>
|
|
|
2227
2280
|
return def.innerType._zod.run(payload, ctx);
|
|
2228
2281
|
};
|
|
2229
2282
|
});
|
|
2283
|
+
const $ZodExactOptional = /* @__PURE__ */ $constructor("$ZodExactOptional", (inst, def) => {
|
|
2284
|
+
$ZodOptional.init(inst, def);
|
|
2285
|
+
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
2286
|
+
defineLazy(inst._zod, "pattern", () => def.innerType._zod.pattern);
|
|
2287
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2288
|
+
return def.innerType._zod.run(payload, ctx);
|
|
2289
|
+
};
|
|
2290
|
+
});
|
|
2230
2291
|
const $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => {
|
|
2231
2292
|
$ZodType.init(inst, def);
|
|
2232
2293
|
defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
|
|
@@ -2411,7 +2472,7 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
2411
2472
|
}
|
|
2412
2473
|
|
|
2413
2474
|
//#endregion
|
|
2414
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
2475
|
+
//#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/registries.js
|
|
2415
2476
|
var _a;
|
|
2416
2477
|
var $ZodRegistry = class {
|
|
2417
2478
|
constructor() {
|
|
@@ -2421,10 +2482,7 @@ var $ZodRegistry = class {
|
|
|
2421
2482
|
add(schema, ..._meta) {
|
|
2422
2483
|
const meta$2 = _meta[0];
|
|
2423
2484
|
this._map.set(schema, meta$2);
|
|
2424
|
-
if (meta$2 && typeof meta$2 === "object" && "id" in meta$2)
|
|
2425
|
-
if (this._idmap.has(meta$2.id)) throw new Error(`ID ${meta$2.id} already exists in the registry`);
|
|
2426
|
-
this._idmap.set(meta$2.id, schema);
|
|
2427
|
-
}
|
|
2485
|
+
if (meta$2 && typeof meta$2 === "object" && "id" in meta$2) this._idmap.set(meta$2.id, schema);
|
|
2428
2486
|
return this;
|
|
2429
2487
|
}
|
|
2430
2488
|
clear() {
|
|
@@ -2462,13 +2520,15 @@ function registry() {
|
|
|
2462
2520
|
const globalRegistry = globalThis.__zod_globalRegistry;
|
|
2463
2521
|
|
|
2464
2522
|
//#endregion
|
|
2465
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
2523
|
+
//#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/api.js
|
|
2524
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2466
2525
|
function _string(Class, params) {
|
|
2467
2526
|
return new Class({
|
|
2468
2527
|
type: "string",
|
|
2469
2528
|
...normalizeParams(params)
|
|
2470
2529
|
});
|
|
2471
2530
|
}
|
|
2531
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2472
2532
|
function _email(Class, params) {
|
|
2473
2533
|
return new Class({
|
|
2474
2534
|
type: "string",
|
|
@@ -2478,6 +2538,7 @@ function _email(Class, params) {
|
|
|
2478
2538
|
...normalizeParams(params)
|
|
2479
2539
|
});
|
|
2480
2540
|
}
|
|
2541
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2481
2542
|
function _guid(Class, params) {
|
|
2482
2543
|
return new Class({
|
|
2483
2544
|
type: "string",
|
|
@@ -2487,6 +2548,7 @@ function _guid(Class, params) {
|
|
|
2487
2548
|
...normalizeParams(params)
|
|
2488
2549
|
});
|
|
2489
2550
|
}
|
|
2551
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2490
2552
|
function _uuid(Class, params) {
|
|
2491
2553
|
return new Class({
|
|
2492
2554
|
type: "string",
|
|
@@ -2496,6 +2558,7 @@ function _uuid(Class, params) {
|
|
|
2496
2558
|
...normalizeParams(params)
|
|
2497
2559
|
});
|
|
2498
2560
|
}
|
|
2561
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2499
2562
|
function _uuidv4(Class, params) {
|
|
2500
2563
|
return new Class({
|
|
2501
2564
|
type: "string",
|
|
@@ -2506,6 +2569,7 @@ function _uuidv4(Class, params) {
|
|
|
2506
2569
|
...normalizeParams(params)
|
|
2507
2570
|
});
|
|
2508
2571
|
}
|
|
2572
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2509
2573
|
function _uuidv6(Class, params) {
|
|
2510
2574
|
return new Class({
|
|
2511
2575
|
type: "string",
|
|
@@ -2516,6 +2580,7 @@ function _uuidv6(Class, params) {
|
|
|
2516
2580
|
...normalizeParams(params)
|
|
2517
2581
|
});
|
|
2518
2582
|
}
|
|
2583
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2519
2584
|
function _uuidv7(Class, params) {
|
|
2520
2585
|
return new Class({
|
|
2521
2586
|
type: "string",
|
|
@@ -2526,6 +2591,7 @@ function _uuidv7(Class, params) {
|
|
|
2526
2591
|
...normalizeParams(params)
|
|
2527
2592
|
});
|
|
2528
2593
|
}
|
|
2594
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2529
2595
|
function _url(Class, params) {
|
|
2530
2596
|
return new Class({
|
|
2531
2597
|
type: "string",
|
|
@@ -2535,6 +2601,7 @@ function _url(Class, params) {
|
|
|
2535
2601
|
...normalizeParams(params)
|
|
2536
2602
|
});
|
|
2537
2603
|
}
|
|
2604
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2538
2605
|
function _emoji(Class, params) {
|
|
2539
2606
|
return new Class({
|
|
2540
2607
|
type: "string",
|
|
@@ -2544,6 +2611,7 @@ function _emoji(Class, params) {
|
|
|
2544
2611
|
...normalizeParams(params)
|
|
2545
2612
|
});
|
|
2546
2613
|
}
|
|
2614
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2547
2615
|
function _nanoid(Class, params) {
|
|
2548
2616
|
return new Class({
|
|
2549
2617
|
type: "string",
|
|
@@ -2553,6 +2621,7 @@ function _nanoid(Class, params) {
|
|
|
2553
2621
|
...normalizeParams(params)
|
|
2554
2622
|
});
|
|
2555
2623
|
}
|
|
2624
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2556
2625
|
function _cuid(Class, params) {
|
|
2557
2626
|
return new Class({
|
|
2558
2627
|
type: "string",
|
|
@@ -2562,6 +2631,7 @@ function _cuid(Class, params) {
|
|
|
2562
2631
|
...normalizeParams(params)
|
|
2563
2632
|
});
|
|
2564
2633
|
}
|
|
2634
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2565
2635
|
function _cuid2(Class, params) {
|
|
2566
2636
|
return new Class({
|
|
2567
2637
|
type: "string",
|
|
@@ -2571,6 +2641,7 @@ function _cuid2(Class, params) {
|
|
|
2571
2641
|
...normalizeParams(params)
|
|
2572
2642
|
});
|
|
2573
2643
|
}
|
|
2644
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2574
2645
|
function _ulid(Class, params) {
|
|
2575
2646
|
return new Class({
|
|
2576
2647
|
type: "string",
|
|
@@ -2580,6 +2651,7 @@ function _ulid(Class, params) {
|
|
|
2580
2651
|
...normalizeParams(params)
|
|
2581
2652
|
});
|
|
2582
2653
|
}
|
|
2654
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2583
2655
|
function _xid(Class, params) {
|
|
2584
2656
|
return new Class({
|
|
2585
2657
|
type: "string",
|
|
@@ -2589,6 +2661,7 @@ function _xid(Class, params) {
|
|
|
2589
2661
|
...normalizeParams(params)
|
|
2590
2662
|
});
|
|
2591
2663
|
}
|
|
2664
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2592
2665
|
function _ksuid(Class, params) {
|
|
2593
2666
|
return new Class({
|
|
2594
2667
|
type: "string",
|
|
@@ -2598,6 +2671,7 @@ function _ksuid(Class, params) {
|
|
|
2598
2671
|
...normalizeParams(params)
|
|
2599
2672
|
});
|
|
2600
2673
|
}
|
|
2674
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2601
2675
|
function _ipv4(Class, params) {
|
|
2602
2676
|
return new Class({
|
|
2603
2677
|
type: "string",
|
|
@@ -2607,6 +2681,7 @@ function _ipv4(Class, params) {
|
|
|
2607
2681
|
...normalizeParams(params)
|
|
2608
2682
|
});
|
|
2609
2683
|
}
|
|
2684
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2610
2685
|
function _ipv6(Class, params) {
|
|
2611
2686
|
return new Class({
|
|
2612
2687
|
type: "string",
|
|
@@ -2616,6 +2691,7 @@ function _ipv6(Class, params) {
|
|
|
2616
2691
|
...normalizeParams(params)
|
|
2617
2692
|
});
|
|
2618
2693
|
}
|
|
2694
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2619
2695
|
function _cidrv4(Class, params) {
|
|
2620
2696
|
return new Class({
|
|
2621
2697
|
type: "string",
|
|
@@ -2625,6 +2701,7 @@ function _cidrv4(Class, params) {
|
|
|
2625
2701
|
...normalizeParams(params)
|
|
2626
2702
|
});
|
|
2627
2703
|
}
|
|
2704
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2628
2705
|
function _cidrv6(Class, params) {
|
|
2629
2706
|
return new Class({
|
|
2630
2707
|
type: "string",
|
|
@@ -2634,6 +2711,7 @@ function _cidrv6(Class, params) {
|
|
|
2634
2711
|
...normalizeParams(params)
|
|
2635
2712
|
});
|
|
2636
2713
|
}
|
|
2714
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2637
2715
|
function _base64(Class, params) {
|
|
2638
2716
|
return new Class({
|
|
2639
2717
|
type: "string",
|
|
@@ -2643,6 +2721,7 @@ function _base64(Class, params) {
|
|
|
2643
2721
|
...normalizeParams(params)
|
|
2644
2722
|
});
|
|
2645
2723
|
}
|
|
2724
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2646
2725
|
function _base64url(Class, params) {
|
|
2647
2726
|
return new Class({
|
|
2648
2727
|
type: "string",
|
|
@@ -2652,6 +2731,7 @@ function _base64url(Class, params) {
|
|
|
2652
2731
|
...normalizeParams(params)
|
|
2653
2732
|
});
|
|
2654
2733
|
}
|
|
2734
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2655
2735
|
function _e164(Class, params) {
|
|
2656
2736
|
return new Class({
|
|
2657
2737
|
type: "string",
|
|
@@ -2661,6 +2741,7 @@ function _e164(Class, params) {
|
|
|
2661
2741
|
...normalizeParams(params)
|
|
2662
2742
|
});
|
|
2663
2743
|
}
|
|
2744
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2664
2745
|
function _jwt(Class, params) {
|
|
2665
2746
|
return new Class({
|
|
2666
2747
|
type: "string",
|
|
@@ -2670,6 +2751,7 @@ function _jwt(Class, params) {
|
|
|
2670
2751
|
...normalizeParams(params)
|
|
2671
2752
|
});
|
|
2672
2753
|
}
|
|
2754
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2673
2755
|
function _isoDateTime(Class, params) {
|
|
2674
2756
|
return new Class({
|
|
2675
2757
|
type: "string",
|
|
@@ -2681,6 +2763,7 @@ function _isoDateTime(Class, params) {
|
|
|
2681
2763
|
...normalizeParams(params)
|
|
2682
2764
|
});
|
|
2683
2765
|
}
|
|
2766
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2684
2767
|
function _isoDate(Class, params) {
|
|
2685
2768
|
return new Class({
|
|
2686
2769
|
type: "string",
|
|
@@ -2689,6 +2772,7 @@ function _isoDate(Class, params) {
|
|
|
2689
2772
|
...normalizeParams(params)
|
|
2690
2773
|
});
|
|
2691
2774
|
}
|
|
2775
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2692
2776
|
function _isoTime(Class, params) {
|
|
2693
2777
|
return new Class({
|
|
2694
2778
|
type: "string",
|
|
@@ -2698,6 +2782,7 @@ function _isoTime(Class, params) {
|
|
|
2698
2782
|
...normalizeParams(params)
|
|
2699
2783
|
});
|
|
2700
2784
|
}
|
|
2785
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2701
2786
|
function _isoDuration(Class, params) {
|
|
2702
2787
|
return new Class({
|
|
2703
2788
|
type: "string",
|
|
@@ -2706,6 +2791,7 @@ function _isoDuration(Class, params) {
|
|
|
2706
2791
|
...normalizeParams(params)
|
|
2707
2792
|
});
|
|
2708
2793
|
}
|
|
2794
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2709
2795
|
function _number(Class, params) {
|
|
2710
2796
|
return new Class({
|
|
2711
2797
|
type: "number",
|
|
@@ -2713,6 +2799,7 @@ function _number(Class, params) {
|
|
|
2713
2799
|
...normalizeParams(params)
|
|
2714
2800
|
});
|
|
2715
2801
|
}
|
|
2802
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2716
2803
|
function _int(Class, params) {
|
|
2717
2804
|
return new Class({
|
|
2718
2805
|
type: "number",
|
|
@@ -2722,30 +2809,36 @@ function _int(Class, params) {
|
|
|
2722
2809
|
...normalizeParams(params)
|
|
2723
2810
|
});
|
|
2724
2811
|
}
|
|
2812
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2725
2813
|
function _boolean(Class, params) {
|
|
2726
2814
|
return new Class({
|
|
2727
2815
|
type: "boolean",
|
|
2728
2816
|
...normalizeParams(params)
|
|
2729
2817
|
});
|
|
2730
2818
|
}
|
|
2819
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2731
2820
|
function _any(Class) {
|
|
2732
2821
|
return new Class({ type: "any" });
|
|
2733
2822
|
}
|
|
2823
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2734
2824
|
function _unknown(Class) {
|
|
2735
2825
|
return new Class({ type: "unknown" });
|
|
2736
2826
|
}
|
|
2827
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2737
2828
|
function _never(Class, params) {
|
|
2738
2829
|
return new Class({
|
|
2739
2830
|
type: "never",
|
|
2740
2831
|
...normalizeParams(params)
|
|
2741
2832
|
});
|
|
2742
2833
|
}
|
|
2834
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2743
2835
|
function _date(Class, params) {
|
|
2744
2836
|
return new Class({
|
|
2745
2837
|
type: "date",
|
|
2746
2838
|
...normalizeParams(params)
|
|
2747
2839
|
});
|
|
2748
2840
|
}
|
|
2841
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2749
2842
|
function _lt(value, params) {
|
|
2750
2843
|
return new $ZodCheckLessThan({
|
|
2751
2844
|
check: "less_than",
|
|
@@ -2754,6 +2847,7 @@ function _lt(value, params) {
|
|
|
2754
2847
|
inclusive: false
|
|
2755
2848
|
});
|
|
2756
2849
|
}
|
|
2850
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2757
2851
|
function _lte(value, params) {
|
|
2758
2852
|
return new $ZodCheckLessThan({
|
|
2759
2853
|
check: "less_than",
|
|
@@ -2762,6 +2856,7 @@ function _lte(value, params) {
|
|
|
2762
2856
|
inclusive: true
|
|
2763
2857
|
});
|
|
2764
2858
|
}
|
|
2859
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2765
2860
|
function _gt(value, params) {
|
|
2766
2861
|
return new $ZodCheckGreaterThan({
|
|
2767
2862
|
check: "greater_than",
|
|
@@ -2770,6 +2865,7 @@ function _gt(value, params) {
|
|
|
2770
2865
|
inclusive: false
|
|
2771
2866
|
});
|
|
2772
2867
|
}
|
|
2868
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2773
2869
|
function _gte(value, params) {
|
|
2774
2870
|
return new $ZodCheckGreaterThan({
|
|
2775
2871
|
check: "greater_than",
|
|
@@ -2778,6 +2874,7 @@ function _gte(value, params) {
|
|
|
2778
2874
|
inclusive: true
|
|
2779
2875
|
});
|
|
2780
2876
|
}
|
|
2877
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2781
2878
|
function _multipleOf(value, params) {
|
|
2782
2879
|
return new $ZodCheckMultipleOf({
|
|
2783
2880
|
check: "multiple_of",
|
|
@@ -2785,6 +2882,7 @@ function _multipleOf(value, params) {
|
|
|
2785
2882
|
value
|
|
2786
2883
|
});
|
|
2787
2884
|
}
|
|
2885
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2788
2886
|
function _maxLength(maximum, params) {
|
|
2789
2887
|
return new $ZodCheckMaxLength({
|
|
2790
2888
|
check: "max_length",
|
|
@@ -2792,6 +2890,7 @@ function _maxLength(maximum, params) {
|
|
|
2792
2890
|
maximum
|
|
2793
2891
|
});
|
|
2794
2892
|
}
|
|
2893
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2795
2894
|
function _minLength(minimum, params) {
|
|
2796
2895
|
return new $ZodCheckMinLength({
|
|
2797
2896
|
check: "min_length",
|
|
@@ -2799,6 +2898,7 @@ function _minLength(minimum, params) {
|
|
|
2799
2898
|
minimum
|
|
2800
2899
|
});
|
|
2801
2900
|
}
|
|
2901
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2802
2902
|
function _length(length, params) {
|
|
2803
2903
|
return new $ZodCheckLengthEquals({
|
|
2804
2904
|
check: "length_equals",
|
|
@@ -2806,6 +2906,7 @@ function _length(length, params) {
|
|
|
2806
2906
|
length
|
|
2807
2907
|
});
|
|
2808
2908
|
}
|
|
2909
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2809
2910
|
function _regex(pattern, params) {
|
|
2810
2911
|
return new $ZodCheckRegex({
|
|
2811
2912
|
check: "string_format",
|
|
@@ -2814,6 +2915,7 @@ function _regex(pattern, params) {
|
|
|
2814
2915
|
pattern
|
|
2815
2916
|
});
|
|
2816
2917
|
}
|
|
2918
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2817
2919
|
function _lowercase(params) {
|
|
2818
2920
|
return new $ZodCheckLowerCase({
|
|
2819
2921
|
check: "string_format",
|
|
@@ -2821,6 +2923,7 @@ function _lowercase(params) {
|
|
|
2821
2923
|
...normalizeParams(params)
|
|
2822
2924
|
});
|
|
2823
2925
|
}
|
|
2926
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2824
2927
|
function _uppercase(params) {
|
|
2825
2928
|
return new $ZodCheckUpperCase({
|
|
2826
2929
|
check: "string_format",
|
|
@@ -2828,6 +2931,7 @@ function _uppercase(params) {
|
|
|
2828
2931
|
...normalizeParams(params)
|
|
2829
2932
|
});
|
|
2830
2933
|
}
|
|
2934
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2831
2935
|
function _includes(includes, params) {
|
|
2832
2936
|
return new $ZodCheckIncludes({
|
|
2833
2937
|
check: "string_format",
|
|
@@ -2836,6 +2940,7 @@ function _includes(includes, params) {
|
|
|
2836
2940
|
includes
|
|
2837
2941
|
});
|
|
2838
2942
|
}
|
|
2943
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2839
2944
|
function _startsWith(prefix, params) {
|
|
2840
2945
|
return new $ZodCheckStartsWith({
|
|
2841
2946
|
check: "string_format",
|
|
@@ -2844,6 +2949,7 @@ function _startsWith(prefix, params) {
|
|
|
2844
2949
|
prefix
|
|
2845
2950
|
});
|
|
2846
2951
|
}
|
|
2952
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2847
2953
|
function _endsWith(suffix, params) {
|
|
2848
2954
|
return new $ZodCheckEndsWith({
|
|
2849
2955
|
check: "string_format",
|
|
@@ -2852,27 +2958,34 @@ function _endsWith(suffix, params) {
|
|
|
2852
2958
|
suffix
|
|
2853
2959
|
});
|
|
2854
2960
|
}
|
|
2961
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2855
2962
|
function _overwrite(tx) {
|
|
2856
2963
|
return new $ZodCheckOverwrite({
|
|
2857
2964
|
check: "overwrite",
|
|
2858
2965
|
tx
|
|
2859
2966
|
});
|
|
2860
2967
|
}
|
|
2968
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2861
2969
|
function _normalize(form) {
|
|
2862
|
-
return _overwrite((input) => input.normalize(form));
|
|
2970
|
+
return /* @__PURE__ */ _overwrite((input) => input.normalize(form));
|
|
2863
2971
|
}
|
|
2972
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2864
2973
|
function _trim() {
|
|
2865
|
-
return _overwrite((input) => input.trim());
|
|
2974
|
+
return /* @__PURE__ */ _overwrite((input) => input.trim());
|
|
2866
2975
|
}
|
|
2976
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2867
2977
|
function _toLowerCase() {
|
|
2868
|
-
return _overwrite((input) => input.toLowerCase());
|
|
2978
|
+
return /* @__PURE__ */ _overwrite((input) => input.toLowerCase());
|
|
2869
2979
|
}
|
|
2980
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2870
2981
|
function _toUpperCase() {
|
|
2871
|
-
return _overwrite((input) => input.toUpperCase());
|
|
2982
|
+
return /* @__PURE__ */ _overwrite((input) => input.toUpperCase());
|
|
2872
2983
|
}
|
|
2984
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2873
2985
|
function _slugify() {
|
|
2874
|
-
return _overwrite((input) => slugify(input));
|
|
2986
|
+
return /* @__PURE__ */ _overwrite((input) => slugify(input));
|
|
2875
2987
|
}
|
|
2988
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2876
2989
|
function _array(Class, element, params) {
|
|
2877
2990
|
return new Class({
|
|
2878
2991
|
type: "array",
|
|
@@ -2880,6 +2993,7 @@ function _array(Class, element, params) {
|
|
|
2880
2993
|
...normalizeParams(params)
|
|
2881
2994
|
});
|
|
2882
2995
|
}
|
|
2996
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2883
2997
|
function _refine(Class, fn, _params) {
|
|
2884
2998
|
return new Class({
|
|
2885
2999
|
type: "custom",
|
|
@@ -2888,8 +3002,9 @@ function _refine(Class, fn, _params) {
|
|
|
2888
3002
|
...normalizeParams(_params)
|
|
2889
3003
|
});
|
|
2890
3004
|
}
|
|
3005
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2891
3006
|
function _superRefine(fn) {
|
|
2892
|
-
const ch = _check((payload) => {
|
|
3007
|
+
const ch = /* @__PURE__ */ _check((payload) => {
|
|
2893
3008
|
payload.addIssue = (issue$1) => {
|
|
2894
3009
|
if (typeof issue$1 === "string") payload.issues.push(issue(issue$1, payload.value, ch._zod.def));
|
|
2895
3010
|
else {
|
|
@@ -2906,6 +3021,7 @@ function _superRefine(fn) {
|
|
|
2906
3021
|
});
|
|
2907
3022
|
return ch;
|
|
2908
3023
|
}
|
|
3024
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2909
3025
|
function _check(fn, params) {
|
|
2910
3026
|
const ch = new $ZodCheck({
|
|
2911
3027
|
check: "custom",
|
|
@@ -2914,6 +3030,7 @@ function _check(fn, params) {
|
|
|
2914
3030
|
ch._zod.check = fn;
|
|
2915
3031
|
return ch;
|
|
2916
3032
|
}
|
|
3033
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2917
3034
|
function describe$1(description) {
|
|
2918
3035
|
const ch = new $ZodCheck({ check: "describe" });
|
|
2919
3036
|
ch._zod.onattach = [(inst) => {
|
|
@@ -2926,6 +3043,7 @@ function describe$1(description) {
|
|
|
2926
3043
|
ch._zod.check = () => {};
|
|
2927
3044
|
return ch;
|
|
2928
3045
|
}
|
|
3046
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2929
3047
|
function meta$1(metadata) {
|
|
2930
3048
|
const ch = new $ZodCheck({ check: "meta" });
|
|
2931
3049
|
ch._zod.onattach = [(inst) => {
|
|
@@ -2940,7 +3058,7 @@ function meta$1(metadata) {
|
|
|
2940
3058
|
}
|
|
2941
3059
|
|
|
2942
3060
|
//#endregion
|
|
2943
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
3061
|
+
//#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/to-json-schema.js
|
|
2944
3062
|
function initializeContext(params) {
|
|
2945
3063
|
let target = params?.target ?? "draft-2020-12";
|
|
2946
3064
|
if (target === "draft-4") target = "draft-04";
|
|
@@ -2986,18 +3104,19 @@ function process$1(schema, ctx, _params = {
|
|
|
2986
3104
|
schemaPath: [..._params.schemaPath, schema],
|
|
2987
3105
|
path: _params.path
|
|
2988
3106
|
};
|
|
2989
|
-
|
|
2990
|
-
if (parent) {
|
|
2991
|
-
result.ref = parent;
|
|
2992
|
-
process$1(parent, ctx, params);
|
|
2993
|
-
ctx.seen.get(parent).isParent = true;
|
|
2994
|
-
} else if (schema._zod.processJSONSchema) schema._zod.processJSONSchema(ctx, result.schema, params);
|
|
3107
|
+
if (schema._zod.processJSONSchema) schema._zod.processJSONSchema(ctx, result.schema, params);
|
|
2995
3108
|
else {
|
|
2996
3109
|
const _json = result.schema;
|
|
2997
3110
|
const processor = ctx.processors[def.type];
|
|
2998
3111
|
if (!processor) throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);
|
|
2999
3112
|
processor(schema, ctx, _json, params);
|
|
3000
3113
|
}
|
|
3114
|
+
const parent = schema._zod.parent;
|
|
3115
|
+
if (parent) {
|
|
3116
|
+
if (!result.ref) result.ref = parent;
|
|
3117
|
+
process$1(parent, ctx, params);
|
|
3118
|
+
ctx.seen.get(parent).isParent = true;
|
|
3119
|
+
}
|
|
3001
3120
|
}
|
|
3002
3121
|
const meta$2 = ctx.metadataRegistry.get(schema);
|
|
3003
3122
|
if (meta$2) Object.assign(result.schema, meta$2);
|
|
@@ -3012,6 +3131,15 @@ function process$1(schema, ctx, _params = {
|
|
|
3012
3131
|
function extractDefs(ctx, schema) {
|
|
3013
3132
|
const root = ctx.seen.get(schema);
|
|
3014
3133
|
if (!root) throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
3134
|
+
const idToSchema = /* @__PURE__ */ new Map();
|
|
3135
|
+
for (const entry of ctx.seen.entries()) {
|
|
3136
|
+
const id = ctx.metadataRegistry.get(entry[0])?.id;
|
|
3137
|
+
if (id) {
|
|
3138
|
+
const existing = idToSchema.get(id);
|
|
3139
|
+
if (existing && existing !== entry[0]) throw new Error(`Duplicate schema id "${id}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
3140
|
+
idToSchema.set(id, entry[0]);
|
|
3141
|
+
}
|
|
3142
|
+
}
|
|
3015
3143
|
const makeURI = (entry) => {
|
|
3016
3144
|
const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
3017
3145
|
if (ctx.external) {
|
|
@@ -3083,23 +3211,42 @@ function finalize(ctx, schema) {
|
|
|
3083
3211
|
if (!root) throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
3084
3212
|
const flattenRef = (zodSchema) => {
|
|
3085
3213
|
const seen = ctx.seen.get(zodSchema);
|
|
3214
|
+
if (seen.ref === null) return;
|
|
3086
3215
|
const schema$1 = seen.def ?? seen.schema;
|
|
3087
3216
|
const _cached = { ...schema$1 };
|
|
3088
|
-
if (seen.ref === null) return;
|
|
3089
3217
|
const ref = seen.ref;
|
|
3090
3218
|
seen.ref = null;
|
|
3091
3219
|
if (ref) {
|
|
3092
3220
|
flattenRef(ref);
|
|
3093
|
-
const
|
|
3221
|
+
const refSeen = ctx.seen.get(ref);
|
|
3222
|
+
const refSchema = refSeen.schema;
|
|
3094
3223
|
if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
|
|
3095
3224
|
schema$1.allOf = schema$1.allOf ?? [];
|
|
3096
3225
|
schema$1.allOf.push(refSchema);
|
|
3097
|
-
} else
|
|
3098
|
-
|
|
3099
|
-
|
|
3226
|
+
} else Object.assign(schema$1, refSchema);
|
|
3227
|
+
Object.assign(schema$1, _cached);
|
|
3228
|
+
if (zodSchema._zod.parent === ref) for (const key in schema$1) {
|
|
3229
|
+
if (key === "$ref" || key === "allOf") continue;
|
|
3230
|
+
if (!(key in _cached)) delete schema$1[key];
|
|
3231
|
+
}
|
|
3232
|
+
if (refSchema.$ref) for (const key in schema$1) {
|
|
3233
|
+
if (key === "$ref" || key === "allOf") continue;
|
|
3234
|
+
if (key in refSeen.def && JSON.stringify(schema$1[key]) === JSON.stringify(refSeen.def[key])) delete schema$1[key];
|
|
3235
|
+
}
|
|
3236
|
+
}
|
|
3237
|
+
const parent = zodSchema._zod.parent;
|
|
3238
|
+
if (parent && parent !== ref) {
|
|
3239
|
+
flattenRef(parent);
|
|
3240
|
+
const parentSeen = ctx.seen.get(parent);
|
|
3241
|
+
if (parentSeen?.schema.$ref) {
|
|
3242
|
+
schema$1.$ref = parentSeen.schema.$ref;
|
|
3243
|
+
if (parentSeen.def) for (const key in schema$1) {
|
|
3244
|
+
if (key === "$ref" || key === "allOf") continue;
|
|
3245
|
+
if (key in parentSeen.def && JSON.stringify(schema$1[key]) === JSON.stringify(parentSeen.def[key])) delete schema$1[key];
|
|
3246
|
+
}
|
|
3100
3247
|
}
|
|
3101
3248
|
}
|
|
3102
|
-
|
|
3249
|
+
ctx.override({
|
|
3103
3250
|
zodSchema,
|
|
3104
3251
|
jsonSchema: schema$1,
|
|
3105
3252
|
path: seen.path ?? []
|
|
@@ -3130,8 +3277,8 @@ function finalize(ctx, schema) {
|
|
|
3130
3277
|
value: {
|
|
3131
3278
|
...schema["~standard"],
|
|
3132
3279
|
jsonSchema: {
|
|
3133
|
-
input: createStandardJSONSchemaMethod(schema, "input"),
|
|
3134
|
-
output: createStandardJSONSchemaMethod(schema, "output")
|
|
3280
|
+
input: createStandardJSONSchemaMethod(schema, "input", ctx.processors),
|
|
3281
|
+
output: createStandardJSONSchemaMethod(schema, "output", ctx.processors)
|
|
3135
3282
|
}
|
|
3136
3283
|
},
|
|
3137
3284
|
enumerable: false,
|
|
@@ -3183,13 +3330,13 @@ const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
|
3183
3330
|
extractDefs(ctx, schema);
|
|
3184
3331
|
return finalize(ctx, schema);
|
|
3185
3332
|
};
|
|
3186
|
-
const createStandardJSONSchemaMethod = (schema, io) => (params) => {
|
|
3333
|
+
const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
|
|
3187
3334
|
const { libraryOptions, target } = params ?? {};
|
|
3188
3335
|
const ctx = initializeContext({
|
|
3189
3336
|
...libraryOptions ?? {},
|
|
3190
3337
|
target,
|
|
3191
3338
|
io,
|
|
3192
|
-
processors
|
|
3339
|
+
processors
|
|
3193
3340
|
});
|
|
3194
3341
|
process$1(schema, ctx);
|
|
3195
3342
|
extractDefs(ctx, schema);
|
|
@@ -3197,7 +3344,7 @@ const createStandardJSONSchemaMethod = (schema, io) => (params) => {
|
|
|
3197
3344
|
};
|
|
3198
3345
|
|
|
3199
3346
|
//#endregion
|
|
3200
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
3347
|
+
//#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/json-schema-processors.js
|
|
3201
3348
|
const formatMap = {
|
|
3202
3349
|
guid: "uuid",
|
|
3203
3350
|
url: "uri",
|
|
@@ -3214,6 +3361,7 @@ const stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
3214
3361
|
if (format) {
|
|
3215
3362
|
json.format = formatMap[format] ?? format;
|
|
3216
3363
|
if (json.format === "") delete json.format;
|
|
3364
|
+
if (format === "time") delete json.format;
|
|
3217
3365
|
}
|
|
3218
3366
|
if (contentEncoding) json.contentEncoding = contentEncoding;
|
|
3219
3367
|
if (patterns && patterns.size > 0) {
|
|
@@ -3354,14 +3502,34 @@ const recordProcessor = (schema, ctx, _json, params) => {
|
|
|
3354
3502
|
const json = _json;
|
|
3355
3503
|
const def = schema._zod.def;
|
|
3356
3504
|
json.type = "object";
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3505
|
+
const keyType = def.keyType;
|
|
3506
|
+
const patterns = keyType._zod.bag?.patterns;
|
|
3507
|
+
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
3508
|
+
const valueSchema = process$1(def.valueType, ctx, {
|
|
3509
|
+
...params,
|
|
3510
|
+
path: [
|
|
3511
|
+
...params.path,
|
|
3512
|
+
"patternProperties",
|
|
3513
|
+
"*"
|
|
3514
|
+
]
|
|
3515
|
+
});
|
|
3516
|
+
json.patternProperties = {};
|
|
3517
|
+
for (const pattern of patterns) json.patternProperties[pattern.source] = valueSchema;
|
|
3518
|
+
} else {
|
|
3519
|
+
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process$1(def.keyType, ctx, {
|
|
3520
|
+
...params,
|
|
3521
|
+
path: [...params.path, "propertyNames"]
|
|
3522
|
+
});
|
|
3523
|
+
json.additionalProperties = process$1(def.valueType, ctx, {
|
|
3524
|
+
...params,
|
|
3525
|
+
path: [...params.path, "additionalProperties"]
|
|
3526
|
+
});
|
|
3527
|
+
}
|
|
3528
|
+
const keyValues = keyType._zod.values;
|
|
3529
|
+
if (keyValues) {
|
|
3530
|
+
const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
|
|
3531
|
+
if (validKeyValues.length > 0) json.required = validKeyValues;
|
|
3532
|
+
}
|
|
3365
3533
|
};
|
|
3366
3534
|
const nullableProcessor = (schema, ctx, json, params) => {
|
|
3367
3535
|
const def = schema._zod.def;
|
|
@@ -3433,7 +3601,7 @@ const lazyProcessor = (schema, ctx, _json, params) => {
|
|
|
3433
3601
|
};
|
|
3434
3602
|
|
|
3435
3603
|
//#endregion
|
|
3436
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
3604
|
+
//#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/iso.js
|
|
3437
3605
|
const ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
|
|
3438
3606
|
$ZodISODateTime.init(inst, def);
|
|
3439
3607
|
ZodStringFormat.init(inst, def);
|
|
@@ -3464,7 +3632,7 @@ function duration(params) {
|
|
|
3464
3632
|
}
|
|
3465
3633
|
|
|
3466
3634
|
//#endregion
|
|
3467
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
3635
|
+
//#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/errors.js
|
|
3468
3636
|
const initializer = (inst, issues) => {
|
|
3469
3637
|
$ZodError.init(inst, issues);
|
|
3470
3638
|
inst.name = "ZodError";
|
|
@@ -3488,7 +3656,7 @@ const ZodError = $constructor("ZodError", initializer);
|
|
|
3488
3656
|
const ZodRealError = $constructor("ZodError", initializer, { Parent: Error });
|
|
3489
3657
|
|
|
3490
3658
|
//#endregion
|
|
3491
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
3659
|
+
//#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/parse.js
|
|
3492
3660
|
const parse = /* @__PURE__ */ _parse(ZodRealError);
|
|
3493
3661
|
const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
3494
3662
|
const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -3503,7 +3671,7 @@ const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
|
3503
3671
|
const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
3504
3672
|
|
|
3505
3673
|
//#endregion
|
|
3506
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
3674
|
+
//#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/schemas.js
|
|
3507
3675
|
const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
3508
3676
|
$ZodType.init(inst, def);
|
|
3509
3677
|
Object.assign(inst["~standard"], { jsonSchema: {
|
|
@@ -3519,8 +3687,9 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
3519
3687
|
check: ch,
|
|
3520
3688
|
def: { check: "custom" },
|
|
3521
3689
|
onattach: []
|
|
3522
|
-
} } : ch)] }));
|
|
3690
|
+
} } : ch)] }), { parent: true });
|
|
3523
3691
|
};
|
|
3692
|
+
inst.with = inst.check;
|
|
3524
3693
|
inst.clone = (def$1, params) => clone(inst, def$1, params);
|
|
3525
3694
|
inst.brand = () => inst;
|
|
3526
3695
|
inst.register = ((reg, meta$2) => {
|
|
@@ -3544,6 +3713,7 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
3544
3713
|
inst.superRefine = (refinement) => inst.check(superRefine(refinement));
|
|
3545
3714
|
inst.overwrite = (fn) => inst.check(_overwrite(fn));
|
|
3546
3715
|
inst.optional = () => optional(inst);
|
|
3716
|
+
inst.exactOptional = () => exactOptional(inst);
|
|
3547
3717
|
inst.nullable = () => nullable(inst);
|
|
3548
3718
|
inst.nullish = () => optional(nullable(inst));
|
|
3549
3719
|
inst.nonoptional = (params) => nonoptional(inst, params);
|
|
@@ -3575,6 +3745,7 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
3575
3745
|
};
|
|
3576
3746
|
inst.isOptional = () => inst.safeParse(void 0).success;
|
|
3577
3747
|
inst.isNullable = () => inst.safeParse(null).success;
|
|
3748
|
+
inst.apply = (fn) => fn(inst);
|
|
3578
3749
|
return inst;
|
|
3579
3750
|
});
|
|
3580
3751
|
/** @internal */
|
|
@@ -3979,6 +4150,18 @@ function optional(innerType) {
|
|
|
3979
4150
|
innerType
|
|
3980
4151
|
});
|
|
3981
4152
|
}
|
|
4153
|
+
const ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => {
|
|
4154
|
+
$ZodExactOptional.init(inst, def);
|
|
4155
|
+
ZodType.init(inst, def);
|
|
4156
|
+
inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
|
|
4157
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
4158
|
+
});
|
|
4159
|
+
function exactOptional(innerType) {
|
|
4160
|
+
return new ZodExactOptional({
|
|
4161
|
+
type: "optional",
|
|
4162
|
+
innerType
|
|
4163
|
+
});
|
|
4164
|
+
}
|
|
3982
4165
|
const ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
|
|
3983
4166
|
$ZodNullable.init(inst, def);
|
|
3984
4167
|
ZodType.init(inst, def);
|
|
@@ -4100,7 +4283,7 @@ function superRefine(fn) {
|
|
|
4100
4283
|
}
|
|
4101
4284
|
const describe = describe$1;
|
|
4102
4285
|
const meta = meta$1;
|
|
4103
|
-
function _instanceof(cls, params = {
|
|
4286
|
+
function _instanceof(cls, params = {}) {
|
|
4104
4287
|
const inst = new ZodCustom({
|
|
4105
4288
|
type: "custom",
|
|
4106
4289
|
check: "custom",
|
|
@@ -4109,6 +4292,15 @@ function _instanceof(cls, params = { error: `Input not instance of ${cls.name}`
|
|
|
4109
4292
|
...normalizeParams(params)
|
|
4110
4293
|
});
|
|
4111
4294
|
inst._zod.bag.Class = cls;
|
|
4295
|
+
inst._zod.check = (payload) => {
|
|
4296
|
+
if (!(payload.value instanceof cls)) payload.issues.push({
|
|
4297
|
+
code: "invalid_type",
|
|
4298
|
+
expected: cls.name,
|
|
4299
|
+
input: payload.value,
|
|
4300
|
+
inst,
|
|
4301
|
+
path: [...inst._zod.def.path ?? []]
|
|
4302
|
+
});
|
|
4303
|
+
};
|
|
4112
4304
|
return inst;
|
|
4113
4305
|
}
|
|
4114
4306
|
|
|
@@ -9980,7 +10172,7 @@ const retryRequest = async (url, options, retryCount, statusCodesToRetry, timeou
|
|
|
9980
10172
|
|
|
9981
10173
|
//#endregion
|
|
9982
10174
|
//#region package.json
|
|
9983
|
-
var version = "0.
|
|
10175
|
+
var version = "0.2.0-beta.2";
|
|
9984
10176
|
|
|
9985
10177
|
//#endregion
|
|
9986
10178
|
//#region src/providers/bytez/api.ts
|