Add missing OCPP 1.6 command payload OCA JSON schemas
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 7 Jan 2023 22:27:54 +0000 (23:27 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 7 Jan 2023 22:27:54 +0000 (23:27 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
23 files changed:
src/assets/json-schemas/ocpp/1.6/CancelReservation.json [new file with mode: 0755]
src/assets/json-schemas/ocpp/1.6/CancelReservationResponse.json [new file with mode: 0755]
src/assets/json-schemas/ocpp/1.6/ChangeAvailabilityResponse.json [new file with mode: 0755]
src/assets/json-schemas/ocpp/1.6/ChangeConfigurationResponse.json [new file with mode: 0755]
src/assets/json-schemas/ocpp/1.6/ClearCacheResponse.json [new file with mode: 0755]
src/assets/json-schemas/ocpp/1.6/ClearChargingProfileResponse.json [new file with mode: 0755]
src/assets/json-schemas/ocpp/1.6/GetConfigurationResponse.json [new file with mode: 0755]
src/assets/json-schemas/ocpp/1.6/GetDiagnosticsResponse.json [new file with mode: 0755]
src/assets/json-schemas/ocpp/1.6/GetLocalListVersion.json [new file with mode: 0755]
src/assets/json-schemas/ocpp/1.6/GetLocalListVersionResponse.json [new file with mode: 0755]
src/assets/json-schemas/ocpp/1.6/RemoteStartTransactionResponse.json [new file with mode: 0755]
src/assets/json-schemas/ocpp/1.6/RemoteStopTransactionResponse.json [new file with mode: 0755]
src/assets/json-schemas/ocpp/1.6/ReserveNow.json [new file with mode: 0755]
src/assets/json-schemas/ocpp/1.6/ReserveNowResponse.json [new file with mode: 0755]
src/assets/json-schemas/ocpp/1.6/ResetResponse.json [new file with mode: 0755]
src/assets/json-schemas/ocpp/1.6/SendLocalList.json [new file with mode: 0755]
src/assets/json-schemas/ocpp/1.6/SendLocalListResponse.json [new file with mode: 0755]
src/assets/json-schemas/ocpp/1.6/SetChargingProfileResponse.json [new file with mode: 0755]
src/assets/json-schemas/ocpp/1.6/TriggerMessageResponse.json [new file with mode: 0755]
src/assets/json-schemas/ocpp/1.6/UnlockConnectorResponse.json [new file with mode: 0755]
src/assets/json-schemas/ocpp/1.6/UpdateFirmware.json [new file with mode: 0755]
src/assets/json-schemas/ocpp/1.6/UpdateFirmwareResponse.json [new file with mode: 0755]
src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts

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 (executable)
index 0000000..c797a9d
--- /dev/null
@@ -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 (executable)
index 0000000..c26dedd
--- /dev/null
@@ -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 (executable)
index 0000000..59a0a9e
--- /dev/null
@@ -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 (executable)
index 0000000..b9e92a0
--- /dev/null
@@ -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 (executable)
index 0000000..ceb8d9f
--- /dev/null
@@ -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 (executable)
index 0000000..2eeb156
--- /dev/null
@@ -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 (executable)
index 0000000..875fa18
--- /dev/null
@@ -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 (executable)
index 0000000..948bfdf
--- /dev/null
@@ -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 (executable)
index 0000000..971f387
--- /dev/null
@@ -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 (executable)
index 0000000..5f76312
--- /dev/null
@@ -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 (executable)
index 0000000..6453d94
--- /dev/null
@@ -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 (executable)
index 0000000..68e9c79
--- /dev/null
@@ -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 (executable)
index 0000000..89d7ac4
--- /dev/null
@@ -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 (executable)
index 0000000..8bc82da
--- /dev/null
@@ -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 (executable)
index 0000000..0d9a8c5
--- /dev/null
@@ -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 (executable)
index 0000000..6ec3d01
--- /dev/null
@@ -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 (executable)
index 0000000..b8c528d
--- /dev/null
@@ -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 (executable)
index 0000000..1b388a0
--- /dev/null
@@ -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 (executable)
index 0000000..cb8d3d6
--- /dev/null
@@ -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 (executable)
index 0000000..942d0f1
--- /dev/null
@@ -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 (executable)
index 0000000..266b193
--- /dev/null
@@ -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 (executable)
index 0000000..575950f
--- /dev/null
@@ -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
+}
index 92bd399c4b6f05bb6f3dd56878bbaa1ace75f6d6..93c59ba29cfcedaa63f334270f4f2ca37766372f 100644 (file)
@@ -291,6 +291,18 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer
           )
         ) as JSONSchemaType<OCPP16DataTransferRequest>,
       ],
+      [
+        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<OCPP16UpdateFirmwareRequest>,
+      ],
     ]);
     this.validatePayload.bind(this);
   }