Migrated CPO Commands endpoint
MODIFY
src/server/ocpi/OCPIServer.ts
src/server/ocpi/OCPIServer.ts
@@ -37,7 +37,6 @@ export default class OCPIServer {
this.expressApplication.use(Logging.traceExpressRequest.bind(this));
// Routers
this.expressApplication.use('/ocpi', new GlobalRouter().buildRoutes());
-
// const ocpiServices = new OCPIServices(this.ocpiRestConfig);
// // Register all services in express
// for (const ocpiService of ocpiServices.getOCPIServiceImplementations()) {

MODIFY
src/server/ocpi/ocpi-services-impl/ocpi-2.1.1/CPOService.ts
src/server/ocpi/ocpi-services-impl/ocpi-2.1.1/CPOService.ts
import AbstractOCPIService from '../../AbstractOCPIService';
-import CPOCommandsEndpoint from './cpo/CPOCommandsEndpoint';
import CPOSessionsEndpoint from './cpo/CPOSessionsEndpoint';
import CPOTariffsEndpoint from './cpo/CPOTariffsEndpoint';
import CredentialsEndpoint from './credentials/CredentialsEndpoint';
@@ -12,10 +11,9 @@ export default class CPOService extends AbstractOCPIService {
public constructor(ocpiRestConfig: OCPIServiceConfiguration) {
super(ocpiRestConfig, CPOService.PATH, CPOService.VERSION);
// Register Endpoints
- this.registerEndpoint(new CredentialsEndpoint(this));
- this.registerEndpoint(new CPOCommandsEndpoint(this));
this.registerEndpoint(new CPOSessionsEndpoint(this));
this.registerEndpoint(new CPOTariffsEndpoint(this));
+ this.registerEndpoint(new CredentialsEndpoint(this));
}
}

MODIFY
src/server/ocpi/router/cpo/CPORouter.ts
src/server/ocpi/router/cpo/CPORouter.ts
@@ -3,6 +3,7 @@ import { OCPIServerRoute, ServerAction } from '../../../../types/Server';
import express, { NextFunction, Request, Response } from 'express';
import CPOCdrsRouterV211 from './V2.1.1/CPOCdrsRouterV211';
+import CPOCommandsRouterV211 from './V2.1.1/CPOCommandsRouterV211';
import CPOLocationsRouterV211 from './V2.1.1/CPOLocationsRouterV211';
import CPOTokensRouterV211 from './V2.1.1/CPOTokensRouterV211';
import CPOVersionsService from '../../service/cpo/CPOVersionsService';
@@ -32,6 +33,7 @@ export default class CPORouter {
new CPOLocationsRouterV211().buildRoutes(),
new CPOTokensRouterV211().buildRoutes(),
new CPOCdrsRouterV211().buildRoutes(),
+ new CPOCommandsRouterV211().buildRoutes(),
]);
}
}

ADD
src/server/ocpi/router/cpo/V2.1.1/CPOCommandsRouterV211.ts
+/* eslint-disable @typescript-eslint/no-misused-promises */
+import { OCPIServerRoute, ServerAction } from '../../../../../types/Server';
+import express, { NextFunction, Request, Response } from 'express';
+
+import CPOCommandsService from '../../../service/cpo/v2.1.1/CPOCommandsService';
+import RouterUtils from '../../../../../utils/RouterUtils';
+
+export default class CPOCommandsRouterV211 {
+ private router: express.Router;
+
+ public constructor() {
+ this.router = express.Router();
+ }
+
+ public buildRoutes(): express.Router {
+ this.buildRouteCommands();
+ return this.router;
+ }
+
+ protected buildRouteCommands(): void {
+ this.router.post(`/${OCPIServerRoute.OCPI_COMMANDS}/*`, async (req: Request, res: Response, next: NextFunction) => {
+ await RouterUtils.handleServerAction(CPOCommandsService.handleCommands.bind(this), ServerAction.OCPI_CPO_COMMAND, req, res, next);
+ });
+ }
+}

RENAME
src/server/ocpi/ocpi-services-impl/ocpi-2.1.1/cpo/CPOCommandsEndpoint.ts
src/server/ocpi/service/cpo/v2.1.1/CPOCommandsService.ts
@@ -2,8 +2,6 @@ import ChargingStation, { Connector, RemoteAuthorization } from '../../../../../
import { NextFunction, Request, Response } from 'express';
import { OCPICommandResponse, OCPICommandResponseType } from '../../../../../types/ocpi/OCPICommandResponse';
-import AbstractEndpoint from '../../AbstractEndpoint';
-import AbstractOCPIService from '../../../AbstractOCPIService';
import AppError from '../../../../../exception/AppError';
import AxiosFactory from '../../../../../utils/AxiosFactory';
import { ChargePointStatus } from '../../../../../types/ocpp/OCPPServer';
@@ -18,7 +16,7 @@ import { OCPIStartSession } from '../../../../../types/ocpi/OCPIStartSession';
import { OCPIStatusCode } from '../../../../../types/ocpi/OCPIStatusCode';
import { OCPIStopSession } from '../../../../../types/ocpi/OCPIStopSession';
import OCPIUtils from '../../../OCPIUtils';
-import OCPIUtilsService from '../../../service/OCPIUtilsService';
+import OCPIUtilsService from '../../OCPIUtilsService';
import { OCPPRemoteStartStopStatus } from '../../../../../types/ocpp/OCPPClient';
import { ServerAction } from '../../../../../types/Server';
import { StatusCodes } from 'http-status-codes';
@@ -28,16 +26,11 @@ import TransactionStorage from '../../../../../storage/mongodb/TransactionStorag
import Utils from '../../../../../utils/Utils';
import moment from 'moment';
-const MODULE_NAME = 'CPOCommandsEndpoint';
+const MODULE_NAME = 'CPOCommandsService';
-export default class CPOCommandsEndpoint extends AbstractEndpoint {
- public constructor(ocpiService: AbstractOCPIService) {
- super(ocpiService, 'commands');
- }
-
- public async process(req: Request, res: Response, next: NextFunction, tenant: Tenant, ocpiEndpoint: OCPIEndpoint): Promise<OCPIResponse> {
- switch (req.method) {
- case 'POST':
+export default class CPOCommandsService {
+ public static async handleCommands(action: ServerAction, req: Request, res: Response, next: NextFunction): Promise<void> {
+ const { tenant, ocpiEndpoint } = req;
// Split URL Segments
// /ocpi/cpo/2.0/commands/{command}
// eslint-disable-next-line no-case-declarations
@@ -49,8 +42,7 @@ export default class CPOCommandsEndpoint extends AbstractEndpoint {
const command = urlSegment.shift();
if (!command) {
throw new AppError({
- action: ServerAction.OCPI_CPO_COMMAND,
- module: MODULE_NAME, method: 'getToken',
+ module: MODULE_NAME, method: 'handleCommands', action,
errorCode: StatusCodes.BAD_REQUEST,
message: 'OCPI Command is not provided',
ocpiError: OCPIStatusCode.CODE_2001_INVALID_PARAMETER_ERROR
@@ -58,30 +50,31 @@ export default class CPOCommandsEndpoint extends AbstractEndpoint {
}
switch (command) {
case OCPICommandType.START_SESSION:
- return this.remoteStartSessionRequest(req, res, next, tenant, ocpiEndpoint);
+ res.json(await CPOCommandsService.remoteStartSession(action, req, res, next, tenant, ocpiEndpoint));
+ break;
case OCPICommandType.STOP_SESSION:
- return this.remoteStopSessionRequest(req, res, next, tenant, ocpiEndpoint);
+ res.json(await CPOCommandsService.remoteStopSession(action, req, res, next, tenant, ocpiEndpoint));
+ break;
case OCPICommandType.RESERVE_NOW:
case OCPICommandType.UNLOCK_CONNECTOR:
- return this.buildOCPIResponse(OCPICommandResponseType.NOT_SUPPORTED);
+ res.json(CPOCommandsService.buildOCPIResponse(OCPICommandResponseType.NOT_SUPPORTED));
+ break;
default:
throw new AppError({
- action: ServerAction.OCPI_CPO_COMMAND,
- module: MODULE_NAME, method: 'getToken',
+ module: MODULE_NAME, method: 'handleCommands', action,
errorCode: StatusCodes.BAD_REQUEST,
message: `OCPI Command '${command}' is unknown`,
ocpiError: OCPIStatusCode.CODE_2001_INVALID_PARAMETER_ERROR
});
}
- }
+ next();
}
- private async remoteStartSessionRequest(req: Request, res: Response, next: NextFunction, tenant: Tenant, ocpiEndpoint: OCPIEndpoint): Promise<OCPIResponse> {
+ private static async remoteStartSession(action: ServerAction, req: Request, res: Response, next: NextFunction, tenant: Tenant, ocpiEndpoint: OCPIEndpoint): Promise<OCPIResponse> {
const startSession = req.body as OCPIStartSession;
- if (!this.validateStartSession(startSession)) {
+ if (!CPOCommandsService.validateStartSession(startSession)) {
throw new AppError({
- module: MODULE_NAME, method: 'remoteStartSession',
- action: ServerAction.OCPI_CPO_START_SESSION,
+ module: MODULE_NAME, method: 'remoteStartSession', action,
errorCode: StatusCodes.BAD_REQUEST,
message: 'Start Session command body is invalid',
detailedMessages: { startSession },
@@ -93,22 +86,20 @@ export default class CPOCommandsEndpoint extends AbstractEndpoint {
if (!localToken?.active || !localToken.ocpiToken?.valid) {
await Logging.logError({
tenantID: tenant.id,
- action: ServerAction.OCPI_CPO_START_SESSION,
+ module: MODULE_NAME, method: 'remoteStartSession', action,
message: `Token ID '${startSession.token.uid}' is either not active or invalid`,
- module: MODULE_NAME, method: 'remoteStartSession',
detailedMessages: { localToken, startSession }
});
- return this.buildOCPIResponse(OCPICommandResponseType.REJECTED);
+ return CPOCommandsService.buildOCPIResponse(OCPICommandResponseType.REJECTED);
}
if (Utils.isNullOrUndefined(localToken.user) || localToken.user?.issuer) {
await Logging.logError({
tenantID: tenant.id,
- action: ServerAction.OCPI_CPO_START_SESSION,
+ module: MODULE_NAME, method: 'remoteStartSession', action,
message: `Invalid user associated to Token ID '${startSession.token.uid}'`,
- module: MODULE_NAME, method: 'remoteStartSession',
detailedMessages: { localToken, startSession }
});
- return this.buildOCPIResponse(OCPICommandResponseType.REJECTED);
+ return CPOCommandsService.buildOCPIResponse(OCPICommandResponseType.REJECTED);
}
// Get the Charging Station
const chargingStation = await ChargingStationStorage.getChargingStationByOcpiLocationEvseUid(
@@ -116,12 +107,11 @@ export default class CPOCommandsEndpoint extends AbstractEndpoint {
if (!chargingStation) {
await Logging.logError({
tenantID: tenant.id,
- action: ServerAction.OCPI_CPO_START_SESSION,
+ module: MODULE_NAME, method: 'remoteStartSession', action,
message: `Charging Station with EVSE ID '${startSession.evse_uid}' and Location ID '${startSession.location_id}' does not exist`,
- module: MODULE_NAME, method: 'remoteStartSession',
detailedMessages: { startSession }
});
- return this.buildOCPIResponse(OCPICommandResponseType.REJECTED);
+ return CPOCommandsService.buildOCPIResponse(OCPICommandResponseType.REJECTED);
}
// Find the connector
const connectorID = Utils.convertToInt(OCPIUtils.getConnectorIDFromEvseID(startSession.evse_uid));
@@ -130,35 +120,32 @@ export default class CPOCommandsEndpoint extends AbstractEndpoint {
await Logging.logError({
...LoggingHelper.getChargingStationProperties(chargingStation),
tenantID: tenant.id,
- action: ServerAction.OCPI_CPO_START_SESSION,
+ module: MODULE_NAME, method: 'remoteStartSession', action,
message: `${Utils.buildConnectorInfo(connectorID)} Connector not found`,
- module: MODULE_NAME, method: 'remoteStartSession',
detailedMessages: { connectorID, chargingStation, startSession }
});
- return this.buildOCPIResponse(OCPICommandResponseType.REJECTED);
+ return CPOCommandsService.buildOCPIResponse(OCPICommandResponseType.REJECTED);
}
if (!chargingStation.issuer || !chargingStation.public) {
await Logging.logError({
...LoggingHelper.getChargingStationProperties(chargingStation),
tenantID: tenant.id,
- action: ServerAction.OCPI_CPO_START_SESSION,
+ module: MODULE_NAME, method: 'remoteStartSession', action,
message: `Charging Station ID '${startSession.evse_uid}' is either not public or local to the tenant`,
- module: MODULE_NAME, method: 'remoteStartSession',
detailedMessages: { chargingStation, startSession }
});
- return this.buildOCPIResponse(OCPICommandResponseType.REJECTED);
+ return CPOCommandsService.buildOCPIResponse(OCPICommandResponseType.REJECTED);
}
if (connector.status !== ChargePointStatus.AVAILABLE &&
connector.status !== ChargePointStatus.PREPARING) {
await Logging.logError({
...LoggingHelper.getChargingStationProperties(chargingStation),
tenantID: tenant.id,
- action: ServerAction.OCPI_CPO_STOP_SESSION,
+ module: MODULE_NAME, method: 'remoteStartSession', action,
message: `Charging Station ID '${chargingStation.id}' is not available (status is '${connector.status}')`,
- module: MODULE_NAME, method: 'remoteStartSession',
detailedMessages: { chargingStation, startSession }
});
- return this.buildOCPIResponse(OCPICommandResponseType.REJECTED);
+ return CPOCommandsService.buildOCPIResponse(OCPICommandResponseType.REJECTED);
}
if (!chargingStation.remoteAuthorizations) {
chargingStation.remoteAuthorizations = [];
@@ -170,12 +157,11 @@ export default class CPOCommandsEndpoint extends AbstractEndpoint {
await Logging.logError({
...LoggingHelper.getChargingStationProperties(chargingStation),
tenantID: tenant.id,
- action: ServerAction.OCPI_CPO_START_SESSION,
+ module: MODULE_NAME, method: 'remoteStartSession', action,
message: `Remote authorization already exists for Charging Station '${chargingStation.id}' and Connector ID ${connector.connectorId}`,
- module: MODULE_NAME, method: 'remoteStartSession',
detailedMessages: { existingAuthorization, chargingStation, startSession }
});
- return this.buildOCPIResponse(OCPICommandResponseType.REJECTED);
+ return CPOCommandsService.buildOCPIResponse(OCPICommandResponseType.REJECTED);
}
existingAuthorization.timestamp = moment().toDate();
existingAuthorization.id = startSession.authorization_id;
@@ -194,16 +180,15 @@ export default class CPOCommandsEndpoint extends AbstractEndpoint {
await ChargingStationStorage.saveChargingStationRemoteAuthorizations(
tenant, chargingStation.id, chargingStation.remoteAuthorizations);
// Called Async as the response to the eMSP is sent asynchronously and this request has to finish before the command returns
- void this.remoteStartTransaction(tenant, chargingStation, connector, startSession, ocpiEndpoint);
- return this.buildOCPIResponse(OCPICommandResponseType.ACCEPTED);
+ void CPOCommandsService.remoteStartTransaction(action, tenant, chargingStation, connector, startSession, ocpiEndpoint);
+ return CPOCommandsService.buildOCPIResponse(OCPICommandResponseType.ACCEPTED);
}
- private async remoteStopSessionRequest(req: Request, res: Response, next: NextFunction, tenant: Tenant, ocpiEndpoint: OCPIEndpoint): Promise<OCPIResponse> {
+ private static async remoteStopSession(action: ServerAction, req: Request, res: Response, next: NextFunction, tenant: Tenant, ocpiEndpoint: OCPIEndpoint): Promise<OCPIResponse> {
const stopSession = req.body as OCPIStopSession;
- if (!this.validateStopSession(stopSession)) {
+ if (!CPOCommandsService.validateStopSession(stopSession)) {
throw new AppError({
- module: MODULE_NAME, method: 'remoteStopSession',
- action: ServerAction.OCPI_CPO_START_SESSION,
+ module: MODULE_NAME, method: 'remoteStopSession', action,
errorCode: StatusCodes.BAD_REQUEST,
message: 'StopSession command body is invalid',
detailedMessages: { stopSession },
@@ -214,57 +199,53 @@ export default class CPOCommandsEndpoint extends AbstractEndpoint {
if (!transaction) {
await Logging.logError({
tenantID: tenant.id,
- action: ServerAction.OCPI_CPO_STOP_SESSION,
+ module: MODULE_NAME, method: 'remoteStopSession', action,
message: `Transaction with Session ID '${stopSession.session_id}' does not exists`,
- module: MODULE_NAME, method: 'remoteStopSession',
detailedMessages: { stopSession },
});
- return this.buildOCPIResponse(OCPICommandResponseType.REJECTED);
+ return CPOCommandsService.buildOCPIResponse(OCPICommandResponseType.REJECTED);
}
if (!transaction.issuer) {
await Logging.logError({
...LoggingHelper.getTransactionProperties(transaction),
tenantID: tenant.id,
- action: ServerAction.OCPI_CPO_STOP_SESSION,
+ module: MODULE_NAME, method: 'remoteStopSession', action,
message: `Transaction with Session ID '${stopSession.session_id}' is local to the tenant`,
- module: MODULE_NAME, method: 'remoteStopSession',
detailedMessages: { stopSession, transaction },
});
- return this.buildOCPIResponse(OCPICommandResponseType.REJECTED);
+ return CPOCommandsService.buildOCPIResponse(OCPICommandResponseType.REJECTED);
}
if (transaction.stop) {
await Logging.logError({
...LoggingHelper.getTransactionProperties(transaction),
tenantID: tenant.id,
- action: ServerAction.OCPI_CPO_STOP_SESSION,
+ module: MODULE_NAME, method: 'remoteStopSession', action,
message: `Transaction with Session ID '${stopSession.session_id}' is already stopped`,
- module: MODULE_NAME, method: 'remoteStopSession',
detailedMessages: { stopSession, transaction },
});
- return this.buildOCPIResponse(OCPICommandResponseType.REJECTED);
+ return CPOCommandsService.buildOCPIResponse(OCPICommandResponseType.REJECTED);
}
const chargingStation = await ChargingStationStorage.getChargingStation(tenant, transaction.chargeBoxID);
if (!chargingStation) {
await Logging.logError({
...LoggingHelper.getTransactionProperties(transaction),
tenantID: tenant.id,
- action: ServerAction.OCPI_CPO_STOP_SESSION,
+ module: MODULE_NAME, method: 'remoteStopSession', action,
message: `Charging Station ID '${transaction.chargeBoxID}' has not been found`,
- module: MODULE_NAME, method: 'remoteStopSession',
detailedMessages: { stopSession, transaction },
});
- return this.buildOCPIResponse(OCPICommandResponseType.REJECTED);
+ return CPOCommandsService.buildOCPIResponse(OCPICommandResponseType.REJECTED);
}
// Called Async as the response to the eMSP is sent asynchronously and this request has to finish before the command returns
- void this.remoteStopTransaction(tenant, chargingStation, transaction.id, stopSession, ocpiEndpoint);
- return this.buildOCPIResponse(OCPICommandResponseType.ACCEPTED);
+ void CPOCommandsService.remoteStopTransaction(action, tenant, chargingStation, transaction.id, stopSession, ocpiEndpoint);
+ return CPOCommandsService.buildOCPIResponse(OCPICommandResponseType.ACCEPTED);
}
- private buildOCPIResponse(responseType: OCPICommandResponseType): OCPIResponse {
+ private static buildOCPIResponse(responseType: OCPICommandResponseType): OCPIResponse {
return OCPIUtils.success({ result: responseType });
}
- private validateStartSession(startSession: OCPIStartSession): boolean {
+ private static validateStartSession(startSession: OCPIStartSession): boolean {
if (!startSession
|| !startSession.response_url
|| !startSession.evse_uid
@@ -277,7 +258,7 @@ export default class CPOCommandsEndpoint extends AbstractEndpoint {
return OCPIUtilsService.validateCpoToken(startSession.token);
}
- private validateStopSession(stopSession: OCPIStopSession): boolean {
+ private static validateStopSession(stopSession: OCPIStopSession): boolean {
if (!stopSession ||
!stopSession.response_url ||
!stopSession.session_id) {
@@ -286,16 +267,15 @@ export default class CPOCommandsEndpoint extends AbstractEndpoint {
return true;
}
- private async remoteStartTransaction(tenant: Tenant, chargingStation: ChargingStation,
+ private static async remoteStartTransaction(action: ServerAction, tenant: Tenant, chargingStation: ChargingStation,
connector: Connector, startSession: OCPIStartSession, ocpiEndpoint: OCPIEndpoint): Promise<void> {
const chargingStationClient = await ChargingStationClientFactory.getChargingStationClient(tenant, chargingStation);
if (!chargingStationClient) {
await Logging.logError({
...LoggingHelper.getChargingStationProperties(chargingStation),
tenantID: tenant.id,
- action: ServerAction.OCPI_CPO_START_SESSION,
+ module: MODULE_NAME, method: 'remoteStartTransaction', action,
message: 'Charging Station is not connected to the backend',
- module: MODULE_NAME, method: 'remoteStartTransaction',
detailedMessages: { startSession, chargingStation },
});
}
@@ -304,22 +284,21 @@ export default class CPOCommandsEndpoint extends AbstractEndpoint {
idTag: startSession.token.uid
});
if (result?.status === OCPPRemoteStartStopStatus.ACCEPTED) {
- await this.sendCommandResponse(tenant, ServerAction.OCPI_CPO_START_SESSION, startSession.response_url, OCPICommandResponseType.ACCEPTED, ocpiEndpoint);
+ await CPOCommandsService.sendCommandResponse(tenant, action, startSession.response_url, OCPICommandResponseType.ACCEPTED, ocpiEndpoint);
} else {
- await this.sendCommandResponse(tenant, ServerAction.OCPI_CPO_START_SESSION, startSession.response_url, OCPICommandResponseType.REJECTED, ocpiEndpoint);
+ await CPOCommandsService.sendCommandResponse(tenant, action, startSession.response_url, OCPICommandResponseType.REJECTED, ocpiEndpoint);
}
}
- private async remoteStopTransaction(tenant: Tenant, chargingStation: ChargingStation, transactionId: number,
+ private static async remoteStopTransaction(action: ServerAction, tenant: Tenant, chargingStation: ChargingStation, transactionId: number,
stopSession: OCPIStopSession, ocpiEndpoint: OCPIEndpoint): Promise<void> {
const chargingStationClient = await ChargingStationClientFactory.getChargingStationClient(tenant, chargingStation);
if (!chargingStationClient) {
await Logging.logError({
...LoggingHelper.getChargingStationProperties(chargingStation),
tenantID: tenant.id,
- action: ServerAction.OCPI_CPO_STOP_SESSION,
+ module: MODULE_NAME, method: 'remoteStopTransaction', action,
message: 'Charging Station is not connected to the backend',
- module: MODULE_NAME, method: 'remoteStopTransaction',
detailedMessages: { transactionId, stopSession, chargingStation },
});
}
@@ -327,26 +306,23 @@ export default class CPOCommandsEndpoint extends AbstractEndpoint {
transactionId: transactionId
});
if (result?.status === OCPPRemoteStartStopStatus.ACCEPTED) {
- await this.sendCommandResponse(tenant, ServerAction.OCPI_CPO_STOP_SESSION, stopSession.response_url, OCPICommandResponseType.ACCEPTED, ocpiEndpoint);
+ await CPOCommandsService.sendCommandResponse(tenant, action, stopSession.response_url, OCPICommandResponseType.ACCEPTED, ocpiEndpoint);
} else {
- await this.sendCommandResponse(tenant, ServerAction.OCPI_CPO_STOP_SESSION, stopSession.response_url, OCPICommandResponseType.REJECTED, ocpiEndpoint);
+ await CPOCommandsService.sendCommandResponse(tenant, action, stopSession.response_url, OCPICommandResponseType.REJECTED, ocpiEndpoint);
}
}
- private async sendCommandResponse(tenant: Tenant, action: ServerAction, responseUrl: string, responseType: OCPICommandResponseType, ocpiEndpoint: OCPIEndpoint) {
+ private static async sendCommandResponse(tenant: Tenant, action: ServerAction, responseUrl: string, responseType: OCPICommandResponseType, ocpiEndpoint: OCPIEndpoint) {
// Build payload
const payload: OCPICommandResponse = {
result: responseType
};
- // Log
await Logging.logDebug({
tenantID: tenant.id,
- action: action,
+ module: MODULE_NAME, method: 'sendCommandResponse', action,
message: `Post command response at ${responseUrl}`,
- module: MODULE_NAME, method: 'sendCommandResponse',
detailedMessages: { payload }
});
- // Call IOP
await AxiosFactory.getAxiosInstance(tenant).post(responseUrl, payload,
{
headers: {
@@ -356,4 +332,3 @@ export default class CPOCommandsEndpoint extends AbstractEndpoint {
});
}
}
-

MODIFY
src/types/Server.ts
src/types/Server.ts
@@ -674,6 +674,7 @@ export enum OCPIServerRoute {
OCPI_VERSIONS = 'versions',
OCPI_LOCATIONS = 'locations',
OCPI_CDRS = 'cdrs',
+ OCPI_COMMANDS = 'commands',
OCPI_TOKENS = 'tokens',
}

Migrated CPO Commands endpoint