Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
Merge pull request #2638 from sap-labs-france/master-qa
Browse files Browse the repository at this point in the history
Merge master-qa
  • Loading branch information
LucasBrazi06 authored Jul 2, 2021
2 parents cb5d960 + 91e448a commit 05a48e8
Show file tree
Hide file tree
Showing 64 changed files with 368 additions and 269 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ev-server",
"version": "2.4.72",
"version": "2.4.73",
"engines": {
"node": "14.x.x",
"npm": "6.x.x"
Expand Down
2 changes: 1 addition & 1 deletion src/assets/configs-aws
32 changes: 16 additions & 16 deletions src/async-task/AsyncTaskManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class AsyncTaskManager {
tenantID: Constants.DEFAULT_TENANT,
action: ServerAction.ASYNC_TASK,
module: MODULE_NAME, method: 'handleAsyncTasks',
message: 'Checking Async Task to process...'
message: 'Checking asynchronous task to process...'
});
const processedTask: ActionsResponse = {
inError: 0,
Expand All @@ -69,7 +69,7 @@ export default class AsyncTaskManager {
tenantID: Constants.DEFAULT_TENANT,
action: ServerAction.ASYNC_TASK,
module: MODULE_NAME, method: 'handleAsyncTasks',
message: `${asyncTasks.result.length} Async Task(s) are going to be processed...`
message: `${asyncTasks.result.length} asynchronous task(s) are going to be processed...`
});
await Promise.map(asyncTasks.result,
async (asyncTask: AsyncTask) => {
Expand Down Expand Up @@ -120,7 +120,7 @@ export default class AsyncTaskManager {
tenantID: Constants.DEFAULT_TENANT,
action: ServerAction.ASYNC_TASK,
module: MODULE_NAME, method: 'handleAsyncTasks',
message: `The Async Task '${asyncTask.name}' is unknown`
message: `The asynchronous task '${asyncTask.name}' is unknown`
});
}
if (abstractAsyncTask) {
Expand All @@ -140,7 +140,7 @@ export default class AsyncTaskManager {
tenantID: Constants.DEFAULT_TENANT,
action: ServerAction.ASYNC_TASK,
module: MODULE_NAME, method: 'handleAsyncTasks',
message: `The task '${asyncTask.name}' is running...`
message: `The asynchronous task '${asyncTask.name}' is running...`
});
// Run
await abstractAsyncTask.run();
Expand All @@ -157,7 +157,7 @@ export default class AsyncTaskManager {
tenantID: Constants.DEFAULT_TENANT,
action: ServerAction.ASYNC_TASK,
module: MODULE_NAME, method: 'handleAsyncTasks',
message: `The task '${asyncTask.name}' has been processed in ${asyncTaskTotalDurationSecs} secs`
message: `The asynchronous task '${asyncTask.name}' has been processed in ${asyncTaskTotalDurationSecs} secs`
});
} catch (error) {
processedTask.inError++;
Expand All @@ -172,8 +172,8 @@ export default class AsyncTaskManager {
tenantID: Constants.DEFAULT_TENANT,
module: MODULE_NAME, method: 'handleAsyncTasks',
action: ServerAction.ASYNC_TASK,
message: `Error while running the Async Task '${asyncTask.name}': ${error.message}`,
detailedMessages: { error: error.message, stack: error.stack, asyncTask }
message: `Error while running the asynchronous task '${asyncTask.name}': ${error.message}`,
detailedMessages: { error: error.stack, asyncTask }
});
} finally {
// Release lock
Expand All @@ -187,17 +187,17 @@ export default class AsyncTaskManager {
const totalDurationSecs = Utils.truncTo((new Date().getTime() - startTime) / 1000, 2);
void Logging.logActionsResponse(Constants.DEFAULT_TENANT, ServerAction.ASYNC_TASK,
MODULE_NAME, 'handleAsyncTasks', processedTask,
`{{inSuccess}} Async Task(s) were successfully processed in ${totalDurationSecs} secs`,
`{{inError}} Async Task(s) failed to be processed in ${totalDurationSecs} secs`,
`{{inSuccess}} Async Task(s) were successfully processed in ${totalDurationSecs} secs and {{inError}} failed`,
'No Async Task to process'
`{{inSuccess}} asynchronous task(s) were successfully processed in ${totalDurationSecs} secs`,
`{{inError}} asynchronous task(s) failed to be processed in ${totalDurationSecs} secs`,
`{{inSuccess}} asynchronous task(s) were successfully processed in ${totalDurationSecs} secs and {{inError}} failed`,
'No asynchronous task to process'
);
} else {
await Logging.logInfo({
tenantID: Constants.DEFAULT_TENANT,
action: ServerAction.ASYNC_TASK,
module: MODULE_NAME, method: 'handleAsyncTasks',
message: 'No Async Task to process'
message: 'No asynchronous task to process'
});
}
}
Expand All @@ -206,14 +206,14 @@ export default class AsyncTaskManager {
public static async createAndSaveAsyncTasks(asyncTask: Omit<AsyncTask, 'id'>): Promise<void> {
// Check
if (Utils.isNullOrUndefined(asyncTask)) {
throw new Error('The Async Task must not be null');
throw new Error('The asynchronous task must not be null');
}
// Check
if (Utils.isNullOrUndefined(asyncTask.name)) {
throw new Error('The Name of the Async Task is mandatory');
throw new Error('The Name of the asynchronous task is mandatory');
}
if (!Utils.isNullOrUndefined(asyncTask.parameters) && (typeof asyncTask.parameters !== 'object')) {
throw new Error('The Parameters of the Async Task must be a Json document');
throw new Error('The Parameters of the asynchronous task must be a Json document');
}
// Set
asyncTask.status = AsyncTaskStatus.PENDING;
Expand All @@ -225,7 +225,7 @@ export default class AsyncTaskManager {
tenantID: Constants.DEFAULT_TENANT,
action: ServerAction.ASYNC_TASK,
module: MODULE_NAME, method: 'createAndSaveAsyncTasks',
message: `The task '${asyncTask.name}' has been saved successfully and will be processed soon`
message: `The asynchronous task '${asyncTask.name}' has been saved successfully and will be processed soon`
});
}
}
2 changes: 1 addition & 1 deletion src/async-task/tasks/TagsImportAsyncTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default class TagsImportAsyncTask extends AbstractAsyncTask {
action: ServerAction.TAGS_IMPORT,
module: MODULE_NAME, method: 'processTenant',
message: `Error when importing Tag ID '${importedTag.id}': ${error.message}`,
detailedMessages: { tag: importedTag, error: error.message, stack: error.stack }
detailedMessages: { tag: importedTag, error: error.stack }
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/async-task/tasks/UsersImportAsyncTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default class UsersImportAsyncTask extends AbstractAsyncTask {
action: ServerAction.USERS_IMPORT,
module: MODULE_NAME, method: 'processTenant',
message: `Error when importing User with email '${importedUser.email}': ${error.message}`,
detailedMessages: { user: importedUser, error: error.message, stack: error.stack }
detailedMessages: { user: importedUser, error: error.stack }
});
}
}
Expand Down
26 changes: 13 additions & 13 deletions src/authorization/AuthorizationsDefinition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
{
resource: Entity.COMPANIES, action: Action.LIST,
attributes: [
'id', 'name', 'address', 'logo', 'issuer', 'distanceMeters', 'createdOn', 'lastChangedOn',
'id', 'name', 'address.city', 'address.country', 'logo', 'issuer', 'distanceMeters', 'createdOn', 'lastChangedOn',
'createdBy.name', 'createdBy.firstName', 'lastChangedBy.name', 'lastChangedBy.firstName'
]
},
Expand Down Expand Up @@ -133,7 +133,7 @@ const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
{
resource: Entity.SITES, action: Action.LIST,
attributes: [
'id', 'name', 'address', 'companyID', 'company.name', 'autoUserSiteAssignment', 'issuer',
'id', 'name', 'address.city', 'address.country', 'companyID', 'company.name', 'autoUserSiteAssignment', 'issuer',
'autoUserSiteAssignment', 'distanceMeters', 'public', 'createdOn', 'lastChangedOn',
'createdBy.name', 'createdBy.firstName', 'lastChangedBy.name', 'lastChangedBy.firstName'
]
Expand All @@ -154,7 +154,7 @@ const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
{
resource: Entity.SITE_AREAS, action: Action.LIST,
attributes: [
'id', 'name', 'siteID', 'maximumPower', 'voltage', 'numberOfPhases', 'accessControl', 'smartCharging', 'address',
'id', 'name', 'siteID', 'maximumPower', 'voltage', 'numberOfPhases', 'accessControl', 'smartCharging', 'address.city', 'address.country',
'site.id', 'site.name', 'issuer', 'distanceMeters', 'createdOn', 'createdBy', 'lastChangedOn', 'lastChangedBy'
]
},
Expand Down Expand Up @@ -393,7 +393,7 @@ const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
args: { filters: ['AssignedSitesCompanies'] }
},
attributes: [
'id', 'name', 'address', 'logo', 'issuer', 'distanceMeters', 'createdOn', 'lastChangedOn'
'id', 'name', 'address.city', 'address.country', 'logo', 'issuer', 'distanceMeters', 'createdOn', 'lastChangedOn'
]
},
{
Expand All @@ -419,7 +419,7 @@ const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
{
resource: Entity.SITES, action: Action.LIST,
attributes: [
'id', 'name', 'address', 'companyID', 'company.name', 'autoUserSiteAssignment', 'issuer',
'id', 'name', 'address.city', 'address.country', 'companyID', 'company.name', 'autoUserSiteAssignment', 'issuer',
'autoUserSiteAssignment', 'distanceMeters', 'public', 'createdOn', 'lastChangedOn',
],
condition: {
Expand All @@ -441,7 +441,7 @@ const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
{
resource: Entity.SITE_AREAS, action: Action.LIST,
attributes: [
'id', 'name', 'siteID', 'maximumPower', 'voltage', 'numberOfPhases', 'accessControl', 'smartCharging', 'address',
'id', 'name', 'siteID', 'maximumPower', 'voltage', 'numberOfPhases', 'accessControl', 'smartCharging', 'address.city', 'address.country',
'site.id', 'site.name', 'issuer', 'distanceMeters', 'createdOn', 'lastChangedOn'
],
condition: {
Expand Down Expand Up @@ -615,7 +615,7 @@ const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
},
{
resource: Entity.COMPANIES, action: Action.LIST, attributes: [
'id', 'name', 'address', 'logo', 'issuer', 'distanceMeters', 'createdOn', 'lastChangedOn'
'id', 'name', 'address.city', 'address.country', 'logo', 'issuer', 'distanceMeters', 'createdOn', 'lastChangedOn'
]
},
{
Expand All @@ -625,7 +625,7 @@ const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
},
{
resource: Entity.SITES, action: Action.LIST, attributes: [
'id', 'name', 'address', 'companyID', 'company.name', 'autoUserSiteAssignment', 'issuer',
'id', 'name', 'address.city', 'address.country', 'companyID', 'company.name', 'autoUserSiteAssignment', 'issuer',
'autoUserSiteAssignment', 'distanceMeters', 'public', 'createdOn', 'lastChangedOn',
]
},
Expand All @@ -637,7 +637,7 @@ const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
},
{
resource: Entity.SITE_AREAS, action: Action.LIST, attributes: [
'id', 'name', 'siteID', 'maximumPower', 'voltage', 'numberOfPhases', 'accessControl', 'smartCharging', 'address',
'id', 'name', 'siteID', 'maximumPower', 'voltage', 'numberOfPhases', 'accessControl', 'smartCharging', 'address.city', 'address.country',
'site.id', 'site.name', 'issuer', 'distanceMeters', 'createdOn', 'lastChangedOn'
]
},
Expand Down Expand Up @@ -848,7 +848,7 @@ export default class AuthorizationsDefinition {
source: Constants.CENTRAL_SERVER,
module: MODULE_NAME, method: 'constructor',
message: 'Unable to init authorization definition',
detailedMessages: { error: error.message, stack: error.stack }
detailedMessages: { error: error.stack }
});
}
}
Expand All @@ -874,7 +874,7 @@ export default class AuthorizationsDefinition {
module: MODULE_NAME,
method: 'getScopes',
message: 'Unable to load available scopes',
detailedMessages: { error: error.message, stack: error.stack }
detailedMessages: { error: error.stack }
});
}
return scopes;
Expand All @@ -890,7 +890,7 @@ export default class AuthorizationsDefinition {
module: MODULE_NAME,
method: 'can',
message: 'Unable to check authorization',
detailedMessages: { error: error.message, stack: error.stack }
detailedMessages: { error: error.stack }
});
}
}
Expand All @@ -908,7 +908,7 @@ export default class AuthorizationsDefinition {
module: MODULE_NAME,
method: 'canPerformAction',
message: 'Unable to check authorization',
detailedMessages: { error: error.message, stack: error.stack }
detailedMessages: { error: error.stack }
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/client/ocpp/json/JsonRestChargingStationClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export default class JsonRestChargingStationClient extends ChargingStationClient
action: ServerAction.WS_REST_CLIENT_CONNECTION_ERROR,
module: MODULE_NAME, method: 'onError',
message: `Connection error to '${this.serverURL}: ${error.toString()}`,
detailedMessages: { error: error.message, stack: error.stack }
detailedMessages: { error: error.stack }
});
// Terminate WS in error
this.terminateConnection();
Expand Down
2 changes: 1 addition & 1 deletion src/client/ocpp/soap/SoapChargingStationClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default class SoapChargingStationClient extends ChargingStationClient {
source: scsc.chargingStation.id,
module: MODULE_NAME, method: 'getChargingStationClient',
message: `Error when creating SOAP client: ${error.toString()}`,
detailedMessages: { error: error.message, stack: error.stack }
detailedMessages: { error: error.stack }
});
reject(`Error when creating SOAP client for charging station with ID ${scsc.chargingStation.id}: ${error.message}`);
} else {
Expand Down
27 changes: 9 additions & 18 deletions src/client/oicp/CpoOICPClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,7 @@ export default class CpoOICPClient extends OICPClient {
message: this.buildOICPChargingNotificationErrorMessage(pushEvseDataResponse, requestError),
module: MODULE_NAME, method: 'pushEvseData',
detailedMessages: {
error: requestError?.message,
stack: requestError?.stack,
error: requestError?.stack,
evse: payload,
response: pushEvseDataResponse,
}
Expand Down Expand Up @@ -582,8 +581,7 @@ export default class CpoOICPClient extends OICPClient {
message: this.buildOICPChargingNotificationErrorMessage(pushEvseStatusResponse, requestError),
module: MODULE_NAME, method: 'pushEvseStatus',
detailedMessages: {
error: requestError?.message,
stack: requestError?.stack,
error: requestError?.stack,
evseStatus: payload,
response: pushEvseStatusResponse,
}
Expand Down Expand Up @@ -640,8 +638,7 @@ export default class CpoOICPClient extends OICPClient {
message: this.buildOICPChargingNotificationErrorMessage(authorizeResponse, requestError),
module: MODULE_NAME, method: 'authorizeStart',
detailedMessages: {
error: requestError?.message,
stack: requestError?.stack,
error: requestError?.stack,
authorize: payload,
response: authorizeResponse,
}
Expand Down Expand Up @@ -709,8 +706,7 @@ export default class CpoOICPClient extends OICPClient {
message: this.buildOICPChargingNotificationErrorMessage(authorizeResponse, requestError),
module: MODULE_NAME, method: 'authorizeStop',
detailedMessages: {
error: requestError?.message,
stack: requestError?.stack,
error: requestError?.stack,
authorize: payload,
response: authorizeResponse,
}
Expand Down Expand Up @@ -816,8 +812,7 @@ export default class CpoOICPClient extends OICPClient {
message: this.buildOICPChargingNotificationErrorMessage(pushCdrResponse, requestError),
module: MODULE_NAME, method: 'pushCdr',
detailedMessages: {
error: requestError?.message,
stack: requestError?.stack,
error: requestError?.stack,
cdr: payload,
response: pushCdrResponse,
}
Expand Down Expand Up @@ -892,9 +887,8 @@ export default class CpoOICPClient extends OICPClient {
message: this.buildOICPChargingNotificationErrorMessage(notificationStartResponse, requestError),
module: MODULE_NAME, method: 'sendChargingNotificationStart',
detailedMessages: {
error: requestError?.message,
chargingStart: payload,
stack: requestError?.stack,
error: requestError?.stack,
response: notificationStartResponse,
}
});
Expand Down Expand Up @@ -972,8 +966,7 @@ export default class CpoOICPClient extends OICPClient {
message: this.buildOICPChargingNotificationErrorMessage(notificationProgressResponse, requestError),
module: MODULE_NAME, method: 'sendChargingNotificationProgress',
detailedMessages: {
error: requestError?.message,
stack: requestError?.stack,
error: requestError?.stack,
chargingProgress: payload,
response: notificationProgressResponse,
}
Expand Down Expand Up @@ -1066,8 +1059,7 @@ export default class CpoOICPClient extends OICPClient {
message: this.buildOICPChargingNotificationErrorMessage(notificationEndResponse, requestError),
module: MODULE_NAME, method: 'sendChargingNotificationEnd',
detailedMessages: {
error: requestError?.message,
stack: requestError?.stack,
error: requestError?.stack,
chargingEnd: payload,
response: notificationEndResponse,
}
Expand Down Expand Up @@ -1139,8 +1131,7 @@ export default class CpoOICPClient extends OICPClient {
message: this.buildOICPChargingNotificationErrorMessage(notificationErrorResponse, requestError),
module: MODULE_NAME, method: 'sendChargingNotificationError',
detailedMessages: {
error: requestError?.message,
stack: requestError?.stack,
error: requestError?.stack,
chargingError: payload,
response: notificationErrorResponse,
}
Expand Down
2 changes: 1 addition & 1 deletion src/integration/asset/greencom/GreencomAssetIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default class GreencomAssetIntegration extends AssetIntegration<AssetSett
method: 'retrieveConsumption',
action: ServerAction.RETRIEVE_ASSET_CONSUMPTION,
message: 'Error while retrieving the asset consumption',
detailedMessages: { request, token, error: error.message, stack: error.stack, asset }
detailedMessages: { request, token, error: error.stack, asset }
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/integration/asset/iothink/IothinkAssetIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default class IothinkAssetIntegration extends AssetIntegration<AssetSetti
method: 'retrieveConsumption',
action: ServerAction.RETRIEVE_ASSET_CONSUMPTION,
message: 'Error while retrieving the asset consumption',
detailedMessages: { request, token, error: error.message, stack: error.stack, asset }
detailedMessages: { request, token, error: error.stack, asset }
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default class SchneiderAssetIntegration extends AssetIntegration<AssetSet
method: 'retrieveConsumption',
action: ServerAction.RETRIEVE_ASSET_CONSUMPTION,
message: 'Error while retrieving the asset consumption',
detailedMessages: { request, token, error: error.message, stack: error.stack, asset }
detailedMessages: { request, token, error: error.stack, asset }
});
}
}
Expand Down
Loading

0 comments on commit 05a48e8

Please sign in to comment.