From: Jérôme Benoit Date: Sat, 7 Jan 2023 22:27:54 +0000 (+0100) Subject: Add missing OCPP 1.6 command payload OCA JSON schemas X-Git-Tag: v1.1.89~14 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=bfbda738d80c83b76e2d38f221bfe305a4a89c2b;p=e-mobility-charging-stations-simulator.git Add missing OCPP 1.6 command payload OCA JSON schemas Signed-off-by: Jérôme Benoit --- diff --git a/src/assets/json-schemas/ocpp/1.6/CancelReservation.json b/src/assets/json-schemas/ocpp/1.6/CancelReservation.json new file mode 100755 index 00000000..c797a9df --- /dev/null +++ b/src/assets/json-schemas/ocpp/1.6/CancelReservation.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "urn:OCPP:1.6:2019:12:CancelReservationRequest", + "title": "CancelReservationRequest", + "type": "object", + "properties": { + "reservationId": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": ["reservationId"] +} diff --git a/src/assets/json-schemas/ocpp/1.6/CancelReservationResponse.json b/src/assets/json-schemas/ocpp/1.6/CancelReservationResponse.json new file mode 100755 index 00000000..c26deddb --- /dev/null +++ b/src/assets/json-schemas/ocpp/1.6/CancelReservationResponse.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "urn:OCPP:1.6:2019:12:CancelReservationResponse", + "title": "CancelReservationResponse", + "type": "object", + "properties": { + "status": { + "type": "string", + "additionalProperties": false, + "enum": ["Accepted", "Rejected"] + } + }, + "additionalProperties": false, + "required": ["status"] +} diff --git a/src/assets/json-schemas/ocpp/1.6/ChangeAvailabilityResponse.json b/src/assets/json-schemas/ocpp/1.6/ChangeAvailabilityResponse.json new file mode 100755 index 00000000..59a0a9e3 --- /dev/null +++ b/src/assets/json-schemas/ocpp/1.6/ChangeAvailabilityResponse.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "urn:OCPP:1.6:2019:12:ChangeAvailabilityResponse", + "title": "ChangeAvailabilityResponse", + "type": "object", + "properties": { + "status": { + "type": "string", + "additionalProperties": false, + "enum": ["Accepted", "Rejected", "Scheduled"] + } + }, + "additionalProperties": false, + "required": ["status"] +} diff --git a/src/assets/json-schemas/ocpp/1.6/ChangeConfigurationResponse.json b/src/assets/json-schemas/ocpp/1.6/ChangeConfigurationResponse.json new file mode 100755 index 00000000..b9e92a06 --- /dev/null +++ b/src/assets/json-schemas/ocpp/1.6/ChangeConfigurationResponse.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "urn:OCPP:1.6:2019:12:ChangeConfigurationResponse", + "title": "ChangeConfigurationResponse", + "type": "object", + "properties": { + "status": { + "type": "string", + "additionalProperties": false, + "enum": ["Accepted", "Rejected", "RebootRequired", "NotSupported"] + } + }, + "additionalProperties": false, + "required": ["status"] +} diff --git a/src/assets/json-schemas/ocpp/1.6/ClearCacheResponse.json b/src/assets/json-schemas/ocpp/1.6/ClearCacheResponse.json new file mode 100755 index 00000000..ceb8d9f4 --- /dev/null +++ b/src/assets/json-schemas/ocpp/1.6/ClearCacheResponse.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "urn:OCPP:1.6:2019:12:ClearCacheResponse", + "title": "ClearCacheResponse", + "type": "object", + "properties": { + "status": { + "type": "string", + "additionalProperties": false, + "enum": ["Accepted", "Rejected"] + } + }, + "additionalProperties": false, + "required": ["status"] +} diff --git a/src/assets/json-schemas/ocpp/1.6/ClearChargingProfileResponse.json b/src/assets/json-schemas/ocpp/1.6/ClearChargingProfileResponse.json new file mode 100755 index 00000000..2eeb1565 --- /dev/null +++ b/src/assets/json-schemas/ocpp/1.6/ClearChargingProfileResponse.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "urn:OCPP:1.6:2019:12:ClearChargingProfileResponse", + "title": "ClearChargingProfileResponse", + "type": "object", + "properties": { + "status": { + "type": "string", + "additionalProperties": false, + "enum": ["Accepted", "Unknown"] + } + }, + "additionalProperties": false, + "required": ["status"] +} diff --git a/src/assets/json-schemas/ocpp/1.6/GetConfigurationResponse.json b/src/assets/json-schemas/ocpp/1.6/GetConfigurationResponse.json new file mode 100755 index 00000000..875fa180 --- /dev/null +++ b/src/assets/json-schemas/ocpp/1.6/GetConfigurationResponse.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "urn:OCPP:1.6:2019:12:GetConfigurationResponse", + "title": "GetConfigurationResponse", + "type": "object", + "properties": { + "configurationKey": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "maxLength": 50 + }, + "readonly": { + "type": "boolean" + }, + "value": { + "type": "string", + "maxLength": 500 + } + }, + "additionalProperties": false, + "required": ["key", "readonly"] + } + }, + "unknownKey": { + "type": "array", + "items": { + "type": "string", + "maxLength": 50 + } + } + }, + "additionalProperties": false +} diff --git a/src/assets/json-schemas/ocpp/1.6/GetDiagnosticsResponse.json b/src/assets/json-schemas/ocpp/1.6/GetDiagnosticsResponse.json new file mode 100755 index 00000000..948bfdfd --- /dev/null +++ b/src/assets/json-schemas/ocpp/1.6/GetDiagnosticsResponse.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "urn:OCPP:1.6:2019:12:GetDiagnosticsResponse", + "title": "GetDiagnosticsResponse", + "type": "object", + "properties": { + "fileName": { + "type": "string", + "maxLength": 255 + } + }, + "additionalProperties": false +} diff --git a/src/assets/json-schemas/ocpp/1.6/GetLocalListVersion.json b/src/assets/json-schemas/ocpp/1.6/GetLocalListVersion.json new file mode 100755 index 00000000..971f3872 --- /dev/null +++ b/src/assets/json-schemas/ocpp/1.6/GetLocalListVersion.json @@ -0,0 +1,8 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "urn:OCPP:1.6:2019:12:GetLocalListVersionRequest", + "title": "GetLocalListVersionRequest", + "type": "object", + "properties": {}, + "additionalProperties": false +} diff --git a/src/assets/json-schemas/ocpp/1.6/GetLocalListVersionResponse.json b/src/assets/json-schemas/ocpp/1.6/GetLocalListVersionResponse.json new file mode 100755 index 00000000..5f763121 --- /dev/null +++ b/src/assets/json-schemas/ocpp/1.6/GetLocalListVersionResponse.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "urn:OCPP:1.6:2019:12:GetLocalListVersionResponse", + "title": "GetLocalListVersionResponse", + "type": "object", + "properties": { + "listVersion": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": ["listVersion"] +} diff --git a/src/assets/json-schemas/ocpp/1.6/RemoteStartTransactionResponse.json b/src/assets/json-schemas/ocpp/1.6/RemoteStartTransactionResponse.json new file mode 100755 index 00000000..6453d946 --- /dev/null +++ b/src/assets/json-schemas/ocpp/1.6/RemoteStartTransactionResponse.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "urn:OCPP:1.6:2019:12:RemoteStartTransactionResponse", + "title": "RemoteStartTransactionResponse", + "type": "object", + "properties": { + "status": { + "type": "string", + "additionalProperties": false, + "enum": ["Accepted", "Rejected"] + } + }, + "additionalProperties": false, + "required": ["status"] +} diff --git a/src/assets/json-schemas/ocpp/1.6/RemoteStopTransactionResponse.json b/src/assets/json-schemas/ocpp/1.6/RemoteStopTransactionResponse.json new file mode 100755 index 00000000..68e9c79b --- /dev/null +++ b/src/assets/json-schemas/ocpp/1.6/RemoteStopTransactionResponse.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "urn:OCPP:1.6:2019:12:RemoteStopTransactionResponse", + "title": "RemoteStopTransactionResponse", + "type": "object", + "properties": { + "status": { + "type": "string", + "additionalProperties": false, + "enum": ["Accepted", "Rejected"] + } + }, + "additionalProperties": false, + "required": ["status"] +} diff --git a/src/assets/json-schemas/ocpp/1.6/ReserveNow.json b/src/assets/json-schemas/ocpp/1.6/ReserveNow.json new file mode 100755 index 00000000..89d7ac49 --- /dev/null +++ b/src/assets/json-schemas/ocpp/1.6/ReserveNow.json @@ -0,0 +1,28 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "urn:OCPP:1.6:2019:12:ReserveNowRequest", + "title": "ReserveNowRequest", + "type": "object", + "properties": { + "connectorId": { + "type": "integer" + }, + "expiryDate": { + "type": "string", + "format": "date-time" + }, + "idTag": { + "type": "string", + "maxLength": 20 + }, + "parentIdTag": { + "type": "string", + "maxLength": 20 + }, + "reservationId": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": ["connectorId", "expiryDate", "idTag", "reservationId"] +} diff --git a/src/assets/json-schemas/ocpp/1.6/ReserveNowResponse.json b/src/assets/json-schemas/ocpp/1.6/ReserveNowResponse.json new file mode 100755 index 00000000..8bc82da4 --- /dev/null +++ b/src/assets/json-schemas/ocpp/1.6/ReserveNowResponse.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "urn:OCPP:1.6:2019:12:ReserveNowResponse", + "title": "ReserveNowResponse", + "type": "object", + "properties": { + "status": { + "type": "string", + "additionalProperties": false, + "enum": ["Accepted", "Faulted", "Occupied", "Rejected", "Unavailable"] + } + }, + "additionalProperties": false, + "required": ["status"] +} diff --git a/src/assets/json-schemas/ocpp/1.6/ResetResponse.json b/src/assets/json-schemas/ocpp/1.6/ResetResponse.json new file mode 100755 index 00000000..0d9a8c5a --- /dev/null +++ b/src/assets/json-schemas/ocpp/1.6/ResetResponse.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "urn:OCPP:1.6:2019:12:ResetResponse", + "title": "ResetResponse", + "type": "object", + "properties": { + "status": { + "type": "string", + "additionalProperties": false, + "enum": ["Accepted", "Rejected"] + } + }, + "additionalProperties": false, + "required": ["status"] +} diff --git a/src/assets/json-schemas/ocpp/1.6/SendLocalList.json b/src/assets/json-schemas/ocpp/1.6/SendLocalList.json new file mode 100755 index 00000000..6ec3d011 --- /dev/null +++ b/src/assets/json-schemas/ocpp/1.6/SendLocalList.json @@ -0,0 +1,52 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "urn:OCPP:1.6:2019:12:SendLocalListRequest", + "title": "SendLocalListRequest", + "type": "object", + "properties": { + "listVersion": { + "type": "integer" + }, + "localAuthorizationList": { + "type": "array", + "items": { + "type": "object", + "properties": { + "idTag": { + "type": "string", + "maxLength": 20 + }, + "idTagInfo": { + "type": "object", + "properties": { + "expiryDate": { + "type": "string", + "format": "date-time" + }, + "parentIdTag": { + "type": "string", + "maxLength": 20 + }, + "status": { + "type": "string", + "additionalProperties": false, + "enum": ["Accepted", "Blocked", "Expired", "Invalid", "ConcurrentTx"] + } + }, + "additionalProperties": false, + "required": ["status"] + } + }, + "additionalProperties": false, + "required": ["idTag"] + } + }, + "updateType": { + "type": "string", + "additionalProperties": false, + "enum": ["Differential", "Full"] + } + }, + "additionalProperties": false, + "required": ["listVersion", "updateType"] +} diff --git a/src/assets/json-schemas/ocpp/1.6/SendLocalListResponse.json b/src/assets/json-schemas/ocpp/1.6/SendLocalListResponse.json new file mode 100755 index 00000000..b8c528d3 --- /dev/null +++ b/src/assets/json-schemas/ocpp/1.6/SendLocalListResponse.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "urn:OCPP:1.6:2019:12:SendLocalListResponse", + "title": "SendLocalListResponse", + "type": "object", + "properties": { + "status": { + "type": "string", + "additionalProperties": false, + "enum": ["Accepted", "Failed", "NotSupported", "VersionMismatch"] + } + }, + "additionalProperties": false, + "required": ["status"] +} diff --git a/src/assets/json-schemas/ocpp/1.6/SetChargingProfileResponse.json b/src/assets/json-schemas/ocpp/1.6/SetChargingProfileResponse.json new file mode 100755 index 00000000..1b388a04 --- /dev/null +++ b/src/assets/json-schemas/ocpp/1.6/SetChargingProfileResponse.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "urn:OCPP:1.6:2019:12:SetChargingProfileResponse", + "title": "SetChargingProfileResponse", + "type": "object", + "properties": { + "status": { + "type": "string", + "additionalProperties": false, + "enum": ["Accepted", "Rejected", "NotSupported"] + } + }, + "additionalProperties": false, + "required": ["status"] +} diff --git a/src/assets/json-schemas/ocpp/1.6/TriggerMessageResponse.json b/src/assets/json-schemas/ocpp/1.6/TriggerMessageResponse.json new file mode 100755 index 00000000..cb8d3d62 --- /dev/null +++ b/src/assets/json-schemas/ocpp/1.6/TriggerMessageResponse.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "urn:OCPP:1.6:2019:12:TriggerMessageResponse", + "title": "TriggerMessageResponse", + "type": "object", + "properties": { + "status": { + "type": "string", + "additionalProperties": false, + "enum": ["Accepted", "Rejected", "NotImplemented"] + } + }, + "additionalProperties": false, + "required": ["status"] +} diff --git a/src/assets/json-schemas/ocpp/1.6/UnlockConnectorResponse.json b/src/assets/json-schemas/ocpp/1.6/UnlockConnectorResponse.json new file mode 100755 index 00000000..942d0f12 --- /dev/null +++ b/src/assets/json-schemas/ocpp/1.6/UnlockConnectorResponse.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "urn:OCPP:1.6:2019:12:UnlockConnectorResponse", + "title": "UnlockConnectorResponse", + "type": "object", + "properties": { + "status": { + "type": "string", + "additionalProperties": false, + "enum": ["Unlocked", "UnlockFailed", "NotSupported"] + } + }, + "additionalProperties": false, + "required": ["status"] +} diff --git a/src/assets/json-schemas/ocpp/1.6/UpdateFirmware.json b/src/assets/json-schemas/ocpp/1.6/UpdateFirmware.json new file mode 100755 index 00000000..266b1933 --- /dev/null +++ b/src/assets/json-schemas/ocpp/1.6/UpdateFirmware.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "urn:OCPP:1.6:2019:12:UpdateFirmwareRequest", + "title": "UpdateFirmwareRequest", + "type": "object", + "properties": { + "location": { + "type": "string", + "format": "uri" + }, + "retries": { + "type": "integer" + }, + "retrieveDate": { + "type": "string", + "format": "date-time" + }, + "retryInterval": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": ["location", "retrieveDate"] +} diff --git a/src/assets/json-schemas/ocpp/1.6/UpdateFirmwareResponse.json b/src/assets/json-schemas/ocpp/1.6/UpdateFirmwareResponse.json new file mode 100755 index 00000000..575950f0 --- /dev/null +++ b/src/assets/json-schemas/ocpp/1.6/UpdateFirmwareResponse.json @@ -0,0 +1,8 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "urn:OCPP:1.6:2019:12:UpdateFirmwareResponse", + "title": "UpdateFirmwareResponse", + "type": "object", + "properties": {}, + "additionalProperties": false +} diff --git a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts index 92bd399c..93c59ba2 100644 --- a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts @@ -291,6 +291,18 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer ) ) as JSONSchemaType, ], + [ + OCPP16IncomingRequestCommand.UPDATE_FIRMWARE, + JSON.parse( + fs.readFileSync( + path.resolve( + path.dirname(fileURLToPath(import.meta.url)), + '../../../assets/json-schemas/ocpp/1.6/UpdateFirmware.json' + ), + 'utf8' + ) + ) as JSONSchemaType, + ], ]); this.validatePayload.bind(this); }