UNPKG

baasic-sdk-javascript

Version:

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

59 lines (58 loc) 2.33 kB
"use strict"; /* globals module */ /** * @module versionClient * @description Version Client provides an easy way to consume Password Recovery REST API end-points. In order to obtain needed routes `versionClient` uses `versionRoute`. */ 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 VersionClient = /** @class */ (function () { function VersionClient(versionRoute, apiClient) { this.versionRoute = versionRoute; this.apiClient = apiClient; } Object.defineProperty(VersionClient.prototype, "routeDefinition", { /** * Provides direct access to `versionRoute`. * @method **/ get: function () { return this.versionRoute; }, enumerable: true, configurable: true }); /** * Returns a promise that is resolved once the get action has been performed. Success response returns the all application module versions. * @method * @returns A promise that is resolved once the get action has been performed. * @example versionClient.get() .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); **/ VersionClient.prototype.get = function () { return this.apiClient.get(this.routeDefinition.get()); }; VersionClient = tslib_1.__decorate([ inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(_1.TYPES.VersionRoute)), tslib_1.__param(1, inversify_1.inject(httpApi_1.httpTYPES.ApiClient)), tslib_1.__metadata("design:paramtypes", [_1.VersionRoute, httpApi_1.ApiClient]) ], VersionClient); return VersionClient; }()); exports.VersionClient = VersionClient; /** * @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. */