import { BaseStatic } from "./../interfaces/BaseStatic"; export default class BaseCrud { protected apiToken: string; protected apiEndpoint: string; protected baseApiUrl: string; constructor(apiToken: string, apiEndpoint: string); /** * Lists the ressource * * @param {BaseStatic.BaseOptions} [options] * @returns {Promise>} * @memberof BaseCrud */ list(options?: BaseStatic.BaseOptions): Promise>; /** * search for resources * * @param {Array>} searchOptions * @param {BaseStatic.BaseOptions} [options] * @returns {Promise>} * @memberof BaseCrud */ search(searchOptions: Array>, options?: BaseStatic.BaseOptions): Promise>; /** * show a specific ressource * * @param {string | number} id * @param {BaseStatic.BaseOptions} [options] * @returns {Promise} * @memberof BaseCrud */ show(id: string | number, options?: BaseStatic.BaseOptions): Promise; /** * create a new ressource * * @param {Full} ressource * @returns {Promise} * @memberof BaseCrud */ create(ressource: Create): Promise; /** * overwrite an existing ressource * * @param {number} id * @param {Overwrite} ressource * @returns {Promise} * @memberof BaseCrud */ overwrite(id: number, ressource: Overwrite): Promise; /** * edit an existing ressource * * @param {number} id * @param {Partial} ressource * @returns {Promise} * @memberof BaseCrud */ edit(id: number, ressource: Partial): Promise; /** * delete an ressource * * @param {string | number} id * @returns {Promise} * @memberof BaseCrud */ delete(id: string | number): Promise; /** * Base request to the api * * @protected * @template T * @param {string} method * @param {string} path * @param {BaseStatic.BaseOptions} [options] * @param {*} [data] * @returns {Promise} * @memberof Bexio */ protected request(method: "DELETE" | "get" | "GET" | "delete" | "head" | "HEAD" | "options" | "OPTIONS" | "post" | "POST" | "put" | "PUT" | "patch" | "PATCH" | "purge" | "PURGE" | "link" | "LINK" | "unlink" | "UNLINK", path: string, options?: BaseStatic.BaseOptions, data?: any): Promise; /** * Generates the querystring out of the options * * @protected * @param {BaseStatic.BaseOptions} [options] * @returns {string} * @memberof Bexio */ protected optionsToQuery(options?: BaseStatic.BaseOptions): string; }