fix(core): tidy formatting and minor fixes across CLI, SNMP, HTTP server, migrations and packaging

This commit is contained in:
2026-01-29 17:10:17 +00:00
parent fda072d15e
commit ff2dc00f31
31 changed files with 693 additions and 362 deletions

View File

@@ -25,7 +25,7 @@ export class NupstHttpServer {
port: number,
path: string,
authToken: string,
getUpsStatus: () => Map<string, IUpsStatus>
getUpsStatus: () => Map<string, IUpsStatus>,
) {
this.port = port;
this.path = path;
@@ -70,7 +70,7 @@ export class NupstHttpServer {
if (!this.isAuthenticated(req)) {
res.writeHead(401, {
'Content-Type': 'application/json',
'WWW-Authenticate': 'Bearer'
'WWW-Authenticate': 'Bearer',
});
res.end(JSON.stringify({ error: 'Unauthorized' }));
return;
@@ -82,7 +82,7 @@ export class NupstHttpServer {
res.writeHead(200, {
'Content-Type': 'application/json',
'Cache-Control': 'no-cache'
'Cache-Control': 'no-cache',
});
res.end(JSON.stringify(statusArray, null, 2));
} else {
@@ -95,7 +95,7 @@ export class NupstHttpServer {
logger.success(`HTTP server started on port ${this.port} at ${this.path}`);
});
this.server.on('error', (error: any) => {
this.server.on('error', (error: Error) => {
logger.error(`HTTP server error: ${error.message}`);
});
}