UNPKG

baasic-sdk-javascript

Version:

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

95 lines (94 loc) 5.11 kB
"use strict"; /* globals module */ /** * @module commercePaymentTransactionRoute * @description Baasic Commerce PaymentTransaction Route Definition provides Baasic route templates which can be expanded to Baasic REST URIs. Various services can use Baasic Commerce PaymentTransaction Route Definition to obtain a needed routes while other routes will be obtained through HAL. By convention, all route services use the same function names as their corresponding services. */ Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var inversify_1 = require("inversify"); var common_1 = require("../../../common"); ; var contracts_1 = require("../../../core/contracts"); var CommercePaymentTransactionRoute = /** @class */ (function (_super) { tslib_1.__extends(CommercePaymentTransactionRoute, _super); function CommercePaymentTransactionRoute(appOptions) { var _this = _super.call(this, appOptions) || this; _this.appOptions = appOptions; _this.findRoute = 'commerce/payment-transactions/{?customerId,searchQuery,invoiceStatusId,subscriptionId,paymentMethodId,firstName,lastName,transactionStatuses,page,rpp,sort,embed,fields}'; _this.getRoute = 'commerce/payment-transactions/{id}/{?embed,fields}'; _this.createRoute = 'commerce/payment-transactions'; _this.updateRoute = 'commerce/payment-transactions/{id}'; _this.deleteRoute = 'commerce/payment-transactions/{id}'; return _this; } /** * Parses find commerce payment transaction route which can be expanded with additional options. Supported items are: * - `customerId` - A customer unique identifier. * - `searchQuery` - A string value used to identify commerce resources using the phrase search. * - `invoiceStatusId` - A invoice status unique identifier. * - `subscriptionId` - A subscription unique identifier. * - `paymentMethodId` - A payment method unique identifier. * - `firstName` - A customer first name. * - `lastName` - A customer last name. * - `transactionStatuses` - A transaction statuses in CSV format. * - `page` - A value used to set the page number, i.e. to retrieve certain commerce subset from the storage. * - `rpp` - A value used to limit the size of result set per page. * - `sort` - A string used to set the commerce property to sort the result collection by. * - `embed` - Comma separated list of resources to be contained within the current representation. * @method * @example commercePaymentTransactionRoute.find({searchQuery: '<search-phrase>'}); **/ CommercePaymentTransactionRoute.prototype.find = function (options) { return _super.prototype.baseFind.call(this, this.findRoute, options); }; /** * Parses get route; this route doesn't expose any properties. * @method * @example commercePaymentTransactionRoute.get(id, options); **/ CommercePaymentTransactionRoute.prototype.get = function (id, options) { return _super.prototype.baseGet.call(this, this.getRoute, id, options); }; /** * Parses create route; this route doesn't expose any properties. * @method * @example commercePaymentTransactionRoute.create(); **/ CommercePaymentTransactionRoute.prototype.create = function () { return _super.prototype.baseCreate.call(this, this.createRoute, {}); }; /** * Parses update route; this route doesn't expose any properties. * @method * @example commercePaymentTransactionRoute.update(data); **/ CommercePaymentTransactionRoute.prototype.update = function (data) { return _super.prototype.baseUpdate.call(this, this.updateRoute, data); }; /** * Parses delete route; this route doesn't expose any properties. * @method * @example commercePaymentTransactionRoute.delete(data); **/ CommercePaymentTransactionRoute.prototype.delete = function (data) { return _super.prototype.baseDelete.call(this, this.deleteRoute, data); }; CommercePaymentTransactionRoute = tslib_1.__decorate([ inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(contracts_1.TYPES.IAppOptions)), tslib_1.__metadata("design:paramtypes", [Object]) ], CommercePaymentTransactionRoute); return CommercePaymentTransactionRoute; }(common_1.BaseRoute)); exports.CommercePaymentTransactionRoute = CommercePaymentTransactionRoute; /** * @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. - [URI Template](https://github.com/Baasic/uritemplate-js) syntax enables expanding the Baasic route templates to Baasic REST URIs providing it with an object that contains URI parameters. - All end-point objects are transformed by the associated route service. */