feat: add `deleteChargingStations` SRPC command to UI Services
[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,
5 BroadcastChannelProcedureName,
6 BroadcastChannelRequestPayload
7 ]
8 export type BroadcastChannelResponse = [string, BroadcastChannelResponsePayload]
9
10 export enum BroadcastChannelProcedureName {
11 START_CHARGING_STATION = 'startChargingStation',
12 STOP_CHARGING_STATION = 'stopChargingStation',
13 DELETE_CHARGING_STATIONS = 'deleteChargingStations',
14 OPEN_CONNECTION = 'openConnection',
15 CLOSE_CONNECTION = 'closeConnection',
16 START_AUTOMATIC_TRANSACTION_GENERATOR = 'startAutomaticTransactionGenerator',
17 STOP_AUTOMATIC_TRANSACTION_GENERATOR = 'stopAutomaticTransactionGenerator',
18 SET_SUPERVISION_URL = 'setSupervisionUrl',
19 START_TRANSACTION = 'startTransaction',
20 STOP_TRANSACTION = 'stopTransaction',
21 AUTHORIZE = 'authorize',
22 BOOT_NOTIFICATION = 'bootNotification',
23 STATUS_NOTIFICATION = 'statusNotification',
24 HEARTBEAT = 'heartbeat',
25 METER_VALUES = 'meterValues',
26 DATA_TRANSFER = 'dataTransfer',
27 DIAGNOSTICS_STATUS_NOTIFICATION = 'diagnosticsStatusNotification',
28 FIRMWARE_STATUS_NOTIFICATION = 'firmwareStatusNotification'
29 }
30
31 export interface BroadcastChannelRequestPayload extends RequestPayload {
32 connectorId?: number
33 transactionId?: number
34 }
35
36 export interface BroadcastChannelResponsePayload
37 extends Omit<ResponsePayload, 'hashIdsSucceeded' | 'hashIdsFailed' | 'responsesFailed'> {
38 hashId: string | undefined
39 }
40
41 export interface MessageEvent {
42 data: BroadcastChannelRequest | BroadcastChannelResponse
43 }