diff --git a/README.md b/README.md index 32c7a2859..d130920c5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# DSP-JS-LIB — A library to easily connect to Knora/DSP API +# DSP-JS-LIB — A library to easily connect to DSP-API (Knora) [![npm version](https://badge.fury.io/js/%40dasch-swiss%2Fdsp-js.svg)](https://www.npmjs.com/package/@dasch-swiss/dsp-js) [![CI](https://github.com/dasch-swiss/knora-api-js-lib/workflows/CI/badge.svg)](https://github.com/dasch-swiss/dsp-js-lib/actions?query=workflow%3ACI) @@ -6,197 +6,90 @@ [![minzipped size](https://img.shields.io/bundlephobia/minzip/@dasch-swiss/dsp-js.svg?style=flat)](https://www.npmjs.com/package/@dasch-swiss/dsp-js) [![license](https://img.shields.io/npm/l/@dasch-swiss/dsp-js.svg?style=flat)](https://www.npmjs.com/package/@dasch-swiss/dsp-js) -## Purpose of this project +## Introduction -This TypeScript library allows a developer to connect to the Knora API without knowing technical details about it. -We published this library as `@dasch-swiss/dsp-js` on NPM for easy integration into TypeScript/JavaScript projects. -The library is developed in TypeScript and declaration files are part of the package to allow for integration with other TypeScript projects. +### Links in this document +This document contains links to other files of DPS-JS-LIB's documentation. +Note that these links point to the latest version of these files and +not necessarily the version you are working with. -## Changelog +### Purpose of DSP-JS-LIB +The purpose of DSP-JS-LIB is to facilitate the communication with [DSP-API (Knora)](https://www.knora.org) in web clients developed with TypeScript/JavaScript. +DSP-JS-LIB depends on [RxJS](https://rxjs.dev/guide/overview) and is web framework agnostic (it can be used with Angular, React, Vue.js etc.). -See file . +DSP-JS-LIB offers the following features: + - handling of HTTP calls to connect to DSP-API + - (de)serialisation from and to JSON-LD so the web client can work with classes instead + - methods that combine different HTTP calls to DSP-API into *one* method call + - caching for different types of data so fewer HTTP calls to DSP-API have to be performed -## Getting started - -### Requirements +### Basic Structure of DSP-JS-LIB +DSP-JS-LIB's architecture is based on endpoints that correspond to DSP-API's endpoints. -This library has been written to be used in any TypeScript/JavaScript project. -It may be integrated with any JavaScript framework/library of your choice, such as Angular, React, Vue.js, and more. +The following endpoints are available through DSP-JS-LIB: +- **admin**: getting and modifying users, projects, permissions etc. +- **v2**: requesting and modifying resources and values using DSP-API version 2 +- **system**: DSP-API's health status -We recommend to install this library through NPM. This will make sure that all dependencies are installed. -At the moment, this library depends on `rxjs`, `json2typescript`, and `jsonld`. +Consult the API docs for more details about the available endpoints. +See [design documentation](design-documentation.md) for a detailed description of DSP-JS-LIB's design and architecture. -In order to be able to integrate this library, you should have a basic understanding of an `Observable`. -All HTTP requests to Knora are performed using an `Observable` through the RxJS library. +### RxJS Observables +DSP-JS-LIB's endpoints return observables to the client. +An `Observable` represents the result of an asynchronous request to DSP-API that will either succeed or fail. +An `Observable` is an [RxJS construct](https://rxjs.dev/guide/observable) that the client can subscribe to. -### Installation +## Getting started -Run `npm install @dasch-swiss/dsp-js --save` in the root directory of your project. -Make sure to install the lib's peer dependencies, see below. +### Install DSP-JS-LIB +Run `npm install @dasch-swiss/dsp-js --save` to install DSP-JS-LIB in your npm project. ### Dependencies and Peer Dependencies +DSP-JS-LIB depends on [jsonld](https://www.npmjs.com/package/jsonld) and [json2typescript](https://www.npmjs.com/package/json2typescript). +These dependencies will be installed with `npm install`. -This library depends on `RxJS`, `jsonld`, and `json2typescript`. `jsonld` and `json2typescript` are only used internally and listed as dependencies. - -`RxJS` is listed as a peer dependency and **not** installed with `npm install`. -It can be installed with `npm run peer-deps` when you are working on this project. -`RxJS`'s `Observable` is used in this library's public API -and has to be compatible with whatever version of `RxJS` is used in the productive environment, e.g. an Angular application. -This library works with `RxJS`'s major version defined in `package.json` . See `rxjs.md` for details. - -### Starting example +[RxJS](https://www.npmjs.com/package/rxjs) is a peer dependency of this library and is **not installed** when running `npm install`. +Note that DSP-JS-LIB requires major version 6 of `rxjs`. -Below you may find a minimal example in TypeScript for the process of the user login. +Make sure that the framework you are using, e.g., Angular, requires major version 6 of RxJS to ensure the peer dependency will be met. +Otherwise, install it with `npm install rxjs@6.x --save`. -If your IDE does not automatically help you with imports, these are the necessary files for the basic example: +### Start Using DSP-JS-LIB +In order to get started using DSP-JS-LIB, you have to create a `KnoraApiConfig` instance and pass it to `KnoraApiConnection`'s constructor: ```typescript -import { KnoraApiConfig, KnoraApiConnection, ApiResponseData, ApiResponseError, LoginResponse } from "@dasch-swiss/dsp-js"; -``` - -Now, we will set up an instance of the class `KnoraApiConnection`. -This instance can be your gateway to all API requests. -In most use cases, you will want to store this instance globally within your JavaScript application. +// import from DSP-JS-LIB +import { KnoraApiConfig, KnoraApiConnection } from "@dasch-swiss/dsp-js"; -```typescript -// Set up a KnoraApiConnection instance. -// We suggest to do this at your app entrypoint and store the instance globally. +// create the configuration +const config: KnoraApiConfig = new KnoraApiConfig("https", "api.dasch.swiss"); -const config: KnoraApiConfig = new KnoraApiConfig("https", "knora.org"); +// create a connection instance const knoraApiConnection: KnoraApiConnection = new KnoraApiConnection(config); ``` -As soon as the basic configuration is done, you will be able to use the pre-defined methods provided by the KnoraApiConnection instance. -For example, you can login a user with a password as follows: +Once you have set up the connection instance, you can use any of DSP-JS-LIB's endpoints to perform requests to DSP-API. +In the following example, we are requesting a resource from DSP-API: ```typescript -// Login the user to Knora. -// The method subscribe() is provided with two anonymous functions: -// The first is launched in case of success, the second in case of failure. - -knoraApiConnection.v2.auth.login("user", "password").subscribe( - (response: ApiResponseData) => { - console.log("Login successful!"); - }, - (response: ApiResponseError) => { - console.error("Login failed!"); - } +// request a resource using the resources endpoint from v2 +knoraApiConnection.v2.res.getResource(iri).subscribe( + (resource: ReadResource) => { + // "resource" represents a resource retrieved from DSP-API + console.log(res); + }, + (error) => { + // if, for some reason, the request failed + console.error(error); + } ); ``` -Our library makes sure that session data (token) is stored within the KnoraApiConnection instance. -Any subsequent call after a successful login will be performed using the session. - -### Test environment for Angular - -`./test-framework` provides a ready-to-use test environment for Angular developers. See `./test-framework/README.md` for further instructions. - -## Scripts for testing and deployment - -This package provides the following short-hand scripts: - -1. `npm run peer-deps`: Installs the project's peer dependencies. Peer dependencies are not installed with `npm install`, but have to be met before building or running the tests. -1. `npm run test`: Runs the project's tests defined in `./karma.conf.js`. The coverage data is saved into the `./coverage/` folder. -1. `npm run build`: Builds the whole project without testing and puts the files into the `./build/` folder. -1. `npm run yalc-publish`: Executes 2 and publishes the package to the yalc app store. -1. `npm run npm-pack`: Executes 1, 2 and packs the `./build/` folder into an NPM tgz package. The package is moved into a `./dist/` folder. -1. `npm run npm-publish`: Executes 4 and publishes the package to the NPM store (runs in dry-run mode). - -> Note: You need to install [`yalc`]() globally by `npm install yalc -g` to use script number 4. - -For further development with Knora, the following scripts can be used: - -1. `npm run integrate-admin-test-data `: integrates generated test data for the Knora Admin API, -see -> Internals -> Development -> Generating Client Test Data. -1. `npm run integrate-v2-test-data `: integrates JSON-LD test data for Knora API v2, -see -> Internals -> Development -> Generating Client Test Data. -The test data files have to be added to `scripts/v2-test-data-config.json`: `source` refers to their location in the Knora test data directory structure, -`destination` refers to their location in this repo. The test data files are copied when running the script. -1. `npm run expand-jsonld-test-data`: creates versions with expanded prefixes for Knora API v2 JSON-LD test data. -1. `npm run prepare-dev-publication`: prepares a dev version of the library for publication. -The dev versions contains mocks that produce tests data without a connection to Knora. -The mocks are configured in `scripts/mock-exports.json`. -If you need a local version of this lib that contains the mocks, do the following: - - `npm run prepare-dev-publication` to prepare a dev version. - - `npm run yalc-publish` to publish a local build containing the mocks. -1. `npm run webdriver-update` (from directory `test-framework`): updates Chrome webdriver for e2e tests - -## Change Supported Version of DSP-API - -DSP-JS is compatible with a specified release of DSP-API. -To update the target release of DSP-API, the following steps have to be carried out: - -1. Update DSP-API version in - - `vars.mk`, e.g., change `v13.0.0-rc.16` to `v13.0.0-rc.17`. - - `src/api/system/health/health-endpoint.spec.ts` -1. Delete local test data with `make delete-test-data` -1. Generate test data using the target DSP-API release, - - Variant 1: See -> Internals -> Development -> Generating Client Test Data - and copy generated test data from Knora-Api repository to DSP-JS-Lib repo: - Run from project root: `cp /Folder/To/Knora-Api/client-test-data.zip ./` - - Variant 2: Download test-data from DSP-API release with `make get-test-data-from-release` -1. Unpack generated test data and integrate it with `make prepare-test-data` -1. Run the unit tests with `npm test` from the project root. -1. Check for differences in the generated test data with respect to the previous release of DSP-API. - If there are changes in the test data that have **no breaking effect**, integrate them (add them to the git repo). - Otherwise, DSP-JS has to be adapted to comply with the later version of DSP-JS. Also see section "Integration of Generated Test Data". -1. Run the e2e tests against the target release of DSP-API: - - prepare the local publication of the library using `npm run prepare-dev-publication` - - build the library and publish it locally with `npm run yalc-publish` - - change to directory `test-framework` - - add the locally build library using `npm run yalc-add` and run `npm install` - - run `npm run webdriver-update` and then `npm run e2e` -1. See if the tests pass on GitHub CI - -## Integration of Generated Test Data - -By default, all generated test data for THE admin API is integrated with the script `npm run integrate-admin-test-data`. - -Test data for v2 has to be added to `scripts/v2-test-data-config.json` to be used in the unit tests. -All files that are contained in `scripts/v2-test-data-config.json` will be copied this library's tests data when running `npm run integrate-v2-test-data`. - -Example: - -```json -{ - "generated-test-data": [ - { - "source": "/v2/ontologies/all-ontology-metadata-response.json", - "destination": "./test/data/api/v2/ontologies/all-ontology-metadata-response.json" - }, - ... - ] -} -``` - -The example shown above will copy the file `/v2/ontologies/all-ontology-metadata-response.json` -from the generated test data to the specified destination in this library's test data folder. -In the unit tests, this file can then be used to mock request and response data. - -When adding a new method to a v2 endpoint, only add the test data needed to test this method to facilitate the review process. -**Do not add v2 test data that is not used in the unit tests.** - -After integrating v2 test data, run `npm run expand-jsonld-test-data`. - -## Publish a new version to NPM - -Before publishing: - -- Update README if necessary and commit the changes. - -- Be sure that the dependency to DSP-API is set to the correct version: - - Update DSP-API version in `Makefile` (see section above) - -A new version will be published with each Github release as it's part of Github actions' workflow. To make a new release, go to and update the draft called "Next release" by changing: - -- the tag version and the release title (same name) with the version number, e.g. `v3.0.0` or `v3.0.0-rc.0` -- If this is a pre-release, check the box "This is a pre-release" - -New package will be available on . - -At the moment (2020-06) all releases contain mocked data. +For more information about available endpoints and methods, consult the API docs. -## Documentation +## Release Notes +For the release notes +see [GitHub releases](https://github.com/dasch-swiss/dsp-js-lib/releases). -For the public API, see . -For design documentation, see file `design-documentation.md`. +## Developing DSP-JS-LIB +See [contribution guidelines](contribution.md). diff --git a/contribution.md b/contribution.md new file mode 100644 index 000000000..f51ba3eef --- /dev/null +++ b/contribution.md @@ -0,0 +1,172 @@ +# Contribution + +## How to Contribute to this Project + +If you are interested in contributing to this project, +please read our [general contribution guidelines](https://docs.dasch.swiss/developers/dsp/contribution/) first. + +## Introduction + +The purpose of this library is to facilitate the use of [DSP-API (Knora)](https://www.knora.org) in web client development. +It offers a convenient way to communicate with DSP-API without knowing specific technical details. + +## Architecture +See [design documentation](design-documentation.md). + +## Development + +### Prerequisites + +For development, you need to install [`yalc`]() globally. +Run `npm install yalc -g`. This will enable you to build and publish DSP-JS-LIB locally. + +### Dependencies + +This library depends on [RxJS](https://www.npmjs.com/package/rxjs), [jsonld](https://www.npmjs.com/package/jsonld), and [json2typescript](https://www.npmjs.com/package/json2typescript). +`jsonld` and `json2typescript` are only used internally and listed as dependencies in `package.json`. + +`RxJS` is listed as a peer dependency and **not** installed with `npm install`. +It can be installed running `npm run peer-deps` **after** `npm install`. + +`RxJS`'s `Observable` is used in this library's public API +and has to be compatible with whatever version of `RxJS` is used in the productive environment, e.g. an Angular application. +This library works with `RxJS`'s major version defined in `package.json`. See [Use of RxJS](rxjs.md) for details. + +### Scripts for Testing and Development + +This package provides the following short-hand scripts: + +1. `npm run peer-deps`: Installs the project's peer dependencies. Peer dependencies are not installed with `npm install`, but have to be met before building or running the tests. +1. `npm run test`: Runs the library's tests defined in `./karma.conf.js`. +1. `npm run prepare-dev-publication`: prepares a dev version of the library **before** building it. The dev version contains code to create mocked data to be used in unit tests of projects using DSP-JS-LIB. +1. `npm run build`: Builds the whole library without testing and puts the files into the `./build/` folder. +1. `npm run yalc-publish`: Builds and publishes the package to the yalc app store (local publication of the lib). +1. `npm run npm-pack`: Tests and builds the library and then packs the `./build/` folder into an NPM tgz package. The package is moved into a `./dist/` folder. + +### Build and Publish a Local Version + +Using `yalc`, DSP-JS-LIB can be built and published locally: +- Run `npm install` and `npm run peer-deps` +- Run `npm run prepare-dev-publication` if the mocks should be included, see section below. +- Run `npm run yalc-publish` + +Alternatively, you can run `npm run build-local` which combines the script mentioned above. + +### Development Version + +The development version contains mocks that produce tests data without a connection to DSP-API. +These mocks were originally developed for internal use, but can be used to get data for unit tests in projects that use DSP-JS-LIB. +The following example shows how to get a mocked resource without a connection to DSP-API: + +```ts +import { MockResource } from "@dasch-swiss/dsp-js"; + +MockResource.getTestThing().subscribe( + (testthing: ReadResource) => { + console.log(testthing); + } +) +``` + +The mocks are configured in `scripts/mock-exports.json`. + +If you need a local version of this library that contains the mocks, do the following: + - `npm run prepare-dev-publication` to prepare a dev version. + - `npm run yalc-publish` to publish a local build containing the mocks. + +**Note that `prepare-dev-publication` modifies `package.json`, `tsconfig.json` and `index.ts`. +Run this script only once and do not commit these changes.** + +### Integrating Generated Test Data from DSP-API + +Unit tests use data that is generated by DSP-API. + +Download test data generated by DSP-API by running `make get-test-data-from-release`. +This will download the test data for DSP-API release which is set in `vars.mk`. + +To integrate test data generated by DSP-API, the following scripts can be used. + +1. `npm run integrate-system-test-data `: integrates generated test data for DSP-API system API. +1. `npm run integrate-admin-test-data `: integrates generated test data for DSP-API admin API. +1. `npm run integrate-v2-test-data `: integrates JSON-LD test data for DSP-API v2 API. +The test data files have to be added to `scripts/v2-test-data-config.json`: `source` refers to their location in DSP-API test data directory structure, +`destination` refers to their location in this repo. The test data files are copied when running the script. +1. `npm run expand-jsonld-test-data`: creates versions with expanded prefixes for DSP-API v2 JSON-LD test data. + +Instead of running these scripts one by one, you can also run `make prepare-test-data`. + +By default, all generated test data for the system and admin API is integrated with the corresponding script. + +Test data for v2 has to be added to `scripts/v2-test-data-config.json` to be used in the unit tests. +All files that are contained in `scripts/v2-test-data-config.json` will be copied to this library's test data directory when running `npm run integrate-v2-test-data`. + +Example: + +```json +{ + "generated-test-data": [ + { + "source": "/v2/ontologies/all-ontology-metadata-response.json", + "destination": "./test/data/api/v2/ontologies/all-ontology-metadata-response.json" + }, + ... + ] +} +``` + +The example shown above will copy the file `/v2/ontologies/all-ontology-metadata-response.json` +from the generated test data to the specified destination in this library's test data folder. +In the unit tests, this file can then be used to mock request and response data. + +When adding a new method to a v2 endpoint, only add the test data needed to test this method to facilitate the review process. +**Do not add v2 test data that is not used in the unit tests.** + +After integrating v2 test data, run `npm run expand-jsonld-test-data`. + + +### Change Supported Version of DSP-API + +DSP-JS-LIB is compatible with a release of DSP-API that is specified in `vars.mk`. +To update the target release of DSP-API, the following steps have to be carried out: + +1. Update DSP-API version in `vars.mk`, e.g., change `v13.0.0-rc.16` to `v13.0.0-rc.17`. +1. Download test-data from DSP-API release with `make get-test-data-from-release`. +1. Unpack generated test data and integrate it with `make prepare-test-data`. +1. Run the unit tests with `npm test` from the project root. +1. Check for differences in the generated test data with respect to the previous release of DSP-API. + If there are changes in the test data that have **no breaking effect**, integrate them (add them to the git repo). + Otherwise, DSP-JS has to be adapted to comply with the later version of DSP-JS. Also see section "Integration of Generated Test Data". +1. Run the e2e tests against the target release of DSP-API: + - prepare the local publication of the library using `npm run prepare-dev-publication` + - build the library and publish it locally with `npm run yalc-publish` + - change to directory `test-framework` + - add the locally build library using `npm run yalc-add` and run `npm install` + - run `npm run webdriver-update` and then `npm run e2e` +1. See if the tests pass on GitHub CI. + +## Unit Tests + +Component have their own spec files defining unit tests. +Since this library relies on DSP-API, +static test data is generated from DSP-API and integrated automatically. + +Actual calls to DSP-API in production are mocked with `jasmine.Ajax`. +The data is read from the static test data files and passed to `jasmine.Ajax`, +so the component being tested can react to it. + +If a component A depends on a component B, then B has to be mocked during the test using a `jasmine.Spy`. +The behavior of component B is simulated and a fake response is returned. +Mocking components turned out to be quite complex for the `OntologyCache`. +Therefore, a stand-alone testing component has been made for this mock called `MockOntology` that can be reused. +It can also be used to generate static test data in software projects using this library. + +Since `MockOntology` is complex, some global assertions are made to guarantee that the mock behaves like the actual component. +These assertions are defined in `MockOntologyAssertions`. + +## Test Environment and E2E Tests + +`./test-framework` provides a ready-to-use test environment for Angular developers. +The E2E test for DSP-JS-LIB are run by the test environment. +See the [test framwork README](test-framework/README.md) for further instructions. + + diff --git a/design-documentation.md b/design-documentation.md index 6d1d024e0..c31890ce0 100644 --- a/design-documentation.md +++ b/design-documentation.md @@ -1,119 +1,137 @@ # Design Documentation -## Introduction +## Architecture -The purpose of this library is facilitating the use of the Knora API in web client development. -It offers a convenient way to communicate with the Knora API without knowing specific technical details. +### Endpoints -## Endpoints +An `Endpoint` offers methods to communicate with DSP-API. Three main groups of endpoints have been implemented: -An `Endpoint` offers methods to communicate with the Knora API. At the current state, two main groups of endpoints have been implemented: +- `SystemEndpoint`: communication with DSP-API system endpoint: `HealthEndpoint` +- `AdminEndpoint`: communication with DSP-API admin endpoint: `UsersEndpoint`, `GroupsEndpoint`, `ProjectsEndpoint`, `PermissionsEndpoint` +- `V2Endpoint`: communication with DSP-API v2 endpoint: `AuthenticationEndpoint`, `OntologiesEndpoint`, `ResourcesEndpoint`, `ListsEndpoint`, `SearchEndpoint` -- `AdminEndpoint`: communication with Knora admin API: `UsersEndpoint`, `GroupsEndpoint`, `ProjectsEndpoint`, `PermissionsEndpoint` -- `V2Endpoint`: communication with Knora API v2: `AuthenticationEndpoint`, `OntologiesEndpoint`, `ResourcesEndpoint`, `ListsEndpoint`, `SearchEndpoint` +#### System Endpoints +DSP-API System endpoints inform about DSP-API's health status. -### Knora Admin API Endpoints +##### Health Endpoint -The Knora Admin API is used to administrate projects in Knora. This also includes management of users and groups as well as permissions. -The Knora API relies on JSON as an exchange format. +The `HealthEndpointSystem` returns DSP-API's health status including information about the version. -#### Users +#### DSP-API Admin API Endpoints + +DSP-API Admin is used to administrate projects in DSP-API. This also includes management of users and groups as well as permissions. +DSP-API relies on JSON as an exchange format. + +##### Users The `UsersEndpoint` deals with all requests related to creating, reading, updating and deleting users. -It communicates directly with the Knoa API, taking care of deserializing JSON responses received from Knora and serializing payloads submitted in requests to JSON. +It communicates directly with DSP-API, taking care of deserializing JSON responses received from DSP-API and serializing payloads submitted in requests to JSON. -#### Groups +##### Groups The `GroupsEndpoint` deals with all requests related to creating, reading, updating and deleting groups. -It communicates directly with the Knoa API, taking care of deserializing JSON responses received from Knora and serializing payloads submitted in requests to JSON. +It communicates directly with DSP-API, taking care of deserializing JSON responses received from DSP-API and serializing payloads submitted in requests to JSON. -#### Projects +##### Projects The `ProjectsEndpoint` deals with all requests related to creating, reading, updating and deleting projects. -It communicates directly with the Knoa API, taking care of deserializing JSON responses received from Knora and serializing payloads submitted in requests to JSON. +It communicates directly with DSP-API, taking care of deserializing JSON responses received from DSP-API and serializing payloads submitted in requests to JSON. -#### Permissions +##### Permissions The `ProjectsEndpoint` deals with all requests related to reading permissions. -It communicates directly with the Knoa API, taking care of deserializing JSON responses received from Knora. +It communicates directly with DSP-API, taking care of deserializing JSON responses received from DSP-API. -#### Lists +##### Lists The `ListsEndpoint` deals with all requests about lists that use the admin API. -It communicates directly with the Knoa API, taking care of deserializing JSON responses received from Knora. +It communicates directly with DSP-API, taking care of deserializing JSON responses received from DSP-API. -### Knora Api v2 Endpoints +#### DSP-API v2 Endpoints -The Knora API v2 is used to create, read, search, and modify data (resources and values). -The Knora API relies on JSON-LD as an exchange format. +DSP-API v2 is used to create, read, search, and modify data (resources and values). +DSP-API relies on JSON-LD as an exchange format. -#### Authentication +##### Authentication -The `AuthenticationEndpoint` performs login and logout operations to the Knora API. -When a user logs in, a token is set and submitted which each request to the Knora API until the user logs out. +The `AuthenticationEndpoint` performs login and logout operations to DSP-API. +When a user logs in, a token is set and submitted which each request to DSP-API until the user logs out. -#### Ontology +##### Ontology -The `OntologiesEndpoint` handles requests to the Knora API that relate to ontologies. +The `OntologiesEndpoint` handles requests to DSP-API that relate to ontologies. -Entire system or project ontologies are requested from Knora +Entire system or project ontologies are requested from DSP-API and converted to a `ReadOntology` using `OntologyConversionUtil`. `OntologiesEndpoint` should not be used directly by the client when reading ontologies. Instead, `OntologyCache` should be used. -This guarantees that an ontology is only requested once from Knora, keeping API calls and conversions to a minimum. +This guarantees that an ontology is only requested once from DSP-API, keeping API calls and conversions to a minimum. -#### Resource +##### Resource -The `ResourcesEndpoint` handles requests to the Knora API that relate to resource instances. -When reading resources, resource instances are returned from Knora as JSON-LD and converted to an array of `ReadResource` using `ResourcesConversionUtil`. +The `ResourcesEndpoint` handles requests to DSP-API that relate to resource instances. +When reading resources, resource instances are returned from DSP-API as JSON-LD and converted to an array of `ReadResource` using `ResourcesConversionUtil`. -### Values +#### Values -The `ValuesEndpoint` handles requests to the Knora API that relate to operations on values. +The `ValuesEndpoint` handles requests to DSP-API that relate to operations on values. When reading values, these are embedded in resource instances and converted to an array of `ReadResource` using `ResourcesConversionUtil`. -#### Search +##### Search -The `SearchEndpoint` handles requests to the Knora API that relate to searches, either full-text or complex (Gravsearch). +The `SearchEndpoint` handles requests to DSP-API that relate to searches, either full-text or complex (Gravsearch). The result of a search is converted to an array of `ReadResource` or a `CountQueryResponse` using `ResourcesConversionUtil`. -#### List +##### List `ListsEndpoint` handles requests relating to whole lists or specific list nodes. Lists and list nodes serialized as JSON-LD are converted to `ListNode`. When reading lists or list nodes, `ListsEndpoint` should not be used directly by the client. Instead, `ListNodeCache` should be used, keeping API calls and conversions to a minimum. -### Utility Methods +#### Utility Methods -Utility methods perform conversion tasks that need to be performed when deserializing JSON-LD. Utility methods are called in endpoints when an answer from Knora has to be processed. Several endpoints may use the same utility functions. For example, the resources and search endpoint receive the same response format from Knora. +Utility methods perform conversion tasks that need to be performed when deserializing JSON-LD. Utility methods are called in endpoints when an answer from DSP-API has to be processed. Several endpoints may use the same utility functions. For example, the resources and search endpoint receive the same response format from DSP-API. -#### Ontology Conversion Util +##### Ontology Conversion Util `OntologyConversionUtil` converts an entire system or project ontology to a `ReadOntology` and also analyzes direct dependencies on other ontologies. Entity definitions contained in an ontology are grouped (resource class definition, standoff class definition, resource property definition, system property definition) and converted from JSON-LD to the corresponding classes. -#### Resource Conversion Util +##### Resource Conversion Util `ResourcesConversionUtil` handles the conversion of one or several resources serialized as JSON-LD to an array of `ReadResource`. `ResourcesConversionUtil` creates an array of `ReadResource` from JSON-LD representing resource instances, automatically adding ontology information such as resource class labels and labels from list nodes that are referred to from list values. -It does so by using `OntologyCache` and `ListNodeCache`, minimizing the requests to the Knora API to obtain the necessary information. +It does so by using `OntologyCache` and `ListNodeCache`, minimizing the requests to DSP-API to obtain the necessary information. -`ResourcesConversionUtil.createReadResourceSequence` is a public method that takes JSON-LD representing zero, one or more resources and returns an array of `ReadResource`. For each resource serialized as JSON-LD, `ResourcesConversionUtil.createReadResource` is called to do the conversion to a `ReadResource`. As a first step, `ResourcesConversionUtil.createReadResource` determines the resource's type (its class). Then, the definition for this class is requested from `OntologyCache`. The class definition contains information such as the class's label, cardinalities for properties and the definitions of those properties. The cardinalities are required to distinguish between system properties and properties that are defined in a project ontology. Each property value serialized as JSON-LD is converted to a `ReadValue` if there exists a cardinality for it for the resource class at hand. +`ResourcesConversionUtil.createReadResourceSequence` is a public method that takes JSON-LD representing zero, one, or more resources and returns an array of `ReadResource`. +For each resource serialized as JSON-LD, `ResourcesConversionUtil.createReadResource` is called to do the conversion to a `ReadResource`. +As a first step, `ResourcesConversionUtil.createReadResource` determines the resource's type (its class). +Then, the definition for this class is requested from `OntologyCache`. +The class definition contains information such as the class's label, +cardinalities for properties and the definitions of those properties. +The cardinalities are required to distinguish between system properties and properties that are defined in a project ontology. +Each property value serialized as JSON-LD is converted to a `ReadValue` if a cardinality for it exists for the resource class at hand. Once all property values have been converted, link property values are analyzed to facilitate the handling of incoming and outgoing links on a given resource. ## Caching -Caching is necessary to avoid making redundant calls to the Knora API and processing the same responses more than once. +Caching is necessary to avoid making redundant calls to DSP-API and processing the same responses more than once. ### Generic Cache -`GenericCache` is an abstract and generic class. The generic type is the type of object that is going to be cached, e.g., an `ReadOntology`. The key is the IRI of the object that is cached. `GenericCache` ensures that a specific element is only requested once from Knora also if several asynchronous for the same element are performed. `GenericCache` also resolves dependencies of an element that is being requested, but in a non blocking ay, i.e. the requested element is returned immediately it is ready while the dependencies are still being resolved. +`GenericCache` is an abstract and generic class. The generic type is the type of object that is going to be cached, e.g., an `ReadOntology`. +The key is the IRI of the object that is cached. +`GenericCache` ensures that a specific element is only requested once from DSP-API +if several asynchronous for the same element are performed. +`GenericCache` also resolves dependencies of an element that is being requested, +but in a non-blocking ay, i.e. the requested element is returned immediately +when it is ready while the dependencies are still being resolved. `GenericCache` cannot be instantiated because it is an abstract class. It can be implemented for a specific type providing implementations for the following methods: -- `requestItemFromKnora(key: string, isDependency: boolean): : Observable`: Requests the specified element from Knora, e.g., an ontology by calling the `OntologyEndpoint`. +- `requestItemFromKnora(key: string, isDependency: boolean): : Observable`: Requests the specified element from DSP-API, e.g., an ontology by calling the `OntologyEndpoint`. - `getKeyOfItem(item: T): string`: Given the element, get the key that identifies it. For example given a `ReadOntology` returns its IRI. - `getDependenciesOfItem(item: T): string[]`: Given an element, gets its dependencies. For example given a `ReadOntology` returns the IRIs of ontologies it directly depends on. @@ -142,22 +160,3 @@ requests a resource class definition with all its property definitions that coul #### List Node v2 Cache `ListNodeV2Cache` caches v2 list nodes. As an optimization, the entire list is regarded as a dependency of any given list node and requested. Like this, all list nodes can be fetched with one request and written to the cache. - -### Tests - -Component have their own spec files defining unit tests. -Since this library relies on Knora API, -static test data is generated from Knora API and integrated automatically. - -Actual calls to the Knora API in production are mocked with `jasmine.Ajax`. -The data is read from the static test data files and passed to `jasmine.Ajax`, -so the component under test can react to it. - -If a component A depends on a component B, then B has to be mocked during the test using a `jasmine.Spy`. -The behavior of component B is simulated and a fake response is returned. -Mocking components turned out to be quite complex for the `OntologyCache`. -Therefore, the mock has been made a stand-alone testing component called `MockOntology` that can be reused. -It can also be used to generate static test data in software projects using this library. - -Since `MockOntology` is complex, some global assertions are made to guarantee that the mock behaves as the actual component. -These assertions are defined in `MockOntologyAssertions`. diff --git a/package.json b/package.json index da099f43c..9293bfc9e 100644 --- a/package.json +++ b/package.json @@ -1,71 +1,70 @@ { - "name": "@dasch-swiss/dsp-js", - "version": "0.0.0-PLACEHOLDER", - "description": "JavaScript library that handles API requests to Knora", - "main": "index.js", - "files": [ - "src/**/*.d.ts", - "src/**/*.js.map", - "src/**/*.js", - "index.d.ts", - "index.js.map", - "index.js" - ], - "scripts": { - "integrate-admin-test-data": "node scripts/integrate-files-admin.js", - "integrate-system-test-data": "node scripts/integrate-files-system.js", - "integrate-v2-test-data": "node scripts/integrate-files-v2.js", - "expand-jsonld-test-data": "node scripts/expand-jsonld-test-data-files.js", - "test": "karma start karma.conf.js", - "build": "rm -rf build/* && tsc && mkdir -p build/ && cp LICENSE build/ && cp README.md build/ && cp package.json build/", - "yalc-publish": "npm run build && yalc publish build/ --push", - "npm-pack": "npm run test && npm run build && npm pack build/ && mkdir -p dist/ && cp *.tgz dist/ && rm *.tgz", - "npm-publish": "npm run npm-pack && npm publish --tag rc build/ --dry-run", - "prepare-dev-publication": "node scripts/prepare-dev-publication.js", - "builddocs": "typedoc --out docs --readme none --name '@dasch-swiss/dsp-js API Documentation' --exclude \"**/*.spec.*\" src/*.ts", - "peer-deps": "npm i rxjs@6.x --no-save", - "build-local": "npm i && npm run peer-deps && npm run prepare-dev-publication && npm run yalc-publish" - }, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com:dasch-swiss/knora-api-js-lib.git" - }, - "keywords": [ - "typescript", - "javascript", - "knora", - "api", - "converter" - ], - "author": "Data & Service Center for the Humanities DaSCH, University of Basel", - "license": "AGPL-3.0", - "bugs": { - "url": "https://github.com/dasch-swiss/knora-api-js-lib/issues" - }, - "homepage": "https://github.com/dasch-swiss/knora-api-js-lib#readme", - "devDependencies": { - "@types/jasmine": "^3.4.0", - "@types/jasmine-ajax": "^3.3.0", - "@types/node": "^12.7.7", - "jasmine": "^3.5.0", - "jasmine-ajax": "^4.0.0", - "karma": "^5.0.9", - "karma-chrome-launcher": "^3.1.0", - "karma-jasmine": "^2.0.1", - "karma-jasmine-ajax": "^0.1.13", - "karma-mocha-reporter": "^2.2.5", - "karma-typescript": "^5.0.3", - "phantomjs-prebuilt": "^2.1.16", - "tslint": "^5.20.0", - "typedoc": "^0.15.0", - "typescript": "~3.6.3" - }, - "dependencies": { - "@types/jsonld": "^1.5.0", - "json2typescript": "1.4.1", - "jsonld": "^1.8.0" - }, - "peerDependencies": { - "rxjs": "6.x" - } -} \ No newline at end of file + "name": "@dasch-swiss/dsp-js", + "version": "0.0.0-PLACEHOLDER", + "description": "JavaScript library that handles API requests to Knora", + "main": "index.js", + "files": [ + "src/**/*.d.ts", + "src/**/*.js.map", + "src/**/*.js", + "index.d.ts", + "index.js.map", + "index.js" + ], + "scripts": { + "integrate-admin-test-data": "node scripts/integrate-files-admin.js", + "integrate-system-test-data": "node scripts/integrate-files-system.js", + "integrate-v2-test-data": "node scripts/integrate-files-v2.js", + "expand-jsonld-test-data": "node scripts/expand-jsonld-test-data-files.js", + "test": "karma start karma.conf.js", + "build": "rm -rf build/* && tsc && mkdir -p build/ && cp LICENSE build/ && cp README.md build/ && cp package.json build/", + "yalc-publish": "npm run build && yalc publish build/ --push", + "npm-pack": "npm run test && npm run build && npm pack build/ && mkdir -p dist/ && cp *.tgz dist/ && rm *.tgz", + "prepare-dev-publication": "node scripts/prepare-dev-publication.js", + "builddocs": "typedoc --options typedoc.json src", + "peer-deps": "npm i rxjs@6.x --no-save", + "build-local": "npm i && npm run peer-deps && npm run prepare-dev-publication && npm run yalc-publish" + }, + "repository": { + "type": "git", + "url": "git+ssh://git@github.com:dasch-swiss/knora-api-js-lib.git" + }, + "keywords": [ + "typescript", + "javascript", + "knora", + "api", + "converter" + ], + "author": "Data & Service Center for the Humanities DaSCH, University of Basel", + "license": "AGPL-3.0", + "bugs": { + "url": "https://github.com/dasch-swiss/knora-api-js-lib/issues" + }, + "homepage": "https://github.com/dasch-swiss/knora-api-js-lib#readme", + "devDependencies": { + "@types/jasmine": "^3.4.0", + "@types/jasmine-ajax": "^3.3.0", + "@types/node": "^12.7.7", + "jasmine": "^3.5.0", + "jasmine-ajax": "^4.0.0", + "karma": "^5.0.9", + "karma-chrome-launcher": "^3.1.0", + "karma-jasmine": "^2.0.1", + "karma-jasmine-ajax": "^0.1.13", + "karma-mocha-reporter": "^2.2.5", + "karma-typescript": "^5.0.3", + "phantomjs-prebuilt": "^2.1.16", + "tslint": "^5.20.0", + "typedoc": "^0.15.0", + "typescript": "~3.6.3" + }, + "dependencies": { + "@types/jsonld": "^1.5.0", + "json2typescript": "1.4.1", + "jsonld": "^1.8.0" + }, + "peerDependencies": { + "rxjs": "6.x" + } +} diff --git a/src/api/admin/admin-endpoint.ts b/src/api/admin/admin-endpoint.ts index e49e81e60..f1645eabf 100755 --- a/src/api/admin/admin-endpoint.ts +++ b/src/api/admin/admin-endpoint.ts @@ -10,6 +10,8 @@ import { ListsEndpointAdmin } from "./lists/lists-endpoint-admin"; /** * A client API for administering Knora. + * + * @category Endpoint Admin */ export class AdminEndpoint extends Endpoint { diff --git a/src/api/admin/groups/groups-endpoint-admin.ts b/src/api/admin/groups/groups-endpoint-admin.ts index 09b0042f8..fff0c1b0d 100755 --- a/src/api/admin/groups/groups-endpoint-admin.ts +++ b/src/api/admin/groups/groups-endpoint-admin.ts @@ -14,6 +14,8 @@ import { UpdateGroupRequest } from "../../../models/admin/update-group-request"; /** * An endpoint for working with Knora groups. + * + * @category Endpoint Admin */ export class GroupsEndpointAdmin extends Endpoint { diff --git a/src/api/admin/lists/lists-endpoint-admin.ts b/src/api/admin/lists/lists-endpoint-admin.ts index c8a572e02..9eb1075aa 100755 --- a/src/api/admin/lists/lists-endpoint-admin.ts +++ b/src/api/admin/lists/lists-endpoint-admin.ts @@ -16,6 +16,8 @@ import { UpdateListInfoRequest } from "../../../models/admin/update-list-info-re /** * An endpoint for working with Knora lists. + * + * @category Endpoint Admin */ export class ListsEndpointAdmin extends Endpoint { diff --git a/src/api/admin/permissions/permissions-endpoint-admin.ts b/src/api/admin/permissions/permissions-endpoint-admin.ts index 7083f2096..e54036a0c 100755 --- a/src/api/admin/permissions/permissions-endpoint-admin.ts +++ b/src/api/admin/permissions/permissions-endpoint-admin.ts @@ -13,6 +13,8 @@ import { Endpoint } from "../../endpoint"; /** * An endpoint for working with Knora permissions. + * + * @category Endpoint Admin */ export class PermissionsEndpointAdmin extends Endpoint { diff --git a/src/api/admin/projects/projects-endpoint-admin.ts b/src/api/admin/projects/projects-endpoint-admin.ts index 219c460dc..96194fd7f 100755 --- a/src/api/admin/projects/projects-endpoint-admin.ts +++ b/src/api/admin/projects/projects-endpoint-admin.ts @@ -16,6 +16,8 @@ import { UpdateProjectRequest } from "../../../models/admin/update-project-reque /** * An endpoint for working with Knora projects. + * + * @category Endpoint Admin */ export class ProjectsEndpointAdmin extends Endpoint { diff --git a/src/api/admin/users/users-endpoint-admin.ts b/src/api/admin/users/users-endpoint-admin.ts index f8c900ec8..42dbaaadc 100644 --- a/src/api/admin/users/users-endpoint-admin.ts +++ b/src/api/admin/users/users-endpoint-admin.ts @@ -15,6 +15,8 @@ import { UsersResponse } from "../../../models/admin/users-response"; /** * An endpoint for working with Knora users. + * + * @category Endpoint Admin */ export class UsersEndpointAdmin extends Endpoint { diff --git a/src/api/endpoint.ts b/src/api/endpoint.ts index 77d66b300..16d67ffd4 100644 --- a/src/api/endpoint.ts +++ b/src/api/endpoint.ts @@ -7,6 +7,9 @@ import { KnoraApiConfig } from "../knora-api-config"; import { ApiResponseError } from "../models/api-response-error"; import { DataError } from "../models/data-error"; +/** + * @category Internal + */ export class Endpoint { /////////////// diff --git a/src/api/system/health/health-conversion-util.ts b/src/api/system/health/health-conversion-util.ts index c5220358e..e27143ad8 100644 --- a/src/api/system/health/health-conversion-util.ts +++ b/src/api/system/health/health-conversion-util.ts @@ -1,6 +1,9 @@ import { ApiResponseData } from "../../../models/api-response-data"; import { HealthResponse } from "../../../models/system/health-response"; +/** + * @category Internal + */ export namespace HealthConversionUtil { /** diff --git a/src/api/system/health/health-endpoint-system.ts b/src/api/system/health/health-endpoint-system.ts index 29f57899f..4f4d1bbc4 100755 --- a/src/api/system/health/health-endpoint-system.ts +++ b/src/api/system/health/health-endpoint-system.ts @@ -8,6 +8,8 @@ import { HealthConversionUtil } from "./health-conversion-util"; /** * An endpoint to get Knora's state of health. + * + * @category Endpoint System */ export class HealthEndpointSystem extends Endpoint { diff --git a/src/api/system/system-endpoint.ts b/src/api/system/system-endpoint.ts index dfef373d6..30257121c 100755 --- a/src/api/system/system-endpoint.ts +++ b/src/api/system/system-endpoint.ts @@ -4,6 +4,8 @@ import { HealthEndpointSystem } from "./health/health-endpoint-system"; /** * A client API for administering Knora. + * + * @category Endpoint System */ export class SystemEndpoint extends Endpoint { diff --git a/src/api/v2/authentication/authentication-endpoint-v2.ts b/src/api/v2/authentication/authentication-endpoint-v2.ts index bfd6eef3a..f99764058 100644 --- a/src/api/v2/authentication/authentication-endpoint-v2.ts +++ b/src/api/v2/authentication/authentication-endpoint-v2.ts @@ -11,6 +11,8 @@ import { Endpoint } from "../../endpoint"; /** * Handles requests to the authentication route of the Knora API. + * + * @category Endpoint V2 */ export class AuthenticationEndpointV2 extends Endpoint { diff --git a/src/api/v2/list/lists-endpoint-v2.ts b/src/api/v2/list/lists-endpoint-v2.ts index 3c7570740..1d0f469dc 100644 --- a/src/api/v2/list/lists-endpoint-v2.ts +++ b/src/api/v2/list/lists-endpoint-v2.ts @@ -10,6 +10,8 @@ const jsonld = require("jsonld/dist/jsonld.js"); /** * Handles requests to the lists route of the Knora API. + * + * @category Endpoint V2 */ export class ListsEndpointV2 extends Endpoint { diff --git a/src/api/v2/ontology/ontologies-endpoint-v2.ts b/src/api/v2/ontology/ontologies-endpoint-v2.ts index 04c261bf2..ce16f3965 100644 --- a/src/api/v2/ontology/ontologies-endpoint-v2.ts +++ b/src/api/v2/ontology/ontologies-endpoint-v2.ts @@ -30,6 +30,8 @@ const jsonld = require("jsonld/dist/jsonld.js"); /** * Handles requests to the ontologies route of the Knora API. + * + * @category Endpoint V2 */ export class OntologiesEndpointV2 extends Endpoint { diff --git a/src/api/v2/project-metadata/metadata-endpoint-v2.ts b/src/api/v2/project-metadata/metadata-endpoint-v2.ts index f12a8da31..6112f8af3 100644 --- a/src/api/v2/project-metadata/metadata-endpoint-v2.ts +++ b/src/api/v2/project-metadata/metadata-endpoint-v2.ts @@ -13,7 +13,9 @@ declare let require: any; // http://stackoverflow.com/questions/34730010/angular const jsonld = require("jsonld/dist/jsonld.js"); /** - * Handles requests to the metadata route of the Knora API + * Handles requests to the metadata route of the Knora API. + * + * @category Endpoint V2 */ export class ProjectMetadataEndpointV2 extends Endpoint { diff --git a/src/api/v2/resource/resources-endpoint-v2.ts b/src/api/v2/resource/resources-endpoint-v2.ts index b5107bb28..ce217bf16 100644 --- a/src/api/v2/resource/resources-endpoint-v2.ts +++ b/src/api/v2/resource/resources-endpoint-v2.ts @@ -19,9 +19,17 @@ const jsonld = require("jsonld/dist/jsonld.js"); /** * Handles requests to the resources route of the Knora API. + * + * @category Endpoint V2 */ export class ResourcesEndpointV2 extends Endpoint { + /** + * @category Internal + * @param knoraApiConfig the config object. + * @param path this endpoint's base path. + * @param v2Endpoint a reference to the v2 endpoint. + */ constructor(protected readonly knoraApiConfig: KnoraApiConfig, protected readonly path: string, private readonly v2Endpoint: V2Endpoint) { super(knoraApiConfig, path); } diff --git a/src/api/v2/search/search-endpoint-v2.ts b/src/api/v2/search/search-endpoint-v2.ts index 318cbbcf8..9b46ec844 100644 --- a/src/api/v2/search/search-endpoint-v2.ts +++ b/src/api/v2/search/search-endpoint-v2.ts @@ -16,6 +16,8 @@ const jsonld = require("jsonld/dist/jsonld.js"); /** * Handles requests to the search route of the Knora API. + * + * @category Endpoint V2 */ export class SearchEndpointV2 extends Endpoint { diff --git a/src/api/v2/v2-endpoint.ts b/src/api/v2/v2-endpoint.ts index eaa39ca7e..927aef773 100644 --- a/src/api/v2/v2-endpoint.ts +++ b/src/api/v2/v2-endpoint.ts @@ -12,18 +12,20 @@ import { ValuesEndpointV2 } from "./values/values-endpoint-v2"; /** * Defines the V2 endpoint of the Knora API. + * + * @category Endpoint V2 */ export class V2Endpoint extends Endpoint { - static readonly PATH_AUTHENTICATION = "/authentication"; + private static readonly PATH_AUTHENTICATION = "/authentication"; - static readonly PATH_ONTOLOGIES = "/ontologies"; + private static readonly PATH_ONTOLOGIES = "/ontologies"; - static readonly PATH_RESOURCES = "/resources"; + private static readonly PATH_RESOURCES = "/resources"; - static readonly PATH_VALUES = "/values"; + private static readonly PATH_VALUES = "/values"; - static readonly PATH_METADATA = "/metadata"; + private static readonly PATH_METADATA = "/metadata"; readonly auth: AuthenticationEndpointV2; @@ -44,10 +46,12 @@ export class V2Endpoint extends Endpoint { readonly metadata: ProjectMetadataEndpointV2; /** - * Constructor. * Sets up all endpoints for this endpoint. - * @param knoraApiConfig - * @param path + * + * @param knoraApiConfig the configuration for the DSP-API instance to connect to. + * @param path this endpoint's path segment. + * + * @category Internal */ constructor(protected readonly knoraApiConfig: KnoraApiConfig, protected readonly path: string) { diff --git a/src/api/v2/values/values-endpoint-v2.ts b/src/api/v2/values/values-endpoint-v2.ts index 4d6951e96..2fa2cc5f2 100644 --- a/src/api/v2/values/values-endpoint-v2.ts +++ b/src/api/v2/values/values-endpoint-v2.ts @@ -21,9 +21,17 @@ const jsonld = require("jsonld/dist/jsonld.js"); /** * Handles requests to the values route of the Knora API. + * + * @category Endpoint V2 */ export class ValuesEndpointV2 extends Endpoint { + /** + * @category Internal + * @param knoraApiConfig the config object. + * @param path this endpoint's base path. + * @param v2Endpoint a reference to the v2 endpoint. + */ constructor(protected readonly knoraApiConfig: KnoraApiConfig, protected readonly path: string, private readonly v2Endpoint: V2Endpoint) { super(knoraApiConfig, path); } diff --git a/src/cache/GenericCache.ts b/src/cache/GenericCache.ts index 60388d008..7a51449fe 100644 --- a/src/cache/GenericCache.ts +++ b/src/cache/GenericCache.ts @@ -5,8 +5,9 @@ import { take } from "rxjs/operators"; * Generic cache class. * Fetches information of a specific type from Knora once and caches it. * Fetches also dependencies of a requested element (non-blocking). - * * Works also with multiple async requests for the same key, also if not cached yet. + * + * @category Internal */ export abstract class GenericCache { diff --git a/src/cache/ontology-cache/resource-class-and-property-definitions.ts b/src/cache/ontology-cache/resource-class-and-property-definitions.ts index fbe5d7031..67b48e63f 100644 --- a/src/cache/ontology-cache/resource-class-and-property-definitions.ts +++ b/src/cache/ontology-cache/resource-class-and-property-definitions.ts @@ -5,6 +5,8 @@ import { ResourceClassDefinitionWithPropertyDefinition } from "./resource-class- /** * Represents resource class definitions * and property definitions the resource classes have cardinalities for. + * + * @category Model V2 */ export class ResourceClassAndPropertyDefinitions { diff --git a/src/cache/ontology-cache/resource-class-definition-with-property-definition.ts b/src/cache/ontology-cache/resource-class-definition-with-property-definition.ts index 7fe3487bf..109c9a3d7 100644 --- a/src/cache/ontology-cache/resource-class-definition-with-property-definition.ts +++ b/src/cache/ontology-cache/resource-class-definition-with-property-definition.ts @@ -6,6 +6,8 @@ import { SystemPropertyDefinition } from "../../models/v2/ontologies/system-prop /** * Represents a resource class definition containing all property definitions it has cardinalities for. + * + * @category Model V2 */ export class ResourceClassDefinitionWithPropertyDefinition extends ResourceClassDefinition { @@ -67,6 +69,8 @@ export class ResourceClassDefinitionWithPropertyDefinition extends ResourceClass /** * Represents a property defined on a resource class * including the property definition. + * + * @category Model V2 */ export interface IHasPropertyWithPropertyDefinition extends IHasProperty { diff --git a/src/interfaces/models/admin/i-permissions.ts b/src/interfaces/models/admin/i-permissions.ts index d54ba0507..15b869719 100644 --- a/src/interfaces/models/admin/i-permissions.ts +++ b/src/interfaces/models/admin/i-permissions.ts @@ -1,3 +1,6 @@ +/** + * @category Model Admin + */ export interface IPermissions { groupsPerProject: any; administrativePermissionsPerProject: any; diff --git a/src/interfaces/models/v2/i-fulltext-search-params.ts b/src/interfaces/models/v2/i-fulltext-search-params.ts index e59014b1c..9d1499d1d 100644 --- a/src/interfaces/models/v2/i-fulltext-search-params.ts +++ b/src/interfaces/models/v2/i-fulltext-search-params.ts @@ -1,5 +1,6 @@ /** * Params for fulltext search. + * @category Model V2 */ export interface IFulltextSearchParams { diff --git a/src/interfaces/models/v2/i-label-search-params.ts b/src/interfaces/models/v2/i-label-search-params.ts index 753a0684f..abcf38b39 100644 --- a/src/interfaces/models/v2/i-label-search-params.ts +++ b/src/interfaces/models/v2/i-label-search-params.ts @@ -1,5 +1,7 @@ /** * Params for search by label + * + * @category Model V2 */ export interface ILabelSearchParams { diff --git a/src/interfaces/models/v2/i-login-response.ts b/src/interfaces/models/v2/i-login-response.ts index e2fac3f2d..f73dd903a 100644 --- a/src/interfaces/models/v2/i-login-response.ts +++ b/src/interfaces/models/v2/i-login-response.ts @@ -1,3 +1,6 @@ +/** + * @category Model Admin + */ export interface ILoginResponse { token: string; } diff --git a/src/interfaces/models/v2/i-logout-response.ts b/src/interfaces/models/v2/i-logout-response.ts index 197b94b19..7cea05bf9 100644 --- a/src/interfaces/models/v2/i-logout-response.ts +++ b/src/interfaces/models/v2/i-logout-response.ts @@ -1,3 +1,6 @@ +/** + * @category Model Admin + */ export interface ILogoutResponse { message: string; status: number; diff --git a/src/knora-api-config.ts b/src/knora-api-config.ts index 37863a145..aaf226077 100644 --- a/src/knora-api-config.ts +++ b/src/knora-api-config.ts @@ -1,28 +1,16 @@ /** - * Contains the configuration that can be used in the KnoraApiConnection. + * Configuration to instantiate a `KnoraApiConnection`. + * + * @category Config */ export class KnoraApiConfig { - /////////////// - // CONSTANTS // - /////////////// - - // - static readonly PROTOCOL_HTTP = "http"; static readonly PROTOCOL_HTTPS = "https"; static readonly DEFAULT_PORT_HTTP = 80; static readonly DEFAULT_PORT_HTTPS = 443; - // - - //////////////// - // PROPERTIES // - //////////////// - - // - /** * The full API URL */ @@ -34,20 +22,11 @@ export class KnoraApiConfig { ); } - // - - ///////////////// - // CONSTRUCTOR // - ///////////////// - - // - /** - * Constructor. - * @param apiProtocol the protocol of the API (http/https) - * @param apiHost the API base URL - * @param apiPort the port of the Knora API - * @param apiPath the base path following + * @param apiProtocol the protocol of the API (http or https) + * @param apiHost the DSP-API base URL + * @param apiPort the port of DSP-API + * @param apiPath the base path following host and port, if any. * @param jsonWebToken token to identify the user * @param logErrors determines whether errors should be logged to the console */ @@ -66,14 +45,4 @@ export class KnoraApiConfig { } } - - // - - ///////////// - // METHODS // - ///////////// - - // - // - } diff --git a/src/knora-api-connection.ts b/src/knora-api-connection.ts index efd70ceb8..827eed296 100644 --- a/src/knora-api-connection.ts +++ b/src/knora-api-connection.ts @@ -4,7 +4,9 @@ import { V2Endpoint } from "./api/v2/v2-endpoint"; import { KnoraApiConfig } from "./knora-api-config"; /** - * Offers methods for JavaScript developers to interact with the Knora API. + * Contains endpoints to interact with DSP-API. + * + * @category Config */ export class KnoraApiConnection { @@ -28,9 +30,9 @@ export class KnoraApiConnection { readonly v2: V2Endpoint; /** - * Constructor. - * Sets up all endpoints for the Knora API. - * @param knoraApiConfig + * Sets up all endpoints. + * + * @param knoraApiConfig the configuration for the DSP-API instance to connect to. */ constructor(knoraApiConfig: KnoraApiConfig) { diff --git a/src/models/admin/admin-doap-base.ts b/src/models/admin/admin-doap-base.ts index 8643512aa..7af9a1370 100644 --- a/src/models/admin/admin-doap-base.ts +++ b/src/models/admin/admin-doap-base.ts @@ -1,6 +1,9 @@ import { JsonObject, JsonProperty } from "json2typescript"; import { Permission } from "./permission"; +/** + * @category Internal + */ @JsonObject("AdminDoapBase") export abstract class AdminDoapBase { diff --git a/src/models/admin/administrative-permission-response.ts b/src/models/admin/administrative-permission-response.ts index be50f6678..e580958d1 100755 --- a/src/models/admin/administrative-permission-response.ts +++ b/src/models/admin/administrative-permission-response.ts @@ -4,6 +4,8 @@ import { AdministrativePermission } from "./administrative-permission"; /** * A response providing a single administrative permission. + * + * @category Model Admin */ @JsonObject("AdministrativePermissionResponse") export class AdministrativePermissionResponse { diff --git a/src/models/admin/administrative-permission.ts b/src/models/admin/administrative-permission.ts index 9d7af4a7e..e5f7e4a28 100755 --- a/src/models/admin/administrative-permission.ts +++ b/src/models/admin/administrative-permission.ts @@ -3,6 +3,8 @@ import { AdminDoapBase } from "./admin-doap-base"; /** * An administrative permission. + * + * @category Model Admin */ @JsonObject("AdministrativePermission") export class AdministrativePermission extends AdminDoapBase { diff --git a/src/models/admin/administrative-permissions-response.ts b/src/models/admin/administrative-permissions-response.ts index 6511d369a..2418415fb 100644 --- a/src/models/admin/administrative-permissions-response.ts +++ b/src/models/admin/administrative-permissions-response.ts @@ -3,6 +3,8 @@ import { AdministrativePermission } from "./administrative-permission"; /** * A response providing all administrative permissions. + * + * @category Model Admin */ @JsonObject("AdministrativePermissionsResponse") export class AdministrativePermissionsResponse { diff --git a/src/models/admin/create-admin-doap-base.ts b/src/models/admin/create-admin-doap-base.ts index d4dbdba09..ccc04b3f6 100644 --- a/src/models/admin/create-admin-doap-base.ts +++ b/src/models/admin/create-admin-doap-base.ts @@ -1,6 +1,9 @@ import { JsonObject, JsonProperty } from "json2typescript"; import { CreatePermission } from "./create-permission"; +/** + * @category Internal + */ @JsonObject("CreateAdminDoapBase") export abstract class CreateAdminDoapBase { diff --git a/src/models/admin/create-administrative-permission.ts b/src/models/admin/create-administrative-permission.ts index 1c1cbbe5f..50b354a10 100644 --- a/src/models/admin/create-administrative-permission.ts +++ b/src/models/admin/create-administrative-permission.ts @@ -1,9 +1,10 @@ import { JsonObject, JsonProperty } from "json2typescript"; import { CreateAdminDoapBase } from "./create-admin-doap-base"; -import { CreatePermission } from "./create-permission"; /** * Creation of an administrative permission. + * + * @category Model Admin */ @JsonObject("CreateAdministrativePermission") export class CreateAdministrativePermission extends CreateAdminDoapBase { diff --git a/src/models/admin/create-child-node-request.ts b/src/models/admin/create-child-node-request.ts index 4c3fc4249..ef1f48f08 100755 --- a/src/models/admin/create-child-node-request.ts +++ b/src/models/admin/create-child-node-request.ts @@ -4,6 +4,8 @@ import { StringLiteral } from "./string-literal"; /** * A request to create a child node in a list. + * + * @category Model Admin */ @JsonObject("CreateChildNodeRequest") export class CreateChildNodeRequest { @@ -38,4 +40,4 @@ export class CreateChildNodeRequest { @JsonProperty("projectIri", String) projectIri: string = ""; -} \ No newline at end of file +} diff --git a/src/models/admin/create-default-object-access-permission.ts b/src/models/admin/create-default-object-access-permission.ts index 6a48c9a36..962ac983c 100644 --- a/src/models/admin/create-default-object-access-permission.ts +++ b/src/models/admin/create-default-object-access-permission.ts @@ -3,6 +3,8 @@ import { CreateAdminDoapBase } from "./create-admin-doap-base"; /** * Creation of a default object access permission permission. + * + * @category Model Admin */ @JsonObject("CreateDefaultObjectAccessPermission") export class CreateDefaultObjectAccessPermission extends CreateAdminDoapBase { diff --git a/src/models/admin/create-group-request.ts b/src/models/admin/create-group-request.ts index f52aeaf0a..a9530d34f 100755 --- a/src/models/admin/create-group-request.ts +++ b/src/models/admin/create-group-request.ts @@ -2,6 +2,8 @@ import { JsonObject, JsonProperty } from "json2typescript"; /** * A request to create a group. + * + * @category Model Admin */ @JsonObject("CreateGroupRequest") export class CreateGroupRequest { diff --git a/src/models/admin/create-list-request.ts b/src/models/admin/create-list-request.ts index 041865e9d..1672017ce 100755 --- a/src/models/admin/create-list-request.ts +++ b/src/models/admin/create-list-request.ts @@ -4,6 +4,8 @@ import { StringLiteral } from "./string-literal"; /** * A request to create a list. + * + * @category Model Admin */ @JsonObject("CreateListRequest") export class CreateListRequest { @@ -32,4 +34,4 @@ export class CreateListRequest { @JsonProperty("projectIri", String) projectIri: string = ""; -} \ No newline at end of file +} diff --git a/src/models/admin/create-permission.ts b/src/models/admin/create-permission.ts index ca9d20afc..5c0eb85f6 100644 --- a/src/models/admin/create-permission.ts +++ b/src/models/admin/create-permission.ts @@ -2,6 +2,8 @@ import { JsonObject, JsonProperty } from "json2typescript"; /** * Creation of a permission. + * + * @category Model Admin */ @JsonObject("CreatePermission") export class CreatePermission { diff --git a/src/models/admin/custom-converters/administrative-permissions-per-project-converter.ts b/src/models/admin/custom-converters/administrative-permissions-per-project-converter.ts index f52c36c52..7d4682695 100644 --- a/src/models/admin/custom-converters/administrative-permissions-per-project-converter.ts +++ b/src/models/admin/custom-converters/administrative-permissions-per-project-converter.ts @@ -3,6 +3,9 @@ import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-c import { Permission } from "../permission"; +/** + * @category Internal + */ @JsonConverter export class AdministrativePermissionsPerProjectConverter implements JsonCustomConvert<{ [key: string]: Permission[] }> { diff --git a/src/models/admin/custom-converters/groups-per-project-converter.ts b/src/models/admin/custom-converters/groups-per-project-converter.ts index fc1e661f8..cfa42f2a6 100644 --- a/src/models/admin/custom-converters/groups-per-project-converter.ts +++ b/src/models/admin/custom-converters/groups-per-project-converter.ts @@ -1,6 +1,9 @@ import { JsonConverter, JsonCustomConvert } from "json2typescript"; import { CustomConverterUtils } from "../../../util/utils"; +/** + * @category Internal + */ @JsonConverter export class GroupsPerProjectConverter implements JsonCustomConvert<{ [key: string]: string[] }> { serialize(groups: { [key: string]: string[] }): any { diff --git a/src/models/admin/default-object-access-permission-response.ts b/src/models/admin/default-object-access-permission-response.ts index 501e64721..bbd9ed4ee 100644 --- a/src/models/admin/default-object-access-permission-response.ts +++ b/src/models/admin/default-object-access-permission-response.ts @@ -3,6 +3,8 @@ import { DefaultObjectAccessPermission } from "./default-object-access-permissio /** * Represents a project's default object access permissions. + * + * @category Model Admin */ @JsonObject("DefaultObjectAccessPermissionResponse") export class DefaultObjectAccessPermissionResponse { diff --git a/src/models/admin/default-object-access-permission.ts b/src/models/admin/default-object-access-permission.ts index 08f9452bf..78dd55a0f 100644 --- a/src/models/admin/default-object-access-permission.ts +++ b/src/models/admin/default-object-access-permission.ts @@ -1,6 +1,9 @@ import { JsonObject, JsonProperty } from "json2typescript"; import { AdminDoapBase } from "./admin-doap-base"; +/** + * @category Model Admin + */ @JsonObject("DefaultObjectAccessPermission") export class DefaultObjectAccessPermission extends AdminDoapBase { diff --git a/src/models/admin/default-object-access-permissions-response.ts b/src/models/admin/default-object-access-permissions-response.ts index 6a68fa313..bdb3fae50 100644 --- a/src/models/admin/default-object-access-permissions-response.ts +++ b/src/models/admin/default-object-access-permissions-response.ts @@ -3,6 +3,8 @@ import { DefaultObjectAccessPermission } from "./default-object-access-permissio /** * Represents a project's default object access permissions. + * + * @category Model Admin */ @JsonObject("DefaultObjectAccessPermissionsResponse") export class DefaultObjectAccessPermissionsResponse { diff --git a/src/models/admin/group-response.ts b/src/models/admin/group-response.ts index e607baa97..8e556ef6c 100755 --- a/src/models/admin/group-response.ts +++ b/src/models/admin/group-response.ts @@ -4,6 +4,8 @@ import { ReadGroup } from "./read-group"; /** * A response providing a single group. + * + * @category Model Admin */ @JsonObject("GroupResponse") export class GroupResponse { @@ -14,4 +16,4 @@ export class GroupResponse { @JsonProperty("group", ReadGroup) group: ReadGroup = new ReadGroup(); -} \ No newline at end of file +} diff --git a/src/models/admin/group.ts b/src/models/admin/group.ts index 8752f955c..76e3455dc 100755 --- a/src/models/admin/group.ts +++ b/src/models/admin/group.ts @@ -2,6 +2,8 @@ import { JsonObject, JsonProperty } from "json2typescript"; /** * A group of Knora users. + * + * @category Model Admin */ @JsonObject("Group") export class Group { diff --git a/src/models/admin/groups-response.ts b/src/models/admin/groups-response.ts index 5f978db32..271d345b3 100755 --- a/src/models/admin/groups-response.ts +++ b/src/models/admin/groups-response.ts @@ -4,6 +4,8 @@ import { ReadGroup } from "./read-group"; /** * A response providing a collection of groups. + * + * @category Model Admin */ @JsonObject("GroupsResponse") export class GroupsResponse { diff --git a/src/models/admin/keywords-response.ts b/src/models/admin/keywords-response.ts index 636dd137b..3336d7c10 100755 --- a/src/models/admin/keywords-response.ts +++ b/src/models/admin/keywords-response.ts @@ -2,6 +2,8 @@ import { JsonObject, JsonProperty } from "json2typescript"; /** * A response providing project keywords. + * + * @category Model Admin */ @JsonObject("KeywordsResponse") export class KeywordsResponse { diff --git a/src/models/admin/list-info-response.ts b/src/models/admin/list-info-response.ts index 8c835f4cc..69c29e768 100755 --- a/src/models/admin/list-info-response.ts +++ b/src/models/admin/list-info-response.ts @@ -4,6 +4,8 @@ import { ListNodeInfo } from "./list-node-info"; /** * A response containing information about a list. + * + * @category Model Admin */ @JsonObject("ListInfoResponse") export class ListInfoResponse { @@ -14,4 +16,4 @@ export class ListInfoResponse { @JsonProperty("listinfo", ListNodeInfo) listinfo: ListNodeInfo = new ListNodeInfo(); -} \ No newline at end of file +} diff --git a/src/models/admin/list-node-info-response.ts b/src/models/admin/list-node-info-response.ts index 1ae057e04..5e52c5280 100755 --- a/src/models/admin/list-node-info-response.ts +++ b/src/models/admin/list-node-info-response.ts @@ -4,6 +4,8 @@ import { ListNodeInfo } from "./list-node-info"; /** * A response containing information about a list node. + * + * @category Model Admin */ @JsonObject("ListNodeInfoResponse") export class ListNodeInfoResponse { @@ -14,4 +16,4 @@ export class ListNodeInfoResponse { @JsonProperty("nodeinfo", ListNodeInfo) nodeinfo: ListNodeInfo = new ListNodeInfo(); -} \ No newline at end of file +} diff --git a/src/models/admin/list-node-info.ts b/src/models/admin/list-node-info.ts index b9885730e..b75a87f53 100755 --- a/src/models/admin/list-node-info.ts +++ b/src/models/admin/list-node-info.ts @@ -4,6 +4,8 @@ import { StringLiteral } from "./string-literal"; /** * Information about a list node. + * + * @category Model Admin */ @JsonObject("ListNodeInfo") export class ListNodeInfo { @@ -56,4 +58,4 @@ export class ListNodeInfo { @JsonProperty("projectIri", String, true) projectIri?: string = undefined; -} \ No newline at end of file +} diff --git a/src/models/admin/list-node.ts b/src/models/admin/list-node.ts index 19866145f..8ff0f83e7 100755 --- a/src/models/admin/list-node.ts +++ b/src/models/admin/list-node.ts @@ -4,6 +4,8 @@ import { StringLiteral } from "./string-literal"; /** * A list node. + * + * @category Model Admin */ @JsonObject("ListNode") export class ListNode { @@ -62,4 +64,4 @@ export class ListNode { @JsonProperty("projectIri", String, true) projectIri?: string = undefined; -} \ No newline at end of file +} diff --git a/src/models/admin/list-response.ts b/src/models/admin/list-response.ts index 0a678dd7d..dd24c05f4 100755 --- a/src/models/admin/list-response.ts +++ b/src/models/admin/list-response.ts @@ -4,6 +4,8 @@ import { List } from "./list"; /** * A response containing a list. + * + * @category Model Admin */ @JsonObject("ListResponse") export class ListResponse { @@ -14,4 +16,4 @@ export class ListResponse { @JsonProperty("list", List) list: List = new List(); -} \ No newline at end of file +} diff --git a/src/models/admin/list.ts b/src/models/admin/list.ts index 44c235015..d2cc54ba2 100755 --- a/src/models/admin/list.ts +++ b/src/models/admin/list.ts @@ -5,6 +5,8 @@ import { ListNodeInfo } from "./list-node-info"; /** * Represents a list. + * + * @category Model Admin */ @JsonObject("List") export class List { @@ -21,4 +23,4 @@ export class List { @JsonProperty("listinfo", ListNodeInfo) listinfo: ListNodeInfo = new ListNodeInfo(); -} \ No newline at end of file +} diff --git a/src/models/admin/lists-response.ts b/src/models/admin/lists-response.ts index 93da93bb1..f0a723bf7 100755 --- a/src/models/admin/lists-response.ts +++ b/src/models/admin/lists-response.ts @@ -4,6 +4,8 @@ import { ListNodeInfo } from "./list-node-info"; /** * A response providing a collection of lists. + * + * @category Model Admin */ @JsonObject("ListsResponse") export class ListsResponse { @@ -14,4 +16,4 @@ export class ListsResponse { @JsonProperty("lists", [ListNodeInfo]) lists: ListNodeInfo[] = []; -} \ No newline at end of file +} diff --git a/src/models/admin/members-response.ts b/src/models/admin/members-response.ts index c5f48f696..1bfde2c0e 100755 --- a/src/models/admin/members-response.ts +++ b/src/models/admin/members-response.ts @@ -4,6 +4,8 @@ import { ReadUser } from "./read-user"; /** * A response providing a collection of group or project members. + * + * @category Model Admin */ @JsonObject("MembersResponse") export class MembersResponse { diff --git a/src/models/admin/permission.ts b/src/models/admin/permission.ts index f30d52bb4..b074e4521 100755 --- a/src/models/admin/permission.ts +++ b/src/models/admin/permission.ts @@ -2,6 +2,8 @@ import { JsonObject, JsonProperty } from "json2typescript"; /** * A permission. + * + * @category Model Admin */ @JsonObject("Permission") export class Permission { diff --git a/src/models/admin/permissions-data.ts b/src/models/admin/permissions-data.ts index d08e52900..fe65d84c7 100644 --- a/src/models/admin/permissions-data.ts +++ b/src/models/admin/permissions-data.ts @@ -6,6 +6,8 @@ import { GroupsPerProjectConverter } from "./custom-converters/groups-per-projec /** * A user's permissions data. + * + * @category Model Admin */ @JsonObject("PermissionsData") export class PermissionsData { @@ -22,4 +24,4 @@ export class PermissionsData { @JsonProperty("groupsPerProject", GroupsPerProjectConverter, true) groupsPerProject?: { [key: string]: string[] } = undefined; -} \ No newline at end of file +} diff --git a/src/models/admin/permissions.ts b/src/models/admin/permissions.ts index 2ba46813f..ec7b48ca6 100644 --- a/src/models/admin/permissions.ts +++ b/src/models/admin/permissions.ts @@ -2,6 +2,9 @@ import { JsonObject, JsonProperty } from "json2typescript"; import { IPermissions } from "../../interfaces/models/admin/i-permissions"; +/** + * @category Model Admin + */ @JsonObject("Permissions") export class Permissions implements IPermissions { diff --git a/src/models/admin/project-permission.ts b/src/models/admin/project-permission.ts index 22036cf81..5aaf47321 100644 --- a/src/models/admin/project-permission.ts +++ b/src/models/admin/project-permission.ts @@ -2,6 +2,8 @@ import { JsonObject, JsonProperty } from "json2typescript"; /** * A permission belonging to a project. + * + * @category Model Admin */ @JsonObject("ProjectPermission") export class ProjectPermission { diff --git a/src/models/admin/project-permissions-response.ts b/src/models/admin/project-permissions-response.ts index e253a0886..64fd5a7e5 100644 --- a/src/models/admin/project-permissions-response.ts +++ b/src/models/admin/project-permissions-response.ts @@ -3,6 +3,8 @@ import { ProjectPermission } from "./project-permission"; /** * Represents a project's permissions. + * + * @category Model Admin */ @JsonObject("ProjectPermissionsResponse") export class ProjectPermissionsResponse { diff --git a/src/models/admin/project-response.ts b/src/models/admin/project-response.ts index 9b029ab2a..c58dc4a8d 100755 --- a/src/models/admin/project-response.ts +++ b/src/models/admin/project-response.ts @@ -4,6 +4,8 @@ import { ReadProject } from "./read-project"; /** * A response providing a single project. + * + * @category Model Admin */ @JsonObject("ProjectResponse") export class ProjectResponse { diff --git a/src/models/admin/project-restricted-view-settings-response.ts b/src/models/admin/project-restricted-view-settings-response.ts index 8d8064799..1737a6a3f 100755 --- a/src/models/admin/project-restricted-view-settings-response.ts +++ b/src/models/admin/project-restricted-view-settings-response.ts @@ -4,6 +4,8 @@ import { ProjectRestrictedViewSettings } from "./project-restricted-view-setting /** * A response providing a project's restricted view settings. + * + * @category Model Admin */ @JsonObject("ProjectRestrictedViewSettingsResponse") export class ProjectRestrictedViewSettingsResponse { diff --git a/src/models/admin/project-restricted-view-settings.ts b/src/models/admin/project-restricted-view-settings.ts index 917de3a1c..14e1f0da4 100755 --- a/src/models/admin/project-restricted-view-settings.ts +++ b/src/models/admin/project-restricted-view-settings.ts @@ -2,6 +2,8 @@ import { JsonObject, JsonProperty } from "json2typescript"; /** * A project's restricted view settings. + * + * @category Model Admin */ @JsonObject("ProjectRestrictedViewSettings") export class ProjectRestrictedViewSettings { diff --git a/src/models/admin/project.ts b/src/models/admin/project.ts index 2118b94e3..14c929c3b 100755 --- a/src/models/admin/project.ts +++ b/src/models/admin/project.ts @@ -4,6 +4,8 @@ import { StringLiteral } from "./string-literal"; /** * Represents a project that uses Knora. + * + * @category Model Admin */ @JsonObject("Project") export class Project { diff --git a/src/models/admin/projects-response.ts b/src/models/admin/projects-response.ts index 2a17726ea..b025d1045 100755 --- a/src/models/admin/projects-response.ts +++ b/src/models/admin/projects-response.ts @@ -4,6 +4,8 @@ import { ReadProject } from "./read-project"; /** * A response providing a collection of projects. + * + * @category Model Admin */ @JsonObject("ProjectsResponse") export class ProjectsResponse { diff --git a/src/models/admin/read-group.ts b/src/models/admin/read-group.ts index b407a5ca2..f135343f5 100755 --- a/src/models/admin/read-group.ts +++ b/src/models/admin/read-group.ts @@ -5,6 +5,8 @@ import { StoredProject } from "./stored-project"; /** * A group of Knora users. + * + * @category Model Admin */ @JsonObject("ReadGroup") export class ReadGroup extends StoredGroup { diff --git a/src/models/admin/read-project.ts b/src/models/admin/read-project.ts index 1faa7dee8..c9fcadf94 100755 --- a/src/models/admin/read-project.ts +++ b/src/models/admin/read-project.ts @@ -4,6 +4,8 @@ import { StoredProject } from "./stored-project"; /** * Represents a project that uses Knora. + * + * @category Model Admin */ @JsonObject("ReadProject") export class ReadProject extends StoredProject { diff --git a/src/models/admin/read-user.ts b/src/models/admin/read-user.ts index b28a942e8..11ceba111 100755 --- a/src/models/admin/read-user.ts +++ b/src/models/admin/read-user.ts @@ -7,6 +7,8 @@ import { StoredUser } from "./stored-user"; /** * Represents a Knora user. + * + * @category Model Admin */ @JsonObject("ReadUser") export class ReadUser extends StoredUser { @@ -41,4 +43,4 @@ export class ReadUser extends StoredUser { @JsonProperty("token", String, true) token?: string = undefined; -} \ No newline at end of file +} diff --git a/src/models/admin/stored-administrative-permission.ts b/src/models/admin/stored-administrative-permission.ts index 56e35d929..2ca6cca98 100755 --- a/src/models/admin/stored-administrative-permission.ts +++ b/src/models/admin/stored-administrative-permission.ts @@ -4,6 +4,8 @@ import { AdministrativePermission } from "./administrative-permission"; /** * An administrative permission. + * + * @category Model Admin */ @JsonObject("StoredAdministrativePermission") export class StoredAdministrativePermission extends AdministrativePermission { diff --git a/src/models/admin/stored-group.ts b/src/models/admin/stored-group.ts index 5183b8a3d..00460fc0a 100755 --- a/src/models/admin/stored-group.ts +++ b/src/models/admin/stored-group.ts @@ -4,6 +4,8 @@ import { Group } from "./group"; /** * A group of Knora users. + * + * @category Model Admin */ @JsonObject("StoredGroup") export class StoredGroup extends Group { diff --git a/src/models/admin/stored-list-node-info.ts b/src/models/admin/stored-list-node-info.ts index 29dd0550d..d639939d0 100755 --- a/src/models/admin/stored-list-node-info.ts +++ b/src/models/admin/stored-list-node-info.ts @@ -4,6 +4,8 @@ import { ListNodeInfo } from "./list-node-info"; /** * Information about a list node. + * + * @category Model Admin */ @JsonObject("StoredListNodeInfo") export class StoredListNodeInfo extends ListNodeInfo { @@ -14,4 +16,4 @@ export class StoredListNodeInfo extends ListNodeInfo { @JsonProperty("id", String) id: string = ""; -} \ No newline at end of file +} diff --git a/src/models/admin/stored-list-node.ts b/src/models/admin/stored-list-node.ts index bc4dde0b2..5aa57e28b 100755 --- a/src/models/admin/stored-list-node.ts +++ b/src/models/admin/stored-list-node.ts @@ -4,6 +4,8 @@ import { ListNode } from "./list-node"; /** * A list node. + * + * @category Model Admin */ @JsonObject("StoredListNode") export class StoredListNode extends ListNode { @@ -14,4 +16,4 @@ export class StoredListNode extends ListNode { @JsonProperty("id", String) id: string = ""; -} \ No newline at end of file +} diff --git a/src/models/admin/stored-project.ts b/src/models/admin/stored-project.ts index e7074940e..5334f400d 100755 --- a/src/models/admin/stored-project.ts +++ b/src/models/admin/stored-project.ts @@ -4,6 +4,8 @@ import { Project } from "./project"; /** * Represents a project that uses Knora. + * + * @category Model Admin */ @JsonObject("StoredProject") export class StoredProject extends Project { diff --git a/src/models/admin/stored-user.ts b/src/models/admin/stored-user.ts index 33b3f257a..bdb2554a8 100755 --- a/src/models/admin/stored-user.ts +++ b/src/models/admin/stored-user.ts @@ -4,6 +4,8 @@ import { User } from "./user"; /** * Represents a Knora user. + * + * @category Model Admin */ @JsonObject("StoredUser") export class StoredUser extends User { diff --git a/src/models/admin/string-literal.ts b/src/models/admin/string-literal.ts index 56a688381..ea5af456a 100755 --- a/src/models/admin/string-literal.ts +++ b/src/models/admin/string-literal.ts @@ -2,6 +2,8 @@ import { JsonObject, JsonProperty } from "json2typescript"; /** * A string with an optional language tag. + * + * @category Model Admin */ @JsonObject("StringLiteral") export class StringLiteral { diff --git a/src/models/admin/update-group-request.ts b/src/models/admin/update-group-request.ts index f3c2cf701..980937a34 100755 --- a/src/models/admin/update-group-request.ts +++ b/src/models/admin/update-group-request.ts @@ -2,6 +2,8 @@ import { JsonObject, JsonProperty } from "json2typescript"; /** * A request to update a group. + * + * @category Model Admin */ @JsonObject("UpdateGroupRequest") export class UpdateGroupRequest { diff --git a/src/models/admin/update-list-info-request.ts b/src/models/admin/update-list-info-request.ts index 85884fe56..8e53ffe48 100755 --- a/src/models/admin/update-list-info-request.ts +++ b/src/models/admin/update-list-info-request.ts @@ -4,6 +4,8 @@ import { StringLiteral } from "./string-literal"; /** * A request to update information about a list. + * + * @category Model Admin */ @JsonObject("UpdateListInfoRequest") export class UpdateListInfoRequest { @@ -32,4 +34,4 @@ export class UpdateListInfoRequest { @JsonProperty("projectIri", String, true) projectIri?: string = undefined; -} \ No newline at end of file +} diff --git a/src/models/admin/update-project-request.ts b/src/models/admin/update-project-request.ts index fe1167d47..d6b7d132f 100644 --- a/src/models/admin/update-project-request.ts +++ b/src/models/admin/update-project-request.ts @@ -4,6 +4,8 @@ import { StringLiteral } from "./string-literal"; /** * A request to update a project. + * + * @category Model Admin */ @JsonObject("UpdateProjectRequest") export class UpdateProjectRequest { @@ -50,4 +52,4 @@ export class UpdateProjectRequest { @JsonProperty("status", Boolean, true) status?: boolean = undefined; -} \ No newline at end of file +} diff --git a/src/models/admin/update-user-request.ts b/src/models/admin/update-user-request.ts index e48db0d74..2fea06d2e 100755 --- a/src/models/admin/update-user-request.ts +++ b/src/models/admin/update-user-request.ts @@ -2,6 +2,8 @@ import { JsonObject, JsonProperty } from "json2typescript"; /** * A request to update a user. + * + * @category Model Admin */ @JsonObject("UpdateUserRequest") export class UpdateUserRequest { diff --git a/src/models/admin/user-response.ts b/src/models/admin/user-response.ts index 7a0b38de3..2145a5dee 100755 --- a/src/models/admin/user-response.ts +++ b/src/models/admin/user-response.ts @@ -4,6 +4,8 @@ import { ReadUser } from "./read-user"; /** * A response providing a single user. + * + * @category Model Admin */ @JsonObject("UserResponse") export class UserResponse { diff --git a/src/models/admin/user.ts b/src/models/admin/user.ts index d60af1086..80e1e0405 100755 --- a/src/models/admin/user.ts +++ b/src/models/admin/user.ts @@ -2,6 +2,8 @@ import { JsonObject, JsonProperty } from "json2typescript"; /** * Represents a Knora user. + * + * @category Model Admin */ @JsonObject("User") export class User { diff --git a/src/models/admin/users-response.ts b/src/models/admin/users-response.ts index 2d137faa8..7862a253d 100755 --- a/src/models/admin/users-response.ts +++ b/src/models/admin/users-response.ts @@ -4,6 +4,8 @@ import { ReadUser } from "./read-user"; /** * A response providing a collection of users. + * + * @category Model Admin */ @JsonObject("UsersResponse") export class UsersResponse { diff --git a/src/models/api-response-data.ts b/src/models/api-response-data.ts index 69b79b267..62388017a 100644 --- a/src/models/api-response-data.ts +++ b/src/models/api-response-data.ts @@ -5,6 +5,9 @@ import { ApiResponse } from "./api-response"; import { ApiResponseError } from "./api-response-error"; import { DataError } from "./data-error"; +/** + * @category Response + */ export class ApiResponseData extends ApiResponse { /////////////// diff --git a/src/models/api-response-error.ts b/src/models/api-response-error.ts index 26cc183bc..195bc0fc1 100644 --- a/src/models/api-response-error.ts +++ b/src/models/api-response-error.ts @@ -3,6 +3,9 @@ import { AjaxError } from "rxjs/ajax"; import { ApiResponse } from "./api-response"; import { ApiResponseData } from "./api-response-data"; +/** + * @category Response + */ export class ApiResponseError extends ApiResponse { /////////////// diff --git a/src/models/api-response.ts b/src/models/api-response.ts index 6417c0fd6..74c97398c 100644 --- a/src/models/api-response.ts +++ b/src/models/api-response.ts @@ -1,3 +1,6 @@ +/** + * @category Response + */ export abstract class ApiResponse { /////////////// diff --git a/src/models/data-error.ts b/src/models/data-error.ts index dc62af436..ff5c904f0 100644 --- a/src/models/data-error.ts +++ b/src/models/data-error.ts @@ -2,6 +2,8 @@ import { ApiResponseError } from "./api-response-error"; /** * Generic error class for API responses where the format was incorrect. + * + * @category Response */ export class DataError extends Error { diff --git a/src/models/system/health-response.ts b/src/models/system/health-response.ts index eea1583f6..625da0bd0 100644 --- a/src/models/system/health-response.ts +++ b/src/models/system/health-response.ts @@ -2,6 +2,8 @@ import { JsonObject, JsonProperty } from "json2typescript"; /** * Represents Knora's state of health. + * + * @category Model System */ @JsonObject("HealthResponse") export class HealthResponse { diff --git a/src/models/v2/authentication/credentials-response.ts b/src/models/v2/authentication/credentials-response.ts index e82c5f063..b511ae833 100644 --- a/src/models/v2/authentication/credentials-response.ts +++ b/src/models/v2/authentication/credentials-response.ts @@ -1,5 +1,8 @@ import { JsonObject, JsonProperty } from "json2typescript"; +/** + * @category Model V2 + */ @JsonObject("CredentialsResponse") export class CredentialsResponse { diff --git a/src/models/v2/authentication/login-response.ts b/src/models/v2/authentication/login-response.ts index c180d9cfd..15987800e 100644 --- a/src/models/v2/authentication/login-response.ts +++ b/src/models/v2/authentication/login-response.ts @@ -1,6 +1,9 @@ import { JsonObject, JsonProperty } from "json2typescript"; import { ILoginResponse } from "../../../interfaces/models/v2/i-login-response"; +/** + * @category Model V2 + */ @JsonObject("LoginResponse") export class LoginResponse implements ILoginResponse { diff --git a/src/models/v2/authentication/logout-response.ts b/src/models/v2/authentication/logout-response.ts index 43435bf2f..d66f6d697 100644 --- a/src/models/v2/authentication/logout-response.ts +++ b/src/models/v2/authentication/logout-response.ts @@ -1,6 +1,9 @@ import { JsonObject, JsonProperty } from "json2typescript"; import { ILogoutResponse } from "../../../interfaces/models/v2/i-logout-response"; +/** + * @category Model V2 + */ @JsonObject("LogoutResponse") export class LogoutResponse implements ILogoutResponse { diff --git a/src/models/v2/custom-converters/date-time-stamp-converter.ts b/src/models/v2/custom-converters/date-time-stamp-converter.ts index 3adbc841d..083447868 100644 --- a/src/models/v2/custom-converters/date-time-stamp-converter.ts +++ b/src/models/v2/custom-converters/date-time-stamp-converter.ts @@ -2,6 +2,9 @@ import { JsonConverter, JsonCustomConvert } from "json2typescript"; import { CustomConverterUtils } from "../../../util/utils"; import { Constants } from "../Constants"; +/** + * @category Internal + */ @JsonConverter export class DateTimeStampConverter implements JsonCustomConvert { serialize(dateTimeStamp: string): any { diff --git a/src/models/v2/custom-converters/decimal-converter.ts b/src/models/v2/custom-converters/decimal-converter.ts index f14c3b30e..eb9c3d9a6 100644 --- a/src/models/v2/custom-converters/decimal-converter.ts +++ b/src/models/v2/custom-converters/decimal-converter.ts @@ -2,6 +2,9 @@ import { JsonConverter, JsonCustomConvert } from "json2typescript"; import { Constants } from "../Constants"; import { CustomConverterUtils } from "../../../util/utils"; +/** + * @category Internal + */ @JsonConverter export class DecimalConverter implements JsonCustomConvert { serialize(decimal: number): any { diff --git a/src/models/v2/custom-converters/gui-attribute-converter.ts b/src/models/v2/custom-converters/gui-attribute-converter.ts index 807fdaa4e..348a3b8eb 100644 --- a/src/models/v2/custom-converters/gui-attribute-converter.ts +++ b/src/models/v2/custom-converters/gui-attribute-converter.ts @@ -1,5 +1,8 @@ import { JsonConverter, JsonCustomConvert } from "json2typescript"; +/** + * @category Internal + */ @JsonConverter export class GuiAttributeConverter implements JsonCustomConvert { @@ -18,4 +21,4 @@ export class GuiAttributeConverter implements JsonCustomConvert { return guiAttributes; } -} \ No newline at end of file +} diff --git a/src/models/v2/custom-converters/has-cardinality-for-property-converter.ts b/src/models/v2/custom-converters/has-cardinality-for-property-converter.ts index f643dc267..7fbf4b8bb 100644 --- a/src/models/v2/custom-converters/has-cardinality-for-property-converter.ts +++ b/src/models/v2/custom-converters/has-cardinality-for-property-converter.ts @@ -3,6 +3,9 @@ import { CustomConverterUtils } from "../../../util/utils"; import { Constants } from "../Constants"; import { Cardinality, IHasProperty } from "../ontologies/class-definition"; +/** + * @category Internal + */ @JsonConverter export class HasCardinalityForPropertyConverter implements JsonCustomConvert { serialize(cardinalities: IHasProperty[]): any { diff --git a/src/models/v2/custom-converters/id-converter.ts b/src/models/v2/custom-converters/id-converter.ts index 54927d872..da7d23a5a 100644 --- a/src/models/v2/custom-converters/id-converter.ts +++ b/src/models/v2/custom-converters/id-converter.ts @@ -1,6 +1,9 @@ import { JsonConverter, JsonCustomConvert } from "json2typescript"; import { CustomConverterUtils } from "../../../util/utils"; +/** + * @category Internal + */ @JsonConverter export class IdConverter implements JsonCustomConvert { serialize(id: string): any { diff --git a/src/models/v2/custom-converters/string-literal-to-string-converter.ts b/src/models/v2/custom-converters/string-literal-to-string-converter.ts index 9fed15357..ad1b719dc 100644 --- a/src/models/v2/custom-converters/string-literal-to-string-converter.ts +++ b/src/models/v2/custom-converters/string-literal-to-string-converter.ts @@ -2,6 +2,9 @@ import { JsonConvert, JsonConverter, JsonCustomConvert, OperationMode, ValueChec import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-convert-enums"; import { StringLiteralV2 } from "../string-literal-v2"; +/** + * @category Internal + */ @JsonConverter export class StringLiteralToStringConverter implements JsonCustomConvert { diff --git a/src/models/v2/custom-converters/string-literal-to-string-literal-array-converter.ts b/src/models/v2/custom-converters/string-literal-to-string-literal-array-converter.ts index 4ee398ed9..396ef28a0 100644 --- a/src/models/v2/custom-converters/string-literal-to-string-literal-array-converter.ts +++ b/src/models/v2/custom-converters/string-literal-to-string-literal-array-converter.ts @@ -2,6 +2,9 @@ import { JsonConvert, JsonConverter, JsonCustomConvert, OperationMode, ValueChec import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-convert-enums"; import { StringLiteralV2 } from "../string-literal-v2"; +/** + * @category Internal + */ @JsonConverter export class StringLiteralToStringLiteralArrayConverter implements JsonCustomConvert { diff --git a/src/models/v2/custom-converters/subclass-of-converter.ts b/src/models/v2/custom-converters/subclass-of-converter.ts index ef913aad8..cc223be8b 100644 --- a/src/models/v2/custom-converters/subclass-of-converter.ts +++ b/src/models/v2/custom-converters/subclass-of-converter.ts @@ -1,6 +1,9 @@ import { JsonConverter, JsonCustomConvert } from "json2typescript"; import { CustomConverterUtils } from "../../../util/utils"; +/** + * @category Internal + */ @JsonConverter export class SubClassOfConverter implements JsonCustomConvert { diff --git a/src/models/v2/custom-converters/subproperty-of-converter.ts b/src/models/v2/custom-converters/subproperty-of-converter.ts index 76649506d..80fecf362 100644 --- a/src/models/v2/custom-converters/subproperty-of-converter.ts +++ b/src/models/v2/custom-converters/subproperty-of-converter.ts @@ -1,6 +1,9 @@ import { JsonConverter, JsonCustomConvert } from "json2typescript"; import { CustomConverterUtils } from "../../../util/utils"; +/** + * @category Internal + */ @JsonConverter export class SubPropertyOfConverter implements JsonCustomConvert { serialize(subproperties: string[]): any { diff --git a/src/models/v2/custom-converters/uri-converter.ts b/src/models/v2/custom-converters/uri-converter.ts index fd7028437..82c6d0a0c 100644 --- a/src/models/v2/custom-converters/uri-converter.ts +++ b/src/models/v2/custom-converters/uri-converter.ts @@ -2,6 +2,9 @@ import { JsonConverter, JsonCustomConvert } from "json2typescript"; import { CustomConverterUtils } from "../../../util/utils"; import { Constants } from "../Constants"; +/** + * @category Internal + */ @JsonConverter export class UriConverter implements JsonCustomConvert { serialize(uri: string): any { diff --git a/src/models/v2/lists/list-conversion-util.ts b/src/models/v2/lists/list-conversion-util.ts index c9ed198e5..f6a6d6ac4 100644 --- a/src/models/v2/lists/list-conversion-util.ts +++ b/src/models/v2/lists/list-conversion-util.ts @@ -1,5 +1,8 @@ import { ListNodeV2 } from "./list-node-v2"; +/** + * @category Internal + */ export namespace ListConversionUtil { /** diff --git a/src/models/v2/lists/list-node-v2.ts b/src/models/v2/lists/list-node-v2.ts index 7135331cf..77e573689 100644 --- a/src/models/v2/lists/list-node-v2.ts +++ b/src/models/v2/lists/list-node-v2.ts @@ -11,6 +11,9 @@ import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-c import { Constants } from "../Constants"; import { IdConverter } from "../custom-converters/id-converter"; +/** + * @category Internal + */ @JsonConverter export class SubListNodeConverter implements JsonCustomConvert { @@ -41,6 +44,9 @@ export class SubListNodeConverter implements JsonCustomConvert { } } +/** + * @category Model V2 + */ @JsonObject("ListNode") export class ListNodeV2 { diff --git a/src/models/v2/ontologies/EntityDefinition.ts b/src/models/v2/ontologies/EntityDefinition.ts index 3555f3ac5..9991e675e 100644 --- a/src/models/v2/ontologies/EntityDefinition.ts +++ b/src/models/v2/ontologies/EntityDefinition.ts @@ -1,3 +1,6 @@ +/** + * @category Internal + */ export abstract class EntityDefinition { abstract id: string; diff --git a/src/models/v2/ontologies/OntologyConversionUtil.ts b/src/models/v2/ontologies/OntologyConversionUtil.ts index 4070d50da..86e5c6007 100644 --- a/src/models/v2/ontologies/OntologyConversionUtil.ts +++ b/src/models/v2/ontologies/OntologyConversionUtil.ts @@ -10,6 +10,9 @@ import { ResourcePropertyDefinition, ResourcePropertyDefinitionWithAllLanguages import { StandoffClassDefinition } from "./standoff-class-definition"; import { SystemPropertyDefinition } from "./system-property-definition"; +/** + * @category Internal + */ export namespace OntologyConversionUtil { /** diff --git a/src/models/v2/ontologies/class-definition.ts b/src/models/v2/ontologies/class-definition.ts index 9b4cf39d8..4807ccdab 100644 --- a/src/models/v2/ontologies/class-definition.ts +++ b/src/models/v2/ontologies/class-definition.ts @@ -1,5 +1,10 @@ import { EntityDefinition } from "./EntityDefinition"; +/** + * Represents a property's cardinality. + * + * @category Model V2 + */ export enum Cardinality { /** * Cardinality 1 (required). @@ -25,6 +30,8 @@ export enum Cardinality { /** * Represents a property defined on a resource class. * Contains only the property's IRI, not the definition itself. + * + * @category Model V2 */ export interface IHasProperty { /** @@ -57,6 +64,8 @@ export interface IHasProperty { /** * Represents a resource class. + * + * @category Internal */ export abstract class ClassDefinition extends EntityDefinition { diff --git a/src/models/v2/ontologies/create/create-ontology.ts b/src/models/v2/ontologies/create/create-ontology.ts index af4cfce7a..82c75e593 100644 --- a/src/models/v2/ontologies/create/create-ontology.ts +++ b/src/models/v2/ontologies/create/create-ontology.ts @@ -2,6 +2,9 @@ import { JsonObject, JsonProperty } from "json2typescript"; import { Constants } from "../../Constants"; import { IdConverter } from "../../custom-converters/id-converter"; +/** + * @category Model V2 + */ @JsonObject("CreateOntology") export class CreateOntology { diff --git a/src/models/v2/ontologies/create/create-resource-class.ts b/src/models/v2/ontologies/create/create-resource-class.ts index e17416401..51340ea4e 100644 --- a/src/models/v2/ontologies/create/create-resource-class.ts +++ b/src/models/v2/ontologies/create/create-resource-class.ts @@ -4,6 +4,9 @@ import { StringLiteralToStringLiteralArrayConverter } from "../../custom-convert import { SubClassOfConverter } from "../../custom-converters/subclass-of-converter"; import { StringLiteralV2 } from "../../string-literal-v2"; +/** + * @category Model V2 + */ @JsonObject("CreateResourceClass") export class CreateResourceClass { @@ -22,6 +25,9 @@ export class CreateResourceClass { subClassOf: string[] = []; } +/** + * @category Internal + */ @JsonObject("CreateResourceClassPayload") export class CreateResourceClassPayload extends CreateResourceClass { diff --git a/src/models/v2/ontologies/create/create-resource-property.ts b/src/models/v2/ontologies/create/create-resource-property.ts index c516ffa2c..1a61fc11a 100644 --- a/src/models/v2/ontologies/create/create-resource-property.ts +++ b/src/models/v2/ontologies/create/create-resource-property.ts @@ -1,12 +1,13 @@ import { JsonObject, JsonProperty } from "json2typescript"; -import { StringLiteral } from "../../../admin/string-literal"; import { Constants } from "../../Constants"; import { IdConverter } from "../../custom-converters/id-converter"; import { StringLiteralToStringLiteralArrayConverter } from "../../custom-converters/string-literal-to-string-literal-array-converter"; import { SubClassOfConverter } from "../../custom-converters/subclass-of-converter"; import { StringLiteralV2 } from "../../string-literal-v2"; -import { UpdateOntology } from "../update/update-ontology"; +/** + * @category Model V2 + */ @JsonObject("CreateResourceProperty") export class CreateResourceProperty { @@ -35,6 +36,9 @@ export class CreateResourceProperty { } +/** + * @category Internal + */ @JsonObject("CreateResourcePropertyPayload") export class CreateResourcePropertyPayload extends CreateResourceProperty { diff --git a/src/models/v2/ontologies/delete/delete-ontology-response.ts b/src/models/v2/ontologies/delete/delete-ontology-response.ts index 3323a4301..fb705d25e 100644 --- a/src/models/v2/ontologies/delete/delete-ontology-response.ts +++ b/src/models/v2/ontologies/delete/delete-ontology-response.ts @@ -1,6 +1,9 @@ import { JsonObject, JsonProperty } from "json2typescript"; import { Constants } from "../../Constants"; +/** + * @category Model V2 + */ @JsonObject("DeleteOntologyResponse") export class DeleteOntologyResponse { diff --git a/src/models/v2/ontologies/delete/delete-ontology.ts b/src/models/v2/ontologies/delete/delete-ontology.ts index 677c13254..5d7cc4cec 100644 --- a/src/models/v2/ontologies/delete/delete-ontology.ts +++ b/src/models/v2/ontologies/delete/delete-ontology.ts @@ -1,6 +1,9 @@ import { JsonObject } from "json2typescript"; import { UpdateDeleteEntity } from "../update-delete-entity"; +/** + * @category Model V2 + */ @JsonObject("DeleteOntology") export class DeleteOntology extends UpdateDeleteEntity { diff --git a/src/models/v2/ontologies/delete/delete-resource-class.ts b/src/models/v2/ontologies/delete/delete-resource-class.ts index 9059eedda..ac44eb380 100644 --- a/src/models/v2/ontologies/delete/delete-resource-class.ts +++ b/src/models/v2/ontologies/delete/delete-resource-class.ts @@ -1,5 +1,8 @@ import { UpdateDeleteEntity } from "../update-delete-entity"; +/** + * @category Model V2 + */ export class DeleteResourceClass extends UpdateDeleteEntity { } diff --git a/src/models/v2/ontologies/delete/delete-resource-property.ts b/src/models/v2/ontologies/delete/delete-resource-property.ts index 6ccf555e7..81db1ae82 100644 --- a/src/models/v2/ontologies/delete/delete-resource-property.ts +++ b/src/models/v2/ontologies/delete/delete-resource-property.ts @@ -1,5 +1,8 @@ import { UpdateDeleteEntity } from "../update-delete-entity"; +/** + * @category Model V2 + */ export class DeleteResourceProperty extends UpdateDeleteEntity { } diff --git a/src/models/v2/ontologies/ontology-metadata.ts b/src/models/v2/ontologies/ontology-metadata.ts index 1238aa9ef..a8e206487 100644 --- a/src/models/v2/ontologies/ontology-metadata.ts +++ b/src/models/v2/ontologies/ontology-metadata.ts @@ -3,6 +3,9 @@ import { Constants } from "../Constants"; import { DateTimeStampConverter } from "../custom-converters/date-time-stamp-converter"; import { IdConverter } from "../custom-converters/id-converter"; +/** + * @category Model V2 + */ @JsonObject("OntologyMetadata") export class OntologyMetadata { @@ -22,6 +25,9 @@ export class OntologyMetadata { attachedToProject: string = ""; } +/** + * @category Model V2 + */ @JsonObject("OntologiesMetadata") export class OntologiesMetadata { diff --git a/src/models/v2/ontologies/property-definition.ts b/src/models/v2/ontologies/property-definition.ts index 1ca839549..d4fedc732 100644 --- a/src/models/v2/ontologies/property-definition.ts +++ b/src/models/v2/ontologies/property-definition.ts @@ -1,5 +1,8 @@ import { EntityDefinition } from "./EntityDefinition"; +/** + * @category Internal + */ export abstract class PropertyDefinition extends EntityDefinition { abstract subPropertyOf: string[]; diff --git a/src/models/v2/ontologies/read/read-ontology.ts b/src/models/v2/ontologies/read/read-ontology.ts index f4bf20796..2c0cd2dcf 100644 --- a/src/models/v2/ontologies/read/read-ontology.ts +++ b/src/models/v2/ontologies/read/read-ontology.ts @@ -4,6 +4,9 @@ import { DateTimeStampConverter } from "../../custom-converters/date-time-stamp- import { ClassDefinition } from "../class-definition"; import { PropertyDefinition } from "../property-definition"; +/** + * @category Model V2 + */ @JsonObject("ReadOntology") export class ReadOntology { diff --git a/src/models/v2/ontologies/resource-class-definition.ts b/src/models/v2/ontologies/resource-class-definition.ts index 4386d3740..5d5d7ac9d 100644 --- a/src/models/v2/ontologies/resource-class-definition.ts +++ b/src/models/v2/ontologies/resource-class-definition.ts @@ -8,6 +8,9 @@ import { SubClassOfConverter } from "../custom-converters/subclass-of-converter" import { StringLiteralV2 } from "../string-literal-v2"; import { ClassDefinition, IHasProperty } from "./class-definition"; +/** + * @category Model V2 + */ @JsonObject("ResourceClassDefinition") export class ResourceClassDefinition extends ClassDefinition { @JsonProperty("@id", String) @@ -29,6 +32,9 @@ export class ResourceClassDefinition extends ClassDefinition { canBeInstantiated: boolean = false; } +/** + * @category Model V2 + */ @JsonObject("ResourceClassDefinitionWithAllLanguages") export class ResourceClassDefinitionWithAllLanguages extends ResourceClassDefinition { diff --git a/src/models/v2/ontologies/resource-property-definition.ts b/src/models/v2/ontologies/resource-property-definition.ts index 3a9aece69..fc4bd4e42 100644 --- a/src/models/v2/ontologies/resource-property-definition.ts +++ b/src/models/v2/ontologies/resource-property-definition.ts @@ -9,6 +9,9 @@ import { SubPropertyOfConverter } from "../custom-converters/subproperty-of-conv import { StringLiteralV2 } from "../string-literal-v2"; import { PropertyDefinition } from "./property-definition"; +/** + * @category Model V2 + */ @JsonObject("ResourcePropertyDefinition") export class ResourcePropertyDefinition extends PropertyDefinition { @JsonProperty("@id", String) @@ -45,6 +48,9 @@ export class ResourcePropertyDefinition extends PropertyDefinition { guiAttributes: string[] = []; } +/** + * @category Model V2 + */ @JsonObject("ResourcePropertyDefinitionWithAllLanguages") export class ResourcePropertyDefinitionWithAllLanguages extends ResourcePropertyDefinition { @@ -63,4 +69,4 @@ export class ResourcePropertyDefinitionWithAllLanguages extends ResourceProperty @JsonProperty(Constants.LastModificationDate, DateTimeStampConverter, true) lastModificationDate?: string = undefined; -} \ No newline at end of file +} diff --git a/src/models/v2/ontologies/standoff-class-definition.ts b/src/models/v2/ontologies/standoff-class-definition.ts index ef446fdff..5821325a0 100644 --- a/src/models/v2/ontologies/standoff-class-definition.ts +++ b/src/models/v2/ontologies/standoff-class-definition.ts @@ -4,6 +4,9 @@ import { HasCardinalityForPropertyConverter } from "../custom-converters/has-car import { SubClassOfConverter } from "../custom-converters/subclass-of-converter"; import { ClassDefinition, IHasProperty } from "./class-definition"; +/** + * @category Model V2 + */ @JsonObject("StandoffClassDefinition") export class StandoffClassDefinition extends ClassDefinition { diff --git a/src/models/v2/ontologies/system-property-definition.ts b/src/models/v2/ontologies/system-property-definition.ts index f19588440..dfd50879d 100644 --- a/src/models/v2/ontologies/system-property-definition.ts +++ b/src/models/v2/ontologies/system-property-definition.ts @@ -4,6 +4,9 @@ import { IdConverter } from "../custom-converters/id-converter"; import { SubPropertyOfConverter } from "../custom-converters/subproperty-of-converter"; import { PropertyDefinition } from "./property-definition"; +/** + * @category Model V2 + */ @JsonObject("SystemPropertyDefinition") export class SystemPropertyDefinition extends PropertyDefinition { diff --git a/src/models/v2/ontologies/update-delete-entity.ts b/src/models/v2/ontologies/update-delete-entity.ts index 6271c8ea8..4541c2c2f 100644 --- a/src/models/v2/ontologies/update-delete-entity.ts +++ b/src/models/v2/ontologies/update-delete-entity.ts @@ -2,6 +2,9 @@ import { JsonObject, JsonProperty } from "json2typescript"; import { Constants } from "../Constants"; import { DateTimeStampConverter } from "../custom-converters/date-time-stamp-converter"; +/** + * @category Internal + */ @JsonObject("UpdateDeleteEntity") export abstract class UpdateDeleteEntity { diff --git a/src/models/v2/ontologies/update/update-ontology-resource-class-cardinality.ts b/src/models/v2/ontologies/update/update-ontology-resource-class-cardinality.ts index e46aff5ee..a2832204b 100644 --- a/src/models/v2/ontologies/update/update-ontology-resource-class-cardinality.ts +++ b/src/models/v2/ontologies/update/update-ontology-resource-class-cardinality.ts @@ -1,10 +1,12 @@ import { JsonObject, JsonProperty } from "json2typescript"; import { Constants } from "../../Constants"; -import { DateTimeStampConverter } from "../../custom-converters/date-time-stamp-converter"; import { HasCardinalityForPropertyConverter } from "../../custom-converters/has-cardinality-for-property-converter"; import { IHasProperty } from "../class-definition"; import { UpdateDeleteEntity } from "../update-delete-entity"; +/** + * @category Model V2 + */ @JsonObject("UpdateOntologyResourceClassCardinality") export class UpdateOntologyResourceClassCardinality extends UpdateDeleteEntity { diff --git a/src/models/v2/ontologies/update/update-ontology.ts b/src/models/v2/ontologies/update/update-ontology.ts index cdbbaa6bf..577f73482 100644 --- a/src/models/v2/ontologies/update/update-ontology.ts +++ b/src/models/v2/ontologies/update/update-ontology.ts @@ -4,6 +4,9 @@ import { UpdateDeleteEntity } from "../update-delete-entity"; import { CreateResourceClass } from "../create/create-resource-class"; import { Constants } from "../../Constants"; +/** + * @category Model V2 + */ @JsonObject("UpdateOntology") export class UpdateOntology extends UpdateDeleteEntity { diff --git a/src/models/v2/resources/ResourcesConversionUtil.ts b/src/models/v2/resources/ResourcesConversionUtil.ts index 4ece78ff7..63fc85cc0 100644 --- a/src/models/v2/resources/ResourcesConversionUtil.ts +++ b/src/models/v2/resources/ResourcesConversionUtil.ts @@ -30,6 +30,9 @@ import { ReadUriValue } from "./values/read/read-uri-value"; import { ReadValue } from "./values/read/read-value"; import { ResourceClassAndPropertyDefinitions } from "../../../cache/ontology-cache/resource-class-and-property-definitions"; +/** + * @category Internal + */ export namespace ResourcesConversionUtil { /** diff --git a/src/models/v2/resources/base-resource.ts b/src/models/v2/resources/base-resource.ts index a28c82b2e..636751d8b 100644 --- a/src/models/v2/resources/base-resource.ts +++ b/src/models/v2/resources/base-resource.ts @@ -1,5 +1,8 @@ import { JsonObject, JsonProperty } from "json2typescript"; +/** + * @category Internal + */ @JsonObject("BaseResource") export abstract class BaseResource { diff --git a/src/models/v2/resources/cardinality-util.ts b/src/models/v2/resources/cardinality-util.ts index dc149ec20..d70fd74e8 100644 --- a/src/models/v2/resources/cardinality-util.ts +++ b/src/models/v2/resources/cardinality-util.ts @@ -1,6 +1,11 @@ import { Cardinality, IHasProperty } from "../../../models/v2/ontologies/class-definition"; import { ResourceClassDefinition } from "../ontologies/resource-class-definition"; +/** + * Utility methods to facilitate the handling of a property's cardinality. + * + * @category Model V2 + */ export namespace CardinalityUtil { /** diff --git a/src/models/v2/resources/create/create-resource.ts b/src/models/v2/resources/create/create-resource.ts index cb69b9960..61b395e2b 100644 --- a/src/models/v2/resources/create/create-resource.ts +++ b/src/models/v2/resources/create/create-resource.ts @@ -4,6 +4,9 @@ import { Constants } from "../../Constants"; import { DateTimeStampConverter } from "../../custom-converters/date-time-stamp-converter"; import { IdConverter } from "../../custom-converters/id-converter"; +/** + * @category Model V2 + */ @JsonObject("CreateResource") export class CreateResource { diff --git a/src/models/v2/resources/delete/delete-resource-response.ts b/src/models/v2/resources/delete/delete-resource-response.ts index 9869deedc..161258b27 100644 --- a/src/models/v2/resources/delete/delete-resource-response.ts +++ b/src/models/v2/resources/delete/delete-resource-response.ts @@ -1,6 +1,9 @@ import { JsonObject, JsonProperty } from "json2typescript"; import { Constants } from "../../Constants"; +/** + * @category Model V2 + */ @JsonObject("DeleteResourceResponse") export class DeleteResourceResponse { diff --git a/src/models/v2/resources/delete/delete-resource.ts b/src/models/v2/resources/delete/delete-resource.ts index 3e5620d99..c6914d8fa 100644 --- a/src/models/v2/resources/delete/delete-resource.ts +++ b/src/models/v2/resources/delete/delete-resource.ts @@ -2,6 +2,9 @@ import { JsonObject, JsonProperty } from "json2typescript"; import { Constants } from "../../Constants"; import { DateTimeStampConverter } from "../../custom-converters/date-time-stamp-converter"; +/** + * @category Model V2 + */ @JsonObject("DeleteResource") export class DeleteResource { diff --git a/src/models/v2/resources/permission-util.ts b/src/models/v2/resources/permission-util.ts index 96881b246..c71b7ac01 100644 --- a/src/models/v2/resources/permission-util.ts +++ b/src/models/v2/resources/permission-util.ts @@ -1,3 +1,8 @@ +/** + * Utility methods to facilitate the handling of permissions defined for a resource or value. + * + * @category Model V2 + */ export namespace PermissionUtil { /** diff --git a/src/models/v2/resources/read-write-resource.ts b/src/models/v2/resources/read-write-resource.ts index a13d15d0e..b70903f4b 100644 --- a/src/models/v2/resources/read-write-resource.ts +++ b/src/models/v2/resources/read-write-resource.ts @@ -1,6 +1,9 @@ import { JsonObject, JsonProperty } from "json2typescript"; import { BaseResource } from "./base-resource"; +/** + * @category Internal + */ @JsonObject("ReadWriteResource") export abstract class ReadWriteResource extends BaseResource { diff --git a/src/models/v2/resources/read/read-resource-sequence.ts b/src/models/v2/resources/read/read-resource-sequence.ts index 383955121..9f02a6b7d 100644 --- a/src/models/v2/resources/read/read-resource-sequence.ts +++ b/src/models/v2/resources/read/read-resource-sequence.ts @@ -1,5 +1,8 @@ import { ReadResource } from "./read-resource"; +/** + * @category Model V2 + */ export class ReadResourceSequence { /** diff --git a/src/models/v2/resources/read/read-resource.ts b/src/models/v2/resources/read/read-resource.ts index 80660b58f..179611bc4 100644 --- a/src/models/v2/resources/read/read-resource.ts +++ b/src/models/v2/resources/read/read-resource.ts @@ -3,13 +3,15 @@ import { Constants } from "../../Constants"; import { DateTimeStampConverter } from "../../custom-converters/date-time-stamp-converter"; import { IdConverter } from "../../custom-converters/id-converter"; import { UriConverter } from "../../custom-converters/uri-converter"; -import { PropertyDefinition } from "../../ontologies/property-definition"; import { ResourcePropertyDefinition } from "../../ontologies/resource-property-definition"; import { ReadWriteResource } from "../read-write-resource"; import { TypeGuard } from "../type-guard"; import { ReadValue } from "../values/read/read-value"; import { ResourceClassAndPropertyDefinitions } from "../../../../cache/ontology-cache/resource-class-and-property-definitions"; +/** + * @category Model V2 + */ @JsonObject("ReadResource") export class ReadResource extends ReadWriteResource { diff --git a/src/models/v2/resources/type-guard.ts b/src/models/v2/resources/type-guard.ts index 2c9e0c5f9..336dd92d2 100644 --- a/src/models/v2/resources/type-guard.ts +++ b/src/models/v2/resources/type-guard.ts @@ -1,3 +1,6 @@ +/** + * @category Internal + */ export namespace TypeGuard { // https://dev.to/krumpet/generic-type-guard-in-typescript-258l diff --git a/src/models/v2/resources/update/update-resource-metadata-response.ts b/src/models/v2/resources/update/update-resource-metadata-response.ts index c6df074e1..3db2b0e0c 100644 --- a/src/models/v2/resources/update/update-resource-metadata-response.ts +++ b/src/models/v2/resources/update/update-resource-metadata-response.ts @@ -1,6 +1,9 @@ import { JsonObject, JsonProperty } from "json2typescript"; import { Constants } from "../../Constants"; +/** + * @category Model V2 + */ @JsonObject("UpdateResourceMetadataResponse") export class UpdateResourceMetadataResponse { diff --git a/src/models/v2/resources/update/update-resource-metadata.ts b/src/models/v2/resources/update/update-resource-metadata.ts index 99742fed5..84eb7299a 100644 --- a/src/models/v2/resources/update/update-resource-metadata.ts +++ b/src/models/v2/resources/update/update-resource-metadata.ts @@ -2,6 +2,9 @@ import { JsonObject, JsonProperty } from "json2typescript"; import { Constants } from "../../Constants"; import { DateTimeStampConverter } from "../../custom-converters/date-time-stamp-converter"; +/** + * @category Model V2 + */ @JsonObject("UpdateResourceMetadata") export class UpdateResourceMetadata { diff --git a/src/models/v2/resources/update/update-resource.ts b/src/models/v2/resources/update/update-resource.ts index a9504f870..36f4fb6ab 100644 --- a/src/models/v2/resources/update/update-resource.ts +++ b/src/models/v2/resources/update/update-resource.ts @@ -6,6 +6,8 @@ import { UpdateValue } from "../values/update/update-value"; /** * Represents a resource with a value to be updated, created, or deleted. + * + * @category Model V2 */ @JsonObject("UpdateResource") export class UpdateResource extends ReadWriteResource { diff --git a/src/models/v2/resources/values/base-value.ts b/src/models/v2/resources/values/base-value.ts index 55035d941..5cdced7c3 100644 --- a/src/models/v2/resources/values/base-value.ts +++ b/src/models/v2/resources/values/base-value.ts @@ -1,5 +1,8 @@ import { JsonObject, JsonProperty } from "json2typescript"; +/** + * @category Internal + */ @JsonObject("BaseValue") export abstract class BaseValue { diff --git a/src/models/v2/resources/values/create/create-boolean-value.ts b/src/models/v2/resources/values/create/create-boolean-value.ts index 20fafd79b..2db895b4f 100644 --- a/src/models/v2/resources/values/create/create-boolean-value.ts +++ b/src/models/v2/resources/values/create/create-boolean-value.ts @@ -3,6 +3,9 @@ import { Constants } from "../../../Constants"; import { IBaseBooleanValue } from "../type-specific-interfaces/base-boolean-value"; import { CreateValue } from "./create-value"; +/** + * @category Model V2 + */ @JsonObject("CreateBooleanValue") export class CreateBooleanValue extends CreateValue implements IBaseBooleanValue { diff --git a/src/models/v2/resources/values/create/create-color-value.ts b/src/models/v2/resources/values/create/create-color-value.ts index 807645b42..86354f4b4 100644 --- a/src/models/v2/resources/values/create/create-color-value.ts +++ b/src/models/v2/resources/values/create/create-color-value.ts @@ -3,6 +3,9 @@ import { Constants } from "../../../Constants"; import { IBaseColorValue } from "../type-specific-interfaces/base-color-value"; import { CreateValue } from "./create-value"; +/** + * @category Model V2 + */ @JsonObject("CreateColorValue") export class CreateColorValue extends CreateValue implements IBaseColorValue { diff --git a/src/models/v2/resources/values/create/create-date-value.ts b/src/models/v2/resources/values/create/create-date-value.ts index f114f3248..70a191a84 100644 --- a/src/models/v2/resources/values/create/create-date-value.ts +++ b/src/models/v2/resources/values/create/create-date-value.ts @@ -3,6 +3,9 @@ import { Constants } from "../../../Constants"; import { IBaseDateValue } from "../type-specific-interfaces/base-date-value"; import { CreateValue } from "./create-value"; +/** + * @category Model V2 + */ @JsonObject("CreateDateValue") export class CreateDateValue extends CreateValue implements IBaseDateValue { diff --git a/src/models/v2/resources/values/create/create-decimal-value.ts b/src/models/v2/resources/values/create/create-decimal-value.ts index f086fbc98..52dcafc23 100644 --- a/src/models/v2/resources/values/create/create-decimal-value.ts +++ b/src/models/v2/resources/values/create/create-decimal-value.ts @@ -4,6 +4,9 @@ import { DecimalConverter } from "../../../custom-converters/decimal-converter"; import { IBaseDecimalValue } from "../type-specific-interfaces/base-decimal-value"; import { CreateValue } from "./create-value"; +/** + * @category Model V2 + */ @JsonObject("CreateDecimalValue") export class CreateDecimalValue extends CreateValue implements IBaseDecimalValue { diff --git a/src/models/v2/resources/values/create/create-file-value.ts b/src/models/v2/resources/values/create/create-file-value.ts index 987bba0e2..a7785acdb 100644 --- a/src/models/v2/resources/values/create/create-file-value.ts +++ b/src/models/v2/resources/values/create/create-file-value.ts @@ -3,12 +3,18 @@ import { Constants } from "../../../Constants"; import { IBaseFileValue } from "../type-specific-interfaces/base-file-value"; import { CreateValue } from "./create-value"; +/** + * @category Model V2 + */ @JsonObject("CreateFileValue") export abstract class CreateFileValue extends CreateValue implements IBaseFileValue { @JsonProperty(Constants.FileValueHasFilename, String) filename: string = ""; } +/** + * @category Model V2 + */ @JsonObject("CreateStillImageFileValue") export class CreateStillImageFileValue extends CreateFileValue { diff --git a/src/models/v2/resources/values/create/create-geom-value.ts b/src/models/v2/resources/values/create/create-geom-value.ts index b0c94199a..82369bd96 100644 --- a/src/models/v2/resources/values/create/create-geom-value.ts +++ b/src/models/v2/resources/values/create/create-geom-value.ts @@ -3,6 +3,9 @@ import { Constants } from "../../../Constants"; import { IBaseGeomValue } from "../type-specific-interfaces/base-geom-value"; import { CreateValue } from "./create-value"; +/** + * @category Model V2 + */ @JsonObject("CreateGeomValue") export class CreateGeomValue extends CreateValue implements IBaseGeomValue { diff --git a/src/models/v2/resources/values/create/create-geoname-value.ts b/src/models/v2/resources/values/create/create-geoname-value.ts index ee462a613..82871416e 100644 --- a/src/models/v2/resources/values/create/create-geoname-value.ts +++ b/src/models/v2/resources/values/create/create-geoname-value.ts @@ -3,6 +3,9 @@ import { Constants } from "../../../Constants"; import { IBaseGeonameValue } from "../type-specific-interfaces/base-geoname-value"; import { CreateValue } from "./create-value"; +/** + * @category Model V2 + */ @JsonObject("CreateGeonameValue") export class CreateGeonameValue extends CreateValue implements IBaseGeonameValue { diff --git a/src/models/v2/resources/values/create/create-int-value.ts b/src/models/v2/resources/values/create/create-int-value.ts index dc0e7849a..ae0773d42 100644 --- a/src/models/v2/resources/values/create/create-int-value.ts +++ b/src/models/v2/resources/values/create/create-int-value.ts @@ -3,6 +3,9 @@ import { Constants } from "../../../Constants"; import { IBaseIntValue } from "../type-specific-interfaces/base-int-value"; import { CreateValue } from "./create-value"; +/** + * @category Model V2 + */ @JsonObject("CreateIntValue") export class CreateIntValue extends CreateValue implements IBaseIntValue { diff --git a/src/models/v2/resources/values/create/create-interval-value.ts b/src/models/v2/resources/values/create/create-interval-value.ts index 6077e5d7c..94d0f9b86 100644 --- a/src/models/v2/resources/values/create/create-interval-value.ts +++ b/src/models/v2/resources/values/create/create-interval-value.ts @@ -4,6 +4,9 @@ import { DecimalConverter } from "../../../custom-converters/decimal-converter"; import { IBaseIntervalValue } from "../type-specific-interfaces/base-interval-value"; import { CreateValue } from "./create-value"; +/** + * @category Model V2 + */ @JsonObject("CreateIntervalValue") export class CreateIntervalValue extends CreateValue implements IBaseIntervalValue { diff --git a/src/models/v2/resources/values/create/create-link-value.ts b/src/models/v2/resources/values/create/create-link-value.ts index 0c33d7dc9..9b72651d6 100644 --- a/src/models/v2/resources/values/create/create-link-value.ts +++ b/src/models/v2/resources/values/create/create-link-value.ts @@ -4,6 +4,9 @@ import { IdConverter } from "../../../custom-converters/id-converter"; import { IBaseLinkValue } from "../type-specific-interfaces/base-link-value"; import { CreateValue } from "./create-value"; +/** + * @category Model V2 + */ @JsonObject("CreateLinkValue") export class CreateLinkValue extends CreateValue implements IBaseLinkValue { diff --git a/src/models/v2/resources/values/create/create-list-value.ts b/src/models/v2/resources/values/create/create-list-value.ts index f92fdd50a..57e466057 100644 --- a/src/models/v2/resources/values/create/create-list-value.ts +++ b/src/models/v2/resources/values/create/create-list-value.ts @@ -4,6 +4,9 @@ import { IdConverter } from "../../../custom-converters/id-converter"; import { IBaseListValue } from "../type-specific-interfaces/base-list-value"; import { CreateValue } from "./create-value"; +/** + * @category Model V2 + */ @JsonObject("CreateListValue") export class CreateListValue extends CreateValue implements IBaseListValue { diff --git a/src/models/v2/resources/values/create/create-text-value.ts b/src/models/v2/resources/values/create/create-text-value.ts index 02b1e6993..cdbda2edb 100644 --- a/src/models/v2/resources/values/create/create-text-value.ts +++ b/src/models/v2/resources/values/create/create-text-value.ts @@ -4,6 +4,9 @@ import { IdConverter } from "../../../custom-converters/id-converter"; import { IBaseTextValueAsString, IBaseTextValueAsXml } from "../type-specific-interfaces/base-text-value"; import { CreateValue } from "./create-value"; +/** + * @category Model V2 + */ @JsonObject("CreateTextValueAsString") export class CreateTextValueAsString extends CreateValue implements IBaseTextValueAsString { @@ -16,6 +19,9 @@ export class CreateTextValueAsString extends CreateValue implements IBaseTextVal } +/** + * @category Model V2 + */ @JsonObject("CreateTextValueAsXml") export class CreateTextValueAsXml extends CreateValue implements IBaseTextValueAsXml { diff --git a/src/models/v2/resources/values/create/create-time-value.ts b/src/models/v2/resources/values/create/create-time-value.ts index 8cffb3b26..e92d36470 100644 --- a/src/models/v2/resources/values/create/create-time-value.ts +++ b/src/models/v2/resources/values/create/create-time-value.ts @@ -4,6 +4,9 @@ import { DateTimeStampConverter } from "../../../custom-converters/date-time-sta import { IBaseTimeValue } from "../type-specific-interfaces/base-time-value"; import { CreateValue } from "./create-value"; +/** + * @category Model V2 + */ @JsonObject("CreateTimeValue") export class CreateTimeValue extends CreateValue implements IBaseTimeValue { diff --git a/src/models/v2/resources/values/create/create-uri-value.ts b/src/models/v2/resources/values/create/create-uri-value.ts index 5a3932c4e..3b680be15 100644 --- a/src/models/v2/resources/values/create/create-uri-value.ts +++ b/src/models/v2/resources/values/create/create-uri-value.ts @@ -4,6 +4,9 @@ import { UriConverter } from "../../../custom-converters/uri-converter"; import { IBaseUriValue } from "../type-specific-interfaces/base-uri-value"; import { CreateValue } from "./create-value"; +/** + * @category Model V2 + */ @JsonObject("CreateUriValue") export class CreateUriValue extends CreateValue implements IBaseUriValue { diff --git a/src/models/v2/resources/values/create/create-value.ts b/src/models/v2/resources/values/create/create-value.ts index 874d4be50..fd0c0d605 100644 --- a/src/models/v2/resources/values/create/create-value.ts +++ b/src/models/v2/resources/values/create/create-value.ts @@ -1,6 +1,9 @@ -import { JsonObject, JsonProperty } from "json2typescript"; +import { JsonObject } from "json2typescript"; import { WriteValue } from "../write-value"; +/** + * @category Model V2 + */ @JsonObject("CreateValue") export abstract class CreateValue extends WriteValue { diff --git a/src/models/v2/resources/values/delete/delete-value-response.ts b/src/models/v2/resources/values/delete/delete-value-response.ts index 55dec53b5..aae841172 100644 --- a/src/models/v2/resources/values/delete/delete-value-response.ts +++ b/src/models/v2/resources/values/delete/delete-value-response.ts @@ -1,6 +1,9 @@ import { JsonObject, JsonProperty } from "json2typescript"; import { Constants } from "../../../Constants"; +/** + * @category Model V2 + */ @JsonObject("DeleteValueResponse") export class DeleteValueResponse { diff --git a/src/models/v2/resources/values/delete/delete-value.ts b/src/models/v2/resources/values/delete/delete-value.ts index b631ea70b..0946300df 100644 --- a/src/models/v2/resources/values/delete/delete-value.ts +++ b/src/models/v2/resources/values/delete/delete-value.ts @@ -2,6 +2,9 @@ import { JsonObject, JsonProperty } from "json2typescript"; import { Constants } from "../../../Constants"; import { BaseValue } from "../base-value"; +/** + * @category Model V2 + */ @JsonObject("DeleteValue") export class DeleteValue extends BaseValue { diff --git a/src/models/v2/resources/values/read/read-boolean-value.ts b/src/models/v2/resources/values/read/read-boolean-value.ts index 8c442f14a..50deea44a 100644 --- a/src/models/v2/resources/values/read/read-boolean-value.ts +++ b/src/models/v2/resources/values/read/read-boolean-value.ts @@ -3,6 +3,9 @@ import { Constants } from "../../../Constants"; import { IBaseBooleanValue } from "../type-specific-interfaces/base-boolean-value"; import { ReadValue } from "./read-value"; +/** + * @category Model V2 + */ @JsonObject("ReadBooleanValue") export class ReadBooleanValue extends ReadValue implements IBaseBooleanValue { diff --git a/src/models/v2/resources/values/read/read-color-value.ts b/src/models/v2/resources/values/read/read-color-value.ts index ace4f790d..96fc47786 100644 --- a/src/models/v2/resources/values/read/read-color-value.ts +++ b/src/models/v2/resources/values/read/read-color-value.ts @@ -3,6 +3,9 @@ import { Constants } from "../../../Constants"; import { IBaseColorValue } from "../type-specific-interfaces/base-color-value"; import { ReadValue } from "./read-value"; +/** + * @category Model V2 + */ @JsonObject("ReadColorValue") export class ReadColorValue extends ReadValue implements IBaseColorValue { diff --git a/src/models/v2/resources/values/read/read-date-value.ts b/src/models/v2/resources/values/read/read-date-value.ts index 6aec27192..4ae57366f 100644 --- a/src/models/v2/resources/values/read/read-date-value.ts +++ b/src/models/v2/resources/values/read/read-date-value.ts @@ -3,6 +3,9 @@ import { Constants } from "../../../Constants"; import { IBaseDateValue } from "../type-specific-interfaces/base-date-value"; import { ReadValue } from "./read-value"; +/** + * @category Internal + */ @JsonObject("ReadDateValue") export class ParseReadDateValue extends ReadValue implements IBaseDateValue { @@ -38,16 +41,31 @@ export class ParseReadDateValue extends ReadValue implements IBaseDateValue { } /** - * Precision for DateSalsah. + * Precision of a date. + * + * @category Model V2 */ export enum Precision { + /** + * Year precision (first to last day of the year). + */ yearPrecision, + + /** + * Month precision (first to last day of the month). + */ monthPrecision, + + /** + * Day precision. + */ dayPrecision } /** * Represents a Salsah date object with a precision information. + * + * @category Model V2 */ export class KnoraDate { @@ -80,6 +98,8 @@ export class KnoraDate { /** * Represents a period (with start date and end date). + * + * @category Model V2 */ export class KnoraPeriod { @@ -91,6 +111,9 @@ export class KnoraPeriod { } +/** + * @category Model V2 + */ export class ReadDateValue extends ReadValue { date: KnoraDate | KnoraPeriod; diff --git a/src/models/v2/resources/values/read/read-decimal-value.ts b/src/models/v2/resources/values/read/read-decimal-value.ts index 66a0193f3..0636777f4 100644 --- a/src/models/v2/resources/values/read/read-decimal-value.ts +++ b/src/models/v2/resources/values/read/read-decimal-value.ts @@ -4,6 +4,9 @@ import { DecimalConverter } from "../../../custom-converters/decimal-converter"; import { IBaseDecimalValue } from "../type-specific-interfaces/base-decimal-value"; import { ReadValue } from "./read-value"; +/** + * @category Model V2 + */ @JsonObject("ReadDecimalValue") export class ReadDecimalValue extends ReadValue implements IBaseDecimalValue { diff --git a/src/models/v2/resources/values/read/read-file-value.ts b/src/models/v2/resources/values/read/read-file-value.ts index 57bbdf506..6b903782f 100644 --- a/src/models/v2/resources/values/read/read-file-value.ts +++ b/src/models/v2/resources/values/read/read-file-value.ts @@ -4,6 +4,9 @@ import { UriConverter } from "../../../custom-converters/uri-converter"; import { IBaseFileValue } from "../type-specific-interfaces/base-file-value"; import { ReadValue } from "./read-value"; +/** + * @category Model V2 + */ @JsonObject("ReadFileValue") export abstract class ReadFileValue extends ReadValue implements IBaseFileValue { @@ -14,6 +17,9 @@ export abstract class ReadFileValue extends ReadValue implements IBaseFileValue fileUrl: string = ""; } +/** + * @category Model V2 + */ @JsonObject("ReadStillImageFileValue") export class ReadStillImageFileValue extends ReadFileValue { diff --git a/src/models/v2/resources/values/read/read-geom-value.ts b/src/models/v2/resources/values/read/read-geom-value.ts index 9f52740d8..f06b72a9f 100644 --- a/src/models/v2/resources/values/read/read-geom-value.ts +++ b/src/models/v2/resources/values/read/read-geom-value.ts @@ -3,6 +3,9 @@ import { Constants } from "../../../Constants"; import { IBaseGeomValue } from "../type-specific-interfaces/base-geom-value"; import { ReadValue } from "./read-value"; +/** + * @category Internal + */ @JsonObject("ReadGeomValue") export class ParseReadGeomValue extends ReadValue implements IBaseGeomValue { @@ -12,6 +15,8 @@ export class ParseReadGeomValue extends ReadValue implements IBaseGeomValue { /** * Represents a point in a 2D-coordinate system (for geometry values). + * + * @category Model V2 */ export class Point2D { constructor(public x: number, public y: number) { @@ -20,6 +25,8 @@ export class Point2D { /** * Represents a geometry value parsed from JSON. + * + * @category Model V2 */ export class RegionGeometry { constructor(public status: string, @@ -32,6 +39,9 @@ export class RegionGeometry { } } +/** + * @category Model V2 + */ export class ReadGeomValue extends ReadValue { geometry: RegionGeometry; diff --git a/src/models/v2/resources/values/read/read-geoname-value.ts b/src/models/v2/resources/values/read/read-geoname-value.ts index daa5b022e..ff5cb7ed0 100644 --- a/src/models/v2/resources/values/read/read-geoname-value.ts +++ b/src/models/v2/resources/values/read/read-geoname-value.ts @@ -3,6 +3,9 @@ import { Constants } from "../../../Constants"; import { IBaseGeonameValue } from "../type-specific-interfaces/base-geoname-value"; import { ReadValue } from "./read-value"; +/** + * @category Model V2 + */ @JsonObject("ReadGeonameValue") export class ReadGeonameValue extends ReadValue implements IBaseGeonameValue { diff --git a/src/models/v2/resources/values/read/read-int-value.ts b/src/models/v2/resources/values/read/read-int-value.ts index 087127fbc..ad2938fbd 100644 --- a/src/models/v2/resources/values/read/read-int-value.ts +++ b/src/models/v2/resources/values/read/read-int-value.ts @@ -3,6 +3,9 @@ import { Constants } from "../../../Constants"; import { IBaseIntValue } from "../type-specific-interfaces/base-int-value"; import { ReadValue } from "./read-value"; +/** + * @category Model V2 + */ @JsonObject("ReadIntValue") export class ReadIntValue extends ReadValue implements IBaseIntValue { diff --git a/src/models/v2/resources/values/read/read-interval-value.ts b/src/models/v2/resources/values/read/read-interval-value.ts index d6599f3c5..b0863b54d 100644 --- a/src/models/v2/resources/values/read/read-interval-value.ts +++ b/src/models/v2/resources/values/read/read-interval-value.ts @@ -4,6 +4,9 @@ import { DecimalConverter } from "../../../custom-converters/decimal-converter"; import { IBaseIntervalValue } from "../type-specific-interfaces/base-interval-value"; import { ReadValue } from "./read-value"; +/** + * @category Model V2 + */ @JsonObject("ReadIntervalValue") export class ReadIntervalValue extends ReadValue implements IBaseIntervalValue { diff --git a/src/models/v2/resources/values/read/read-link-value.ts b/src/models/v2/resources/values/read/read-link-value.ts index bf7a9c6b6..c49468121 100644 --- a/src/models/v2/resources/values/read/read-link-value.ts +++ b/src/models/v2/resources/values/read/read-link-value.ts @@ -3,6 +3,9 @@ import { ReadResource } from "../../read/read-resource"; import { IBaseLinkValue } from "../type-specific-interfaces/base-link-value"; import { ReadValue } from "./read-value"; +/** + * @category Model V2 + */ @JsonObject("ReadLinkValue") export class ReadLinkValue extends ReadValue implements IBaseLinkValue { diff --git a/src/models/v2/resources/values/read/read-list-value.ts b/src/models/v2/resources/values/read/read-list-value.ts index bdd40ae42..8a6d41d02 100644 --- a/src/models/v2/resources/values/read/read-list-value.ts +++ b/src/models/v2/resources/values/read/read-list-value.ts @@ -4,6 +4,9 @@ import { IdConverter } from "../../../custom-converters/id-converter"; import { IBaseListValue } from "../type-specific-interfaces/base-list-value"; import { ReadValue } from "./read-value"; +/** + * @category Model V2 + */ @JsonObject("ReadListValue") export class ReadListValue extends ReadValue implements IBaseListValue { diff --git a/src/models/v2/resources/values/read/read-text-value.ts b/src/models/v2/resources/values/read/read-text-value.ts index 7b06494e0..8c6dd4206 100644 --- a/src/models/v2/resources/values/read/read-text-value.ts +++ b/src/models/v2/resources/values/read/read-text-value.ts @@ -8,10 +8,16 @@ import { } from "../type-specific-interfaces/base-text-value"; import { ReadValue } from "./read-value"; +/** + * @category Model V2 + */ @JsonObject("ReadTextValue") export abstract class ReadTextValue extends ReadValue { } +/** + * @category Model V2 + */ @JsonObject("ReadTextValueAsString") export class ReadTextValueAsString extends ReadTextValue implements IBaseTextValueAsString { @@ -22,6 +28,9 @@ export class ReadTextValueAsString extends ReadTextValue implements IBaseTextVal } +/** + * @category Model V2 + */ @JsonObject("ReadTextValueAsXml") export class ReadTextValueAsXml extends ReadTextValue implements IBaseTextValueAsXml { @@ -33,6 +42,9 @@ export class ReadTextValueAsXml extends ReadTextValue implements IBaseTextValueA } +/** + * @category Model V2 + */ @JsonObject("ReadTextValueAsHtml") export class ReadTextValueAsHtml extends ReadTextValue implements IBaseTextValueAsHtml { diff --git a/src/models/v2/resources/values/read/read-time-value.ts b/src/models/v2/resources/values/read/read-time-value.ts index 215649e9c..63d69b4fc 100644 --- a/src/models/v2/resources/values/read/read-time-value.ts +++ b/src/models/v2/resources/values/read/read-time-value.ts @@ -4,6 +4,9 @@ import { DateTimeStampConverter } from "../../../custom-converters/date-time-sta import { IBaseTimeValue } from "../type-specific-interfaces/base-time-value"; import { ReadValue } from "./read-value"; +/** + * @category Model V2 + */ @JsonObject("ReadTimeValue") export class ReadTimeValue extends ReadValue implements IBaseTimeValue { diff --git a/src/models/v2/resources/values/read/read-uri-value.ts b/src/models/v2/resources/values/read/read-uri-value.ts index 7113506a3..9979bbd8f 100644 --- a/src/models/v2/resources/values/read/read-uri-value.ts +++ b/src/models/v2/resources/values/read/read-uri-value.ts @@ -4,6 +4,9 @@ import { UriConverter } from "../../../custom-converters/uri-converter"; import { IBaseUriValue } from "../type-specific-interfaces/base-uri-value"; import { ReadValue } from "./read-value"; +/** + * @category Model V2 + */ @JsonObject("ReadUriValue") export class ReadUriValue extends ReadValue implements IBaseUriValue { diff --git a/src/models/v2/resources/values/read/read-value.ts b/src/models/v2/resources/values/read/read-value.ts index 0c9ac02a0..d5e6cd73b 100644 --- a/src/models/v2/resources/values/read/read-value.ts +++ b/src/models/v2/resources/values/read/read-value.ts @@ -5,6 +5,9 @@ import { IdConverter } from "../../../custom-converters/id-converter"; import { UriConverter } from "../../../custom-converters/uri-converter"; import { BaseValue } from "../base-value"; +/** + * @category Model V2 + */ @JsonObject("ReadValue") export class ReadValue extends BaseValue { @@ -43,6 +46,23 @@ export class ReadValue extends BaseValue { strval?: string; + /** + * @category Internal + * @param id the id of the value. + * @param type the type of the value. + * @param attachedToUser the user the value is attached to. + * @param arkUrl the value's persistent URL. + * @param versionArkUrl the value's persistent URL for this version. + * @param valueCreationDate the value's date of creation. + * @param hasPermissions the permission set for the value. + * @param userHasPermission the current user's permissions on the value. + * @param uuid the value's UUID. + * @param propertyLabel the label of the value's property. + * @param propertyComment the comment of the value's property. + * @param property the property pointing to the value. + * @param strval the value's string representation, if any. + * @param valueHasComment the comment on the value, if any. + */ constructor(id?: string, type?: string, attachedToUser?: string, diff --git a/src/models/v2/resources/values/type-specific-interfaces/base-boolean-value.ts b/src/models/v2/resources/values/type-specific-interfaces/base-boolean-value.ts index 54612f520..d9eb8e31d 100644 --- a/src/models/v2/resources/values/type-specific-interfaces/base-boolean-value.ts +++ b/src/models/v2/resources/values/type-specific-interfaces/base-boolean-value.ts @@ -1,3 +1,6 @@ +/** + * @category Internal + */ export interface IBaseBooleanValue { bool: boolean; diff --git a/src/models/v2/resources/values/type-specific-interfaces/base-color-value.ts b/src/models/v2/resources/values/type-specific-interfaces/base-color-value.ts index 051a3efd9..d0e22423f 100644 --- a/src/models/v2/resources/values/type-specific-interfaces/base-color-value.ts +++ b/src/models/v2/resources/values/type-specific-interfaces/base-color-value.ts @@ -1,3 +1,6 @@ +/** + * @category Internal + */ export interface IBaseColorValue { color: string; } diff --git a/src/models/v2/resources/values/type-specific-interfaces/base-date-value.ts b/src/models/v2/resources/values/type-specific-interfaces/base-date-value.ts index c0d6a48a9..6716b7c4a 100644 --- a/src/models/v2/resources/values/type-specific-interfaces/base-date-value.ts +++ b/src/models/v2/resources/values/type-specific-interfaces/base-date-value.ts @@ -1,3 +1,6 @@ +/** + * @category Internal + */ export interface IBaseDateValue { calendar: string; diff --git a/src/models/v2/resources/values/type-specific-interfaces/base-decimal-value.ts b/src/models/v2/resources/values/type-specific-interfaces/base-decimal-value.ts index 679a7aded..979d01e5f 100644 --- a/src/models/v2/resources/values/type-specific-interfaces/base-decimal-value.ts +++ b/src/models/v2/resources/values/type-specific-interfaces/base-decimal-value.ts @@ -1,3 +1,6 @@ +/** + * @category Internal + */ export interface IBaseDecimalValue { decimal: number; } diff --git a/src/models/v2/resources/values/type-specific-interfaces/base-file-value.ts b/src/models/v2/resources/values/type-specific-interfaces/base-file-value.ts index ef5fc16dc..08be4b8a2 100644 --- a/src/models/v2/resources/values/type-specific-interfaces/base-file-value.ts +++ b/src/models/v2/resources/values/type-specific-interfaces/base-file-value.ts @@ -1,3 +1,6 @@ +/** + * @category Internal + */ export interface IBaseFileValue { filename: string; diff --git a/src/models/v2/resources/values/type-specific-interfaces/base-geom-value.ts b/src/models/v2/resources/values/type-specific-interfaces/base-geom-value.ts index d26bc1bd2..360b708e0 100644 --- a/src/models/v2/resources/values/type-specific-interfaces/base-geom-value.ts +++ b/src/models/v2/resources/values/type-specific-interfaces/base-geom-value.ts @@ -1,3 +1,6 @@ +/** + * @category Internal + */ export interface IBaseGeomValue { geometryString: string; diff --git a/src/models/v2/resources/values/type-specific-interfaces/base-geoname-value.ts b/src/models/v2/resources/values/type-specific-interfaces/base-geoname-value.ts index 4960693f1..8ebf0e65d 100644 --- a/src/models/v2/resources/values/type-specific-interfaces/base-geoname-value.ts +++ b/src/models/v2/resources/values/type-specific-interfaces/base-geoname-value.ts @@ -1,3 +1,6 @@ +/** + * @category Internal + */ export interface IBaseGeonameValue { geoname: string; diff --git a/src/models/v2/resources/values/type-specific-interfaces/base-int-value.ts b/src/models/v2/resources/values/type-specific-interfaces/base-int-value.ts index 5161c879b..48ea928e3 100644 --- a/src/models/v2/resources/values/type-specific-interfaces/base-int-value.ts +++ b/src/models/v2/resources/values/type-specific-interfaces/base-int-value.ts @@ -1,3 +1,6 @@ +/** + * @category Internal + */ export interface IBaseIntValue { int: number; } diff --git a/src/models/v2/resources/values/type-specific-interfaces/base-interval-value.ts b/src/models/v2/resources/values/type-specific-interfaces/base-interval-value.ts index 5d8ab74c8..46563a384 100644 --- a/src/models/v2/resources/values/type-specific-interfaces/base-interval-value.ts +++ b/src/models/v2/resources/values/type-specific-interfaces/base-interval-value.ts @@ -1,3 +1,6 @@ +/** + * @category Internal + */ export interface IBaseIntervalValue { start: number; diff --git a/src/models/v2/resources/values/type-specific-interfaces/base-link-value.ts b/src/models/v2/resources/values/type-specific-interfaces/base-link-value.ts index fffe663bb..a16a4d976 100644 --- a/src/models/v2/resources/values/type-specific-interfaces/base-link-value.ts +++ b/src/models/v2/resources/values/type-specific-interfaces/base-link-value.ts @@ -1,3 +1,6 @@ +/** + * @category Internal + */ export interface IBaseLinkValue { linkedResourceIri: string; diff --git a/src/models/v2/resources/values/type-specific-interfaces/base-list-value.ts b/src/models/v2/resources/values/type-specific-interfaces/base-list-value.ts index f5f8000ce..89b848391 100644 --- a/src/models/v2/resources/values/type-specific-interfaces/base-list-value.ts +++ b/src/models/v2/resources/values/type-specific-interfaces/base-list-value.ts @@ -1,3 +1,6 @@ +/** + * @category Internal + */ export interface IBaseListValue { listNode: string; diff --git a/src/models/v2/resources/values/type-specific-interfaces/base-text-value.ts b/src/models/v2/resources/values/type-specific-interfaces/base-text-value.ts index 9b2063f32..233c13fae 100644 --- a/src/models/v2/resources/values/type-specific-interfaces/base-text-value.ts +++ b/src/models/v2/resources/values/type-specific-interfaces/base-text-value.ts @@ -1,9 +1,15 @@ +/** + * @category Internal + */ export interface IBaseTextValueAsString { text: string; } +/** + * @category Internal + */ export interface IBaseTextValueAsXml { xml: string; @@ -12,6 +18,9 @@ export interface IBaseTextValueAsXml { } +/** + * @category Internal + */ export interface IBaseTextValueAsHtml { html: string; diff --git a/src/models/v2/resources/values/type-specific-interfaces/base-time-value.ts b/src/models/v2/resources/values/type-specific-interfaces/base-time-value.ts index c03744f61..d13a081aa 100644 --- a/src/models/v2/resources/values/type-specific-interfaces/base-time-value.ts +++ b/src/models/v2/resources/values/type-specific-interfaces/base-time-value.ts @@ -1,3 +1,6 @@ +/** + * @category Internal + */ export interface IBaseTimeValue { time: string; } diff --git a/src/models/v2/resources/values/type-specific-interfaces/base-uri-value.ts b/src/models/v2/resources/values/type-specific-interfaces/base-uri-value.ts index 47548f37e..b644a859e 100644 --- a/src/models/v2/resources/values/type-specific-interfaces/base-uri-value.ts +++ b/src/models/v2/resources/values/type-specific-interfaces/base-uri-value.ts @@ -1,3 +1,6 @@ +/** + * @category Internal + */ export interface IBaseUriValue { uri: string; diff --git a/src/models/v2/resources/values/update/update-boolean-value.ts b/src/models/v2/resources/values/update/update-boolean-value.ts index a8354ca71..cad874d9f 100644 --- a/src/models/v2/resources/values/update/update-boolean-value.ts +++ b/src/models/v2/resources/values/update/update-boolean-value.ts @@ -3,6 +3,9 @@ import { Constants } from "../../../Constants"; import { IBaseBooleanValue } from "../type-specific-interfaces/base-boolean-value"; import { UpdateValue } from "./update-value"; +/** + * @category Model V2 + */ @JsonObject("UpdateBooleanValue") export class UpdateBooleanValue extends UpdateValue implements IBaseBooleanValue { diff --git a/src/models/v2/resources/values/update/update-color-value.ts b/src/models/v2/resources/values/update/update-color-value.ts index bb061ce3b..f4d364cf0 100644 --- a/src/models/v2/resources/values/update/update-color-value.ts +++ b/src/models/v2/resources/values/update/update-color-value.ts @@ -3,6 +3,9 @@ import { Constants } from "../../../Constants"; import { IBaseColorValue } from "../type-specific-interfaces/base-color-value"; import { UpdateValue } from "./update-value"; +/** + * @category Model V2 + */ @JsonObject("UpdateColorValue") export class UpdateColorValue extends UpdateValue implements IBaseColorValue { diff --git a/src/models/v2/resources/values/update/update-date-value.ts b/src/models/v2/resources/values/update/update-date-value.ts index c05b2ad21..0c0f262df 100644 --- a/src/models/v2/resources/values/update/update-date-value.ts +++ b/src/models/v2/resources/values/update/update-date-value.ts @@ -3,6 +3,9 @@ import { Constants } from "../../../Constants"; import { IBaseDateValue } from "../type-specific-interfaces/base-date-value"; import { UpdateValue } from "./update-value"; +/** + * @category Model V2 + */ @JsonObject("UpdateDateValue") export class UpdateDateValue extends UpdateValue implements IBaseDateValue { diff --git a/src/models/v2/resources/values/update/update-decimal-value.ts b/src/models/v2/resources/values/update/update-decimal-value.ts index 6eade1f0c..1a8b36c48 100644 --- a/src/models/v2/resources/values/update/update-decimal-value.ts +++ b/src/models/v2/resources/values/update/update-decimal-value.ts @@ -4,6 +4,9 @@ import { DecimalConverter } from "../../../custom-converters/decimal-converter"; import { IBaseDecimalValue } from "../type-specific-interfaces/base-decimal-value"; import { UpdateValue } from "./update-value"; +/** + * @category Model V2 + */ @JsonObject("UpdateDecimalValue") export class UpdateDecimalValue extends UpdateValue implements IBaseDecimalValue { diff --git a/src/models/v2/resources/values/update/update-file-value.ts b/src/models/v2/resources/values/update/update-file-value.ts index e3d55cdb4..5c2265685 100644 --- a/src/models/v2/resources/values/update/update-file-value.ts +++ b/src/models/v2/resources/values/update/update-file-value.ts @@ -3,6 +3,9 @@ import { Constants } from "../../../Constants"; import { IBaseFileValue } from "../type-specific-interfaces/base-file-value"; import { UpdateValue } from "./update-value"; +/** + * @category Model V2 + */ @JsonObject("UpdateFileValue") export abstract class UpdateFileValue extends UpdateValue implements IBaseFileValue { @@ -11,6 +14,9 @@ export abstract class UpdateFileValue extends UpdateValue implements IBaseFileVa } +/** + * @category Model V2 + */ @JsonObject("UpdateStillImageFileValue") export class UpdateStillImageFileValue extends UpdateFileValue { diff --git a/src/models/v2/resources/values/update/update-geom-value.ts b/src/models/v2/resources/values/update/update-geom-value.ts index ae9661f01..4dc2ee240 100644 --- a/src/models/v2/resources/values/update/update-geom-value.ts +++ b/src/models/v2/resources/values/update/update-geom-value.ts @@ -3,6 +3,9 @@ import { Constants } from "../../../Constants"; import { IBaseGeomValue } from "../type-specific-interfaces/base-geom-value"; import { UpdateValue } from "./update-value"; +/** + * @category Model V2 + */ @JsonObject("UpdateGeomValue") export class UpdateGeomValue extends UpdateValue implements IBaseGeomValue { diff --git a/src/models/v2/resources/values/update/update-geoname-value.ts b/src/models/v2/resources/values/update/update-geoname-value.ts index 06b4cecfb..ec9191e5e 100644 --- a/src/models/v2/resources/values/update/update-geoname-value.ts +++ b/src/models/v2/resources/values/update/update-geoname-value.ts @@ -3,6 +3,9 @@ import { Constants } from "../../../Constants"; import { IBaseGeonameValue } from "../type-specific-interfaces/base-geoname-value"; import { UpdateValue } from "./update-value"; +/** + * @category Model V2 + */ @JsonObject("UpdateGeonameValue") export class UpdateGeonameValue extends UpdateValue implements IBaseGeonameValue { diff --git a/src/models/v2/resources/values/update/update-int-value.ts b/src/models/v2/resources/values/update/update-int-value.ts index bbe555dc5..0c75004db 100644 --- a/src/models/v2/resources/values/update/update-int-value.ts +++ b/src/models/v2/resources/values/update/update-int-value.ts @@ -3,6 +3,9 @@ import { Constants } from "../../../Constants"; import { IBaseIntValue } from "../type-specific-interfaces/base-int-value"; import { UpdateValue } from "./update-value"; +/** + * @category Model V2 + */ @JsonObject("UpdateIntValue") export class UpdateIntValue extends UpdateValue implements IBaseIntValue { diff --git a/src/models/v2/resources/values/update/update-interval-value.ts b/src/models/v2/resources/values/update/update-interval-value.ts index 1771a74f7..3d7780a96 100644 --- a/src/models/v2/resources/values/update/update-interval-value.ts +++ b/src/models/v2/resources/values/update/update-interval-value.ts @@ -4,6 +4,9 @@ import { DecimalConverter } from "../../../custom-converters/decimal-converter"; import { IBaseIntervalValue } from "../type-specific-interfaces/base-interval-value"; import { UpdateValue } from "./update-value"; +/** + * @category Model V2 + */ @JsonObject("UpdateIntervalValue") export class UpdateIntervalValue extends UpdateValue implements IBaseIntervalValue { diff --git a/src/models/v2/resources/values/update/update-link-value.ts b/src/models/v2/resources/values/update/update-link-value.ts index 7b2ee79b3..52a68fc6a 100644 --- a/src/models/v2/resources/values/update/update-link-value.ts +++ b/src/models/v2/resources/values/update/update-link-value.ts @@ -4,6 +4,9 @@ import { IdConverter } from "../../../custom-converters/id-converter"; import { IBaseLinkValue } from "../type-specific-interfaces/base-link-value"; import { UpdateValue } from "./update-value"; +/** + * @category Model V2 + */ @JsonObject("UpdateLinkValue") export class UpdateLinkValue extends UpdateValue implements IBaseLinkValue { diff --git a/src/models/v2/resources/values/update/update-list-value.ts b/src/models/v2/resources/values/update/update-list-value.ts index d47ab62d3..b2f6b627f 100644 --- a/src/models/v2/resources/values/update/update-list-value.ts +++ b/src/models/v2/resources/values/update/update-list-value.ts @@ -4,6 +4,9 @@ import { IdConverter } from "../../../custom-converters/id-converter"; import { IBaseListValue } from "../type-specific-interfaces/base-list-value"; import { UpdateValue } from "./update-value"; +/** + * @category Model V2 + */ @JsonObject("UpdateListValue") export class UpdateListValue extends UpdateValue implements IBaseListValue { diff --git a/src/models/v2/resources/values/update/update-text-value.ts b/src/models/v2/resources/values/update/update-text-value.ts index cd574ee50..0916ae9a8 100644 --- a/src/models/v2/resources/values/update/update-text-value.ts +++ b/src/models/v2/resources/values/update/update-text-value.ts @@ -4,6 +4,9 @@ import { IdConverter } from "../../../custom-converters/id-converter"; import { IBaseTextValueAsString, IBaseTextValueAsXml } from "../type-specific-interfaces/base-text-value"; import { UpdateValue } from "./update-value"; +/** + * @category Model V2 + */ @JsonObject("UpdateTextValueAsString") export class UpdateTextValueAsString extends UpdateValue implements IBaseTextValueAsString { @@ -16,6 +19,9 @@ export class UpdateTextValueAsString extends UpdateValue implements IBaseTextVal } +/** + * @category Model V2 + */ @JsonObject("UpdateTextValueAsXml") export class UpdateTextValueAsXml extends UpdateValue implements IBaseTextValueAsXml { diff --git a/src/models/v2/resources/values/update/update-time-value.ts b/src/models/v2/resources/values/update/update-time-value.ts index a902d9f32..87fc84077 100644 --- a/src/models/v2/resources/values/update/update-time-value.ts +++ b/src/models/v2/resources/values/update/update-time-value.ts @@ -4,6 +4,9 @@ import { DateTimeStampConverter } from "../../../custom-converters/date-time-sta import { IBaseTimeValue } from "../type-specific-interfaces/base-time-value"; import { UpdateValue } from "./update-value"; +/** + * @category Model V2 + */ @JsonObject("UpdateTimeValue") export class UpdateTimeValue extends UpdateValue implements IBaseTimeValue { diff --git a/src/models/v2/resources/values/update/update-uri-value.ts b/src/models/v2/resources/values/update/update-uri-value.ts index d617c9d59..1d20fee2d 100644 --- a/src/models/v2/resources/values/update/update-uri-value.ts +++ b/src/models/v2/resources/values/update/update-uri-value.ts @@ -4,6 +4,9 @@ import { UriConverter } from "../../../custom-converters/uri-converter"; import { IBaseUriValue } from "../type-specific-interfaces/base-uri-value"; import { UpdateValue } from "./update-value"; +/** + * @category Model V2 + */ @JsonObject("UpdateUriValue") export class UpdateUriValue extends UpdateValue implements IBaseUriValue { diff --git a/src/models/v2/resources/values/update/update-value-permissions.ts b/src/models/v2/resources/values/update/update-value-permissions.ts index a63b7c1b0..bf7fab899 100644 --- a/src/models/v2/resources/values/update/update-value-permissions.ts +++ b/src/models/v2/resources/values/update/update-value-permissions.ts @@ -2,6 +2,9 @@ import { JsonObject, JsonProperty } from "json2typescript"; import { Constants } from "../../../Constants"; import { BaseValue } from "../base-value"; +/** + * @category Model V2 + */ @JsonObject("UpdateValuePermissions") export class UpdateValuePermissions extends BaseValue { diff --git a/src/models/v2/resources/values/update/update-value.ts b/src/models/v2/resources/values/update/update-value.ts index 63e65c07f..6627417eb 100644 --- a/src/models/v2/resources/values/update/update-value.ts +++ b/src/models/v2/resources/values/update/update-value.ts @@ -1,6 +1,11 @@ import { JsonObject, JsonProperty } from "json2typescript"; import { WriteValue } from "../write-value"; +/** + * Represents a value to be updated. + * + * @category Model V2 + */ @JsonObject("UpdateValue") export abstract class UpdateValue extends WriteValue { diff --git a/src/models/v2/resources/values/write-value-response.ts b/src/models/v2/resources/values/write-value-response.ts index f4791551a..803b7db37 100644 --- a/src/models/v2/resources/values/write-value-response.ts +++ b/src/models/v2/resources/values/write-value-response.ts @@ -2,6 +2,9 @@ import { JsonObject, JsonProperty } from "json2typescript"; import { Constants } from "../../Constants"; import { BaseValue } from "./base-value"; +/** + * @category Model V2 + */ @JsonObject("WriteValueResponse") export class WriteValueResponse extends BaseValue { diff --git a/src/models/v2/resources/values/write-value.ts b/src/models/v2/resources/values/write-value.ts index 3e0b8c07a..bc19dd069 100644 --- a/src/models/v2/resources/values/write-value.ts +++ b/src/models/v2/resources/values/write-value.ts @@ -2,6 +2,9 @@ import { JsonObject, JsonProperty } from "json2typescript"; import { Constants } from "../../Constants"; import { BaseValue } from "./base-value"; +/** + * @category Internal + */ @JsonObject("WriteValue") export abstract class WriteValue extends BaseValue { diff --git a/src/models/v2/search/count-query-response.ts b/src/models/v2/search/count-query-response.ts index bde1ffca8..37cc97a0b 100644 --- a/src/models/v2/search/count-query-response.ts +++ b/src/models/v2/search/count-query-response.ts @@ -1,6 +1,9 @@ import { JsonObject, JsonProperty } from "json2typescript"; import { Constants } from "../Constants"; +/** + * @category Model V2 + */ @JsonObject("CountQueryResponse") export class CountQueryResponse { diff --git a/src/models/v2/string-literal-v2.ts b/src/models/v2/string-literal-v2.ts index 08831c60e..1f712363e 100644 --- a/src/models/v2/string-literal-v2.ts +++ b/src/models/v2/string-literal-v2.ts @@ -2,6 +2,8 @@ import { JsonObject, JsonProperty } from "json2typescript"; /** * A string with an optional language tag. + * + * @category Model V2 */ @JsonObject("StringLiteralV2") export class StringLiteralV2 { diff --git a/src/util/utils.ts b/src/util/utils.ts index 8d39c46bf..68f3a1a2e 100644 --- a/src/util/utils.ts +++ b/src/util/utils.ts @@ -1,3 +1,6 @@ +/** + * @category Internal + */ export namespace CustomConverterUtils { export const isString = (maybeString: any): boolean => { diff --git a/test-framework/README.md b/test-framework/README.md index 53976cab1..6f766dade 100644 --- a/test-framework/README.md +++ b/test-framework/README.md @@ -1,36 +1,44 @@ -# Purpose of this project +# Purpose of the Test Environment -This Angular application is supposed to test development builds of the `@dasch-swiss/dsp-js` NPM package. -Thus, it does not directly install the package through NPM. +This Angular application allows testing local builds of the `@dasch-swiss/dsp-js` npm package. Instead, it links a local version using the NPM package `yalc`. -## Setup application +## Using the Test Environment -### Install yalc +### Prerequisites -Install the NPM package `yalc` by running `npm install yalc -g`. +If not installed yet, install `yalc` globally by running `npm install yalc -g`. -### Setup development of Knora API package +### Build and Integrate DSP-JS-LIB -Check out https://github.com/dhlab-basel/knora-api-js-lib to the folder of your choice on your computer. +From the project root, build and publish DSP-JS-LIB locally using `yalc`. +Follow the instructions given in the [contribution guidelines](../contribution.md#build-and-publish-a-local-version). -Then, open the root directory of the library in the terminal and run +Then switch to the directory `./test-framework`. +From this directory, run the following scripts: +- `npm run yalc-add` +- `npm install` -```shell -npm install && npm run yalc-publish -``` +### Run Test Angular Application -This command will first install other NPM packages (dependencies), make a local build of the package and then publish the package to the local `yalc` store. +Once you have included the local build with `yalc`, +you can run the test Angular application with `npm run ng s`. -### Setup development of this test application +Note that this requires a running DSP-API instance. +Use the DSP-API release which is specified in `vars.mk`. -Open the root directory of this application the terminal and run: +### Run E2E Tests -```shell -yalc add @dasch-swiss/dsp-js -npm install -``` +To run the E2E tests, you need to build and integrate a local version of DSP-JS-LIB, +see section "Build and Integrate DSP-JS-LIB". +If the Angular test app is running, stop it before running the E2E test. -## Run application +Make sure that DSP-API's database is in its initial state. Reload the data if necessary. -Now you may proceed using the Angular CLI. To see the result in the browser, run `ng serve` in the terminal. +Then, execute the following steps: +- `npm run webdriver-update` to install the required version of Chrome webdriver +- `npm run e2e` + +Alternatively, run `npm run e2e-local` which combines the steps mentioned above. +It installs the locally built version of DSP-JS-LIB using `yalc`, +installs the required version of Chrome webdriver, and runs the E2E tests. diff --git a/typedoc.json b/typedoc.json new file mode 100644 index 000000000..ec17a4598 --- /dev/null +++ b/typedoc.json @@ -0,0 +1,21 @@ +{ + "out": "docs", + "readme": "none", + "name": "@dasch-swiss/dsp-js API Documentation", + "exclude": "**/*.spec.*", + "mode": "file", + "excludeExternals": true, + "excludeNotExported": true, + "excludePrivate": true, + "categoryOrder": [ + "Config", + "Response", + "Endpoint Admin", + "Endpoint V2", + "Endpoint System", + "Model Admin", + "Model V2", + "Model System", + "Internal" + ] +}