X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Ftypes%2Focpp%2F1.6%2FResponses.ts;h=f1e8b0e2699e68303ff92231c36db147bff914ba;hb=68220b423c52da387fdf41967dd8c738da0ff52e;hp=68df3e91090ac8c6e2e380962c1d49e98e7596c9;hpb=6ce0bca57a96ef920df4e0786d8f28b0b89a36ef;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 68df3e91..f1e8b0e2 100644 --- a/src/types/ocpp/1.6/Responses.ts +++ b/src/types/ocpp/1.6/Responses.ts @@ -1,48 +1,45 @@ -import { OCPPConfigurationKey } from '../Configuration'; - -export interface HeartbeatResponse { - currentTime: string; +import type { OCPP16ChargingSchedule } from './ChargingProfile.js' +import type { EmptyObject } from '../../EmptyObject.js' +import type { JsonObject } from '../../JsonType.js' +import type { GenericStatus, RegistrationStatusEnumType } from '../Common.js' +import type { OCPPConfigurationKey } from '../Configuration.js' + +export interface OCPP16HeartbeatResponse extends JsonObject { + currentTime: Date } export enum OCPP16UnlockStatus { UNLOCKED = 'Unlocked', UNLOCK_FAILED = 'UnlockFailed', - NOT_SUPPORTED = 'NotSupported' + NOT_SUPPORTED = 'NotSupported', } -export interface UnlockConnectorResponse { - status: OCPP16UnlockStatus; +export interface UnlockConnectorResponse extends JsonObject { + status: OCPP16UnlockStatus } export enum OCPP16ConfigurationStatus { ACCEPTED = 'Accepted', REJECTED = 'Rejected', REBOOT_REQUIRED = 'RebootRequired', - NOT_SUPPORTED = 'NotSupported' -} - -export interface ChangeConfigurationResponse { - status: OCPP16ConfigurationStatus; + NOT_SUPPORTED = 'NotSupported', } -export enum OCPP16RegistrationStatus { - ACCEPTED = 'Accepted', - PENDING = 'Pending', - REJECTED = 'Rejected' +export interface ChangeConfigurationResponse extends JsonObject { + status: OCPP16ConfigurationStatus } -export interface OCPP16BootNotificationResponse { - status: OCPP16RegistrationStatus; - currentTime: string; - interval: number; +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 { - configurationKey: OCPPConfigurationKey[]; - unknownKey: string[]; +export interface GetConfigurationResponse extends JsonObject { + configurationKey: OCPPConfigurationKey[] + unknownKey: string[] } export enum OCPP16ChargingProfileStatus { @@ -51,32 +48,77 @@ export enum OCPP16ChargingProfileStatus { NOT_SUPPORTED = 'NotSupported', } -export interface SetChargingProfileResponse { - status: OCPP16ChargingProfileStatus; +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 { - status: OCPP16AvailabilityStatus; +export interface OCPP16ChangeAvailabilityResponse extends JsonObject { + status: OCPP16AvailabilityStatus } export enum OCPP16ClearChargingProfileStatus { ACCEPTED = 'Accepted', - UNKNOWN = 'Unknown' + UNKNOWN = 'Unknown', } -export interface ClearChargingProfileResponse { - status: OCPP16ClearChargingProfileStatus; +export interface OCPP16ClearChargingProfileResponse extends JsonObject { + status: OCPP16ClearChargingProfileStatus } -export interface GetDiagnosticsResponse { - fileName?: string; +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', } -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface DiagnosticsStatusNotificationResponse {} +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 +}