Migrate manager and wrapper to shared message types
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"amqplib": "^2.0.1",
|
||||
"server-manager-shared": "file:../shared",
|
||||
"steam-server-query": "^1.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
+12
-3
@@ -4,6 +4,12 @@ import { loadConfig, saveConfig } from "./config";
|
||||
import { ProcessManager } from "./processManager";
|
||||
import { StatusReporter } from "./statusReporter";
|
||||
import { QueryManager } from "./queryManager";
|
||||
import {
|
||||
WrapperRegisterMessage,
|
||||
WrapperHeartbeatMessage,
|
||||
ServerStartCommand,
|
||||
ServerStopCommand
|
||||
} from "server-manager-shared";
|
||||
|
||||
|
||||
class Wrapper {
|
||||
@@ -211,7 +217,7 @@ class Wrapper {
|
||||
|
||||
|
||||
|
||||
const message = {
|
||||
const message: WrapperRegisterMessage = {
|
||||
|
||||
|
||||
|
||||
@@ -298,7 +304,10 @@ class Wrapper {
|
||||
const command =
|
||||
JSON.parse(
|
||||
msg.content.toString()
|
||||
);
|
||||
) as ServerStartCommand | ServerStopCommand | {
|
||||
type: string;
|
||||
[key: string]: unknown;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -392,7 +401,7 @@ class Wrapper {
|
||||
|
||||
|
||||
|
||||
const heartbeat = {
|
||||
const heartbeat: WrapperHeartbeatMessage = {
|
||||
|
||||
|
||||
type:
|
||||
|
||||
@@ -41,7 +41,7 @@ export class ProcessManager {
|
||||
|
||||
|
||||
|
||||
startServer(data:any){
|
||||
startServer(data: ServerStartCommand){
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import * as amqp from "amqplib";
|
||||
import { ProcessManager } from "./processManager";
|
||||
import os from "os";
|
||||
import { QueryManager } from "./queryManager";
|
||||
import { WrapperStatusMessage } from "server-manager-shared";
|
||||
|
||||
|
||||
|
||||
@@ -93,7 +94,7 @@ export class StatusReporter {
|
||||
|
||||
|
||||
|
||||
const status = {
|
||||
const status: WrapperStatusMessage = {
|
||||
|
||||
|
||||
type:
|
||||
|
||||
Reference in New Issue
Block a user