feat: add configuration cache
[e-mobility-charging-stations-simulator.git] / src / types / ChargingStationTemplate.ts
index 200307ab2758eab00b0ce911b892708efe362fb2..7807837573fac8aed4fcbef66dcd73a9023cb180 100644 (file)
@@ -2,18 +2,18 @@ import type { ClientRequestArgs } from 'node:http';
 
 import type { ClientOptions } from 'ws';
 
+import type { AutomaticTransactionGeneratorConfiguration } from './AutomaticTransactionGenerator';
+import type { ChargingStationOcppConfiguration } from './ChargingStationOcppConfiguration';
+import type { ConnectorStatus } from './ConnectorStatus';
+import type { EvseTemplate } from './Evse';
+import type { OCPPProtocol } from './ocpp/OCPPProtocol';
+import type { OCPPVersion } from './ocpp/OCPPVersion';
 import type {
-  AutomaticTransactionGeneratorConfiguration,
-  ChargingStationOcppConfiguration,
-  ConnectorStatus,
-  EvseTemplate,
   FirmwareStatus,
   IncomingRequestCommand,
   MessageTrigger,
-  OCPPProtocol,
-  OCPPVersion,
   RequestCommand,
-} from './internal';
+} from './ocpp/Requests';
 
 export enum CurrentType {
   AC = 'AC',
@@ -41,21 +41,30 @@ export enum Voltage {
 
 export type WsOptions = ClientOptions & ClientRequestArgs;
 
-export type FirmwareUpgrade = {
+export interface FirmwareUpgrade {
   versionUpgrade?: {
     patternGroup?: number;
     step?: number;
   };
   reset?: boolean;
   failureStatus?: FirmwareStatus;
-};
+}
 
-type CommandsSupport = {
+interface CommandsSupport {
   incomingCommands: Record<IncomingRequestCommand, boolean>;
   outgoingCommands?: Record<RequestCommand, boolean>;
-};
+}
 
-export type ChargingStationTemplate = {
+enum x509CertificateType {
+  V2GRootCertificate = 'V2GRootCertificate',
+  MORootCertificate = 'MORootCertificate',
+  CSMSRootCertificate = 'CSMSRootCertificate',
+  ManufacturerRootCertificate = 'ManufacturerRootCertificate',
+  ChargingStationCertificate = 'ChargingStationCertificate',
+  V2GCertificate = 'V2GCertificate',
+}
+
+export interface ChargingStationTemplate {
   templateHash?: string;
   supervisionUrls?: string | string[];
   supervisionUrlOcppConfiguration?: boolean;
@@ -67,6 +76,7 @@ export type ChargingStationTemplate = {
   ocppStrictCompliance?: boolean;
   ocppPersistentConfiguration?: boolean;
   stationInfoPersistentConfiguration?: boolean;
+  automaticTransactionGeneratorPersistentConfiguration?: boolean;
   wsOptions?: WsOptions;
   idTagsFile?: string;
   baseName: string;
@@ -83,9 +93,9 @@ export type ChargingStationTemplate = {
   imsi?: string;
   meterSerialNumberPrefix?: string;
   meterType?: string;
-  power: number | number[];
+  power?: number | number[];
+  powerUnit?: PowerUnits;
   powerSharedByConnectors?: boolean;
-  powerUnit: PowerUnits;
   currentOutType?: CurrentType;
   voltageOut?: Voltage;
   numberOfPhases?: number;
@@ -99,6 +109,7 @@ export type ChargingStationTemplate = {
   registrationMaxRetries?: number;
   enableStatistics?: boolean;
   mustAuthorizeAtRemoteStart?: boolean;
+  /** @deprecated Replaced by ocppStrictCompliance */
   payloadSchemaValidation?: boolean;
   amperageLimitationOcppKey?: string;
   amperageLimitationUnit?: AmpereUnits;
@@ -114,5 +125,6 @@ export type ChargingStationTemplate = {
   Configuration?: ChargingStationOcppConfiguration;
   AutomaticTransactionGenerator?: AutomaticTransactionGeneratorConfiguration;
   Evses?: Record<string, EvseTemplate>;
-  Connectors: Record<string, ConnectorStatus>;
-};
+  Connectors?: Record<string, ConnectorStatus>;
+  x509Certificates?: Record<x509CertificateType, string>;
+}