import path from 'path';
import tar from 'tar';
+const moduleName = 'OCPPIncomingRequestService';
+
export default class OCPP16IncomingRequestService extends OCPPIncomingRequestService {
private incomingRequestHandlers: Map<OCPP16IncomingRequestCommand, IncomingRequestHandler>;
public constructor(chargingStation: ChargingStation) {
- if (new.target?.name === 'OCPP16IncomingRequestService') {
+ if (new.target?.name === moduleName) {
throw new TypeError(`Cannot construct ${new.target?.name} instances directly`);
}
super(chargingStation);
import Utils from '../../../utils/Utils';
import logger from '../../../utils/Logger';
+const moduleName = 'OCPP16RequestService';
+
export default class OCPP16RequestService extends OCPPRequestService {
public constructor(chargingStation: ChargingStation, ocppResponseService: OCPPResponseService) {
- if (new.target?.name === 'OCPP16RequestService') {
+ if (new.target?.name === moduleName) {
throw new TypeError(`Cannot construct ${new.target?.name} instances directly`);
}
super(chargingStation, ocppResponseService);
import Utils from '../../../utils/Utils';
import logger from '../../../utils/Logger';
+const moduleName = 'OCPP16ResponseService';
+
export default class OCPP16ResponseService extends OCPPResponseService {
private responseHandlers: Map<OCPP16RequestCommand, ResponseHandler>;
public constructor(chargingStation: ChargingStation) {
- if (new.target?.name === 'OCPP16ResponseService') {
+ if (new.target?.name === moduleName) {
throw new TypeError(`Cannot construct ${new.target?.name} instances directly`);
}
super(chargingStation);