@bedrockio/model 0.15.0 → 0.17.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 +8 -0
- package/README.md +67 -14
- package/dist/cjs/upsert.js +15 -4
- package/dist/cjs/validation-schemas.js +1 -1
- package/dist/cjs/validation.js +6 -4
- package/package.json +2 -2
- package/src/upsert.js +19 -4
- package/src/validation-schemas.js +1 -1
- package/src/validation.js +7 -3
- package/types/search.d.ts +8 -3
- package/types/search.d.ts.map +1 -1
- package/types/upsert.d.ts.map +1 -1
- package/types/validation-schemas.d.ts +13 -6
- package/types/validation-schemas.d.ts.map +1 -1
- package/types/validation.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -931,6 +931,20 @@ caller does not need to know whether the path contains subdocuments or foreign
|
|
|
931
931
|
references. As Bedrock has knowledge of the schemas, it is able to build the
|
|
932
932
|
appropriate call to `populate` for you.
|
|
933
933
|
|
|
934
|
+
#### Include Syntax
|
|
935
|
+
|
|
936
|
+
| Example | Type | Populated | Description |
|
|
937
|
+
| ----------------- | --------- | --------- | ---------------------------------------------------- |
|
|
938
|
+
| `shop` | Inclusive | shop | Populates top level document. |
|
|
939
|
+
| `shop.user` | Inclusive | shop/user | Populates two levels deep. |
|
|
940
|
+
| `^name` | Exclusive | | Selects only `name`. |
|
|
941
|
+
| `^shop.name` | Exclusive | shop | Selects only `shop.name`. |
|
|
942
|
+
| `^shop.user.name` | Exclusive | shop/user | Selects only `shop.user.name`. |
|
|
943
|
+
| `shop.^user.name` | Exclusive | shop/user | Selects root fields and `shop.user.name`. |
|
|
944
|
+
| `shop.user.^name` | Exclusive | shop/user | Selects root and `shop` fields and `shop.user.name`. |
|
|
945
|
+
| `*Name` | Wildcard | | Matches any root field ending with `Name`. |
|
|
946
|
+
| `**Name` | Wildcard | | Matches any root or nested field ending with `Name`. |
|
|
947
|
+
|
|
934
948
|
#### Exclusive Fields
|
|
935
949
|
|
|
936
950
|
By default, arguments to `include` are for population. However often field
|
|
@@ -1650,35 +1664,52 @@ string, both of which would be stored in the database if naively assigned with
|
|
|
1650
1664
|
|
|
1651
1665
|
### Upsert
|
|
1652
1666
|
|
|
1653
|
-
This module adds
|
|
1654
|
-
|
|
1655
|
-
|
|
1667
|
+
This module adds two similar methods:
|
|
1668
|
+
|
|
1669
|
+
- `upsert`
|
|
1670
|
+
- `findOrCreate`
|
|
1671
|
+
|
|
1672
|
+
The `upsert` method is used when documents must always be overwritten with the
|
|
1673
|
+
latest data.
|
|
1656
1674
|
|
|
1657
1675
|
```js
|
|
1658
|
-
const shop = await Shop.
|
|
1659
|
-
|
|
1660
|
-
|
|
1676
|
+
const shop = await Shop.upsert(
|
|
1677
|
+
{
|
|
1678
|
+
name: 'My Shop',
|
|
1679
|
+
},
|
|
1680
|
+
{
|
|
1681
|
+
name: 'My Shop',
|
|
1682
|
+
slug: 'my-shop',
|
|
1683
|
+
},
|
|
1684
|
+
);
|
|
1685
|
+
|
|
1686
|
+
// This is equivalent to:
|
|
1661
1687
|
|
|
1662
|
-
// This is equivalent to running:
|
|
1663
1688
|
let shop = await Shop.findOne({
|
|
1664
1689
|
name: 'My Shop',
|
|
1665
1690
|
});
|
|
1666
1691
|
|
|
1667
|
-
if (
|
|
1692
|
+
if (shop) {
|
|
1693
|
+
shop.assign({
|
|
1694
|
+
name: 'My Shop',
|
|
1695
|
+
slug: 'my-shop',
|
|
1696
|
+
});
|
|
1697
|
+
await shop.save();
|
|
1698
|
+
} else {
|
|
1668
1699
|
shop = await Shop.create({
|
|
1669
1700
|
name: 'My Shop',
|
|
1701
|
+
slug: 'my-shop',
|
|
1670
1702
|
});
|
|
1671
1703
|
}
|
|
1672
1704
|
```
|
|
1673
1705
|
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
of which is the query:
|
|
1706
|
+
The `findOrCreate` method does just whan the name implies and will return the
|
|
1707
|
+
document it finds without modifying it.
|
|
1677
1708
|
|
|
1678
1709
|
```js
|
|
1679
1710
|
const shop = await Shop.findOrCreate(
|
|
1680
1711
|
{
|
|
1681
|
-
|
|
1712
|
+
name: 'My Shop',
|
|
1682
1713
|
},
|
|
1683
1714
|
{
|
|
1684
1715
|
name: 'My Shop',
|
|
@@ -1686,9 +1717,10 @@ const shop = await Shop.findOrCreate(
|
|
|
1686
1717
|
},
|
|
1687
1718
|
);
|
|
1688
1719
|
|
|
1689
|
-
// This is equivalent to
|
|
1720
|
+
// This is equivalent to:
|
|
1721
|
+
|
|
1690
1722
|
let shop = await Shop.findOne({
|
|
1691
|
-
|
|
1723
|
+
name: 'My Shop',
|
|
1692
1724
|
});
|
|
1693
1725
|
|
|
1694
1726
|
if (!shop) {
|
|
@@ -1699,6 +1731,27 @@ if (!shop) {
|
|
|
1699
1731
|
}
|
|
1700
1732
|
```
|
|
1701
1733
|
|
|
1734
|
+
Note that a single argument can also be passed as a shortcut to both the query
|
|
1735
|
+
and the update for simple cases:
|
|
1736
|
+
|
|
1737
|
+
```js
|
|
1738
|
+
const shop = await Shop.findOrCreate({
|
|
1739
|
+
name: 'My Shop',
|
|
1740
|
+
});
|
|
1741
|
+
|
|
1742
|
+
// This is equivalent to:
|
|
1743
|
+
|
|
1744
|
+
let shop = await Shop.findOne({
|
|
1745
|
+
name: 'My Shop',
|
|
1746
|
+
});
|
|
1747
|
+
|
|
1748
|
+
if (!shop) {
|
|
1749
|
+
shop = await Shop.create({
|
|
1750
|
+
name: 'My Shop',
|
|
1751
|
+
});
|
|
1752
|
+
}
|
|
1753
|
+
```
|
|
1754
|
+
|
|
1702
1755
|
### Clone
|
|
1703
1756
|
|
|
1704
1757
|
Adds a single `clone` method on documents. This is an async method mostly for
|
package/dist/cjs/upsert.js
CHANGED
|
@@ -5,11 +5,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.applyUpsert = applyUpsert;
|
|
7
7
|
function applyUpsert(schema) {
|
|
8
|
-
// Note:
|
|
9
|
-
//
|
|
10
|
-
// means however that we cannot always return a query here
|
|
11
|
-
// operations are inherently different.
|
|
8
|
+
// Note: Avoiding the findOneAndUpdate approach here as this
|
|
9
|
+
// will prevent hooks from being run on the document. This
|
|
10
|
+
// means however that we cannot always return a query here
|
|
11
|
+
// as the operations are inherently different.
|
|
12
12
|
|
|
13
|
+
schema.static('upsert', async function upsert(query, fields) {
|
|
14
|
+
fields ||= query;
|
|
15
|
+
let doc = await this.findOne(query);
|
|
16
|
+
if (doc) {
|
|
17
|
+
doc.assign(fields);
|
|
18
|
+
await doc.save();
|
|
19
|
+
} else {
|
|
20
|
+
doc = await this.create(fields);
|
|
21
|
+
}
|
|
22
|
+
return doc;
|
|
23
|
+
});
|
|
13
24
|
schema.static('findOrCreate', async function findOrCreate(query, fields) {
|
|
14
25
|
fields ||= query;
|
|
15
26
|
let doc = await this.findOne(query);
|
|
@@ -70,6 +70,6 @@ An object with an \`id\` field may also be passed, which will be converted into
|
|
|
70
70
|
const INCLUDE_FIELD_SCHEMA = exports.INCLUDE_FIELD_SCHEMA = _yada.default.object({
|
|
71
71
|
include: _yada.default.allow(_yada.default.string(), _yada.default.array(_yada.default.string())).tag({
|
|
72
72
|
'x-schema': 'Includes',
|
|
73
|
-
'x-description': 'A `string` or `array` of fields to be selected or populated using [includes syntax](
|
|
73
|
+
'x-description': 'A `string` or `array` of fields to be selected or populated using [includes syntax](https://bit.ly/4mZwSq4).'
|
|
74
74
|
})
|
|
75
75
|
});
|
package/dist/cjs/validation.js
CHANGED
|
@@ -28,6 +28,8 @@ const NAMED_SCHEMAS = {
|
|
|
28
28
|
// "calendar" validation is a special case to validate
|
|
29
29
|
// string fields in ISO-8601 format without a time.
|
|
30
30
|
calendar: _yada.default.string().calendar(),
|
|
31
|
+
// Validates generic ISO-8601 time.
|
|
32
|
+
time: _yada.default.string().time(),
|
|
31
33
|
ascii: _yada.default.string().ascii(),
|
|
32
34
|
base64: _yada.default.string().base64(),
|
|
33
35
|
btc: _yada.default.string().btc(),
|
|
@@ -42,15 +44,15 @@ const NAMED_SCHEMAS = {
|
|
|
42
44
|
locale: _yada.default.string().locale(),
|
|
43
45
|
md5: _yada.default.string().md5(),
|
|
44
46
|
phone: _yada.default.string().phone(),
|
|
45
|
-
'phone:US': _yada.default.string().phone('US'),
|
|
46
|
-
'phone:NANP': _yada.default.string().phone('NANP'),
|
|
47
47
|
postalCode: _yada.default.string().postalCode(),
|
|
48
|
-
zipcode: _yada.default.string().zipcode(),
|
|
49
48
|
sha1: _yada.default.string().sha1(),
|
|
50
49
|
slug: _yada.default.string().slug(),
|
|
51
50
|
swift: _yada.default.string().swift(),
|
|
52
51
|
url: _yada.default.string().url(),
|
|
53
|
-
uuid: _yada.default.string().uuid()
|
|
52
|
+
uuid: _yada.default.string().uuid(),
|
|
53
|
+
zipcode: _yada.default.string().zipcode(),
|
|
54
|
+
'phone:NANP': _yada.default.string().phone('NANP'),
|
|
55
|
+
'phone:US': _yada.default.string().phone('US')
|
|
54
56
|
};
|
|
55
57
|
function addValidators(schemas) {
|
|
56
58
|
Object.assign(NAMED_SCHEMAS, schemas);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bedrockio/model",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "Bedrock utilities for model creation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -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.
|
|
42
|
+
"@bedrockio/yada": "^1.9.0",
|
|
43
43
|
"@shelf/jest-mongodb": "^5.2.2",
|
|
44
44
|
"eslint": "^9.36.0",
|
|
45
45
|
"jest": "^30.2.0",
|
package/src/upsert.js
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
export function applyUpsert(schema) {
|
|
2
|
-
// Note:
|
|
3
|
-
//
|
|
4
|
-
// means however that we cannot always return a query here
|
|
5
|
-
// operations are inherently different.
|
|
2
|
+
// Note: Avoiding the findOneAndUpdate approach here as this
|
|
3
|
+
// will prevent hooks from being run on the document. This
|
|
4
|
+
// means however that we cannot always return a query here
|
|
5
|
+
// as the operations are inherently different.
|
|
6
|
+
|
|
7
|
+
schema.static('upsert', async function upsert(query, fields) {
|
|
8
|
+
fields ||= query;
|
|
9
|
+
|
|
10
|
+
let doc = await this.findOne(query);
|
|
11
|
+
|
|
12
|
+
if (doc) {
|
|
13
|
+
doc.assign(fields);
|
|
14
|
+
await doc.save();
|
|
15
|
+
} else {
|
|
16
|
+
doc = await this.create(fields);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return doc;
|
|
20
|
+
});
|
|
6
21
|
|
|
7
22
|
schema.static('findOrCreate', async function findOrCreate(query, fields) {
|
|
8
23
|
fields ||= query;
|
|
@@ -105,6 +105,6 @@ export const INCLUDE_FIELD_SCHEMA = yd.object({
|
|
|
105
105
|
include: yd.allow(yd.string(), yd.array(yd.string())).tag({
|
|
106
106
|
'x-schema': 'Includes',
|
|
107
107
|
'x-description':
|
|
108
|
-
'A `string` or `array` of fields to be selected or populated using [includes syntax](
|
|
108
|
+
'A `string` or `array` of fields to be selected or populated using [includes syntax](https://bit.ly/4mZwSq4).',
|
|
109
109
|
}),
|
|
110
110
|
});
|
package/src/validation.js
CHANGED
|
@@ -30,6 +30,9 @@ const NAMED_SCHEMAS = {
|
|
|
30
30
|
// string fields in ISO-8601 format without a time.
|
|
31
31
|
calendar: yd.string().calendar(),
|
|
32
32
|
|
|
33
|
+
// Validates generic ISO-8601 time.
|
|
34
|
+
time: yd.string().time(),
|
|
35
|
+
|
|
33
36
|
ascii: yd.string().ascii(),
|
|
34
37
|
base64: yd.string().base64(),
|
|
35
38
|
btc: yd.string().btc(),
|
|
@@ -44,15 +47,16 @@ const NAMED_SCHEMAS = {
|
|
|
44
47
|
locale: yd.string().locale(),
|
|
45
48
|
md5: yd.string().md5(),
|
|
46
49
|
phone: yd.string().phone(),
|
|
47
|
-
'phone:US': yd.string().phone('US'),
|
|
48
|
-
'phone:NANP': yd.string().phone('NANP'),
|
|
49
50
|
postalCode: yd.string().postalCode(),
|
|
50
|
-
zipcode: yd.string().zipcode(),
|
|
51
51
|
sha1: yd.string().sha1(),
|
|
52
52
|
slug: yd.string().slug(),
|
|
53
53
|
swift: yd.string().swift(),
|
|
54
54
|
url: yd.string().url(),
|
|
55
55
|
uuid: yd.string().uuid(),
|
|
56
|
+
zipcode: yd.string().zipcode(),
|
|
57
|
+
|
|
58
|
+
'phone:NANP': yd.string().phone('NANP'),
|
|
59
|
+
'phone:US': yd.string().phone('US'),
|
|
56
60
|
};
|
|
57
61
|
|
|
58
62
|
export function addValidators(schemas) {
|
package/types/search.d.ts
CHANGED
|
@@ -33,8 +33,9 @@ export function searchValidation(options?: {}): {
|
|
|
33
33
|
description(description: any): /*elided*/ any;
|
|
34
34
|
validate(value: any, options?: {}): Promise<any>;
|
|
35
35
|
clone(meta: any): /*elided*/ any;
|
|
36
|
-
|
|
36
|
+
toJsonSchema(extra?: any): any;
|
|
37
37
|
toOpenApi(...extra: any[]): any;
|
|
38
|
+
toJSON(): any;
|
|
38
39
|
getAnyType(): {
|
|
39
40
|
type: string[];
|
|
40
41
|
};
|
|
@@ -120,6 +121,7 @@ export function exportValidation(options?: {}): {
|
|
|
120
121
|
swift(): /*elided*/ any;
|
|
121
122
|
mongo(): /*elided*/ any;
|
|
122
123
|
calendar(): /*elided*/ any;
|
|
124
|
+
time(): /*elided*/ any;
|
|
123
125
|
format(name: any, fn: any): /*elided*/ any;
|
|
124
126
|
toString(): any;
|
|
125
127
|
assertions: any[];
|
|
@@ -138,8 +140,9 @@ export function exportValidation(options?: {}): {
|
|
|
138
140
|
validate(value: any, options?: {}): Promise<any>;
|
|
139
141
|
clone(meta: any): /*elided*/ any;
|
|
140
142
|
append(schema: any): import("@bedrockio/yada/types/Schema").default;
|
|
141
|
-
|
|
143
|
+
toJsonSchema(extra?: any): any;
|
|
142
144
|
toOpenApi(...extra: any[]): any;
|
|
145
|
+
toJSON(): any;
|
|
143
146
|
getAnyType(): {
|
|
144
147
|
type: string[];
|
|
145
148
|
};
|
|
@@ -226,6 +229,7 @@ export function exportValidation(options?: {}): {
|
|
|
226
229
|
swift(): /*elided*/ any;
|
|
227
230
|
mongo(): /*elided*/ any;
|
|
228
231
|
calendar(): /*elided*/ any;
|
|
232
|
+
time(): /*elided*/ any;
|
|
229
233
|
format(name: any, fn: any): /*elided*/ any;
|
|
230
234
|
toString(): any;
|
|
231
235
|
assertions: any[];
|
|
@@ -244,8 +248,9 @@ export function exportValidation(options?: {}): {
|
|
|
244
248
|
validate(value: any, options?: {}): Promise<any>;
|
|
245
249
|
clone(meta: any): /*elided*/ any;
|
|
246
250
|
append(schema: any): import("@bedrockio/yada/types/Schema").default;
|
|
247
|
-
|
|
251
|
+
toJsonSchema(extra?: any): any;
|
|
248
252
|
toOpenApi(...extra: any[]): any;
|
|
253
|
+
toJSON(): any;
|
|
249
254
|
getAnyType(): {
|
|
250
255
|
type: string[];
|
|
251
256
|
};
|
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;;;;;;;;;;;;kBA8GU,CAAH;oBAEG,CAAR;qBAEU,CAAF;sBAEF,CAAJ
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.js"],"names":[],"mappings":"AAuBA,gEAaC;AAED;;;;;;;;;;;;kBA8GU,CAAH;oBAEG,CAAR;qBAEU,CAAF;sBAEF,CAAJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAlDwB,CAAC;;;;;;;;;;;;;;;;;EAzC5B;AAED;;;;;;;;;;;;;;;;;mBAtBI,CAAA;;;;;;;;;;;;qBAuBC,CAAC;sBAA4B,CAAC;sBACvB,CAAC;wBAA8B,CAAC;wBAEnC,CAAC;;;4BA4BN,CAAD;kCAAyC,CAAC;wBACtC,CAAC;wBAA+B,CAAC;wCAKlC,CAAA;2BAAkC,CAAC;kCACP,CAAC;2BAIhB,CAAC;qBAA4B,CAAC;;;uBAuB/C,CAAA;6BAEA,CAAA;8BAEK,CAAC;6BAAoC,CAAC;0BAClB,CAAC;6BAIjB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBApCgB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBA7DzB,CAAA;;;;;;;;;;;;qBAuBC,CAAC;sBAA4B,CAAC;sBACvB,CAAC;wBAA8B,CAAC;wBAEnC,CAAC;;;4BA4BN,CAAD;kCAAyC,CAAC;wBACtC,CAAC;wBAA+B,CAAC;wCAKlC,CAAA;2BAAkC,CAAC;kCACP,CAAC;2BAIhB,CAAC;qBAA4B,CAAC;;;uBAuB/C,CAAA;6BAEA,CAAA;8BAEK,CAAC;6BAAoC,CAAC;0BAClB,CAAC;6BAIjB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBApCgB,CAAC;;;;;;;;;;;;;;;;;;;;EA1B5B"}
|
package/types/upsert.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upsert.d.ts","sourceRoot":"","sources":["../src/upsert.js"],"names":[],"mappings":"AAAA,+
|
|
1
|
+
{"version":3,"file":"upsert.d.ts","sourceRoot":"","sources":["../src/upsert.js"],"names":[],"mappings":"AAAA,+CAgCC"}
|
|
@@ -25,8 +25,9 @@ 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
|
+
toJsonSchema(extra?: any): any;
|
|
29
29
|
toOpenApi(...extra: any[]): any;
|
|
30
|
+
toJSON(): any;
|
|
30
31
|
getAnyType(): {
|
|
31
32
|
type: string[];
|
|
32
33
|
};
|
|
@@ -113,6 +114,7 @@ export const OBJECT_ID_SCHEMA: {
|
|
|
113
114
|
swift(): /*elided*/ any;
|
|
114
115
|
mongo(): /*elided*/ any;
|
|
115
116
|
calendar(): /*elided*/ any;
|
|
117
|
+
time(): /*elided*/ any;
|
|
116
118
|
format(name: any, fn: any): /*elided*/ any;
|
|
117
119
|
toString(): any;
|
|
118
120
|
assertions: any[];
|
|
@@ -131,8 +133,9 @@ export const OBJECT_ID_SCHEMA: {
|
|
|
131
133
|
validate(value: any, options?: {}): Promise<any>;
|
|
132
134
|
clone(meta: any): /*elided*/ any;
|
|
133
135
|
append(schema: any): import("@bedrockio/yada/types/Schema").default;
|
|
134
|
-
|
|
136
|
+
toJsonSchema(extra?: any): any;
|
|
135
137
|
toOpenApi(...extra: any[]): any;
|
|
138
|
+
toJSON(): any;
|
|
136
139
|
getAnyType(): {
|
|
137
140
|
type: string[];
|
|
138
141
|
};
|
|
@@ -194,8 +197,9 @@ export const NUMBER_RANGE_SCHEMA: {
|
|
|
194
197
|
description(description: any): /*elided*/ any;
|
|
195
198
|
validate(value: any, options?: {}): Promise<any>;
|
|
196
199
|
clone(meta: any): /*elided*/ any;
|
|
197
|
-
|
|
200
|
+
toJsonSchema(extra?: any): any;
|
|
198
201
|
toOpenApi(...extra: any[]): any;
|
|
202
|
+
toJSON(): any;
|
|
199
203
|
getAnyType(): {
|
|
200
204
|
type: string[];
|
|
201
205
|
};
|
|
@@ -255,8 +259,9 @@ export const STRING_RANGE_SCHEMA: {
|
|
|
255
259
|
description(description: any): /*elided*/ any;
|
|
256
260
|
validate(value: any, options?: {}): Promise<any>;
|
|
257
261
|
clone(meta: any): /*elided*/ any;
|
|
258
|
-
|
|
262
|
+
toJsonSchema(extra?: any): any;
|
|
259
263
|
toOpenApi(...extra: any[]): any;
|
|
264
|
+
toJSON(): any;
|
|
260
265
|
getAnyType(): {
|
|
261
266
|
type: string[];
|
|
262
267
|
};
|
|
@@ -316,8 +321,9 @@ export const DATE_RANGE_SCHEMA: {
|
|
|
316
321
|
description(description: any): /*elided*/ any;
|
|
317
322
|
validate(value: any, options?: {}): Promise<any>;
|
|
318
323
|
clone(meta: any): /*elided*/ any;
|
|
319
|
-
|
|
324
|
+
toJsonSchema(extra?: any): any;
|
|
320
325
|
toOpenApi(...extra: any[]): any;
|
|
326
|
+
toJSON(): any;
|
|
321
327
|
getAnyType(): {
|
|
322
328
|
type: string[];
|
|
323
329
|
};
|
|
@@ -378,8 +384,9 @@ export const INCLUDE_FIELD_SCHEMA: {
|
|
|
378
384
|
description(description: any): /*elided*/ any;
|
|
379
385
|
validate(value: any, options?: {}): Promise<any>;
|
|
380
386
|
clone(meta: any): /*elided*/ any;
|
|
381
|
-
|
|
387
|
+
toJsonSchema(extra?: any): any;
|
|
382
388
|
toOpenApi(...extra: any[]): any;
|
|
389
|
+
toJSON(): any;
|
|
383
390
|
getAnyType(): {
|
|
384
391
|
type: string[];
|
|
385
392
|
};
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eA0F4E,CAAC;;;;;;;;;;;;;;;;;;;EA1FnB;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;;;mBAW0D,CAAC;yBAAoC,CAAC;0BAAqC,CAAC;yBAAoC,CAAC;sBAAiC,CAAC;yBAAoC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAZ9N,CAAC;;;;;;;;;;;;;;;;;;;EAhFxE;AAEL;;;;;;;;;;;;kBA0Fmb,CAAC;oBAA+B,CAAC;qBAAgC,CAAC;sBAAiC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAZ3c,CAAC;;;;;;;;;;;;;;;;;EApExE;AAEL;;;;;;;;;;;;kBA8Emb,CAAC;oBAA+B,CAAC;qBAAgC,CAAC;sBAAiC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAZ3c,CAAC;;;;;;;;;;;;;;;;;EAxDxE;AAEL;;;;;;;;;;;;kBAkEmb,CAAC;oBAA+B,CAAC;qBAAgC,CAAC;sBAAiC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAZ3c,CAAC;;;;;;;;;;;;;;;;;EApBxE;AAEL,8EAqBK;AAEL;;;;;;;;;;;;kBAOmb,CAAC;oBAA+B,CAAC;qBAAgC,CAAC;sBAAiC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAZ3c,CAAC;;;;;;;;;;;;;;;;;EAW1E"}
|
|
@@ -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":"AA6DA,kDAEC;AAED,oEA4FC;AAsBD,wEAiBC;AA8SD;;;EAEC;AAED;;;EAOC"}
|