zod-nest 3.2.3 → 3.2.4
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/{chunk-7IPDYJNI.mjs → chunk-2NVNXIOY.mjs} +2 -2
- package/dist/chunk-2NVNXIOY.mjs.map +1 -0
- package/dist/{chunk-DUQLL62I.js → chunk-KNXYA5ER.js} +2 -2
- package/dist/chunk-KNXYA5ER.js.map +1 -0
- package/dist/{chunk-6FL3HR4I.js → chunk-N3VWL7G7.js} +10 -10
- package/dist/{chunk-6FL3HR4I.js.map → chunk-N3VWL7G7.js.map} +1 -1
- package/dist/{chunk-47ML6LKE.mjs → chunk-VSI3SF7S.mjs} +3 -3
- package/dist/{chunk-47ML6LKE.mjs.map → chunk-VSI3SF7S.mjs.map} +1 -1
- package/dist/express/index.d.mts +3 -3
- package/dist/express/index.d.ts +3 -3
- package/dist/express/index.js +9 -9
- package/dist/express/index.mjs +3 -3
- package/dist/fastify/index.d.mts +3 -3
- package/dist/fastify/index.d.ts +3 -3
- package/dist/fastify/index.js +6 -6
- package/dist/fastify/index.mjs +3 -3
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +86 -75
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -3
- package/dist/index.mjs.map +1 -1
- package/dist/{param-decorators-Dfd2Cy08.d.mts → param-decorators-1UCi-qHq.d.mts} +1 -1
- package/dist/{param-decorators-23pStLeF.d.ts → param-decorators-CcuRJZXu.d.ts} +1 -1
- package/dist/{registry-Cs1Y0a-L.d.mts → registry-D99yMzJg.d.mts} +3 -2
- package/dist/{registry-Cs1Y0a-L.d.ts → registry-D99yMzJg.d.ts} +3 -2
- package/package.json +1 -1
- package/dist/chunk-7IPDYJNI.mjs.map +0 -1
- package/dist/chunk-DUQLL62I.js.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isZodDto, ZodNestError, ZodValidationException, defaultRegistry, ZOD_DTO_SYMBOL, ZOD_NEST_DTO_EXTENSION, flattenObjectIntersection, resolveSchemaRef, isZodObject, registerSchema, expandObjectSchema, paramSchemaBody, COMPONENTS_SCHEMAS_PREFIX, isZodSchema, buildToJsonSchemaOptions, resolveAnonId, ANON_RESPONSE_PREFIX, ZOD_NEST_ERROR_DUPLICATE_ID, ZOD_NEST_ERROR_EXTENSION } from './chunk-
|
|
2
|
-
export { COMPONENTS_SCHEMAS_PREFIX, ZOD_DTO_SYMBOL, ZOD_NEST_DTO_EXTENSION, ZOD_NEST_ERROR_DUPLICATE_ID, ZOD_NEST_ERROR_EXTENSION, ZodNestError, ZodNestUnrepresentableError, ZodValidationException, createRegistry, defaultRegistry, extend, getLineage, isZodDto, isZodSchema, registerSchema, toOpenApi } from './chunk-
|
|
1
|
+
import { isZodDto, ZodNestError, ZodValidationException, defaultRegistry, ZOD_DTO_SYMBOL, ZOD_NEST_DTO_EXTENSION, flattenObjectIntersection, resolveSchemaRef, isZodObject, registerSchema, expandObjectSchema, paramSchemaBody, COMPONENTS_SCHEMAS_PREFIX, isZodSchema, buildToJsonSchemaOptions, resolveAnonId, ANON_RESPONSE_PREFIX, ZOD_NEST_ERROR_DUPLICATE_ID, ZOD_NEST_ERROR_EXTENSION } from './chunk-2NVNXIOY.mjs';
|
|
2
|
+
export { COMPONENTS_SCHEMAS_PREFIX, ZOD_DTO_SYMBOL, ZOD_NEST_DTO_EXTENSION, ZOD_NEST_ERROR_DUPLICATE_ID, ZOD_NEST_ERROR_EXTENSION, ZodNestError, ZodNestUnrepresentableError, ZodValidationException, createRegistry, defaultRegistry, extend, getLineage, isZodDto, isZodSchema, registerSchema, toOpenApi } from './chunk-2NVNXIOY.mjs';
|
|
3
3
|
import { singleton, __name } from './chunk-MPNAA53V.mjs';
|
|
4
4
|
export { overrideJSONSchema } from './chunk-MPNAA53V.mjs';
|
|
5
5
|
import { InternalServerErrorException, HttpStatus, Injectable, Optional, Inject, Logger, RequestMethod, applyDecorators } from '@nestjs/common';
|
|
@@ -1040,6 +1040,17 @@ var bulkEmit = /* @__PURE__ */ __name((opts) => {
|
|
|
1040
1040
|
outputSchemas: runPass(opts, "output", knownIds)
|
|
1041
1041
|
};
|
|
1042
1042
|
}, "bulkEmit");
|
|
1043
|
+
var scopeToKnownIds = /* @__PURE__ */ __name((zodRegistry, knownIds) => {
|
|
1044
|
+
const scoped = z.registry();
|
|
1045
|
+
for (const [id, schema] of zodRegistry._idmap) {
|
|
1046
|
+
if (knownIds.has(id)) {
|
|
1047
|
+
scoped.add(schema, {
|
|
1048
|
+
id
|
|
1049
|
+
});
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
return scoped;
|
|
1053
|
+
}, "scopeToKnownIds");
|
|
1043
1054
|
var runPass = /* @__PURE__ */ __name((opts, io, knownIds) => {
|
|
1044
1055
|
const built = buildToJsonSchemaOptions({
|
|
1045
1056
|
registry: opts.registry,
|
|
@@ -1049,7 +1060,7 @@ var runPass = /* @__PURE__ */ __name((opts, io, knownIds) => {
|
|
|
1049
1060
|
reused: "inline",
|
|
1050
1061
|
uri: URI
|
|
1051
1062
|
});
|
|
1052
|
-
const raw = z.toJSONSchema(opts.registry.zodRegistry, built.options);
|
|
1063
|
+
const raw = z.toJSONSchema(scopeToKnownIds(opts.registry.zodRegistry, knownIds), built.options);
|
|
1053
1064
|
built.consumeUnrepresentable();
|
|
1054
1065
|
const filtered = /* @__PURE__ */ new Map();
|
|
1055
1066
|
for (const [id, schema] of Object.entries(raw.schemas)) {
|