-import type { JSONSchemaType } from 'ajv';
-import Ajv from 'ajv-draft-04';
+import Ajv, { type JSONSchemaType } from 'ajv';
import ajvFormats from 'ajv-formats';
import OCPPError from '../../exception/OCPPError';
import type { JsonType } from '../../types/JsonType';
+import type { OCPPVersion } from '../../types/ocpp/OCPPVersion';
import type { RequestCommand } from '../../types/ocpp/Requests';
import logger from '../../utils/Logger';
import type ChargingStation from '../ChargingStation';
export default abstract class OCPPResponseService {
private static instance: OCPPResponseService | null = null;
- private ajv: Ajv;
+ private readonly version: OCPPVersion;
+ private readonly ajv: Ajv;
- protected constructor() {
+ protected constructor(version: OCPPVersion) {
+ this.version = version;
this.ajv = new Ajv();
ajvFormats(this.ajv);
this.responseHandler.bind(this);
);
}
- // eslint-disable-next-line @typescript-eslint/no-empty-function
- protected emptyResponseHandler() {}
+ protected emptyResponseHandler() {
+ /* This is intentional */
+ }
public abstract responseHandler(
chargingStation: ChargingStation,