Apply dependencies update
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 23 Dec 2022 20:50:05 +0000 (21:50 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 23 Dec 2022 20:50:05 +0000 (21:50 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
package-lock.json
package.json
src/assets/station-templates/abb-atg.station-template.json
src/assets/station-templates/abb.station-template.json
src/assets/station-templates/evlink.station-template.json
src/assets/station-templates/schneider-imredd.station-template.json
src/assets/station-templates/schneider.station-template.json
src/charging-station/ChargingStation.ts
src/types/ChargingStationTemplate.ts
src/utils/Constants.ts
ui/web/src/types/ChargingStationType.ts

index 2f1ebea9a7b3cde6325f0e9ef523ead339570bbe..6f3c1b5ab133cff77509f7fbac35ec42a1eae036 100644 (file)
@@ -65,7 +65,7 @@
         "prettier": "^2.8.1",
         "release-it": "^15.5.1",
         "robohydra": "^0.6.9",
-        "rollup": "^3.8.0",
+        "rollup": "^3.8.1",
         "rollup-plugin-analyzer": "^4.0.0",
         "rollup-plugin-copy": "^3.4.0",
         "rollup-plugin-delete": "^2.0.0",
       }
     },
     "node_modules/rollup": {
-      "version": "3.8.0",
-      "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.8.0.tgz",
-      "integrity": "sha512-+UR6PnUslneJNiJfLSzy4XH6R50ZGF0MS7UCv20ftXrktF/TkvZDwiBtXX65esblLR5p8w6LmXgPwt2f2B8SoQ==",
+      "version": "3.8.1",
+      "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.8.1.tgz",
+      "integrity": "sha512-4yh9eMW7byOroYcN8DlF9P/2jCpu6txVIHjEqquQVSx7DI0RgyCCN3tjrcy4ra6yVtV336aLBB3v2AarYAxePQ==",
       "dev": true,
       "bin": {
         "rollup": "dist/bin/rollup"
       }
     },
     "rollup": {
-      "version": "3.8.0",
-      "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.8.0.tgz",
-      "integrity": "sha512-+UR6PnUslneJNiJfLSzy4XH6R50ZGF0MS7UCv20ftXrktF/TkvZDwiBtXX65esblLR5p8w6LmXgPwt2f2B8SoQ==",
+      "version": "3.8.1",
+      "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.8.1.tgz",
+      "integrity": "sha512-4yh9eMW7byOroYcN8DlF9P/2jCpu6txVIHjEqquQVSx7DI0RgyCCN3tjrcy4ra6yVtV336aLBB3v2AarYAxePQ==",
       "dev": true,
       "requires": {
         "fsevents": "~2.3.2"
index 43204820cb11cea306522b7f5bf98706dddef19f..ed1bf8324b9c178b2da9dadba795f2500e777979 100644 (file)
     "prettier": "^2.8.1",
     "release-it": "^15.5.1",
     "robohydra": "^0.6.9",
-    "rollup": "^3.8.0",
+    "rollup": "^3.8.1",
     "rollup-plugin-analyzer": "^4.0.0",
     "rollup-plugin-copy": "^3.4.0",
     "rollup-plugin-delete": "^2.0.0",
index 8deb8d6ff4a49259a22d83a26c26b005d89c1fe9..cda5806eae69a23e9f7042ebf2ac791a389cdab9 100644 (file)
@@ -3,6 +3,7 @@
   "baseName": "CS-ABB",
   "chargePointModel": "MD_TERRA_53",
   "chargePointVendor": "ABB",
+  "firmwareVersionPattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$",
   "firmwareVersion": "4.0.4.22",
   "power": 50000,
   "powerSharedByConnectors": true,
index 81f2d099c7a3b17c7be589205bdcf3e3b3dc8a1f..2aef581adf4a69b486af99c06dfbbfd247206cb4 100644 (file)
@@ -3,6 +3,7 @@
   "baseName": "CS-ABB",
   "chargePointModel": "MD_TERRA_53",
   "chargePointVendor": "ABB",
+  "firmwareVersionPattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$",
   "firmwareVersion": "4.0.4.22",
   "power": 50000,
   "powerSharedByConnectors": true,
index fbaa37e193408d4d02c9af3585d3865e5a13dba2..307db670fc7df8744b27011cedcfdbd1fea705fc 100644 (file)
@@ -6,6 +6,7 @@
   "chargePointModel": "MONOBLOCK",
   "chargePointVendor": "Schneider Electric",
   "chargeBoxSerialNumberPrefix": "EV.2S7P04",
+  "firmwareVersionPattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$",
   "firmwareVersion": "3.3.0.10",
   "power": 7360,
   "powerUnit": "W",
index 63ee8c01b3f60efb271cda5f27dafd4338a7226d..18c6ea478f62b47808ec3c2685dc21aa56347730 100644 (file)
@@ -6,6 +6,7 @@
   "chargePointModel": "MONOBLOCK",
   "chargePointVendor": "Schneider Electric",
   "chargeBoxSerialNumberPrefix": "EV.2S22P04",
+  "firmwareVersionPattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$",
   "firmwareVersion": "3.3.0.10",
   "power": 22080,
   "powerUnit": "W",
index 2482a4392bd9994c0c3192acb398ee4f6a70052b..65f7f304476a06269d664765dcb4cc8febb399ae 100644 (file)
@@ -6,6 +6,7 @@
   "chargePointModel": "MONOBLOCK",
   "chargePointVendor": "Schneider Electric",
   "chargeBoxSerialNumberPrefix": "EV.2S22P44",
+  "firmwareVersionPattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$",
   "firmwareVersion": "3.3.0.10",
   "power": 44160,
   "powerUnit": "W",
index f7cad5db37beb80db1b417b183d40121718557e8..01e340606e0f6f218fe74dabbffe54055e48a82b 100644 (file)
@@ -818,6 +818,19 @@ export default class ChargingStation {
       'supervisionUrl',
       'supervisionUrls'
     );
+    const firmwareVersionRegExp = stationTemplate.firmwareVersionPattern
+      ? new RegExp(stationTemplate.firmwareVersionPattern)
+      : Constants.SEMVER_REGEXP;
+    if (
+      stationTemplate.firmwareVersion &&
+      firmwareVersionRegExp.test(stationTemplate.firmwareVersion) === false
+    ) {
+      logger.warn(
+        `${this.logPrefix()} Firmware version '${
+          stationTemplate.firmwareVersion
+        }' does not match regular expression '${firmwareVersionRegExp.toString()}'`
+      );
+    }
     const stationInfo: ChargingStationInfo =
       ChargingStationUtils.stationTemplateToStationInfo(stationTemplate);
     stationInfo.hashId = ChargingStationUtils.getHashId(this.index, stationTemplate);
index 3945e8925f94ebbafd9ce5435b10b12466649e45..cd92616c11063cb4060013081ce8ffd45e974bc2 100644 (file)
@@ -35,6 +35,16 @@ export enum Voltage {
 
 export type WsOptions = ClientOptions & ClientRequestArgs;
 
+type FirmwareUpgrade = {
+  versionUpgrade: {
+    patternGroup?: number | number[];
+    to?: string;
+  };
+  reset?: boolean;
+  resetDelay?: number;
+  checkIntegrity?: boolean;
+};
+
 type CommandsSupport = {
   incomingCommands: Record<IncomingRequestCommand, boolean>;
   outgoingCommands?: Record<RequestCommand, boolean>;
@@ -61,7 +71,9 @@ export type ChargingStationTemplate = {
   chargePointVendor: string;
   chargePointSerialNumberPrefix?: string;
   chargeBoxSerialNumberPrefix?: string;
+  firmwareVersionPattern?: string;
   firmwareVersion?: string;
+  firmwareUpgrade?: FirmwareUpgrade;
   iccid?: string;
   imsi?: string;
   meterSerialNumberPrefix?: string;
index 74b88834e1b943742320f8956d4fabf1c4dbbd97..ee9d96d9d03c00fb920b0664086fdcdd406ca730 100644 (file)
@@ -95,6 +95,10 @@ export default class Constants {
   static readonly CHARGING_STATION_ATG_INITIALIZATION_TIME = 1000; // Ms
   static readonly CHARGING_STATION_ATG_DEFAULT_STOP_AFTER_HOURS = 0.25; // Hours
 
+  // See https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
+  static readonly SEMVER_REGEXP =
+    /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
+
   static readonly DEFAULT_CIRCULAR_BUFFER_CAPACITY = Number.MAX_SAFE_INTEGER;
 
   static readonly DEFAULT_HASH_ALGORITHM = 'sha384';
index ae049bd0b963c64f2159f9997ee819f343ca6e16..3aa769839848ba9da75f572b3cb349997fb58e62 100644 (file)
@@ -18,6 +18,7 @@ export type ChargingStationInfo = {
   chargingStationId?: string;
   chargePointModel: string;
   chargePointVendor: string;
+  firmwareVersionPattern?: string;
   firmwareVersion?: string;
   numberOfConnectors?: number | number[];
   baseName: string;