@grandlinex/kernel 1.1.0-alpha.0 → 1.1.1

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 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=&amp;message=KERNEL&amp;color=black&amp;logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAAAAACPAi4CAAABJWlDQ1BJQ0MgcHJvZmlsZQAAKJGdkL9KxEAQxr/EQ0XORsVCLLawPbAxlY1/MFgcnLkIRqvcbg4PszFk9zh8A9/Ee5grBME38AUUrP02Wli4jQvD/Bhmvm9mgVCUUpvOPqAr28TJUXaVXYuVN3TRwQYOEObS1P3hWQrv+3xF4PJLz2n5+/58y6owknnBqGTdWCA4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ZqoJ0qpx2kKQ1OqKzouu0cmeaPoVWfMPEb3soas/nDernomKXTW9DGJvGmJg8zZ39P6gB0B6qOviy0uwiBHCLkgeMl6hB/Daf2jEDQuD4taO5+qri25zng9p1W1UuABTBsaR+INPne33D3pCIjQQAt13CnSEfxmyOtpv3hFQqrh0/YDTS26YoKoleOJrji8VurUQlCfBK9HRKdomnj/NSyfA+0PyhJFFJovCKkrX87Tfgru4kPFmeHTNUZwi/lKGvt0GzOXmkNdk0mdbbQrL0dWNhOQk9vyV3WYwaAgx3Z9ia1kdemNJuHm5CQk7I9avCo+0c92UIAPfRuoesmWVqAGgsof/YTLaZJAD09V/mDjBu30oCADoZ7ey4KAIg60q4OV57NpGF6vzRgfLnJh4Au1rfNduQwUVvht67662VAZj0ZKkAKJI3Ro0zrCqEz3238P778wDmU6aaNbuVANikxH0jTqqJ1CoJILHypU0oDc9TAAAbHj5rk+qyVfLVeezw1346JjWcmF6MvI8dPdLpmVP9zrPFVuei1NldVV9gTIhgCKGQxjuqfhS0ZjWAcdnqDIDTJz0ZqRLttzoHXQDhNQAm7IsABE5pAUAA8D8D/AUp6ovNs1/7jgAAAABJRU5ErkJggg==" />
8
-
9
-
10
- [![GitHub](https://badge.fury.io/gh/grandlinex%2Fkernel.svg)](https://github.com/GrandlineX/kernel)
11
- [![NPM](https://img.shields.io/static/v1?label=NPM&message=Package&color=red&logo=NPM)](https://www.npmjs.com/package/@grandlinex/kernel)
12
- ![TS](https://img.shields.io/static/v1?label=Language&message=TypeScript&color=blue&logo=TypeScript)
13
-
14
- ### Status
15
- ![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=GrandlineX_kernel&metric=alert_status)
16
- ![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=GrandlineX_kernel&metric=security_rating)
17
- ![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=GrandlineX_kernel&metric=sqale_rating)
18
- ![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=GrandlineX_kernel&metric=reliability_rating)
19
- ![Coverage](https://sonarcloud.io/api/project_badges/measure?project=GrandlineX_kernel&metric=coverage)
20
-
21
- ### Issues
22
- ![Bugs](https://sonarcloud.io/api/project_badges/measure?project=GrandlineX_kernel&metric=bugs)
23
- ![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=GrandlineX_kernel&metric=vulnerabilities)
24
- ![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=GrandlineX_kernel&metric=code_smells)
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=&amp;message=KERNEL&amp;color=black&amp;logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAAAAACPAi4CAAABJWlDQ1BJQ0MgcHJvZmlsZQAAKJGdkL9KxEAQxr/EQ0XORsVCLLawPbAxlY1/MFgcnLkIRqvcbg4PszFk9zh8A9/Ee5grBME38AUUrP02Wli4jQvD/Bhmvm9mgVCUUpvOPqAr28TJUXaVXYuVN3TRwQYOEObS1P3hWQrv+3xF4PJLz2n5+/58y6owknnBqGTdWCA4JEczWztmYOsuTU7Ij2ShdKXIc/Ke0sqxm010OZU/mm6bblFdDl2dsYsY5+hjAIERppighEWPuWLlFBHvFOxpkOMBBpK5RMHajD0WtyRDpRjHpJTEbTx+O63fgC4jakyo5Rzuoanp/OD+93vs46KdDLYXdd7kbWmJEY7HwPsTsJ4Bm8/A2o3Ha/X3bZ6eqO35541f9HxQa/wig0AAAAAJcEhZcwAAC7gAAAu4AT6yGBcAAAAHdElNRQflDAQSNSxPhIOMAAAEMElEQVRYw+2Wa0wUVxTH/3dmH+wgr4WdBWst4gIVwUAoxqJUwYatthCMtpVoE0usq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oesmWVqAGgsof/YTLaZJAD09V/mDjBu30oCADoZ7ey4KAIg60q4OV57NpGF6vzRgfLnJh4Au1rfNduQwUVvht67662VAZj0ZKkAKJI3Ro0zrCqEz3238P778wDmU6aaNbuVANikxH0jTqqJ1CoJILHypU0oDc9TAAAbHj5rk+qyVfLVeezw1346JjWcmF6MvI8dPdLpmVP9zrPFVuei1NldVV9gTIhgCKGQxjuqfhS0ZjWAcdnqDIDTJz0ZqRLttzoHXQDhNQAm7IsABE5pAUAA8D8D/AUp6ovNs1/7jgAAAABJRU5ErkJggg==" />
8
+
9
+
10
+ [![GitHub](https://badge.fury.io/gh/grandlinex%2Fkernel.svg)](https://github.com/GrandlineX/kernel)
11
+ [![NPM](https://img.shields.io/static/v1?label=NPM&message=Package&color=red&logo=NPM)](https://www.npmjs.com/package/@grandlinex/kernel)
12
+ ![TS](https://img.shields.io/static/v1?label=Language&message=TypeScript&color=blue&logo=TypeScript)
13
+
14
+ ### Status
15
+ ![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=GrandlineX_kernel&metric=alert_status)
16
+ ![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=GrandlineX_kernel&metric=security_rating)
17
+ ![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=GrandlineX_kernel&metric=sqale_rating)
18
+ ![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=GrandlineX_kernel&metric=reliability_rating)
19
+ ![Coverage](https://sonarcloud.io/api/project_badges/measure?project=GrandlineX_kernel&metric=coverage)
20
+
21
+ ### Issues
22
+ ![Bugs](https://sonarcloud.io/api/project_badges/measure?project=GrandlineX_kernel&metric=bugs)
23
+ ![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=GrandlineX_kernel&metric=vulnerabilities)
24
+ ![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=GrandlineX_kernel&metric=code_smells)
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/)
@@ -15,6 +15,7 @@ export default abstract class BaseAction<K extends IKernel = IKernel, T extends
15
15
  abstract handler(event: XActionEvent): Promise<void>;
16
16
  static validateSchema(error: ErrorType, schema: SSchemaEl, key: string, field: any, required?: boolean): void;
17
17
  bodyValidation<A>(req: XRequest): A | ErrorType | null;
18
+ static sendError(res: XResponse, code: number, error: Partial<ErrorType>): void;
18
19
  secureHandler(req: XRequest, res: XResponse, next: () => void): Promise<void>;
19
20
  setMode(mode: ActionMode): void;
20
21
  abstract register(): void;
@@ -108,6 +108,12 @@ class BaseAction extends core_1.CoreAction {
108
108
  }
109
109
  return req.body;
110
110
  }
111
+ static sendError(res, code, error) {
112
+ res.status(code).send({
113
+ type: 'error',
114
+ ...error,
115
+ });
116
+ }
111
117
  async secureHandler(req, res, next) {
112
118
  const extension = this.initExtension(res);
113
119
  const auth = extension.timing.start('auth');
@@ -145,6 +151,7 @@ class BaseAction extends core_1.CoreAction {
145
151
  extension,
146
152
  agent: new BaseUserAgent_js_1.BaseUserAgent(req),
147
153
  body,
154
+ sendError: (code, error) => BaseAction.sendError(res, code, error),
148
155
  });
149
156
  }
150
157
  catch (e) {
@@ -180,6 +187,7 @@ class BaseAction extends core_1.CoreAction {
180
187
  extension,
181
188
  agent: new BaseUserAgent_js_1.BaseUserAgent(req),
182
189
  body,
190
+ sendError: (code, error) => BaseAction.sendError(res, code, error),
183
191
  });
184
192
  }
185
193
  catch (e) {
@@ -212,6 +220,7 @@ class BaseAction extends core_1.CoreAction {
212
220
  extension,
213
221
  agent: new BaseUserAgent_js_1.BaseUserAgent(req),
214
222
  body,
223
+ sendError: (code, error) => BaseAction.sendError(res, code, error),
215
224
  });
216
225
  }
217
226
  catch (e) {
@@ -1,4 +1,5 @@
1
1
  import express from 'express';
2
+ import { ErrorType } from '@grandlinex/swagger-mate';
2
3
  import { BaseUserAgent, IExtensionInterface, JwtToken } from '../classes/index.js';
3
4
  export type XRequest = express.Request & {
4
5
  rawBody?: string | null;
@@ -13,4 +14,5 @@ export type XActionEvent<G = JwtToken | null, B = any> = {
13
14
  extension: IExtensionInterface;
14
15
  agent: BaseUserAgent;
15
16
  body: B;
17
+ sendError: (code: number, error: Partial<ErrorType>) => void;
16
18
  };
@@ -15,6 +15,7 @@ export default abstract class BaseAction<K extends IKernel = IKernel, T extends
15
15
  abstract handler(event: XActionEvent): Promise<void>;
16
16
  static validateSchema(error: ErrorType, schema: SSchemaEl, key: string, field: any, required?: boolean): void;
17
17
  bodyValidation<A>(req: XRequest): A | ErrorType | null;
18
+ static sendError(res: XResponse, code: number, error: Partial<ErrorType>): void;
18
19
  secureHandler(req: XRequest, res: XResponse, next: () => void): Promise<void>;
19
20
  setMode(mode: ActionMode): void;
20
21
  abstract register(): void;
@@ -105,6 +105,12 @@ export default class BaseAction extends CoreAction {
105
105
  }
106
106
  return req.body;
107
107
  }
108
+ static sendError(res, code, error) {
109
+ res.status(code).send({
110
+ type: 'error',
111
+ ...error,
112
+ });
113
+ }
108
114
  async secureHandler(req, res, next) {
109
115
  const extension = this.initExtension(res);
110
116
  const auth = extension.timing.start('auth');
@@ -142,6 +148,7 @@ export default class BaseAction extends CoreAction {
142
148
  extension,
143
149
  agent: new BaseUserAgent(req),
144
150
  body,
151
+ sendError: (code, error) => BaseAction.sendError(res, code, error),
145
152
  });
146
153
  }
147
154
  catch (e) {
@@ -177,6 +184,7 @@ export default class BaseAction extends CoreAction {
177
184
  extension,
178
185
  agent: new BaseUserAgent(req),
179
186
  body,
187
+ sendError: (code, error) => BaseAction.sendError(res, code, error),
180
188
  });
181
189
  }
182
190
  catch (e) {
@@ -209,6 +217,7 @@ export default class BaseAction extends CoreAction {
209
217
  extension,
210
218
  agent: new BaseUserAgent(req),
211
219
  body,
220
+ sendError: (code, error) => BaseAction.sendError(res, code, error),
212
221
  });
213
222
  }
214
223
  catch (e) {
@@ -1,4 +1,5 @@
1
1
  import express from 'express';
2
+ import { ErrorType } from '@grandlinex/swagger-mate';
2
3
  import { BaseUserAgent, IExtensionInterface, JwtToken } from '../classes/index.js';
3
4
  export type XRequest = express.Request & {
4
5
  rawBody?: string | null;
@@ -13,4 +14,5 @@ export type XActionEvent<G = JwtToken | null, B = any> = {
13
14
  extension: IExtensionInterface;
14
15
  agent: BaseUserAgent;
15
16
  body: B;
17
+ sendError: (code: number, error: Partial<ErrorType>) => void;
16
18
  };
package/package.json CHANGED
@@ -1,89 +1,89 @@
1
- {
2
- "name": "@grandlinex/kernel",
3
- "version": "1.1.0-alpha.0",
4
- "description": "GrandLineX is an out-of-the-box server framework on top of ExpressJs.",
5
- "type": "module",
6
- "exports": {
7
- ".": {
8
- "import": {
9
- "types": "./dist/mjs/index.d.ts",
10
- "default": "./dist/mjs/index.js"
11
- },
12
- "require": {
13
- "types": "./dist/cjs/index.d.ts",
14
- "default": "./dist/cjs/index.js"
15
- }
16
- }
17
- },
18
- "types": "dist/cjs/index.d.ts",
19
- "main": "dist/cjs/index.js",
20
- "module": "dist/mjs/index.js",
21
- "scripts": {
22
- "buildprep": "npm run build-mjs && npm run build-cjs && npm run build-fix",
23
- "build-mjs": "tsc",
24
- "build-cjs": "tsc -p tsconfig-cjs.json",
25
- "build-fix": "node ./node_modules/@grandlinex/core/fix.js",
26
- "lint": "eslint src",
27
- "test": "jest --runInBand ",
28
- "run": "node --no-warnings=ExperimentalWarning --loader ts-node/esm src/tests/run.ts",
29
- "pack-dev": "npm version -no-git-tag-version prerelease && npm run buildprep && npm pack",
30
- "test-converage": "jest --runInBand --ci --collectCoverage --coverageDirectory=\"./coverage\" --reporters=default --reporters=jest-junit",
31
- "doc-converage": "jest --runInBand --ci --collectCoverage --coverageDirectory=\"./docs/coverage\" --reporters=default --reporters=jest-junit",
32
- "makeDocs": "typedoc",
33
- "openDocs": "npm run makeDocs",
34
- "makeSpec": "swagger-mate"
35
- },
36
- "keywords": [
37
- "typescript",
38
- "framework",
39
- "express",
40
- "orm",
41
- "server",
42
- "backend"
43
- ],
44
- "author": {
45
- "name": "Elschnagoo"
46
- },
47
- "license": "BSD-3-Clause",
48
- "dependencies": {
49
- "reflect-metadata": "0.2.2",
50
- "@grandlinex/core": "1.1.0-alpha.0",
51
- "@grandlinex/swagger-mate": "1.0.2",
52
- "axios": "1.11.0",
53
- "body-parser": "1.20.3",
54
- "express": "5.1.0",
55
- "jsonwebtoken": "9.0.2",
56
- "@types/express": "5.0.3",
57
- "@types/jsonwebtoken": "9.0.10",
58
- "@types/ms": "2.1.0"
59
- },
60
- "devDependencies": {
61
- "@types/jest": "29.5.14",
62
- "@types/node": "22.15.20",
63
- "@typescript-eslint/eslint-plugin": "7.18.0",
64
- "@typescript-eslint/parser": "7.18.0",
65
- "eslint": "8.57.1",
66
- "eslint-config-airbnb": "19.0.4",
67
- "eslint-config-airbnb-typescript": "18.0.0",
68
- "eslint-config-prettier": "9.1.0",
69
- "eslint-plugin-import": "2.29.1",
70
- "eslint-plugin-jest": "28.6.0",
71
- "eslint-plugin-jsx-a11y": "6.9.0",
72
- "eslint-plugin-prettier": "5.2.1",
73
- "jest": "29.7.0",
74
- "jest-junit": "16.0.0",
75
- "prettier": "3.5.3",
76
- "ts-jest": "29.3.4",
77
- "ts-loader": "9.5.2",
78
- "ts-node": "10.9.2",
79
- "typedoc": "0.28.10",
80
- "typescript": "5.9.2"
81
- },
82
- "engines": {
83
- "node": ">=22.0.0"
84
- },
85
- "repository": {
86
- "type": "git",
87
- "url": "https://github.com/GrandlineX/kernel.git"
88
- }
89
- }
1
+ {
2
+ "name": "@grandlinex/kernel",
3
+ "version": "1.1.1",
4
+ "description": "GrandLineX is an out-of-the-box server framework on top of ExpressJs.",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "import": {
9
+ "types": "./dist/mjs/index.d.ts",
10
+ "default": "./dist/mjs/index.js"
11
+ },
12
+ "require": {
13
+ "types": "./dist/cjs/index.d.ts",
14
+ "default": "./dist/cjs/index.js"
15
+ }
16
+ }
17
+ },
18
+ "types": "dist/cjs/index.d.ts",
19
+ "main": "dist/cjs/index.js",
20
+ "module": "dist/mjs/index.js",
21
+ "scripts": {
22
+ "buildprep": "npm run build-mjs && npm run build-cjs && npm run build-fix",
23
+ "build-mjs": "tsc",
24
+ "build-cjs": "tsc -p tsconfig-cjs.json",
25
+ "build-fix": "node ./node_modules/@grandlinex/core/fix.js",
26
+ "lint": "eslint src",
27
+ "test": "jest --runInBand ",
28
+ "run": "node --no-warnings=ExperimentalWarning --loader ts-node/esm src/tests/run.ts",
29
+ "pack-dev": "npm version -no-git-tag-version prerelease && npm run buildprep && npm pack",
30
+ "test-converage": "jest --runInBand --ci --collectCoverage --coverageDirectory=\"./coverage\" --reporters=default --reporters=jest-junit",
31
+ "doc-converage": "jest --runInBand --ci --collectCoverage --coverageDirectory=\"./docs/coverage\" --reporters=default --reporters=jest-junit",
32
+ "makeDocs": "typedoc",
33
+ "openDocs": "npm run makeDocs",
34
+ "makeSpec": "swagger-mate"
35
+ },
36
+ "keywords": [
37
+ "typescript",
38
+ "framework",
39
+ "express",
40
+ "orm",
41
+ "server",
42
+ "backend"
43
+ ],
44
+ "author": {
45
+ "name": "Elschnagoo"
46
+ },
47
+ "license": "BSD-3-Clause",
48
+ "dependencies": {
49
+ "reflect-metadata": "0.2.2",
50
+ "@grandlinex/core": "1.1.1",
51
+ "@grandlinex/swagger-mate": "1.1.1",
52
+ "axios": "1.11.0",
53
+ "body-parser": "1.20.3",
54
+ "express": "5.1.0",
55
+ "jsonwebtoken": "9.0.2",
56
+ "@types/express": "5.0.3",
57
+ "@types/jsonwebtoken": "9.0.10",
58
+ "@types/ms": "2.1.0"
59
+ },
60
+ "devDependencies": {
61
+ "@types/jest": "29.5.14",
62
+ "@types/node": "22.15.20",
63
+ "@typescript-eslint/eslint-plugin": "7.18.0",
64
+ "@typescript-eslint/parser": "7.18.0",
65
+ "eslint": "8.57.1",
66
+ "eslint-config-airbnb": "19.0.4",
67
+ "eslint-config-airbnb-typescript": "18.0.0",
68
+ "eslint-config-prettier": "9.1.0",
69
+ "eslint-plugin-import": "2.29.1",
70
+ "eslint-plugin-jest": "28.6.0",
71
+ "eslint-plugin-jsx-a11y": "6.9.0",
72
+ "eslint-plugin-prettier": "5.2.1",
73
+ "jest": "29.7.0",
74
+ "jest-junit": "16.0.0",
75
+ "prettier": "3.5.3",
76
+ "ts-jest": "29.3.4",
77
+ "ts-loader": "9.5.2",
78
+ "ts-node": "10.9.2",
79
+ "typedoc": "0.28.10",
80
+ "typescript": "5.9.2"
81
+ },
82
+ "engines": {
83
+ "node": ">=22.0.0"
84
+ },
85
+ "repository": {
86
+ "type": "git",
87
+ "url": "https://github.com/GrandlineX/kernel.git"
88
+ }
89
+ }