badmfck-api-server 1.6.0 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -47,7 +47,7 @@ async function Initializer(services) {
47
47
  exports.Initializer = Initializer;
48
48
  class APIService extends BaseService_1.BaseService {
49
49
  static nextLogID = 0;
50
- version = "1.6.0";
50
+ version = "1.6.2";
51
51
  options;
52
52
  monitor;
53
53
  monitorIndexFile;
@@ -252,9 +252,9 @@ class APIService extends BaseService_1.BaseService {
252
252
  log.time = data.responseTime;
253
253
  if (res.destroyed || res.closed) {
254
254
  if (log)
255
- log.error = "Connection already closed, can't send response";
255
+ log.error = "Connection already closed, can't send response for: " + data.endpoint;
256
256
  if (this.options.onError)
257
- this.options.onError("Connection already closed, can't send response", data);
257
+ this.options.onError("Connection already closed, can't send response: " + data.endpoint, data);
258
258
  if (this.monitor)
259
259
  this.monitor.registrateError(data.endpoint);
260
260
  }
@@ -1,6 +1,7 @@
1
1
  import { FieldInfo, MysqlError, Pool, PoolConnection } from "mysql";
2
2
  import { BaseService } from "./BaseService";
3
- import { Req } from "badmfck-signal";
3
+ import Signal, { Req } from "badmfck-signal";
4
+ export declare const S_MYSQL_STARTED: Signal<void>;
4
5
  export declare const REQ_MYSQL_QUERY: Req<MySqlQuery | MySqlQuery[], MysqlResult[]>;
5
6
  export declare const executeQuery: (query: MySqlQuery | MySqlQuery[]) => Promise<MysqlResult[]>;
6
7
  export interface MysqlServiceOptions {
@@ -1,14 +1,38 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
5
28
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.MysqlService = exports.executeQuery = exports.REQ_MYSQL_QUERY = void 0;
29
+ exports.MysqlService = exports.executeQuery = exports.REQ_MYSQL_QUERY = exports.S_MYSQL_STARTED = void 0;
7
30
  const mysql_1 = __importDefault(require("mysql"));
8
31
  const BaseService_1 = require("./BaseService");
9
- const badmfck_signal_1 = require("badmfck-signal");
32
+ const badmfck_signal_1 = __importStar(require("badmfck-signal"));
10
33
  const crypto_1 = require("crypto");
11
34
  const LogService_1 = require("./LogService");
35
+ exports.S_MYSQL_STARTED = new badmfck_signal_1.default();
12
36
  exports.REQ_MYSQL_QUERY = new badmfck_signal_1.Req("REQ_MYSQL_QUERY");
13
37
  const executeQuery = async (query) => { return await exports.REQ_MYSQL_QUERY.request(query); };
14
38
  exports.executeQuery = executeQuery;
@@ -60,6 +84,7 @@ class MysqlService extends BaseService_1.BaseService {
60
84
  else {
61
85
  this.serviceStarted = true;
62
86
  (0, LogService_1.logInfo)("${MysqlService.js}", "Mysql Service started!");
87
+ exports.S_MYSQL_STARTED.invoke();
63
88
  }
64
89
  }
65
90
  async onApplicationReady() { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "badmfck-api-server",
3
- "version": "1.6.0",
3
+ "version": "1.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",