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