X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2Focpp%2F1.6%2FResponses.ts;h=a42733e8a2244721451bf109b395f20331898bcc;hb=41f3983a4f934199769f9ef1c46bfae2adc22b56;hp=317926f3fe921be2020dc59ac6c687cea0b7c1bc;hpb=9ccca265277990663dad8ad0573b7c283e221c6f;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/ocpp/1.6/Responses.ts b/src/types/ocpp/1.6/Responses.ts index 317926f3..a42733e8 100644 --- a/src/types/ocpp/1.6/Responses.ts +++ b/src/types/ocpp/1.6/Responses.ts @@ -1,16 +1,20 @@ -import { OCPPConfigurationKey } from '../Configuration'; +import type { OCPP16ChargingSchedule } from './ChargingProfile'; +import type { EmptyObject } from '../../EmptyObject'; +import type { JsonObject } from '../../JsonType'; +import type { GenericStatus, RegistrationStatusEnumType } from '../Common'; +import type { OCPPConfigurationKey } from '../Configuration'; -export interface HeartbeatResponse { - currentTime: string; +export interface OCPP16HeartbeatResponse extends JsonObject { + currentTime: Date; } export enum OCPP16UnlockStatus { UNLOCKED = 'Unlocked', UNLOCK_FAILED = 'UnlockFailed', - NOT_SUPPORTED = 'NotSupported' + NOT_SUPPORTED = 'NotSupported', } -export interface UnlockConnectorResponse { +export interface UnlockConnectorResponse extends JsonObject { status: OCPP16UnlockStatus; } @@ -18,29 +22,22 @@ export enum OCPP16ConfigurationStatus { ACCEPTED = 'Accepted', REJECTED = 'Rejected', REBOOT_REQUIRED = 'RebootRequired', - NOT_SUPPORTED = 'NotSupported' + NOT_SUPPORTED = 'NotSupported', } -export interface ChangeConfigurationResponse { +export interface ChangeConfigurationResponse extends JsonObject { status: OCPP16ConfigurationStatus; } -export enum OCPP16RegistrationStatus { - ACCEPTED = 'Accepted', - PENDING = 'Pending', - REJECTED = 'Rejected' -} - -export interface OCPP16BootNotificationResponse { - status: OCPP16RegistrationStatus; - currentTime: string; +export interface OCPP16BootNotificationResponse extends JsonObject { + status: RegistrationStatusEnumType; + currentTime: Date; interval: number; } -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface StatusNotificationResponse {} +export type OCPP16StatusNotificationResponse = EmptyObject; -export interface GetConfigurationResponse { +export interface GetConfigurationResponse extends JsonObject { configurationKey: OCPPConfigurationKey[]; unknownKey: string[]; } @@ -51,25 +48,77 @@ export enum OCPP16ChargingProfileStatus { NOT_SUPPORTED = 'NotSupported', } -export interface SetChargingProfileResponse { +export interface OCPP16GetCompositeScheduleResponse extends JsonObject { + status: GenericStatus; + connectorId?: number; + scheduleStart?: Date; + chargingSchedule?: OCPP16ChargingSchedule; +} + +export interface SetChargingProfileResponse extends JsonObject { status: OCPP16ChargingProfileStatus; } export enum OCPP16AvailabilityStatus { ACCEPTED = 'Accepted', REJECTED = 'Rejected', - SCHEDULED = 'Scheduled' + SCHEDULED = 'Scheduled', } -export interface ChangeAvailabilityResponse { +export interface OCPP16ChangeAvailabilityResponse extends JsonObject { status: OCPP16AvailabilityStatus; } export enum OCPP16ClearChargingProfileStatus { ACCEPTED = 'Accepted', - UNKNOWN = 'Unknown' + UNKNOWN = 'Unknown', } -export interface ClearChargingProfileResponse { +export interface OCPP16ClearChargingProfileResponse extends JsonObject { status: OCPP16ClearChargingProfileStatus; } + +export type OCPP16UpdateFirmwareResponse = EmptyObject; + +export type OCPP16FirmwareStatusNotificationResponse = EmptyObject; + +export interface GetDiagnosticsResponse extends JsonObject { + fileName?: string; +} + +export type OCPP16DiagnosticsStatusNotificationResponse = EmptyObject; + +export enum OCPP16TriggerMessageStatus { + ACCEPTED = 'Accepted', + REJECTED = 'Rejected', + NOT_IMPLEMENTED = 'NotImplemented', +} + +export interface OCPP16TriggerMessageResponse extends JsonObject { + status: OCPP16TriggerMessageStatus; +} + +export enum OCPP16DataTransferStatus { + ACCEPTED = 'Accepted', + REJECTED = 'Rejected', + UNKNOWN_MESSAGE_ID = 'UnknownMessageId', + UNKNOWN_VENDOR_ID = 'UnknownVendorId', +} + +export interface OCPP16DataTransferResponse extends JsonObject { + status: OCPP16DataTransferStatus; + data?: string; +} + +export enum OCPP16ReservationStatus { + ACCEPTED = 'Accepted', + FAULTED = 'Faulted', + OCCUPIED = 'Occupied', + REJECTED = 'Rejected', + UNAVAILABLE = 'Unavailable', + NOT_SUPPORTED = 'NotSupported', +} + +export interface OCPP16ReserveNowResponse extends JsonObject { + status: OCPP16ReservationStatus; +}