Silence one eslint warning
[e-mobility-charging-stations-simulator.git] / src / utils / Constants.ts
index bfb4fbf38aaf34341dcbb03f6549126ae4e284a7..ee9d96d9d03c00fb920b0664086fdcdd406ca730 100644 (file)
@@ -4,6 +4,7 @@ import {
   ChargingProfileStatus,
   ClearChargingProfileStatus,
   ConfigurationStatus,
+  DataTransferStatus,
   DefaultStatus,
   TriggerMessageStatus,
   UnlockStatus,
@@ -82,6 +83,10 @@ export default class Constants {
     status: TriggerMessageStatus.NOT_IMPLEMENTED,
   });
 
+  static readonly OCPP_DATA_TRANSFER_RESPONSE_REJECTED = Object.freeze({
+    status: DataTransferStatus.REJECTED,
+  });
+
   static readonly OCPP_DEFAULT_BOOT_NOTIFICATION_INTERVAL = 60000; // Ms
   static readonly OCPP_WEBSOCKET_TIMEOUT = 60000; // Ms
   static readonly OCPP_TRIGGER_MESSAGE_DELAY = 500; // Ms
@@ -90,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';