import { ConfigureAPI } from "../baseWellsClient"; import { rethrowAsHttpError } from "../errorHandlingUtils"; import { NdsAggregateItems, NdsItems, NdsAggregateRequest, NdsIngestionItems, NdsFilterRequest, NdsIngestion, } from "src"; export class NdsAPI extends ConfigureAPI { public ingest = async (ndsIngestions: NdsIngestion[]): Promise => { const path: string = this.getPath(`/nds`); const ingestionItems: NdsIngestionItems = { items: ndsIngestions }; return await this.client .asyncPost(path, { data: ingestionItems }) .then((response) => response.data) .catch((err) => { throw rethrowAsHttpError(err); }); }; public list = async (ndsFilter: NdsFilterRequest): Promise => { const path: string = this.getPath(`/nds/list`); return await this.client .asyncPost(path, { data: ndsFilter }) .then((response) => response.data) .catch((err) => { throw rethrowAsHttpError(err); }); }; public aggregate = async ( request: NdsAggregateRequest ): Promise => { const path: string = this.getPath(`/nds/aggregate`); return await this.client .asyncPost(path, { data: request }) .then((response) => response.data) .catch((err) => { throw rethrowAsHttpError(err); }); }; }