siva kumar 09b4df5af7
[ACA-4227] [APS] Create a script to check Process Services Management plugin status before running e2e tests (#6486)
* [ACA-4227] Create a generic script to check plugin status before running e2e tests by plugin name

* * Added governace env check

* * Added AAE plugin check

* * Updated script

* small improvements, add uiName parameter for the command

* * Fixed comments

* * Moved check-plugin script in the common place

* * Added table format to show plugin status

Co-authored-by: adomi <ardit.domi@alfresco.com>
2021-01-06 11:56:24 +00:00

45 lines
1.1 KiB
TypeScript

import { PluginInterface } from './plugin-model';
import { logger } from '../logger';
export class PluginConfiguration {
constructor(
private plugInInfo: PluginInterface,
private alfrescoJsApi: any
) {}
async getAppConfig(url: string) {
return this.callCustomApi(url);
}
async callCustomApi(url: string) {
const pathParams = {},
headerParams = {},
formParams = {},
bodyParam = {},
queryParams = {},
contentTypes = ['application/json'],
accepts = ['application/json'];
try {
const response = await this.alfrescoJsApi.oauth2Auth.callCustomApi(
url,
'GET',
pathParams,
queryParams,
headerParams,
formParams,
bodyParam,
contentTypes,
accepts
);
return response;
} catch (error) {
logger.error(
`${this.plugInInfo.host} is not reachable error: `,
error
);
return {};
}
}
}