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',
15 PROTOCOL_BASIC_AUTH
= 'protocol-basic-auth'
18 export enum ProtocolVersion
{
22 export type ProtocolRequest
= [string, ProcedureName
, RequestPayload
]
23 export type ProtocolResponse
= [string, ResponsePayload
]
25 export type ProtocolRequestHandler
= (
27 procedureName
?: ProcedureName
,
28 payload
?: RequestPayload
29 ) => undefined | Promise
<undefined> | ResponsePayload
| Promise
<ResponsePayload
>
31 export enum ProcedureName
{
32 START_SIMULATOR
= 'startSimulator',
33 STOP_SIMULATOR
= 'stopSimulator',
34 LIST_TEMPLATES
= 'listTemplates',
35 LIST_CHARGING_STATIONS
= 'listChargingStations',
36 ADD_CHARGING_STATIONS
= 'addChargingStations',
37 DELETE_CHARGING_STATIONS
= 'deleteChargingStations',
38 PERFORMANCE_STATISTICS
= 'performanceStatistics',
39 START_CHARGING_STATION
= 'startChargingStation',
40 STOP_CHARGING_STATION
= 'stopChargingStation',
41 OPEN_CONNECTION
= 'openConnection',
42 CLOSE_CONNECTION
= 'closeConnection',
43 START_AUTOMATIC_TRANSACTION_GENERATOR
= 'startAutomaticTransactionGenerator',
44 STOP_AUTOMATIC_TRANSACTION_GENERATOR
= 'stopAutomaticTransactionGenerator',
45 SET_SUPERVISION_URL
= 'setSupervisionUrl',
46 START_TRANSACTION
= 'startTransaction',
47 STOP_TRANSACTION
= 'stopTransaction',
48 AUTHORIZE
= 'authorize',
49 BOOT_NOTIFICATION
= 'bootNotification',
50 STATUS_NOTIFICATION
= 'statusNotification',
51 HEARTBEAT
= 'heartbeat',
52 METER_VALUES
= 'meterValues',
53 DATA_TRANSFER
= 'dataTransfer',
54 DIAGNOSTICS_STATUS_NOTIFICATION
= 'diagnosticsStatusNotification',
55 FIRMWARE_STATUS_NOTIFICATION
= 'firmwareStatusNotification'
58 export interface RequestPayload
extends JsonObject
{
60 connectorIds
?: number[]
63 export enum ResponseStatus
{
68 export interface ResponsePayload
extends JsonObject
{
69 status: ResponseStatus
70 hashIdsSucceeded
?: string[]
71 hashIdsFailed
?: string[]
72 responsesFailed
?: BroadcastChannelResponsePayload
[]