Denys Vuika 8dc736e8f0
[AAE-7100] migrate ADF projects to eslint (#7483)
* migrate content services to eslint

* migrate insights to eslint

* migrate extensions to eslint

* migrate testing lib to eslint

* migrate CLI to eslint

* migrate process-services to eslint

* migrate process-services-cloud to eslint

* remove cli analytics [ci:force]
2022-02-03 11:01:54 +00:00

46 lines
1.2 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 = {};
const headerParams = {};
const formParams = {};
const bodyParam = {};
const queryParams = {};
const contentTypes = ['application/json'];
const 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 {};
}
}
}