@knora/api
Version:
JavaScript library that handles API requests to Knora
50 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 (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var operators_1 = require("rxjs/operators");
var GenericCache_1 = require("./GenericCache");
/**
* Caches user information obtained from Knora.
*/
var ListAdminCache = /** @class */ (function (_super) {
__extends(ListAdminCache, _super);
function ListAdminCache(adminEndpoint) {
var _this = _super.call(this) || this;
_this.adminEndpoint = adminEndpoint;
return _this;
}
/**
* Requests a whole list from the admin API.
*
* @param listIri IRI of the list.
*/
ListAdminCache.prototype.getList = function (listIri) {
return this.getItem(listIri);
};
ListAdminCache.prototype.requestItemFromKnora = function (key, isDependency) {
return this.adminEndpoint.listsEndpoint.getList(key).pipe(operators_1.map(function (response) {
return [response.body];
}));
};
ListAdminCache.prototype.getKeyOfItem = function (item) {
return item.list.listinfo.id;
};
ListAdminCache.prototype.getDependenciesOfItem = function (item) {
return [];
};
return ListAdminCache;
}(GenericCache_1.GenericCache));
exports.ListAdminCache = ListAdminCache;
//# sourceMappingURL=ListAdminCache.js.map