import { API, APIOptions } from "../api"; interface ClientConfig { apiOptions: APIOptions; } export default abstract class Client { protected readonly api: API; constructor({ apiOptions }: ClientConfig) { this.api = new API(apiOptions) } public async get({ path }: { path: string }) { return this.api.makeRequest(path, {}, null, 'GET'); } public async post({ path, body }: { path: string, body: any }) { return this.api.makeRequest(path, { 'Content-Type': 'application/json' }, body, 'POST'); } public async search({ index, body }: { index: string, body: any }) { return this.post({ path: `/${index}/_search`, body }); } }