zod-nest 3.2.2 → 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/README.md +1 -0
- package/dist/{chunk-LHNXO52A.mjs → chunk-2NVNXIOY.mjs} +15 -26
- package/dist/chunk-2NVNXIOY.mjs.map +1 -0
- package/dist/{chunk-LXRBMFWD.js → chunk-4LOFWANL.js} +6 -6
- package/dist/{chunk-LXRBMFWD.js.map → chunk-4LOFWANL.js.map} +1 -1
- package/dist/chunk-EV5I5HGT.js +127 -0
- package/dist/chunk-EV5I5HGT.js.map +1 -0
- package/dist/{chunk-WI4JKXT6.mjs → chunk-IMEFMJTS.mjs} +3 -3
- package/dist/{chunk-WI4JKXT6.mjs.map → chunk-IMEFMJTS.mjs.map} +1 -1
- package/dist/{chunk-FKXVNCDD.js → chunk-KNXYA5ER.js} +73 -84
- package/dist/chunk-KNXYA5ER.js.map +1 -0
- package/dist/chunk-MPNAA53V.mjs +119 -0
- package/dist/chunk-MPNAA53V.mjs.map +1 -0
- package/dist/{chunk-26E2XEJU.js → chunk-N3VWL7G7.js} +45 -45
- package/dist/{chunk-26E2XEJU.js.map → chunk-N3VWL7G7.js.map} +1 -1
- package/dist/{chunk-RAF7JGS6.mjs → chunk-VSI3SF7S.mjs} +5 -5
- package/dist/{chunk-RAF7JGS6.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 +20 -20
- package/dist/express/index.mjs +5 -5
- package/dist/fastify/index.d.mts +3 -3
- package/dist/fastify/index.d.ts +3 -3
- package/dist/fastify/index.js +11 -11
- package/dist/fastify/index.mjs +5 -5
- package/dist/helpers/index.js +24 -24
- package/dist/helpers/index.mjs +3 -3
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +215 -204
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -5
- 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-4RXGLSPP.js +0 -73
- package/dist/chunk-4RXGLSPP.js.map +0 -1
- package/dist/chunk-FKXVNCDD.js.map +0 -1
- package/dist/chunk-LHNXO52A.mjs.map +0 -1
- package/dist/chunk-ZZW54ETO.mjs +0 -67
- package/dist/chunk-ZZW54ETO.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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-
|
|
3
|
-
import { singleton, __name } from './chunk-
|
|
4
|
-
export { overrideJSONSchema } 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
|
+
import { singleton, __name } from './chunk-MPNAA53V.mjs';
|
|
4
|
+
export { overrideJSONSchema } from './chunk-MPNAA53V.mjs';
|
|
5
5
|
import { InternalServerErrorException, HttpStatus, Injectable, Optional, Inject, Logger, RequestMethod, applyDecorators } from '@nestjs/common';
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
import { HTTP_CODE_METADATA, METHOD_METADATA, HEADERS_METADATA } from '@nestjs/common/constants.js';
|
|
@@ -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)) {
|