badmfck-api-server 3.6.0 → 3.6.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.
@@ -95,7 +95,7 @@ async function Initializer(services) {
95
95
  exports.Initializer = Initializer;
96
96
  class APIService extends BaseService_1.BaseService {
97
97
  static nextLogID = 0;
98
- version = "3.6.0";
98
+ version = "3.6.1";
99
99
  options;
100
100
  monitor = null;
101
101
  started = new Date();
@@ -262,7 +262,7 @@ class APIService extends BaseService_1.BaseService {
262
262
  this.sendResponse(req.get("Referer") ?? "", res, { error: { ...DefaultErrors_1.default.DB_ERROR, details: e.message } }, tme, ep, log, httpRequest);
263
263
  return;
264
264
  }
265
- this.sendResponse(req.get("Referer") ?? "", res, { error: { code: 10002, message: "Internal server error", stack: stack, details: details }, data: null, httpStatus: 500 }, tme, ep, log, httpRequest);
265
+ this.sendResponse(req.get("Referer") ?? "", res, { error: { code: 10002, message: "Internal server error!", stack: stack, details: details }, data: null, httpStatus: 500 }, tme, ep, log, httpRequest);
266
266
  return;
267
267
  }
268
268
  }
@@ -371,8 +371,6 @@ class APIService extends BaseService_1.BaseService {
371
371
  if (res.destroyed || res.closed) {
372
372
  if (log)
373
373
  log.error = "Connection already closed, can't send response for: " + data.endpoint;
374
- if (this.options.onError)
375
- this.options.onError("Connection already closed, can't send response: " + data.endpoint, data);
376
374
  }
377
375
  else {
378
376
  try {
@@ -17,7 +17,7 @@ class DefaultErrors {
17
17
  static DB_ERROR = { code: 11, message: "DB error", httpStatus: 500 };
18
18
  static FORBIDDEN = { code: 12, message: "Forbidden", httpStatus: 403 };
19
19
  static NOT_FOUND = { code: 13, message: "Not found", httpStatus: 404 };
20
- static INTERNAL_SERVER_ERROR = { code: 14, message: "Internal server error", httpStatus: 500 };
20
+ static INTERNAL_SERVER_ERROR = { code: 14, message: "Internal server error.", httpStatus: 500 };
21
21
  static INVALID_TOKEN = { code: 15, message: "Invalid token", httpStatus: 401 };
22
22
  static INVALID_CREDENTIALS = { code: 16, message: "Invalid credentials", httpStatus: 401 };
23
23
  static INVALID_DATA = { code: 17, message: "Invalid data", httpStatus: 422 };
package/package.json CHANGED
@@ -1,16 +1,14 @@
1
1
  {
2
2
  "name": "badmfck-api-server",
3
- "version": "3.6.0",
3
+ "version": "3.6.2",
4
4
  "description": "Simple API http server based on express",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "type": "commonjs",
8
-
9
8
  "scripts": {
10
9
  "build": "tsc & cp ./src/apiServer/monitor/index.html ./dist/apiServer/monitor/index.html & cp ./src/apiServer/documentation/index.html ./dist/apiServer/documentation/index.html",
11
10
  "test": "echo \"Error: no test specified\" && exit 1"
12
11
  },
13
-
14
12
  "keywords": [
15
13
  "api",
16
14
  "rest",
@@ -22,14 +20,13 @@
22
20
  "@types/express-fileupload": "^1.5.0",
23
21
  "@types/mysql": "^2.15.21",
24
22
  "@types/ws": "^8.5.9",
25
- "axios": "^1.7.7",
26
- "badmfck-signal": "^1.4.8",
27
- "comment-parser": "^1.4.1",
23
+ "axios": "^1.10.0",
24
+ "badmfck-signal": "^1.4.9",
28
25
  "cors": "^2.8.5",
29
- "express": "^4.21.1",
30
- "express-fileupload": "^1.5.1",
31
- "mysql2": "^3.11.3",
32
- "ws": "^8.18.0"
26
+ "express": "^4.21.2",
27
+ "express-fileupload": "^1.5.2",
28
+ "mysql2": "^3.14.2",
29
+ "ws": "^8.18.3"
33
30
  },
34
31
  "devDependencies": {
35
32
  "@types/cors": "^2.8.13",
@@ -37,4 +34,4 @@
37
34
  },
38
35
  "author": "Igor Bloom",
39
36
  "license": "MIT"
40
- }
37
+ }