.gitignore
.gitattributes
.gitmodules
+.github
.jshintrc
.eslintrc
.vscode
.tscache
# Logs
*.log
+# Winston
+*-audit.json
# Vim
# Persistent undo
[._]*.un~
.netrwhist
*~
*.orig
+src
ev-simulator-start.sh
ev-simulator-start.bat
README.md
node_modules
manifest-cf-template.yml
+mta.yaml
"request": "launch",
"name": "Debug Program via npm",
"cwd": "${workspaceFolder}",
+ "preLaunchTask": "Build",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script",
- "start:dev:debug"
+ "start:debug"
],
"skipFiles": [
"<node_internals>/**"
--- /dev/null
+{
+ "version": "2.0.0",
+ "tasks": [
+ {
+ "label": "Build",
+ "type": "npm",
+ "script": "build"
+ }
+ ]
+}
pkg: grunt.file.readJSON('package.json'),
ts: {
tsconfig: './tsconfig.json',
- dev: {
- watch: './src'
+ buildWatch: {
+ watch: './src',
},
prod: {}
+ },
+ mkdir: {
+ assets: {
+ options: {
+ create: ['dist/assets'],
+ }
+ }
+ },
+ copy: {
+ assets: {
+ files: [{
+ expand: true,
+ cwd: 'src/assets',
+ src: '**',
+ dest: 'dist/assets',
+ }]
+ },
+ },
+ clean: {
+ build: ['dist'],
}
});
+ grunt.loadNpmTasks('grunt-contrib-clean');
+ grunt.loadNpmTasks('grunt-mkdir');
+ grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-ts');
- grunt.registerTask('default', ['ts:prod']);
+ grunt.registerTask('default', ['clean:build', 'ts:prod', 'mkdir:assets', 'copy:assets']);
};
COPY --from=builder /usr/builder/node_modules ./node_modules
COPY NOTICE LICENSE ./
-COPY src ./src
COPY dist ./dist
COPY *.json ./
-COPY docker/config.json ./src/assets/config.json
+COPY docker/config.json ./dist/assets/config.json
COPY docker/autoconfig.sh /autoconfig.sh
RUN chmod +x /autoconfig.sh
[ -z $emobility_server_type ] && { echo "emobility env server type variable not found, exiting"; exit 1; }
[ -z $emobility_service_type ] && { echo "emobility env service type variable not found, exiting"; exit 1; }
- cp $emobility_install_dir/src/assets/configs-aws/$emobility_server_type-$emobility_service_type-$emobility_landscape.json $emobility_install_dir/src/assets/config.json
+ cp $emobility_install_dir/src/assets/configs-aws/$emobility_server_type-$emobility_service_type-$emobility_landscape.json $emobility_install_dir/dist/assets/config.json
else
echo "no emobility env defined, start with default configuration"
fi
}
},
"@types/estree": {
- "version": "0.0.45",
- "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.45.tgz",
- "integrity": "sha512-jnqIUKDUqJbDIUxm0Uj7bnlMnRm1T/eZ9N+AVMqhPgzrba2GhGG5o/jCTwmdPK709nEZsGoMzXEDUjcXHa3W0g==",
+ "version": "0.0.46",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.46.tgz",
+ "integrity": "sha512-laIjwTQaD+5DukBZaygQ79K1Z0jb1bPEMRrkXSLjtCcZm+abyp5YbrqpSLzD42FwWW6gK/aS4NYpJ804nG2brg==",
"dev": true
},
"@types/json-schema": {
"dev": true
},
"@types/node": {
- "version": "14.14.25",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.25.tgz",
- "integrity": "sha512-EPpXLOVqDvisVxtlbvzfyqSsFeQxltFbluZNRndIb8tr9KiBnYNLzrc1N3pyKUCww2RNrfHDViqDWWE1LCJQtQ==",
+ "version": "14.14.27",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.27.tgz",
+ "integrity": "sha512-Ecfmo4YDQPwuqTCl1yBxLV5ihKfRlkBmzUEDcfIRvDxOTGQEeikr317Ln7Gcv0tjA8dVgKI3rniqW2G1OyKDng==",
"dev": true
},
"@types/offscreencanvas": {
}
},
"eslint": {
- "version": "7.19.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.19.0.tgz",
- "integrity": "sha512-CGlMgJY56JZ9ZSYhJuhow61lMPPjUzWmChFya71Z/jilVos7mR/jPgaEfVGgMBY5DshbKdG8Ezb8FDCHcoMEMg==",
+ "version": "7.20.0",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.20.0.tgz",
+ "integrity": "sha512-qGi0CTcOGP2OtCQBgWZlQjcTuP0XkIpYFj25XtRTQSHC+umNnp7UMshr2G8SLsRFYDdAPFeHOsiteadmMH02Yw==",
"dev": true,
"requires": {
- "@babel/code-frame": "^7.0.0",
+ "@babel/code-frame": "7.12.11",
"@eslint/eslintrc": "^0.3.0",
"ajv": "^6.10.0",
"chalk": "^4.0.0",
"eslint-utils": "^2.1.0",
"eslint-visitor-keys": "^2.0.0",
"espree": "^7.3.1",
- "esquery": "^1.2.0",
+ "esquery": "^1.4.0",
"esutils": "^2.0.2",
"file-entry-cache": "^6.0.0",
"functional-red-black-tree": "^1.0.1",
"v8-compile-cache": "^2.0.3"
},
"dependencies": {
+ "@babel/code-frame": {
+ "version": "7.12.11",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz",
+ "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==",
+ "dev": true,
+ "requires": {
+ "@babel/highlight": "^7.10.4"
+ }
+ },
"ansi-regex": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
"dev": true
},
"esquery": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz",
- "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==",
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz",
+ "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==",
"dev": true,
"requires": {
"estraverse": "^5.1.0"
"moment": "^2.11.2"
}
},
+ "file-sync-cmp": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/file-sync-cmp/-/file-sync-cmp-0.1.1.tgz",
+ "integrity": "sha1-peeo/7+kk7Q7kju9TKiaU7Y7YSs=",
+ "dev": true
+ },
"file-uri-to-path": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
}
}
},
+ "grunt-contrib-clean": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/grunt-contrib-clean/-/grunt-contrib-clean-2.0.0.tgz",
+ "integrity": "sha512-g5ZD3ORk6gMa5ugZosLDQl3dZO7cI3R14U75hTM+dVLVxdMNJCPVmwf9OUt4v4eWgpKKWWoVK9DZc1amJp4nQw==",
+ "dev": true,
+ "requires": {
+ "async": "^2.6.1",
+ "rimraf": "^2.6.2"
+ },
+ "dependencies": {
+ "async": {
+ "version": "2.6.3",
+ "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
+ "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
+ "dev": true,
+ "requires": {
+ "lodash": "^4.17.14"
+ }
+ },
+ "rimraf": {
+ "version": "2.7.1",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
+ "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
+ "dev": true,
+ "requires": {
+ "glob": "^7.1.3"
+ }
+ }
+ }
+ },
+ "grunt-contrib-copy": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/grunt-contrib-copy/-/grunt-contrib-copy-1.0.0.tgz",
+ "integrity": "sha1-cGDGWB6QS4qw0A8HbgqPbj58NXM=",
+ "dev": true,
+ "requires": {
+ "chalk": "^1.1.1",
+ "file-sync-cmp": "^0.1.0"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
+ "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
+ "dev": true
+ },
+ "ansi-styles": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
+ "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
+ "dev": true
+ },
+ "chalk": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^2.2.1",
+ "escape-string-regexp": "^1.0.2",
+ "has-ansi": "^2.0.0",
+ "strip-ansi": "^3.0.0",
+ "supports-color": "^2.0.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^2.0.0"
+ }
+ },
+ "supports-color": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
+ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
+ "dev": true
+ }
+ }
+ },
"grunt-known-options": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-1.1.1.tgz",
}
}
},
+ "grunt-mkdir": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/grunt-mkdir/-/grunt-mkdir-1.1.0.tgz",
+ "integrity": "sha512-FRE17OYVveNbVJFX8GPGa5bzH2ZiAdBx3q0Kwk2Dg6l+TzLGaTdufUxiUWUbS2MERFacnmXZwDDOR5ZbYW0o+Q==",
+ "dev": true
+ },
"grunt-ts": {
"version": "6.0.0-beta.22",
"resolved": "https://registry.npmjs.org/grunt-ts/-/grunt-ts-6.0.0-beta.22.tgz",
},
"dependencies": {
"ajv": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.0.3.tgz",
- "integrity": "sha512-R50QRlXSxqXcQP5SvKUrw8VZeypvo12i2IX0EeR5PiZ7bEKeHWgzgo264LDadUsCU42lTJVhFikTqJwNeH34gQ==",
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.1.0.tgz",
+ "integrity": "sha512-svS9uILze/cXbH0z2myCK2Brqprx/+JJYK5pHicT/GQiBfzzhUVAIT6MwqJg8y4xV/zoGsUeuPuwtoiKSGE15g==",
"dev": true,
"requires": {
"fast-deep-equal": "^3.1.1",
"main": "dist/start.js",
"scripts": {
"prestart": "npm run build",
- "start": "node -r source-map-support/register dist/start.js",
- "start:dev": "ts-node-dev -- src/start.ts",
- "start:dev:debug": "ts-node-dev --inspect -- src/start.ts",
- "start:debug": "node -r source-map-support/register --inspect dist/start.js",
- "start:prof": "node -r source-map-support/register --prof dist/start.js",
- "start:doctorprof": "clinic doctor -- node -r source-map-support/register dist/start.js",
- "start:flameprof": "clinic flame -- node -r source-map-support/register dist/start.js",
- "start:bubbleprof": "clinic bubbleprof -- node -r source-map-support/register dist/start.js",
+ "start": "cross-env NODE_ENV=production node -r source-map-support/register dist/start.js",
+ "start:debug": "cross-env NODE_ENV=production node -r source-map-support/register --inspect dist/start.js",
+ "start:prof": "cross-env NODE_ENV=production node -r source-map-support/register --prof dist/start.js",
+ "start:doctorprof": "cross-env NODE_ENV=production clinic doctor -- node -r source-map-support/register dist/start.js",
+ "start:flameprof": "cross-env NODE_ENV=production clinic flame -- node -r source-map-support/register dist/start.js",
+ "start:bubbleprof": "cross-env NODE_ENV=production clinic bubbleprof -- node -r source-map-support/register dist/start.js",
"grunt": "grunt",
- "build": "npm run build:prod",
+ "build": "npm run grunt",
"build:mta": "mbt build",
- "build:prod": "npm run grunt",
- "build:dev": "npm run grunt -- ts:dev",
- "build:clean": "rimraf ./dist",
+ "build:watch": "npm run grunt -- ts:buildWatch",
"lint": "cross-env TIMING=1 eslint --ext .js,.ts src",
"lint:fix": "cross-env TIMING=1 eslint --fix --ext .js,.ts src",
"import-sort": "npx import-sort-cli --write 'src/**/*.ts{,x}'",
"utf-8-validate": "^5.0.4"
},
"devDependencies": {
- "@types/node": "^14.14.25",
+ "@types/node": "^14.14.27",
"@types/uuid": "^8.3.0",
"@types/ws": "^7.4.0",
"@typescript-eslint/eslint-plugin": "^4.15.0",
"@typescript-eslint/parser": "^4.15.0",
"clinic": "^8.0.1",
"cross-env": "^7.0.3",
- "eslint": "^7.19.0",
+ "eslint": "^7.20.0",
"grunt": "^1.3.0",
+ "grunt-contrib-clean": "^2.0.0",
+ "grunt-contrib-copy": "^1.0.0",
+ "grunt-mkdir": "^1.1.0",
"grunt-ts": "^6.0.0-beta.22",
"mbt": "^1.1.0",
"npm-check": "^5.9.2",
- "rimraf": "^3.0.2",
- "ts-node-dev": "^1.1.1",
"typescript": "^4.1.5"
}
}
"workerPoolMaxSize": 16,
"stationTemplateURLs": [
{
- "file": "./src/assets/station-templates/siemens.station-template.json",
+ "file": "siemens.station-template.json",
"numberOfStations": 1
},
{
- "file": "./src/assets/station-templates/keba.station-template.json",
+ "file": "keba.station-template.json",
"numberOfStations": 2
},
{
- "file": "./src/assets/station-templates/abb.station-template.json",
+ "file": "abb.station-template.json",
"numberOfStations": 2
},
{
- "file": "./src/assets/station-templates/evlink.station-template.json",
+ "file": "evlink.station-template.json",
"numberOfStations": 4
},
{
- "file": "./src/assets/station-templates/schneider.station-template.json",
+ "file": "schneider.station-template.json",
"numberOfStations": 1
}
],
-Subproject commit 51d08d86d46e58e739deb9a75f9044f78b3c96fe
+Subproject commit e72cca60a40fc383ff1c4f35aa93fff7fc169968
{
- "authorizationFile": "./src/assets/authorization-tags.json",
+ "authorizationFile": "authorization-tags.json",
"baseName": "CS-ABB",
"nameSuffix": "-Roaming",
"chargePointModel": "MD_TERRA_53",
{
- "authorizationFile": "./src/assets/authorization-tags.json",
+ "authorizationFile": "authorization-tags.json",
"baseName": "CS-ABB",
"chargePointModel": "MD_TERRA_53",
"chargePointVendor": "ABB",
{
- "authorizationFile": "./src/assets/authorization-tags.json",
+ "authorizationFile": "authorization-tags.json",
"baseName": "CS-EVLINK",
"chargePointModel": "MONOBLOCK",
"chargePointVendor": "Schneider Electric",
{
- "authorizationFile": "./src/assets/authorization-tags.json",
+ "authorizationFile": "authorization-tags.json",
"baseName": "CS-KEBA",
"chargePointModel": "KC-P30-ESS400C2-E0R",
"chargePointVendor": "Keba AG",
{
- "authorizationFile": "./src/assets/authorization-tags.json",
+ "authorizationFile": "authorization-tags.json",
"baseName": "CS-SCHNEIDER",
"chargePointModel": "MONOBLOCK",
"chargePointVendor": "Schneider Electric",
{
- "authorizationFile": "./src/assets/authorization-tags.json",
+ "authorizationFile": "authorization-tags.json",
"baseName": "CS-SCHNEIDER",
"chargePointModel": "MONOBLOCK",
"chargePointVendor": "Schneider Electric",
{
- "authorizationFile": "./src/assets/authorization-tags.json",
+ "authorizationFile": "authorization-tags.json",
"baseName": "CS-SIEMENS",
"fixedName": true,
"chargePointModel": "SIEMENSXX213",
{
- "authorizationFile": "./src/assets/authorization-tags.json",
+ "authorizationFile": "authorization-tags.json",
"baseName": "CS-BASIC",
"chargePointModel": "Simulator simple",
"chargePointVendor": "Ovomaltin",
{
- "authorizationFile": "./src/assets/authorization-tags.json",
+ "authorizationFile": "authorization-tags.json",
"baseName": "CS-BASIC",
"chargePointModel": "Simulator simple",
"chargePointVendor": "Ovomaltin",
{
- "authorizationFile": "./src/assets/authorization-tags.json",
+ "authorizationFile": "authorization-tags.json",
"baseName": "CS-SIMU",
"chargePointModel": "Simulator connectors",
"chargePointVendor": "Ovomaltin",
import WorkerFactory from '../worker/WorkerFactory';
import Wrk from '../worker/Wrk';
import { isMainThread } from 'worker_threads';
+import path from 'path';
export default class Bootstrap {
private static instance: Bootstrap;
private constructor() {
this.started = false;
- this.workerScript = './dist/charging-station/StationWorker.js';
+ this.workerScript = path.join(path.resolve(__dirname, '../'), 'charging-station', 'StationWorker.js');
}
public static getInstance(): Bootstrap {
for (let index = 1; index <= nbStations; index++) {
const workerData: StationWorkerData = {
index,
- templateFile: stationURL.file
+ templateFile: path.join(path.resolve(__dirname, '../'), 'assets', 'station-templates', path.basename(stationURL.file))
};
await this.getWorkerImplementationInstance().addElement(workerData);
numStationsTotal++;
import crypto from 'crypto';
import fs from 'fs';
import logger from '../utils/Logger';
+import path from 'path';
export default class ChargingStation {
public stationTemplateFile: string;
}
private getAuthorizationFile(): string {
- return this.stationInfo.authorizationFile && this.stationInfo.authorizationFile;
+ return this.stationInfo.authorizationFile && path.join(path.resolve(__dirname, '../'), 'assets', path.basename(this.stationInfo.authorizationFile));
}
private getAuthorizedTags(): string[] {
import Bootstrap from '../charging-station/Bootstrap';
import { WorkerProcessType } from '../types/Worker';
import fs from 'fs';
+import path from 'path';
export default class Configuration {
- private static configurationFilePath = './src/assets/config.json';
+ private static configurationFilePath = path.join(path.resolve(__dirname, '../'), 'assets', 'config.json');
private static configurationFileWatcher: fs.FSWatcher;
private static configuration: ConfigurationData;