[MIGRATION] - Fixed lint errors for empty function

This commit is contained in:
VitoAlbano
2024-08-05 23:06:04 +01:00
parent cf175c67b8
commit 1c339a926b
867 changed files with 2147 additions and 2153 deletions

View File

@@ -61,20 +61,20 @@ export class UploadActions {
// eslint-disable-next-line @typescript-eslint/prefer-for-of
for (let i = 0; i < emptyFileNames.length; i++) {
const jsonItem = {};
const jsonItem = { /* empty */ };
jsonItem['name'] = emptyFileNames[i];
jsonItem['nodeType'] = 'cm:content';
filesRequest.push(jsonItem);
}
return this.nodesApi.createNode(parentFolderId, filesRequest as any, {});
return this.nodesApi.createNode(parentFolderId, filesRequest as any, { /* empty */ });
}
async createFolder(folderName: string, parentFolderId: string): Promise<NodeEntry> {
return this.nodesApi.createNode(parentFolderId, {
name: folderName,
nodeType: 'cm:folder'
}, {});
}, { /* empty */ });
}
async deleteFileOrFolder(nodeId: string) {

View File

@@ -22,7 +22,7 @@ import { browser } from 'protractor';
export const createApiService = (
/** @deprecated */
appConfigOverride: Partial<AlfrescoApiConfig> = {}
appConfigOverride: Partial<AlfrescoApiConfig> = { /* empty */ }
) => {
const patchedAppConfig = {
...browser.params.testConfig.appConfig,

View File

@@ -42,7 +42,7 @@ export class GroupIdentityService {
async createGroup(groupName: string): Promise<any> {
const path = '/groups';
const method = 'POST';
const queryParams = {};
const queryParams = { /* empty */ };
const postBody = {
name: `${groupName}-${browser.params.groupSuffix}`
};
@@ -53,8 +53,8 @@ export class GroupIdentityService {
async deleteGroup(groupId: string): Promise<any> {
const path = `/groups/${groupId}`;
const method = 'DELETE';
const queryParams = {};
const postBody = {};
const queryParams = { /* empty */ };
const postBody = { /* empty */ };
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
return data;
}
@@ -69,7 +69,7 @@ export class GroupIdentityService {
const path = `/groups`;
const method = 'GET';
const queryParams = { search: groupName };
const postBody = {};
const postBody = { /* empty */ };
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
@@ -89,7 +89,7 @@ export class GroupIdentityService {
const path = `/groups/${groupId}/role-mappings/realm`;
const method = 'POST';
const queryParams = {};
const queryParams = { /* empty */ };
const postBody = [{ id: roleId, name: roleName }];
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
@@ -107,7 +107,7 @@ export class GroupIdentityService {
async addClientRole(groupId: string, clientId: string, roleId: string, roleName: string): Promise<any> {
const path = `/groups/${groupId}/role-mappings/clients/${clientId}`;
const method = 'POST';
const queryParams = {};
const queryParams = { /* empty */ };
const postBody = [
{
id: roleId,
@@ -130,7 +130,7 @@ export class GroupIdentityService {
const path = `/clients`;
const method = 'GET';
const queryParams = { clientId: applicationName };
const postBody = {};
const postBody = { /* empty */ };
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
return data[0].id;

View File

@@ -30,7 +30,7 @@ export class IdentityService {
ACTIVITI_IDENTITY: 'ACTIVITI_IDENTITY'
};
constructor(public api: ApiService) {}
constructor(public api: ApiService) { /* empty */ }
async createIdentityUserWithRole(roles: string[]): Promise<any> {
const rolesService = new RolesService(this.api);
@@ -62,7 +62,7 @@ export class IdentityService {
const path = '/users';
const method = 'POST';
const queryParams = {};
const queryParams = { /* empty */ };
const postBody = {
username: user.username,
firstName: user.firstName,
@@ -80,8 +80,8 @@ export class IdentityService {
async deleteUser(userId: string): Promise<any> {
const path = `/users/${userId}`;
const method = 'DELETE';
const queryParams = {};
const postBody = {};
const queryParams = { /* empty */ };
const postBody = { /* empty */ };
const deletePromise = this.api.performIdentityOperation(path, method, queryParams, postBody);
@@ -96,7 +96,7 @@ export class IdentityService {
const path = `/users`;
const method = 'GET';
const queryParams = { username };
const postBody = {};
const postBody = { /* empty */ };
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
return data[0];
@@ -105,7 +105,7 @@ export class IdentityService {
async resetPassword(id: string, password: string): Promise<any> {
const path = `/users/${id}/reset-password`;
const method = 'PUT';
const queryParams = {};
const queryParams = { /* empty */ };
const postBody = { type: 'password', value: password, temporary: false };
return this.api.performIdentityOperation(path, method, queryParams, postBody);
@@ -117,7 +117,7 @@ export class IdentityService {
try {
const path = `/users/${userId}/groups/${groupId}`;
const method = 'PUT';
const queryParams = {};
const queryParams = { /* empty */ };
const postBody = { realm: 'alfresco', userId, groupId };
return this.api.performIdentityOperation(path, method, queryParams, postBody);
@@ -129,7 +129,7 @@ export class IdentityService {
async assignRole(userId: string, roleId: string, roleName: string): Promise<any> {
const path = `/users/${userId}/role-mappings/realm`;
const method = 'POST';
const queryParams = {};
const queryParams = { /* empty */ };
const postBody = [{ id: roleId, name: roleName }];
return this.api.performIdentityOperation(path, method, queryParams, postBody);
@@ -138,7 +138,7 @@ export class IdentityService {
async deleteClientRole(userId: string, clientId: string, roleId: string, roleName: string): Promise<any> {
const path = `/users/${userId}/role-mappings/clients/${clientId}`;
const method = 'DELETE';
const queryParams = {};
const queryParams = { /* empty */ };
const postBody = [{
id: roleId,
name: roleName,

View File

@@ -37,8 +37,8 @@ export class QueryService {
const path = '/' + appName + '/query/v1/process-instances/' + processInstanceId + '/tasks';
const method = 'GET';
const queryParams = {};
const postBody = {};
const queryParams = { /* empty */ };
const postBody = { /* empty */ };
return this.api.performBpmOperation(path, method, queryParams, postBody);
} catch (error) {
@@ -57,8 +57,8 @@ export class QueryService {
const path = '/' + appName + '/query/v1/process-instances/' + processInstanceId;
const method = 'GET';
const queryParams = {};
const postBody = {};
const queryParams = { /* empty */ };
const postBody = { /* empty */ };
return this.api.performBpmOperation(path, method, queryParams, postBody);
} catch (error) {
@@ -77,8 +77,8 @@ export class QueryService {
const path = '/' + appName + '/query/v1/process-instances/' + processInstanceId + '/subprocesses';
const method = 'GET';
const queryParams = {};
const postBody = {};
const queryParams = { /* empty */ };
const postBody = { /* empty */ };
return this.api.performBpmOperation(path, method, queryParams, postBody);
} catch (error) {
@@ -97,8 +97,8 @@ export class QueryService {
const path = '/' + appName + '/query/v1/process-instances/' + processInstanceId + '/tasks';
const method = 'GET';
const queryParams = {};
const postBody = {};
const queryParams = { /* empty */ };
const postBody = { /* empty */ };
const data = await this.api.performBpmOperation(path, method, queryParams, postBody);
return data.list?.entries.length && data.list.entries.find(task => task.entry.name === taskName && task.entry.status === status);
@@ -118,8 +118,8 @@ export class QueryService {
const path = `/${appName}/query/v1/tasks?standalone=${standalone}&status=${status}&maxItems=1000&skipCount=0&sort=createdDate`;
const method = 'GET';
const queryParams = {};
const postBody = {};
const queryParams = { /* empty */ };
const postBody = { /* empty */ };
const data = await this.api.performBpmOperation(path, method, queryParams, postBody);
// eslint-disable-next-line @typescript-eslint/prefer-for-of
@@ -145,8 +145,8 @@ export class QueryService {
const path = '/' + appName + '/query/v1/process-instances/' + processInstanceId + '/tasks';
const method = 'GET';
const queryParams = {};
const postBody = {};
const queryParams = { /* empty */ };
const postBody = { /* empty */ };
const data = await this.api.performBpmOperation(path, method, queryParams, postBody);
// eslint-disable-next-line @typescript-eslint/prefer-for-of
@@ -168,8 +168,8 @@ export class QueryService {
const path = '/' + appName + '/query/v1/process-instances/' + processInstanceId + '/tasks';
const method = 'GET';
const queryParams = {};
const postBody = {};
const queryParams = { /* empty */ };
const postBody = { /* empty */ };
const data = await this.api.performBpmOperation(path, method, queryParams, postBody);
// eslint-disable-next-line @typescript-eslint/prefer-for-of
@@ -210,7 +210,7 @@ export class QueryService {
const path = '/' + appName + '/query/v1/process-instances';
const method = 'GET';
const queryParams = { name: processName };
const postBody = {};
const postBody = { /* empty */ };
const data = await this.api.performBpmOperation(path, method, queryParams, postBody);
return data.list.entries && data.list.entries.length > 0 ? data.list.entries[0].entry.id : null;
} catch (error) {
@@ -234,7 +234,7 @@ export class QueryService {
} else {
queryParams = { name: processName };
}
const postBody = {};
const postBody = { /* empty */ };
const data = await this.api.performBpmOperation(path, method, queryParams, postBody);
return data.list.entries ?? null;
} catch (error) {

View File

@@ -28,7 +28,7 @@ export class RolesService {
async createRole(roleName: string): Promise<any> {
const path = '/roles';
const method = 'POST';
const queryParams = {};
const queryParams = { /* empty */ };
const postBody = {
name: roleName + 'TestRole'
};
@@ -39,8 +39,8 @@ export class RolesService {
async deleteRole(roleId: string): Promise<any> {
const path = `/roles-by-id/${roleId}`;
const method = 'DELETE';
const queryParams = {};
const postBody = {};
const queryParams = { /* empty */ };
const postBody = { /* empty */ };
return this.api.performIdentityOperation(path, method, queryParams, postBody);
}
@@ -48,8 +48,8 @@ export class RolesService {
async getRoleIdByRoleName(roleName: string): Promise<string> {
const path = `/roles`;
const method = 'GET';
const queryParams = {};
const postBody = {};
const queryParams = { /* empty */ };
const postBody = { /* empty */ };
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
for (const key in data) {
@@ -63,8 +63,8 @@ export class RolesService {
async getClientRoleIdByRoleName(groupId: string, clientId: string, clientRoleName: string): Promise<any> {
const path = `/groups/${groupId}/role-mappings/clients/${clientId}/available`;
const method = 'GET';
const queryParams = {};
const postBody = {};
const queryParams = { /* empty */ };
const postBody = { /* empty */ };
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
for (const key in data) {

View File

@@ -47,7 +47,7 @@ export class UsersActions {
await this.api.apiService.login(browser.params.testConfig.users.admin.username, browser.params.testConfig.users.admin.password);
}
const user = new UserModel({ ...(userModel ? userModel : {}) });
const user = new UserModel({ ...(userModel ? userModel : { /* empty */ }) });
try {
if (this.api.apiService.isEcmConfiguration() || this.api.apiService.isEcmBpmConfiguration()) {

View File

@@ -32,7 +32,7 @@ export class UserModel {
company?: string;
id: number;
constructor(details: any = {}) {
constructor(details: any = { /* empty */ }) {
const EMAIL_DOMAIN = browser.params?.testConfig?.emailDomain ? browser.params.testConfig.emailDomain : 'example.com';
this.firstName = details.firstName ? details.firstName : this.firstName;
this.lastName = details.lastName ? details.lastName : this.lastName;

View File

@@ -388,7 +388,7 @@ export class DataTableComponentPage {
this.rootElement.element(by.tagName(materialLocators.Progress.spinner.root)),
MAX_LOADING_TIME
);
} catch (error) {}
} catch (error) { /* empty */ }
if (await this.isEmpty()) {
Logger.log('empty page');
@@ -414,7 +414,7 @@ export class DataTableComponentPage {
try {
Logger.log('wait datatable loading spinner is present');
await BrowserVisibility.waitUntilElementIsVisible(element(by.tagName(materialLocators.Progress.bar.root)));
} catch (error) {}
} catch (error) { /* empty */ }
if (await this.isEmpty()) {
Logger.log('empty page');
} else {

View File

@@ -42,7 +42,7 @@ export class SettingsPage {
try {
currentUrl = await browser.getCurrentUrl();
} catch (e) {}
} catch (e) { /* empty */ }
if (!currentUrl || currentUrl.indexOf(this.settingsURL) === -1) {
await browser.get(this.settingsURL);

View File

@@ -75,7 +75,7 @@ export class ViewerPage {
Logger.log('wait spinner is present');
await BrowserVisibility.waitUntilElementIsVisible(element(by.tagName(materialLocators.Progress.spinner.root)));
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.tagName(materialLocators.Progress.spinner.root)), MAX_LOADING_TIME);
} catch (error) {}
} catch (error) { /* empty */ }
}
}

View File

@@ -41,7 +41,7 @@ export class Application {
async undeploy(applicationName: string): Promise<any> {
const isApplicationUndeployed = (response: any) => {
if (JSON.stringify(response) === '{}') {
if (JSON.stringify(response) === '{ /* empty */ }') {
Logger.info(`[Application] Application was undeployed successfully`);
return true;
} else {
@@ -69,7 +69,7 @@ export class Application {
async getDescriptors(): Promise<ResultSetPaging> {
Logger.info(`[Descriptor] Return descriptors`);
return this.requestApiHelper.get<ResultSetPaging>(`v1/descriptors`, {});
return this.requestApiHelper.get<ResultSetPaging>(`v1/descriptors`, { /* empty */ });
}
async getApplicationsByStatus(status: string): Promise<ResultSetPaging> {

View File

@@ -44,7 +44,7 @@ export class Descriptor {
async delete(name: string): Promise<void> {
const isDescriptorDeleted = (response: any) => {
if (JSON.stringify(response) === '{}') {
if (JSON.stringify(response) === '{ /* empty */ }') {
Logger.info(`[Descriptor] Descriptor was deleted successfully`);
return true;
} else {

View File

@@ -31,7 +31,7 @@ export class FormCloudService {
const path = '/' + appName + '/form/v1/forms/' + formId + '/submit';
const method = 'POST';
const queryParams = {};
const queryParams = { /* empty */ };
const postBody = {
values,
taskId,
@@ -51,8 +51,8 @@ export class FormCloudService {
const path = '/' + appName + '/form/v1/forms';
const method = 'GET';
const queryParams = {};
const postBody = {};
const queryParams = { /* empty */ };
const postBody = { /* empty */ };
return this.api.performBpmOperation(path, method, queryParams, postBody);

View File

@@ -31,10 +31,10 @@ export class MessageEventsService {
const path = '/' + appName + '/rb/v1/process-instances/message';
const method = 'POST';
const queryParams = {};
const queryParams = { /* empty */ };
const postBody = {
name: startMessage,
variables: {},
variables: { /* empty */ },
payloadType: 'StartMessagePayload',
...options
};
@@ -52,10 +52,10 @@ export class MessageEventsService {
const path = '/' + appName + '/rb/v1/process-instances/message';
const method = 'PUT';
const queryParams = {};
const queryParams = { /* empty */ };
const postBody = {
name: receiveMessage,
variables: {},
variables: { /* empty */ },
payloadType: 'ReceiveMessagePayload',
...options
};

View File

@@ -30,10 +30,10 @@ export class ProcessDefinitionsService {
const path = '/' + appName + '/rb/v1/process-definitions';
const method = 'GET';
const queryParams = {};
const queryParams = { /* empty */ };
try {
return this.api.performBpmOperation(path, method, queryParams, {});
return this.api.performBpmOperation(path, method, queryParams, { /* empty */ });
} catch (error) {
if (error.status === 404) {
Logger.error(`${appName} not present`);

View File

@@ -31,7 +31,7 @@ export class ProcessInstancesService {
const path = '/' + appName + '/rb/v1/process-instances';
const method = 'POST';
const queryParams = {};
const queryParams = { /* empty */ };
const postBody = {
processDefinitionKey: processDefKey,
payloadType: 'StartProcessPayload',
@@ -52,8 +52,8 @@ export class ProcessInstancesService {
const path = '/' + appName + '/rb/v1/process-instances/' + processInstanceId + '/suspend';
const method = 'POST';
const queryParams = {};
const postBody = {};
const queryParams = { /* empty */ };
const postBody = { /* empty */ };
return this.api.performBpmOperation(path, method, queryParams, postBody);
@@ -67,8 +67,8 @@ export class ProcessInstancesService {
try {
const path = '/' + appName + '/rb/v1/process-instances/' + processInstanceId;
const method = 'DELETE';
const queryParams = {};
const postBody = {};
const queryParams = { /* empty */ };
const postBody = { /* empty */ };
return this.api.performBpmOperation(path, method, queryParams, postBody);
@@ -82,8 +82,8 @@ export class ProcessInstancesService {
try {
const path = '/' + appName + '/rb/v1/process-instances/' + processInstanceId + '/complete';
const method = 'POST';
const queryParams = {};
const postBody = {};
const queryParams = { /* empty */ };
const postBody = { /* empty */ };
return this.api.performBpmOperation(path, method, queryParams, postBody);

View File

@@ -30,7 +30,7 @@ export class TasksService {
const path = '/' + appName + '/rb/v1/tasks';
const method = 'POST';
const queryParams = {};
const queryParams = { /* empty */ };
const postBody = {
name: taskName,
payloadType: 'CreateTaskPayload',
@@ -47,7 +47,7 @@ export class TasksService {
const path = '/' + appName + '/rb/v1/tasks';
const method = 'POST';
const queryParams = {};
const queryParams = { /* empty */ };
const postBody = {
name: taskName,
payloadType: 'CreateTaskPayload',
@@ -65,7 +65,7 @@ export class TasksService {
const path = '/' + appName + '/rb/v1/tasks/' + taskId + '/complete';
const method = 'POST';
const queryParams = {};
const queryParams = { /* empty */ };
const postBody = { payloadType: 'CompleteTaskPayload' };
return this.api.performBpmOperation(path, method, queryParams, postBody)
@@ -78,8 +78,8 @@ export class TasksService {
const path = '/' + appName + '/rb/v1/tasks/' + taskId + `/claim`;
const method = 'POST';
const queryParams = {};
const postBody = {};
const queryParams = { /* empty */ };
const postBody = { /* empty */ };
return this.api.performBpmOperation(path, method, queryParams, postBody)
.catch((error) => {
@@ -91,8 +91,8 @@ export class TasksService {
const path = '/' + appName + '/rb/v1/tasks/' + taskId;
const method = 'DELETE';
const queryParams = {};
const postBody = {};
const queryParams = { /* empty */ };
const postBody = { /* empty */ };
return this.api.performBpmOperation(path, method, queryParams, postBody)
.catch((error) => {
@@ -111,8 +111,8 @@ export class TasksService {
const path = '/' + appName + '/query/v1/tasks/' + taskId;
const method = 'GET';
const queryParams = {};
const postBody = {};
const queryParams = { /* empty */ };
const postBody = { /* empty */ };
return this.api.performBpmOperation(path, method, queryParams, postBody)
.catch((error) => {
@@ -125,7 +125,7 @@ export class TasksService {
const method = 'GET';
const queryParams = { name: taskName };
const postBody = {};
const postBody = { /* empty */ };
const data = await this.api.performBpmOperation(path, method, queryParams, postBody)
.catch((error) => {
@@ -138,7 +138,7 @@ export class TasksService {
const path = '/' + appName + '/rb/v1/tasks';
const method = 'POST';
const queryParams = {};
const queryParams = { /* empty */ };
const postBody = { name, parentTaskId, payloadType: 'CreateTaskPayload' };
return this.api.performBpmOperation(path, method, queryParams, postBody)

View File

@@ -417,7 +417,7 @@ export const ACTIVITI_CLOUD_APPS = {
users: ['hruser']
}
],
infrastructure: { connectors: { restconnector: {} }, bridges: {} },
infrastructure: { connectors: { restconnector: { /* empty */ } }, bridges: { /* empty */ } },
connectors: {
restConnector: {
response: {

View File

@@ -65,7 +65,7 @@ export class ApplicationsUtil {
return publishApp;
}
async importPublishDeployApp(appFileLocation: string, option = {}): Promise<AppDefinitionRepresentation> {
async importPublishDeployApp(appFileLocation: string, option = { /* empty */ }): Promise<AppDefinitionRepresentation> {
try {
const appCreated = await this.importApplication(appFileLocation, option);
const publishApp = await this.publishDeployApp(appCreated.id);
@@ -74,7 +74,7 @@ export class ApplicationsUtil {
return appCreated;
} catch (error) {
Logger.error('Import Publish Deploy Application - Service error, Response: ', JSON.stringify(error));
return {};
return { /* empty */ };
}
}
@@ -91,13 +91,13 @@ export class ApplicationsUtil {
return appCreated;
}
async importApplication(appFileLocation: string, options = {}): Promise<AppDefinitionRepresentation> {
async importApplication(appFileLocation: string, options = { /* empty */ }): Promise<AppDefinitionRepresentation> {
try {
const file = fs.createReadStream(appFileLocation);
return await this.appDefinitionsApi.importAppDefinition(file, options);
} catch (error) {
Logger.error('Import Application - Service error, Response: ', JSON.parse(JSON.stringify(error))?.response?.text);
return {};
return { /* empty */ };
}
}
@@ -107,7 +107,7 @@ export class ApplicationsUtil {
return appDefinitionsList.data.find((currentApp) => currentApp.name === appName);
} catch (error) {
Logger.error('Get AppDefinitions - Service error, Response: ', JSON.parse(JSON.stringify(error))?.response?.text);
return {};
return { /* empty */ };
}
}

View File

@@ -47,7 +47,7 @@ export class ModelsActions {
}
async getModels(opts: any): Promise<ResultListDataRepresentationModelRepresentation> {
const options = opts || {};
const options = opts || { /* empty */ };
let models;
try {
models = await this.modelsApi.getModels(options);

View File

@@ -113,7 +113,7 @@ export class ProcessUtil {
}
async getProcessTaskId(processId: string): Promise<TaskRepresentation> {
const taskList = await this.tasksApi.listTasks({});
const taskList = await this.tasksApi.listTasks({ /* empty */ });
let wantedTask;
taskList.data.forEach((task) => {

View File

@@ -70,8 +70,8 @@ export class ApiService {
async performBpmOperation(path: string, method: string, queryParams: any, postBody: any): Promise<any> {
return new Promise((resolve, reject) => {
const uri = this.config.appConfig.hostBpm + path;
const pathParams = {};
const formParams = {};
const pathParams = { /* empty */ };
const formParams = { /* empty */ };
const contentTypes = ['application/json'];
const accepts = ['application/json'];
@@ -91,8 +91,8 @@ export class ApiService {
async performIdentityOperation(path: string, method: string, queryParams: any, postBody: any): Promise<any> {
return new Promise((resolve, reject) => {
const uri = this.config.appConfig.oauth2.host.replace('/realms', '/admin/realms') + path;
const pathParams = {};
const formParams = {};
const pathParams = { /* empty */ };
const formParams = { /* empty */ };
const contentTypes = ['application/json'];
const accepts = ['application/json'];
@@ -112,8 +112,8 @@ export class ApiService {
async performECMOperation(path: string, method: string, queryParams: any, postBody: any): Promise<any> {
return new Promise((resolve, reject) => {
const uri = this.config.appConfig.hostEcm + path;
const pathParams = {};
const formParams = {};
const pathParams = { /* empty */ };
const formParams = { /* empty */ };
const contentTypes = ['application/json'];
const accepts = ['application/json'];

View File

@@ -32,11 +32,11 @@ export interface E2eRequestApiHelperOptions {
}
const getDefaultOptions = (): E2eRequestApiHelperOptions => ({
pathParams: {},
queryParams: {},
headerParams: {},
formParams: {},
bodyParam: {},
pathParams: { /* empty */ },
queryParams: { /* empty */ },
headerParams: { /* empty */ },
formParams: { /* empty */ },
bodyParam: { /* empty */ },
contentTypes: ['application/json'],
accepts: ['application/json'],
returnType: undefined