@rexeus/typeweaver-types 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -7,28 +7,20 @@ var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
8
  var __exportAll = (all, no_symbols) => {
9
9
  let target = {};
10
- for (var name in all) {
11
- __defProp(target, name, {
12
- get: all[name],
13
- enumerable: true
14
- });
15
- }
16
- if (!no_symbols) {
17
- __defProp(target, Symbol.toStringTag, { value: "Module" });
18
- }
10
+ for (var name in all) __defProp(target, name, {
11
+ get: all[name],
12
+ enumerable: true
13
+ });
14
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
19
15
  return target;
20
16
  };
21
17
  var __copyProps = (to, from, except, desc) => {
22
- if (from && typeof from === "object" || typeof from === "function") {
23
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
24
- key = keys[i];
25
- if (!__hasOwnProp.call(to, key) && key !== except) {
26
- __defProp(to, key, {
27
- get: ((k) => from[k]).bind(null, key),
28
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
29
- });
30
- }
31
- }
18
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
19
+ key = keys[i];
20
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
21
+ get: ((k) => from[k]).bind(null, key),
22
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
23
+ });
32
24
  }
33
25
  return to;
34
26
  };
@@ -36,7 +28,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
36
28
  value: mod,
37
29
  enumerable: true
38
30
  }) : target, mod));
39
-
40
31
  //#endregion
41
32
  let node_path = require("node:path");
42
33
  node_path = __toESM(node_path);
@@ -46,87 +37,30 @@ let _rexeus_typeweaver_zod_to_ts = require("@rexeus/typeweaver-zod-to-ts");
46
37
  let case$1 = require("case");
47
38
  case$1 = __toESM(case$1);
48
39
  let _rexeus_typeweaver_core = require("@rexeus/typeweaver-core");
49
-
50
- //#region src/RequestGenerator.ts
51
- const moduleDir$5 = node_path.default.dirname((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
52
- var RequestGenerator = class {
53
- static generate(context) {
54
- const templateFilePath = node_path.default.join(moduleDir$5, "templates", "Request.ejs");
55
- for (const [, entityResource] of Object.entries(context.resources.entityResources)) for (const definition of entityResource.operations) this.writeRequestType(templateFilePath, definition, context);
56
- }
57
- static writeRequestType(templateFilePath, operationResource, context) {
58
- const { outputDir, definition, outputResponseFileName, outputResponseValidationFileName } = operationResource;
59
- const { request, operationId, method, responses } = definition;
60
- const { header, query, param, body } = request;
61
- const headerTsType = header ? _rexeus_typeweaver_zod_to_ts.TsTypePrinter.print(_rexeus_typeweaver_zod_to_ts.TsTypeNode.fromZod(header)) : void 0;
62
- const queryTsType = query ? _rexeus_typeweaver_zod_to_ts.TsTypePrinter.print(_rexeus_typeweaver_zod_to_ts.TsTypeNode.fromZod(query)) : void 0;
63
- const paramTsType = param ? _rexeus_typeweaver_zod_to_ts.TsTypePrinter.print(_rexeus_typeweaver_zod_to_ts.TsTypeNode.fromZod(param)) : void 0;
64
- const bodyTsType = body ? _rexeus_typeweaver_zod_to_ts.TsTypePrinter.print(_rexeus_typeweaver_zod_to_ts.TsTypeNode.fromZod(body)) : void 0;
65
- const pascalCaseOperationId = case$1.default.pascal(operationId);
66
- const sourcePath = _rexeus_typeweaver_gen.Path.relative(outputDir, `${operationResource.sourceDir}/${node_path.default.relative(operationResource.sourceDir, operationResource.sourceFile).replace(/\.ts$/, "")}`);
67
- const ownSuccessResponses = [];
68
- const ownErrorResponses = [];
69
- const sharedSuccessResponses = [];
70
- const sharedErrorResponses = [];
71
- const entityErrorResponses = [];
72
- for (const response of responses) {
73
- const { statusCode, name, isReference } = response;
74
- if (isReference) {
75
- const sharedResponse = context.resources.sharedResponseResources.find((resource) => resource.name === name);
76
- if (sharedResponse) {
77
- const responsePath = _rexeus_typeweaver_gen.Path.relative(outputDir, `${sharedResponse.outputDir}/${node_path.default.basename(sharedResponse.outputFileName, ".ts")}`);
78
- if (statusCode >= 200 && statusCode < 300) sharedSuccessResponses.push({
79
- name,
80
- path: responsePath
81
- });
82
- else sharedErrorResponses.push({
83
- name,
84
- path: responsePath
85
- });
86
- } else {
87
- const entityResponse = (context.resources.entityResources[operationResource.entityName]?.responses)?.find((r) => r.name === name);
88
- if (!entityResponse) throw new Error(`Shared response '${response.name}' not found in shared or entity resources`);
89
- const responsePath = _rexeus_typeweaver_gen.Path.relative(outputDir, `${entityResponse.outputDir}/${node_path.default.basename(entityResponse.outputFileName, ".ts")}`);
90
- if (statusCode >= 200 && statusCode < 300) sharedSuccessResponses.push({
91
- name,
92
- path: responsePath
93
- });
94
- else entityErrorResponses.push({
95
- name,
96
- path: responsePath
97
- });
98
- }
99
- continue;
100
- }
101
- const assembledResponse = { name };
102
- if (statusCode >= 200 && statusCode < 300) ownSuccessResponses.push(assembledResponse);
103
- else ownErrorResponses.push(assembledResponse);
104
- }
105
- const content = context.renderTemplate(templateFilePath, {
106
- pascalCaseOperationId,
107
- operationId,
108
- coreDir: context.coreDir,
109
- sourcePath,
110
- headerTsType,
111
- queryTsType,
112
- paramTsType,
113
- bodyTsType,
114
- method,
115
- ownSuccessResponses,
116
- ownErrorResponses,
117
- sharedSuccessResponses,
118
- sharedErrorResponses,
119
- entityErrorResponses,
120
- responseFile: _rexeus_typeweaver_gen.Path.relative(outputDir, `${outputDir}/${node_path.default.basename(outputResponseFileName, ".ts")}`),
121
- responseValidationFile: _rexeus_typeweaver_gen.Path.relative(outputDir, `${outputDir}/${node_path.default.basename(outputResponseValidationFileName, ".ts")}`),
122
- hasErrorResponses: ownErrorResponses.length > 0 || entityErrorResponses.length > 0 || sharedErrorResponses.length > 0,
123
- hasSuccessResponses: ownSuccessResponses.length > 0 || sharedSuccessResponses.length > 0
124
- });
125
- const relativePath = node_path.default.relative(context.outputDir, operationResource.outputRequestFile);
126
- context.writeFile(relativePath, content);
127
- }
128
- };
129
-
40
+ //#region src/requestGenerator.ts
41
+ const moduleDir$4 = node_path.default.dirname((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
42
+ function generate$3(context) {
43
+ const templateFilePath = node_path.default.join(moduleDir$4, "templates", "Request.ejs");
44
+ for (const resource of context.normalizedSpec.resources) for (const operation of resource.operations) writeRequestType(templateFilePath, resource.name, operation, context);
45
+ }
46
+ function writeRequestType(templateFilePath, resourceName, operation, context) {
47
+ const { request, operationId, method } = operation;
48
+ const { header, query, param, body } = request ?? {};
49
+ const outputPaths = context.getOperationOutputPaths({
50
+ resourceName,
51
+ operationId
52
+ });
53
+ const content = context.renderTemplate(templateFilePath, {
54
+ pascalCaseOperationId: case$1.default.pascal(operationId),
55
+ method,
56
+ headerTsType: header ? (0, _rexeus_typeweaver_zod_to_ts.print)((0, _rexeus_typeweaver_zod_to_ts.fromZod)(header)) : void 0,
57
+ queryTsType: query ? (0, _rexeus_typeweaver_zod_to_ts.print)((0, _rexeus_typeweaver_zod_to_ts.fromZod)(query)) : void 0,
58
+ paramTsType: param ? (0, _rexeus_typeweaver_zod_to_ts.print)((0, _rexeus_typeweaver_zod_to_ts.fromZod)(param)) : void 0,
59
+ bodyTsType: body ? (0, _rexeus_typeweaver_zod_to_ts.print)((0, _rexeus_typeweaver_zod_to_ts.fromZod)(body)) : void 0
60
+ });
61
+ const relativePath = node_path.default.relative(context.outputDir, outputPaths.requestFile);
62
+ context.writeFile(relativePath, content);
63
+ }
130
64
  //#endregion
131
65
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.js
132
66
  /** A special constant with type `never` */
@@ -187,7 +121,6 @@ function config(newConfig) {
187
121
  if (newConfig) Object.assign(globalConfig, newConfig);
188
122
  return globalConfig;
189
123
  }
190
-
191
124
  //#endregion
192
125
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.js
193
126
  var util_exports = /* @__PURE__ */ __exportAll({
@@ -336,10 +269,7 @@ function assignProp(target, prop, value) {
336
269
  }
337
270
  function mergeDefs(...defs) {
338
271
  const mergedDescriptors = {};
339
- for (const def of defs) {
340
- const descriptors = Object.getOwnPropertyDescriptors(def);
341
- Object.assign(mergedDescriptors, descriptors);
342
- }
272
+ for (const def of defs) Object.assign(mergedDescriptors, Object.getOwnPropertyDescriptors(def));
343
273
  return Object.defineProperties({}, mergedDescriptors);
344
274
  }
345
275
  function cloneDef(schema) {
@@ -736,7 +666,6 @@ function uint8ArrayToHex(bytes) {
736
666
  var Class = class {
737
667
  constructor(..._args) {}
738
668
  };
739
-
740
669
  //#endregion
741
670
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.js
742
671
  const initializer$1 = (inst, def) => {
@@ -882,7 +811,6 @@ function prettifyError(error) {
882
811
  }
883
812
  return lines.join("\n");
884
813
  }
885
-
886
814
  //#endregion
887
815
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/parse.js
888
816
  const _parse = (_Err) => (schema, value, _ctx, _params) => {
@@ -986,7 +914,6 @@ const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
986
914
  return _safeParseAsync(_Err)(schema, value, _ctx);
987
915
  };
988
916
  const safeDecodeAsync$1 = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
989
-
990
917
  //#endregion
991
918
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/regexes.js
992
919
  var regexes_exports = /* @__PURE__ */ __exportAll({
@@ -1149,7 +1076,6 @@ const sha384_base64url = /* @__PURE__ */ fixedBase64url(64);
1149
1076
  const sha512_hex = /^[0-9a-fA-F]{128}$/;
1150
1077
  const sha512_base64 = /* @__PURE__ */ fixedBase64(86, "==");
1151
1078
  const sha512_base64url = /* @__PURE__ */ fixedBase64url(86);
1152
-
1153
1079
  //#endregion
1154
1080
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.js
1155
1081
  const $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
@@ -1655,7 +1581,6 @@ const $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (i
1655
1581
  payload.value = def.tx(payload.value);
1656
1582
  };
1657
1583
  });
1658
-
1659
1584
  //#endregion
1660
1585
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/doc.js
1661
1586
  var Doc = class {
@@ -1687,7 +1612,6 @@ var Doc = class {
1687
1612
  return new F(...args, lines.join("\n"));
1688
1613
  }
1689
1614
  };
1690
-
1691
1615
  //#endregion
1692
1616
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.js
1693
1617
  const version = {
@@ -1695,7 +1619,6 @@ const version = {
1695
1619
  minor: 3,
1696
1620
  patch: 6
1697
1621
  };
1698
-
1699
1622
  //#endregion
1700
1623
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.js
1701
1624
  const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
@@ -2438,8 +2361,7 @@ const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def)
2438
2361
  let fastpass;
2439
2362
  const isObject$1 = isObject;
2440
2363
  const jit = !globalConfig.jitless;
2441
- const allowsEval$1 = allowsEval;
2442
- const fastEnabled = jit && allowsEval$1.value;
2364
+ const fastEnabled = jit && allowsEval.value;
2443
2365
  const catchall = def.catchall;
2444
2366
  let value;
2445
2367
  inst._zod.parse = (payload, ctx) => {
@@ -3427,7 +3349,6 @@ function handleRefineResult(result, payload, input, inst) {
3427
3349
  payload.issues.push(issue(_iss));
3428
3350
  }
3429
3351
  }
3430
-
3431
3352
  //#endregion
3432
3353
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ar.js
3433
3354
  const error$46 = () => {
@@ -3527,7 +3448,6 @@ const error$46 = () => {
3527
3448
  function ar_default() {
3528
3449
  return { localeError: error$46() };
3529
3450
  }
3530
-
3531
3451
  //#endregion
3532
3452
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/az.js
3533
3453
  const error$45 = () => {
@@ -3627,7 +3547,6 @@ const error$45 = () => {
3627
3547
  function az_default() {
3628
3548
  return { localeError: error$45() };
3629
3549
  }
3630
-
3631
3550
  //#endregion
3632
3551
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/be.js
3633
3552
  function getBelarusianPlural(count, one, few, many) {
@@ -3762,7 +3681,6 @@ const error$44 = () => {
3762
3681
  function be_default() {
3763
3682
  return { localeError: error$44() };
3764
3683
  }
3765
-
3766
3684
  //#endregion
3767
3685
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/bg.js
3768
3686
  const error$43 = () => {
@@ -3872,7 +3790,6 @@ const error$43 = () => {
3872
3790
  function bg_default() {
3873
3791
  return { localeError: error$43() };
3874
3792
  }
3875
-
3876
3793
  //#endregion
3877
3794
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ca.js
3878
3795
  const error$42 = () => {
@@ -3972,7 +3889,6 @@ const error$42 = () => {
3972
3889
  function ca_default() {
3973
3890
  return { localeError: error$42() };
3974
3891
  }
3975
-
3976
3892
  //#endregion
3977
3893
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/cs.js
3978
3894
  const error$41 = () => {
@@ -4078,7 +3994,6 @@ const error$41 = () => {
4078
3994
  function cs_default() {
4079
3995
  return { localeError: error$41() };
4080
3996
  }
4081
-
4082
3997
  //#endregion
4083
3998
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/da.js
4084
3999
  const error$40 = () => {
@@ -4189,7 +4104,6 @@ const error$40 = () => {
4189
4104
  function da_default() {
4190
4105
  return { localeError: error$40() };
4191
4106
  }
4192
-
4193
4107
  //#endregion
4194
4108
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/de.js
4195
4109
  const error$39 = () => {
@@ -4293,7 +4207,6 @@ const error$39 = () => {
4293
4207
  function de_default() {
4294
4208
  return { localeError: error$39() };
4295
4209
  }
4296
-
4297
4210
  //#endregion
4298
4211
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/en.js
4299
4212
  const error$38 = () => {
@@ -4396,7 +4309,6 @@ const error$38 = () => {
4396
4309
  function en_default() {
4397
4310
  return { localeError: error$38() };
4398
4311
  }
4399
-
4400
4312
  //#endregion
4401
4313
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/eo.js
4402
4314
  const error$37 = () => {
@@ -4501,7 +4413,6 @@ const error$37 = () => {
4501
4413
  function eo_default() {
4502
4414
  return { localeError: error$37() };
4503
4415
  }
4504
-
4505
4416
  //#endregion
4506
4417
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/es.js
4507
4418
  const error$36 = () => {
@@ -4629,7 +4540,6 @@ const error$36 = () => {
4629
4540
  function es_default() {
4630
4541
  return { localeError: error$36() };
4631
4542
  }
4632
-
4633
4543
  //#endregion
4634
4544
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/fa.js
4635
4545
  const error$35 = () => {
@@ -4733,7 +4643,6 @@ const error$35 = () => {
4733
4643
  function fa_default() {
4734
4644
  return { localeError: error$35() };
4735
4645
  }
4736
-
4737
4646
  //#endregion
4738
4647
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/fi.js
4739
4648
  const error$34 = () => {
@@ -4849,7 +4758,6 @@ const error$34 = () => {
4849
4758
  function fi_default() {
4850
4759
  return { localeError: error$34() };
4851
4760
  }
4852
-
4853
4761
  //#endregion
4854
4762
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/fr.js
4855
4763
  const error$33 = () => {
@@ -4953,7 +4861,6 @@ const error$33 = () => {
4953
4861
  function fr_default() {
4954
4862
  return { localeError: error$33() };
4955
4863
  }
4956
-
4957
4864
  //#endregion
4958
4865
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/fr-CA.js
4959
4866
  const error$32 = () => {
@@ -5053,7 +4960,6 @@ const error$32 = () => {
5053
4960
  function fr_CA_default() {
5054
4961
  return { localeError: error$32() };
5055
4962
  }
5056
-
5057
4963
  //#endregion
5058
4964
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/he.js
5059
4965
  const error$31 = () => {
@@ -5359,7 +5265,6 @@ const error$31 = () => {
5359
5265
  function he_default() {
5360
5266
  return { localeError: error$31() };
5361
5267
  }
5362
-
5363
5268
  //#endregion
5364
5269
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/hu.js
5365
5270
  const error$30 = () => {
@@ -5463,7 +5368,6 @@ const error$30 = () => {
5463
5368
  function hu_default() {
5464
5369
  return { localeError: error$30() };
5465
5370
  }
5466
-
5467
5371
  //#endregion
5468
5372
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/hy.js
5469
5373
  function getArmenianPlural(count, one, many) {
@@ -5602,7 +5506,6 @@ const error$29 = () => {
5602
5506
  function hy_default() {
5603
5507
  return { localeError: error$29() };
5604
5508
  }
5605
-
5606
5509
  //#endregion
5607
5510
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/id.js
5608
5511
  const error$28 = () => {
@@ -5702,7 +5605,6 @@ const error$28 = () => {
5702
5605
  function id_default() {
5703
5606
  return { localeError: error$28() };
5704
5607
  }
5705
-
5706
5608
  //#endregion
5707
5609
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/is.js
5708
5610
  const error$27 = () => {
@@ -5806,7 +5708,6 @@ const error$27 = () => {
5806
5708
  function is_default() {
5807
5709
  return { localeError: error$27() };
5808
5710
  }
5809
-
5810
5711
  //#endregion
5811
5712
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/it.js
5812
5713
  const error$26 = () => {
@@ -5910,7 +5811,6 @@ const error$26 = () => {
5910
5811
  function it_default() {
5911
5812
  return { localeError: error$26() };
5912
5813
  }
5913
-
5914
5814
  //#endregion
5915
5815
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ja.js
5916
5816
  const error$25 = () => {
@@ -6014,7 +5914,6 @@ const error$25 = () => {
6014
5914
  function ja_default() {
6015
5915
  return { localeError: error$25() };
6016
5916
  }
6017
-
6018
5917
  //#endregion
6019
5918
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ka.js
6020
5919
  const error$24 = () => {
@@ -6121,7 +6020,6 @@ const error$24 = () => {
6121
6020
  function ka_default() {
6122
6021
  return { localeError: error$24() };
6123
6022
  }
6124
-
6125
6023
  //#endregion
6126
6024
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/km.js
6127
6025
  const error$23 = () => {
@@ -6226,14 +6124,12 @@ const error$23 = () => {
6226
6124
  function km_default() {
6227
6125
  return { localeError: error$23() };
6228
6126
  }
6229
-
6230
6127
  //#endregion
6231
6128
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/kh.js
6232
6129
  /** @deprecated Use `km` instead. */
6233
6130
  function kh_default() {
6234
6131
  return km_default();
6235
6132
  }
6236
-
6237
6133
  //#endregion
6238
6134
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ko.js
6239
6135
  const error$22 = () => {
@@ -6337,7 +6233,6 @@ const error$22 = () => {
6337
6233
  function ko_default() {
6338
6234
  return { localeError: error$22() };
6339
6235
  }
6340
-
6341
6236
  //#endregion
6342
6237
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/lt.js
6343
6238
  const capitalizeFirstCharacter = (text) => {
@@ -6519,7 +6414,6 @@ const error$21 = () => {
6519
6414
  function lt_default() {
6520
6415
  return { localeError: error$21() };
6521
6416
  }
6522
-
6523
6417
  //#endregion
6524
6418
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/mk.js
6525
6419
  const error$20 = () => {
@@ -6623,7 +6517,6 @@ const error$20 = () => {
6623
6517
  function mk_default() {
6624
6518
  return { localeError: error$20() };
6625
6519
  }
6626
-
6627
6520
  //#endregion
6628
6521
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ms.js
6629
6522
  const error$19 = () => {
@@ -6726,7 +6619,6 @@ const error$19 = () => {
6726
6619
  function ms_default() {
6727
6620
  return { localeError: error$19() };
6728
6621
  }
6729
-
6730
6622
  //#endregion
6731
6623
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/nl.js
6732
6624
  const error$18 = () => {
@@ -6831,7 +6723,6 @@ const error$18 = () => {
6831
6723
  function nl_default() {
6832
6724
  return { localeError: error$18() };
6833
6725
  }
6834
-
6835
6726
  //#endregion
6836
6727
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/no.js
6837
6728
  const error$17 = () => {
@@ -6935,7 +6826,6 @@ const error$17 = () => {
6935
6826
  function no_default() {
6936
6827
  return { localeError: error$17() };
6937
6828
  }
6938
-
6939
6829
  //#endregion
6940
6830
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ota.js
6941
6831
  const error$16 = () => {
@@ -7040,7 +6930,6 @@ const error$16 = () => {
7040
6930
  function ota_default() {
7041
6931
  return { localeError: error$16() };
7042
6932
  }
7043
-
7044
6933
  //#endregion
7045
6934
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ps.js
7046
6935
  const error$15 = () => {
@@ -7144,7 +7033,6 @@ const error$15 = () => {
7144
7033
  function ps_default() {
7145
7034
  return { localeError: error$15() };
7146
7035
  }
7147
-
7148
7036
  //#endregion
7149
7037
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/pl.js
7150
7038
  const error$14 = () => {
@@ -7248,7 +7136,6 @@ const error$14 = () => {
7248
7136
  function pl_default() {
7249
7137
  return { localeError: error$14() };
7250
7138
  }
7251
-
7252
7139
  //#endregion
7253
7140
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/pt.js
7254
7141
  const error$13 = () => {
@@ -7352,7 +7239,6 @@ const error$13 = () => {
7352
7239
  function pt_default() {
7353
7240
  return { localeError: error$13() };
7354
7241
  }
7355
-
7356
7242
  //#endregion
7357
7243
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ru.js
7358
7244
  function getRussianPlural(count, one, few, many) {
@@ -7487,7 +7373,6 @@ const error$12 = () => {
7487
7373
  function ru_default() {
7488
7374
  return { localeError: error$12() };
7489
7375
  }
7490
-
7491
7376
  //#endregion
7492
7377
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/sl.js
7493
7378
  const error$11 = () => {
@@ -7591,7 +7476,6 @@ const error$11 = () => {
7591
7476
  function sl_default() {
7592
7477
  return { localeError: error$11() };
7593
7478
  }
7594
-
7595
7479
  //#endregion
7596
7480
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/sv.js
7597
7481
  const error$10 = () => {
@@ -7695,7 +7579,6 @@ const error$10 = () => {
7695
7579
  function sv_default() {
7696
7580
  return { localeError: error$10() };
7697
7581
  }
7698
-
7699
7582
  //#endregion
7700
7583
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ta.js
7701
7584
  const error$9 = () => {
@@ -7800,7 +7683,6 @@ const error$9 = () => {
7800
7683
  function ta_default() {
7801
7684
  return { localeError: error$9() };
7802
7685
  }
7803
-
7804
7686
  //#endregion
7805
7687
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/th.js
7806
7688
  const error$8 = () => {
@@ -7905,7 +7787,6 @@ const error$8 = () => {
7905
7787
  function th_default() {
7906
7788
  return { localeError: error$8() };
7907
7789
  }
7908
-
7909
7790
  //#endregion
7910
7791
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/tr.js
7911
7792
  const error$7 = () => {
@@ -8005,7 +7886,6 @@ const error$7 = () => {
8005
7886
  function tr_default() {
8006
7887
  return { localeError: error$7() };
8007
7888
  }
8008
-
8009
7889
  //#endregion
8010
7890
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/uk.js
8011
7891
  const error$6 = () => {
@@ -8109,14 +7989,12 @@ const error$6 = () => {
8109
7989
  function uk_default() {
8110
7990
  return { localeError: error$6() };
8111
7991
  }
8112
-
8113
7992
  //#endregion
8114
7993
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ua.js
8115
7994
  /** @deprecated Use `uk` instead. */
8116
7995
  function ua_default() {
8117
7996
  return uk_default();
8118
7997
  }
8119
-
8120
7998
  //#endregion
8121
7999
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ur.js
8122
8000
  const error$5 = () => {
@@ -8221,7 +8099,6 @@ const error$5 = () => {
8221
8099
  function ur_default() {
8222
8100
  return { localeError: error$5() };
8223
8101
  }
8224
-
8225
8102
  //#endregion
8226
8103
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/uz.js
8227
8104
  const error$4 = () => {
@@ -8326,7 +8203,6 @@ const error$4 = () => {
8326
8203
  function uz_default() {
8327
8204
  return { localeError: error$4() };
8328
8205
  }
8329
-
8330
8206
  //#endregion
8331
8207
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/vi.js
8332
8208
  const error$3 = () => {
@@ -8430,7 +8306,6 @@ const error$3 = () => {
8430
8306
  function vi_default() {
8431
8307
  return { localeError: error$3() };
8432
8308
  }
8433
-
8434
8309
  //#endregion
8435
8310
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/zh-CN.js
8436
8311
  const error$2 = () => {
@@ -8535,7 +8410,6 @@ const error$2 = () => {
8535
8410
  function zh_CN_default() {
8536
8411
  return { localeError: error$2() };
8537
8412
  }
8538
-
8539
8413
  //#endregion
8540
8414
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/zh-TW.js
8541
8415
  const error$1 = () => {
@@ -8635,7 +8509,6 @@ const error$1 = () => {
8635
8509
  function zh_TW_default() {
8636
8510
  return { localeError: error$1() };
8637
8511
  }
8638
-
8639
8512
  //#endregion
8640
8513
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/yo.js
8641
8514
  const error = () => {
@@ -8739,7 +8612,6 @@ const error = () => {
8739
8612
  function yo_default() {
8740
8613
  return { localeError: error() };
8741
8614
  }
8742
-
8743
8615
  //#endregion
8744
8616
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/index.js
8745
8617
  var locales_exports = /* @__PURE__ */ __exportAll({
@@ -8793,7 +8665,6 @@ var locales_exports = /* @__PURE__ */ __exportAll({
8793
8665
  zhCN: () => zh_CN_default,
8794
8666
  zhTW: () => zh_TW_default
8795
8667
  });
8796
-
8797
8668
  //#endregion
8798
8669
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.js
8799
8670
  var _a;
@@ -8843,7 +8714,6 @@ function registry() {
8843
8714
  }
8844
8715
  (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
8845
8716
  const globalRegistry = globalThis.__zod_globalRegistry;
8846
-
8847
8717
  //#endregion
8848
8718
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.js
8849
8719
  /* @__NO_SIDE_EFFECTS__ */
@@ -9571,12 +9441,11 @@ function _intersection(Class, left, right) {
9571
9441
  /* @__NO_SIDE_EFFECTS__ */
9572
9442
  function _tuple(Class, items, _paramsOrRest, _params) {
9573
9443
  const hasRest = _paramsOrRest instanceof $ZodType;
9574
- const params = hasRest ? _params : _paramsOrRest;
9575
9444
  return new Class({
9576
9445
  type: "tuple",
9577
9446
  items,
9578
9447
  rest: hasRest ? _paramsOrRest : null,
9579
- ...normalizeParams(params)
9448
+ ...normalizeParams(hasRest ? _params : _paramsOrRest)
9580
9449
  });
9581
9450
  }
9582
9451
  /* @__NO_SIDE_EFFECTS__ */
@@ -9884,7 +9753,6 @@ function _stringFormat(Class, format, fnOrRegex, _params = {}) {
9884
9753
  if (fnOrRegex instanceof RegExp) def.pattern = fnOrRegex;
9885
9754
  return new Class(def);
9886
9755
  }
9887
-
9888
9756
  //#endregion
9889
9757
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.js
9890
9758
  function initializeContext(params) {
@@ -10170,7 +10038,6 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
10170
10038
  extractDefs(ctx, schema);
10171
10039
  return finalize(ctx, schema);
10172
10040
  };
10173
-
10174
10041
  //#endregion
10175
10042
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema-processors.js
10176
10043
  const formatMap = {
@@ -10627,7 +10494,6 @@ function toJSONSchema(input, params) {
10627
10494
  extractDefs(ctx, input);
10628
10495
  return finalize(ctx, input);
10629
10496
  }
10630
-
10631
10497
  //#endregion
10632
10498
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema-generator.js
10633
10499
  /**
@@ -10717,11 +10583,9 @@ var JSONSchemaGenerator = class {
10717
10583
  return plainResult;
10718
10584
  }
10719
10585
  };
10720
-
10721
10586
  //#endregion
10722
10587
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema.js
10723
10588
  var json_schema_exports = /* @__PURE__ */ __exportAll({});
10724
-
10725
10589
  //#endregion
10726
10590
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/index.js
10727
10591
  var core_exports = /* @__PURE__ */ __exportAll({
@@ -10999,7 +10863,6 @@ var core_exports = /* @__PURE__ */ __exportAll({
10999
10863
  util: () => util_exports,
11000
10864
  version: () => version
11001
10865
  });
11002
-
11003
10866
  //#endregion
11004
10867
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/checks.js
11005
10868
  var checks_exports = /* @__PURE__ */ __exportAll({
@@ -11033,7 +10896,6 @@ var checks_exports = /* @__PURE__ */ __exportAll({
11033
10896
  trim: () => _trim,
11034
10897
  uppercase: () => _uppercase
11035
10898
  });
11036
-
11037
10899
  //#endregion
11038
10900
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/iso.js
11039
10901
  var iso_exports = /* @__PURE__ */ __exportAll({
@@ -11051,30 +10913,29 @@ const ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def
11051
10913
  ZodStringFormat.init(inst, def);
11052
10914
  });
11053
10915
  function datetime(params) {
11054
- return _isoDateTime(ZodISODateTime, params);
10916
+ return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
11055
10917
  }
11056
10918
  const ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
11057
10919
  $ZodISODate.init(inst, def);
11058
10920
  ZodStringFormat.init(inst, def);
11059
10921
  });
11060
10922
  function date$2(params) {
11061
- return _isoDate(ZodISODate, params);
10923
+ return /* @__PURE__ */ _isoDate(ZodISODate, params);
11062
10924
  }
11063
10925
  const ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
11064
10926
  $ZodISOTime.init(inst, def);
11065
10927
  ZodStringFormat.init(inst, def);
11066
10928
  });
11067
10929
  function time(params) {
11068
- return _isoTime(ZodISOTime, params);
10930
+ return /* @__PURE__ */ _isoTime(ZodISOTime, params);
11069
10931
  }
11070
10932
  const ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => {
11071
10933
  $ZodISODuration.init(inst, def);
11072
10934
  ZodStringFormat.init(inst, def);
11073
10935
  });
11074
10936
  function duration(params) {
11075
- return _isoDuration(ZodISODuration, params);
10937
+ return /* @__PURE__ */ _isoDuration(ZodISODuration, params);
11076
10938
  }
11077
-
11078
10939
  //#endregion
11079
10940
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/errors.js
11080
10941
  const initializer = (inst, issues) => {
@@ -11098,7 +10959,6 @@ const initializer = (inst, issues) => {
11098
10959
  };
11099
10960
  const ZodError = $constructor("ZodError", initializer);
11100
10961
  const ZodRealError = $constructor("ZodError", initializer, { Parent: Error });
11101
-
11102
10962
  //#endregion
11103
10963
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/parse.js
11104
10964
  const parse = /* @__PURE__ */ _parse(ZodRealError);
@@ -11113,7 +10973,6 @@ const safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError);
11113
10973
  const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
11114
10974
  const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
11115
10975
  const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
11116
-
11117
10976
  //#endregion
11118
10977
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/schemas.js
11119
10978
  var schemas_exports = /* @__PURE__ */ __exportAll({
@@ -11321,7 +11180,7 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
11321
11180
  inst.safeDecodeAsync = async (data, params) => safeDecodeAsync(inst, data, params);
11322
11181
  inst.refine = (check, params) => inst.check(refine(check, params));
11323
11182
  inst.superRefine = (refinement) => inst.check(superRefine(refinement));
11324
- inst.overwrite = (fn) => inst.check(_overwrite(fn));
11183
+ inst.overwrite = (fn) => inst.check(/* @__PURE__ */ _overwrite(fn));
11325
11184
  inst.optional = () => optional(inst);
11326
11185
  inst.exactOptional = () => exactOptional(inst);
11327
11186
  inst.nullable = () => nullable(inst);
@@ -11367,55 +11226,55 @@ const _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
11367
11226
  inst.format = bag.format ?? null;
11368
11227
  inst.minLength = bag.minimum ?? null;
11369
11228
  inst.maxLength = bag.maximum ?? null;
11370
- inst.regex = (...args) => inst.check(_regex(...args));
11371
- inst.includes = (...args) => inst.check(_includes(...args));
11372
- inst.startsWith = (...args) => inst.check(_startsWith(...args));
11373
- inst.endsWith = (...args) => inst.check(_endsWith(...args));
11374
- inst.min = (...args) => inst.check(_minLength(...args));
11375
- inst.max = (...args) => inst.check(_maxLength(...args));
11376
- inst.length = (...args) => inst.check(_length(...args));
11377
- inst.nonempty = (...args) => inst.check(_minLength(1, ...args));
11378
- inst.lowercase = (params) => inst.check(_lowercase(params));
11379
- inst.uppercase = (params) => inst.check(_uppercase(params));
11380
- inst.trim = () => inst.check(_trim());
11381
- inst.normalize = (...args) => inst.check(_normalize(...args));
11382
- inst.toLowerCase = () => inst.check(_toLowerCase());
11383
- inst.toUpperCase = () => inst.check(_toUpperCase());
11384
- inst.slugify = () => inst.check(_slugify());
11229
+ inst.regex = (...args) => inst.check(/* @__PURE__ */ _regex(...args));
11230
+ inst.includes = (...args) => inst.check(/* @__PURE__ */ _includes(...args));
11231
+ inst.startsWith = (...args) => inst.check(/* @__PURE__ */ _startsWith(...args));
11232
+ inst.endsWith = (...args) => inst.check(/* @__PURE__ */ _endsWith(...args));
11233
+ inst.min = (...args) => inst.check(/* @__PURE__ */ _minLength(...args));
11234
+ inst.max = (...args) => inst.check(/* @__PURE__ */ _maxLength(...args));
11235
+ inst.length = (...args) => inst.check(/* @__PURE__ */ _length(...args));
11236
+ inst.nonempty = (...args) => inst.check(/* @__PURE__ */ _minLength(1, ...args));
11237
+ inst.lowercase = (params) => inst.check(/* @__PURE__ */ _lowercase(params));
11238
+ inst.uppercase = (params) => inst.check(/* @__PURE__ */ _uppercase(params));
11239
+ inst.trim = () => inst.check(/* @__PURE__ */ _trim());
11240
+ inst.normalize = (...args) => inst.check(/* @__PURE__ */ _normalize(...args));
11241
+ inst.toLowerCase = () => inst.check(/* @__PURE__ */ _toLowerCase());
11242
+ inst.toUpperCase = () => inst.check(/* @__PURE__ */ _toUpperCase());
11243
+ inst.slugify = () => inst.check(/* @__PURE__ */ _slugify());
11385
11244
  });
11386
11245
  const ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
11387
11246
  $ZodString.init(inst, def);
11388
11247
  _ZodString.init(inst, def);
11389
- inst.email = (params) => inst.check(_email(ZodEmail, params));
11390
- inst.url = (params) => inst.check(_url(ZodURL, params));
11391
- inst.jwt = (params) => inst.check(_jwt(ZodJWT, params));
11392
- inst.emoji = (params) => inst.check(_emoji(ZodEmoji, params));
11393
- inst.guid = (params) => inst.check(_guid(ZodGUID, params));
11394
- inst.uuid = (params) => inst.check(_uuid(ZodUUID, params));
11395
- inst.uuidv4 = (params) => inst.check(_uuidv4(ZodUUID, params));
11396
- inst.uuidv6 = (params) => inst.check(_uuidv6(ZodUUID, params));
11397
- inst.uuidv7 = (params) => inst.check(_uuidv7(ZodUUID, params));
11398
- inst.nanoid = (params) => inst.check(_nanoid(ZodNanoID, params));
11399
- inst.guid = (params) => inst.check(_guid(ZodGUID, params));
11400
- inst.cuid = (params) => inst.check(_cuid(ZodCUID, params));
11401
- inst.cuid2 = (params) => inst.check(_cuid2(ZodCUID2, params));
11402
- inst.ulid = (params) => inst.check(_ulid(ZodULID, params));
11403
- inst.base64 = (params) => inst.check(_base64(ZodBase64, params));
11404
- inst.base64url = (params) => inst.check(_base64url(ZodBase64URL, params));
11405
- inst.xid = (params) => inst.check(_xid(ZodXID, params));
11406
- inst.ksuid = (params) => inst.check(_ksuid(ZodKSUID, params));
11407
- inst.ipv4 = (params) => inst.check(_ipv4(ZodIPv4, params));
11408
- inst.ipv6 = (params) => inst.check(_ipv6(ZodIPv6, params));
11409
- inst.cidrv4 = (params) => inst.check(_cidrv4(ZodCIDRv4, params));
11410
- inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params));
11411
- inst.e164 = (params) => inst.check(_e164(ZodE164, params));
11248
+ inst.email = (params) => inst.check(/* @__PURE__ */ _email(ZodEmail, params));
11249
+ inst.url = (params) => inst.check(/* @__PURE__ */ _url(ZodURL, params));
11250
+ inst.jwt = (params) => inst.check(/* @__PURE__ */ _jwt(ZodJWT, params));
11251
+ inst.emoji = (params) => inst.check(/* @__PURE__ */ _emoji(ZodEmoji, params));
11252
+ inst.guid = (params) => inst.check(/* @__PURE__ */ _guid(ZodGUID, params));
11253
+ inst.uuid = (params) => inst.check(/* @__PURE__ */ _uuid(ZodUUID, params));
11254
+ inst.uuidv4 = (params) => inst.check(/* @__PURE__ */ _uuidv4(ZodUUID, params));
11255
+ inst.uuidv6 = (params) => inst.check(/* @__PURE__ */ _uuidv6(ZodUUID, params));
11256
+ inst.uuidv7 = (params) => inst.check(/* @__PURE__ */ _uuidv7(ZodUUID, params));
11257
+ inst.nanoid = (params) => inst.check(/* @__PURE__ */ _nanoid(ZodNanoID, params));
11258
+ inst.guid = (params) => inst.check(/* @__PURE__ */ _guid(ZodGUID, params));
11259
+ inst.cuid = (params) => inst.check(/* @__PURE__ */ _cuid(ZodCUID, params));
11260
+ inst.cuid2 = (params) => inst.check(/* @__PURE__ */ _cuid2(ZodCUID2, params));
11261
+ inst.ulid = (params) => inst.check(/* @__PURE__ */ _ulid(ZodULID, params));
11262
+ inst.base64 = (params) => inst.check(/* @__PURE__ */ _base64(ZodBase64, params));
11263
+ inst.base64url = (params) => inst.check(/* @__PURE__ */ _base64url(ZodBase64URL, params));
11264
+ inst.xid = (params) => inst.check(/* @__PURE__ */ _xid(ZodXID, params));
11265
+ inst.ksuid = (params) => inst.check(/* @__PURE__ */ _ksuid(ZodKSUID, params));
11266
+ inst.ipv4 = (params) => inst.check(/* @__PURE__ */ _ipv4(ZodIPv4, params));
11267
+ inst.ipv6 = (params) => inst.check(/* @__PURE__ */ _ipv6(ZodIPv6, params));
11268
+ inst.cidrv4 = (params) => inst.check(/* @__PURE__ */ _cidrv4(ZodCIDRv4, params));
11269
+ inst.cidrv6 = (params) => inst.check(/* @__PURE__ */ _cidrv6(ZodCIDRv6, params));
11270
+ inst.e164 = (params) => inst.check(/* @__PURE__ */ _e164(ZodE164, params));
11412
11271
  inst.datetime = (params) => inst.check(datetime(params));
11413
11272
  inst.date = (params) => inst.check(date$2(params));
11414
11273
  inst.time = (params) => inst.check(time(params));
11415
11274
  inst.duration = (params) => inst.check(duration(params));
11416
11275
  });
11417
11276
  function string$1(params) {
11418
- return _string(ZodString, params);
11277
+ return /* @__PURE__ */ _string(ZodString, params);
11419
11278
  }
11420
11279
  const ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => {
11421
11280
  $ZodStringFormat.init(inst, def);
@@ -11426,40 +11285,40 @@ const ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => {
11426
11285
  ZodStringFormat.init(inst, def);
11427
11286
  });
11428
11287
  function email(params) {
11429
- return _email(ZodEmail, params);
11288
+ return /* @__PURE__ */ _email(ZodEmail, params);
11430
11289
  }
11431
11290
  const ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def) => {
11432
11291
  $ZodGUID.init(inst, def);
11433
11292
  ZodStringFormat.init(inst, def);
11434
11293
  });
11435
11294
  function guid(params) {
11436
- return _guid(ZodGUID, params);
11295
+ return /* @__PURE__ */ _guid(ZodGUID, params);
11437
11296
  }
11438
11297
  const ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def) => {
11439
11298
  $ZodUUID.init(inst, def);
11440
11299
  ZodStringFormat.init(inst, def);
11441
11300
  });
11442
11301
  function uuid(params) {
11443
- return _uuid(ZodUUID, params);
11302
+ return /* @__PURE__ */ _uuid(ZodUUID, params);
11444
11303
  }
11445
11304
  function uuidv4(params) {
11446
- return _uuidv4(ZodUUID, params);
11305
+ return /* @__PURE__ */ _uuidv4(ZodUUID, params);
11447
11306
  }
11448
11307
  function uuidv6(params) {
11449
- return _uuidv6(ZodUUID, params);
11308
+ return /* @__PURE__ */ _uuidv6(ZodUUID, params);
11450
11309
  }
11451
11310
  function uuidv7(params) {
11452
- return _uuidv7(ZodUUID, params);
11311
+ return /* @__PURE__ */ _uuidv7(ZodUUID, params);
11453
11312
  }
11454
11313
  const ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => {
11455
11314
  $ZodURL.init(inst, def);
11456
11315
  ZodStringFormat.init(inst, def);
11457
11316
  });
11458
11317
  function url(params) {
11459
- return _url(ZodURL, params);
11318
+ return /* @__PURE__ */ _url(ZodURL, params);
11460
11319
  }
11461
11320
  function httpUrl(params) {
11462
- return _url(ZodURL, {
11321
+ return /* @__PURE__ */ _url(ZodURL, {
11463
11322
  protocol: /^https?$/,
11464
11323
  hostname: domain,
11465
11324
  ...normalizeParams(params)
@@ -11470,150 +11329,150 @@ const ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => {
11470
11329
  ZodStringFormat.init(inst, def);
11471
11330
  });
11472
11331
  function emoji(params) {
11473
- return _emoji(ZodEmoji, params);
11332
+ return /* @__PURE__ */ _emoji(ZodEmoji, params);
11474
11333
  }
11475
11334
  const ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => {
11476
11335
  $ZodNanoID.init(inst, def);
11477
11336
  ZodStringFormat.init(inst, def);
11478
11337
  });
11479
11338
  function nanoid(params) {
11480
- return _nanoid(ZodNanoID, params);
11339
+ return /* @__PURE__ */ _nanoid(ZodNanoID, params);
11481
11340
  }
11482
11341
  const ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def) => {
11483
11342
  $ZodCUID.init(inst, def);
11484
11343
  ZodStringFormat.init(inst, def);
11485
11344
  });
11486
11345
  function cuid(params) {
11487
- return _cuid(ZodCUID, params);
11346
+ return /* @__PURE__ */ _cuid(ZodCUID, params);
11488
11347
  }
11489
11348
  const ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def) => {
11490
11349
  $ZodCUID2.init(inst, def);
11491
11350
  ZodStringFormat.init(inst, def);
11492
11351
  });
11493
11352
  function cuid2(params) {
11494
- return _cuid2(ZodCUID2, params);
11353
+ return /* @__PURE__ */ _cuid2(ZodCUID2, params);
11495
11354
  }
11496
11355
  const ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => {
11497
11356
  $ZodULID.init(inst, def);
11498
11357
  ZodStringFormat.init(inst, def);
11499
11358
  });
11500
11359
  function ulid(params) {
11501
- return _ulid(ZodULID, params);
11360
+ return /* @__PURE__ */ _ulid(ZodULID, params);
11502
11361
  }
11503
11362
  const ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => {
11504
11363
  $ZodXID.init(inst, def);
11505
11364
  ZodStringFormat.init(inst, def);
11506
11365
  });
11507
11366
  function xid(params) {
11508
- return _xid(ZodXID, params);
11367
+ return /* @__PURE__ */ _xid(ZodXID, params);
11509
11368
  }
11510
11369
  const ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def) => {
11511
11370
  $ZodKSUID.init(inst, def);
11512
11371
  ZodStringFormat.init(inst, def);
11513
11372
  });
11514
11373
  function ksuid(params) {
11515
- return _ksuid(ZodKSUID, params);
11374
+ return /* @__PURE__ */ _ksuid(ZodKSUID, params);
11516
11375
  }
11517
11376
  const ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def) => {
11518
11377
  $ZodIPv4.init(inst, def);
11519
11378
  ZodStringFormat.init(inst, def);
11520
11379
  });
11521
11380
  function ipv4(params) {
11522
- return _ipv4(ZodIPv4, params);
11381
+ return /* @__PURE__ */ _ipv4(ZodIPv4, params);
11523
11382
  }
11524
11383
  const ZodMAC = /* @__PURE__ */ $constructor("ZodMAC", (inst, def) => {
11525
11384
  $ZodMAC.init(inst, def);
11526
11385
  ZodStringFormat.init(inst, def);
11527
11386
  });
11528
11387
  function mac(params) {
11529
- return _mac(ZodMAC, params);
11388
+ return /* @__PURE__ */ _mac(ZodMAC, params);
11530
11389
  }
11531
11390
  const ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def) => {
11532
11391
  $ZodIPv6.init(inst, def);
11533
11392
  ZodStringFormat.init(inst, def);
11534
11393
  });
11535
11394
  function ipv6(params) {
11536
- return _ipv6(ZodIPv6, params);
11395
+ return /* @__PURE__ */ _ipv6(ZodIPv6, params);
11537
11396
  }
11538
11397
  const ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def) => {
11539
11398
  $ZodCIDRv4.init(inst, def);
11540
11399
  ZodStringFormat.init(inst, def);
11541
11400
  });
11542
11401
  function cidrv4(params) {
11543
- return _cidrv4(ZodCIDRv4, params);
11402
+ return /* @__PURE__ */ _cidrv4(ZodCIDRv4, params);
11544
11403
  }
11545
11404
  const ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def) => {
11546
11405
  $ZodCIDRv6.init(inst, def);
11547
11406
  ZodStringFormat.init(inst, def);
11548
11407
  });
11549
11408
  function cidrv6(params) {
11550
- return _cidrv6(ZodCIDRv6, params);
11409
+ return /* @__PURE__ */ _cidrv6(ZodCIDRv6, params);
11551
11410
  }
11552
11411
  const ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def) => {
11553
11412
  $ZodBase64.init(inst, def);
11554
11413
  ZodStringFormat.init(inst, def);
11555
11414
  });
11556
11415
  function base64(params) {
11557
- return _base64(ZodBase64, params);
11416
+ return /* @__PURE__ */ _base64(ZodBase64, params);
11558
11417
  }
11559
11418
  const ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => {
11560
11419
  $ZodBase64URL.init(inst, def);
11561
11420
  ZodStringFormat.init(inst, def);
11562
11421
  });
11563
11422
  function base64url(params) {
11564
- return _base64url(ZodBase64URL, params);
11423
+ return /* @__PURE__ */ _base64url(ZodBase64URL, params);
11565
11424
  }
11566
11425
  const ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => {
11567
11426
  $ZodE164.init(inst, def);
11568
11427
  ZodStringFormat.init(inst, def);
11569
11428
  });
11570
11429
  function e164(params) {
11571
- return _e164(ZodE164, params);
11430
+ return /* @__PURE__ */ _e164(ZodE164, params);
11572
11431
  }
11573
11432
  const ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
11574
11433
  $ZodJWT.init(inst, def);
11575
11434
  ZodStringFormat.init(inst, def);
11576
11435
  });
11577
11436
  function jwt(params) {
11578
- return _jwt(ZodJWT, params);
11437
+ return /* @__PURE__ */ _jwt(ZodJWT, params);
11579
11438
  }
11580
11439
  const ZodCustomStringFormat = /* @__PURE__ */ $constructor("ZodCustomStringFormat", (inst, def) => {
11581
11440
  $ZodCustomStringFormat.init(inst, def);
11582
11441
  ZodStringFormat.init(inst, def);
11583
11442
  });
11584
11443
  function stringFormat(format, fnOrRegex, _params = {}) {
11585
- return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
11444
+ return /* @__PURE__ */ _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
11586
11445
  }
11587
11446
  function hostname(_params) {
11588
- return _stringFormat(ZodCustomStringFormat, "hostname", hostname$1, _params);
11447
+ return /* @__PURE__ */ _stringFormat(ZodCustomStringFormat, "hostname", hostname$1, _params);
11589
11448
  }
11590
11449
  function hex(_params) {
11591
- return _stringFormat(ZodCustomStringFormat, "hex", hex$1, _params);
11450
+ return /* @__PURE__ */ _stringFormat(ZodCustomStringFormat, "hex", hex$1, _params);
11592
11451
  }
11593
11452
  function hash(alg, params) {
11594
11453
  const format = `${alg}_${params?.enc ?? "hex"}`;
11595
11454
  const regex = regexes_exports[format];
11596
11455
  if (!regex) throw new Error(`Unrecognized hash format: ${format}`);
11597
- return _stringFormat(ZodCustomStringFormat, format, regex, params);
11456
+ return /* @__PURE__ */ _stringFormat(ZodCustomStringFormat, format, regex, params);
11598
11457
  }
11599
11458
  const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
11600
11459
  $ZodNumber.init(inst, def);
11601
11460
  ZodType.init(inst, def);
11602
11461
  inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
11603
- inst.gt = (value, params) => inst.check(_gt(value, params));
11604
- inst.gte = (value, params) => inst.check(_gte(value, params));
11605
- inst.min = (value, params) => inst.check(_gte(value, params));
11606
- inst.lt = (value, params) => inst.check(_lt(value, params));
11607
- inst.lte = (value, params) => inst.check(_lte(value, params));
11608
- inst.max = (value, params) => inst.check(_lte(value, params));
11462
+ inst.gt = (value, params) => inst.check(/* @__PURE__ */ _gt(value, params));
11463
+ inst.gte = (value, params) => inst.check(/* @__PURE__ */ _gte(value, params));
11464
+ inst.min = (value, params) => inst.check(/* @__PURE__ */ _gte(value, params));
11465
+ inst.lt = (value, params) => inst.check(/* @__PURE__ */ _lt(value, params));
11466
+ inst.lte = (value, params) => inst.check(/* @__PURE__ */ _lte(value, params));
11467
+ inst.max = (value, params) => inst.check(/* @__PURE__ */ _lte(value, params));
11609
11468
  inst.int = (params) => inst.check(int(params));
11610
11469
  inst.safe = (params) => inst.check(int(params));
11611
- inst.positive = (params) => inst.check(_gt(0, params));
11612
- inst.nonnegative = (params) => inst.check(_gte(0, params));
11613
- inst.negative = (params) => inst.check(_lt(0, params));
11614
- inst.nonpositive = (params) => inst.check(_lte(0, params));
11615
- inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params));
11616
- inst.step = (value, params) => inst.check(_multipleOf(value, params));
11470
+ inst.positive = (params) => inst.check(/* @__PURE__ */ _gt(0, params));
11471
+ inst.nonnegative = (params) => inst.check(/* @__PURE__ */ _gte(0, params));
11472
+ inst.negative = (params) => inst.check(/* @__PURE__ */ _lt(0, params));
11473
+ inst.nonpositive = (params) => inst.check(/* @__PURE__ */ _lte(0, params));
11474
+ inst.multipleOf = (value, params) => inst.check(/* @__PURE__ */ _multipleOf(value, params));
11475
+ inst.step = (value, params) => inst.check(/* @__PURE__ */ _multipleOf(value, params));
11617
11476
  inst.finite = () => inst;
11618
11477
  const bag = inst._zod.bag;
11619
11478
  inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
@@ -11623,26 +11482,26 @@ const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
11623
11482
  inst.format = bag.format ?? null;
11624
11483
  });
11625
11484
  function number$1(params) {
11626
- return _number(ZodNumber, params);
11485
+ return /* @__PURE__ */ _number(ZodNumber, params);
11627
11486
  }
11628
11487
  const ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def) => {
11629
11488
  $ZodNumberFormat.init(inst, def);
11630
11489
  ZodNumber.init(inst, def);
11631
11490
  });
11632
11491
  function int(params) {
11633
- return _int(ZodNumberFormat, params);
11492
+ return /* @__PURE__ */ _int(ZodNumberFormat, params);
11634
11493
  }
11635
11494
  function float32(params) {
11636
- return _float32(ZodNumberFormat, params);
11495
+ return /* @__PURE__ */ _float32(ZodNumberFormat, params);
11637
11496
  }
11638
11497
  function float64(params) {
11639
- return _float64(ZodNumberFormat, params);
11498
+ return /* @__PURE__ */ _float64(ZodNumberFormat, params);
11640
11499
  }
11641
11500
  function int32(params) {
11642
- return _int32(ZodNumberFormat, params);
11501
+ return /* @__PURE__ */ _int32(ZodNumberFormat, params);
11643
11502
  }
11644
11503
  function uint32(params) {
11645
- return _uint32(ZodNumberFormat, params);
11504
+ return /* @__PURE__ */ _uint32(ZodNumberFormat, params);
11646
11505
  }
11647
11506
  const ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
11648
11507
  $ZodBoolean.init(inst, def);
@@ -11650,42 +11509,42 @@ const ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
11650
11509
  inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params);
11651
11510
  });
11652
11511
  function boolean$1(params) {
11653
- return _boolean(ZodBoolean, params);
11512
+ return /* @__PURE__ */ _boolean(ZodBoolean, params);
11654
11513
  }
11655
11514
  const ZodBigInt = /* @__PURE__ */ $constructor("ZodBigInt", (inst, def) => {
11656
11515
  $ZodBigInt.init(inst, def);
11657
11516
  ZodType.init(inst, def);
11658
11517
  inst._zod.processJSONSchema = (ctx, json, params) => bigintProcessor(inst, ctx, json, params);
11659
- inst.gte = (value, params) => inst.check(_gte(value, params));
11660
- inst.min = (value, params) => inst.check(_gte(value, params));
11661
- inst.gt = (value, params) => inst.check(_gt(value, params));
11662
- inst.gte = (value, params) => inst.check(_gte(value, params));
11663
- inst.min = (value, params) => inst.check(_gte(value, params));
11664
- inst.lt = (value, params) => inst.check(_lt(value, params));
11665
- inst.lte = (value, params) => inst.check(_lte(value, params));
11666
- inst.max = (value, params) => inst.check(_lte(value, params));
11667
- inst.positive = (params) => inst.check(_gt(BigInt(0), params));
11668
- inst.negative = (params) => inst.check(_lt(BigInt(0), params));
11669
- inst.nonpositive = (params) => inst.check(_lte(BigInt(0), params));
11670
- inst.nonnegative = (params) => inst.check(_gte(BigInt(0), params));
11671
- inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params));
11518
+ inst.gte = (value, params) => inst.check(/* @__PURE__ */ _gte(value, params));
11519
+ inst.min = (value, params) => inst.check(/* @__PURE__ */ _gte(value, params));
11520
+ inst.gt = (value, params) => inst.check(/* @__PURE__ */ _gt(value, params));
11521
+ inst.gte = (value, params) => inst.check(/* @__PURE__ */ _gte(value, params));
11522
+ inst.min = (value, params) => inst.check(/* @__PURE__ */ _gte(value, params));
11523
+ inst.lt = (value, params) => inst.check(/* @__PURE__ */ _lt(value, params));
11524
+ inst.lte = (value, params) => inst.check(/* @__PURE__ */ _lte(value, params));
11525
+ inst.max = (value, params) => inst.check(/* @__PURE__ */ _lte(value, params));
11526
+ inst.positive = (params) => inst.check(/* @__PURE__ */ _gt(BigInt(0), params));
11527
+ inst.negative = (params) => inst.check(/* @__PURE__ */ _lt(BigInt(0), params));
11528
+ inst.nonpositive = (params) => inst.check(/* @__PURE__ */ _lte(BigInt(0), params));
11529
+ inst.nonnegative = (params) => inst.check(/* @__PURE__ */ _gte(BigInt(0), params));
11530
+ inst.multipleOf = (value, params) => inst.check(/* @__PURE__ */ _multipleOf(value, params));
11672
11531
  const bag = inst._zod.bag;
11673
11532
  inst.minValue = bag.minimum ?? null;
11674
11533
  inst.maxValue = bag.maximum ?? null;
11675
11534
  inst.format = bag.format ?? null;
11676
11535
  });
11677
11536
  function bigint$1(params) {
11678
- return _bigint(ZodBigInt, params);
11537
+ return /* @__PURE__ */ _bigint(ZodBigInt, params);
11679
11538
  }
11680
11539
  const ZodBigIntFormat = /* @__PURE__ */ $constructor("ZodBigIntFormat", (inst, def) => {
11681
11540
  $ZodBigIntFormat.init(inst, def);
11682
11541
  ZodBigInt.init(inst, def);
11683
11542
  });
11684
11543
  function int64(params) {
11685
- return _int64(ZodBigIntFormat, params);
11544
+ return /* @__PURE__ */ _int64(ZodBigIntFormat, params);
11686
11545
  }
11687
11546
  function uint64(params) {
11688
- return _uint64(ZodBigIntFormat, params);
11547
+ return /* @__PURE__ */ _uint64(ZodBigIntFormat, params);
11689
11548
  }
11690
11549
  const ZodSymbol = /* @__PURE__ */ $constructor("ZodSymbol", (inst, def) => {
11691
11550
  $ZodSymbol.init(inst, def);
@@ -11693,7 +11552,7 @@ const ZodSymbol = /* @__PURE__ */ $constructor("ZodSymbol", (inst, def) => {
11693
11552
  inst._zod.processJSONSchema = (ctx, json, params) => symbolProcessor(inst, ctx, json, params);
11694
11553
  });
11695
11554
  function symbol(params) {
11696
- return _symbol(ZodSymbol, params);
11555
+ return /* @__PURE__ */ _symbol(ZodSymbol, params);
11697
11556
  }
11698
11557
  const ZodUndefined = /* @__PURE__ */ $constructor("ZodUndefined", (inst, def) => {
11699
11558
  $ZodUndefined.init(inst, def);
@@ -11701,7 +11560,7 @@ const ZodUndefined = /* @__PURE__ */ $constructor("ZodUndefined", (inst, def) =>
11701
11560
  inst._zod.processJSONSchema = (ctx, json, params) => undefinedProcessor(inst, ctx, json, params);
11702
11561
  });
11703
11562
  function _undefined(params) {
11704
- return _undefined$1(ZodUndefined, params);
11563
+ return /* @__PURE__ */ _undefined$1(ZodUndefined, params);
11705
11564
  }
11706
11565
  const ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
11707
11566
  $ZodNull.init(inst, def);
@@ -11709,7 +11568,7 @@ const ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
11709
11568
  inst._zod.processJSONSchema = (ctx, json, params) => nullProcessor(inst, ctx, json, params);
11710
11569
  });
11711
11570
  function _null(params) {
11712
- return _null$1(ZodNull, params);
11571
+ return /* @__PURE__ */ _null$1(ZodNull, params);
11713
11572
  }
11714
11573
  const ZodAny = /* @__PURE__ */ $constructor("ZodAny", (inst, def) => {
11715
11574
  $ZodAny.init(inst, def);
@@ -11717,7 +11576,7 @@ const ZodAny = /* @__PURE__ */ $constructor("ZodAny", (inst, def) => {
11717
11576
  inst._zod.processJSONSchema = (ctx, json, params) => anyProcessor(inst, ctx, json, params);
11718
11577
  });
11719
11578
  function any() {
11720
- return _any(ZodAny);
11579
+ return /* @__PURE__ */ _any(ZodAny);
11721
11580
  }
11722
11581
  const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
11723
11582
  $ZodUnknown.init(inst, def);
@@ -11725,7 +11584,7 @@ const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
11725
11584
  inst._zod.processJSONSchema = (ctx, json, params) => unknownProcessor(inst, ctx, json, params);
11726
11585
  });
11727
11586
  function unknown() {
11728
- return _unknown(ZodUnknown);
11587
+ return /* @__PURE__ */ _unknown(ZodUnknown);
11729
11588
  }
11730
11589
  const ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
11731
11590
  $ZodNever.init(inst, def);
@@ -11733,7 +11592,7 @@ const ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
11733
11592
  inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json, params);
11734
11593
  });
11735
11594
  function never(params) {
11736
- return _never(ZodNever, params);
11595
+ return /* @__PURE__ */ _never(ZodNever, params);
11737
11596
  }
11738
11597
  const ZodVoid = /* @__PURE__ */ $constructor("ZodVoid", (inst, def) => {
11739
11598
  $ZodVoid.init(inst, def);
@@ -11741,34 +11600,34 @@ const ZodVoid = /* @__PURE__ */ $constructor("ZodVoid", (inst, def) => {
11741
11600
  inst._zod.processJSONSchema = (ctx, json, params) => voidProcessor(inst, ctx, json, params);
11742
11601
  });
11743
11602
  function _void(params) {
11744
- return _void$1(ZodVoid, params);
11603
+ return /* @__PURE__ */ _void$1(ZodVoid, params);
11745
11604
  }
11746
11605
  const ZodDate = /* @__PURE__ */ $constructor("ZodDate", (inst, def) => {
11747
11606
  $ZodDate.init(inst, def);
11748
11607
  ZodType.init(inst, def);
11749
11608
  inst._zod.processJSONSchema = (ctx, json, params) => dateProcessor(inst, ctx, json, params);
11750
- inst.min = (value, params) => inst.check(_gte(value, params));
11751
- inst.max = (value, params) => inst.check(_lte(value, params));
11609
+ inst.min = (value, params) => inst.check(/* @__PURE__ */ _gte(value, params));
11610
+ inst.max = (value, params) => inst.check(/* @__PURE__ */ _lte(value, params));
11752
11611
  const c = inst._zod.bag;
11753
11612
  inst.minDate = c.minimum ? new Date(c.minimum) : null;
11754
11613
  inst.maxDate = c.maximum ? new Date(c.maximum) : null;
11755
11614
  });
11756
11615
  function date$1(params) {
11757
- return _date(ZodDate, params);
11616
+ return /* @__PURE__ */ _date(ZodDate, params);
11758
11617
  }
11759
11618
  const ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
11760
11619
  $ZodArray.init(inst, def);
11761
11620
  ZodType.init(inst, def);
11762
11621
  inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
11763
11622
  inst.element = def.element;
11764
- inst.min = (minLength, params) => inst.check(_minLength(minLength, params));
11765
- inst.nonempty = (params) => inst.check(_minLength(1, params));
11766
- inst.max = (maxLength, params) => inst.check(_maxLength(maxLength, params));
11767
- inst.length = (len, params) => inst.check(_length(len, params));
11623
+ inst.min = (minLength, params) => inst.check(/* @__PURE__ */ _minLength(minLength, params));
11624
+ inst.nonempty = (params) => inst.check(/* @__PURE__ */ _minLength(1, params));
11625
+ inst.max = (maxLength, params) => inst.check(/* @__PURE__ */ _maxLength(maxLength, params));
11626
+ inst.length = (len, params) => inst.check(/* @__PURE__ */ _length(len, params));
11768
11627
  inst.unwrap = () => inst.element;
11769
11628
  });
11770
11629
  function array(element, params) {
11771
- return _array(ZodArray, element, params);
11630
+ return /* @__PURE__ */ _array(ZodArray, element, params);
11772
11631
  }
11773
11632
  function keyof(schema) {
11774
11633
  const shape = schema._zod.def.shape;
@@ -11902,12 +11761,11 @@ const ZodTuple = /* @__PURE__ */ $constructor("ZodTuple", (inst, def) => {
11902
11761
  });
11903
11762
  function tuple(items, _paramsOrRest, _params) {
11904
11763
  const hasRest = _paramsOrRest instanceof $ZodType;
11905
- const params = hasRest ? _params : _paramsOrRest;
11906
11764
  return new ZodTuple({
11907
11765
  type: "tuple",
11908
11766
  items,
11909
11767
  rest: hasRest ? _paramsOrRest : null,
11910
- ...normalizeParams(params)
11768
+ ...normalizeParams(hasRest ? _params : _paramsOrRest)
11911
11769
  });
11912
11770
  }
11913
11771
  const ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
@@ -11950,10 +11808,10 @@ const ZodMap = /* @__PURE__ */ $constructor("ZodMap", (inst, def) => {
11950
11808
  inst._zod.processJSONSchema = (ctx, json, params) => mapProcessor(inst, ctx, json, params);
11951
11809
  inst.keyType = def.keyType;
11952
11810
  inst.valueType = def.valueType;
11953
- inst.min = (...args) => inst.check(_minSize(...args));
11954
- inst.nonempty = (params) => inst.check(_minSize(1, params));
11955
- inst.max = (...args) => inst.check(_maxSize(...args));
11956
- inst.size = (...args) => inst.check(_size(...args));
11811
+ inst.min = (...args) => inst.check(/* @__PURE__ */ _minSize(...args));
11812
+ inst.nonempty = (params) => inst.check(/* @__PURE__ */ _minSize(1, params));
11813
+ inst.max = (...args) => inst.check(/* @__PURE__ */ _maxSize(...args));
11814
+ inst.size = (...args) => inst.check(/* @__PURE__ */ _size(...args));
11957
11815
  });
11958
11816
  function map(keyType, valueType, params) {
11959
11817
  return new ZodMap({
@@ -11967,10 +11825,10 @@ const ZodSet = /* @__PURE__ */ $constructor("ZodSet", (inst, def) => {
11967
11825
  $ZodSet.init(inst, def);
11968
11826
  ZodType.init(inst, def);
11969
11827
  inst._zod.processJSONSchema = (ctx, json, params) => setProcessor(inst, ctx, json, params);
11970
- inst.min = (...args) => inst.check(_minSize(...args));
11971
- inst.nonempty = (params) => inst.check(_minSize(1, params));
11972
- inst.max = (...args) => inst.check(_maxSize(...args));
11973
- inst.size = (...args) => inst.check(_size(...args));
11828
+ inst.min = (...args) => inst.check(/* @__PURE__ */ _minSize(...args));
11829
+ inst.nonempty = (params) => inst.check(/* @__PURE__ */ _minSize(1, params));
11830
+ inst.max = (...args) => inst.check(/* @__PURE__ */ _maxSize(...args));
11831
+ inst.size = (...args) => inst.check(/* @__PURE__ */ _size(...args));
11974
11832
  });
11975
11833
  function set(valueType, params) {
11976
11834
  return new ZodSet({
@@ -12051,12 +11909,12 @@ const ZodFile = /* @__PURE__ */ $constructor("ZodFile", (inst, def) => {
12051
11909
  $ZodFile.init(inst, def);
12052
11910
  ZodType.init(inst, def);
12053
11911
  inst._zod.processJSONSchema = (ctx, json, params) => fileProcessor(inst, ctx, json, params);
12054
- inst.min = (size, params) => inst.check(_minSize(size, params));
12055
- inst.max = (size, params) => inst.check(_maxSize(size, params));
12056
- inst.mime = (types, params) => inst.check(_mime(Array.isArray(types) ? types : [types], params));
11912
+ inst.min = (size, params) => inst.check(/* @__PURE__ */ _minSize(size, params));
11913
+ inst.max = (size, params) => inst.check(/* @__PURE__ */ _maxSize(size, params));
11914
+ inst.mime = (types, params) => inst.check(/* @__PURE__ */ _mime(Array.isArray(types) ? types : [types], params));
12057
11915
  });
12058
11916
  function file(params) {
12059
- return _file(ZodFile, params);
11917
+ return /* @__PURE__ */ _file(ZodFile, params);
12060
11918
  }
12061
11919
  const ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
12062
11920
  $ZodTransform.init(inst, def);
@@ -12205,7 +12063,7 @@ const ZodNaN = /* @__PURE__ */ $constructor("ZodNaN", (inst, def) => {
12205
12063
  inst._zod.processJSONSchema = (ctx, json, params) => nanProcessor(inst, ctx, json, params);
12206
12064
  });
12207
12065
  function nan(params) {
12208
- return _nan(ZodNaN, params);
12066
+ return /* @__PURE__ */ _nan(ZodNaN, params);
12209
12067
  }
12210
12068
  const ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
12211
12069
  $ZodPipe.init(inst, def);
@@ -12305,13 +12163,13 @@ function check(fn) {
12305
12163
  return ch;
12306
12164
  }
12307
12165
  function custom(fn, _params) {
12308
- return _custom(ZodCustom, fn ?? (() => true), _params);
12166
+ return /* @__PURE__ */ _custom(ZodCustom, fn ?? (() => true), _params);
12309
12167
  }
12310
12168
  function refine(fn, _params = {}) {
12311
- return _refine(ZodCustom, fn, _params);
12169
+ return /* @__PURE__ */ _refine(ZodCustom, fn, _params);
12312
12170
  }
12313
12171
  function superRefine(fn) {
12314
- return _superRefine(fn);
12172
+ return /* @__PURE__ */ _superRefine(fn);
12315
12173
  }
12316
12174
  const describe = describe$1;
12317
12175
  const meta = meta$1;
@@ -12335,7 +12193,7 @@ function _instanceof(cls, params = {}) {
12335
12193
  };
12336
12194
  return inst;
12337
12195
  }
12338
- const stringbool = (...args) => _stringbool({
12196
+ const stringbool = (...args) => /* @__PURE__ */ _stringbool({
12339
12197
  Codec: ZodCodec,
12340
12198
  Boolean: ZodBoolean,
12341
12199
  String: ZodString
@@ -12356,7 +12214,6 @@ function json(params) {
12356
12214
  function preprocess(fn, schema) {
12357
12215
  return pipe(transform(fn), schema);
12358
12216
  }
12359
-
12360
12217
  //#endregion
12361
12218
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/compat.js
12362
12219
  /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
@@ -12384,7 +12241,6 @@ function getErrorMap() {
12384
12241
  /** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
12385
12242
  var ZodFirstPartyTypeKind;
12386
12243
  (function(ZodFirstPartyTypeKind) {})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
12387
-
12388
12244
  //#endregion
12389
12245
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/from-json-schema.js
12390
12246
  const z = {
@@ -12709,7 +12565,6 @@ function fromJSONSchema(schema, params) {
12709
12565
  registry: params?.registry ?? globalRegistry
12710
12566
  });
12711
12567
  }
12712
-
12713
12568
  //#endregion
12714
12569
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/coerce.js
12715
12570
  var coerce_exports = /* @__PURE__ */ __exportAll({
@@ -12720,21 +12575,20 @@ var coerce_exports = /* @__PURE__ */ __exportAll({
12720
12575
  string: () => string
12721
12576
  });
12722
12577
  function string(params) {
12723
- return _coercedString(ZodString, params);
12578
+ return /* @__PURE__ */ _coercedString(ZodString, params);
12724
12579
  }
12725
12580
  function number(params) {
12726
- return _coercedNumber(ZodNumber, params);
12581
+ return /* @__PURE__ */ _coercedNumber(ZodNumber, params);
12727
12582
  }
12728
12583
  function boolean(params) {
12729
- return _coercedBoolean(ZodBoolean, params);
12584
+ return /* @__PURE__ */ _coercedBoolean(ZodBoolean, params);
12730
12585
  }
12731
12586
  function bigint(params) {
12732
- return _coercedBigint(ZodBigInt, params);
12587
+ return /* @__PURE__ */ _coercedBigint(ZodBigInt, params);
12733
12588
  }
12734
12589
  function date(params) {
12735
- return _coercedDate(ZodDate, params);
12590
+ return /* @__PURE__ */ _coercedDate(ZodDate, params);
12736
12591
  }
12737
-
12738
12592
  //#endregion
12739
12593
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/external.js
12740
12594
  var external_exports = /* @__PURE__ */ __exportAll({
@@ -12976,204 +12830,159 @@ var external_exports = /* @__PURE__ */ __exportAll({
12976
12830
  xor: () => xor
12977
12831
  });
12978
12832
  config(en_default());
12979
-
12980
- //#endregion
12981
- //#region src/RequestValidationGenerator.ts
12982
- const moduleDir$4 = node_path.default.dirname((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
12983
- var RequestValidationGenerator = class {
12984
- static generate(context) {
12985
- const templateFilePath = node_path.default.join(moduleDir$4, "templates", "RequestValidator.ejs");
12986
- for (const [, entityResource] of Object.entries(context.resources.entityResources)) for (const definition of entityResource.operations) this.writeRequestValidator(templateFilePath, definition, context);
12987
- }
12988
- static writeRequestValidator(templateFilePath, operationResource, context) {
12989
- const { outputDir, definition, outputRequestFileName } = operationResource;
12990
- const { operationId, request } = definition;
12991
- const { body, query, param, header } = request;
12992
- const pascalCaseOperationId = case$1.default.pascal(operationId);
12993
- const content = context.renderTemplate(templateFilePath, {
12994
- pascalCaseOperationId,
12995
- operationId,
12996
- sourcePath: _rexeus_typeweaver_gen.Path.relative(outputDir, `${operationResource.sourceDir}/${node_path.default.relative(operationResource.sourceDir, operationResource.sourceFile).replace(/\.ts$/, "")}`),
12997
- corePath: context.coreDir,
12998
- requestFile: _rexeus_typeweaver_gen.Path.relative(outputDir, `${outputDir}/${node_path.default.basename(outputRequestFileName, ".ts")}`),
12999
- body,
13000
- query,
13001
- param,
13002
- header,
13003
- z: external_exports
13004
- });
13005
- const relativePath = node_path.default.relative(context.outputDir, operationResource.outputRequestValidationFile);
13006
- context.writeFile(relativePath, content);
13007
- }
13008
- };
13009
-
13010
12833
  //#endregion
13011
- //#region src/ResponseGenerator.ts
12834
+ //#region src/requestValidationGenerator.ts
13012
12835
  const moduleDir$3 = node_path.default.dirname((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
13013
- var ResponseGenerator = class {
13014
- static generate(context) {
13015
- const templateFile = node_path.default.join(moduleDir$3, "templates", "Response.ejs");
13016
- const sharedResponseTemplateFile = node_path.default.join(moduleDir$3, "templates", "SharedResponse.ejs");
13017
- for (const [, entityResource] of Object.entries(context.resources.entityResources)) {
13018
- for (const definition of entityResource.operations) this.writeResponseType(templateFile, definition, context);
13019
- for (const responseResource of entityResource.responses) this.writeEntityResponseType(sharedResponseTemplateFile, responseResource, context);
13020
- }
13021
- }
13022
- static writeResponseType(templateFile, resource, context) {
13023
- const { definition, outputResponseFile, outputDir, outputResponseFileName, sourceDir, sourceFile } = resource;
13024
- const { responses, operationId } = definition;
13025
- const pascalCaseOperationId = case$1.default.pascal(operationId);
13026
- const ownResponses = [];
13027
- const entityResponses = [];
13028
- const sharedResponses = [];
13029
- for (const response of responses) {
13030
- const { statusCode, name, body, header, isReference } = response;
13031
- if (isReference) {
13032
- const sharedResponse = context.resources.sharedResponseResources.find((resource) => resource.name === name);
13033
- if (sharedResponse) sharedResponses.push({
13034
- name,
13035
- path: _rexeus_typeweaver_gen.Path.relative(outputDir, `${sharedResponse.outputDir}/${node_path.default.basename(sharedResponse.outputFileName, ".ts")}`)
13036
- });
13037
- else {
13038
- const entityResponse = (context.resources.entityResources[resource.entityName]?.responses)?.find((r) => r.name === name);
13039
- if (!entityResponse) throw new Error(`Response ${name} not found in shared or entity-specific responses`);
13040
- entityResponses.push({
13041
- name,
13042
- path: _rexeus_typeweaver_gen.Path.relative(outputDir, `${entityResponse.outputDir}/${node_path.default.basename(entityResponse.outputFileName, ".ts")}`)
13043
- });
13044
- }
13045
- continue;
13046
- }
13047
- ownResponses.push({
13048
- name,
13049
- body: body ? _rexeus_typeweaver_zod_to_ts.TsTypePrinter.print(_rexeus_typeweaver_zod_to_ts.TsTypeNode.fromZod(body)) : void 0,
13050
- header: header ? _rexeus_typeweaver_zod_to_ts.TsTypePrinter.print(_rexeus_typeweaver_zod_to_ts.TsTypeNode.fromZod(header)) : void 0,
13051
- statusCode,
13052
- statusCodeKey: _rexeus_typeweaver_core.HttpStatusCode[statusCode]
13053
- });
13054
- }
13055
- const content = context.renderTemplate(templateFile, {
13056
- operationId,
13057
- pascalCaseOperationId,
13058
- coreDir: context.coreDir,
13059
- ownResponses,
13060
- entityResponses,
13061
- sharedResponses,
13062
- responseFile: _rexeus_typeweaver_gen.Path.relative(outputDir, `${outputDir}/${node_path.default.basename(outputResponseFileName, ".ts")}`),
13063
- sourcePath: _rexeus_typeweaver_gen.Path.relative(outputDir, `${sourceDir}/${node_path.default.relative(sourceDir, sourceFile).replace(/\.ts$/, "")}`)
13064
- });
13065
- const relativePath = node_path.default.relative(context.outputDir, outputResponseFile);
13066
- context.writeFile(relativePath, content);
13067
- }
13068
- static writeEntityResponseType(templateFile, resource, context) {
13069
- const { name, body, header, outputFile } = resource;
13070
- const pascalCaseName = case$1.default.pascal(name);
13071
- const headerTsType = header ? _rexeus_typeweaver_zod_to_ts.TsTypePrinter.print(_rexeus_typeweaver_zod_to_ts.TsTypeNode.fromZod(header)) : void 0;
13072
- const bodyTsType = body ? _rexeus_typeweaver_zod_to_ts.TsTypePrinter.print(_rexeus_typeweaver_zod_to_ts.TsTypeNode.fromZod(body)) : void 0;
13073
- const content = context.renderTemplate(templateFile, {
13074
- coreDir: context.coreDir,
13075
- httpStatusCode: _rexeus_typeweaver_core.HttpStatusCode,
13076
- headerTsType,
13077
- bodyTsType,
13078
- pascalCaseName,
13079
- sharedResponse: resource
13080
- });
13081
- const relativePath = node_path.default.relative(context.outputDir, outputFile);
13082
- context.writeFile(relativePath, content);
13083
- }
13084
- };
13085
-
12836
+ function generate$2(context) {
12837
+ const templateFilePath = node_path.default.join(moduleDir$3, "templates", "RequestValidator.ejs");
12838
+ for (const resource of context.normalizedSpec.resources) resource.operations.forEach((operation) => {
12839
+ writeRequestValidator(templateFilePath, resource.name, operation, context);
12840
+ });
12841
+ }
12842
+ function writeRequestValidator(templateFilePath, resourceName, operation, context) {
12843
+ const { operationId, request } = operation;
12844
+ const { body, query, param, header } = request ?? {};
12845
+ const outputPaths = context.getOperationOutputPaths({
12846
+ resourceName,
12847
+ operationId
12848
+ });
12849
+ const pascalCaseOperationId = case$1.default.pascal(operationId);
12850
+ const content = context.renderTemplate(templateFilePath, {
12851
+ pascalCaseOperationId,
12852
+ operationId,
12853
+ resourceName,
12854
+ specPath: context.getSpecImportPath({ importerDir: outputPaths.outputDir }),
12855
+ corePath: context.coreDir,
12856
+ requestFile: `./${node_path.default.basename(outputPaths.requestFileName, ".ts")}`,
12857
+ body,
12858
+ query,
12859
+ param,
12860
+ header,
12861
+ z: external_exports
12862
+ });
12863
+ const relativePath = node_path.default.relative(context.outputDir, outputPaths.requestValidationFile);
12864
+ context.writeFile(relativePath, content);
12865
+ }
13086
12866
  //#endregion
13087
- //#region src/ResponseValidationGenerator.ts
12867
+ //#region src/responseGenerator.ts
13088
12868
  const moduleDir$2 = node_path.default.dirname((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
13089
- var ResponseValidationGenerator = class {
13090
- static generate(context) {
13091
- const templateFilePath = node_path.default.join(moduleDir$2, "templates", "ResponseValidator.ejs");
13092
- for (const [, entityResource] of Object.entries(context.resources.entityResources)) for (const operationResource of entityResource.operations) this.writeResponseValidator(templateFilePath, operationResource, context);
13093
- }
13094
- static writeResponseValidator(templateFilePath, resource, context) {
13095
- const { definition, outputDir, outputResponseFileName, sourceDir, sourceFile, outputResponseValidationFile } = resource;
13096
- const { responses, operationId } = definition;
13097
- const pascalCaseOperationId = case$1.default.pascal(operationId);
13098
- const ownResponses = [];
13099
- const sharedResponses = [];
13100
- const allStatusCodes = [];
13101
- for (const response of responses) {
13102
- const { statusCode, name, isReference, body, header, statusCodeName } = response;
13103
- const index = responses.indexOf(response);
13104
- if (!allStatusCodes.some((status) => {
13105
- return status.statusCode === statusCode;
13106
- })) allStatusCodes.push({
13107
- statusCode,
13108
- name: statusCodeName
13109
- });
13110
- if (isReference) {
13111
- const sharedResponse = context.resources.sharedResponseResources.find((resource) => resource.name === name);
13112
- let importPath;
13113
- if (!sharedResponse) {
13114
- const entityResponse = (context.resources.entityResources[resource.entityName]?.responses)?.find((r) => r.name === name);
13115
- if (entityResponse) importPath = _rexeus_typeweaver_gen.Path.relative(outputDir, `${entityResponse.outputDir}/${node_path.default.basename(entityResponse.outputFileName, ".ts")}`);
13116
- else throw new Error(`Shared response '${response.name}' not found in shared or entity resources`);
13117
- } else importPath = _rexeus_typeweaver_gen.Path.relative(outputDir, `${sharedResponse.outputDir}/${node_path.default.basename(sharedResponse.outputFileName, ".ts")}`);
13118
- sharedResponses.push({
13119
- name,
13120
- importPath,
13121
- hasBody: !!body,
13122
- hasHeader: !!header,
13123
- statusCode,
13124
- index
13125
- });
13126
- continue;
13127
- }
13128
- ownResponses.push({
13129
- name,
13130
- hasBody: !!body,
13131
- hasHeader: !!header,
13132
- statusCode,
13133
- statusCodeKey: _rexeus_typeweaver_core.HttpStatusCode[statusCode],
13134
- index
12869
+ function generate$1(context) {
12870
+ const templateFile = node_path.default.join(moduleDir$2, "templates", "Response.ejs");
12871
+ const canonicalResponseTemplateFile = node_path.default.join(moduleDir$2, "templates", "SharedResponse.ejs");
12872
+ for (const response of context.normalizedSpec.responses) writeCanonicalResponseType(canonicalResponseTemplateFile, response, context);
12873
+ for (const resource of context.normalizedSpec.resources) for (const operation of resource.operations) writeResponseType(templateFile, resource, operation, context);
12874
+ }
12875
+ function writeResponseType(templateFile, resource, operation, context) {
12876
+ const outputPaths = context.getOperationOutputPaths({
12877
+ resourceName: resource.name,
12878
+ operationId: operation.operationId
12879
+ });
12880
+ const pascalCaseOperationId = case$1.default.pascal(operation.operationId);
12881
+ const ownResponses = [];
12882
+ const canonicalResponses = [];
12883
+ for (const responseUsage of operation.responses) {
12884
+ if (responseUsage.source === "canonical") {
12885
+ canonicalResponses.push({
12886
+ name: responseUsage.responseName,
12887
+ path: context.getCanonicalResponseImportPath({
12888
+ importerDir: outputPaths.outputDir,
12889
+ responseName: responseUsage.responseName
12890
+ })
13135
12891
  });
12892
+ continue;
13136
12893
  }
13137
- const content = context.renderTemplate(templateFilePath, {
13138
- operationId,
13139
- pascalCaseOperationId,
13140
- coreDir: context.coreDir,
13141
- responseFile: `./${node_path.default.basename(outputResponseFileName, ".ts")}`,
13142
- sourcePath: _rexeus_typeweaver_gen.Path.relative(outputDir, `${sourceDir}/${node_path.default.relative(sourceDir, sourceFile).replace(/\.ts$/, "")}`),
13143
- sharedResponses,
13144
- ownResponses,
13145
- allStatusCodes
13146
- });
13147
- const relativePath = node_path.default.relative(context.outputDir, outputResponseValidationFile);
13148
- context.writeFile(relativePath, content);
12894
+ ownResponses.push(createOwnResponseTemplateData(responseUsage.response));
13149
12895
  }
13150
- };
13151
-
12896
+ const content = context.renderTemplate(templateFile, {
12897
+ operationId: operation.operationId,
12898
+ pascalCaseOperationId,
12899
+ coreDir: context.coreDir,
12900
+ ownResponses,
12901
+ entityResponses: [],
12902
+ sharedResponses: canonicalResponses,
12903
+ responseFile: `./${node_path.default.basename(outputPaths.responseFileName, ".ts")}`
12904
+ });
12905
+ const relativePath = node_path.default.relative(context.outputDir, outputPaths.responseFile);
12906
+ context.writeFile(relativePath, content);
12907
+ }
12908
+ function createOwnResponseTemplateData(response) {
12909
+ return {
12910
+ name: response.name,
12911
+ body: response.body ? (0, _rexeus_typeweaver_zod_to_ts.print)((0, _rexeus_typeweaver_zod_to_ts.fromZod)(response.body)) : void 0,
12912
+ header: response.header ? (0, _rexeus_typeweaver_zod_to_ts.print)((0, _rexeus_typeweaver_zod_to_ts.fromZod)(response.header)) : void 0,
12913
+ statusCode: response.statusCode,
12914
+ statusCodeKey: _rexeus_typeweaver_core.HttpStatusCode[response.statusCode]
12915
+ };
12916
+ }
12917
+ function writeCanonicalResponseType(templateFile, response, context) {
12918
+ const pascalCaseName = case$1.default.pascal(response.name);
12919
+ const headerTsType = response.header ? (0, _rexeus_typeweaver_zod_to_ts.print)((0, _rexeus_typeweaver_zod_to_ts.fromZod)(response.header)) : void 0;
12920
+ const bodyTsType = response.body ? (0, _rexeus_typeweaver_zod_to_ts.print)((0, _rexeus_typeweaver_zod_to_ts.fromZod)(response.body)) : void 0;
12921
+ const content = context.renderTemplate(templateFile, {
12922
+ coreDir: context.coreDir,
12923
+ httpStatusCode: _rexeus_typeweaver_core.HttpStatusCode,
12924
+ headerTsType,
12925
+ bodyTsType,
12926
+ pascalCaseName,
12927
+ sharedResponse: response
12928
+ });
12929
+ const relativePath = node_path.default.relative(context.outputDir, context.getCanonicalResponseOutputFile(response.name));
12930
+ context.writeFile(relativePath, content);
12931
+ }
13152
12932
  //#endregion
13153
- //#region src/SharedResponseGenerator.ts
12933
+ //#region src/responseValidationGenerator.ts
13154
12934
  const moduleDir$1 = node_path.default.dirname((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
13155
- var SharedResponseGenerator = class {
13156
- static generate(context) {
13157
- const templateFile = node_path.default.join(moduleDir$1, "templates", "SharedResponse.ejs");
13158
- for (const sharedResponse of context.resources.sharedResponseResources) this.writeSharedResponse(templateFile, sharedResponse, context);
13159
- }
13160
- static writeSharedResponse(templateFile, sharedResponse, context) {
13161
- const headerTsType = sharedResponse.header ? _rexeus_typeweaver_zod_to_ts.TsTypePrinter.print(_rexeus_typeweaver_zod_to_ts.TsTypeNode.fromZod(sharedResponse.header)) : void 0;
13162
- const bodyTsType = sharedResponse.body ? _rexeus_typeweaver_zod_to_ts.TsTypePrinter.print(_rexeus_typeweaver_zod_to_ts.TsTypeNode.fromZod(sharedResponse.body)) : void 0;
13163
- const pascalCaseName = case$1.default.pascal(sharedResponse.name);
13164
- const content = context.renderTemplate(templateFile, {
13165
- coreDir: context.coreDir,
13166
- httpStatusCode: _rexeus_typeweaver_core.HttpStatusCode,
13167
- headerTsType,
13168
- bodyTsType,
13169
- pascalCaseName,
13170
- sharedResponse
12935
+ function generate(context) {
12936
+ const templateFilePath = node_path.default.join(moduleDir$1, "templates", "ResponseValidator.ejs");
12937
+ for (const resource of context.normalizedSpec.resources) resource.operations.forEach((operation) => {
12938
+ writeResponseValidator(templateFilePath, resource, operation, context);
12939
+ });
12940
+ }
12941
+ function writeResponseValidator(templateFilePath, resource, operation, context) {
12942
+ const outputPaths = context.getOperationOutputPaths({
12943
+ resourceName: resource.name,
12944
+ operationId: operation.operationId
12945
+ });
12946
+ const pascalCaseOperationId = case$1.default.pascal(operation.operationId);
12947
+ const ownResponses = [];
12948
+ const sharedResponses = [];
12949
+ const allStatusCodes = /* @__PURE__ */ new Map();
12950
+ operation.responses.forEach((responseUsage) => {
12951
+ const response = responseUsage.source === "canonical" ? context.getCanonicalResponse(responseUsage.responseName) : responseUsage.response;
12952
+ allStatusCodes.set(response.statusCode, response.statusCodeName);
12953
+ const templateData = {
12954
+ definitionVariableName: `${case$1.default.camel(response.name)}Definition`,
12955
+ name: response.name,
12956
+ hasBody: response.body !== void 0,
12957
+ hasHeader: response.header !== void 0,
12958
+ statusCode: response.statusCode
12959
+ };
12960
+ if (responseUsage.source === "canonical") {
12961
+ sharedResponses.push(templateData);
12962
+ return;
12963
+ }
12964
+ ownResponses.push({
12965
+ ...templateData,
12966
+ statusCodeKey: _rexeus_typeweaver_core.HttpStatusCode[response.statusCode]
13171
12967
  });
13172
- const relativePath = node_path.default.relative(context.outputDir, sharedResponse.outputFile);
13173
- context.writeFile(relativePath, content);
13174
- }
13175
- };
13176
-
12968
+ });
12969
+ const content = context.renderTemplate(templateFilePath, {
12970
+ resourceName: resource.name,
12971
+ operationId: operation.operationId,
12972
+ pascalCaseOperationId,
12973
+ coreDir: context.coreDir,
12974
+ responseFile: `./${node_path.default.basename(outputPaths.responseFileName, ".ts")}`,
12975
+ specPath: context.getSpecImportPath({ importerDir: outputPaths.outputDir }),
12976
+ sharedResponses,
12977
+ ownResponses,
12978
+ allStatusCodes: Array.from(allStatusCodes.entries()).map(([statusCode, name]) => ({
12979
+ statusCode,
12980
+ name
12981
+ }))
12982
+ });
12983
+ const relativePath = node_path.default.relative(context.outputDir, outputPaths.responseValidationFile);
12984
+ context.writeFile(relativePath, content);
12985
+ }
13177
12986
  //#endregion
13178
12987
  //#region src/index.ts
13179
12988
  const moduleDir = node_path.default.dirname((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
@@ -13182,13 +12991,11 @@ var TypesPlugin = class extends _rexeus_typeweaver_gen.BasePlugin {
13182
12991
  generate(context) {
13183
12992
  const libDir = node_path.default.join(moduleDir, "lib");
13184
12993
  this.copyLibFiles(context, libDir, this.name);
13185
- SharedResponseGenerator.generate(context);
13186
- RequestGenerator.generate(context);
13187
- RequestValidationGenerator.generate(context);
13188
- ResponseGenerator.generate(context);
13189
- ResponseValidationGenerator.generate(context);
12994
+ generate$3(context);
12995
+ generate$2(context);
12996
+ generate$1(context);
12997
+ generate(context);
13190
12998
  }
13191
12999
  };
13192
-
13193
13000
  //#endregion
13194
- module.exports = TypesPlugin;
13001
+ module.exports = TypesPlugin;