mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 09:03:02 +00:00
Compare commits
138 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
522be6643a | ||
|
|
8784309ddb | ||
|
|
3d8f996690 | ||
|
|
36a4bfcbbc | ||
|
|
db347bf324 | ||
|
|
7a2e0f20d1 | ||
|
|
b2d18da82a | ||
|
|
fae7395cf0 | ||
|
|
0745b1af72 | ||
|
|
a2b2cefe8e | ||
|
|
04b21a7c5d | ||
|
|
ca7626db17 | ||
|
|
e8d492a18a | ||
|
|
aa294c4e29 | ||
|
|
369bb906c1 | ||
|
|
aa38fef293 | ||
|
|
ded8e7dfd5 | ||
|
|
d47897c7e8 | ||
|
|
9ab5280b2e | ||
|
|
596788f3a1 | ||
|
|
70271a4849 | ||
|
|
98ab64403f | ||
|
|
3d1bb6ef13 | ||
|
|
d5f39517e8 | ||
|
|
dfe35d71a3 | ||
|
|
cdaa83122f | ||
|
|
937919f1a7 | ||
|
|
3249300dac | ||
|
|
5acf49fd52 | ||
|
|
07b5ad1618 | ||
|
|
d56c3d11a8 | ||
|
|
83f00f40bf | ||
|
|
782ee3758a | ||
|
|
8a28d6fa86 | ||
|
|
ed53c6595e | ||
|
|
49ea2c59ab | ||
|
|
869fa831ea | ||
|
|
21eeecd5ee | ||
|
|
2dfb64bafd | ||
|
|
4ab8770fbc | ||
|
|
2cf1027796 | ||
|
|
3aed37ecb4 | ||
|
|
ddb26b8207 | ||
|
|
805c1f0937 | ||
|
|
5377d026f3 | ||
|
|
148fd77f4d | ||
|
|
4036bfd193 | ||
|
|
f4f372b9ad | ||
|
|
872c1f5fc3 | ||
|
|
4f2ca30dab | ||
|
|
882483ee24 | ||
|
|
c998166938 | ||
|
|
d61e33de39 | ||
|
|
07d6c4770a | ||
|
|
aab3e9fa6c | ||
|
|
4a4cd4e6d4 | ||
|
|
942cd11469 | ||
|
|
fe090c7387 | ||
|
|
f0782d8820 | ||
|
|
a2461d5904 | ||
|
|
d2e0069dc2 | ||
|
|
9c6972af78 | ||
|
|
56b03aa0b9 | ||
|
|
b517837671 | ||
|
|
6f03ede8bf | ||
|
|
952207ace1 | ||
|
|
3d9d28c60c | ||
|
|
913c5691da | ||
|
|
03cdbc6f9b | ||
|
|
9f886a8968 | ||
|
|
e80afe2c93 | ||
|
|
6b10cc86d8 | ||
|
|
1aedd6332f | ||
|
|
790c8bbc3f | ||
|
|
e934017a65 | ||
|
|
88dbedd932 | ||
|
|
8b1b3444fd | ||
|
|
d5f3d71a41 | ||
|
|
cbcf9c9adb | ||
|
|
321e4f6f24 | ||
|
|
8510f11d7b | ||
|
|
68aa377fe2 | ||
|
|
29f2c77ecc | ||
|
|
29bc00616e | ||
|
|
02920af4a4 | ||
|
|
0c14b0f1a0 | ||
|
|
db0a239761 | ||
|
|
377f55bbbe | ||
|
|
8d7a0e10c6 | ||
|
|
4865f911d1 | ||
|
|
15ae5e0873 | ||
|
|
a246bdea84 | ||
|
|
8641bfc877 | ||
|
|
d34e66fbbc | ||
|
|
c6273a85d9 | ||
|
|
5558d29c2b | ||
|
|
69dfd1ae39 | ||
|
|
4638bb3684 | ||
|
|
6c687c6004 | ||
|
|
0bf1301733 | ||
|
|
827ba47892 | ||
|
|
d3b620a745 | ||
|
|
821834cfa0 | ||
|
|
c369c8520a | ||
|
|
66075ef99b | ||
|
|
7a6333aa8f | ||
|
|
e242a21e99 | ||
|
|
6fecd1e89d | ||
|
|
f6a93e668b | ||
|
|
2f96bc8569 | ||
|
|
9ce4026b1a | ||
|
|
e434b2d26e | ||
|
|
fe7f1a53ae | ||
|
|
907d61b5d2 | ||
|
|
5fb9755841 | ||
|
|
e5dd02eeca | ||
|
|
e7b4a426a9 | ||
|
|
7dd74af305 | ||
|
|
4409101647 | ||
|
|
3a141e6cf4 | ||
|
|
8a20e3e873 | ||
|
|
e196303e64 | ||
|
|
70c1a3eaa3 | ||
|
|
6060113df5 | ||
|
|
39d5becb56 | ||
|
|
f5e88569eb | ||
|
|
67041aa39d | ||
|
|
18943612a8 | ||
|
|
d167947e04 | ||
|
|
2a0dc812d8 | ||
|
|
cdb8a6507d | ||
|
|
5bedb27cad | ||
|
|
0d89b14932 | ||
|
|
5de523a4bf | ||
|
|
f97e199bb9 | ||
|
|
abda5cf0ca | ||
|
|
9658f05d31 | ||
|
|
e92bf6f7c7 |
@@ -1,16 +1,13 @@
|
|||||||
image: registry.gitlab.com/openstapps/projectmanagement/node
|
image: registry.gitlab.com/openstapps/projectmanagement/node
|
||||||
|
|
||||||
cache:
|
|
||||||
key: ${CI_COMMIT_REF_SLUG}
|
|
||||||
paths:
|
|
||||||
- node_modules
|
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- npm install
|
- npm install
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
|
- review
|
||||||
- test
|
- test
|
||||||
|
- audit
|
||||||
- deploy
|
- deploy
|
||||||
- publish
|
- publish
|
||||||
|
|
||||||
@@ -25,8 +22,48 @@ build:
|
|||||||
- lib
|
- lib
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
|
|
||||||
|
build-ts-3.8.3:
|
||||||
|
tags:
|
||||||
|
- performance
|
||||||
|
stage: build
|
||||||
|
script:
|
||||||
|
- npm uninstall typescript
|
||||||
|
- npm install typescript@3.8.3
|
||||||
|
- npm run build
|
||||||
|
|
||||||
|
docs_review:
|
||||||
|
dependencies:
|
||||||
|
- build
|
||||||
|
stage: review
|
||||||
|
script:
|
||||||
|
- npm run documentation
|
||||||
|
- ./node_modules/.bin/surge -p ./docs -d https://$CI_PROJECT_PATH_SLUG-$CI_ENVIRONMENT_SLUG.surge.sh/
|
||||||
|
when: manual
|
||||||
|
environment:
|
||||||
|
name: review/$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_NAME
|
||||||
|
url: https://$CI_PROJECT_PATH_SLUG-$CI_ENVIRONMENT_SLUG.surge.sh/
|
||||||
|
on_stop: stop_review
|
||||||
|
except:
|
||||||
|
- master
|
||||||
|
- develop
|
||||||
|
tags:
|
||||||
|
- secrecy
|
||||||
|
|
||||||
|
stop_review:
|
||||||
|
stage: review
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: none
|
||||||
|
script:
|
||||||
|
- ./node_modules/.bin/surge teardown $CI_PROJECT_PATH_SLUG-$CI_ENVIRONMENT_SLUG.surge.sh
|
||||||
|
when: manual
|
||||||
|
environment:
|
||||||
|
name: review/$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_NAME
|
||||||
|
action: stop
|
||||||
|
tags:
|
||||||
|
- secrecy
|
||||||
|
|
||||||
audit:
|
audit:
|
||||||
stage: test
|
stage: audit
|
||||||
script:
|
script:
|
||||||
- npm audit
|
- npm audit
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
@@ -34,9 +71,9 @@ audit:
|
|||||||
- schedules
|
- schedules
|
||||||
|
|
||||||
scheduled-audit:
|
scheduled-audit:
|
||||||
stage: test
|
stage: audit
|
||||||
script:
|
script:
|
||||||
- npm audit
|
- npm audit --audit-level=high
|
||||||
only:
|
only:
|
||||||
- schedules
|
- schedules
|
||||||
|
|
||||||
@@ -51,6 +88,21 @@ test:
|
|||||||
- report
|
- report
|
||||||
- coverage
|
- coverage
|
||||||
|
|
||||||
|
mapping:
|
||||||
|
tags:
|
||||||
|
- performance
|
||||||
|
dependencies:
|
||||||
|
- build
|
||||||
|
stage: test
|
||||||
|
services:
|
||||||
|
- name: registry.gitlab.com/openstapps/database:master
|
||||||
|
alias: elasticsearch
|
||||||
|
script:
|
||||||
|
- npm run mappings-integration
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- lib
|
||||||
|
|
||||||
package:
|
package:
|
||||||
dependencies:
|
dependencies:
|
||||||
- build
|
- build
|
||||||
|
|||||||
5
.mailmap
Normal file
5
.mailmap
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Rainer Killinger <mail-openstapps@killinger.co> Rainer Killinger <git@killinger.co>
|
||||||
|
Rainer Killinger <mail-openstapps@killinger.co> Rainer Killinger <killinge@hrz.uni-frankfurt.de>
|
||||||
|
Rainer Killinger <mail-openstapps@killinger.co> Rainer Killinger <killinger@hrz.uni-frankfurt.de>
|
||||||
|
Wieland Schöbl <wulkanat@gmail.com> wulkanat@gmail.com <wulkanat@gmail.com>
|
||||||
|
Wieland Schöbl <wulkanat@gmail.com> Wieland Schöbl <wieland.schoebl@campus.tu-berlin.de>
|
||||||
318
CHANGELOG.md
318
CHANGELOG.md
@@ -1,9 +1,239 @@
|
|||||||
|
# [0.54.0](https://gitlab.com/openstapps/core/compare/v0.53.0...v0.54.0) (2021-11-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add SCAssessment ([7a2e0f2](https://gitlab.com/openstapps/core/commit/7a2e0f20d1c64ab1deb7ab30bfb4bab4daaabd6d))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.53.0](https://gitlab.com/openstapps/core/compare/v0.52.0...v0.53.0) (2021-10-19)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.52.0](https://gitlab.com/openstapps/core/compare/v0.51.0...v0.52.0) (2021-09-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add about config ([aa294c4](https://gitlab.com/openstapps/core/commit/aa294c4e29e9191bef6d79487b0b321fbc34f6fb))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.51.0](https://gitlab.com/openstapps/core/compare/v0.50.0...v0.51.0) (2021-09-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add physicalobject to book categories ([ded8e7d](https://gitlab.com/openstapps/core/commit/ded8e7dfd51094c02a86e1383a4e94c069c10e64))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.50.0](https://gitlab.com/openstapps/core/compare/v0.49.5...v0.50.0) (2021-09-01)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.49.5](https://gitlab.com/openstapps/core/compare/v0.49.3...v0.49.5) (2021-08-27)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* test resources from hds2 ([dfe35d7](https://gitlab.com/openstapps/core/commit/dfe35d71a38c35064726365f99714abff3b30ba6))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.49.3](https://gitlab.com/openstapps/core/compare/v0.49.2...v0.49.3) (2021-08-18)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.49.2](https://gitlab.com/openstapps/core/compare/v0.49.1...v0.49.2) (2021-08-17)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.49.1](https://gitlab.com/openstapps/core/compare/v0.49.0...v0.49.1) (2021-08-13)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* documentation generation ([8a28d6f](https://gitlab.com/openstapps/core/commit/8a28d6fa8657d778d6ae0d38cda7da3531d6478c))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.49.0](https://gitlab.com/openstapps/core/compare/v0.48.0...v0.49.0) (2021-08-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add elasticsearch mappings to build ([21eeecd](https://gitlab.com/openstapps/core/commit/21eeecd5ee0d68a4faa93bb70d2187ce35807b01))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.48.0](https://gitlab.com/openstapps/core/compare/v0.47.0...v0.48.0) (2021-07-14)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* correct parameter name of thing update route ([872c1f5](https://gitlab.com/openstapps/core/commit/872c1f5fc3884b6df6f5025287873d98b27dd6b1))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* support geo shape queries ([882483e](https://gitlab.com/openstapps/core/commit/882483ee2490938014904bc26687bd1648992ae6))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.47.0](https://gitlab.com/openstapps/core/compare/v0.46.0...v0.47.0) (2021-06-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* set date-series frequency non translatable ([4a4cd4e](https://gitlab.com/openstapps/core/commit/4a4cd4e6d4b01ac34b5338dfcf4aeb959f54461d))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* make SCDateSeries.frequency compliant with schema.org ([942cd11](https://gitlab.com/openstapps/core/commit/942cd1146966aa9e60321160489a6605877925e9))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.46.0](https://gitlab.com/openstapps/core/compare/v0.45.0...v0.46.0) (2021-05-04)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* change range offer to use date range ([9c6972a](https://gitlab.com/openstapps/core/commit/9c6972af787678567409877b6bc9f9417e1374e2))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.45.0](https://gitlab.com/openstapps/core/compare/v0.44.0...v0.45.0) (2021-04-26)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.44.0](https://gitlab.com/openstapps/core/compare/v0.43.0...v0.44.0) (2021-04-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add support for multiple values in the value filter ([913c569](https://gitlab.com/openstapps/core/commit/913c5691da46ad2591fe14bcf7286f12b29ab5ee))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.43.0](https://gitlab.com/openstapps/core/compare/v0.42.0...v0.43.0) (2021-04-07)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.42.0](https://gitlab.com/openstapps/core/compare/v0.41.0...v0.42.0) (2021-02-16)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.41.0](https://gitlab.com/openstapps/core/compare/v0.40.0...v0.41.0) (2021-02-08)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add date, numeric range filter to SCSearchFilter ([8510f11](https://gitlab.com/openstapps/core/commit/8510f11d7b4c62a6b239a70f47fe07e8cc86ab63))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.40.0](https://gitlab.com/openstapps/core/compare/v0.39.0...v0.40.0) (2021-02-05)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add range filter, date sorting support ([29bc006](https://gitlab.com/openstapps/core/commit/29bc00616e87a8d346d8c304fab2e3818921c75e))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.39.0](https://gitlab.com/openstapps/core/compare/v0.38.1...v0.39.0) (2020-12-01)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* extend property value translation retrival ([a246bde](https://gitlab.com/openstapps/core/commit/a246bdea84e0ca390be6ab38723d637626db87d2))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.38.1](https://gitlab.com/openstapps/core/compare/v0.38.0...v0.38.1) (2020-11-02)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.38.0](https://gitlab.com/openstapps/core/compare/v0.37.0...v0.38.0) (2020-10-30)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.37.0](https://gitlab.com/openstapps/core/compare/v0.36.0...v0.37.0) (2020-09-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* remove keyword tag from steps ([c369c85](https://gitlab.com/openstapps/core/commit/c369c8520a2eed169555a35a50ce745c08e1f9da))
|
||||||
|
* remove redundant property declaration ([66075ef](https://gitlab.com/openstapps/core/commit/66075ef99b95198a9cd5c0a396603e089221bcd9))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.36.0](https://gitlab.com/openstapps/core/compare/v0.35.0...v0.36.0) (2020-07-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add function to get translated SCThingType ([fe7f1a5](https://gitlab.com/openstapps/core/commit/fe7f1a53ae46e052e23f1b39851f1547b5a8dded))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.35.0](https://gitlab.com/openstapps/core/compare/v0.34.0...v0.35.0) (2020-05-13)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.34.0](https://gitlab.com/openstapps/core/compare/v0.33.0...v0.34.0) (2020-04-21)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add [@sortable](https://gitlab.com/sortable) tags to certain translatable properties ([f5e8856](https://gitlab.com/openstapps/core/commit/f5e88569eb75578febbcde67259c0c14563e53fe))
|
||||||
|
* annotate SCThing uid and url as filterable ([70c1a3e](https://gitlab.com/openstapps/core/commit/70c1a3eaa3d1c88f4b86f0df86d0d362ad1f930c))
|
||||||
|
* Update src/things/book.ts - made ISBN optional ([6060113](https://gitlab.com/openstapps/core/commit/6060113df56b871bb5014a8a961974895e52158f))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.33.0](https://gitlab.com/openstapps/core/compare/v0.32.0...v0.33.0) (2020-02-11)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.32.0](https://gitlab.com/openstapps/core/compare/v0.31.0...v0.32.0) (2020-02-04)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* make SCContactPoint extend SCThing ([0d89b14](https://gitlab.com/openstapps/core/commit/0d89b1493293f83e9096615f653a6094519d59f2))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.31.0](https://gitlab.com/openstapps/core/compare/v0.30.0...v0.31.0) (2019-11-14)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* remove categories from custom translations ([9658f05](https://gitlab.com/openstapps/core/commit/9658f05d31366b3735da3aa548ef5ed0255d8054))
|
||||||
|
* translator can now handle enum translations ([abda5cf](https://gitlab.com/openstapps/core/commit/abda5cf0caead37f085431e1e5a9771b79272ec6))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.30.0](https://gitlab.com/openstapps/core/compare/v0.29.0...v0.30.0) (2019-11-08)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add aggregatable tag for type field ([443cb74](https://gitlab.com/openstapps/core/commit/443cb748fba1575f5f1e16c550fd33eb7fa7901c))
|
||||||
|
* add new field sequenceIndex to message ([01f92ba](https://gitlab.com/openstapps/core/commit/01f92baa985013bfe1c79fad60351fdaf44bd676))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [0.29.0](https://gitlab.com/openstapps/core/compare/v0.28.0...v0.29.0) (2019-09-17)
|
# [0.29.0](https://gitlab.com/openstapps/core/compare/v0.28.0...v0.29.0) (2019-09-17)
|
||||||
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add mappingIgnoredTags property to SCBackend ([149f3ff](https://gitlab.com/openstapps/core/commit/149f3ff))
|
* add mappingIgnoredTags property to SCBackend ([149f3ff](https://gitlab.com/openstapps/core/commit/149f3ffff15dce27337665abba520d11bc3014dd))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -12,7 +242,7 @@
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add onlyOnType field for SCFacet ([fba63db](https://gitlab.com/openstapps/core/commit/fba63db))
|
* add onlyOnType field for SCFacet ([fba63db](https://gitlab.com/openstapps/core/commit/fba63db137c52212113545be1062d760f0c4213f))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -21,7 +251,7 @@
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add [@filterable](https://gitlab.com/filterable) tags ([fec3371](https://gitlab.com/openstapps/core/commit/fec3371))
|
* add [@filterable](https://gitlab.com/filterable) tags ([fec3371](https://gitlab.com/openstapps/core/commit/fec33715add996ae0a7125ad00ee043d288c6671))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -30,12 +260,12 @@
|
|||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* complete german translations ([bad15dc](https://gitlab.com/openstapps/core/commit/bad15dc))
|
* complete german translations ([bad15dc](https://gitlab.com/openstapps/core/commit/bad15dc8728954ee6ee23fa68c471647328830b9))
|
||||||
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add pluginRequestTimeout field to backend config ([88f579e](https://gitlab.com/openstapps/core/commit/88f579e))
|
* add pluginRequestTimeout field to backend config ([88f579e](https://gitlab.com/openstapps/core/commit/88f579e09bc5e7726dbc4fc788737ba49a0801cd))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -44,7 +274,7 @@
|
|||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* correct package job ([d4a8ef6](https://gitlab.com/openstapps/core/commit/d4a8ef6))
|
* correct package job ([d4a8ef6](https://gitlab.com/openstapps/core/commit/d4a8ef6a9ca69849f8b981804da45e4ba907f37b))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -53,7 +283,7 @@
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add new field receivingOrganisations to message ([d781dd6](https://gitlab.com/openstapps/core/commit/d781dd6))
|
* add new field receivingOrganisations to message ([d781dd6](https://gitlab.com/openstapps/core/commit/d781dd6de5cc7572b9218df959247b93cb2db305))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -62,12 +292,12 @@
|
|||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* use correct generic for the distance filter ([f262a6b](https://gitlab.com/openstapps/core/commit/f262a6b))
|
* use correct generic for the distance filter ([f262a6b](https://gitlab.com/openstapps/core/commit/f262a6b8fa7a9d40234569ec490d5ef8e9437a75))
|
||||||
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add type maps from routes to requests and responses ([e1d4b2b](https://gitlab.com/openstapps/core/commit/e1d4b2b)), closes [#80](https://gitlab.com/openstapps/core/issues/80)
|
* add type maps from routes to requests and responses ([e1d4b2b](https://gitlab.com/openstapps/core/commit/e1d4b2bc9de60a2332788c9a2264760d151c8813)), closes [#80](https://gitlab.com/openstapps/core/issues/80)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -76,8 +306,8 @@
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add mapping type from response to request and vice versa ([c18e3c1](https://gitlab.com/openstapps/core/commit/c18e3c1)), closes [#80](https://gitlab.com/openstapps/core/issues/80)
|
* add mapping type from response to request and vice versa ([c18e3c1](https://gitlab.com/openstapps/core/commit/c18e3c15f1940338b6872343f6b20dba6346f84b)), closes [#80](https://gitlab.com/openstapps/core/issues/80)
|
||||||
* support 404 (resource not found) error on plugin register route ([43851d2](https://gitlab.com/openstapps/core/commit/43851d2))
|
* support 404 (resource not found) error on plugin register route ([43851d2](https://gitlab.com/openstapps/core/commit/43851d2d358c4c342a80a863b059a6447c819c04))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -90,8 +320,8 @@
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add ES annotations ([9c424b0](https://gitlab.com/openstapps/core/commit/9c424b0))
|
* add ES annotations ([9c424b0](https://gitlab.com/openstapps/core/commit/9c424b0f96da26d3aae9ffaadb2c640e7369ca7e))
|
||||||
* add static typed test for consistency ([ff1f554](https://gitlab.com/openstapps/core/commit/ff1f554)), closes [#71](https://gitlab.com/openstapps/core/issues/71)
|
* add static typed test for consistency ([ff1f554](https://gitlab.com/openstapps/core/commit/ff1f554e0beacb5ce2f3308c8212e2b8e4d8cbb0)), closes [#71](https://gitlab.com/openstapps/core/issues/71)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -100,8 +330,8 @@
|
|||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* add translations for every SCThing ([f847a2a](https://gitlab.com/openstapps/core/commit/f847a2a))
|
* add translations for every SCThing ([f847a2a](https://gitlab.com/openstapps/core/commit/f847a2aa0cf576e2fd79197cdc7795638d929136))
|
||||||
* rename properties floor and message so that they are not identical to SCThingTypes ([78b64ba](https://gitlab.com/openstapps/core/commit/78b64ba))
|
* rename properties floor and message so that they are not identical to SCThingTypes ([78b64ba](https://gitlab.com/openstapps/core/commit/78b64bae08d9ca12badaedf921a24fa5ffe90552))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -110,9 +340,9 @@
|
|||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* add thing without references, split thing ([da0507e](https://gitlab.com/openstapps/core/commit/da0507e)), closes [#69](https://gitlab.com/openstapps/core/issues/69)
|
* add thing without references, split thing ([da0507e](https://gitlab.com/openstapps/core/commit/da0507ee341af75cd15dddeeb3f4cbe08899434c)), closes [#69](https://gitlab.com/openstapps/core/issues/69)
|
||||||
* adjust model to remove references from things without references ([ca72c20](https://gitlab.com/openstapps/core/commit/ca72c20)), closes [#69](https://gitlab.com/openstapps/core/issues/69)
|
* adjust model to remove references from things without references ([ca72c20](https://gitlab.com/openstapps/core/commit/ca72c20bd098032745ed0eb6978902b6ff6feac5)), closes [#69](https://gitlab.com/openstapps/core/issues/69)
|
||||||
* remove references from origins ([1d6a2b7](https://gitlab.com/openstapps/core/commit/1d6a2b7)), closes [#69](https://gitlab.com/openstapps/core/issues/69)
|
* remove references from origins ([1d6a2b7](https://gitlab.com/openstapps/core/commit/1d6a2b7841e9c38e68c9e5c718377a9c04fe50d6)), closes [#69](https://gitlab.com/openstapps/core/issues/69)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -121,7 +351,7 @@
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add study module interface ([d3790ad](https://gitlab.com/openstapps/core/commit/d3790ad))
|
* add study module interface ([d3790ad](https://gitlab.com/openstapps/core/commit/d3790adbd82417923d79b4a5a35c74fcaab3e050))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -138,13 +368,13 @@
|
|||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* change SCThingMeta getInstance() return value ([4986042](https://gitlab.com/openstapps/core/commit/4986042))
|
* change SCThingMeta getInstance() return value ([4986042](https://gitlab.com/openstapps/core/commit/4986042428e24a04b73fb03d71c01353588419a7))
|
||||||
* resolve issues with things that can be offered ([623ed61](https://gitlab.com/openstapps/core/commit/623ed61)), closes [#41](https://gitlab.com/openstapps/core/issues/41)
|
* resolve issues with things that can be offered ([623ed61](https://gitlab.com/openstapps/core/commit/623ed613a9405b53a86a33c13d48bc49d48de1ce)), closes [#41](https://gitlab.com/openstapps/core/issues/41)
|
||||||
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* provide context based search ([3242411](https://gitlab.com/openstapps/core/commit/3242411))
|
* provide context based search ([3242411](https://gitlab.com/openstapps/core/commit/324241176849b338bee9f5d1dcaf1109f47a8bb9))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -153,7 +383,7 @@
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add model for plugin register route ([8188731](https://gitlab.com/openstapps/core/commit/8188731))
|
* add model for plugin register route ([8188731](https://gitlab.com/openstapps/core/commit/81887315f8c3038ec37c2197db8e193da835f6fc))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -162,14 +392,14 @@
|
|||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* correct isThing guard ([67868e9](https://gitlab.com/openstapps/core/commit/67868e9))
|
* correct isThing guard ([67868e9](https://gitlab.com/openstapps/core/commit/67868e9eb810de94ca0bb6e1298799ee3f550145))
|
||||||
* update tslint dependencies ([bbe4fca](https://gitlab.com/openstapps/core/commit/bbe4fca))
|
* update tslint dependencies ([bbe4fca](https://gitlab.com/openstapps/core/commit/bbe4fcac42c21c68b5c6aa6bcf9bbdecfdf84de7))
|
||||||
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add conditional "maps" for associated types ([c8bda2e](https://gitlab.com/openstapps/core/commit/c8bda2e)), closes [#50](https://gitlab.com/openstapps/core/issues/50)
|
* add conditional "maps" for associated types ([c8bda2e](https://gitlab.com/openstapps/core/commit/c8bda2eae7f44ec4a284cc26fc85051a9a45e192)), closes [#50](https://gitlab.com/openstapps/core/issues/50)
|
||||||
* provide sample JSON files with the package ([5d1e79d](https://gitlab.com/openstapps/core/commit/5d1e79d)), closes [#46](https://gitlab.com/openstapps/core/issues/46)
|
* provide sample JSON files with the package ([5d1e79d](https://gitlab.com/openstapps/core/commit/5d1e79d4879e6ce8f43d4cebb9d8c8500d5d16b7)), closes [#46](https://gitlab.com/openstapps/core/issues/46)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -178,12 +408,12 @@
|
|||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* add todo to SCThingsWithoutDiff and SCClasses ([9a49442](https://gitlab.com/openstapps/core/commit/9a49442)), closes [#39](https://gitlab.com/openstapps/core/issues/39)
|
* add todo to SCThingsWithoutDiff and SCClasses ([9a49442](https://gitlab.com/openstapps/core/commit/9a49442902a9f49439083a9197bd9f0a231d007d)), closes [#39](https://gitlab.com/openstapps/core/issues/39)
|
||||||
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add SCThingTranslator class. move functionality accordingly ([90e3d22](https://gitlab.com/openstapps/core/commit/90e3d22))
|
* add SCThingTranslator class. move functionality accordingly ([90e3d22](https://gitlab.com/openstapps/core/commit/90e3d2239921bbfcea27b64aef9344ffee270b6d))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -192,8 +422,8 @@
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add laboratory and computer as room categories ([a0ab72e](https://gitlab.com/openstapps/core/commit/a0ab72e)), closes [#33](https://gitlab.com/openstapps/core/issues/33)
|
* add laboratory and computer as room categories ([a0ab72e](https://gitlab.com/openstapps/core/commit/a0ab72e597f6a14cfc0bd8935e1ef765b86b90f7)), closes [#33](https://gitlab.com/openstapps/core/issues/33)
|
||||||
* add maxRequestBodySize in backend configuration ([b5bd09e](https://gitlab.com/openstapps/core/commit/b5bd09e))
|
* add maxRequestBodySize in backend configuration ([b5bd09e](https://gitlab.com/openstapps/core/commit/b5bd09e40bfb49463815538ebaa44ff53b5d7b92))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -202,7 +432,7 @@
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add model for requestBodyTooLargeError ([bc3a0f6](https://gitlab.com/openstapps/core/commit/bc3a0f6))
|
* add model for requestBodyTooLargeError ([bc3a0f6](https://gitlab.com/openstapps/core/commit/bc3a0f6d11cba836a55cbd5787d68cfe655b68a6))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -215,7 +445,7 @@
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add config for maximum queries ([c7ab473](https://gitlab.com/openstapps/core/commit/c7ab473))
|
* add config for maximum queries ([c7ab473](https://gitlab.com/openstapps/core/commit/c7ab47397e2a33b1c460b9038cbf53fec148316d))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -232,7 +462,7 @@
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add model for syntax error ([a3f9fcb](https://gitlab.com/openstapps/core/commit/a3f9fcb))
|
* add model for syntax error ([a3f9fcb](https://gitlab.com/openstapps/core/commit/a3f9fcbfb0c35206adabc95792de076518f604f7))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -241,7 +471,7 @@
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add draft of todo ([2860a11](https://gitlab.com/openstapps/core/commit/2860a11))
|
* add draft of todo ([2860a11](https://gitlab.com/openstapps/core/commit/2860a11b618081ab88ecb1780a280cab37217a0e))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -250,13 +480,13 @@
|
|||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* set larger v8 stack size ([d3d08e7](https://gitlab.com/openstapps/core/commit/d3d08e7))
|
* set larger v8 stack size ([d3d08e7](https://gitlab.com/openstapps/core/commit/d3d08e7735808d4eae5aab4b263e36047c608679))
|
||||||
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add different origin types: remote and user ([13a4965](https://gitlab.com/openstapps/core/commit/13a4965)), closes [#12](https://gitlab.com/openstapps/core/issues/12)
|
* add different origin types: remote and user ([13a4965](https://gitlab.com/openstapps/core/commit/13a49650c4498f6edbe17c9de3598e0180b866da)), closes [#12](https://gitlab.com/openstapps/core/issues/12)
|
||||||
* add saveable thing for saving user/client data ([a4f3fab](https://gitlab.com/openstapps/core/commit/a4f3fab)), closes [#12](https://gitlab.com/openstapps/core/issues/12)
|
* add saveable thing for saving user/client data ([a4f3fab](https://gitlab.com/openstapps/core/commit/a4f3fab033ca18352c0119061f2d0e64252d4bbb)), closes [#12](https://gitlab.com/openstapps/core/issues/12)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -265,7 +495,7 @@
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* use tag [@validatable](https://gitlab.com/validatable) to mark schema types ([7f248ee](https://gitlab.com/openstapps/core/commit/7f248ee))
|
* use tag [@validatable](https://gitlab.com/validatable) to mark schema types ([7f248ee](https://gitlab.com/openstapps/core/commit/7f248eea13c732a95c4ee8e1bc91afeee52e8c2d))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -274,9 +504,9 @@
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add base scheme for academic degrees ([85c8fc4](https://gitlab.com/openstapps/core/commit/85c8fc4))
|
* add base scheme for academic degrees ([85c8fc4](https://gitlab.com/openstapps/core/commit/85c8fc49c14b0ce45cf0cfdaf46c1ebe43b23ec7))
|
||||||
* add schema for course of studies ([2d4a76a](https://gitlab.com/openstapps/core/commit/2d4a76a))
|
* add schema for course of studies ([2d4a76a](https://gitlab.com/openstapps/core/commit/2d4a76a555603a395c81a7a92ce5d95ed04de9de))
|
||||||
* add tool to generate documentation for routes ([1a07df2](https://gitlab.com/openstapps/core/commit/1a07df2))
|
* add tool to generate documentation for routes ([1a07df2](https://gitlab.com/openstapps/core/commit/1a07df2d676895264f43b0138645d7c13f60c9db))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -284,12 +514,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [0.0.1](https://gitlab.com/openstapps/core/compare/2d770dd...v0.0.1) (2018-11-29)
|
## [0.0.1](https://gitlab.com/openstapps/core/compare/2d770dde4464dc4cf4cdc29927aa4e4382914148...v0.0.1) (2018-11-29)
|
||||||
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add core ([2d770dd](https://gitlab.com/openstapps/core/commit/2d770dd))
|
* add core ([2d770dd](https://gitlab.com/openstapps/core/commit/2d770dde4464dc4cf4cdc29927aa4e4382914148))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
12
README.md
12
README.md
@@ -36,15 +36,17 @@ Annotations are used to add additional informations to fields, which are used to
|
|||||||
External dependencies can not be covered by the annotations. Documentation about some of the annotations can be found in: [typedoc](https://typedoc.org/guides/doccomments/)
|
External dependencies can not be covered by the annotations. Documentation about some of the annotations can be found in: [typedoc](https://typedoc.org/guides/doccomments/)
|
||||||
|
|
||||||
| annotation | description | parameters |
|
| annotation | description | parameters |
|
||||||
|-------------------|-------------------------------------------|---------------|
|
|-------------------|-------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------|
|
||||||
| `@aggregatable` | used for generating of aggregations of the field if the core schema is used to put data into a database/key-value store | whether the property is being used on the top type or across all types: `global` |
|
| `@aggregatable` | used for generating of aggregations of the field if the core schema is used to put data into a database/key-value store | whether the property is being used on the top type or across all types: `global` |
|
||||||
| `@float` | number field is interpreted as float | |
|
| `@float` | number field is interpreted as float | |
|
||||||
| `@indexable` | marks the type as indexable if the core schema is used to put data into a database/key-value store| |
|
| `@indexable` | marks the type as indexable if the core schema is used to put data into a database/key-value store | |
|
||||||
| `@integer` | number field is interpreted as integer | |
|
| `@integer` | number field is interpreted as integer | |
|
||||||
| `@keyword` | string field is interpreted as keyword | |
|
| `@keyword` | string field is interpreted as keyword | |
|
||||||
| `@sortable` | field is sortable if the core schema is used to put data into a database/key-value store | sort method to be used: `ducet`, `price`, `distance` |
|
| `@sortable` | field is sortable if the core schema is used to put data into a database/key-value store. Fields are always sortable through generic sort, even without annotation. | sort method to be used: `ducet`, `price`, `distance` |
|
||||||
| `@text` | string field is interpreted as text | |
|
| `@text` | string field is interpreted as text | |
|
||||||
| `@validatable` | marks the type as validatable if the core schema is used to put data into a database/key-value store | |
|
| `@date` | string field is interpreted as a date field | |
|
||||||
|
| `@validatable` | Marks the type for json schema generation, which can be checked at runtime. Any top-level type that is put into a database should always be marked as validatable. | |
|
||||||
| `@filterable` | non-object/nested field is filterable if the core schema is used to put data into a database/key-value store | |
|
| `@filterable` | non-object/nested field is filterable if the core schema is used to put data into a database/key-value store | |
|
||||||
|
| `@inheritTags` | inherit all tags from another field | `[SCThingType]::[field]` |
|
||||||
|
|
||||||
|
*Note: tags ignore casing, but for consistency they should use the variants proposed here.*
|
||||||
|
|||||||
7103
package-lock.json
generated
7103
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
74
package.json
74
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@openstapps/core",
|
"name": "@openstapps/core",
|
||||||
"version": "0.30.0",
|
"version": "0.55.0",
|
||||||
"description": "StAppsCore - Generalized model of data",
|
"description": "StAppsCore - Generalized model of data",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"Model",
|
"Model",
|
||||||
@@ -14,67 +14,75 @@
|
|||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"types": "./lib/index.d.ts",
|
"types": "./lib/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npm run tslint && npm run compile && npm run pack && npm run schema",
|
"build": "npm run tslint && npm run compile && npm run pack && npm run schema && npm run mappings",
|
||||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md && git commit -m 'docs: update changelog'",
|
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md && git commit -m 'docs: update changelog'",
|
||||||
"check-configuration": "openstapps-configuration",
|
"check-configuration": "openstapps-configuration",
|
||||||
"compile": "rimraf lib && tsc",
|
"compile": "rimraf lib && tsc",
|
||||||
"documentation": "typedoc --name \"@openstapps/core\" --includeDeclarations --mode modules --out docs --readme README.md --listInvalidSymbolLinks lib",
|
"documentation": "typedoc --name \"@openstapps/core\" --includeVersion --out docs --readme README.md --listInvalidSymbolLinks src",
|
||||||
"pack": "openstapps-core-tools pack",
|
"pack": "openstapps-core-tools pack",
|
||||||
"postversion": "npm run changelog",
|
"postversion": "npm run changelog",
|
||||||
"prepublishOnly": "npm ci && npm run build",
|
"prepublishOnly": "npm ci && npm run build",
|
||||||
"preversion": "npm run prepublishOnly",
|
"preversion": "npm run prepublishOnly",
|
||||||
"push": "git push && git push origin \"v$npm_package_version\"",
|
"push": "git push && git push origin \"v$npm_package_version\"",
|
||||||
"schema": "node --max-old-space-size=8192 --stack-size=10240 ./node_modules/.bin/openstapps-core-tools schema src lib/schema",
|
"schema": "node --max-old-space-size=8192 --stack-size=10240 ./node_modules/.bin/openstapps-core-tools schema src lib/schema",
|
||||||
"test": "nyc mocha --require ts-node/register --require source-map-support/register --ui mocha-typescript test/*.spec.ts",
|
"mappings": "mkdir lib/mappings && openstapps-es-mapping-generator mapping ../core/src -i minlength,pattern,see,tjs-format -m lib/mappings/mappings.json -a lib/mappings/aggregations.json",
|
||||||
|
"mappings-integration": "openstapps-es-mapping-generator put-es-templates lib/mappings/mappings.json http://elasticsearch:9200/",
|
||||||
|
"test": "nyc mocha --require ts-node/register --recursive 'test/*.spec.ts'",
|
||||||
"tslint": "tslint -p tsconfig.json -c tslint.json 'src/**/*.ts'"
|
"tslint": "tslint -p tsconfig.json -c tslint.json 'src/**/*.ts'"
|
||||||
},
|
},
|
||||||
"author": "Karl-Philipp Wulfert <krlwlfrt@gmail.com>",
|
"author": "Karl-Philipp Wulfert <krlwlfrt@gmail.com>",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"Andreas Lehmann",
|
"Andreas Lehmann",
|
||||||
"Anselm Stordeur <anselmstordeur@gmail.com>",
|
"Anselm Stordeur <anselmstordeur@gmail.com>",
|
||||||
|
"Axel Nieder-Vahrenholz",
|
||||||
"Benjamin Jöckel",
|
"Benjamin Jöckel",
|
||||||
"Imran Hossain",
|
"Frank Nagel",
|
||||||
"Jovan Krunić <jovan.krunic@gmail.com>",
|
"Jovan Krunić <jovan.krunic@gmail.com>",
|
||||||
"Michel Jonathan Schmitz",
|
"Michel Jonathan Schmitz",
|
||||||
"Rainer Killinger",
|
"Rainer Killinger <mail-openstapps@killinger.co>",
|
||||||
|
"Roman Klopsch",
|
||||||
"Sebastian Lange",
|
"Sebastian Lange",
|
||||||
"Wieland Schöbl",
|
"Wieland Schöbl"
|
||||||
"Roman Klopsch"
|
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@openstapps/core-tools": "0.27.0",
|
||||||
"@types/geojson": "1.0.6",
|
"@types/geojson": "1.0.6",
|
||||||
"@types/json-patch": "0.0.30",
|
"@types/json-patch": "0.0.30",
|
||||||
"@types/node": "10.14.14",
|
"@types/json-schema": "7.0.9",
|
||||||
|
"@types/node": "14.18.0",
|
||||||
"fast-clone": "1.5.13",
|
"fast-clone": "1.5.13",
|
||||||
"http-status-codes": "1.3.2",
|
"fast-deep-equal": "3.1.3",
|
||||||
|
"http-status-codes": "2.1.4",
|
||||||
"json-patch": "0.7.0",
|
"json-patch": "0.7.0",
|
||||||
"jsonschema": "1.2.4",
|
"json-schema": "0.4.0",
|
||||||
"ts-optchain": "0.1.3"
|
"ts-optchain": "0.1.8"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@krlwlfrt/async-pool": "0.1.0",
|
"@openstapps/configuration": "0.29.0",
|
||||||
"@openstapps/configuration": "0.21.1",
|
"@openstapps/es-mapping-generator": "0.0.3",
|
||||||
"@openstapps/core-tools": "0.8.0",
|
"@openstapps/logger": "0.8.0",
|
||||||
"@openstapps/logger": "0.4.0",
|
"@testdeck/mocha": "0.2.0",
|
||||||
"@types/chai": "4.1.7",
|
"@types/chai": "4.3.0",
|
||||||
"@types/rimraf": "2.0.2",
|
"@types/lodash": "4.14.178",
|
||||||
"chai": "4.2.0",
|
"@types/mocha": "9.0.0",
|
||||||
"commander": "2.20.0",
|
"@types/rimraf": "3.0.2",
|
||||||
"conditional-type-checks": "1.0.1",
|
"chai": "4.3.4",
|
||||||
"conventional-changelog-cli": "2.0.23",
|
"conditional-type-checks": "1.0.5",
|
||||||
"mocha": "6.2.0",
|
"conventional-changelog-cli": "2.1.1",
|
||||||
"mocha-typescript": "1.1.17",
|
"lodash": "4.17.21",
|
||||||
"nyc": "14.1.1",
|
"mocha": "9.1.3",
|
||||||
"rimraf": "2.6.3",
|
"nyc": "15.1.0",
|
||||||
"source-map-support": "0.5.13",
|
"rimraf": "3.0.2",
|
||||||
"ts-node": "8.3.0",
|
"source-map-support": "0.5.21",
|
||||||
"tslint": "5.18.0",
|
"surge": "0.23.0",
|
||||||
"typedoc": "0.14.2",
|
"ts-node": "10.4.0",
|
||||||
"typescript": "3.5.3"
|
"tslint": "6.1.3",
|
||||||
|
"typedoc": "0.21.6",
|
||||||
|
"typescript": "4.3.5"
|
||||||
},
|
},
|
||||||
"nyc": {
|
"nyc": {
|
||||||
"all": true,
|
"all": true,
|
||||||
"branches": 85,
|
"branches": 90,
|
||||||
"check-coverage": true,
|
"check-coverage": true,
|
||||||
"exclude": [],
|
"exclude": [],
|
||||||
"extension": [
|
"extension": [
|
||||||
@@ -84,6 +92,8 @@
|
|||||||
"include": [
|
"include": [
|
||||||
"src/protocol/route.ts",
|
"src/protocol/route.ts",
|
||||||
"src/things/abstract/thing.ts",
|
"src/things/abstract/thing.ts",
|
||||||
|
"src/things/abstract/thing-that-can-be-offered.ts",
|
||||||
|
"src/things/abstract/thing-with-categories.ts",
|
||||||
"src/translator.ts",
|
"src/translator.ts",
|
||||||
"src/guards.ts"
|
"src/guards.ts"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2019 StApps
|
* Copyright (C) 2019-2021 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -15,7 +15,8 @@
|
|||||||
// tslint:disable-next-line:no-implicit-dependencies
|
// tslint:disable-next-line:no-implicit-dependencies
|
||||||
import {Polygon} from 'geojson';
|
import {Polygon} from 'geojson';
|
||||||
import {SCTranslations} from '../general/i18n';
|
import {SCTranslations} from '../general/i18n';
|
||||||
import {SCSetting} from '../things/setting';
|
import {SCMap} from '../general/map';
|
||||||
|
import {SCLanguageSetting, SCSetting, SCUserGroupSetting} from '../things/setting';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An app configuration menu item
|
* An app configuration menu item
|
||||||
@@ -80,6 +81,13 @@ export interface SCAppConfigurationMenuCategory {
|
|||||||
* An app configuration
|
* An app configuration
|
||||||
*/
|
*/
|
||||||
export interface SCAppConfiguration {
|
export interface SCAppConfiguration {
|
||||||
|
/**
|
||||||
|
* The about page
|
||||||
|
*
|
||||||
|
* Mapping route -> page config
|
||||||
|
*/
|
||||||
|
aboutPages: SCMap<SCAboutPage>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Polygon that encapsulates the main campus
|
* Polygon that encapsulates the main campus
|
||||||
*/
|
*/
|
||||||
@@ -112,8 +120,9 @@ export interface SCAppConfiguration {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of available settings in the app
|
* A list of available settings in the app
|
||||||
|
* !Important! Use provided specific settings, for other settings use general SCSetting
|
||||||
*/
|
*/
|
||||||
settings: SCSetting[];
|
settings: Array<SCUserGroupSetting | SCLanguageSetting | SCSetting>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map of store URLs
|
* Map of store URLs
|
||||||
@@ -173,3 +182,147 @@ export interface SCAppConfigurationMenuCategoryTranslationName {
|
|||||||
*/
|
*/
|
||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum SCAboutPageContentType {
|
||||||
|
SECTION = 'section',
|
||||||
|
ROUTER_LINK = 'router link',
|
||||||
|
TABLE = 'table',
|
||||||
|
MARKDOWN = 'markdown',
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SCAboutPageTranslationTitle {
|
||||||
|
/**
|
||||||
|
* Translation of the title
|
||||||
|
*/
|
||||||
|
title: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SCAboutPageTranslationValue {
|
||||||
|
/**
|
||||||
|
* Translation of the value
|
||||||
|
*/
|
||||||
|
value: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A (mostly) self-contained section, akin to markdown `# Title`
|
||||||
|
*/
|
||||||
|
export interface SCAboutPageSection {
|
||||||
|
/**
|
||||||
|
* If the section should be contained in a card
|
||||||
|
*/
|
||||||
|
card?: true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The content of the section
|
||||||
|
*/
|
||||||
|
content: SCAboutPageContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The title of the section
|
||||||
|
*/
|
||||||
|
title: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translations
|
||||||
|
*/
|
||||||
|
translations: SCTranslations<SCAboutPageTranslationTitle>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type
|
||||||
|
*/
|
||||||
|
type: SCAboutPageContentType.SECTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A router link that can lead to a new page
|
||||||
|
*
|
||||||
|
* For external links, prefer markdown `[destination](link)`
|
||||||
|
*/
|
||||||
|
export interface SCAboutPageRouterLink {
|
||||||
|
/**
|
||||||
|
* Icon of the destination
|
||||||
|
*/
|
||||||
|
icon?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Router link
|
||||||
|
*/
|
||||||
|
link: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Title of the destination
|
||||||
|
*/
|
||||||
|
title: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translations
|
||||||
|
*/
|
||||||
|
translations: SCTranslations<SCAboutPageTranslationTitle>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type
|
||||||
|
*/
|
||||||
|
type: SCAboutPageContentType.ROUTER_LINK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A simple table element
|
||||||
|
*/
|
||||||
|
export interface SCAboutPageTable {
|
||||||
|
/**
|
||||||
|
* Rows of the table
|
||||||
|
*/
|
||||||
|
rows: SCAboutPageContent[][];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type
|
||||||
|
*/
|
||||||
|
type: SCAboutPageContentType.TABLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A markdown element
|
||||||
|
*/
|
||||||
|
export interface SCAboutPageMarkdown {
|
||||||
|
/**
|
||||||
|
* Translations
|
||||||
|
*/
|
||||||
|
translations: SCTranslations<SCAboutPageTranslationValue>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type
|
||||||
|
*/
|
||||||
|
type: SCAboutPageContentType.MARKDOWN;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Value (Markdown)
|
||||||
|
*/
|
||||||
|
value: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type SCAboutPageContent =
|
||||||
|
| SCAboutPageMarkdown
|
||||||
|
| SCAboutPageTable
|
||||||
|
| SCAboutPageSection
|
||||||
|
| SCAboutPageRouterLink;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Root of the about page
|
||||||
|
*/
|
||||||
|
export interface SCAboutPage {
|
||||||
|
/**
|
||||||
|
* Content of the page
|
||||||
|
*/
|
||||||
|
content: SCAboutPageContent[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Header (title) of the page
|
||||||
|
*/
|
||||||
|
title: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translations
|
||||||
|
*/
|
||||||
|
translations: SCTranslations<SCAboutPageTranslationTitle>;
|
||||||
|
}
|
||||||
|
|||||||
@@ -16,8 +16,10 @@
|
|||||||
/**
|
/**
|
||||||
* An ISO8601 date
|
* An ISO8601 date
|
||||||
*
|
*
|
||||||
* @pattern ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$
|
* @pattern ^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])(T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])([\.,][0-9]{0,7})?(Z|[+-](?:2[0-3]|[01][0-9])(:?[0-5][0-9])?)?)?$
|
||||||
* @see https://gist.github.com/philipashlock/8830168
|
* @see https://gist.github.com/philipashlock/8830168
|
||||||
|
*
|
||||||
|
* @date
|
||||||
*/
|
*/
|
||||||
export type SCISO8601Date = string;
|
export type SCISO8601Date = string;
|
||||||
/* tslint:enable */
|
/* tslint:enable */
|
||||||
@@ -35,6 +37,6 @@ export type SCISO8601Duration = string;
|
|||||||
/**
|
/**
|
||||||
* An ISO8601 time
|
* An ISO8601 time
|
||||||
*
|
*
|
||||||
* @pattern \d{2}:\d{2}(:\d{2})?
|
* @pattern ^(2[0-3]|[01][0-9]):?([0-5][0-9]):?([0-5][0-9])$
|
||||||
*/
|
*/
|
||||||
export type SCISO8601Time = string;
|
export type SCISO8601Time = string;
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
/**
|
/**
|
||||||
* Universally unique identifier of the thing
|
* Universally unique identifier of the thing
|
||||||
*
|
*
|
||||||
|
* @filterable
|
||||||
* @pattern ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
|
* @pattern ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
|
||||||
* @see http://stackoverflow.com/questions/7905929/how-to-test-valid-uuid-guid
|
* @see http://stackoverflow.com/questions/7905929/how-to-test-valid-uuid-guid
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export function isThing(something: unknown): something is SCThing {
|
|||||||
|
|
||||||
return Object
|
return Object
|
||||||
.values(SCThingType)
|
.values(SCThingType)
|
||||||
.indexOf(type) >= 0;
|
.indexOf(type as SCThingType) >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
46
src/meta.ts
46
src/meta.ts
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2019 StApps
|
* Copyright (C) 2019-2021 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -15,10 +15,12 @@
|
|||||||
import {SCThingType} from './things/abstract/thing';
|
import {SCThingType} from './things/abstract/thing';
|
||||||
import {SCAcademicEvent, SCAcademicEventMeta, SCAcademicEventWithoutReferences} from './things/academic-event';
|
import {SCAcademicEvent, SCAcademicEventMeta, SCAcademicEventWithoutReferences} from './things/academic-event';
|
||||||
import {SCArticle, SCArticleMeta, SCArticleWithoutReferences} from './things/article';
|
import {SCArticle, SCArticleMeta, SCArticleWithoutReferences} from './things/article';
|
||||||
|
import {SCAssessment, SCAssessmentMeta, SCAssessmentWithoutReferences} from './things/assessment';
|
||||||
import {SCBook, SCBookMeta, SCBookWithoutReferences} from './things/book';
|
import {SCBook, SCBookMeta, SCBookWithoutReferences} from './things/book';
|
||||||
import {SCBuilding, SCBuildingMeta, SCBuildingWithoutReferences} from './things/building';
|
import {SCBuilding, SCBuildingMeta, SCBuildingWithoutReferences} from './things/building';
|
||||||
import {SCCatalog, SCCatalogMeta, SCCatalogWithoutReferences} from './things/catalog';
|
import {SCCatalog, SCCatalogMeta, SCCatalogWithoutReferences} from './things/catalog';
|
||||||
import {SCCourseOfStudies, SCCourseOfStudiesMeta, SCCourseOfStudiesWithoutReferences} from './things/course-of-studies';
|
import {SCContactPoint, SCContactPointMeta, SCContactPointWithoutReferences} from './things/contact-point';
|
||||||
|
import {SCCourseOfStudy, SCCourseOfStudyMeta, SCCourseOfStudyWithoutReferences} from './things/course-of-study';
|
||||||
import {SCDateSeries, SCDateSeriesMeta, SCDateSeriesWithoutReferences} from './things/date-series';
|
import {SCDateSeries, SCDateSeriesMeta, SCDateSeriesWithoutReferences} from './things/date-series';
|
||||||
import {SCDiff, SCDiffMeta, SCDiffWithoutReferences} from './things/diff';
|
import {SCDiff, SCDiffMeta, SCDiffWithoutReferences} from './things/diff';
|
||||||
import {SCDish, SCDishMeta, SCDishWithoutReferences} from './things/dish';
|
import {SCDish, SCDishMeta, SCDishWithoutReferences} from './things/dish';
|
||||||
@@ -26,8 +28,14 @@ import {SCFavorite, SCFavoriteMeta, SCFavoriteWithoutReferences} from './things/
|
|||||||
import {SCFloor, SCFloorMeta, SCFloorWithoutReferences} from './things/floor';
|
import {SCFloor, SCFloorMeta, SCFloorWithoutReferences} from './things/floor';
|
||||||
import {SCMessage, SCMessageMeta, SCMessageWithoutReferences} from './things/message';
|
import {SCMessage, SCMessageMeta, SCMessageWithoutReferences} from './things/message';
|
||||||
import {SCOrganization, SCOrganizationMeta, SCOrganizationWithoutReferences} from './things/organization';
|
import {SCOrganization, SCOrganizationMeta, SCOrganizationWithoutReferences} from './things/organization';
|
||||||
|
import {SCPeriodical, SCPeriodicalMeta, SCPeriodicalWithoutReferences} from './things/periodical';
|
||||||
import {SCPerson, SCPersonMeta, SCPersonWithoutReferences} from './things/person';
|
import {SCPerson, SCPersonMeta, SCPersonWithoutReferences} from './things/person';
|
||||||
import {SCPointOfInterest, SCPointOfInterestMeta, SCPointOfInterestWithoutReferences} from './things/point-of-interest';
|
import {SCPointOfInterest, SCPointOfInterestMeta, SCPointOfInterestWithoutReferences} from './things/point-of-interest';
|
||||||
|
import {
|
||||||
|
SCPublicationEvent,
|
||||||
|
SCPublicationEventMeta,
|
||||||
|
SCPublicationEventWithoutReferences,
|
||||||
|
} from './things/publication-event';
|
||||||
import {SCRoom, SCRoomMeta, SCRoomWithoutReferences} from './things/room';
|
import {SCRoom, SCRoomMeta, SCRoomWithoutReferences} from './things/room';
|
||||||
import {SCSemester, SCSemesterMeta, SCSemesterWithoutReferences} from './things/semester';
|
import {SCSemester, SCSemesterMeta, SCSemesterWithoutReferences} from './things/semester';
|
||||||
import {SCSetting, SCSettingMeta, SCSettingWithoutReferences} from './things/setting';
|
import {SCSetting, SCSettingMeta, SCSettingWithoutReferences} from './things/setting';
|
||||||
@@ -44,12 +52,14 @@ import {SCVideo, SCVideoMeta, SCVideoWithoutReferences} from './things/video';
|
|||||||
*/
|
*/
|
||||||
export const SCClasses: { [K in SCThingType]: object } = {
|
export const SCClasses: { [K in SCThingType]: object } = {
|
||||||
/* tslint:enable */
|
/* tslint:enable */
|
||||||
|
'assessment': SCAssessmentMeta,
|
||||||
'academic event': SCAcademicEventMeta,
|
'academic event': SCAcademicEventMeta,
|
||||||
'article': SCArticleMeta,
|
'article': SCArticleMeta,
|
||||||
'book': SCBookMeta,
|
'book': SCBookMeta,
|
||||||
'building': SCBuildingMeta,
|
'building': SCBuildingMeta,
|
||||||
'catalog': SCCatalogMeta,
|
'catalog': SCCatalogMeta,
|
||||||
'course of studies': SCCourseOfStudiesMeta,
|
'contact point': SCContactPointMeta,
|
||||||
|
'course of study': SCCourseOfStudyMeta,
|
||||||
'date series': SCDateSeriesMeta,
|
'date series': SCDateSeriesMeta,
|
||||||
'diff': SCDiffMeta,
|
'diff': SCDiffMeta,
|
||||||
'dish': SCDishMeta,
|
'dish': SCDishMeta,
|
||||||
@@ -57,8 +67,10 @@ export const SCClasses: { [K in SCThingType]: object } = {
|
|||||||
'floor': SCFloorMeta,
|
'floor': SCFloorMeta,
|
||||||
'message': SCMessageMeta,
|
'message': SCMessageMeta,
|
||||||
'organization': SCOrganizationMeta,
|
'organization': SCOrganizationMeta,
|
||||||
|
'periodical': SCPeriodicalMeta,
|
||||||
'person': SCPersonMeta,
|
'person': SCPersonMeta,
|
||||||
'point of interest': SCPointOfInterestMeta,
|
'point of interest': SCPointOfInterestMeta,
|
||||||
|
'publication event': SCPublicationEventMeta,
|
||||||
'room': SCRoomMeta,
|
'room': SCRoomMeta,
|
||||||
'semester': SCSemesterMeta,
|
'semester': SCSemesterMeta,
|
||||||
'setting': SCSettingMeta,
|
'setting': SCSettingMeta,
|
||||||
@@ -70,24 +82,26 @@ export const SCClasses: { [K in SCThingType]: object } = {
|
|||||||
'video': SCVideoMeta,
|
'video': SCVideoMeta,
|
||||||
};
|
};
|
||||||
|
|
||||||
export type SCThingsWithoutDiff =
|
export type SCIndexableThings =
|
||||||
SCAcademicEvent
|
SCAssessment
|
||||||
|
| SCAcademicEvent
|
||||||
| SCArticle
|
| SCArticle
|
||||||
| SCBook
|
| SCBook
|
||||||
| SCBuilding
|
| SCBuilding
|
||||||
| SCCatalog
|
| SCCatalog
|
||||||
| SCCourseOfStudies
|
| SCContactPoint
|
||||||
|
| SCCourseOfStudy
|
||||||
| SCDateSeries
|
| SCDateSeries
|
||||||
| SCDish
|
| SCDish
|
||||||
| SCFavorite
|
|
||||||
| SCFloor
|
| SCFloor
|
||||||
| SCMessage
|
| SCMessage
|
||||||
| SCOrganization
|
| SCOrganization
|
||||||
|
| SCPeriodical
|
||||||
| SCPerson
|
| SCPerson
|
||||||
| SCPointOfInterest
|
| SCPointOfInterest
|
||||||
|
| SCPublicationEvent
|
||||||
| SCRoom
|
| SCRoom
|
||||||
| SCSemester
|
| SCSemester
|
||||||
| SCSetting
|
|
||||||
| SCSportCourse
|
| SCSportCourse
|
||||||
| SCStudyModule
|
| SCStudyModule
|
||||||
| SCTicket
|
| SCTicket
|
||||||
@@ -99,8 +113,8 @@ export type SCThingsWithoutDiff =
|
|||||||
* An object that exists in the StAppsCore
|
* An object that exists in the StAppsCore
|
||||||
*/
|
*/
|
||||||
export type SCThings =
|
export type SCThings =
|
||||||
SCThingsWithoutDiff
|
SCIndexableThings
|
||||||
| SCDiff;
|
| SCDiff | SCFavorite | SCSetting;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A field of a thing
|
* A field of a thing
|
||||||
@@ -111,12 +125,14 @@ export type SCThingsField = keyof SCThings | string;
|
|||||||
* Thing without references for a thing
|
* Thing without references for a thing
|
||||||
*/
|
*/
|
||||||
export type SCAssociatedThingWithoutReferences<THING extends SCThings> =
|
export type SCAssociatedThingWithoutReferences<THING extends SCThings> =
|
||||||
|
THING extends SCAssessment ? SCAssessmentWithoutReferences :
|
||||||
THING extends SCAcademicEvent ? SCAcademicEventWithoutReferences :
|
THING extends SCAcademicEvent ? SCAcademicEventWithoutReferences :
|
||||||
THING extends SCArticle ? SCArticleWithoutReferences :
|
THING extends SCArticle ? SCArticleWithoutReferences :
|
||||||
THING extends SCBook ? SCBookWithoutReferences :
|
THING extends SCBook ? SCBookWithoutReferences :
|
||||||
THING extends SCBuilding ? SCBuildingWithoutReferences :
|
THING extends SCBuilding ? SCBuildingWithoutReferences :
|
||||||
THING extends SCCatalog ? SCCatalogWithoutReferences :
|
THING extends SCCatalog ? SCCatalogWithoutReferences :
|
||||||
THING extends SCCourseOfStudies ? SCCourseOfStudiesWithoutReferences :
|
THING extends SCContactPoint ? SCContactPointWithoutReferences :
|
||||||
|
THING extends SCCourseOfStudy ? SCCourseOfStudyWithoutReferences :
|
||||||
THING extends SCDateSeries ? SCDateSeriesWithoutReferences :
|
THING extends SCDateSeries ? SCDateSeriesWithoutReferences :
|
||||||
THING extends SCDiff ? SCDiffWithoutReferences :
|
THING extends SCDiff ? SCDiffWithoutReferences :
|
||||||
THING extends SCDish ? SCDishWithoutReferences :
|
THING extends SCDish ? SCDishWithoutReferences :
|
||||||
@@ -124,8 +140,10 @@ export type SCAssociatedThingWithoutReferences<THING extends SCThings> =
|
|||||||
THING extends SCFloor ? SCFloorWithoutReferences :
|
THING extends SCFloor ? SCFloorWithoutReferences :
|
||||||
THING extends SCMessage ? SCMessageWithoutReferences :
|
THING extends SCMessage ? SCMessageWithoutReferences :
|
||||||
THING extends SCOrganization ? SCOrganizationWithoutReferences :
|
THING extends SCOrganization ? SCOrganizationWithoutReferences :
|
||||||
|
THING extends SCPeriodical ? SCPeriodicalWithoutReferences :
|
||||||
THING extends SCPerson ? SCPersonWithoutReferences :
|
THING extends SCPerson ? SCPersonWithoutReferences :
|
||||||
THING extends SCPointOfInterest ? SCPointOfInterestWithoutReferences :
|
THING extends SCPointOfInterest ? SCPointOfInterestWithoutReferences :
|
||||||
|
THING extends SCPublicationEvent ? SCPublicationEventWithoutReferences :
|
||||||
THING extends SCRoom ? SCRoomWithoutReferences :
|
THING extends SCRoom ? SCRoomWithoutReferences :
|
||||||
THING extends SCSemester ? SCSemesterWithoutReferences :
|
THING extends SCSemester ? SCSemesterWithoutReferences :
|
||||||
THING extends SCSetting ? SCSettingWithoutReferences :
|
THING extends SCSetting ? SCSettingWithoutReferences :
|
||||||
@@ -141,12 +159,14 @@ export type SCAssociatedThingWithoutReferences<THING extends SCThings> =
|
|||||||
* Thing for a thing without references
|
* Thing for a thing without references
|
||||||
*/
|
*/
|
||||||
export type SCAssociatedThing<THING extends SCThings> =
|
export type SCAssociatedThing<THING extends SCThings> =
|
||||||
|
THING extends SCAssessmentWithoutReferences ? SCAssessment :
|
||||||
THING extends SCAcademicEventWithoutReferences ? SCAcademicEvent :
|
THING extends SCAcademicEventWithoutReferences ? SCAcademicEvent :
|
||||||
THING extends SCArticleWithoutReferences ? SCArticle :
|
THING extends SCArticleWithoutReferences ? SCArticle :
|
||||||
THING extends SCBookWithoutReferences ? SCBook :
|
THING extends SCBookWithoutReferences ? SCBook :
|
||||||
THING extends SCBuildingWithoutReferences ? SCBuilding :
|
THING extends SCBuildingWithoutReferences ? SCBuilding :
|
||||||
THING extends SCCatalogWithoutReferences ? SCCatalog :
|
THING extends SCCatalogWithoutReferences ? SCCatalog :
|
||||||
THING extends SCCourseOfStudiesWithoutReferences ? SCCourseOfStudies :
|
THING extends SCContactPointWithoutReferences ? SCContactPoint :
|
||||||
|
THING extends SCCourseOfStudyWithoutReferences ? SCCourseOfStudy :
|
||||||
THING extends SCDateSeriesWithoutReferences ? SCDateSeries :
|
THING extends SCDateSeriesWithoutReferences ? SCDateSeries :
|
||||||
THING extends SCDiffWithoutReferences ? SCDiff :
|
THING extends SCDiffWithoutReferences ? SCDiff :
|
||||||
THING extends SCDishWithoutReferences ? SCDish :
|
THING extends SCDishWithoutReferences ? SCDish :
|
||||||
@@ -154,8 +174,10 @@ export type SCAssociatedThing<THING extends SCThings> =
|
|||||||
THING extends SCFloorWithoutReferences ? SCFloor :
|
THING extends SCFloorWithoutReferences ? SCFloor :
|
||||||
THING extends SCMessageWithoutReferences ? SCMessage :
|
THING extends SCMessageWithoutReferences ? SCMessage :
|
||||||
THING extends SCOrganizationWithoutReferences ? SCOrganization :
|
THING extends SCOrganizationWithoutReferences ? SCOrganization :
|
||||||
|
THING extends SCPeriodicalWithoutReferences ? SCPeriodical :
|
||||||
THING extends SCPersonWithoutReferences ? SCPerson :
|
THING extends SCPersonWithoutReferences ? SCPerson :
|
||||||
THING extends SCPointOfInterestWithoutReferences ? SCPointOfInterest :
|
THING extends SCPointOfInterestWithoutReferences ? SCPointOfInterest :
|
||||||
|
THING extends SCPublicationEventWithoutReferences ? SCPublicationEvent :
|
||||||
THING extends SCRoomWithoutReferences ? SCRoom :
|
THING extends SCRoomWithoutReferences ? SCRoom :
|
||||||
THING extends SCSemesterWithoutReferences ? SCSemester :
|
THING extends SCSemesterWithoutReferences ? SCSemester :
|
||||||
THING extends SCSettingWithoutReferences ? SCSetting :
|
THING extends SCSettingWithoutReferences ? SCSetting :
|
||||||
|
|||||||
@@ -12,11 +12,13 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {BAD_GATEWAY} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCError} from '../error';
|
import {SCError} from '../error';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An error that is returned, when an internal server error occurred
|
* An error that is returned, when an internal server error occurred
|
||||||
|
*
|
||||||
|
* @validatable
|
||||||
*/
|
*/
|
||||||
export class SCInternalServerErrorResponse extends SCError {
|
export class SCInternalServerErrorResponse extends SCError {
|
||||||
/**
|
/**
|
||||||
@@ -32,7 +34,7 @@ export class SCInternalServerErrorResponse extends SCError {
|
|||||||
* and the internal server error should be displayed to the client
|
* and the internal server error should be displayed to the client
|
||||||
*/
|
*/
|
||||||
constructor(err?: Error, stack = false) {
|
constructor(err?: Error, stack = false) {
|
||||||
super('InternalServerError', 'Internal server error', BAD_GATEWAY, stack);
|
super('InternalServerError', 'Internal server error', StatusCodes.BAD_GATEWAY, stack);
|
||||||
|
|
||||||
if (stack) {
|
if (stack) {
|
||||||
this.additionalData = err;
|
this.additionalData = err;
|
||||||
|
|||||||
@@ -12,11 +12,13 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {METHOD_NOT_ALLOWED} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCError} from '../error';
|
import {SCError} from '../error';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An error that is returned, when the used HTTP method is not allowed on the requested route
|
* An error that is returned, when the used HTTP method is not allowed on the requested route
|
||||||
|
*
|
||||||
|
* @validatable
|
||||||
*/
|
*/
|
||||||
export class SCMethodNotAllowedErrorResponse extends SCError {
|
export class SCMethodNotAllowedErrorResponse extends SCError {
|
||||||
/**
|
/**
|
||||||
@@ -25,6 +27,6 @@ export class SCMethodNotAllowedErrorResponse extends SCError {
|
|||||||
* @param stack Set to true if a stack trace should be created
|
* @param stack Set to true if a stack trace should be created
|
||||||
*/
|
*/
|
||||||
constructor(stack?: boolean) {
|
constructor(stack?: boolean) {
|
||||||
super('MethodNotAllowedError', 'HTTP method is not allowed on this route', METHOD_NOT_ALLOWED, stack);
|
super('MethodNotAllowedError', 'HTTP method is not allowed on this route', StatusCodes.METHOD_NOT_ALLOWED, stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,11 +12,13 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {NOT_FOUND} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCError} from '../error';
|
import {SCError} from '../error';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An error that is returned when the requested route or resource was not found
|
* An error that is returned when the requested route or resource was not found
|
||||||
|
*
|
||||||
|
* @validatable
|
||||||
*/
|
*/
|
||||||
export class SCNotFoundErrorResponse extends SCError {
|
export class SCNotFoundErrorResponse extends SCError {
|
||||||
/**
|
/**
|
||||||
@@ -25,6 +27,6 @@ export class SCNotFoundErrorResponse extends SCError {
|
|||||||
* @param stack Set to true if a stack trace should be created
|
* @param stack Set to true if a stack trace should be created
|
||||||
*/
|
*/
|
||||||
constructor(stack?: boolean) {
|
constructor(stack?: boolean) {
|
||||||
super('NotFoundError', 'Resource not found', NOT_FOUND, stack);
|
super('NotFoundError', 'Resource not found', StatusCodes.NOT_FOUND, stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,12 +12,14 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {NOT_ACCEPTABLE} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCError} from '../error';
|
import {SCError} from '../error';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An error that is returned when the request is in the right format, but contains parameters that are invalid or not
|
* An error that is returned when the request is in the right format, but contains parameters that are invalid or not
|
||||||
* acceptable.
|
* acceptable.
|
||||||
|
*
|
||||||
|
* @validatable
|
||||||
*/
|
*/
|
||||||
export class SCParametersNotAcceptable extends SCError {
|
export class SCParametersNotAcceptable extends SCError {
|
||||||
/**
|
/**
|
||||||
@@ -27,6 +29,6 @@ export class SCParametersNotAcceptable extends SCError {
|
|||||||
* @param stack Set to true if a stack trace should be created
|
* @param stack Set to true if a stack trace should be created
|
||||||
*/
|
*/
|
||||||
constructor(message: string, stack?: boolean) {
|
constructor(message: string, stack?: boolean) {
|
||||||
super('ParametersNotAcceptable', message, NOT_ACCEPTABLE, stack);
|
super('ParametersNotAcceptable', message, StatusCodes.NOT_ACCEPTABLE, stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {CONFLICT} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCError} from '../error';
|
import {SCError} from '../error';
|
||||||
import {SCPluginMetaData} from '../routes/plugin-register';
|
import {SCPluginMetaData} from '../routes/plugin-register';
|
||||||
|
|
||||||
@@ -20,6 +20,8 @@ import {SCPluginMetaData} from '../routes/plugin-register';
|
|||||||
* An error that is returned when a plugin with the same name is already registered, to prevent two copies of a plugin
|
* An error that is returned when a plugin with the same name is already registered, to prevent two copies of a plugin
|
||||||
* running at the same time.
|
* running at the same time.
|
||||||
* This usually indicates that there is more than one instance a plugin running.
|
* This usually indicates that there is more than one instance a plugin running.
|
||||||
|
*
|
||||||
|
* @validatable
|
||||||
*/
|
*/
|
||||||
export class SCPluginAlreadyRegisteredErrorResponse extends SCError {
|
export class SCPluginAlreadyRegisteredErrorResponse extends SCError {
|
||||||
/**
|
/**
|
||||||
@@ -36,7 +38,7 @@ export class SCPluginAlreadyRegisteredErrorResponse extends SCError {
|
|||||||
* @param stack Set to true if a stack trace should be created
|
* @param stack Set to true if a stack trace should be created
|
||||||
*/
|
*/
|
||||||
constructor(message: string, plugin: SCPluginMetaData, stack = false) {
|
constructor(message: string, plugin: SCPluginMetaData, stack = false) {
|
||||||
super('SCPluginAlreadyRegisteredError', message, CONFLICT, stack);
|
super('SCPluginAlreadyRegisteredError', message, StatusCodes.CONFLICT, stack);
|
||||||
if (stack) {
|
if (stack) {
|
||||||
this.additionalData = plugin;
|
this.additionalData = plugin;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,11 +12,13 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {INTERNAL_SERVER_ERROR} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCError} from '../error';
|
import {SCError} from '../error';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An error that is returned whenever there is an unexpected error while creating a plugin
|
* An error that is returned whenever there is an unexpected error while creating a plugin
|
||||||
|
*
|
||||||
|
* @validatable
|
||||||
*/
|
*/
|
||||||
export class SCPluginRegisteringFailedErrorResponse extends SCError {
|
export class SCPluginRegisteringFailedErrorResponse extends SCError {
|
||||||
/**
|
/**
|
||||||
@@ -26,6 +28,6 @@ export class SCPluginRegisteringFailedErrorResponse extends SCError {
|
|||||||
* @param stack Set to true if a stack trace should be created
|
* @param stack Set to true if a stack trace should be created
|
||||||
*/
|
*/
|
||||||
constructor(message: string, stack?: boolean) {
|
constructor(message: string, stack?: boolean) {
|
||||||
super('PluginRegisteringFailedError', message, INTERNAL_SERVER_ERROR, stack);
|
super('PluginRegisteringFailedError', message, StatusCodes.INTERNAL_SERVER_ERROR, stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,11 +12,13 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {REQUEST_TOO_LONG} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCError} from '../error';
|
import {SCError} from '../error';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An error that is returned, when the request body is too large.
|
* An error that is returned, when the request body is too large.
|
||||||
|
*
|
||||||
|
* @validatable
|
||||||
*/
|
*/
|
||||||
export class SCRequestBodyTooLargeErrorResponse extends SCError {
|
export class SCRequestBodyTooLargeErrorResponse extends SCError {
|
||||||
/**
|
/**
|
||||||
@@ -25,6 +27,6 @@ export class SCRequestBodyTooLargeErrorResponse extends SCError {
|
|||||||
* @param stack Set to true if a stack trace should be created
|
* @param stack Set to true if a stack trace should be created
|
||||||
*/
|
*/
|
||||||
constructor(stack?: boolean) {
|
constructor(stack?: boolean) {
|
||||||
super('RequestBodyTooLargeError', 'The request body is too large.', REQUEST_TOO_LONG, stack);
|
super('RequestBodyTooLargeError', 'The request body is too large.', StatusCodes.REQUEST_TOO_LONG, stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,11 +12,13 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {BAD_REQUEST} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCError} from '../error';
|
import {SCError} from '../error';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An error that is returned whenever there is a syntax error
|
* An error that is returned whenever there is a syntax error
|
||||||
|
*
|
||||||
|
* @validatable
|
||||||
*/
|
*/
|
||||||
export class SCSyntaxErrorResponse extends SCError {
|
export class SCSyntaxErrorResponse extends SCError {
|
||||||
/**
|
/**
|
||||||
@@ -26,6 +28,6 @@ export class SCSyntaxErrorResponse extends SCError {
|
|||||||
* @param stack Set to true if a stack trace should be created
|
* @param stack Set to true if a stack trace should be created
|
||||||
*/
|
*/
|
||||||
constructor(message: string, stack?: boolean) {
|
constructor(message: string, stack?: boolean) {
|
||||||
super('SyntaxError', message, BAD_REQUEST, stack);
|
super('SyntaxError', message, StatusCodes.BAD_REQUEST, stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,11 +12,13 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {TOO_MANY_REQUESTS} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCError} from '../error';
|
import {SCError} from '../error';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An error that is returned, when to many request are submitted at once
|
* An error that is returned, when to many request are submitted at once
|
||||||
|
*
|
||||||
|
* @validatable
|
||||||
*/
|
*/
|
||||||
export class SCTooManyRequestsErrorResponse extends SCError {
|
export class SCTooManyRequestsErrorResponse extends SCError {
|
||||||
/**
|
/**
|
||||||
@@ -28,7 +30,7 @@ export class SCTooManyRequestsErrorResponse extends SCError {
|
|||||||
super(
|
super(
|
||||||
'TooManyRequestsError',
|
'TooManyRequestsError',
|
||||||
'Too many requests. You can not submit more than 5 queries an once',
|
'Too many requests. You can not submit more than 5 queries an once',
|
||||||
TOO_MANY_REQUESTS,
|
StatusCodes.TOO_MANY_REQUESTS,
|
||||||
stack,
|
stack,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,11 +12,13 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {UNSUPPORTED_MEDIA_TYPE} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCError} from '../error';
|
import {SCError} from '../error';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An error that is returned when the content type of the request is not supported
|
* An error that is returned when the content type of the request is not supported
|
||||||
|
*
|
||||||
|
* @validatable
|
||||||
*/
|
*/
|
||||||
export class SCUnsupportedMediaTypeErrorResponse extends SCError {
|
export class SCUnsupportedMediaTypeErrorResponse extends SCError {
|
||||||
/**
|
/**
|
||||||
@@ -25,6 +27,6 @@ export class SCUnsupportedMediaTypeErrorResponse extends SCError {
|
|||||||
* @param stack Set to true if a stack trace should be created
|
* @param stack Set to true if a stack trace should be created
|
||||||
*/
|
*/
|
||||||
constructor(stack?: boolean) {
|
constructor(stack?: boolean) {
|
||||||
super('UnsupportedMediaTypeError', 'Unsupported media type', UNSUPPORTED_MEDIA_TYPE, stack);
|
super('UnsupportedMediaTypeError', 'Unsupported media type', StatusCodes.UNSUPPORTED_MEDIA_TYPE, stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,12 +12,14 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {BAD_REQUEST} from 'http-status-codes';
|
import {ValidationError} from '@openstapps/core-tools/lib/types/validator';
|
||||||
import {ValidationError} from 'jsonschema';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCError} from '../error';
|
import {SCError} from '../error';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An error that is returned when the validation of a request fails
|
* An error that is returned when the validation of a request fails
|
||||||
|
*
|
||||||
|
* @validatable
|
||||||
*/
|
*/
|
||||||
export class SCValidationErrorResponse extends SCError {
|
export class SCValidationErrorResponse extends SCError {
|
||||||
/**
|
/**
|
||||||
@@ -32,7 +34,7 @@ export class SCValidationErrorResponse extends SCError {
|
|||||||
* @param stack Set to true if a stack trace should be created
|
* @param stack Set to true if a stack trace should be created
|
||||||
*/
|
*/
|
||||||
constructor(errors: ValidationError[], stack?: boolean) {
|
constructor(errors: ValidationError[], stack?: boolean) {
|
||||||
super('ValidationError', 'Validation of request failed', BAD_REQUEST, stack);
|
super('ValidationError', 'Validation of request failed', StatusCodes.BAD_REQUEST, stack);
|
||||||
this.additionalData = errors;
|
this.additionalData = errors;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {OK} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCUuid} from '../../general/uuid';
|
import {SCUuid} from '../../general/uuid';
|
||||||
import {SCAcademicPriceGroup, SCThingThatCanBeOfferedOffer} from '../../things/abstract/thing-that-can-be-offered';
|
import {SCAcademicPriceGroup, SCThingThatCanBeOfferedOffer} from '../../things/abstract/thing-that-can-be-offered';
|
||||||
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
||||||
@@ -88,7 +88,7 @@ export class SCBookAvailabilityRoute extends SCAbstractRoute {
|
|||||||
this.method = SCRouteHttpVerbs.POST;
|
this.method = SCRouteHttpVerbs.POST;
|
||||||
this.requestBodyName = 'SCBookAvailabilityRequest';
|
this.requestBodyName = 'SCBookAvailabilityRequest';
|
||||||
this.responseBodyName = 'SCBookAvailabilityResponse';
|
this.responseBodyName = 'SCBookAvailabilityResponse';
|
||||||
this.statusCodeSuccess = OK;
|
this.statusCodeSuccess = StatusCodes.OK;
|
||||||
this.urlFragment = '/bookAvailability';
|
this.urlFragment = '/bookAvailability';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {CREATED} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCThings} from '../../meta';
|
import {SCThings} from '../../meta';
|
||||||
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
||||||
import {SCMethodNotAllowedErrorResponse} from '../errors/method-not-allowed';
|
import {SCMethodNotAllowedErrorResponse} from '../errors/method-not-allowed';
|
||||||
@@ -59,7 +59,7 @@ export class SCBulkAddRoute extends SCAbstractRoute {
|
|||||||
};
|
};
|
||||||
this.requestBodyName = 'SCBulkAddRequest';
|
this.requestBodyName = 'SCBulkAddRequest';
|
||||||
this.responseBodyName = 'SCBulkAddResponse';
|
this.responseBodyName = 'SCBulkAddResponse';
|
||||||
this.statusCodeSuccess = CREATED;
|
this.statusCodeSuccess = StatusCodes.CREATED;
|
||||||
this.urlFragment = '/bulk/:UID';
|
this.urlFragment = '/bulk/:UID';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {NO_CONTENT} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
||||||
import {SCMethodNotAllowedErrorResponse} from '../errors/method-not-allowed';
|
import {SCMethodNotAllowedErrorResponse} from '../errors/method-not-allowed';
|
||||||
import {SCNotFoundErrorResponse} from '../errors/not-found';
|
import {SCNotFoundErrorResponse} from '../errors/not-found';
|
||||||
@@ -59,7 +59,7 @@ export class SCBulkDoneRoute extends SCAbstractRoute {
|
|||||||
};
|
};
|
||||||
this.requestBodyName = 'SCBulkDoneRequest';
|
this.requestBodyName = 'SCBulkDoneRequest';
|
||||||
this.responseBodyName = 'SCBulkDoneResponse';
|
this.responseBodyName = 'SCBulkDoneResponse';
|
||||||
this.statusCodeSuccess = NO_CONTENT;
|
this.statusCodeSuccess = StatusCodes.NO_CONTENT;
|
||||||
this.urlFragment = '/bulk/:UID/done';
|
this.urlFragment = '/bulk/:UID/done';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {OK} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCISO8601Date} from '../../general/time';
|
import {SCISO8601Date} from '../../general/time';
|
||||||
import {SCUuid} from '../../general/uuid';
|
import {SCUuid} from '../../general/uuid';
|
||||||
import {SCThingType} from '../../things/abstract/thing';
|
import {SCThingType} from '../../things/abstract/thing';
|
||||||
@@ -98,7 +98,7 @@ export class SCBulkRoute extends SCAbstractRoute {
|
|||||||
this.method = SCRouteHttpVerbs.POST;
|
this.method = SCRouteHttpVerbs.POST;
|
||||||
this.requestBodyName = 'SCBulkRequest';
|
this.requestBodyName = 'SCBulkRequest';
|
||||||
this.responseBodyName = 'SCBulkResponse';
|
this.responseBodyName = 'SCBulkResponse';
|
||||||
this.statusCodeSuccess = OK;
|
this.statusCodeSuccess = StatusCodes.OK;
|
||||||
this.urlFragment = '/bulk';
|
this.urlFragment = '/bulk';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {NO_CONTENT} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCMessage} from '../../things/message';
|
import {SCMessage} from '../../things/message';
|
||||||
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
||||||
import {SCMethodNotAllowedErrorResponse} from '../errors/method-not-allowed';
|
import {SCMethodNotAllowedErrorResponse} from '../errors/method-not-allowed';
|
||||||
@@ -59,7 +59,7 @@ export class SCFeedbackRoute extends SCAbstractRoute {
|
|||||||
this.method = SCRouteHttpVerbs.POST;
|
this.method = SCRouteHttpVerbs.POST;
|
||||||
this.requestBodyName = 'SCFeedbackRequest';
|
this.requestBodyName = 'SCFeedbackRequest';
|
||||||
this.responseBodyName = 'SCFeedbackResponse';
|
this.responseBodyName = 'SCFeedbackResponse';
|
||||||
this.statusCodeSuccess = NO_CONTENT;
|
this.statusCodeSuccess = StatusCodes.OK;
|
||||||
this.urlFragment = '/feedback';
|
this.urlFragment = '/feedback';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {OK} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCAppConfiguration} from '../../config/app';
|
import {SCAppConfiguration} from '../../config/app';
|
||||||
import {SCBackendConfiguration} from '../../config/backend';
|
import {SCBackendConfiguration} from '../../config/backend';
|
||||||
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
||||||
@@ -65,7 +65,7 @@ export class SCIndexRoute extends SCAbstractRoute {
|
|||||||
this.method = SCRouteHttpVerbs.POST;
|
this.method = SCRouteHttpVerbs.POST;
|
||||||
this.requestBodyName = 'SCIndexRequest';
|
this.requestBodyName = 'SCIndexRequest';
|
||||||
this.responseBodyName = 'SCIndexResponse';
|
this.responseBodyName = 'SCIndexResponse';
|
||||||
this.statusCodeSuccess = OK;
|
this.statusCodeSuccess = StatusCodes.OK;
|
||||||
this.urlFragment = '/';
|
this.urlFragment = '/';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {OK} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {Schema} from 'jsonschema';
|
import {JSONSchema7} from 'json-schema';
|
||||||
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
||||||
import {SCMethodNotAllowedErrorResponse} from '../errors/method-not-allowed';
|
import {SCMethodNotAllowedErrorResponse} from '../errors/method-not-allowed';
|
||||||
import {SCNotFoundErrorResponse} from '../errors/not-found';
|
import {SCNotFoundErrorResponse} from '../errors/not-found';
|
||||||
@@ -78,12 +78,12 @@ export interface SCPluginMetaData {
|
|||||||
/**
|
/**
|
||||||
* How the requests of the plugin looks like, a JSON schema for validation
|
* How the requests of the plugin looks like, a JSON schema for validation
|
||||||
*/
|
*/
|
||||||
requestSchema: Schema;
|
requestSchema: JSONSchema7;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* How the responses of the plugin looks like, a JSON schema for validation
|
* How the responses of the plugin looks like, a JSON schema for validation
|
||||||
*/
|
*/
|
||||||
responseSchema: Schema;
|
responseSchema: JSONSchema7;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The desired route, for example /feedback.
|
* The desired route, for example /feedback.
|
||||||
@@ -122,7 +122,7 @@ export class SCPluginRegisterRoute extends SCAbstractRoute {
|
|||||||
this.method = SCRouteHttpVerbs.POST;
|
this.method = SCRouteHttpVerbs.POST;
|
||||||
this.requestBodyName = 'SCPluginRegisterRequest';
|
this.requestBodyName = 'SCPluginRegisterRequest';
|
||||||
this.responseBodyName = 'SCPluginRegisterResponse';
|
this.responseBodyName = 'SCPluginRegisterResponse';
|
||||||
this.statusCodeSuccess = OK;
|
this.statusCodeSuccess = StatusCodes.OK;
|
||||||
this.urlFragment = '/plugin/register';
|
this.urlFragment = '/plugin/register';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {OK} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCMap} from '../../general/map';
|
import {SCMap} from '../../general/map';
|
||||||
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
||||||
import {SCMethodNotAllowedErrorResponse} from '../errors/method-not-allowed';
|
import {SCMethodNotAllowedErrorResponse} from '../errors/method-not-allowed';
|
||||||
@@ -63,7 +63,7 @@ export class SCMultiSearchRoute extends SCAbstractRoute {
|
|||||||
this.method = SCRouteHttpVerbs.POST;
|
this.method = SCRouteHttpVerbs.POST;
|
||||||
this.requestBodyName = 'SCMultiSearchRequest';
|
this.requestBodyName = 'SCMultiSearchRequest';
|
||||||
this.responseBodyName = 'SCMultiSearchResponse';
|
this.responseBodyName = 'SCMultiSearchResponse';
|
||||||
this.statusCodeSuccess = OK;
|
this.statusCodeSuccess = StatusCodes.OK;
|
||||||
this.urlFragment = '/search/multi';
|
this.urlFragment = '/search/multi';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {OK} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
||||||
import {SCMethodNotAllowedErrorResponse} from '../errors/method-not-allowed';
|
import {SCMethodNotAllowedErrorResponse} from '../errors/method-not-allowed';
|
||||||
import {SCRequestBodyTooLargeErrorResponse} from '../errors/request-body-too-large';
|
import {SCRequestBodyTooLargeErrorResponse} from '../errors/request-body-too-large';
|
||||||
@@ -56,7 +56,7 @@ export class SCSearchRoute extends SCAbstractRoute {
|
|||||||
this.method = SCRouteHttpVerbs.POST;
|
this.method = SCRouteHttpVerbs.POST;
|
||||||
this.requestBodyName = 'SCSearchRequest';
|
this.requestBodyName = 'SCSearchRequest';
|
||||||
this.responseBodyName = 'SCSearchResponse';
|
this.responseBodyName = 'SCSearchResponse';
|
||||||
this.statusCodeSuccess = OK;
|
this.statusCodeSuccess = StatusCodes.OK;
|
||||||
this.urlFragment = '/search';
|
this.urlFragment = '/search';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {OK} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCThings} from '../../meta';
|
import {SCThings} from '../../meta';
|
||||||
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
||||||
import {SCMethodNotAllowedErrorResponse} from '../errors/method-not-allowed';
|
import {SCMethodNotAllowedErrorResponse} from '../errors/method-not-allowed';
|
||||||
@@ -55,12 +55,12 @@ export class SCThingUpdateRoute extends SCAbstractRoute {
|
|||||||
];
|
];
|
||||||
this.method = SCRouteHttpVerbs.PUT;
|
this.method = SCRouteHttpVerbs.PUT;
|
||||||
this.obligatoryParameters = {
|
this.obligatoryParameters = {
|
||||||
TYPE: 'SCThingTypes',
|
TYPE: 'SCThingType',
|
||||||
UID: 'SCUuid',
|
UID: 'SCUuid',
|
||||||
};
|
};
|
||||||
this.requestBodyName = 'SCThingUpdateRequest';
|
this.requestBodyName = 'SCThingUpdateRequest';
|
||||||
this.responseBodyName = 'SCThingUpdateResponse';
|
this.responseBodyName = 'SCThingUpdateResponse';
|
||||||
this.statusCodeSuccess = OK;
|
this.statusCodeSuccess = StatusCodes.OK;
|
||||||
this.urlFragment = '/:TYPE/:UID';
|
this.urlFragment = '/:TYPE/:UID';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ import {SCMap} from '../../general/map';
|
|||||||
import {SCSearchAvailabilityFilter} from './filters/availability';
|
import {SCSearchAvailabilityFilter} from './filters/availability';
|
||||||
import {SCSearchBooleanFilter} from './filters/boolean';
|
import {SCSearchBooleanFilter} from './filters/boolean';
|
||||||
import {SCSearchDistanceFilter} from './filters/distance';
|
import {SCSearchDistanceFilter} from './filters/distance';
|
||||||
|
import {SCGeoFilter} from './filters/geo';
|
||||||
|
import {SCSearchDateRangeFilter, SCSearchNumericRangeFilter} from './filters/range';
|
||||||
import {SCSearchValueFilter} from './filters/value';
|
import {SCSearchValueFilter} from './filters/value';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -28,7 +30,10 @@ export type SCSearchFilterType =
|
|||||||
'availability'
|
'availability'
|
||||||
| 'boolean'
|
| 'boolean'
|
||||||
| 'distance'
|
| 'distance'
|
||||||
| 'value';
|
| 'value'
|
||||||
|
| 'date range'
|
||||||
|
| 'numeric range'
|
||||||
|
| 'geo';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Structure of a filter instruction
|
* Structure of a filter instruction
|
||||||
@@ -57,4 +62,7 @@ export type SCSearchFilter =
|
|||||||
SCSearchAvailabilityFilter
|
SCSearchAvailabilityFilter
|
||||||
| SCSearchBooleanFilter
|
| SCSearchBooleanFilter
|
||||||
| SCSearchDistanceFilter
|
| SCSearchDistanceFilter
|
||||||
| SCSearchValueFilter;
|
| SCSearchValueFilter
|
||||||
|
| SCSearchNumericRangeFilter
|
||||||
|
| SCSearchDateRangeFilter
|
||||||
|
| SCGeoFilter;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2019 StApps
|
* Copyright (C) 2019-2021 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -33,17 +33,17 @@ export interface SCSearchAvailabilityFilter extends SCSearchAbstractFilter<SCAva
|
|||||||
*/
|
*/
|
||||||
export interface SCAvailabilityFilterArguments extends SCSearchAbstractFilterArguments {
|
export interface SCAvailabilityFilterArguments extends SCSearchAbstractFilterArguments {
|
||||||
/**
|
/**
|
||||||
* Field which marks the start of the availability
|
* Field which marks availability range
|
||||||
*/
|
*/
|
||||||
fromField: SCThingsField;
|
field: SCThingsField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Time to check. Defaults to 'now'
|
* If set, the provided time will apply to the full hour, day, week, etc.
|
||||||
*/
|
*/
|
||||||
time?: SCISO8601Date | 'now';
|
scope?: 's' | 'm' | 'H' | 'd' | 'w' | 'M' | 'y';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Field which marks the end of the availability
|
* Time to check. Defaults current time if not set
|
||||||
*/
|
*/
|
||||||
toField: SCThingsField;
|
time?: SCISO8601Date;
|
||||||
}
|
}
|
||||||
|
|||||||
55
src/protocol/search/filters/geo.ts
Normal file
55
src/protocol/search/filters/geo.ts
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2021 StApps
|
||||||
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
|
* Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with
|
||||||
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
// tslint:disable-next-line:no-implicit-dependencies
|
||||||
|
import {Polygon} from 'geojson';
|
||||||
|
import {SCThingsField} from '../../../meta';
|
||||||
|
import {SCSearchAbstractFilter, SCSearchAbstractFilterArguments} from '../filter';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A geo filter
|
||||||
|
*
|
||||||
|
* Filter for documents that are in relation to some geo data
|
||||||
|
*/
|
||||||
|
export interface SCGeoFilter extends SCSearchAbstractFilter<SCGeoFilterArguments> {
|
||||||
|
/**
|
||||||
|
* @see SCSearchAbstractFilter.type
|
||||||
|
*/
|
||||||
|
type: 'geo';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Arguments for filter instruction by geo data
|
||||||
|
*/
|
||||||
|
export interface SCGeoFilterArguments extends SCSearchAbstractFilterArguments {
|
||||||
|
/**
|
||||||
|
* Field on which to filter
|
||||||
|
*/
|
||||||
|
field: SCThingsField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Geo data to check up on
|
||||||
|
*/
|
||||||
|
shape: Polygon;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Spatial relation between the provided shape and the shape of the field.
|
||||||
|
*
|
||||||
|
* intersects - both shapes intersect (default)
|
||||||
|
* disjoint - both shapes don't intersect
|
||||||
|
* within - the search shape contains the field shape
|
||||||
|
* contains - the search shape is contained in the field shape
|
||||||
|
*/
|
||||||
|
spatialRelation?: 'intersects' | 'disjoint' | 'within' | 'contains';
|
||||||
|
}
|
||||||
121
src/protocol/search/filters/range.ts
Normal file
121
src/protocol/search/filters/range.ts
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020-2021 StApps
|
||||||
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
|
* Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with
|
||||||
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
import {SCThingsField} from '../../../meta';
|
||||||
|
import {SCSearchAbstractFilter, SCSearchAbstractFilterArguments} from '../filter';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A date range filter
|
||||||
|
*
|
||||||
|
* Filter for documents with a date field that satisfies the given constraints
|
||||||
|
*
|
||||||
|
* @see https://www.elastic.co/guide/en/elasticsearch/reference/5.6/query-dsl-range-query.html#_date_format_in_range_queries
|
||||||
|
*/
|
||||||
|
export interface SCSearchDateRangeFilter extends SCSearchAbstractFilter<SCDateRangeFilterArguments> {
|
||||||
|
/**
|
||||||
|
* @see SCSearchAbstractFilter.type
|
||||||
|
*/
|
||||||
|
type: 'date range';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A distance filter
|
||||||
|
*
|
||||||
|
* Filter for documents with a numeric field that satisfies the given constraints
|
||||||
|
*
|
||||||
|
* @see https://www.elastic.co/guide/en/elasticsearch/reference/5.6/query-dsl-range-query.html#query-dsl-range-query
|
||||||
|
*/
|
||||||
|
export interface SCSearchNumericRangeFilter extends SCSearchAbstractFilter<SCNumericRangeFilterArguments> {
|
||||||
|
/**
|
||||||
|
* @see SCSearchAbstractFilter.type
|
||||||
|
*/
|
||||||
|
type: 'numeric range';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Additional arguments for date range filters
|
||||||
|
*
|
||||||
|
* Filter uses a plain string to allow for date math expressions
|
||||||
|
* @see https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/date-math-expressions.html
|
||||||
|
*/
|
||||||
|
export interface SCDateRangeFilterArguments extends SCRangeFilterArguments<string> {
|
||||||
|
/**
|
||||||
|
* Optional date format specifier
|
||||||
|
*
|
||||||
|
* @see https://www.elastic.co/guide/en/elasticsearch/reference/5.6/query-dsl-range-query.html#_date_format_in_range_queries
|
||||||
|
*/
|
||||||
|
format?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Optional timezone specifier
|
||||||
|
*
|
||||||
|
* @see https://www.elastic.co/guide/en/elasticsearch/reference/5.6/query-dsl-range-query.html#_time_zone_in_range_queries
|
||||||
|
*/
|
||||||
|
timeZone?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Additional arguments for numeric range filters
|
||||||
|
*/
|
||||||
|
export type SCNumericRangeFilterArguments = SCRangeFilterArguments<number>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Additional arguments for range filters
|
||||||
|
*
|
||||||
|
* @see https://www.elastic.co/guide/en/elasticsearch/reference/5.6/query-dsl-range-query.html#query-dsl-range-query
|
||||||
|
*/
|
||||||
|
export interface SCRangeFilterArguments<T> extends SCSearchAbstractFilterArguments {
|
||||||
|
/**
|
||||||
|
* Bounds of the range
|
||||||
|
*/
|
||||||
|
bounds: Bounds<T>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Field where the filter will be applied
|
||||||
|
*/
|
||||||
|
field: SCThingsField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Relation when searching on other range fields
|
||||||
|
*
|
||||||
|
* Intersects (Default): Both search and field range intersect
|
||||||
|
* Within: Search range is within the field range
|
||||||
|
* Contains: Search range contains the field range
|
||||||
|
*/
|
||||||
|
relation?: 'intersects' | 'within' | 'contains';
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Bounds<T> {
|
||||||
|
/**
|
||||||
|
* The lower bound
|
||||||
|
*/
|
||||||
|
lowerBound?: Bound<T>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The upper bound
|
||||||
|
*/
|
||||||
|
upperBound?: Bound<T>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Bound<T> {
|
||||||
|
/**
|
||||||
|
* Limit of the bound
|
||||||
|
*/
|
||||||
|
limit: T;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bound mode
|
||||||
|
*/
|
||||||
|
mode: 'inclusive' | 'exclusive';
|
||||||
|
}
|
||||||
@@ -32,7 +32,7 @@ export interface SCValueFilterArguments extends SCSearchAbstractFilterArguments
|
|||||||
field: SCThingsField;
|
field: SCThingsField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Value to filter. Value has to match the field exactly.
|
* Value to filter. One or more values has to match the field exactly.
|
||||||
*/
|
*/
|
||||||
value: string;
|
value: string | string[];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2019 StApps
|
* Copyright (C) 2019, 2020 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -16,6 +16,7 @@ import {SCMap} from '../../general/map';
|
|||||||
import {SCThingsField} from '../../meta';
|
import {SCThingsField} from '../../meta';
|
||||||
import {SCDistanceSort} from './sorts/distance';
|
import {SCDistanceSort} from './sorts/distance';
|
||||||
import {SCDucetSort} from './sorts/ducet';
|
import {SCDucetSort} from './sorts/ducet';
|
||||||
|
import {SCGenericSort} from './sorts/generic';
|
||||||
import {SCPriceSort} from './sorts/price';
|
import {SCPriceSort} from './sorts/price';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -51,9 +52,9 @@ export interface SCSearchAbstractSortArguments extends SCMap<unknown> {
|
|||||||
/**
|
/**
|
||||||
* Type of a sort instruction
|
* Type of a sort instruction
|
||||||
*/
|
*/
|
||||||
export type SCSearchSortType = 'distance' | 'price' | 'ducet';
|
export type SCSearchSortType = 'distance' | 'price' | 'ducet' | 'generic';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A sort instruction
|
* A sort instruction
|
||||||
*/
|
*/
|
||||||
export type SCSearchSort = SCDistanceSort | SCPriceSort | SCDucetSort;
|
export type SCSearchSort = SCDistanceSort | SCPriceSort | SCDucetSort | SCGenericSort;
|
||||||
|
|||||||
25
src/protocol/search/sorts/generic.ts
Normal file
25
src/protocol/search/sorts/generic.ts
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020 StApps
|
||||||
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
|
* Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with
|
||||||
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
import {SCSearchAbstractSort, SCSearchAbstractSortArguments} from '../sort';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sort instruction for generic sort such as date
|
||||||
|
*/
|
||||||
|
export interface SCGenericSort extends SCSearchAbstractSort<SCSearchAbstractSortArguments> {
|
||||||
|
/**
|
||||||
|
* @see SCSearchAbstractSort.type
|
||||||
|
*/
|
||||||
|
type: 'generic';
|
||||||
|
}
|
||||||
@@ -22,26 +22,25 @@ export interface SCAcademicDegreeWithoutReferences
|
|||||||
extends SCThingWithoutReferences {
|
extends SCThingWithoutReferences {
|
||||||
/**
|
/**
|
||||||
* The achievable academic degree
|
* The achievable academic degree
|
||||||
|
*
|
||||||
|
* @filterable
|
||||||
|
* @sortable ducet
|
||||||
*/
|
*/
|
||||||
academicDegree: SCGermanAcademicDegree;
|
academicDegree: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The achievable academic degree with academic field specification
|
* The achievable academic degree with academic field specification
|
||||||
* (eg. Master of Science)
|
* (eg. Master of Science)
|
||||||
*
|
*
|
||||||
* @filterable
|
|
||||||
* @keyword
|
|
||||||
*/
|
*/
|
||||||
academicDegreewithField: string;
|
academicDegreewithField?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The achievable academic degree with academic field specification
|
* The achievable academic degree with academic field specification
|
||||||
* shorted (eg. M.Sc.).
|
* shorted (eg. M.Sc.).
|
||||||
*
|
*
|
||||||
* @filterable
|
|
||||||
* @keyword
|
|
||||||
*/
|
*/
|
||||||
academicDegreewithFieldShort: string;
|
academicDegreewithFieldShort?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -63,9 +62,9 @@ export class SCAcademicDegreeMeta
|
|||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
|
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
|
||||||
academicDegree: 'Hochschulgrad',
|
academicDegree: 'Abschlussgrad',
|
||||||
academicDegreewithField: 'Abschlussbezeichnungen',
|
academicDegreewithField: 'Abschlussbezeichnung',
|
||||||
academicDegreewithFieldShort: 'Abschlussbezeichnungen (kurz)',
|
academicDegreewithFieldShort: 'Abschlussbezeichnung (kurz)',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
|
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
|
||||||
@@ -81,32 +80,9 @@ export class SCAcademicDegreeMeta
|
|||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
|
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
|
||||||
academicDegree: {
|
|
||||||
'bachelor': 'Bachelor',
|
|
||||||
'diploma': 'Diplom',
|
|
||||||
'doctor': 'Doktor',
|
|
||||||
'licentiate': 'Lizenziat',
|
|
||||||
'magister': 'Magister',
|
|
||||||
'master': 'Master',
|
|
||||||
'masterstudent': 'Meisterschüler',
|
|
||||||
'state examination': 'Staatsexamen',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
|
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Types of (german) academic degrees
|
|
||||||
*/
|
|
||||||
export type SCGermanAcademicDegree =
|
|
||||||
'bachelor'
|
|
||||||
| 'diploma'
|
|
||||||
| 'doctor'
|
|
||||||
| 'licentiate'
|
|
||||||
| 'magister'
|
|
||||||
| 'master'
|
|
||||||
| 'master pupil'
|
|
||||||
| 'state examination' ;
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2019 StApps
|
* Copyright (C) 2019-2021 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -12,15 +12,15 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {SCLanguage, SCMetaTranslations, SCTranslations} from '../../general/i18n';
|
import {SCLanguageCode, SCMetaTranslations, SCTranslations} from '../../general/i18n';
|
||||||
import {SCISO8601Date} from '../../general/time';
|
import {SCISO8601Date} from '../../general/time';
|
||||||
import {SCOrganizationWithoutReferences} from '../organization';
|
import {SCOrganizationWithoutReferences} from '../organization';
|
||||||
import {SCPersonWithoutReferences} from '../person';
|
import {SCPersonWithoutReferences} from '../person';
|
||||||
|
import {SCPublicationEventWithoutReferences} from '../publication-event';
|
||||||
import {SCThingMeta, SCThingTranslatableProperties, SCThingWithoutReferences} from './thing';
|
import {SCThingMeta, SCThingTranslatableProperties, SCThingWithoutReferences} from './thing';
|
||||||
import {
|
import {
|
||||||
SCAcademicPriceGroup,
|
SCAcademicPriceGroup,
|
||||||
SCThingThatCanBeOffered,
|
SCThingThatCanBeOffered, SCThingThatCanBeOfferedMeta,
|
||||||
SCThingThatCanBeOfferedMeta,
|
|
||||||
SCThingThatCanBeOfferedTranslatableProperties,
|
SCThingThatCanBeOfferedTranslatableProperties,
|
||||||
SCThingThatCanBeOfferedWithoutReferences,
|
SCThingThatCanBeOfferedWithoutReferences,
|
||||||
} from './thing-that-can-be-offered';
|
} from './thing-that-can-be-offered';
|
||||||
@@ -30,17 +30,37 @@ import {
|
|||||||
*/
|
*/
|
||||||
export interface SCCreativeWorkWithoutReferences
|
export interface SCCreativeWorkWithoutReferences
|
||||||
extends SCThingWithoutReferences, SCThingThatCanBeOfferedWithoutReferences {
|
extends SCThingWithoutReferences, SCThingThatCanBeOfferedWithoutReferences {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Languages this creative work is available in
|
||||||
|
*/
|
||||||
|
availableLanguages?: SCLanguageCode[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Date the creative work was published
|
* Date the creative work was published
|
||||||
*
|
|
||||||
* @filterable
|
|
||||||
*/
|
*/
|
||||||
datePublished?: SCISO8601Date;
|
datePublished?: SCISO8601Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of languages this creative work is written/recorded/... in
|
* Edition of a creative work (e.g. the book edition or edition of an article)
|
||||||
|
*
|
||||||
|
* @keyword
|
||||||
*/
|
*/
|
||||||
inLanguages?: SCLanguage[];
|
edition?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Date (in text form) the creative work was published for the first time
|
||||||
|
*
|
||||||
|
* @keyword
|
||||||
|
*/
|
||||||
|
firstPublished?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Languages this creative work is written/recorded/... in
|
||||||
|
*
|
||||||
|
* @filterable
|
||||||
|
*/
|
||||||
|
inLanguage?: SCLanguageCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Keywords of the creative work
|
* Keywords of the creative work
|
||||||
@@ -67,11 +87,26 @@ export interface SCCreativeWork
|
|||||||
*/
|
*/
|
||||||
authors?: SCPersonWithoutReferences[];
|
authors?: SCPersonWithoutReferences[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A creative work to which the creative work belongs
|
||||||
|
*/
|
||||||
|
isPartOf?: SCCreativeWorkWithoutReferences;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of events at which the creative work was published
|
||||||
|
*/
|
||||||
|
publications?: SCPublicationEventWithoutReferences[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of publishers of the creative work
|
* List of publishers of the creative work
|
||||||
*/
|
*/
|
||||||
publishers?: Array<SCPersonWithoutReferences | SCOrganizationWithoutReferences>;
|
publishers?: Array<SCPersonWithoutReferences | SCOrganizationWithoutReferences>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A text representing on organization on whose behalf the creator was working
|
||||||
|
*/
|
||||||
|
sourceOrganization?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translated fields of the creative work
|
* Translated fields of the creative work
|
||||||
*/
|
*/
|
||||||
@@ -103,20 +138,36 @@ export class SCCreativeWorkMeta
|
|||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
|
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
|
||||||
...SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.de,
|
...SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.de,
|
||||||
authors: 'Authoren',
|
name: 'Titel',
|
||||||
|
authors: 'beteiligte Personen',
|
||||||
|
availableLanguages: 'verfügbare Übersetzungen',
|
||||||
datePublished: 'Veröffentlichungsdatum',
|
datePublished: 'Veröffentlichungsdatum',
|
||||||
inLanguages: 'verfügbare Übersetzungen',
|
edition: 'Ausgabe',
|
||||||
|
firstPublished: 'erste Veröffentlichung',
|
||||||
|
inLanguage: 'Inhaltssprache',
|
||||||
|
isPartOf: 'erschienen in',
|
||||||
keywords: 'Schlagwörter',
|
keywords: 'Schlagwörter',
|
||||||
|
lastPublished: 'aktuellste Veröffentlichung',
|
||||||
publishers: 'Verleger',
|
publishers: 'Verleger',
|
||||||
|
publications: 'Veröffentlichungen',
|
||||||
|
sourceOrganization: 'Körperschaft',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
|
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
|
||||||
...SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.en,
|
...SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.en,
|
||||||
authors: 'authors',
|
name: 'title',
|
||||||
|
authors: 'involved persons',
|
||||||
|
availableLanguages: 'available languages',
|
||||||
datePublished: 'release date',
|
datePublished: 'release date',
|
||||||
inLanguages: 'available Languages',
|
edition: 'edition',
|
||||||
|
firstPublished: 'first published',
|
||||||
|
inLanguage: 'content language',
|
||||||
|
isPartOf: 'published in',
|
||||||
keywords: 'keywords',
|
keywords: 'keywords',
|
||||||
|
lastPublished: 'last published',
|
||||||
publishers: 'publishers',
|
publishers: 'publishers',
|
||||||
|
publications: 'publications',
|
||||||
|
sourceOrganization: 'corporation',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -126,7 +177,7 @@ export class SCCreativeWorkMeta
|
|||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
|
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
|
||||||
...SCThingThatCanBeOfferedMeta.getInstance().fieldValueTranslations.en,
|
...SCThingThatCanBeOfferedMeta.getInstance().fieldValueTranslations.de,
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
|
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
|
||||||
|
|||||||
64
src/things/abstract/range.ts
Normal file
64
src/things/abstract/range.ts
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2021 StApps
|
||||||
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
|
* Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with
|
||||||
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
import {SCISO8601Date} from '../../general/time';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Date Range
|
||||||
|
*
|
||||||
|
* CAUTION: Changing the name requires changes in the core-tools premaps
|
||||||
|
*/
|
||||||
|
export type SCISO8601DateRange = SCRange<SCISO8601Date>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generic range type
|
||||||
|
*/
|
||||||
|
export type SCRange<T> = {
|
||||||
|
/**
|
||||||
|
* Greater than value
|
||||||
|
*/
|
||||||
|
gt?: never;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Greater or equal to value
|
||||||
|
*/
|
||||||
|
gte?: T;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Greater than value
|
||||||
|
*/
|
||||||
|
lt?: never;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Greater or equal to value
|
||||||
|
*/
|
||||||
|
lte?: T;
|
||||||
|
} | {
|
||||||
|
// tslint:disable:completed-docs
|
||||||
|
gt?: T;
|
||||||
|
gte?: never;
|
||||||
|
lt?: T;
|
||||||
|
lte?: never;
|
||||||
|
} | {
|
||||||
|
gt?: T;
|
||||||
|
gte?: never;
|
||||||
|
lt?: never;
|
||||||
|
lte?: T;
|
||||||
|
} | {
|
||||||
|
gt?: never;
|
||||||
|
gte?: T;
|
||||||
|
lt?: T;
|
||||||
|
lte?: never;
|
||||||
|
// tslint:enable:completed-docs
|
||||||
|
};
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
import {SCIndexableThings} from '../../meta';
|
||||||
import {SCThing, SCThingUserOrigin, SCThingWithoutReferences} from './thing';
|
import {SCThing, SCThingUserOrigin, SCThingWithoutReferences} from './thing';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -19,18 +20,17 @@ import {SCThing, SCThingUserOrigin, SCThingWithoutReferences} from './thing';
|
|||||||
*/
|
*/
|
||||||
export interface SCSaveableThingWithoutReferences
|
export interface SCSaveableThingWithoutReferences
|
||||||
extends SCThingWithoutReferences {
|
extends SCThingWithoutReferences {
|
||||||
// noop
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An encapsulation of the data (e.g. a thing) that is saved, which provides additional information.
|
* An encapsulation of the data (e.g. a thing) that is saved, which provides additional information.
|
||||||
*/
|
*/
|
||||||
export interface SCSaveableThing<T extends SCThingWithoutReferences>
|
export interface SCSaveableThing
|
||||||
extends SCSaveableThingWithoutReferences, SCThing {
|
extends SCSaveableThingWithoutReferences, SCThing {
|
||||||
/**
|
/**
|
||||||
* The contained data
|
* The contained data
|
||||||
*/
|
*/
|
||||||
data: T;
|
data: SCIndexableThings;
|
||||||
/**
|
/**
|
||||||
* Type of the origin
|
* Type of the origin
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2019 StApps
|
* Copyright (C) 2019-2021 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -13,10 +13,10 @@
|
|||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {SCMetaTranslations, SCTranslations} from '../../general/i18n';
|
import {SCMetaTranslations, SCTranslations} from '../../general/i18n';
|
||||||
import {SCISO8601Date} from '../../general/time';
|
|
||||||
import {SCOrganizationWithoutReferences} from '../organization';
|
import {SCOrganizationWithoutReferences} from '../organization';
|
||||||
import {SCPersonWithoutReferences} from '../person';
|
import {SCPersonWithoutReferences} from '../person';
|
||||||
import {SCInPlace} from './place';
|
import {SCInPlace} from './place';
|
||||||
|
import {SCISO8601DateRange} from './range';
|
||||||
import {SCThing, SCThingMeta, SCThingTranslatableProperties, SCThingWithoutReferences} from './thing';
|
import {SCThing, SCThingMeta, SCThingTranslatableProperties, SCThingWithoutReferences} from './thing';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -100,19 +100,14 @@ export interface SCThingThatCanBeOfferedOffer<T extends SCPriceGroup>
|
|||||||
availability: SCThingThatCanBeOfferedAvailability;
|
availability: SCThingThatCanBeOfferedAvailability;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The time when the thing becomes unavailable as an SCISO8601Date formatted string.
|
* The time when the thing is available.
|
||||||
*/
|
*/
|
||||||
availabilityEnds?: SCISO8601Date;
|
availabilityRange?: SCISO8601DateRange;
|
||||||
|
|
||||||
/**
|
|
||||||
* The time when the thing becomes available as an SCISO8601Date formatted string.
|
|
||||||
*/
|
|
||||||
availabilityStarts?: SCISO8601Date;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of prices that are distinct for specific groups
|
* List of prices that are distinct for specific groups
|
||||||
*/
|
*/
|
||||||
prices: T;
|
prices?: T;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provider of an offer
|
* Provider of an offer
|
||||||
|
|||||||
@@ -64,6 +64,8 @@ export interface SCThingWithCategoriesTranslatableProperties
|
|||||||
extends SCThingTranslatableProperties {
|
extends SCThingTranslatableProperties {
|
||||||
/**
|
/**
|
||||||
* translations of the categories of a thing with categories
|
* translations of the categories of a thing with categories
|
||||||
|
*
|
||||||
|
* @sortable ducet
|
||||||
*/
|
*/
|
||||||
categories?: string[];
|
categories?: string[];
|
||||||
}
|
}
|
||||||
@@ -98,6 +100,7 @@ export interface SCThingWithCategoriesSpecificValues {
|
|||||||
/**
|
/**
|
||||||
* Category specific name of a thing
|
* Category specific name of a thing
|
||||||
*
|
*
|
||||||
|
* @sortable ducet
|
||||||
* @text
|
* @text
|
||||||
*/
|
*/
|
||||||
name?: string;
|
name?: string;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {SCMetaTranslations, SCTranslations} from '../../general/i18n';
|
import {SCMetaTranslations, SCTranslations} from '../../general/i18n';
|
||||||
|
import {SCMap} from '../../general/map';
|
||||||
import {SCISO8601Date} from '../../general/time';
|
import {SCISO8601Date} from '../../general/time';
|
||||||
import {SCUuid} from '../../general/uuid';
|
import {SCUuid} from '../../general/uuid';
|
||||||
import {SCOrganizationWithoutReferences} from '../organization';
|
import {SCOrganizationWithoutReferences} from '../organization';
|
||||||
@@ -22,12 +23,15 @@ import {SCPersonWithoutReferences} from '../person';
|
|||||||
* Types a thing can be
|
* Types a thing can be
|
||||||
*/
|
*/
|
||||||
export enum SCThingType {
|
export enum SCThingType {
|
||||||
|
Assessment = 'assessment',
|
||||||
AcademicEvent = 'academic event',
|
AcademicEvent = 'academic event',
|
||||||
Article = 'article',
|
Article = 'article',
|
||||||
Book = 'book',
|
Book = 'book',
|
||||||
|
Periodical = 'periodical',
|
||||||
Building = 'building',
|
Building = 'building',
|
||||||
Catalog = 'catalog',
|
Catalog = 'catalog',
|
||||||
CourseOfStudies = 'course of studies',
|
ContactPoint = 'contact point',
|
||||||
|
CourseOfStudy = 'course of study',
|
||||||
DateSeries = 'date series',
|
DateSeries = 'date series',
|
||||||
Diff = 'diff',
|
Diff = 'diff',
|
||||||
Dish = 'dish',
|
Dish = 'dish',
|
||||||
@@ -37,6 +41,7 @@ export enum SCThingType {
|
|||||||
Organization = 'organization',
|
Organization = 'organization',
|
||||||
Person = 'person',
|
Person = 'person',
|
||||||
PointOfInterest = 'point of interest',
|
PointOfInterest = 'point of interest',
|
||||||
|
PublicationEvent = 'publication event',
|
||||||
Room = 'room',
|
Room = 'room',
|
||||||
Semester = 'semester',
|
Semester = 'semester',
|
||||||
Setting = 'setting',
|
Setting = 'setting',
|
||||||
@@ -59,6 +64,7 @@ export interface SCThingWithoutReferences {
|
|||||||
* @keyword
|
* @keyword
|
||||||
*/
|
*/
|
||||||
alternateNames?: string[];
|
alternateNames?: string[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description of the thing
|
* Description of the thing
|
||||||
*
|
*
|
||||||
@@ -66,12 +72,21 @@ export interface SCThingWithoutReferences {
|
|||||||
* @text
|
* @text
|
||||||
*/
|
*/
|
||||||
description?: string;
|
description?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The identifier property represents any kind of additional identifier for any kind of SCThing
|
||||||
|
*
|
||||||
|
* E.g. GTIN codes, UUIDs, Database IDs etc.
|
||||||
|
*/
|
||||||
|
identifiers?: SCMap<string>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* URL of an image of the thing
|
* URL of an image of the thing
|
||||||
*
|
*
|
||||||
* @keyword
|
* @keyword
|
||||||
*/
|
*/
|
||||||
image?: string;
|
image?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Name of the thing
|
* Name of the thing
|
||||||
*
|
*
|
||||||
@@ -81,12 +96,21 @@ export interface SCThingWithoutReferences {
|
|||||||
* @text
|
* @text
|
||||||
*/
|
*/
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* URL of a reference Web page that unambiguously indicates the item's identity
|
||||||
|
*
|
||||||
|
* E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
|
||||||
|
*/
|
||||||
|
sameAs?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translations of specific values of the object
|
* Translations of specific values of the object
|
||||||
*
|
*
|
||||||
* Take precedence over "main" value for selected languages.
|
* Take precedence over "main" value for selected languages.
|
||||||
*/
|
*/
|
||||||
translations?: SCTranslations<SCThingTranslatableProperties>;
|
translations?: SCTranslations<SCThingTranslatableProperties>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type of the thing
|
* Type of the thing
|
||||||
*
|
*
|
||||||
@@ -95,14 +119,11 @@ export interface SCThingWithoutReferences {
|
|||||||
* @aggregatable global
|
* @aggregatable global
|
||||||
*/
|
*/
|
||||||
type: SCThingType;
|
type: SCThingType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Universally unique identifier of the thing
|
* Universally unique identifier of the thing
|
||||||
*/
|
*/
|
||||||
uid: SCUuid;
|
uid: SCUuid;
|
||||||
/**
|
|
||||||
* URL of the thing
|
|
||||||
*/
|
|
||||||
url?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -222,6 +243,7 @@ export interface SCThingTranslatableProperties {
|
|||||||
/**
|
/**
|
||||||
* Translation of the name of the thing
|
* Translation of the name of the thing
|
||||||
*
|
*
|
||||||
|
* @sortable ducet
|
||||||
* @text
|
* @text
|
||||||
*/
|
*/
|
||||||
name?: string;
|
name?: string;
|
||||||
@@ -248,7 +270,7 @@ export interface SCThingTranslatablePropertyOrigin {
|
|||||||
*/
|
*/
|
||||||
export class SCThingMeta implements SCMetaTranslations<SCThing> {
|
export class SCThingMeta implements SCMetaTranslations<SCThing> {
|
||||||
/**
|
/**
|
||||||
* Set type definiton for singleton instance
|
* Set type definition for singleton instance
|
||||||
*/
|
*/
|
||||||
protected static _instance = new Map<string, unknown>();
|
protected static _instance = new Map<string, unknown>();
|
||||||
|
|
||||||
@@ -259,24 +281,26 @@ export class SCThingMeta implements SCMetaTranslations<SCThing> {
|
|||||||
de: {
|
de: {
|
||||||
alternateNames: 'alternative Namen',
|
alternateNames: 'alternative Namen',
|
||||||
description: 'Beschreibung',
|
description: 'Beschreibung',
|
||||||
|
identifiers: 'Alternative Identifikation',
|
||||||
image: 'Bild',
|
image: 'Bild',
|
||||||
name: 'Name',
|
name: 'Name',
|
||||||
origin: 'Ursprung',
|
origin: 'Ursprung',
|
||||||
|
sameAs: 'ursprünglicher Link',
|
||||||
translations: 'Übersetzungen',
|
translations: 'Übersetzungen',
|
||||||
type: 'Typ',
|
type: 'Typ',
|
||||||
uid: 'Identifikation',
|
uid: 'Identifikation',
|
||||||
url: 'URL',
|
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
alternateNames: 'alternate names',
|
alternateNames: 'alternate names',
|
||||||
description: 'description',
|
description: 'description',
|
||||||
|
identifiers: 'alternative identification',
|
||||||
image: 'image',
|
image: 'image',
|
||||||
name: 'name',
|
name: 'name',
|
||||||
origin: 'origin',
|
origin: 'origin',
|
||||||
|
sameAs: 'original link',
|
||||||
translations: 'translations',
|
translations: 'translations',
|
||||||
type: 'type',
|
type: 'type',
|
||||||
uid: 'identification',
|
uid: 'identification',
|
||||||
url: 'URL',
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
21
src/things/abstract/user-groups.ts
Normal file
21
src/things/abstract/user-groups.ts
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2021 StApps
|
||||||
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
|
* Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with
|
||||||
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* Types of data consumers
|
||||||
|
*/
|
||||||
|
export type SCUserGroup =
|
||||||
|
'students'
|
||||||
|
| 'employees'
|
||||||
|
| 'guests';
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2019 StApps
|
* Copyright (C) 2019-2021 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -21,12 +21,19 @@ import {
|
|||||||
} from './abstract/creative-work';
|
} from './abstract/creative-work';
|
||||||
import {SCThingMeta, SCThingType} from './abstract/thing';
|
import {SCThingMeta, SCThingType} from './abstract/thing';
|
||||||
import {
|
import {
|
||||||
SCThingWithCategories,
|
|
||||||
SCThingWithCategoriesSpecificValues,
|
SCThingWithCategoriesSpecificValues,
|
||||||
SCThingWithCategoriesTranslatableProperties,
|
SCThingWithCategoriesTranslatableProperties,
|
||||||
SCThingWithCategoriesWithoutReferences,
|
SCThingWithCategoriesWithoutReferences,
|
||||||
SCThingWithCategoriesWithoutReferencesMeta,
|
SCThingWithCategoriesWithoutReferencesMeta,
|
||||||
} from './abstract/thing-with-categories';
|
} from './abstract/thing-with-categories';
|
||||||
|
import {SCPeriodicalWithoutReferences} from './periodical';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Categories of an article
|
||||||
|
*/
|
||||||
|
export type SCArticleCategories = 'unipedia'
|
||||||
|
| 'article'
|
||||||
|
| 'eArticle';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An article without references
|
* An article without references
|
||||||
@@ -39,7 +46,12 @@ export interface SCArticleWithoutReferences
|
|||||||
*
|
*
|
||||||
* @text
|
* @text
|
||||||
*/
|
*/
|
||||||
articleBody: string;
|
articleBody?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Categories of an article
|
||||||
|
*/
|
||||||
|
categories: SCArticleCategories[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translated fields of an article
|
* Translated fields of an article
|
||||||
@@ -59,8 +71,16 @@ export interface SCArticleWithoutReferences
|
|||||||
* @indexable
|
* @indexable
|
||||||
*/
|
*/
|
||||||
export interface SCArticle
|
export interface SCArticle
|
||||||
extends SCCreativeWork, SCArticleWithoutReferences,
|
extends SCCreativeWork, SCArticleWithoutReferences {
|
||||||
SCThingWithCategories<SCArticleCategories, SCThingWithCategoriesSpecificValues> {
|
/**
|
||||||
|
* A periodical to which this article belongs
|
||||||
|
*/
|
||||||
|
isPartOf?: SCPeriodicalWithoutReferences;
|
||||||
|
/**
|
||||||
|
* Additional information about how to find the article inside of its "parent" (which is provided in 'isPartOf')
|
||||||
|
* e.g. "40, 2011, S. 2-3"
|
||||||
|
*/
|
||||||
|
reference?: string;
|
||||||
/**
|
/**
|
||||||
* Translated fields of an article
|
* Translated fields of an article
|
||||||
*/
|
*/
|
||||||
@@ -73,12 +93,7 @@ export interface SCArticle
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Categories of articles
|
* Translatable properties of an article
|
||||||
*/
|
|
||||||
export type SCArticleCategories = 'unipedia';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Translatable properties of creative works
|
|
||||||
*/
|
*/
|
||||||
export interface SCArticleTranslatableProperties
|
export interface SCArticleTranslatableProperties
|
||||||
extends SCThingWithCategoriesTranslatableProperties, SCCreativeWorkTranslatableProperties {
|
extends SCThingWithCategoriesTranslatableProperties, SCCreativeWorkTranslatableProperties {
|
||||||
@@ -104,6 +119,8 @@ export class SCArticleMeta
|
|||||||
.de,
|
.de,
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCArticleCategories,
|
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCArticleCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
||||||
|
categories: 'Format',
|
||||||
|
reference: 'Referenz',
|
||||||
articleBody: 'Artikelinhalt',
|
articleBody: 'Artikelinhalt',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
@@ -111,6 +128,8 @@ export class SCArticleMeta
|
|||||||
.en,
|
.en,
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCArticleCategories,
|
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCArticleCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
||||||
|
categories: 'format',
|
||||||
|
reference: 'reference',
|
||||||
articleBody: 'article body',
|
articleBody: 'article body',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -122,19 +141,22 @@ export class SCArticleMeta
|
|||||||
de: {
|
de: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
||||||
.fieldValueTranslations.de,
|
.fieldValueTranslations.de,
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCArticleCategories,
|
|
||||||
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
|
||||||
categories: {
|
categories: {
|
||||||
'unipedia': 'Unipedia',
|
article: 'Artikel',
|
||||||
|
eArticle: 'E-Aufsatz',
|
||||||
|
unipedia: 'Unipedia',
|
||||||
},
|
},
|
||||||
type: 'Artikel',
|
type: 'Artikel',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
||||||
.fieldValueTranslations.en,
|
.fieldValueTranslations.en,
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCArticleCategories,
|
|
||||||
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
|
||||||
type: SCThingType.Article,
|
type: SCThingType.Article,
|
||||||
|
categories: {
|
||||||
|
article: 'article',
|
||||||
|
eArticle: 'E-Article',
|
||||||
|
unipedia: 'unipedia',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
162
src/things/assessment.ts
Normal file
162
src/things/assessment.ts
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2019-2021 StApps
|
||||||
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
|
* Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with
|
||||||
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import {SCMetaTranslations, SCTranslations} from '../general/i18n';
|
||||||
|
import {SCISO8601Date} from '../general/time';
|
||||||
|
import {SCThing, SCThingMeta, SCThingType} from './abstract/thing';
|
||||||
|
import {SCThingWithCategories, SCThingWithCategoriesSpecificValues, SCThingWithCategoriesTranslatableProperties, SCThingWithCategoriesWithoutReferences, SCThingWithCategoriesWithoutReferencesMeta} from './abstract/thing-with-categories';
|
||||||
|
import {SCCourseOfStudyWithoutReferences} from './course-of-study';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Categories of assessments
|
||||||
|
*/
|
||||||
|
export type SCAssessmentCategories = 'university assessment';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An assessment without references
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
export interface SCAssessmentWithoutReferences
|
||||||
|
extends SCThingWithCategoriesWithoutReferences<SCAssessmentCategories, SCThingWithCategoriesSpecificValues> {
|
||||||
|
/**
|
||||||
|
* Number of attempts
|
||||||
|
*
|
||||||
|
* @integer
|
||||||
|
*/
|
||||||
|
attempt?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Date assessment was taken or graded
|
||||||
|
*/
|
||||||
|
date?: SCISO8601Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ECTS (credit-points)
|
||||||
|
*
|
||||||
|
* @float
|
||||||
|
*/
|
||||||
|
ects?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Grade
|
||||||
|
*/
|
||||||
|
grade: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Current status
|
||||||
|
*/
|
||||||
|
status?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translated fields of an assessment
|
||||||
|
*/
|
||||||
|
translations?: SCTranslations<SCAssessmentTranslatableProperties>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type of an assessment
|
||||||
|
*/
|
||||||
|
type: SCThingType.Assessment;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An assessment
|
||||||
|
*
|
||||||
|
* @validatable
|
||||||
|
*/
|
||||||
|
export interface SCAssessment
|
||||||
|
extends SCAssessmentWithoutReferences, SCThing,
|
||||||
|
SCThingWithCategories<SCAssessmentCategories, SCThingWithCategoriesSpecificValues> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Course of study the assessment was taken for
|
||||||
|
*/
|
||||||
|
courseOfStudy?: SCCourseOfStudyWithoutReferences;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An array of assessments from the 'level 0' (root) assessment to the direct parent
|
||||||
|
*/
|
||||||
|
superAssessments?: SCAssessmentWithoutReferences[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translated fields of an assessment
|
||||||
|
*/
|
||||||
|
translations?: SCTranslations<SCAssessmentTranslatableProperties>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type of an assessment
|
||||||
|
*/
|
||||||
|
type: SCThingType.Assessment;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SCAssessmentTranslatableProperties
|
||||||
|
extends SCThingWithCategoriesTranslatableProperties {
|
||||||
|
/**
|
||||||
|
* @see SCAssessmentWithoutReferences.status
|
||||||
|
*/
|
||||||
|
status?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Study module meta data
|
||||||
|
*/
|
||||||
|
export class SCAssessmentMeta
|
||||||
|
extends SCThingMeta
|
||||||
|
implements SCMetaTranslations<SCAssessment> {
|
||||||
|
/**
|
||||||
|
* Translations of fields
|
||||||
|
*/
|
||||||
|
fieldTranslations = {
|
||||||
|
de: {
|
||||||
|
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCAssessmentCategories,
|
||||||
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
||||||
|
attempt: 'Versuch',
|
||||||
|
courseOfStudy: 'Studiengang',
|
||||||
|
date: 'Datum',
|
||||||
|
ects: 'ECTS-Punkte',
|
||||||
|
grade: 'Note',
|
||||||
|
status: 'Status',
|
||||||
|
superAssessments: 'übergeordnete Prüfungen',
|
||||||
|
},
|
||||||
|
en: {
|
||||||
|
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCAssessmentCategories,
|
||||||
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
||||||
|
attempt: 'attempt',
|
||||||
|
courseOfStudy: 'course of study',
|
||||||
|
date: 'date',
|
||||||
|
ects: 'ECTS points',
|
||||||
|
grade: 'grade',
|
||||||
|
status: 'status',
|
||||||
|
superAssessments: 'parent assessments',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translations of values of fields
|
||||||
|
*/
|
||||||
|
fieldValueTranslations = {
|
||||||
|
de: {
|
||||||
|
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCAssessmentCategories,
|
||||||
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
||||||
|
type: 'Prüfung',
|
||||||
|
},
|
||||||
|
en: {
|
||||||
|
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCAssessmentCategories,
|
||||||
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
||||||
|
type: SCThingType.Assessment,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2019 StApps
|
* Copyright (C) 2019-2021 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -20,29 +20,53 @@ import {
|
|||||||
SCCreativeWorkWithoutReferences,
|
SCCreativeWorkWithoutReferences,
|
||||||
} from './abstract/creative-work';
|
} from './abstract/creative-work';
|
||||||
import {SCThingMeta, SCThingType} from './abstract/thing';
|
import {SCThingMeta, SCThingType} from './abstract/thing';
|
||||||
import {SCThingWithCategoriesTranslatableProperties} from './abstract/thing-with-categories';
|
import {
|
||||||
import {SCPersonWithoutReferences} from './person';
|
SCThingWithCategoriesSpecificValues,
|
||||||
|
SCThingWithCategoriesTranslatableProperties,
|
||||||
|
SCThingWithCategoriesWithoutReferences,
|
||||||
|
SCThingWithCategoriesWithoutReferencesMeta,
|
||||||
|
} from './abstract/thing-with-categories';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Categories of a book
|
||||||
|
*/
|
||||||
|
export type SCBookCategories = 'audio'
|
||||||
|
| 'book'
|
||||||
|
| 'cd'
|
||||||
|
| 'dvd'
|
||||||
|
| 'ePhoto'
|
||||||
|
| 'ebook'
|
||||||
|
| 'hierarchy'
|
||||||
|
| 'kit'
|
||||||
|
| 'manuscript'
|
||||||
|
| 'map'
|
||||||
|
| 'microfilm'
|
||||||
|
| 'musicalscore'
|
||||||
|
| 'photo'
|
||||||
|
| 'physicalobject'
|
||||||
|
| 'retro'
|
||||||
|
| 'sensorimage'
|
||||||
|
| 'unknown'
|
||||||
|
| 'video';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A book without references
|
* A book without references
|
||||||
*/
|
*/
|
||||||
export interface SCBookWithoutReferences
|
export interface SCBookWithoutReferences
|
||||||
extends SCCreativeWorkWithoutReferences {
|
extends SCCreativeWorkWithoutReferences,
|
||||||
|
SCThingWithCategoriesWithoutReferences<SCBookCategories, SCThingWithCategoriesSpecificValues> {
|
||||||
/**
|
/**
|
||||||
* Edition of a book
|
* Categories of a book
|
||||||
*
|
|
||||||
* @filterable
|
|
||||||
* @keyword
|
|
||||||
*/
|
*/
|
||||||
bookEdition?: string;
|
categories: SCBookCategories[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ISBN of a book
|
* ISBNs of a book
|
||||||
*
|
*
|
||||||
* @filterable
|
* @filterable
|
||||||
* @keyword
|
* @keyword
|
||||||
*/
|
*/
|
||||||
isbn: string;
|
ISBNs?: string[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Number of pages of a book
|
* Number of pages of a book
|
||||||
@@ -70,11 +94,6 @@ export interface SCBookWithoutReferences
|
|||||||
*/
|
*/
|
||||||
export interface SCBook
|
export interface SCBook
|
||||||
extends SCCreativeWork, SCBookWithoutReferences {
|
extends SCCreativeWork, SCBookWithoutReferences {
|
||||||
/**
|
|
||||||
* Authors of the creative work
|
|
||||||
*/
|
|
||||||
authors: SCPersonWithoutReferences[];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translated properties of a book
|
* Translated properties of a book
|
||||||
*/
|
*/
|
||||||
@@ -91,12 +110,6 @@ export interface SCBook
|
|||||||
*/
|
*/
|
||||||
export interface SCBookTranslatableFields
|
export interface SCBookTranslatableFields
|
||||||
extends SCThingWithCategoriesTranslatableProperties, SCCreativeWorkTranslatableProperties {
|
extends SCThingWithCategoriesTranslatableProperties, SCCreativeWorkTranslatableProperties {
|
||||||
/**
|
|
||||||
* Translation of an edition of a book
|
|
||||||
*
|
|
||||||
* @keyword
|
|
||||||
*/
|
|
||||||
bookEdition?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -108,17 +121,19 @@ export class SCBookMeta extends SCThingMeta implements SCMetaTranslations<SCBook
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations
|
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations.de,
|
||||||
.de,
|
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBookCategories,
|
||||||
bookEdition: 'Buchausgabe',
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
||||||
isbn: 'ISBN',
|
categories: 'Format',
|
||||||
numberOfPages: 'Seitenzahl',
|
ISBNs: 'ISBN',
|
||||||
|
numberOfPages: 'Seitenanzahl',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations
|
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations.en,
|
||||||
.en,
|
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBookCategories,
|
||||||
bookEdition: 'book edition',
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
||||||
isbn: 'ISBN',
|
categories: 'format',
|
||||||
|
ISBNs: 'ISBN',
|
||||||
numberOfPages: 'number of pages',
|
numberOfPages: 'number of pages',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -130,12 +145,56 @@ export class SCBookMeta extends SCThingMeta implements SCMetaTranslations<SCBook
|
|||||||
de: {
|
de: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
||||||
.fieldValueTranslations.de,
|
.fieldValueTranslations.de,
|
||||||
|
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBookCategories,
|
||||||
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
||||||
|
categories: {
|
||||||
|
audio: 'Tonträger',
|
||||||
|
book: 'Buch',
|
||||||
|
cd: 'CD',
|
||||||
|
dvd: 'DVD',
|
||||||
|
ePhoto: 'E-Photo',
|
||||||
|
ebook: 'E-Book',
|
||||||
|
hierarchy: 'mehrteiliges Werk',
|
||||||
|
kit: 'Medienkombination',
|
||||||
|
manuscript: 'Handschrift',
|
||||||
|
map: 'Karte',
|
||||||
|
microfilm: 'Mikrofilm, Mikrofiche',
|
||||||
|
musicalscore: 'Noten',
|
||||||
|
photo: 'Abbildung',
|
||||||
|
physicalobject: 'Objekt',
|
||||||
|
retro: 'Retro (Buch)',
|
||||||
|
sensorimage: 'Blindenschrift',
|
||||||
|
unknown: 'Unbekannt',
|
||||||
|
video: 'Film',
|
||||||
|
},
|
||||||
type: 'Buch',
|
type: 'Buch',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
||||||
.fieldValueTranslations.en,
|
.fieldValueTranslations.en,
|
||||||
|
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBookCategories,
|
||||||
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
||||||
type: SCThingType.Book,
|
type: SCThingType.Book,
|
||||||
|
categories: {
|
||||||
|
audio: 'audio material',
|
||||||
|
book: 'book',
|
||||||
|
cd: 'CD',
|
||||||
|
dvd: 'DVD',
|
||||||
|
ePhoto: 'E-Photo',
|
||||||
|
ebook: 'E-Book',
|
||||||
|
hierarchy: 'multipart item',
|
||||||
|
kit: 'media combination',
|
||||||
|
manuscript: 'manuscript',
|
||||||
|
map: 'map',
|
||||||
|
microfilm: 'microfilm, microfiche',
|
||||||
|
musicalscore: 'sheet music',
|
||||||
|
photo: 'illustration',
|
||||||
|
physicalobject: 'object',
|
||||||
|
retro: 'retro (book)',
|
||||||
|
sensorimage: 'braille',
|
||||||
|
unknown: 'unknown',
|
||||||
|
video: 'film',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,15 +41,6 @@ export type SCBuildingCategories =
|
|||||||
export interface SCBuildingWithoutReferences
|
export interface SCBuildingWithoutReferences
|
||||||
extends SCThingWithCategoriesWithoutReferences<SCBuildingCategories, SCThingWithCategoriesSpecificValues>,
|
extends SCThingWithCategoriesWithoutReferences<SCBuildingCategories, SCThingWithCategoriesSpecificValues>,
|
||||||
SCPlaceWithoutReferences {
|
SCPlaceWithoutReferences {
|
||||||
/**
|
|
||||||
* Categories of a building
|
|
||||||
*
|
|
||||||
* @sortable ducet
|
|
||||||
* @aggregatable
|
|
||||||
* @filterable
|
|
||||||
*/
|
|
||||||
categories: SCBuildingCategories[];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of floor names of the place
|
* List of floor names of the place
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ export interface SCCatalogWithoutReferences
|
|||||||
*
|
*
|
||||||
* Needed for keeping order in catalog inheritance array.
|
* Needed for keeping order in catalog inheritance array.
|
||||||
*
|
*
|
||||||
|
* @filterable
|
||||||
* @integer
|
* @integer
|
||||||
*/
|
*/
|
||||||
level: number;
|
level: number;
|
||||||
|
|||||||
136
src/things/contact-point.ts
Normal file
136
src/things/contact-point.ts
Normal file
@@ -0,0 +1,136 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2019 StApps
|
||||||
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
|
* Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with
|
||||||
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import {SCMetaTranslations} from '../general/i18n';
|
||||||
|
import {
|
||||||
|
SCThing,
|
||||||
|
SCThingMeta,
|
||||||
|
SCThingType,
|
||||||
|
SCThingWithoutReferences,
|
||||||
|
} from './abstract/thing';
|
||||||
|
import {SCRoomWithoutReferences} from './room';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A contact point without references
|
||||||
|
*/
|
||||||
|
export interface SCContactPointWithoutReferences
|
||||||
|
extends SCThingWithoutReferences {
|
||||||
|
/**
|
||||||
|
* E-mail at the work location
|
||||||
|
*
|
||||||
|
* @keyword
|
||||||
|
*/
|
||||||
|
email?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fax number at the work location
|
||||||
|
*
|
||||||
|
* @keyword
|
||||||
|
*/
|
||||||
|
faxNumber?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Office hours for contacting someone at the work location
|
||||||
|
*
|
||||||
|
* @see http://wiki.openstreetmap.org/wiki/Key:opening_hours/specification
|
||||||
|
* @keyword
|
||||||
|
*/
|
||||||
|
officeHours?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contact number at the work location
|
||||||
|
*
|
||||||
|
* @keyword
|
||||||
|
*/
|
||||||
|
telephone?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type of a contact point
|
||||||
|
*/
|
||||||
|
type: SCThingType.ContactPoint;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* URL at the work location
|
||||||
|
*
|
||||||
|
* @keyword
|
||||||
|
*/
|
||||||
|
url?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A contact point
|
||||||
|
*
|
||||||
|
* @see http://schema.org/ContactPoint
|
||||||
|
*
|
||||||
|
* @validatable
|
||||||
|
* @indexable
|
||||||
|
*/
|
||||||
|
export interface SCContactPoint
|
||||||
|
extends SCContactPointWithoutReferences, SCThing {
|
||||||
|
/**
|
||||||
|
* Exact place where work is performed
|
||||||
|
*/
|
||||||
|
areaServed?: SCRoomWithoutReferences;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type of a contact point
|
||||||
|
*/
|
||||||
|
type: SCThingType.ContactPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Meta information about a contact point
|
||||||
|
*/
|
||||||
|
export class SCContactPointMeta
|
||||||
|
extends SCThingMeta
|
||||||
|
implements SCMetaTranslations<SCContactPoint> {
|
||||||
|
/**
|
||||||
|
* Translations of fields
|
||||||
|
*/
|
||||||
|
fieldTranslations = {
|
||||||
|
de: {
|
||||||
|
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
|
||||||
|
areaServed: 'Arbeitsraum',
|
||||||
|
email: 'E-Mail-Addresse',
|
||||||
|
faxNumber: 'Faxnummer',
|
||||||
|
officeHours: 'Sprechzeiten',
|
||||||
|
telephone: 'Telefonnummer',
|
||||||
|
url: 'Link',
|
||||||
|
},
|
||||||
|
en: {
|
||||||
|
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
|
||||||
|
areaServed: 'location',
|
||||||
|
email: 'email address',
|
||||||
|
faxNumber: 'fax number',
|
||||||
|
officeHours: 'office hours',
|
||||||
|
telephone: 'telephone number',
|
||||||
|
url: 'link',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translations of values of fields
|
||||||
|
*/
|
||||||
|
fieldValueTranslations = {
|
||||||
|
de: {
|
||||||
|
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
|
||||||
|
type: 'Kontaktinformation',
|
||||||
|
},
|
||||||
|
en: {
|
||||||
|
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
|
||||||
|
type: SCThingType.ContactPoint,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -26,94 +26,90 @@ import {SCDateSeriesWithoutReferences} from './date-series';
|
|||||||
import {SCOrganizationWithoutReferences} from './organization';
|
import {SCOrganizationWithoutReferences} from './organization';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A course of studies without references
|
* A course of study without references
|
||||||
*/
|
*/
|
||||||
export interface SCCourseOfStudiesWithoutReferences
|
export interface SCCourseOfStudyWithoutReferences
|
||||||
extends SCAcademicDegreeWithoutReferences, SCThingThatCanBeOfferedWithoutReferences {
|
extends SCAcademicDegreeWithoutReferences, SCThingThatCanBeOfferedWithoutReferences {
|
||||||
/**
|
/**
|
||||||
* The main language in which the course of studies
|
* The main language in which the course of study
|
||||||
* is beeing offered
|
* is beeing offered
|
||||||
*/
|
*/
|
||||||
mainLanguage: SCLanguage;
|
mainLanguage?: SCLanguage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Actual major of the course of studies (eg. physics)
|
* The modes the course of study is offered in
|
||||||
*
|
*
|
||||||
* @filterable
|
* @filterable
|
||||||
* @keyword
|
|
||||||
*/
|
*/
|
||||||
major: string;
|
mode?: SCCourseOfStudyMode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The modes the course of studies is offered in
|
* The time modes the course of study is offered in
|
||||||
|
*
|
||||||
|
* @filterable
|
||||||
*/
|
*/
|
||||||
mode: SCCourseOfStudiesMode;
|
timeMode?: SCCourseOfStudyTimeMode;
|
||||||
|
|
||||||
/**
|
|
||||||
* The time modes the course of studies is offered in
|
|
||||||
*/
|
|
||||||
timeMode: SCCourseOfStudiesTimeMode;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translated fields of a dish
|
* Translated fields of a dish
|
||||||
*/
|
*/
|
||||||
translations?: SCTranslations<SCCourseOfStudiesTranslatableProperties>;
|
translations?: SCTranslations<SCCourseOfStudyTranslatableProperties>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type of the course of studies
|
* Type of the course of study
|
||||||
*/
|
*/
|
||||||
type: SCThingType.CourseOfStudies;
|
type: SCThingType.CourseOfStudy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A course of studies
|
* A course of study
|
||||||
*
|
*
|
||||||
* @validatable
|
* @validatable
|
||||||
* @indexable
|
* @indexable
|
||||||
*/
|
*/
|
||||||
export interface SCCourseOfStudies
|
export interface SCCourseOfStudy
|
||||||
extends SCCourseOfStudiesWithoutReferences, SCThingThatCanBeOffered<SCAcademicPriceGroup>, SCAcademicDegree {
|
extends SCCourseOfStudyWithoutReferences, SCThingThatCanBeOffered<SCAcademicPriceGroup>, SCAcademicDegree {
|
||||||
/**
|
/**
|
||||||
* The department that manages the course of studies
|
* The department that manages the course of study
|
||||||
*/
|
*/
|
||||||
department: SCOrganizationWithoutReferences;
|
department?: SCOrganizationWithoutReferences;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The secretary that administers requests and
|
* The secretary that administers requests and
|
||||||
* questions concerning the course of studies
|
* questions concerning the course of study
|
||||||
*/
|
*/
|
||||||
secretary: SCOrganizationWithoutReferences;
|
secretary?: SCOrganizationWithoutReferences;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dates at which the course of studies is planned to start
|
* Dates at which the course of study is planned to start
|
||||||
*/
|
*/
|
||||||
startDates?: SCDateSeriesWithoutReferences[];
|
startDates?: SCDateSeriesWithoutReferences[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translated fields of a course of studies
|
* Translated fields of a course of study
|
||||||
*/
|
*/
|
||||||
translations?: SCTranslations<SCCourseOfStudiesTranslatableProperties>;
|
translations?: SCTranslations<SCCourseOfStudyTranslatableProperties>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type of the course of studies
|
* Type of the course of study
|
||||||
*/
|
*/
|
||||||
type: SCThingType.CourseOfStudies;
|
type: SCThingType.CourseOfStudy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translatable properties of a course of studies
|
* Translatable properties of a course of study
|
||||||
*/
|
*/
|
||||||
export interface SCCourseOfStudiesTranslatableProperties
|
export interface SCCourseOfStudyTranslatableProperties
|
||||||
extends SCThingThatCanBeOfferedTranslatableProperties {
|
extends SCThingThatCanBeOfferedTranslatableProperties {
|
||||||
// noop
|
// noop
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Meta information about a course of studies
|
* Meta information about a course of study
|
||||||
*/
|
*/
|
||||||
export class SCCourseOfStudiesMeta
|
export class SCCourseOfStudyMeta
|
||||||
extends SCThingMeta
|
extends SCThingMeta
|
||||||
implements SCMetaTranslations<SCCourseOfStudies> {
|
implements SCMetaTranslations<SCCourseOfStudy> {
|
||||||
/**
|
/**
|
||||||
* Translations of fields
|
* Translations of fields
|
||||||
*/
|
*/
|
||||||
@@ -125,7 +121,6 @@ export class SCCourseOfStudiesMeta
|
|||||||
.fieldTranslations.de,
|
.fieldTranslations.de,
|
||||||
department: 'Fachbereich',
|
department: 'Fachbereich',
|
||||||
mainLanguage: 'Unterrichtssprache',
|
mainLanguage: 'Unterrichtssprache',
|
||||||
major: 'Studienfach',
|
|
||||||
mode: 'Studiengangsart',
|
mode: 'Studiengangsart',
|
||||||
secretary: 'Sekretariat',
|
secretary: 'Sekretariat',
|
||||||
startDates: 'Startdatum',
|
startDates: 'Startdatum',
|
||||||
@@ -138,7 +133,6 @@ export class SCCourseOfStudiesMeta
|
|||||||
.fieldTranslations.de,
|
.fieldTranslations.de,
|
||||||
department: 'department',
|
department: 'department',
|
||||||
mainLanguage: 'main language',
|
mainLanguage: 'main language',
|
||||||
major: 'major',
|
|
||||||
mode: 'mode',
|
mode: 'mode',
|
||||||
secretary: 'secretary',
|
secretary: 'secretary',
|
||||||
startDates: 'start dates',
|
startDates: 'start dates',
|
||||||
@@ -167,30 +161,30 @@ export class SCCourseOfStudiesMeta
|
|||||||
en: {
|
en: {
|
||||||
...SCAcademicDegreeMeta.getInstance().fieldValueTranslations.en,
|
...SCAcademicDegreeMeta.getInstance().fieldValueTranslations.en,
|
||||||
modes: {
|
modes: {
|
||||||
combination: 'combination course of studies',
|
combination: 'combination course of study',
|
||||||
'double-degree': 'double degree course of studies',
|
'double-degree': 'double degree course of study',
|
||||||
dual: 'dual course of studies',
|
dual: 'dual course of study',
|
||||||
standard: 'course of studies',
|
standard: 'course of study',
|
||||||
},
|
},
|
||||||
timeMode: {
|
timeMode: {
|
||||||
fulltime: 'full-time',
|
fulltime: 'full-time',
|
||||||
parttime: 'part-time',
|
parttime: 'part-time',
|
||||||
},
|
},
|
||||||
type: SCThingType.CourseOfStudies,
|
type: SCThingType.CourseOfStudy,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Types of (german) course of studies modes
|
* Types of (german) course of study modes
|
||||||
*/
|
*/
|
||||||
export type SCCourseOfStudiesMode = 'combination'
|
export type SCCourseOfStudyMode = 'combination'
|
||||||
| 'dual'
|
| 'dual'
|
||||||
| 'double-degree'
|
| 'double-degree'
|
||||||
| 'standard' ;
|
| 'standard' ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Types of (german) course of studies time modes
|
* Types of (german) course of study time modes
|
||||||
*/
|
*/
|
||||||
export type SCCourseOfStudiesTimeMode = 'fulltime'
|
export type SCCourseOfStudyTimeMode = 'fulltime'
|
||||||
| 'parttime' ;
|
| 'parttime' ;
|
||||||
@@ -65,9 +65,9 @@ export interface SCDateSeriesWithoutReferences
|
|||||||
/**
|
/**
|
||||||
* Frequency of the date series
|
* Frequency of the date series
|
||||||
*
|
*
|
||||||
* @keyword
|
* @filterable
|
||||||
*/
|
*/
|
||||||
frequency: string;
|
repeatFrequency?: SCISO8601Duration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translated properties
|
* Translated properties
|
||||||
@@ -131,7 +131,7 @@ export class SCDateSeriesMeta
|
|||||||
duration: 'Dauer',
|
duration: 'Dauer',
|
||||||
event: 'Event',
|
event: 'Event',
|
||||||
exceptions: 'Ausnahmen',
|
exceptions: 'Ausnahmen',
|
||||||
frequency: 'Frequenz',
|
repeatFrequency: 'Frequenz',
|
||||||
performers: 'Vortragende',
|
performers: 'Vortragende',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
@@ -143,7 +143,7 @@ export class SCDateSeriesMeta
|
|||||||
duration: 'duration',
|
duration: 'duration',
|
||||||
event: 'event',
|
event: 'event',
|
||||||
exceptions: 'exceptions',
|
exceptions: 'exceptions',
|
||||||
frequency: 'frequency',
|
repeatFrequency: 'frequency',
|
||||||
performers: 'performers',
|
performers: 'performers',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -174,8 +174,4 @@ export class SCDateSeriesMeta
|
|||||||
*/
|
*/
|
||||||
export interface SCDateSeriesTranslatableProperties
|
export interface SCDateSeriesTranslatableProperties
|
||||||
extends SCThingThatCanBeOfferedTranslatableProperties {
|
extends SCThingThatCanBeOfferedTranslatableProperties {
|
||||||
/**
|
|
||||||
* @see SCDateSeriesWithoutReferences.frequency
|
|
||||||
*/
|
|
||||||
frequency?: string;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
import * as jsonpatch from 'json-patch';
|
import * as jsonpatch from 'json-patch';
|
||||||
import {SCMetaTranslations} from '../general/i18n';
|
import {SCMetaTranslations} from '../general/i18n';
|
||||||
import {SCISO8601Date} from '../general/time';
|
import {SCISO8601Date} from '../general/time';
|
||||||
import {SCThingsWithoutDiff} from '../meta';
|
import {SCIndexableThings} from '../meta';
|
||||||
import {SCThing, SCThingMeta, SCThingType, SCThingWithoutReferences} from './abstract/thing';
|
import {SCThing, SCThingMeta, SCThingType, SCThingWithoutReferences} from './abstract/thing';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -48,14 +48,13 @@ export interface SCDiffWithoutReferences
|
|||||||
* A diff
|
* A diff
|
||||||
*
|
*
|
||||||
* @validatable
|
* @validatable
|
||||||
* @indexable
|
|
||||||
*/
|
*/
|
||||||
export interface SCDiff
|
export interface SCDiff
|
||||||
extends SCDiffWithoutReferences, SCThing {
|
extends SCDiffWithoutReferences, SCThing {
|
||||||
/**
|
/**
|
||||||
* Original object the diff was generated on
|
* Original object the diff was generated on
|
||||||
*/
|
*/
|
||||||
object: SCThingsWithoutDiff;
|
object: SCIndexableThings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type of a diff
|
* Type of a diff
|
||||||
|
|||||||
@@ -43,15 +43,6 @@ export interface SCDishWithoutReferences
|
|||||||
*/
|
*/
|
||||||
additives?: string[];
|
additives?: string[];
|
||||||
|
|
||||||
/**
|
|
||||||
* Category of the dish
|
|
||||||
*
|
|
||||||
* @sortable ducet
|
|
||||||
* @aggregatable
|
|
||||||
* @filterable
|
|
||||||
*/
|
|
||||||
categories: SCDishCategories[];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Characteristics of the dish
|
* Characteristics of the dish
|
||||||
*/
|
*/
|
||||||
@@ -100,6 +91,13 @@ export interface SCDish
|
|||||||
|
|
||||||
export interface SCDishTranslatableProperties
|
export interface SCDishTranslatableProperties
|
||||||
extends SCThingWithCategoriesTranslatableProperties, SCThingThatCanBeOfferedTranslatableProperties {
|
extends SCThingWithCategoriesTranslatableProperties, SCThingThatCanBeOfferedTranslatableProperties {
|
||||||
|
/**
|
||||||
|
* Additives of the dish
|
||||||
|
*
|
||||||
|
* @filterable
|
||||||
|
* @keyword
|
||||||
|
*/
|
||||||
|
additives?: string[];
|
||||||
/**
|
/**
|
||||||
* Characteristics of the dish
|
* Characteristics of the dish
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2019 StApps
|
* Copyright (C) 2019-2021 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -14,45 +14,24 @@
|
|||||||
*/
|
*/
|
||||||
import {SCSaveableThing, SCSaveableThingWithoutReferences} from './abstract/saveable-thing';
|
import {SCSaveableThing, SCSaveableThingWithoutReferences} from './abstract/saveable-thing';
|
||||||
import {SCThingMeta, SCThingType} from './abstract/thing';
|
import {SCThingMeta, SCThingType} from './abstract/thing';
|
||||||
import {SCAcademicEventWithoutReferences} from './academic-event';
|
|
||||||
import {SCArticleWithoutReferences} from './article';
|
|
||||||
import {SCBookWithoutReferences} from './book';
|
|
||||||
import {SCBuildingWithoutReferences} from './building';
|
|
||||||
import {SCPersonWithoutReferences} from './person';
|
|
||||||
import {SCPointOfInterestWithoutReferences} from './point-of-interest';
|
|
||||||
import {SCRoomWithoutReferences} from './room';
|
|
||||||
import {SCSportCourseWithoutReferences} from './sport-course';
|
|
||||||
import {SCToDoWithoutReferences} from './todo';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Types that can be made a favorite (added as a favorite)
|
|
||||||
*/
|
|
||||||
export type SCFavoriteDataTypes = SCAcademicEventWithoutReferences
|
|
||||||
| SCArticleWithoutReferences
|
|
||||||
| SCBookWithoutReferences
|
|
||||||
| SCBuildingWithoutReferences
|
|
||||||
| SCPersonWithoutReferences
|
|
||||||
| SCPointOfInterestWithoutReferences
|
|
||||||
| SCRoomWithoutReferences
|
|
||||||
| SCSportCourseWithoutReferences
|
|
||||||
| SCToDoWithoutReferences;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A favorite without references
|
* A favorite without references
|
||||||
*/
|
*/
|
||||||
export interface SCFavoriteWithoutReferences
|
export interface SCFavoriteWithoutReferences
|
||||||
extends SCSaveableThingWithoutReferences {
|
extends SCSaveableThingWithoutReferences {
|
||||||
// noop
|
/**
|
||||||
|
* Type of a favorite
|
||||||
|
*/
|
||||||
|
type: SCThingType.Favorite;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A favorite
|
* A favorite
|
||||||
*
|
*
|
||||||
* @validatable
|
* @validatable
|
||||||
* @indexable
|
|
||||||
*/
|
*/
|
||||||
export interface SCFavorite
|
export interface SCFavorite extends SCSaveableThing {
|
||||||
extends SCSaveableThing<SCFavoriteDataTypes>, SCFavoriteWithoutReferences {
|
|
||||||
/**
|
/**
|
||||||
* Type of a favorite
|
* Type of a favorite
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2019 StApps
|
* Copyright (C) 2019-2021 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -22,13 +22,24 @@ import {
|
|||||||
} from './abstract/creative-work';
|
} from './abstract/creative-work';
|
||||||
import {SCThingMeta, SCThingType} from './abstract/thing';
|
import {SCThingMeta, SCThingType} from './abstract/thing';
|
||||||
import {SCThingThatCanBeOfferedTranslatableProperties} from './abstract/thing-that-can-be-offered';
|
import {SCThingThatCanBeOfferedTranslatableProperties} from './abstract/thing-that-can-be-offered';
|
||||||
|
import {
|
||||||
|
SCThingWithCategoriesSpecificValues,
|
||||||
|
SCThingWithCategoriesWithoutReferences, SCThingWithCategoriesWithoutReferencesMeta,
|
||||||
|
} from './abstract/thing-with-categories';
|
||||||
|
import {SCUserGroup} from './abstract/user-groups';
|
||||||
import {SCOrganizationWithoutReferences} from './organization';
|
import {SCOrganizationWithoutReferences} from './organization';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Categories of a message
|
||||||
|
*/
|
||||||
|
export type SCMessageCategories = 'news';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A message without references
|
* A message without references
|
||||||
*/
|
*/
|
||||||
export interface SCMessageWithoutReferences
|
export interface SCMessageWithoutReferences
|
||||||
extends SCCreativeWorkWithoutReferences {
|
extends SCCreativeWorkWithoutReferences,
|
||||||
|
SCThingWithCategoriesWithoutReferences<SCMessageCategories, SCThingWithCategoriesSpecificValues> {
|
||||||
/**
|
/**
|
||||||
* Organizational unit for which the message is intended
|
* Organizational unit for which the message is intended
|
||||||
*/
|
*/
|
||||||
@@ -39,7 +50,12 @@ export interface SCMessageWithoutReferences
|
|||||||
*
|
*
|
||||||
* @filterable
|
* @filterable
|
||||||
*/
|
*/
|
||||||
audiences: SCMessageAudience[];
|
audiences: SCUserGroup[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Categories of a message
|
||||||
|
*/
|
||||||
|
categories: SCMessageCategories[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When the message was created
|
* When the message was created
|
||||||
@@ -90,14 +106,6 @@ export interface SCMessage
|
|||||||
type: SCThingType.Message;
|
type: SCThingType.Message;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Audiences for messages
|
|
||||||
*/
|
|
||||||
export type SCMessageAudience =
|
|
||||||
'students'
|
|
||||||
| 'employees'
|
|
||||||
| 'guests';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translatable properties of a message
|
* Translatable properties of a message
|
||||||
*/
|
*/
|
||||||
@@ -124,6 +132,8 @@ export class SCMessageMeta
|
|||||||
de: {
|
de: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations
|
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations
|
||||||
.de,
|
.de,
|
||||||
|
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCMessageCategories,
|
||||||
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
||||||
audienceOrganizations: 'Zielgruppenorganisationen',
|
audienceOrganizations: 'Zielgruppenorganisationen',
|
||||||
audiences: 'Zielgruppen',
|
audiences: 'Zielgruppen',
|
||||||
dateCreated: 'Erstellungsdatum',
|
dateCreated: 'Erstellungsdatum',
|
||||||
@@ -133,6 +143,8 @@ export class SCMessageMeta
|
|||||||
en: {
|
en: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations
|
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations
|
||||||
.en,
|
.en,
|
||||||
|
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCMessageCategories,
|
||||||
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
||||||
audienceOrganizations: 'audience organizations',
|
audienceOrganizations: 'audience organizations',
|
||||||
audiences: 'audiences',
|
audiences: 'audiences',
|
||||||
dateCreated: 'date created',
|
dateCreated: 'date created',
|
||||||
@@ -149,9 +161,12 @@ export class SCMessageMeta
|
|||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
||||||
.fieldValueTranslations.de,
|
.fieldValueTranslations.de,
|
||||||
audiences: {
|
audiences: {
|
||||||
'employees': 'Angestellte',
|
employees: 'Angestellte',
|
||||||
'guests': 'Gäste',
|
guests: 'Gäste',
|
||||||
'students': 'Studenten',
|
students: 'Studenten',
|
||||||
|
},
|
||||||
|
categories: {
|
||||||
|
news: 'Neuigkeiten',
|
||||||
},
|
},
|
||||||
type: 'Nachricht',
|
type: 'Nachricht',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
import {SCMetaTranslations} from '../general/i18n';
|
import {SCMetaTranslations} from '../general/i18n';
|
||||||
import {SCThingMeta, SCThingType, SCThingWithoutReferences} from './abstract/thing';
|
import {SCThingMeta, SCThingType, SCThingWithoutReferences} from './abstract/thing';
|
||||||
import {SCThingInPlace, SCThingInPlaceMeta} from './abstract/thing-in-place';
|
import {SCThingInPlace, SCThingInPlaceMeta} from './abstract/thing-in-place';
|
||||||
|
import {SCContactPointWithoutReferences} from './contact-point';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An organization without references
|
* An organization without references
|
||||||
@@ -35,6 +36,11 @@ export interface SCOrganizationWithoutReferences
|
|||||||
*/
|
*/
|
||||||
export interface SCOrganization
|
export interface SCOrganization
|
||||||
extends SCOrganizationWithoutReferences, SCThingInPlace {
|
extends SCOrganizationWithoutReferences, SCThingInPlace {
|
||||||
|
/**
|
||||||
|
* A list of contact points concerning the organization
|
||||||
|
*/
|
||||||
|
contactPoints?: SCContactPointWithoutReferences[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type of an organization
|
* Type of an organization
|
||||||
*/
|
*/
|
||||||
@@ -52,9 +58,11 @@ export class SCOrganizationMeta
|
|||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations.de,
|
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations.de,
|
||||||
|
contactPoints: 'Kontaktinformationen',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations.en,
|
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations.en,
|
||||||
|
contactPoints: 'contact details',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
137
src/things/periodical.ts
Normal file
137
src/things/periodical.ts
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2021 StApps
|
||||||
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
|
* Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with
|
||||||
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
import {SCMetaTranslations, SCTranslations} from '../general/i18n';
|
||||||
|
import {
|
||||||
|
SCCreativeWork,
|
||||||
|
SCCreativeWorkMeta,
|
||||||
|
SCCreativeWorkTranslatableProperties,
|
||||||
|
SCCreativeWorkWithoutReferences,
|
||||||
|
} from './abstract/creative-work';
|
||||||
|
import {SCThingMeta, SCThingType} from './abstract/thing';
|
||||||
|
import {
|
||||||
|
SCThingWithCategoriesSpecificValues,
|
||||||
|
SCThingWithCategoriesTranslatableProperties,
|
||||||
|
SCThingWithCategoriesWithoutReferences,
|
||||||
|
SCThingWithCategoriesWithoutReferencesMeta,
|
||||||
|
} from './abstract/thing-with-categories';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Categories of a periodical
|
||||||
|
*/
|
||||||
|
export type SCPeriodicalCategories = 'journal' | 'electronic';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A periodical without references
|
||||||
|
*/
|
||||||
|
export interface SCPeriodicalWithoutReferences
|
||||||
|
extends SCCreativeWorkWithoutReferences,
|
||||||
|
SCThingWithCategoriesWithoutReferences<SCPeriodicalCategories, SCThingWithCategoriesSpecificValues> {
|
||||||
|
/**
|
||||||
|
* Categories of a periodical
|
||||||
|
*/
|
||||||
|
categories: SCPeriodicalCategories[];
|
||||||
|
/**
|
||||||
|
* A list of ISSNs of a periodical
|
||||||
|
*
|
||||||
|
* @filterable
|
||||||
|
* @keyword
|
||||||
|
*/
|
||||||
|
ISSNs?: string[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translated properties of a periodical
|
||||||
|
*/
|
||||||
|
translations?: SCTranslations<SCPeriodicalTranslatableFields>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type of a periodical
|
||||||
|
*/
|
||||||
|
type: SCThingType.Periodical;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A publication published at regular intervals (e.g. a magazine or newspaper)
|
||||||
|
*
|
||||||
|
* @validatable
|
||||||
|
* @indexable
|
||||||
|
*/
|
||||||
|
export interface SCPeriodical
|
||||||
|
extends SCCreativeWork, SCPeriodicalWithoutReferences {
|
||||||
|
/**
|
||||||
|
* Translated properties of a periodical
|
||||||
|
*/
|
||||||
|
translations?: SCTranslations<SCPeriodicalTranslatableFields>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type of a periodical
|
||||||
|
*/
|
||||||
|
type: SCThingType.Periodical;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translatable properties of a periodical
|
||||||
|
*/
|
||||||
|
export interface SCPeriodicalTranslatableFields
|
||||||
|
extends SCThingWithCategoriesTranslatableProperties, SCCreativeWorkTranslatableProperties {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Meta information about a periodical
|
||||||
|
*/
|
||||||
|
export class SCPeriodicalMeta extends SCThingMeta implements SCMetaTranslations<SCPeriodical> {
|
||||||
|
/**
|
||||||
|
* Translations of fields
|
||||||
|
*/
|
||||||
|
fieldTranslations = {
|
||||||
|
de: {
|
||||||
|
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations.de,
|
||||||
|
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCPeriodicalCategories,
|
||||||
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
||||||
|
categories: 'Format',
|
||||||
|
ISSNs: 'ISSN',
|
||||||
|
},
|
||||||
|
en: {
|
||||||
|
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations.en,
|
||||||
|
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCPeriodicalCategories,
|
||||||
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
||||||
|
categories: 'format',
|
||||||
|
ISSNs: 'ISSN',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translations of values of fields
|
||||||
|
*/
|
||||||
|
fieldValueTranslations = {
|
||||||
|
de: {
|
||||||
|
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
||||||
|
.fieldValueTranslations.de,
|
||||||
|
type: 'Periodikum',
|
||||||
|
categories: {
|
||||||
|
electronic: 'E-Journal',
|
||||||
|
journal: 'Zeitschrift',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
en: {
|
||||||
|
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
||||||
|
.fieldValueTranslations.en,
|
||||||
|
type: 'periodical',
|
||||||
|
categories: {
|
||||||
|
electronic: 'E-Journal',
|
||||||
|
journal: 'journal',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -16,6 +16,7 @@ import {SCMetaTranslations, SCNationality} from '../general/i18n';
|
|||||||
import {SCISO8601Date} from '../general/time';
|
import {SCISO8601Date} from '../general/time';
|
||||||
import {SCThing, SCThingMeta, SCThingType, SCThingWithoutReferences} from './abstract/thing';
|
import {SCThing, SCThingMeta, SCThingType, SCThingWithoutReferences} from './abstract/thing';
|
||||||
import {SCBuildingWithoutReferences} from './building';
|
import {SCBuildingWithoutReferences} from './building';
|
||||||
|
import {SCContactPointWithoutReferences} from './contact-point';
|
||||||
import {SCOrganizationWithoutReferences} from './organization';
|
import {SCOrganizationWithoutReferences} from './organization';
|
||||||
import {SCPointOfInterestWithoutReferences} from './point-of-interest';
|
import {SCPointOfInterestWithoutReferences} from './point-of-interest';
|
||||||
import {SCRoomWithoutReferences} from './room';
|
import {SCRoomWithoutReferences} from './room';
|
||||||
@@ -56,7 +57,7 @@ export interface SCPersonWithoutReferences
|
|||||||
* @filterable
|
* @filterable
|
||||||
* @keyword
|
* @keyword
|
||||||
*/
|
*/
|
||||||
familyName: string;
|
familyName?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The private fax number of the person.
|
* The private fax number of the person.
|
||||||
@@ -79,7 +80,7 @@ export interface SCPersonWithoutReferences
|
|||||||
* @filterable
|
* @filterable
|
||||||
* @keyword
|
* @keyword
|
||||||
*/
|
*/
|
||||||
givenName: string;
|
givenName?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Honorific prefix of the person.
|
* Honorific prefix of the person.
|
||||||
@@ -159,7 +160,7 @@ export interface SCPerson
|
|||||||
/**
|
/**
|
||||||
* Locations where the person performs her/his work
|
* Locations where the person performs her/his work
|
||||||
*/
|
*/
|
||||||
workLocations?: SCContactPoint[];
|
workLocations?: SCContactPointWithoutReferences[];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -188,13 +189,14 @@ export class SCPersonMeta
|
|||||||
jobTitles: 'Berufsbezeichnungen',
|
jobTitles: 'Berufsbezeichnungen',
|
||||||
nationality: 'Staatsangehörigkeit',
|
nationality: 'Staatsangehörigkeit',
|
||||||
telephone: 'Telefonnummer',
|
telephone: 'Telefonnummer',
|
||||||
workLocations: 'Arbeitsorte',
|
workLocations: 'Arbeitsstandorte',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
|
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
|
||||||
additionalName: 'additional name',
|
additionalName: 'additional name',
|
||||||
affiliations: 'affiliations',
|
affiliations: 'affiliations',
|
||||||
birthDate: 'birth date',
|
birthDate: 'birth date',
|
||||||
|
contactDetails: 'contact details',
|
||||||
email: 'email',
|
email: 'email',
|
||||||
familyName: 'family name',
|
familyName: 'family name',
|
||||||
faxNumber: 'fax',
|
faxNumber: 'fax',
|
||||||
@@ -231,53 +233,6 @@ export class SCPersonMeta
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* A contact point
|
|
||||||
*
|
|
||||||
* @see http://schema.org/ContactPoint
|
|
||||||
*/
|
|
||||||
export interface SCContactPoint {
|
|
||||||
/**
|
|
||||||
* Exact place where work is performed
|
|
||||||
*/
|
|
||||||
areaServed?: SCRoomWithoutReferences;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* E-mail at the work location
|
|
||||||
*
|
|
||||||
* @keyword
|
|
||||||
*/
|
|
||||||
email?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fax number at the work location
|
|
||||||
*
|
|
||||||
* @keyword
|
|
||||||
*/
|
|
||||||
faxNumber?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Times available for contacting at the work location
|
|
||||||
*
|
|
||||||
* @keyword
|
|
||||||
*/
|
|
||||||
hoursAvailable?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Contact number at the work location
|
|
||||||
*
|
|
||||||
* @keyword
|
|
||||||
*/
|
|
||||||
telephone?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* URL at the work location
|
|
||||||
*
|
|
||||||
* @keyword
|
|
||||||
*/
|
|
||||||
url?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gender of a person
|
* Gender of a person
|
||||||
*/
|
*/
|
||||||
|
|||||||
105
src/things/publication-event.ts
Normal file
105
src/things/publication-event.ts
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2021 StApps
|
||||||
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
|
* Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with
|
||||||
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
import {SCMetaTranslations, SCTranslations} from '../general/i18n';
|
||||||
|
import {SCEvent, SCEventMeta, SCEventWithoutReferences} from './abstract/event';
|
||||||
|
import {SCThingMeta, SCThingTranslatableProperties, SCThingType} from './abstract/thing';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An publication event without references
|
||||||
|
*/
|
||||||
|
export interface SCPublicationEventWithoutReferences
|
||||||
|
extends SCEventWithoutReferences {
|
||||||
|
/**
|
||||||
|
* All the locations related to the event (e.g. where a creative work was published)
|
||||||
|
*/
|
||||||
|
locations?: string[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An organization (or a person) that is publishing at the event
|
||||||
|
*/
|
||||||
|
publisher?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translated fields of an publication event
|
||||||
|
*/
|
||||||
|
translations?: SCTranslations<SCPublicationEventTranslatableProperties>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type of an publication event
|
||||||
|
*/
|
||||||
|
type: SCThingType.PublicationEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An publication event
|
||||||
|
*
|
||||||
|
* @validatable
|
||||||
|
* @indexable
|
||||||
|
*/
|
||||||
|
export interface SCPublicationEvent
|
||||||
|
extends SCEvent, SCPublicationEventWithoutReferences {
|
||||||
|
/**
|
||||||
|
* Translated fields of an publication event
|
||||||
|
*/
|
||||||
|
translations?: SCTranslations<SCPublicationEventTranslatableProperties>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type of an publication event
|
||||||
|
*/
|
||||||
|
type: SCThingType.PublicationEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translatable properties of an publication event
|
||||||
|
*/
|
||||||
|
export interface SCPublicationEventTranslatableProperties extends SCThingTranslatableProperties {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Meta information about publication events
|
||||||
|
*/
|
||||||
|
export class SCPublicationEventMeta
|
||||||
|
extends SCThingMeta
|
||||||
|
implements SCMetaTranslations<SCPublicationEvent> {
|
||||||
|
/**
|
||||||
|
* Translations of fields
|
||||||
|
*/
|
||||||
|
fieldTranslations = {
|
||||||
|
de: {
|
||||||
|
...SCEventMeta.getInstance<SCEventMeta>().fieldTranslations.de,
|
||||||
|
locations: 'Erscheinungsorte',
|
||||||
|
publisher: 'Verlag',
|
||||||
|
},
|
||||||
|
en: {
|
||||||
|
...SCEventMeta.getInstance<SCEventMeta>().fieldTranslations.en,
|
||||||
|
locations: 'places of publication',
|
||||||
|
publisher: 'publisher',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translations of values of fields
|
||||||
|
*/
|
||||||
|
fieldValueTranslations = {
|
||||||
|
de: {
|
||||||
|
...SCEventMeta.getInstance<SCEventMeta>().fieldValueTranslations.de,
|
||||||
|
type: 'Veröffentlichung',
|
||||||
|
},
|
||||||
|
en: {
|
||||||
|
...SCEventMeta.getInstance<SCEventMeta>().fieldValueTranslations.en,
|
||||||
|
type: 'publication event',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -29,7 +29,7 @@ export interface SCSemesterWithoutReferences
|
|||||||
* The short name of the semester, using the given pattern.
|
* The short name of the semester, using the given pattern.
|
||||||
*
|
*
|
||||||
* @filterable
|
* @filterable
|
||||||
* @pattern ^(WS|SS) [0-9]{4}(/[0-9]{2})?$
|
* @pattern ^(WS|SS|WiSe|SoSe) [0-9]{4}(/[0-9]{2})?$
|
||||||
* @keyword
|
* @keyword
|
||||||
*/
|
*/
|
||||||
acronym: string;
|
acronym: string;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2019 StApps
|
* Copyright (C) 2019-2021 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {SCMetaTranslations, SCTranslations} from '../general/i18n';
|
import {SCLanguageCode, SCMetaTranslations, SCTranslations} from '../general/i18n';
|
||||||
import {SCThing, SCThingMeta, SCThingType} from './abstract/thing';
|
import {SCThing, SCThingMeta, SCThingType} from './abstract/thing';
|
||||||
import {
|
import {
|
||||||
SCThingWithCategories,
|
SCThingWithCategories,
|
||||||
@@ -21,16 +21,13 @@ import {
|
|||||||
SCThingWithCategoriesWithoutReferences,
|
SCThingWithCategoriesWithoutReferences,
|
||||||
SCThingWithCategoriesWithoutReferencesMeta,
|
SCThingWithCategoriesWithoutReferencesMeta,
|
||||||
} from './abstract/thing-with-categories';
|
} from './abstract/thing-with-categories';
|
||||||
|
import {SCUserGroup} from './abstract/user-groups';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A setting without references
|
* A setting without references
|
||||||
*/
|
*/
|
||||||
export interface SCSettingWithoutReferences
|
export interface SCSettingWithoutReferences
|
||||||
extends SCThingWithCategoriesWithoutReferences<SCSettingCategories, SCThingWithCategoriesSpecificValues> {
|
extends SCThingWithCategoriesWithoutReferences<SCSettingCategories, SCThingWithCategoriesSpecificValues> {
|
||||||
/**
|
|
||||||
* Categories of a setting
|
|
||||||
*/
|
|
||||||
categories: SCSettingCategories[];
|
|
||||||
/**
|
/**
|
||||||
* The default value of a setting
|
* The default value of a setting
|
||||||
*/
|
*/
|
||||||
@@ -87,7 +84,6 @@ export enum SCSettingInputType {
|
|||||||
* A setting with references
|
* A setting with references
|
||||||
*
|
*
|
||||||
* @validatable
|
* @validatable
|
||||||
* @indexable
|
|
||||||
*/
|
*/
|
||||||
export interface SCSetting
|
export interface SCSetting
|
||||||
extends SCSettingWithoutReferences, SCThing,
|
extends SCSettingWithoutReferences, SCThing,
|
||||||
@@ -181,3 +177,55 @@ export class SCSettingMeta extends SCThingMeta implements SCMetaTranslations<SCS
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A user group setting
|
||||||
|
*/
|
||||||
|
export interface SCUserGroupSetting extends SCSetting {
|
||||||
|
/**
|
||||||
|
* Exact categories of the setting
|
||||||
|
*/
|
||||||
|
categories: ['profile'];
|
||||||
|
/**
|
||||||
|
* The default value of the setting
|
||||||
|
*/
|
||||||
|
defaultValue: SCUserGroup;
|
||||||
|
/**
|
||||||
|
* Specific name of the setting
|
||||||
|
*/
|
||||||
|
name: 'group';
|
||||||
|
/**
|
||||||
|
* Chosen value of the setting
|
||||||
|
*/
|
||||||
|
value?: SCUserGroup;
|
||||||
|
/**
|
||||||
|
* The possible values of the setting
|
||||||
|
*/
|
||||||
|
values: SCUserGroup[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A language setting
|
||||||
|
*/
|
||||||
|
export interface SCLanguageSetting extends SCSetting {
|
||||||
|
/**
|
||||||
|
* Exact categories of the setting
|
||||||
|
*/
|
||||||
|
categories: ['profile'];
|
||||||
|
/**
|
||||||
|
* The default value of the setting
|
||||||
|
*/
|
||||||
|
defaultValue: SCLanguageCode;
|
||||||
|
/**
|
||||||
|
* Specific name of the setting
|
||||||
|
*/
|
||||||
|
name: 'language';
|
||||||
|
/**
|
||||||
|
* Chosen value of the setting
|
||||||
|
*/
|
||||||
|
value?: SCLanguageCode;
|
||||||
|
/**
|
||||||
|
* The possible values of the setting
|
||||||
|
*/
|
||||||
|
values: SCLanguageCode[];
|
||||||
|
}
|
||||||
|
|||||||
@@ -29,8 +29,6 @@ export interface SCTourWithoutReferences
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Steps of a tour
|
* Steps of a tour
|
||||||
*
|
|
||||||
* @keyword
|
|
||||||
*/
|
*/
|
||||||
steps: SCTourStep[];
|
steps: SCTourStep[];
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,9 @@
|
|||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import clone = require('fast-clone');
|
import clone = require('fast-clone');
|
||||||
import {Defined, OCType} from 'ts-optchain';
|
import equal = require('fast-deep-equal/es6');
|
||||||
import {SCTranslations} from './general/i18n';
|
import {Defined, TSOCType} from 'ts-optchain';
|
||||||
|
import {SCLanguageCode} from './general/i18n';
|
||||||
import {isThing} from './guards';
|
import {isThing} from './guards';
|
||||||
import {SCClasses} from './meta';
|
import {SCClasses} from './meta';
|
||||||
import {SCThing, SCThingType} from './things/abstract/thing';
|
import {SCThing, SCThingType} from './things/abstract/thing';
|
||||||
@@ -27,13 +28,32 @@ const standardCacheSize = 200;
|
|||||||
*/
|
*/
|
||||||
export class SCThingTranslator {
|
export class SCThingTranslator {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Getter for language property
|
||||||
|
*/
|
||||||
|
get language(): SCLanguageCode {
|
||||||
|
return this._language;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setter for language property. Also flushes translation cache
|
||||||
|
*
|
||||||
|
* @param language The language the translator instance will use from now on
|
||||||
|
*/
|
||||||
|
set language(language: SCLanguageCode) {
|
||||||
|
if (language !== this._language) {
|
||||||
|
this.cache.flush();
|
||||||
|
}
|
||||||
|
this._language = language;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Property representing the translators target language
|
* Property representing the translators target language
|
||||||
*/
|
*/
|
||||||
private _language: keyof SCTranslations<SCThing>;
|
private _language: SCLanguageCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Property representing the translators base language
|
* LRU cache containing already translated SCThings
|
||||||
* This means every translation is given for this language
|
|
||||||
*/
|
*/
|
||||||
private readonly cache: LRUCache<SCThing>;
|
private readonly cache: LRUCache<SCThing>;
|
||||||
|
|
||||||
@@ -42,46 +62,33 @@ export class SCThingTranslator {
|
|||||||
*/
|
*/
|
||||||
private readonly metaClasses: typeof SCClasses;
|
private readonly metaClasses: typeof SCClasses;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LRU cache containing SCThings translations have been provided for
|
||||||
|
*/
|
||||||
|
private readonly sourceCache: LRUCache<SCThing>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @example
|
* @example
|
||||||
* // returns translator instance for german
|
* // returns translator instance for german
|
||||||
* new SCThingTranslator('de');
|
* new SCThingTranslator('de');
|
||||||
*/
|
*/
|
||||||
constructor(language: keyof SCTranslations<SCThing>, cacheCapacity: number = standardCacheSize) {
|
constructor(language: SCLanguageCode, cacheCapacity: number = standardCacheSize) {
|
||||||
this.cache = new LRUCache(cacheCapacity);
|
this.cache = new LRUCache(cacheCapacity);
|
||||||
|
this.sourceCache = new LRUCache(cacheCapacity);
|
||||||
this._language = language;
|
this._language = language;
|
||||||
this.metaClasses = SCClasses;
|
this.metaClasses = SCClasses;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Getter for language property
|
|
||||||
*/
|
|
||||||
get language(): keyof SCTranslations<SCThing> {
|
|
||||||
return this._language;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Setter for language property. Also flushes translation cache
|
|
||||||
*
|
|
||||||
* @param language The language the translator instance will use from now on
|
|
||||||
*/
|
|
||||||
set language(language: keyof SCTranslations<SCThing>) {
|
|
||||||
if (language !== this._language) {
|
|
||||||
this.cache.flush();
|
|
||||||
}
|
|
||||||
this._language = language;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get field value translation recursively
|
* Get field value translation recursively
|
||||||
*
|
*
|
||||||
* @param data The intermediate object / primitive returned by the Proxys get() method
|
* @param data The intermediate object / primitive returned by the Proxys get() method
|
||||||
* @returns an OCType<T> object allowing for access to translations or a translated value(s)
|
* @returns an TSOCType<T> object allowing for access to translations or a translated value(s)
|
||||||
*/
|
*/
|
||||||
// tslint:disable-next-line:prefer-function-over-method
|
// tslint:disable-next-line:prefer-function-over-method
|
||||||
private deeptranslate<T>(data?: T): OCType<T> {
|
private deeptranslate<T>(data?: T): TSOCType<T> {
|
||||||
const proxy = new Proxy(
|
const proxy = new Proxy(
|
||||||
((defaultValue?: Defined<T>) => (data == null ? defaultValue : data)) as OCType<T>,
|
((defaultValue?: Defined<T>) => (data == null ? defaultValue : data)) as TSOCType<T>,
|
||||||
{
|
{
|
||||||
get: (target, key) => {
|
get: (target, key) => {
|
||||||
const obj: any = target();
|
const obj: any = target();
|
||||||
@@ -101,8 +108,8 @@ export class SCThingTranslator {
|
|||||||
* @param language The language the thing property values are translated to
|
* @param language The language the thing property values are translated to
|
||||||
* @returns The thing with all known meta values translated
|
* @returns The thing with all known meta values translated
|
||||||
*/
|
*/
|
||||||
private getAllMetaFieldTranslations<T extends SCThing>(thingType: SCThingType,
|
private getAllMetaFieldTranslations(thingType: SCThingType,
|
||||||
language: keyof SCTranslations<T>): object | undefined {
|
language: SCLanguageCode): object | undefined {
|
||||||
const fieldTranslations = {};
|
const fieldTranslations = {};
|
||||||
const metaClass = this.getMetaClassInstance(thingType);
|
const metaClass = this.getMetaClassInstance(thingType);
|
||||||
if (typeof metaClass === 'undefined') {
|
if (typeof metaClass === 'undefined') {
|
||||||
@@ -146,12 +153,12 @@ export class SCThingTranslator {
|
|||||||
* Applies known field value translations of the given SCThings meta class to an instance
|
* Applies known field value translations of the given SCThings meta class to an instance
|
||||||
* Translated values overwrite current values inplace (destructive)
|
* Translated values overwrite current values inplace (destructive)
|
||||||
*
|
*
|
||||||
* @param language The language the thing is translated to
|
* @param instance The thing / object that will be translated
|
||||||
* @param thing The thing that will be translated
|
* @param language The language the thing / object is translated to
|
||||||
* @returns The thing with translated meta field values
|
* @returns The thing with translated meta field values
|
||||||
*/
|
*/
|
||||||
private replaceAvailableMetaFieldValueTranslations(instance: any,
|
private replaceAvailableMetaFieldValueTranslations(instance: any,
|
||||||
language: keyof SCTranslations<any>): any {
|
language: SCLanguageCode): any {
|
||||||
const metaClass = this.getMetaClassInstance(instance.type);
|
const metaClass = this.getMetaClassInstance(instance.type);
|
||||||
if (typeof metaClass === 'undefined') {
|
if (typeof metaClass === 'undefined') {
|
||||||
return instance;
|
return instance;
|
||||||
@@ -159,13 +166,18 @@ export class SCThingTranslator {
|
|||||||
if (typeof metaClass.fieldValueTranslations[language] !== 'undefined') {
|
if (typeof metaClass.fieldValueTranslations[language] !== 'undefined') {
|
||||||
Object.keys(metaClass.fieldValueTranslations[language])
|
Object.keys(metaClass.fieldValueTranslations[language])
|
||||||
.forEach((key) => {
|
.forEach((key) => {
|
||||||
if (metaClass.fieldValueTranslations[language][key] instanceof Object) {
|
if (metaClass.fieldValueTranslations[language][key] instanceof Object
|
||||||
|
&& (instance as any)[key] instanceof Object) {
|
||||||
// Assigns known translations of subproperties to property in given language (e.g. categories)
|
// Assigns known translations of subproperties to property in given language (e.g. categories)
|
||||||
Object.keys((instance as any)[key])
|
Object.keys((instance as any)[key])
|
||||||
.forEach((subKey) => {
|
.forEach((subKey) => {
|
||||||
(instance as any)[key][subKey] =
|
(instance as any)[key][subKey] =
|
||||||
metaClass.fieldValueTranslations[language][key][(instance as any)[key][subKey]];
|
metaClass.fieldValueTranslations[language][key][(instance as any)[key][subKey]];
|
||||||
});
|
});
|
||||||
|
} else if (metaClass.fieldValueTranslations[language][key] instanceof Object
|
||||||
|
&& typeof (instance as any)[key] === 'string') {
|
||||||
|
// Assigns known translations of enum to property in given language (e.g. SCSettingInputType)
|
||||||
|
(instance as any)[key] = metaClass.fieldValueTranslations[language][key][(instance as any)[key]];
|
||||||
} else {
|
} else {
|
||||||
// Assigns property to known translation of fieldValueTranslations in given language
|
// Assigns property to known translation of fieldValueTranslations in given language
|
||||||
(instance as any)[key] = metaClass.fieldValueTranslations[language][key];
|
(instance as any)[key] = metaClass.fieldValueTranslations[language][key];
|
||||||
@@ -176,6 +188,60 @@ export class SCThingTranslator {
|
|||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Recursively translates the given object in-place
|
||||||
|
* Translated values overwrite current values (destructive)
|
||||||
|
*
|
||||||
|
* @param instance The thing / object that will be translated
|
||||||
|
* @returns The thing translated
|
||||||
|
*/
|
||||||
|
private translateThingInPlaceDestructively<T>(instance: T): T {
|
||||||
|
const targetLanguage = this.language;
|
||||||
|
|
||||||
|
let nextInstance = instance as any;
|
||||||
|
// Recursively call this function on all nested SCThings, arrays and objects
|
||||||
|
Object.keys(nextInstance)
|
||||||
|
.forEach((key) => {
|
||||||
|
if (
|
||||||
|
isThing(nextInstance[key]) ||
|
||||||
|
nextInstance[key] instanceof Array ||
|
||||||
|
nextInstance[key] instanceof Object) {
|
||||||
|
nextInstance[key] = this.translateThingInPlaceDestructively(nextInstance[key]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Spread variable translations given by the connector into thing
|
||||||
|
if (typeof nextInstance.translations?.[targetLanguage] !== 'undefined') {
|
||||||
|
nextInstance = {...nextInstance, ...nextInstance.translations![targetLanguage]} as T;
|
||||||
|
}
|
||||||
|
// Spread known translations from meta classes into (partly) translated thing
|
||||||
|
this.replaceAvailableMetaFieldValueTranslations(nextInstance, targetLanguage);
|
||||||
|
|
||||||
|
return nextInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Recursively translates the given object in-place
|
||||||
|
* Translated values overwrite current values (destructive)
|
||||||
|
*
|
||||||
|
* @param instance The thing / object that will be translated
|
||||||
|
* @returns The thing translated
|
||||||
|
*/
|
||||||
|
public translate<T extends SCThing>(thing: T): T {
|
||||||
|
if (equal(this.sourceCache.get(thing), thing)) {
|
||||||
|
const cachedInstance = this.cache.get(thing);
|
||||||
|
if (typeof cachedInstance !== 'undefined') {
|
||||||
|
return cachedInstance as T;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const translatedInstance = this.translateThingInPlaceDestructively(clone(thing));
|
||||||
|
delete translatedInstance.translations;
|
||||||
|
this.cache.putObject(translatedInstance);
|
||||||
|
this.sourceCache.putObject(thing);
|
||||||
|
|
||||||
|
return translatedInstance as T;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get field value translation recursively
|
* Get field value translation recursively
|
||||||
* @example
|
* @example
|
||||||
@@ -184,23 +250,26 @@ export class SCThingTranslator {
|
|||||||
* // or
|
* // or
|
||||||
* const dishTranslatedAccess = translator.translate(dish);
|
* const dishTranslatedAccess = translator.translate(dish);
|
||||||
* dishTranslatedAccess.offers[0].inPlace.categories[1]();
|
* dishTranslatedAccess.offers[0].inPlace.categories[1]();
|
||||||
* // undoing the OCType<T>
|
* // undoing the TSOCType<T>
|
||||||
* const dishAsBefore: SCDish = dishTranslatedAccess()!;
|
* const dishAsBefore: SCDish = dishTranslatedAccess()!;
|
||||||
* @param data Top level object that gets passed through the recursion
|
* @param thing Top level object that gets passed through the recursion
|
||||||
* @returns an OCType<T> object allowing for access to translations or a translated value(s)
|
* @returns an TSOCType<T> object allowing for access to translations or a translated value(s)
|
||||||
*/
|
*/
|
||||||
public translate<T extends SCThing>(data: T): OCType<T> {
|
public translatedAccess<T extends SCThing>(thing: T): TSOCType<T> {
|
||||||
return new Proxy(
|
return new Proxy(
|
||||||
((defaultValue?: Defined<T>) => (data == null ? defaultValue : data)) as OCType<T>,
|
((defaultValue?: Defined<T>) => (thing == null ? defaultValue : thing)) as TSOCType<T>,
|
||||||
{
|
{
|
||||||
get: (target, key) => {
|
get: (target, key) => {
|
||||||
const obj: any = target();
|
const obj: any = target();
|
||||||
const objTranslatedFromCache = this.cache.get(data);
|
if (equal(this.sourceCache.get(thing), thing)) {
|
||||||
|
const objTranslatedFromCache = this.cache.get(thing);
|
||||||
if (typeof objTranslatedFromCache !== 'undefined') {
|
if (typeof objTranslatedFromCache !== 'undefined') {
|
||||||
return this.deeptranslate((objTranslatedFromCache as any)[key]);
|
return this.deeptranslate((objTranslatedFromCache as any)[key]);
|
||||||
}
|
}
|
||||||
const objTranslated = this.translateWholeThingDestructively(clone(obj));
|
}
|
||||||
|
const objTranslated = this.translateThingInPlaceDestructively(clone(obj));
|
||||||
this.cache.putObject(objTranslated);
|
this.cache.putObject(objTranslated);
|
||||||
|
this.sourceCache.putObject(thing);
|
||||||
|
|
||||||
return this.deeptranslate(objTranslated[key]);
|
return this.deeptranslate(objTranslated[key]);
|
||||||
},
|
},
|
||||||
@@ -212,53 +281,33 @@ export class SCThingTranslator {
|
|||||||
* Given a SCThingType this function returns an object with the same basic structure as the corresponding SCThing
|
* Given a SCThingType this function returns an object with the same basic structure as the corresponding SCThing
|
||||||
* All the values will be set to the known translations of the property/key name
|
* All the values will be set to the known translations of the property/key name
|
||||||
* @example
|
* @example
|
||||||
* const translatedMetaDish = translator.translatedPropertyNames<SCCourseOfStudies>(SCThingType.CourseOfStudies);
|
* const translatedMetaDish = translator.translatedPropertyNames<SCCourseOfStudy>(SCThingType.CourseOfStudy);
|
||||||
* @param language The language the object is translated to
|
* @param type The type whose property names will be translated
|
||||||
* @param thingType Type of the thing
|
|
||||||
* @returns An object with the properties of the SCThingType where the values are the known property tranlations
|
* @returns An object with the properties of the SCThingType where the values are the known property tranlations
|
||||||
*/
|
*/
|
||||||
public translatedPropertyNames<T extends SCThing>(thing: T,
|
public translatedPropertyNames<T extends SCThing>(type: SCThingType): T | undefined {
|
||||||
language?: keyof SCTranslations<T>): T | undefined {
|
return this.getAllMetaFieldTranslations(type, this.language) as T;
|
||||||
const targetLanguage = (typeof language !== 'undefined') ? language : this.language;
|
|
||||||
|
|
||||||
return this.getAllMetaFieldTranslations(thing.type, targetLanguage) as T;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recursively translates the given object in-place
|
* Given a SCThingType and a corresponding property name it returns the known property value translation
|
||||||
* Translated values overwrite current values (destructive)
|
* Access pattern to the meta object containing the translation can be thought of as type.field[key] with key being optional
|
||||||
*
|
* @example
|
||||||
* @param language The language the thing is translated to
|
* const singleValueTranslation = translator.translatedPropertyValue(SCThingType.Dish, 'categories', 'main dish');
|
||||||
* @param thing The thing that will be translated
|
* @param type The type for whose property values a translation is required
|
||||||
* @returns The thing translated
|
* @param field The property for which a translation is required
|
||||||
|
* @param key If specified tries to access the field with this key
|
||||||
|
* @returns Known translation for the property
|
||||||
*/
|
*/
|
||||||
public translateWholeThingDestructively(instance: any,
|
public translatedPropertyValue(type: SCThingType,
|
||||||
language?: keyof SCTranslations<any>): any {
|
field: string,
|
||||||
const targetLanguage = (typeof language !== 'undefined') ? language : this.language;
|
key?: string): string | undefined {
|
||||||
let nextInstance = instance;
|
const fieldValueTranslations = this.getMetaClassInstance(type).fieldValueTranslations[this.language] ??
|
||||||
// Recursively call this function on all nested SCThings, arrays and objects
|
this.getMetaClassInstance(type).fieldValueTranslations.en;
|
||||||
Object.keys(nextInstance)
|
const fieldTranslation = fieldValueTranslations?.[field];
|
||||||
.forEach((key) => {
|
|
||||||
if (
|
|
||||||
isThing((nextInstance as any)[key]) ||
|
|
||||||
nextInstance[key] instanceof Array ||
|
|
||||||
nextInstance[key] instanceof Object) {
|
|
||||||
nextInstance[key] = this.translateWholeThingDestructively(nextInstance[key], targetLanguage);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Spread variable translations given by the connector into thing
|
return fieldTranslation?.[key ?? ''] ?? key ?? fieldTranslation;
|
||||||
if (typeof nextInstance.translations !== 'undefined') {
|
|
||||||
if (typeof nextInstance.translations![targetLanguage] !== 'undefined') {
|
|
||||||
nextInstance = {...nextInstance, ...nextInstance.translations![targetLanguage]} as typeof instance;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// Spread known translations from meta classes into (partly) translated thing
|
|
||||||
this.replaceAvailableMetaFieldValueTranslations(nextInstance, targetLanguage);
|
|
||||||
|
|
||||||
return nextInstance;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
44
test/compat.spec.ts
Normal file
44
test/compat.spec.ts
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2021 StApps
|
||||||
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
|
* Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with
|
||||||
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import {lightweightProjectFromPath} from '@openstapps/core-tools/lib/easy-ast/easy-ast';
|
||||||
|
import {LightweightProject} from '@openstapps/core-tools/lib/easy-ast/types/lightweight-project';
|
||||||
|
import {expect} from 'chai';
|
||||||
|
import {reduce} from 'lodash';
|
||||||
|
|
||||||
|
process.on('unhandledRejection', (err) => {
|
||||||
|
throw err;
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Mapping Compatibility', () => {
|
||||||
|
let project: LightweightProject;
|
||||||
|
|
||||||
|
before(function () {
|
||||||
|
this.timeout(15000);
|
||||||
|
this.slow(10000);
|
||||||
|
|
||||||
|
project = lightweightProjectFromPath('src');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('non-exported definitions should not have duplicate names across files', () => {
|
||||||
|
reduce(project, (result, file) => reduce(file, (result2, _, key) => {
|
||||||
|
expect(result2[key]).to.be.undefined;
|
||||||
|
return {
|
||||||
|
[key]: true,
|
||||||
|
...result2,
|
||||||
|
};
|
||||||
|
}, result), {} as Record<string, boolean>);
|
||||||
|
});
|
||||||
|
});
|
||||||
140
test/features.spec.ts
Normal file
140
test/features.spec.ts
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 StApps
|
||||||
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
|
* Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with
|
||||||
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
import {isLightweightClass, isLightweightEnum, isUnionType} from '@openstapps/core-tools/lib/easy-ast/ast-util';
|
||||||
|
import {LightweightAliasDefinition} from '@openstapps/core-tools/lib/easy-ast/types/lightweight-alias-definition';
|
||||||
|
import {LightweightProjectWithIndex} from '@openstapps/core-tools/lib/easy-ast/types/lightweight-project';
|
||||||
|
import {LightweightType} from '@openstapps/core-tools/lib/easy-ast/types/lightweight-type';
|
||||||
|
import {LightweightClassDefinition} from '@openstapps/core-tools/src/easy-ast/types/lightweight-class-definition';
|
||||||
|
import {LightweightDefinition} from '@openstapps/core-tools/src/easy-ast/types/lightweight-definition';
|
||||||
|
import {LightweightProperty} from '@openstapps/core-tools/src/easy-ast/types/lightweight-property';
|
||||||
|
import {expect} from 'chai';
|
||||||
|
import {assign, chain, clone, flatMap, isNil, reduce, reject, some} from 'lodash';
|
||||||
|
|
||||||
|
process.on('unhandledRejection', (err) => {
|
||||||
|
throw err;
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Features', () => {
|
||||||
|
let project: LightweightProjectWithIndex;
|
||||||
|
let thingNames: string[];
|
||||||
|
let things: LightweightClassDefinition[];
|
||||||
|
let thingsWithoutReferences: LightweightClassDefinition[];
|
||||||
|
|
||||||
|
before(function () {
|
||||||
|
this.timeout(15000);
|
||||||
|
this.slow(10000);
|
||||||
|
|
||||||
|
project = new LightweightProjectWithIndex('src');
|
||||||
|
|
||||||
|
const thingsReflection = project.definitions['SCIndexableThings'] as LightweightAliasDefinition;
|
||||||
|
expect(isLightweightEnum(thingsReflection)).to.be.true;
|
||||||
|
expect(isUnionType(thingsReflection.type!)).to.be.true;
|
||||||
|
|
||||||
|
thingsReflection.type!.specificationTypes!.push({
|
||||||
|
flags: 524_288,
|
||||||
|
referenceName: 'SCDiff',
|
||||||
|
});
|
||||||
|
|
||||||
|
// tslint:disable-next-line:no-unused-expression
|
||||||
|
expect(thingsReflection.type?.specificationTypes?.every(it => typeof it.referenceName !== 'undefined')).to.be.true;
|
||||||
|
thingNames = thingsReflection.type?.specificationTypes?.map(type => type.referenceName!) ?? [];
|
||||||
|
things = thingNames
|
||||||
|
.map(it => project.definitions[it])
|
||||||
|
.filter(isLightweightClass);
|
||||||
|
thingsWithoutReferences = thingNames
|
||||||
|
.map(it => project.definitions[`${it}WithoutReferences`])
|
||||||
|
.filter(isLightweightClass);
|
||||||
|
});
|
||||||
|
|
||||||
|
const inheritedProperties = function (classLike: LightweightClassDefinition):
|
||||||
|
Record<string, LightweightProperty> | undefined {
|
||||||
|
return reduce(
|
||||||
|
[...(classLike.implementedDefinitions ?? []), ...(classLike.extendedDefinitions ?? [])],
|
||||||
|
(obj, extension) => {
|
||||||
|
const object = project.definitions[extension.referenceName ?? ''];
|
||||||
|
|
||||||
|
return assign(obj, isLightweightClass(object)
|
||||||
|
? inheritedProperties(object)
|
||||||
|
: obj);
|
||||||
|
},
|
||||||
|
clone(classLike.properties)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
it('should have an origin', () => {
|
||||||
|
for (const thing of things) {
|
||||||
|
expect(inheritedProperties(thing)?.['origin']).not.to.be.undefined;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not have duplicate names', () => {
|
||||||
|
reduce(project.files, (fileResult, file) =>
|
||||||
|
reduce(file, (definitionResult, definition: LightweightDefinition) => {
|
||||||
|
expect(definitionResult[definition.name]).to.be.undefined;
|
||||||
|
definitionResult[definition.name] = true; // something that's not undefined
|
||||||
|
|
||||||
|
return definitionResult;
|
||||||
|
}, fileResult), {} as Record<string, true>);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not have properties referencing SCThing', () => {
|
||||||
|
const allPropertyReferenceNames: (property: LightweightProperty) => string[] = property => reject([
|
||||||
|
property.type.referenceName!,
|
||||||
|
...flatMap(property.properties, allPropertyReferenceNames),
|
||||||
|
], isNil);
|
||||||
|
|
||||||
|
const typeHasSCThingReferences: (type?: LightweightType) => boolean = type => type?.referenceName
|
||||||
|
? hasSCThingReferences(project.definitions[type.referenceName])
|
||||||
|
: some(type?.specificationTypes, typeHasSCThingReferences);
|
||||||
|
|
||||||
|
const hasSCThingReferences: (definition?: LightweightDefinition) => boolean = definition =>
|
||||||
|
isLightweightClass(definition)
|
||||||
|
? chain(inheritedProperties(definition))
|
||||||
|
.flatMap(it => flatMap(it.properties, allPropertyReferenceNames))
|
||||||
|
.map(it => project.definitions[it] as LightweightDefinition)
|
||||||
|
.some(it => it.name === 'SCThing' || hasSCThingReferences(it))
|
||||||
|
.value()
|
||||||
|
: definition ? typeHasSCThingReferences(definition.type) : false;
|
||||||
|
|
||||||
|
for (const thing of things) {
|
||||||
|
expect(hasSCThingReferences(thing)).to.be.false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function extendsSCThing(definition?: LightweightDefinition): boolean {
|
||||||
|
return isLightweightClass(definition)
|
||||||
|
? chain([
|
||||||
|
...(definition as LightweightClassDefinition).extendedDefinitions ?? [],
|
||||||
|
...(definition as LightweightClassDefinition).implementedDefinitions ?? [],
|
||||||
|
])
|
||||||
|
.map(it => it.referenceName)
|
||||||
|
.reject(isNil)
|
||||||
|
.some(it => it === 'SCThing' || extendsSCThing(project.definitions[it!]))
|
||||||
|
.value()
|
||||||
|
: false;
|
||||||
|
}
|
||||||
|
|
||||||
|
it('should extend SCThing if it is an SCThing', () => {
|
||||||
|
for (const thing of things) {
|
||||||
|
expect(extendsSCThing(thing)).to.be.true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not extend SCThing if it is an SCThingWithoutReferences', () => {
|
||||||
|
for (const thingWithoutReferences of thingsWithoutReferences) {
|
||||||
|
expect(extendsSCThing(thingWithoutReferences)).to.be.false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {expect} from 'chai';
|
import {expect} from 'chai';
|
||||||
import {slow, suite, test, timeout} from 'mocha-typescript';
|
import {slow, suite, test, timeout} from '@testdeck/mocha';
|
||||||
import {SCBulkResponse} from '../src/protocol/routes/bulk-request';
|
import {SCBulkResponse} from '../src/protocol/routes/bulk-request';
|
||||||
import {SCMultiSearchResponse} from '../src/protocol/routes/search-multi';
|
import {SCMultiSearchResponse} from '../src/protocol/routes/search-multi';
|
||||||
import {SCSearchResponse} from '../src/protocol/routes/search';
|
import {SCSearchResponse} from '../src/protocol/routes/search';
|
||||||
@@ -116,8 +116,10 @@ export class GuardsSpec {
|
|||||||
@test
|
@test
|
||||||
public isSearchResponse() {
|
public isSearchResponse() {
|
||||||
const notASearchResponse = {...GuardsSpec.searchResponse};
|
const notASearchResponse = {...GuardsSpec.searchResponse};
|
||||||
|
// @ts-ignore
|
||||||
delete notASearchResponse.pagination;
|
delete notASearchResponse.pagination;
|
||||||
expect(isSearchResponse(notASearchResponse)).to.be.equal(false);
|
expect(isSearchResponse(notASearchResponse)).to.be.equal(false);
|
||||||
|
// @ts-ignore
|
||||||
delete notASearchResponse.data;
|
delete notASearchResponse.data;
|
||||||
expect(isSearchResponse(notASearchResponse)).to.be.equal(false);
|
expect(isSearchResponse(notASearchResponse)).to.be.equal(false);
|
||||||
expect(isSearchResponse(null)).to.be.equal(false);
|
expect(isSearchResponse(null)).to.be.equal(false);
|
||||||
|
|||||||
@@ -21,6 +21,9 @@
|
|||||||
"audiences": [
|
"audiences": [
|
||||||
"students"
|
"students"
|
||||||
],
|
],
|
||||||
|
"categories": [
|
||||||
|
"news"
|
||||||
|
],
|
||||||
"sequenceIndex": 1010,
|
"sequenceIndex": 1010,
|
||||||
"origin": {
|
"origin": {
|
||||||
"indexed": "2018-09-11T12:30:00Z",
|
"indexed": "2018-09-11T12:30:00Z",
|
||||||
|
|||||||
@@ -21,6 +21,9 @@
|
|||||||
"audiences": [
|
"audiences": [
|
||||||
"students"
|
"students"
|
||||||
],
|
],
|
||||||
|
"categories": [
|
||||||
|
"news"
|
||||||
|
],
|
||||||
"sequenceIndex": 1020,
|
"sequenceIndex": 1020,
|
||||||
"origin": {
|
"origin": {
|
||||||
"indexed": "2018-09-11T12:30:00Z",
|
"indexed": "2018-09-11T12:30:00Z",
|
||||||
|
|||||||
@@ -6,17 +6,67 @@
|
|||||||
"uid": "3af3ccaa-f066-5eff-9a3d-a70567f3d70d",
|
"uid": "3af3ccaa-f066-5eff-9a3d-a70567f3d70d",
|
||||||
"data": {
|
"data": {
|
||||||
"type": "academic event",
|
"type": "academic event",
|
||||||
"description": "Grundlagen, algebraische Grundbegriffe, Vektorräume, lineare Abbildungen und Gleichungen, Determinanten",
|
"description": "Fortsetzung der Algebra I: Galoistheorie mit Anwendungen, ausgewählte Spezialthemen.",
|
||||||
"uid": "b17eb963-42b5-5861-adce-2b7b2607ef0a",
|
"uid": "681a59a1-23c2-5d78-861a-8c86a3abf2b9",
|
||||||
"name": "Lineare Algebra I für Mathematiker",
|
"name": "Algebra II",
|
||||||
"categories": [
|
"categories": [
|
||||||
"lecture"
|
"lecture"
|
||||||
],
|
],
|
||||||
|
"academicTerms": [
|
||||||
|
{
|
||||||
|
"uid": "aacd5611-b5be-54ce-b39f-c52f7e9a631d",
|
||||||
|
"type": "semester",
|
||||||
|
"name": "Sommersemester 2018",
|
||||||
|
"acronym": "SS 2018",
|
||||||
|
"alternateNames": [
|
||||||
|
"SoSe 2018"
|
||||||
|
],
|
||||||
|
"startDate": "2018-04-01",
|
||||||
|
"endDate": "2018-09-30",
|
||||||
|
"eventsStartDate": "2018-04-09",
|
||||||
|
"eventsEndDate": "2018-07-13"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"performers": [
|
||||||
|
{
|
||||||
|
"type": "person",
|
||||||
|
"uid": "7f8ce700-2679-51a5-86b5-3dfba85a33ff",
|
||||||
|
"givenName": "Peter",
|
||||||
|
"familyName": "Bürgisser",
|
||||||
|
"gender": "male",
|
||||||
|
"honorificPrefix": "Prof. Dr.",
|
||||||
|
"name": "Peter Bürgisser"
|
||||||
|
}
|
||||||
|
],
|
||||||
"majors": [
|
"majors": [
|
||||||
"Wirtschaftsmathematik BSc",
|
"Mathematik D",
|
||||||
"Technomathematik BSc",
|
"Mathematik L2",
|
||||||
"Mathematik BSc"
|
"Mathematik StRGym",
|
||||||
]
|
"Mathematik StRBeruf",
|
||||||
|
"Mathematik BSc",
|
||||||
|
"Mathematik MSc"
|
||||||
|
],
|
||||||
|
"origin": {
|
||||||
|
"indexed": "2018-09-11T12:30:00Z",
|
||||||
|
"name": "Dummy",
|
||||||
|
"type": "remote",
|
||||||
|
"maintainer": {
|
||||||
|
"type": "organization",
|
||||||
|
"name": "tubIT",
|
||||||
|
"uid": "25f76840-db89-5da2-a8a2-75992f637613"
|
||||||
|
},
|
||||||
|
"modified": "2018-09-01T10:00:00Z",
|
||||||
|
"originalId": "foo bar",
|
||||||
|
"responsibleEntity": {
|
||||||
|
"type": "person",
|
||||||
|
"uid": "7f8ce700-2679-51a5-86b5-3dfba85a33ff",
|
||||||
|
"givenName": "Peter",
|
||||||
|
"familyName": "Bürgisser",
|
||||||
|
"gender": "male",
|
||||||
|
"honorificPrefix": "Prof. Dr.",
|
||||||
|
"name": "Peter Bürgisser"
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"origin": {
|
"origin": {
|
||||||
"created": "2018-09-11T12:30:00Z",
|
"created": "2018-09-11T12:30:00Z",
|
||||||
|
|||||||
@@ -1,81 +0,0 @@
|
|||||||
{
|
|
||||||
"errorNames": [],
|
|
||||||
"instance": {
|
|
||||||
"type": "person",
|
|
||||||
"familyName": "Mustermann",
|
|
||||||
"givenName": "Erika",
|
|
||||||
"honorificPrefix": "Univ.-Prof'in Dr.",
|
|
||||||
"gender": "female",
|
|
||||||
"jobTitles": [
|
|
||||||
"Direktor/in, Akademie für Bildungsforschung und Lehrerbildung",
|
|
||||||
"Professorinnen und Professoren, Politikwissenschaft mit dem Schwerpunkt Internationale Institutionen und Friedensprozesse",
|
|
||||||
"Vizepräsidentinnen und Vizepräsidenten, Leitung der Universität (Präsidium)",
|
|
||||||
"Senat",
|
|
||||||
"Leitung, Projektkoordination - Abteilung Lehre und Qualitätssicherung"
|
|
||||||
],
|
|
||||||
"name": "Univ.-Prof'in Dr. Erika Mustermann",
|
|
||||||
"uid": "be34a419-e9e8-5de0-b998-dd1b19e7f451",
|
|
||||||
"workLocations": [
|
|
||||||
{
|
|
||||||
"url": "http://www.fb03.uni-frankfurt.de/1234567",
|
|
||||||
"email": "mustermann@soz.uni-frankfurt.de",
|
|
||||||
"faxNumber": "",
|
|
||||||
"telephone": "069/123-36232; -1324325",
|
|
||||||
"hoursAvailable": "siehe Homepage",
|
|
||||||
"areaServed": {
|
|
||||||
"type": "room",
|
|
||||||
"categories": [
|
|
||||||
"education"
|
|
||||||
],
|
|
||||||
"uid": "39c1a574-04ef-5157-9c6f-e271d93eb273",
|
|
||||||
"name": "3.G 121",
|
|
||||||
"alternateNames": [
|
|
||||||
"Dienstzimmer"
|
|
||||||
],
|
|
||||||
"geo": {
|
|
||||||
"point": {
|
|
||||||
"coordinates": [
|
|
||||||
8.66919,
|
|
||||||
50.12834
|
|
||||||
],
|
|
||||||
"type": "Point"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "http://www2.uni-frankfurt.de/12345/vizepraesidenten",
|
|
||||||
"email": "",
|
|
||||||
"faxNumber": "",
|
|
||||||
"telephone": "069/123-1235",
|
|
||||||
"hoursAvailable": "siehe Homepage",
|
|
||||||
"areaServed": {
|
|
||||||
"type": "room",
|
|
||||||
"categories": [
|
|
||||||
"education"
|
|
||||||
],
|
|
||||||
"uid": "5e54aefd-078b-5007-bca1-53dc60f79d37",
|
|
||||||
"name": "4.P 22",
|
|
||||||
"alternateNames": [
|
|
||||||
"Dienstzimmer"
|
|
||||||
],
|
|
||||||
"geo": {
|
|
||||||
"point": {
|
|
||||||
"coordinates": [
|
|
||||||
8.66898,
|
|
||||||
50.12772
|
|
||||||
],
|
|
||||||
"type": "Point"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"origin": {
|
|
||||||
"indexed": "2018-09-11T12:30:00Z",
|
|
||||||
"name": "Dummy",
|
|
||||||
"type": "remote"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"schema": "SCPerson"
|
|
||||||
}
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
"address": "http://foo.com:1234",
|
"address": "http://foo.com:1234",
|
||||||
"name": "Foo Plugin",
|
"name": "Foo Plugin",
|
||||||
"requestSchema": {
|
"requestSchema": {
|
||||||
"$schema": "http://json-schema.org/draft-06/schema#",
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||||
"definitions": {
|
"definitions": {
|
||||||
"SCFooPluginRequest": {
|
"SCFooPluginRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
@@ -33,10 +33,10 @@
|
|||||||
],
|
],
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"description": "User query",
|
"description": "User query",
|
||||||
"id": "https://core.stapps.tu-berlin.de/v0.18.0/lib/schema/SCFooPluginRequest.json"
|
"$id": "https://core.stapps.tu-berlin.de/v0.18.0/lib/schema/SCFooPluginRequest.json"
|
||||||
},
|
},
|
||||||
"responseSchema": {
|
"responseSchema": {
|
||||||
"$schema": "http://json-schema.org/draft-06/schema#",
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||||
"definitions": {
|
"definitions": {
|
||||||
"SCFooPluginResponse": {
|
"SCFooPluginResponse": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
],
|
],
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"description": "A response to a query",
|
"description": "A response to a query",
|
||||||
"id": "https://core.stapps.tu-berlin.de/v0.18.0/lib/schema/SCFooPluginResponse.json"
|
"$id": "https://core.stapps.tu-berlin.de/v0.18.0/lib/schema/SCFooPluginResponse.json"
|
||||||
},
|
},
|
||||||
"route": "/foo"
|
"route": "/foo"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": {
|
"arguments": {
|
||||||
"fromField": "availabilityStarts",
|
"scope": "d",
|
||||||
"toField": "availabilityEnds",
|
"field": "availabilityRange",
|
||||||
"time": "2018-01-15T04:13:00+00:00"
|
"time": "2018-01-15T04:13:00+00:00"
|
||||||
},
|
},
|
||||||
"type": "availability"
|
"type": "availability"
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
},
|
},
|
||||||
"translations": {
|
"translations": {
|
||||||
"de": {
|
"de": {
|
||||||
"categories": ["Benutzer"],
|
|
||||||
"description": "Die Sprache in der die App angezeigt wird.",
|
"description": "Die Sprache in der die App angezeigt wird.",
|
||||||
"name": "Sprache",
|
"name": "Sprache",
|
||||||
"values": [
|
"values": [
|
||||||
@@ -25,9 +24,6 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"en": {
|
"en": {
|
||||||
"categories": [
|
|
||||||
"User"
|
|
||||||
],
|
|
||||||
"description": "The language this app is going to use.",
|
"description": "The language this app is going to use.",
|
||||||
"name": "Language",
|
"name": "Language",
|
||||||
"values": [
|
"values": [
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"categories": [
|
"categories": [
|
||||||
"unipedia"
|
"unipedia"
|
||||||
],
|
],
|
||||||
"url": "https://www.mydesk.tu-berlin.de/wiki/abk%C3%BCrzungen",
|
"sameAs": "https://www.mydesk.tu-berlin.de/wiki/abk%C3%BCrzungen",
|
||||||
"name": "Abkürzungen",
|
"name": "Abkürzungen",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"Abkürzungen",
|
"Abkürzungen",
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
"categories": [
|
"categories": [
|
||||||
"unipedia"
|
"unipedia"
|
||||||
],
|
],
|
||||||
"url": "https://www.mydesk.tu-berlin.de/wiki/ag_ziethen",
|
"sameAs": "https://www.mydesk.tu-berlin.de/wiki/ag_ziethen",
|
||||||
"name": "AG Ziethen",
|
"name": "AG Ziethen",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"Bologna",
|
"Bologna",
|
||||||
36
test/resources/indexable/Article.3.json
Normal file
36
test/resources/indexable/Article.3.json
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"errorNames": [],
|
||||||
|
"instance": {
|
||||||
|
"type": "article",
|
||||||
|
"uid": "d541eda5-1542-59b2-969e-7dbbee0bd2a8",
|
||||||
|
"name": "Mozart und Frankfurt am Main : drei Generationen Mozart in Frankfurt am Main",
|
||||||
|
"description": "Ill.",
|
||||||
|
"categories": [
|
||||||
|
"article"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"type": "person",
|
||||||
|
"uid": "56d46c9b-8ede-52ae-a40f-6800cff577e5",
|
||||||
|
"name": "Greve, Clemens"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"firstPublished": "2008",
|
||||||
|
"sameAs": "https://hds2test.hebis.de/ubffm/Record/HEB198305427",
|
||||||
|
"origin": {
|
||||||
|
"indexed": "2018-09-11T12:30:00Z",
|
||||||
|
"name": "HeBIS HDS",
|
||||||
|
"originalId": "HEB198305427",
|
||||||
|
"type": "remote",
|
||||||
|
"url": "https://hds2.hebis.de/ubffm/"
|
||||||
|
},
|
||||||
|
"isPartOf": {
|
||||||
|
"uid": "bc5e5399-a24c-5c01-9c1b-0c8b83272087",
|
||||||
|
"name": "Archiv für Frankfurts Geschichte und Kunst",
|
||||||
|
"type": "periodical",
|
||||||
|
"categories": []
|
||||||
|
},
|
||||||
|
"reference": "Band 71 (2008), Seite 27-40"
|
||||||
|
},
|
||||||
|
"schema": "SCArticle"
|
||||||
|
}
|
||||||
36
test/resources/indexable/Article.4.json
Normal file
36
test/resources/indexable/Article.4.json
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"errorNames": [],
|
||||||
|
"instance": {
|
||||||
|
"type": "article",
|
||||||
|
"uid": "554a4a89-df73-5197-ac85-c8a5a3a9c5b0",
|
||||||
|
"name": "Ursula Janik : [Markthändlerin]",
|
||||||
|
"description": "Ill.",
|
||||||
|
"categories": [
|
||||||
|
"article"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"type": "person",
|
||||||
|
"uid": "c6e44e1f-f76c-53f8-a18f-47fa54ae0e90",
|
||||||
|
"name": "Fröhlich, Ute B."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"firstPublished": "2002",
|
||||||
|
"sameAs": "https://hds2test.hebis.de/ubffm/Record/HEB107025590",
|
||||||
|
"origin": {
|
||||||
|
"indexed": "2018-09-11T12:30:00Z",
|
||||||
|
"name": "HeBIS HDS",
|
||||||
|
"originalId": "HEB107025590",
|
||||||
|
"type": "remote",
|
||||||
|
"url": "https://hds2.hebis.de/ubffm/"
|
||||||
|
},
|
||||||
|
"isPartOf": {
|
||||||
|
"uid": "f84c1851-042e-542f-ba7a-158b32dfb82f",
|
||||||
|
"name": "Frankfurter Allgemeine. R, Rhein-Main-Zeitung",
|
||||||
|
"type": "periodical",
|
||||||
|
"categories": []
|
||||||
|
},
|
||||||
|
"reference": "Heft 190 (17. 8 2002), Seite 62"
|
||||||
|
},
|
||||||
|
"schema": "SCArticle"
|
||||||
|
}
|
||||||
36
test/resources/indexable/Assessment.1.json
Normal file
36
test/resources/indexable/Assessment.1.json
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"errorNames": [],
|
||||||
|
"instance": {
|
||||||
|
"attempt": 1,
|
||||||
|
"date": "2020-04-01",
|
||||||
|
"ects": 20,
|
||||||
|
"grade": "N/A",
|
||||||
|
"status": "ongoing",
|
||||||
|
"uid": "681a59a1-23c2-5d78-861a-8c86a3abf404",
|
||||||
|
"name": "Introductory courses extreme math",
|
||||||
|
"categories": [
|
||||||
|
"university assessment"
|
||||||
|
],
|
||||||
|
"courseOfStudy": {
|
||||||
|
"academicDegree": "bachelor",
|
||||||
|
"academicDegreewithField": "Bachelor of Arts",
|
||||||
|
"academicDegreewithFieldShort": "B.A.",
|
||||||
|
"mainLanguage": {
|
||||||
|
"code": "de",
|
||||||
|
"name": "german"
|
||||||
|
},
|
||||||
|
"mode": "dual",
|
||||||
|
"name": "Astroturfing",
|
||||||
|
"timeMode": "parttime",
|
||||||
|
"type": "course of study",
|
||||||
|
"uid": "4c6f0a18-343d-5175-9fb1-62d28545c2aa"
|
||||||
|
},
|
||||||
|
"origin": {
|
||||||
|
"indexed": "2020-04-11T12:30:00Z",
|
||||||
|
"name": "Dummy",
|
||||||
|
"type": "remote"
|
||||||
|
},
|
||||||
|
"type": "assessment"
|
||||||
|
},
|
||||||
|
"schema": "SCAssessment"
|
||||||
|
}
|
||||||
51
test/resources/indexable/Assessment.2.json
Normal file
51
test/resources/indexable/Assessment.2.json
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
{
|
||||||
|
"errorNames": [],
|
||||||
|
"instance": {
|
||||||
|
"attempt": 1,
|
||||||
|
"date": "2020-04-01",
|
||||||
|
"ects": 6,
|
||||||
|
"grade": "very much 1.0",
|
||||||
|
"status": "passed",
|
||||||
|
"uid": "681a59a1-23c2-5d78-861a-8c86a3abf303",
|
||||||
|
"name": "Mathe 9001",
|
||||||
|
"categories": [
|
||||||
|
"university assessment"
|
||||||
|
],
|
||||||
|
"superAssessments": [
|
||||||
|
{
|
||||||
|
"attempt": 1,
|
||||||
|
"date": "2020-04-01",
|
||||||
|
"ects": 20,
|
||||||
|
"grade": "N/A",
|
||||||
|
"status": "ongoing",
|
||||||
|
"uid": "681a59a1-23c2-5d78-861a-8c86a3abf404",
|
||||||
|
"name": "Introductory courses extreme math",
|
||||||
|
"categories": [
|
||||||
|
"university assessment"
|
||||||
|
],
|
||||||
|
"type": "assessment"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"courseOfStudy": {
|
||||||
|
"academicDegree": "bachelor",
|
||||||
|
"academicDegreewithField": "Bachelor of Arts",
|
||||||
|
"academicDegreewithFieldShort": "B.A.",
|
||||||
|
"mainLanguage": {
|
||||||
|
"code": "de",
|
||||||
|
"name": "german"
|
||||||
|
},
|
||||||
|
"mode": "dual",
|
||||||
|
"name": "Astroturfing",
|
||||||
|
"timeMode": "parttime",
|
||||||
|
"type": "course of study",
|
||||||
|
"uid": "4c6f0a18-343d-5175-9fb1-62d28545c2aa"
|
||||||
|
},
|
||||||
|
"origin": {
|
||||||
|
"indexed": "2020-04-11T12:30:00Z",
|
||||||
|
"name": "Dummy",
|
||||||
|
"type": "remote"
|
||||||
|
},
|
||||||
|
"type": "assessment"
|
||||||
|
},
|
||||||
|
"schema": "SCAssessment"
|
||||||
|
}
|
||||||
@@ -21,15 +21,15 @@
|
|||||||
"name": "Symposion Publishing"
|
"name": "Symposion Publishing"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"inLanguages": [
|
"inLanguage": "de",
|
||||||
{
|
"edition": "2., überarb. u. erw. Aufl.",
|
||||||
"name": "german",
|
"ISBNs": [
|
||||||
"code": "de"
|
"3936608776"
|
||||||
}
|
|
||||||
],
|
],
|
||||||
"bookEdition": "2., überarb. u. erw. Aufl.",
|
|
||||||
"isbn": "3936608776",
|
|
||||||
"numberOfPages": 537,
|
"numberOfPages": 537,
|
||||||
|
"categories": [
|
||||||
|
"book"
|
||||||
|
],
|
||||||
"origin": {
|
"origin": {
|
||||||
"indexed": "2018-09-11T12:30:00Z",
|
"indexed": "2018-09-11T12:30:00Z",
|
||||||
"name": "Dummy",
|
"name": "Dummy",
|
||||||
@@ -4,6 +4,9 @@
|
|||||||
"type": "book",
|
"type": "book",
|
||||||
"uid": "db47f7f4-7699-5a37-afcc-24beaa998d36",
|
"uid": "db47f7f4-7699-5a37-afcc-24beaa998d36",
|
||||||
"name": "Minimal Book",
|
"name": "Minimal Book",
|
||||||
|
"categories": [
|
||||||
|
"ebook"
|
||||||
|
],
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"type": "person",
|
"type": "person",
|
||||||
@@ -14,7 +17,9 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"datePublished": "2007-08-01",
|
"datePublished": "2007-08-01",
|
||||||
"isbn": "3936608776",
|
"ISBNs": [
|
||||||
|
"3936608776"
|
||||||
|
],
|
||||||
"origin": {
|
"origin": {
|
||||||
"indexed": "2018-09-11T12:30:00Z",
|
"indexed": "2018-09-11T12:30:00Z",
|
||||||
"name": "Dummy",
|
"name": "Dummy",
|
||||||
40
test/resources/indexable/Book.3.json
Normal file
40
test/resources/indexable/Book.3.json
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
"errorNames": [],
|
||||||
|
"instance": {
|
||||||
|
"type": "book",
|
||||||
|
"uid": "188cb2bd-724d-543d-97ac-9aa1dda68cb7",
|
||||||
|
"name": "Frauen im Ingenieurberuf : FIB ; 1. Gesamtdeutsches Symposium VDI-FIB 17. - 18. November 1990, Bad Homburg ; 1. überregionales Treffen VDI-FIB 11. - 12. November 1989, Düsseldorf",
|
||||||
|
"description": "47 S. : Ill., Kt.",
|
||||||
|
"categories": [
|
||||||
|
"book"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"uid": "a276588c-ecee-5d2e-8b9c-73cb902bc165",
|
||||||
|
"name": "Saatweber, Jutta (Hrsg.)",
|
||||||
|
"type": "person"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"firstPublished": "[ca. 1991]",
|
||||||
|
"publications": [
|
||||||
|
{
|
||||||
|
"uid": "603a6574-8910-588a-9e83-cd26e6988c74",
|
||||||
|
"type": "publication event",
|
||||||
|
"locations": [
|
||||||
|
"Frankfurt/M"
|
||||||
|
],
|
||||||
|
"publisher": "VDI",
|
||||||
|
"name": "VDI"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"sameAs": "https://hds2test.hebis.de/ubffm/Record/HEB022992618",
|
||||||
|
"origin": {
|
||||||
|
"indexed": "2018-09-11T12:30:00Z",
|
||||||
|
"name": "HeBIS HDS",
|
||||||
|
"originalId": "HEB022992618",
|
||||||
|
"type": "remote",
|
||||||
|
"url": "https://hds2.hebis.de/ubffm/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"schema": "SCBook"
|
||||||
|
}
|
||||||
43
test/resources/indexable/Book.4.json
Normal file
43
test/resources/indexable/Book.4.json
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"errorNames": [],
|
||||||
|
"instance": {
|
||||||
|
"type": "book",
|
||||||
|
"uid": "f6ee5744-a441-595d-9dae-a9f579c0660f",
|
||||||
|
"name": "Kant",
|
||||||
|
"description": "176 S.",
|
||||||
|
"categories": [
|
||||||
|
"book"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"uid": "7e198ecf-966a-5f99-8a45-266243583023",
|
||||||
|
"name": "Thouard, Denis",
|
||||||
|
"type": "person"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"firstPublished": "2001",
|
||||||
|
"publications": [
|
||||||
|
{
|
||||||
|
"uid": "6333427c-0725-5398-9a04-11604680dae3",
|
||||||
|
"type": "publication event",
|
||||||
|
"locations": [
|
||||||
|
"Paris"
|
||||||
|
],
|
||||||
|
"publisher": "Belles Lettres",
|
||||||
|
"name": "Belles Lettres"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"sameAs": "https://hds2test.hebis.de/ubffm/Record/HEB102248788",
|
||||||
|
"ISBNs": [
|
||||||
|
"2251760385"
|
||||||
|
],
|
||||||
|
"origin": {
|
||||||
|
"indexed": "2018-09-11T12:30:00Z",
|
||||||
|
"name": "HeBIS HDS",
|
||||||
|
"originalId": "HEB102248788",
|
||||||
|
"type": "remote",
|
||||||
|
"url": "https://hds2.hebis.de/ubffm/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"schema": "SCBook"
|
||||||
|
}
|
||||||
39
test/resources/indexable/ContactPoint.1.json
Normal file
39
test/resources/indexable/ContactPoint.1.json
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
"errorNames": [],
|
||||||
|
"instance": {
|
||||||
|
"type": "contact point",
|
||||||
|
"name": "Dienstadresse",
|
||||||
|
"areaServed": {
|
||||||
|
"type": "room",
|
||||||
|
"categories": [
|
||||||
|
"education"
|
||||||
|
],
|
||||||
|
"uid": "39c1a574-04ef-5157-9c6f-e271d93eb273",
|
||||||
|
"name": "3.G 121",
|
||||||
|
"alternateNames": [
|
||||||
|
"Dienstzimmer"
|
||||||
|
],
|
||||||
|
"geo": {
|
||||||
|
"point": {
|
||||||
|
"coordinates": [
|
||||||
|
8.66919,
|
||||||
|
50.12834
|
||||||
|
],
|
||||||
|
"type": "Point"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"email": "info@example.com",
|
||||||
|
"faxNumber": "069 / 123450",
|
||||||
|
"officeHours": "Mo, Mi 8:00-13:00",
|
||||||
|
"telephone": "069 / 12345",
|
||||||
|
"url": "https://example.com",
|
||||||
|
"uid": "be34a419-e9e8-5de0-b998-dd1b19e7beef",
|
||||||
|
"origin": {
|
||||||
|
"indexed": "2018-09-11T12:30:00Z",
|
||||||
|
"name": "Dummy",
|
||||||
|
"type": "remote"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"schema": "SCContactPoint"
|
||||||
|
}
|
||||||
@@ -13,9 +13,8 @@
|
|||||||
"code": "de",
|
"code": "de",
|
||||||
"name": "german"
|
"name": "german"
|
||||||
},
|
},
|
||||||
"major": "Astroturfing",
|
|
||||||
"mode": "dual",
|
"mode": "dual",
|
||||||
"name": "Astroturfing Bachelor",
|
"name": "Astroturfing",
|
||||||
"origin": {
|
"origin": {
|
||||||
"indexed": "2018-09-11T12:30:00Z",
|
"indexed": "2018-09-11T12:30:00Z",
|
||||||
"name": "Dummy",
|
"name": "Dummy",
|
||||||
@@ -27,8 +26,8 @@
|
|||||||
"uid": "b0f878fd-8fda-53b8-b065-a8d854c3d0d2"
|
"uid": "b0f878fd-8fda-53b8-b065-a8d854c3d0d2"
|
||||||
},
|
},
|
||||||
"timeMode": "parttime",
|
"timeMode": "parttime",
|
||||||
"type": "course of studies",
|
"type": "course of study",
|
||||||
"uid": "4c6f0a18-343d-5175-9fb1-62d28545c2aa"
|
"uid": "4c6f0a18-343d-5175-9fb1-62d28545c2aa"
|
||||||
},
|
},
|
||||||
"schema": "SCCourseOfStudies"
|
"schema": "SCCourseOfStudy"
|
||||||
}
|
}
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"frequency": "once",
|
"repeatFrequency": "P1W",
|
||||||
"dates": [
|
"dates": [
|
||||||
"2016-04-15T17:00:00+00:00"
|
"2016-04-15T17:00:00+00:00"
|
||||||
],
|
],
|
||||||
@@ -23,7 +23,6 @@
|
|||||||
"name": "EMH 225",
|
"name": "EMH 225",
|
||||||
"floorName": "2"
|
"floorName": "2"
|
||||||
},
|
},
|
||||||
"frequency": "once",
|
|
||||||
"dates": [
|
"dates": [
|
||||||
"2016-04-12T11:00:00+00:00"
|
"2016-04-12T11:00:00+00:00"
|
||||||
],
|
],
|
||||||
@@ -23,7 +23,6 @@
|
|||||||
"name": "EMH 225",
|
"name": "EMH 225",
|
||||||
"floorName": "2"
|
"floorName": "2"
|
||||||
},
|
},
|
||||||
"frequency": "once",
|
|
||||||
"dates": [
|
"dates": [
|
||||||
"2016-04-12T11:00:00+00:00"
|
"2016-04-12T11:00:00+00:00"
|
||||||
],
|
],
|
||||||
@@ -43,8 +42,10 @@
|
|||||||
"offers": [
|
"offers": [
|
||||||
{
|
{
|
||||||
"availability": "in stock",
|
"availability": "in stock",
|
||||||
"availabilityStarts": "2017-01-30T00:00:00.000Z",
|
"availabilityRange": {
|
||||||
"availabilityEnds": "2017-01-30T23:59:59.999Z",
|
"gte": "2017-01-30T00:00:00.000Z",
|
||||||
|
"lte": "2017-01-30T23:59:59.999Z"
|
||||||
|
},
|
||||||
"prices": {
|
"prices": {
|
||||||
"default": 6.5,
|
"default": 6.5,
|
||||||
"student": 5,
|
"student": 5,
|
||||||
@@ -19,8 +19,10 @@
|
|||||||
"offers": [
|
"offers": [
|
||||||
{
|
{
|
||||||
"availability": "in stock",
|
"availability": "in stock",
|
||||||
"availabilityStarts": "2017-01-30T00:00:00.000Z",
|
"availabilityRange": {
|
||||||
"availabilityEnds": "2017-01-30T23:59:59.999Z",
|
"gte": "2017-01-30T00:00:00.000Z",
|
||||||
|
"lte": "2017-01-30T23:59:59.999Z"
|
||||||
|
},
|
||||||
"prices": {
|
"prices": {
|
||||||
"default": 4.85,
|
"default": 4.85,
|
||||||
"student": 2.85,
|
"student": 2.85,
|
||||||
@@ -20,8 +20,10 @@
|
|||||||
"uid": "3b9b3df6-3a7a-58cc-922f-c7335c002634"
|
"uid": "3b9b3df6-3a7a-58cc-922f-c7335c002634"
|
||||||
},
|
},
|
||||||
"availability": "in stock",
|
"availability": "in stock",
|
||||||
"availabilityStarts": "2017-01-30T00:00:00.000Z",
|
"availabilityRange": {
|
||||||
"availabilityEnds": "2017-01-30T23:59:59.999Z",
|
"gte": "2017-01-30T00:00:00.000Z",
|
||||||
|
"lte": "2017-01-30T23:59:59.999Z"
|
||||||
|
},
|
||||||
"inPlace": {
|
"inPlace": {
|
||||||
"geo": {
|
"geo": {
|
||||||
"point": {
|
"point": {
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user