refactor(simulator): add type shorcuts for OCPP configuration keys
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 2.0 / Variables.ts
CommitLineData
28f1c574
JB
1import type { EVSEType, JsonObject, StatusInfoType } from '../../internal';
2
3enum OCPP20ComponentName {
857d8dd9
JB
4 AlignedDataCtrlr = 'AlignedDataCtrlr',
5 AuthCacheCtrlr = 'AuthCacheCtrlr',
6 AuthCtrlr = 'AuthCtrlr',
7 CHAdeMOCtrlr = 'CHAdeMOCtrlr',
8 ClockCtrlr = 'ClockCtrlr',
9 CustomizationCtrlr = 'CustomizationCtrlr',
10 DeviceDataCtrlr = 'DeviceDataCtrlr',
11 DisplayMessageCtrlr = 'DisplayMessageCtrlr',
12 ISO15118Ctrlr = 'ISO15118Ctrlr',
13 LocalAuthListCtrlr = 'LocalAuthListCtrlr',
14 MonitoringCtrlr = 'MonitoringCtrlr',
15 OCPPCommCtrlr = 'OCPPCommCtrlr',
16 ReservationCtrlr = 'ReservationCtrlr',
17 SampledDataCtrlr = 'SampledDataCtrlr',
18 SecurityCtrlr = 'SecurityCtrlr',
19 SmartChargingCtrlr = 'SmartChargingCtrlr',
20 TariffCostCtrlr = 'TariffCostCtrlr',
21 TxCtrlr = 'TxCtrlr',
22}
23
24export enum OCPP20RequiredVariableName {
25 MessageTimeout = 'MessageTimeout',
26 FileTransferProtocols = 'FileTransferProtocols',
27 NetworkConfigurationPriority = 'NetworkConfigurationPriority',
28 NetworkProfileConnectionAttempts = 'NetworkProfileConnectionAttempts',
29 OfflineThreshold = 'OfflineThreshold',
30 MessageAttempts = 'TransactionEvent',
31 MessageAttemptInterval = 'MessageAttemptInterval',
32 UnlockOnEVSideDisconnect = 'UnlockOnEVSideDisconnect',
33 ResetRetries = 'ResetRetries',
34 ItemsPerMessage = 'ItemsPerMessage',
35 BytesPerMessage = 'BytesPerMessage',
36 DateTime = 'DateTime',
37 TimeSource = 'TimeSource',
38 OrganizationName = 'OrganizationName',
39 CertificateEntries = 'CertificateEntries',
40 SecurityProfile = 'SecurityProfile',
41 AuthorizeRemoteStart = 'AuthorizeRemoteStart',
42 LocalAuthorizeOffline = 'LocalAuthorizeOffline',
43 LocalPreAuthorize = 'LocalPreAuthorize',
44 EVConnectionTimeOut = 'EVConnectionTimeOut',
45 StopTxOnEVSideDisconnect = 'StopTxOnEVSideDisconnect',
46 TxStartPoint = 'TxStartPoint',
47 TxStopPoint = 'TxStopPoint',
48 StopTxOnInvalidId = 'StopTxOnInvalidId',
49 TxEndedMeasurands = 'TxEndedMeasurands',
50 TxStartedMeasurands = 'TxStartedMeasurands',
51 TxUpdatedMeasurands = 'TxUpdatedMeasurands',
52 TxUpdatedInterval = 'TxUpdatedInterval',
53}
54
55export enum OCPP20OptionalVariableName {
56 HeartbeatInterval = 'HeartbeatInterval',
57 WebSocketPingInterval = 'WebSocketPingInterval',
58}
59
60export enum OCPP20VendorVariableName {
61 ConnectionUrl = 'ConnectionUrl',
62}
28f1c574
JB
63
64enum AttributeEnumType {
65 Actual = 'Actual',
66 Target = 'Target',
67 MinSet = 'MinSet',
68 MaxSet = 'MaxSet',
69}
70
71type ComponentType = {
72 name: string | OCPP20ComponentName;
73 instance?: string;
74 evse?: EVSEType;
75} & JsonObject;
76
6dad8e21
JB
77type VariableName =
78 | string
79 | OCPP20RequiredVariableName
80 | OCPP20OptionalVariableName
81 | OCPP20VendorVariableName;
82
28f1c574 83type VariableType = {
6dad8e21 84 name: VariableName;
28f1c574
JB
85 instance?: string;
86} & JsonObject;
87
88export type OCPP20SetVariableDataType = {
89 attributeType?: AttributeEnumType;
90 attributeValue: string;
91 component: ComponentType;
92 variable: VariableType;
93} & JsonObject;
94
95enum SetVariableStatusEnumType {
96 Accepted = 'Accepted',
97 Rejected = 'Rejected',
98 UnknownComponent = 'UnknownComponent',
99 UnknownVariable = 'UnknownVariable',
100 NotSupportedAttributeType = 'NotSupportedAttributeType',
101 RebootRequired = 'RebootRequired',
102}
103
104export type OCPP20SetVariableResultType = {
105 attributeType?: AttributeEnumType;
106 attributeStatus: SetVariableStatusEnumType;
107 component: ComponentType;
108 variable: VariableType;
109 attributeStatusInfo?: StatusInfoType;
110} & JsonObject;
111
112type OCPP20ComponentVariableType = {
113 component: ComponentType;
114 variable?: VariableType;
115} & JsonObject;