@dasch-swiss/dsp-js
Version:
JavaScript library that handles API requests to Knora
43 lines • 1.88 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
import { catchError, map } from "rxjs/operators";
import { ApiResponseData } from "../../../models/api-response-data";
import { VersionResponse } from "../../../models/system/version-response";
import { Endpoint } from "../../endpoint";
/**
* An endpoint to get DSP's version.
*
* @category Endpoint System
*/
var VersionEndpointSystem = /** @class */ (function (_super) {
__extends(VersionEndpointSystem, _super);
function VersionEndpointSystem() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* Returns DSP's version.
*/
VersionEndpointSystem.prototype.getVersion = function () {
var _this = this;
return this.httpGet("").pipe(map(function (ajaxResponse) {
var versionResponse = ApiResponseData.fromAjaxResponse(ajaxResponse, VersionResponse, _this.jsonConvert);
return versionResponse;
}), catchError(function (error) { return _this.handleError(error); }));
};
return VersionEndpointSystem;
}(Endpoint));
export { VersionEndpointSystem };
//# sourceMappingURL=version-endpoint-system.js.map