}
},
"expect": {
- "version": "27.2.5",
- "resolved": "https://registry.npmjs.org/expect/-/expect-27.2.5.tgz",
- "integrity": "sha512-ZrO0w7bo8BgGoP/bLz+HDCI+0Hfei9jUSZs5yI/Wyn9VkG9w8oJ7rHRgYj+MA7yqqFa0IwHA3flJzZtYugShJA==",
+ "version": "27.3.0",
+ "resolved": "https://registry.npmjs.org/expect/-/expect-27.3.0.tgz",
+ "integrity": "sha512-JBRU82EBkZUBqLBAoF3ovzNGEBm14QQnePK4PmZdm6de6q/UzPnmIuWP3dRCw/FE8wRQhf/1eKzy1p1q8d6EvQ==",
"dev": true,
"requires": {
"@jest/types": "^27.2.5",
"ansi-styles": "^5.0.0",
"jest-get-type": "^27.0.6",
- "jest-matcher-utils": "^27.2.5",
- "jest-message-util": "^27.2.5",
+ "jest-matcher-utils": "^27.3.0",
+ "jest-message-util": "^27.3.0",
"jest-regex-util": "^27.0.6"
},
"dependencies": {
}
},
"jest-diff": {
- "version": "27.2.5",
- "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-27.2.5.tgz",
- "integrity": "sha512-7gfwwyYkeslOOVQY4tVq5TaQa92mWfC9COsVYMNVYyJTOYAqbIkoD3twi5A+h+tAPtAelRxkqY6/xu+jwTr0dA==",
+ "version": "27.3.0",
+ "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-27.3.0.tgz",
+ "integrity": "sha512-Nl2rE58B2ye+RvPcU4hN+6wBCHxX7aWz6RMTMFxe9jAg8ZueMj5QQ+T/nmHRutbBc5BEjrbbEWOrRzp9rUEsYA==",
"dev": true,
"requires": {
"chalk": "^4.0.0",
"diff-sequences": "^27.0.6",
"jest-get-type": "^27.0.6",
- "pretty-format": "^27.2.5"
+ "pretty-format": "^27.3.0"
}
},
"jest-get-type": {
"dev": true
},
"jest-matcher-utils": {
- "version": "27.2.5",
- "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-27.2.5.tgz",
- "integrity": "sha512-qNR/kh6bz0Dyv3m68Ck2g1fLW5KlSOUNcFQh87VXHZwWc/gY6XwnKofx76Qytz3x5LDWT09/2+yXndTkaG4aWg==",
+ "version": "27.3.0",
+ "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-27.3.0.tgz",
+ "integrity": "sha512-AK2ds5J29PJcZhfJ/5J8ycbjCXTHnwc6lQeOV1a1GahU1MCpSvyHG1iIevyvp6PXPy6r0q9ywGdCObWHmkK16g==",
"dev": true,
"requires": {
"chalk": "^4.0.0",
- "jest-diff": "^27.2.5",
+ "jest-diff": "^27.3.0",
"jest-get-type": "^27.0.6",
- "pretty-format": "^27.2.5"
+ "pretty-format": "^27.3.0"
}
},
"jest-message-util": {
- "version": "27.2.5",
- "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.2.5.tgz",
- "integrity": "sha512-ggXSLoPfIYcbmZ8glgEJZ8b+e0Msw/iddRmgkoO7lDAr9SmI65IIfv7VnvTnV4FGnIIUIjzM+fHRHO5RBvyAbQ==",
+ "version": "27.3.0",
+ "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.3.0.tgz",
+ "integrity": "sha512-0c79aomiyE3mlta4NCWsICydvv2W0HlM/eVx46YEO+vdDuwUvNuQn8LqOtcHC1hSd25i03RrPvscrWgHBJQpRQ==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.12.13",
"chalk": "^4.0.0",
"graceful-fs": "^4.2.4",
"micromatch": "^4.0.4",
- "pretty-format": "^27.2.5",
+ "pretty-format": "^27.3.0",
"slash": "^3.0.0",
"stack-utils": "^2.0.3"
},
"dev": true
},
"mocha": {
- "version": "9.1.2",
- "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.2.tgz",
- "integrity": "sha512-ta3LtJ+63RIBP03VBjMGtSqbe6cWXRejF9SyM9Zyli1CKZJZ+vfCTj3oW24V7wAphMJdpOFLoMI3hjJ1LWbs0w==",
+ "version": "9.1.3",
+ "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.3.tgz",
+ "integrity": "sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw==",
"dev": true,
"requires": {
"@ungap/promise-all-settled": "1.1.2",
"dev": true
},
"pretty-format": {
- "version": "27.2.5",
- "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.2.5.tgz",
- "integrity": "sha512-+nYn2z9GgicO9JiqmY25Xtq8SYfZ/5VCpEU3pppHHNAhd1y+ZXxmNPd1evmNcAd6Hz4iBV2kf0UpGth5A/VJ7g==",
+ "version": "27.3.0",
+ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.3.0.tgz",
+ "integrity": "sha512-Nkdd0xmxZdjCe6GoJomHnrLcCYGYzZKI/fRnUX0sCwDai2mmCHJfC9Ecx33lYgaxAFS/pJCAqhfxmWlm1wNVag==",
"dev": true,
"requires": {
"@jest/types": "^27.2.5",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jsdoc": "^36.1.1",
"eslint-plugin-node": "^11.1.0",
- "expect": "^27.2.5",
- "mocha": "^9.1.2",
+ "expect": "^27.3.0",
+ "mocha": "^9.1.3",
"mochawesome": "^6.3.1",
"npm-check": "^5.9.2",
"nyc": "^15.1.0",
stationTemplateFromFile = JSON.parse(fs.readFileSync(fileDescriptor, 'utf8')) as ChargingStationTemplate;
fs.closeSync(fileDescriptor);
} catch (error) {
- FileUtils.handleFileException(this.logPrefix(), 'Template', this.stationTemplateFile, error);
+ FileUtils.handleFileException(this.logPrefix(), 'Template', this.stationTemplateFile, error as NodeJS.ErrnoException);
}
const stationInfo: ChargingStationInfo = stationTemplateFromFile ?? {} as ChargingStationInfo;
stationInfo.wsOptions = stationTemplateFromFile?.wsOptions ?? {};
// Log
logger.error('%s Incoming OCPP message %j matching cached request %j processing error %j', this.logPrefix(), data.toString(), this.requests.get(messageId), error);
// Send error
- messageType === MessageType.CALL_MESSAGE && await this.ocppRequestService.sendError(messageId, error, commandName);
+ messageType === MessageType.CALL_MESSAGE && await this.ocppRequestService.sendError(messageId, error as OCPPError, commandName);
}
}
authorizedTags = JSON.parse(fs.readFileSync(fileDescriptor, 'utf8')) as string[];
fs.closeSync(fileDescriptor);
} catch (error) {
- FileUtils.handleFileException(this.logPrefix(), 'Authorization', authorizationFile, error);
+ FileUtils.handleFileException(this.logPrefix(), 'Authorization', authorizationFile, error as NodeJS.ErrnoException);
}
} else {
logger.info(this.logPrefix() + ' No authorization file given in template file ' + this.stationTemplateFile);
if (this.isWebSocketConnectionOpened() && forceCloseOpened) {
this.wsConnection.close();
}
- let protocol;
+ let protocol: string;
switch (this.getOCPPVersion()) {
case OCPPVersion.VERSION_16:
protocol = 'ocpp' + OCPPVersion.VERSION_16;
}
});
} catch (error) {
- FileUtils.handleFileException(this.logPrefix(), 'Authorization', authorizationFile, error);
+ FileUtils.handleFileException(this.logPrefix(), 'Authorization', authorizationFile, error as NodeJS.ErrnoException);
}
} else {
logger.info(this.logPrefix() + ' No authorization file given in template file ' + this.stationTemplateFile + '. Not monitoring changes');
}
});
} catch (error) {
- FileUtils.handleFileException(this.logPrefix(), 'Template', this.stationTemplateFile, error);
+ FileUtils.handleFileException(this.logPrefix(), 'Template', this.stationTemplateFile, error as NodeJS.ErrnoException);
}
}
if (ftpClient) {
ftpClient.close();
}
- return this.handleIncomingRequestError(OCPP16IncomingRequestCommand.GET_DIAGNOSTICS, error, Constants.OCPP_RESPONSE_EMPTY);
+ return this.handleIncomingRequestError(OCPP16IncomingRequestCommand.GET_DIAGNOSTICS, error as Error, Constants.OCPP_RESPONSE_EMPTY);
}
} else {
logger.error(`${this.chargingStation.logPrefix()} Unsupported protocol ${uri.protocol} to transfer the diagnostic logs archive`);
return Constants.OCPP_TRIGGER_MESSAGE_RESPONSE_NOT_IMPLEMENTED;
}
} catch (error) {
- return this.handleIncomingRequestError(OCPP16IncomingRequestCommand.TRIGGER_MESSAGE, error, Constants.OCPP_TRIGGER_MESSAGE_RESPONSE_REJECTED);
+ return this.handleIncomingRequestError(OCPP16IncomingRequestCommand.TRIGGER_MESSAGE, error as Error, Constants.OCPP_TRIGGER_MESSAGE_RESPONSE_REJECTED);
}
}
}
const payload: HeartbeatRequest = {};
await this.sendMessage(Utils.generateUUID(), payload, MessageType.CALL_MESSAGE, OCPP16RequestCommand.HEARTBEAT);
} catch (error) {
- this.handleRequestError(OCPP16RequestCommand.HEARTBEAT, error);
+ this.handleRequestError(OCPP16RequestCommand.HEARTBEAT, error as Error);
}
}
};
return await this.sendMessage(Utils.generateUUID(), payload, MessageType.CALL_MESSAGE, OCPP16RequestCommand.BOOT_NOTIFICATION, true) as OCPP16BootNotificationResponse;
} catch (error) {
- this.handleRequestError(OCPP16RequestCommand.BOOT_NOTIFICATION, error);
+ this.handleRequestError(OCPP16RequestCommand.BOOT_NOTIFICATION, error as Error);
}
}
};
await this.sendMessage(Utils.generateUUID(), payload, MessageType.CALL_MESSAGE, OCPP16RequestCommand.STATUS_NOTIFICATION);
} catch (error) {
- this.handleRequestError(OCPP16RequestCommand.STATUS_NOTIFICATION, error);
+ this.handleRequestError(OCPP16RequestCommand.STATUS_NOTIFICATION, error as Error);
}
}
this.chargingStation.getConnectorStatus(connectorId).authorizeIdTag = idTag;
return await this.sendMessage(Utils.generateUUID(), payload, MessageType.CALL_MESSAGE, OCPP16RequestCommand.AUTHORIZE) as OCPP16AuthorizeResponse;
} catch (error) {
- this.handleRequestError(OCPP16RequestCommand.AUTHORIZE, error);
+ this.handleRequestError(OCPP16RequestCommand.AUTHORIZE, error as Error);
}
}
};
return await this.sendMessage(Utils.generateUUID(), payload, MessageType.CALL_MESSAGE, OCPP16RequestCommand.START_TRANSACTION) as OCPP16StartTransactionResponse;
} catch (error) {
- this.handleRequestError(OCPP16RequestCommand.START_TRANSACTION, error);
+ this.handleRequestError(OCPP16RequestCommand.START_TRANSACTION, error as Error);
}
}
};
return await this.sendMessage(Utils.generateUUID(), payload, MessageType.CALL_MESSAGE, OCPP16RequestCommand.STOP_TRANSACTION) as OCPP16StartTransactionResponse;
} catch (error) {
- this.handleRequestError(OCPP16RequestCommand.STOP_TRANSACTION, error);
+ this.handleRequestError(OCPP16RequestCommand.STOP_TRANSACTION, error as Error);
}
}
};
await this.sendMessage(Utils.generateUUID(), payload, MessageType.CALL_MESSAGE, OCPP16RequestCommand.METER_VALUES);
} catch (error) {
- this.handleRequestError(OCPP16RequestCommand.METER_VALUES, error);
+ this.handleRequestError(OCPP16RequestCommand.METER_VALUES, error as Error);
}
}
};
await this.sendMessage(Utils.generateUUID(), payload, MessageType.CALL_MESSAGE, OCPP16RequestCommand.METER_VALUES);
} catch (error) {
- this.handleRequestError(OCPP16RequestCommand.METER_VALUES, error);
+ this.handleRequestError(OCPP16RequestCommand.METER_VALUES, error as Error);
}
}
};
await this.sendMessage(Utils.generateUUID(), payload, MessageType.CALL_MESSAGE, OCPP16RequestCommand.METER_VALUES);
} catch (error) {
- this.handleRequestError(OCPP16RequestCommand.METER_VALUES, error);
+ this.handleRequestError(OCPP16RequestCommand.METER_VALUES, error as Error);
}
}
};
await this.sendMessage(Utils.generateUUID(), payload, MessageType.CALL_MESSAGE, OCPP16RequestCommand.DIAGNOSTICS_STATUS_NOTIFICATION);
} catch (error) {
- this.handleRequestError(OCPP16RequestCommand.METER_VALUES, error);
+ this.handleRequestError(OCPP16RequestCommand.METER_VALUES, error as Error);
}
}
// Send error
return await this.sendMessage(messageId, error, MessageType.CALL_ERROR_MESSAGE, commandName);
} catch (err) {
- this.handleRequestError(commandName as OCPP16RequestCommand, err);
+ this.handleRequestError(commandName as OCPP16RequestCommand, err as Error);
}
}
}