"@mikro-orm/reflection": "^5.6.3",
"@mikro-orm/sqlite": "^5.6.3",
"ajv": "^8.12.0",
- "ajv-draft-04": "^1.0.0",
"ajv-formats": "^2.1.1",
"basic-ftp": "^5.0.2",
"chalk": "^4.1.2",
"url": "https://github.com/sponsors/epoberezkin"
}
},
- "node_modules/ajv-draft-04": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/ajv-draft-04/-/ajv-draft-04-1.0.0.tgz",
- "integrity": "sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==",
- "peerDependencies": {
- "ajv": "^8.5.0"
- },
- "peerDependenciesMeta": {
- "ajv": {
- "optional": true
- }
- }
- },
"node_modules/ajv-formats": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz",
"uri-js": "^4.2.2"
}
},
- "ajv-draft-04": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/ajv-draft-04/-/ajv-draft-04-1.0.0.tgz",
- "integrity": "sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw=="
- },
"ajv-formats": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz",
"@mikro-orm/reflection": "^5.6.3",
"@mikro-orm/sqlite": "^5.6.3",
"ajv": "^8.12.0",
- "ajv-draft-04": "^1.0.0",
"ajv-formats": "^2.1.1",
"basic-ftp": "^5.0.2",
"chalk": "^4.1.2",
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:AuthorizeRequest",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:AuthorizeRequest",
"title": "AuthorizeRequest",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:AuthorizeResponse",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:AuthorizeResponse",
"title": "AuthorizeResponse",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:BootNotificationRequest",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:BootNotificationRequest",
"title": "BootNotificationRequest",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:BootNotificationResponse",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:BootNotificationResponse",
"title": "BootNotificationResponse",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:ChangeAvailabilityRequest",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:ChangeAvailabilityRequest",
"title": "ChangeAvailabilityRequest",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:ChangeConfigurationRequest",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:ChangeConfigurationRequest",
"title": "ChangeConfigurationRequest",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:ClearCacheRequest",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:ClearCacheRequest",
"title": "ClearCacheRequest",
"type": "object",
"properties": {},
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:ClearChargingProfileRequest",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:ClearChargingProfileRequest",
"title": "ClearChargingProfileRequest",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:DataTransferRequest",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:DataTransferRequest",
"title": "DataTransferRequest",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:DataTransferResponse",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:DataTransferResponse",
"title": "DataTransferResponse",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:DiagnosticsStatusNotificationRequest",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:DiagnosticsStatusNotificationRequest",
"title": "DiagnosticsStatusNotificationRequest",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:DiagnosticsStatusNotificationResponse",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:DiagnosticsStatusNotificationResponse",
"title": "DiagnosticsStatusNotificationResponse",
"type": "object",
"properties": {},
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:GetCompositeScheduleRequest",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:GetCompositeScheduleRequest",
"title": "GetCompositeScheduleRequest",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:GetConfigurationRequest",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:GetConfigurationRequest",
"title": "GetConfigurationRequest",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:GetDiagnosticsRequest",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:GetDiagnosticsRequest",
"title": "GetDiagnosticsRequest",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:HeartbeatRequest",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:HeartbeatRequest",
"title": "HeartbeatRequest",
"type": "object",
"properties": {},
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:HeartbeatResponse",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:HeartbeatResponse",
"title": "HeartbeatResponse",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:MeterValuesRequest",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:MeterValuesRequest",
"title": "MeterValuesRequest",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:MeterValuesResponse",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:MeterValuesResponse",
"title": "MeterValuesResponse",
"type": "object",
"properties": {},
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:RemoteStartTransactionRequest",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:RemoteStartTransactionRequest",
"title": "RemoteStartTransactionRequest",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:RemoteStopTransactionRequest",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:RemoteStopTransactionRequest",
"title": "RemoteStopTransactionRequest",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:ResetRequest",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:ResetRequest",
"title": "ResetRequest",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:SetChargingProfileRequest",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:SetChargingProfileRequest",
"title": "SetChargingProfileRequest",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:StartTransactionRequest",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:StartTransactionRequest",
"title": "StartTransactionRequest",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:StartTransactionResponse",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:StartTransactionResponse",
"title": "StartTransactionResponse",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:StatusNotificationRequest",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:StatusNotificationRequest",
"title": "StatusNotificationRequest",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:StatusNotificationResponse",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:StatusNotificationResponse",
"title": "StatusNotificationResponse",
"type": "object",
"properties": {},
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:StopTransactionRequest",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:StopTransactionRequest",
"title": "StopTransactionRequest",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:StopTransactionResponse",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:StopTransactionResponse",
"title": "StopTransactionResponse",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:TriggerMessageRequest",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:TriggerMessageRequest",
"title": "TriggerMessageRequest",
"type": "object",
"properties": {
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "id": "urn:OCPP:1.6:2019:12:UnlockConnectorRequest",
+ "$schema": "http://json-schema.org/draft-07/schema",
+ "$id": "urn:OCPP:1.6:2019:12:UnlockConnectorRequest",
"title": "UnlockConnectorRequest",
"type": "object",
"properties": {
import { AsyncResource } from 'async_hooks';
import Ajv, { type JSONSchemaType } from 'ajv';
-import AjvDraft04 from 'ajv-draft-04';
import ajvFormats from 'ajv-formats';
import OCPPError from '../../exception/OCPPError';
import type { HandleErrorParams } from '../../types/Error';
import type { JsonType } from '../../types/JsonType';
-import { OCPPVersion } from '../../types/ocpp/OCPPVersion';
+import type { OCPPVersion } from '../../types/ocpp/OCPPVersion';
import type { IncomingRequestCommand } from '../../types/ocpp/Requests';
import logger from '../../utils/Logger';
import type ChargingStation from '../ChargingStation';
protected constructor(version: OCPPVersion) {
this.version = version;
- switch (this.version) {
- case OCPPVersion.VERSION_16:
- this.ajv = new AjvDraft04();
- break;
- case OCPPVersion.VERSION_20:
- case OCPPVersion.VERSION_201:
- this.ajv = new Ajv();
- break;
- }
+ this.ajv = new Ajv();
ajvFormats(this.ajv);
this.asyncResource = new AsyncResource(moduleName);
this.incomingRequestHandler.bind(this);
import Ajv, { type JSONSchemaType } from 'ajv';
-import AjvDraft04 from 'ajv-draft-04';
import ajvFormats from 'ajv-formats';
import OCPPError from '../../exception/OCPPError';
import type { JsonObject, JsonType } from '../../types/JsonType';
import { ErrorType } from '../../types/ocpp/ErrorType';
import { MessageType } from '../../types/ocpp/MessageType';
-import { OCPPVersion } from '../../types/ocpp/OCPPVersion';
+import type { OCPPVersion } from '../../types/ocpp/OCPPVersion';
import {
type ErrorCallback,
type IncomingRequestCommand,
protected constructor(version: OCPPVersion, ocppResponseService: OCPPResponseService) {
this.version = version;
- switch (this.version) {
- case OCPPVersion.VERSION_16:
- this.ajv = new AjvDraft04();
- break;
- case OCPPVersion.VERSION_20:
- case OCPPVersion.VERSION_201:
- this.ajv = new Ajv();
- break;
- }
+ this.ajv = new Ajv();
ajvFormats(this.ajv);
this.ocppResponseService = ocppResponseService;
this.requestHandler.bind(this);
import Ajv, { type JSONSchemaType } from 'ajv';
-import AjvDraft04 from 'ajv-draft-04';
import ajvFormats from 'ajv-formats';
import OCPPError from '../../exception/OCPPError';
import type { JsonType } from '../../types/JsonType';
-import { OCPPVersion } from '../../types/ocpp/OCPPVersion';
+import type { OCPPVersion } from '../../types/ocpp/OCPPVersion';
import type { RequestCommand } from '../../types/ocpp/Requests';
import logger from '../../utils/Logger';
import type ChargingStation from '../ChargingStation';
protected constructor(version: OCPPVersion) {
this.version = version;
- switch (this.version) {
- case OCPPVersion.VERSION_16:
- this.ajv = new AjvDraft04();
- break;
- case OCPPVersion.VERSION_20:
- case OCPPVersion.VERSION_201:
- this.ajv = new Ajv();
- break;
- }
+ this.ajv = new Ajv();
ajvFormats(this.ajv);
this.responseHandler.bind(this);
this.validateResponsePayload.bind(this);