Convert Constants to ES6 module definition.
[e-mobility-charging-stations-simulator.git] / src / utils / Constants.js
1 class Constants {
2 REST_RESPONSE_SUCCESS = {status = 'Success'},
3
4 CONN_STATUS_AVAILABLE = 'Available',
5 CONN_STATUS_OCCUPIED = 'Occupied',
6
7 STATS_GROUP_BY_CONSUMPTION = 'C',
8 STATS_GROUP_BY_USAGE = 'U',
9
10 // Statuses
11 ENTITY_SITE = 'Site',
12 ENTITY_SITES = 'Sites',
13 ENTITY_SITE_AREA = 'SiteArea',
14 ENTITY_SITE_AREAS = 'SiteAreas',
15 ENTITY_COMPANY = 'Company',
16 ENTITY_COMPANIES = 'Companies',
17 ENTITY_CHARGING_STATION = 'ChargingStation',
18 ENTITY_CHARGING_STATIONS = 'ChargingStations',
19 ENTITY_TENANT = 'Tenant',
20 ENTITY_TENANTS = 'Tenants',
21 ENTITY_TRANSACTION = 'Transaction',
22 ENTITY_TRANSACTIONS = 'Transactions',
23 ENTITY_TRANSACTION_METER_VALUES = 'MeterValues',
24 ENTITY_TRANSACTION_STOP = 'Stop',
25 ENTITY_USER = 'User',
26 ENTITY_USERS = 'Users',
27 ENTITY_VEHICLE_MANUFACTURER = 'VehicleManufacturer',
28 ENTITY_VEHICLE_MANUFACTURERS = 'VehicleManufacturers',
29 ENTITY_VEHICLES = 'Vehicles',
30 ENTITY_VEHICLE = 'Vehicle',
31 ENTITY_LOGGINGS = 'Loggings',
32 ENTITY_LOGGING = 'Logging',
33 ENTITY_PRICING = 'Pricing',
34
35 NOTIF_TYPE_CHARGING_STATION_CONFIGURATION = 'Configuration',
36
37 ACTION_READ = 'Read',
38 ACTION_CREATE = 'Create',
39 ACTION_UPDATE = 'Update',
40 ACTION_DELETE = 'Delete',
41
42 NO_LIMIT = 0,
43
44 CENTRAL_SERVER = 'Central Server',
45
46 WITH_CONNECTORS = true,
47 WITHOUT_CONNECTORS = false,
48
49 WITH_CHARGING_STATIONS = true,
50 WITHOUT_CHARGING_STATIONS = false,
51 WITH_SITE = true,
52 WITHOUT_SITE = false,
53
54 VEHICLE_TYPE_CAR = 'C',
55
56 // Statuses
57 USER_STATUS_PENDING = 'P',
58 USER_STATUS_ACTIVE = 'A',
59 USER_STATUS_DELETED = 'D',
60 USER_STATUS_INACTIVE = 'I',
61 USER_STATUS_BLOCKED = 'B',
62 USER_STATUS_LOCKED = 'L',
63
64 // Roles
65 ROLE_SUPER_ADMIN = 'S',
66 ROLE_ADMIN = 'A',
67 ROLE_BASIC = 'B',
68 ROLE_DEMO = 'D',
69 ACTION_LOGOUT = 'Logout',
70 ACTION_LIST = 'List',
71 ACTION_RESET = 'Reset',
72 ACTION_AUTHORIZE = 'Authorize',
73 ACTION_CLEAR_CACHE = 'ClearCache',
74 ACTION_STOP_TRANSACTION = 'StopTransaction',
75 ACTION_START_TRANSACTION = 'StartTransaction',
76 ACTION_REFUND_TRANSACTION = 'RefundTransaction',
77 ACTION_UNLOCK_CONNECTOR = 'UnlockConnector',
78 ACTION_GET_CONFIGURATION = 'GetConfiguration',
79
80 // Password constants
81 PWD_MIN_LENGTH = 15,
82 PWD_MAX_LENGTH = 20,
83 PWD_UPPERCASE_MIN_COUNT = 1,
84 PWD_LOWERCASE_MIN_COUNT = 1,
85 PWD_NUMBER_MIN_COUNT = 1,
86 PWD_SPECIAL_MIN_COUNT = 1,
87
88 PWD_UPPERCASE_RE = /([A-Z])/g,
89 PWD_LOWERCASE_RE = /([a-z])/g,
90 PWD_NUMBER_RE = /([\d])/g,
91 PWD_SPECIAL_CHAR_RE = /([!#$%^&*.?-])/g,
92
93 DEFAULT_LOCALE = 'en_US',
94
95 ANONYMIZED_VALUE = '####',
96
97 DEFAULT_DB_LIMIT = 100,
98
99 METER_VALUE_CTX_SAMPLE_PERIODIC = 'Sample.Periodic',
100 METER_VALUE_CTX_SAMPLE_CLOCK = 'Sample.Clock',
101
102 WS_UNSUPPORTED_DATA = 1007,
103
104 OCPP_SOCKET_TIMEOUT = 60000, // 60 sec
105 OCPP_JSON_CALL_MESSAGE = 2, // Client-to-Server
106 OCPP_JSON_CALL_RESULT_MESSAGE = 3, // Server-to-Client
107 OCPP_JSON_CALL_ERROR_MESSAGE = 4, // Server-to-Client
108 // Requested Action is not known by receiver
109 OCPP_ERROR_NOT_IMPLEMENTED = 'NotImplemented',
110 // Requested Action is recognized but not supported by the receiver
111 OCPP_ERROR_NOT_SUPPORTED = 'NotSupported',
112 // An internal error occurred and the receiver was not able to process the requested Action successfully
113 OCPP_ERROR_INTERNAL_ERROR = 'InternalError',
114 // Payload for Action is incomplete
115 OCPP_ERROR_PROTOCOL_ERROR = 'ProtocolError',
116 // During the processing of Action a security issue occurred preventing receiver from completing the Action successfully
117 OCPP_ERROR_SECURITY_ERROR = 'SecurityError',
118 // Payload for Action is syntactically incorrect or not conform the PDU structure for Action
119 OCPP_ERROR_FORMATION_VIOLATION = 'FormationViolation',
120 // Payload is syntactically correct but at least one field contains an invalid value
121 OCPP_ERROR_PROPERTY_RAINT_VIOLATION = 'PropertyraintViolation',
122 // Payload for Action is syntactically correct but at least one of the fields violates occurence raints
123 OCPP_ERROR_OCCURENCE_RAINT_VIOLATION = 'OccurenceraintViolation',
124 // Payload for Action is syntactically correct but at least one of the fields violates data type raints (e.g. “somestring” = 12)
125 OCPP_ERROR_TYPERAINT_VIOLATION = 'TyperaintViolation',
126 // Any other error not covered by the previous ones
127 OCPP_ERROR_GENERIC_ERROR = 'GenericError',
128
129 OCPP_PROTOCOL_JSON = 'json',
130 OCPP_PROTOCOL_SOAP = 'soap',
131 OCPP_VERSION_12 = '1.2',
132 OCPP_VERSION_15 = '1.5',
133 OCPP_VERSION_16 = '1.6',
134 OCPP_VERSION_20 = '2.0',
135 };
136
137 module.exports = Constants;