@feathersjs/typebox 5.0.40 → 6.0.0-pre.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 +43 -2
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/lib/default-schemas.d.ts +116 -115
- package/lib/default-schemas.js +51 -54
- package/lib/default-schemas.js.map +1 -1
- package/lib/index.d.ts +57 -74
- package/lib/index.js +45 -66
- package/lib/index.js.map +1 -1
- package/package.json +10 -7
- package/src/default-schemas.ts +2 -2
- package/src/index.ts +167 -100
package/CHANGELOG.md
CHANGED
|
@@ -3,9 +3,50 @@
|
|
|
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
|
-
|
|
6
|
+
# 6.0.0-pre.0 (2026-01-31)
|
|
7
7
|
|
|
8
|
-
|
|
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
|
+
- **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))
|
|
12
|
+
- **core:** Update to latest feathersjs/hooks ([#3434](https://github.com/feathersjs/feathers/issues/3434)) ([1499ccc](https://github.com/feathersjs/feathers/commit/1499ccc41fb3ebba97b2c84e0cb19bc48ad3c651))
|
|
13
|
+
- **dependencies:** Update all dependencies ([#3139](https://github.com/feathersjs/feathers/issues/3139)) ([f24276e](https://github.com/feathersjs/feathers/commit/f24276e9a909e2e58a0730c730258ce1f70f4028))
|
|
14
|
+
- **dependencies:** Update all dependencies ([#3545](https://github.com/feathersjs/feathers/issues/3545)) ([221b92b](https://github.com/feathersjs/feathers/commit/221b92bb0ee5d54fb1036742968797cb02e56da2))
|
|
15
|
+
- **dependencies:** Update all dependencies ([#3625](https://github.com/feathersjs/feathers/issues/3625)) ([2698e4e](https://github.com/feathersjs/feathers/commit/2698e4e2996fbf479d82435938d907bc3d5b583a))
|
|
16
|
+
- **dependencies:** Update dependencies ([#3571](https://github.com/feathersjs/feathers/issues/3571)) ([ad611cb](https://github.com/feathersjs/feathers/commit/ad611cb6ffb1dc31d603ba5817331318c5a23217))
|
|
17
|
+
- **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))
|
|
18
|
+
- **knex:** Update all dependencies and Knex peer ([#3308](https://github.com/feathersjs/feathers/issues/3308)) ([d2f9860](https://github.com/feathersjs/feathers/commit/d2f986036c4741cce2339d8abbcc6b2eb037a12a))
|
|
19
|
+
- Make sure all Readme files are up to date ([#3154](https://github.com/feathersjs/feathers/issues/3154)) ([a5f0b38](https://github.com/feathersjs/feathers/commit/a5f0b38bbf2a11486415a39533bcc6c67fb51e3e))
|
|
20
|
+
- **schema:** Allow $in and $nin queries to work for arrays ([#3352](https://github.com/feathersjs/feathers/issues/3352)) ([677c214](https://github.com/feathersjs/feathers/commit/677c214a353a7f9a1f90649b9bbec4d0d6517a6f))
|
|
21
|
+
- **schema:** Allow query schemas with no properties, error on unsupported types ([#2904](https://github.com/feathersjs/feathers/issues/2904)) ([b66c734](https://github.com/feathersjs/feathers/commit/b66c734357478f51b2d38fa7f3eee08640cea26e))
|
|
22
|
+
- **schema:** Fix TypeBox extension value query syntax inference ([#3010](https://github.com/feathersjs/feathers/issues/3010)) ([f1c7a76](https://github.com/feathersjs/feathers/commit/f1c7a76586bbb8aed66ef866c3dcd666d79f3a24))
|
|
23
|
+
- **typebox:** Add TRecord to getValidator arg1 type ([#3488](https://github.com/feathersjs/feathers/issues/3488)) ([ffbcc0a](https://github.com/feathersjs/feathers/commit/ffbcc0ad0c361f77171f9ad6224006727644433a))
|
|
24
|
+
- **typebox:** Allow default value in StringEnum ([#3281](https://github.com/feathersjs/feathers/issues/3281)) ([25af09a](https://github.com/feathersjs/feathers/commit/25af09ad065e72768bf88bc8b529b68f2ca4da17))
|
|
25
|
+
- **typebox:** Allow nested or in and queries ([#3029](https://github.com/feathersjs/feathers/issues/3029)) ([39e0b78](https://github.com/feathersjs/feathers/commit/39e0b785238b809aa9b4dea9b95efc3c188c9baa))
|
|
26
|
+
- **typebox:** allow TUnion<TObject[]> inside getValidator ([#3262](https://github.com/feathersjs/feathers/issues/3262)) ([cf9df96](https://github.com/feathersjs/feathers/commit/cf9df96c1011fcf13e9c6d652b06036bb0aac1c3))
|
|
27
|
+
- **typebox:** Implement custom TypeBuilder for backwards compatibility ([#3150](https://github.com/feathersjs/feathers/issues/3150)) ([962bd87](https://github.com/feathersjs/feathers/commit/962bd87217212320b1a68f6556a16b8a6b8f757c))
|
|
28
|
+
- **typebox:** Improve query syntax defaults ([#2888](https://github.com/feathersjs/feathers/issues/2888)) ([59f3cdc](https://github.com/feathersjs/feathers/commit/59f3cdca6376e34fe39a7b91db837d0325aeb5db))
|
|
29
|
+
- **typebox:** Revert to TypeBox 0.25 ([#3183](https://github.com/feathersjs/feathers/issues/3183)) ([cacedf5](https://github.com/feathersjs/feathers/commit/cacedf59e3d2df836777f0cd06ab1b2484ed87c5))
|
|
30
|
+
- **typebox:** Upgrade to TypeBox 0.26.0 ([#3113](https://github.com/feathersjs/feathers/issues/3113)) ([d1d9598](https://github.com/feathersjs/feathers/commit/d1d95984dd94d2b9305e7338421f84f9c4f733fd))
|
|
31
|
+
- Update all dependencies ([#3024](https://github.com/feathersjs/feathers/issues/3024)) ([283dc47](https://github.com/feathersjs/feathers/commit/283dc4798d85584bc031e6e54b83b4ea77d1edd0))
|
|
32
|
+
- Update all dependencies ([#3613](https://github.com/feathersjs/feathers/issues/3613)) ([5136bbd](https://github.com/feathersjs/feathers/commit/5136bbd2e2eeb4e6579e07c9e914006629542363))
|
|
33
|
+
- Update dependencies ([#3584](https://github.com/feathersjs/feathers/issues/3584)) ([119fa4e](https://github.com/feathersjs/feathers/commit/119fa4e1ade8b0078aa235083d566e2538b3a084))
|
|
34
|
+
|
|
35
|
+
### Features
|
|
36
|
+
|
|
37
|
+
- **cli:** Improve generated schema definitions ([#2783](https://github.com/feathersjs/feathers/issues/2783)) ([474a9fd](https://github.com/feathersjs/feathers/commit/474a9fda2107e9bcf357746320a8e00cda8182b6))
|
|
38
|
+
- ES module v5 compatibility layer for v6 ([#3607](https://github.com/feathersjs/feathers/issues/3607)) ([1dfff88](https://github.com/feathersjs/feathers/commit/1dfff8832eedca895eeaafd7f3acf0f8a27be23c))
|
|
39
|
+
- **generators:** Move core code generators to shared generators package ([#2982](https://github.com/feathersjs/feathers/issues/2982)) ([0328d22](https://github.com/feathersjs/feathers/commit/0328d2292153870bc43958f73d2c6f288a8cec17))
|
|
40
|
+
- **schema:** Add schema helper for handling Object ids ([#3058](https://github.com/feathersjs/feathers/issues/3058)) ([1393bed](https://github.com/feathersjs/feathers/commit/1393bed81a9ee814de6aab0e537af83e667591a2))
|
|
41
|
+
- **schema:** Add StringEnum to TypeBox module ([#2827](https://github.com/feathersjs/feathers/issues/2827)) ([65d3665](https://github.com/feathersjs/feathers/commit/65d36656f50a48f633fa3fcabaea10521d04bf1c))
|
|
42
|
+
- **schema:** Allow to add additional operators to the query syntax ([#2941](https://github.com/feathersjs/feathers/issues/2941)) ([f324940](https://github.com/feathersjs/feathers/commit/f324940d5795b41e8c6fc113defb0beb7ab03a0a))
|
|
43
|
+
- **schema:** Make schemas validation library independent and add TypeBox support ([#2772](https://github.com/feathersjs/feathers/issues/2772)) ([44172d9](https://github.com/feathersjs/feathers/commit/44172d99b566d11d9ceda04f1d0bf72b6d05ce76))
|
|
44
|
+
- Update to Typebox v1 ([#3616](https://github.com/feathersjs/feathers/issues/3616)) ([077dcc2](https://github.com/feathersjs/feathers/commit/077dcc2cece0ede6f92388dd39be4dcaeed203eb))
|
|
45
|
+
- Upgrade to latest TypeBox ([#3612](https://github.com/feathersjs/feathers/issues/3612)) ([4def62e](https://github.com/feathersjs/feathers/commit/4def62efaaf093cb33e44a3f82169149422af987))
|
|
46
|
+
|
|
47
|
+
### BREAKING CHANGES
|
|
48
|
+
|
|
49
|
+
- All packages are now ES modules only
|
|
9
50
|
|
|
10
51
|
## [5.0.39](https://github.com/feathersjs/feathers/compare/v5.0.38...v5.0.39) (2026-01-31)
|
|
11
52
|
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2025 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
|
package/README.md
CHANGED
|
@@ -18,6 +18,6 @@ Refer to the [Feathers TypeBox documentation](https://feathersjs.com/api/schema/
|
|
|
18
18
|
|
|
19
19
|
## License
|
|
20
20
|
|
|
21
|
-
Copyright (c)
|
|
21
|
+
Copyright (c) 2025 [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
|
@@ -1,137 +1,138 @@
|
|
|
1
|
-
import { Static } from '
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import type { Static } from 'typebox';
|
|
2
|
+
import { Type } from 'typebox';
|
|
3
|
+
export declare const authenticationSettingsSchema: Type.TObject<{
|
|
4
|
+
secret: Type.TString;
|
|
5
|
+
entity: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
|
|
6
|
+
entityId: Type.TOptional<Type.TString>;
|
|
7
|
+
service: Type.TOptional<Type.TString>;
|
|
8
|
+
authStrategies: Type.TArray<Type.TString>;
|
|
9
|
+
parseStrategies: Type.TOptional<Type.TArray<Type.TString>>;
|
|
10
|
+
jwtOptions: Type.TOptional<Type.TObject<{}>>;
|
|
11
|
+
jwt: Type.TOptional<Type.TObject<{
|
|
12
|
+
header: Type.TString;
|
|
13
|
+
schemes: Type.TString;
|
|
13
14
|
}>>;
|
|
14
|
-
local:
|
|
15
|
-
usernameField:
|
|
16
|
-
passwordField:
|
|
17
|
-
hashSize:
|
|
18
|
-
errorMessage:
|
|
19
|
-
entityUsernameField:
|
|
20
|
-
entityPasswordField:
|
|
15
|
+
local: Type.TOptional<Type.TObject<{
|
|
16
|
+
usernameField: Type.TString;
|
|
17
|
+
passwordField: Type.TString;
|
|
18
|
+
hashSize: Type.TOptional<Type.TNumber>;
|
|
19
|
+
errorMessage: Type.TOptional<Type.TString>;
|
|
20
|
+
entityUsernameField: Type.TOptional<Type.TString>;
|
|
21
|
+
entityPasswordField: Type.TOptional<Type.TString>;
|
|
21
22
|
}>>;
|
|
22
|
-
oauth:
|
|
23
|
-
redirect:
|
|
24
|
-
origins:
|
|
25
|
-
defaults:
|
|
26
|
-
key:
|
|
27
|
-
secret:
|
|
23
|
+
oauth: Type.TOptional<Type.TObject<{
|
|
24
|
+
redirect: Type.TOptional<Type.TString>;
|
|
25
|
+
origins: Type.TOptional<Type.TArray<Type.TString>>;
|
|
26
|
+
defaults: Type.TOptional<Type.TObject<{
|
|
27
|
+
key: Type.TOptional<Type.TString>;
|
|
28
|
+
secret: Type.TOptional<Type.TString>;
|
|
28
29
|
}>>;
|
|
29
30
|
}>>;
|
|
30
31
|
}>;
|
|
31
|
-
export declare const sqlSettingsSchema:
|
|
32
|
-
client:
|
|
33
|
-
connection:
|
|
34
|
-
host:
|
|
35
|
-
port:
|
|
36
|
-
user:
|
|
37
|
-
password:
|
|
38
|
-
database:
|
|
39
|
-
}
|
|
40
|
-
pool:
|
|
41
|
-
min:
|
|
42
|
-
max:
|
|
32
|
+
export declare const sqlSettingsSchema: Type.TOptional<Type.TObject<{
|
|
33
|
+
client: Type.TString;
|
|
34
|
+
connection: Type.TUnion<[Type.TString, Type.TObject<{
|
|
35
|
+
host: Type.TOptional<Type.TString>;
|
|
36
|
+
port: Type.TOptional<Type.TNumber>;
|
|
37
|
+
user: Type.TOptional<Type.TString>;
|
|
38
|
+
password: Type.TOptional<Type.TString>;
|
|
39
|
+
database: Type.TOptional<Type.TString>;
|
|
40
|
+
}>]>;
|
|
41
|
+
pool: Type.TOptional<Type.TObject<{
|
|
42
|
+
min: Type.TNumber;
|
|
43
|
+
max: Type.TNumber;
|
|
43
44
|
}>>;
|
|
44
45
|
}>>;
|
|
45
|
-
export declare const defaultAppConfiguration:
|
|
46
|
-
authentication:
|
|
47
|
-
secret:
|
|
48
|
-
entity:
|
|
49
|
-
entityId:
|
|
50
|
-
service:
|
|
51
|
-
authStrategies:
|
|
52
|
-
parseStrategies:
|
|
53
|
-
jwtOptions:
|
|
54
|
-
jwt:
|
|
55
|
-
header:
|
|
56
|
-
schemes:
|
|
46
|
+
export declare const defaultAppConfiguration: Type.TObject<{
|
|
47
|
+
authentication: Type.TOptional<Type.TObject<{
|
|
48
|
+
secret: Type.TString;
|
|
49
|
+
entity: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
|
|
50
|
+
entityId: Type.TOptional<Type.TString>;
|
|
51
|
+
service: Type.TOptional<Type.TString>;
|
|
52
|
+
authStrategies: Type.TArray<Type.TString>;
|
|
53
|
+
parseStrategies: Type.TOptional<Type.TArray<Type.TString>>;
|
|
54
|
+
jwtOptions: Type.TOptional<Type.TObject<{}>>;
|
|
55
|
+
jwt: Type.TOptional<Type.TObject<{
|
|
56
|
+
header: Type.TString;
|
|
57
|
+
schemes: Type.TString;
|
|
57
58
|
}>>;
|
|
58
|
-
local:
|
|
59
|
-
usernameField:
|
|
60
|
-
passwordField:
|
|
61
|
-
hashSize:
|
|
62
|
-
errorMessage:
|
|
63
|
-
entityUsernameField:
|
|
64
|
-
entityPasswordField:
|
|
59
|
+
local: Type.TOptional<Type.TObject<{
|
|
60
|
+
usernameField: Type.TString;
|
|
61
|
+
passwordField: Type.TString;
|
|
62
|
+
hashSize: Type.TOptional<Type.TNumber>;
|
|
63
|
+
errorMessage: Type.TOptional<Type.TString>;
|
|
64
|
+
entityUsernameField: Type.TOptional<Type.TString>;
|
|
65
|
+
entityPasswordField: Type.TOptional<Type.TString>;
|
|
65
66
|
}>>;
|
|
66
|
-
oauth:
|
|
67
|
-
redirect:
|
|
68
|
-
origins:
|
|
69
|
-
defaults:
|
|
70
|
-
key:
|
|
71
|
-
secret:
|
|
67
|
+
oauth: Type.TOptional<Type.TObject<{
|
|
68
|
+
redirect: Type.TOptional<Type.TString>;
|
|
69
|
+
origins: Type.TOptional<Type.TArray<Type.TString>>;
|
|
70
|
+
defaults: Type.TOptional<Type.TObject<{
|
|
71
|
+
key: Type.TOptional<Type.TString>;
|
|
72
|
+
secret: Type.TOptional<Type.TString>;
|
|
72
73
|
}>>;
|
|
73
74
|
}>>;
|
|
74
75
|
}>>;
|
|
75
|
-
paginate:
|
|
76
|
-
default:
|
|
77
|
-
max:
|
|
76
|
+
paginate: Type.TOptional<Type.TObject<{
|
|
77
|
+
default: Type.TNumber;
|
|
78
|
+
max: Type.TNumber;
|
|
78
79
|
}>>;
|
|
79
|
-
origins:
|
|
80
|
-
mongodb:
|
|
81
|
-
mysql:
|
|
82
|
-
client:
|
|
83
|
-
connection:
|
|
84
|
-
host:
|
|
85
|
-
port:
|
|
86
|
-
user:
|
|
87
|
-
password:
|
|
88
|
-
database:
|
|
89
|
-
}
|
|
90
|
-
pool:
|
|
91
|
-
min:
|
|
92
|
-
max:
|
|
80
|
+
origins: Type.TOptional<Type.TArray<Type.TString>>;
|
|
81
|
+
mongodb: Type.TOptional<Type.TString>;
|
|
82
|
+
mysql: Type.TOptional<Type.TObject<{
|
|
83
|
+
client: Type.TString;
|
|
84
|
+
connection: Type.TUnion<[Type.TString, Type.TObject<{
|
|
85
|
+
host: Type.TOptional<Type.TString>;
|
|
86
|
+
port: Type.TOptional<Type.TNumber>;
|
|
87
|
+
user: Type.TOptional<Type.TString>;
|
|
88
|
+
password: Type.TOptional<Type.TString>;
|
|
89
|
+
database: Type.TOptional<Type.TString>;
|
|
90
|
+
}>]>;
|
|
91
|
+
pool: Type.TOptional<Type.TObject<{
|
|
92
|
+
min: Type.TNumber;
|
|
93
|
+
max: Type.TNumber;
|
|
93
94
|
}>>;
|
|
94
95
|
}>>;
|
|
95
|
-
postgresql:
|
|
96
|
-
client:
|
|
97
|
-
connection:
|
|
98
|
-
host:
|
|
99
|
-
port:
|
|
100
|
-
user:
|
|
101
|
-
password:
|
|
102
|
-
database:
|
|
103
|
-
}
|
|
104
|
-
pool:
|
|
105
|
-
min:
|
|
106
|
-
max:
|
|
96
|
+
postgresql: Type.TOptional<Type.TObject<{
|
|
97
|
+
client: Type.TString;
|
|
98
|
+
connection: Type.TUnion<[Type.TString, Type.TObject<{
|
|
99
|
+
host: Type.TOptional<Type.TString>;
|
|
100
|
+
port: Type.TOptional<Type.TNumber>;
|
|
101
|
+
user: Type.TOptional<Type.TString>;
|
|
102
|
+
password: Type.TOptional<Type.TString>;
|
|
103
|
+
database: Type.TOptional<Type.TString>;
|
|
104
|
+
}>]>;
|
|
105
|
+
pool: Type.TOptional<Type.TObject<{
|
|
106
|
+
min: Type.TNumber;
|
|
107
|
+
max: Type.TNumber;
|
|
107
108
|
}>>;
|
|
108
109
|
}>>;
|
|
109
|
-
sqlite:
|
|
110
|
-
client:
|
|
111
|
-
connection:
|
|
112
|
-
host:
|
|
113
|
-
port:
|
|
114
|
-
user:
|
|
115
|
-
password:
|
|
116
|
-
database:
|
|
117
|
-
}
|
|
118
|
-
pool:
|
|
119
|
-
min:
|
|
120
|
-
max:
|
|
110
|
+
sqlite: Type.TOptional<Type.TObject<{
|
|
111
|
+
client: Type.TString;
|
|
112
|
+
connection: Type.TUnion<[Type.TString, Type.TObject<{
|
|
113
|
+
host: Type.TOptional<Type.TString>;
|
|
114
|
+
port: Type.TOptional<Type.TNumber>;
|
|
115
|
+
user: Type.TOptional<Type.TString>;
|
|
116
|
+
password: Type.TOptional<Type.TString>;
|
|
117
|
+
database: Type.TOptional<Type.TString>;
|
|
118
|
+
}>]>;
|
|
119
|
+
pool: Type.TOptional<Type.TObject<{
|
|
120
|
+
min: Type.TNumber;
|
|
121
|
+
max: Type.TNumber;
|
|
121
122
|
}>>;
|
|
122
123
|
}>>;
|
|
123
|
-
mssql:
|
|
124
|
-
client:
|
|
125
|
-
connection:
|
|
126
|
-
host:
|
|
127
|
-
port:
|
|
128
|
-
user:
|
|
129
|
-
password:
|
|
130
|
-
database:
|
|
131
|
-
}
|
|
132
|
-
pool:
|
|
133
|
-
min:
|
|
134
|
-
max:
|
|
124
|
+
mssql: Type.TOptional<Type.TObject<{
|
|
125
|
+
client: Type.TString;
|
|
126
|
+
connection: Type.TUnion<[Type.TString, Type.TObject<{
|
|
127
|
+
host: Type.TOptional<Type.TString>;
|
|
128
|
+
port: Type.TOptional<Type.TNumber>;
|
|
129
|
+
user: Type.TOptional<Type.TString>;
|
|
130
|
+
password: Type.TOptional<Type.TString>;
|
|
131
|
+
database: Type.TOptional<Type.TString>;
|
|
132
|
+
}>]>;
|
|
133
|
+
pool: Type.TOptional<Type.TObject<{
|
|
134
|
+
min: Type.TNumber;
|
|
135
|
+
max: Type.TNumber;
|
|
135
136
|
}>>;
|
|
136
137
|
}>>;
|
|
137
138
|
}>;
|
package/lib/default-schemas.js
CHANGED
|
@@ -1,75 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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()
|
|
1
|
+
import { Type } from 'typebox';
|
|
2
|
+
export const authenticationSettingsSchema = Type.Object({
|
|
3
|
+
secret: Type.String({ description: 'The JWT signing secret' }),
|
|
4
|
+
entity: Type.Optional(Type.Union([
|
|
5
|
+
Type.String({ description: 'The name of the authentication entity (e.g. user)' }),
|
|
6
|
+
Type.Null()
|
|
10
7
|
])),
|
|
11
|
-
entityId:
|
|
12
|
-
service:
|
|
13
|
-
authStrategies:
|
|
8
|
+
entityId: Type.Optional(Type.String({ description: 'The name of the authentication entity id property' })),
|
|
9
|
+
service: Type.Optional(Type.String({ description: 'The path of the entity service' })),
|
|
10
|
+
authStrategies: Type.Array(Type.String(), {
|
|
14
11
|
description: 'A list of authentication strategy names that are allowed to create JWT access tokens'
|
|
15
12
|
}),
|
|
16
|
-
parseStrategies:
|
|
13
|
+
parseStrategies: Type.Optional(Type.Array(Type.String(), {
|
|
17
14
|
description: 'A list of authentication strategy names that should parse HTTP headers for authentication information (defaults to `authStrategies`)'
|
|
18
15
|
})),
|
|
19
|
-
jwtOptions:
|
|
20
|
-
jwt:
|
|
21
|
-
header:
|
|
22
|
-
schemes:
|
|
16
|
+
jwtOptions: Type.Optional(Type.Object({})),
|
|
17
|
+
jwt: Type.Optional(Type.Object({
|
|
18
|
+
header: Type.String({ default: 'Authorization', description: 'The HTTP header containing the JWT' }),
|
|
19
|
+
schemes: Type.String({ description: 'An array of schemes to support' })
|
|
23
20
|
})),
|
|
24
|
-
local:
|
|
25
|
-
usernameField:
|
|
26
|
-
passwordField:
|
|
27
|
-
hashSize:
|
|
28
|
-
errorMessage:
|
|
29
|
-
entityUsernameField:
|
|
21
|
+
local: Type.Optional(Type.Object({
|
|
22
|
+
usernameField: Type.String({ description: 'Name of the username field (e.g. `email`)' }),
|
|
23
|
+
passwordField: Type.String({ description: 'Name of the password field (e.g. `password`)' }),
|
|
24
|
+
hashSize: Type.Optional(Type.Number({ description: 'The BCrypt salt length' })),
|
|
25
|
+
errorMessage: Type.Optional(Type.String({ description: 'The error message to return on errors' })),
|
|
26
|
+
entityUsernameField: Type.Optional(Type.String({
|
|
30
27
|
description: 'Name of the username field on the entity if authentication request data and entity field names are different'
|
|
31
28
|
})),
|
|
32
|
-
entityPasswordField:
|
|
29
|
+
entityPasswordField: Type.Optional(Type.String({
|
|
33
30
|
description: 'Name of the password field on the entity if authentication request data and entity field names are different'
|
|
34
31
|
}))
|
|
35
32
|
})),
|
|
36
|
-
oauth:
|
|
37
|
-
redirect:
|
|
38
|
-
origins:
|
|
39
|
-
defaults:
|
|
40
|
-
key:
|
|
41
|
-
secret:
|
|
33
|
+
oauth: Type.Optional(Type.Object({
|
|
34
|
+
redirect: Type.Optional(Type.String()),
|
|
35
|
+
origins: Type.Optional(Type.Array(Type.String())),
|
|
36
|
+
defaults: Type.Optional(Type.Object({
|
|
37
|
+
key: Type.Optional(Type.String()),
|
|
38
|
+
secret: Type.Optional(Type.String())
|
|
42
39
|
}))
|
|
43
40
|
}))
|
|
44
41
|
});
|
|
45
|
-
|
|
46
|
-
client:
|
|
47
|
-
connection:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
host:
|
|
51
|
-
port:
|
|
52
|
-
user:
|
|
53
|
-
password:
|
|
54
|
-
database:
|
|
42
|
+
export const sqlSettingsSchema = Type.Optional(Type.Object({
|
|
43
|
+
client: Type.String(),
|
|
44
|
+
connection: Type.Union([
|
|
45
|
+
Type.String(),
|
|
46
|
+
Type.Partial(Type.Object({
|
|
47
|
+
host: Type.String(),
|
|
48
|
+
port: Type.Number(),
|
|
49
|
+
user: Type.String(),
|
|
50
|
+
password: Type.String(),
|
|
51
|
+
database: Type.String()
|
|
55
52
|
}))
|
|
56
53
|
]),
|
|
57
|
-
pool:
|
|
58
|
-
min:
|
|
59
|
-
max:
|
|
54
|
+
pool: Type.Optional(Type.Object({
|
|
55
|
+
min: Type.Number(),
|
|
56
|
+
max: Type.Number()
|
|
60
57
|
}))
|
|
61
58
|
}));
|
|
62
|
-
|
|
63
|
-
authentication:
|
|
64
|
-
paginate:
|
|
65
|
-
default:
|
|
66
|
-
max:
|
|
59
|
+
export const defaultAppConfiguration = Type.Object({
|
|
60
|
+
authentication: Type.Optional(authenticationSettingsSchema),
|
|
61
|
+
paginate: Type.Optional(Type.Object({
|
|
62
|
+
default: Type.Number(),
|
|
63
|
+
max: Type.Number()
|
|
67
64
|
}, { additionalProperties: false })),
|
|
68
|
-
origins:
|
|
69
|
-
mongodb:
|
|
70
|
-
mysql:
|
|
71
|
-
postgresql:
|
|
72
|
-
sqlite:
|
|
73
|
-
mssql:
|
|
65
|
+
origins: Type.Optional(Type.Array(Type.String())),
|
|
66
|
+
mongodb: Type.Optional(Type.String()),
|
|
67
|
+
mysql: sqlSettingsSchema,
|
|
68
|
+
postgresql: sqlSettingsSchema,
|
|
69
|
+
sqlite: sqlSettingsSchema,
|
|
70
|
+
mssql: sqlSettingsSchema
|
|
74
71
|
}, { $id: 'ApplicationConfiguration', additionalProperties: false });
|
|
75
72
|
//# sourceMappingURL=default-schemas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-schemas.js","sourceRoot":"","sources":["../src/default-schemas.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"default-schemas.js","sourceRoot":"","sources":["../src/default-schemas.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC,MAAM,CAAC;IACtD,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;IAC9D,MAAM,EAAE,IAAI,CAAC,QAAQ,CACnB,IAAI,CAAC,KAAK,CAAC;QACT,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,mDAAmD,EAAE,CAAC;QACjF,IAAI,CAAC,IAAI,EAAE;KACZ,CAAC,CACH;IACD,QAAQ,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