From e5925eda298231626d008f2ad4ded271dc9b51e0 Mon Sep 17 00:00:00 2001 From: larte Date: Mon, 23 Sep 2024 13:31:49 +0300 Subject: [PATCH] fix: adds valid urns for ocpp rpc schemas --- package.json | 2 +- pnpm-lock.yaml | 22 ++- src/schemas/v16/index.ts | 168 ++++++++-------- src/schemas/v16/rpc-call-error.json | 2 +- src/schemas/v16/rpc-call-result.json | 2 +- src/schemas/v16/rpc-call.json | 2 +- src/schemas/v201/index.ts | 268 +++++++++++++------------- src/schemas/v201/rpc-call-error.json | 2 +- src/schemas/v201/rpc-call-result.json | 2 +- src/schemas/v201/rpc-call.json | 2 +- src/types/v16/index.ts | 4 +- src/types/v201/index.ts | 4 +- tests/ocpp-messages-v16.test.ts | 9 + 13 files changed, 252 insertions(+), 237 deletions(-) diff --git a/package.json b/package.json index 60c67da..6898bb4 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "typescript-eslint": "^7.4.0" }, "dependencies": { - "ajv": "^8.12.0", + "ajv": "^8.17.1", "ajv-formats": "^2.1.1" }, "directories": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 39cee51..2a79f70 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,11 +6,11 @@ settings: dependencies: ajv: - specifier: ^8.12.0 - version: 8.12.0 + specifier: ^8.17.1 + version: 8.17.1 ajv-formats: specifier: ^2.1.1 - version: 2.1.1(ajv@8.12.0) + version: 2.1.1(ajv@8.17.1) devDependencies: '@jest/globals': @@ -1322,7 +1322,7 @@ packages: hasBin: true dev: true - /ajv-formats@2.1.1(ajv@8.12.0): + /ajv-formats@2.1.1(ajv@8.17.1): resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==} peerDependencies: ajv: ^8.0.0 @@ -1330,7 +1330,7 @@ packages: ajv: optional: true dependencies: - ajv: 8.12.0 + ajv: 8.17.1 dev: false /ajv@6.12.6: @@ -1342,13 +1342,13 @@ packages: uri-js: 4.4.1 dev: true - /ajv@8.12.0: - resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==} + /ajv@8.17.1: + resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} dependencies: fast-deep-equal: 3.1.3 + fast-uri: 3.0.1 json-schema-traverse: 1.0.0 require-from-string: 2.0.2 - uri-js: 4.4.1 dev: false /ansi-escapes@4.3.2: @@ -2523,6 +2523,10 @@ packages: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} dev: true + /fast-uri@3.0.1: + resolution: {integrity: sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==} + dev: false + /fastq@1.17.1: resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} dependencies: @@ -4023,6 +4027,7 @@ packages: /punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} + dev: true /pure-rand@6.0.4: resolution: {integrity: sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==} @@ -4638,6 +4643,7 @@ packages: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} dependencies: punycode: 2.3.1 + dev: true /v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} diff --git a/src/schemas/v16/index.ts b/src/schemas/v16/index.ts index d7e446e..1193596 100644 --- a/src/schemas/v16/index.ts +++ b/src/schemas/v16/index.ts @@ -83,87 +83,87 @@ import updateFirmwareResponseV16 from "./update-firmware-response.json"; import updateFirmwareRequestV16 from "./update-firmware.json"; export const schemas = { - v16: { - authorizeResponseV16, - authorizeRequestV16, - bootNotificationResponseV16, - bootNotificationRequestV16, - cancelReservationResponseV16, - cancelReservationRequestV16, - certificateSignedResponseV16, - certificateSignedRequestV16, - changeAvailabilityResponseV16, - changeAvailabilityRequestV16, - changeConfigurationResponseV16, - changeConfigurationRequestV16, - clearCacheResponseV16, - clearCacheRequestV16, - clearChargingProfileResponseV16, - clearChargingProfileRequestV16, - dataTransferResponseV16, - dataTransferRequestV16, - deleteCertificateResponseV16, - deleteCertificateRequestV16, - diagnosticsStatusNotificationResponseV16, - diagnosticsStatusNotificationRequestV16, - extendedTriggerMessageResponseV16, - extendedTriggerMessageRequestV16, - firmwareStatusNotificationResponseV16, - firmwareStatusNotificationRequestV16, - getCompositeScheduleResponseV16, - getCompositeScheduleRequestV16, - getConfigurationResponseV16, - getConfigurationRequestV16, - getDiagnosticsResponseV16, - getDiagnosticsRequestV16, - getInstalledCertificateIdsResponseV16, - getInstalledCertificateIdsRequestV16, - getLocalListVersionResponseV16, - getLocalListVersionRequestV16, - getLogResponseV16, - getLogRequestV16, - heartbeatResponseV16, - heartbeatRequestV16, - installCertificateResponseV16, - installCertificateRequestV16, - logStatusNotificationResponseV16, - logStatusNotificationRequestV16, - meterValuesResponseV16, - meterValuesRequestV16, - remoteStartTransactionResponseV16, - remoteStartTransactionRequestV16, - remoteStopTransactionResponseV16, - remoteStopTransactionRequestV16, - reserveNowResponseV16, - reserveNowRequestV16, - resetResponseV16, - resetRequestV16, - rpcCallErrorV16, - rpcCallResultV16, - rpcCallV16, - securityEventNotificationResponseV16, - securityEventNotificationRequestV16, - sendLocalListResponseV16, - sendLocalListRequestV16, - setChargingProfileResponseV16, - setChargingProfileRequestV16, - signCertificateResponseV16, - signCertificateRequestV16, - signedFirmwareStatusNotificationResponseV16, - signedFirmwareStatusNotificationRequestV16, - signedUpdateFirmwareResponseV16, - signedUpdateFirmwareRequestV16, - startTransactionResponseV16, - startTransactionRequestV16, - statusNotificationResponseV16, - statusNotificationRequestV16, - stopTransactionResponseV16, - stopTransactionRequestV16, - triggerMessageResponseV16, - triggerMessageRequestV16, - unlockConnectorResponseV16, - unlockConnectorRequestV16, - updateFirmwareResponseV16, - updateFirmwareRequestV16 - } -}; + v16: { + authorizeResponseV16, + authorizeRequestV16, + bootNotificationResponseV16, + bootNotificationRequestV16, + cancelReservationResponseV16, + cancelReservationRequestV16, + certificateSignedResponseV16, + certificateSignedRequestV16, + changeAvailabilityResponseV16, + changeAvailabilityRequestV16, + changeConfigurationResponseV16, + changeConfigurationRequestV16, + clearCacheResponseV16, + clearCacheRequestV16, + clearChargingProfileResponseV16, + clearChargingProfileRequestV16, + dataTransferResponseV16, + dataTransferRequestV16, + deleteCertificateResponseV16, + deleteCertificateRequestV16, + diagnosticsStatusNotificationResponseV16, + diagnosticsStatusNotificationRequestV16, + extendedTriggerMessageResponseV16, + extendedTriggerMessageRequestV16, + firmwareStatusNotificationResponseV16, + firmwareStatusNotificationRequestV16, + getCompositeScheduleResponseV16, + getCompositeScheduleRequestV16, + getConfigurationResponseV16, + getConfigurationRequestV16, + getDiagnosticsResponseV16, + getDiagnosticsRequestV16, + getInstalledCertificateIdsResponseV16, + getInstalledCertificateIdsRequestV16, + getLocalListVersionResponseV16, + getLocalListVersionRequestV16, + getLogResponseV16, + getLogRequestV16, + heartbeatResponseV16, + heartbeatRequestV16, + installCertificateResponseV16, + installCertificateRequestV16, + logStatusNotificationResponseV16, + logStatusNotificationRequestV16, + meterValuesResponseV16, + meterValuesRequestV16, + remoteStartTransactionResponseV16, + remoteStartTransactionRequestV16, + remoteStopTransactionResponseV16, + remoteStopTransactionRequestV16, + reserveNowResponseV16, + reserveNowRequestV16, + resetResponseV16, + resetRequestV16, + rpcCallErrorV16, + rpcCallResultV16, + rpcCallV16, + securityEventNotificationResponseV16, + securityEventNotificationRequestV16, + sendLocalListResponseV16, + sendLocalListRequestV16, + setChargingProfileResponseV16, + setChargingProfileRequestV16, + signCertificateResponseV16, + signCertificateRequestV16, + signedFirmwareStatusNotificationResponseV16, + signedFirmwareStatusNotificationRequestV16, + signedUpdateFirmwareResponseV16, + signedUpdateFirmwareRequestV16, + startTransactionResponseV16, + startTransactionRequestV16, + statusNotificationResponseV16, + statusNotificationRequestV16, + stopTransactionResponseV16, + stopTransactionRequestV16, + triggerMessageResponseV16, + triggerMessageRequestV16, + unlockConnectorResponseV16, + unlockConnectorRequestV16, + updateFirmwareResponseV16, + updateFirmwareRequestV16 + } +}; \ No newline at end of file diff --git a/src/schemas/v16/rpc-call-error.json b/src/schemas/v16/rpc-call-error.json index 3bd5945..e645ade 100644 --- a/src/schemas/v16/rpc-call-error.json +++ b/src/schemas/v16/rpc-call-error.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "urn:RpcCallErrorV16", + "$id": "urn:OCPP:1.6:2019:12:RpcCallErrorV16", "title": "RpcCallError", "type": "array", "minItems": 5, diff --git a/src/schemas/v16/rpc-call-result.json b/src/schemas/v16/rpc-call-result.json index 6560efe..7159b56 100644 --- a/src/schemas/v16/rpc-call-result.json +++ b/src/schemas/v16/rpc-call-result.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "urn:RpcCallResultV16", + "$id": "urn:OCPP:1.6:2019:12:RpcCallResultV16", "title": "RpcCallResult", "type": "array", "minItems": 3, diff --git a/src/schemas/v16/rpc-call.json b/src/schemas/v16/rpc-call.json index 44bf03b..a22fefe 100644 --- a/src/schemas/v16/rpc-call.json +++ b/src/schemas/v16/rpc-call.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "urn:RpcCallV16", + "$id": "urn:OCPP:1.6:2019:12:RpcCallV16", "title": "RpcCall", "type": "array", "minItems": 4, diff --git a/src/schemas/v201/index.ts b/src/schemas/v201/index.ts index 9b068b2..848cf12 100644 --- a/src/schemas/v201/index.ts +++ b/src/schemas/v201/index.ts @@ -133,137 +133,137 @@ import updateFirmwareResponseV201 from "./update-firmware-response.json"; import updateFirmwareRequestV201 from "./update-firmware.json"; export const schemas = { - v201: { - authorizeResponseV201, - authorizeRequestV201, - bootNotificationResponseV201, - bootNotificationRequestV201, - cancelReservationResponseV201, - cancelReservationRequestV201, - certificateSignedResponseV201, - certificateSignedRequestV201, - changeAvailabilityResponseV201, - changeAvailabilityRequestV201, - clearCacheResponseV201, - clearCacheRequestV201, - clearChargingProfileResponseV201, - clearChargingProfileRequestV201, - clearDisplayMessageResponseV201, - clearDisplayMessageRequestV201, - clearVariableMonitoringResponseV201, - clearVariableMonitoringRequestV201, - clearedChargingLimitResponseV201, - clearedChargingLimitRequestV201, - costUpdatedResponseV201, - costUpdatedRequestV201, - customerInformationResponseV201, - customerInformationRequestV201, - dataTransferResponseV201, - dataTransferRequestV201, - deleteCertificateResponseV201, - deleteCertificateRequestV201, - firmwareStatusNotificationResponseV201, - firmwareStatusNotificationRequestV201, - getBaseReportResponseV201, - getBaseReportRequestV201, - getCertificateStatusResponseV201, - getCertificateStatusRequestV201, - getChargingProfilesResponseV201, - getChargingProfilesRequestV201, - getCompositeScheduleResponseV201, - getCompositeScheduleRequestV201, - getDisplayMessagesResponseV201, - getDisplayMessagesRequestV201, - getInstalledCertificateIdsResponseV201, - getInstalledCertificateIdsRequestV201, - getLocalListVersionResponseV201, - getLocalListVersionRequestV201, - getLogResponseV201, - getLogRequestV201, - getMonitoringReportResponseV201, - getMonitoringReportRequestV201, - getReportResponseV201, - getReportRequestV201, - getTransactionStatusResponseV201, - getTransactionStatusRequestV201, - getVariablesResponseV201, - getVariablesRequestV201, - get15118EVCertificateResponseV201, - get15118EVCertificateRequestV201, - heartbeatResponseV201, - heartbeatRequestV201, - installCertificateResponseV201, - installCertificateRequestV201, - logStatusNotificationResponseV201, - logStatusNotificationRequestV201, - meterValuesResponseV201, - meterValuesRequestV201, - notifyChargingLimitResponseV201, - notifyChargingLimitRequestV201, - notifyCustomerInformationResponseV201, - notifyCustomerInformationRequestV201, - notifyDisplayMessagesResponseV201, - notifyDisplayMessagesRequestV201, - notifyEVChargingNeedsResponseV201, - notifyEVChargingNeedsRequestV201, - notifyEVChargingScheduleResponseV201, - notifyEVChargingScheduleRequestV201, - notifyEventResponseV201, - notifyEventRequestV201, - notifyMonitoringReportResponseV201, - notifyMonitoringReportRequestV201, - notifyReportResponseV201, - notifyReportRequestV201, - publishFirmwareResponseV201, - publishFirmwareStatusNotificationResponseV201, - publishFirmwareStatusNotificationRequestV201, - publishFirmwareRequestV201, - reportChargingProfilesResponseV201, - reportChargingProfilesRequestV201, - reservationStatusUpdateResponseV201, - reservationStatusUpdateRequestV201, - reserveNowResponseV201, - reserveNowRequestV201, - resetResponseV201, - resetRequestV201, - rpcCallErrorV201, - rpcCallResultV201, - rpcCallV201, - securityEventNotificationResponseV201, - securityEventNotificationRequestV201, - sendLocalListResponseV201, - sendLocalListRequestV201, - setChargingProfileResponseV201, - setChargingProfileRequestV201, - setDisplayMessageResponseV201, - setDisplayMessageRequestV201, - setMonitoringBaseResponseV201, - setMonitoringBaseRequestV201, - setMonitoringLevelResponseV201, - setMonitoringLevelRequestV201, - setNetworkProfileResponseV201, - setNetworkProfileRequestV201, - setVariableMonitoringResponseV201, - setVariableMonitoringRequestV201, - setVariablesResponseV201, - setVariablesRequestV201, - signCertificateResponseV201, - signCertificateRequestV201, - requestStartTransactionResponseV201, - requestStartTransactionRequestV201, - statusNotificationResponseV201, - statusNotificationRequestV201, - requestStopTransactionResponseV201, - requestStopTransactionRequestV201, - transactionEventResponseV201, - transactionEventRequestV201, - triggerMessageResponseV201, - triggerMessageRequestV201, - unlockConnectorResponseV201, - unlockConnectorRequestV201, - unpublishFirmwareResponseV201, - unpublishFirmwareRequestV201, - updateFirmwareResponseV201, - updateFirmwareRequestV201 - } -}; + v201: { + authorizeResponseV201, + authorizeRequestV201, + bootNotificationResponseV201, + bootNotificationRequestV201, + cancelReservationResponseV201, + cancelReservationRequestV201, + certificateSignedResponseV201, + certificateSignedRequestV201, + changeAvailabilityResponseV201, + changeAvailabilityRequestV201, + clearCacheResponseV201, + clearCacheRequestV201, + clearChargingProfileResponseV201, + clearChargingProfileRequestV201, + clearDisplayMessageResponseV201, + clearDisplayMessageRequestV201, + clearVariableMonitoringResponseV201, + clearVariableMonitoringRequestV201, + clearedChargingLimitResponseV201, + clearedChargingLimitRequestV201, + costUpdatedResponseV201, + costUpdatedRequestV201, + customerInformationResponseV201, + customerInformationRequestV201, + dataTransferResponseV201, + dataTransferRequestV201, + deleteCertificateResponseV201, + deleteCertificateRequestV201, + firmwareStatusNotificationResponseV201, + firmwareStatusNotificationRequestV201, + getBaseReportResponseV201, + getBaseReportRequestV201, + getCertificateStatusResponseV201, + getCertificateStatusRequestV201, + getChargingProfilesResponseV201, + getChargingProfilesRequestV201, + getCompositeScheduleResponseV201, + getCompositeScheduleRequestV201, + getDisplayMessagesResponseV201, + getDisplayMessagesRequestV201, + getInstalledCertificateIdsResponseV201, + getInstalledCertificateIdsRequestV201, + getLocalListVersionResponseV201, + getLocalListVersionRequestV201, + getLogResponseV201, + getLogRequestV201, + getMonitoringReportResponseV201, + getMonitoringReportRequestV201, + getReportResponseV201, + getReportRequestV201, + getTransactionStatusResponseV201, + getTransactionStatusRequestV201, + getVariablesResponseV201, + getVariablesRequestV201, + get15118EVCertificateResponseV201, + get15118EVCertificateRequestV201, + heartbeatResponseV201, + heartbeatRequestV201, + installCertificateResponseV201, + installCertificateRequestV201, + logStatusNotificationResponseV201, + logStatusNotificationRequestV201, + meterValuesResponseV201, + meterValuesRequestV201, + notifyChargingLimitResponseV201, + notifyChargingLimitRequestV201, + notifyCustomerInformationResponseV201, + notifyCustomerInformationRequestV201, + notifyDisplayMessagesResponseV201, + notifyDisplayMessagesRequestV201, + notifyEVChargingNeedsResponseV201, + notifyEVChargingNeedsRequestV201, + notifyEVChargingScheduleResponseV201, + notifyEVChargingScheduleRequestV201, + notifyEventResponseV201, + notifyEventRequestV201, + notifyMonitoringReportResponseV201, + notifyMonitoringReportRequestV201, + notifyReportResponseV201, + notifyReportRequestV201, + publishFirmwareResponseV201, + publishFirmwareStatusNotificationResponseV201, + publishFirmwareStatusNotificationRequestV201, + publishFirmwareRequestV201, + reportChargingProfilesResponseV201, + reportChargingProfilesRequestV201, + reservationStatusUpdateResponseV201, + reservationStatusUpdateRequestV201, + reserveNowResponseV201, + reserveNowRequestV201, + resetResponseV201, + resetRequestV201, + rpcCallErrorV201, + rpcCallResultV201, + rpcCallV201, + securityEventNotificationResponseV201, + securityEventNotificationRequestV201, + sendLocalListResponseV201, + sendLocalListRequestV201, + setChargingProfileResponseV201, + setChargingProfileRequestV201, + setDisplayMessageResponseV201, + setDisplayMessageRequestV201, + setMonitoringBaseResponseV201, + setMonitoringBaseRequestV201, + setMonitoringLevelResponseV201, + setMonitoringLevelRequestV201, + setNetworkProfileResponseV201, + setNetworkProfileRequestV201, + setVariableMonitoringResponseV201, + setVariableMonitoringRequestV201, + setVariablesResponseV201, + setVariablesRequestV201, + signCertificateResponseV201, + signCertificateRequestV201, + requestStartTransactionResponseV201, + requestStartTransactionRequestV201, + statusNotificationResponseV201, + statusNotificationRequestV201, + requestStopTransactionResponseV201, + requestStopTransactionRequestV201, + transactionEventResponseV201, + transactionEventRequestV201, + triggerMessageResponseV201, + triggerMessageRequestV201, + unlockConnectorResponseV201, + unlockConnectorRequestV201, + unpublishFirmwareResponseV201, + unpublishFirmwareRequestV201, + updateFirmwareResponseV201, + updateFirmwareRequestV201 + } +}; \ No newline at end of file diff --git a/src/schemas/v201/rpc-call-error.json b/src/schemas/v201/rpc-call-error.json index 0727eb7..90e9389 100644 --- a/src/schemas/v201/rpc-call-error.json +++ b/src/schemas/v201/rpc-call-error.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "urn:RpcCallErrorV201", + "$id": "urn:OCPP:Cp:2:2020:3:RpcCallErrorV201", "title": "RpcCallError", "type": "array", "minItems": 5, diff --git a/src/schemas/v201/rpc-call-result.json b/src/schemas/v201/rpc-call-result.json index 15af511..4730608 100644 --- a/src/schemas/v201/rpc-call-result.json +++ b/src/schemas/v201/rpc-call-result.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "urn:RpcCallResultV201", + "$id": "urn:OCPP:Cp:2:2020:3:RpcCallResultV201", "title": "RpcCallResult", "type": "array", "minItems": 3, diff --git a/src/schemas/v201/rpc-call.json b/src/schemas/v201/rpc-call.json index 49b1240..bbfc2be 100644 --- a/src/schemas/v201/rpc-call.json +++ b/src/schemas/v201/rpc-call.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "urn:RpcCallV201", + "$id": "urn:OCPP:Cp:2:2020:3:RpcCallV201", "title": "RpcCall", "type": "array", "minItems": 4, diff --git a/src/types/v16/index.ts b/src/types/v16/index.ts index fdf2ff9..f3561fb 100644 --- a/src/types/v16/index.ts +++ b/src/types/v16/index.ts @@ -1,5 +1,5 @@ -// Generated by scripts/types-ast.ts - +//Generated by scripts/types-ast.ts +; export type { AuthorizeResponseV16 } from "./authorize-response"; export type { AuthorizeRequestV16 } from "./authorize"; export type { BootNotificationResponseV16 } from "./boot-notification-response"; diff --git a/src/types/v201/index.ts b/src/types/v201/index.ts index 513f65a..1148715 100644 --- a/src/types/v201/index.ts +++ b/src/types/v201/index.ts @@ -1,5 +1,5 @@ -// Generated by scripts/types-ast.ts - +//Generated by scripts/types-ast.ts +; export type { AuthorizeResponseV201 } from "./authorize-response"; export type { AuthorizeRequestV201 } from "./authorize"; export type { BootNotificationResponseV201 } from "./boot-notification-response"; diff --git a/tests/ocpp-messages-v16.test.ts b/tests/ocpp-messages-v16.test.ts index 4de2330..c6490aa 100644 --- a/tests/ocpp-messages-v16.test.ts +++ b/tests/ocpp-messages-v16.test.ts @@ -51,6 +51,15 @@ const exampleRequests: Array> = [ action: "SecurityEventNotification", payload: { timestamp: "2024-04-25T23:04:15Z", type: "InvalidMessages" } } + }, + { + input: "[2,\"829cc6c0-25c8-4a8c-a7fb-ad31fb25d66b\",\"StatusNotification\",{\"connectorId\":2,\"status\":\"Available\",\"errorCode\":\"NoError\"}]", + expected: { + messageId: "829cc6c0-25c8-4a8c-a7fb-ad31fb25d66b", + messageTypeId: 2, + action: "StatusNotification", + payload: { connectorId: 2, status: "Available", errorCode: "NoError" } + } } ];