@meru2802/aux-server 1.0.0
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.
- package/README.md +168 -0
- package/dist/config/index.d.ts +37 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +76 -0
- package/dist/config/swagger.d.ts +2 -0
- package/dist/config/swagger.d.ts.map +1 -0
- package/dist/config/swagger.js +267 -0
- package/dist/controllers/BaseController.d.ts +16 -0
- package/dist/controllers/BaseController.d.ts.map +1 -0
- package/dist/controllers/BaseController.js +28 -0
- package/dist/controllers/apiController.d.ts +8 -0
- package/dist/controllers/apiController.d.ts.map +1 -0
- package/dist/controllers/apiController.js +60 -0
- package/dist/controllers/coreController.d.ts +11 -0
- package/dist/controllers/coreController.d.ts.map +1 -0
- package/dist/controllers/coreController.js +470 -0
- package/dist/controllers/healthController.d.ts +9 -0
- package/dist/controllers/healthController.d.ts.map +1 -0
- package/dist/controllers/healthController.js +35 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +97 -0
- package/dist/lib/utils/index.d.ts +10 -0
- package/dist/lib/utils/index.d.ts.map +1 -0
- package/dist/lib/utils/index.js +78 -0
- package/dist/lib/utils/index.test.d.ts +3 -0
- package/dist/lib/utils/index.test.d.ts.map +1 -0
- package/dist/lib/utils/index.test.js +197 -0
- package/dist/middleware/BaseMiddleware.d.ts +13 -0
- package/dist/middleware/BaseMiddleware.d.ts.map +1 -0
- package/dist/middleware/BaseMiddleware.js +22 -0
- package/dist/middleware/authMiddleware.d.ts +9 -0
- package/dist/middleware/authMiddleware.d.ts.map +1 -0
- package/dist/middleware/authMiddleware.js +287 -0
- package/dist/middleware/index.d.ts +11 -0
- package/dist/middleware/index.d.ts.map +1 -0
- package/dist/middleware/index.js +125 -0
- package/dist/routes/apiRoutes.d.ts +5 -0
- package/dist/routes/apiRoutes.d.ts.map +1 -0
- package/dist/routes/apiRoutes.js +46 -0
- package/dist/routes/coreRoutes.d.ts +5 -0
- package/dist/routes/coreRoutes.d.ts.map +1 -0
- package/dist/routes/coreRoutes.js +158 -0
- package/dist/routes/healthRoutes.d.ts +4 -0
- package/dist/routes/healthRoutes.d.ts.map +1 -0
- package/dist/routes/healthRoutes.js +63 -0
- package/dist/routes/index.d.ts +3 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/dist/routes/index.js +31 -0
- package/dist/routes/swaggerRoutes.d.ts +3 -0
- package/dist/routes/swaggerRoutes.d.ts.map +1 -0
- package/dist/routes/swaggerRoutes.js +35 -0
- package/dist/services/ApplicationService.d.ts +26 -0
- package/dist/services/ApplicationService.d.ts.map +1 -0
- package/dist/services/ApplicationService.js +46 -0
- package/dist/services/DatabaseService.d.ts +17 -0
- package/dist/services/DatabaseService.d.ts.map +1 -0
- package/dist/services/DatabaseService.js +38 -0
- package/dist/services/HttpServerService.d.ts +29 -0
- package/dist/services/HttpServerService.d.ts.map +1 -0
- package/dist/services/HttpServerService.js +101 -0
- package/dist/services/ServiceContainer.d.ts +26 -0
- package/dist/services/ServiceContainer.d.ts.map +1 -0
- package/dist/services/ServiceContainer.js +39 -0
- package/dist/services/WebSocketService.d.ts +27 -0
- package/dist/services/WebSocketService.d.ts.map +1 -0
- package/dist/services/WebSocketService.js +180 -0
- package/dist/types/index.d.ts +218 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +19 -0
- package/dist/types/schemas/index.d.ts +31 -0
- package/dist/types/schemas/index.d.ts.map +1 -0
- package/dist/types/schemas/index.js +226 -0
- package/package.json +55 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Application } from "express";
|
|
2
|
+
import { Server } from "http";
|
|
3
|
+
import { Config } from "../types";
|
|
4
|
+
export interface IHttpServerService {
|
|
5
|
+
getApp(): Application;
|
|
6
|
+
getServer(): Server | null;
|
|
7
|
+
isRunning(): boolean;
|
|
8
|
+
start(port?: number): Promise<void>;
|
|
9
|
+
stop(): Promise<void>;
|
|
10
|
+
getPort(): number | null;
|
|
11
|
+
}
|
|
12
|
+
export declare class HttpServerService implements IHttpServerService {
|
|
13
|
+
private app;
|
|
14
|
+
private server;
|
|
15
|
+
private port;
|
|
16
|
+
private running;
|
|
17
|
+
private initialized;
|
|
18
|
+
private config;
|
|
19
|
+
constructor(config: Config);
|
|
20
|
+
private setupMiddleware;
|
|
21
|
+
private setupRoutes;
|
|
22
|
+
start(port?: number): Promise<void>;
|
|
23
|
+
stop(): Promise<void>;
|
|
24
|
+
getApp(): Application;
|
|
25
|
+
getServer(): Server | null;
|
|
26
|
+
isRunning(): boolean;
|
|
27
|
+
getPort(): number | null;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=HttpServerService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpServerService.d.ts","sourceRoot":"","sources":["../../src/services/HttpServerService.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAG9B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,MAAM,WAAW,kBAAkB;IACjC,MAAM,IAAI,WAAW,CAAC;IACtB,SAAS,IAAI,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,IAAI,OAAO,CAAC;IACrB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,OAAO,IAAI,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,qBAAa,iBAAkB,YAAW,kBAAkB;IAC1D,OAAO,CAAC,GAAG,CAAc;IACzB,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,IAAI,CAAuB;IACnC,OAAO,CAAC,OAAO,CAAkB;IACjC,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,MAAM,CAAS;gBAEX,MAAM,EAAE,MAAM;IAM1B,OAAO,CAAC,eAAe;IAuBvB,OAAO,CAAC,WAAW;IAON,KAAK,CAAC,IAAI,GAAE,MAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IA4BzC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAqB3B,MAAM,IAAI,WAAW;IAIrB,SAAS,IAAI,MAAM,GAAG,IAAI;IAI1B,SAAS,IAAI,OAAO;IAIpB,OAAO,IAAI,MAAM,GAAG,IAAI;CAGhC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
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.HttpServerService = void 0;
|
|
7
|
+
const express_1 = __importDefault(require("express"));
|
|
8
|
+
const middleware_1 = require("../middleware");
|
|
9
|
+
const routes_1 = require("../routes");
|
|
10
|
+
class HttpServerService {
|
|
11
|
+
constructor(config) {
|
|
12
|
+
this.server = null;
|
|
13
|
+
this.port = null;
|
|
14
|
+
this.running = false;
|
|
15
|
+
this.initialized = false;
|
|
16
|
+
this.app = (0, express_1.default)();
|
|
17
|
+
this.config = config;
|
|
18
|
+
this.setupMiddleware();
|
|
19
|
+
}
|
|
20
|
+
setupMiddleware() {
|
|
21
|
+
const { allowedOrigins, ...restCorsOptions } = this.config.serverConfig.corsOptions;
|
|
22
|
+
const corsOptions = {
|
|
23
|
+
...restCorsOptions,
|
|
24
|
+
origin: (origin, callback) => {
|
|
25
|
+
if (!origin) {
|
|
26
|
+
return callback(null, true);
|
|
27
|
+
}
|
|
28
|
+
if (allowedOrigins.includes(origin)) {
|
|
29
|
+
callback(null, true);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
console.warn(`CORS blocked origin: ${origin}`);
|
|
33
|
+
callback(new Error(`Origin ${origin} not allowed by CORS policy`));
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
(0, middleware_1.setupMiddleware)(this.app, corsOptions);
|
|
38
|
+
}
|
|
39
|
+
setupRoutes() {
|
|
40
|
+
if (!this.initialized) {
|
|
41
|
+
(0, routes_1.setupRoutes)(this.app);
|
|
42
|
+
this.initialized = true;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async start(port = 3003) {
|
|
46
|
+
return new Promise((resolve, reject) => {
|
|
47
|
+
if (this.running) {
|
|
48
|
+
return resolve();
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
this.setupRoutes();
|
|
52
|
+
this.server = this.app.listen(port, () => {
|
|
53
|
+
this.port = port;
|
|
54
|
+
this.running = true;
|
|
55
|
+
console.log(`Server running on port ${port}`);
|
|
56
|
+
resolve();
|
|
57
|
+
});
|
|
58
|
+
this.server.on("error", (error) => {
|
|
59
|
+
console.error("HTTP Server error:", error);
|
|
60
|
+
this.running = false;
|
|
61
|
+
reject(error);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
console.error("Failed to start HTTP server:", error);
|
|
66
|
+
reject(error);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
async stop() {
|
|
71
|
+
return new Promise((resolve, reject) => {
|
|
72
|
+
if (!this.server || !this.running) {
|
|
73
|
+
return resolve();
|
|
74
|
+
}
|
|
75
|
+
this.server.close((error) => {
|
|
76
|
+
this.server = null;
|
|
77
|
+
this.running = false;
|
|
78
|
+
this.port = null;
|
|
79
|
+
error ? reject(error) : resolve();
|
|
80
|
+
});
|
|
81
|
+
setTimeout(() => {
|
|
82
|
+
if (this.server) {
|
|
83
|
+
this.server.closeAllConnections();
|
|
84
|
+
}
|
|
85
|
+
}, 5000);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
getApp() {
|
|
89
|
+
return this.app;
|
|
90
|
+
}
|
|
91
|
+
getServer() {
|
|
92
|
+
return this.server;
|
|
93
|
+
}
|
|
94
|
+
isRunning() {
|
|
95
|
+
return this.running;
|
|
96
|
+
}
|
|
97
|
+
getPort() {
|
|
98
|
+
return this.port;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
exports.HttpServerService = HttpServerService;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Config } from "../types";
|
|
2
|
+
import { IApplicationService } from "./ApplicationService";
|
|
3
|
+
import { IDatabaseService } from "./DatabaseService";
|
|
4
|
+
import { IWebSocketService } from "./WebSocketService";
|
|
5
|
+
import { IHttpServerService } from "./HttpServerService";
|
|
6
|
+
export interface IServiceContainer {
|
|
7
|
+
getApplicationService(): IApplicationService;
|
|
8
|
+
getDatabaseService(): IDatabaseService;
|
|
9
|
+
getWebSocketService(): IWebSocketService;
|
|
10
|
+
getHttpServerService(): IHttpServerService;
|
|
11
|
+
getConfig(): Config;
|
|
12
|
+
}
|
|
13
|
+
export declare class ServiceContainer implements IServiceContainer {
|
|
14
|
+
private static instance;
|
|
15
|
+
private applicationService;
|
|
16
|
+
private config;
|
|
17
|
+
private constructor();
|
|
18
|
+
static getInstance(): ServiceContainer;
|
|
19
|
+
static initialize(config: Config): ServiceContainer;
|
|
20
|
+
getApplicationService(): IApplicationService;
|
|
21
|
+
getDatabaseService(): IDatabaseService;
|
|
22
|
+
getWebSocketService(): IWebSocketService;
|
|
23
|
+
getHttpServerService(): IHttpServerService;
|
|
24
|
+
getConfig(): Config;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=ServiceContainer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServiceContainer.d.ts","sourceRoot":"","sources":["../../src/services/ServiceContainer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAsB,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,WAAW,iBAAiB;IAChC,qBAAqB,IAAI,mBAAmB,CAAC;IAC7C,kBAAkB,IAAI,gBAAgB,CAAC;IACvC,mBAAmB,IAAI,iBAAiB,CAAC;IACzC,oBAAoB,IAAI,kBAAkB,CAAC;IAC3C,SAAS,IAAI,MAAM,CAAC;CACrB;AAED,qBAAa,gBAAiB,YAAW,iBAAiB;IACxD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAmB;IAC1C,OAAO,CAAC,kBAAkB,CAAsB;IAChD,OAAO,CAAC,MAAM,CAAS;IAEvB,OAAO;WAKO,WAAW,IAAI,gBAAgB;WAS/B,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB;IAQnD,qBAAqB,IAAI,mBAAmB;IAI5C,kBAAkB,IAAI,gBAAgB;IAItC,mBAAmB,IAAI,iBAAiB;IAIxC,oBAAoB,IAAI,kBAAkB;IAI1C,SAAS,IAAI,MAAM;CAG3B"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ServiceContainer = void 0;
|
|
4
|
+
const ApplicationService_1 = require("./ApplicationService");
|
|
5
|
+
class ServiceContainer {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
this.config = config;
|
|
8
|
+
this.applicationService = new ApplicationService_1.ApplicationService(config);
|
|
9
|
+
}
|
|
10
|
+
static getInstance() {
|
|
11
|
+
if (!ServiceContainer.instance) {
|
|
12
|
+
throw new Error("ServiceContainer has not been initialized. Call initialize() first.");
|
|
13
|
+
}
|
|
14
|
+
return ServiceContainer.instance;
|
|
15
|
+
}
|
|
16
|
+
static initialize(config) {
|
|
17
|
+
if (ServiceContainer.instance) {
|
|
18
|
+
return ServiceContainer.instance;
|
|
19
|
+
}
|
|
20
|
+
ServiceContainer.instance = new ServiceContainer(config);
|
|
21
|
+
return ServiceContainer.instance;
|
|
22
|
+
}
|
|
23
|
+
getApplicationService() {
|
|
24
|
+
return this.applicationService;
|
|
25
|
+
}
|
|
26
|
+
getDatabaseService() {
|
|
27
|
+
return this.applicationService.getDatabaseService();
|
|
28
|
+
}
|
|
29
|
+
getWebSocketService() {
|
|
30
|
+
return this.applicationService.getWebSocketService();
|
|
31
|
+
}
|
|
32
|
+
getHttpServerService() {
|
|
33
|
+
return this.applicationService.getHttpServerService();
|
|
34
|
+
}
|
|
35
|
+
getConfig() {
|
|
36
|
+
return this.config;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.ServiceContainer = ServiceContainer;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import WebSocket from "ws";
|
|
2
|
+
import { Config } from "../types";
|
|
3
|
+
export interface IWebSocketService {
|
|
4
|
+
getWebSocket(): WebSocket | null;
|
|
5
|
+
isConnected(): boolean;
|
|
6
|
+
connect(): Promise<void>;
|
|
7
|
+
disconnect(): Promise<void>;
|
|
8
|
+
sendMessage(message: any): boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare class WebSocketService implements IWebSocketService {
|
|
11
|
+
private ws;
|
|
12
|
+
private config;
|
|
13
|
+
private connected;
|
|
14
|
+
private reconnectInterval;
|
|
15
|
+
private reconnectAttempts;
|
|
16
|
+
private maxReconnectAttempts;
|
|
17
|
+
private reconnectDelay;
|
|
18
|
+
constructor(config: Config);
|
|
19
|
+
connect(): Promise<void>;
|
|
20
|
+
disconnect(): Promise<void>;
|
|
21
|
+
sendMessage(message: any): boolean;
|
|
22
|
+
getWebSocket(): WebSocket | null;
|
|
23
|
+
isConnected(): boolean;
|
|
24
|
+
private handleMessage;
|
|
25
|
+
private scheduleReconnect;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=WebSocketService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebSocketService.d.ts","sourceRoot":"","sources":["../../src/services/WebSocketService.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,IAAI,CAAC;AAE3B,OAAO,EACL,MAAM,EAKP,MAAM,UAAU,CAAC;AAIlB,MAAM,WAAW,iBAAiB;IAChC,YAAY,IAAI,SAAS,GAAG,IAAI,CAAC;IACjC,WAAW,IAAI,OAAO,CAAC;IACvB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,WAAW,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC;CACpC;AAED,qBAAa,gBAAiB,YAAW,iBAAiB;IACxD,OAAO,CAAC,EAAE,CAA0B;IACpC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,iBAAiB,CAA+B;IACxD,OAAO,CAAC,iBAAiB,CAAa;IACtC,OAAO,CAAC,oBAAoB,CAAc;IAC1C,OAAO,CAAC,cAAc,CAAiB;gBAE3B,MAAM,EAAE,MAAM;IAIb,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IA8CxB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAuBjC,WAAW,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO;IAiBlC,YAAY,IAAI,SAAS,GAAG,IAAI;IAIhC,WAAW,IAAI,OAAO;YAQf,aAAa;IA0B3B,OAAO,CAAC,iBAAiB;CAkC1B"}
|
|
@@ -0,0 +1,180 @@
|
|
|
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 () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.WebSocketService = void 0;
|
|
40
|
+
const ws_1 = __importDefault(require("ws"));
|
|
41
|
+
const base64 = __importStar(require("base-64"));
|
|
42
|
+
const types_1 = require("../types");
|
|
43
|
+
const utils_1 = require("@meru2802/rmm-lib/utils");
|
|
44
|
+
const axios_1 = __importDefault(require("axios"));
|
|
45
|
+
class WebSocketService {
|
|
46
|
+
constructor(config) {
|
|
47
|
+
this.ws = null;
|
|
48
|
+
this.connected = false;
|
|
49
|
+
this.reconnectInterval = null;
|
|
50
|
+
this.reconnectAttempts = 0;
|
|
51
|
+
this.maxReconnectAttempts = 10;
|
|
52
|
+
this.reconnectDelay = 30000; // 30 seconds
|
|
53
|
+
this.config = config;
|
|
54
|
+
}
|
|
55
|
+
async connect() {
|
|
56
|
+
return new Promise((resolve, reject) => {
|
|
57
|
+
try {
|
|
58
|
+
const { user, password, server } = this.config.meshcentralConfig;
|
|
59
|
+
this.ws = new ws_1.default(`wss://${server}/control.ashx`, {
|
|
60
|
+
headers: {
|
|
61
|
+
"x-meshauth": `${base64.encode(user)},${base64.encode(password)},`,
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
this.ws.on("open", () => {
|
|
65
|
+
console.log("Connected to MeshCentral WebSocket server");
|
|
66
|
+
this.connected = true;
|
|
67
|
+
this.reconnectAttempts = 0;
|
|
68
|
+
resolve();
|
|
69
|
+
});
|
|
70
|
+
this.ws.on("message", (data) => {
|
|
71
|
+
this.handleMessage(data);
|
|
72
|
+
});
|
|
73
|
+
this.ws.on("error", (error) => {
|
|
74
|
+
console.error("WebSocket error:", error);
|
|
75
|
+
this.connected = false;
|
|
76
|
+
if (this.reconnectAttempts === 0) {
|
|
77
|
+
reject(error);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
this.ws.on("close", (code, reason) => {
|
|
81
|
+
console.log(`WebSocket connection closed: ${code} - ${reason.toString()}`);
|
|
82
|
+
this.connected = false;
|
|
83
|
+
this.ws = null;
|
|
84
|
+
this.scheduleReconnect();
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
console.error("Error connecting to MeshCentral:", error);
|
|
89
|
+
this.connected = false;
|
|
90
|
+
reject(error);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
async disconnect() {
|
|
95
|
+
return new Promise((resolve) => {
|
|
96
|
+
if (this.reconnectInterval) {
|
|
97
|
+
clearInterval(this.reconnectInterval);
|
|
98
|
+
this.reconnectInterval = null;
|
|
99
|
+
}
|
|
100
|
+
if (this.ws) {
|
|
101
|
+
this.ws.removeAllListeners();
|
|
102
|
+
if (this.ws.readyState === ws_1.default.OPEN) {
|
|
103
|
+
this.ws.close();
|
|
104
|
+
}
|
|
105
|
+
this.ws = null;
|
|
106
|
+
}
|
|
107
|
+
this.connected = false;
|
|
108
|
+
console.log("WebSocket connection closed gracefully");
|
|
109
|
+
resolve();
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
sendMessage(message) {
|
|
113
|
+
if (!this.ws || !this.connected || this.ws.readyState !== ws_1.default.OPEN) {
|
|
114
|
+
console.warn("Cannot send message: WebSocket not connected");
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
try {
|
|
118
|
+
const messageString = typeof message === "string" ? message : JSON.stringify(message);
|
|
119
|
+
this.ws.send(messageString);
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
console.error("Error sending WebSocket message:", error);
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
getWebSocket() {
|
|
128
|
+
return this.ws;
|
|
129
|
+
}
|
|
130
|
+
isConnected() {
|
|
131
|
+
return (this.connected &&
|
|
132
|
+
this.ws !== null &&
|
|
133
|
+
this.ws.readyState === ws_1.default.OPEN);
|
|
134
|
+
}
|
|
135
|
+
async handleMessage(data) {
|
|
136
|
+
try {
|
|
137
|
+
const message = JSON.parse(data.toString());
|
|
138
|
+
switch (message.action) {
|
|
139
|
+
case types_1.MeshActions.EVENT:
|
|
140
|
+
if (message.event.msgid === 98) {
|
|
141
|
+
const event = message.event;
|
|
142
|
+
const meshNodeId = (0, utils_1.base64ToHex)(event.nodeid);
|
|
143
|
+
await axios_1.default.post(this.config.icebergConfig.eventsEndpoint, {
|
|
144
|
+
event: types_1.IcebergConnectEvents.MESH_NODE_ID,
|
|
145
|
+
participantName: event.msgArgs[0],
|
|
146
|
+
room_id: event.msgArgs[1],
|
|
147
|
+
progress: "100",
|
|
148
|
+
logs: [meshNodeId],
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
console.error("Error processing MeshCentral message:", error);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
scheduleReconnect() {
|
|
159
|
+
if (this.reconnectAttempts >= this.maxReconnectAttempts) {
|
|
160
|
+
console.error(`Max reconnection attempts (${this.maxReconnectAttempts}) reached. Giving up.`);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
if (this.reconnectInterval) {
|
|
164
|
+
return; // Already scheduled
|
|
165
|
+
}
|
|
166
|
+
console.log(`Scheduling reconnection attempt ${this.reconnectAttempts + 1} in ${this.reconnectDelay}ms`);
|
|
167
|
+
this.reconnectInterval = setTimeout(async () => {
|
|
168
|
+
this.reconnectInterval = null;
|
|
169
|
+
this.reconnectAttempts++;
|
|
170
|
+
console.log(`Attempting to reconnect to MeshCentral (attempt ${this.reconnectAttempts}/${this.maxReconnectAttempts})...`);
|
|
171
|
+
try {
|
|
172
|
+
await this.connect();
|
|
173
|
+
}
|
|
174
|
+
catch (error) {
|
|
175
|
+
console.error(`Reconnection attempt ${this.reconnectAttempts} failed:`, error);
|
|
176
|
+
}
|
|
177
|
+
}, this.reconnectDelay);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
exports.WebSocketService = WebSocketService;
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { CorsOptions } from "cors";
|
|
2
|
+
export declare enum MeshActions {
|
|
3
|
+
MESH_ES = "meshes",
|
|
4
|
+
EVENT = "event",
|
|
5
|
+
CREATE_MESH = "createmesh",
|
|
6
|
+
ADD_MESH_USER = "addmeshuser"
|
|
7
|
+
}
|
|
8
|
+
export declare enum IcebergConnectEvents {
|
|
9
|
+
MESH_NODE_ID = "MESH_NODE_ID"
|
|
10
|
+
}
|
|
11
|
+
export declare enum AgentType {
|
|
12
|
+
WORKSTATION = "workstation",
|
|
13
|
+
SERVER = "server"
|
|
14
|
+
}
|
|
15
|
+
export interface MeshCentralMessage {
|
|
16
|
+
action: string;
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
}
|
|
19
|
+
export interface HelpRequestEvent {
|
|
20
|
+
etype: string;
|
|
21
|
+
action: string;
|
|
22
|
+
nodeid: string;
|
|
23
|
+
domain: string;
|
|
24
|
+
msg: string;
|
|
25
|
+
msgid: number;
|
|
26
|
+
msgArgs: string[];
|
|
27
|
+
time: string;
|
|
28
|
+
}
|
|
29
|
+
interface UserLink {
|
|
30
|
+
name: string;
|
|
31
|
+
rights: number;
|
|
32
|
+
}
|
|
33
|
+
interface MeshLinks {
|
|
34
|
+
[userId: string]: UserLink;
|
|
35
|
+
}
|
|
36
|
+
interface Mesh {
|
|
37
|
+
type: string;
|
|
38
|
+
_id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
mtype: number;
|
|
41
|
+
domain: string;
|
|
42
|
+
links: MeshLinks;
|
|
43
|
+
creation: number;
|
|
44
|
+
creatorid: string;
|
|
45
|
+
creatorname: string;
|
|
46
|
+
}
|
|
47
|
+
export interface MeshesMessage {
|
|
48
|
+
action: string;
|
|
49
|
+
meshes: Mesh[];
|
|
50
|
+
}
|
|
51
|
+
export interface CreateMeshMessage {
|
|
52
|
+
action: MeshActions.CREATE_MESH;
|
|
53
|
+
result: "ok";
|
|
54
|
+
meshid: string;
|
|
55
|
+
links: {
|
|
56
|
+
[userKey: string]: {
|
|
57
|
+
name: string;
|
|
58
|
+
rights: number;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
export interface CustomCorsOptions extends Omit<CorsOptions, "origin"> {
|
|
63
|
+
allowedOrigins: string[];
|
|
64
|
+
}
|
|
65
|
+
export interface Config {
|
|
66
|
+
serverConfig: {
|
|
67
|
+
corsOptions: CustomCorsOptions;
|
|
68
|
+
};
|
|
69
|
+
meshcentralConfig: {
|
|
70
|
+
user: string;
|
|
71
|
+
password: string;
|
|
72
|
+
server: string;
|
|
73
|
+
loginEncryptionKey: string;
|
|
74
|
+
inviteEncryptionKey: string;
|
|
75
|
+
};
|
|
76
|
+
epmConfig: {
|
|
77
|
+
server: string;
|
|
78
|
+
installerToken: string;
|
|
79
|
+
};
|
|
80
|
+
icebergConfig: {
|
|
81
|
+
eventsEndpoint: string;
|
|
82
|
+
introspectEndpoint: string;
|
|
83
|
+
HMAC_SECRET: string;
|
|
84
|
+
};
|
|
85
|
+
dbConfig: {
|
|
86
|
+
host: string;
|
|
87
|
+
port: number;
|
|
88
|
+
user: string;
|
|
89
|
+
password: string;
|
|
90
|
+
database: string;
|
|
91
|
+
};
|
|
92
|
+
logging: {
|
|
93
|
+
level: string;
|
|
94
|
+
directory: string;
|
|
95
|
+
filename: string;
|
|
96
|
+
datePattern: string;
|
|
97
|
+
maxSize: string;
|
|
98
|
+
maxFiles: string;
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
export interface HealthResponse {
|
|
102
|
+
status: string;
|
|
103
|
+
timestamp: string;
|
|
104
|
+
meshConnection: boolean;
|
|
105
|
+
dbConnection: boolean;
|
|
106
|
+
}
|
|
107
|
+
export interface StatusResponse {
|
|
108
|
+
service: string;
|
|
109
|
+
version: string;
|
|
110
|
+
meshCentral: {
|
|
111
|
+
connected: boolean;
|
|
112
|
+
server: string;
|
|
113
|
+
};
|
|
114
|
+
database: {
|
|
115
|
+
connected: boolean;
|
|
116
|
+
host: string;
|
|
117
|
+
};
|
|
118
|
+
uptime: number;
|
|
119
|
+
}
|
|
120
|
+
export interface DownloadLinkResponse {
|
|
121
|
+
download_link: string;
|
|
122
|
+
timestamp: string;
|
|
123
|
+
}
|
|
124
|
+
export interface ConnectUrlSResponse {
|
|
125
|
+
control: string;
|
|
126
|
+
terminal: string;
|
|
127
|
+
file: string;
|
|
128
|
+
timestamp: string;
|
|
129
|
+
}
|
|
130
|
+
export interface CreateDeviceGroupResponse {
|
|
131
|
+
result: string;
|
|
132
|
+
deviceGroupId: string;
|
|
133
|
+
timestamp: string;
|
|
134
|
+
}
|
|
135
|
+
export interface AddUserToGroupResponse {
|
|
136
|
+
result: string;
|
|
137
|
+
users_added: string[];
|
|
138
|
+
failed_users?: string[];
|
|
139
|
+
timestamp: string;
|
|
140
|
+
}
|
|
141
|
+
export interface AddMeshUserEventData {
|
|
142
|
+
action: "event";
|
|
143
|
+
event: {
|
|
144
|
+
etype: "user";
|
|
145
|
+
userid: string;
|
|
146
|
+
username: string;
|
|
147
|
+
account: {
|
|
148
|
+
_id: string;
|
|
149
|
+
name: string;
|
|
150
|
+
creation: number;
|
|
151
|
+
email: string;
|
|
152
|
+
emailVerified: boolean;
|
|
153
|
+
passchange: number;
|
|
154
|
+
realname: string;
|
|
155
|
+
siteadmin: number;
|
|
156
|
+
links: {
|
|
157
|
+
[meshId: string]: {
|
|
158
|
+
rights: number;
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
action: "accountchange";
|
|
163
|
+
msgid: number;
|
|
164
|
+
msgArgs: string[];
|
|
165
|
+
msg: string;
|
|
166
|
+
domain: string;
|
|
167
|
+
time: string;
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
export interface UnauthorizedResponse {
|
|
171
|
+
error: string;
|
|
172
|
+
code: number;
|
|
173
|
+
message: string[];
|
|
174
|
+
path: string;
|
|
175
|
+
timestamp: string;
|
|
176
|
+
}
|
|
177
|
+
export interface ErrorResponse {
|
|
178
|
+
error: string;
|
|
179
|
+
timestamp?: string;
|
|
180
|
+
}
|
|
181
|
+
export interface TokenData {
|
|
182
|
+
active: boolean;
|
|
183
|
+
amr: string[];
|
|
184
|
+
aud: string[];
|
|
185
|
+
auth_time: number;
|
|
186
|
+
client_id: string;
|
|
187
|
+
email: string;
|
|
188
|
+
email_verified: boolean;
|
|
189
|
+
exp: number;
|
|
190
|
+
family_name: string;
|
|
191
|
+
given_name: string;
|
|
192
|
+
iat: number;
|
|
193
|
+
iss: string;
|
|
194
|
+
jti: string;
|
|
195
|
+
locale: string | null;
|
|
196
|
+
name: string;
|
|
197
|
+
nbf: number;
|
|
198
|
+
preferred_username: string;
|
|
199
|
+
scope: string;
|
|
200
|
+
sub: string;
|
|
201
|
+
token_type: string;
|
|
202
|
+
updated_at: number;
|
|
203
|
+
username: string;
|
|
204
|
+
user_id: string;
|
|
205
|
+
org_id: string;
|
|
206
|
+
"urn:zitadel:iam:user:resourceowner:id": string;
|
|
207
|
+
"urn:zitadel:iam:user:resourceowner:name": string;
|
|
208
|
+
"urn:zitadel:iam:user:resourceowner:primary_domain": string;
|
|
209
|
+
"urn:zitadel:iam:org:project:311317783956687372:roles": RoleMapping;
|
|
210
|
+
"urn:zitadel:iam:org:project:roles": RoleMapping;
|
|
211
|
+
}
|
|
212
|
+
interface RoleMapping {
|
|
213
|
+
[roleName: string]: {
|
|
214
|
+
[organizationId: string]: string;
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
export {};
|
|
218
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAEnC,oBAAY,WAAW;IACrB,OAAO,WAAW;IAClB,KAAK,UAAU;IACf,WAAW,eAAe;IAC1B,aAAa,gBAAgB;CAC9B;AAED,oBAAY,oBAAoB;IAC9B,YAAY,iBAAiB;CAC9B;AAED,oBAAY,SAAS;IACnB,WAAW,gBAAgB;IAC3B,MAAM,WAAW;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED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,sDAAsD,EAAE,WAAW,CAAC;IACpE,mCAAmC,EAAE,WAAW,CAAC;CAClD;AAED,UAAU,WAAW;IACnB,CAAC,QAAQ,EAAE,MAAM,GAAG;QAClB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAAC;KAClC,CAAC;CACH"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgentType = exports.IcebergConnectEvents = exports.MeshActions = void 0;
|
|
4
|
+
var MeshActions;
|
|
5
|
+
(function (MeshActions) {
|
|
6
|
+
MeshActions["MESH_ES"] = "meshes";
|
|
7
|
+
MeshActions["EVENT"] = "event";
|
|
8
|
+
MeshActions["CREATE_MESH"] = "createmesh";
|
|
9
|
+
MeshActions["ADD_MESH_USER"] = "addmeshuser";
|
|
10
|
+
})(MeshActions || (exports.MeshActions = MeshActions = {}));
|
|
11
|
+
var IcebergConnectEvents;
|
|
12
|
+
(function (IcebergConnectEvents) {
|
|
13
|
+
IcebergConnectEvents["MESH_NODE_ID"] = "MESH_NODE_ID";
|
|
14
|
+
})(IcebergConnectEvents || (exports.IcebergConnectEvents = IcebergConnectEvents = {}));
|
|
15
|
+
var AgentType;
|
|
16
|
+
(function (AgentType) {
|
|
17
|
+
AgentType["WORKSTATION"] = "workstation";
|
|
18
|
+
AgentType["SERVER"] = "server";
|
|
19
|
+
})(AgentType || (exports.AgentType = AgentType = {}));
|