@kikiutils/mongoose 9.0.2 → 9.0.3
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/dist/assertions.js.map +1 -1
- package/dist/plugins/assertions.js +4 -4
- package/dist/plugins/assertions.js.map +1 -1
- package/dist/plugins/lean-decimal128-to-string.d.ts +6 -2
- package/dist/plugins/lean-decimal128-to-string.d.ts.map +1 -1
- package/dist/plugins/lean-decimal128-to-string.js +5 -4
- package/dist/plugins/lean-decimal128-to-string.js.map +1 -1
- package/dist/plugins/normalize.d.ts +3 -1
- package/dist/plugins/normalize.d.ts.map +1 -1
- package/dist/plugins/normalize.js +2 -1
- package/dist/plugins/normalize.js.map +1 -1
- package/dist/schema-builders/_internals.d.ts +18 -0
- package/dist/schema-builders/_internals.d.ts.map +1 -0
- package/dist/schema-builders/_internals.js +36 -0
- package/dist/schema-builders/_internals.js.map +1 -0
- package/dist/schema-builders/bigint.d.ts +5 -25
- package/dist/schema-builders/bigint.d.ts.map +1 -1
- package/dist/schema-builders/bigint.js +9 -19
- package/dist/schema-builders/bigint.js.map +1 -1
- package/dist/schema-builders/date.d.ts +4 -9
- package/dist/schema-builders/date.d.ts.map +1 -1
- package/dist/schema-builders/date.js.map +1 -1
- package/dist/schema-builders/decimal128.d.ts +6 -24
- package/dist/schema-builders/decimal128.d.ts.map +1 -1
- package/dist/schema-builders/decimal128.js +4 -6
- package/dist/schema-builders/decimal128.js.map +1 -1
- package/dist/schema-builders/double.d.ts +5 -25
- package/dist/schema-builders/double.d.ts.map +1 -1
- package/dist/schema-builders/double.js +9 -19
- package/dist/schema-builders/double.js.map +1 -1
- package/dist/schema-builders/int32.d.ts +5 -25
- package/dist/schema-builders/int32.d.ts.map +1 -1
- package/dist/schema-builders/int32.js +9 -19
- package/dist/schema-builders/int32.js.map +1 -1
- package/dist/schema-builders/number.d.ts +4 -9
- package/dist/schema-builders/number.d.ts.map +1 -1
- package/dist/schema-builders/number.js.map +1 -1
- package/dist/schema-builders/object-id.d.ts +2 -7
- package/dist/schema-builders/object-id.d.ts.map +1 -1
- package/dist/schema-builders/object-id.js.map +1 -1
- package/dist/schema-builders/ref.d.ts +2 -7
- package/dist/schema-builders/ref.d.ts.map +1 -1
- package/dist/schema-builders/ref.js.map +1 -1
- package/dist/schema-builders/string.d.ts +5 -10
- package/dist/schema-builders/string.d.ts.map +1 -1
- package/dist/schema-builders/string.js.map +1 -1
- package/dist/types/_internals.d.ts +22 -0
- package/dist/types/_internals.d.ts.map +1 -1
- package/dist/types/aggregate-paginate.d.ts +2 -1
- package/dist/types/aggregate-paginate.d.ts.map +1 -1
- package/dist/types/data.d.ts +3 -1
- package/dist/types/data.d.ts.map +1 -1
- package/dist/types/options.d.ts +6 -2
- package/dist/types/options.d.ts.map +1 -1
- package/package.json +9 -8
- package/src/assertions.ts +0 -1
- package/src/plugins/assertions.ts +4 -4
- package/src/plugins/lean-decimal128-to-string.ts +18 -7
- package/src/plugins/normalize.ts +5 -2
- package/src/schema-builders/_internals.ts +64 -0
- package/src/schema-builders/bigint.ts +33 -67
- package/src/schema-builders/date.ts +7 -7
- package/src/schema-builders/decimal128.ts +25 -41
- package/src/schema-builders/double.ts +35 -67
- package/src/schema-builders/int32.ts +33 -67
- package/src/schema-builders/number.ts +7 -7
- package/src/schema-builders/object-id.ts +2 -5
- package/src/schema-builders/ref.ts +2 -5
- package/src/schema-builders/string.ts +8 -8
- package/src/types/_internals.ts +26 -0
- package/src/types/aggregate-paginate.ts +2 -1
- package/src/types/data.ts +3 -1
- package/src/types/options.ts +6 -2
|
@@ -11,6 +11,7 @@ import type {
|
|
|
11
11
|
PipelineStage,
|
|
12
12
|
Schema,
|
|
13
13
|
} from 'mongoose';
|
|
14
|
+
import type { Arrayable } from 'type-fest';
|
|
14
15
|
|
|
15
16
|
type PrePaginatePipelineStage = '__PREPAGINATE__' | PipelineStage;
|
|
16
17
|
|
|
@@ -86,7 +87,7 @@ export interface AggregatePaginateQueryPopulateOptions {
|
|
|
86
87
|
/**
|
|
87
88
|
* The nested population options applied to the populated documents.
|
|
88
89
|
*/
|
|
89
|
-
populate?: AggregatePaginateQueryPopulateOptions
|
|
90
|
+
populate?: Arrayable<AggregatePaginateQueryPopulateOptions>;
|
|
90
91
|
|
|
91
92
|
/**
|
|
92
93
|
* The field projection used when retrieving populated documents.
|
package/src/types/data.ts
CHANGED
|
@@ -10,7 +10,9 @@ export type BaseMongooseModelData<CreatedAtField extends boolean = true, Updated
|
|
|
10
10
|
& (UpdatedAtField extends true ? { updatedAt: string } : unknown)
|
|
11
11
|
& { id: string };
|
|
12
12
|
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Converts data fields to document fields using the same `_id` rules as BaseMongooseDocType.
|
|
15
|
+
*/
|
|
14
16
|
export type DataToBaseMongooseDocType<
|
|
15
17
|
T,
|
|
16
18
|
ObjectIdFields extends keyof T = never,
|
package/src/types/options.ts
CHANGED
|
@@ -13,10 +13,14 @@ import type { BaseMongoosePaginateModel } from './';
|
|
|
13
13
|
export interface BuildMongooseModelOptions {
|
|
14
14
|
connection?: Connection;
|
|
15
15
|
plugins?: {
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Register lean conversion for marked Decimal128 fields. Defaults to true.
|
|
18
|
+
*/
|
|
17
19
|
leanDecimal128ToString?: boolean | MongooseLeanDecimal128ToStringPluginOptions;
|
|
18
20
|
|
|
19
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Register JSON normalization. Defaults to true; an object enables it with custom options.
|
|
23
|
+
*/
|
|
20
24
|
normalize?: boolean | MongooseNormalizePluginOptions;
|
|
21
25
|
};
|
|
22
26
|
|