@bedrockio/model 0.14.3 → 0.15.0
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 +10 -0
- package/dist/cjs/include.js +0 -6
- package/dist/cjs/validation-schemas.js +7 -1
- package/dist/cjs/validation.js +14 -16
- package/package.json +1 -1
- package/src/include.js +0 -10
- package/src/validation-schemas.js +8 -0
- package/src/validation.js +13 -14
- package/types/include.d.ts +0 -61
- package/types/include.d.ts.map +1 -1
- package/types/validation-schemas.d.ts +61 -0
- package/types/validation-schemas.d.ts.map +1 -1
- package/types/validation.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## 0.15.0
|
|
2
|
+
|
|
3
|
+
- Tagged outer includes schema.
|
|
4
|
+
- `allowInclude` -> `allowIncludes`.
|
|
5
|
+
- Inclues not allowed on `getUpdateValidation` by default (revert of `0.14.1`).
|
|
6
|
+
|
|
7
|
+
## 0.14.4
|
|
8
|
+
|
|
9
|
+
- Fixed bug with nested includes in update validation.
|
|
10
|
+
|
|
1
11
|
## 0.14.3
|
|
2
12
|
|
|
3
13
|
- Allow keyword search on number fields.
|
package/dist/cjs/include.js
CHANGED
|
@@ -3,12 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.INCLUDE_FIELD_SCHEMA = void 0;
|
|
7
6
|
exports.applyInclude = applyInclude;
|
|
8
7
|
exports.checkSelects = checkSelects;
|
|
9
8
|
exports.getDocumentParams = getDocumentParams;
|
|
10
9
|
exports.getParams = getParams;
|
|
11
|
-
var _yada = _interopRequireDefault(require("@bedrockio/yada"));
|
|
12
10
|
var _lodash = require("lodash");
|
|
13
11
|
var _mongoose = _interopRequireDefault(require("mongoose"));
|
|
14
12
|
var _const = require("./const");
|
|
@@ -24,10 +22,6 @@ _mongoose.default.Query.prototype.include = function include(arg) {
|
|
|
24
22
|
}
|
|
25
23
|
return this;
|
|
26
24
|
};
|
|
27
|
-
const DESCRIPTION = 'Field to be selected or populated.';
|
|
28
|
-
const INCLUDE_FIELD_SCHEMA = exports.INCLUDE_FIELD_SCHEMA = _yada.default.object({
|
|
29
|
-
include: _yada.default.allow(_yada.default.string().description(DESCRIPTION), _yada.default.array(_yada.default.string().description(DESCRIPTION)))
|
|
30
|
-
});
|
|
31
25
|
function applyInclude(schema) {
|
|
32
26
|
// Query Includes
|
|
33
27
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.STRING_RANGE_SCHEMA = exports.REFERENCE_SCHEMA = exports.OBJECT_ID_SCHEMA = exports.NUMBER_RANGE_SCHEMA = exports.DATE_SCHEMA = exports.DATE_RANGE_SCHEMA = void 0;
|
|
6
|
+
exports.STRING_RANGE_SCHEMA = exports.REFERENCE_SCHEMA = exports.OBJECT_ID_SCHEMA = exports.NUMBER_RANGE_SCHEMA = exports.INCLUDE_FIELD_SCHEMA = exports.DATE_SCHEMA = exports.DATE_RANGE_SCHEMA = void 0;
|
|
7
7
|
var _yada = _interopRequireDefault(require("@bedrockio/yada"));
|
|
8
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
const DATE_TAGS = {
|
|
@@ -66,4 +66,10 @@ const REFERENCE_SCHEMA = exports.REFERENCE_SCHEMA = _yada.default.allow(OBJECT_I
|
|
|
66
66
|
A 24 character hexadecimal string representing a Mongo [ObjectId](https://bit.ly/3YPtGlU).
|
|
67
67
|
An object with an \`id\` field may also be passed, which will be converted into a string.
|
|
68
68
|
`.trim()
|
|
69
|
+
});
|
|
70
|
+
const INCLUDE_FIELD_SCHEMA = exports.INCLUDE_FIELD_SCHEMA = _yada.default.object({
|
|
71
|
+
include: _yada.default.allow(_yada.default.string(), _yada.default.array(_yada.default.string())).tag({
|
|
72
|
+
'x-schema': 'Includes',
|
|
73
|
+
'x-description': 'A `string` or `array` of fields to be selected or populated using [includes syntax](http://bit.ly/4q2viXl).'
|
|
74
|
+
})
|
|
69
75
|
});
|
package/dist/cjs/validation.js
CHANGED
|
@@ -10,10 +10,8 @@ exports.getTupleValidator = getTupleValidator;
|
|
|
10
10
|
exports.getValidationSchema = getValidationSchema;
|
|
11
11
|
var _yada = _interopRequireDefault(require("@bedrockio/yada"));
|
|
12
12
|
var _lodash = require("lodash");
|
|
13
|
-
var _mongoose = _interopRequireDefault(require("mongoose"));
|
|
14
13
|
var _access = require("./access");
|
|
15
14
|
var _errors = require("./errors");
|
|
16
|
-
var _include = require("./include");
|
|
17
15
|
var _search = require("./search");
|
|
18
16
|
var _softDelete = require("./soft-delete");
|
|
19
17
|
var _utils = require("./utils");
|
|
@@ -59,12 +57,12 @@ function addValidators(schemas) {
|
|
|
59
57
|
}
|
|
60
58
|
function applyValidation(schema, definition) {
|
|
61
59
|
schema.static('getCreateValidation', function getCreateValidation(options) {
|
|
62
|
-
return
|
|
60
|
+
return getSchemaForMongoose(schema, {
|
|
63
61
|
model: this,
|
|
64
62
|
stripEmpty: true,
|
|
65
63
|
applyUnique: true,
|
|
66
64
|
stripDeleted: true,
|
|
67
|
-
|
|
65
|
+
allowIncludes: false,
|
|
68
66
|
stripTimestamps: true,
|
|
69
67
|
allowDefaultTags: true,
|
|
70
68
|
allowExpandedRefs: true,
|
|
@@ -73,7 +71,7 @@ function applyValidation(schema, definition) {
|
|
|
73
71
|
});
|
|
74
72
|
});
|
|
75
73
|
schema.static('getUpdateValidation', function getUpdateValidation(options) {
|
|
76
|
-
return
|
|
74
|
+
return getSchemaForMongoose(schema, {
|
|
77
75
|
model: this,
|
|
78
76
|
allowNull: true,
|
|
79
77
|
applyUnique: true,
|
|
@@ -81,7 +79,7 @@ function applyValidation(schema, definition) {
|
|
|
81
79
|
stripUnknown: true,
|
|
82
80
|
stripDeleted: true,
|
|
83
81
|
allowFlatKeys: true,
|
|
84
|
-
|
|
82
|
+
allowIncludes: false,
|
|
85
83
|
stripTimestamps: true,
|
|
86
84
|
allowExpandedRefs: true,
|
|
87
85
|
requireWriteAccess: true,
|
|
@@ -96,15 +94,15 @@ function applyValidation(schema, definition) {
|
|
|
96
94
|
formats,
|
|
97
95
|
...rest
|
|
98
96
|
} = options;
|
|
99
|
-
let validation =
|
|
97
|
+
let validation = getSchemaForMongoose(schema, {
|
|
100
98
|
model: this,
|
|
101
99
|
allowNull: true,
|
|
102
100
|
stripEmpty: true,
|
|
103
101
|
allowSearch: true,
|
|
104
102
|
skipRequired: true,
|
|
105
|
-
allowInclude: true,
|
|
106
103
|
stripDeleted: true,
|
|
107
104
|
allowFlatKeys: true,
|
|
105
|
+
allowIncludes: true,
|
|
108
106
|
unwindArrayFields: true,
|
|
109
107
|
requireReadAccess: true,
|
|
110
108
|
...rest
|
|
@@ -129,10 +127,10 @@ function applyValidation(schema, definition) {
|
|
|
129
127
|
});
|
|
130
128
|
});
|
|
131
129
|
schema.static('getIncludeValidation', function getIncludeValidation() {
|
|
132
|
-
return
|
|
130
|
+
return _validationSchemas.INCLUDE_FIELD_SCHEMA;
|
|
133
131
|
});
|
|
134
132
|
schema.static('getBaseSchema', function getBaseSchema() {
|
|
135
|
-
return
|
|
133
|
+
return getSchemaForMongoose(schema, {
|
|
136
134
|
model: this,
|
|
137
135
|
stripDeleted: true,
|
|
138
136
|
requireReadAccess: true
|
|
@@ -142,7 +140,7 @@ function applyValidation(schema, definition) {
|
|
|
142
140
|
|
|
143
141
|
// Yada schemas
|
|
144
142
|
|
|
145
|
-
function
|
|
143
|
+
function getSchemaForMongoose(schema, options = {}) {
|
|
146
144
|
const fields = getMongooseFields(schema, options);
|
|
147
145
|
return getValidationSchema(fields, options);
|
|
148
146
|
}
|
|
@@ -164,12 +162,12 @@ function getMongooseFields(schema, options) {
|
|
|
164
162
|
// Exported for testing
|
|
165
163
|
function getValidationSchema(attributes, options = {}) {
|
|
166
164
|
const {
|
|
167
|
-
|
|
165
|
+
allowIncludes,
|
|
168
166
|
updateAccess
|
|
169
167
|
} = options;
|
|
170
168
|
let schema = getObjectSchema(attributes, options);
|
|
171
|
-
if (
|
|
172
|
-
schema = schema.append(
|
|
169
|
+
if (allowIncludes) {
|
|
170
|
+
schema = schema.append(_validationSchemas.INCLUDE_FIELD_SCHEMA);
|
|
173
171
|
}
|
|
174
172
|
if (updateAccess) {
|
|
175
173
|
return validateAccess('update', schema, updateAccess, {
|
|
@@ -182,7 +180,7 @@ function getValidationSchema(attributes, options = {}) {
|
|
|
182
180
|
function getObjectSchema(arg, options) {
|
|
183
181
|
if ((0, _utils.isSchemaTypedef)(arg)) {
|
|
184
182
|
return getSchemaForTypedef(arg, options);
|
|
185
|
-
} else if (
|
|
183
|
+
} else if ((0, _utils.isMongooseSchema)(arg)) {
|
|
186
184
|
return getObjectSchema(arg.obj, options);
|
|
187
185
|
} else if (Array.isArray(arg)) {
|
|
188
186
|
return getArraySchema(arg, options);
|
|
@@ -244,7 +242,7 @@ function getSchemaForTypedef(typedef, options = {}) {
|
|
|
244
242
|
} = typedef;
|
|
245
243
|
let schema;
|
|
246
244
|
if ((0, _utils.isMongooseSchema)(type)) {
|
|
247
|
-
schema =
|
|
245
|
+
schema = getObjectSchema(type, options);
|
|
248
246
|
} else if (Array.isArray(type)) {
|
|
249
247
|
schema = getArraySchema(type, options);
|
|
250
248
|
} else if (typeof type === 'object') {
|
package/package.json
CHANGED
package/src/include.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import yd from '@bedrockio/yada';
|
|
2
1
|
import { escapeRegExp } from 'lodash';
|
|
3
2
|
import mongoose from 'mongoose';
|
|
4
3
|
|
|
@@ -16,15 +15,6 @@ mongoose.Query.prototype.include = function include(arg) {
|
|
|
16
15
|
return this;
|
|
17
16
|
};
|
|
18
17
|
|
|
19
|
-
const DESCRIPTION = 'Field to be selected or populated.';
|
|
20
|
-
|
|
21
|
-
export const INCLUDE_FIELD_SCHEMA = yd.object({
|
|
22
|
-
include: yd.allow(
|
|
23
|
-
yd.string().description(DESCRIPTION),
|
|
24
|
-
yd.array(yd.string().description(DESCRIPTION)),
|
|
25
|
-
),
|
|
26
|
-
});
|
|
27
|
-
|
|
28
18
|
export function applyInclude(schema) {
|
|
29
19
|
// Query Includes
|
|
30
20
|
|
|
@@ -100,3 +100,11 @@ A 24 character hexadecimal string representing a Mongo [ObjectId](https://bit.ly
|
|
|
100
100
|
An object with an \`id\` field may also be passed, which will be converted into a string.
|
|
101
101
|
`.trim(),
|
|
102
102
|
});
|
|
103
|
+
|
|
104
|
+
export const INCLUDE_FIELD_SCHEMA = yd.object({
|
|
105
|
+
include: yd.allow(yd.string(), yd.array(yd.string())).tag({
|
|
106
|
+
'x-schema': 'Includes',
|
|
107
|
+
'x-description':
|
|
108
|
+
'A `string` or `array` of fields to be selected or populated using [includes syntax](http://bit.ly/4q2viXl).',
|
|
109
|
+
}),
|
|
110
|
+
});
|
package/src/validation.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import yd from '@bedrockio/yada';
|
|
2
2
|
import { get, lowerFirst, omit } from 'lodash';
|
|
3
|
-
import mongoose from 'mongoose';
|
|
4
3
|
|
|
5
4
|
import { hasAccess } from './access';
|
|
6
5
|
import { ImplementationError, PermissionsError } from './errors';
|
|
7
|
-
import { INCLUDE_FIELD_SCHEMA } from './include';
|
|
8
6
|
import { exportValidation, searchValidation } from './search';
|
|
9
7
|
import { assertUnique } from './soft-delete';
|
|
10
8
|
import { isMongooseSchema, isSchemaTypedef } from './utils';
|
|
9
|
+
import { INCLUDE_FIELD_SCHEMA } from './validation-schemas';
|
|
11
10
|
|
|
12
11
|
import {
|
|
13
12
|
DATE_RANGE_SCHEMA,
|
|
@@ -62,12 +61,12 @@ export function addValidators(schemas) {
|
|
|
62
61
|
|
|
63
62
|
export function applyValidation(schema, definition) {
|
|
64
63
|
schema.static('getCreateValidation', function getCreateValidation(options) {
|
|
65
|
-
return
|
|
64
|
+
return getSchemaForMongoose(schema, {
|
|
66
65
|
model: this,
|
|
67
66
|
stripEmpty: true,
|
|
68
67
|
applyUnique: true,
|
|
69
68
|
stripDeleted: true,
|
|
70
|
-
|
|
69
|
+
allowIncludes: false,
|
|
71
70
|
stripTimestamps: true,
|
|
72
71
|
allowDefaultTags: true,
|
|
73
72
|
allowExpandedRefs: true,
|
|
@@ -77,7 +76,7 @@ export function applyValidation(schema, definition) {
|
|
|
77
76
|
});
|
|
78
77
|
|
|
79
78
|
schema.static('getUpdateValidation', function getUpdateValidation(options) {
|
|
80
|
-
return
|
|
79
|
+
return getSchemaForMongoose(schema, {
|
|
81
80
|
model: this,
|
|
82
81
|
allowNull: true,
|
|
83
82
|
applyUnique: true,
|
|
@@ -85,7 +84,7 @@ export function applyValidation(schema, definition) {
|
|
|
85
84
|
stripUnknown: true,
|
|
86
85
|
stripDeleted: true,
|
|
87
86
|
allowFlatKeys: true,
|
|
88
|
-
|
|
87
|
+
allowIncludes: false,
|
|
89
88
|
stripTimestamps: true,
|
|
90
89
|
allowExpandedRefs: true,
|
|
91
90
|
requireWriteAccess: true,
|
|
@@ -99,15 +98,15 @@ export function applyValidation(schema, definition) {
|
|
|
99
98
|
function getSearchValidation(options = {}) {
|
|
100
99
|
const { allowExport, defaults, formats, ...rest } = options;
|
|
101
100
|
|
|
102
|
-
let validation =
|
|
101
|
+
let validation = getSchemaForMongoose(schema, {
|
|
103
102
|
model: this,
|
|
104
103
|
allowNull: true,
|
|
105
104
|
stripEmpty: true,
|
|
106
105
|
allowSearch: true,
|
|
107
106
|
skipRequired: true,
|
|
108
|
-
allowInclude: true,
|
|
109
107
|
stripDeleted: true,
|
|
110
108
|
allowFlatKeys: true,
|
|
109
|
+
allowIncludes: true,
|
|
111
110
|
unwindArrayFields: true,
|
|
112
111
|
requireReadAccess: true,
|
|
113
112
|
...rest,
|
|
@@ -146,7 +145,7 @@ export function applyValidation(schema, definition) {
|
|
|
146
145
|
});
|
|
147
146
|
|
|
148
147
|
schema.static('getBaseSchema', function getBaseSchema() {
|
|
149
|
-
return
|
|
148
|
+
return getSchemaForMongoose(schema, {
|
|
150
149
|
model: this,
|
|
151
150
|
stripDeleted: true,
|
|
152
151
|
requireReadAccess: true,
|
|
@@ -156,7 +155,7 @@ export function applyValidation(schema, definition) {
|
|
|
156
155
|
|
|
157
156
|
// Yada schemas
|
|
158
157
|
|
|
159
|
-
function
|
|
158
|
+
function getSchemaForMongoose(schema, options = {}) {
|
|
160
159
|
const fields = getMongooseFields(schema, options);
|
|
161
160
|
return getValidationSchema(fields, options);
|
|
162
161
|
}
|
|
@@ -175,11 +174,11 @@ function getMongooseFields(schema, options) {
|
|
|
175
174
|
|
|
176
175
|
// Exported for testing
|
|
177
176
|
export function getValidationSchema(attributes, options = {}) {
|
|
178
|
-
const {
|
|
177
|
+
const { allowIncludes, updateAccess } = options;
|
|
179
178
|
|
|
180
179
|
let schema = getObjectSchema(attributes, options);
|
|
181
180
|
|
|
182
|
-
if (
|
|
181
|
+
if (allowIncludes) {
|
|
183
182
|
schema = schema.append(INCLUDE_FIELD_SCHEMA);
|
|
184
183
|
}
|
|
185
184
|
|
|
@@ -196,7 +195,7 @@ export function getValidationSchema(attributes, options = {}) {
|
|
|
196
195
|
function getObjectSchema(arg, options) {
|
|
197
196
|
if (isSchemaTypedef(arg)) {
|
|
198
197
|
return getSchemaForTypedef(arg, options);
|
|
199
|
-
} else if (arg
|
|
198
|
+
} else if (isMongooseSchema(arg)) {
|
|
200
199
|
return getObjectSchema(arg.obj, options);
|
|
201
200
|
} else if (Array.isArray(arg)) {
|
|
202
201
|
return getArraySchema(arg, options);
|
|
@@ -261,7 +260,7 @@ function getSchemaForTypedef(typedef, options = {}) {
|
|
|
261
260
|
let schema;
|
|
262
261
|
|
|
263
262
|
if (isMongooseSchema(type)) {
|
|
264
|
-
schema =
|
|
263
|
+
schema = getObjectSchema(type, options);
|
|
265
264
|
} else if (Array.isArray(type)) {
|
|
266
265
|
schema = getArraySchema(type, options);
|
|
267
266
|
} else if (typeof type === 'object') {
|
package/types/include.d.ts
CHANGED
|
@@ -2,65 +2,4 @@ export function applyInclude(schema: any): void;
|
|
|
2
2
|
export function checkSelects(doc: any, ret: any): void;
|
|
3
3
|
export function getParams(modelName: any, arg: any): any;
|
|
4
4
|
export function getDocumentParams(doc: any, arg: any, options?: {}): any;
|
|
5
|
-
export const INCLUDE_FIELD_SCHEMA: {
|
|
6
|
-
setup(): void;
|
|
7
|
-
get(path?: string | Array<string>): any;
|
|
8
|
-
unwind(path?: string | Array<string>): any;
|
|
9
|
-
pick(...names?: string[]): /*elided*/ any;
|
|
10
|
-
omit(...names?: string[]): /*elided*/ any;
|
|
11
|
-
require(...fields: string[]): /*elided*/ any;
|
|
12
|
-
requireAll(): /*elided*/ any;
|
|
13
|
-
requireAllWithin(): /*elided*/ any;
|
|
14
|
-
export(): any;
|
|
15
|
-
append(arg: import("@bedrockio/yada/types/object").SchemaMap | import("@bedrockio/yada/types/Schema").default): /*elided*/ any;
|
|
16
|
-
options(options?: {
|
|
17
|
-
stripEmpty?: boolean;
|
|
18
|
-
stripUnknown?: boolean;
|
|
19
|
-
allowFlatKeys?: boolean;
|
|
20
|
-
expandFlatKeys?: boolean;
|
|
21
|
-
}): /*elided*/ any;
|
|
22
|
-
format(name: any, fn: any): /*elided*/ any;
|
|
23
|
-
toString(): any;
|
|
24
|
-
assertions: any[];
|
|
25
|
-
meta: {};
|
|
26
|
-
required(): /*elided*/ any;
|
|
27
|
-
default(arg: any): /*elided*/ any;
|
|
28
|
-
custom(fn: Function): /*elided*/ any;
|
|
29
|
-
missing(fn: Function): /*elided*/ any;
|
|
30
|
-
strip(strip: any): /*elided*/ any;
|
|
31
|
-
allow(...set: any[]): /*elided*/ any;
|
|
32
|
-
reject(...set: any[]): /*elided*/ any;
|
|
33
|
-
nullable(): /*elided*/ any;
|
|
34
|
-
message(message: any): /*elided*/ any;
|
|
35
|
-
tag(tags: any): /*elided*/ any;
|
|
36
|
-
description(description: any): /*elided*/ any;
|
|
37
|
-
validate(value: any, options?: {}): Promise<any>;
|
|
38
|
-
clone(meta: any): /*elided*/ any;
|
|
39
|
-
toJSON(extra?: any): any;
|
|
40
|
-
toOpenApi(...extra: any[]): any;
|
|
41
|
-
getAnyType(): {
|
|
42
|
-
type: string[];
|
|
43
|
-
};
|
|
44
|
-
getFormat(): {
|
|
45
|
-
format: any;
|
|
46
|
-
};
|
|
47
|
-
getDefault(): {
|
|
48
|
-
default?: undefined;
|
|
49
|
-
} | {
|
|
50
|
-
default: any;
|
|
51
|
-
};
|
|
52
|
-
getNullable(): {
|
|
53
|
-
nullable: boolean;
|
|
54
|
-
};
|
|
55
|
-
getEnum(): any;
|
|
56
|
-
expandExtra(extra?: {}): {};
|
|
57
|
-
inspect(): string;
|
|
58
|
-
assertEnum(set: any, allow: any): /*elided*/ any;
|
|
59
|
-
assert(type: any, fn: any): /*elided*/ any;
|
|
60
|
-
pushAssertion(assertion: any): void;
|
|
61
|
-
canSkipAssertion(value: any, assertion: any, options: any): any;
|
|
62
|
-
transform(fn: any): /*elided*/ any;
|
|
63
|
-
getSortIndex(type: any): number;
|
|
64
|
-
runAssertion(value: any, assertion: any, options?: {}): Promise<any>;
|
|
65
|
-
};
|
|
66
5
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"include.d.ts","sourceRoot":"","sources":["../src/include.js"],"names":[],"mappings":"AAiBA,gDAuEC;AAMD,uDA4BC;AAGD,yDAIC;AAaD,yEAUC"}
|
|
@@ -344,4 +344,65 @@ export const DATE_RANGE_SCHEMA: {
|
|
|
344
344
|
runAssertion(value: any, assertion: any, options?: {}): Promise<any>;
|
|
345
345
|
};
|
|
346
346
|
export const REFERENCE_SCHEMA: import("@bedrockio/yada/types/Schema").default;
|
|
347
|
+
export const INCLUDE_FIELD_SCHEMA: {
|
|
348
|
+
setup(): void;
|
|
349
|
+
get(path?: string | Array<string>): any;
|
|
350
|
+
unwind(path?: string | Array<string>): any;
|
|
351
|
+
pick(...names?: string[]): /*elided*/ any;
|
|
352
|
+
omit(...names?: string[]): /*elided*/ any;
|
|
353
|
+
require(...fields: string[]): /*elided*/ any;
|
|
354
|
+
requireAll(): /*elided*/ any;
|
|
355
|
+
requireAllWithin(): /*elided*/ any;
|
|
356
|
+
export(): any;
|
|
357
|
+
append(arg: import("@bedrockio/yada/types/object").SchemaMap | import("@bedrockio/yada/types/Schema").default): /*elided*/ any;
|
|
358
|
+
options(options?: {
|
|
359
|
+
stripEmpty?: boolean;
|
|
360
|
+
stripUnknown?: boolean;
|
|
361
|
+
allowFlatKeys?: boolean;
|
|
362
|
+
expandFlatKeys?: boolean;
|
|
363
|
+
}): /*elided*/ any;
|
|
364
|
+
format(name: any, fn: any): /*elided*/ any;
|
|
365
|
+
toString(): any;
|
|
366
|
+
assertions: any[];
|
|
367
|
+
meta: {};
|
|
368
|
+
required(): /*elided*/ any;
|
|
369
|
+
default(arg: any): /*elided*/ any;
|
|
370
|
+
custom(fn: Function): /*elided*/ any;
|
|
371
|
+
missing(fn: Function): /*elided*/ any;
|
|
372
|
+
strip(strip: any): /*elided*/ any;
|
|
373
|
+
allow(...set: any[]): /*elided*/ any;
|
|
374
|
+
reject(...set: any[]): /*elided*/ any;
|
|
375
|
+
nullable(): /*elided*/ any;
|
|
376
|
+
message(message: any): /*elided*/ any;
|
|
377
|
+
tag(tags: any): /*elided*/ any;
|
|
378
|
+
description(description: any): /*elided*/ any;
|
|
379
|
+
validate(value: any, options?: {}): Promise<any>;
|
|
380
|
+
clone(meta: any): /*elided*/ any;
|
|
381
|
+
toJSON(extra?: any): any;
|
|
382
|
+
toOpenApi(...extra: any[]): any;
|
|
383
|
+
getAnyType(): {
|
|
384
|
+
type: string[];
|
|
385
|
+
};
|
|
386
|
+
getFormat(): {
|
|
387
|
+
format: any;
|
|
388
|
+
};
|
|
389
|
+
getDefault(): {
|
|
390
|
+
default?: undefined;
|
|
391
|
+
} | {
|
|
392
|
+
default: any;
|
|
393
|
+
};
|
|
394
|
+
getNullable(): {
|
|
395
|
+
nullable: boolean;
|
|
396
|
+
};
|
|
397
|
+
getEnum(): any;
|
|
398
|
+
expandExtra(extra?: {}): {};
|
|
399
|
+
inspect(): string;
|
|
400
|
+
assertEnum(set: any, allow: any): /*elided*/ any;
|
|
401
|
+
assert(type: any, fn: any): /*elided*/ any;
|
|
402
|
+
pushAssertion(assertion: any): void;
|
|
403
|
+
canSkipAssertion(value: any, assertion: any, options: any): any;
|
|
404
|
+
transform(fn: any): /*elided*/ any;
|
|
405
|
+
getSortIndex(type: any): number;
|
|
406
|
+
runAssertion(value: any, assertion: any, options?: {}): Promise<any>;
|
|
407
|
+
};
|
|
347
408
|
//# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAwFsB,CAAC;;;;;;;;;;;;;;;;;;;EAxFmC;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;;;
|
|
1
|
+
{"version":3,"file":"validation-schemas.d.ts","sourceRoot":"","sources":["../src/validation-schemas.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAwFsB,CAAC;;;;;;;;;;;;;;;;;;;EAxFmC;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;;;mBAW2D,CAAC;yBAAoC,CAAC;0BAAqC,CAAC;yBAAoC,CAAC;sBAAiC,CAAC;yBAAoC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAdrR,CAAC;;;;;;;;;;;;;;;;;;;EA9ElB;AAEL;;;;;;;;;;;;kBA0Fob,CAAC;oBAA+B,CAAC;qBAAgC,CAAC;sBAAiC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAdlgB,CAAC;;;;;;;;;;;;;;;;;EAlElB;AAEL;;;;;;;;;;;;kBA8Eob,CAAC;oBAA+B,CAAC;qBAAgC,CAAC;sBAAiC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAdlgB,CAAC;;;;;;;;;;;;;;;;;EAtDlB;AAEL;;;;;;;;;;;;kBAkEob,CAAC;oBAA+B,CAAC;qBAAgC,CAAC;sBAAiC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAdlgB,CAAC;;;;;;;;;;;;;;;;;EAlBlB;AAEL,8EAqBK;AAEL;;;;;;;;;;;;kBAOob,CAAC;oBAA+B,CAAC;qBAAgC,CAAC;sBAAiC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAdlgB,CAAC;;;;;;;;;;;;;;;;;EAapB"}
|
|
@@ -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":"AAyDA,kDAEC;AAED,oEA4FC;AAsBD,wEAiBC;AA8SD;;;EAEC;AAED;;;EAOC"}
|