UNPKG

baasic-sdk-javascript

Version:

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

90 lines (89 loc) 4.43 kB
"use strict"; /* globals module */ /** * @module commerceInvoiceStatusBatchClient * @description Commerce Invoice Stauts Batch Client provides an easy way to consume Commerce REST API end-points. In order to obtain a needed routes `commerceInvoiceStatusBatchClient` uses `commerceInvoiceStatusBatchRoute`. */ Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var inversify_1 = require("inversify"); ; var httpApi_1 = require("../../../../httpApi"); var __1 = require("../../"); var CommerceLookupsInvoiceStatusBatchClient = /** @class */ (function () { function CommerceLookupsInvoiceStatusBatchClient(commerceLookupsInvoiceStatusBatchRoute, apiClient) { this.commerceLookupsInvoiceStatusBatchRoute = commerceLookupsInvoiceStatusBatchRoute; this.apiClient = apiClient; } Object.defineProperty(CommerceLookupsInvoiceStatusBatchClient.prototype, "routeDefinition", { get: function () { return this.commerceLookupsInvoiceStatusBatchRoute; }, enumerable: true, configurable: true }); /** * Returns a promise that is resolved once the create commerce action has been performed; this action creates a new commerce resources. * @method * @example commerceLookupsInvoiceStatusBatchClient.create([{ name : '<name>', abrv: '<abbreviation>', description: '<description>' }]) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); **/ CommerceLookupsInvoiceStatusBatchClient.prototype.create = function (data) { return this.apiClient.post(this.routeDefinition.create(), this.routeDefinition.createParams(data)); }; /** * Returns a promise that is resolved once the update commerce action has been performed; this action updates specified commerce resources. * @method * @example commerceLookupsInvoiceStatusBatchClient.update(InvoiceStatuses) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); **/ CommerceLookupsInvoiceStatusBatchClient.prototype.update = function (data) { return this.apiClient.put(this.routeDefinition.update(), this.routeDefinition.updateParams(data)); }; /** * Returns a promise that is resolved once the remove commerce action has been performed. This action will remove commerce resources from the system if successfully completed. * @method * @example commerceLookupsInvoiceStatusBatchClient.remove(InvoiceStatusIds) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); **/ CommerceLookupsInvoiceStatusBatchClient.prototype.remove = function (ids) { return this.apiClient.delete(this.commerceLookupsInvoiceStatusBatchRoute.delete(), undefined, ids); }; CommerceLookupsInvoiceStatusBatchClient = tslib_1.__decorate([ inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(__1.TYPES.CommerceLookupsInvoiceStatusBatchRoute)), tslib_1.__param(1, inversify_1.inject(httpApi_1.httpTYPES.ApiClient)), tslib_1.__metadata("design:paramtypes", [__1.CommerceLookupsInvoiceStatusBatchRoute, httpApi_1.ApiClient]) ], CommerceLookupsInvoiceStatusBatchClient); return CommerceLookupsInvoiceStatusBatchClient; }()); exports.CommerceLookupsInvoiceStatusBatchClient = CommerceLookupsInvoiceStatusBatchClient; /** * @copyright (c) 2017 Mono Ltd * @license MIT * @author Mono Ltd * @overview ***Notes:** - Refer to the [Baasic REST API](http://dev.baasic.com/api/reference/home) for detailed information about available Baasic REST API end-points. - All end-point objects are transformed by the associated route service. */