| 1 | export default class Constants { |
| 2 | static REST_RESPONSE_SUCCESS = { status: 'Success' }; |
| 3 | |
| 4 | static CONN_STATUS_AVAILABLE = 'Available'; |
| 5 | static CONN_STATUS_OCCUPIED = 'Occupied'; |
| 6 | |
| 7 | static STATS_GROUP_BY_CONSUMPTION = 'C'; |
| 8 | static STATS_GROUP_BY_USAGE = 'U'; |
| 9 | |
| 10 | // Statuses |
| 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 NOTIFICATION_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'; |
| 55 | |
| 56 | // Statuses |
| 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'; |
| 63 | |
| 64 | // Roles |
| 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'; |
| 79 | |
| 80 | // Password constants |
| 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; |
| 87 | |
| 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; |
| 92 | |
| 93 | static DEFAULT_LOCALE = 'en_US'; |
| 94 | |
| 95 | static ANONYMIZED_VALUE = '####'; |
| 96 | |
| 97 | static DEFAULT_DB_LIMIT = 100; |
| 98 | |
| 99 | static METER_VALUE_CTX_SAMPLE_PERIODIC = 'Sample.Periodic'; |
| 100 | static METER_VALUE_CTX_SAMPLE_CLOCK = 'Sample.Clock'; |
| 101 | |
| 102 | static WS_UNSUPPORTED_DATA = 1007; |
| 103 | |
| 104 | static OCPP_RESPONSE_ACCEPTED = { status: 'Accepted' }; |
| 105 | static OCPP_RESPONSE_REJECTED = { status: 'Rejected' }; |
| 106 | static OCPP_RESPONSE_REBOOT_REQUIRED = { status: 'RebootRequired' }; |
| 107 | static OCPP_SOCKET_TIMEOUT = 60000; // 60 sec |
| 108 | static OCPP_JSON_CALL_MESSAGE = 2; // Client-to-Server |
| 109 | static OCPP_JSON_CALL_RESULT_MESSAGE = 3; // Server-to-Client |
| 110 | static OCPP_JSON_CALL_ERROR_MESSAGE = 4; // Server-to-Client |
| 111 | // Requested Action is not known by receiver |
| 112 | static OCPP_ERROR_NOT_IMPLEMENTED = 'NotImplemented'; |
| 113 | // Requested Action is recognized but not supported by the receiver |
| 114 | static OCPP_ERROR_NOT_SUPPORTED = 'NotSupported'; |
| 115 | // An internal error occurred and the receiver was not able to process the requested Action successfully |
| 116 | static OCPP_ERROR_INTERNAL_ERROR = 'InternalError'; |
| 117 | // Payload for Action is incomplete |
| 118 | static OCPP_ERROR_PROTOCOL_ERROR = 'ProtocolError'; |
| 119 | // During the processing of Action a security issue occurred preventing receiver from completing the Action successfully |
| 120 | static OCPP_ERROR_SECURITY_ERROR = 'SecurityError'; |
| 121 | // Payload for Action is syntactically incorrect or not conform the PDU structure for Action |
| 122 | static OCPP_ERROR_FORMATION_VIOLATION = 'FormationViolation'; |
| 123 | // Payload is syntactically correct but at least one field contains an invalid value |
| 124 | static OCPP_ERROR_PROPERTY_RAINT_VIOLATION = 'PropertyraintViolation'; |
| 125 | // Payload for Action is syntactically correct but at least one of the fields violates occurence raints |
| 126 | static OCPP_ERROR_OCCURENCE_RAINT_VIOLATION = 'OccurenceraintViolation'; |
| 127 | // Payload for Action is syntactically correct but at least one of the fields violates data type raints (e.g. “somestring” = 12) |
| 128 | static OCPP_ERROR_TYPERAINT_VIOLATION = 'TyperaintViolation'; |
| 129 | // Any other error not covered by the previous ones |
| 130 | static OCPP_ERROR_GENERIC_ERROR = 'GenericError'; |
| 131 | |
| 132 | static OCPP_PROTOCOL_JSON = 'json'; |
| 133 | static OCPP_PROTOCOL_SOAP = 'soap'; |
| 134 | static OCPP_VERSION_12 = '1.2'; |
| 135 | static OCPP_VERSION_15 = '1.5'; |
| 136 | static OCPP_VERSION_16 = '1.6'; |
| 137 | static OCPP_VERSION_20 = '2.0'; |
| 138 | |
| 139 | static STATUS_NOTIFICATION_TIMEOUT = 500; |
| 140 | static START_TRANSACTION_TIMEOUT = 500; |
| 141 | |
| 142 | static CHARGING_STATION_DEFAULT_RESET_TIME = 60000; // Ms |
| 143 | static CHARGING_STATION_ATG_WAIT_TIME = 2000; // Ms |
| 144 | } |