Merge pull request #6 from LucasBrazi06/memory-optimization
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Requests.ts
index bbcf5145e321cd560b92b92e68241de9fdfbeedb..e7e662233aecb7ff6d4176111fd213aeaad30d37 100644 (file)
@@ -1,17 +1,14 @@
 import { ChargePointErrorCode } from './ChargePointErrorCode';
 import { ChargePointStatus } from './ChargePointStatus';
 import { ChargingProfile } from './ChargingProfile';
-import OCPPError from '../../../charging-station/OcppError';
-
-export default interface Requests {
-  [id: string]: [(payload?, requestPayload?) => void, (error?: OCPPError) => void, Record<string, unknown>];
-}
+import { StandardParametersKey } from './Configuration';
 
 export enum RequestCommand {
   BOOT_NOTIFICATION = 'BootNotification',
   HEARTBEAT = 'Heartbeat',
   STATUS_NOTIFICATION = 'StatusNotification',
   CHANGE_CONFIGURATION = 'ChangeConfiguration',
+  AUTHORIZE = 'Authorize',
   START_TRANSACTION = 'StartTransaction',
   STOP_TRANSACTION = 'StopTransaction',
   METERVALUES = 'MeterValues'
@@ -20,6 +17,7 @@ export enum RequestCommand {
 export enum IncomingRequestCommand {
   RESET = 'Reset',
   CLEAR_CACHE = 'ClearCache',
+  CHANGE_AVAILABILITY = 'ChangeAvailability',
   UNLOCK_CONNECTOR = 'UnlockConnector',
   GET_CONFIGURATION = 'GetConfiguration',
   CHANGE_CONFIGURATION = 'ChangeConfiguration',
@@ -29,7 +27,7 @@ export enum IncomingRequestCommand {
 }
 
 // eslint-disable-next-line @typescript-eslint/no-empty-interface
-export interface HeartbeatRequest {}
+export interface HeartbeatRequest { }
 
 export interface BootNotificationRequest {
   chargeBoxSerialNumber?: string;
@@ -54,7 +52,7 @@ export interface StatusNotificationRequest {
 }
 
 export interface ChangeConfigurationRequest {
-  key: string;
+  key: string | StandardParametersKey;
   value: string;
 }
 
@@ -73,7 +71,7 @@ export interface UnlockConnectorRequest {
 }
 
 export interface GetConfigurationRequest {
-  key?: string[];
+  key?: string | StandardParametersKey[];
 }
 
 export enum ResetType {
@@ -89,3 +87,13 @@ export interface SetChargingProfileRequest {
   connectorId: number;
   csChargingProfiles: ChargingProfile;
 }
+
+export enum AvailabilityType {
+  INOPERATIVE = 'Inoperative',
+  OPERATIVE = 'Operative'
+}
+
+export interface ChangeAvailabilityRequest {
+  connectorId: number;
+  type: AvailabilityType;
+}