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