From cbb3711f55d6cc41a82fe4ff7104d8083077f526 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 20 Aug 2022 15:44:04 +0200 Subject: [PATCH 1/1] Use the generic OCPPServiceUtils import where appropriate MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ocpp/OCPPIncomingRequestService.ts | 4 ++-- src/charging-station/ocpp/OCPPRequestService.ts | 4 ++-- src/charging-station/ocpp/OCPPResponseService.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/charging-station/ocpp/OCPPIncomingRequestService.ts b/src/charging-station/ocpp/OCPPIncomingRequestService.ts index ef05c3af..5760e1d1 100644 --- a/src/charging-station/ocpp/OCPPIncomingRequestService.ts +++ b/src/charging-station/ocpp/OCPPIncomingRequestService.ts @@ -8,7 +8,7 @@ import { JsonType } from '../../types/JsonType'; import { IncomingRequestCommand } from '../../types/ocpp/Requests'; import logger from '../../utils/Logger'; import type ChargingStation from '../ChargingStation'; -import { OCPP16ServiceUtils } from './1.6/OCPP16ServiceUtils'; +import { OCPPServiceUtils } from './OCPPServiceUtils'; const moduleName = 'OCPPIncomingRequestService'; @@ -68,7 +68,7 @@ export default abstract class OCPPIncomingRequestService { validate.errors ); throw new OCPPError( - OCPP16ServiceUtils.AjvErrorsToErrorType(validate.errors), + OCPPServiceUtils.AjvErrorsToErrorType(validate.errors), 'Incoming request PDU is invalid', commandName, JSON.stringify(validate.errors, null, 2) diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index e4ac7868..de10f546 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -21,8 +21,8 @@ import Constants from '../../utils/Constants'; import logger from '../../utils/Logger'; import Utils from '../../utils/Utils'; import type ChargingStation from '../ChargingStation'; -import { OCPP16ServiceUtils } from './1.6/OCPP16ServiceUtils'; import type OCPPResponseService from './OCPPResponseService'; +import { OCPPServiceUtils } from './OCPPServiceUtils'; const moduleName = 'OCPPRequestService'; @@ -133,7 +133,7 @@ export default abstract class OCPPRequestService { validate.errors ); throw new OCPPError( - OCPP16ServiceUtils.AjvErrorsToErrorType(validate.errors), + OCPPServiceUtils.AjvErrorsToErrorType(validate.errors), 'Request PDU is invalid', commandName, JSON.stringify(validate.errors, null, 2) diff --git a/src/charging-station/ocpp/OCPPResponseService.ts b/src/charging-station/ocpp/OCPPResponseService.ts index 8c9cd984..c91066c4 100644 --- a/src/charging-station/ocpp/OCPPResponseService.ts +++ b/src/charging-station/ocpp/OCPPResponseService.ts @@ -7,7 +7,7 @@ import { JsonType } from '../../types/JsonType'; import { RequestCommand } from '../../types/ocpp/Requests'; import logger from '../../utils/Logger'; import type ChargingStation from '../ChargingStation'; -import { OCPP16ServiceUtils } from './1.6/OCPP16ServiceUtils'; +import { OCPPServiceUtils } from './OCPPServiceUtils'; const moduleName = 'OCPPResponseService'; @@ -45,7 +45,7 @@ export default abstract class OCPPResponseService { validate.errors ); throw new OCPPError( - OCPP16ServiceUtils.AjvErrorsToErrorType(validate.errors), + OCPPServiceUtils.AjvErrorsToErrorType(validate.errors), 'Response PDU is invalid', commandName, JSON.stringify(validate.errors, null, 2) -- 2.34.1