@zodyac/zod-mongoose 3.0.0 → 3.1.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/CHANGELOG.md CHANGED
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## Unreleased
9
9
 
10
+ ## 3.1.0 - 2025-01-06
11
+
10
12
  ## 3.0.0 - 2024-10-19
11
13
 
12
14
  ## 2.3.3 - 2024-09-21
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { Types, SchemaTypes, SchemaOptions, Schema } from 'mongoose';
1
+ import { Types, SchemaTypes, SchemaDefinition, SchemaTypeOptions, SchemaOptions, Schema } from 'mongoose';
2
2
  import { z, ZodType, ZodRawShape, ZodObject } from 'zod';
3
3
 
4
4
  declare namespace zm {
@@ -66,8 +66,8 @@ declare namespace zm {
66
66
  of?: Constructor;
67
67
  }
68
68
  type mField = mString | mNumber | mBoolean | mDate | mObjectId | mUUID | mMixed<unknown> | mArray<unknown> | _Schema<unknown> | mMap<unknown, unknown>;
69
- type _Schema<T> = {
70
- [K in keyof T]: _Field<T[K]> | _Schema<T[K]>;
69
+ type _Schema<T> = SchemaDefinition & {
70
+ [K in keyof T]: (_Field<T[K]> & SchemaTypeOptions<T[K]>) | _Schema<T[K]>;
71
71
  };
72
72
  type UnwrapZodType<T> = T extends ZodType<infer K> ? K : never;
73
73
  type EffectValidator<T> = {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Types, SchemaTypes, SchemaOptions, Schema } from 'mongoose';
1
+ import { Types, SchemaTypes, SchemaDefinition, SchemaTypeOptions, SchemaOptions, Schema } from 'mongoose';
2
2
  import { z, ZodType, ZodRawShape, ZodObject } from 'zod';
3
3
 
4
4
  declare namespace zm {
@@ -66,8 +66,8 @@ declare namespace zm {
66
66
  of?: Constructor;
67
67
  }
68
68
  type mField = mString | mNumber | mBoolean | mDate | mObjectId | mUUID | mMixed<unknown> | mArray<unknown> | _Schema<unknown> | mMap<unknown, unknown>;
69
- type _Schema<T> = {
70
- [K in keyof T]: _Field<T[K]> | _Schema<T[K]>;
69
+ type _Schema<T> = SchemaDefinition & {
70
+ [K in keyof T]: (_Field<T[K]> & SchemaTypeOptions<T[K]>) | _Schema<T[K]>;
71
71
  };
72
72
  type UnwrapZodType<T> = T extends ZodType<infer K> ? K : never;
73
73
  type EffectValidator<T> = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zodyac/zod-mongoose",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "A library that allows you to generate mongoose schemas from zod objects.",
5
5
  "scripts": {
6
6
  "test": "jest",