1 import type { JsonObject
} from
'./JsonType.js'
2 import type { BroadcastChannelResponsePayload
} from
'./WorkerBroadcastChannel.js'
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_TEMPLATES
= 'listTemplates',
34 LIST_CHARGING_STATIONS
= 'listChargingStations',
35 ADD_CHARGING_STATIONS
= 'addChargingStations',
36 START_CHARGING_STATION
= 'startChargingStation',
37 STOP_CHARGING_STATION
= 'stopChargingStation',
38 OPEN_CONNECTION
= 'openConnection',
39 CLOSE_CONNECTION
= 'closeConnection',
40 START_AUTOMATIC_TRANSACTION_GENERATOR
= 'startAutomaticTransactionGenerator',
41 STOP_AUTOMATIC_TRANSACTION_GENERATOR
= 'stopAutomaticTransactionGenerator',
42 SET_SUPERVISION_URL
= 'setSupervisionUrl',
43 START_TRANSACTION
= 'startTransaction',
44 STOP_TRANSACTION
= 'stopTransaction',
45 AUTHORIZE
= 'authorize',
46 BOOT_NOTIFICATION
= 'bootNotification',
47 STATUS_NOTIFICATION
= 'statusNotification',
48 HEARTBEAT
= 'heartbeat',
49 METER_VALUES
= 'meterValues',
50 DATA_TRANSFER
= 'dataTransfer',
51 DIAGNOSTICS_STATUS_NOTIFICATION
= 'diagnosticsStatusNotification',
52 FIRMWARE_STATUS_NOTIFICATION
= 'firmwareStatusNotification'
55 export interface RequestPayload
extends JsonObject
{
57 connectorIds
?: number[]
60 export enum ResponseStatus
{
65 export interface ResponsePayload
extends JsonObject
{
66 status: ResponseStatus
67 hashIdsSucceeded
?: string[]
68 hashIdsFailed
?: string[]
69 responsesFailed
?: BroadcastChannelResponsePayload
[]