1 import type { JsonObject
} from
'./JsonType';
2 import type { BroadcastChannelResponsePayload
} from
'./WorkerBroadcastChannel';
8 export enum ApplicationProtocol
{
13 export enum AuthenticationType
{
14 BASIC_AUTH
= 'basic-auth',
17 export enum ProtocolVersion
{
21 export type ProtocolRequest
= [string, ProcedureName
, RequestPayload
];
22 export type ProtocolResponse
= [string, ResponsePayload
];
24 export type ProtocolRequestHandler
= (
26 procedureName
?: ProcedureName
,
27 payload
?: RequestPayload
28 ) => undefined | Promise
<undefined> | ResponsePayload
| Promise
<ResponsePayload
>;
30 export enum ProcedureName
{
31 START_SIMULATOR
= 'startSimulator',
32 STOP_SIMULATOR
= 'stopSimulator',
33 LIST_CHARGING_STATIONS
= 'listChargingStations',
34 START_CHARGING_STATION
= 'startChargingStation',
35 STOP_CHARGING_STATION
= 'stopChargingStation',
36 OPEN_CONNECTION
= 'openConnection',
37 CLOSE_CONNECTION
= 'closeConnection',
38 START_AUTOMATIC_TRANSACTION_GENERATOR
= 'startAutomaticTransactionGenerator',
39 STOP_AUTOMATIC_TRANSACTION_GENERATOR
= 'stopAutomaticTransactionGenerator',
40 START_TRANSACTION
= 'startTransaction',
41 STOP_TRANSACTION
= 'stopTransaction',
42 AUTHORIZE
= 'authorize',
43 BOOT_NOTIFICATION
= 'bootNotification',
44 STATUS_NOTIFICATION
= 'statusNotification',
45 HEARTBEAT
= 'heartbeat',
46 METER_VALUES
= 'meterValues',
47 DATA_TRANSFER
= 'dataTransfer',
48 DIAGNOSTICS_STATUS_NOTIFICATION
= 'diagnosticsStatusNotification',
49 FIRMWARE_STATUS_NOTIFICATION
= 'firmwareStatusNotification',
52 export interface RequestPayload
extends JsonObject
{
54 connectorIds
?: number[];
57 export enum ResponseStatus
{
62 export interface ResponsePayload
extends JsonObject
{
63 status: ResponseStatus
;
64 hashIdsSucceeded
?: string[];
65 hashIdsFailed
?: string[];
66 responsesFailed
?: BroadcastChannelResponsePayload
[];