@aomex/mongoose 3.21.0 → 3.21.1

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
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.21.1](https://github.com/aomex/aomex/compare/v3.21.0...v3.21.1) (2025-04-06)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **mongoose:** 忘记导出ModelInput类型 ([b3dce65](https://github.com/aomex/aomex/commit/b3dce656571bb7d1c448dc77d091e198716b7e81))
12
+
13
+
14
+
15
+
16
+
6
17
  # [3.21.0](https://github.com/aomex/aomex/compare/v3.20.0...v3.21.0) (2025-04-06)
7
18
 
8
19
 
package/dist/index.d.ts CHANGED
@@ -34,6 +34,9 @@ declare module '@aomex/common' {
34
34
  }
35
35
  }
36
36
 
37
+ type ModelInput<M extends Model<any, any, any, any, any, any>> = M extends Model<any, any, any, any, any, infer R extends Record<string, Validator>> ? {
38
+ -readonly [K in keyof R]: R[K] extends Validator<infer U> ? U extends null ? null | undefined : U extends Validator.TDefault | Validator.TOptional ? undefined : U : never;
39
+ } : never;
37
40
  type ModelOutput<M extends Model<any, any, any, any, any, any>> = {
38
41
  _id: mongo.ObjectId;
39
42
  } & (M extends Model<infer R, any, any, any, any, any> ? R : never);
@@ -96,4 +99,4 @@ declare function formatMongoResult<T extends Record<string, any>, Remove extends
96
99
  declare function formatMongoResult<T extends Document | null, Remove extends boolean>(data: T, removeColumns?: Remove): T extends Document ? MongoResult<T extends Document<any, any, infer R> ? FlattenMaps<Default__v<Require_id<R>>> : never, Remove> : null;
97
100
  declare function formatMongoResult<T extends Record<string, any> | null, Remove extends boolean>(data: T, removeColumns?: Remove): T extends Record<string, any> ? MongoResult<T, Remove> : null;
98
101
 
99
- export { type ModelOutput, MongoDecimal128Validator, MongoObjectIdValidator, type MongoResult, defineMongooseModel, formatMongoResult };
102
+ export { type ModelInput, type ModelOutput, MongoDecimal128Validator, MongoObjectIdValidator, type MongoResult, defineMongooseModel, formatMongoResult };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aomex/mongoose",
3
- "version": "3.21.0",
3
+ "version": "3.21.1",
4
4
  "description": "aomex与mongoose深度集成",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",