refactor: refine type definitions
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 2.0 / Common.ts
CommitLineData
66a7748d
JB
1import type { JsonObject } from '../../JsonType.js'
2import type { GenericStatus } from '../Common.js'
6b635033
JB
3
4export enum DataEnumType {
6b635033
JB
5 string = 'string',
6 decimal = 'decimal',
7 integer = 'integer',
8 dateTime = 'dateTime',
6b635033
JB
9 boolean = 'boolean',
10 OptionList = 'OptionList',
11 SequenceList = 'SequenceList',
a223d9be 12 MemberList = 'MemberList'
6b635033 13}
28f1c574
JB
14
15export enum BootReasonEnumType {
16 ApplicationReset = 'ApplicationReset',
17 FirmwareUpdate = 'FirmwareUpdate',
18 LocalReset = 'LocalReset',
19 PowerUp = 'PowerUp',
20 RemoteReset = 'RemoteReset',
21 ScheduledReset = 'ScheduledReset',
22 Triggered = 'Triggered',
23 Unknown = 'Unknown',
a223d9be 24 Watchdog = 'Watchdog'
28f1c574
JB
25}
26
2585c6e9
JB
27export enum OperationalStatusEnumType {
28 Operative = 'Operative',
a223d9be 29 Inoperative = 'Inoperative'
2585c6e9
JB
30}
31
28f1c574 32export enum OCPP20ConnectorStatusEnumType {
721646e9
JB
33 Available = 'Available',
34 Occupied = 'Occupied',
35 Reserved = 'Reserved',
36 Unavailable = 'Unavailable',
a223d9be 37 Faulted = 'Faulted'
28f1c574
JB
38}
39
66a7748d 40export type GenericStatusEnumType = GenericStatus
6b635033
JB
41
42export enum HashAlgorithmEnumType {
43 SHA256 = 'SHA256',
44 SHA384 = 'SHA384',
a223d9be 45 SHA512 = 'SHA512'
6b635033
JB
46}
47
48export enum GetCertificateIdUseEnumType {
49 V2GRootCertificate = 'V2GRootCertificate',
50 MORootCertificate = 'MORootCertificate',
51 CSMSRootCertificate = 'CSMSRootCertificate',
52 V2GCertificateChain = 'V2GCertificateChain',
a223d9be 53 ManufacturerRootCertificate = 'ManufacturerRootCertificate'
6b635033
JB
54}
55
56export enum GetCertificateStatusEnumType {
57 Accepted = 'Accepted',
a223d9be 58 Failed = 'Failed'
6b635033
JB
59}
60
61export enum GetInstalledCertificateStatusEnumType {
62 Accepted = 'Accepted',
a223d9be 63 NotFound = 'NotFound'
6b635033
JB
64}
65
66export enum InstallCertificateStatusEnumType {
67 Accepted = 'Accepted',
68 Rejected = 'Rejected',
a223d9be 69 Failed = 'Failed'
6b635033
JB
70}
71
72export enum InstallCertificateUseEnumType {
73 V2GRootCertificate = 'V2GRootCertificate',
74 MORootCertificate = 'MORootCertificate',
75 CSMSRootCertificate = 'CSMSRootCertificate',
a223d9be 76 ManufacturerRootCertificate = 'ManufacturerRootCertificate'
6b635033
JB
77}
78
79export enum DeleteCertificateStatusEnumType {
80 Accepted = 'Accepted',
81 Failed = 'Failed',
a223d9be 82 NotFound = 'NotFound'
6b635033
JB
83}
84
85export enum CertificateActionEnumType {
86 Install = 'Install',
a223d9be 87 Update = 'Update'
6b635033
JB
88}
89
90export enum CertificateSigningUseEnumType {
91 ChargingStationCertificate = 'ChargingStationCertificate',
a223d9be 92 V2GCertificate = 'V2GCertificate'
6b635033
JB
93}
94
66a7748d 95export type CertificateSignedStatusEnumType = GenericStatusEnumType
6b635033 96
f4b3f35d 97export interface CertificateHashDataType extends JsonObject {
66a7748d
JB
98 hashAlgorithm: HashAlgorithmEnumType
99 issuerNameHash: string
100 issuerKeyHash: string
101 serialNumber: string
f4b3f35d 102}
6b635033 103
f4b3f35d 104export interface CertificateHashDataChainType extends JsonObject {
66a7748d
JB
105 certificateType: GetCertificateIdUseEnumType
106 certificateHashData: CertificateHashDataType
107 childCertificateHashData?: CertificateHashDataType
f4b3f35d 108}
6b635033 109
f4b3f35d 110export interface OCSPRequestDataType extends JsonObject {
66a7748d
JB
111 hashAlgorithm: HashAlgorithmEnumType
112 issuerNameHash: string
113 issuerKeyHash: string
114 serialNumber: string
115 responderURL: string
f4b3f35d 116}
6b635033 117
f4b3f35d 118export interface StatusInfoType extends JsonObject {
66a7748d
JB
119 reasonCode: string
120 additionalInfo?: string
f4b3f35d 121}
28f1c574 122
f4b3f35d 123export interface EVSEType extends JsonObject {
66a7748d
JB
124 id: number
125 connectorId?: string
f4b3f35d 126}