@bedrockio/model 0.13.0 → 0.13.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 +11 -0
- package/dist/cjs/validation.js +8 -9
- package/package.json +3 -3
- package/src/validation.js +9 -9
- package/types/include.d.ts +8 -3
- package/types/include.d.ts.map +1 -1
- package/types/search.d.ts +14 -7
- package/types/search.d.ts.map +1 -1
- package/types/validation-schemas.d.ts +30 -13
- package/types/validation-schemas.d.ts.map +1 -1
- package/types/validation.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## 0.13.2
|
|
2
|
+
|
|
3
|
+
- Bumped yada version.
|
|
4
|
+
- Removed `expandDotSyntax` as default.
|
|
5
|
+
- Added `calendar` named validation.
|
|
6
|
+
- Updated OpenApi tests to match stricter JSON schema.
|
|
7
|
+
|
|
8
|
+
## 0.13.1
|
|
9
|
+
|
|
10
|
+
- Do not enforce unique constraints in search validation.
|
|
11
|
+
|
|
1
12
|
## 0.13.0
|
|
2
13
|
|
|
3
14
|
- Removed support for passing schemas into `getCreateValidation` etc. now that
|
package/dist/cjs/validation.js
CHANGED
|
@@ -26,6 +26,10 @@ const NAMED_SCHEMAS = {
|
|
|
26
26
|
// Force "objectId" to have parity with refs.
|
|
27
27
|
// "mongo" is notably excluded here for this reason.
|
|
28
28
|
objectId: _validationSchemas.OBJECT_ID_SCHEMA,
|
|
29
|
+
// Normal date validations must contain a time. The
|
|
30
|
+
// "calendar" validation is a special case to validate
|
|
31
|
+
// string fields in ISO-8601 format without a time.
|
|
32
|
+
calendar: _yada.default.string().calendar(),
|
|
29
33
|
ascii: _yada.default.string().ascii(),
|
|
30
34
|
base64: _yada.default.string().base64(),
|
|
31
35
|
btc: _yada.default.string().btc(),
|
|
@@ -58,6 +62,7 @@ function applyValidation(schema, definition) {
|
|
|
58
62
|
return getSchemaFromMongoose(schema, {
|
|
59
63
|
model: this,
|
|
60
64
|
stripEmpty: true,
|
|
65
|
+
applyUnique: true,
|
|
61
66
|
stripDeleted: true,
|
|
62
67
|
allowInclude: false,
|
|
63
68
|
stripTimestamps: true,
|
|
@@ -71,6 +76,7 @@ function applyValidation(schema, definition) {
|
|
|
71
76
|
return getSchemaFromMongoose(schema, {
|
|
72
77
|
model: this,
|
|
73
78
|
allowNull: true,
|
|
79
|
+
applyUnique: true,
|
|
74
80
|
skipRequired: true,
|
|
75
81
|
stripUnknown: true,
|
|
76
82
|
stripDeleted: true,
|
|
@@ -97,7 +103,6 @@ function applyValidation(schema, definition) {
|
|
|
97
103
|
skipRequired: true,
|
|
98
104
|
allowInclude: true,
|
|
99
105
|
stripDeleted: true,
|
|
100
|
-
expandDotSyntax: true,
|
|
101
106
|
unwindArrayFields: true,
|
|
102
107
|
requireReadAccess: true,
|
|
103
108
|
...rest
|
|
@@ -182,8 +187,7 @@ function getObjectSchema(arg, options) {
|
|
|
182
187
|
} else if (typeof arg === 'object') {
|
|
183
188
|
const {
|
|
184
189
|
stripUnknown,
|
|
185
|
-
stripEmpty
|
|
186
|
-
expandDotSyntax
|
|
190
|
+
stripEmpty
|
|
187
191
|
} = options;
|
|
188
192
|
const map = {};
|
|
189
193
|
for (let [key, field] of Object.entries(arg)) {
|
|
@@ -202,11 +206,6 @@ function getObjectSchema(arg, options) {
|
|
|
202
206
|
stripEmpty: true
|
|
203
207
|
});
|
|
204
208
|
}
|
|
205
|
-
if (expandDotSyntax) {
|
|
206
|
-
schema = schema.options({
|
|
207
|
-
expandDotSyntax: true
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
209
|
return schema;
|
|
211
210
|
} else {
|
|
212
211
|
return getSchemaForType(arg, options);
|
|
@@ -304,7 +303,7 @@ function getSchemaForTypedef(typedef, options = {}) {
|
|
|
304
303
|
if (typedef.writeAccess && options.requireWriteAccess) {
|
|
305
304
|
schema = validateAccess('write', schema, typedef.writeAccess, options);
|
|
306
305
|
}
|
|
307
|
-
if (typedef.softUnique) {
|
|
306
|
+
if (typedef.softUnique && options.applyUnique) {
|
|
308
307
|
schema = schema.custom(async (value, {
|
|
309
308
|
path,
|
|
310
309
|
originalRoot
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bedrockio/model",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.2",
|
|
4
4
|
"description": "Bedrock utilities for model creation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"lodash": "^4.17.21"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@bedrockio/yada": "^1.
|
|
33
|
+
"@bedrockio/yada": "^1.6.0",
|
|
34
34
|
"mongoose": "^8.13.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@babel/preset-env": "^7.26.0",
|
|
40
40
|
"@bedrockio/eslint-plugin": "^1.1.7",
|
|
41
41
|
"@bedrockio/prettier-config": "^1.0.2",
|
|
42
|
-
"@bedrockio/yada": "^1.
|
|
42
|
+
"@bedrockio/yada": "^1.6.0",
|
|
43
43
|
"@shelf/jest-mongodb": "^5.1.0",
|
|
44
44
|
"eslint": "^9.19.0",
|
|
45
45
|
"jest": "^29.7.0",
|
package/src/validation.js
CHANGED
|
@@ -26,6 +26,11 @@ const NAMED_SCHEMAS = {
|
|
|
26
26
|
// "mongo" is notably excluded here for this reason.
|
|
27
27
|
objectId: OBJECT_ID_SCHEMA,
|
|
28
28
|
|
|
29
|
+
// Normal date validations must contain a time. The
|
|
30
|
+
// "calendar" validation is a special case to validate
|
|
31
|
+
// string fields in ISO-8601 format without a time.
|
|
32
|
+
calendar: yd.string().calendar(),
|
|
33
|
+
|
|
29
34
|
ascii: yd.string().ascii(),
|
|
30
35
|
base64: yd.string().base64(),
|
|
31
36
|
btc: yd.string().btc(),
|
|
@@ -60,6 +65,7 @@ export function applyValidation(schema, definition) {
|
|
|
60
65
|
return getSchemaFromMongoose(schema, {
|
|
61
66
|
model: this,
|
|
62
67
|
stripEmpty: true,
|
|
68
|
+
applyUnique: true,
|
|
63
69
|
stripDeleted: true,
|
|
64
70
|
allowInclude: false,
|
|
65
71
|
stripTimestamps: true,
|
|
@@ -74,6 +80,7 @@ export function applyValidation(schema, definition) {
|
|
|
74
80
|
return getSchemaFromMongoose(schema, {
|
|
75
81
|
model: this,
|
|
76
82
|
allowNull: true,
|
|
83
|
+
applyUnique: true,
|
|
77
84
|
skipRequired: true,
|
|
78
85
|
stripUnknown: true,
|
|
79
86
|
stripDeleted: true,
|
|
@@ -99,7 +106,6 @@ export function applyValidation(schema, definition) {
|
|
|
99
106
|
skipRequired: true,
|
|
100
107
|
allowInclude: true,
|
|
101
108
|
stripDeleted: true,
|
|
102
|
-
expandDotSyntax: true,
|
|
103
109
|
unwindArrayFields: true,
|
|
104
110
|
requireReadAccess: true,
|
|
105
111
|
...rest,
|
|
@@ -193,7 +199,7 @@ function getObjectSchema(arg, options) {
|
|
|
193
199
|
} else if (Array.isArray(arg)) {
|
|
194
200
|
return getArraySchema(arg, options);
|
|
195
201
|
} else if (typeof arg === 'object') {
|
|
196
|
-
const { stripUnknown, stripEmpty
|
|
202
|
+
const { stripUnknown, stripEmpty } = options;
|
|
197
203
|
const map = {};
|
|
198
204
|
for (let [key, field] of Object.entries(arg)) {
|
|
199
205
|
if (!isExcludedField(field, options)) {
|
|
@@ -215,12 +221,6 @@ function getObjectSchema(arg, options) {
|
|
|
215
221
|
});
|
|
216
222
|
}
|
|
217
223
|
|
|
218
|
-
if (expandDotSyntax) {
|
|
219
|
-
schema = schema.options({
|
|
220
|
-
expandDotSyntax: true,
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
|
|
224
224
|
return schema;
|
|
225
225
|
} else {
|
|
226
226
|
return getSchemaForType(arg, options);
|
|
@@ -326,7 +326,7 @@ function getSchemaForTypedef(typedef, options = {}) {
|
|
|
326
326
|
schema = validateAccess('write', schema, typedef.writeAccess, options);
|
|
327
327
|
}
|
|
328
328
|
|
|
329
|
-
if (typedef.softUnique) {
|
|
329
|
+
if (typedef.softUnique && options.applyUnique) {
|
|
330
330
|
schema = schema.custom(async (value, { path, originalRoot }) => {
|
|
331
331
|
const { id } = originalRoot;
|
|
332
332
|
await assertUnique({
|
package/types/include.d.ts
CHANGED
|
@@ -11,6 +11,11 @@ export const INCLUDE_FIELD_SCHEMA: {
|
|
|
11
11
|
require(...fields: string[]): /*elided*/ any;
|
|
12
12
|
export(): any;
|
|
13
13
|
append(arg: import("@bedrockio/yada/types/object").SchemaMap | import("@bedrockio/yada/types/Schema").default): /*elided*/ any;
|
|
14
|
+
options(options?: {
|
|
15
|
+
stripEmpty?: boolean;
|
|
16
|
+
stripUnknown?: boolean;
|
|
17
|
+
preserveKeys?: boolean;
|
|
18
|
+
}): /*elided*/ any;
|
|
14
19
|
format(name: any, fn: any): /*elided*/ any;
|
|
15
20
|
toString(): any;
|
|
16
21
|
assertions: any[];
|
|
@@ -26,10 +31,10 @@ export const INCLUDE_FIELD_SCHEMA: {
|
|
|
26
31
|
message(message: any): /*elided*/ any;
|
|
27
32
|
tag(tags: any): /*elided*/ any;
|
|
28
33
|
description(description: any): /*elided*/ any;
|
|
29
|
-
options(options: any): /*elided*/ any;
|
|
30
34
|
validate(value: any, options?: {}): Promise<any>;
|
|
31
35
|
clone(meta: any): /*elided*/ any;
|
|
32
|
-
|
|
36
|
+
toJSON(extra?: any): any;
|
|
37
|
+
toOpenApi(...extra: any[]): any;
|
|
33
38
|
getAnyType(): {
|
|
34
39
|
type: string[];
|
|
35
40
|
};
|
|
@@ -41,6 +46,7 @@ export const INCLUDE_FIELD_SCHEMA: {
|
|
|
41
46
|
getNullable(): {
|
|
42
47
|
nullable: boolean;
|
|
43
48
|
};
|
|
49
|
+
getEnum(): any;
|
|
44
50
|
expandExtra(extra?: {}): {};
|
|
45
51
|
inspect(): string;
|
|
46
52
|
assertEnum(set: any, allow: any): /*elided*/ any;
|
|
@@ -50,6 +56,5 @@ export const INCLUDE_FIELD_SCHEMA: {
|
|
|
50
56
|
transform(fn: any): /*elided*/ any;
|
|
51
57
|
getSortIndex(type: any): number;
|
|
52
58
|
runAssertion(value: any, assertion: any, options?: {}): Promise<any>;
|
|
53
|
-
enumToOpenApi(): any;
|
|
54
59
|
};
|
|
55
60
|
//# sourceMappingURL=include.d.ts.map
|
package/types/include.d.ts.map
CHANGED
|
@@ -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
|
|
1
|
+
{"version":3,"file":"include.d.ts","sourceRoot":"","sources":["../src/include.js"],"names":[],"mappings":"AA2BA,gDAuEC;AAMD,uDA4BC;AAGD,yDAIC;AAaD,yEAUC;AA9ID;;;;;;;;;;kBAyFsB,CAAC;oBACD,CAAC;oBACE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;eApBT,CAAC;;;;;;;;;;;;;;;;;EAlEf"}
|
package/types/search.d.ts
CHANGED
|
@@ -8,6 +8,11 @@ export function searchValidation(options?: {}): {
|
|
|
8
8
|
require(...fields: string[]): /*elided*/ any;
|
|
9
9
|
export(): any;
|
|
10
10
|
append(arg: import("@bedrockio/yada/types/object").SchemaMap | import("@bedrockio/yada/types/Schema").default): /*elided*/ any;
|
|
11
|
+
options(options?: {
|
|
12
|
+
stripEmpty?: boolean;
|
|
13
|
+
stripUnknown?: boolean;
|
|
14
|
+
preserveKeys?: boolean;
|
|
15
|
+
}): /*elided*/ any;
|
|
11
16
|
format(name: any, fn: any): /*elided*/ any;
|
|
12
17
|
toString(): any;
|
|
13
18
|
assertions: any[];
|
|
@@ -23,10 +28,10 @@ export function searchValidation(options?: {}): {
|
|
|
23
28
|
message(message: any): /*elided*/ any;
|
|
24
29
|
tag(tags: any): /*elided*/ any;
|
|
25
30
|
description(description: any): /*elided*/ any;
|
|
26
|
-
options(options: any): /*elided*/ any;
|
|
27
31
|
validate(value: any, options?: {}): Promise<any>;
|
|
28
32
|
clone(meta: any): /*elided*/ any;
|
|
29
|
-
|
|
33
|
+
toJSON(extra?: any): any;
|
|
34
|
+
toOpenApi(...extra: any[]): any;
|
|
30
35
|
getAnyType(): {
|
|
31
36
|
type: string[];
|
|
32
37
|
};
|
|
@@ -38,6 +43,7 @@ export function searchValidation(options?: {}): {
|
|
|
38
43
|
getNullable(): {
|
|
39
44
|
nullable: boolean;
|
|
40
45
|
};
|
|
46
|
+
getEnum(): any;
|
|
41
47
|
expandExtra(extra?: {}): {};
|
|
42
48
|
inspect(): string;
|
|
43
49
|
assertEnum(set: any, allow: any): /*elided*/ any;
|
|
@@ -47,7 +53,6 @@ export function searchValidation(options?: {}): {
|
|
|
47
53
|
transform(fn: any): /*elided*/ any;
|
|
48
54
|
getSortIndex(type: any): number;
|
|
49
55
|
runAssertion(value: any, assertion: any, options?: {}): Promise<any>;
|
|
50
|
-
enumToOpenApi(): any;
|
|
51
56
|
};
|
|
52
57
|
export function exportValidation(options?: {}): {
|
|
53
58
|
filename: {
|
|
@@ -127,7 +132,8 @@ export function exportValidation(options?: {}): {
|
|
|
127
132
|
validate(value: any, options?: {}): Promise<any>;
|
|
128
133
|
clone(meta: any): /*elided*/ any;
|
|
129
134
|
append(schema: any): import("@bedrockio/yada/types/Schema").default;
|
|
130
|
-
|
|
135
|
+
toJSON(extra?: any): any;
|
|
136
|
+
toOpenApi(...extra: any[]): any;
|
|
131
137
|
getAnyType(): {
|
|
132
138
|
type: string[];
|
|
133
139
|
};
|
|
@@ -139,6 +145,7 @@ export function exportValidation(options?: {}): {
|
|
|
139
145
|
getNullable(): {
|
|
140
146
|
nullable: boolean;
|
|
141
147
|
};
|
|
148
|
+
getEnum(): any;
|
|
142
149
|
expandExtra(extra?: {}): {};
|
|
143
150
|
inspect(): string;
|
|
144
151
|
get(): void;
|
|
@@ -149,7 +156,6 @@ export function exportValidation(options?: {}): {
|
|
|
149
156
|
transform(fn: any): /*elided*/ any;
|
|
150
157
|
getSortIndex(type: any): number;
|
|
151
158
|
runAssertion(value: any, assertion: any, options?: {}): Promise<any>;
|
|
152
|
-
enumToOpenApi(): any;
|
|
153
159
|
};
|
|
154
160
|
format: {
|
|
155
161
|
required(): /*elided*/ any;
|
|
@@ -228,7 +234,8 @@ export function exportValidation(options?: {}): {
|
|
|
228
234
|
validate(value: any, options?: {}): Promise<any>;
|
|
229
235
|
clone(meta: any): /*elided*/ any;
|
|
230
236
|
append(schema: any): import("@bedrockio/yada/types/Schema").default;
|
|
231
|
-
|
|
237
|
+
toJSON(extra?: any): any;
|
|
238
|
+
toOpenApi(...extra: any[]): any;
|
|
232
239
|
getAnyType(): {
|
|
233
240
|
type: string[];
|
|
234
241
|
};
|
|
@@ -240,6 +247,7 @@ export function exportValidation(options?: {}): {
|
|
|
240
247
|
getNullable(): {
|
|
241
248
|
nullable: boolean;
|
|
242
249
|
};
|
|
250
|
+
getEnum(): any;
|
|
243
251
|
expandExtra(extra?: {}): {};
|
|
244
252
|
inspect(): string;
|
|
245
253
|
get(): void;
|
|
@@ -250,7 +258,6 @@ export function exportValidation(options?: {}): {
|
|
|
250
258
|
transform(fn: any): /*elided*/ any;
|
|
251
259
|
getSortIndex(type: any): number;
|
|
252
260
|
runAssertion(value: any, assertion: any, options?: {}): Promise<any>;
|
|
253
|
-
enumToOpenApi(): any;
|
|
254
261
|
};
|
|
255
262
|
};
|
|
256
263
|
//# sourceMappingURL=search.d.ts.map
|
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;;;;;;;;;;kBA0Fe,CAAC;oBAA+B,CAAC;oBAEtB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;eAhCvB,CAAF;;;;;;;;;;;;;;;;;EAnCD;AAED;;;;;;;;;;;;;;;;;mBAtBI,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBA1CJ,CAAF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAvDE,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBA1CJ,CAAF;;;;;;;;;;;;;;;;;;;EApBD"}
|
|
@@ -25,7 +25,8 @@ export const DATE_SCHEMA: {
|
|
|
25
25
|
validate(value: any, options?: {}): Promise<any>;
|
|
26
26
|
clone(meta: any): /*elided*/ any;
|
|
27
27
|
append(schema: any): import("@bedrockio/yada/types/Schema").default;
|
|
28
|
-
|
|
28
|
+
toJSON(extra?: any): any;
|
|
29
|
+
toOpenApi(...extra: any[]): any;
|
|
29
30
|
getAnyType(): {
|
|
30
31
|
type: string[];
|
|
31
32
|
};
|
|
@@ -37,6 +38,7 @@ export const DATE_SCHEMA: {
|
|
|
37
38
|
getNullable(): {
|
|
38
39
|
nullable: boolean;
|
|
39
40
|
};
|
|
41
|
+
getEnum(): any;
|
|
40
42
|
expandExtra(extra?: {}): {};
|
|
41
43
|
inspect(): string;
|
|
42
44
|
get(): void;
|
|
@@ -47,7 +49,6 @@ export const DATE_SCHEMA: {
|
|
|
47
49
|
transform(fn: any): /*elided*/ any;
|
|
48
50
|
getSortIndex(type: any): number;
|
|
49
51
|
runAssertion(value: any, assertion: any, options?: {}): Promise<any>;
|
|
50
|
-
enumToOpenApi(): any;
|
|
51
52
|
};
|
|
52
53
|
export const OBJECT_ID_SCHEMA: {
|
|
53
54
|
required(): /*elided*/ any;
|
|
@@ -126,7 +127,8 @@ export const OBJECT_ID_SCHEMA: {
|
|
|
126
127
|
validate(value: any, options?: {}): Promise<any>;
|
|
127
128
|
clone(meta: any): /*elided*/ any;
|
|
128
129
|
append(schema: any): import("@bedrockio/yada/types/Schema").default;
|
|
129
|
-
|
|
130
|
+
toJSON(extra?: any): any;
|
|
131
|
+
toOpenApi(...extra: any[]): any;
|
|
130
132
|
getAnyType(): {
|
|
131
133
|
type: string[];
|
|
132
134
|
};
|
|
@@ -138,6 +140,7 @@ export const OBJECT_ID_SCHEMA: {
|
|
|
138
140
|
getNullable(): {
|
|
139
141
|
nullable: boolean;
|
|
140
142
|
};
|
|
143
|
+
getEnum(): any;
|
|
141
144
|
expandExtra(extra?: {}): {};
|
|
142
145
|
inspect(): string;
|
|
143
146
|
get(): void;
|
|
@@ -148,7 +151,6 @@ export const OBJECT_ID_SCHEMA: {
|
|
|
148
151
|
transform(fn: any): /*elided*/ any;
|
|
149
152
|
getSortIndex(type: any): number;
|
|
150
153
|
runAssertion(value: any, assertion: any, options?: {}): Promise<any>;
|
|
151
|
-
enumToOpenApi(): any;
|
|
152
154
|
};
|
|
153
155
|
export const NUMBER_RANGE_SCHEMA: {
|
|
154
156
|
setup(): void;
|
|
@@ -159,6 +161,11 @@ export const NUMBER_RANGE_SCHEMA: {
|
|
|
159
161
|
require(...fields: string[]): /*elided*/ any;
|
|
160
162
|
export(): any;
|
|
161
163
|
append(arg: import("@bedrockio/yada/types/object").SchemaMap | import("@bedrockio/yada/types/Schema").default): /*elided*/ any;
|
|
164
|
+
options(options?: {
|
|
165
|
+
stripEmpty?: boolean;
|
|
166
|
+
stripUnknown?: boolean;
|
|
167
|
+
preserveKeys?: boolean;
|
|
168
|
+
}): /*elided*/ any;
|
|
162
169
|
format(name: any, fn: any): /*elided*/ any;
|
|
163
170
|
toString(): any;
|
|
164
171
|
assertions: any[];
|
|
@@ -174,10 +181,10 @@ export const NUMBER_RANGE_SCHEMA: {
|
|
|
174
181
|
message(message: any): /*elided*/ any;
|
|
175
182
|
tag(tags: any): /*elided*/ any;
|
|
176
183
|
description(description: any): /*elided*/ any;
|
|
177
|
-
options(options: any): /*elided*/ any;
|
|
178
184
|
validate(value: any, options?: {}): Promise<any>;
|
|
179
185
|
clone(meta: any): /*elided*/ any;
|
|
180
|
-
|
|
186
|
+
toJSON(extra?: any): any;
|
|
187
|
+
toOpenApi(...extra: any[]): any;
|
|
181
188
|
getAnyType(): {
|
|
182
189
|
type: string[];
|
|
183
190
|
};
|
|
@@ -189,6 +196,7 @@ export const NUMBER_RANGE_SCHEMA: {
|
|
|
189
196
|
getNullable(): {
|
|
190
197
|
nullable: boolean;
|
|
191
198
|
};
|
|
199
|
+
getEnum(): any;
|
|
192
200
|
expandExtra(extra?: {}): {};
|
|
193
201
|
inspect(): string;
|
|
194
202
|
assertEnum(set: any, allow: any): /*elided*/ any;
|
|
@@ -198,7 +206,6 @@ export const NUMBER_RANGE_SCHEMA: {
|
|
|
198
206
|
transform(fn: any): /*elided*/ any;
|
|
199
207
|
getSortIndex(type: any): number;
|
|
200
208
|
runAssertion(value: any, assertion: any, options?: {}): Promise<any>;
|
|
201
|
-
enumToOpenApi(): any;
|
|
202
209
|
};
|
|
203
210
|
export const STRING_RANGE_SCHEMA: {
|
|
204
211
|
setup(): void;
|
|
@@ -209,6 +216,11 @@ export const STRING_RANGE_SCHEMA: {
|
|
|
209
216
|
require(...fields: string[]): /*elided*/ any;
|
|
210
217
|
export(): any;
|
|
211
218
|
append(arg: import("@bedrockio/yada/types/object").SchemaMap | import("@bedrockio/yada/types/Schema").default): /*elided*/ any;
|
|
219
|
+
options(options?: {
|
|
220
|
+
stripEmpty?: boolean;
|
|
221
|
+
stripUnknown?: boolean;
|
|
222
|
+
preserveKeys?: boolean;
|
|
223
|
+
}): /*elided*/ any;
|
|
212
224
|
format(name: any, fn: any): /*elided*/ any;
|
|
213
225
|
toString(): any;
|
|
214
226
|
assertions: any[];
|
|
@@ -224,10 +236,10 @@ export const STRING_RANGE_SCHEMA: {
|
|
|
224
236
|
message(message: any): /*elided*/ any;
|
|
225
237
|
tag(tags: any): /*elided*/ any;
|
|
226
238
|
description(description: any): /*elided*/ any;
|
|
227
|
-
options(options: any): /*elided*/ any;
|
|
228
239
|
validate(value: any, options?: {}): Promise<any>;
|
|
229
240
|
clone(meta: any): /*elided*/ any;
|
|
230
|
-
|
|
241
|
+
toJSON(extra?: any): any;
|
|
242
|
+
toOpenApi(...extra: any[]): any;
|
|
231
243
|
getAnyType(): {
|
|
232
244
|
type: string[];
|
|
233
245
|
};
|
|
@@ -239,6 +251,7 @@ export const STRING_RANGE_SCHEMA: {
|
|
|
239
251
|
getNullable(): {
|
|
240
252
|
nullable: boolean;
|
|
241
253
|
};
|
|
254
|
+
getEnum(): any;
|
|
242
255
|
expandExtra(extra?: {}): {};
|
|
243
256
|
inspect(): string;
|
|
244
257
|
assertEnum(set: any, allow: any): /*elided*/ any;
|
|
@@ -248,7 +261,6 @@ export const STRING_RANGE_SCHEMA: {
|
|
|
248
261
|
transform(fn: any): /*elided*/ any;
|
|
249
262
|
getSortIndex(type: any): number;
|
|
250
263
|
runAssertion(value: any, assertion: any, options?: {}): Promise<any>;
|
|
251
|
-
enumToOpenApi(): any;
|
|
252
264
|
};
|
|
253
265
|
export const DATE_RANGE_SCHEMA: {
|
|
254
266
|
setup(): void;
|
|
@@ -259,6 +271,11 @@ export const DATE_RANGE_SCHEMA: {
|
|
|
259
271
|
require(...fields: string[]): /*elided*/ any;
|
|
260
272
|
export(): any;
|
|
261
273
|
append(arg: import("@bedrockio/yada/types/object").SchemaMap | import("@bedrockio/yada/types/Schema").default): /*elided*/ any;
|
|
274
|
+
options(options?: {
|
|
275
|
+
stripEmpty?: boolean;
|
|
276
|
+
stripUnknown?: boolean;
|
|
277
|
+
preserveKeys?: boolean;
|
|
278
|
+
}): /*elided*/ any;
|
|
262
279
|
format(name: any, fn: any): /*elided*/ any;
|
|
263
280
|
toString(): any;
|
|
264
281
|
assertions: any[];
|
|
@@ -274,10 +291,10 @@ export const DATE_RANGE_SCHEMA: {
|
|
|
274
291
|
message(message: any): /*elided*/ any;
|
|
275
292
|
tag(tags: any): /*elided*/ any;
|
|
276
293
|
description(description: any): /*elided*/ any;
|
|
277
|
-
options(options: any): /*elided*/ any;
|
|
278
294
|
validate(value: any, options?: {}): Promise<any>;
|
|
279
295
|
clone(meta: any): /*elided*/ any;
|
|
280
|
-
|
|
296
|
+
toJSON(extra?: any): any;
|
|
297
|
+
toOpenApi(...extra: any[]): any;
|
|
281
298
|
getAnyType(): {
|
|
282
299
|
type: string[];
|
|
283
300
|
};
|
|
@@ -289,6 +306,7 @@ export const DATE_RANGE_SCHEMA: {
|
|
|
289
306
|
getNullable(): {
|
|
290
307
|
nullable: boolean;
|
|
291
308
|
};
|
|
309
|
+
getEnum(): any;
|
|
292
310
|
expandExtra(extra?: {}): {};
|
|
293
311
|
inspect(): string;
|
|
294
312
|
assertEnum(set: any, allow: any): /*elided*/ any;
|
|
@@ -298,7 +316,6 @@ export const DATE_RANGE_SCHEMA: {
|
|
|
298
316
|
transform(fn: any): /*elided*/ any;
|
|
299
317
|
getSortIndex(type: any): number;
|
|
300
318
|
runAssertion(value: any, assertion: any, options?: {}): Promise<any>;
|
|
301
|
-
enumToOpenApi(): any;
|
|
302
319
|
};
|
|
303
320
|
export const REFERENCE_SCHEMA: import("@bedrockio/yada/types/Schema").default;
|
|
304
321
|
//# sourceMappingURL=validation-schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation-schemas.d.ts","sourceRoot":"","sources":["../src/validation-schemas.js"],"names":[],"mappings":"AAQA
|
|
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;;;;;;;;;;kBAkFwU,CAAC;oBAA+B,CAAC;oBAA+B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;eARzV,CAAC;;;;;;;;;;;;;;;;;EAhE5C;AAEL;;;;;;;;;;kBAsEwU,CAAC;oBAA+B,CAAC;oBAA+B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;eARzV,CAAC;;;;;;;;;;;;;;;;;EApD5C;AAEL;;;;;;;;;;kBA0DwU,CAAC;oBAA+B,CAAC;oBAA+B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;eARzV,CAAC;;;;;;;;;;;;;;;;;EAhB5C;AAEL,8EAqBK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.js"],"names":[],"mappings":"AA0DA,kDAEC;AAED,oEA0FC;AAsBD,wEAiBC;AAwSD;;;EAEC;AAED;;;EAOC"}
|