| 1 | import type { |
| 2 | EmptyObject, |
| 3 | JsonObject, |
| 4 | OCPP16ChargePointErrorCode, |
| 5 | OCPP16ChargePointStatus, |
| 6 | OCPP16ChargingProfile, |
| 7 | OCPP16ChargingProfilePurposeType, |
| 8 | OCPP16ChargingRateUnitType, |
| 9 | OCPP16DiagnosticsStatus, |
| 10 | OCPP16StandardParametersKey, |
| 11 | OCPP16VendorParametersKey, |
| 12 | } from '../../internal'; |
| 13 | |
| 14 | export enum OCPP16RequestCommand { |
| 15 | BOOT_NOTIFICATION = 'BootNotification', |
| 16 | HEARTBEAT = 'Heartbeat', |
| 17 | STATUS_NOTIFICATION = 'StatusNotification', |
| 18 | AUTHORIZE = 'Authorize', |
| 19 | START_TRANSACTION = 'StartTransaction', |
| 20 | STOP_TRANSACTION = 'StopTransaction', |
| 21 | METER_VALUES = 'MeterValues', |
| 22 | DIAGNOSTICS_STATUS_NOTIFICATION = 'DiagnosticsStatusNotification', |
| 23 | FIRMWARE_STATUS_NOTIFICATION = 'FirmwareStatusNotification', |
| 24 | DATA_TRANSFER = 'DataTransfer', |
| 25 | } |
| 26 | |
| 27 | export enum OCPP16IncomingRequestCommand { |
| 28 | RESET = 'Reset', |
| 29 | CLEAR_CACHE = 'ClearCache', |
| 30 | CHANGE_AVAILABILITY = 'ChangeAvailability', |
| 31 | UNLOCK_CONNECTOR = 'UnlockConnector', |
| 32 | GET_CONFIGURATION = 'GetConfiguration', |
| 33 | CHANGE_CONFIGURATION = 'ChangeConfiguration', |
| 34 | GET_COMPOSITE_SCHEDULE = 'GetCompositeSchedule', |
| 35 | SET_CHARGING_PROFILE = 'SetChargingProfile', |
| 36 | CLEAR_CHARGING_PROFILE = 'ClearChargingProfile', |
| 37 | REMOTE_START_TRANSACTION = 'RemoteStartTransaction', |
| 38 | REMOTE_STOP_TRANSACTION = 'RemoteStopTransaction', |
| 39 | GET_DIAGNOSTICS = 'GetDiagnostics', |
| 40 | TRIGGER_MESSAGE = 'TriggerMessage', |
| 41 | DATA_TRANSFER = 'DataTransfer', |
| 42 | UPDATE_FIRMWARE = 'UpdateFirmware', |
| 43 | } |
| 44 | |
| 45 | export type OCPP16HeartbeatRequest = EmptyObject; |
| 46 | |
| 47 | export interface OCPP16BootNotificationRequest extends JsonObject { |
| 48 | chargePointVendor: string; |
| 49 | chargePointModel: string; |
| 50 | chargePointSerialNumber?: string; |
| 51 | chargeBoxSerialNumber?: string; |
| 52 | firmwareVersion?: string; |
| 53 | iccid?: string; |
| 54 | imsi?: string; |
| 55 | meterType?: string; |
| 56 | meterSerialNumber?: string; |
| 57 | } |
| 58 | |
| 59 | export interface OCPP16StatusNotificationRequest extends JsonObject { |
| 60 | connectorId: number; |
| 61 | errorCode: OCPP16ChargePointErrorCode; |
| 62 | status: OCPP16ChargePointStatus; |
| 63 | info?: string; |
| 64 | timestamp?: Date; |
| 65 | vendorId?: string; |
| 66 | vendorErrorCode?: string; |
| 67 | } |
| 68 | |
| 69 | export type OCPP16ClearCacheRequest = EmptyObject; |
| 70 | |
| 71 | type OCPP16ConfigurationKey = string | OCPP16StandardParametersKey | OCPP16VendorParametersKey; |
| 72 | |
| 73 | export interface ChangeConfigurationRequest extends JsonObject { |
| 74 | key: OCPP16ConfigurationKey; |
| 75 | value: string; |
| 76 | } |
| 77 | |
| 78 | export interface RemoteStartTransactionRequest extends JsonObject { |
| 79 | connectorId: number; |
| 80 | idTag: string; |
| 81 | chargingProfile?: OCPP16ChargingProfile; |
| 82 | } |
| 83 | |
| 84 | export interface RemoteStopTransactionRequest extends JsonObject { |
| 85 | transactionId: number; |
| 86 | } |
| 87 | |
| 88 | export interface UnlockConnectorRequest extends JsonObject { |
| 89 | connectorId: number; |
| 90 | } |
| 91 | |
| 92 | export interface GetConfigurationRequest extends JsonObject { |
| 93 | key?: OCPP16ConfigurationKey[]; |
| 94 | } |
| 95 | |
| 96 | enum ResetType { |
| 97 | HARD = 'Hard', |
| 98 | SOFT = 'Soft', |
| 99 | } |
| 100 | |
| 101 | export interface ResetRequest extends JsonObject { |
| 102 | type: ResetType; |
| 103 | } |
| 104 | |
| 105 | export interface OCPP16GetCompositeScheduleRequest extends JsonObject { |
| 106 | connectorId: number; |
| 107 | duration: number; |
| 108 | chargingRateUnit?: OCPP16ChargingRateUnitType; |
| 109 | } |
| 110 | |
| 111 | export interface SetChargingProfileRequest extends JsonObject { |
| 112 | connectorId: number; |
| 113 | csChargingProfiles: OCPP16ChargingProfile; |
| 114 | } |
| 115 | |
| 116 | export enum OCPP16AvailabilityType { |
| 117 | INOPERATIVE = 'Inoperative', |
| 118 | OPERATIVE = 'Operative', |
| 119 | } |
| 120 | |
| 121 | export interface ChangeAvailabilityRequest extends JsonObject { |
| 122 | connectorId: number; |
| 123 | type: OCPP16AvailabilityType; |
| 124 | } |
| 125 | |
| 126 | export interface ClearChargingProfileRequest extends JsonObject { |
| 127 | id?: number; |
| 128 | connectorId?: number; |
| 129 | chargingProfilePurpose?: OCPP16ChargingProfilePurposeType; |
| 130 | stackLevel?: number; |
| 131 | } |
| 132 | |
| 133 | export interface OCPP16UpdateFirmwareRequest extends JsonObject { |
| 134 | location: string; |
| 135 | retrieveDate: Date; |
| 136 | retries?: number; |
| 137 | retryInterval?: number; |
| 138 | } |
| 139 | |
| 140 | export enum OCPP16FirmwareStatus { |
| 141 | Downloaded = 'Downloaded', |
| 142 | DownloadFailed = 'DownloadFailed', |
| 143 | Downloading = 'Downloading', |
| 144 | Idle = 'Idle', |
| 145 | InstallationFailed = 'InstallationFailed', |
| 146 | Installing = 'Installing', |
| 147 | Installed = 'Installed', |
| 148 | } |
| 149 | |
| 150 | export type OCPP16FirmwareStatusNotificationRequest = { |
| 151 | status: OCPP16FirmwareStatus; |
| 152 | } & JsonObject; |
| 153 | |
| 154 | export interface GetDiagnosticsRequest extends JsonObject { |
| 155 | location: string; |
| 156 | retries?: number; |
| 157 | retryInterval?: number; |
| 158 | startTime?: Date; |
| 159 | stopTime?: Date; |
| 160 | } |
| 161 | |
| 162 | export interface OCPP16DiagnosticsStatusNotificationRequest extends JsonObject { |
| 163 | status: OCPP16DiagnosticsStatus; |
| 164 | } |
| 165 | |
| 166 | export enum OCPP16MessageTrigger { |
| 167 | BootNotification = 'BootNotification', |
| 168 | DiagnosticsStatusNotification = 'DiagnosticsStatusNotification', |
| 169 | FirmwareStatusNotification = 'FirmwareStatusNotification', |
| 170 | Heartbeat = 'Heartbeat', |
| 171 | MeterValues = 'MeterValues', |
| 172 | StatusNotification = 'StatusNotification', |
| 173 | } |
| 174 | |
| 175 | export interface OCPP16TriggerMessageRequest extends JsonObject { |
| 176 | requestedMessage: OCPP16MessageTrigger; |
| 177 | connectorId?: number; |
| 178 | } |
| 179 | |
| 180 | export enum OCPP16DataTransferVendorId {} |
| 181 | |
| 182 | export interface OCPP16DataTransferRequest extends JsonObject { |
| 183 | vendorId: string; |
| 184 | messageId?: string; |
| 185 | data?: string; |
| 186 | } |