@llmops/gateway 0.1.9-beta.6 → 0.2.0-beta.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.
Files changed (3) hide show
  1. package/dist/index.cjs +309 -117
  2. package/dist/index.mjs +309 -117
  3. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -288,7 +288,7 @@ let BatchEndpoints = /* @__PURE__ */ function(BatchEndpoints$1) {
288
288
  }({});
289
289
 
290
290
  //#endregion
291
- //#region ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/core/core.js
291
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/core.js
292
292
  /** A special constant with type `never` */
293
293
  const NEVER = Object.freeze({ status: "aborted" });
294
294
  function $constructor(name, initializer$2, params) {
@@ -348,7 +348,7 @@ function config(newConfig) {
348
348
  }
349
349
 
350
350
  //#endregion
351
- //#region ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/core/util.js
351
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/util.js
352
352
  function getEnumValues(entries) {
353
353
  const numericValues = Object.values(entries).filter((v) => typeof v === "number");
354
354
  return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
@@ -496,6 +496,8 @@ const NUMBER_FORMAT_RANGES = {
496
496
  };
497
497
  function pick(schema, mask) {
498
498
  const currDef = schema._zod.def;
499
+ const checks = currDef.checks;
500
+ if (checks && checks.length > 0) throw new Error(".pick() cannot be used on object schemas containing refinements");
499
501
  return clone(schema, mergeDefs(schema._zod.def, {
500
502
  get shape() {
501
503
  const newShape = {};
@@ -512,6 +514,8 @@ function pick(schema, mask) {
512
514
  }
513
515
  function omit(schema, mask) {
514
516
  const currDef = schema._zod.def;
517
+ const checks = currDef.checks;
518
+ if (checks && checks.length > 0) throw new Error(".omit() cannot be used on object schemas containing refinements");
515
519
  return clone(schema, mergeDefs(schema._zod.def, {
516
520
  get shape() {
517
521
  const newShape = { ...schema._zod.def.shape };
@@ -529,33 +533,29 @@ function omit(schema, mask) {
529
533
  function extend(schema, shape) {
530
534
  if (!isPlainObject(shape)) throw new Error("Invalid input to extend: expected a plain object");
531
535
  const checks = schema._zod.def.checks;
532
- if (checks && checks.length > 0) throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
533
- return clone(schema, mergeDefs(schema._zod.def, {
534
- get shape() {
535
- const _shape = {
536
- ...schema._zod.def.shape,
537
- ...shape
538
- };
539
- assignProp(this, "shape", _shape);
540
- return _shape;
541
- },
542
- checks: []
543
- }));
536
+ if (checks && checks.length > 0) {
537
+ const existingShape = schema._zod.def.shape;
538
+ 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.");
539
+ }
540
+ return clone(schema, mergeDefs(schema._zod.def, { get shape() {
541
+ const _shape = {
542
+ ...schema._zod.def.shape,
543
+ ...shape
544
+ };
545
+ assignProp(this, "shape", _shape);
546
+ return _shape;
547
+ } }));
544
548
  }
545
549
  function safeExtend(schema, shape) {
546
550
  if (!isPlainObject(shape)) throw new Error("Invalid input to safeExtend: expected a plain object");
547
- return clone(schema, {
548
- ...schema._zod.def,
549
- get shape() {
550
- const _shape = {
551
- ...schema._zod.def.shape,
552
- ...shape
553
- };
554
- assignProp(this, "shape", _shape);
555
- return _shape;
556
- },
557
- checks: schema._zod.def.checks
558
- });
551
+ return clone(schema, mergeDefs(schema._zod.def, { get shape() {
552
+ const _shape = {
553
+ ...schema._zod.def.shape,
554
+ ...shape
555
+ };
556
+ assignProp(this, "shape", _shape);
557
+ return _shape;
558
+ } }));
559
559
  }
560
560
  function merge(a, b) {
561
561
  return clone(a, mergeDefs(a._zod.def, {
@@ -574,6 +574,8 @@ function merge(a, b) {
574
574
  }));
575
575
  }
576
576
  function partial(Class, schema, mask) {
577
+ const checks = schema._zod.def.checks;
578
+ if (checks && checks.length > 0) throw new Error(".partial() cannot be used on object schemas containing refinements");
577
579
  return clone(schema, mergeDefs(schema._zod.def, {
578
580
  get shape() {
579
581
  const oldShape = schema._zod.def.shape;
@@ -597,27 +599,24 @@ function partial(Class, schema, mask) {
597
599
  }));
598
600
  }
599
601
  function required(Class, schema, mask) {
600
- return clone(schema, mergeDefs(schema._zod.def, {
601
- get shape() {
602
- const oldShape = schema._zod.def.shape;
603
- const shape = { ...oldShape };
604
- if (mask) for (const key in mask) {
605
- if (!(key in shape)) throw new Error(`Unrecognized key: "${key}"`);
606
- if (!mask[key]) continue;
607
- shape[key] = new Class({
608
- type: "nonoptional",
609
- innerType: oldShape[key]
610
- });
611
- }
612
- else for (const key in oldShape) shape[key] = new Class({
602
+ return clone(schema, mergeDefs(schema._zod.def, { get shape() {
603
+ const oldShape = schema._zod.def.shape;
604
+ const shape = { ...oldShape };
605
+ if (mask) for (const key in mask) {
606
+ if (!(key in shape)) throw new Error(`Unrecognized key: "${key}"`);
607
+ if (!mask[key]) continue;
608
+ shape[key] = new Class({
613
609
  type: "nonoptional",
614
610
  innerType: oldShape[key]
615
611
  });
616
- assignProp(this, "shape", shape);
617
- return shape;
618
- },
619
- checks: []
620
- }));
612
+ }
613
+ else for (const key in oldShape) shape[key] = new Class({
614
+ type: "nonoptional",
615
+ innerType: oldShape[key]
616
+ });
617
+ assignProp(this, "shape", shape);
618
+ return shape;
619
+ } }));
621
620
  }
622
621
  function aborted(x, startIndex = 0) {
623
622
  if (x.aborted === true) return true;
@@ -663,7 +662,7 @@ function issue(...args) {
663
662
  }
664
663
 
665
664
  //#endregion
666
- //#region ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/core/errors.js
665
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/errors.js
667
666
  const initializer$1 = (inst, def) => {
668
667
  inst.name = "$ZodError";
669
668
  Object.defineProperty(inst, "_zod", {
@@ -721,7 +720,7 @@ function formatError(error, mapper = (issue$1) => issue$1.message) {
721
720
  }
722
721
 
723
722
  //#endregion
724
- //#region ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/core/parse.js
723
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/parse.js
725
724
  const _parse = (_Err) => (schema, value, _ctx, _params) => {
726
725
  const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
727
726
  const result = schema._zod.run({
@@ -825,7 +824,7 @@ const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
825
824
  const safeDecodeAsync$1 = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
826
825
 
827
826
  //#endregion
828
- //#region ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/core/regexes.js
827
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/regexes.js
829
828
  const cuid = /^[cC][^\s-]{8,}$/;
830
829
  const cuid2 = /^[0-9a-z]+$/;
831
830
  const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
@@ -855,7 +854,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-
855
854
  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])$/;
856
855
  const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
857
856
  const base64url = /^[A-Za-z0-9_-]*$/;
858
- const e164 = /^\+(?:[0-9]){6,14}[0-9]$/;
857
+ const e164 = /^\+[1-9]\d{6,14}$/;
859
858
  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])))`;
860
859
  const date$2 = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
861
860
  function timeSource(args) {
@@ -878,13 +877,13 @@ const string$1 = (params) => {
878
877
  return /* @__PURE__ */ new RegExp(`^${regex}$`);
879
878
  };
880
879
  const integer = /^-?\d+$/;
881
- const number$1 = /^-?\d+(?:\.\d+)?/;
880
+ const number$1 = /^-?\d+(?:\.\d+)?$/;
882
881
  const boolean$1 = /^(?:true|false)$/i;
883
882
  const lowercase = /^[^A-Z]*$/;
884
883
  const uppercase = /^[^a-z]*$/;
885
884
 
886
885
  //#endregion
887
- //#region ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/core/checks.js
886
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/checks.js
888
887
  const $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
889
888
  var _a$1;
890
889
  inst._zod ?? (inst._zod = {});
@@ -910,7 +909,7 @@ const $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (ins
910
909
  payload.issues.push({
911
910
  origin,
912
911
  code: "too_big",
913
- maximum: def.value,
912
+ maximum: typeof def.value === "object" ? def.value.getTime() : def.value,
914
913
  input: payload.value,
915
914
  inclusive: def.inclusive,
916
915
  inst,
@@ -932,7 +931,7 @@ const $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan"
932
931
  payload.issues.push({
933
932
  origin,
934
933
  code: "too_small",
935
- minimum: def.value,
934
+ minimum: typeof def.value === "object" ? def.value.getTime() : def.value,
936
935
  input: payload.value,
937
936
  inclusive: def.inclusive,
938
937
  inst,
@@ -994,6 +993,7 @@ const $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberForma
994
993
  note: "Integers must be within the safe integer range.",
995
994
  inst,
996
995
  origin,
996
+ inclusive: true,
997
997
  continue: !def.abort
998
998
  });
999
999
  else payload.issues.push({
@@ -1003,6 +1003,7 @@ const $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberForma
1003
1003
  note: "Integers must be within the safe integer range.",
1004
1004
  inst,
1005
1005
  origin,
1006
+ inclusive: true,
1006
1007
  continue: !def.abort
1007
1008
  });
1008
1009
  return;
@@ -1022,7 +1023,9 @@ const $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberForma
1022
1023
  input,
1023
1024
  code: "too_big",
1024
1025
  maximum,
1025
- inst
1026
+ inclusive: true,
1027
+ inst,
1028
+ continue: !def.abort
1026
1029
  });
1027
1030
  };
1028
1031
  });
@@ -1239,7 +1242,7 @@ const $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (i
1239
1242
  });
1240
1243
 
1241
1244
  //#endregion
1242
- //#region ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/core/doc.js
1245
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/doc.js
1243
1246
  var Doc = class {
1244
1247
  constructor(args = []) {
1245
1248
  this.content = [];
@@ -1271,15 +1274,15 @@ var Doc = class {
1271
1274
  };
1272
1275
 
1273
1276
  //#endregion
1274
- //#region ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/core/versions.js
1277
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/versions.js
1275
1278
  const version$1 = {
1276
1279
  major: 4,
1277
- minor: 2,
1278
- patch: 1
1280
+ minor: 3,
1281
+ patch: 5
1279
1282
  };
1280
1283
 
1281
1284
  //#endregion
1282
- //#region ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/core/schemas.js
1285
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/schemas.js
1283
1286
  const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1284
1287
  var _a$1;
1285
1288
  inst ?? (inst = {});
@@ -1355,7 +1358,7 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1355
1358
  return runChecks(result, checks, ctx);
1356
1359
  };
1357
1360
  }
1358
- inst["~standard"] = {
1361
+ defineLazy(inst, "~standard", () => ({
1359
1362
  validate: (value) => {
1360
1363
  try {
1361
1364
  const r = safeParse$1(inst, value);
@@ -1366,7 +1369,7 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1366
1369
  },
1367
1370
  vendor: "zod",
1368
1371
  version: 1
1369
- };
1372
+ }));
1370
1373
  });
1371
1374
  const $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
1372
1375
  $ZodType.init(inst, def);
@@ -1743,8 +1746,11 @@ const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
1743
1746
  return payload;
1744
1747
  };
1745
1748
  });
1746
- function handlePropertyResult(result, final, key, input) {
1747
- if (result.issues.length) final.issues.push(...prefixIssues(key, result.issues));
1749
+ function handlePropertyResult(result, final, key, input, isOptionalOut) {
1750
+ if (result.issues.length) {
1751
+ if (isOptionalOut && !(key in input)) return;
1752
+ final.issues.push(...prefixIssues(key, result.issues));
1753
+ }
1748
1754
  if (result.value === void 0) {
1749
1755
  if (key in input) final.value[key] = void 0;
1750
1756
  } else final.value[key] = result.value;
@@ -1766,6 +1772,7 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
1766
1772
  const keySet = def.keySet;
1767
1773
  const _catchall = def.catchall._zod;
1768
1774
  const t = _catchall.def.type;
1775
+ const isOptionalOut = _catchall.optout === "optional";
1769
1776
  for (const key in input) {
1770
1777
  if (keySet.has(key)) continue;
1771
1778
  if (t === "never") {
@@ -1776,8 +1783,8 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
1776
1783
  value: input[key],
1777
1784
  issues: []
1778
1785
  }, ctx);
1779
- if (r instanceof Promise) proms.push(r.then((r$1) => handlePropertyResult(r$1, payload, key, input)));
1780
- else handlePropertyResult(r, payload, key, input);
1786
+ if (r instanceof Promise) proms.push(r.then((r$1) => handlePropertyResult(r$1, payload, key, input, isOptionalOut)));
1787
+ else handlePropertyResult(r, payload, key, input, isOptionalOut);
1781
1788
  }
1782
1789
  if (unrecognized.length) payload.issues.push({
1783
1790
  code: "unrecognized_keys",
@@ -1832,12 +1839,14 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
1832
1839
  const proms = [];
1833
1840
  const shape = value.shape;
1834
1841
  for (const key of value.keys) {
1835
- const r = shape[key]._zod.run({
1842
+ const el = shape[key];
1843
+ const isOptionalOut = el._zod.optout === "optional";
1844
+ const r = el._zod.run({
1836
1845
  value: input[key],
1837
1846
  issues: []
1838
1847
  }, ctx);
1839
- if (r instanceof Promise) proms.push(r.then((r$1) => handlePropertyResult(r$1, payload, key, input)));
1840
- else handlePropertyResult(r, payload, key, input);
1848
+ if (r instanceof Promise) proms.push(r.then((r$1) => handlePropertyResult(r$1, payload, key, input, isOptionalOut)));
1849
+ else handlePropertyResult(r, payload, key, input, isOptionalOut);
1841
1850
  }
1842
1851
  if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
1843
1852
  return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
@@ -1866,8 +1875,28 @@ const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def)
1866
1875
  for (const key of normalized.keys) {
1867
1876
  const id = ids[key];
1868
1877
  const k = esc(key);
1878
+ const isOptionalOut = shape[key]?._zod?.optout === "optional";
1869
1879
  doc.write(`const ${id} = ${parseStr(key)};`);
1870
- doc.write(`
1880
+ if (isOptionalOut) doc.write(`
1881
+ if (${id}.issues.length) {
1882
+ if (${k} in input) {
1883
+ payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1884
+ ...iss,
1885
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
1886
+ })));
1887
+ }
1888
+ }
1889
+
1890
+ if (${id}.value === undefined) {
1891
+ if (${k} in input) {
1892
+ newResult[${k}] = undefined;
1893
+ }
1894
+ } else {
1895
+ newResult[${k}] = ${id}.value;
1896
+ }
1897
+
1898
+ `);
1899
+ else doc.write(`
1871
1900
  if (${id}.issues.length) {
1872
1901
  payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1873
1902
  ...iss,
@@ -1875,7 +1904,6 @@ const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def)
1875
1904
  })));
1876
1905
  }
1877
1906
 
1878
-
1879
1907
  if (${id}.value === undefined) {
1880
1908
  if (${k} in input) {
1881
1909
  newResult[${k}] = undefined;
@@ -2049,8 +2077,25 @@ function mergeValues(a, b) {
2049
2077
  };
2050
2078
  }
2051
2079
  function handleIntersectionResults(result, left, right) {
2052
- if (left.issues.length) result.issues.push(...left.issues);
2053
- if (right.issues.length) result.issues.push(...right.issues);
2080
+ const unrecKeys = /* @__PURE__ */ new Map();
2081
+ let unrecIssue;
2082
+ for (const iss of left.issues) if (iss.code === "unrecognized_keys") {
2083
+ unrecIssue ?? (unrecIssue = iss);
2084
+ for (const k of iss.keys) {
2085
+ if (!unrecKeys.has(k)) unrecKeys.set(k, {});
2086
+ unrecKeys.get(k).l = true;
2087
+ }
2088
+ } else result.issues.push(iss);
2089
+ for (const iss of right.issues) if (iss.code === "unrecognized_keys") for (const k of iss.keys) {
2090
+ if (!unrecKeys.has(k)) unrecKeys.set(k, {});
2091
+ unrecKeys.get(k).r = true;
2092
+ }
2093
+ else result.issues.push(iss);
2094
+ const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);
2095
+ if (bothKeys.length && unrecIssue) result.issues.push({
2096
+ ...unrecIssue,
2097
+ keys: bothKeys
2098
+ });
2054
2099
  if (aborted(result)) return result;
2055
2100
  const merged = mergeValues(left.value, right.value);
2056
2101
  if (!merged.valid) throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
@@ -2105,11 +2150,19 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
2105
2150
  payload.value = {};
2106
2151
  for (const key of Reflect.ownKeys(input)) {
2107
2152
  if (key === "__proto__") continue;
2108
- const keyResult = def.keyType._zod.run({
2153
+ let keyResult = def.keyType._zod.run({
2109
2154
  value: key,
2110
2155
  issues: []
2111
2156
  }, ctx);
2112
2157
  if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
2158
+ if (typeof key === "string" && number$1.test(key) && keyResult.issues.length && keyResult.issues.some((iss) => iss.code === "invalid_type" && iss.expected === "number")) {
2159
+ const retryResult = def.keyType._zod.run({
2160
+ value: Number(key),
2161
+ issues: []
2162
+ }, ctx);
2163
+ if (retryResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
2164
+ if (retryResult.issues.length === 0) keyResult = retryResult;
2165
+ }
2113
2166
  if (keyResult.issues.length) {
2114
2167
  if (def.mode === "loose") payload.value[key] = input[key];
2115
2168
  else payload.issues.push({
@@ -2200,6 +2253,14 @@ const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) =>
2200
2253
  return def.innerType._zod.run(payload, ctx);
2201
2254
  };
2202
2255
  });
2256
+ const $ZodExactOptional = /* @__PURE__ */ $constructor("$ZodExactOptional", (inst, def) => {
2257
+ $ZodOptional.init(inst, def);
2258
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2259
+ defineLazy(inst._zod, "pattern", () => def.innerType._zod.pattern);
2260
+ inst._zod.parse = (payload, ctx) => {
2261
+ return def.innerType._zod.run(payload, ctx);
2262
+ };
2263
+ });
2203
2264
  const $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => {
2204
2265
  $ZodType.init(inst, def);
2205
2266
  defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
@@ -2384,7 +2445,7 @@ function handleRefineResult(result, payload, input, inst) {
2384
2445
  }
2385
2446
 
2386
2447
  //#endregion
2387
- //#region ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/core/registries.js
2448
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/registries.js
2388
2449
  var _a;
2389
2450
  var $ZodRegistry = class {
2390
2451
  constructor() {
@@ -2394,10 +2455,7 @@ var $ZodRegistry = class {
2394
2455
  add(schema, ..._meta) {
2395
2456
  const meta$2 = _meta[0];
2396
2457
  this._map.set(schema, meta$2);
2397
- if (meta$2 && typeof meta$2 === "object" && "id" in meta$2) {
2398
- if (this._idmap.has(meta$2.id)) throw new Error(`ID ${meta$2.id} already exists in the registry`);
2399
- this._idmap.set(meta$2.id, schema);
2400
- }
2458
+ if (meta$2 && typeof meta$2 === "object" && "id" in meta$2) this._idmap.set(meta$2.id, schema);
2401
2459
  return this;
2402
2460
  }
2403
2461
  clear() {
@@ -2435,13 +2493,15 @@ function registry() {
2435
2493
  const globalRegistry = globalThis.__zod_globalRegistry;
2436
2494
 
2437
2495
  //#endregion
2438
- //#region ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/core/api.js
2496
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/api.js
2497
+ /* @__NO_SIDE_EFFECTS__ */
2439
2498
  function _string(Class, params) {
2440
2499
  return new Class({
2441
2500
  type: "string",
2442
2501
  ...normalizeParams(params)
2443
2502
  });
2444
2503
  }
2504
+ /* @__NO_SIDE_EFFECTS__ */
2445
2505
  function _email(Class, params) {
2446
2506
  return new Class({
2447
2507
  type: "string",
@@ -2451,6 +2511,7 @@ function _email(Class, params) {
2451
2511
  ...normalizeParams(params)
2452
2512
  });
2453
2513
  }
2514
+ /* @__NO_SIDE_EFFECTS__ */
2454
2515
  function _guid(Class, params) {
2455
2516
  return new Class({
2456
2517
  type: "string",
@@ -2460,6 +2521,7 @@ function _guid(Class, params) {
2460
2521
  ...normalizeParams(params)
2461
2522
  });
2462
2523
  }
2524
+ /* @__NO_SIDE_EFFECTS__ */
2463
2525
  function _uuid(Class, params) {
2464
2526
  return new Class({
2465
2527
  type: "string",
@@ -2469,6 +2531,7 @@ function _uuid(Class, params) {
2469
2531
  ...normalizeParams(params)
2470
2532
  });
2471
2533
  }
2534
+ /* @__NO_SIDE_EFFECTS__ */
2472
2535
  function _uuidv4(Class, params) {
2473
2536
  return new Class({
2474
2537
  type: "string",
@@ -2479,6 +2542,7 @@ function _uuidv4(Class, params) {
2479
2542
  ...normalizeParams(params)
2480
2543
  });
2481
2544
  }
2545
+ /* @__NO_SIDE_EFFECTS__ */
2482
2546
  function _uuidv6(Class, params) {
2483
2547
  return new Class({
2484
2548
  type: "string",
@@ -2489,6 +2553,7 @@ function _uuidv6(Class, params) {
2489
2553
  ...normalizeParams(params)
2490
2554
  });
2491
2555
  }
2556
+ /* @__NO_SIDE_EFFECTS__ */
2492
2557
  function _uuidv7(Class, params) {
2493
2558
  return new Class({
2494
2559
  type: "string",
@@ -2499,6 +2564,7 @@ function _uuidv7(Class, params) {
2499
2564
  ...normalizeParams(params)
2500
2565
  });
2501
2566
  }
2567
+ /* @__NO_SIDE_EFFECTS__ */
2502
2568
  function _url(Class, params) {
2503
2569
  return new Class({
2504
2570
  type: "string",
@@ -2508,6 +2574,7 @@ function _url(Class, params) {
2508
2574
  ...normalizeParams(params)
2509
2575
  });
2510
2576
  }
2577
+ /* @__NO_SIDE_EFFECTS__ */
2511
2578
  function _emoji(Class, params) {
2512
2579
  return new Class({
2513
2580
  type: "string",
@@ -2517,6 +2584,7 @@ function _emoji(Class, params) {
2517
2584
  ...normalizeParams(params)
2518
2585
  });
2519
2586
  }
2587
+ /* @__NO_SIDE_EFFECTS__ */
2520
2588
  function _nanoid(Class, params) {
2521
2589
  return new Class({
2522
2590
  type: "string",
@@ -2526,6 +2594,7 @@ function _nanoid(Class, params) {
2526
2594
  ...normalizeParams(params)
2527
2595
  });
2528
2596
  }
2597
+ /* @__NO_SIDE_EFFECTS__ */
2529
2598
  function _cuid(Class, params) {
2530
2599
  return new Class({
2531
2600
  type: "string",
@@ -2535,6 +2604,7 @@ function _cuid(Class, params) {
2535
2604
  ...normalizeParams(params)
2536
2605
  });
2537
2606
  }
2607
+ /* @__NO_SIDE_EFFECTS__ */
2538
2608
  function _cuid2(Class, params) {
2539
2609
  return new Class({
2540
2610
  type: "string",
@@ -2544,6 +2614,7 @@ function _cuid2(Class, params) {
2544
2614
  ...normalizeParams(params)
2545
2615
  });
2546
2616
  }
2617
+ /* @__NO_SIDE_EFFECTS__ */
2547
2618
  function _ulid(Class, params) {
2548
2619
  return new Class({
2549
2620
  type: "string",
@@ -2553,6 +2624,7 @@ function _ulid(Class, params) {
2553
2624
  ...normalizeParams(params)
2554
2625
  });
2555
2626
  }
2627
+ /* @__NO_SIDE_EFFECTS__ */
2556
2628
  function _xid(Class, params) {
2557
2629
  return new Class({
2558
2630
  type: "string",
@@ -2562,6 +2634,7 @@ function _xid(Class, params) {
2562
2634
  ...normalizeParams(params)
2563
2635
  });
2564
2636
  }
2637
+ /* @__NO_SIDE_EFFECTS__ */
2565
2638
  function _ksuid(Class, params) {
2566
2639
  return new Class({
2567
2640
  type: "string",
@@ -2571,6 +2644,7 @@ function _ksuid(Class, params) {
2571
2644
  ...normalizeParams(params)
2572
2645
  });
2573
2646
  }
2647
+ /* @__NO_SIDE_EFFECTS__ */
2574
2648
  function _ipv4(Class, params) {
2575
2649
  return new Class({
2576
2650
  type: "string",
@@ -2580,6 +2654,7 @@ function _ipv4(Class, params) {
2580
2654
  ...normalizeParams(params)
2581
2655
  });
2582
2656
  }
2657
+ /* @__NO_SIDE_EFFECTS__ */
2583
2658
  function _ipv6(Class, params) {
2584
2659
  return new Class({
2585
2660
  type: "string",
@@ -2589,6 +2664,7 @@ function _ipv6(Class, params) {
2589
2664
  ...normalizeParams(params)
2590
2665
  });
2591
2666
  }
2667
+ /* @__NO_SIDE_EFFECTS__ */
2592
2668
  function _cidrv4(Class, params) {
2593
2669
  return new Class({
2594
2670
  type: "string",
@@ -2598,6 +2674,7 @@ function _cidrv4(Class, params) {
2598
2674
  ...normalizeParams(params)
2599
2675
  });
2600
2676
  }
2677
+ /* @__NO_SIDE_EFFECTS__ */
2601
2678
  function _cidrv6(Class, params) {
2602
2679
  return new Class({
2603
2680
  type: "string",
@@ -2607,6 +2684,7 @@ function _cidrv6(Class, params) {
2607
2684
  ...normalizeParams(params)
2608
2685
  });
2609
2686
  }
2687
+ /* @__NO_SIDE_EFFECTS__ */
2610
2688
  function _base64(Class, params) {
2611
2689
  return new Class({
2612
2690
  type: "string",
@@ -2616,6 +2694,7 @@ function _base64(Class, params) {
2616
2694
  ...normalizeParams(params)
2617
2695
  });
2618
2696
  }
2697
+ /* @__NO_SIDE_EFFECTS__ */
2619
2698
  function _base64url(Class, params) {
2620
2699
  return new Class({
2621
2700
  type: "string",
@@ -2625,6 +2704,7 @@ function _base64url(Class, params) {
2625
2704
  ...normalizeParams(params)
2626
2705
  });
2627
2706
  }
2707
+ /* @__NO_SIDE_EFFECTS__ */
2628
2708
  function _e164(Class, params) {
2629
2709
  return new Class({
2630
2710
  type: "string",
@@ -2634,6 +2714,7 @@ function _e164(Class, params) {
2634
2714
  ...normalizeParams(params)
2635
2715
  });
2636
2716
  }
2717
+ /* @__NO_SIDE_EFFECTS__ */
2637
2718
  function _jwt(Class, params) {
2638
2719
  return new Class({
2639
2720
  type: "string",
@@ -2643,6 +2724,7 @@ function _jwt(Class, params) {
2643
2724
  ...normalizeParams(params)
2644
2725
  });
2645
2726
  }
2727
+ /* @__NO_SIDE_EFFECTS__ */
2646
2728
  function _isoDateTime(Class, params) {
2647
2729
  return new Class({
2648
2730
  type: "string",
@@ -2654,6 +2736,7 @@ function _isoDateTime(Class, params) {
2654
2736
  ...normalizeParams(params)
2655
2737
  });
2656
2738
  }
2739
+ /* @__NO_SIDE_EFFECTS__ */
2657
2740
  function _isoDate(Class, params) {
2658
2741
  return new Class({
2659
2742
  type: "string",
@@ -2662,6 +2745,7 @@ function _isoDate(Class, params) {
2662
2745
  ...normalizeParams(params)
2663
2746
  });
2664
2747
  }
2748
+ /* @__NO_SIDE_EFFECTS__ */
2665
2749
  function _isoTime(Class, params) {
2666
2750
  return new Class({
2667
2751
  type: "string",
@@ -2671,6 +2755,7 @@ function _isoTime(Class, params) {
2671
2755
  ...normalizeParams(params)
2672
2756
  });
2673
2757
  }
2758
+ /* @__NO_SIDE_EFFECTS__ */
2674
2759
  function _isoDuration(Class, params) {
2675
2760
  return new Class({
2676
2761
  type: "string",
@@ -2679,6 +2764,7 @@ function _isoDuration(Class, params) {
2679
2764
  ...normalizeParams(params)
2680
2765
  });
2681
2766
  }
2767
+ /* @__NO_SIDE_EFFECTS__ */
2682
2768
  function _number(Class, params) {
2683
2769
  return new Class({
2684
2770
  type: "number",
@@ -2686,6 +2772,7 @@ function _number(Class, params) {
2686
2772
  ...normalizeParams(params)
2687
2773
  });
2688
2774
  }
2775
+ /* @__NO_SIDE_EFFECTS__ */
2689
2776
  function _int(Class, params) {
2690
2777
  return new Class({
2691
2778
  type: "number",
@@ -2695,30 +2782,36 @@ function _int(Class, params) {
2695
2782
  ...normalizeParams(params)
2696
2783
  });
2697
2784
  }
2785
+ /* @__NO_SIDE_EFFECTS__ */
2698
2786
  function _boolean(Class, params) {
2699
2787
  return new Class({
2700
2788
  type: "boolean",
2701
2789
  ...normalizeParams(params)
2702
2790
  });
2703
2791
  }
2792
+ /* @__NO_SIDE_EFFECTS__ */
2704
2793
  function _any(Class) {
2705
2794
  return new Class({ type: "any" });
2706
2795
  }
2796
+ /* @__NO_SIDE_EFFECTS__ */
2707
2797
  function _unknown(Class) {
2708
2798
  return new Class({ type: "unknown" });
2709
2799
  }
2800
+ /* @__NO_SIDE_EFFECTS__ */
2710
2801
  function _never(Class, params) {
2711
2802
  return new Class({
2712
2803
  type: "never",
2713
2804
  ...normalizeParams(params)
2714
2805
  });
2715
2806
  }
2807
+ /* @__NO_SIDE_EFFECTS__ */
2716
2808
  function _date(Class, params) {
2717
2809
  return new Class({
2718
2810
  type: "date",
2719
2811
  ...normalizeParams(params)
2720
2812
  });
2721
2813
  }
2814
+ /* @__NO_SIDE_EFFECTS__ */
2722
2815
  function _lt(value, params) {
2723
2816
  return new $ZodCheckLessThan({
2724
2817
  check: "less_than",
@@ -2727,6 +2820,7 @@ function _lt(value, params) {
2727
2820
  inclusive: false
2728
2821
  });
2729
2822
  }
2823
+ /* @__NO_SIDE_EFFECTS__ */
2730
2824
  function _lte(value, params) {
2731
2825
  return new $ZodCheckLessThan({
2732
2826
  check: "less_than",
@@ -2735,6 +2829,7 @@ function _lte(value, params) {
2735
2829
  inclusive: true
2736
2830
  });
2737
2831
  }
2832
+ /* @__NO_SIDE_EFFECTS__ */
2738
2833
  function _gt(value, params) {
2739
2834
  return new $ZodCheckGreaterThan({
2740
2835
  check: "greater_than",
@@ -2743,6 +2838,7 @@ function _gt(value, params) {
2743
2838
  inclusive: false
2744
2839
  });
2745
2840
  }
2841
+ /* @__NO_SIDE_EFFECTS__ */
2746
2842
  function _gte(value, params) {
2747
2843
  return new $ZodCheckGreaterThan({
2748
2844
  check: "greater_than",
@@ -2751,6 +2847,7 @@ function _gte(value, params) {
2751
2847
  inclusive: true
2752
2848
  });
2753
2849
  }
2850
+ /* @__NO_SIDE_EFFECTS__ */
2754
2851
  function _multipleOf(value, params) {
2755
2852
  return new $ZodCheckMultipleOf({
2756
2853
  check: "multiple_of",
@@ -2758,6 +2855,7 @@ function _multipleOf(value, params) {
2758
2855
  value
2759
2856
  });
2760
2857
  }
2858
+ /* @__NO_SIDE_EFFECTS__ */
2761
2859
  function _maxLength(maximum, params) {
2762
2860
  return new $ZodCheckMaxLength({
2763
2861
  check: "max_length",
@@ -2765,6 +2863,7 @@ function _maxLength(maximum, params) {
2765
2863
  maximum
2766
2864
  });
2767
2865
  }
2866
+ /* @__NO_SIDE_EFFECTS__ */
2768
2867
  function _minLength(minimum, params) {
2769
2868
  return new $ZodCheckMinLength({
2770
2869
  check: "min_length",
@@ -2772,6 +2871,7 @@ function _minLength(minimum, params) {
2772
2871
  minimum
2773
2872
  });
2774
2873
  }
2874
+ /* @__NO_SIDE_EFFECTS__ */
2775
2875
  function _length(length, params) {
2776
2876
  return new $ZodCheckLengthEquals({
2777
2877
  check: "length_equals",
@@ -2779,6 +2879,7 @@ function _length(length, params) {
2779
2879
  length
2780
2880
  });
2781
2881
  }
2882
+ /* @__NO_SIDE_EFFECTS__ */
2782
2883
  function _regex(pattern, params) {
2783
2884
  return new $ZodCheckRegex({
2784
2885
  check: "string_format",
@@ -2787,6 +2888,7 @@ function _regex(pattern, params) {
2787
2888
  pattern
2788
2889
  });
2789
2890
  }
2891
+ /* @__NO_SIDE_EFFECTS__ */
2790
2892
  function _lowercase(params) {
2791
2893
  return new $ZodCheckLowerCase({
2792
2894
  check: "string_format",
@@ -2794,6 +2896,7 @@ function _lowercase(params) {
2794
2896
  ...normalizeParams(params)
2795
2897
  });
2796
2898
  }
2899
+ /* @__NO_SIDE_EFFECTS__ */
2797
2900
  function _uppercase(params) {
2798
2901
  return new $ZodCheckUpperCase({
2799
2902
  check: "string_format",
@@ -2801,6 +2904,7 @@ function _uppercase(params) {
2801
2904
  ...normalizeParams(params)
2802
2905
  });
2803
2906
  }
2907
+ /* @__NO_SIDE_EFFECTS__ */
2804
2908
  function _includes(includes, params) {
2805
2909
  return new $ZodCheckIncludes({
2806
2910
  check: "string_format",
@@ -2809,6 +2913,7 @@ function _includes(includes, params) {
2809
2913
  includes
2810
2914
  });
2811
2915
  }
2916
+ /* @__NO_SIDE_EFFECTS__ */
2812
2917
  function _startsWith(prefix, params) {
2813
2918
  return new $ZodCheckStartsWith({
2814
2919
  check: "string_format",
@@ -2817,6 +2922,7 @@ function _startsWith(prefix, params) {
2817
2922
  prefix
2818
2923
  });
2819
2924
  }
2925
+ /* @__NO_SIDE_EFFECTS__ */
2820
2926
  function _endsWith(suffix, params) {
2821
2927
  return new $ZodCheckEndsWith({
2822
2928
  check: "string_format",
@@ -2825,27 +2931,34 @@ function _endsWith(suffix, params) {
2825
2931
  suffix
2826
2932
  });
2827
2933
  }
2934
+ /* @__NO_SIDE_EFFECTS__ */
2828
2935
  function _overwrite(tx) {
2829
2936
  return new $ZodCheckOverwrite({
2830
2937
  check: "overwrite",
2831
2938
  tx
2832
2939
  });
2833
2940
  }
2941
+ /* @__NO_SIDE_EFFECTS__ */
2834
2942
  function _normalize(form) {
2835
- return _overwrite((input) => input.normalize(form));
2943
+ return /* @__PURE__ */ _overwrite((input) => input.normalize(form));
2836
2944
  }
2945
+ /* @__NO_SIDE_EFFECTS__ */
2837
2946
  function _trim() {
2838
- return _overwrite((input) => input.trim());
2947
+ return /* @__PURE__ */ _overwrite((input) => input.trim());
2839
2948
  }
2949
+ /* @__NO_SIDE_EFFECTS__ */
2840
2950
  function _toLowerCase() {
2841
- return _overwrite((input) => input.toLowerCase());
2951
+ return /* @__PURE__ */ _overwrite((input) => input.toLowerCase());
2842
2952
  }
2953
+ /* @__NO_SIDE_EFFECTS__ */
2843
2954
  function _toUpperCase() {
2844
- return _overwrite((input) => input.toUpperCase());
2955
+ return /* @__PURE__ */ _overwrite((input) => input.toUpperCase());
2845
2956
  }
2957
+ /* @__NO_SIDE_EFFECTS__ */
2846
2958
  function _slugify() {
2847
- return _overwrite((input) => slugify(input));
2959
+ return /* @__PURE__ */ _overwrite((input) => slugify(input));
2848
2960
  }
2961
+ /* @__NO_SIDE_EFFECTS__ */
2849
2962
  function _array(Class, element, params) {
2850
2963
  return new Class({
2851
2964
  type: "array",
@@ -2853,6 +2966,7 @@ function _array(Class, element, params) {
2853
2966
  ...normalizeParams(params)
2854
2967
  });
2855
2968
  }
2969
+ /* @__NO_SIDE_EFFECTS__ */
2856
2970
  function _refine(Class, fn, _params) {
2857
2971
  return new Class({
2858
2972
  type: "custom",
@@ -2861,8 +2975,9 @@ function _refine(Class, fn, _params) {
2861
2975
  ...normalizeParams(_params)
2862
2976
  });
2863
2977
  }
2978
+ /* @__NO_SIDE_EFFECTS__ */
2864
2979
  function _superRefine(fn) {
2865
- const ch = _check((payload) => {
2980
+ const ch = /* @__PURE__ */ _check((payload) => {
2866
2981
  payload.addIssue = (issue$1) => {
2867
2982
  if (typeof issue$1 === "string") payload.issues.push(issue(issue$1, payload.value, ch._zod.def));
2868
2983
  else {
@@ -2879,6 +2994,7 @@ function _superRefine(fn) {
2879
2994
  });
2880
2995
  return ch;
2881
2996
  }
2997
+ /* @__NO_SIDE_EFFECTS__ */
2882
2998
  function _check(fn, params) {
2883
2999
  const ch = new $ZodCheck({
2884
3000
  check: "custom",
@@ -2887,6 +3003,7 @@ function _check(fn, params) {
2887
3003
  ch._zod.check = fn;
2888
3004
  return ch;
2889
3005
  }
3006
+ /* @__NO_SIDE_EFFECTS__ */
2890
3007
  function describe$1(description) {
2891
3008
  const ch = new $ZodCheck({ check: "describe" });
2892
3009
  ch._zod.onattach = [(inst) => {
@@ -2899,6 +3016,7 @@ function describe$1(description) {
2899
3016
  ch._zod.check = () => {};
2900
3017
  return ch;
2901
3018
  }
3019
+ /* @__NO_SIDE_EFFECTS__ */
2902
3020
  function meta$1(metadata) {
2903
3021
  const ch = new $ZodCheck({ check: "meta" });
2904
3022
  ch._zod.onattach = [(inst) => {
@@ -2913,7 +3031,7 @@ function meta$1(metadata) {
2913
3031
  }
2914
3032
 
2915
3033
  //#endregion
2916
- //#region ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/core/to-json-schema.js
3034
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/to-json-schema.js
2917
3035
  function initializeContext(params) {
2918
3036
  let target = params?.target ?? "draft-2020-12";
2919
3037
  if (target === "draft-4") target = "draft-04";
@@ -2959,18 +3077,19 @@ function process$1(schema, ctx, _params = {
2959
3077
  schemaPath: [..._params.schemaPath, schema],
2960
3078
  path: _params.path
2961
3079
  };
2962
- const parent = schema._zod.parent;
2963
- if (parent) {
2964
- result.ref = parent;
2965
- process$1(parent, ctx, params);
2966
- ctx.seen.get(parent).isParent = true;
2967
- } else if (schema._zod.processJSONSchema) schema._zod.processJSONSchema(ctx, result.schema, params);
3080
+ if (schema._zod.processJSONSchema) schema._zod.processJSONSchema(ctx, result.schema, params);
2968
3081
  else {
2969
3082
  const _json = result.schema;
2970
3083
  const processor = ctx.processors[def.type];
2971
3084
  if (!processor) throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);
2972
3085
  processor(schema, ctx, _json, params);
2973
3086
  }
3087
+ const parent = schema._zod.parent;
3088
+ if (parent) {
3089
+ if (!result.ref) result.ref = parent;
3090
+ process$1(parent, ctx, params);
3091
+ ctx.seen.get(parent).isParent = true;
3092
+ }
2974
3093
  }
2975
3094
  const meta$2 = ctx.metadataRegistry.get(schema);
2976
3095
  if (meta$2) Object.assign(result.schema, meta$2);
@@ -2985,6 +3104,15 @@ function process$1(schema, ctx, _params = {
2985
3104
  function extractDefs(ctx, schema) {
2986
3105
  const root = ctx.seen.get(schema);
2987
3106
  if (!root) throw new Error("Unprocessed schema. This is a bug in Zod.");
3107
+ const idToSchema = /* @__PURE__ */ new Map();
3108
+ for (const entry of ctx.seen.entries()) {
3109
+ const id = ctx.metadataRegistry.get(entry[0])?.id;
3110
+ if (id) {
3111
+ const existing = idToSchema.get(id);
3112
+ 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.`);
3113
+ idToSchema.set(id, entry[0]);
3114
+ }
3115
+ }
2988
3116
  const makeURI = (entry) => {
2989
3117
  const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
2990
3118
  if (ctx.external) {
@@ -3056,23 +3184,42 @@ function finalize(ctx, schema) {
3056
3184
  if (!root) throw new Error("Unprocessed schema. This is a bug in Zod.");
3057
3185
  const flattenRef = (zodSchema) => {
3058
3186
  const seen = ctx.seen.get(zodSchema);
3187
+ if (seen.ref === null) return;
3059
3188
  const schema$1 = seen.def ?? seen.schema;
3060
3189
  const _cached = { ...schema$1 };
3061
- if (seen.ref === null) return;
3062
3190
  const ref = seen.ref;
3063
3191
  seen.ref = null;
3064
3192
  if (ref) {
3065
3193
  flattenRef(ref);
3066
- const refSchema = ctx.seen.get(ref).schema;
3194
+ const refSeen = ctx.seen.get(ref);
3195
+ const refSchema = refSeen.schema;
3067
3196
  if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
3068
3197
  schema$1.allOf = schema$1.allOf ?? [];
3069
3198
  schema$1.allOf.push(refSchema);
3070
- } else {
3071
- Object.assign(schema$1, refSchema);
3072
- Object.assign(schema$1, _cached);
3199
+ } else Object.assign(schema$1, refSchema);
3200
+ Object.assign(schema$1, _cached);
3201
+ if (zodSchema._zod.parent === ref) for (const key in schema$1) {
3202
+ if (key === "$ref" || key === "allOf") continue;
3203
+ if (!(key in _cached)) delete schema$1[key];
3204
+ }
3205
+ if (refSchema.$ref) for (const key in schema$1) {
3206
+ if (key === "$ref" || key === "allOf") continue;
3207
+ if (key in refSeen.def && JSON.stringify(schema$1[key]) === JSON.stringify(refSeen.def[key])) delete schema$1[key];
3208
+ }
3209
+ }
3210
+ const parent = zodSchema._zod.parent;
3211
+ if (parent && parent !== ref) {
3212
+ flattenRef(parent);
3213
+ const parentSeen = ctx.seen.get(parent);
3214
+ if (parentSeen?.schema.$ref) {
3215
+ schema$1.$ref = parentSeen.schema.$ref;
3216
+ if (parentSeen.def) for (const key in schema$1) {
3217
+ if (key === "$ref" || key === "allOf") continue;
3218
+ if (key in parentSeen.def && JSON.stringify(schema$1[key]) === JSON.stringify(parentSeen.def[key])) delete schema$1[key];
3219
+ }
3073
3220
  }
3074
3221
  }
3075
- if (!seen.isParent) ctx.override({
3222
+ ctx.override({
3076
3223
  zodSchema,
3077
3224
  jsonSchema: schema$1,
3078
3225
  path: seen.path ?? []
@@ -3103,8 +3250,8 @@ function finalize(ctx, schema) {
3103
3250
  value: {
3104
3251
  ...schema["~standard"],
3105
3252
  jsonSchema: {
3106
- input: createStandardJSONSchemaMethod(schema, "input"),
3107
- output: createStandardJSONSchemaMethod(schema, "output")
3253
+ input: createStandardJSONSchemaMethod(schema, "input", ctx.processors),
3254
+ output: createStandardJSONSchemaMethod(schema, "output", ctx.processors)
3108
3255
  }
3109
3256
  },
3110
3257
  enumerable: false,
@@ -3156,13 +3303,13 @@ const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
3156
3303
  extractDefs(ctx, schema);
3157
3304
  return finalize(ctx, schema);
3158
3305
  };
3159
- const createStandardJSONSchemaMethod = (schema, io) => (params) => {
3306
+ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
3160
3307
  const { libraryOptions, target } = params ?? {};
3161
3308
  const ctx = initializeContext({
3162
3309
  ...libraryOptions ?? {},
3163
3310
  target,
3164
3311
  io,
3165
- processors: {}
3312
+ processors
3166
3313
  });
3167
3314
  process$1(schema, ctx);
3168
3315
  extractDefs(ctx, schema);
@@ -3170,7 +3317,7 @@ const createStandardJSONSchemaMethod = (schema, io) => (params) => {
3170
3317
  };
3171
3318
 
3172
3319
  //#endregion
3173
- //#region ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/core/json-schema-processors.js
3320
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/json-schema-processors.js
3174
3321
  const formatMap = {
3175
3322
  guid: "uuid",
3176
3323
  url: "uri",
@@ -3187,6 +3334,7 @@ const stringProcessor = (schema, ctx, _json, _params) => {
3187
3334
  if (format) {
3188
3335
  json.format = formatMap[format] ?? format;
3189
3336
  if (json.format === "") delete json.format;
3337
+ if (format === "time") delete json.format;
3190
3338
  }
3191
3339
  if (contentEncoding) json.contentEncoding = contentEncoding;
3192
3340
  if (patterns && patterns.size > 0) {
@@ -3327,14 +3475,34 @@ const recordProcessor = (schema, ctx, _json, params) => {
3327
3475
  const json = _json;
3328
3476
  const def = schema._zod.def;
3329
3477
  json.type = "object";
3330
- if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process$1(def.keyType, ctx, {
3331
- ...params,
3332
- path: [...params.path, "propertyNames"]
3333
- });
3334
- json.additionalProperties = process$1(def.valueType, ctx, {
3335
- ...params,
3336
- path: [...params.path, "additionalProperties"]
3337
- });
3478
+ const keyType = def.keyType;
3479
+ const patterns = keyType._zod.bag?.patterns;
3480
+ if (def.mode === "loose" && patterns && patterns.size > 0) {
3481
+ const valueSchema = process$1(def.valueType, ctx, {
3482
+ ...params,
3483
+ path: [
3484
+ ...params.path,
3485
+ "patternProperties",
3486
+ "*"
3487
+ ]
3488
+ });
3489
+ json.patternProperties = {};
3490
+ for (const pattern of patterns) json.patternProperties[pattern.source] = valueSchema;
3491
+ } else {
3492
+ if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process$1(def.keyType, ctx, {
3493
+ ...params,
3494
+ path: [...params.path, "propertyNames"]
3495
+ });
3496
+ json.additionalProperties = process$1(def.valueType, ctx, {
3497
+ ...params,
3498
+ path: [...params.path, "additionalProperties"]
3499
+ });
3500
+ }
3501
+ const keyValues = keyType._zod.values;
3502
+ if (keyValues) {
3503
+ const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
3504
+ if (validKeyValues.length > 0) json.required = validKeyValues;
3505
+ }
3338
3506
  };
3339
3507
  const nullableProcessor = (schema, ctx, json, params) => {
3340
3508
  const def = schema._zod.def;
@@ -3406,7 +3574,7 @@ const lazyProcessor = (schema, ctx, _json, params) => {
3406
3574
  };
3407
3575
 
3408
3576
  //#endregion
3409
- //#region ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/classic/iso.js
3577
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/iso.js
3410
3578
  const ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
3411
3579
  $ZodISODateTime.init(inst, def);
3412
3580
  ZodStringFormat.init(inst, def);
@@ -3437,7 +3605,7 @@ function duration(params) {
3437
3605
  }
3438
3606
 
3439
3607
  //#endregion
3440
- //#region ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/classic/errors.js
3608
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/errors.js
3441
3609
  const initializer = (inst, issues) => {
3442
3610
  $ZodError.init(inst, issues);
3443
3611
  inst.name = "ZodError";
@@ -3461,7 +3629,7 @@ const ZodError = $constructor("ZodError", initializer);
3461
3629
  const ZodRealError = $constructor("ZodError", initializer, { Parent: Error });
3462
3630
 
3463
3631
  //#endregion
3464
- //#region ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/classic/parse.js
3632
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/parse.js
3465
3633
  const parse = /* @__PURE__ */ _parse(ZodRealError);
3466
3634
  const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
3467
3635
  const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
@@ -3476,7 +3644,7 @@ const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
3476
3644
  const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
3477
3645
 
3478
3646
  //#endregion
3479
- //#region ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/classic/schemas.js
3647
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/schemas.js
3480
3648
  const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
3481
3649
  $ZodType.init(inst, def);
3482
3650
  Object.assign(inst["~standard"], { jsonSchema: {
@@ -3492,8 +3660,9 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
3492
3660
  check: ch,
3493
3661
  def: { check: "custom" },
3494
3662
  onattach: []
3495
- } } : ch)] }));
3663
+ } } : ch)] }), { parent: true });
3496
3664
  };
3665
+ inst.with = inst.check;
3497
3666
  inst.clone = (def$1, params) => clone(inst, def$1, params);
3498
3667
  inst.brand = () => inst;
3499
3668
  inst.register = ((reg, meta$2) => {
@@ -3517,6 +3686,7 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
3517
3686
  inst.superRefine = (refinement) => inst.check(superRefine(refinement));
3518
3687
  inst.overwrite = (fn) => inst.check(_overwrite(fn));
3519
3688
  inst.optional = () => optional(inst);
3689
+ inst.exactOptional = () => exactOptional(inst);
3520
3690
  inst.nullable = () => nullable(inst);
3521
3691
  inst.nullish = () => optional(nullable(inst));
3522
3692
  inst.nonoptional = (params) => nonoptional(inst, params);
@@ -3548,6 +3718,7 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
3548
3718
  };
3549
3719
  inst.isOptional = () => inst.safeParse(void 0).success;
3550
3720
  inst.isNullable = () => inst.safeParse(null).success;
3721
+ inst.apply = (fn) => fn(inst);
3551
3722
  return inst;
3552
3723
  });
3553
3724
  /** @internal */
@@ -3952,6 +4123,18 @@ function optional(innerType) {
3952
4123
  innerType
3953
4124
  });
3954
4125
  }
4126
+ const ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => {
4127
+ $ZodExactOptional.init(inst, def);
4128
+ ZodType.init(inst, def);
4129
+ inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
4130
+ inst.unwrap = () => inst._zod.def.innerType;
4131
+ });
4132
+ function exactOptional(innerType) {
4133
+ return new ZodExactOptional({
4134
+ type: "optional",
4135
+ innerType
4136
+ });
4137
+ }
3955
4138
  const ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
3956
4139
  $ZodNullable.init(inst, def);
3957
4140
  ZodType.init(inst, def);
@@ -4073,7 +4256,7 @@ function superRefine(fn) {
4073
4256
  }
4074
4257
  const describe = describe$1;
4075
4258
  const meta = meta$1;
4076
- function _instanceof(cls, params = { error: `Input not instance of ${cls.name}` }) {
4259
+ function _instanceof(cls, params = {}) {
4077
4260
  const inst = new ZodCustom({
4078
4261
  type: "custom",
4079
4262
  check: "custom",
@@ -4082,6 +4265,15 @@ function _instanceof(cls, params = { error: `Input not instance of ${cls.name}`
4082
4265
  ...normalizeParams(params)
4083
4266
  });
4084
4267
  inst._zod.bag.Class = cls;
4268
+ inst._zod.check = (payload) => {
4269
+ if (!(payload.value instanceof cls)) payload.issues.push({
4270
+ code: "invalid_type",
4271
+ expected: cls.name,
4272
+ input: payload.value,
4273
+ inst,
4274
+ path: [...inst._zod.def.path ?? []]
4275
+ });
4276
+ };
4085
4277
  return inst;
4086
4278
  }
4087
4279
 
@@ -9953,7 +10145,7 @@ const retryRequest = async (url, options, retryCount, statusCodesToRetry, timeou
9953
10145
 
9954
10146
  //#endregion
9955
10147
  //#region package.json
9956
- var version = "0.1.9-beta.6";
10148
+ var version = "0.2.0-beta.1";
9957
10149
 
9958
10150
  //#endregion
9959
10151
  //#region src/providers/bytez/api.ts