UNPKG

baasic-sdk-javascript

Version:

JavaScript SDK provides core functionality for building web and mobile applications on [Baasic](http://www.baasic.com/).

63 lines (62 loc) 3.32 kB
/** * @module templatingBatchClient * @description Templating Batch Client provides an easy way to consume Templating REST API end-points. In order to obtain a needed routes `templatingBatchClient` uses `templatingBatchRoute`. */ import { IResponse } from '../../common/contracts'; import { ApiClient, IHttpResponse } from '../../httpApi'; import { TemplatingBatchRoute } from './'; import { ITemplate } from './contracts'; export declare class TemplatingBatchClient { protected templatingBatchRoute: TemplatingBatchRoute; protected apiClient: ApiClient; constructor(templatingBatchRoute: TemplatingBatchRoute, apiClient: ApiClient); readonly routeDefinition: TemplatingBatchRoute; /** * Returns a promise that is resolved once the create action has been performed; this action creates new template resources. * @method * @param data An Template objects that need to be inserted into the system. * @returns A promise that is resolved once the create action has been performed. * @example templatingBatchClient.create([{ content : '<content>', templateId : '<template-id>' }]) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); **/ create(data: ITemplate[]): PromiseLike<IHttpResponse<IResponse[]>>; /** * Returns a promise that is resolved once the update action has been performed; this action updates specified template resources. * @method * @param data An Template objects that need to be inserted into the system. * @returns A promise that is resolved once the update action has been performed. * @example templatingBatchClient.update(templates) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); **/ update(data: ITemplate[]): PromiseLike<IHttpResponse<IResponse[]>>; /** * Returns a promise that is resolved once the remove action has been performed. This action will remove template resources from the system if successfully completed. * @method * @param ids Template ids which uniquely identify Template resources that need to be deleted. * @returns A promise that is resolved once the update action has been performed. * @example templatingBatchClient.remove(companyIds) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); **/ remove(ids: string[]): PromiseLike<IHttpResponse<void>>; } /** * @overview ***Notes:** - Refer to the [REST API documentation](https://github.com/Baasic/baasic-rest-api/wiki) for detailed information about available Baasic REST API end-points. - All end-point objects are transformed by the associated route definition. */