@grandlinex/kernel 1.1.0-alpha.0 → 1.2.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 +117 -117
- package/LICENSE +29 -29
- package/README.md +30 -30
- package/dist/cjs/actions/ApiAuthTestAction.js +6 -12
- package/dist/cjs/actions/ApiVersionAction.js +14 -18
- package/dist/cjs/actions/GetTokenAction.js +26 -31
- package/dist/cjs/classes/BaseAction.d.ts +3 -7
- package/dist/cjs/classes/BaseAction.js +21 -19
- package/dist/cjs/classes/BaseApiAction.d.ts +2 -1
- package/dist/cjs/classes/RouteApiAction.js +7 -7
- package/dist/cjs/classes/index.d.ts +2 -2
- package/dist/cjs/classes/index.js +2 -3
- package/dist/cjs/index.d.ts +0 -1
- package/dist/cjs/index.js +0 -1
- package/dist/cjs/lib/express.d.ts +2 -0
- package/dist/cjs/lib/index.d.ts +0 -1
- package/dist/mjs/actions/ApiAuthTestAction.js +7 -13
- package/dist/mjs/actions/ApiVersionAction.js +16 -20
- package/dist/mjs/actions/GetTokenAction.js +28 -33
- package/dist/mjs/classes/BaseAction.d.ts +3 -7
- package/dist/mjs/classes/BaseAction.js +19 -16
- package/dist/mjs/classes/BaseApiAction.d.ts +2 -1
- package/dist/mjs/classes/RouteApiAction.js +7 -7
- package/dist/mjs/classes/index.d.ts +2 -2
- package/dist/mjs/classes/index.js +2 -2
- package/dist/mjs/index.d.ts +0 -1
- package/dist/mjs/index.js +0 -1
- package/dist/mjs/lib/express.d.ts +2 -0
- package/dist/mjs/lib/index.d.ts +0 -1
- package/package.json +89 -89
- package/dist/cjs/annotation/index.d.ts +0 -13
- package/dist/cjs/annotation/index.js +0 -21
- package/dist/mjs/annotation/index.d.ts +0 -13
- package/dist/mjs/annotation/index.js +0 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,117 +1,117 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
All notable changes to this project will be documented in this file.
|
|
3
|
-
|
|
4
|
-
## [1.0.0] - 2024-07-30
|
|
5
|
-
### Added
|
|
6
|
-
- Add EntitySchemaExtender
|
|
7
|
-
- Add BaseUserAgent
|
|
8
|
-
### Changed
|
|
9
|
-
- Update Deps
|
|
10
|
-
|
|
11
|
-
## [0.32.11] - 2024-07-13
|
|
12
|
-
### Changed
|
|
13
|
-
- Update Deps
|
|
14
|
-
- Error Handling for BaseApiAction
|
|
15
|
-
|
|
16
|
-
## [0.32.10] - 2023-10-06
|
|
17
|
-
### Changed
|
|
18
|
-
- Breaking Change: BaseApiAction now use XActionEvent
|
|
19
|
-
|
|
20
|
-
## [0.31.1] - 2023-07-07
|
|
21
|
-
### Added
|
|
22
|
-
- @/token pass the token body to jwt generator function
|
|
23
|
-
### Fixed
|
|
24
|
-
- Deal with code smells
|
|
25
|
-
|
|
26
|
-
## [0.31.0] - 2023-07-06
|
|
27
|
-
### Added
|
|
28
|
-
- JTW Token now can be extended with custom payload
|
|
29
|
-
- Update to core 0.31.0
|
|
30
|
-
- Add forceDebug flag for BaseAction to force Server-Timing in production mode
|
|
31
|
-
|
|
32
|
-
## [0.30.0] - 2023-04-03
|
|
33
|
-
### Added
|
|
34
|
-
- Switch to ESM
|
|
35
|
-
- Update to core 0.30.0
|
|
36
|
-
|
|
37
|
-
## [0.27.1] - 2023-01-26
|
|
38
|
-
### Added
|
|
39
|
-
- Add raw body field for express calls
|
|
40
|
-
- change BaseEndpoint variables from private to protected
|
|
41
|
-
|
|
42
|
-
## [0.25.2] - 2022-08-07
|
|
43
|
-
### Added
|
|
44
|
-
- Add express timing api in dev mode
|
|
45
|
-
|
|
46
|
-
## [0.25.0] - 2022-07-23
|
|
47
|
-
### Changed
|
|
48
|
-
- Update to core 0.25.0
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
## [0.18.0] - 2022-01-10
|
|
52
|
-
### Changed
|
|
53
|
-
- Update to core 0.18.0
|
|
54
|
-
|
|
55
|
-
## [0.17.0] - 2022-01-03
|
|
56
|
-
### Changed
|
|
57
|
-
- Update to core 0.17.1
|
|
58
|
-
- Using db prefab for kernel db
|
|
59
|
-
|
|
60
|
-
## [0.16.2] - 2021-12-17
|
|
61
|
-
|
|
62
|
-
### Changed
|
|
63
|
-
- Update Db Bundles with search bug
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
## [0.16.1] - 2021-12-07
|
|
67
|
-
|
|
68
|
-
### Changed
|
|
69
|
-
- Update to core 0.16.2
|
|
70
|
-
|
|
71
|
-
## [0.15.3] - 2021-12-06
|
|
72
|
-
### Changed
|
|
73
|
-
- Update to core 0.15.1
|
|
74
|
-
|
|
75
|
-
## [0.15.2] - 2021-12-04
|
|
76
|
-
|
|
77
|
-
### Fixed
|
|
78
|
-
- Update to fixed database bundles
|
|
79
|
-
- Export DB Classes in root file
|
|
80
|
-
|
|
81
|
-
## [0.15.1] - 2021-12-03
|
|
82
|
-
|
|
83
|
-
### Fixed
|
|
84
|
-
- Linting error
|
|
85
|
-
- DB Duplication
|
|
86
|
-
|
|
87
|
-
## [0.15.0] - 2021-12-02
|
|
88
|
-
### Added
|
|
89
|
-
- Add Changelog
|
|
90
|
-
- Add ORM System
|
|
91
|
-
- Add reflection Typescript feature (for ORM)
|
|
92
|
-
````json
|
|
93
|
-
{
|
|
94
|
-
"dependencies": {
|
|
95
|
-
"reflect-metadata": "^0.1.13"
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
````
|
|
99
|
-
- `GKey` Store
|
|
100
|
-
- `GKey` - ORM Entity
|
|
101
|
-
### Changed
|
|
102
|
-
- Update to core version `0.15.0`
|
|
103
|
-
- Change tsconfig.json enable decorator feature
|
|
104
|
-
````json
|
|
105
|
-
{
|
|
106
|
-
"experimentalDecorators": true,
|
|
107
|
-
"emitDecoratorMetadata": true
|
|
108
|
-
}
|
|
109
|
-
````
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
### Removed
|
|
113
|
-
- legacy keystore
|
|
114
|
-
|
|
115
|
-
### Fixed
|
|
116
|
-
> bundle export nameSpace
|
|
117
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
All notable changes to this project will be documented in this file.
|
|
3
|
+
|
|
4
|
+
## [1.0.0] - 2024-07-30
|
|
5
|
+
### Added
|
|
6
|
+
- Add EntitySchemaExtender
|
|
7
|
+
- Add BaseUserAgent
|
|
8
|
+
### Changed
|
|
9
|
+
- Update Deps
|
|
10
|
+
|
|
11
|
+
## [0.32.11] - 2024-07-13
|
|
12
|
+
### Changed
|
|
13
|
+
- Update Deps
|
|
14
|
+
- Error Handling for BaseApiAction
|
|
15
|
+
|
|
16
|
+
## [0.32.10] - 2023-10-06
|
|
17
|
+
### Changed
|
|
18
|
+
- Breaking Change: BaseApiAction now use XActionEvent
|
|
19
|
+
|
|
20
|
+
## [0.31.1] - 2023-07-07
|
|
21
|
+
### Added
|
|
22
|
+
- @/token pass the token body to jwt generator function
|
|
23
|
+
### Fixed
|
|
24
|
+
- Deal with code smells
|
|
25
|
+
|
|
26
|
+
## [0.31.0] - 2023-07-06
|
|
27
|
+
### Added
|
|
28
|
+
- JTW Token now can be extended with custom payload
|
|
29
|
+
- Update to core 0.31.0
|
|
30
|
+
- Add forceDebug flag for BaseAction to force Server-Timing in production mode
|
|
31
|
+
|
|
32
|
+
## [0.30.0] - 2023-04-03
|
|
33
|
+
### Added
|
|
34
|
+
- Switch to ESM
|
|
35
|
+
- Update to core 0.30.0
|
|
36
|
+
|
|
37
|
+
## [0.27.1] - 2023-01-26
|
|
38
|
+
### Added
|
|
39
|
+
- Add raw body field for express calls
|
|
40
|
+
- change BaseEndpoint variables from private to protected
|
|
41
|
+
|
|
42
|
+
## [0.25.2] - 2022-08-07
|
|
43
|
+
### Added
|
|
44
|
+
- Add express timing api in dev mode
|
|
45
|
+
|
|
46
|
+
## [0.25.0] - 2022-07-23
|
|
47
|
+
### Changed
|
|
48
|
+
- Update to core 0.25.0
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
## [0.18.0] - 2022-01-10
|
|
52
|
+
### Changed
|
|
53
|
+
- Update to core 0.18.0
|
|
54
|
+
|
|
55
|
+
## [0.17.0] - 2022-01-03
|
|
56
|
+
### Changed
|
|
57
|
+
- Update to core 0.17.1
|
|
58
|
+
- Using db prefab for kernel db
|
|
59
|
+
|
|
60
|
+
## [0.16.2] - 2021-12-17
|
|
61
|
+
|
|
62
|
+
### Changed
|
|
63
|
+
- Update Db Bundles with search bug
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## [0.16.1] - 2021-12-07
|
|
67
|
+
|
|
68
|
+
### Changed
|
|
69
|
+
- Update to core 0.16.2
|
|
70
|
+
|
|
71
|
+
## [0.15.3] - 2021-12-06
|
|
72
|
+
### Changed
|
|
73
|
+
- Update to core 0.15.1
|
|
74
|
+
|
|
75
|
+
## [0.15.2] - 2021-12-04
|
|
76
|
+
|
|
77
|
+
### Fixed
|
|
78
|
+
- Update to fixed database bundles
|
|
79
|
+
- Export DB Classes in root file
|
|
80
|
+
|
|
81
|
+
## [0.15.1] - 2021-12-03
|
|
82
|
+
|
|
83
|
+
### Fixed
|
|
84
|
+
- Linting error
|
|
85
|
+
- DB Duplication
|
|
86
|
+
|
|
87
|
+
## [0.15.0] - 2021-12-02
|
|
88
|
+
### Added
|
|
89
|
+
- Add Changelog
|
|
90
|
+
- Add ORM System
|
|
91
|
+
- Add reflection Typescript feature (for ORM)
|
|
92
|
+
````json
|
|
93
|
+
{
|
|
94
|
+
"dependencies": {
|
|
95
|
+
"reflect-metadata": "^0.1.13"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
````
|
|
99
|
+
- `GKey` Store
|
|
100
|
+
- `GKey` - ORM Entity
|
|
101
|
+
### Changed
|
|
102
|
+
- Update to core version `0.15.0`
|
|
103
|
+
- Change tsconfig.json enable decorator feature
|
|
104
|
+
````json
|
|
105
|
+
{
|
|
106
|
+
"experimentalDecorators": true,
|
|
107
|
+
"emitDecoratorMetadata": true
|
|
108
|
+
}
|
|
109
|
+
````
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
### Removed
|
|
113
|
+
- legacy keystore
|
|
114
|
+
|
|
115
|
+
### Fixed
|
|
116
|
+
> bundle export nameSpace
|
|
117
|
+
|
package/LICENSE
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
BSD 3-Clause License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021, GrandlineX
|
|
4
|
-
All rights reserved.
|
|
5
|
-
|
|
6
|
-
Redistribution and use in source and binary forms, with or without
|
|
7
|
-
modification, are permitted provided that the following conditions are met:
|
|
8
|
-
|
|
9
|
-
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
-
list of conditions and the following disclaimer.
|
|
11
|
-
|
|
12
|
-
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
-
this list of conditions and the following disclaimer in the documentation
|
|
14
|
-
and/or other materials provided with the distribution.
|
|
15
|
-
|
|
16
|
-
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
-
contributors may be used to endorse or promote products derived from
|
|
18
|
-
this software without specific prior written permission.
|
|
19
|
-
|
|
20
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021, GrandlineX
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
# GrandLineX Kernel
|
|
2
|
-
|
|
3
|
-
## Description
|
|
4
|
-
|
|
5
|
-
GrandLineX is an out-of-the-box server framework on top of ExpressJs.
|
|
6
|
-
|
|
7
|
-
<img alt="img" height="24" src="https://img.shields.io/static/v1?label=&message=KERNEL&color=black&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAAAAACPAi4CAAABJWlDQ1BJQ0MgcHJvZmlsZQAAKJGdkL9KxEAQxr/EQ0XORsVCLLawPbAxlY1/MFgcnLkIRqvcbg4PszFk9zh8A9/Ee5grBME38AUUrP02Wli4jQvD/Bhmvm9mgVCUUpvOPqAr28TJUXaVXYuVN3TRwQYOEObS1P3hWQrv+3xF4PJLz2n5+/58y6owknnBqGTdWCA4JEczWztmYOsuTU7Ij2ShdKXIc/Ke0sqxm010OZU/mm6bblFdDl2dsYsY5+hjAIERppighEWPuWLlFBHvFOxpkOMBBpK5RMHajD0WtyRDpRjHpJTEbTx+O63fgC4jakyo5Rzuoanp/OD+93vs46KdDLYXdd7kbWmJEY7HwPsTsJ4Bm8/A2o3Ha/X3bZ6eqO35541f9HxQa/wig0AAAAAJcEhZcwAAC7gAAAu4AT6yGBcAAAAHdElNRQflDAQSNSxPhIOMAAAEMElEQVRYw+2Wa0wUVxTH/3dmH+wgr4WdBWst4gIVwUAoxqJUwYatthCMtpVoE0usqY1pg/ShMTFpm6YiiWlMStLWEm0biqQE05qoLUIEIqlaHoW2yoLQxQWB3YVleezszuztB8XFFdoh/dKkO5/mnjnzmznnnnP+l/D4dxeDACAACA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CqEz3238P778wDmU6aaNbuVANikxH0jTqqJ1CoJILHypU0oDc9TAAAbHj5rk+qyVfLVeezw1346JjWcmF6MvI8dPdLpmVP9zrPFVuei1NldVV9gTIhgCKGQxjuqfhS0ZjWAcdnqDIDTJz0ZqRLttzoHXQDhNQAm7IsABE5pAUAA8D8D/AUp6ovNs1/7jgAAAABJRU5ErkJggg==" />
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
[](https://github.com/GrandlineX/kernel)
|
|
11
|
-
[](https://www.npmjs.com/package/@grandlinex/kernel)
|
|
12
|
-

|
|
13
|
-
|
|
14
|
-
### Status
|
|
15
|
-

|
|
16
|
-

|
|
17
|
-

|
|
18
|
-

|
|
19
|
-

|
|
20
|
-
|
|
21
|
-
### Issues
|
|
22
|
-

|
|
23
|
-

|
|
24
|
-

|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
## Documentation
|
|
28
|
-
- [Documentation](https://grandlinex.github.io/kernel/)
|
|
29
|
-
- [GrandLineX Docs](https://grandlinex.github.io/docs/)
|
|
30
|
-
- [GrandLineX Project](https://grandlinex.github.io/)
|
|
1
|
+
# GrandLineX Kernel
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
GrandLineX is an out-of-the-box server framework on top of ExpressJs.
|
|
6
|
+
|
|
7
|
+
<img alt="img" height="24" src="https://img.shields.io/static/v1?label=&message=KERNEL&color=black&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAAAAACPAi4CAAABJWlDQ1BJQ0MgcHJvZmlsZQAAKJGdkL9KxEAQxr/EQ0XORsVCLLawPbAxlY1/MFgcnLkIRqvcbg4PszFk9zh8A9/Ee5grBME38AUUrP02Wli4jQvD/Bhmvm9mgVCUUpvOPqAr28TJUXaVXYuVN3TRwQYOEObS1P3hWQrv+3xF4PJLz2n5+/58y6owknnBqGTdWCA4JEczWztmYOsuTU7Ij2ShdKXIc/Ke0sqxm010OZU/mm6bblFdDl2dsYsY5+hjA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Z39P6gB0B6qOviy0uwiBHCLkgeMl6hB/Daf2jEDQuD4taO5+qri25zng9p1W1UuABTBsaR+INPne33D3pCIjQQAt13CnSEfxmyOtpv3hFQqrh0/YDTS26YoKoleOJrji8VurUQlCfBK9HRKdomnj/NSyfA+0PyhJFFJovCKkrX87Tfgru4kPFmeHTNUZwi/lKGvt0GzOXmkNdk0mdbbQrL0dWNhOQk9vyV3WYwaAgx3Z9ia1kdemNJuHm5CQk7I9avCo+0c92UIAPfRuoesmWVqAGgsof/YTLaZJAD09V/mDjBu30oCADoZ7ey4KAIg60q4OV57NpGF6vzRgfLnJh4Au1rfNduQwUVvht67662VAZj0ZKkAKJI3Ro0zrCqEz3238P778wDmU6aaNbuVANikxH0jTqqJ1CoJILHypU0oDc9TAAAbHj5rk+qyVfLVeezw1346JjWcmF6MvI8dPdLpmVP9zrPFVuei1NldVV9gTIhgCKGQxjuqfhS0ZjWAcdnqDIDTJz0ZqRLttzoHXQDhNQAm7IsABE5pAUAA8D8D/AUp6ovNs1/7jgAAAABJRU5ErkJggg==" />
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
[](https://github.com/GrandlineX/kernel)
|
|
11
|
+
[](https://www.npmjs.com/package/@grandlinex/kernel)
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
### Status
|
|
15
|
+

|
|
16
|
+

|
|
17
|
+

|
|
18
|
+

|
|
19
|
+

|
|
20
|
+
|
|
21
|
+
### Issues
|
|
22
|
+

|
|
23
|
+

|
|
24
|
+

|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## Documentation
|
|
28
|
+
- [Documentation](https://grandlinex.github.io/kernel/)
|
|
29
|
+
- [GrandLineX Docs](https://grandlinex.github.io/docs/)
|
|
30
|
+
- [GrandLineX Project](https://grandlinex.github.io/)
|
|
@@ -8,7 +8,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
const swagger_mate_1 = require("@grandlinex/swagger-mate");
|
|
10
10
|
const index_js_1 = require("../classes/index.js");
|
|
11
|
-
const index_js_2 = require("../annotation/index.js");
|
|
12
11
|
let ApiAuthTestAction = class ApiAuthTestAction extends index_js_1.RouteApiAction {
|
|
13
12
|
async handler({ data, res }) {
|
|
14
13
|
this.debug(data.userid);
|
|
@@ -16,16 +15,11 @@ let ApiAuthTestAction = class ApiAuthTestAction extends index_js_1.RouteApiActio
|
|
|
16
15
|
}
|
|
17
16
|
};
|
|
18
17
|
ApiAuthTestAction = __decorate([
|
|
19
|
-
(0, swagger_mate_1.
|
|
20
|
-
'
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
responses: swagger_mate_1.SPathUtil.defaultResponse('200', '403'),
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
}),
|
|
29
|
-
(0, index_js_2.Route)('GET', '/test/auth')
|
|
18
|
+
(0, swagger_mate_1.Route)('GET', '/test/auth', {
|
|
19
|
+
operationId: 'testAuth',
|
|
20
|
+
summary: 'Test user auth',
|
|
21
|
+
tags: ['kernel'],
|
|
22
|
+
responseCodes: ['200', '403'],
|
|
23
|
+
})
|
|
30
24
|
], ApiAuthTestAction);
|
|
31
25
|
exports.default = ApiAuthTestAction;
|
|
@@ -8,7 +8,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
const swagger_mate_1 = require("@grandlinex/swagger-mate");
|
|
10
10
|
const index_js_1 = require("../classes/index.js");
|
|
11
|
-
const index_js_2 = require("../annotation/index.js");
|
|
12
11
|
let ApiVersionAction = class ApiVersionAction extends index_js_1.RouteApiAction {
|
|
13
12
|
async handler({ res, extension }) {
|
|
14
13
|
extension.done();
|
|
@@ -16,24 +15,21 @@ let ApiVersionAction = class ApiVersionAction extends index_js_1.RouteApiAction
|
|
|
16
15
|
}
|
|
17
16
|
};
|
|
18
17
|
ApiVersionAction = __decorate([
|
|
19
|
-
(0, swagger_mate_1.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
required: ['api'],
|
|
33
|
-
}, false, '403'),
|
|
18
|
+
(0, swagger_mate_1.Route)('GET', '/version', {
|
|
19
|
+
mode: swagger_mate_1.ActionMode.DMZ,
|
|
20
|
+
operationId: 'getVersion',
|
|
21
|
+
summary: 'Get API version',
|
|
22
|
+
tags: ['kernel'],
|
|
23
|
+
responseSchema: {
|
|
24
|
+
type: 'object',
|
|
25
|
+
properties: {
|
|
26
|
+
api: {
|
|
27
|
+
type: 'number',
|
|
28
|
+
},
|
|
34
29
|
},
|
|
30
|
+
required: ['api'],
|
|
35
31
|
},
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
responseCodes: ['200', '403'],
|
|
33
|
+
})
|
|
38
34
|
], ApiVersionAction);
|
|
39
35
|
exports.default = ApiVersionAction;
|
|
@@ -8,19 +8,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
const swagger_mate_1 = require("@grandlinex/swagger-mate");
|
|
10
10
|
const index_js_1 = require("../classes/index.js");
|
|
11
|
-
const index_js_2 = require("../annotation/index.js");
|
|
12
|
-
const schema = {
|
|
13
|
-
type: 'object',
|
|
14
|
-
properties: {
|
|
15
|
-
username: {
|
|
16
|
-
type: 'string',
|
|
17
|
-
},
|
|
18
|
-
token: {
|
|
19
|
-
type: 'string',
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
required: ['username', 'token'],
|
|
23
|
-
};
|
|
24
11
|
let GetTokenAction = class GetTokenAction extends index_js_1.RouteApiAction {
|
|
25
12
|
async handler({ req, res, extension, body, }) {
|
|
26
13
|
const cc = this.getKernel().getCryptoClient();
|
|
@@ -40,25 +27,33 @@ let GetTokenAction = class GetTokenAction extends index_js_1.RouteApiAction {
|
|
|
40
27
|
}
|
|
41
28
|
};
|
|
42
29
|
GetTokenAction = __decorate([
|
|
43
|
-
(0, swagger_mate_1.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
30
|
+
(0, swagger_mate_1.Route)('POST', '/token', {
|
|
31
|
+
mode: swagger_mate_1.ActionMode.DMZ,
|
|
32
|
+
operationId: 'getToken',
|
|
33
|
+
summary: 'Get API token',
|
|
34
|
+
tags: ['kernel'],
|
|
35
|
+
requestSchema: {
|
|
36
|
+
type: 'object',
|
|
37
|
+
properties: {
|
|
38
|
+
username: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
},
|
|
41
|
+
token: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
required: ['username', 'token'],
|
|
46
|
+
},
|
|
47
|
+
responseSchema: {
|
|
48
|
+
type: 'object',
|
|
49
|
+
properties: {
|
|
50
|
+
token: {
|
|
51
|
+
type: 'string',
|
|
52
|
+
},
|
|
59
53
|
},
|
|
54
|
+
required: ['token'],
|
|
60
55
|
},
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
responseCodes: ['200', '403'],
|
|
57
|
+
})
|
|
63
58
|
], GetTokenAction);
|
|
64
59
|
exports.default = GetTokenAction;
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import { CoreAction, IDataBase } from '@grandlinex/core';
|
|
2
|
-
import { ErrorType, SSchemaEl } from '@grandlinex/swagger-mate';
|
|
2
|
+
import { ActionMode, ErrorType, SSchemaEl } from '@grandlinex/swagger-mate';
|
|
3
3
|
import { IBaseAction, IBaseCache, IBaseClient, IBaseKernelModule, IBasePresenter, IKernel } from '../lib/index.js';
|
|
4
4
|
import { XActionEvent, XRequest, XResponse } from '../lib/express.js';
|
|
5
|
-
export declare enum ActionMode {
|
|
6
|
-
'DEFAULT' = 0,
|
|
7
|
-
'DMZ' = 1,
|
|
8
|
-
'DMZ_WITH_USER' = 2
|
|
9
|
-
}
|
|
10
5
|
export default abstract class BaseAction<K extends IKernel = IKernel, T extends IDataBase<any, any> | null = any, P extends IBaseClient | null = any, C extends IBaseCache | null = any, E extends IBasePresenter | null = any> extends CoreAction<K, T, P, C, E> implements IBaseAction<K, T, P, C, E> {
|
|
11
6
|
mode: ActionMode;
|
|
12
7
|
forceDebug: boolean;
|
|
13
|
-
|
|
8
|
+
requestSchema: SSchemaEl | null;
|
|
14
9
|
constructor(chanel: string, module: IBaseKernelModule<K, T, P, C, E>);
|
|
15
10
|
abstract handler(event: XActionEvent): Promise<void>;
|
|
16
11
|
static validateSchema(error: ErrorType, schema: SSchemaEl, key: string, field: any, required?: boolean): void;
|
|
17
12
|
bodyValidation<A>(req: XRequest): A | ErrorType | null;
|
|
13
|
+
static sendError(res: XResponse, code: number, error: Partial<ErrorType>): void;
|
|
18
14
|
secureHandler(req: XRequest, res: XResponse, next: () => void): Promise<void>;
|
|
19
15
|
setMode(mode: ActionMode): void;
|
|
20
16
|
abstract register(): void;
|