@bedrockio/model 0.18.5 → 0.18.6
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bedrockio/model",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.6",
|
|
4
4
|
"description": "Bedrock utilities for model creation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@babel/preset-env": "^7.26.0",
|
|
40
40
|
"@bedrockio/eslint-plugin": "^1.2.2",
|
|
41
41
|
"@bedrockio/prettier-config": "^1.1.1",
|
|
42
|
-
"@bedrockio/yada": "^1.10.
|
|
42
|
+
"@bedrockio/yada": "^1.10.3",
|
|
43
43
|
"@shelf/jest-mongodb": "^5.2.2",
|
|
44
44
|
"eslint": "^9.36.0",
|
|
45
45
|
"jest": "^30.2.0",
|
package/types/schema.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export function createSchema(definition: object, options?: mongoose.SchemaOption
|
|
|
19
19
|
};
|
|
20
20
|
collation?: mongoose.mongo.CollationOptions;
|
|
21
21
|
collectionOptions?: mongoose.mongo.CreateCollectionOptions;
|
|
22
|
+
lean?: boolean | mongoose.LeanOptions;
|
|
22
23
|
timeseries?: mongoose.mongo.TimeSeriesCollectionOptions;
|
|
23
24
|
expireAfterSeconds?: number;
|
|
24
25
|
expires?: number | string;
|
|
@@ -28,7 +29,9 @@ export function createSchema(definition: object, options?: mongoose.SchemaOption
|
|
|
28
29
|
id?: boolean;
|
|
29
30
|
_id?: boolean;
|
|
30
31
|
minimize?: boolean;
|
|
31
|
-
optimisticConcurrency?: boolean
|
|
32
|
+
optimisticConcurrency?: boolean | string[] | {
|
|
33
|
+
exclude: string[];
|
|
34
|
+
};
|
|
32
35
|
pluginTags?: string[];
|
|
33
36
|
read?: string;
|
|
34
37
|
readConcern?: {
|
|
@@ -47,16 +50,16 @@ export function createSchema(definition: object, options?: mongoose.SchemaOption
|
|
|
47
50
|
getters: boolean;
|
|
48
51
|
versionKey: boolean;
|
|
49
52
|
transform: (doc: any, ret: any, options: any) => void;
|
|
50
|
-
} | mongoose.ToObjectOptions<any>;
|
|
53
|
+
} | mongoose.ToObjectOptions<any, any>;
|
|
51
54
|
toObject: {
|
|
52
55
|
getters: boolean;
|
|
53
56
|
versionKey: boolean;
|
|
54
57
|
transform: (doc: any, ret: any, options: any) => void;
|
|
55
|
-
} | mongoose.ToObjectOptions<any>;
|
|
58
|
+
} | mongoose.ToObjectOptions<any, any>;
|
|
56
59
|
typeKey?: string;
|
|
57
60
|
validateBeforeSave?: boolean;
|
|
58
61
|
validateModifiedOnly?: boolean;
|
|
59
|
-
versionKey?: string |
|
|
62
|
+
versionKey?: string | false;
|
|
60
63
|
selectPopulatedPaths?: boolean;
|
|
61
64
|
skipVersioning?: {
|
|
62
65
|
[key: string]: boolean;
|
|
@@ -64,12 +67,13 @@ export function createSchema(definition: object, options?: mongoose.SchemaOption
|
|
|
64
67
|
storeSubdocValidationError?: boolean;
|
|
65
68
|
timestamps: boolean | mongoose.SchemaTimestampsConfig;
|
|
66
69
|
suppressReservedKeysWarning?: boolean;
|
|
67
|
-
statics?: mongoose.AddThisParameter<any, mongoose.Model<any,
|
|
70
|
+
statics?: mongoose.AddThisParameter<any, mongoose.Model<any, any, any, any, any, any>>;
|
|
68
71
|
methods?: mongoose.AddThisParameter<any, any> & mongoose.AnyObject;
|
|
69
72
|
query?: any;
|
|
70
73
|
castNonArrays?: boolean;
|
|
71
74
|
virtuals?: mongoose.SchemaOptionsVirtualsPropertyType<any, any, any>;
|
|
72
75
|
overwriteModels?: boolean;
|
|
76
|
+
encryptionType?: "csfle" | "queryableEncryption";
|
|
73
77
|
}, any, any>;
|
|
74
78
|
export function normalizeAttributes(arg: any, path?: any[]): any;
|
|
75
79
|
import mongoose from 'mongoose';
|
package/types/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.js"],"names":[],"mappings":"AAyBA;;;;;;;GAOG;AACH,yCAJW,MAAM,YACN,QAAQ,CAAC,aAAa;;;;;;;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.js"],"names":[],"mappings":"AAyBA;;;;;;;GAOG;AACH,yCAJW,MAAM,YACN,QAAQ,CAAC,aAAa;;;;;;;YA2C7B,CAAC;WAAa,CAAC;mBACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;SAqIH,CAAC;gBACL,CAAC;SAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAjItB;AAED,iEAcC;qBA9FoB,UAAU"}
|
package/types/search.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export function applySearch(schema: any, definition: any): void;
|
|
2
2
|
export function searchValidation(options?: {}): {
|
|
3
|
+
validateInput(): void;
|
|
3
4
|
setup(): void;
|
|
4
5
|
get(path?: string | Array<string>): any;
|
|
5
6
|
unwind(path?: string | Array<string>): any;
|
|
@@ -10,6 +11,10 @@ export function searchValidation(options?: {}): {
|
|
|
10
11
|
transform(fn: Function, root?: boolean): /*elided*/ any;
|
|
11
12
|
export(): any;
|
|
12
13
|
append(arg: import("@bedrockio/yada/types/object").SchemaMap | import("@bedrockio/yada/types/Schema").default): /*elided*/ any;
|
|
14
|
+
stripEmpty(): /*elided*/ any;
|
|
15
|
+
stripUnknown(): /*elided*/ any;
|
|
16
|
+
allowFlatKeys(): /*elided*/ any;
|
|
17
|
+
expandFlatKeys(): /*elided*/ any;
|
|
13
18
|
options(options?: {
|
|
14
19
|
stripEmpty?: boolean;
|
|
15
20
|
stripUnknown?: boolean;
|
package/types/search.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.js"],"names":[],"mappings":"AAuBA,gEAaC;AAED
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.js"],"names":[],"mappings":"AAuBA,gEAaC;AAED;;;;;;;;;;;;;;;;;kBAyII,CAAF;oBAIe,CAAC;qBAEd,CAAJ;sBACmB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAnDc,CAAC;;;;;;;;;;;;;;EApElC;AAED;;;;;;;;;;;;;;;;mBA1BmD,CAAC;;;;;;;;;;;;qBAuBlD,CAAC;sBAGmB,CAAC;sBACrB,CAAC;wBAA8B,CAAC;wBACrB,CAAC;;;4BAwBc,CAAC;kCAK3B,CAAD;wBACc,CAAC;wBAA+B,CAAC;wCACtB,CAAC;2BAGhB,CAAC;kCAES,CAAC;2BACd,CAAC;qBACL,CAAJ;;;uBAuBgC,CAAC;6BAEjB,CAAC;8BACF,CAAC;6BAGZ,CAAH;0BACgB,CAAC;6BACZ,CAAF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAL8B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBA5FgB,CAAC;;;;;;;;;;;;qBAuBlD,CAAC;sBAGmB,CAAC;sBACrB,CAAC;wBAA8B,CAAC;wBACrB,CAAC;;;4BAwBc,CAAC;kCAK3B,CAAD;wBACc,CAAC;wBAA+B,CAAC;wCACtB,CAAC;2BAGhB,CAAC;kCAES,CAAC;2BACd,CAAC;qBACL,CAAJ;;;uBAuBgC,CAAC;6BAEjB,CAAC;8BACF,CAAC;6BAGZ,CAAH;0BACgB,CAAC;6BACZ,CAAF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAL8B,CAAC;;;;;;;;;;;;;;;;;EArDlC"}
|
|
@@ -162,6 +162,7 @@ export const OBJECT_ID_SCHEMA: {
|
|
|
162
162
|
runAssertion(value: any, assertion: any, options?: {}): Promise<any>;
|
|
163
163
|
};
|
|
164
164
|
export const NUMBER_RANGE_SCHEMA: {
|
|
165
|
+
validateInput(): void;
|
|
165
166
|
setup(): void;
|
|
166
167
|
get(path?: string | Array<string>): any;
|
|
167
168
|
unwind(path?: string | Array<string>): any;
|
|
@@ -172,6 +173,10 @@ export const NUMBER_RANGE_SCHEMA: {
|
|
|
172
173
|
transform(fn: Function, root?: boolean): /*elided*/ any;
|
|
173
174
|
export(): any;
|
|
174
175
|
append(arg: import("@bedrockio/yada/types/object").SchemaMap | import("@bedrockio/yada/types/Schema").default): /*elided*/ any;
|
|
176
|
+
stripEmpty(): /*elided*/ any;
|
|
177
|
+
stripUnknown(): /*elided*/ any;
|
|
178
|
+
allowFlatKeys(): /*elided*/ any;
|
|
179
|
+
expandFlatKeys(): /*elided*/ any;
|
|
175
180
|
options(options?: {
|
|
176
181
|
stripEmpty?: boolean;
|
|
177
182
|
stripUnknown?: boolean;
|
|
@@ -221,6 +226,7 @@ export const NUMBER_RANGE_SCHEMA: {
|
|
|
221
226
|
runAssertion(value: any, assertion: any, options?: {}): Promise<any>;
|
|
222
227
|
};
|
|
223
228
|
export const STRING_RANGE_SCHEMA: {
|
|
229
|
+
validateInput(): void;
|
|
224
230
|
setup(): void;
|
|
225
231
|
get(path?: string | Array<string>): any;
|
|
226
232
|
unwind(path?: string | Array<string>): any;
|
|
@@ -231,6 +237,10 @@ export const STRING_RANGE_SCHEMA: {
|
|
|
231
237
|
transform(fn: Function, root?: boolean): /*elided*/ any;
|
|
232
238
|
export(): any;
|
|
233
239
|
append(arg: import("@bedrockio/yada/types/object").SchemaMap | import("@bedrockio/yada/types/Schema").default): /*elided*/ any;
|
|
240
|
+
stripEmpty(): /*elided*/ any;
|
|
241
|
+
stripUnknown(): /*elided*/ any;
|
|
242
|
+
allowFlatKeys(): /*elided*/ any;
|
|
243
|
+
expandFlatKeys(): /*elided*/ any;
|
|
234
244
|
options(options?: {
|
|
235
245
|
stripEmpty?: boolean;
|
|
236
246
|
stripUnknown?: boolean;
|
|
@@ -280,6 +290,7 @@ export const STRING_RANGE_SCHEMA: {
|
|
|
280
290
|
runAssertion(value: any, assertion: any, options?: {}): Promise<any>;
|
|
281
291
|
};
|
|
282
292
|
export const DATE_RANGE_SCHEMA: {
|
|
293
|
+
validateInput(): void;
|
|
283
294
|
setup(): void;
|
|
284
295
|
get(path?: string | Array<string>): any;
|
|
285
296
|
unwind(path?: string | Array<string>): any;
|
|
@@ -290,6 +301,10 @@ export const DATE_RANGE_SCHEMA: {
|
|
|
290
301
|
transform(fn: Function, root?: boolean): /*elided*/ any;
|
|
291
302
|
export(): any;
|
|
292
303
|
append(arg: import("@bedrockio/yada/types/object").SchemaMap | import("@bedrockio/yada/types/Schema").default): /*elided*/ any;
|
|
304
|
+
stripEmpty(): /*elided*/ any;
|
|
305
|
+
stripUnknown(): /*elided*/ any;
|
|
306
|
+
allowFlatKeys(): /*elided*/ any;
|
|
307
|
+
expandFlatKeys(): /*elided*/ any;
|
|
293
308
|
options(options?: {
|
|
294
309
|
stripEmpty?: boolean;
|
|
295
310
|
stripUnknown?: boolean;
|
|
@@ -340,6 +355,7 @@ export const DATE_RANGE_SCHEMA: {
|
|
|
340
355
|
};
|
|
341
356
|
export const REFERENCE_SCHEMA: import("@bedrockio/yada/types/Schema").default;
|
|
342
357
|
export const INCLUDE_FIELD_SCHEMA: {
|
|
358
|
+
validateInput(): void;
|
|
343
359
|
setup(): void;
|
|
344
360
|
get(path?: string | Array<string>): any;
|
|
345
361
|
unwind(path?: string | Array<string>): any;
|
|
@@ -350,6 +366,10 @@ export const INCLUDE_FIELD_SCHEMA: {
|
|
|
350
366
|
transform(fn: Function, root?: boolean): /*elided*/ any;
|
|
351
367
|
export(): any;
|
|
352
368
|
append(arg: import("@bedrockio/yada/types/object").SchemaMap | import("@bedrockio/yada/types/Schema").default): /*elided*/ any;
|
|
369
|
+
stripEmpty(): /*elided*/ any;
|
|
370
|
+
stripUnknown(): /*elided*/ any;
|
|
371
|
+
allowFlatKeys(): /*elided*/ any;
|
|
372
|
+
expandFlatKeys(): /*elided*/ any;
|
|
353
373
|
options(options?: {
|
|
354
374
|
stripEmpty?: boolean;
|
|
355
375
|
stripUnknown?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation-schemas.d.ts","sourceRoot":"","sources":["../src/validation-schemas.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA2FwE,CAAC;aACjE,CAAC;uBAGc,CAAC;;;;;;;;;;;eAO2H,CAAC;;;;;;;;;;;;;;;;EAtG1F;AAE1D;;;;;;;;;;;;;;;eAwBwB,CAAC;;;;;;;;;;;;iBAoBjB,CAAC;kBAEC,CAAC;kBAEH,CAAH;oBAA8B,CAAC;oBAEhC,CAAD;;;wBA4BW,CAAC;8BAEK,CAAA;oBAEd,CAAF;oBAEiB,CAAC;oCACjB,CAAC;uBAEF,CAAD;8BACkB,CAAC;uBAAkC,CAAC;iBAA4B,CAAC;;;mBAYjC,CAAC;yBAAoC,CAAC;0BAAqC,CAAC;yBAAoC,CAAC;sBAAiC,CAAC;yBAAoC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAA1F,CAAC;;;;;;;;;;;;;;;;EA5F/I;AAEL
|
|
1
|
+
{"version":3,"file":"validation-schemas.d.ts","sourceRoot":"","sources":["../src/validation-schemas.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA2FwE,CAAC;aACjE,CAAC;uBAGc,CAAC;;;;;;;;;;;eAO2H,CAAC;;;;;;;;;;;;;;;;EAtG1F;AAE1D;;;;;;;;;;;;;;;eAwBwB,CAAC;;;;;;;;;;;;iBAoBjB,CAAC;kBAEC,CAAC;kBAEH,CAAH;oBAA8B,CAAC;oBAEhC,CAAD;;;wBA4BW,CAAC;8BAEK,CAAA;oBAEd,CAAF;oBAEiB,CAAC;oCACjB,CAAC;uBAEF,CAAD;8BACkB,CAAC;uBAAkC,CAAC;iBAA4B,CAAC;;;mBAYjC,CAAC;yBAAoC,CAAC;0BAAqC,CAAC;yBAAoC,CAAC;sBAAiC,CAAC;yBAAoC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAA1F,CAAC;;;;;;;;;;;;;;;;EA5F/I;AAEL;;;;;;;;;;;;;;;;;kBA0F04B,CAAC;oBAA+B,CAAC;qBAAgC,CAAC;sBAAiC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAA31B,CAAC;;;;;;;;;;;;;;EAhF/I;AAEL;;;;;;;;;;;;;;;;;kBA8E04B,CAAC;oBAA+B,CAAC;qBAAgC,CAAC;sBAAiC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAA31B,CAAC;;;;;;;;;;;;;;EApE/I;AAEL;;;;;;;;;;;;;;;;;kBAkE04B,CAAC;oBAA+B,CAAC;qBAAgC,CAAC;sBAAiC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAA31B,CAAC;;;;;;;;;;;;;;EAhC/I;AAEL,8EAqBK;AAEL;;;;;;;;;;;;;;;;;kBAO04B,CAAC;oBAA+B,CAAC;qBAAgC,CAAC;sBAAiC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAA31B,CAAC;;;;;;;;;;;;;;EADjJ"}
|