Add enum for standard OCPP parameters key.
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Requests.ts
index e8368793e5835f56a141c9268317767f7bffffc8..4baa070f2a8cf6b93c81cbd332344c8de5e2e3b6 100644 (file)
@@ -1,14 +1,31 @@
 import { ChargePointErrorCode } from './ChargePointErrorCode';
 import { ChargePointStatus } from './ChargePointStatus';
 import { ChargingProfile } from './ChargingProfile';
-import OCPPError from '../../../charging-station/OcppError';
+import { StandardParametersKey } from './Configuration';
 
-export default interface Requests {
-  [id: string]: [(payload?, requestPayload?) => void, (error?: OCPPError) => void, Record<string, unknown>];
+export enum RequestCommand {
+  BOOT_NOTIFICATION = 'BootNotification',
+  HEARTBEAT = 'Heartbeat',
+  STATUS_NOTIFICATION = 'StatusNotification',
+  CHANGE_CONFIGURATION = 'ChangeConfiguration',
+  START_TRANSACTION = 'StartTransaction',
+  STOP_TRANSACTION = 'StopTransaction',
+  METERVALUES = 'MeterValues'
+}
+
+export enum IncomingRequestCommand {
+  RESET = 'Reset',
+  CLEAR_CACHE = 'ClearCache',
+  UNLOCK_CONNECTOR = 'UnlockConnector',
+  GET_CONFIGURATION = 'GetConfiguration',
+  CHANGE_CONFIGURATION = 'ChangeConfiguration',
+  SET_CHARGING_PROFILE = 'SetChargingProfile',
+  REMOTE_START_TRANSACTION = 'RemoteStartTransaction',
+  REMOTE_STOP_TRANSACTION = 'RemoteStopTransaction'
 }
 
 // eslint-disable-next-line @typescript-eslint/no-empty-interface
-export interface HeartbeatRequest {}
+export interface HeartbeatRequest { }
 
 export interface BootNotificationRequest {
   chargeBoxSerialNumber?: string;
@@ -33,7 +50,7 @@ export interface StatusNotificationRequest {
 }
 
 export interface ChangeConfigurationRequest {
-  key: string;
+  key: string | StandardParametersKey;
   value: string;
 }
 
@@ -52,7 +69,7 @@ export interface UnlockConnectorRequest {
 }
 
 export interface GetConfigurationRequest {
-  key?: string[];
+  key?: string | StandardParametersKey[];
 }
 
 export enum ResetType {