mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
* 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]
46 lines
1.2 KiB
TypeScript
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 {};
|
|
}
|
|
}
|
|
}
|