UNPKG

@crediblex.io/fineract-api-client

Version:
64 lines 3.03 kB
import { HttpClient } from "../utils/http-client"; import { Datatable, DatatableListResponse } from "../types/datatable"; /** * API client for Fineract Datatable related operations. * It uses the HttpClient for making requests. */ export declare class FineractDatatableApi { private readonly httpClient; constructor(httpClient: HttpClient); /** * Retrieves all datatables from Fineract. * Corresponds to the GET /datatables endpoint. * * @returns A promise that resolves to the list of datatables or rejects with an error. */ getAll(): Promise<DatatableListResponse>; /** * Retrieves a specific datatable by name from Fineract. * Corresponds to the GET /datatables/{datatableName} endpoint. * * @param datatableName The name of the datatable to retrieve. * @returns A promise that resolves to the datatable details or rejects with an error. */ getByName(datatableName: string): Promise<Datatable>; /** * Retrieves datatable entries for a specific entity. * Corresponds to the GET /datatables/{datatableName}/{entityId} endpoint. * * @param datatableName The name of the datatable. * @param entityId The id of the entity (e.g. m_client.id) to retrieve datatable entries for. * @returns A promise that resolves to the datatable entries or rejects with an error. */ getEntries(datatableName: string, entityId: number): Promise<any[]>; /** * Creates a new datatable entry for a specific entity. * Corresponds to the POST /datatables/{datatableName}/{entityId} endpoint. * * @param datatableName The name of the datatable. * @param entityId The id of the entity (e.g. m_client.id) to create the datatable entry for. * @param entryData The data for the new datatable entry. * @returns A promise that resolves to the creation response or rejects with an error. */ createEntry(datatableName: string, entityId: number, entryData: any): Promise<any>; /** * Updates a datatable entry for a specific entity. * Corresponds to the PUT /datatables/{datatableName}/{entityId} endpoint. * * @param datatableName The name of the datatable. * @param entityId The id of the entity (e.g. m_client.id). * @param entryData The updated data for the datatable entry. * @returns A promise that resolves to the update response or rejects with an error. */ updateEntry(datatableName: string, entityId: number, entryData: any): Promise<any>; /** * Deletes a datatable entry for a specific entity. * Corresponds to the DELETE /datatables/{datatableName}/{entityId} endpoint. * * @param datatableName The name of the datatable. * @param entityId The id of the entity (e.g. m_client.id). * @returns A promise that resolves to the deletion response or rejects with an error. */ deleteEntry(datatableName: string, entityId: number): Promise<any>; } //# sourceMappingURL=fineract-datatable-api.d.ts.map