badmfck-api-server 2.8.6 → 2.8.7

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.
@@ -80,6 +80,7 @@ async function Initializer(services) {
80
80
  for (let i of services) {
81
81
  await i.init();
82
82
  activeServices.push(i.getName());
83
+ MonitorService_1.S_STAT_REGISTRATE_SERVICE.invoke(i.getName());
83
84
  }
84
85
  for (let i of services) {
85
86
  i.applicationReady();
@@ -88,7 +89,7 @@ async function Initializer(services) {
88
89
  exports.Initializer = Initializer;
89
90
  class APIService extends BaseService_1.BaseService {
90
91
  static nextLogID = 0;
91
- version = "2.8.6";
92
+ version = "2.8.7";
92
93
  options;
93
94
  monitor = null;
94
95
  monitorIndexFile;
@@ -14,6 +14,7 @@ export interface IEPStatReqFilter {
14
14
  export interface IEPStatResult {
15
15
  }
16
16
  export declare const S_STAT_REGISTRATE_REQUEST: Signal<TransferPacketVO<any>>;
17
+ export declare const S_STAT_REGISTRATE_SERVICE: Signal<string>;
17
18
  export declare const REQ_EP_STAT: Req<IEPStatReqFilter, IEPStatResult>;
18
19
  export declare class MonitorService extends BaseService {
19
20
  endpoints: Map<number, Map<string, IEPStat>>;
@@ -23,10 +23,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.MonitorService = exports.REQ_EP_STAT = exports.S_STAT_REGISTRATE_REQUEST = void 0;
26
+ exports.MonitorService = exports.REQ_EP_STAT = exports.S_STAT_REGISTRATE_SERVICE = exports.S_STAT_REGISTRATE_REQUEST = void 0;
27
27
  const badmfck_signal_1 = __importStar(require("badmfck-signal"));
28
28
  const BaseService_1 = require("./BaseService");
29
29
  exports.S_STAT_REGISTRATE_REQUEST = new badmfck_signal_1.default();
30
+ exports.S_STAT_REGISTRATE_SERVICE = new badmfck_signal_1.default();
30
31
  exports.REQ_EP_STAT = new badmfck_signal_1.Req(undefined, "REQ_EP_STAT");
31
32
  class MonitorService extends BaseService_1.BaseService {
32
33
  endpoints = new Map();
@@ -81,7 +82,7 @@ class MonitorService extends BaseService_1.BaseService {
81
82
  }
82
83
  endResult.push(stat);
83
84
  }
84
- return { filter: req, result: endResult };
85
+ return { filter: req, result: endResult, overallcount: this.endpoints.size };
85
86
  }
86
87
  onStatRegistrate(data) {
87
88
  const minute = this.getMinutes(new Date());
@@ -15,6 +15,7 @@ export declare class Monitor extends BaseEndpoint {
15
15
  ignoreHttpLogging: boolean;
16
16
  users: Map<string, IStatObject>;
17
17
  constructor();
18
+ controllers(req: HTTPRequestVO): Promise<TransferPacketVO>;
18
19
  logs(req: HTTPRequestVO): Promise<TransferPacketVO>;
19
20
  netlog(req: HTTPRequestVO): Promise<TransferPacketVO>;
20
21
  metrics(req: HTTPRequestVO): Promise<TransferPacketVO>;
@@ -22,9 +22,14 @@ class Monitor extends BaseEndpoint_1.BaseEndpoint {
22
22
  { ignoreInterceptor: true, endpoint: "log", handler: this.logs },
23
23
  { ignoreInterceptor: true, endpoint: "netlog", handler: this.netlog },
24
24
  { ignoreInterceptor: true, endpoint: "metrics", handler: this.metrics },
25
- { ignoreInterceptor: true, endpoint: "server", handler: this.serverStat }
25
+ { ignoreInterceptor: true, endpoint: "server", handler: this.serverStat },
26
+ { ignoreInterceptor: true, endpoint: "controllers", handler: this.controllers }
26
27
  ]);
27
28
  }
29
+ async controllers(req) {
30
+ this.checkAuthentication(req);
31
+ return {};
32
+ }
28
33
  async logs(req) {
29
34
  this.checkAuthentication(req);
30
35
  const services = await LogService_1.REQ_LOG_UNIQUE_SERVICES.request();
@@ -40,7 +45,8 @@ class Monitor extends BaseEndpoint_1.BaseEndpoint {
40
45
  }
41
46
  async netlog(req) {
42
47
  this.checkAuthentication(req);
43
- return {};
48
+ const log = await APIService_1.REQ_HTTP_LOG.request(req.data);
49
+ return { data: log };
44
50
  }
45
51
  async metrics(req) {
46
52
  this.checkAuthentication(req);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "badmfck-api-server",
3
- "version": "2.8.6",
3
+ "version": "2.8.7",
4
4
  "description": "Simple API http server based on express",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",