@feathersjs/typebox 5.0.0 → 5.0.3
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 +13 -0
- package/lib/default-schemas.d.ts +37 -37
- package/lib/default-schemas.js +4 -1
- package/lib/default-schemas.js.map +1 -1
- package/lib/index.d.ts +69 -64
- package/lib/index.js +5 -1
- package/lib/index.js.map +1 -1
- package/package.json +6 -6
- package/src/default-schemas.ts +6 -1
- package/src/index.ts +10 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
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.3](https://github.com/feathersjs/feathers/compare/v5.0.2...v5.0.3) (2023-04-05)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **authentication:** Ensure authentication.entity configuration can be null ([#3136](https://github.com/feathersjs/feathers/issues/3136)) ([c47349b](https://github.com/feathersjs/feathers/commit/c47349b9dcf2067b7b572c5463b15b2a8fbda972))
|
|
11
|
+
- **dependencies:** Update all dependencies ([#3139](https://github.com/feathersjs/feathers/issues/3139)) ([f24276e](https://github.com/feathersjs/feathers/commit/f24276e9a909e2e58a0730c730258ce1f70f4028))
|
|
12
|
+
- **knex:** Get by id and transactions should work with params.knex ([#3146](https://github.com/feathersjs/feathers/issues/3146)) ([b172b5e](https://github.com/feathersjs/feathers/commit/b172b5ea9b461642874eb7d2ba01dc4cfc275155))
|
|
13
|
+
- **typebox:** Upgrade to TypeBox 0.26.0 ([#3113](https://github.com/feathersjs/feathers/issues/3113)) ([d1d9598](https://github.com/feathersjs/feathers/commit/d1d95984dd94d2b9305e7338421f84f9c4f733fd))
|
|
14
|
+
|
|
15
|
+
## [5.0.1](https://github.com/feathersjs/feathers/compare/v5.0.0...v5.0.1) (2023-03-15)
|
|
16
|
+
|
|
17
|
+
**Note:** Version bump only for package @feathersjs/typebox
|
|
18
|
+
|
|
6
19
|
# [5.0.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.38...v5.0.0) (2023-02-24)
|
|
7
20
|
|
|
8
21
|
**Note:** Version bump only for package @feathersjs/typebox
|
package/lib/default-schemas.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Static } from '@sinclair/typebox';
|
|
2
2
|
export declare const authenticationSettingsSchema: import("@sinclair/typebox").TObject<{
|
|
3
3
|
secret: import("@sinclair/typebox").TString<string>;
|
|
4
|
-
entity: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
4
|
+
entity: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TNull]>>;
|
|
5
5
|
entityId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
6
6
|
service: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
7
7
|
authStrategies: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString<string>>;
|
|
@@ -30,13 +30,13 @@ 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").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").
|
|
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
|
-
}
|
|
33
|
+
connection: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TObject<{
|
|
34
|
+
host: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
35
|
+
port: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
36
|
+
user: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
37
|
+
password: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
38
|
+
database: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
39
|
+
}>]>;
|
|
40
40
|
pool: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
41
41
|
min: import("@sinclair/typebox").TNumber;
|
|
42
42
|
max: import("@sinclair/typebox").TNumber;
|
|
@@ -45,7 +45,7 @@ export declare const sqlSettingsSchema: import("@sinclair/typebox").TOptional<im
|
|
|
45
45
|
export declare const defaultAppConfiguration: import("@sinclair/typebox").TObject<{
|
|
46
46
|
authentication: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
47
47
|
secret: import("@sinclair/typebox").TString<string>;
|
|
48
|
-
entity: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
48
|
+
entity: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TNull]>>;
|
|
49
49
|
entityId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
50
50
|
service: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
51
51
|
authStrategies: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString<string>>;
|
|
@@ -80,13 +80,13 @@ export declare const defaultAppConfiguration: import("@sinclair/typebox").TObjec
|
|
|
80
80
|
mongodb: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
81
81
|
mysql: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
82
82
|
client: import("@sinclair/typebox").TString<string>;
|
|
83
|
-
connection: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").
|
|
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
|
-
}
|
|
83
|
+
connection: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TObject<{
|
|
84
|
+
host: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
85
|
+
port: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
86
|
+
user: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
87
|
+
password: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
88
|
+
database: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
89
|
+
}>]>;
|
|
90
90
|
pool: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
91
91
|
min: import("@sinclair/typebox").TNumber;
|
|
92
92
|
max: import("@sinclair/typebox").TNumber;
|
|
@@ -94,13 +94,13 @@ export declare const defaultAppConfiguration: import("@sinclair/typebox").TObjec
|
|
|
94
94
|
}>>;
|
|
95
95
|
postgresql: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
96
96
|
client: import("@sinclair/typebox").TString<string>;
|
|
97
|
-
connection: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").
|
|
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
|
-
}
|
|
97
|
+
connection: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TObject<{
|
|
98
|
+
host: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
99
|
+
port: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
100
|
+
user: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
101
|
+
password: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
102
|
+
database: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
103
|
+
}>]>;
|
|
104
104
|
pool: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
105
105
|
min: import("@sinclair/typebox").TNumber;
|
|
106
106
|
max: import("@sinclair/typebox").TNumber;
|
|
@@ -108,13 +108,13 @@ export declare const defaultAppConfiguration: import("@sinclair/typebox").TObjec
|
|
|
108
108
|
}>>;
|
|
109
109
|
sqlite: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
110
110
|
client: import("@sinclair/typebox").TString<string>;
|
|
111
|
-
connection: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").
|
|
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
|
-
}
|
|
111
|
+
connection: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TObject<{
|
|
112
|
+
host: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
113
|
+
port: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
114
|
+
user: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
115
|
+
password: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
116
|
+
database: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
117
|
+
}>]>;
|
|
118
118
|
pool: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
119
119
|
min: import("@sinclair/typebox").TNumber;
|
|
120
120
|
max: import("@sinclair/typebox").TNumber;
|
|
@@ -122,13 +122,13 @@ export declare const defaultAppConfiguration: import("@sinclair/typebox").TObjec
|
|
|
122
122
|
}>>;
|
|
123
123
|
mssql: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
124
124
|
client: import("@sinclair/typebox").TString<string>;
|
|
125
|
-
connection: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").
|
|
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
|
-
}
|
|
125
|
+
connection: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TObject<{
|
|
126
|
+
host: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
127
|
+
port: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
128
|
+
user: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
129
|
+
password: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
130
|
+
database: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
|
|
131
|
+
}>]>;
|
|
132
132
|
pool: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
133
133
|
min: import("@sinclair/typebox").TNumber;
|
|
134
134
|
max: import("@sinclair/typebox").TNumber;
|
package/lib/default-schemas.js
CHANGED
|
@@ -4,7 +4,10 @@ exports.defaultAppConfiguration = exports.sqlSettingsSchema = exports.authentica
|
|
|
4
4
|
const typebox_1 = require("@sinclair/typebox");
|
|
5
5
|
exports.authenticationSettingsSchema = typebox_1.Type.Object({
|
|
6
6
|
secret: typebox_1.Type.String({ description: 'The JWT signing secret' }),
|
|
7
|
-
entity: typebox_1.Type.Optional(typebox_1.Type.
|
|
7
|
+
entity: typebox_1.Type.Optional(typebox_1.Type.Union([
|
|
8
|
+
typebox_1.Type.String({ description: 'The name of the authentication entity (e.g. user)' }),
|
|
9
|
+
typebox_1.Type.Null()
|
|
10
|
+
])),
|
|
8
11
|
entityId: typebox_1.Type.Optional(typebox_1.Type.String({ description: 'The name of the authentication entity id property' })),
|
|
9
12
|
service: typebox_1.Type.Optional(typebox_1.Type.String({ description: 'The path of the entity service' })),
|
|
10
13
|
authStrategies: typebox_1.Type.Array(typebox_1.Type.String(), {
|
|
@@ -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;
|
|
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,CACnB,cAA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I,CAAC,MAAM,EAAE;YACnB,IAAI,EAAE,cAAI,CAAC,MAAM,EAAE;YACnB,QAAQ,EAAE,cAAI,CAAC,MAAM,EAAE;YACvB,QAAQ,EAAE,cAAI,CAAC,MAAM,EAAE;SACxB,CAAC,CACH;KACF,CAAC;IACF,IAAI,EAAE,cAAI,CAAC,QAAQ,CACjB,cAAI,CAAC,MAAM,CAAC;QACV,GAAG,EAAE,cAAI,CAAC,MAAM,EAAE;QAClB,GAAG,EAAE,cAAI,CAAC,MAAM,EAAE;KACnB,CAAC,CACH;CACF,CAAC,CACH,CAAA;AAEY,QAAA,uBAAuB,GAAG,cAAI,CAAC,MAAM,CAChD;IACE,cAAc,EAAE,cAAI,CAAC,QAAQ,CAAC,oCAA4B,CAAC;IAC3D,QAAQ,EAAE,cAAI,CAAC,QAAQ,CACrB,cAAI,CAAC,MAAM,CACT;QACE,OAAO,EAAE,cAAI,CAAC,MAAM,EAAE;QACtB,GAAG,EAAE,cAAI,CAAC,MAAM,EAAE;KACnB,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAChC,CACF;IACD,OAAO,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
|
@@ -2,6 +2,11 @@ import { TObject, TInteger, TOptional, TSchema, TIntersect, ObjectOptions } from
|
|
|
2
2
|
import { Validator, DataValidatorMap, Ajv } from '@feathersjs/schema';
|
|
3
3
|
export * from '@sinclair/typebox';
|
|
4
4
|
export * from './default-schemas';
|
|
5
|
+
export declare const Intersect: {
|
|
6
|
+
(allOf: [], options?: import("@sinclair/typebox").SchemaOptions): import("@sinclair/typebox").TNever;
|
|
7
|
+
<T extends [TSchema]>(allOf: [...T], options?: import("@sinclair/typebox").SchemaOptions): T[0];
|
|
8
|
+
<T_1 extends TSchema[]>(allOf: [...T_1], options?: import("@sinclair/typebox").IntersectOptions): TIntersect<T_1>;
|
|
9
|
+
};
|
|
5
10
|
export type TDataSchemaMap = {
|
|
6
11
|
create: TObject;
|
|
7
12
|
update?: TObject;
|
|
@@ -14,7 +19,7 @@ export type TDataSchemaMap = {
|
|
|
14
19
|
* @param validator The AJV validation instance
|
|
15
20
|
* @returns A compiled validation function
|
|
16
21
|
*/
|
|
17
|
-
export declare const getValidator: <T = any, R = T>(schema: TObject, validator: Ajv) => Validator<T, R>;
|
|
22
|
+
export declare const getValidator: <T = any, R = T>(schema: TObject | TIntersect, validator: Ajv) => Validator<T, R>;
|
|
18
23
|
/**
|
|
19
24
|
* Returns compiled validation functions to validate data for the `create`, `update` and `patch`
|
|
20
25
|
* service methods. If not passed explicitly, the `update` validator will be the same as the `create`
|
|
@@ -38,7 +43,7 @@ export declare function StringEnum<T extends string[]>(allowedValues: [...T]): i
|
|
|
38
43
|
* @param schema The TypeBox object schema
|
|
39
44
|
* @returns The `$sort` syntax schema
|
|
40
45
|
*/
|
|
41
|
-
export declare function sortDefinition<T extends TObject>(schema: T): TObject<T["properties"] extends infer T_1 ? { [K in keyof T_1]: TOptional<TInteger>; } : never>;
|
|
46
|
+
export declare function sortDefinition<T extends TObject | TIntersect>(schema: T): TObject<T["properties"] extends infer T_1 ? { [K in keyof T_1]: TOptional<TInteger>; } : never>;
|
|
42
47
|
/**
|
|
43
48
|
* Returns the standard Feathers query syntax for a property schema,
|
|
44
49
|
* including operators like `$gt`, `$lt` etc. for a single property
|
|
@@ -49,15 +54,15 @@ export declare function sortDefinition<T extends TObject>(schema: T): TObject<T[
|
|
|
49
54
|
*/
|
|
50
55
|
export declare const queryProperty: <T extends TSchema, X extends {
|
|
51
56
|
[key: string]: TSchema;
|
|
52
|
-
}>(def: T, extension?: X) => TOptional<import("@sinclair/typebox").TUnion<[T, import("@sinclair/typebox").
|
|
53
|
-
$gt: T
|
|
54
|
-
$gte: T
|
|
55
|
-
$lt: T
|
|
56
|
-
$lte: T
|
|
57
|
-
$ne: T
|
|
58
|
-
$in: import("@sinclair/typebox").TArray<T
|
|
59
|
-
$nin: import("@sinclair/typebox").TArray<T
|
|
60
|
-
}
|
|
57
|
+
}>(def: T, extension?: X) => TOptional<import("@sinclair/typebox").TUnion<[T, TIntersect<[TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").Assert<{
|
|
58
|
+
$gt: T extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T>;
|
|
59
|
+
$gte: T extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T>;
|
|
60
|
+
$lt: T extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T>;
|
|
61
|
+
$lte: T extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T>;
|
|
62
|
+
$ne: T extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T>;
|
|
63
|
+
$in: TOptional<import("@sinclair/typebox").TArray<T>>;
|
|
64
|
+
$nin: TOptional<import("@sinclair/typebox").TArray<T>>;
|
|
65
|
+
}, import("@sinclair/typebox").TProperties>>>, TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").Assert<{ [K in keyof X]: X[K] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : X[K] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : X[K] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<X[K]>; }, import("@sinclair/typebox").TProperties>>>]>]>>;
|
|
61
66
|
/**
|
|
62
67
|
* Creates a Feathers query syntax schema for the properties defined in `definition`.
|
|
63
68
|
*
|
|
@@ -65,17 +70,17 @@ export declare const queryProperty: <T extends TSchema, X extends {
|
|
|
65
70
|
* @param extensions Additional properties to add to a property query
|
|
66
71
|
* @returns The Feathers query syntax schema
|
|
67
72
|
*/
|
|
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]?: {
|
|
73
|
+
export declare const queryProperties: <T extends TObject<import("@sinclair/typebox").TProperties> | TIntersect<TSchema[]>, X extends T["properties"] extends infer T_1 ? { [K in keyof T_1]?: {
|
|
69
74
|
[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").
|
|
71
|
-
$gt: T["properties"][K_1]
|
|
72
|
-
$gte: T["properties"][K_1]
|
|
73
|
-
$lt: T["properties"][K_1]
|
|
74
|
-
$lte: T["properties"][K_1]
|
|
75
|
-
$ne: T["properties"][K_1]
|
|
76
|
-
$in: import("@sinclair/typebox").TArray<T["properties"][K_1]
|
|
77
|
-
$nin: import("@sinclair/typebox").TArray<T["properties"][K_1]
|
|
78
|
-
}
|
|
75
|
+
}; } : 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], TIntersect<[TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").Assert<{
|
|
76
|
+
$gt: T["properties"][K_1] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_1] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_1] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_1]>;
|
|
77
|
+
$gte: T["properties"][K_1] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_1] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_1] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_1]>;
|
|
78
|
+
$lt: T["properties"][K_1] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_1] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_1] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_1]>;
|
|
79
|
+
$lte: T["properties"][K_1] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_1] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_1] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_1]>;
|
|
80
|
+
$ne: T["properties"][K_1] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_1] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_1] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_1]>;
|
|
81
|
+
$in: TOptional<import("@sinclair/typebox").TArray<T["properties"][K_1]>>;
|
|
82
|
+
$nin: TOptional<import("@sinclair/typebox").TArray<T["properties"][K_1]>>;
|
|
83
|
+
}, import("@sinclair/typebox").TProperties>>>, TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").Assert<X[K_1] extends infer T_3 extends import("@sinclair/typebox").TProperties ? { [K_2 in keyof T_3]: X[K_1][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : X[K_1][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : X[K_1][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<X[K_1][K_2]>; } : never, import("@sinclair/typebox").TProperties>>>]>]>>; } : never>>;
|
|
79
84
|
/**
|
|
80
85
|
* Creates a TypeBox schema for the complete Feathers query syntax including `$limit`, $skip`, `$or`
|
|
81
86
|
* and `$sort` and `$select` for the allowed properties.
|
|
@@ -85,48 +90,48 @@ export declare const queryProperties: <T extends TObject<import("@sinclair/typeb
|
|
|
85
90
|
* @param options Options for the TypeBox object schema
|
|
86
91
|
* @returns A TypeBox object representing the complete Feathers query syntax for the given properties
|
|
87
92
|
*/
|
|
88
|
-
export declare const querySyntax: <T extends TObject<import("@sinclair/typebox").TProperties> | TIntersect<
|
|
93
|
+
export declare const querySyntax: <T extends TObject<import("@sinclair/typebox").TProperties> | TIntersect<TSchema[]>, X extends T["properties"] extends infer T_1 ? { [K in keyof T_1]?: {
|
|
89
94
|
[key: string]: TSchema;
|
|
90
|
-
}; } : never>(type: T, extensions?: X, options?: ObjectOptions) => TIntersect<[
|
|
91
|
-
$limit: import("@sinclair/typebox").TNumber
|
|
92
|
-
$skip: import("@sinclair/typebox").TNumber
|
|
93
|
-
$sort: TObject<T["properties"] extends infer T_2 ? { [K_1 in keyof T_2]: TOptional<TInteger>; } : never
|
|
94
|
-
$select: import("@sinclair/typebox").TUnsafe<(keyof T["properties"])[]
|
|
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").
|
|
96
|
-
$gt: T["properties"][K_2]
|
|
97
|
-
$gte: T["properties"][K_2]
|
|
98
|
-
$lt: T["properties"][K_2]
|
|
99
|
-
$lte: T["properties"][K_2]
|
|
100
|
-
$ne: T["properties"][K_2]
|
|
101
|
-
$in: import("@sinclair/typebox").TArray<T["properties"][K_2]
|
|
102
|
-
$nin: import("@sinclair/typebox").TArray<T["properties"][K_2]
|
|
103
|
-
}
|
|
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").
|
|
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
|
-
}
|
|
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").
|
|
115
|
-
$gt: T["properties"][K_2]
|
|
116
|
-
$gte: T["properties"][K_2]
|
|
117
|
-
$lt: T["properties"][K_2]
|
|
118
|
-
$lte: T["properties"][K_2]
|
|
119
|
-
$ne: T["properties"][K_2]
|
|
120
|
-
$in: import("@sinclair/typebox").TArray<T["properties"][K_2]
|
|
121
|
-
$nin: import("@sinclair/typebox").TArray<T["properties"][K_2]
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
$gt: T["properties"][K_2]
|
|
125
|
-
$gte: T["properties"][K_2]
|
|
126
|
-
$lt: T["properties"][K_2]
|
|
127
|
-
$lte: T["properties"][K_2]
|
|
128
|
-
$ne: T["properties"][K_2]
|
|
129
|
-
$in: import("@sinclair/typebox").TArray<T["properties"][K_2]
|
|
130
|
-
$nin: import("@sinclair/typebox").TArray<T["properties"][K_2]
|
|
131
|
-
}
|
|
95
|
+
}; } : never>(type: T, extensions?: X, options?: ObjectOptions) => TIntersect<[TObject<{
|
|
96
|
+
$limit: TOptional<import("@sinclair/typebox").TNumber>;
|
|
97
|
+
$skip: TOptional<import("@sinclair/typebox").TNumber>;
|
|
98
|
+
$sort: TOptional<TObject<T["properties"] extends infer T_2 ? { [K_1 in keyof T_2]: TOptional<TInteger>; } : never>>;
|
|
99
|
+
$select: TOptional<import("@sinclair/typebox").TUnsafe<(keyof T["properties"])[]>>;
|
|
100
|
+
$and: TOptional<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], TIntersect<[TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").Assert<{
|
|
101
|
+
$gt: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>;
|
|
102
|
+
$gte: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>;
|
|
103
|
+
$lt: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>;
|
|
104
|
+
$lte: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>;
|
|
105
|
+
$ne: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>;
|
|
106
|
+
$in: TOptional<import("@sinclair/typebox").TArray<T["properties"][K_2]>>;
|
|
107
|
+
$nin: TOptional<import("@sinclair/typebox").TArray<T["properties"][K_2]>>;
|
|
108
|
+
}, import("@sinclair/typebox").TProperties>>>, TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").Assert<X[K_2] extends infer T_4 extends import("@sinclair/typebox").TProperties ? { [K_3 in keyof T_4]: X[K_2][K_3] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : X[K_2][K_3] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : X[K_2][K_3] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<X[K_2][K_3]>; } : never, import("@sinclair/typebox").TProperties>>>]>]>>; } : never>>, TObject<{
|
|
109
|
+
$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], TIntersect<[TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").Assert<{
|
|
110
|
+
$gt: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>;
|
|
111
|
+
$gte: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>;
|
|
112
|
+
$lt: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>;
|
|
113
|
+
$lte: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>;
|
|
114
|
+
$ne: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>;
|
|
115
|
+
$in: TOptional<import("@sinclair/typebox").TArray<T["properties"][K_2]>>;
|
|
116
|
+
$nin: TOptional<import("@sinclair/typebox").TArray<T["properties"][K_2]>>;
|
|
117
|
+
}, import("@sinclair/typebox").TProperties>>>, TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").Assert<X[K_2] extends infer T_4 extends import("@sinclair/typebox").TProperties ? { [K_3 in keyof T_4]: X[K_2][K_3] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : X[K_2][K_3] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : X[K_2][K_3] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<X[K_2][K_3]>; } : never, import("@sinclair/typebox").TProperties>>>]>]>>; } : never>>>;
|
|
118
|
+
}>]>>>;
|
|
119
|
+
$or: TOptional<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], TIntersect<[TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").Assert<{
|
|
120
|
+
$gt: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>;
|
|
121
|
+
$gte: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>;
|
|
122
|
+
$lt: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>;
|
|
123
|
+
$lte: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>;
|
|
124
|
+
$ne: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>;
|
|
125
|
+
$in: TOptional<import("@sinclair/typebox").TArray<T["properties"][K_2]>>;
|
|
126
|
+
$nin: TOptional<import("@sinclair/typebox").TArray<T["properties"][K_2]>>;
|
|
127
|
+
}, import("@sinclair/typebox").TProperties>>>, TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").Assert<X[K_2] extends infer T_4 extends import("@sinclair/typebox").TProperties ? { [K_3 in keyof T_4]: X[K_2][K_3] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : X[K_2][K_3] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : X[K_2][K_3] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<X[K_2][K_3]>; } : never, import("@sinclair/typebox").TProperties>>>]>]>>; } : never>>>>;
|
|
128
|
+
}>, TOptional<TObject<T["properties"] extends infer T_5 ? { [K_2 in keyof T_5]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_2], TIntersect<[TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").Assert<{
|
|
129
|
+
$gt: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>;
|
|
130
|
+
$gte: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>;
|
|
131
|
+
$lt: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>;
|
|
132
|
+
$lte: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>;
|
|
133
|
+
$ne: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>;
|
|
134
|
+
$in: TOptional<import("@sinclair/typebox").TArray<T["properties"][K_2]>>;
|
|
135
|
+
$nin: TOptional<import("@sinclair/typebox").TArray<T["properties"][K_2]>>;
|
|
136
|
+
}, import("@sinclair/typebox").TProperties>>>, TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").Assert<X[K_2] extends infer T_6 extends import("@sinclair/typebox").TProperties ? { [K_3 in keyof T_6]: X[K_2][K_3] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : X[K_2][K_3] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : X[K_2][K_3] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<X[K_2][K_3]>; } : never, import("@sinclair/typebox").TProperties>>>]>]>>; } : never>>]>;
|
|
132
137
|
export declare const ObjectIdSchema: () => import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, TObject<{}>]>;
|
package/lib/index.js
CHANGED
|
@@ -14,11 +14,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.ObjectIdSchema = exports.querySyntax = exports.queryProperties = exports.queryProperty = exports.sortDefinition = exports.StringEnum = exports.getDataValidator = exports.getValidator = void 0;
|
|
17
|
+
exports.ObjectIdSchema = exports.querySyntax = exports.queryProperties = exports.queryProperty = exports.sortDefinition = exports.StringEnum = exports.getDataValidator = exports.getValidator = exports.Intersect = void 0;
|
|
18
18
|
const typebox_1 = require("@sinclair/typebox");
|
|
19
19
|
const schema_1 = require("@feathersjs/schema");
|
|
20
20
|
__exportStar(require("@sinclair/typebox"), exports);
|
|
21
21
|
__exportStar(require("./default-schemas"), exports);
|
|
22
|
+
// Export new intersect
|
|
23
|
+
exports.Intersect = typebox_1.Type.Intersect;
|
|
24
|
+
// This is necessary to maintain backwards compatibility between 0.25 and 0.26
|
|
25
|
+
typebox_1.Type.Intersect = typebox_1.Type.Composite;
|
|
22
26
|
/**
|
|
23
27
|
* Returns a compiled validation function for a TypeBox object and AJV validator instance.
|
|
24
28
|
*
|
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;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,+CAA0G;AAC1G,+CAAiF;AAEjF,oDAAiC;AACjC,oDAAiC;AAEjC,uBAAuB;AACV,QAAA,SAAS,GAAG,cAAI,CAAC,SAAS,CAAA;AAEvC,8EAA8E;AAC9E,cAAI,CAAC,SAAS,GAAG,cAAI,CAAC,SAAgB,CAAA;AAQtC;;;;;;GAMG;AACI,MAAM,YAAY,GAAG,CAAiB,MAA4B,EAAE,SAAc,EAAmB,EAAE,CAC5G,mBAAU,CAAC,YAAY,CAAC,MAAa,EAAE,SAAS,CAAC,CAAA;AADtC,QAAA,YAAY,gBAC0B;AAEnD;;;;;;;;;GASG;AACI,MAAM,gBAAgB,GAAG,CAAC,GAA6B,EAAE,SAAc,EAAoB,EAAE,CAClG,mBAAU,CAA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|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feathersjs/typebox",
|
|
3
3
|
"description": "TypeBox integration for @feathersjs/schema",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.3",
|
|
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.
|
|
58
|
-
"@sinclair/typebox": "^0.
|
|
57
|
+
"@feathersjs/schema": "^5.0.3",
|
|
58
|
+
"@sinclair/typebox": "^0.26.8"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/mocha": "^10.0.1",
|
|
62
|
-
"@types/node": "^18.
|
|
62
|
+
"@types/node": "^18.15.11",
|
|
63
63
|
"mocha": "^10.2.0",
|
|
64
64
|
"shx": "^0.3.4",
|
|
65
|
-
"typescript": "^
|
|
65
|
+
"typescript": "^5.0.3"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "a6ba4dfd08f537a7d4778bed4c45091cbe3802aa"
|
|
68
68
|
}
|
package/src/default-schemas.ts
CHANGED
|
@@ -2,7 +2,12 @@ import { Type, Static } from '@sinclair/typebox'
|
|
|
2
2
|
|
|
3
3
|
export const authenticationSettingsSchema = Type.Object({
|
|
4
4
|
secret: Type.String({ description: 'The JWT signing secret' }),
|
|
5
|
-
entity: Type.Optional(
|
|
5
|
+
entity: Type.Optional(
|
|
6
|
+
Type.Union([
|
|
7
|
+
Type.String({ description: 'The name of the authentication entity (e.g. user)' }),
|
|
8
|
+
Type.Null()
|
|
9
|
+
])
|
|
10
|
+
),
|
|
6
11
|
entityId: Type.Optional(Type.String({ description: 'The name of the authentication entity id property' })),
|
|
7
12
|
service: Type.Optional(Type.String({ description: 'The path of the entity service' })),
|
|
8
13
|
authStrategies: Type.Array(Type.String(), {
|
package/src/index.ts
CHANGED
|
@@ -4,6 +4,12 @@ import { jsonSchema, Validator, DataValidatorMap, Ajv } from '@feathersjs/schema
|
|
|
4
4
|
export * from '@sinclair/typebox'
|
|
5
5
|
export * from './default-schemas'
|
|
6
6
|
|
|
7
|
+
// Export new intersect
|
|
8
|
+
export const Intersect = Type.Intersect
|
|
9
|
+
|
|
10
|
+
// This is necessary to maintain backwards compatibility between 0.25 and 0.26
|
|
11
|
+
Type.Intersect = Type.Composite as any
|
|
12
|
+
|
|
7
13
|
export type TDataSchemaMap = {
|
|
8
14
|
create: TObject
|
|
9
15
|
update?: TObject
|
|
@@ -17,7 +23,7 @@ export type TDataSchemaMap = {
|
|
|
17
23
|
* @param validator The AJV validation instance
|
|
18
24
|
* @returns A compiled validation function
|
|
19
25
|
*/
|
|
20
|
-
export const getValidator = <T = any, R = T>(schema: TObject, validator: Ajv): Validator<T, R> =>
|
|
26
|
+
export const getValidator = <T = any, R = T>(schema: TObject | TIntersect, validator: Ajv): Validator<T, R> =>
|
|
21
27
|
jsonSchema.getValidator(schema as any, validator)
|
|
22
28
|
|
|
23
29
|
/**
|
|
@@ -42,7 +48,7 @@ export function StringEnum<T extends string[]>(allowedValues: [...T]) {
|
|
|
42
48
|
return Type.Unsafe<T[number]>({ type: 'string', enum: allowedValues })
|
|
43
49
|
}
|
|
44
50
|
|
|
45
|
-
const arrayOfKeys = <T extends TObject>(type: T) => {
|
|
51
|
+
const arrayOfKeys = <T extends TObject | TIntersect>(type: T) => {
|
|
46
52
|
const keys = Object.keys(type.properties)
|
|
47
53
|
return Type.Unsafe<(keyof T['properties'])[]>({
|
|
48
54
|
type: 'array',
|
|
@@ -60,7 +66,7 @@ const arrayOfKeys = <T extends TObject>(type: T) => {
|
|
|
60
66
|
* @param schema The TypeBox object schema
|
|
61
67
|
* @returns The `$sort` syntax schema
|
|
62
68
|
*/
|
|
63
|
-
export function sortDefinition<T extends TObject>(schema: T) {
|
|
69
|
+
export function sortDefinition<T extends TObject | TIntersect>(schema: T) {
|
|
64
70
|
const properties = Object.keys(schema.properties).reduce((res, key) => {
|
|
65
71
|
const result = res as any
|
|
66
72
|
|
|
@@ -119,7 +125,7 @@ type QueryProperty<T extends TSchema, X extends { [key: string]: TSchema }> = Re
|
|
|
119
125
|
* @returns The Feathers query syntax schema
|
|
120
126
|
*/
|
|
121
127
|
export const queryProperties = <
|
|
122
|
-
T extends TObject,
|
|
128
|
+
T extends TObject | TIntersect,
|
|
123
129
|
X extends { [K in keyof T['properties']]?: { [key: string]: TSchema } }
|
|
124
130
|
>(
|
|
125
131
|
definition: T,
|