"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
- "plugin:@typescript-eslint/recommended-requiring-type-checking"
+ "plugin:@typescript-eslint/recommended-requiring-type-checking",
+ "plugin:jsdoc/recommended"
],
"plugins": [
- "@typescript-eslint"
+ "@typescript-eslint",
+ "jsdoc"
],
"rules": {
"indent": "off",
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
"dev": true
},
+ "comment-parser": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.1.2.tgz",
+ "integrity": "sha512-AOdq0i8ghZudnYv8RUnHrhTgafUGs61Rdz9jemU5x2lnZwAWyOq7vySo626K59e1fVKH1xSRorJwPVRLSWOoAQ==",
+ "dev": true
+ },
"commist": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/commist/-/commist-1.1.0.tgz",
}
}
},
+ "eslint-plugin-jsdoc": {
+ "version": "32.3.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-32.3.0.tgz",
+ "integrity": "sha512-zyx7kajDK+tqS1bHuY5sapkad8P8KT0vdd/lE55j47VPG2MeenSYuIY/M/Pvmzq5g0+3JB+P3BJGUXmHxtuKPQ==",
+ "dev": true,
+ "requires": {
+ "comment-parser": "1.1.2",
+ "debug": "^4.3.1",
+ "jsdoctypeparser": "^9.0.0",
+ "lodash": "^4.17.20",
+ "regextras": "^0.7.1",
+ "semver": "^7.3.4",
+ "spdx-expression-parse": "^3.0.1"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
+ "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
+ "dev": true,
+ "requires": {
+ "ms": "2.1.2"
+ }
+ },
+ "lodash": {
+ "version": "4.17.21",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
+ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
+ "dev": true
+ },
+ "lru-cache": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
+ "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
+ "dev": true,
+ "requires": {
+ "yallist": "^4.0.0"
+ }
+ },
+ "ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
+ "dev": true
+ },
+ "semver": {
+ "version": "7.3.5",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
+ "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
+ "dev": true,
+ "requires": {
+ "lru-cache": "^6.0.0"
+ }
+ },
+ "spdx-expression-parse": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz",
+ "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==",
+ "dev": true,
+ "requires": {
+ "spdx-exceptions": "^2.1.0",
+ "spdx-license-ids": "^3.0.0"
+ }
+ },
+ "yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
+ "dev": true
+ }
+ }
+ },
"eslint-scope": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
"integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=",
"dev": true
},
+ "jsdoctypeparser": {
+ "version": "9.0.0",
+ "resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-9.0.0.tgz",
+ "integrity": "sha512-jrTA2jJIL6/DAEILBEh2/w9QxCuwmvNXIry39Ay/HVfhE3o2yVV0U44blYkqdHA/OKloJEqvJy0xU+GSdE2SIw==",
+ "dev": true
+ },
"jsesc": {
"version": "2.5.2",
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",
"integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==",
"dev": true
},
+ "regextras": {
+ "version": "0.7.1",
+ "resolved": "https://registry.npmjs.org/regextras/-/regextras-0.7.1.tgz",
+ "integrity": "sha512-9YXf6xtW+qzQ+hcMQXx95MOvfqXFgsKDZodX3qZB0x2n5Z94ioetIITsBtvJbiOyxa/6s9AtyweBLCdPmPko/w==",
+ "dev": true
+ },
"registry-auth-token": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.4.0.tgz",
"clinic": "^8.0.1",
"cross-env": "^7.0.3",
"eslint": "^7.22.0",
+ "eslint-plugin-jsdoc": "^32.3.0",
"mbt": "^1.1.1",
"npm-check": "^5.9.2",
"rollup": "^2.42.4",
}
}
+/**
+ *
+ */
function addMessageListener(): void {
parentPort.on('message', (message) => {
if (message.id === WorkerEvents.START_WORKER_ELEMENT) {
});
}
+/**
+ * @param data
+ */
function startChargingStation(data: StationWorkerData): void {
const station = new ChargingStation(data.index, data.templateFile);
station.start();
setTimeout(() => rejectCallback(new OCPPError(commandParams.code ? commandParams.code : ErrorType.GENERIC_ERROR, commandParams.message ? commandParams.message : `Timeout for message id '${messageId}' with content '${messageToSend}'`, commandParams.details ? commandParams.details : {})), Constants.OCPP_ERROR_TIMEOUT);
}
- // Function that will receive the request's response
+ /**
+ * Function that will receive the request's response
+ *
+ * @param payload
+ * @param requestPayload
+ */
async function responseCallback(payload: Record<string, unknown> | string, requestPayload: Record<string, unknown>): Promise<void> {
if (self.chargingStation.getEnableStatistics()) {
self.chargingStation.statistics.addMessage(commandName, messageType);
resolve(payload);
}
- // Function that will receive the request's rejection
+ /**
+ * Function that will receive the request's rejection
+ *
+ * @param error
+ */
function rejectCallback(error: OCPPError): void {
if (self.chargingStation.getEnableStatistics()) {
self.chargingStation.statistics.addMessage(commandName, messageType);
/**
* @param {number} [retryNumber=0]
- * @return {number} - delay in milliseconds
+ * @returns {number} - delay in milliseconds
*/
static exponentialDelay(retryNumber = 0): number {
const delay = Math.pow(2, retryNumber) * 100;
* Create a new `WorkerDynamicPool`.
*
* @param {string} workerScript
+ * @param min
+ * @param max
*/
constructor(workerScript: string, min: number, max: number,) {
super(workerScript);
/**
*
- * @return {Promise<void>}
+ * @returns {Promise<void>}
* @public
*/
// eslint-disable-next-line @typescript-eslint/no-empty-function
/**
*
- * @return {Promise<void>}
+ * @returns {Promise<void>}
* @public
*/
// eslint-disable-next-line @typescript-eslint/require-await
/**
*
- * @return {Promise<void>}
+ * @param elementData
+ * @returns {Promise<void>}
* @public
*/
public async addElement(elementData: T): Promise<void> {
/**
*
- * @return {Promise<void>}
+ * @param elementData
+ * @returns {Promise<void>}
* @public
*/
public async addElement(elementData: T): Promise<void> {
/**
*
- * @return {Promise<void>}
+ * @returns {Promise<void>}
* @public
*/
public async start(): Promise<void> {
/**
*
- * @return {Promise<void>}
+ * @returns {Promise<void>}
* @public
*/
public async stop(): Promise<void> {
/**
*
- * @return {Promise}
+ * @returns {Promise}
* @private
*/
private startWorker(): void {
* Create a new `WorkerStaticPool`.
*
* @param {string} workerScript
+ * @param numberOfThreads
*/
constructor(workerScript: string, numberOfThreads: number) {
super(workerScript);
/**
*
- * @return {Promise<void>}
+ * @returns {Promise<void>}
* @public
*/
// eslint-disable-next-line @typescript-eslint/no-empty-function
/**
*
- * @return {Promise<void>}
+ * @returns {Promise<void>}
* @public
*/
public async stop(): Promise<void> {
/**
*
- * @return {Promise<void>}
+ * @param elementData
+ * @returns {Promise<void>}
* @public
*/
public async addElement(elementData: T): Promise<void> {