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