-import Ajv, { type JSONSchemaType, type ValidateFunction } from 'ajv';
-import ajvFormats from 'ajv-formats';
+import _Ajv, { type JSONSchemaType, type ValidateFunction } from 'ajv';
+import _ajvFormats from 'ajv-formats';
import { OCPPConstants } from './OCPPConstants.js';
import { OCPPServiceUtils } from './OCPPServiceUtils.js';
OCPPVersion,
} from '../../types/index.js';
import { logger, setDefaultErrorParams } from '../../utils/index.js';
+type Ajv = _Ajv.default;
+const Ajv = _Ajv.default;
+const ajvFormats = _ajvFormats.default;
const moduleName = 'OCPPIncomingRequestService';
protected constructor(version: OCPPVersion) {
this.version = version;
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
this.ajv = new Ajv({
keywords: ['javaType'],
multipleOfPrecision: 2,
schema: JSONSchemaType<T>,
) {
if (this.jsonValidateFunctions.has(commandName) === false) {
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
this.jsonValidateFunctions.set(commandName, this.ajv.compile<T>(schema).bind(this));
}
return this.jsonValidateFunctions.get(commandName)!;
-import Ajv, { type JSONSchemaType, type ValidateFunction } from 'ajv';
-import ajvFormats from 'ajv-formats';
+import _Ajv, { type JSONSchemaType, type ValidateFunction } from 'ajv';
+import _ajvFormats from 'ajv-formats';
import { OCPPConstants } from './OCPPConstants.js';
import type { OCPPResponseService } from './OCPPResponseService.js';
isNullOrUndefined,
logger,
} from '../../utils/index.js';
+type Ajv = _Ajv.default;
+const Ajv = _Ajv.default;
+const ajvFormats = _ajvFormats.default;
const moduleName = 'OCPPRequestService';
protected constructor(version: OCPPVersion, ocppResponseService: OCPPResponseService) {
this.version = version;
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
this.ajv = new Ajv({
keywords: ['javaType'],
multipleOfPrecision: 2,
if (this.jsonValidateFunctions.has(commandName) === false) {
this.jsonValidateFunctions.set(
commandName,
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
this.ajv.compile<T>(this.jsonSchemas.get(commandName)!).bind(this),
);
}
) {
this.ocppResponseService.jsonIncomingRequestResponseValidateFunctions.set(
commandName,
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call
this.ajv
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
.compile<T>(this.ocppResponseService.jsonIncomingRequestResponseSchemas.get(commandName)!)
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
.bind(this),
);
}
-import Ajv, { type JSONSchemaType, type ValidateFunction } from 'ajv';
-import ajvFormats from 'ajv-formats';
+import _Ajv, { type JSONSchemaType, type ValidateFunction } from 'ajv';
+import _ajvFormats from 'ajv-formats';
import { OCPPServiceUtils } from './OCPPServiceUtils.js';
import type { ChargingStation } from '../../charging-station/index.js';
RequestCommand,
} from '../../types/index.js';
import { logger } from '../../utils/index.js';
+type Ajv = _Ajv.default;
+const Ajv = _Ajv.default;
+const ajvFormats = _ajvFormats.default;
const moduleName = 'OCPPResponseService';
protected constructor(version: OCPPVersion) {
this.version = version;
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
this.ajv = new Ajv({
keywords: ['javaType'],
multipleOfPrecision: 2,
schema: JSONSchemaType<T>,
) {
if (this.jsonRequestValidateFunctions.has(commandName) === false) {
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
this.jsonRequestValidateFunctions.set(commandName, this.ajv.compile<T>(schema).bind(this));
}
return this.jsonRequestValidateFunctions.get(commandName)!;