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 DELETE_CHARGING_STATIONS
= 'deleteChargingStations',
37 PERFORMANCE_STATISTICS
= 'performanceStatistics',
38 START_CHARGING_STATION
= 'startChargingStation',
39 STOP_CHARGING_STATION
= 'stopChargingStation',
40 OPEN_CONNECTION
= 'openConnection',
41 CLOSE_CONNECTION
= 'closeConnection',
42 START_AUTOMATIC_TRANSACTION_GENERATOR
= 'startAutomaticTransactionGenerator',
43 STOP_AUTOMATIC_TRANSACTION_GENERATOR
= 'stopAutomaticTransactionGenerator',
44 SET_SUPERVISION_URL
= 'setSupervisionUrl',
45 START_TRANSACTION
= 'startTransaction',
46 STOP_TRANSACTION
= 'stopTransaction',
47 AUTHORIZE
= 'authorize',
48 BOOT_NOTIFICATION
= 'bootNotification',
49 STATUS_NOTIFICATION
= 'statusNotification',
50 HEARTBEAT
= 'heartbeat',
51 METER_VALUES
= 'meterValues',
52 DATA_TRANSFER
= 'dataTransfer',
53 DIAGNOSTICS_STATUS_NOTIFICATION
= 'diagnosticsStatusNotification',
54 FIRMWARE_STATUS_NOTIFICATION
= 'firmwareStatusNotification'
57 export interface RequestPayload
extends JsonObject
{
59 connectorIds
?: number[]
62 export enum ResponseStatus
{
67 export interface ResponsePayload
extends JsonObject
{
68 status: ResponseStatus
69 hashIdsSucceeded
?: string[]
70 hashIdsFailed
?: string[]
71 responsesFailed
?: BroadcastChannelResponsePayload
[]