Introduce JSON type and use it for OCPP and internal message structure
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Responses.ts
index cf0a84ef750d08cd71e3d75f58ae298805e5066a..7d3487ba1f8bdc4549e2c9f298a9a111bc4c2a71 100644 (file)
@@ -1,6 +1,8 @@
+import { EmptyObject } from '../../EmptyObject';
+import { JsonType } from '../../JsonType';
 import { OCPPConfigurationKey } from '../Configuration';
 
-export interface HeartbeatResponse {
+export interface HeartbeatResponse extends JsonType {
   currentTime: string;
 }
 
@@ -10,7 +12,7 @@ export enum OCPP16UnlockStatus {
   NOT_SUPPORTED = 'NotSupported'
 }
 
-export interface UnlockConnectorResponse {
+export interface UnlockConnectorResponse extends JsonType {
   status: OCPP16UnlockStatus;
 }
 
@@ -21,7 +23,7 @@ export enum OCPP16ConfigurationStatus {
   NOT_SUPPORTED = 'NotSupported'
 }
 
-export interface ChangeConfigurationResponse {
+export interface ChangeConfigurationResponse extends JsonType {
   status: OCPP16ConfigurationStatus;
 }
 
@@ -31,16 +33,15 @@ export enum OCPP16RegistrationStatus {
   REJECTED = 'Rejected'
 }
 
-export interface OCPP16BootNotificationResponse {
+export interface OCPP16BootNotificationResponse extends JsonType {
   status: OCPP16RegistrationStatus;
   currentTime: string;
   interval: number;
 }
 
-// eslint-disable-next-line @typescript-eslint/no-empty-interface
-export interface StatusNotificationResponse {}
+export type StatusNotificationResponse = EmptyObject;
 
-export interface GetConfigurationResponse {
+export interface GetConfigurationResponse extends JsonType {
   configurationKey: OCPPConfigurationKey[];
   unknownKey: string[];
 }
@@ -51,7 +52,7 @@ export enum OCPP16ChargingProfileStatus {
   NOT_SUPPORTED = 'NotSupported',
 }
 
-export interface SetChargingProfileResponse {
+export interface SetChargingProfileResponse extends JsonType {
   status: OCPP16ChargingProfileStatus;
 }
 
@@ -61,7 +62,7 @@ export enum OCPP16AvailabilityStatus {
   SCHEDULED = 'Scheduled'
 }
 
-export interface ChangeAvailabilityResponse {
+export interface ChangeAvailabilityResponse extends JsonType {
   status: OCPP16AvailabilityStatus;
 }
 
@@ -70,16 +71,15 @@ export enum OCPP16ClearChargingProfileStatus {
   UNKNOWN = 'Unknown'
 }
 
-export interface ClearChargingProfileResponse {
+export interface ClearChargingProfileResponse extends JsonType {
   status: OCPP16ClearChargingProfileStatus;
 }
 
-export interface GetDiagnosticsResponse {
+export interface GetDiagnosticsResponse extends JsonType {
   fileName?: string;
 }
 
-// eslint-disable-next-line @typescript-eslint/no-empty-interface
-export interface DiagnosticsStatusNotificationResponse {}
+export type DiagnosticsStatusNotificationResponse = EmptyObject;
 
 export enum OCPP16TriggerMessageStatus {
   ACCEPTED = 'Accepted',
@@ -87,6 +87,6 @@ export enum OCPP16TriggerMessageStatus {
   NOT_IMPLEMENTED = 'NotImplemented'
 }
 
-export interface OCPP16TriggerMessageResponse {
+export interface OCPP16TriggerMessageResponse extends JsonType {
   status: OCPP16TriggerMessageStatus
 }