export interface ApiResult { result: boolean; info: any; content: T; } export interface AsyncApiResult extends Promise> { } /** * ApiService provide functions for GET, POST, PUT and DELETE query * * Usage: * * const apiService = new ApiService('kalvad-poc'); // contact center name you want to connect to * apiService.get(apiService.endpoints.authenticate) ; // ApiService already defined the endpoints available on Ziwo API * .then( (e) => console.log('User > ', e.data)); // Request object is available under `data`; */ export declare class ApiService { readonly endpoints: any; private token?; private readonly baseUrl; private readonly contactCenterName; private readonly API_PROTOCOL; private readonly API_PREFIX; constructor(contactCenterName: string); /** * Return the hostname of current user */ getHostname(): string; /** * Set Authorization token for further requests */ setToken(token: string): void; /** * Execute a GET query * @endpoint url endpoint. Base url should not be included */ get(endpoint: string): AsyncApiResult; /** * Execute a POST query * @endpoint url endpoint. Base url should not be included */ post(endpoint: string, payload: any): AsyncApiResult; /** * Execute a PUT query * @endpoint url endpoint. Base url should not be included */ put(endpoint: string, payload: any): AsyncApiResult; /** * Execute a DELETE query * @endpoint url endpoint. Base url should not be included */ delete(endpoint: string): AsyncApiResult; private query; }