UNPKG

@dasch-swiss/dsp-js

Version:

JavaScript library that handles API requests to Knora

64 lines 3.06 kB
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 { ListNodeV2Cache } from "../../cache/ListNodeV2Cache"; import { OntologyCache } from "../../cache/ontology-cache/OntologyCache"; import { Endpoint } from "../endpoint"; import { AuthenticationEndpointV2 } from "./authentication/authentication-endpoint-v2"; import { ListsEndpointV2 } from "./list/lists-endpoint-v2"; import { OntologiesEndpointV2 } from "./ontology/ontologies-endpoint-v2"; import { ResourcesEndpointV2 } from "./resource/resources-endpoint-v2"; import { SearchEndpointV2 } from "./search/search-endpoint-v2"; import { ValuesEndpointV2 } from "./values/values-endpoint-v2"; /** * Defines the V2 endpoint of the Knora API. * * @category Endpoint V2 */ var V2Endpoint = /** @class */ (function (_super) { __extends(V2Endpoint, _super); /** * Sets up all endpoints for this endpoint. * * @param knoraApiConfig the configuration for the DSP-API instance to connect to. * @param path this endpoint's path segment. * * @category Internal */ function V2Endpoint(knoraApiConfig, path) { var _this = _super.call(this, knoraApiConfig, path) || this; _this.knoraApiConfig = knoraApiConfig; _this.path = path; // Instantiate the endpoints _this.auth = new AuthenticationEndpointV2(knoraApiConfig, path + V2Endpoint.PATH_AUTHENTICATION); _this.onto = new OntologiesEndpointV2(knoraApiConfig, path + V2Endpoint.PATH_ONTOLOGIES); _this.res = new ResourcesEndpointV2(knoraApiConfig, path + V2Endpoint.PATH_RESOURCES, _this); _this.values = new ValuesEndpointV2(knoraApiConfig, path + V2Endpoint.PATH_VALUES, _this); _this.list = new ListsEndpointV2(knoraApiConfig, path); _this.search = new SearchEndpointV2(knoraApiConfig, path, _this); // Instantiate caches _this.ontologyCache = new OntologyCache(knoraApiConfig, _this); _this.listNodeCache = new ListNodeV2Cache(_this); return _this; } V2Endpoint.PATH_AUTHENTICATION = "/authentication"; V2Endpoint.PATH_ONTOLOGIES = "/ontologies"; V2Endpoint.PATH_RESOURCES = "/resources"; V2Endpoint.PATH_VALUES = "/values"; V2Endpoint.PATH_METADATA = "/metadata"; return V2Endpoint; }(Endpoint)); export { V2Endpoint }; //# sourceMappingURL=v2-endpoint.js.map