@dasch-swiss/dsp-js
Version:
TypeScript client library for DSP-API
46 lines • 2.28 kB
JavaScript
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
*/
export class V2Endpoint extends Endpoint {
static { this.PATH_AUTHENTICATION = '/authentication'; }
static { this.PATH_ONTOLOGIES = '/ontologies'; }
static { this.PATH_RESOURCES = '/resources'; }
static { this.PATH_VALUES = '/values'; }
static { this.PATH_METADATA = '/metadata'; }
/**
* 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
*/
constructor(knoraApiConfig, path) {
super(knoraApiConfig, path);
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);
// Initialize deprecated caches for test compatibility only
// These are NOT used by production code - endpoints create temporary caches per request
this.ontologyCache = new OntologyCache(knoraApiConfig, this);
this.listNodeCache = new ListNodeV2Cache(this);
}
}
//# sourceMappingURL=v2-endpoint.js.map