@bedrockio/model 0.14.0 → 0.14.2

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
@@ -1,3 +1,11 @@
1
+ ## 0.14.2
2
+
3
+ - Loosened peer deps.
4
+
5
+ ## 0.14.1
6
+
7
+ - Ensure includes are allowed on `getUpdateValidattion`.
8
+
1
9
  ## 0.14.0
2
10
 
3
11
  - More clearly defined assign behavior on nested fields.
@@ -81,7 +81,7 @@ function applyValidation(schema, definition) {
81
81
  stripUnknown: true,
82
82
  stripDeleted: true,
83
83
  allowFlatKeys: true,
84
- allowInclude: false,
84
+ allowInclude: true,
85
85
  stripTimestamps: true,
86
86
  allowExpandedRefs: true,
87
87
  requireWriteAccess: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrockio/model",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
4
4
  "description": "Bedrock utilities for model creation.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -30,8 +30,8 @@
30
30
  "lodash": "^4.17.21"
31
31
  },
32
32
  "peerDependencies": {
33
- "@bedrockio/yada": "^1.6.1",
34
- "mongoose": "^8.18.2"
33
+ "@bedrockio/yada": "1.x",
34
+ "mongoose": "8.x"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@babel/cli": "^7.26.4",
@@ -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.6.1",
42
+ "@bedrockio/yada": "^1.8.0",
43
43
  "@shelf/jest-mongodb": "^5.2.2",
44
44
  "eslint": "^9.36.0",
45
45
  "jest": "^30.2.0",
package/src/validation.js CHANGED
@@ -85,7 +85,7 @@ export function applyValidation(schema, definition) {
85
85
  stripUnknown: true,
86
86
  stripDeleted: true,
87
87
  allowFlatKeys: true,
88
- allowInclude: false,
88
+ allowInclude: true,
89
89
  stripTimestamps: true,
90
90
  allowExpandedRefs: true,
91
91
  requireWriteAccess: true,
@@ -9,6 +9,8 @@ export const INCLUDE_FIELD_SCHEMA: {
9
9
  pick(...names?: string[]): /*elided*/ any;
10
10
  omit(...names?: string[]): /*elided*/ any;
11
11
  require(...fields: string[]): /*elided*/ any;
12
+ requireAll(): /*elided*/ any;
13
+ requireAllWithin(): /*elided*/ any;
12
14
  export(): any;
13
15
  append(arg: import("@bedrockio/yada/types/object").SchemaMap | import("@bedrockio/yada/types/Schema").default): /*elided*/ any;
14
16
  options(options?: {
@@ -39,6 +41,9 @@ export const INCLUDE_FIELD_SCHEMA: {
39
41
  getAnyType(): {
40
42
  type: string[];
41
43
  };
44
+ getFormat(): {
45
+ format: any;
46
+ };
42
47
  getDefault(): {
43
48
  default?: undefined;
44
49
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"include.d.ts","sourceRoot":"","sources":["../src/include.js"],"names":[],"mappings":"AA2BA,gDAuEC;AAMD,uDA4BC;AAGD,yDAIC;AAaD,yEAUC;AA9ID;;;;;;;;;;kBA6FQ,CAAL;oBAA+B,CAAC;qBAE7B,CAAN;sBACkB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;eAzBF,CAAC;;;;;;;;;;;;;;;;;EAlEf"}
1
+ {"version":3,"file":"include.d.ts","sourceRoot":"","sources":["../src/include.js"],"names":[],"mappings":"AA2BA,gDAuEC;AAMD,uDA4BC;AAGD,yDAIC;AAaD,yEAUC;AA9ID;;;;;;;;;;;;kBAwGwB,CAAC;oBAEnB,CADL;qBAAgC,CAAC;sBACxB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAnCqD,CAAC;;;;;;;;;;;;;;;;;EAlE9D"}
package/types/search.d.ts CHANGED
@@ -6,6 +6,8 @@ export function searchValidation(options?: {}): {
6
6
  pick(...names?: string[]): /*elided*/ any;
7
7
  omit(...names?: string[]): /*elided*/ any;
8
8
  require(...fields: string[]): /*elided*/ any;
9
+ requireAll(): /*elided*/ any;
10
+ requireAllWithin(): /*elided*/ any;
9
11
  export(): any;
10
12
  append(arg: import("@bedrockio/yada/types/object").SchemaMap | import("@bedrockio/yada/types/Schema").default): /*elided*/ any;
11
13
  options(options?: {
@@ -36,6 +38,9 @@ export function searchValidation(options?: {}): {
36
38
  getAnyType(): {
37
39
  type: string[];
38
40
  };
41
+ getFormat(): {
42
+ format: any;
43
+ };
39
44
  getDefault(): {
40
45
  default?: undefined;
41
46
  } | {
@@ -138,6 +143,9 @@ export function exportValidation(options?: {}): {
138
143
  getAnyType(): {
139
144
  type: string[];
140
145
  };
146
+ getFormat(): {
147
+ format: any;
148
+ };
141
149
  getDefault(): {
142
150
  default?: undefined;
143
151
  } | {
@@ -147,6 +155,7 @@ export function exportValidation(options?: {}): {
147
155
  nullable: boolean;
148
156
  };
149
157
  getEnum(): any;
158
+ requireAllWithin(): /*elided*/ any;
150
159
  expandExtra(extra?: {}): {};
151
160
  inspect(): string;
152
161
  get(): void;
@@ -240,6 +249,9 @@ export function exportValidation(options?: {}): {
240
249
  getAnyType(): {
241
250
  type: string[];
242
251
  };
252
+ getFormat(): {
253
+ format: any;
254
+ };
243
255
  getDefault(): {
244
256
  default?: undefined;
245
257
  } | {
@@ -249,6 +261,7 @@ export function exportValidation(options?: {}): {
249
261
  nullable: boolean;
250
262
  };
251
263
  getEnum(): any;
264
+ requireAllWithin(): /*elided*/ any;
252
265
  expandExtra(extra?: {}): {};
253
266
  inspect(): string;
254
267
  get(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.js"],"names":[],"mappings":"AAuBA,gEAaC;AAED;;;;;;;;;;kBA6F6B,CAAC;oBAGrB,CAAC;qBACe,CAAC;sBAClB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;eAtCL,CAAF;;;;;;;;;;;;;;;;;EAnCD;AAED;;;;;;;;;;;;;;;;;mBAtBI,CAAA;;;;;;;;;;;;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BAA4B,CAAC;;;uBAsBT,CAAC;6BACH,CAAC;8BAI7B,CAAF;6BAAoC,CAAC;0BAClB,CAAC;6BAIhB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAvCN,CADF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAzDI,CAAA;;;;;;;;;;;;qBAuBC,CAAC;sBAA4B,CAAC;sBACvB,CAAC;wBAA8B,CAAC;wBAEnC,CAAC;;;4BA2BK,CAAC;kCACwB,CAAC;wBACrC,CAAA;wBAA+B,CAAC;wCAK9B,CAAJ;2BAAkC,CAAC;kCACP,CAAC;2BAIhB,CAAC;qBAA4B,CAAC;;;uBAsBT,CAAC;6BACH,CAAC;8BAI7B,CAAF;6BAAoC,CAAC;0BAClB,CAAC;6BAIhB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAvCN,CADF;;;;;;;;;;;;;;;;;;;;EAtBC"}
@@ -30,6 +30,9 @@ export const DATE_SCHEMA: {
30
30
  getAnyType(): {
31
31
  type: string[];
32
32
  };
33
+ getFormat(): {
34
+ format: any;
35
+ };
33
36
  getDefault(): {
34
37
  default?: undefined;
35
38
  } | {
@@ -39,6 +42,7 @@ export const DATE_SCHEMA: {
39
42
  nullable: boolean;
40
43
  };
41
44
  getEnum(): any;
45
+ requireAllWithin(): /*elided*/ any;
42
46
  expandExtra(extra?: {}): {};
43
47
  inspect(): string;
44
48
  get(): void;
@@ -132,6 +136,9 @@ export const OBJECT_ID_SCHEMA: {
132
136
  getAnyType(): {
133
137
  type: string[];
134
138
  };
139
+ getFormat(): {
140
+ format: any;
141
+ };
135
142
  getDefault(): {
136
143
  default?: undefined;
137
144
  } | {
@@ -141,6 +148,7 @@ export const OBJECT_ID_SCHEMA: {
141
148
  nullable: boolean;
142
149
  };
143
150
  getEnum(): any;
151
+ requireAllWithin(): /*elided*/ any;
144
152
  expandExtra(extra?: {}): {};
145
153
  inspect(): string;
146
154
  get(): void;
@@ -159,6 +167,8 @@ export const NUMBER_RANGE_SCHEMA: {
159
167
  pick(...names?: string[]): /*elided*/ any;
160
168
  omit(...names?: string[]): /*elided*/ any;
161
169
  require(...fields: string[]): /*elided*/ any;
170
+ requireAll(): /*elided*/ any;
171
+ requireAllWithin(): /*elided*/ any;
162
172
  export(): any;
163
173
  append(arg: import("@bedrockio/yada/types/object").SchemaMap | import("@bedrockio/yada/types/Schema").default): /*elided*/ any;
164
174
  options(options?: {
@@ -189,6 +199,9 @@ export const NUMBER_RANGE_SCHEMA: {
189
199
  getAnyType(): {
190
200
  type: string[];
191
201
  };
202
+ getFormat(): {
203
+ format: any;
204
+ };
192
205
  getDefault(): {
193
206
  default?: undefined;
194
207
  } | {
@@ -215,6 +228,8 @@ export const STRING_RANGE_SCHEMA: {
215
228
  pick(...names?: string[]): /*elided*/ any;
216
229
  omit(...names?: string[]): /*elided*/ any;
217
230
  require(...fields: string[]): /*elided*/ any;
231
+ requireAll(): /*elided*/ any;
232
+ requireAllWithin(): /*elided*/ any;
218
233
  export(): any;
219
234
  append(arg: import("@bedrockio/yada/types/object").SchemaMap | import("@bedrockio/yada/types/Schema").default): /*elided*/ any;
220
235
  options(options?: {
@@ -245,6 +260,9 @@ export const STRING_RANGE_SCHEMA: {
245
260
  getAnyType(): {
246
261
  type: string[];
247
262
  };
263
+ getFormat(): {
264
+ format: any;
265
+ };
248
266
  getDefault(): {
249
267
  default?: undefined;
250
268
  } | {
@@ -271,6 +289,8 @@ export const DATE_RANGE_SCHEMA: {
271
289
  pick(...names?: string[]): /*elided*/ any;
272
290
  omit(...names?: string[]): /*elided*/ any;
273
291
  require(...fields: string[]): /*elided*/ any;
292
+ requireAll(): /*elided*/ any;
293
+ requireAllWithin(): /*elided*/ any;
274
294
  export(): any;
275
295
  append(arg: import("@bedrockio/yada/types/object").SchemaMap | import("@bedrockio/yada/types/Schema").default): /*elided*/ any;
276
296
  options(options?: {
@@ -301,6 +321,9 @@ export const DATE_RANGE_SCHEMA: {
301
321
  getAnyType(): {
302
322
  type: string[];
303
323
  };
324
+ getFormat(): {
325
+ format: any;
326
+ };
304
327
  getDefault(): {
305
328
  default?: undefined;
306
329
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"validation-schemas.d.ts","sourceRoot":"","sources":["../src/validation-schemas.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAsFgD,CAAC;;;;;;;;;;;;;;;;;;EAtFS;AAE1D;;;;;;;;;;;;;;;;eAyBwB,CAAC;;;;;;;;;;;;iBAuBjB,CAAA;kBAA4B,CAAC;kBAEjC,CAAF;oBAEI,CAAC;oBAEI,CAAC;;;wBA2BC,CAAC;8BAGI,CAAC;oBAA+B,CAAC;oBAE1C,CAAC;oCAEL,CAAC;uBAAkC,CAAC;8BAAyC,CAAC;uBACzD,CAAC;iBAA4B,CAAC;;;mBAG0V,CAAC;yBAAoC,CAAC;0BAAqC,CAAC;yBAAoC,CAAC;sBAAiC,CAAC;yBAAoC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAR1hB,CAAC;;;;;;;;;;;;;;;;;;EA5E5C;AAEL;;;;;;;;;;kBAkFkb,CAAC;oBAA+B,CAAC;qBAAgC,CAAC;sBAAiC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;eARte,CAAC;;;;;;;;;;;;;;;;;EAhE5C;AAEL;;;;;;;;;;kBAsEkb,CAAC;oBAA+B,CAAC;qBAAgC,CAAC;sBAAiC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;eARte,CAAC;;;;;;;;;;;;;;;;;EApD5C;AAEL;;;;;;;;;;kBA0Dkb,CAAC;oBAA+B,CAAC;qBAAgC,CAAC;sBAAiC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;eARte,CAAC;;;;;;;;;;;;;;;;;EAhB5C;AAEL,8EAqBK"}
1
+ {"version":3,"file":"validation-schemas.d.ts","sourceRoot":"","sources":["../src/validation-schemas.js"],"names":[],"mappings":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