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.
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunk3D4FM53F_js = require('../chunk-3D4FM53F.js');
4
- require('../chunk-J2MGUXBB.js');
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) => chunk3D4FM53F_js.buildFileSchema({
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 = chunk3D4FM53F_js.createZodMultipart(chunk3D4FM53F_js.MultipartFilesIn.Body);
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 chunk3D4FM53F_js.MULTIPART_CONTENT_TYPE; }
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 chunk3D4FM53F_js.ZodMultipartBody; }
28
+ get: function () { return chunkWR5L7BVA_js.ZodMultipartBody; }
29
29
  });
30
30
  exports.FastifyMultipartFileSchema = FastifyMultipartFileSchema;
31
31
  exports.ZodMultipart = ZodMultipart;
@@ -1,6 +1,6 @@
1
- import { createZodMultipart, MultipartFilesIn, buildFileSchema } from '../chunk-YUY5LICA.mjs';
2
- export { MULTIPART_CONTENT_TYPE, ZodMultipartBody } from '../chunk-YUY5LICA.mjs';
3
- import '../chunk-6HU5TMFO.mjs';
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 };