axe-api 1.7.0 → 1.7.2
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.
|
@@ -74,7 +74,7 @@ exports.default = (request, response, next) => __awaiter(void 0, void 0, void 0,
|
|
|
74
74
|
// Rollback transaction
|
|
75
75
|
if (match.hasTransaction && trx) {
|
|
76
76
|
Services_1.LogService.info("\t🛢 DBTransaction:rollback()");
|
|
77
|
-
trx.rollback();
|
|
77
|
+
yield trx.rollback();
|
|
78
78
|
}
|
|
79
79
|
if (error.type === "ApiError") {
|
|
80
80
|
const apiError = error;
|
|
@@ -94,7 +94,7 @@ exports.default = (request, response, next) => __awaiter(void 0, void 0, void 0,
|
|
|
94
94
|
if (context.res.statusCode() >= 400 && context.res.statusCode() < 599) {
|
|
95
95
|
if (match.hasTransaction && trx) {
|
|
96
96
|
Services_1.LogService.info("\t🛢 DBTransaction:rollback()");
|
|
97
|
-
trx.rollback();
|
|
97
|
+
yield trx.rollback();
|
|
98
98
|
}
|
|
99
99
|
Services_1.LogService.debug(`\tResponse ${context.res.statusCode()}`);
|
|
100
100
|
break;
|
|
@@ -102,7 +102,7 @@ exports.default = (request, response, next) => __awaiter(void 0, void 0, void 0,
|
|
|
102
102
|
// We should commit the transaction if there is any
|
|
103
103
|
if (match.hasTransaction && trx) {
|
|
104
104
|
Services_1.LogService.info("\t🛢 DBTransaction:commit()");
|
|
105
|
-
trx.commit();
|
|
105
|
+
yield trx.commit();
|
|
106
106
|
}
|
|
107
107
|
Services_1.LogService.debug(`\t🟢 Response ${context.res.statusCode()}`);
|
|
108
108
|
// We should brake the for-loop
|
|
@@ -24,6 +24,9 @@ class RedisAdaptor {
|
|
|
24
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
25
25
|
try {
|
|
26
26
|
yield this.client.connect();
|
|
27
|
+
this.client.on("error", (err) => {
|
|
28
|
+
Services_1.LogService.error(`Redis Client Error: ${err.message}`);
|
|
29
|
+
});
|
|
27
30
|
Services_1.LogService.info("Redis connection done!");
|
|
28
31
|
this.isConnected = true;
|
|
29
32
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "axe-api",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.2",
|
|
4
4
|
"description": "AXE API is a simple tool to create Rest APIs quickly.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -46,31 +46,18 @@
|
|
|
46
46
|
"scripts": {
|
|
47
47
|
"build": "rm -rf build && tsc && rm -rf build/dev-kit",
|
|
48
48
|
"build:watch": "tsc -w",
|
|
49
|
-
"
|
|
50
|
-
"dev-kit:install": "node ./scripts/dev-kit-install.js",
|
|
51
|
-
"dev-kit:remove": "node ./scripts/dev-kit-remove.js",
|
|
52
|
-
"test": "jest --runInBand",
|
|
49
|
+
"test": "vitest run",
|
|
53
50
|
"test:all": "npm run lint && npm run prettier:check && npm run test && npm run test:sqlite",
|
|
54
|
-
"test:dev": "
|
|
51
|
+
"test:dev": "vitest",
|
|
55
52
|
"lint": "eslint --max-warnings=0 .",
|
|
56
53
|
"lint:watch": "esw --watch --color",
|
|
57
|
-
"test:postgres11": "sh ./scripts/test-postgres11.sh",
|
|
58
|
-
"test:postgres12": "sh ./scripts/test-postgres12.sh",
|
|
59
|
-
"test:postgres13": "sh ./scripts/test-postgres13.sh",
|
|
60
|
-
"test:postgres14": "sh ./scripts/test-postgres14.sh",
|
|
61
|
-
"test:postgres15": "sh ./scripts/test-postgres15.sh",
|
|
62
|
-
"test:cockroach": "sh ./scripts/test-cockroach.sh",
|
|
63
|
-
"test:mysql57": "sh ./scripts/test-mysql57.sh",
|
|
64
|
-
"test:mysql8": "sh ./scripts/test-mysql8.sh",
|
|
65
|
-
"test:mariadb": "sh ./scripts/test-mariadb.sh",
|
|
66
|
-
"test:sqlite": "sh ./scripts/test-sqlite.sh",
|
|
67
54
|
"prettier:check": "prettier --check .",
|
|
68
55
|
"prettier:write": "prettier --write .",
|
|
69
56
|
"prepare": "husky",
|
|
70
57
|
"benchmark": "k6 run benchmark/run.js"
|
|
71
58
|
},
|
|
72
59
|
"engines": {
|
|
73
|
-
"node": ">=
|
|
60
|
+
"node": ">=20.0.0"
|
|
74
61
|
},
|
|
75
62
|
"dependencies": {
|
|
76
63
|
"body-parser": "^2.2.0",
|
|
@@ -105,7 +92,6 @@
|
|
|
105
92
|
"@types/validatorjs": "^3.15.5",
|
|
106
93
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
107
94
|
"@typescript-eslint/parser": "^7.18.0",
|
|
108
|
-
"babel-jest": "^30.0.0",
|
|
109
95
|
"cors": "^2.8.5",
|
|
110
96
|
"eslint": "^8.57.1",
|
|
111
97
|
"eslint-config-standard": "^17.1.0",
|
|
@@ -116,9 +102,8 @@
|
|
|
116
102
|
"eslint-watch": "^8.0.0",
|
|
117
103
|
"glob": "^11.0.3",
|
|
118
104
|
"husky": "^9.1.7",
|
|
119
|
-
"jest": "^30.0.0",
|
|
120
105
|
"lint-staged": "^16.1.0",
|
|
121
|
-
"multer": "^
|
|
106
|
+
"multer": "^2.0.1",
|
|
122
107
|
"mysql": "^2.18.1",
|
|
123
108
|
"mysql2": "^3.14.1",
|
|
124
109
|
"node-cache": "^5.1.2",
|
|
@@ -131,7 +116,8 @@
|
|
|
131
116
|
"sqlite3": "^5.1.7",
|
|
132
117
|
"ts-node": "^10.9.2",
|
|
133
118
|
"tsx": "^4.20.3",
|
|
134
|
-
"typescript": "^5.8.3"
|
|
119
|
+
"typescript": "^5.8.3",
|
|
120
|
+
"vitest": "^3.2.3"
|
|
135
121
|
},
|
|
136
122
|
"lint-staged": {
|
|
137
123
|
"**/*": "prettier --write --ignore-unknown"
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021 Özgür Adem Işıklı <i.ozguradem@gmail.com>
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/readme.md
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<h1 align="center">
|
|
2
|
-
<br>
|
|
3
|
-
<a href="https://axe-api.com/">
|
|
4
|
-
<img src="https://axe-api.com/viking.png" alt="Markdownify" width="200">
|
|
5
|
-
</a>
|
|
6
|
-
<br>
|
|
7
|
-
Axe API
|
|
8
|
-
<br>
|
|
9
|
-
<a href="https://badge.fury.io/js/axe-api">
|
|
10
|
-
<img src="https://badge.fury.io/js/axe-api.svg" alt="npm version" height="18">
|
|
11
|
-
</a>
|
|
12
|
-
<a href="https://github.com/axe-api/axe-api/actions/workflows/npm-release-publish.yml" target="_blank">
|
|
13
|
-
<img src="https://github.com/axe-api/axe-api/actions/workflows/npm-release-publish.yml/badge.svg?branch=master">
|
|
14
|
-
</a>
|
|
15
|
-
<a href="https://sonarcloud.io/dashboard?id=axe-api_axe-api" target="_blank">
|
|
16
|
-
<img src="https://sonarcloud.io/api/project_badges/measure?project=axe-api_axe-api&metric=alert_status">
|
|
17
|
-
</a>
|
|
18
|
-
<a href="https://github.com/axe-api/axe-api/issues" target="_blank">
|
|
19
|
-
<img src="https://img.shields.io/github/issues/axe-api/axe-api.svg">
|
|
20
|
-
</a>
|
|
21
|
-
<a href="https://opensource.org/licenses/MIT" target="_blank">
|
|
22
|
-
<img src="https://img.shields.io/badge/license-MIT-blue.svg">
|
|
23
|
-
</a>
|
|
24
|
-
</h1>
|
|
25
|
-
|
|
26
|
-
**Axe API** is a **TypeScript-based** **Node.js** framework designed to eliminate the need for repetitive tasks associated with common elements while allowing developers to focus on custom logic.
|
|
27
|
-
|
|
28
|
-
It offers a comprehensive structure for your API, including numerous features and best practices that will save you time.
|
|
29
|
-
|
|
30
|
-
## 🎥 Video Introduction
|
|
31
|
-
|
|
32
|
-
<div style="display: flex; justify-content: center;">
|
|
33
|
-
|
|
34
|
-
<a href="https://www.youtube.com/watch?v=3p4jggsNrJA" target="_blank">
|
|
35
|
-
<img src="https://raw.githubusercontent.com/axe-api/axe-api/master/youtube.png" />
|
|
36
|
-
</a>
|
|
37
|
-
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
## 📚 Documentation
|
|
41
|
-
|
|
42
|
-
Axe API has great documentation. Please [check it out in here](https://axe-api.com/).
|
|
43
|
-
|
|
44
|
-
## 👥 Contributors
|
|
45
|
-
|
|
46
|
-
<a href="https://github.com/axe-api/axe-api/graphs/contributors">
|
|
47
|
-
<img src="https://contrib.rocks/image?repo=axe-api/axe-api" />
|
|
48
|
-
</a>
|
|
49
|
-
|
|
50
|
-
Made with [contrib.rocks](https://contrib.rocks).
|
|
51
|
-
|
|
52
|
-
## 📜 License
|
|
53
|
-
|
|
54
|
-
[MIT License](LICENSE)
|