badmfck-api-server 2.1.0 → 2.1.1
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.
@@ -2,7 +2,7 @@
|
|
2
2
|
import { Application, Response } from 'express';
|
3
3
|
import { BaseService, IBaseService } from './BaseService';
|
4
4
|
import { IBaseEndpoint } from './BaseEndpoint';
|
5
|
-
import { HTTPRequestVO, TransferPacketVO } from './structures/Interfaces';
|
5
|
+
import { HTTPRequestVO, IError, TransferPacketVO } from './structures/Interfaces';
|
6
6
|
import { Req } from "badmfck-signal";
|
7
7
|
import http from 'http';
|
8
8
|
export interface APIServiceNetworkLogItem {
|
@@ -45,7 +45,7 @@ export declare const REQ_HTTP_SERVER: Req<void, {
|
|
45
45
|
express: Application;
|
46
46
|
http: http.Server;
|
47
47
|
}>;
|
48
|
-
export declare const REQ_INTERNAL_CALL: Req<HTTPRequestVO,
|
48
|
+
export declare const REQ_INTERNAL_CALL: Req<HTTPRequestVO, IError | any>;
|
49
49
|
export declare function Initializer(services: IBaseService[]): Promise<void>;
|
50
50
|
export declare class APIService extends BaseService {
|
51
51
|
private static nextLogID;
|
@@ -83,7 +83,7 @@ async function Initializer(services) {
|
|
83
83
|
exports.Initializer = Initializer;
|
84
84
|
class APIService extends BaseService_1.BaseService {
|
85
85
|
static nextLogID = 0;
|
86
|
-
version = "2.1.
|
86
|
+
version = "2.1.1";
|
87
87
|
options;
|
88
88
|
monitor;
|
89
89
|
monitorIndexFile;
|
@@ -136,7 +136,10 @@ class APIService extends BaseService_1.BaseService {
|
|
136
136
|
let ep = BaseEndpoint_1.BaseEndpoint.getEntryPoint() + j.endpoint;
|
137
137
|
ep = ep.replaceAll("//", "/");
|
138
138
|
if (ep === req.endpoint) {
|
139
|
-
|
139
|
+
const response = await i.execute(req);
|
140
|
+
if (response.error)
|
141
|
+
return response.error;
|
142
|
+
return response.data;
|
140
143
|
}
|
141
144
|
}
|
142
145
|
}
|