@bedrockio/model 0.1.8 → 0.1.10
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/schema.js +0 -4
- package/dist/cjs/search.js +31 -15
- package/dist/cjs/validation.js +65 -35
- package/package.json +1 -1
- package/src/schema.js +0 -7
- package/src/search.js +28 -16
- package/src/validation.js +92 -47
- package/types/schema.d.ts +0 -1
- package/types/schema.d.ts.map +1 -1
- package/types/search.d.ts +1 -1
- package/types/search.d.ts.map +1 -1
- package/types/validation.d.ts +91 -1
- package/types/validation.d.ts.map +1 -1
- package/yarn-error.log +979 -1038
package/types/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.js"],"names":[],"mappings":"AAoBA;;;;;;;GAOG;AACH,yCAJW,MAAM,YACN,SAAS,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAoChC;AAED,iEAuBC"}
|
package/types/search.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export function applySearch(schema: any, definition: any): void;
|
|
2
|
-
export function searchValidation(
|
|
2
|
+
export function searchValidation(options?: {}): {
|
|
3
3
|
setup: any;
|
|
4
4
|
getFields: any;
|
|
5
5
|
append(arg: import("@bedrockio/yada/types/object").SchemaMap | import("@bedrockio/yada/types/Schema").default): any;
|
package/types/search.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.js"],"names":[],"mappings":"AAYA,gEAyDC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyBC"}
|
package/types/validation.d.ts
CHANGED
|
@@ -9,5 +9,95 @@ export function getTupleValidator(types: any): {
|
|
|
9
9
|
(val: any): Promise<void>;
|
|
10
10
|
schema: any;
|
|
11
11
|
};
|
|
12
|
-
export const OBJECT_ID_SCHEMA:
|
|
12
|
+
export const OBJECT_ID_SCHEMA: {
|
|
13
|
+
length(length: number): any;
|
|
14
|
+
min(length: number): any;
|
|
15
|
+
max(length: number): any;
|
|
16
|
+
trim(): any;
|
|
17
|
+
lowercase(assert?: boolean): any;
|
|
18
|
+
uppercase(assert?: boolean): any;
|
|
19
|
+
match(reg: RegExp): any;
|
|
20
|
+
email(): any;
|
|
21
|
+
phone(): any;
|
|
22
|
+
hex(): any;
|
|
23
|
+
md5(): any;
|
|
24
|
+
sha1(): any;
|
|
25
|
+
ascii(): any;
|
|
26
|
+
base64(options?: {
|
|
27
|
+
urlSafe?: boolean;
|
|
28
|
+
}): any;
|
|
29
|
+
creditCard(): any;
|
|
30
|
+
ip(): any;
|
|
31
|
+
country(): any;
|
|
32
|
+
locale(): any;
|
|
33
|
+
jwt(): any;
|
|
34
|
+
slug(): any;
|
|
35
|
+
latlng(): any;
|
|
36
|
+
postalCode(locale?: string): any;
|
|
37
|
+
password(options?: {
|
|
38
|
+
minLength?: number;
|
|
39
|
+
minNumbers?: number;
|
|
40
|
+
minSymbols?: number;
|
|
41
|
+
minLowercase?: number;
|
|
42
|
+
minUppercase?: number;
|
|
43
|
+
}): any;
|
|
44
|
+
url(options?: {
|
|
45
|
+
require_protocol?: boolean;
|
|
46
|
+
require_valid_protocol?: boolean;
|
|
47
|
+
require_host?: boolean;
|
|
48
|
+
require_port?: boolean;
|
|
49
|
+
allow_protocol_relative_urls?: boolean;
|
|
50
|
+
allow_fragments?: boolean;
|
|
51
|
+
allow_query_components?: boolean;
|
|
52
|
+
validate_length?: boolean;
|
|
53
|
+
protocols?: string[];
|
|
54
|
+
}): any;
|
|
55
|
+
domain(options?: {
|
|
56
|
+
require_tld?: boolean;
|
|
57
|
+
allow_underscores?: boolean;
|
|
58
|
+
allow_trailing_dot?: boolean;
|
|
59
|
+
allow_numeric_tld?: boolean;
|
|
60
|
+
allow_wildcard?: boolean;
|
|
61
|
+
ignore_max_length?: boolean;
|
|
62
|
+
}): any;
|
|
63
|
+
uuid(version?: 1 | 2 | 5 | 3 | 4): any;
|
|
64
|
+
btc(): any;
|
|
65
|
+
eth(): any;
|
|
66
|
+
swift(): any;
|
|
67
|
+
mongo(): any;
|
|
68
|
+
format(name: any, fn: any): import("@bedrockio/yada/types/TypeSchema").default;
|
|
69
|
+
toString(): any;
|
|
70
|
+
assertions: any[];
|
|
71
|
+
meta: {};
|
|
72
|
+
required(): any;
|
|
73
|
+
default(value: any): any;
|
|
74
|
+
custom(...args: import("@bedrockio/yada/types/Schema").CustomSignature): any;
|
|
75
|
+
strip(strip: any): any;
|
|
76
|
+
allow(...set: any[]): any;
|
|
77
|
+
reject(...set: any[]): any;
|
|
78
|
+
message(message: any): any;
|
|
79
|
+
tag(tags: any): any;
|
|
80
|
+
description(description: any): any;
|
|
81
|
+
options(options: any): any;
|
|
82
|
+
validate(value: any, options?: {}): Promise<any>;
|
|
83
|
+
clone(meta: any): any;
|
|
84
|
+
append(schema: any): any;
|
|
85
|
+
toOpenApi(extra: any): any;
|
|
86
|
+
expandExtra(extra?: {}): {};
|
|
87
|
+
assertEnum(set: any, allow: any): any;
|
|
88
|
+
assert(type: any, fn: any): any;
|
|
89
|
+
pushAssertion(assertion: any): void;
|
|
90
|
+
transform(fn: any): any;
|
|
91
|
+
getSortIndex(type: any): number;
|
|
92
|
+
runAssertion(assertion: any, value: any, options?: {}): Promise<any>;
|
|
93
|
+
enumToOpenApi(): {
|
|
94
|
+
type: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
|
|
95
|
+
enum: any;
|
|
96
|
+
oneOf?: undefined;
|
|
97
|
+
} | {
|
|
98
|
+
oneOf: any[];
|
|
99
|
+
type?: undefined;
|
|
100
|
+
enum?: undefined;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
13
103
|
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -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":"AAyEA,kDAEC;AAED,oEA8EC;AAsBD,wEAkBC;AA0QD;;;EAEC;AAED;;;EAOC;AAtcD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIG"}
|