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
= [
23 `${string}-${string}-${string}-${string}-${string}`,
27 export type ProtocolResponse
= [
28 `${string}-${string}-${string}-${string}-${string}`,
32 export type ProtocolRequestHandler
= (
33 uuid
?: `${string}-${string}-${string}-${string}-${string}`,
34 procedureName
?: ProcedureName
,
35 payload
?: RequestPayload
36 ) => undefined | Promise
<undefined> | ResponsePayload
| Promise
<ResponsePayload
>
38 export enum ProcedureName
{
39 SIMULATOR_STATE
= 'simulatorState',
40 START_SIMULATOR
= 'startSimulator',
41 STOP_SIMULATOR
= 'stopSimulator',
42 LIST_TEMPLATES
= 'listTemplates',
43 LIST_CHARGING_STATIONS
= 'listChargingStations',
44 ADD_CHARGING_STATIONS
= 'addChargingStations',
45 DELETE_CHARGING_STATIONS
= 'deleteChargingStations',
46 PERFORMANCE_STATISTICS
= 'performanceStatistics',
47 START_CHARGING_STATION
= 'startChargingStation',
48 STOP_CHARGING_STATION
= 'stopChargingStation',
49 OPEN_CONNECTION
= 'openConnection',
50 CLOSE_CONNECTION
= 'closeConnection',
51 START_AUTOMATIC_TRANSACTION_GENERATOR
= 'startAutomaticTransactionGenerator',
52 STOP_AUTOMATIC_TRANSACTION_GENERATOR
= 'stopAutomaticTransactionGenerator',
53 SET_SUPERVISION_URL
= 'setSupervisionUrl',
54 START_TRANSACTION
= 'startTransaction',
55 STOP_TRANSACTION
= 'stopTransaction',
56 AUTHORIZE
= 'authorize',
57 BOOT_NOTIFICATION
= 'bootNotification',
58 STATUS_NOTIFICATION
= 'statusNotification',
59 HEARTBEAT
= 'heartbeat',
60 METER_VALUES
= 'meterValues',
61 DATA_TRANSFER
= 'dataTransfer',
62 DIAGNOSTICS_STATUS_NOTIFICATION
= 'diagnosticsStatusNotification',
63 FIRMWARE_STATUS_NOTIFICATION
= 'firmwareStatusNotification'
66 export interface RequestPayload
extends JsonObject
{
68 connectorIds
?: number[]
71 export enum ResponseStatus
{
76 export interface ResponsePayload
extends JsonObject
{
77 status: ResponseStatus
78 hashIdsSucceeded
?: string[]
79 hashIdsFailed
?: string[]
80 responsesFailed
?: BroadcastChannelResponsePayload
[]