Skip to content

Commit

Permalink
0.32.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Elschnagoo committed Jul 13, 2024
1 parent 5ce101d commit aac7b29
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 47 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog
All notable changes to this project will be documented in this file.

## [v0.32.11] - 2024-07-13
### Changed
- Update Deps
- Error Handling for BaseApiAction

## [v0.32.10] - 2023-10-06
### Changed
- Breaking Change: BaseApiAction now use XActionEvent
Expand Down
52 changes: 26 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@grandlinex/kernel",
"version": "0.32.10",
"version": "0.32.11",
"description": "GrandLineX is an out-of-the-box server framework on top of ExpressJs.",
"type": "module",
"exports": {
Expand Down Expand Up @@ -48,35 +48,35 @@
"dependencies": {
"@grandlinex/core": "0.32.0",
"@grandlinex/swagger-mate": "0.32.1",
"axios": "1.5.1",
"axios": "1.6.0",
"body-parser": "1.20.2",
"express": "4.18.2",
"express": "4.19.2",
"jsonwebtoken": "9.0.2",
"@types/express": "^4.17.18",
"@types/jsonwebtoken": "^9.0.3"
"@types/express": "4.17.21",
"@types/jsonwebtoken": "9.0.6"
},
"devDependencies": {
"@types/jest": "^29.5.5",
"@types/node": "^20.8.2",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"cross-env": "^7.0.3",
"eslint": "^8.50.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jest": "^27.4.2",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.7.0",
"jest-junit": "^16.0.0",
"prettier": "3.0.3",
"ts-jest": "^29.1.1",
"ts-loader": "^9.4.4",
"ts-node": "^10.9.1",
"typedoc": "^0.25.1",
"typescript": "^5.2.2"
"@types/jest": "29.5.12",
"@types/node": "20.14.10",
"@typescript-eslint/eslint-plugin": "7.16.0",
"@typescript-eslint/parser": "7.16.0",
"cross-env": "7.0.3",
"eslint": "8.57.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-airbnb-typescript": "18.0.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jest": "28.6.0",
"eslint-plugin-jsx-a11y": "6.9.0",
"eslint-plugin-prettier": "5.1.3",
"jest": "29.7.0",
"jest-junit": "16.0.0",
"prettier": "3.3.2",
"ts-jest": "29.1.5",
"ts-loader": "9.5.1",
"ts-node": "10.9.2",
"typedoc": "0.26.4",
"typescript": "5.5.3"
},
"repository": {
"type": "git",
Expand Down
66 changes: 45 additions & 21 deletions src/classes/BaseAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,33 +60,57 @@ export default abstract class BaseAction<

if (this.mode === ActionMode.DMZ) {
auth.stop();
await this.handler({
res,
req,
next,
data: null,
extension,
});
try {
await this.handler({
res,
req,
next,
data: null,
extension,
});
} catch (e: any) {
this.error(e);
this.error(e?.message);
if (!res.headersSent) {
res.sendStatus(500);
}
}
return;
}
const dat = await cc.bearerTokenValidation(req);
auth.stop();
if (dat && typeof dat !== 'number') {
await this.handler({
res,
req,
next,
data: dat,
extension,
});
try {
await this.handler({
res,
req,
next,
data: dat,
extension,
});
} catch (e: any) {
this.error(e);
this.error(e?.message);
if (!res.headersSent) {
res.sendStatus(500);
}
}
} else if (this.mode === ActionMode.DMZ_WITH_USER) {
await this.handler({
res,
req,
next,
data: null,
extension,
});
try {
await this.handler({
res,
req,
next,
data: null,
extension,
});
} catch (e: any) {
this.error(e);
this.error(e?.message);
if (!res.headersSent) {
res.sendStatus(500);
}
}
} else if (dat) {
res.sendStatus(dat);
} else {
Expand Down

0 comments on commit aac7b29

Please sign in to comment.