badmfck-api-server 1.6.8 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/apiServer/APIService.d.ts +1 -0
- package/dist/apiServer/APIService.js +4 -2
- package/dist/apiServer/MysqlService.js +1 -1
- package/dist/apiServer/deployment/Deployment.d.ts +10 -0
- package/dist/apiServer/deployment/Deployment.js +24 -0
- package/dist/apiServer/structures/Interfaces.d.ts +1 -0
- package/package.json +1 -1
@@ -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.
|
50
|
+
version = "1.6.9";
|
51
51
|
options;
|
52
52
|
monitor;
|
53
53
|
monitorIndexFile;
|
@@ -248,8 +248,10 @@ class APIService extends BaseService_1.BaseService {
|
|
248
248
|
}
|
249
249
|
sendResponse(res, data, requestTime, endpoint, log) {
|
250
250
|
data.responseTime = (+new Date()) - requestTime;
|
251
|
-
data.
|
251
|
+
data.core = this.version;
|
252
252
|
data.endpoint = endpoint ?? "no_endpoint";
|
253
|
+
if (this.options.appVersion)
|
254
|
+
data.version = this.options.appVersion;
|
253
255
|
if (this.monitor)
|
254
256
|
this.monitor.registrateResponse(data.endpoint, data.responseTime);
|
255
257
|
if (log)
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { BaseEndpoint } from "../BaseEndpoint";
|
2
|
+
import { HTTPRequestVO, TransferPacketVO } from "../structures/Interfaces";
|
3
|
+
export declare class Deployment extends BaseEndpoint {
|
4
|
+
hash: string;
|
5
|
+
constructor({ login, password }: {
|
6
|
+
login: string;
|
7
|
+
password: string;
|
8
|
+
});
|
9
|
+
deploymentHistory(req: HTTPRequestVO): Promise<TransferPacketVO<any>>;
|
10
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.Deployment = void 0;
|
7
|
+
const BaseEndpoint_1 = require("../BaseEndpoint");
|
8
|
+
const crypto_1 = __importDefault(require("crypto"));
|
9
|
+
const LogService_1 = require("../LogService");
|
10
|
+
class Deployment extends BaseEndpoint_1.BaseEndpoint {
|
11
|
+
hash;
|
12
|
+
constructor({ login, password }) {
|
13
|
+
super("sys-deployment");
|
14
|
+
this.hash = crypto_1.default.createHash("sha256").update(login + password).digest().toString("hex");
|
15
|
+
(0, LogService_1.logWarn)("Deployment initialized at: sys-deployment/" + this.hash);
|
16
|
+
this.registerEndpoints([
|
17
|
+
{ ignoreInterceptor: true, endpoint: this.hash, handler: this.deploymentHistory },
|
18
|
+
]);
|
19
|
+
}
|
20
|
+
async deploymentHistory(req) {
|
21
|
+
return {};
|
22
|
+
}
|
23
|
+
}
|
24
|
+
exports.Deployment = Deployment;
|