zod-nest 3.2.3 → 3.2.5

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.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkDUQLL62I_js = require('./chunk-DUQLL62I.js');
3
+ var chunkQ3SWJZBB_js = require('./chunk-Q3SWJZBB.js');
4
4
  var chunkEV5I5HGT_js = require('./chunk-EV5I5HGT.js');
5
5
  var common = require('@nestjs/common');
6
6
  var zod = require('zod');
@@ -39,7 +39,7 @@ var buildSiblingClass = /* @__PURE__ */ chunkEV5I5HGT_js.__name((parent, schema)
39
39
  }
40
40
  static schema = schema;
41
41
  static io = "output";
42
- static [chunkDUQLL62I_js.ZOD_DTO_SYMBOL] = true;
42
+ static [chunkQ3SWJZBB_js.ZOD_DTO_SYMBOL] = true;
43
43
  static get id() {
44
44
  return parent.id;
45
45
  }
@@ -54,7 +54,7 @@ var buildSiblingClass = /* @__PURE__ */ chunkEV5I5HGT_js.__name((parent, schema)
54
54
  }
55
55
  static _OPENAPI_METADATA_FACTORY() {
56
56
  return {
57
- [chunkDUQLL62I_js.ZOD_NEST_DTO_EXTENSION]: makeZodDtoMarker(parent.id, "output")
57
+ [chunkQ3SWJZBB_js.ZOD_NEST_DTO_EXTENSION]: makeZodDtoMarker(parent.id, "output")
58
58
  };
59
59
  }
60
60
  };
@@ -92,14 +92,14 @@ var resolveFallbackId = /* @__PURE__ */ chunkEV5I5HGT_js.__name((className) => {
92
92
  return fallback;
93
93
  }, "resolveFallbackId");
94
94
  var createZodDto = /* @__PURE__ */ chunkEV5I5HGT_js.__name((schema, options) => {
95
- const registry = options?.registry ?? chunkDUQLL62I_js.defaultRegistry;
95
+ const registry = options?.registry ?? chunkQ3SWJZBB_js.defaultRegistry;
96
96
  const io = "input";
97
97
  let cachedId;
98
98
  const ensureRegistered = /* @__PURE__ */ chunkEV5I5HGT_js.__name((className) => {
99
99
  if (cachedId !== void 0) {
100
100
  return cachedId;
101
101
  }
102
- const named = chunkDUQLL62I_js.registerSchema(schema, registry, {
102
+ const named = chunkQ3SWJZBB_js.registerSchema(schema, registry, {
103
103
  id: options?.id,
104
104
  expose: options?.expose
105
105
  });
@@ -119,7 +119,7 @@ var createZodDto = /* @__PURE__ */ chunkEV5I5HGT_js.__name((schema, options) =>
119
119
  }
120
120
  static schema = schema;
121
121
  static io = io;
122
- static [chunkDUQLL62I_js.ZOD_DTO_SYMBOL] = true;
122
+ static [chunkQ3SWJZBB_js.ZOD_DTO_SYMBOL] = true;
123
123
  static get id() {
124
124
  return ensureRegistered(this.name);
125
125
  }
@@ -134,7 +134,7 @@ var createZodDto = /* @__PURE__ */ chunkEV5I5HGT_js.__name((schema, options) =>
134
134
  }
135
135
  static _OPENAPI_METADATA_FACTORY() {
136
136
  return {
137
- [chunkDUQLL62I_js.ZOD_NEST_DTO_EXTENSION]: makeZodDtoMarker(ensureRegistered(this.name), io)
137
+ [chunkQ3SWJZBB_js.ZOD_NEST_DTO_EXTENSION]: makeZodDtoMarker(ensureRegistered(this.name), io)
138
138
  };
139
139
  }
140
140
  };
@@ -420,7 +420,7 @@ function _ts_param(paramIndex, decorator) {
420
420
  chunkEV5I5HGT_js.__name(_ts_param, "_ts_param");
421
421
  var isZodSchema2 = /* @__PURE__ */ chunkEV5I5HGT_js.__name((value) => value !== null && typeof value === "object" && "_zod" in value, "isZodSchema");
422
422
  var isOptionsObject = /* @__PURE__ */ chunkEV5I5HGT_js.__name((value) => value !== null && typeof value === "object" && !isZodSchema2(value), "isOptionsObject");
423
- var defaultExceptionFactory = /* @__PURE__ */ chunkEV5I5HGT_js.__name((zodError, argMetadata) => new chunkDUQLL62I_js.ZodValidationException(zodError, argMetadata), "defaultExceptionFactory");
423
+ var defaultExceptionFactory = /* @__PURE__ */ chunkEV5I5HGT_js.__name((zodError, argMetadata) => new chunkQ3SWJZBB_js.ZodValidationException(zodError, argMetadata), "defaultExceptionFactory");
424
424
  exports.ZodValidationPipe = class _ZodValidationPipe {
425
425
  static {
426
426
  chunkEV5I5HGT_js.__name(this, "ZodValidationPipe");
@@ -458,7 +458,7 @@ exports.ZodValidationPipe = class _ZodValidationPipe {
458
458
  return this.explicitSchema;
459
459
  }
460
460
  const metatype = metadata.metatype;
461
- if (!chunkDUQLL62I_js.isZodDto(metatype)) {
461
+ if (!chunkQ3SWJZBB_js.isZodDto(metatype)) {
462
462
  return void 0;
463
463
  }
464
464
  return metatype.schema;
@@ -468,7 +468,7 @@ exports.ZodValidationPipe = class _ZodValidationPipe {
468
468
  return this.explicitDtoName;
469
469
  }
470
470
  const metatype = metadata.metatype;
471
- if (chunkDUQLL62I_js.isZodDto(metatype)) {
471
+ if (chunkQ3SWJZBB_js.isZodDto(metatype)) {
472
472
  return metatype.name;
473
473
  }
474
474
  return "schema";
@@ -481,7 +481,7 @@ exports.ZodValidationPipe = class _ZodValidationPipe {
481
481
  dtoName: void 0
482
482
  };
483
483
  }
484
- if (chunkDUQLL62I_js.isZodDto(arg)) {
484
+ if (chunkQ3SWJZBB_js.isZodDto(arg)) {
485
485
  return {
486
486
  schema: arg.schema,
487
487
  factory: void 0,
@@ -503,8 +503,8 @@ exports.ZodValidationPipe = class _ZodValidationPipe {
503
503
  };
504
504
  }
505
505
  const optionSchema = arg.schema;
506
- const dtoName = chunkDUQLL62I_js.isZodDto(optionSchema) ? optionSchema.name : void 0;
507
- const resolvedSchema = chunkDUQLL62I_js.isZodDto(optionSchema) ? optionSchema.schema : optionSchema;
506
+ const dtoName = chunkQ3SWJZBB_js.isZodDto(optionSchema) ? optionSchema.name : void 0;
507
+ const resolvedSchema = chunkQ3SWJZBB_js.isZodDto(optionSchema) ? optionSchema.schema : optionSchema;
508
508
  return {
509
509
  schema: resolvedSchema,
510
510
  factory: arg.createValidationException,
@@ -560,14 +560,14 @@ var schemaToOutputDto = /* @__PURE__ */ chunkEV5I5HGT_js.__name((schema) => {
560
560
  if (cached !== void 0) {
561
561
  return cached;
562
562
  }
563
- const namedId = chunkDUQLL62I_js.registerSchema(schema);
563
+ const namedId = chunkQ3SWJZBB_js.registerSchema(schema);
564
564
  if (namedId !== void 0) {
565
565
  const dto2 = createZodDto(schema).Output;
566
566
  responseDtoCache.set(schema, dto2);
567
567
  return dto2;
568
568
  }
569
- const anonId = chunkDUQLL62I_js.resolveAnonId(schema, chunkDUQLL62I_js.ANON_RESPONSE_PREFIX);
570
- chunkDUQLL62I_js.registerSchema(schema, chunkDUQLL62I_js.defaultRegistry, {
569
+ const anonId = chunkQ3SWJZBB_js.resolveAnonId(schema, chunkQ3SWJZBB_js.ANON_RESPONSE_PREFIX);
570
+ chunkQ3SWJZBB_js.registerSchema(schema, chunkQ3SWJZBB_js.defaultRegistry, {
571
571
  id: anonId,
572
572
  anonymous: true
573
573
  });
@@ -578,10 +578,10 @@ var schemaToOutputDto = /* @__PURE__ */ chunkEV5I5HGT_js.__name((schema) => {
578
578
  return dto;
579
579
  }, "schemaToOutputDto");
580
580
  var toResponseDto = /* @__PURE__ */ chunkEV5I5HGT_js.__name((entry, index) => {
581
- if (chunkDUQLL62I_js.isZodDto(entry)) {
581
+ if (chunkQ3SWJZBB_js.isZodDto(entry)) {
582
582
  return entry;
583
583
  }
584
- if (chunkDUQLL62I_js.isZodSchema(entry)) {
584
+ if (chunkQ3SWJZBB_js.isZodSchema(entry)) {
585
585
  return schemaToOutputDto(entry);
586
586
  }
587
587
  const where = index === void 0 ? "@ZodResponse({ type })" : `@ZodResponse({ type }) element [${index}]`;
@@ -773,12 +773,17 @@ var ZodBody = /* @__PURE__ */ chunkEV5I5HGT_js.__name((schema, options) => {
773
773
  });
774
774
  }, "ZodBody");
775
775
  var resolveBodySchema = /* @__PURE__ */ chunkEV5I5HGT_js.__name((schema, options) => {
776
+ const registry = options?.registry ?? chunkQ3SWJZBB_js.defaultRegistry;
776
777
  if (options?.flatten === true) {
777
- return chunkDUQLL62I_js.flattenObjectIntersection(schema, options.registry ?? chunkDUQLL62I_js.defaultRegistry, "@ZodBody");
778
+ const merged = chunkQ3SWJZBB_js.flattenObjectIntersection(schema, registry, "@ZodBody");
779
+ return chunkQ3SWJZBB_js.resolveSchemaRef(merged, {
780
+ registry,
781
+ deferAnonInline: true
782
+ }).ref;
778
783
  }
779
- return chunkDUQLL62I_js.resolveSchemaRef(schema, {
784
+ return chunkQ3SWJZBB_js.resolveSchemaRef(schema, {
780
785
  id: options?.id,
781
- registry: options?.registry,
786
+ registry,
782
787
  deferAnonInline: true
783
788
  }).ref;
784
789
  }, "resolveBodySchema");
@@ -811,27 +816,27 @@ var appendQueryMarker = /* @__PURE__ */ chunkEV5I5HGT_js.__name((dtoId, ref) =>
811
816
 
812
817
  // src/decorators/zod-query.decorator.ts
813
818
  var ZodQuery = /* @__PURE__ */ chunkEV5I5HGT_js.__name((schema, options) => {
814
- if (!chunkDUQLL62I_js.isZodObject(schema)) {
815
- throw new chunkDUQLL62I_js.ZodNestError(`@ZodQuery requires a \`z.object({...})\` schema (got \`${schema._zod.def.type}\`). Each property of the object becomes one OpenAPI parameter. For non-object body shapes (intersections, unions, primitives), use \`@ZodBody\` instead.`);
819
+ if (!chunkQ3SWJZBB_js.isZodObject(schema)) {
820
+ throw new chunkQ3SWJZBB_js.ZodNestError(`@ZodQuery requires a \`z.object({...})\` schema (got \`${schema._zod.def.type}\`). Each property of the object becomes one OpenAPI parameter. For non-object body shapes (intersections, unions, primitives), use \`@ZodBody\` instead.`);
816
821
  }
817
- const registry = options?.registry ?? chunkDUQLL62I_js.defaultRegistry;
818
- const id = chunkDUQLL62I_js.registerSchema(schema, registry, {
822
+ const registry = options?.registry ?? chunkQ3SWJZBB_js.defaultRegistry;
823
+ const id = chunkQ3SWJZBB_js.registerSchema(schema, registry, {
819
824
  id: options?.id
820
825
  });
821
826
  if (id !== void 0) {
822
827
  return appendQueryMarker(id, options?.ref);
823
828
  }
824
829
  if (options?.ref === true) {
825
- throw new chunkDUQLL62I_js.ZodNestError(`@ZodQuery({ ref: true }) requires a named schema \u2014 there is no component to \`$ref\`. Name the schema via \`.meta({ id: 'Foo' })\` or pass the \`id\` option, or drop \`ref\` to expand per property.`);
830
+ throw new chunkQ3SWJZBB_js.ZodNestError(`@ZodQuery({ ref: true }) requires a named schema \u2014 there is no component to \`$ref\`. Name the schema via \`.meta({ id: 'Foo' })\` or pass the \`id\` option, or drop \`ref\` to expand per property.`);
826
831
  }
827
- const expanded = chunkDUQLL62I_js.expandObjectSchema(schema, {
832
+ const expanded = chunkQ3SWJZBB_js.expandObjectSchema(schema, {
828
833
  id: options?.id,
829
834
  registry,
830
835
  decoratorName: "@ZodQuery"
831
836
  });
832
837
  return common.applyDecorators(...expanded.map(({ name, required, resolution }) => swagger.ApiQuery({
833
838
  name,
834
- schema: chunkDUQLL62I_js.paramSchemaBody(resolution),
839
+ schema: chunkQ3SWJZBB_js.paramSchemaBody(resolution),
835
840
  required
836
841
  })));
837
842
  }, "ZodQuery");
@@ -841,7 +846,7 @@ var API_PARAMETERS_KEY = "swagger/apiParameters";
841
846
 
842
847
  // src/decorators/zod-headers.decorator.ts
843
848
  var ZodHeaders = /* @__PURE__ */ chunkEV5I5HGT_js.__name((schema, options) => {
844
- const expanded = chunkDUQLL62I_js.expandObjectSchema(schema, {
849
+ const expanded = chunkQ3SWJZBB_js.expandObjectSchema(schema, {
845
850
  id: options?.id,
846
851
  registry: options?.registry,
847
852
  decoratorName: "@ZodHeaders"
@@ -850,7 +855,7 @@ var ZodHeaders = /* @__PURE__ */ chunkEV5I5HGT_js.__name((schema, options) => {
850
855
  name,
851
856
  in: "header",
852
857
  required,
853
- schema: chunkDUQLL62I_js.paramSchemaBody(resolution)
858
+ schema: chunkQ3SWJZBB_js.paramSchemaBody(resolution)
854
859
  }));
855
860
  return (_target, _propertyKey, descriptor) => {
856
861
  const handler = descriptor.value;
@@ -867,7 +872,7 @@ var ZodHeaders = /* @__PURE__ */ chunkEV5I5HGT_js.__name((schema, options) => {
867
872
 
868
873
  // src/decorators/zod-cookies.decorator.ts
869
874
  var ZodCookies = /* @__PURE__ */ chunkEV5I5HGT_js.__name((schema, options) => {
870
- const expanded = chunkDUQLL62I_js.expandObjectSchema(schema, {
875
+ const expanded = chunkQ3SWJZBB_js.expandObjectSchema(schema, {
871
876
  id: options?.id,
872
877
  registry: options?.registry,
873
878
  decoratorName: "@ZodCookies"
@@ -876,7 +881,7 @@ var ZodCookies = /* @__PURE__ */ chunkEV5I5HGT_js.__name((schema, options) => {
876
881
  name,
877
882
  in: "cookie",
878
883
  required,
879
- schema: chunkDUQLL62I_js.paramSchemaBody(resolution)
884
+ schema: chunkQ3SWJZBB_js.paramSchemaBody(resolution)
880
885
  }));
881
886
  return (_target, _propertyKey, descriptor) => {
882
887
  const handler = descriptor.value;
@@ -1044,8 +1049,19 @@ var bulkEmit = /* @__PURE__ */ chunkEV5I5HGT_js.__name((opts) => {
1044
1049
  outputSchemas: runPass(opts, "output", knownIds)
1045
1050
  };
1046
1051
  }, "bulkEmit");
1052
+ var scopeToKnownIds = /* @__PURE__ */ chunkEV5I5HGT_js.__name((zodRegistry, knownIds) => {
1053
+ const scoped = zod.z.registry();
1054
+ for (const [id, schema] of zodRegistry._idmap) {
1055
+ if (knownIds.has(id)) {
1056
+ scoped.add(schema, {
1057
+ id
1058
+ });
1059
+ }
1060
+ }
1061
+ return scoped;
1062
+ }, "scopeToKnownIds");
1047
1063
  var runPass = /* @__PURE__ */ chunkEV5I5HGT_js.__name((opts, io, knownIds) => {
1048
- const built = chunkDUQLL62I_js.buildToJsonSchemaOptions({
1064
+ const built = chunkQ3SWJZBB_js.buildToJsonSchemaOptions({
1049
1065
  registry: opts.registry,
1050
1066
  io,
1051
1067
  override: opts.override,
@@ -1053,7 +1069,7 @@ var runPass = /* @__PURE__ */ chunkEV5I5HGT_js.__name((opts, io, knownIds) => {
1053
1069
  reused: "inline",
1054
1070
  uri: URI
1055
1071
  });
1056
- const raw = zod.z.toJSONSchema(opts.registry.zodRegistry, built.options);
1072
+ const raw = zod.z.toJSONSchema(scopeToKnownIds(opts.registry.zodRegistry, knownIds), built.options);
1057
1073
  built.consumeUnrepresentable();
1058
1074
  const filtered = /* @__PURE__ */ new Map();
1059
1075
  for (const [id, schema] of Object.entries(raw.schemas)) {
@@ -1152,7 +1168,7 @@ var readMarker = /* @__PURE__ */ chunkEV5I5HGT_js.__name((schema) => {
1152
1168
  if (!isPlainRecord2(schema.properties)) {
1153
1169
  return void 0;
1154
1170
  }
1155
- const marker = schema.properties[chunkDUQLL62I_js.ZOD_NEST_DTO_EXTENSION];
1171
+ const marker = schema.properties[chunkQ3SWJZBB_js.ZOD_NEST_DTO_EXTENSION];
1156
1172
  if (!isZodDtoMarker(marker)) {
1157
1173
  return void 0;
1158
1174
  }
@@ -1224,10 +1240,10 @@ var collectRefFromSchema = /* @__PURE__ */ chunkEV5I5HGT_js.__name((schema, clas
1224
1240
  return;
1225
1241
  }
1226
1242
  walkRefs(schema, (ref) => {
1227
- if (!ref.startsWith(chunkDUQLL62I_js.COMPONENTS_SCHEMAS_PREFIX)) {
1243
+ if (!ref.startsWith(chunkQ3SWJZBB_js.COMPONENTS_SCHEMAS_PREFIX)) {
1228
1244
  return void 0;
1229
1245
  }
1230
- const className = ref.slice(chunkDUQLL62I_js.COMPONENTS_SCHEMAS_PREFIX.length);
1246
+ const className = ref.slice(chunkQ3SWJZBB_js.COMPONENTS_SCHEMAS_PREFIX.length);
1231
1247
  const renamed = classToDtoId.get(className);
1232
1248
  if (renamed !== void 0) {
1233
1249
  ids.add(renamed);
@@ -1263,7 +1279,7 @@ var collectRefsFromResponses = /* @__PURE__ */ chunkEV5I5HGT_js.__name((response
1263
1279
  }, "collectRefsFromResponses");
1264
1280
 
1265
1281
  // src/document/errors.ts
1266
- var ZodNestDocumentError = class extends chunkDUQLL62I_js.ZodNestError {
1282
+ var ZodNestDocumentError = class extends chunkQ3SWJZBB_js.ZodNestError {
1267
1283
  static {
1268
1284
  chunkEV5I5HGT_js.__name(this, "ZodNestDocumentError");
1269
1285
  }
@@ -1283,10 +1299,10 @@ var assertNoDanglingRefs = /* @__PURE__ */ chunkEV5I5HGT_js.__name((params) => {
1283
1299
  const schemas = doc.components?.schemas ?? {};
1284
1300
  const dangling = [];
1285
1301
  walkRefs(doc, (ref) => {
1286
- if (!ref.startsWith(chunkDUQLL62I_js.COMPONENTS_SCHEMAS_PREFIX)) {
1302
+ if (!ref.startsWith(chunkQ3SWJZBB_js.COMPONENTS_SCHEMAS_PREFIX)) {
1287
1303
  return void 0;
1288
1304
  }
1289
- const target = ref.slice(chunkDUQLL62I_js.COMPONENTS_SCHEMAS_PREFIX.length);
1305
+ const target = ref.slice(chunkQ3SWJZBB_js.COMPONENTS_SCHEMAS_PREFIX.length);
1290
1306
  if (!(target in schemas)) {
1291
1307
  dangling.push(ref);
1292
1308
  }
@@ -1302,7 +1318,7 @@ ${lines.join("\n")}`, {
1302
1318
  });
1303
1319
  }, "assertNoDanglingRefs");
1304
1320
  var hintFor = /* @__PURE__ */ chunkEV5I5HGT_js.__name((ref, collected) => {
1305
- const id = ref.slice(chunkDUQLL62I_js.COMPONENTS_SCHEMAS_PREFIX.length);
1321
+ const id = ref.slice(chunkQ3SWJZBB_js.COMPONENTS_SCHEMAS_PREFIX.length);
1306
1322
  const usedInput = collected.inputExposedIds.has(id);
1307
1323
  const usedOutput = collected.outputExposedIds.has(id);
1308
1324
  if (usedInput && usedOutput) {
@@ -1381,7 +1397,7 @@ var buildRefQueryParam = /* @__PURE__ */ chunkEV5I5HGT_js.__name((marker, body)
1381
1397
  style: "form",
1382
1398
  explode: true,
1383
1399
  schema: {
1384
- $ref: `${chunkDUQLL62I_js.COMPONENTS_SCHEMAS_PREFIX}${marker.dtoId}`
1400
+ $ref: `${chunkQ3SWJZBB_js.COMPONENTS_SCHEMAS_PREFIX}${marker.dtoId}`
1385
1401
  }
1386
1402
  };
1387
1403
  }, "buildRefQueryParam");
@@ -1457,7 +1473,7 @@ var pruneOrphanObjectSchema = /* @__PURE__ */ chunkEV5I5HGT_js.__name((doc) => {
1457
1473
  return;
1458
1474
  }
1459
1475
  let referenced = false;
1460
- const targetRef = `${chunkDUQLL62I_js.COMPONENTS_SCHEMAS_PREFIX}Object`;
1476
+ const targetRef = `${chunkQ3SWJZBB_js.COMPONENTS_SCHEMAS_PREFIX}Object`;
1461
1477
  walkRefs(doc, (ref) => {
1462
1478
  if (ref === targetRef) {
1463
1479
  referenced = true;
@@ -1487,10 +1503,10 @@ var closeOverRefs = /* @__PURE__ */ chunkEV5I5HGT_js.__name((seed, bodies) => {
1487
1503
  continue;
1488
1504
  }
1489
1505
  walkRefs(body, (ref) => {
1490
- if (!ref.startsWith(chunkDUQLL62I_js.COMPONENTS_SCHEMAS_PREFIX)) {
1506
+ if (!ref.startsWith(chunkQ3SWJZBB_js.COMPONENTS_SCHEMAS_PREFIX)) {
1491
1507
  return void 0;
1492
1508
  }
1493
- const target = ref.slice(chunkDUQLL62I_js.COMPONENTS_SCHEMAS_PREFIX.length);
1509
+ const target = ref.slice(chunkQ3SWJZBB_js.COMPONENTS_SCHEMAS_PREFIX.length);
1494
1510
  if (out.has(target)) {
1495
1511
  return void 0;
1496
1512
  }
@@ -1523,7 +1539,7 @@ var inlineAnonymousBodies = /* @__PURE__ */ chunkEV5I5HGT_js.__name(({ doc, regi
1523
1539
  ]) {
1524
1540
  const body = schemas[key];
1525
1541
  if (isPlainRecord4(body)) {
1526
- bodyByRef.set(`${chunkDUQLL62I_js.COMPONENTS_SCHEMAS_PREFIX}${key}`, body);
1542
+ bodyByRef.set(`${chunkQ3SWJZBB_js.COMPONENTS_SCHEMAS_PREFIX}${key}`, body);
1527
1543
  }
1528
1544
  }
1529
1545
  }
@@ -1535,7 +1551,7 @@ var inlineAnonymousBodies = /* @__PURE__ */ chunkEV5I5HGT_js.__name(({ doc, regi
1535
1551
  }
1536
1552
  inlineRefs(doc.paths, bodyByRef);
1537
1553
  for (const ref of bodyByRef.keys()) {
1538
- delete schemas[ref.slice(chunkDUQLL62I_js.COMPONENTS_SCHEMAS_PREFIX.length)];
1554
+ delete schemas[ref.slice(chunkQ3SWJZBB_js.COMPONENTS_SCHEMAS_PREFIX.length)];
1539
1555
  }
1540
1556
  }, "inlineAnonymousBodies");
1541
1557
  var refsWithin = /* @__PURE__ */ chunkEV5I5HGT_js.__name((schemas, bodyByRef) => {
@@ -1673,7 +1689,7 @@ var isMarkerPlaceholder = /* @__PURE__ */ chunkEV5I5HGT_js.__name((value) => {
1673
1689
  if (properties === null || typeof properties !== "object") {
1674
1690
  return false;
1675
1691
  }
1676
- const marker = properties[chunkDUQLL62I_js.ZOD_NEST_DTO_EXTENSION];
1692
+ const marker = properties[chunkQ3SWJZBB_js.ZOD_NEST_DTO_EXTENSION];
1677
1693
  return isZodDtoMarker(marker);
1678
1694
  }, "isMarkerPlaceholder");
1679
1695
  var canonicalEqual = /* @__PURE__ */ chunkEV5I5HGT_js.__name((a, b) => {
@@ -1699,7 +1715,7 @@ var decorateIfPresent = /* @__PURE__ */ chunkEV5I5HGT_js.__name((schemas, key) =
1699
1715
  }
1700
1716
  schemas[key] = {
1701
1717
  description: `ERROR: duplicate zod-nest id <${key.replace(/Output$/, "")}>`,
1702
- [chunkDUQLL62I_js.ZOD_NEST_ERROR_EXTENSION]: chunkDUQLL62I_js.ZOD_NEST_ERROR_DUPLICATE_ID
1718
+ [chunkQ3SWJZBB_js.ZOD_NEST_ERROR_EXTENSION]: chunkQ3SWJZBB_js.ZOD_NEST_ERROR_DUPLICATE_ID
1703
1719
  };
1704
1720
  }, "decorateIfPresent");
1705
1721
 
@@ -1733,8 +1749,8 @@ var addRefTitles = /* @__PURE__ */ chunkEV5I5HGT_js.__name((node, titleById) =>
1733
1749
  return;
1734
1750
  }
1735
1751
  const ref = node.$ref;
1736
- if (typeof ref === "string" && ref.startsWith(chunkDUQLL62I_js.COMPONENTS_SCHEMAS_PREFIX) && node.title === void 0) {
1737
- const title = titleById.get(ref.slice(chunkDUQLL62I_js.COMPONENTS_SCHEMAS_PREFIX.length));
1752
+ if (typeof ref === "string" && ref.startsWith(chunkQ3SWJZBB_js.COMPONENTS_SCHEMAS_PREFIX) && node.title === void 0) {
1753
+ const title = titleById.get(ref.slice(chunkQ3SWJZBB_js.COMPONENTS_SCHEMAS_PREFIX.length));
1738
1754
  if (title !== void 0) {
1739
1755
  node.title = title;
1740
1756
  }
@@ -1749,15 +1765,15 @@ var rewriteRefs = /* @__PURE__ */ chunkEV5I5HGT_js.__name((params) => {
1749
1765
  const { doc, renames, divergentOutputIds } = params;
1750
1766
  if (renames.size > 0) {
1751
1767
  walkRefs(doc, (ref) => {
1752
- if (!ref.startsWith(chunkDUQLL62I_js.COMPONENTS_SCHEMAS_PREFIX)) {
1768
+ if (!ref.startsWith(chunkQ3SWJZBB_js.COMPONENTS_SCHEMAS_PREFIX)) {
1753
1769
  return void 0;
1754
1770
  }
1755
- const target = ref.slice(chunkDUQLL62I_js.COMPONENTS_SCHEMAS_PREFIX.length);
1771
+ const target = ref.slice(chunkQ3SWJZBB_js.COMPONENTS_SCHEMAS_PREFIX.length);
1756
1772
  const renamed = renames.get(target);
1757
1773
  if (renamed === void 0) {
1758
1774
  return void 0;
1759
1775
  }
1760
- return `${chunkDUQLL62I_js.COMPONENTS_SCHEMAS_PREFIX}${renamed}`;
1776
+ return `${chunkQ3SWJZBB_js.COMPONENTS_SCHEMAS_PREFIX}${renamed}`;
1761
1777
  });
1762
1778
  }
1763
1779
  if (divergentOutputIds.size === 0) {
@@ -1782,14 +1798,14 @@ var rewriteResponseSubtree = /* @__PURE__ */ chunkEV5I5HGT_js.__name((pathItem,
1782
1798
  continue;
1783
1799
  }
1784
1800
  walkRefs(responses, (ref) => {
1785
- if (!ref.startsWith(chunkDUQLL62I_js.COMPONENTS_SCHEMAS_PREFIX)) {
1801
+ if (!ref.startsWith(chunkQ3SWJZBB_js.COMPONENTS_SCHEMAS_PREFIX)) {
1786
1802
  return void 0;
1787
1803
  }
1788
- const target = ref.slice(chunkDUQLL62I_js.COMPONENTS_SCHEMAS_PREFIX.length);
1804
+ const target = ref.slice(chunkQ3SWJZBB_js.COMPONENTS_SCHEMAS_PREFIX.length);
1789
1805
  if (!divergentOutputIds.has(target)) {
1790
1806
  return void 0;
1791
1807
  }
1792
- return `${chunkDUQLL62I_js.COMPONENTS_SCHEMAS_PREFIX}${target}${OUTPUT_SUFFIX}`;
1808
+ return `${chunkQ3SWJZBB_js.COMPONENTS_SCHEMAS_PREFIX}${target}${OUTPUT_SUFFIX}`;
1793
1809
  });
1794
1810
  }
1795
1811
  }, "rewriteResponseSubtree");
@@ -1831,10 +1847,10 @@ var stripMarkerFromSchema = /* @__PURE__ */ chunkEV5I5HGT_js.__name((schema) =>
1831
1847
  return;
1832
1848
  }
1833
1849
  const props = properties;
1834
- if (!(chunkDUQLL62I_js.ZOD_NEST_DTO_EXTENSION in props)) {
1850
+ if (!(chunkQ3SWJZBB_js.ZOD_NEST_DTO_EXTENSION in props)) {
1835
1851
  return;
1836
1852
  }
1837
- delete props[chunkDUQLL62I_js.ZOD_NEST_DTO_EXTENSION];
1853
+ delete props[chunkQ3SWJZBB_js.ZOD_NEST_DTO_EXTENSION];
1838
1854
  if (Object.keys(props).length === 0) {
1839
1855
  delete schema.properties;
1840
1856
  }
@@ -1857,7 +1873,7 @@ var withForcedExposure = /* @__PURE__ */ chunkEV5I5HGT_js.__name((collected, reg
1857
1873
  }, "withForcedExposure");
1858
1874
  var OPENAPI_VERSION = "3.1.0";
1859
1875
  var applyZodNest = /* @__PURE__ */ chunkEV5I5HGT_js.__name((doc, opts = {}) => {
1860
- const registry = opts.registry ?? chunkDUQLL62I_js.defaultRegistry;
1876
+ const registry = opts.registry ?? chunkQ3SWJZBB_js.defaultRegistry;
1861
1877
  const collected = collectUsage(doc, registry);
1862
1878
  const exposed = withForcedExposure(collected, registry);
1863
1879
  const { inputSchemas, outputSchemas } = bulkEmit({
@@ -1902,67 +1918,67 @@ var applyZodNest = /* @__PURE__ */ chunkEV5I5HGT_js.__name((doc, opts = {}) => {
1902
1918
 
1903
1919
  Object.defineProperty(exports, "COMPONENTS_SCHEMAS_PREFIX", {
1904
1920
  enumerable: true,
1905
- get: function () { return chunkDUQLL62I_js.COMPONENTS_SCHEMAS_PREFIX; }
1921
+ get: function () { return chunkQ3SWJZBB_js.COMPONENTS_SCHEMAS_PREFIX; }
1906
1922
  });
1907
1923
  Object.defineProperty(exports, "ZOD_DTO_SYMBOL", {
1908
1924
  enumerable: true,
1909
- get: function () { return chunkDUQLL62I_js.ZOD_DTO_SYMBOL; }
1925
+ get: function () { return chunkQ3SWJZBB_js.ZOD_DTO_SYMBOL; }
1910
1926
  });
1911
1927
  Object.defineProperty(exports, "ZOD_NEST_DTO_EXTENSION", {
1912
1928
  enumerable: true,
1913
- get: function () { return chunkDUQLL62I_js.ZOD_NEST_DTO_EXTENSION; }
1929
+ get: function () { return chunkQ3SWJZBB_js.ZOD_NEST_DTO_EXTENSION; }
1914
1930
  });
1915
1931
  Object.defineProperty(exports, "ZOD_NEST_ERROR_DUPLICATE_ID", {
1916
1932
  enumerable: true,
1917
- get: function () { return chunkDUQLL62I_js.ZOD_NEST_ERROR_DUPLICATE_ID; }
1933
+ get: function () { return chunkQ3SWJZBB_js.ZOD_NEST_ERROR_DUPLICATE_ID; }
1918
1934
  });
1919
1935
  Object.defineProperty(exports, "ZOD_NEST_ERROR_EXTENSION", {
1920
1936
  enumerable: true,
1921
- get: function () { return chunkDUQLL62I_js.ZOD_NEST_ERROR_EXTENSION; }
1937
+ get: function () { return chunkQ3SWJZBB_js.ZOD_NEST_ERROR_EXTENSION; }
1922
1938
  });
1923
1939
  Object.defineProperty(exports, "ZodNestError", {
1924
1940
  enumerable: true,
1925
- get: function () { return chunkDUQLL62I_js.ZodNestError; }
1941
+ get: function () { return chunkQ3SWJZBB_js.ZodNestError; }
1926
1942
  });
1927
1943
  Object.defineProperty(exports, "ZodNestUnrepresentableError", {
1928
1944
  enumerable: true,
1929
- get: function () { return chunkDUQLL62I_js.ZodNestUnrepresentableError; }
1945
+ get: function () { return chunkQ3SWJZBB_js.ZodNestUnrepresentableError; }
1930
1946
  });
1931
1947
  Object.defineProperty(exports, "ZodValidationException", {
1932
1948
  enumerable: true,
1933
- get: function () { return chunkDUQLL62I_js.ZodValidationException; }
1949
+ get: function () { return chunkQ3SWJZBB_js.ZodValidationException; }
1934
1950
  });
1935
1951
  Object.defineProperty(exports, "createRegistry", {
1936
1952
  enumerable: true,
1937
- get: function () { return chunkDUQLL62I_js.createRegistry; }
1953
+ get: function () { return chunkQ3SWJZBB_js.createRegistry; }
1938
1954
  });
1939
1955
  Object.defineProperty(exports, "defaultRegistry", {
1940
1956
  enumerable: true,
1941
- get: function () { return chunkDUQLL62I_js.defaultRegistry; }
1957
+ get: function () { return chunkQ3SWJZBB_js.defaultRegistry; }
1942
1958
  });
1943
1959
  Object.defineProperty(exports, "extend", {
1944
1960
  enumerable: true,
1945
- get: function () { return chunkDUQLL62I_js.extend; }
1961
+ get: function () { return chunkQ3SWJZBB_js.extend; }
1946
1962
  });
1947
1963
  Object.defineProperty(exports, "getLineage", {
1948
1964
  enumerable: true,
1949
- get: function () { return chunkDUQLL62I_js.getLineage; }
1965
+ get: function () { return chunkQ3SWJZBB_js.getLineage; }
1950
1966
  });
1951
1967
  Object.defineProperty(exports, "isZodDto", {
1952
1968
  enumerable: true,
1953
- get: function () { return chunkDUQLL62I_js.isZodDto; }
1969
+ get: function () { return chunkQ3SWJZBB_js.isZodDto; }
1954
1970
  });
1955
1971
  Object.defineProperty(exports, "isZodSchema", {
1956
1972
  enumerable: true,
1957
- get: function () { return chunkDUQLL62I_js.isZodSchema; }
1973
+ get: function () { return chunkQ3SWJZBB_js.isZodSchema; }
1958
1974
  });
1959
1975
  Object.defineProperty(exports, "registerSchema", {
1960
1976
  enumerable: true,
1961
- get: function () { return chunkDUQLL62I_js.registerSchema; }
1977
+ get: function () { return chunkQ3SWJZBB_js.registerSchema; }
1962
1978
  });
1963
1979
  Object.defineProperty(exports, "toOpenApi", {
1964
1980
  enumerable: true,
1965
- get: function () { return chunkDUQLL62I_js.toOpenApi; }
1981
+ get: function () { return chunkQ3SWJZBB_js.toOpenApi; }
1966
1982
  });
1967
1983
  Object.defineProperty(exports, "overrideJSONSchema", {
1968
1984
  enumerable: true,