UNPKG

fineract_sdk

Version:

Wrapper around fineract api.

143 lines (129 loc) 13.6 kB
/* tslint:disable */ /* eslint-disable */ /** * Apache Fineract * Apache Fineract is a secure, multi-tenanted microfinance platform The goal of the Apache Fineract API is to empower developers to build apps on top of the Apache Fineract Platform<br>The [reference app](https://cui.fineract.dev) (username: mifos, password: password) works on the same demo tenant as the interactive links in this documentation - The API is organized around [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) - Find out more about Apache Fineract [here](/fineract-provider/api-docs/apiLive.htm#top) - You can [Try The API From Your Browser](/fineract-provider/api-docs/apiLive.htm#interact) - The Generic Options are available [here](/fineract-provider/api-docs/apiLive.htm#genopts) - Find out more about [Updating Dates and Numbers](/fineract-provider/api-docs/apiLive.htm#dates_and_numbers) - For the Authentication and the Basic of HTTP and HTTPS refer [here](/fineract-provider/api-docs/apiLive.htm#authentication_overview) - Check about ERROR codes [here](/fineract-provider/api-docs/apiLive.htm#errors) Please refer to the [old documentation](/fineract-provider/api-docs/apiLive.htm) for any documentation queries * * The version of the OpenAPI document: 1.5.0-66-gffae7d4-dirty * Contact: dev@fineract.apache.org * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; import { Configuration } from '../configuration'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore import { RunReportsResponse } from '../models'; /** * RunReportsApi - axios parameter creator * @export */ export const RunReportsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * This resource allows you to run and receive output from pre-defined Apache Fineract reports. Reports can also be used to provide data for searching and workflow functionality. The default output is a JSON formatted \"Generic Resultset\". The Generic Resultset contains Column Heading as well as Data information. However, you can export to CSV format by simply adding \"&exportCSV=true\" to the end of your URL. If Pentaho reports have been pre-defined, they can also be run through this resource. Pentaho reports can return HTML, PDF or CSV formats. The Apache Fineract reference application uses a JQuery plugin called stretchy reporting which, itself, uses this reports resource to provide a pretty flexible reporting User Interface (UI). Example Requests: runreports/Client%20Listing?R_officeId=1 runreports/Client%20Listing?R_officeId=1&exportCSV=true runreports/OfficeIdSelectOne?R_officeId=1&parameterType=true runreports/OfficeIdSelectOne?R_officeId=1&parameterType=true&exportCSV=true runreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=HTML&R_officeId=1 runreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=XLS&R_officeId=1 runreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=CSV&R_officeId=1 runreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=PDF&R_officeId=1 * @summary Running a Report * @param {string} reportName reportName * @param {boolean} [isSelfServiceUserReport] isSelfServiceUserReport * @param {*} [options] Override http request option. * @throws {RequiredError} */ runReport: async (reportName: string, isSelfServiceUserReport?: boolean, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'reportName' is not null or undefined assertParamExists('runReport', 'reportName', reportName) const localVarPath = `/runreports/{reportName}` .replace(`{${"reportName"}}`, encodeURIComponent(String(reportName))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basicAuth required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration) // authentication tenantid required await setApiKeyToObject(localVarHeaderParameter, "fineract-platform-tenantid", configuration) if (isSelfServiceUserReport !== undefined) { localVarQueryParameter['isSelfServiceUserReport'] = isSelfServiceUserReport; } setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * RunReportsApi - functional programming interface * @export */ export const RunReportsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = RunReportsApiAxiosParamCreator(configuration) return { /** * This resource allows you to run and receive output from pre-defined Apache Fineract reports. Reports can also be used to provide data for searching and workflow functionality. The default output is a JSON formatted \"Generic Resultset\". The Generic Resultset contains Column Heading as well as Data information. However, you can export to CSV format by simply adding \"&exportCSV=true\" to the end of your URL. If Pentaho reports have been pre-defined, they can also be run through this resource. Pentaho reports can return HTML, PDF or CSV formats. The Apache Fineract reference application uses a JQuery plugin called stretchy reporting which, itself, uses this reports resource to provide a pretty flexible reporting User Interface (UI). Example Requests: runreports/Client%20Listing?R_officeId=1 runreports/Client%20Listing?R_officeId=1&exportCSV=true runreports/OfficeIdSelectOne?R_officeId=1&parameterType=true runreports/OfficeIdSelectOne?R_officeId=1&parameterType=true&exportCSV=true runreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=HTML&R_officeId=1 runreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=XLS&R_officeId=1 runreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=CSV&R_officeId=1 runreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=PDF&R_officeId=1 * @summary Running a Report * @param {string} reportName reportName * @param {boolean} [isSelfServiceUserReport] isSelfServiceUserReport * @param {*} [options] Override http request option. * @throws {RequiredError} */ async runReport(reportName: string, isSelfServiceUserReport?: boolean, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RunReportsResponse>> { const localVarAxiosArgs = await localVarAxiosParamCreator.runReport(reportName, isSelfServiceUserReport, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * RunReportsApi - factory interface * @export */ export const RunReportsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = RunReportsApiFp(configuration) return { /** * This resource allows you to run and receive output from pre-defined Apache Fineract reports. Reports can also be used to provide data for searching and workflow functionality. The default output is a JSON formatted \"Generic Resultset\". The Generic Resultset contains Column Heading as well as Data information. However, you can export to CSV format by simply adding \"&exportCSV=true\" to the end of your URL. If Pentaho reports have been pre-defined, they can also be run through this resource. Pentaho reports can return HTML, PDF or CSV formats. The Apache Fineract reference application uses a JQuery plugin called stretchy reporting which, itself, uses this reports resource to provide a pretty flexible reporting User Interface (UI). Example Requests: runreports/Client%20Listing?R_officeId=1 runreports/Client%20Listing?R_officeId=1&exportCSV=true runreports/OfficeIdSelectOne?R_officeId=1&parameterType=true runreports/OfficeIdSelectOne?R_officeId=1&parameterType=true&exportCSV=true runreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=HTML&R_officeId=1 runreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=XLS&R_officeId=1 runreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=CSV&R_officeId=1 runreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=PDF&R_officeId=1 * @summary Running a Report * @param {string} reportName reportName * @param {boolean} [isSelfServiceUserReport] isSelfServiceUserReport * @param {*} [options] Override http request option. * @throws {RequiredError} */ runReport(reportName: string, isSelfServiceUserReport?: boolean, options?: any): AxiosPromise<RunReportsResponse> { return localVarFp.runReport(reportName, isSelfServiceUserReport, options).then((request) => request(axios, basePath)); }, }; }; /** * RunReportsApi - object-oriented interface * @export * @class RunReportsApi * @extends {BaseAPI} */ export class RunReportsApi extends BaseAPI { /** * This resource allows you to run and receive output from pre-defined Apache Fineract reports. Reports can also be used to provide data for searching and workflow functionality. The default output is a JSON formatted \"Generic Resultset\". The Generic Resultset contains Column Heading as well as Data information. However, you can export to CSV format by simply adding \"&exportCSV=true\" to the end of your URL. If Pentaho reports have been pre-defined, they can also be run through this resource. Pentaho reports can return HTML, PDF or CSV formats. The Apache Fineract reference application uses a JQuery plugin called stretchy reporting which, itself, uses this reports resource to provide a pretty flexible reporting User Interface (UI). Example Requests: runreports/Client%20Listing?R_officeId=1 runreports/Client%20Listing?R_officeId=1&exportCSV=true runreports/OfficeIdSelectOne?R_officeId=1&parameterType=true runreports/OfficeIdSelectOne?R_officeId=1&parameterType=true&exportCSV=true runreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=HTML&R_officeId=1 runreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=XLS&R_officeId=1 runreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=CSV&R_officeId=1 runreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=PDF&R_officeId=1 * @summary Running a Report * @param {string} reportName reportName * @param {boolean} [isSelfServiceUserReport] isSelfServiceUserReport * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof RunReportsApi */ public runReport(reportName: string, isSelfServiceUserReport?: boolean, options?: any) { return RunReportsApiFp(this.configuration).runReport(reportName, isSelfServiceUserReport, options).then((request) => request(this.axios, this.basePath)); } }