@bedrockio/model 0.1.3 → 0.1.5
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/cjs/search.js +2 -2
- package/dist/cjs/validation.js +17 -6
- package/package.json +3 -2
- package/src/search.js +2 -2
- package/src/validation.js +12 -4
- package/types/schema.d.ts +3 -3
- package/types/search.d.ts +34 -298
- package/types/search.d.ts.map +1 -1
- package/types/validation.d.ts.map +1 -1
- package/yarn-error.log +6270 -0
package/dist/cjs/search.js
CHANGED
|
@@ -84,7 +84,7 @@ function searchValidation(definition, options = {}) {
|
|
|
84
84
|
sort,
|
|
85
85
|
...rest
|
|
86
86
|
} = options;
|
|
87
|
-
return {
|
|
87
|
+
return _yada.default.object({
|
|
88
88
|
ids: _yada.default.array(_validation.OBJECT_ID_SCHEMA),
|
|
89
89
|
keyword: _yada.default.string().description('A keyword to perform a text search against.'),
|
|
90
90
|
include: _yada.default.string().description('Fields to be selected or populated.'),
|
|
@@ -92,7 +92,7 @@ function searchValidation(definition, options = {}) {
|
|
|
92
92
|
sort: _yada.default.allow(SORT_SCHEMA, _yada.default.array(SORT_SCHEMA)).default(sort),
|
|
93
93
|
limit: _yada.default.number().positive().default(limit).description('Limits the number of results.'),
|
|
94
94
|
...rest
|
|
95
|
-
};
|
|
95
|
+
});
|
|
96
96
|
}
|
|
97
97
|
function validateDefinition(definition) {
|
|
98
98
|
if (Array.isArray(definition.search)) {
|
package/dist/cjs/validation.js
CHANGED
|
@@ -104,6 +104,7 @@ function applyValidation(schema, definition) {
|
|
|
104
104
|
return getSchemaFromMongoose(schema, {
|
|
105
105
|
allowSearch: true,
|
|
106
106
|
skipRequired: true,
|
|
107
|
+
expandDotSyntax: true,
|
|
107
108
|
unwindArrayFields: true,
|
|
108
109
|
requireReadAccess: true,
|
|
109
110
|
appendSchema: (0, _search.searchValidation)(definition, searchOptions),
|
|
@@ -135,8 +136,10 @@ function getValidationSchema(attributes, options = {}) {
|
|
|
135
136
|
} = options;
|
|
136
137
|
let schema = getObjectSchema(attributes, options);
|
|
137
138
|
if (assertUniqueOptions) {
|
|
138
|
-
schema =
|
|
139
|
-
|
|
139
|
+
schema = schema.custom(async (obj, {
|
|
140
|
+
root
|
|
141
|
+
}) => {
|
|
142
|
+
await (0, _softDelete.assertUnique)(root, {
|
|
140
143
|
model: options.model,
|
|
141
144
|
...assertUniqueOptions
|
|
142
145
|
});
|
|
@@ -148,9 +151,6 @@ function getValidationSchema(attributes, options = {}) {
|
|
|
148
151
|
return schema;
|
|
149
152
|
}
|
|
150
153
|
function getObjectSchema(arg, options) {
|
|
151
|
-
const {
|
|
152
|
-
stripUnknown
|
|
153
|
-
} = options;
|
|
154
154
|
if ((0, _utils.isSchemaTypedef)(arg)) {
|
|
155
155
|
return getSchemaForTypedef(arg, options);
|
|
156
156
|
} else if (arg instanceof _mongoose.default.Schema) {
|
|
@@ -158,6 +158,10 @@ function getObjectSchema(arg, options) {
|
|
|
158
158
|
} else if (Array.isArray(arg)) {
|
|
159
159
|
return getArraySchema(arg, options);
|
|
160
160
|
} else if (typeof arg === 'object') {
|
|
161
|
+
const {
|
|
162
|
+
stripUnknown,
|
|
163
|
+
expandDotSyntax
|
|
164
|
+
} = options;
|
|
161
165
|
const map = {};
|
|
162
166
|
for (let [key, field] of Object.entries(arg)) {
|
|
163
167
|
if (!isExcludedField(field, options)) {
|
|
@@ -170,6 +174,11 @@ function getObjectSchema(arg, options) {
|
|
|
170
174
|
stripUnknown: true
|
|
171
175
|
});
|
|
172
176
|
}
|
|
177
|
+
if (expandDotSyntax) {
|
|
178
|
+
schema = schema.options({
|
|
179
|
+
expandDotSyntax: true
|
|
180
|
+
});
|
|
181
|
+
}
|
|
173
182
|
return schema;
|
|
174
183
|
} else {
|
|
175
184
|
return getSchemaForType(arg);
|
|
@@ -346,7 +355,9 @@ function getTupleValidator(types) {
|
|
|
346
355
|
types = types.map(type => {
|
|
347
356
|
return getSchemaForTypedef(type);
|
|
348
357
|
});
|
|
349
|
-
|
|
358
|
+
// Using "loose" here to allow empty arrays through,
|
|
359
|
+
// which mongoose defaults to for array fields.
|
|
360
|
+
return wrapSchemaAsValidator(_yada.default.tuple(types).loose());
|
|
350
361
|
}
|
|
351
362
|
|
|
352
363
|
// Returns an async function that will error on failure.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bedrockio/model",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Bedrock utilities for model creation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@bedrockio/logger": "^1.0.5",
|
|
29
|
-
"@bedrockio/yada": "^1.0.17",
|
|
30
29
|
"lodash": "^4.17.21"
|
|
31
30
|
},
|
|
32
31
|
"peerDependencies": {
|
|
32
|
+
"@bedrockio/yada": "^1.0.20",
|
|
33
33
|
"mongoose": "^6.9.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@babel/core": "^7.20.12",
|
|
38
38
|
"@babel/preset-env": "^7.20.2",
|
|
39
39
|
"@bedrockio/prettier-config": "^1.0.2",
|
|
40
|
+
"@bedrockio/yada": "^1.0.20",
|
|
40
41
|
"@shelf/jest-mongodb": "^4.1.6",
|
|
41
42
|
"babel-plugin-import-replacement": "^1.0.1",
|
|
42
43
|
"eslint": "^8.33.0",
|
package/src/search.js
CHANGED
|
@@ -85,7 +85,7 @@ export function searchValidation(definition, options = {}) {
|
|
|
85
85
|
|
|
86
86
|
const { limit, sort, ...rest } = options;
|
|
87
87
|
|
|
88
|
-
return {
|
|
88
|
+
return yd.object({
|
|
89
89
|
ids: yd.array(OBJECT_ID_SCHEMA),
|
|
90
90
|
keyword: yd
|
|
91
91
|
.string()
|
|
@@ -99,7 +99,7 @@ export function searchValidation(definition, options = {}) {
|
|
|
99
99
|
.default(limit)
|
|
100
100
|
.description('Limits the number of results.'),
|
|
101
101
|
...rest,
|
|
102
|
-
};
|
|
102
|
+
});
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
function validateDefinition(definition) {
|
package/src/validation.js
CHANGED
|
@@ -114,6 +114,7 @@ export function applyValidation(schema, definition) {
|
|
|
114
114
|
return getSchemaFromMongoose(schema, {
|
|
115
115
|
allowSearch: true,
|
|
116
116
|
skipRequired: true,
|
|
117
|
+
expandDotSyntax: true,
|
|
117
118
|
unwindArrayFields: true,
|
|
118
119
|
requireReadAccess: true,
|
|
119
120
|
appendSchema: searchValidation(definition, searchOptions),
|
|
@@ -142,8 +143,8 @@ export function getValidationSchema(attributes, options = {}) {
|
|
|
142
143
|
const { appendSchema, assertUniqueOptions } = options;
|
|
143
144
|
let schema = getObjectSchema(attributes, options);
|
|
144
145
|
if (assertUniqueOptions) {
|
|
145
|
-
schema =
|
|
146
|
-
await assertUnique(
|
|
146
|
+
schema = schema.custom(async (obj, { root }) => {
|
|
147
|
+
await assertUnique(root, {
|
|
147
148
|
model: options.model,
|
|
148
149
|
...assertUniqueOptions,
|
|
149
150
|
});
|
|
@@ -156,7 +157,6 @@ export function getValidationSchema(attributes, options = {}) {
|
|
|
156
157
|
}
|
|
157
158
|
|
|
158
159
|
function getObjectSchema(arg, options) {
|
|
159
|
-
const { stripUnknown } = options;
|
|
160
160
|
if (isSchemaTypedef(arg)) {
|
|
161
161
|
return getSchemaForTypedef(arg, options);
|
|
162
162
|
} else if (arg instanceof mongoose.Schema) {
|
|
@@ -164,6 +164,7 @@ function getObjectSchema(arg, options) {
|
|
|
164
164
|
} else if (Array.isArray(arg)) {
|
|
165
165
|
return getArraySchema(arg, options);
|
|
166
166
|
} else if (typeof arg === 'object') {
|
|
167
|
+
const { stripUnknown, expandDotSyntax } = options;
|
|
167
168
|
const map = {};
|
|
168
169
|
for (let [key, field] of Object.entries(arg)) {
|
|
169
170
|
if (!isExcludedField(field, options)) {
|
|
@@ -178,6 +179,11 @@ function getObjectSchema(arg, options) {
|
|
|
178
179
|
stripUnknown: true,
|
|
179
180
|
});
|
|
180
181
|
}
|
|
182
|
+
if (expandDotSyntax) {
|
|
183
|
+
schema = schema.options({
|
|
184
|
+
expandDotSyntax: true,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
181
187
|
|
|
182
188
|
return schema;
|
|
183
189
|
} else {
|
|
@@ -385,7 +391,9 @@ export function getTupleValidator(types) {
|
|
|
385
391
|
types = types.map((type) => {
|
|
386
392
|
return getSchemaForTypedef(type);
|
|
387
393
|
});
|
|
388
|
-
|
|
394
|
+
// Using "loose" here to allow empty arrays through,
|
|
395
|
+
// which mongoose defaults to for array fields.
|
|
396
|
+
return wrapSchemaAsValidator(yd.tuple(types).loose());
|
|
389
397
|
}
|
|
390
398
|
|
|
391
399
|
// Returns an async function that will error on failure.
|
package/types/schema.d.ts
CHANGED
|
@@ -16,8 +16,8 @@ export function createSchema(definition: object, options?: mongoose.SchemaOption
|
|
|
16
16
|
max?: number;
|
|
17
17
|
autoIndexId?: boolean;
|
|
18
18
|
};
|
|
19
|
-
collation?: import("mongodb").CollationOptions;
|
|
20
|
-
timeseries?: import("mongodb").TimeSeriesCollectionOptions;
|
|
19
|
+
collation?: import("mongoose/node_modules/mongodb").CollationOptions;
|
|
20
|
+
timeseries?: import("mongoose/node_modules/mongodb").TimeSeriesCollectionOptions;
|
|
21
21
|
expireAfterSeconds?: number;
|
|
22
22
|
expires?: string | number;
|
|
23
23
|
collection?: string;
|
|
@@ -29,7 +29,7 @@ export function createSchema(definition: object, options?: mongoose.SchemaOption
|
|
|
29
29
|
optimisticConcurrency?: boolean;
|
|
30
30
|
pluginTags?: string[];
|
|
31
31
|
read?: string;
|
|
32
|
-
writeConcern?: import("mongodb").WriteConcern;
|
|
32
|
+
writeConcern?: import("mongoose/node_modules/mongodb").WriteConcern;
|
|
33
33
|
safe?: boolean | {
|
|
34
34
|
w?: string | number;
|
|
35
35
|
wtimeout?: number;
|
package/types/search.d.ts
CHANGED
|
@@ -1,303 +1,39 @@
|
|
|
1
1
|
export function applySearch(schema: any, definition: any): void;
|
|
2
2
|
export function searchValidation(definition: any, options?: {}): {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
type?: undefined;
|
|
38
|
-
enum?: undefined;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
keyword: {
|
|
42
|
-
min(length: number): any;
|
|
43
|
-
max(length: number): any;
|
|
44
|
-
trim(): any;
|
|
45
|
-
lowercase(assert?: boolean): any;
|
|
46
|
-
uppercase(assert?: boolean): any;
|
|
47
|
-
match(reg: RegExp): any;
|
|
48
|
-
email(): any;
|
|
49
|
-
phone(): any;
|
|
50
|
-
hex(): any;
|
|
51
|
-
md5(): any;
|
|
52
|
-
sha1(): any;
|
|
53
|
-
ascii(): any;
|
|
54
|
-
base64(options?: {
|
|
55
|
-
urlSafe?: boolean;
|
|
56
|
-
}): any;
|
|
57
|
-
creditCard(): any;
|
|
58
|
-
ip(): any;
|
|
59
|
-
country(): any;
|
|
60
|
-
locale(): any;
|
|
61
|
-
jwt(): any;
|
|
62
|
-
slug(): any;
|
|
63
|
-
latlng(): any;
|
|
64
|
-
postalCode(locale?: string): any;
|
|
65
|
-
password(options?: {
|
|
66
|
-
minLength?: number;
|
|
67
|
-
minNumbers?: number;
|
|
68
|
-
minSymbols?: number;
|
|
69
|
-
minLowercase?: number;
|
|
70
|
-
minUppercase?: number;
|
|
71
|
-
}): any;
|
|
72
|
-
url(options?: {
|
|
73
|
-
require_protocol?: boolean;
|
|
74
|
-
require_valid_protocol?: boolean;
|
|
75
|
-
require_host?: boolean;
|
|
76
|
-
require_port?: boolean;
|
|
77
|
-
allow_protocol_relative_urls?: boolean;
|
|
78
|
-
allow_fragments?: boolean;
|
|
79
|
-
allow_query_components?: boolean;
|
|
80
|
-
validate_length?: boolean;
|
|
81
|
-
protocols?: string[];
|
|
82
|
-
}): any;
|
|
83
|
-
domain(options?: {
|
|
84
|
-
require_tld?: boolean;
|
|
85
|
-
allow_underscores?: boolean;
|
|
86
|
-
allow_trailing_dot?: boolean;
|
|
87
|
-
allow_numeric_tld?: boolean;
|
|
88
|
-
allow_wildcard?: boolean;
|
|
89
|
-
ignore_max_length?: boolean;
|
|
90
|
-
}): any;
|
|
91
|
-
uuid(version?: 2 | 1 | 5 | 3 | 4): any;
|
|
92
|
-
btc(): any;
|
|
93
|
-
eth(): any;
|
|
94
|
-
swift(): any;
|
|
95
|
-
mongo(): any;
|
|
96
|
-
format(name: any, fn: any): import("@bedrockio/yada/types/TypeSchema").default;
|
|
97
|
-
toString(): any;
|
|
98
|
-
assertions: any[];
|
|
99
|
-
meta: {};
|
|
100
|
-
required(): any;
|
|
101
|
-
default(value: any): any;
|
|
102
|
-
custom(...args: import("@bedrockio/yada/types/Schema").CustomSignature): any;
|
|
103
|
-
strip(strip: any): any;
|
|
104
|
-
allow(...set: any[]): any;
|
|
105
|
-
reject(...set: any[]): any;
|
|
106
|
-
message(message: any): any;
|
|
107
|
-
tag(tags: any): any;
|
|
108
|
-
description(description: any): any;
|
|
109
|
-
options(options: any): any;
|
|
110
|
-
validate(value: any, options?: {}): Promise<any>;
|
|
111
|
-
clone(meta: any): any;
|
|
112
|
-
append(schema: any): any;
|
|
113
|
-
toOpenApi(extra: any): any;
|
|
114
|
-
assertEnum(set: any, allow: any): any;
|
|
115
|
-
assert(type: any, fn: any): any;
|
|
116
|
-
pushAssertion(assertion: any): void;
|
|
117
|
-
transform(fn: any): any;
|
|
118
|
-
getSortIndex(type: any): number;
|
|
119
|
-
runAssertion(assertion: any, value: any, options?: {}): Promise<any>;
|
|
120
|
-
enumToOpenApi(): {
|
|
121
|
-
type: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
|
|
122
|
-
enum: any;
|
|
123
|
-
oneOf?: undefined;
|
|
124
|
-
} | {
|
|
125
|
-
oneOf: any[];
|
|
126
|
-
type?: undefined;
|
|
127
|
-
enum?: undefined;
|
|
128
|
-
};
|
|
129
|
-
};
|
|
130
|
-
include: {
|
|
131
|
-
min(length: number): any;
|
|
132
|
-
max(length: number): any;
|
|
133
|
-
trim(): any;
|
|
134
|
-
lowercase(assert?: boolean): any;
|
|
135
|
-
uppercase(assert?: boolean): any;
|
|
136
|
-
match(reg: RegExp): any;
|
|
137
|
-
email(): any;
|
|
138
|
-
phone(): any;
|
|
139
|
-
hex(): any;
|
|
140
|
-
md5(): any;
|
|
141
|
-
sha1(): any;
|
|
142
|
-
ascii(): any;
|
|
143
|
-
base64(options?: {
|
|
144
|
-
urlSafe?: boolean;
|
|
145
|
-
}): any;
|
|
146
|
-
creditCard(): any;
|
|
147
|
-
ip(): any;
|
|
148
|
-
country(): any;
|
|
149
|
-
locale(): any;
|
|
150
|
-
jwt(): any;
|
|
151
|
-
slug(): any;
|
|
152
|
-
latlng(): any;
|
|
153
|
-
postalCode(locale?: string): any;
|
|
154
|
-
password(options?: {
|
|
155
|
-
minLength?: number;
|
|
156
|
-
minNumbers?: number;
|
|
157
|
-
minSymbols?: number;
|
|
158
|
-
minLowercase?: number;
|
|
159
|
-
minUppercase?: number;
|
|
160
|
-
}): any;
|
|
161
|
-
url(options?: {
|
|
162
|
-
require_protocol?: boolean;
|
|
163
|
-
require_valid_protocol?: boolean;
|
|
164
|
-
require_host?: boolean;
|
|
165
|
-
require_port?: boolean;
|
|
166
|
-
allow_protocol_relative_urls?: boolean;
|
|
167
|
-
allow_fragments?: boolean;
|
|
168
|
-
allow_query_components?: boolean;
|
|
169
|
-
validate_length?: boolean;
|
|
170
|
-
protocols?: string[];
|
|
171
|
-
}): any;
|
|
172
|
-
domain(options?: {
|
|
173
|
-
require_tld?: boolean;
|
|
174
|
-
allow_underscores?: boolean;
|
|
175
|
-
allow_trailing_dot?: boolean;
|
|
176
|
-
allow_numeric_tld?: boolean;
|
|
177
|
-
allow_wildcard?: boolean;
|
|
178
|
-
ignore_max_length?: boolean;
|
|
179
|
-
}): any;
|
|
180
|
-
uuid(version?: 2 | 1 | 5 | 3 | 4): any;
|
|
181
|
-
btc(): any;
|
|
182
|
-
eth(): any;
|
|
183
|
-
swift(): any;
|
|
184
|
-
mongo(): any;
|
|
185
|
-
format(name: any, fn: any): import("@bedrockio/yada/types/TypeSchema").default;
|
|
186
|
-
toString(): any;
|
|
187
|
-
assertions: any[];
|
|
188
|
-
meta: {};
|
|
189
|
-
required(): any;
|
|
190
|
-
default(value: any): any;
|
|
191
|
-
custom(...args: import("@bedrockio/yada/types/Schema").CustomSignature): any;
|
|
192
|
-
strip(strip: any): any;
|
|
193
|
-
allow(...set: any[]): any;
|
|
194
|
-
reject(...set: any[]): any;
|
|
195
|
-
message(message: any): any;
|
|
196
|
-
tag(tags: any): any;
|
|
197
|
-
description(description: any): any;
|
|
198
|
-
options(options: any): any;
|
|
199
|
-
validate(value: any, options?: {}): Promise<any>;
|
|
200
|
-
clone(meta: any): any;
|
|
201
|
-
append(schema: any): any;
|
|
202
|
-
toOpenApi(extra: any): any;
|
|
203
|
-
assertEnum(set: any, allow: any): any;
|
|
204
|
-
assert(type: any, fn: any): any;
|
|
205
|
-
pushAssertion(assertion: any): void;
|
|
206
|
-
transform(fn: any): any;
|
|
207
|
-
getSortIndex(type: any): number;
|
|
208
|
-
runAssertion(assertion: any, value: any, options?: {}): Promise<any>;
|
|
209
|
-
enumToOpenApi(): {
|
|
210
|
-
type: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
|
|
211
|
-
enum: any;
|
|
212
|
-
oneOf?: undefined;
|
|
213
|
-
} | {
|
|
214
|
-
oneOf: any[];
|
|
215
|
-
type?: undefined;
|
|
216
|
-
enum?: undefined;
|
|
217
|
-
};
|
|
218
|
-
};
|
|
219
|
-
skip: {
|
|
220
|
-
min(min: number, message?: string): any;
|
|
221
|
-
max(max: number, message?: string): any;
|
|
222
|
-
negative(): any;
|
|
223
|
-
positive(): any;
|
|
224
|
-
integer(): any;
|
|
225
|
-
multiple(multiple: any): any;
|
|
226
|
-
format(name: any, fn: any): import("@bedrockio/yada/types/TypeSchema").default;
|
|
227
|
-
toString(): any;
|
|
228
|
-
assertions: any[];
|
|
229
|
-
meta: {};
|
|
230
|
-
required(): any;
|
|
231
|
-
default(value: any): any;
|
|
232
|
-
custom(...args: import("@bedrockio/yada/types/Schema").CustomSignature): any;
|
|
233
|
-
strip(strip: any): any;
|
|
234
|
-
allow(...set: any[]): any;
|
|
235
|
-
reject(...set: any[]): any;
|
|
236
|
-
message(message: any): any;
|
|
237
|
-
tag(tags: any): any;
|
|
238
|
-
description(description: any): any;
|
|
239
|
-
options(options: any): any;
|
|
240
|
-
validate(value: any, options?: {}): Promise<any>;
|
|
241
|
-
clone(meta: any): any;
|
|
242
|
-
append(schema: any): any;
|
|
243
|
-
toOpenApi(extra: any): any;
|
|
244
|
-
assertEnum(set: any, allow: any): any;
|
|
245
|
-
assert(type: any, fn: any): any;
|
|
246
|
-
pushAssertion(assertion: any): void;
|
|
247
|
-
transform(fn: any): any;
|
|
248
|
-
getSortIndex(type: any): number;
|
|
249
|
-
runAssertion(assertion: any, value: any, options?: {}): Promise<any>;
|
|
250
|
-
enumToOpenApi(): {
|
|
251
|
-
type: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
|
|
252
|
-
enum: any;
|
|
253
|
-
oneOf?: undefined;
|
|
254
|
-
} | {
|
|
255
|
-
oneOf: any[];
|
|
256
|
-
type?: undefined;
|
|
257
|
-
enum?: undefined;
|
|
258
|
-
};
|
|
259
|
-
};
|
|
260
|
-
sort: import("@bedrockio/yada/types/Schema").default;
|
|
261
|
-
limit: {
|
|
262
|
-
min(min: number, message?: string): any;
|
|
263
|
-
max(max: number, message?: string): any;
|
|
264
|
-
negative(): any;
|
|
265
|
-
positive(): any;
|
|
266
|
-
integer(): any;
|
|
267
|
-
multiple(multiple: any): any;
|
|
268
|
-
format(name: any, fn: any): import("@bedrockio/yada/types/TypeSchema").default;
|
|
269
|
-
toString(): any;
|
|
270
|
-
assertions: any[];
|
|
271
|
-
meta: {};
|
|
272
|
-
required(): any;
|
|
273
|
-
default(value: any): any;
|
|
274
|
-
custom(...args: import("@bedrockio/yada/types/Schema").CustomSignature): any;
|
|
275
|
-
strip(strip: any): any;
|
|
276
|
-
allow(...set: any[]): any;
|
|
277
|
-
reject(...set: any[]): any;
|
|
278
|
-
message(message: any): any;
|
|
279
|
-
tag(tags: any): any;
|
|
280
|
-
description(description: any): any;
|
|
281
|
-
options(options: any): any;
|
|
282
|
-
validate(value: any, options?: {}): Promise<any>;
|
|
283
|
-
clone(meta: any): any;
|
|
284
|
-
append(schema: any): any;
|
|
285
|
-
toOpenApi(extra: any): any;
|
|
286
|
-
assertEnum(set: any, allow: any): any;
|
|
287
|
-
assert(type: any, fn: any): any;
|
|
288
|
-
pushAssertion(assertion: any): void;
|
|
289
|
-
transform(fn: any): any;
|
|
290
|
-
getSortIndex(type: any): number;
|
|
291
|
-
runAssertion(assertion: any, value: any, options?: {}): Promise<any>;
|
|
292
|
-
enumToOpenApi(): {
|
|
293
|
-
type: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
|
|
294
|
-
enum: any;
|
|
295
|
-
oneOf?: undefined;
|
|
296
|
-
} | {
|
|
297
|
-
oneOf: any[];
|
|
298
|
-
type?: undefined;
|
|
299
|
-
enum?: undefined;
|
|
300
|
-
};
|
|
3
|
+
setup: any;
|
|
4
|
+
getFields: any;
|
|
5
|
+
append(arg: import("@bedrockio/yada/types/Schema").default | import("@bedrockio/yada/types/object").SchemaMap): any;
|
|
6
|
+
format(name: any, fn: any): import("@bedrockio/yada/types/TypeSchema").default;
|
|
7
|
+
toString(): any;
|
|
8
|
+
assertions: any[];
|
|
9
|
+
meta: {};
|
|
10
|
+
required(): any;
|
|
11
|
+
default(value: any): any;
|
|
12
|
+
custom(...args: import("@bedrockio/yada/types/Schema").CustomSignature): any;
|
|
13
|
+
strip(strip: any): any;
|
|
14
|
+
allow(...set: any[]): any;
|
|
15
|
+
reject(...set: any[]): any;
|
|
16
|
+
message(message: any): any;
|
|
17
|
+
tag(tags: any): any;
|
|
18
|
+
description(description: any): any;
|
|
19
|
+
options(options: any): any;
|
|
20
|
+
validate(value: any, options?: {}): Promise<any>;
|
|
21
|
+
clone(meta: any): any;
|
|
22
|
+
toOpenApi(extra: any): any;
|
|
23
|
+
assertEnum(set: any, allow: any): any;
|
|
24
|
+
assert(type: any, fn: any): any;
|
|
25
|
+
pushAssertion(assertion: any): void;
|
|
26
|
+
transform(fn: any): any;
|
|
27
|
+
getSortIndex(type: any): number;
|
|
28
|
+
runAssertion(assertion: any, value: any, options?: {}): Promise<any>;
|
|
29
|
+
enumToOpenApi(): {
|
|
30
|
+
type: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
|
|
31
|
+
enum: any;
|
|
32
|
+
oneOf?: undefined;
|
|
33
|
+
} | {
|
|
34
|
+
oneOf: any[];
|
|
35
|
+
type?: undefined;
|
|
36
|
+
enum?: undefined;
|
|
301
37
|
};
|
|
302
38
|
};
|
|
303
39
|
//# 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":"AAmBA,gEAyDC;AAED
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.js"],"names":[],"mappings":"AAmBA,gEAyDC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.js"],"names":[],"mappings":"AAiEA,kDAEC;AAED,
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.js"],"names":[],"mappings":"AAiEA,kDAEC;AAED,oEA2DC;AAaD,wEAeC;AAqOD;;;EAEC;AAED;;;EAOC;AArXD,8EAUK"}
|