import { NptAggregateItems } from "src/model/nptAggregateItems"; import { NptAggregateRequest } from "src/model/nptAggregateRequest"; import { NptFilterRequest } from "src/model/nptFilterRequest"; import { NptIngestion } from "src/model/nptIngestion"; import { NptIngestionItems } from "src/model/nptIngestionItems"; import { NptItems } from "src/model/nptItems"; import { ConfigureAPI } from "../baseWellsClient"; import { rethrowAsHttpError } from "../errorHandlingUtils"; export class NptAPI extends ConfigureAPI { public ingest = async (nptIngestions: NptIngestion[]): Promise => { const path: string = this.getPath(`/npt`); const ingestionItems: NptIngestionItems = { items: nptIngestions }; return await this.client .asyncPost(path, { data: ingestionItems }) .then((response) => response.data) .catch((err) => { throw rethrowAsHttpError(err); }); }; public list = async (nptFilter: NptFilterRequest): Promise => { const path: string = this.getPath(`/npt/list`); return await this.client .asyncPost(path, { data: nptFilter }) .then((response) => response.data) .catch((err) => { throw rethrowAsHttpError(err); }); }; public aggregate = async ( request: NptAggregateRequest ): Promise => { const path: string = this.getPath(`/npt/aggregate`); return await this.client .asyncPost(path, { data: request }) .then((response) => response.data) .catch((err) => { throw rethrowAsHttpError(err); }); }; }