badmfck-api-server 1.6.9 → 1.7.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.
@@ -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;
|
@@ -128,7 +128,8 @@ class APIService extends BaseService_1.BaseService {
|
|
128
128
|
if (!i.endpoints)
|
129
129
|
continue;
|
130
130
|
for (let j of i.endpoints) {
|
131
|
-
|
131
|
+
let ep = BaseEndpoint_1.BaseEndpoint.getEntryPoint() + j.endpoint;
|
132
|
+
ep = ep.replaceAll("//", "/");
|
132
133
|
app.all(ep, async (req, res) => {
|
133
134
|
const tme = +new Date();
|
134
135
|
let log = null;
|
@@ -248,8 +249,10 @@ class APIService extends BaseService_1.BaseService {
|
|
248
249
|
}
|
249
250
|
sendResponse(res, data, requestTime, endpoint, log) {
|
250
251
|
data.responseTime = (+new Date()) - requestTime;
|
251
|
-
data.
|
252
|
+
data.core = this.version;
|
252
253
|
data.endpoint = endpoint ?? "no_endpoint";
|
254
|
+
if (this.options.appVersion)
|
255
|
+
data.version = this.options.appVersion;
|
253
256
|
if (this.monitor)
|
254
257
|
this.monitor.registrateResponse(data.endpoint, data.responseTime);
|
255
258
|
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;
|