Renamed chargingstations endpoint
MODIFY
src/assets/server/rest/v1/docs/e-mobility-oas.json
src/assets/server/rest/v1/docs/e-mobility-oas.json
}
}
},
- "/api/chargingstations": {
+ "/api/charging-stations": {
"get": {
"security": [
{
}
}
},
- "/api/chargingstations/{id}": {
+ "/api/charging-stations/{id}": {
"get": {
"security": [
{
}
}
},
- "/api/chargingstations/{id}/reset": {
+ "/api/charging-stations/{id}/reset": {
"put": {
"security": [
{
}
}
},
- "/api/chargingstations/{id}/cache/clear": {
+ "/api/charging-stations/{id}/cache/clear": {
"put": {
"security": [
{
}
}
},
- "/api/chargingstations/{id}/configuration/retrieve": {
+ "/api/charging-stations/{id}/configuration/retrieve": {
"put": {
"security": [
{
}
}
},
- "/api/chargingstations/{id}/configuration": {
+ "/api/charging-stations/{id}/configuration": {
"put": {
"security": [
{
}
}
},
- "/api/chargingstations/{id}/remote/start": {
+ "/api/charging-stations/{id}/remote/start": {
"put": {
"security": [
{
}
}
},
- "/api/chargingstations/{id}/remote/stop": {
+ "/api/charging-stations/{id}/remote/stop": {
"put": {
"security": [
{
}
}
},
- "/api/chargingstations/{id}/connectors/{connectorId}/unlock": {
+ "/api/charging-stations/{id}/connectors/{connectorId}/unlock": {
"put": {
"security": [
{
}
}
},
- "/api/chargingstations/{id}/compositeschedule": {
+ "/api/charging-stations/{id}/compositeschedule": {
"put": {
"security": [
{
}
}
},
- "/api/chargingstations/{id}/diagnostics": {
+ "/api/charging-stations/{id}/diagnostics": {
"put": {
"security": [
{
}
}
},
- "/api/chargingstations/{id}/firmware/update": {
+ "/api/charging-stations/{id}/firmware/update": {
"put": {
"security": [
{
}
}
},
- "/api/chargingstations/{id}/availability/change": {
+ "/api/charging-stations/{id}/availability/change": {
"put": {
"security": [
{
}
}
},
- "/api/chargingstations/{id}/connectors/{connectorId}/qrcode/generate": {
+ "/api/charging-stations/{id}/connectors/{connectorId}/qrcode/generate": {
"get": {
"security": [
{
}
}
},
- "/api/chargingstations/qrcode/download": {
+ "/api/charging-stations/qrcode/download": {
"get": {
"security": [
{
}
}
},
- "/api/chargingstations/{id}/ocpp/parameters": {
+ "/api/charging-stations/{id}/ocpp/parameters": {
"get": {
"security": [
{
}
}
},
- "/api/chargingstations/ocpp/parameters": {
+ "/api/charging-stations/ocpp/parameters": {
"post": {
"security": [
{
}
}
},
- "/api/chargingstations/ocpp/parameters/export": {
+ "/api/charging-stations/ocpp/parameters/export": {
"get": {
"security": [
{
}
}
},
- "/api/chargingstations/{id}/parameters": {
+ "/api/charging-stations/{id}/parameters": {
"put": {
"security": [
{
}
}
},
- "/api/chargingstations/{id}/power/limit": {
+ "/api/charging-stations/{id}/power/limit": {
"put": {
"security": [
{
}
}
},
- "/api/chargingstations/{id}/transactions": {
+ "/api/charging-stations/{id}/transactions": {
"get": {
"security": [
{
}
}
},
- "/api/chargingstations/status/in-error": {
+ "/api/charging-stations/status/in-error": {
"get": {
"security": [
{
}
}
},
- "/api/chargingstations/action/export": {
+ "/api/charging-stations/action/export": {
"get": {
"security": [
{
}
}
},
- "/api/chargingstations/firmware/download": {
+ "/api/charging-stations/firmware/download": {
"get": {
"security": [
{
}
}
},
- "/api/chargingstations/smartcharging/connection/check": {
+ "/api/charging-stations/smartcharging/connection/check": {
"get": {
"security": [
{
}
}
},
- "/api/chargingstations/smartcharging/trigger": {
+ "/api/charging-stations/smartcharging/trigger": {
"get": {
"security": [
{
}
}
},
- "/api/chargingprofiles": {
+ "/api/charging-profiles": {
"get": {
"security": [
{
}
}
},
- "/api/chargingprofiles/{id}": {
+ "/api/charging-profiles/{id}": {
"put": {
"security": [
{

MODIFY
src/types/Server.ts
src/types/Server.ts
@@ -448,40 +448,40 @@ export enum ServerRoute {
REST_MAIL_CHECK = 'mail/check',
REST_MAIL_RESEND = 'mail/resend',
- REST_CHARGING_STATIONS = 'chargingstations',
- REST_CHARGING_STATION = 'chargingstations/:id',
-
- REST_CHARGING_STATIONS_RESET = 'chargingstations/:id/reset',
- REST_CHARGING_STATIONS_CACHE_CLEAR = 'chargingstations/:id/cache/clear',
- REST_CHARGING_STATIONS_RETRIEVE_CONFIGURATION = 'chargingstations/:id/configuration/retrieve',
- REST_CHARGING_STATIONS_CHANGE_CONFIGURATION = 'chargingstations/:id/configuration',
- REST_CHARGING_STATIONS_REMOTE_START = 'chargingstations/:id/remote/start',
- REST_CHARGING_STATIONS_REMOTE_STOP = 'chargingstations/:id/remote/stop',
- REST_CHARGING_STATIONS_UNLOCK_CONNECTOR = 'chargingstations/:id/connectors/:connectorId/unlock',
- REST_CHARGING_STATIONS_GET_COMPOSITE_SCHEDULE = 'chargingstations/:id/compositeschedule',
- REST_CHARGING_STATIONS_GET_DIAGNOSTICS = 'chargingstations/:id/diagnostics',
- REST_CHARGING_STATIONS_FIRMWARE_UPDATE = 'chargingstations/:id/firmware/update',
- REST_CHARGING_STATIONS_CHANGE_AVAILABILITY = 'chargingstations/:id/availability/change',
-
- REST_CHARGING_STATIONS_DOWNLOAD_FIRMWARE = 'chargingstations/firmware/download',
- REST_CHARGING_STATIONS_QRCODE_GENERATE = 'chargingstations/:id/connectors/:connectorId/qrcode/generate',
- REST_CHARGING_STATIONS_QRCODE_DOWNLOAD = 'chargingstations/qrcode/download',
-
- REST_CHARGING_STATION_GET_OCPP_PARAMETERS = 'chargingstations/:id/ocpp/parameters',
- REST_CHARGING_STATIONS_REQUEST_OCPP_PARAMETERS = 'chargingstations/ocpp/parameters',
- REST_CHARGING_STATIONS_EXPORT_OCPP_PARAMETERS = 'chargingstations/ocpp/parameters/export',
-
- REST_CHARGING_STATIONS_UPDATE_PARAMETERS = 'chargingstations/:id/parameters',
- REST_CHARGING_STATIONS_POWER_LIMIT = 'chargingstations/:id/power/limit',
- REST_CHARGING_STATIONS_TRANSACTIONS = 'chargingstations/:id/transactions',
- REST_CHARGING_STATIONS_IN_ERROR = 'chargingstations/status/in-error',
- REST_CHARGING_STATIONS_EXPORT = 'chargingstations/action/export',
-
- REST_CHARGING_STATION_CHECK_SMART_CHARGING_CONNECTION = 'chargingstations/smartcharging/connection/check',
- REST_CHARGING_STATION_TRIGGER_SMART_CHARGING = 'chargingstations/smartcharging/trigger',
-
- REST_CHARGING_PROFILES = 'chargingprofiles',
- REST_CHARGING_PROFILE = 'chargingprofiles/:id',
+ REST_CHARGING_STATIONS = 'charging-stations',
+ REST_CHARGING_STATION = 'charging-stations/:id',
+
+ REST_CHARGING_STATIONS_RESET = 'charging-stations/:id/reset',
+ REST_CHARGING_STATIONS_CACHE_CLEAR = 'charging-stations/:id/cache/clear',
+ REST_CHARGING_STATIONS_RETRIEVE_CONFIGURATION = 'charging-stations/:id/configuration/retrieve',
+ REST_CHARGING_STATIONS_CHANGE_CONFIGURATION = 'charging-stations/:id/configuration',
+ REST_CHARGING_STATIONS_REMOTE_START = 'charging-stations/:id/remote/start',
+ REST_CHARGING_STATIONS_REMOTE_STOP = 'charging-stations/:id/remote/stop',
+ REST_CHARGING_STATIONS_UNLOCK_CONNECTOR = 'charging-stations/:id/connectors/:connectorId/unlock',
+ REST_CHARGING_STATIONS_GET_COMPOSITE_SCHEDULE = 'charging-stations/:id/compositeschedule',
+ REST_CHARGING_STATIONS_GET_DIAGNOSTICS = 'charging-stations/:id/diagnostics',
+ REST_CHARGING_STATIONS_FIRMWARE_UPDATE = 'charging-stations/:id/firmware/update',
+ REST_CHARGING_STATIONS_CHANGE_AVAILABILITY = 'charging-stations/:id/availability/change',
+
+ REST_CHARGING_STATIONS_DOWNLOAD_FIRMWARE = 'charging-stations/firmware/download',
+ REST_CHARGING_STATIONS_QRCODE_GENERATE = 'charging-stations/:id/connectors/:connectorId/qrcode/generate',
+ REST_CHARGING_STATIONS_QRCODE_DOWNLOAD = 'charging-stations/qrcode/download',
+
+ REST_CHARGING_STATION_GET_OCPP_PARAMETERS = 'charging-stations/:id/ocpp/parameters',
+ REST_CHARGING_STATIONS_REQUEST_OCPP_PARAMETERS = 'charging-stations/ocpp/parameters',
+ REST_CHARGING_STATIONS_EXPORT_OCPP_PARAMETERS = 'charging-stations/ocpp/parameters/export',
+
+ REST_CHARGING_STATIONS_UPDATE_PARAMETERS = 'charging-stations/:id/parameters',
+ REST_CHARGING_STATIONS_POWER_LIMIT = 'charging-stations/:id/power/limit',
+ REST_CHARGING_STATIONS_TRANSACTIONS = 'charging-stations/:id/transactions',
+ REST_CHARGING_STATIONS_IN_ERROR = 'charging-stations/status/in-error',
+ REST_CHARGING_STATIONS_EXPORT = 'charging-stations/action/export',
+
+ REST_CHARGING_STATION_CHECK_SMART_CHARGING_CONNECTION = 'charging-stations/smartcharging/connection/check',
+ REST_CHARGING_STATION_TRIGGER_SMART_CHARGING = 'charging-stations/smartcharging/trigger',
+
+ REST_CHARGING_PROFILES = 'charging-profiles',
+ REST_CHARGING_PROFILE = 'charging-profiles/:id',
REST_TRANSACTIONS = 'transactions',
REST_TRANSACTION = 'transactions/:id',

MODIFY
test/api/client/ChargingStationApi.ts
test/api/client/ChargingStationApi.ts
import CrudApi from './utils/CrudApi';
+import { ServerRoute } from '../../../src/types/Server';
import { StatusCodes } from 'http-status-codes';
import TestConstants from './utils/TestConstants';
import { expect } from 'chai';
@@ -14,23 +15,23 @@ export default class ChargingStationApi extends CrudApi {
}
public async readById(id) {
- return super.read({}, `/v1/api/chargingstations/${id}`);
+ return super.read({}, `/v1/api/${ServerRoute.REST_CHARGING_STATIONS}/${id}`);
}
public async readAll(params, paging = TestConstants.DEFAULT_PAGING, ordering = TestConstants.DEFAULT_ORDERING) {
- return super.readAll(params, paging, ordering, '/v1/api/chargingstations');
+ return super.readAll(params, paging, ordering, `/v1/api/${ServerRoute.REST_CHARGING_STATIONS}`);
}
public async readAllInError(params, paging = TestConstants.DEFAULT_PAGING, ordering = TestConstants.DEFAULT_ORDERING) {
- return super.readAll(params, paging, ordering, '/v1/api/chargingstations/status/in-error');
+ return super.readAll(params, paging, ordering, `/v1/api/${ServerRoute.REST_CHARGING_STATIONS_IN_ERROR}`);
}
public async update(data) {
- return super.update(data, `/v1/api/chargingstations/${data.id}/parameters`);
+ return super.update(data, `/v1/api/${ServerRoute.REST_CHARGING_STATIONS}/${data.id}/parameters`);
}
public async delete(id) {
- return super.delete(id, `/v1/api/chargingstations/${id}`);
+ return super.delete(id, `/v1/api/${ServerRoute.REST_CHARGING_STATIONS}/${id}`);
}
public async readConsumptionStatistics(year) {
@@ -42,7 +43,7 @@ export default class ChargingStationApi extends CrudApi {
}
public async readAllTransactions(params, paging = TestConstants.DEFAULT_PAGING, ordering = TestConstants.DEFAULT_ORDERING) {
- return super.readAll(params, paging, ordering, `/v1/api/chargingstations/${params.id}/transactions`);
+ return super.readAll(params, paging, ordering, `/v1/api/${ServerRoute.REST_CHARGING_STATIONS}/${params.id}/transactions`);
}
public async readAllYears(params) {
@@ -50,7 +51,7 @@ export default class ChargingStationApi extends CrudApi {
}
public async remoteStartTransaction(data) {
- return super.update(data, `/v1/api/chargingstations/${data.chargeBoxID}/remote/start`);
+ return super.update(data, `/v1/api/${ServerRoute.REST_CHARGING_STATIONS}/${data.chargeBoxID}/remote/start`);
}
public async checkConnector(chargingStation, connectorId, connectorData) {

Renamed chargingstations endpoint