zod-nest 3.7.0 → 3.8.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/README.md +2 -2
- package/dist/{chunk-YUY5LICA.mjs → chunk-NJWQ57T4.mjs} +3 -3
- package/dist/{chunk-YUY5LICA.mjs.map → chunk-NJWQ57T4.mjs.map} +1 -1
- package/dist/{chunk-6HU5TMFO.mjs → chunk-TK7QGY45.mjs} +23 -7
- package/dist/chunk-TK7QGY45.mjs.map +1 -0
- package/dist/{chunk-J2MGUXBB.js → chunk-UIQQTAXT.js} +25 -6
- package/dist/chunk-UIQQTAXT.js.map +1 -0
- package/dist/{chunk-3D4FM53F.js → chunk-WR5L7BVA.js} +11 -11
- package/dist/{chunk-3D4FM53F.js.map → chunk-WR5L7BVA.js.map} +1 -1
- package/dist/express/index.d.mts +2 -2
- package/dist/express/index.d.ts +2 -2
- package/dist/express/index.js +9 -9
- package/dist/express/index.mjs +3 -3
- package/dist/fastify/index.d.mts +2 -2
- package/dist/fastify/index.d.ts +2 -2
- package/dist/fastify/index.js +6 -6
- package/dist/fastify/index.mjs +3 -3
- package/dist/index.d.mts +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +88 -84
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.map +1 -1
- package/dist/{param-decorators-1UCi-qHq.d.mts → param-decorators-BbVRG6KY.d.mts} +2 -2
- package/dist/{param-decorators-CcuRJZXu.d.ts → param-decorators-Bjuo6cJW.d.ts} +2 -2
- package/package.json +23 -23
- package/dist/chunk-6HU5TMFO.mjs.map +0 -1
- package/dist/chunk-J2MGUXBB.js.map +0 -1
package/dist/fastify/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var chunkWR5L7BVA_js = require('../chunk-WR5L7BVA.js');
|
|
4
|
+
require('../chunk-UIQQTAXT.js');
|
|
5
5
|
require('../chunk-4LOFWANL.js');
|
|
6
6
|
var chunkEV5I5HGT_js = require('../chunk-EV5I5HGT.js');
|
|
7
7
|
|
|
@@ -11,21 +11,21 @@ var accessors = {
|
|
|
11
11
|
mimeType: /* @__PURE__ */ chunkEV5I5HGT_js.__name((file) => file.mimetype, "mimeType"),
|
|
12
12
|
fileName: /* @__PURE__ */ chunkEV5I5HGT_js.__name((file) => file.filename, "fileName")
|
|
13
13
|
};
|
|
14
|
-
var fastifyMultipartFile = /* @__PURE__ */ chunkEV5I5HGT_js.__name((options) =>
|
|
14
|
+
var fastifyMultipartFile = /* @__PURE__ */ chunkEV5I5HGT_js.__name((options) => chunkWR5L7BVA_js.buildFileSchema({
|
|
15
15
|
predicate: isFastifyMultipartFile,
|
|
16
16
|
accessors,
|
|
17
17
|
options
|
|
18
18
|
}), "fastifyMultipartFile");
|
|
19
19
|
var FastifyMultipartFileSchema = fastifyMultipartFile();
|
|
20
|
-
var ZodMultipart =
|
|
20
|
+
var ZodMultipart = chunkWR5L7BVA_js.createZodMultipart(chunkWR5L7BVA_js.MultipartFilesIn.Body);
|
|
21
21
|
|
|
22
22
|
Object.defineProperty(exports, "MULTIPART_CONTENT_TYPE", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkWR5L7BVA_js.MULTIPART_CONTENT_TYPE; }
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "ZodMultipartBody", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunkWR5L7BVA_js.ZodMultipartBody; }
|
|
29
29
|
});
|
|
30
30
|
exports.FastifyMultipartFileSchema = FastifyMultipartFileSchema;
|
|
31
31
|
exports.ZodMultipart = ZodMultipart;
|
package/dist/fastify/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createZodMultipart, MultipartFilesIn, buildFileSchema } from '../chunk-
|
|
2
|
-
export { MULTIPART_CONTENT_TYPE, ZodMultipartBody } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
import { createZodMultipart, MultipartFilesIn, buildFileSchema } from '../chunk-NJWQ57T4.mjs';
|
|
2
|
+
export { MULTIPART_CONTENT_TYPE, ZodMultipartBody } from '../chunk-NJWQ57T4.mjs';
|
|
3
|
+
import '../chunk-TK7QGY45.mjs';
|
|
4
4
|
import '../chunk-IMEFMJTS.mjs';
|
|
5
5
|
import { __name } from '../chunk-MPNAA53V.mjs';
|
|
6
6
|
|
package/dist/index.d.mts
CHANGED
|
@@ -216,6 +216,13 @@ declare const isZodDto: (value: unknown) => value is ZodDto;
|
|
|
216
216
|
*/
|
|
217
217
|
declare const isZodSchema: (value: unknown) => value is z.ZodType;
|
|
218
218
|
|
|
219
|
+
/** Only populated under `@nestjs/common` >= 12. */
|
|
220
|
+
declare const ZodNestErrorCode: {
|
|
221
|
+
readonly ValidationFailed: "VALIDATION_FAILED";
|
|
222
|
+
readonly SerializationFailed: "SERIALIZATION_FAILED";
|
|
223
|
+
};
|
|
224
|
+
type ZodNestErrorCode = (typeof ZodNestErrorCode)[keyof typeof ZodNestErrorCode];
|
|
225
|
+
|
|
219
226
|
/**
|
|
220
227
|
* Default exception thrown by `ZodSerializerInterceptor` in strict mode
|
|
221
228
|
* (i.e. when `@ZodResponse({ passthroughOnError: true })` is NOT set) on
|
|
@@ -226,6 +233,7 @@ declare const isZodSchema: (value: unknown) => value is z.ZodType;
|
|
|
226
233
|
* {
|
|
227
234
|
* statusCode: 500,
|
|
228
235
|
* message: 'Response validation failed',
|
|
236
|
+
* errorCode: 'SERIALIZATION_FAILED',
|
|
229
237
|
* }
|
|
230
238
|
* ```
|
|
231
239
|
*
|
|
@@ -254,6 +262,7 @@ declare class ZodSerializationException extends InternalServerErrorException {
|
|
|
254
262
|
* statusCode: 400,
|
|
255
263
|
* message: 'Validation failed',
|
|
256
264
|
* errors: z.treeifyError(zodError),
|
|
265
|
+
* errorCode: 'VALIDATION_FAILED',
|
|
257
266
|
* }
|
|
258
267
|
* ```
|
|
259
268
|
*
|
|
@@ -860,4 +869,4 @@ declare class ZodNestDocumentError extends ZodNestError {
|
|
|
860
869
|
constructor(code: ZodNestDocumentErrorCode, message: string, details?: Record<string, unknown>);
|
|
861
870
|
}
|
|
862
871
|
|
|
863
|
-
export { type ApplyZodNestOptions, COMPONENTS_SCHEMAS_PREFIX, type CreateSerializationException, type CreateValidationException, type CreateZodDtoOptions, DEFAULT_MAX_LOGGED_VALUE_BYTES, DEFAULT_REDACT_KEYS, DEFAULT_STREAM_CONTENT_TYPES, type Io, type LineageEntry, type NormalizedZodNestOptions, type Override, type OverrideContext, type OverrideJSONSchemaArg, type ResponseStatusInput, type ResponseStatusWildcard, type ResponseVariant, type ResponseVariantKind, SEQUENTIAL_MEDIA_TYPES, SchemaObject, type ToOpenApiOptions, type ToOpenApiResult, ZOD_DTO_SYMBOL, ZOD_NEST_DTO_EXTENSION, ZOD_NEST_ERROR_DUPLICATE_ID, ZOD_NEST_ERROR_EXTENSION, ZOD_NEST_OPTIONS, ZOD_RESPONSES_METADATA_KEY, ZodBody, type ZodBodyOptions, ZodCookies, type ZodCookiesOptions, type ZodDto, type ZodDtoMarker, ZodHeaders, type ZodHeadersOptions, ZodNestDocumentError, type ZodNestDocumentErrorCode, ZodNestError, ZodNestModule, type ZodNestModuleOptions, ZodNestRegistry, ZodNestUnrepresentableError, ZodQuery, type ZodQueryOptions, ZodResponse, type ZodResponseDescription, type ZodResponseEntry, type ZodResponseOptions, type ZodResponseType, ZodSerializationException, ZodSerializerInterceptor, ZodValidationException, ZodValidationPipe, type ZodValidationPipeArg, type ZodValidationPipeOptions, applyZodNest, createZodDto, defaultStatusFor, extend, getLineage, isZodDto, isZodDtoMarker, isZodSchema, makeZodDtoMarker, overrideJSONSchema, resolveEffectiveStatus, toOpenApi };
|
|
872
|
+
export { type ApplyZodNestOptions, COMPONENTS_SCHEMAS_PREFIX, type CreateSerializationException, type CreateValidationException, type CreateZodDtoOptions, DEFAULT_MAX_LOGGED_VALUE_BYTES, DEFAULT_REDACT_KEYS, DEFAULT_STREAM_CONTENT_TYPES, type Io, type LineageEntry, type NormalizedZodNestOptions, type Override, type OverrideContext, type OverrideJSONSchemaArg, type ResponseStatusInput, type ResponseStatusWildcard, type ResponseVariant, type ResponseVariantKind, SEQUENTIAL_MEDIA_TYPES, SchemaObject, type ToOpenApiOptions, type ToOpenApiResult, ZOD_DTO_SYMBOL, ZOD_NEST_DTO_EXTENSION, ZOD_NEST_ERROR_DUPLICATE_ID, ZOD_NEST_ERROR_EXTENSION, ZOD_NEST_OPTIONS, ZOD_RESPONSES_METADATA_KEY, ZodBody, type ZodBodyOptions, ZodCookies, type ZodCookiesOptions, type ZodDto, type ZodDtoMarker, ZodHeaders, type ZodHeadersOptions, ZodNestDocumentError, type ZodNestDocumentErrorCode, ZodNestError, ZodNestErrorCode, ZodNestModule, type ZodNestModuleOptions, ZodNestRegistry, ZodNestUnrepresentableError, ZodQuery, type ZodQueryOptions, ZodResponse, type ZodResponseDescription, type ZodResponseEntry, type ZodResponseOptions, type ZodResponseType, ZodSerializationException, ZodSerializerInterceptor, ZodValidationException, ZodValidationPipe, type ZodValidationPipeArg, type ZodValidationPipeOptions, applyZodNest, createZodDto, defaultStatusFor, extend, getLineage, isZodDto, isZodDtoMarker, isZodSchema, makeZodDtoMarker, overrideJSONSchema, resolveEffectiveStatus, toOpenApi };
|
package/dist/index.d.ts
CHANGED
|
@@ -216,6 +216,13 @@ declare const isZodDto: (value: unknown) => value is ZodDto;
|
|
|
216
216
|
*/
|
|
217
217
|
declare const isZodSchema: (value: unknown) => value is z.ZodType;
|
|
218
218
|
|
|
219
|
+
/** Only populated under `@nestjs/common` >= 12. */
|
|
220
|
+
declare const ZodNestErrorCode: {
|
|
221
|
+
readonly ValidationFailed: "VALIDATION_FAILED";
|
|
222
|
+
readonly SerializationFailed: "SERIALIZATION_FAILED";
|
|
223
|
+
};
|
|
224
|
+
type ZodNestErrorCode = (typeof ZodNestErrorCode)[keyof typeof ZodNestErrorCode];
|
|
225
|
+
|
|
219
226
|
/**
|
|
220
227
|
* Default exception thrown by `ZodSerializerInterceptor` in strict mode
|
|
221
228
|
* (i.e. when `@ZodResponse({ passthroughOnError: true })` is NOT set) on
|
|
@@ -226,6 +233,7 @@ declare const isZodSchema: (value: unknown) => value is z.ZodType;
|
|
|
226
233
|
* {
|
|
227
234
|
* statusCode: 500,
|
|
228
235
|
* message: 'Response validation failed',
|
|
236
|
+
* errorCode: 'SERIALIZATION_FAILED',
|
|
229
237
|
* }
|
|
230
238
|
* ```
|
|
231
239
|
*
|
|
@@ -254,6 +262,7 @@ declare class ZodSerializationException extends InternalServerErrorException {
|
|
|
254
262
|
* statusCode: 400,
|
|
255
263
|
* message: 'Validation failed',
|
|
256
264
|
* errors: z.treeifyError(zodError),
|
|
265
|
+
* errorCode: 'VALIDATION_FAILED',
|
|
257
266
|
* }
|
|
258
267
|
* ```
|
|
259
268
|
*
|
|
@@ -860,4 +869,4 @@ declare class ZodNestDocumentError extends ZodNestError {
|
|
|
860
869
|
constructor(code: ZodNestDocumentErrorCode, message: string, details?: Record<string, unknown>);
|
|
861
870
|
}
|
|
862
871
|
|
|
863
|
-
export { type ApplyZodNestOptions, COMPONENTS_SCHEMAS_PREFIX, type CreateSerializationException, type CreateValidationException, type CreateZodDtoOptions, DEFAULT_MAX_LOGGED_VALUE_BYTES, DEFAULT_REDACT_KEYS, DEFAULT_STREAM_CONTENT_TYPES, type Io, type LineageEntry, type NormalizedZodNestOptions, type Override, type OverrideContext, type OverrideJSONSchemaArg, type ResponseStatusInput, type ResponseStatusWildcard, type ResponseVariant, type ResponseVariantKind, SEQUENTIAL_MEDIA_TYPES, SchemaObject, type ToOpenApiOptions, type ToOpenApiResult, ZOD_DTO_SYMBOL, ZOD_NEST_DTO_EXTENSION, ZOD_NEST_ERROR_DUPLICATE_ID, ZOD_NEST_ERROR_EXTENSION, ZOD_NEST_OPTIONS, ZOD_RESPONSES_METADATA_KEY, ZodBody, type ZodBodyOptions, ZodCookies, type ZodCookiesOptions, type ZodDto, type ZodDtoMarker, ZodHeaders, type ZodHeadersOptions, ZodNestDocumentError, type ZodNestDocumentErrorCode, ZodNestError, ZodNestModule, type ZodNestModuleOptions, ZodNestRegistry, ZodNestUnrepresentableError, ZodQuery, type ZodQueryOptions, ZodResponse, type ZodResponseDescription, type ZodResponseEntry, type ZodResponseOptions, type ZodResponseType, ZodSerializationException, ZodSerializerInterceptor, ZodValidationException, ZodValidationPipe, type ZodValidationPipeArg, type ZodValidationPipeOptions, applyZodNest, createZodDto, defaultStatusFor, extend, getLineage, isZodDto, isZodDtoMarker, isZodSchema, makeZodDtoMarker, overrideJSONSchema, resolveEffectiveStatus, toOpenApi };
|
|
872
|
+
export { type ApplyZodNestOptions, COMPONENTS_SCHEMAS_PREFIX, type CreateSerializationException, type CreateValidationException, type CreateZodDtoOptions, DEFAULT_MAX_LOGGED_VALUE_BYTES, DEFAULT_REDACT_KEYS, DEFAULT_STREAM_CONTENT_TYPES, type Io, type LineageEntry, type NormalizedZodNestOptions, type Override, type OverrideContext, type OverrideJSONSchemaArg, type ResponseStatusInput, type ResponseStatusWildcard, type ResponseVariant, type ResponseVariantKind, SEQUENTIAL_MEDIA_TYPES, SchemaObject, type ToOpenApiOptions, type ToOpenApiResult, ZOD_DTO_SYMBOL, ZOD_NEST_DTO_EXTENSION, ZOD_NEST_ERROR_DUPLICATE_ID, ZOD_NEST_ERROR_EXTENSION, ZOD_NEST_OPTIONS, ZOD_RESPONSES_METADATA_KEY, ZodBody, type ZodBodyOptions, ZodCookies, type ZodCookiesOptions, type ZodDto, type ZodDtoMarker, ZodHeaders, type ZodHeadersOptions, ZodNestDocumentError, type ZodNestDocumentErrorCode, ZodNestError, ZodNestErrorCode, ZodNestModule, type ZodNestModuleOptions, ZodNestRegistry, ZodNestUnrepresentableError, ZodQuery, type ZodQueryOptions, ZodResponse, type ZodResponseDescription, type ZodResponseEntry, type ZodResponseOptions, type ZodResponseType, ZodSerializationException, ZodSerializerInterceptor, ZodValidationException, ZodValidationPipe, type ZodValidationPipeArg, type ZodValidationPipeOptions, applyZodNest, createZodDto, defaultStatusFor, extend, getLineage, isZodDto, isZodDtoMarker, isZodSchema, makeZodDtoMarker, overrideJSONSchema, resolveEffectiveStatus, toOpenApi };
|