"prettier": "^2.6.2",
"release-it": "^15.0.0",
"robohydra": "^0.6.9",
- "rollup": "^2.71.1",
+ "rollup": "^2.72.0",
"rollup-plugin-analyzer": "^4.0.0",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-delete": "^2.0.0",
}
},
"node_modules/@jridgewell/resolve-uri": {
- "version": "3.0.6",
- "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.6.tgz",
- "integrity": "sha512-R7xHtBSNm+9SyvpJkdQl+qrM3Hm2fea3Ef197M3mUug+v+yR+Rhfbs7PBtcBUVnIWJ4JcAdjvij+c8hXS9p5aw==",
+ "version": "3.0.7",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz",
+ "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==",
"dev": true,
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/@jridgewell/set-array": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.0.tgz",
- "integrity": "sha512-SfJxIxNVYLTsKwzB3MoOQ1yxf4w/E6MdkvTgrgAt1bfxjSrLUoHMKrDOykwN14q65waezZIdqDneUIPh4/sKxg==",
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.1.tgz",
+ "integrity": "sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ==",
"dev": true,
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/@jridgewell/sourcemap-codec": {
- "version": "1.4.12",
- "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.12.tgz",
- "integrity": "sha512-az/NhpIwP3K33ILr0T2bso+k2E/SLf8Yidd8mHl0n6sCQ4YdyC8qDhZA6kOPDNDBA56ZnIjngVl0U3jREA0BUA==",
+ "version": "1.4.13",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz",
+ "integrity": "sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==",
"dev": true
},
"node_modules/@jridgewell/trace-mapping": {
- "version": "0.3.9",
- "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz",
- "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==",
+ "version": "0.3.10",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.10.tgz",
+ "integrity": "sha512-Q0YbBd6OTsXm8Y21+YUSDXupHnodNC2M4O18jtd3iwJ3+vMZNdKGols0a9G6JOK0dcJ3IdUUHoh908ZI6qhk8Q==",
"dev": true,
"dependencies": {
"@jridgewell/resolve-uri": "^3.0.3",
}
},
"node_modules/caniuse-lite": {
- "version": "1.0.30001335",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001335.tgz",
- "integrity": "sha512-ddP1Tgm7z2iIxu6QTtbZUv6HJxSaV/PZeSrWFZtbY4JZ69tOeNhBCl3HyRQgeNZKE5AOn1kpV7fhljigy0Ty3w==",
+ "version": "1.0.30001336",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001336.tgz",
+ "integrity": "sha512-/YxSlBmL7iKXTbIJ48IQTnAOBk7XmWsxhBF1PZLOko5Dt9qc4Pl+84lfqG3Tc4EuavurRn1QLoVJGxY2iSycfw==",
"dev": true,
"funding": [
{
}
},
"node_modules/electron-to-chromium": {
- "version": "1.4.133",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.133.tgz",
- "integrity": "sha512-ZiIO/VXWqY9WME7vztTySSqwm4+A8o66upAb4AmxPwOLejUM8dffcDKY+Hj6oBq/1de7w75n4GxYFxF52ewnUQ==",
+ "version": "1.4.136",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.136.tgz",
+ "integrity": "sha512-GnITX8rHnUrIVnTxU9UlsTnSemHUA2iF+6QrRqxFbp/mf0vfuSc/goEyyQhUX3TUUCE3mv/4BNuXOtaJ4ur0eA==",
"dev": true
},
"node_modules/elliptic": {
}
},
"node_modules/es-abstract": {
- "version": "1.19.5",
- "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.5.tgz",
- "integrity": "sha512-Aa2G2+Rd3b6kxEUKTF4TaW67czBLyAv3z7VOhYRU50YBx+bbsYZ9xQP4lMNazePuFlybXI0V4MruPos7qUo5fA==",
+ "version": "1.20.0",
+ "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.0.tgz",
+ "integrity": "sha512-URbD8tgRthKD3YcC39vbvSDrX23upXnPcnGAjQfgxXF5ID75YcENawc9ZX/9iTP9ptUyfCLIxTTuMYoRfiOVKA==",
"dev": true,
"dependencies": {
"call-bind": "^1.0.2",
"es-to-primitive": "^1.2.1",
"function-bind": "^1.1.1",
+ "function.prototype.name": "^1.1.5",
"get-intrinsic": "^1.1.1",
"get-symbol-description": "^1.0.0",
"has": "^1.0.3",
+ "has-property-descriptors": "^1.0.0",
"has-symbols": "^1.0.3",
"internal-slot": "^1.0.3",
"is-callable": "^1.2.4",
"object-inspect": "^1.12.0",
"object-keys": "^1.1.1",
"object.assign": "^4.1.2",
- "string.prototype.trimend": "^1.0.4",
- "string.prototype.trimstart": "^1.0.4",
- "unbox-primitive": "^1.0.1"
+ "regexp.prototype.flags": "^1.4.1",
+ "string.prototype.trimend": "^1.0.5",
+ "string.prototype.trimstart": "^1.0.5",
+ "unbox-primitive": "^1.0.2"
},
"engines": {
"node": ">= 0.4"
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
},
+ "node_modules/function.prototype.name": {
+ "version": "1.1.5",
+ "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz",
+ "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.1.3",
+ "es-abstract": "^1.19.0",
+ "functions-have-names": "^1.2.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
"node_modules/functional-red-black-tree": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
"integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
"dev": true
},
+ "node_modules/functions-have-names": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz",
+ "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==",
+ "dev": true,
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
"node_modules/gauge": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz",
"resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz",
"integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg=="
},
+ "node_modules/regexp.prototype.flags": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz",
+ "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.1.3",
+ "functions-have-names": "^1.2.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
"node_modules/regexpp": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz",
}
},
"node_modules/rollup": {
- "version": "2.71.1",
- "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.71.1.tgz",
- "integrity": "sha512-lMZk3XfUBGjrrZQpvPSoXcZSfKcJ2Bgn+Z0L1MoW2V8Wh7BVM+LOBJTPo16yul2MwL59cXedzW1ruq3rCjSRgw==",
+ "version": "2.72.0",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.72.0.tgz",
+ "integrity": "sha512-KqtR2YcO35/KKijg4nx4STO3569aqCUeGRkKWnJ6r+AvBBrVY9L4pmf4NHVrQr4mTOq6msbohflxr2kpihhaOA==",
"dev": true,
"bin": {
"rollup": "dist/bin/rollup"
}
},
"@jridgewell/resolve-uri": {
- "version": "3.0.6",
- "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.6.tgz",
- "integrity": "sha512-R7xHtBSNm+9SyvpJkdQl+qrM3Hm2fea3Ef197M3mUug+v+yR+Rhfbs7PBtcBUVnIWJ4JcAdjvij+c8hXS9p5aw==",
+ "version": "3.0.7",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz",
+ "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==",
"dev": true
},
"@jridgewell/set-array": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.0.tgz",
- "integrity": "sha512-SfJxIxNVYLTsKwzB3MoOQ1yxf4w/E6MdkvTgrgAt1bfxjSrLUoHMKrDOykwN14q65waezZIdqDneUIPh4/sKxg==",
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.1.tgz",
+ "integrity": "sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ==",
"dev": true
},
"@jridgewell/sourcemap-codec": {
- "version": "1.4.12",
- "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.12.tgz",
- "integrity": "sha512-az/NhpIwP3K33ILr0T2bso+k2E/SLf8Yidd8mHl0n6sCQ4YdyC8qDhZA6kOPDNDBA56ZnIjngVl0U3jREA0BUA==",
+ "version": "1.4.13",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz",
+ "integrity": "sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==",
"dev": true
},
"@jridgewell/trace-mapping": {
- "version": "0.3.9",
- "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz",
- "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==",
+ "version": "0.3.10",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.10.tgz",
+ "integrity": "sha512-Q0YbBd6OTsXm8Y21+YUSDXupHnodNC2M4O18jtd3iwJ3+vMZNdKGols0a9G6JOK0dcJ3IdUUHoh908ZI6qhk8Q==",
"dev": true,
"requires": {
"@jridgewell/resolve-uri": "^3.0.3",
"dev": true
},
"caniuse-lite": {
- "version": "1.0.30001335",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001335.tgz",
- "integrity": "sha512-ddP1Tgm7z2iIxu6QTtbZUv6HJxSaV/PZeSrWFZtbY4JZ69tOeNhBCl3HyRQgeNZKE5AOn1kpV7fhljigy0Ty3w==",
+ "version": "1.0.30001336",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001336.tgz",
+ "integrity": "sha512-/YxSlBmL7iKXTbIJ48IQTnAOBk7XmWsxhBF1PZLOko5Dt9qc4Pl+84lfqG3Tc4EuavurRn1QLoVJGxY2iSycfw==",
"dev": true
},
"caseless": {
}
},
"electron-to-chromium": {
- "version": "1.4.133",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.133.tgz",
- "integrity": "sha512-ZiIO/VXWqY9WME7vztTySSqwm4+A8o66upAb4AmxPwOLejUM8dffcDKY+Hj6oBq/1de7w75n4GxYFxF52ewnUQ==",
+ "version": "1.4.136",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.136.tgz",
+ "integrity": "sha512-GnITX8rHnUrIVnTxU9UlsTnSemHUA2iF+6QrRqxFbp/mf0vfuSc/goEyyQhUX3TUUCE3mv/4BNuXOtaJ4ur0eA==",
"dev": true
},
"elliptic": {
}
},
"es-abstract": {
- "version": "1.19.5",
- "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.5.tgz",
- "integrity": "sha512-Aa2G2+Rd3b6kxEUKTF4TaW67czBLyAv3z7VOhYRU50YBx+bbsYZ9xQP4lMNazePuFlybXI0V4MruPos7qUo5fA==",
+ "version": "1.20.0",
+ "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.0.tgz",
+ "integrity": "sha512-URbD8tgRthKD3YcC39vbvSDrX23upXnPcnGAjQfgxXF5ID75YcENawc9ZX/9iTP9ptUyfCLIxTTuMYoRfiOVKA==",
"dev": true,
"requires": {
"call-bind": "^1.0.2",
"es-to-primitive": "^1.2.1",
"function-bind": "^1.1.1",
+ "function.prototype.name": "^1.1.5",
"get-intrinsic": "^1.1.1",
"get-symbol-description": "^1.0.0",
"has": "^1.0.3",
+ "has-property-descriptors": "^1.0.0",
"has-symbols": "^1.0.3",
"internal-slot": "^1.0.3",
"is-callable": "^1.2.4",
"object-inspect": "^1.12.0",
"object-keys": "^1.1.1",
"object.assign": "^4.1.2",
- "string.prototype.trimend": "^1.0.4",
- "string.prototype.trimstart": "^1.0.4",
- "unbox-primitive": "^1.0.1"
+ "regexp.prototype.flags": "^1.4.1",
+ "string.prototype.trimend": "^1.0.5",
+ "string.prototype.trimstart": "^1.0.5",
+ "unbox-primitive": "^1.0.2"
}
},
"es-array-method-boxes-properly": {
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
},
+ "function.prototype.name": {
+ "version": "1.1.5",
+ "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz",
+ "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==",
+ "dev": true,
+ "requires": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.1.3",
+ "es-abstract": "^1.19.0",
+ "functions-have-names": "^1.2.2"
+ }
+ },
"functional-red-black-tree": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
"integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
"dev": true
},
+ "functions-have-names": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz",
+ "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==",
+ "dev": true
+ },
"gauge": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz",
"resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz",
"integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg=="
},
+ "regexp.prototype.flags": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz",
+ "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==",
+ "dev": true,
+ "requires": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.1.3",
+ "functions-have-names": "^1.2.2"
+ }
+ },
"regexpp": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz",
}
},
"rollup": {
- "version": "2.71.1",
- "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.71.1.tgz",
- "integrity": "sha512-lMZk3XfUBGjrrZQpvPSoXcZSfKcJ2Bgn+Z0L1MoW2V8Wh7BVM+LOBJTPo16yul2MwL59cXedzW1ruq3rCjSRgw==",
+ "version": "2.72.0",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.72.0.tgz",
+ "integrity": "sha512-KqtR2YcO35/KKijg4nx4STO3569aqCUeGRkKWnJ6r+AvBBrVY9L4pmf4NHVrQr4mTOq6msbohflxr2kpihhaOA==",
"dev": true,
"requires": {
"fsevents": "~2.3.2"
"prettier": "^2.6.2",
"release-it": "^15.0.0",
"robohydra": "^0.6.9",
- "rollup": "^2.71.1",
+ "rollup": "^2.72.0",
"rollup-plugin-analyzer": "^4.0.0",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-delete": "^2.0.0",
import { ErrorType } from '../types/ocpp/ErrorType';
import { FileType } from '../types/FileType';
import FileUtils from '../utils/FileUtils';
-import { JsonType } from '../types/JsonType';
+import { JsonObject } from '../types/JsonType';
import { MessageType } from '../types/ocpp/MessageType';
import OCPP16IncomingRequestService from './ocpp/1.6/OCPP16IncomingRequestService';
import OCPP16RequestService from './ocpp/1.6/OCPP16RequestService';
let messageType: number;
let messageId: string;
let commandName: IncomingRequestCommand;
- let commandPayload: JsonType;
+ let commandPayload: JsonObject;
let errorType: ErrorType;
let errorMessage: string;
- let errorDetails: JsonType;
- let responseCallback: (payload: JsonType, requestPayload: JsonType) => void;
+ let errorDetails: JsonObject;
+ let responseCallback: (payload: JsonObject, requestPayload: JsonObject) => void;
let errorCallback: (error: OCPPError, requestStatistic?: boolean) => void;
let requestCommandName: RequestCommand | IncomingRequestCommand;
- let requestPayload: JsonType;
+ let requestPayload: JsonObject;
let cachedRequest: CachedRequest;
let errMsg: string;
try {
ErrorType.PROTOCOL_ERROR,
`Cached request for message id ${messageId} response is not iterable`,
null,
- cachedRequest as unknown as JsonType
+ cachedRequest as unknown as JsonObject
);
}
logger.debug(
ErrorType.PROTOCOL_ERROR,
`Cached request for message id ${messageId} error response is not iterable`,
null,
- cachedRequest as unknown as JsonType
+ cachedRequest as unknown as JsonObject
);
}
logger.debug(
import { DefaultResponse } from '../../../types/ocpp/Responses';
import { ErrorType } from '../../../types/ocpp/ErrorType';
import { IncomingRequestHandler } from '../../../types/ocpp/Requests';
-import { JsonType } from '../../../types/JsonType';
+import { JsonObject } from '../../../types/JsonType';
import { OCPP16ChargePointErrorCode } from '../../../types/ocpp/1.6/ChargePointErrorCode';
import { OCPP16ChargePointStatus } from '../../../types/ocpp/1.6/ChargePointStatus';
import { OCPP16DiagnosticsStatus } from '../../../types/ocpp/1.6/DiagnosticsStatus';
public async incomingRequestHandler(
messageId: string,
commandName: OCPP16IncomingRequestCommand,
- commandPayload: JsonType
+ commandPayload: JsonObject
): Promise<void> {
- let response: JsonType;
+ let response: JsonObject;
if (
this.chargingStation.getOcppStrictCompliance() &&
this.chargingStation.isInPendingState() &&
import type ChargingStation from '../../ChargingStation';
import Constants from '../../../utils/Constants';
import { ErrorType } from '../../../types/ocpp/ErrorType';
-import { JsonType } from '../../../types/JsonType';
+import { JsonObject } from '../../../types/JsonType';
import { OCPP16RequestCommand } from '../../../types/ocpp/1.6/Requests';
import { OCPP16ServiceUtils } from './OCPP16ServiceUtils';
import OCPPError from '../../../exception/OCPPError';
super(chargingStation, ocppResponseService);
}
- public async requestHandler<Request extends JsonType, Response extends JsonType>(
+ public async requestHandler<Request extends JsonObject, Response extends JsonObject>(
commandName: OCPP16RequestCommand,
- commandParams?: JsonType,
+ commandParams?: JsonObject,
params?: RequestParams
): Promise<Response> {
if (Object.values(OCPP16RequestCommand).includes(commandName)) {
);
}
- private buildRequestPayload<Request extends JsonType>(
+ private buildRequestPayload<Request extends JsonObject>(
commandName: OCPP16RequestCommand,
- commandParams?: JsonType
+ commandParams?: JsonObject
): Request {
let connectorId: number;
switch (commandName) {
import type ChargingStation from '../../ChargingStation';
import { ErrorType } from '../../../types/ocpp/ErrorType';
-import { JsonType } from '../../../types/JsonType';
+import { JsonObject } from '../../../types/JsonType';
import { OCPP16ChargePointErrorCode } from '../../../types/ocpp/1.6/ChargePointErrorCode';
import { OCPP16ChargePointStatus } from '../../../types/ocpp/1.6/ChargePointStatus';
import { OCPP16ServiceUtils } from './OCPP16ServiceUtils';
public async responseHandler(
commandName: OCPP16RequestCommand,
- payload: JsonType,
- requestPayload: JsonType
+ payload: JsonObject,
+ requestPayload: JsonObject
): Promise<void> {
if (
this.chargingStation.isRegistered() ||
import type ChargingStation from '../ChargingStation';
import { HandleErrorParams } from '../../types/Error';
import { IncomingRequestCommand } from '../../types/ocpp/Requests';
-import { JsonType } from '../../types/JsonType';
+import { JsonObject } from '../../types/JsonType';
import logger from '../../utils/Logger';
export default abstract class OCPPIncomingRequestService {
public abstract incomingRequestHandler(
messageId: string,
commandName: IncomingRequestCommand,
- commandPayload: JsonType
+ commandPayload: JsonObject
): Promise<void>;
}
import { EmptyObject } from '../../types/EmptyObject';
import { ErrorType } from '../../types/ocpp/ErrorType';
import { HandleErrorParams } from '../../types/Error';
-import { JsonType } from '../../types/JsonType';
+import { JsonObject } from '../../types/JsonType';
import { MessageType } from '../../types/ocpp/MessageType';
import OCPPError from '../../exception/OCPPError';
import type OCPPResponseService from './OCPPResponseService';
public async sendResponse(
messageId: string,
- messagePayload: JsonType,
+ messagePayload: JsonObject,
commandName: IncomingRequestCommand
): Promise<ResponseType> {
try {
protected async sendMessage(
messageId: string,
- messagePayload: JsonType,
+ messagePayload: JsonObject,
commandName: RequestCommand,
params: RequestParams = {
skipBufferingOnError: false,
private async internalSendMessage(
messageId: string,
- messagePayload: JsonType | OCPPError,
+ messagePayload: JsonObject | OCPPError,
messageType: MessageType,
commandName?: RequestCommand | IncomingRequestCommand,
params: RequestParams = {
ErrorType.GENERIC_ERROR,
`WebSocket closed for buffered message id '${messageId}' with content '${messageToSend}'`,
commandName,
- (messagePayload?.details as JsonType) ?? {}
+ (messagePayload?.details as JsonObject) ?? {}
);
if (messageType === MessageType.CALL_MESSAGE) {
// Reject it but keep the request in the cache
ErrorType.GENERIC_ERROR,
`WebSocket closed for non buffered message id '${messageId}' with content '${messageToSend}'`,
commandName,
- (messagePayload?.details as JsonType) ?? {}
+ (messagePayload?.details as JsonObject) ?? {}
),
false
);
* @param requestPayload
*/
async function responseCallback(
- payload: JsonType,
- requestPayload: JsonType
+ payload: JsonObject,
+ requestPayload: JsonObject
): Promise<void> {
if (self.chargingStation.getEnableStatistics()) {
self.chargingStation.performanceStatistics.addRequestStatistic(
ErrorType.GENERIC_ERROR,
`Timeout for message id '${messageId}'`,
commandName,
- (messagePayload?.details as JsonType) ?? {}
+ (messagePayload?.details as JsonObject) ?? {}
),
() => {
messageType === MessageType.CALL_MESSAGE &&
private buildMessageToSend(
messageId: string,
- messagePayload: JsonType | OCPPError,
+ messagePayload: JsonObject | OCPPError,
messageType: MessageType,
commandName?: RequestCommand | IncomingRequestCommand,
- responseCallback?: (payload: JsonType, requestPayload: JsonType) => Promise<void>,
+ responseCallback?: (payload: JsonObject, requestPayload: JsonObject) => Promise<void>,
errorCallback?: (error: OCPPError, requestStatistic?: boolean) => void
): string {
let messageToSend: string;
responseCallback,
errorCallback,
commandName,
- messagePayload as JsonType,
+ messagePayload as JsonObject,
]);
messageToSend = JSON.stringify([
messageType,
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
- public abstract requestHandler<Request extends JsonType, Response extends JsonType>(
+ public abstract requestHandler<Request extends JsonObject, Response extends JsonObject>(
commandName: RequestCommand,
- commandParams?: JsonType,
+ commandParams?: JsonObject,
params?: RequestParams
): Promise<Response>;
}
import type ChargingStation from '../ChargingStation';
-import { JsonType } from '../../types/JsonType';
+import { JsonObject } from '../../types/JsonType';
import { RequestCommand } from '../../types/ocpp/Requests';
export default abstract class OCPPResponseService {
public abstract responseHandler(
commandName: RequestCommand,
- payload: JsonType,
- requestPayload: JsonType
+ payload: JsonObject,
+ requestPayload: JsonObject
): Promise<void>;
}
import { ProtocolCommand, ProtocolRequestHandler } from '../../types/UIProtocol';
import BaseError from '../../exception/BaseError';
-import { JsonType } from '../../types/JsonType';
+import { JsonObject } from '../../types/JsonType';
import UIWebSocketServer from '../UIWebSocketServer';
import logger from '../../utils/Logger';
]);
}
- public async messageHandler(command: ProtocolCommand, payload: JsonType): Promise<void> {
- let messageResponse: JsonType;
+ public async messageHandler(command: ProtocolCommand, payload: JsonObject): Promise<void> {
+ let messageResponse: JsonObject;
if (this.messageHandlers.has(command)) {
try {
// Call the method to build the message response
- messageResponse = (await this.messageHandlers.get(command)(payload)) as JsonType;
+ messageResponse = (await this.messageHandlers.get(command)(payload)) as JsonObject;
} catch (error) {
// Log
logger.error(this.uiWebSocketServer.logPrefix() + ' Handle message error: %j', error);
this.uiWebSocketServer.broadcastToClients(this.buildProtocolMessage(command, messageResponse));
}
- protected buildProtocolMessage(command: ProtocolCommand, payload: JsonType): string {
+ protected buildProtocolMessage(command: ProtocolCommand, payload: JsonObject): string {
return JSON.stringify([command, payload]);
}
import { ProtocolCommand, ProtocolRequestHandler } from '../../types/UIProtocol';
import AbstractUIService from './AbstractUIService';
-import { JsonType } from '../../types/JsonType';
+import { JsonObject } from '../../types/JsonType';
import UIWebSocketServer from '../UIWebSocketServer';
export default class UIService001 extends AbstractUIService {
);
}
- private handleStartTransaction(payload: JsonType): void {}
- private handleStopTransaction(payload: JsonType): void {}
+ private handleStartTransaction(payload: JsonObject): void {}
+ private handleStopTransaction(payload: JsonObject): void {}
}
import BaseError from './BaseError';
import { ErrorType } from '../types/ocpp/ErrorType';
-import { JsonType } from '../types/JsonType';
+import { JsonObject } from '../types/JsonType';
export default class OCPPError extends BaseError {
code: ErrorType;
command?: RequestCommand | IncomingRequestCommand;
- details?: JsonType;
+ details?: JsonObject;
constructor(
code: ErrorType,
message: string,
command?: RequestCommand | IncomingRequestCommand,
- details?: JsonType
+ details?: JsonObject
) {
super(message);
import { WorkerData, WorkerMessage, WorkerMessageEvents } from './Worker';
-import { JsonType } from './JsonType';
+import { JsonObject } from './JsonType';
-export interface ChargingStationWorkerOptions extends JsonType {
+export interface ChargingStationWorkerOptions extends JsonObject {
elementStartDelay?: number;
}
-type JsonArray = Array<JsonValue>;
+type JsonPrimitive = string | number | boolean | Date | null;
-export type JsonValue = string | number | boolean | Date | JsonType | JsonArray;
-
-export type JsonType = {
- [key in string]: JsonValue;
+export type JsonObject = {
+ [key in string]: JsonType;
};
+
+export type JsonType = JsonPrimitive | JsonType[] | JsonObject;
-import { JsonType } from './JsonType';
+import { JsonObject } from './JsonType';
export enum Protocol {
UI = 'ui',
UNKNOWN = 'unknown',
}
-export type ProtocolRequest = [ProtocolCommand, JsonType];
+export type ProtocolRequest = [ProtocolCommand, JsonObject];
export type ProtocolRequestHandler = (
- payload: JsonType
-) => void | Promise<void> | JsonType | Promise<JsonType>;
+ payload: JsonObject
+) => void | Promise<void> | JsonObject | Promise<JsonObject>;
-import { JsonType } from './JsonType';
+import { JsonObject } from './JsonType';
import { PoolOptions } from 'poolifier';
import { Worker } from 'worker_threads';
messageHandler?: (message: unknown) => void | Promise<void>;
}
-export type WorkerData = JsonType;
+export type WorkerData = JsonObject;
export interface WorkerSetElement {
worker: Worker;
-import { JsonType } from '../../JsonType';
+import { JsonObject } from '../../JsonType';
-export interface OCPP16ChargingProfile extends JsonType {
+export interface OCPP16ChargingProfile extends JsonObject {
chargingProfileId: number;
transactionId?: number;
stackLevel: number;
chargingSchedule: ChargingSchedule;
}
-export interface ChargingSchedule extends JsonType {
+export interface ChargingSchedule extends JsonObject {
duration?: number;
startSchedule?: Date;
chargingRateUnit: OCPP16ChargingRateUnitType;
minChargeRate?: number;
}
-export interface OCPP16ChargingSchedulePeriod extends JsonType {
+export interface OCPP16ChargingSchedulePeriod extends JsonObject {
startPeriod: number;
limit: number;
numberPhases?: number;
import { EmptyObject } from '../../EmptyObject';
-import { JsonType } from '../../JsonType';
+import { JsonObject } from '../../JsonType';
export enum MeterValueUnit {
WATT_HOUR = 'Wh',
SIGNED_DATA = 'SignedData',
}
-export interface OCPP16SampledValue extends JsonType {
+export interface OCPP16SampledValue extends JsonObject {
value?: string;
unit?: MeterValueUnit;
context?: MeterValueContext;
format?: MeterValueFormat;
}
-export interface OCPP16MeterValue extends JsonType {
+export interface OCPP16MeterValue extends JsonObject {
timestamp: string;
sampledValue: OCPP16SampledValue[];
}
-export interface OCPP16MeterValuesRequest extends JsonType {
+export interface OCPP16MeterValuesRequest extends JsonObject {
connectorId: number;
transactionId?: number;
meterValue: OCPP16MeterValue[];
import { ChargingProfilePurposeType, OCPP16ChargingProfile } from './ChargingProfile';
import { EmptyObject } from '../../EmptyObject';
-import { JsonType } from '../../JsonType';
+import { JsonObject } from '../../JsonType';
import { OCPP16ChargePointErrorCode } from './ChargePointErrorCode';
import { OCPP16ChargePointStatus } from './ChargePointStatus';
import { OCPP16DiagnosticsStatus } from './DiagnosticsStatus';
export type OCPP16HeartbeatRequest = EmptyObject;
-export interface OCPP16BootNotificationRequest extends JsonType {
+export interface OCPP16BootNotificationRequest extends JsonObject {
chargeBoxSerialNumber?: string;
chargePointModel: string;
chargePointSerialNumber?: string;
meterType?: string;
}
-export interface OCPP16StatusNotificationRequest extends JsonType {
+export interface OCPP16StatusNotificationRequest extends JsonObject {
connectorId: number;
errorCode: OCPP16ChargePointErrorCode;
info?: string;
vendorErrorCode?: string;
}
-export interface ChangeConfigurationRequest extends JsonType {
+export interface ChangeConfigurationRequest extends JsonObject {
key: string | OCPP16StandardParametersKey;
value: string;
}
-export interface RemoteStartTransactionRequest extends JsonType {
+export interface RemoteStartTransactionRequest extends JsonObject {
connectorId: number;
idTag: string;
chargingProfile?: OCPP16ChargingProfile;
}
-export interface RemoteStopTransactionRequest extends JsonType {
+export interface RemoteStopTransactionRequest extends JsonObject {
transactionId: number;
}
-export interface UnlockConnectorRequest extends JsonType {
+export interface UnlockConnectorRequest extends JsonObject {
connectorId: number;
}
-export interface GetConfigurationRequest extends JsonType {
+export interface GetConfigurationRequest extends JsonObject {
key?: string | OCPP16StandardParametersKey[];
}
SOFT = 'Soft',
}
-export interface ResetRequest extends JsonType {
+export interface ResetRequest extends JsonObject {
type: ResetType;
}
-export interface SetChargingProfileRequest extends JsonType {
+export interface SetChargingProfileRequest extends JsonObject {
connectorId: number;
csChargingProfiles: OCPP16ChargingProfile;
}
OPERATIVE = 'Operative',
}
-export interface ChangeAvailabilityRequest extends JsonType {
+export interface ChangeAvailabilityRequest extends JsonObject {
connectorId: number;
type: OCPP16AvailabilityType;
}
-export interface ClearChargingProfileRequest extends JsonType {
+export interface ClearChargingProfileRequest extends JsonObject {
id?: number;
connectorId?: number;
chargingProfilePurpose?: ChargingProfilePurposeType;
stackLevel?: number;
}
-export interface GetDiagnosticsRequest extends JsonType {
+export interface GetDiagnosticsRequest extends JsonObject {
location: string;
retries?: number;
retryInterval?: number;
stopTime?: Date;
}
-export interface DiagnosticsStatusNotificationRequest extends JsonType {
+export interface DiagnosticsStatusNotificationRequest extends JsonObject {
status: OCPP16DiagnosticsStatus;
}
StatusNotification = 'StatusNotification',
}
-export interface OCPP16TriggerMessageRequest extends JsonType {
+export interface OCPP16TriggerMessageRequest extends JsonObject {
requestedMessage: MessageTrigger;
connectorId?: number;
}
import { EmptyObject } from '../../EmptyObject';
-import { JsonType } from '../../JsonType';
+import { JsonObject } from '../../JsonType';
import { OCPPConfigurationKey } from '../Configuration';
-export interface OCPP16HeartbeatResponse extends JsonType {
+export interface OCPP16HeartbeatResponse extends JsonObject {
currentTime: string;
}
NOT_SUPPORTED = 'NotSupported',
}
-export interface UnlockConnectorResponse extends JsonType {
+export interface UnlockConnectorResponse extends JsonObject {
status: OCPP16UnlockStatus;
}
NOT_SUPPORTED = 'NotSupported',
}
-export interface ChangeConfigurationResponse extends JsonType {
+export interface ChangeConfigurationResponse extends JsonObject {
status: OCPP16ConfigurationStatus;
}
REJECTED = 'Rejected',
}
-export interface OCPP16BootNotificationResponse extends JsonType {
+export interface OCPP16BootNotificationResponse extends JsonObject {
status: OCPP16RegistrationStatus;
currentTime: string;
interval: number;
export type OCPP16StatusNotificationResponse = EmptyObject;
-export interface GetConfigurationResponse extends JsonType {
+export interface GetConfigurationResponse extends JsonObject {
configurationKey: OCPPConfigurationKey[];
unknownKey: string[];
}
NOT_SUPPORTED = 'NotSupported',
}
-export interface SetChargingProfileResponse extends JsonType {
+export interface SetChargingProfileResponse extends JsonObject {
status: OCPP16ChargingProfileStatus;
}
SCHEDULED = 'Scheduled',
}
-export interface ChangeAvailabilityResponse extends JsonType {
+export interface ChangeAvailabilityResponse extends JsonObject {
status: OCPP16AvailabilityStatus;
}
UNKNOWN = 'Unknown',
}
-export interface ClearChargingProfileResponse extends JsonType {
+export interface ClearChargingProfileResponse extends JsonObject {
status: OCPP16ClearChargingProfileStatus;
}
-export interface GetDiagnosticsResponse extends JsonType {
+export interface GetDiagnosticsResponse extends JsonObject {
fileName?: string;
}
NOT_IMPLEMENTED = 'NotImplemented',
}
-export interface OCPP16TriggerMessageResponse extends JsonType {
+export interface OCPP16TriggerMessageResponse extends JsonObject {
status: OCPP16TriggerMessageStatus;
}
-import { JsonType } from '../../JsonType';
+import { JsonObject } from '../../JsonType';
import { OCPP16MeterValue } from './MeterValues';
export enum OCPP16StopTransactionReason {
CONCURRENT_TX = 'ConcurrentTx',
}
-export interface IdTagInfo extends JsonType {
+export interface IdTagInfo extends JsonObject {
status: OCPP16AuthorizationStatus;
parentIdTag?: string;
expiryDate?: Date;
}
-export interface OCPP16AuthorizeRequest extends JsonType {
+export interface OCPP16AuthorizeRequest extends JsonObject {
idTag: string;
}
-export interface OCPP16AuthorizeResponse extends JsonType {
+export interface OCPP16AuthorizeResponse extends JsonObject {
idTagInfo: IdTagInfo;
}
-export interface OCPP16StartTransactionRequest extends JsonType {
+export interface OCPP16StartTransactionRequest extends JsonObject {
connectorId: number;
idTag: string;
meterStart: number;
timestamp: string;
}
-export interface OCPP16StartTransactionResponse extends JsonType {
+export interface OCPP16StartTransactionResponse extends JsonObject {
idTagInfo: IdTagInfo;
transactionId: number;
}
-export interface OCPP16StopTransactionRequest extends JsonType {
+export interface OCPP16StopTransactionRequest extends JsonObject {
idTag?: string;
meterStop: number;
timestamp: string;
transactionData?: OCPP16MeterValue[];
}
-export interface OCPP16StopTransactionResponse extends JsonType {
+export interface OCPP16StopTransactionResponse extends JsonObject {
idTagInfo?: IdTagInfo;
}
OCPP16VendorDefaultParametersKey,
} from './1.6/Configuration';
-import { JsonType } from '../JsonType';
+import { JsonObject } from '../JsonType';
export type StandardParametersKey = OCPP16StandardParametersKey;
TSR = 'TSR',
}
-export interface OCPPConfigurationKey extends JsonType {
+export interface OCPPConfigurationKey extends JsonObject {
key: string | StandardParametersKey;
readonly: boolean;
value?: string;
OCPP16StatusNotificationRequest,
} from './1.6/Requests';
-import { JsonType } from '../JsonType';
+import { JsonObject } from '../JsonType';
import { MessageType } from './MessageType';
import { OCPP16DiagnosticsStatus } from './1.6/DiagnosticsStatus';
import { OCPP16MeterValuesRequest } from './1.6/MeterValues';
import OCPPError from '../../exception/OCPPError';
-export type OutgoingRequest = [MessageType.CALL_MESSAGE, string, RequestCommand, JsonType];
+export type OutgoingRequest = [MessageType.CALL_MESSAGE, string, RequestCommand, JsonObject];
-export type IncomingRequest = [MessageType.CALL_MESSAGE, string, IncomingRequestCommand, JsonType];
+export type IncomingRequest = [
+ MessageType.CALL_MESSAGE,
+ string,
+ IncomingRequestCommand,
+ JsonObject
+];
export type CachedRequest = [
- (payload: JsonType, requestPayload: JsonType) => void,
+ (payload: JsonObject, requestPayload: JsonObject) => void,
(error: OCPPError, requestStatistic?: boolean) => void,
RequestCommand | IncomingRequestCommand,
- JsonType
+ JsonObject
];
-export type IncomingRequestHandler = (commandPayload: JsonType) => JsonType | Promise<JsonType>;
+export type IncomingRequestHandler = (
+ commandPayload: JsonObject
+) => JsonObject | Promise<JsonObject>;
-export type ResponseType = JsonType | OCPPError;
+export type ResponseType = JsonObject | OCPPError;
export interface RequestParams {
skipBufferingOnError?: boolean;
} from './1.6/Responses';
import { ErrorType } from './ErrorType';
-import { JsonType } from '../JsonType';
+import { JsonObject } from '../JsonType';
import { MessageType } from './MessageType';
import { OCPP16MeterValuesResponse } from './1.6/MeterValues';
-export type Response = [MessageType.CALL_RESULT_MESSAGE, string, JsonType];
+export type Response = [MessageType.CALL_RESULT_MESSAGE, string, JsonObject];
-export type ErrorResponse = [MessageType.CALL_ERROR_MESSAGE, string, ErrorType, string, JsonType];
+export type ErrorResponse = [MessageType.CALL_ERROR_MESSAGE, string, ErrorType, string, JsonObject];
export type ResponseHandler = (
- payload: JsonType,
- requestPayload?: JsonType
+ payload: JsonObject,
+ requestPayload?: JsonObject
) => void | Promise<void>;
export type BootNotificationResponse = OCPP16BootNotificationResponse;
-import { JsonType, JsonValue } from '../types/JsonType';
+import { JsonObject, JsonType } from '../types/JsonType';
import { EmptyObject } from '../types/EmptyObject';
import { FileType } from '../types/FileType';
import logger from './Logger';
export default class FileUtils {
- static watchJsonFile<T extends JsonType | JsonValue>(
+ static watchJsonFile<T extends JsonObject | JsonType>(
logPrefix: string,
fileType: FileType,
file: string,