"plugin:import/warnings",
"plugin:import/typescript",
"plugin:jsdoc/recommended",
- "prettier"
+ "plugin:prettier/recommended"
],
"plugins": ["import", "jsdoc", "@typescript-eslint"],
"settings": {
}
},
"rules": {
- "indent": "off",
- "@typescript-eslint/indent": [
- "error",
- 2,
- {
- "SwitchCase": 1,
- "CallExpression": {
- "arguments": 1
- },
- "FunctionDeclaration": {
- "parameters": 2,
- "body": 1
- },
- "FunctionExpression": {
- "parameters": 2,
- "body": 1
- }
- }
- ],
"@typescript-eslint/array-type": "off",
"semi": "off",
"@typescript-eslint/semi": ["error", "always"],
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/no-misused-promises": "error",
- "curly": "error",
+ "curly": ["error", "all"],
"brace-style": "error",
"eqeqeq": ["error", "always"],
"no-else-return": "error",
"max-len": [
"warn",
{
- "code": 180,
- "ignoreComments": true,
- "ignoreUrls": true,
- "ignoreStrings": true,
- "ignoreTemplateLiterals": true,
- "ignoreRegExpLiterals": true,
- "ignorePattern": "(^(import|export)|(public|private))\\s.+;"
+ "code": 80,
+ "ignoreUrls": true
}
],
"no-lonely-if": "error",
"exceptAfterSingleLine": true
}
],
- "quotes": ["error", "single"]
+ "quotes": [
+ "error",
+ "single",
+ {
+ "avoidEscape": true,
+ "allowTemplateLiterals": false
+ }
+ ]
},
"overrides": [
{
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jsdoc": "^37.9.6",
"eslint-plugin-node": "^11.1.0",
+ "eslint-plugin-prettier": "^4.0.0",
"expect": "^27.5.1",
"mocha": "^9.2.1",
"mochawesome": "^7.1.1",
"semver": "bin/semver.js"
}
},
+ "node_modules/eslint-plugin-prettier": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz",
+ "integrity": "sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==",
+ "dev": true,
+ "dependencies": {
+ "prettier-linter-helpers": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ },
+ "peerDependencies": {
+ "eslint": ">=7.28.0",
+ "prettier": ">=2.0.0"
+ },
+ "peerDependenciesMeta": {
+ "eslint-config-prettier": {
+ "optional": true
+ }
+ }
+ },
"node_modules/eslint-scope": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
"devOptional": true
},
+ "node_modules/fast-diff": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz",
+ "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==",
+ "dev": true
+ },
"node_modules/fast-glob": {
"version": "3.2.11",
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz",
"node": ">=10.13.0"
}
},
+ "node_modules/prettier-linter-helpers": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz",
+ "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==",
+ "dev": true,
+ "dependencies": {
+ "fast-diff": "^1.1.2"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
"node_modules/pretty-bytes": {
"version": "5.6.0",
"resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz",
}
}
},
+ "eslint-plugin-prettier": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz",
+ "integrity": "sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==",
+ "dev": true,
+ "requires": {
+ "prettier-linter-helpers": "^1.0.0"
+ }
+ },
"eslint-scope": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
"devOptional": true
},
+ "fast-diff": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz",
+ "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==",
+ "dev": true
+ },
"fast-glob": {
"version": "3.2.11",
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz",
"integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==",
"dev": true
},
+ "prettier-linter-helpers": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz",
+ "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==",
+ "dev": true,
+ "requires": {
+ "fast-diff": "^1.1.2"
+ }
+ },
"pretty-bytes": {
"version": "5.6.0",
"resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jsdoc": "^37.9.6",
"eslint-plugin-node": "^11.1.0",
+ "eslint-plugin-prettier": "^4.0.0",
"expect": "^27.5.1",
"mocha": "^9.2.1",
"mochawesome": "^7.1.1",
string,
AutomaticTransactionGenerator
>();
+
public started: boolean;
private readonly chargingStation: ChargingStation;
private readonly connectorsStatus: Map<number, Status>;
string,
OCPPIncomingRequestService
>();
+
protected chargingStation: ChargingStation;
protected constructor(chargingStation: ChargingStation) {
string,
OCPPRequestService
>();
+
protected readonly chargingStation: ChargingStation;
private readonly ocppResponseService: OCPPResponseService;
meterType?: string,
params?: SendParams
): Promise<BootNotificationResponse>;
+
public abstract sendStatusNotification(
connectorId: number,
status: ChargePointStatus,
errorCode?: ChargePointErrorCode
): Promise<void>;
+
public abstract sendAuthorize(connectorId: number, idTag?: string): Promise<AuthorizeResponse>;
public abstract sendStartTransaction(
connectorId: number,
idTag?: string
): Promise<StartTransactionResponse>;
+
public abstract sendStopTransaction(
transactionId: number,
meterStop: number,
idTag?: string,
reason?: StopTransactionReason
): Promise<StopTransactionResponse>;
+
public abstract sendMeterValues(
connectorId: number,
transactionId: number,
interval: number
): Promise<void>;
+
public abstract sendTransactionBeginMeterValues(
connectorId: number,
transactionId: number,
beginMeterValue: MeterValue
): Promise<void>;
+
public abstract sendTransactionEndMeterValues(
connectorId: number,
transactionId: number,
endMeterValue: MeterValue
): Promise<void>;
+
public abstract sendDiagnosticsStatusNotification(
diagnosticsStatus: DiagnosticsStatus
): Promise<void>;
string,
OCPPResponseService
>();
+
protected readonly chargingStation: ChargingStation;
protected constructor(chargingStation: ChargingStation) {
string,
PerformanceStatistics
>();
+
private readonly objId: string;
private readonly objName: string;
private performanceObserver: PerformanceObserver;
'assets',
'config.json'
);
+
private static configurationFileWatcher: fs.FSWatcher;
private static configuration: ConfigurationData | null = null;
private static configurationChangeCallback: () => Promise<void>;
static readonly OCPP_CONFIGURATION_RESPONSE_ACCEPTED = Object.freeze({
status: ConfigurationStatus.ACCEPTED,
});
+
static readonly OCPP_CONFIGURATION_RESPONSE_REJECTED = Object.freeze({
status: ConfigurationStatus.REJECTED,
});
+
static readonly OCPP_CONFIGURATION_RESPONSE_REBOOT_REQUIRED = Object.freeze({
status: ConfigurationStatus.REBOOT_REQUIRED,
});
+
static readonly OCPP_CONFIGURATION_RESPONSE_NOT_SUPPORTED = Object.freeze({
status: ConfigurationStatus.NOT_SUPPORTED,
});
+
static readonly OCPP_SET_CHARGING_PROFILE_RESPONSE_ACCEPTED = Object.freeze({
status: ChargingProfileStatus.ACCEPTED,
});
+
static readonly OCPP_SET_CHARGING_PROFILE_RESPONSE_REJECTED = Object.freeze({
status: ChargingProfileStatus.REJECTED,
});
+
static readonly OCPP_SET_CHARGING_PROFILE_RESPONSE_NOT_SUPPORTED = Object.freeze({
status: ChargingProfileStatus.NOT_SUPPORTED,
});
+
static readonly OCPP_CLEAR_CHARGING_PROFILE_RESPONSE_ACCEPTED = Object.freeze({
status: ClearChargingProfileStatus.ACCEPTED,
});
+
static readonly OCPP_CLEAR_CHARGING_PROFILE_RESPONSE_UNKNOWN = Object.freeze({
status: ClearChargingProfileStatus.UNKNOWN,
});
+
static readonly OCPP_RESPONSE_UNLOCKED = Object.freeze({ status: UnlockStatus.UNLOCKED });
static readonly OCPP_RESPONSE_UNLOCK_FAILED = Object.freeze({
status: UnlockStatus.UNLOCK_FAILED,
});
+
static readonly OCPP_RESPONSE_UNLOCK_NOT_SUPPORTED = Object.freeze({
status: UnlockStatus.NOT_SUPPORTED,
});
+
static readonly OCPP_AVAILABILITY_RESPONSE_ACCEPTED = Object.freeze({
status: AvailabilityStatus.ACCEPTED,
});
+
static readonly OCPP_AVAILABILITY_RESPONSE_REJECTED = Object.freeze({
status: AvailabilityStatus.REJECTED,
});
+
static readonly OCPP_AVAILABILITY_RESPONSE_SCHEDULED = Object.freeze({
status: AvailabilityStatus.SCHEDULED,
});
+
static readonly OCPP_TRIGGER_MESSAGE_RESPONSE_ACCEPTED = Object.freeze({
status: TriggerMessageStatus.ACCEPTED,
});
+
static readonly OCPP_TRIGGER_MESSAGE_RESPONSE_REJECTED = Object.freeze({
status: TriggerMessageStatus.REJECTED,
});
+
static readonly OCPP_TRIGGER_MESSAGE_RESPONSE_NOT_IMPLEMENTED = Object.freeze({
status: TriggerMessageStatus.NOT_IMPLEMENTED,
});