Added OCPIEndpoint pullTokens/SendEVESEStatuses/sendTokens/generateTokens endpoints
MODIFY
src/assets/server/rest/v1/docs/e-mobility-oas.json
src/assets/server/rest/v1/docs/e-mobility-oas.json
}
}
}
+ },
+ "/api/ocpi/endpoints/{id}/tokens/pull": {
+ "put": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Pull OCPI Endpoint's tokens",
+ "tags": [
+ "OCPI"
+ ],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/OCPIEndpointID"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OCPI Endpoint's tokens pulled",
+ "content": {
+ "application/json": {
+ "example": {
+ "status": "Success"
+ }
+ }
+ }
+ },
+ "401": {
+ "$ref": "#/components/responses/UnauthorizedError"
+ },
+ "403": {
+ "$ref": "#/components/responses/ForbiddenError"
+ },
+ "500": {
+ "$ref": "#/components/responses/BackendError"
+ }
+ }
+ }
+ },
+ "/api/ocpi/endpoints/:id/evses/statuses/send": {
+ "put": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Send OCPI EVSE's statuses",
+ "tags": [
+ "OCPI"
+ ],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/OCPIEndpointID"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OCPI Endpoint's EVSE's statuses sent",
+ "content": {
+ "application/json": {
+ "example": {
+ "status": "Success"
+ }
+ }
+ }
+ },
+ "401": {
+ "$ref": "#/components/responses/UnauthorizedError"
+ },
+ "403": {
+ "$ref": "#/components/responses/ForbiddenError"
+ },
+ "500": {
+ "$ref": "#/components/responses/BackendError"
+ }
+ }
+ }
+ },
+ "/api/ocpi/endpoints/:id/tokens/send": {
+ "put": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Push OCPI Endpoint's tokens",
+ "tags": [
+ "OCPI"
+ ],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/OCPIEndpointID"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OCPI Endpoint's tokens pushed",
+ "content": {
+ "application/json": {
+ "example": {
+ "status": "Success"
+ }
+ }
+ }
+ },
+ "401": {
+ "$ref": "#/components/responses/UnauthorizedError"
+ },
+ "403": {
+ "$ref": "#/components/responses/ForbiddenError"
+ },
+ "500": {
+ "$ref": "#/components/responses/BackendError"
+ }
+ }
+ }
+ },
+ "/api/ocpi/endpoints/:id/tokens/generate": {
+ "put": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Generate OCPI Endpoint's local token",
+ "tags": [
+ "OCPI"
+ ],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/OCPIEndpointID"
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OCPIEndpoint"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "OCPI Endpoint's local tokens generated",
+ "content": {
+ "application/json": {
+ "example": {
+ "status": "Success",
+ "id": "###",
+ "localToken": "###"
+ }
+ }
+ }
+ },
+ "401": {
+ "$ref": "#/components/responses/UnauthorizedError"
+ },
+ "403": {
+ "$ref": "#/components/responses/ForbiddenError"
+ },
+ "500": {
+ "$ref": "#/components/responses/BackendError"
+ }
+ }
+ }
}
},
"components": {

MODIFY
src/server/rest/v1/router/api/OCPIRouter.ts
src/server/rest/v1/router/api/OCPIRouter.ts
@@ -21,6 +21,10 @@ export default class OCPIRouter {
this.buildRouteOcpiEndpointPullCDRs();
this.buildRouteOcpiEndpointPullLocations();
this.buildRouteOcpiEndpointPullSessions();
+ this.buildRouteOcpiEndpointPullTokens();
+ this.buildRouteOcpiEndpointSendEVSEStatuses();
+ this.buildRouteOcpiEndpointSendTokens();
+ this.buildRouteOcpiEndpointGenerateTokens();
return this.router;
}
@@ -71,4 +75,28 @@ export default class OCPIRouter {
await RouterUtils.handleServerAction(OCPIEndpointService.handlePullSessionsEndpoint.bind(this), ServerAction.OCPI_PULL_SESSIONS, req, res, next);
});
}
+
+ protected buildRouteOcpiEndpointPullTokens(): void {
+ this.router.put(`/${ServerRoute.REST_OCPI_ENDPOINT_PULL_TOKENS}`, async (req: Request, res: Response, next: NextFunction) => {
+ await RouterUtils.handleServerAction(OCPIEndpointService.handlePullTokensEndpoint.bind(this), ServerAction.OCPI_PULL_TOKENS, req, res, next);
+ });
+ }
+
+ protected buildRouteOcpiEndpointSendEVSEStatuses(): void {
+ this.router.put(`/${ServerRoute.REST_OCPI_ENDPOINT_SEND_EVSE_STATUSES}`, async (req: Request, res: Response, next: NextFunction) => {
+ await RouterUtils.handleServerAction(OCPIEndpointService.handlePushEVSEStatusesOcpiEndpoint.bind(this), ServerAction.OCPI_ENDPOINT_SEND_EVSE_STATUSES, req, res, next);
+ });
+ }
+
+ protected buildRouteOcpiEndpointSendTokens(): void {
+ this.router.put(`/${ServerRoute.REST_OCPI_ENDPOINT_SEND_TOKENS}`, async (req: Request, res: Response, next: NextFunction) => {
+ await RouterUtils.handleServerAction(OCPIEndpointService.handlePushTokensOcpiEndpoint.bind(this), ServerAction.OCPI_ENDPOINT_SEND_TOKENS, req, res, next);
+ });
+ }
+
+ protected buildRouteOcpiEndpointGenerateTokens(): void {
+ this.router.put(`/${ServerRoute.REST_OCPI_ENDPOINT_GENERATE_LOCAL_TOKEN}`, async (req: Request, res: Response, next: NextFunction) => {
+ await RouterUtils.handleServerAction(OCPIEndpointService.handleGenerateLocalTokenOcpiEndpoint.bind(this), ServerAction.OCPI_ENDPOINT_GENERATE_LOCAL_TOKEN, req, res, next);
+ });
+ }
}

Added OCPIEndpoint pullTokens/SendEVESEStatuses/sendTokens/generateTokens endpoints