build(deps-dev): apply updates
[e-mobility-charging-stations-simulator.git] / src / types / WorkerBroadcastChannel.ts
1 import type { RequestPayload, ResponsePayload } from './UIProtocol.js'
2
3 export type BroadcastChannelRequest = [
4 `${string}-${string}-${string}-${string}-${string}`,
5 BroadcastChannelProcedureName,
6 BroadcastChannelRequestPayload
7 ]
8 export type BroadcastChannelResponse = [
9 `${string}-${string}-${string}-${string}-${string}`,
10 BroadcastChannelResponsePayload
11 ]
12
13 export enum BroadcastChannelProcedureName {
14 START_CHARGING_STATION = 'startChargingStation',
15 STOP_CHARGING_STATION = 'stopChargingStation',
16 DELETE_CHARGING_STATIONS = 'deleteChargingStations',
17 OPEN_CONNECTION = 'openConnection',
18 CLOSE_CONNECTION = 'closeConnection',
19 START_AUTOMATIC_TRANSACTION_GENERATOR = 'startAutomaticTransactionGenerator',
20 STOP_AUTOMATIC_TRANSACTION_GENERATOR = 'stopAutomaticTransactionGenerator',
21 SET_SUPERVISION_URL = 'setSupervisionUrl',
22 START_TRANSACTION = 'startTransaction',
23 STOP_TRANSACTION = 'stopTransaction',
24 AUTHORIZE = 'authorize',
25 BOOT_NOTIFICATION = 'bootNotification',
26 STATUS_NOTIFICATION = 'statusNotification',
27 HEARTBEAT = 'heartbeat',
28 METER_VALUES = 'meterValues',
29 DATA_TRANSFER = 'dataTransfer',
30 DIAGNOSTICS_STATUS_NOTIFICATION = 'diagnosticsStatusNotification',
31 FIRMWARE_STATUS_NOTIFICATION = 'firmwareStatusNotification'
32 }
33
34 export interface BroadcastChannelRequestPayload extends RequestPayload {
35 connectorId?: number
36 transactionId?: number
37 }
38
39 export interface BroadcastChannelResponsePayload
40 extends Omit<ResponsePayload, 'hashIdsSucceeded' | 'hashIdsFailed' | 'responsesFailed'> {
41 hashId: string | undefined
42 }
43
44 export interface MessageEvent {
45 data: BroadcastChannelRequest | BroadcastChannelResponse
46 }