Avoid attribute namespace collision
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 14 May 2022 20:48:36 +0000 (22:48 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 14 May 2022 20:48:36 +0000 (22:48 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
package-lock.json
package.json
src/charging-station/ui-server/AbstractUIServer.ts
src/charging-station/ui-server/UIWebSocketServer.ts

index 15c3d84d9c2418ed00a7a159bbffac9f30cbbfe1..8888dbf7c5c8426ee559bd30e1c834853ae6e046 100644 (file)
@@ -60,7 +60,7 @@
         "prettier": "^2.6.2",
         "release-it": "^15.0.0",
         "robohydra": "^0.6.9",
-        "rollup": "^2.72.1",
+        "rollup": "^2.73.0",
         "rollup-plugin-analyzer": "^4.0.0",
         "rollup-plugin-copy": "^3.4.0",
         "rollup-plugin-delete": "^2.0.0",
       }
     },
     "node_modules/rollup": {
-      "version": "2.72.1",
-      "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.72.1.tgz",
-      "integrity": "sha512-NTc5UGy/NWFGpSqF1lFY8z9Adri6uhyMLI6LvPAXdBKoPRFhIIiBUpt+Qg2awixqO3xvzSijjhnb4+QEZwJmxA==",
+      "version": "2.73.0",
+      "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.73.0.tgz",
+      "integrity": "sha512-h/UngC3S4Zt28mB3g0+2YCMegT5yoftnQplwzPqGZcKvlld5e+kT/QRmJiL+qxGyZKOYpgirWGdLyEO1b0dpLQ==",
       "dev": true,
       "bin": {
         "rollup": "dist/bin/rollup"
       }
     },
     "rollup": {
-      "version": "2.72.1",
-      "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.72.1.tgz",
-      "integrity": "sha512-NTc5UGy/NWFGpSqF1lFY8z9Adri6uhyMLI6LvPAXdBKoPRFhIIiBUpt+Qg2awixqO3xvzSijjhnb4+QEZwJmxA==",
+      "version": "2.73.0",
+      "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.73.0.tgz",
+      "integrity": "sha512-h/UngC3S4Zt28mB3g0+2YCMegT5yoftnQplwzPqGZcKvlld5e+kT/QRmJiL+qxGyZKOYpgirWGdLyEO1b0dpLQ==",
       "dev": true,
       "requires": {
         "fsevents": "~2.3.2"
index cfb1ea249250a922563a4975c7366db997fc978a..60d1b0065c6f234aeec1fc84bd8373cb501ac9c5 100644 (file)
     "prettier": "^2.6.2",
     "release-it": "^15.0.0",
     "robohydra": "^0.6.9",
-    "rollup": "^2.72.1",
+    "rollup": "^2.73.0",
     "rollup-plugin-analyzer": "^4.0.0",
     "rollup-plugin-copy": "^3.4.0",
     "rollup-plugin-delete": "^2.0.0",
index 2608e83443a8bfcfd43a68a93c6074f50f0f0272..92860638192a197a1b29f57cfe7850ce92de9022 100644 (file)
@@ -6,7 +6,7 @@ import { Server as WSServer } from 'ws';
 export abstract class AbstractUIServer {
   public readonly chargingStations: Set<string>;
   protected readonly uiServices: Map<ProtocolVersion, AbstractUIService>;
-  protected uiServer: WSServer | HttpServer;
+  protected server: WSServer | HttpServer;
 
   public constructor() {
     this.chargingStations = new Set<string>();
index fcfc309708811f88eeef7857c6dfec13639f0ce4..f71f404b28b3bce0c11126eb607ba56381b693f6 100644 (file)
@@ -12,11 +12,11 @@ import logger from '../../utils/Logger';
 export default class UIWebSocketServer extends AbstractUIServer {
   public constructor(options?: ServerOptions) {
     super();
-    this.uiServer = new Server(options ?? Configuration.getUIServer().options);
+    this.server = new Server(options ?? Configuration.getUIServer().options);
   }
 
   public start(): void {
-    this.uiServer.on('connection', (socket: WebSocket, request: IncomingMessage): void => {
+    this.server.on('connection', (socket: WebSocket, request: IncomingMessage): void => {
       const protocolIndex = socket.protocol.indexOf(Protocol.UI);
       const version = socket.protocol.substring(
         protocolIndex + Protocol.UI.length
@@ -40,7 +40,7 @@ export default class UIWebSocketServer extends AbstractUIServer {
   }
 
   public stop(): void {
-    this.uiServer.close();
+    this.server.close();
   }
 
   public sendResponse(message: string): void {
@@ -52,7 +52,7 @@ export default class UIWebSocketServer extends AbstractUIServer {
   }
 
   private broadcastToClients(message: string): void {
-    for (const client of (this.uiServer as Server).clients) {
+    for (const client of (this.server as Server).clients) {
       if (client?.readyState === OPEN) {
         client.send(message);
       }