@feathersjs/typebox 5.0.0-pre.35 → 5.0.0-pre.37
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 +14 -0
- package/LICENSE +1 -2
- package/README.md +1 -1
- package/lib/default-schemas.d.ts +55 -5
- package/lib/default-schemas.js +14 -1
- package/lib/default-schemas.js.map +1 -1
- package/lib/index.d.ts +20 -10
- package/lib/index.js +16 -12
- package/lib/index.js.map +1 -1
- package/package.json +5 -5
- package/src/default-schemas.ts +18 -1
- package/src/index.ts +19 -13
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [5.0.0-pre.37](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.36...v5.0.0-pre.37) (2023-02-09)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **typebox:** Allow nested or in and queries ([#3029](https://github.com/feathersjs/feathers/issues/3029)) ([39e0b78](https://github.com/feathersjs/feathers/commit/39e0b785238b809aa9b4dea9b95efc3c188c9baa))
|
|
11
|
+
|
|
12
|
+
# [5.0.0-pre.36](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.35...v5.0.0-pre.36) (2023-01-29)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- **configuration:** Add pool and connection object to SQL database default configuration ([#3023](https://github.com/feathersjs/feathers/issues/3023)) ([092c749](https://github.com/feathersjs/feathers/commit/092c749d43f7da4d019576d1210fe7d3719a44a2))
|
|
17
|
+
- **schema:** Fix TypeBox extension value query syntax inference ([#3010](https://github.com/feathersjs/feathers/issues/3010)) ([f1c7a76](https://github.com/feathersjs/feathers/commit/f1c7a76586bbb8aed66ef866c3dcd666d79f3a24))
|
|
18
|
+
- Update all dependencies ([#3024](https://github.com/feathersjs/feathers/issues/3024)) ([283dc47](https://github.com/feathersjs/feathers/commit/283dc4798d85584bc031e6e54b83b4ea77d1edd0))
|
|
19
|
+
|
|
6
20
|
# [5.0.0-pre.35](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.34...v5.0.0-pre.35) (2023-01-12)
|
|
7
21
|
|
|
8
22
|
### Features
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2023 Feathers Contributors
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
|
22
|
-
|
package/README.md
CHANGED
|
@@ -18,6 +18,6 @@ Refer to the [Feathers documentation](https://docs.feathersjs.com) for more deta
|
|
|
18
18
|
|
|
19
19
|
## License
|
|
20
20
|
|
|
21
|
-
Copyright (c)
|
|
21
|
+
Copyright (c) 2023 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors)
|
|
22
22
|
|
|
23
23
|
Licensed under the [MIT license](LICENSE).
|
package/lib/default-schemas.d.ts
CHANGED
|
@@ -30,7 +30,17 @@ export declare const authenticationSettingsSchema: import("@sinclair/typebox").T
|
|
|
30
30
|
}>;
|
|
31
31
|
export declare const sqlSettingsSchema: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
32
32
|
client: import("@sinclair/typebox").TString<string>;
|
|
33
|
-
connection: import("@sinclair/typebox").TString<string
|
|
33
|
+
connection: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TPartial<import("@sinclair/typebox").TObject<{
|
|
34
|
+
host: import("@sinclair/typebox").TString<string>;
|
|
35
|
+
port: import("@sinclair/typebox").TNumber;
|
|
36
|
+
user: import("@sinclair/typebox").TString<string>;
|
|
37
|
+
password: import("@sinclair/typebox").TString<string>;
|
|
38
|
+
database: import("@sinclair/typebox").TString<string>;
|
|
39
|
+
}>>]>;
|
|
40
|
+
pool: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
41
|
+
min: import("@sinclair/typebox").TNumber;
|
|
42
|
+
max: import("@sinclair/typebox").TNumber;
|
|
43
|
+
}>>;
|
|
34
44
|
}>>;
|
|
35
45
|
export declare const defaultAppConfiguration: import("@sinclair/typebox").TObject<{
|
|
36
46
|
authentication: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
@@ -70,19 +80,59 @@ export declare const defaultAppConfiguration: import("@sinclair/typebox").TObjec
|
|
|
70
80
|
mongodb: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
71
81
|
mysql: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
72
82
|
client: import("@sinclair/typebox").TString<string>;
|
|
73
|
-
connection: import("@sinclair/typebox").TString<string
|
|
83
|
+
connection: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TPartial<import("@sinclair/typebox").TObject<{
|
|
84
|
+
host: import("@sinclair/typebox").TString<string>;
|
|
85
|
+
port: import("@sinclair/typebox").TNumber;
|
|
86
|
+
user: import("@sinclair/typebox").TString<string>;
|
|
87
|
+
password: import("@sinclair/typebox").TString<string>;
|
|
88
|
+
database: import("@sinclair/typebox").TString<string>;
|
|
89
|
+
}>>]>;
|
|
90
|
+
pool: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
91
|
+
min: import("@sinclair/typebox").TNumber;
|
|
92
|
+
max: import("@sinclair/typebox").TNumber;
|
|
93
|
+
}>>;
|
|
74
94
|
}>>;
|
|
75
95
|
postgresql: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
76
96
|
client: import("@sinclair/typebox").TString<string>;
|
|
77
|
-
connection: import("@sinclair/typebox").TString<string
|
|
97
|
+
connection: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TPartial<import("@sinclair/typebox").TObject<{
|
|
98
|
+
host: import("@sinclair/typebox").TString<string>;
|
|
99
|
+
port: import("@sinclair/typebox").TNumber;
|
|
100
|
+
user: import("@sinclair/typebox").TString<string>;
|
|
101
|
+
password: import("@sinclair/typebox").TString<string>;
|
|
102
|
+
database: import("@sinclair/typebox").TString<string>;
|
|
103
|
+
}>>]>;
|
|
104
|
+
pool: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
105
|
+
min: import("@sinclair/typebox").TNumber;
|
|
106
|
+
max: import("@sinclair/typebox").TNumber;
|
|
107
|
+
}>>;
|
|
78
108
|
}>>;
|
|
79
109
|
sqlite: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
80
110
|
client: import("@sinclair/typebox").TString<string>;
|
|
81
|
-
connection: import("@sinclair/typebox").TString<string
|
|
111
|
+
connection: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TPartial<import("@sinclair/typebox").TObject<{
|
|
112
|
+
host: import("@sinclair/typebox").TString<string>;
|
|
113
|
+
port: import("@sinclair/typebox").TNumber;
|
|
114
|
+
user: import("@sinclair/typebox").TString<string>;
|
|
115
|
+
password: import("@sinclair/typebox").TString<string>;
|
|
116
|
+
database: import("@sinclair/typebox").TString<string>;
|
|
117
|
+
}>>]>;
|
|
118
|
+
pool: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
119
|
+
min: import("@sinclair/typebox").TNumber;
|
|
120
|
+
max: import("@sinclair/typebox").TNumber;
|
|
121
|
+
}>>;
|
|
82
122
|
}>>;
|
|
83
123
|
mssql: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
84
124
|
client: import("@sinclair/typebox").TString<string>;
|
|
85
|
-
connection: import("@sinclair/typebox").TString<string
|
|
125
|
+
connection: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TPartial<import("@sinclair/typebox").TObject<{
|
|
126
|
+
host: import("@sinclair/typebox").TString<string>;
|
|
127
|
+
port: import("@sinclair/typebox").TNumber;
|
|
128
|
+
user: import("@sinclair/typebox").TString<string>;
|
|
129
|
+
password: import("@sinclair/typebox").TString<string>;
|
|
130
|
+
database: import("@sinclair/typebox").TString<string>;
|
|
131
|
+
}>>]>;
|
|
132
|
+
pool: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
133
|
+
min: import("@sinclair/typebox").TNumber;
|
|
134
|
+
max: import("@sinclair/typebox").TNumber;
|
|
135
|
+
}>>;
|
|
86
136
|
}>>;
|
|
87
137
|
}>;
|
|
88
138
|
export type DefaultAppConfiguration = Static<typeof defaultAppConfiguration>;
|
package/lib/default-schemas.js
CHANGED
|
@@ -41,7 +41,20 @@ exports.authenticationSettingsSchema = typebox_1.Type.Object({
|
|
|
41
41
|
});
|
|
42
42
|
exports.sqlSettingsSchema = typebox_1.Type.Optional(typebox_1.Type.Object({
|
|
43
43
|
client: typebox_1.Type.String(),
|
|
44
|
-
connection: typebox_1.Type.
|
|
44
|
+
connection: typebox_1.Type.Union([
|
|
45
|
+
typebox_1.Type.String(),
|
|
46
|
+
typebox_1.Type.Partial(typebox_1.Type.Object({
|
|
47
|
+
host: typebox_1.Type.String(),
|
|
48
|
+
port: typebox_1.Type.Number(),
|
|
49
|
+
user: typebox_1.Type.String(),
|
|
50
|
+
password: typebox_1.Type.String(),
|
|
51
|
+
database: typebox_1.Type.String()
|
|
52
|
+
}))
|
|
53
|
+
]),
|
|
54
|
+
pool: typebox_1.Type.Optional(typebox_1.Type.Object({
|
|
55
|
+
min: typebox_1.Type.Number(),
|
|
56
|
+
max: typebox_1.Type.Number()
|
|
57
|
+
}))
|
|
45
58
|
}));
|
|
46
59
|
exports.defaultAppConfiguration = typebox_1.Type.Object({
|
|
47
60
|
authentication: typebox_1.Type.Optional(exports.authenticationSettingsSchema),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-schemas.js","sourceRoot":"","sources":["../src/default-schemas.ts"],"names":[],"mappings":";;;AAAA,+CAAgD;AAEnC,QAAA,4BAA4B,GAAG,cAAI,CAAC,MAAM,CAAC;IACtD,MAAM,EAAE,cAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;IAC9D,MAAM,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,mDAAmD,EAAE,CAAC,CAAC;IACxG,QAAQ,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,mDAAmD,EAAE,CAAC,CAAC;IAC1G,OAAO,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC,CAAC;IACtF,cAAc,EAAE,cAAI,CAAC,KAAK,CAAC,cAAI,CAAC,MAAM,EAAE,EAAE;QACxC,WAAW,EAAE,sFAAsF;KACpG,CAAC;IACF,eAAe,EAAE,cAAI,CAAC,QAAQ,CAC5B,cAAI,CAAC,KAAK,CAAC,cAAI,CAAC,MAAM,EAAE,EAAE;QACxB,WAAW,EACT,sIAAsI;KACzI,CAAC,CACH;IACD,UAAU,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC1C,GAAG,EAAE,cAAI,CAAC,QAAQ,CAChB,cAAI,CAAC,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,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,KAAK,CAAC,cAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IACjD,OAAO,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,EAAE,CAAC;IACrC,KAAK,EAAE,yBAAiB;IACxB,UAAU,EAAE,yBAAiB;IAC7B,MAAM,EAAE,yBAAiB;IACzB,KAAK,EAAE,yBAAiB;CACzB,EACD,EAAE,GAAG,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,KAAK,EAAE,CACjE,CAAA"}
|
package/lib/index.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ export declare function sortDefinition<T extends TObject>(schema: T): TObject<T[
|
|
|
49
49
|
*/
|
|
50
50
|
export declare const queryProperty: <T extends TSchema, X extends {
|
|
51
51
|
[key: string]: TSchema;
|
|
52
|
-
}>(def: T, extension?: X) => TOptional<import("@sinclair/typebox").TUnion<[T, import("@sinclair/typebox").TPartial<TObject<{
|
|
52
|
+
}>(def: T, extension?: X) => TOptional<import("@sinclair/typebox").TUnion<[T, import("@sinclair/typebox").TPartial<TIntersect<[TObject<{
|
|
53
53
|
$gt: T;
|
|
54
54
|
$gte: T;
|
|
55
55
|
$lt: T;
|
|
@@ -57,7 +57,7 @@ export declare const queryProperty: <T extends TSchema, X extends {
|
|
|
57
57
|
$ne: T;
|
|
58
58
|
$in: import("@sinclair/typebox").TArray<T>;
|
|
59
59
|
$nin: import("@sinclair/typebox").TArray<T>;
|
|
60
|
-
}
|
|
60
|
+
}>, TObject<X>]>>]>>;
|
|
61
61
|
/**
|
|
62
62
|
* Creates a Feathers query syntax schema for the properties defined in `definition`.
|
|
63
63
|
*
|
|
@@ -67,7 +67,7 @@ export declare const queryProperty: <T extends TSchema, X extends {
|
|
|
67
67
|
*/
|
|
68
68
|
export declare const queryProperties: <T extends TObject<import("@sinclair/typebox").TProperties>, X extends T["properties"] extends infer T_1 ? { [K in keyof T_1]?: {
|
|
69
69
|
[key: string]: TSchema;
|
|
70
|
-
}; } : never>(definition: T, extensions?: X) => TOptional<TObject<T["properties"] extends infer T_2 ? { [K_1 in keyof T_2]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_1], import("@sinclair/typebox").TPartial<TObject<{
|
|
70
|
+
}; } : never>(definition: T, extensions?: X) => TOptional<TObject<T["properties"] extends infer T_2 ? { [K_1 in keyof T_2]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_1], import("@sinclair/typebox").TPartial<TIntersect<[TObject<{
|
|
71
71
|
$gt: T["properties"][K_1];
|
|
72
72
|
$gte: T["properties"][K_1];
|
|
73
73
|
$lt: T["properties"][K_1];
|
|
@@ -75,7 +75,7 @@ export declare const queryProperties: <T extends TObject<import("@sinclair/typeb
|
|
|
75
75
|
$ne: T["properties"][K_1];
|
|
76
76
|
$in: import("@sinclair/typebox").TArray<T["properties"][K_1]>;
|
|
77
77
|
$nin: import("@sinclair/typebox").TArray<T["properties"][K_1]>;
|
|
78
|
-
}
|
|
78
|
+
}>, TObject<X[K_1]>]>>]>>; } : never>>;
|
|
79
79
|
/**
|
|
80
80
|
* Creates a TypeBox schema for the complete Feathers query syntax including `$limit`, $skip`, `$or`
|
|
81
81
|
* and `$sort` and `$select` for the allowed properties.
|
|
@@ -92,7 +92,7 @@ export declare const querySyntax: <T extends TObject<import("@sinclair/typebox")
|
|
|
92
92
|
$skip: import("@sinclair/typebox").TNumber;
|
|
93
93
|
$sort: TObject<T["properties"] extends infer T_2 ? { [K_1 in keyof T_2]: TOptional<TInteger>; } : never>;
|
|
94
94
|
$select: import("@sinclair/typebox").TUnsafe<(keyof T["properties"])[]>;
|
|
95
|
-
$
|
|
95
|
+
$and: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[TOptional<TObject<T["properties"] extends infer T_3 ? { [K_2 in keyof T_3]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_2], import("@sinclair/typebox").TPartial<TIntersect<[TObject<{
|
|
96
96
|
$gt: T["properties"][K_2];
|
|
97
97
|
$gte: T["properties"][K_2];
|
|
98
98
|
$lt: T["properties"][K_2];
|
|
@@ -100,8 +100,18 @@ export declare const querySyntax: <T extends TObject<import("@sinclair/typebox")
|
|
|
100
100
|
$ne: T["properties"][K_2];
|
|
101
101
|
$in: import("@sinclair/typebox").TArray<T["properties"][K_2]>;
|
|
102
102
|
$nin: import("@sinclair/typebox").TArray<T["properties"][K_2]>;
|
|
103
|
-
}
|
|
104
|
-
|
|
103
|
+
}>, TObject<X[K_2]>]>>]>>; } : never>>, TObject<{
|
|
104
|
+
$or: import("@sinclair/typebox").TArray<TOptional<TObject<T["properties"] extends infer T_3 ? { [K_2 in keyof T_3]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_2], import("@sinclair/typebox").TPartial<TIntersect<[TObject<{
|
|
105
|
+
$gt: T["properties"][K_2];
|
|
106
|
+
$gte: T["properties"][K_2];
|
|
107
|
+
$lt: T["properties"][K_2];
|
|
108
|
+
$lte: T["properties"][K_2];
|
|
109
|
+
$ne: T["properties"][K_2];
|
|
110
|
+
$in: import("@sinclair/typebox").TArray<T["properties"][K_2]>;
|
|
111
|
+
$nin: import("@sinclair/typebox").TArray<T["properties"][K_2]>;
|
|
112
|
+
}>, TObject<X[K_2]>]>>]>>; } : never>>>;
|
|
113
|
+
}>]>>;
|
|
114
|
+
$or: import("@sinclair/typebox").TArray<TOptional<TObject<T["properties"] extends infer T_3 ? { [K_2 in keyof T_3]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_2], import("@sinclair/typebox").TPartial<TIntersect<[TObject<{
|
|
105
115
|
$gt: T["properties"][K_2];
|
|
106
116
|
$gte: T["properties"][K_2];
|
|
107
117
|
$lt: T["properties"][K_2];
|
|
@@ -109,8 +119,8 @@ export declare const querySyntax: <T extends TObject<import("@sinclair/typebox")
|
|
|
109
119
|
$ne: T["properties"][K_2];
|
|
110
120
|
$in: import("@sinclair/typebox").TArray<T["properties"][K_2]>;
|
|
111
121
|
$nin: import("@sinclair/typebox").TArray<T["properties"][K_2]>;
|
|
112
|
-
}
|
|
113
|
-
}>>, TOptional<TObject<T["properties"] extends infer T_4 ? { [K_2 in keyof T_4]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_2], import("@sinclair/typebox").TPartial<TObject<{
|
|
122
|
+
}>, TObject<X[K_2]>]>>]>>; } : never>>>;
|
|
123
|
+
}>>, TOptional<TObject<T["properties"] extends infer T_4 ? { [K_2 in keyof T_4]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_2], import("@sinclair/typebox").TPartial<TIntersect<[TObject<{
|
|
114
124
|
$gt: T["properties"][K_2];
|
|
115
125
|
$gte: T["properties"][K_2];
|
|
116
126
|
$lt: T["properties"][K_2];
|
|
@@ -118,4 +128,4 @@ export declare const querySyntax: <T extends TObject<import("@sinclair/typebox")
|
|
|
118
128
|
$ne: T["properties"][K_2];
|
|
119
129
|
$in: import("@sinclair/typebox").TArray<T["properties"][K_2]>;
|
|
120
130
|
$nin: import("@sinclair/typebox").TArray<T["properties"][K_2]>;
|
|
121
|
-
}
|
|
131
|
+
}>, TObject<X[K_2]>]>>]>>; } : never>>]>;
|
package/lib/index.js
CHANGED
|
@@ -85,16 +85,18 @@ exports.sortDefinition = sortDefinition;
|
|
|
85
85
|
*/
|
|
86
86
|
const queryProperty = (def, extension = {}) => typebox_1.Type.Optional(typebox_1.Type.Union([
|
|
87
87
|
def,
|
|
88
|
-
typebox_1.Type.Partial(typebox_1.Type.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
88
|
+
typebox_1.Type.Partial(typebox_1.Type.Intersect([
|
|
89
|
+
typebox_1.Type.Object({
|
|
90
|
+
$gt: def,
|
|
91
|
+
$gte: def,
|
|
92
|
+
$lt: def,
|
|
93
|
+
$lte: def,
|
|
94
|
+
$ne: def,
|
|
95
|
+
$in: typebox_1.Type.Array(def),
|
|
96
|
+
$nin: typebox_1.Type.Array(def)
|
|
97
|
+
}),
|
|
98
|
+
typebox_1.Type.Object(extension)
|
|
99
|
+
], { additionalProperties: false }))
|
|
98
100
|
]));
|
|
99
101
|
exports.queryProperty = queryProperty;
|
|
100
102
|
/**
|
|
@@ -128,14 +130,16 @@ exports.queryProperties = queryProperties;
|
|
|
128
130
|
*/
|
|
129
131
|
const querySyntax = (type, extensions = {}, options = { additionalProperties: false }) => {
|
|
130
132
|
const propertySchema = (0, exports.queryProperties)(type, extensions);
|
|
133
|
+
const $or = typebox_1.Type.Array(propertySchema);
|
|
134
|
+
const $and = typebox_1.Type.Array(typebox_1.Type.Union([propertySchema, typebox_1.Type.Object({ $or })]));
|
|
131
135
|
return typebox_1.Type.Intersect([
|
|
132
136
|
typebox_1.Type.Partial(typebox_1.Type.Object({
|
|
133
137
|
$limit: typebox_1.Type.Number({ minimum: 0 }),
|
|
134
138
|
$skip: typebox_1.Type.Number({ minimum: 0 }),
|
|
135
139
|
$sort: sortDefinition(type),
|
|
136
140
|
$select: arrayOfKeys(type),
|
|
137
|
-
$
|
|
138
|
-
$
|
|
141
|
+
$and,
|
|
142
|
+
$or
|
|
139
143
|
}, { additionalProperties: false })),
|
|
140
144
|
propertySchema
|
|
141
145
|
], options);
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,+CAA0G;AAC1G,+CAAiF;AAEjF,oDAAiC;AACjC,oDAAiC;AAQjC;;;;;;GAMG;AACI,MAAM,YAAY,GAAG,CAAiB,MAAe,EAAE,SAAc,EAAmB,EAAE,CAC/F,mBAAU,CAAC,YAAY,CAAC,MAAa,EAAE,SAAS,CAAC,CAAA;AADtC,QAAA,YAAY,gBAC0B;AAEnD;;;;;;;;;GASG;AACI,MAAM,gBAAgB,GAAG,CAAC,GAA6B,EAAE,SAA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E,OAAO,cAAI,CAAC,SAAS,CACnB;QACE,cAAI,CAAC,OAAO,CACV,cAAI,CAAC,MAAM,CACT;YACE,MAAM,EAAE,cAAI,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;YACnC,KAAK,EAAE,cAAI,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;YAClC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC;YAC3B,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC;YAC1B,IAAI;YACJ,GAAG;SACJ,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAChC,CACF;QACD,cAAc;KACf,EACD,OAAO,CACR,CAAA;AACH,CAAC,CAAA;AA/BY,QAAA,WAAW,eA+BvB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feathersjs/typebox",
|
|
3
3
|
"description": "TypeBox integration for @feathersjs/schema",
|
|
4
|
-
"version": "5.0.0-pre.
|
|
4
|
+
"version": "5.0.0-pre.37",
|
|
5
5
|
"homepage": "https://feathersjs.com",
|
|
6
6
|
"main": "lib/",
|
|
7
7
|
"types": "lib/",
|
|
@@ -54,15 +54,15 @@
|
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@feathersjs/schema": "^5.0.0-pre.
|
|
58
|
-
"@sinclair/typebox": "^0.25.
|
|
57
|
+
"@feathersjs/schema": "^5.0.0-pre.37",
|
|
58
|
+
"@sinclair/typebox": "^0.25.21"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/mocha": "^10.0.1",
|
|
62
62
|
"@types/node": "^18.11.18",
|
|
63
63
|
"mocha": "^10.2.0",
|
|
64
64
|
"shx": "^0.3.4",
|
|
65
|
-
"typescript": "^4.9.
|
|
65
|
+
"typescript": "^4.9.5"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "17a8b3b2614876772472d3cab3d96d45c01db6ed"
|
|
68
68
|
}
|
package/src/default-schemas.ts
CHANGED
|
@@ -58,7 +58,24 @@ export const authenticationSettingsSchema = Type.Object({
|
|
|
58
58
|
export const sqlSettingsSchema = Type.Optional(
|
|
59
59
|
Type.Object({
|
|
60
60
|
client: Type.String(),
|
|
61
|
-
connection: Type.
|
|
61
|
+
connection: Type.Union([
|
|
62
|
+
Type.String(),
|
|
63
|
+
Type.Partial(
|
|
64
|
+
Type.Object({
|
|
65
|
+
host: Type.String(),
|
|
66
|
+
port: Type.Number(),
|
|
67
|
+
user: Type.String(),
|
|
68
|
+
password: Type.String(),
|
|
69
|
+
database: Type.String()
|
|
70
|
+
})
|
|
71
|
+
)
|
|
72
|
+
]),
|
|
73
|
+
pool: Type.Optional(
|
|
74
|
+
Type.Object({
|
|
75
|
+
min: Type.Number(),
|
|
76
|
+
max: Type.Number()
|
|
77
|
+
})
|
|
78
|
+
)
|
|
62
79
|
})
|
|
63
80
|
)
|
|
64
81
|
|
package/src/index.ts
CHANGED
|
@@ -88,17 +88,21 @@ export const queryProperty = <T extends TSchema, X extends { [key: string]: TSch
|
|
|
88
88
|
Type.Union([
|
|
89
89
|
def,
|
|
90
90
|
Type.Partial(
|
|
91
|
-
Type.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
91
|
+
Type.Intersect(
|
|
92
|
+
[
|
|
93
|
+
Type.Object({
|
|
94
|
+
$gt: def,
|
|
95
|
+
$gte: def,
|
|
96
|
+
$lt: def,
|
|
97
|
+
$lte: def,
|
|
98
|
+
$ne: def,
|
|
99
|
+
$in: Type.Array(def),
|
|
100
|
+
$nin: Type.Array(def)
|
|
101
|
+
}),
|
|
102
|
+
Type.Object(extension)
|
|
103
|
+
],
|
|
104
|
+
{ additionalProperties: false }
|
|
105
|
+
)
|
|
102
106
|
)
|
|
103
107
|
])
|
|
104
108
|
)
|
|
@@ -155,6 +159,8 @@ export const querySyntax = <
|
|
|
155
159
|
options: ObjectOptions = { additionalProperties: false }
|
|
156
160
|
) => {
|
|
157
161
|
const propertySchema = queryProperties(type, extensions)
|
|
162
|
+
const $or = Type.Array(propertySchema)
|
|
163
|
+
const $and = Type.Array(Type.Union([propertySchema, Type.Object({ $or })]))
|
|
158
164
|
|
|
159
165
|
return Type.Intersect(
|
|
160
166
|
[
|
|
@@ -165,8 +171,8 @@ export const querySyntax = <
|
|
|
165
171
|
$skip: Type.Number({ minimum: 0 }),
|
|
166
172
|
$sort: sortDefinition(type),
|
|
167
173
|
$select: arrayOfKeys(type),
|
|
168
|
-
$
|
|
169
|
-
$
|
|
174
|
+
$and,
|
|
175
|
+
$or
|
|
170
176
|
},
|
|
171
177
|
{ additionalProperties: false }
|
|
172
178
|
)
|