badmfck-api-server 4.0.65 → 4.0.66

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
  }
96
96
  exports.Initializer = Initializer;
97
97
  class APIService extends BaseService_1.BaseService {
98
- version = "4.0.65";
98
+ version = "4.0.66";
99
99
  options;
100
100
  monitor = null;
101
101
  started = new Date();
@@ -454,10 +454,10 @@ class MysqlAdapter {
454
454
  const cres = await conn.query(this.prepareCountQuery(query));
455
455
  if (cres && cres[0]) {
456
456
  const res = cres[0];
457
- if (Array.isArray(res) && res.length > 0 && "total" in res[0])
458
- total = res[0].total;
459
- else if ("total" in res)
460
- total = res.total;
457
+ if (Array.isArray(res) && res.length > 0 && "count" in res[0])
458
+ total = res[0].count;
459
+ else if ("count" in res)
460
+ total = res.count;
461
461
  }
462
462
  }
463
463
  this.lastSuccessQueryTime = +new Date();
@@ -132,7 +132,7 @@ class Monitor extends BaseEndpoint_1.BaseEndpoint {
132
132
  async checkAuthentication(req) {
133
133
  const users = await APIService_1.REQ_MONITOR_USERS.request();
134
134
  if (!users || users.length == 0)
135
- throw { ...DefaultErrors_1.default.UNAUTHORIZED, details: "No users found for documentation access" };
135
+ throw { ...DefaultErrors_1.default.UNAUTHORIZED, details: "No users found for monitor access, please set up users first." };
136
136
  let header = req.headers['authorization'];
137
137
  if (!header)
138
138
  throw { ...DefaultErrors_1.default.UNAUTHORIZED, details: "No authorization header found" };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "badmfck-api-server",
3
- "version": "4.0.65",
3
+ "version": "4.0.66",
4
4
  "description": "Simple API http server based on express",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",