mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-25 02:52:41 +00:00
Compare commits
84 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
618a9046bc | ||
|
|
c43e2b38e6 | ||
|
|
9d0ff36af5 | ||
|
|
31bb7e89ea | ||
|
|
942f04e250 | ||
|
|
930b574618 | ||
|
|
7b88be3a75 | ||
|
|
5277f7601c | ||
|
|
5241a01b55 | ||
| 484be6a890 | |||
|
|
45e0f26391 | ||
|
|
ead47aca19 | ||
|
|
f9c2414000 | ||
|
|
523de51160 | ||
|
|
d912c03eb0 | ||
|
|
a638f5447b | ||
|
|
cecf95aa46 | ||
|
|
6fd8c5adf3 | ||
|
|
db24b41d99 | ||
|
|
b1fcd22ab2 | ||
|
|
268588fb6f | ||
|
|
d3048a12d8 | ||
|
|
e14993114f | ||
|
|
4237f6ad60 | ||
|
|
e7c1000bc4 | ||
|
|
e0adb2332e | ||
|
|
e5696b23e7 | ||
|
|
659d0974f7 | ||
|
|
e8304eeeb4 | ||
|
|
dca9d26c66 | ||
|
|
852e0f5373 | ||
|
|
26dd531d24 | ||
|
|
52bdf93356 | ||
|
|
7509610145 | ||
|
|
972cdf392d | ||
|
|
4f758f7d0c | ||
|
|
980e899807 | ||
|
|
d1c5bb9595 | ||
|
|
dc9c0f528f | ||
|
|
66d64e0858 | ||
|
|
06339786c2 | ||
|
|
8ed68481fa | ||
|
|
e26042957c | ||
|
|
7553620a5d | ||
|
|
322c001e70 | ||
|
|
830e249ac4 | ||
|
|
8c9df3ea9a | ||
|
|
f85768d32e | ||
|
|
580ace368f | ||
|
|
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 |
146
CHANGELOG.md
146
CHANGELOG.md
@@ -1,3 +1,149 @@
|
|||||||
|
## [0.66.1](https://gitlab.com/openstapps/core/compare/v0.66.0...v0.66.1) (2022-05-27)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.66.0](https://gitlab.com/openstapps/core/compare/v0.65.1...v0.66.0) (2022-05-11)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add geo filter envelope support ([484be6a](https://gitlab.com/openstapps/core/commit/484be6a890d743601efa5d40d33ea2c619f3126d))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.65.1](https://gitlab.com/openstapps/core/compare/v0.65.0...v0.65.1) (2022-04-04)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.65.0](https://gitlab.com/openstapps/core/compare/v0.64.0...v0.65.0) (2022-04-04)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.64.0](https://gitlab.com/openstapps/core/compare/v0.63.0...v0.64.0) (2022-03-21)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.63.0](https://gitlab.com/openstapps/core/compare/v0.62.0...v0.63.0) (2022-01-24)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add auth object to index route ([e149931](https://gitlab.com/openstapps/core/commit/e14993114f0ec370775010eee4ad0d302a0beebb))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.62.0](https://gitlab.com/openstapps/core/compare/v0.61.0...v0.62.0) (2022-01-21)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add missing lastPublished to SCCreativeWork ([e0adb23](https://gitlab.com/openstapps/core/commit/e0adb2332ec24ce388c4c008b51b7aa941948532))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.61.0](https://gitlab.com/openstapps/core/compare/v0.60.0...v0.61.0) (2022-01-21)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.60.0](https://gitlab.com/openstapps/core/compare/v0.59.0...v0.60.0) (2022-01-21)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.59.0](https://gitlab.com/openstapps/core/compare/v0.58.0...v0.59.0) (2022-01-20)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.58.0](https://gitlab.com/openstapps/core/compare/v0.57.0...v0.58.0) (2022-01-18)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.57.0](https://gitlab.com/openstapps/core/compare/v0.56.0...v0.57.0) (2022-01-18)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* extend config to describe auth providers ([7553620](https://gitlab.com/openstapps/core/commit/7553620a5d330ebfb66461afeab700e36bd37165))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.56.0](https://gitlab.com/openstapps/core/compare/v0.55.0...v0.56.0) (2021-12-17)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.55.0](https://gitlab.com/openstapps/core/compare/v0.54.0...v0.55.0) (2021-12-15)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [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)
|
# [0.48.0](https://gitlab.com/openstapps/core/compare/v0.47.0...v0.48.0) (2021-07-14)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
3579
package-lock.json
generated
3579
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
45
package.json
45
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@openstapps/core",
|
"name": "@openstapps/core",
|
||||||
"version": "0.49.0",
|
"version": "0.67.0",
|
||||||
"description": "StAppsCore - Generalized model of data",
|
"description": "StAppsCore - Generalized model of data",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"Model",
|
"Model",
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
"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 --entryPointStrategy expand 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",
|
||||||
@@ -45,36 +45,39 @@
|
|||||||
"Wieland Schöbl"
|
"Wieland Schöbl"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@openstapps/core-tools": "0.23.2",
|
"@openstapps/core-tools": "0.30.1",
|
||||||
"@types/geojson": "1.0.6",
|
"@types/geojson": "1.0.6",
|
||||||
"@types/json-patch": "0.0.30",
|
"@types/json-patch": "0.0.30",
|
||||||
"@types/json-schema": "7.0.9",
|
"@types/json-schema": "7.0.11",
|
||||||
"@types/node": "14.17.9",
|
"@types/node": "14.18.18",
|
||||||
"fast-clone": "1.5.13",
|
|
||||||
"fast-deep-equal": "3.1.3",
|
"fast-deep-equal": "3.1.3",
|
||||||
"http-status-codes": "2.1.4",
|
"http-status-codes": "2.2.0",
|
||||||
"json-patch": "0.7.0",
|
"json-patch": "0.7.0",
|
||||||
"json-schema": "0.3.0",
|
"json-schema": "0.4.0",
|
||||||
|
"rfdc": "1.3.0",
|
||||||
"ts-optchain": "0.1.8"
|
"ts-optchain": "0.1.8"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@openstapps/configuration": "0.27.0",
|
"@openstapps/configuration": "0.29.1",
|
||||||
"@openstapps/es-mapping-generator": "0.0.3",
|
"@openstapps/es-mapping-generator": "0.1.0",
|
||||||
"@openstapps/logger": "0.7.0",
|
"@openstapps/logger": "0.8.1",
|
||||||
"@testdeck/mocha": "0.1.2",
|
"@testdeck/mocha": "0.2.0",
|
||||||
"@types/chai": "4.2.21",
|
"@types/chai": "4.3.1",
|
||||||
"@types/rimraf": "3.0.1",
|
"@types/lodash": "4.14.182",
|
||||||
"chai": "4.3.4",
|
"@types/mocha": "9.1.1",
|
||||||
|
"@types/rimraf": "3.0.2",
|
||||||
|
"chai": "4.3.6",
|
||||||
"conditional-type-checks": "1.0.5",
|
"conditional-type-checks": "1.0.5",
|
||||||
"conventional-changelog-cli": "2.1.1",
|
"conventional-changelog-cli": "2.2.2",
|
||||||
"mocha": "8.4.0",
|
"lodash": "4.17.21",
|
||||||
|
"mocha": "10.0.0",
|
||||||
"nyc": "15.1.0",
|
"nyc": "15.1.0",
|
||||||
"rimraf": "3.0.2",
|
"rimraf": "3.0.2",
|
||||||
"source-map-support": "0.5.19",
|
"source-map-support": "0.5.21",
|
||||||
"surge": "0.23.0",
|
"surge": "0.23.1",
|
||||||
"ts-node": "9.1.1",
|
"ts-node": "10.8.0",
|
||||||
"tslint": "6.1.3",
|
"tslint": "6.1.3",
|
||||||
"typedoc": "0.21.5",
|
"typedoc": "0.22.15",
|
||||||
"typescript": "4.3.5"
|
"typescript": "4.3.5"
|
||||||
},
|
},
|
||||||
"nyc": {
|
"nyc": {
|
||||||
|
|||||||
@@ -15,7 +15,9 @@
|
|||||||
// 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 {SCMap} from '../general/map';
|
||||||
import {SCLanguageSetting, SCSetting, SCUserGroupSetting} from '../things/setting';
|
import {SCLanguageSetting, SCSetting, SCUserGroupSetting} from '../things/setting';
|
||||||
|
import {SCFeatureConfiguration} from './feature';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An app configuration menu item
|
* An app configuration menu item
|
||||||
@@ -80,15 +82,22 @@ 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
|
||||||
*/
|
*/
|
||||||
campusPolygon: Polygon;
|
campusPolygon: Polygon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of features to en- or disable
|
* Maps of enabled features (plugins and external services)
|
||||||
*/
|
*/
|
||||||
features: SCAppConfigurationFeature;
|
features: SCFeatureConfiguration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A URL where images are available
|
* A URL where images are available
|
||||||
@@ -127,16 +136,6 @@ export interface SCAppConfiguration {
|
|||||||
url?: string;
|
url?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Map of features
|
|
||||||
*/
|
|
||||||
export interface SCAppConfigurationFeature {
|
|
||||||
/**
|
|
||||||
* Whether or not widgets are enabled
|
|
||||||
*/
|
|
||||||
widgets: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* URLs of published apps
|
* URLs of published apps
|
||||||
*/
|
*/
|
||||||
@@ -174,3 +173,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>;
|
||||||
|
}
|
||||||
|
|||||||
96
src/config/authorization.ts
Normal file
96
src/config/authorization.ts
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
/*
|
||||||
|
* 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 {SCUserConfigurationMap} from './user';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Supported authorization provider types
|
||||||
|
*
|
||||||
|
* @see https://datatracker.ietf.org/doc/html/rfc6749#section-1.3.1
|
||||||
|
* @see https://github.com/gbv/paia
|
||||||
|
*/
|
||||||
|
export type SCAuthorizationProviderType = 'default' | 'paia' ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An authorization provider complete configuration
|
||||||
|
*/
|
||||||
|
export interface SCAuthorizationProvider {
|
||||||
|
/**
|
||||||
|
* An authorization provider client configuration
|
||||||
|
*/
|
||||||
|
client: SCAuthorizationProviderClient;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An authorization provider endpoints configuration
|
||||||
|
*/
|
||||||
|
endpoints: SCAuthorizationProviderEndpoints;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An authorization provider client configuration
|
||||||
|
*/
|
||||||
|
export interface SCAuthorizationProviderClient {
|
||||||
|
/**
|
||||||
|
* Client ID
|
||||||
|
*/
|
||||||
|
clientId: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scopes to request
|
||||||
|
*/
|
||||||
|
scopes: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main url to reach authorization provider
|
||||||
|
*/
|
||||||
|
url: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An authorization provider endpoints configuration
|
||||||
|
*/
|
||||||
|
export interface SCAuthorizationProviderEndpoints {
|
||||||
|
/**
|
||||||
|
* URL to start authentication flow
|
||||||
|
*/
|
||||||
|
authorization: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* URL to end current session
|
||||||
|
*/
|
||||||
|
endSession?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mapping of how to create SCUser from userinfo endpoint response (using JSONPath syntax)
|
||||||
|
*
|
||||||
|
* @see https://www.npmjs.com/package/jsonpath
|
||||||
|
*/
|
||||||
|
mapping: SCUserConfigurationMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* URL to revoke a token
|
||||||
|
*/
|
||||||
|
revoke?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* URL to get access Token
|
||||||
|
*/
|
||||||
|
token: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* URL to general user info endpoint
|
||||||
|
*/
|
||||||
|
userinfo: string;
|
||||||
|
}
|
||||||
49
src/config/feature.ts
Normal file
49
src/config/feature.ts
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* 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 {SCMap} from '../general/map';
|
||||||
|
import {SCAuthorizationProviderType} from './authorization';
|
||||||
|
|
||||||
|
export interface SCFeatureConfiguration {
|
||||||
|
/**
|
||||||
|
* Map of extern services mapped by their name (statically)
|
||||||
|
*/
|
||||||
|
extern?: SCMap<SCFeatureConfigurationExtern>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map of plugins registered with the backend mapped by their name.
|
||||||
|
*/
|
||||||
|
plugins?: SCMap<SCFeatureConfigurationPlugin>;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface SCFeatureConfigurationPlugin {
|
||||||
|
/**
|
||||||
|
* URL path registered with the backend
|
||||||
|
*/
|
||||||
|
urlPath: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SCFeatureConfigurationExtern {
|
||||||
|
/**
|
||||||
|
* Key of authorization provider available in SCConfigFile
|
||||||
|
*/
|
||||||
|
authProvider?: SCAuthorizationProviderType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* URL of extern service
|
||||||
|
*/
|
||||||
|
url: string;
|
||||||
|
}
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
*/
|
*/
|
||||||
import {SCLicensePlate} from '../general/namespaces';
|
import {SCLicensePlate} from '../general/namespaces';
|
||||||
import {SCAppConfiguration} from './app';
|
import {SCAppConfiguration} from './app';
|
||||||
|
import {SCAuthorizationProvider, SCAuthorizationProviderType} from './authorization';
|
||||||
import {SCBackendConfiguration, SCBackendInternalConfiguration} from './backend';
|
import {SCBackendConfiguration, SCBackendInternalConfiguration} from './backend';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -27,6 +28,11 @@ export interface SCConfigFile {
|
|||||||
*/
|
*/
|
||||||
app: SCAppConfiguration;
|
app: SCAppConfiguration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configuration for the supported authorization providers
|
||||||
|
*/
|
||||||
|
auth: { [key in SCAuthorizationProviderType]?: SCAuthorizationProvider; };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configuration for the backend that is visible to clients
|
* Configuration for the backend that is visible to clients
|
||||||
*/
|
*/
|
||||||
|
|||||||
64
src/config/user.ts
Normal file
64
src/config/user.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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* User configuration keys mapped to string type while including their requiredness
|
||||||
|
*/
|
||||||
|
export type SCUserConfigurationMap = { [K in keyof SCUserConfigurationOptional]?: string } & { [K in keyof SCUserConfigurationRequired]: string };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A user configuration
|
||||||
|
*/
|
||||||
|
export type SCUserConfiguration = SCUserConfigurationRequired & SCUserConfigurationOptional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A user configurations required properties
|
||||||
|
*/
|
||||||
|
interface SCUserConfigurationRequired {
|
||||||
|
/**
|
||||||
|
* ID given to the user
|
||||||
|
*/
|
||||||
|
id: string;
|
||||||
|
/**
|
||||||
|
* The complete name of the user combining all the parts of the name into one
|
||||||
|
*/
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A user configurations optional properties
|
||||||
|
*/
|
||||||
|
interface SCUserConfigurationOptional {
|
||||||
|
/**
|
||||||
|
* User's e-mail
|
||||||
|
*/
|
||||||
|
email?: string;
|
||||||
|
/**
|
||||||
|
* User's family name
|
||||||
|
*/
|
||||||
|
familyName?: string;
|
||||||
|
/**
|
||||||
|
* User's given name
|
||||||
|
*/
|
||||||
|
givenName?: string;
|
||||||
|
/**
|
||||||
|
* Role assigned to the user
|
||||||
|
*/
|
||||||
|
role?: string;
|
||||||
|
/**
|
||||||
|
* Student ID given to the user
|
||||||
|
*/
|
||||||
|
studentId?: string;
|
||||||
|
}
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
/**
|
/**
|
||||||
* 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
|
* @date
|
||||||
@@ -37,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;
|
||||||
|
|||||||
17
src/meta.ts
17
src/meta.ts
@@ -15,11 +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 {SCContactPoint, SCContactPointMeta, SCContactPointWithoutReferences} from './things/contact-point';
|
import {SCContactPoint, SCContactPointMeta, SCContactPointWithoutReferences} from './things/contact-point';
|
||||||
import {SCCourseOfStudies, SCCourseOfStudiesMeta, SCCourseOfStudiesWithoutReferences} from './things/course-of-studies';
|
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';
|
||||||
@@ -51,13 +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,
|
||||||
'contact point': SCContactPointMeta,
|
'contact point': SCContactPointMeta,
|
||||||
'course of studies': SCCourseOfStudiesMeta,
|
'course of study': SCCourseOfStudyMeta,
|
||||||
'date series': SCDateSeriesMeta,
|
'date series': SCDateSeriesMeta,
|
||||||
'diff': SCDiffMeta,
|
'diff': SCDiffMeta,
|
||||||
'dish': SCDishMeta,
|
'dish': SCDishMeta,
|
||||||
@@ -81,13 +83,14 @@ export const SCClasses: { [K in SCThingType]: object } = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type SCIndexableThings =
|
export type SCIndexableThings =
|
||||||
SCAcademicEvent
|
SCAssessment
|
||||||
|
| SCAcademicEvent
|
||||||
| SCArticle
|
| SCArticle
|
||||||
| SCBook
|
| SCBook
|
||||||
| SCBuilding
|
| SCBuilding
|
||||||
| SCCatalog
|
| SCCatalog
|
||||||
| SCContactPoint
|
| SCContactPoint
|
||||||
| SCCourseOfStudies
|
| SCCourseOfStudy
|
||||||
| SCDateSeries
|
| SCDateSeries
|
||||||
| SCDish
|
| SCDish
|
||||||
| SCFloor
|
| SCFloor
|
||||||
@@ -122,13 +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 SCContactPoint ? SCContactPointWithoutReferences :
|
THING extends SCContactPoint ? SCContactPointWithoutReferences :
|
||||||
THING extends SCCourseOfStudies ? SCCourseOfStudiesWithoutReferences :
|
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 :
|
||||||
@@ -155,13 +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 SCContactPointWithoutReferences ? SCContactPoint :
|
THING extends SCContactPointWithoutReferences ? SCContactPoint :
|
||||||
THING extends SCCourseOfStudiesWithoutReferences ? SCCourseOfStudies :
|
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 :
|
||||||
|
|||||||
@@ -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 {BAD_GATEWAY} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCError} from '../error';
|
import {SCError} from '../error';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -34,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,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 {METHOD_NOT_ALLOWED} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCError} from '../error';
|
import {SCError} from '../error';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -27,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,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 {NOT_FOUND} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCError} from '../error';
|
import {SCError} from '../error';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -27,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,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 {NOT_ACCEPTABLE} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCError} from '../error';
|
import {SCError} from '../error';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -29,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';
|
||||||
|
|
||||||
@@ -38,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,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 {INTERNAL_SERVER_ERROR} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCError} from '../error';
|
import {SCError} from '../error';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -28,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,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 {REQUEST_TOO_LONG} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCError} from '../error';
|
import {SCError} from '../error';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -27,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,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 {BAD_REQUEST} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCError} from '../error';
|
import {SCError} from '../error';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -28,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,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 {TOO_MANY_REQUESTS} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCError} from '../error';
|
import {SCError} from '../error';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -30,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,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 {UNSUPPORTED_MEDIA_TYPE} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCError} from '../error';
|
import {SCError} from '../error';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -27,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,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 {ValidationError} from '@openstapps/core-tools/lib/common';
|
import {ValidationError} from '@openstapps/core-tools/lib/types/validator';
|
||||||
import {BAD_REQUEST} from 'http-status-codes';
|
import {StatusCodes} from 'http-status-codes';
|
||||||
import {SCError} from '../error';
|
import {SCError} from '../error';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -34,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,9 +78,9 @@ export interface SCRoute {
|
|||||||
statusCodeSuccess: number;
|
statusCodeSuccess: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* URL fragment of the route
|
* URL path of the route
|
||||||
*/
|
*/
|
||||||
urlFragment: string;
|
urlPath: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -112,16 +112,16 @@ export abstract class SCAbstractRoute implements SCRoute {
|
|||||||
*/
|
*/
|
||||||
statusCodeSuccess = 200;
|
statusCodeSuccess = 200;
|
||||||
/**
|
/**
|
||||||
* @see SCRoute.urlFragment
|
* @see SCRoute.urlPath
|
||||||
*/
|
*/
|
||||||
urlFragment = '/';
|
urlPath = '/';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get "compiled" URL fragment
|
* Get "compiled" URL path
|
||||||
*
|
*
|
||||||
* @param parameters Parameters to compile URL fragment with
|
* @param parameters Parameters to compile URL path with
|
||||||
*/
|
*/
|
||||||
public getUrlFragment(parameters: SCMap<string> = {}): string {
|
public getUrlPath(parameters: SCMap<string> = {}): string {
|
||||||
let obligatoryParameters: string[] = [];
|
let obligatoryParameters: string[] = [];
|
||||||
|
|
||||||
if (typeof this.obligatoryParameters === 'object') {
|
if (typeof this.obligatoryParameters === 'object') {
|
||||||
@@ -132,7 +132,7 @@ export abstract class SCAbstractRoute implements SCRoute {
|
|||||||
throw new Error('Extraneous parameters provided.');
|
throw new Error('Extraneous parameters provided.');
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.urlFragment
|
return this.urlPath
|
||||||
.split('/')
|
.split('/')
|
||||||
.map((part) => {
|
.map((part) => {
|
||||||
if (part.indexOf(':') !== 0) {
|
if (part.indexOf(':') !== 0) {
|
||||||
|
|||||||
@@ -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.urlPath = '/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.urlPath = '/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.urlPath = '/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.urlPath = '/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,8 +59,8 @@ 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.urlPath = '/feedback';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,9 @@
|
|||||||
* 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 {SCAuthorizationProvider, SCAuthorizationProviderType} from '../../config/authorization';
|
||||||
import {SCBackendConfiguration} from '../../config/backend';
|
import {SCBackendConfiguration} from '../../config/backend';
|
||||||
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';
|
||||||
@@ -42,6 +43,11 @@ export interface SCIndexResponse {
|
|||||||
*/
|
*/
|
||||||
app: SCAppConfiguration;
|
app: SCAppConfiguration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see SCAuthorizationProvider
|
||||||
|
*/
|
||||||
|
auth: { [key in SCAuthorizationProviderType]?: SCAuthorizationProvider; };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see SCBackendConfiguration
|
* @see SCBackendConfiguration
|
||||||
*/
|
*/
|
||||||
@@ -65,7 +71,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.urlPath = '/';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 {JSONSchema7} from 'json-schema';
|
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';
|
||||||
@@ -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.urlPath = '/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.urlPath = '/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.urlPath = '/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';
|
||||||
@@ -60,7 +60,7 @@ export class SCThingUpdateRoute extends SCAbstractRoute {
|
|||||||
};
|
};
|
||||||
this.requestBodyName = 'SCThingUpdateRequest';
|
this.requestBodyName = 'SCThingUpdateRequest';
|
||||||
this.responseBodyName = 'SCThingUpdateResponse';
|
this.responseBodyName = 'SCThingUpdateResponse';
|
||||||
this.statusCodeSuccess = OK;
|
this.statusCodeSuccess = StatusCodes.OK;
|
||||||
this.urlFragment = '/:TYPE/:UID';
|
this.urlPath = '/:TYPE/:UID';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
// tslint:disable-next-line:no-implicit-dependencies
|
// tslint:disable-next-line:no-implicit-dependencies
|
||||||
import {Polygon} from 'geojson';
|
import {Polygon, Position} from 'geojson';
|
||||||
import {SCThingsField} from '../../../meta';
|
import {SCThingsField} from '../../../meta';
|
||||||
import {SCSearchAbstractFilter, SCSearchAbstractFilterArguments} from '../filter';
|
import {SCSearchAbstractFilter, SCSearchAbstractFilterArguments} from '../filter';
|
||||||
|
|
||||||
@@ -29,6 +29,24 @@ export interface SCGeoFilter extends SCSearchAbstractFilter<SCGeoFilterArguments
|
|||||||
type: 'geo';
|
type: 'geo';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A rectangular geo shape, representing the top-left and bottom-right corners
|
||||||
|
*
|
||||||
|
* This is an extension of the Geojson type
|
||||||
|
* http://geojson.org/geojson-spec.html
|
||||||
|
*/
|
||||||
|
export interface Envelope {
|
||||||
|
/**
|
||||||
|
* The top-left and bottom-right corners of the bounding box
|
||||||
|
*/
|
||||||
|
coordinates: [Position, Position];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type of the geometry
|
||||||
|
*/
|
||||||
|
type: 'envelope';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Arguments for filter instruction by geo data
|
* Arguments for filter instruction by geo data
|
||||||
*/
|
*/
|
||||||
@@ -41,7 +59,7 @@ export interface SCGeoFilterArguments extends SCSearchAbstractFilterArguments {
|
|||||||
/**
|
/**
|
||||||
* Geo data to check up on
|
* Geo data to check up on
|
||||||
*/
|
*/
|
||||||
shape: Polygon;
|
shape: Polygon | Envelope;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Spatial relation between the provided shape and the shape of the field.
|
* Spatial relation between the provided shape and the shape of the field.
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -62,13 +61,13 @@ export class SCAcademicDegreeMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
|
...new SCThingMeta().fieldTranslations.de,
|
||||||
academicDegree: 'Hochschulgrad',
|
academicDegree: 'Abschlussgrad',
|
||||||
academicDegreewithField: 'Abschlussbezeichnungen',
|
academicDegreewithField: 'Abschlussbezeichnung',
|
||||||
academicDegreewithFieldShort: 'Abschlussbezeichnungen (kurz)',
|
academicDegreewithFieldShort: 'Abschlussbezeichnung (kurz)',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
|
...new SCThingMeta().fieldTranslations.en,
|
||||||
academicDegree: 'academic degree',
|
academicDegree: 'academic degree',
|
||||||
academicDegreewithField: 'acedemic degree and discipline',
|
academicDegreewithField: 'acedemic degree and discipline',
|
||||||
academicDegreewithFieldShort: 'acedemic degree and discipline (short)',
|
academicDegreewithFieldShort: 'acedemic degree and discipline (short)',
|
||||||
@@ -80,33 +79,10 @@ export class SCAcademicDegreeMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
|
...new 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,
|
...new SCThingMeta().fieldValueTranslations.en,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Types of (german) academic degrees
|
|
||||||
*/
|
|
||||||
export type SCGermanAcademicDegree =
|
|
||||||
'bachelor'
|
|
||||||
| 'diploma'
|
|
||||||
| 'doctor'
|
|
||||||
| 'licentiate'
|
|
||||||
| 'magister'
|
|
||||||
| 'master'
|
|
||||||
| 'master pupil'
|
|
||||||
| 'state examination' ;
|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ export class SCAcademicTermWithoutReferencesMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
|
...new SCThingMeta().fieldTranslations.de,
|
||||||
acronym: 'Akronym',
|
acronym: 'Akronym',
|
||||||
endDate: 'Enddatum',
|
endDate: 'Enddatum',
|
||||||
eventsEndDate: 'Enddatum der Veranstaltungen',
|
eventsEndDate: 'Enddatum der Veranstaltungen',
|
||||||
@@ -85,7 +85,7 @@ export class SCAcademicTermWithoutReferencesMeta
|
|||||||
startDate: 'Startdatum',
|
startDate: 'Startdatum',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
|
...new SCThingMeta().fieldTranslations.en,
|
||||||
acronym: 'acronym',
|
acronym: 'acronym',
|
||||||
endDate: 'end date',
|
endDate: 'end date',
|
||||||
eventsEndDate: 'end date of events',
|
eventsEndDate: 'end date of events',
|
||||||
@@ -99,10 +99,10 @@ export class SCAcademicTermWithoutReferencesMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
|
...new SCThingMeta().fieldValueTranslations.de,
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
|
...new SCThingMeta().fieldValueTranslations.en,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,19 +17,13 @@ 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 {SCPublicationEventWithoutReferences} from '../publication-event';
|
||||||
import {SCThingMeta, SCThingTranslatableProperties, SCThingWithoutReferences} from './thing';
|
import {SCThing, SCThingMeta, SCThingTranslatableProperties, SCThingWithoutReferences} from './thing';
|
||||||
import {
|
|
||||||
SCAcademicPriceGroup,
|
|
||||||
SCThingThatCanBeOffered, SCThingThatCanBeOfferedMeta,
|
|
||||||
SCThingThatCanBeOfferedTranslatableProperties,
|
|
||||||
SCThingThatCanBeOfferedWithoutReferences,
|
|
||||||
} from './thing-that-can-be-offered';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A creative work without references
|
* A creative work without references
|
||||||
*/
|
*/
|
||||||
export interface SCCreativeWorkWithoutReferences
|
export interface SCCreativeWorkWithoutReferences
|
||||||
extends SCThingWithoutReferences, SCThingThatCanBeOfferedWithoutReferences {
|
extends SCThingWithoutReferences {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Languages this creative work is available in
|
* Languages this creative work is available in
|
||||||
@@ -71,6 +65,13 @@ export interface SCCreativeWorkWithoutReferences
|
|||||||
*/
|
*/
|
||||||
keywords?: string[];
|
keywords?: string[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Date (in text form) the creative work was most recently
|
||||||
|
*
|
||||||
|
* @keyword
|
||||||
|
*/
|
||||||
|
lastPublished?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translated fields of the creative work
|
* Translated fields of the creative work
|
||||||
*/
|
*/
|
||||||
@@ -81,7 +82,7 @@ export interface SCCreativeWorkWithoutReferences
|
|||||||
* A creative work
|
* A creative work
|
||||||
*/
|
*/
|
||||||
export interface SCCreativeWork
|
export interface SCCreativeWork
|
||||||
extends SCCreativeWorkWithoutReferences, SCThingThatCanBeOffered<SCAcademicPriceGroup> {
|
extends SCCreativeWorkWithoutReferences, SCThing {
|
||||||
/**
|
/**
|
||||||
* Authors of the creative work
|
* Authors of the creative work
|
||||||
*/
|
*/
|
||||||
@@ -117,7 +118,7 @@ export interface SCCreativeWork
|
|||||||
* Translatable properties of creative works
|
* Translatable properties of creative works
|
||||||
*/
|
*/
|
||||||
export interface SCCreativeWorkTranslatableProperties
|
export interface SCCreativeWorkTranslatableProperties
|
||||||
extends SCThingTranslatableProperties, SCThingThatCanBeOfferedTranslatableProperties {
|
extends SCThingTranslatableProperties {
|
||||||
/**
|
/**
|
||||||
* Translation of the keywords of the creative work
|
* Translation of the keywords of the creative work
|
||||||
*
|
*
|
||||||
@@ -136,8 +137,7 @@ export class SCCreativeWorkMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
|
...new SCThingMeta().fieldTranslations.de,
|
||||||
...SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.de,
|
|
||||||
name: 'Titel',
|
name: 'Titel',
|
||||||
authors: 'beteiligte Personen',
|
authors: 'beteiligte Personen',
|
||||||
availableLanguages: 'verfügbare Übersetzungen',
|
availableLanguages: 'verfügbare Übersetzungen',
|
||||||
@@ -153,8 +153,7 @@ export class SCCreativeWorkMeta
|
|||||||
sourceOrganization: 'Körperschaft',
|
sourceOrganization: 'Körperschaft',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
|
...new SCThingMeta().fieldTranslations.en,
|
||||||
...SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.en,
|
|
||||||
name: 'title',
|
name: 'title',
|
||||||
authors: 'involved persons',
|
authors: 'involved persons',
|
||||||
availableLanguages: 'available languages',
|
availableLanguages: 'available languages',
|
||||||
@@ -176,12 +175,10 @@ export class SCCreativeWorkMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
|
...new SCThingMeta().fieldValueTranslations.de,
|
||||||
...SCThingThatCanBeOfferedMeta.getInstance().fieldValueTranslations.de,
|
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
|
...new SCThingMeta().fieldValueTranslations.en,
|
||||||
...SCThingThatCanBeOfferedMeta.getInstance().fieldValueTranslations.en,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ export class SCEventMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
|
...new SCThingMeta().fieldTranslations.de,
|
||||||
academicTerms: 'Semester',
|
academicTerms: 'Semester',
|
||||||
catalogs: 'Verzeichnis',
|
catalogs: 'Verzeichnis',
|
||||||
creativeWorks: 'begleitende Werke',
|
creativeWorks: 'begleitende Werke',
|
||||||
@@ -96,7 +96,7 @@ export class SCEventMeta
|
|||||||
remainingAttendeeCapacity: 'verfügbare Anzahl an Teilnehmern',
|
remainingAttendeeCapacity: 'verfügbare Anzahl an Teilnehmern',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
|
...new SCThingMeta().fieldTranslations.en,
|
||||||
academicTerms: 'academic terms',
|
academicTerms: 'academic terms',
|
||||||
catalogs: 'catalogs',
|
catalogs: 'catalogs',
|
||||||
creativeWorks: 'related material',
|
creativeWorks: 'related material',
|
||||||
@@ -112,10 +112,10 @@ export class SCEventMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
|
...new SCThingMeta().fieldValueTranslations.de,
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
|
...new SCThingMeta().fieldValueTranslations.en,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,13 +145,13 @@ export class SCPlaceWithoutReferencesMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
|
...new SCThingMeta().fieldTranslations.de,
|
||||||
address: 'Adresse',
|
address: 'Adresse',
|
||||||
geo: 'Geoinformation',
|
geo: 'Geoinformation',
|
||||||
openingHours: 'Öffnungszeiten',
|
openingHours: 'Öffnungszeiten',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
|
...new SCThingMeta().fieldTranslations.en,
|
||||||
address: 'address',
|
address: 'address',
|
||||||
geo: 'geographic information',
|
geo: 'geographic information',
|
||||||
openingHours: 'opening hours',
|
openingHours: 'opening hours',
|
||||||
@@ -163,10 +163,10 @@ export class SCPlaceWithoutReferencesMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
|
...new SCThingMeta().fieldValueTranslations.de,
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
|
...new SCThingMeta().fieldValueTranslations.en,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,11 +34,11 @@ export class SCThingInPlaceMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
|
...new SCThingMeta().fieldTranslations.de,
|
||||||
inPlace: 'Ort',
|
inPlace: 'Ort',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
|
...new SCThingMeta().fieldTranslations.en,
|
||||||
inPlace: 'location',
|
inPlace: 'location',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -48,10 +48,10 @@ export class SCThingInPlaceMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
|
...new SCThingMeta().fieldValueTranslations.de,
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
|
...new SCThingMeta().fieldValueTranslations.en,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,11 +54,11 @@ export class SCThingThatAcceptsPaymentsWithoutReferencesMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
|
...new SCThingMeta().fieldTranslations.de,
|
||||||
paymentsAccepted: 'Bezahlmethoden',
|
paymentsAccepted: 'Bezahlmethoden',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
|
...new SCThingMeta().fieldTranslations.en,
|
||||||
paymentsAccepted: 'accepted payment methods',
|
paymentsAccepted: 'accepted payment methods',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -68,7 +68,7 @@ export class SCThingThatAcceptsPaymentsWithoutReferencesMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
|
...new SCThingMeta().fieldValueTranslations.de,
|
||||||
paymentsAccepted: {
|
paymentsAccepted: {
|
||||||
'cafeteria card': 'Mensakarte',
|
'cafeteria card': 'Mensakarte',
|
||||||
'cash': 'Bar',
|
'cash': 'Bar',
|
||||||
@@ -76,7 +76,7 @@ export class SCThingThatAcceptsPaymentsWithoutReferencesMeta
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
|
...new SCThingMeta().fieldValueTranslations.en,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ export interface SCThingThatCanBeOfferedOffer<T extends SCPriceGroup>
|
|||||||
/**
|
/**
|
||||||
* 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
|
||||||
@@ -150,21 +150,16 @@ export type SCThingThatCanBeOfferedAvailability =
|
|||||||
export class SCThingThatCanBeOfferedMeta<T extends SCPriceGroup>
|
export class SCThingThatCanBeOfferedMeta<T extends SCPriceGroup>
|
||||||
implements SCMetaTranslations<SCThingThatCanBeOffered<T>> {
|
implements SCMetaTranslations<SCThingThatCanBeOffered<T>> {
|
||||||
|
|
||||||
/**
|
|
||||||
* Instance
|
|
||||||
*/
|
|
||||||
protected static _instance = new Map<string, unknown>();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translations of fields
|
* Translations of fields
|
||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance().fieldTranslations.de,
|
...new SCThingMeta().fieldTranslations.de,
|
||||||
offers: 'Angebote',
|
offers: 'Angebote',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance().fieldTranslations.en,
|
...new SCThingMeta().fieldTranslations.en,
|
||||||
offers: 'offers',
|
offers: 'offers',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -174,26 +169,10 @@ export class SCThingThatCanBeOfferedMeta<T extends SCPriceGroup>
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
|
...new SCThingMeta().fieldValueTranslations.de,
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
|
...new SCThingMeta().fieldValueTranslations.en,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// tslint:disable:static-this
|
|
||||||
/**
|
|
||||||
* Function to retrieve typed singleton instance (including generics)
|
|
||||||
*/
|
|
||||||
public static getInstance<T extends SCPriceGroup>(): SCThingThatCanBeOfferedMeta<T> {
|
|
||||||
if (!SCThingThatCanBeOfferedMeta._instance.has(this.name)) {
|
|
||||||
SCThingThatCanBeOfferedMeta._instance.set(this.name, new SCThingThatCanBeOfferedMeta<T>());
|
|
||||||
}
|
|
||||||
|
|
||||||
return SCThingThatCanBeOfferedMeta._instance
|
|
||||||
.get(this.name) as SCThingThatCanBeOfferedMeta<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected constructor() {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,22 +120,17 @@ export interface SCThingWithCategoriesSpecificValues {
|
|||||||
export class SCThingWithCategoriesWithoutReferencesMeta<T, U>
|
export class SCThingWithCategoriesWithoutReferencesMeta<T, U>
|
||||||
implements SCMetaTranslations<SCThingWithCategoriesWithoutReferences<T, U>> {
|
implements SCMetaTranslations<SCThingWithCategoriesWithoutReferences<T, U>> {
|
||||||
|
|
||||||
/**
|
|
||||||
* Instance
|
|
||||||
*/
|
|
||||||
protected static _instance = new Map<string, unknown>();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translations of fields
|
* Translations of fields
|
||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
|
...new SCThingMeta().fieldTranslations.de,
|
||||||
categories: 'Kategorien',
|
categories: 'Kategorien',
|
||||||
categorySpecificValues: 'besondere Kategorien',
|
categorySpecificValues: 'besondere Kategorien',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
|
...new SCThingMeta().fieldTranslations.en,
|
||||||
categories: 'categories',
|
categories: 'categories',
|
||||||
categorySpecificValues: 'category with specific values',
|
categorySpecificValues: 'category with specific values',
|
||||||
},
|
},
|
||||||
@@ -146,27 +141,10 @@ export class SCThingWithCategoriesWithoutReferencesMeta<T, U>
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
|
...new SCThingMeta().fieldValueTranslations.de,
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
|
...new SCThingMeta().fieldValueTranslations.en,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// tslint:disable:static-this
|
|
||||||
/**
|
|
||||||
* Function to retrieve typed singleton instance (including generics)
|
|
||||||
*/
|
|
||||||
public static getInstance<T, U>(): SCThingWithCategoriesWithoutReferencesMeta<T, U> {
|
|
||||||
if (!SCThingWithCategoriesWithoutReferencesMeta._instance.has(this.name)) {
|
|
||||||
SCThingWithCategoriesWithoutReferencesMeta._instance
|
|
||||||
.set(this.name, new SCThingWithCategoriesWithoutReferencesMeta<T, U>());
|
|
||||||
}
|
|
||||||
|
|
||||||
return SCThingWithCategoriesWithoutReferencesMeta._instance
|
|
||||||
.get(this.name) as SCThingWithCategoriesWithoutReferencesMeta<T, U>;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected constructor() {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ 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',
|
||||||
@@ -30,7 +31,7 @@ export enum SCThingType {
|
|||||||
Building = 'building',
|
Building = 'building',
|
||||||
Catalog = 'catalog',
|
Catalog = 'catalog',
|
||||||
ContactPoint = 'contact point',
|
ContactPoint = 'contact point',
|
||||||
CourseOfStudies = 'course of studies',
|
CourseOfStudy = 'course of study',
|
||||||
DateSeries = 'date series',
|
DateSeries = 'date series',
|
||||||
Diff = 'diff',
|
Diff = 'diff',
|
||||||
Dish = 'dish',
|
Dish = 'dish',
|
||||||
@@ -268,11 +269,6 @@ export interface SCThingTranslatablePropertyOrigin {
|
|||||||
* Meta information about things
|
* Meta information about things
|
||||||
*/
|
*/
|
||||||
export class SCThingMeta implements SCMetaTranslations<SCThing> {
|
export class SCThingMeta implements SCMetaTranslations<SCThing> {
|
||||||
/**
|
|
||||||
* Set type definition for singleton instance
|
|
||||||
*/
|
|
||||||
protected static _instance = new Map<string, unknown>();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translations of fields
|
* Translations of fields
|
||||||
*/
|
*/
|
||||||
@@ -314,19 +310,4 @@ export class SCThingMeta implements SCMetaTranslations<SCThing> {
|
|||||||
type: 'Thing',
|
type: 'Thing',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// tslint:disable:static-this
|
|
||||||
/**
|
|
||||||
* Function to retrieve typed singleton instance
|
|
||||||
*/
|
|
||||||
public static getInstance<T extends SCThingMeta>(): T {
|
|
||||||
if (!SCThingMeta._instance.has(this.name)) {
|
|
||||||
SCThingMeta._instance.set(this.name, new this());
|
|
||||||
}
|
|
||||||
|
|
||||||
return SCThingMeta._instance.get(this.name) as T;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected constructor() {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,15 +128,15 @@ export class SCAcademicEventMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCEventMeta.getInstance<SCEventMeta>().fieldTranslations.de,
|
...new SCEventMeta().fieldTranslations.de,
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCAcademicEventCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCAcademicEventCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
||||||
majors: 'Hauptfächer',
|
majors: 'Hauptfächer',
|
||||||
originalCategory: 'ursprüngliche Kategorie',
|
originalCategory: 'ursprüngliche Kategorie',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCEventMeta.getInstance<SCEventMeta>().fieldTranslations.en,
|
...new SCEventMeta().fieldTranslations.en,
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCAcademicEventCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCAcademicEventCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
||||||
majors: 'majors',
|
majors: 'majors',
|
||||||
originalCategory: 'original category',
|
originalCategory: 'original category',
|
||||||
@@ -148,8 +148,8 @@ export class SCAcademicEventMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCEventMeta.getInstance<SCEventMeta>().fieldValueTranslations.de,
|
...new SCEventMeta().fieldValueTranslations.de,
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCAcademicEventCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCAcademicEventCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
||||||
categories: {
|
categories: {
|
||||||
'colloquium': 'Kolloquium',
|
'colloquium': 'Kolloquium',
|
||||||
@@ -171,8 +171,8 @@ export class SCAcademicEventMeta
|
|||||||
type: 'akademische Veranstaltung',
|
type: 'akademische Veranstaltung',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCEventMeta.getInstance<SCEventMeta>().fieldValueTranslations.en,
|
...new SCEventMeta().fieldValueTranslations.en,
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCAcademicEventCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCAcademicEventCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
||||||
type: SCThingType.AcademicEvent,
|
type: SCThingType.AcademicEvent,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import {
|
|||||||
SCCreativeWorkWithoutReferences,
|
SCCreativeWorkWithoutReferences,
|
||||||
} from './abstract/creative-work';
|
} from './abstract/creative-work';
|
||||||
import {SCThingMeta, SCThingType} from './abstract/thing';
|
import {SCThingMeta, SCThingType} from './abstract/thing';
|
||||||
|
import {SCAcademicPriceGroup, SCThingThatCanBeOffered, SCThingThatCanBeOfferedMeta, SCThingThatCanBeOfferedTranslatableProperties, SCThingThatCanBeOfferedWithoutReferences} from './abstract/thing-that-can-be-offered';
|
||||||
import {
|
import {
|
||||||
SCThingWithCategoriesSpecificValues,
|
SCThingWithCategoriesSpecificValues,
|
||||||
SCThingWithCategoriesTranslatableProperties,
|
SCThingWithCategoriesTranslatableProperties,
|
||||||
@@ -40,6 +41,7 @@ export type SCArticleCategories = 'unipedia'
|
|||||||
*/
|
*/
|
||||||
export interface SCArticleWithoutReferences
|
export interface SCArticleWithoutReferences
|
||||||
extends SCCreativeWorkWithoutReferences,
|
extends SCCreativeWorkWithoutReferences,
|
||||||
|
SCThingThatCanBeOfferedWithoutReferences,
|
||||||
SCThingWithCategoriesWithoutReferences<SCArticleCategories, SCThingWithCategoriesSpecificValues> {
|
SCThingWithCategoriesWithoutReferences<SCArticleCategories, SCThingWithCategoriesSpecificValues> {
|
||||||
/**
|
/**
|
||||||
* Article itself as markdown
|
* Article itself as markdown
|
||||||
@@ -71,7 +73,9 @@ export interface SCArticleWithoutReferences
|
|||||||
* @indexable
|
* @indexable
|
||||||
*/
|
*/
|
||||||
export interface SCArticle
|
export interface SCArticle
|
||||||
extends SCCreativeWork, SCArticleWithoutReferences {
|
extends SCCreativeWork,
|
||||||
|
SCThingThatCanBeOffered<SCAcademicPriceGroup>,
|
||||||
|
SCArticleWithoutReferences {
|
||||||
/**
|
/**
|
||||||
* A periodical to which this article belongs
|
* A periodical to which this article belongs
|
||||||
*/
|
*/
|
||||||
@@ -96,7 +100,9 @@ export interface SCArticle
|
|||||||
* Translatable properties of an article
|
* Translatable properties of an article
|
||||||
*/
|
*/
|
||||||
export interface SCArticleTranslatableProperties
|
export interface SCArticleTranslatableProperties
|
||||||
extends SCThingWithCategoriesTranslatableProperties, SCCreativeWorkTranslatableProperties {
|
extends SCThingWithCategoriesTranslatableProperties,
|
||||||
|
SCThingThatCanBeOfferedTranslatableProperties,
|
||||||
|
SCCreativeWorkTranslatableProperties {
|
||||||
/**
|
/**
|
||||||
* Translation of the article itself as markdown
|
* Translation of the article itself as markdown
|
||||||
*
|
*
|
||||||
@@ -115,19 +121,21 @@ export class SCArticleMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations
|
...new SCCreativeWorkMeta().fieldTranslations
|
||||||
.de,
|
.de,
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCArticleCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCArticleCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
||||||
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldTranslations.de,
|
||||||
categories: 'Format',
|
categories: 'Format',
|
||||||
reference: 'Referenz',
|
reference: 'Referenz',
|
||||||
articleBody: 'Artikelinhalt',
|
articleBody: 'Artikelinhalt',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations
|
...new SCCreativeWorkMeta().fieldTranslations
|
||||||
.en,
|
.en,
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCArticleCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCArticleCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
||||||
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldTranslations.en,
|
||||||
categories: 'format',
|
categories: 'format',
|
||||||
reference: 'reference',
|
reference: 'reference',
|
||||||
articleBody: 'article body',
|
articleBody: 'article body',
|
||||||
@@ -139,8 +147,11 @@ export class SCArticleMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
...new SCCreativeWorkMeta().fieldValueTranslations.de,
|
||||||
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
|
||||||
.fieldValueTranslations.de,
|
.fieldValueTranslations.de,
|
||||||
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCArticleCategories,
|
||||||
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
||||||
categories: {
|
categories: {
|
||||||
article: 'Artikel',
|
article: 'Artikel',
|
||||||
eArticle: 'E-Aufsatz',
|
eArticle: 'E-Aufsatz',
|
||||||
@@ -149,8 +160,11 @@ export class SCArticleMeta
|
|||||||
type: 'Artikel',
|
type: 'Artikel',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
...new SCCreativeWorkMeta().fieldValueTranslations.en,
|
||||||
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
|
||||||
.fieldValueTranslations.en,
|
.fieldValueTranslations.en,
|
||||||
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCArticleCategories,
|
||||||
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
||||||
type: SCThingType.Article,
|
type: SCThingType.Article,
|
||||||
categories: {
|
categories: {
|
||||||
article: 'article',
|
article: 'article',
|
||||||
|
|||||||
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: {
|
||||||
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCAssessmentCategories,
|
||||||
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
||||||
|
attempt: 'Versuch',
|
||||||
|
courseOfStudy: 'Studiengang',
|
||||||
|
date: 'Datum',
|
||||||
|
ects: 'ECTS-Punkte',
|
||||||
|
grade: 'Note',
|
||||||
|
status: 'Status',
|
||||||
|
superAssessments: 'übergeordnete Prüfungen',
|
||||||
|
},
|
||||||
|
en: {
|
||||||
|
...new SCThingWithCategoriesWithoutReferencesMeta<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: {
|
||||||
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCAssessmentCategories,
|
||||||
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
||||||
|
type: 'Prüfung',
|
||||||
|
},
|
||||||
|
en: {
|
||||||
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCAssessmentCategories,
|
||||||
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
||||||
|
type: SCThingType.Assessment,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -20,6 +20,7 @@ import {
|
|||||||
SCCreativeWorkWithoutReferences,
|
SCCreativeWorkWithoutReferences,
|
||||||
} from './abstract/creative-work';
|
} from './abstract/creative-work';
|
||||||
import {SCThingMeta, SCThingType} from './abstract/thing';
|
import {SCThingMeta, SCThingType} from './abstract/thing';
|
||||||
|
import {SCAcademicPriceGroup, SCThingThatCanBeOffered, SCThingThatCanBeOfferedMeta, SCThingThatCanBeOfferedTranslatableProperties, SCThingThatCanBeOfferedWithoutReferences} from './abstract/thing-that-can-be-offered';
|
||||||
import {
|
import {
|
||||||
SCThingWithCategoriesSpecificValues,
|
SCThingWithCategoriesSpecificValues,
|
||||||
SCThingWithCategoriesTranslatableProperties,
|
SCThingWithCategoriesTranslatableProperties,
|
||||||
@@ -43,6 +44,7 @@ export type SCBookCategories = 'audio'
|
|||||||
| 'microfilm'
|
| 'microfilm'
|
||||||
| 'musicalscore'
|
| 'musicalscore'
|
||||||
| 'photo'
|
| 'photo'
|
||||||
|
| 'physicalobject'
|
||||||
| 'retro'
|
| 'retro'
|
||||||
| 'sensorimage'
|
| 'sensorimage'
|
||||||
| 'unknown'
|
| 'unknown'
|
||||||
@@ -53,6 +55,7 @@ export type SCBookCategories = 'audio'
|
|||||||
*/
|
*/
|
||||||
export interface SCBookWithoutReferences
|
export interface SCBookWithoutReferences
|
||||||
extends SCCreativeWorkWithoutReferences,
|
extends SCCreativeWorkWithoutReferences,
|
||||||
|
SCThingThatCanBeOfferedWithoutReferences,
|
||||||
SCThingWithCategoriesWithoutReferences<SCBookCategories, SCThingWithCategoriesSpecificValues> {
|
SCThingWithCategoriesWithoutReferences<SCBookCategories, SCThingWithCategoriesSpecificValues> {
|
||||||
/**
|
/**
|
||||||
* Categories of a book
|
* Categories of a book
|
||||||
@@ -92,7 +95,9 @@ export interface SCBookWithoutReferences
|
|||||||
* @indexable
|
* @indexable
|
||||||
*/
|
*/
|
||||||
export interface SCBook
|
export interface SCBook
|
||||||
extends SCCreativeWork, SCBookWithoutReferences {
|
extends SCCreativeWork,
|
||||||
|
SCThingThatCanBeOffered<SCAcademicPriceGroup>,
|
||||||
|
SCBookWithoutReferences {
|
||||||
/**
|
/**
|
||||||
* Translated properties of a book
|
* Translated properties of a book
|
||||||
*/
|
*/
|
||||||
@@ -108,7 +113,9 @@ export interface SCBook
|
|||||||
* Translatable properties of a book
|
* Translatable properties of a book
|
||||||
*/
|
*/
|
||||||
export interface SCBookTranslatableFields
|
export interface SCBookTranslatableFields
|
||||||
extends SCThingWithCategoriesTranslatableProperties, SCCreativeWorkTranslatableProperties {
|
extends SCThingWithCategoriesTranslatableProperties,
|
||||||
|
SCThingThatCanBeOfferedTranslatableProperties,
|
||||||
|
SCCreativeWorkTranslatableProperties {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -120,17 +127,19 @@ export class SCBookMeta extends SCThingMeta implements SCMetaTranslations<SCBook
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations.de,
|
...new SCCreativeWorkMeta().fieldTranslations.de,
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBookCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCBookCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
||||||
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldTranslations.de,
|
||||||
categories: 'Format',
|
categories: 'Format',
|
||||||
ISBNs: 'ISBN',
|
ISBNs: 'ISBN',
|
||||||
numberOfPages: 'Seitenanzahl',
|
numberOfPages: 'Seitenanzahl',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations.en,
|
...new SCCreativeWorkMeta().fieldTranslations.en,
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBookCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCBookCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
||||||
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldTranslations.en,
|
||||||
categories: 'format',
|
categories: 'format',
|
||||||
ISBNs: 'ISBN',
|
ISBNs: 'ISBN',
|
||||||
numberOfPages: 'number of pages',
|
numberOfPages: 'number of pages',
|
||||||
@@ -142,10 +151,12 @@ export class SCBookMeta extends SCThingMeta implements SCMetaTranslations<SCBook
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
...new SCCreativeWorkMeta()
|
||||||
.fieldValueTranslations.de,
|
.fieldValueTranslations.de,
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBookCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCBookCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
||||||
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
|
||||||
|
.fieldValueTranslations.de,
|
||||||
categories: {
|
categories: {
|
||||||
audio: 'Tonträger',
|
audio: 'Tonträger',
|
||||||
book: 'Buch',
|
book: 'Buch',
|
||||||
@@ -169,10 +180,12 @@ export class SCBookMeta extends SCThingMeta implements SCMetaTranslations<SCBook
|
|||||||
type: 'Buch',
|
type: 'Buch',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
...new SCCreativeWorkMeta()
|
||||||
.fieldValueTranslations.en,
|
.fieldValueTranslations.en,
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBookCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCBookCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
||||||
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
|
||||||
|
.fieldValueTranslations.en,
|
||||||
type: SCThingType.Book,
|
type: SCThingType.Book,
|
||||||
categories: {
|
categories: {
|
||||||
audio: 'audio material',
|
audio: 'audio material',
|
||||||
|
|||||||
@@ -99,15 +99,15 @@ export class SCBuildingMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBuildingCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCBuildingCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
||||||
...SCPlaceWithoutReferencesMeta.getInstance<SCPlaceWithoutReferencesMeta>().fieldTranslations.de,
|
...new SCPlaceWithoutReferencesMeta().fieldTranslations.de,
|
||||||
floors: 'Etagen',
|
floors: 'Etagen',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBuildingCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCBuildingCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
||||||
...SCPlaceWithoutReferencesMeta.getInstance<SCPlaceWithoutReferencesMeta>().fieldTranslations.en,
|
...new SCPlaceWithoutReferencesMeta().fieldTranslations.en,
|
||||||
floors: 'floors',
|
floors: 'floors',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -117,9 +117,9 @@ export class SCBuildingMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBuildingCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCBuildingCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
||||||
...SCPlaceWithoutReferencesMeta.getInstance<SCPlaceWithoutReferencesMeta>().fieldValueTranslations.de,
|
...new SCPlaceWithoutReferencesMeta().fieldValueTranslations.de,
|
||||||
categories: {
|
categories: {
|
||||||
'cafe': 'Café',
|
'cafe': 'Café',
|
||||||
'canteen': 'Kantine',
|
'canteen': 'Kantine',
|
||||||
@@ -133,9 +133,9 @@ export class SCBuildingMeta
|
|||||||
type: 'Gebäude',
|
type: 'Gebäude',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBuildingCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCBuildingCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
||||||
...SCPlaceWithoutReferencesMeta.getInstance<SCPlaceWithoutReferencesMeta>().fieldValueTranslations.en,
|
...new SCPlaceWithoutReferencesMeta().fieldValueTranslations.en,
|
||||||
type: SCThingType.Building,
|
type: SCThingType.Building,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ export class SCCatalogMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCCatalogCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCCatalogCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
||||||
academicTerm: 'Semester',
|
academicTerm: 'Semester',
|
||||||
level: 'Ebene',
|
level: 'Ebene',
|
||||||
@@ -97,7 +97,7 @@ export class SCCatalogMeta
|
|||||||
superCatalogs: 'übergeordnete Verzeichnisse',
|
superCatalogs: 'übergeordnete Verzeichnisse',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCCatalogCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCCatalogCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
||||||
academicTerm: 'academic term',
|
academicTerm: 'academic term',
|
||||||
level: 'level',
|
level: 'level',
|
||||||
@@ -111,7 +111,7 @@ export class SCCatalogMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCCatalogCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCCatalogCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
||||||
categories: {
|
categories: {
|
||||||
'university events': 'Universitätsveranstaltung',
|
'university events': 'Universitätsveranstaltung',
|
||||||
@@ -119,7 +119,7 @@ export class SCCatalogMeta
|
|||||||
type: 'Verzeichnis',
|
type: 'Verzeichnis',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCCatalogCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCCatalogCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
||||||
type: SCThingType.Catalog,
|
type: SCThingType.Catalog,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ export class SCContactPointMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
|
...new SCThingMeta().fieldTranslations.de,
|
||||||
areaServed: 'Arbeitsraum',
|
areaServed: 'Arbeitsraum',
|
||||||
email: 'E-Mail-Addresse',
|
email: 'E-Mail-Addresse',
|
||||||
faxNumber: 'Faxnummer',
|
faxNumber: 'Faxnummer',
|
||||||
@@ -110,7 +110,7 @@ export class SCContactPointMeta
|
|||||||
url: 'Link',
|
url: 'Link',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
|
...new SCThingMeta().fieldTranslations.en,
|
||||||
areaServed: 'location',
|
areaServed: 'location',
|
||||||
email: 'email address',
|
email: 'email address',
|
||||||
faxNumber: 'fax number',
|
faxNumber: 'fax number',
|
||||||
@@ -125,11 +125,11 @@ export class SCContactPointMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
|
...new SCThingMeta().fieldValueTranslations.de,
|
||||||
type: 'Kontaktinformation',
|
type: 'Kontaktinformation',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
|
...new SCThingMeta().fieldValueTranslations.en,
|
||||||
type: SCThingType.ContactPoint,
|
type: SCThingType.ContactPoint,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -26,119 +26,113 @@ 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
|
||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCAcademicDegreeMeta.getInstance<SCAcademicDegreeMeta>()
|
...new SCAcademicDegreeMeta()
|
||||||
.fieldTranslations.de,
|
.fieldTranslations.de,
|
||||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
|
||||||
.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',
|
||||||
timeMode: 'Zeitmodell',
|
timeMode: 'Zeitmodell',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCAcademicDegreeMeta.getInstance<SCAcademicDegreeMeta>()
|
...new SCAcademicDegreeMeta()
|
||||||
.fieldTranslations.en,
|
.fieldTranslations.en,
|
||||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
|
||||||
.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',
|
||||||
@@ -151,7 +145,7 @@ export class SCCourseOfStudiesMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCAcademicDegreeMeta.getInstance().fieldValueTranslations.de,
|
...new SCAcademicDegreeMeta().fieldValueTranslations.de,
|
||||||
modes: {
|
modes: {
|
||||||
combination: 'Kombinationsstudiengang',
|
combination: 'Kombinationsstudiengang',
|
||||||
'double-degree': 'Doppelstudium',
|
'double-degree': 'Doppelstudium',
|
||||||
@@ -165,32 +159,32 @@ export class SCCourseOfStudiesMeta
|
|||||||
type: 'Studiengang',
|
type: 'Studiengang',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCAcademicDegreeMeta.getInstance().fieldValueTranslations.en,
|
...new SCAcademicDegreeMeta().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' ;
|
||||||
@@ -123,9 +123,9 @@ export class SCDateSeriesMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations
|
...new SCThingInPlaceMeta().fieldTranslations
|
||||||
.de,
|
.de,
|
||||||
...SCThingThatCanBeOfferedMeta.getInstance<SCSportCoursePriceGroup>()
|
...new SCThingThatCanBeOfferedMeta<SCSportCoursePriceGroup>()
|
||||||
.fieldTranslations.de,
|
.fieldTranslations.de,
|
||||||
dates: 'Einzeltermine',
|
dates: 'Einzeltermine',
|
||||||
duration: 'Dauer',
|
duration: 'Dauer',
|
||||||
@@ -135,9 +135,9 @@ export class SCDateSeriesMeta
|
|||||||
performers: 'Vortragende',
|
performers: 'Vortragende',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations
|
...new SCThingInPlaceMeta().fieldTranslations
|
||||||
.en,
|
.en,
|
||||||
...SCThingThatCanBeOfferedMeta.getInstance<SCSportCoursePriceGroup>()
|
...new SCThingThatCanBeOfferedMeta<SCSportCoursePriceGroup>()
|
||||||
.fieldTranslations.en,
|
.fieldTranslations.en,
|
||||||
dates: 'dates',
|
dates: 'dates',
|
||||||
duration: 'duration',
|
duration: 'duration',
|
||||||
@@ -153,16 +153,16 @@ export class SCDateSeriesMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>()
|
...new SCThingInPlaceMeta()
|
||||||
.fieldValueTranslations.de,
|
.fieldValueTranslations.de,
|
||||||
...SCThingThatCanBeOfferedMeta.getInstance<SCSportCoursePriceGroup>()
|
...new SCThingThatCanBeOfferedMeta<SCSportCoursePriceGroup>()
|
||||||
.fieldValueTranslations.de,
|
.fieldValueTranslations.de,
|
||||||
type: 'Terminserie',
|
type: 'Terminserie',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>()
|
...new SCThingInPlaceMeta()
|
||||||
.fieldValueTranslations.en,
|
.fieldValueTranslations.en,
|
||||||
...SCThingThatCanBeOfferedMeta.getInstance<SCSportCoursePriceGroup>()
|
...new SCThingThatCanBeOfferedMeta<SCSportCoursePriceGroup>()
|
||||||
.fieldValueTranslations.en,
|
.fieldValueTranslations.en,
|
||||||
type: SCThingType.DateSeries,
|
type: SCThingType.DateSeries,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -73,14 +73,14 @@ export class SCDiffMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
|
...new SCThingMeta().fieldTranslations.de,
|
||||||
action: 'Aktion',
|
action: 'Aktion',
|
||||||
changes: 'Änderungen',
|
changes: 'Änderungen',
|
||||||
dateCreated: 'Erstellungsdatum',
|
dateCreated: 'Erstellungsdatum',
|
||||||
object: 'Objekt',
|
object: 'Objekt',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
|
...new SCThingMeta().fieldTranslations.en,
|
||||||
action: 'action',
|
action: 'action',
|
||||||
changes: 'changes',
|
changes: 'changes',
|
||||||
dateCreated: 'date created',
|
dateCreated: 'date created',
|
||||||
@@ -93,7 +93,7 @@ export class SCDiffMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance().fieldValueTranslations.de,
|
...new SCThingMeta().fieldValueTranslations.de,
|
||||||
action: {
|
action: {
|
||||||
'changed': 'geändert',
|
'changed': 'geändert',
|
||||||
'removed': 'gelöscht',
|
'removed': 'gelöscht',
|
||||||
@@ -101,7 +101,7 @@ export class SCDiffMeta
|
|||||||
type: 'Unterschied',
|
type: 'Unterschied',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance().fieldValueTranslations.en,
|
...new SCThingMeta().fieldValueTranslations.en,
|
||||||
type: SCThingType.Diff,
|
type: SCThingType.Diff,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -202,9 +202,9 @@ export class SCDishMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCDishCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCDishCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
||||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
|
||||||
.fieldTranslations.de,
|
.fieldTranslations.de,
|
||||||
additives: 'Zusatzstoffe',
|
additives: 'Zusatzstoffe',
|
||||||
characteristics: 'Merkmale',
|
characteristics: 'Merkmale',
|
||||||
@@ -212,9 +212,9 @@ export class SCDishMeta
|
|||||||
nutrition: 'Nährwertangaben',
|
nutrition: 'Nährwertangaben',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCDishCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCDishCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
||||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
|
||||||
.fieldTranslations.en,
|
.fieldTranslations.en,
|
||||||
additives: 'additives',
|
additives: 'additives',
|
||||||
characteristics: 'characteristics',
|
characteristics: 'characteristics',
|
||||||
@@ -228,9 +228,9 @@ export class SCDishMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCDishCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCDishCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
||||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
|
||||||
.fieldValueTranslations.de,
|
.fieldValueTranslations.de,
|
||||||
categories: {
|
categories: {
|
||||||
appetizer: 'Vorspeise',
|
appetizer: 'Vorspeise',
|
||||||
@@ -243,9 +243,9 @@ export class SCDishMeta
|
|||||||
type: 'Essen',
|
type: 'Essen',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCDishCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCDishCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
||||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
|
||||||
.fieldValueTranslations.en,
|
.fieldValueTranslations.en,
|
||||||
type: SCThingType.Dish,
|
type: SCThingType.Dish,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -114,13 +114,13 @@ export class SCFloorMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations
|
...new SCThingInPlaceMeta().fieldTranslations
|
||||||
.de,
|
.de,
|
||||||
floorName: 'Etagenbezeichnung',
|
floorName: 'Etagenbezeichnung',
|
||||||
plan: 'Grundriss',
|
plan: 'Grundriss',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations
|
...new SCThingInPlaceMeta().fieldTranslations
|
||||||
.en,
|
.en,
|
||||||
floorName: 'floor name',
|
floorName: 'floor name',
|
||||||
plan: 'plan',
|
plan: 'plan',
|
||||||
@@ -132,12 +132,12 @@ export class SCFloorMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>()
|
...new SCThingInPlaceMeta()
|
||||||
.fieldValueTranslations.de,
|
.fieldValueTranslations.de,
|
||||||
type: 'Etage',
|
type: 'Etage',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>()
|
...new SCThingInPlaceMeta()
|
||||||
.fieldValueTranslations.en,
|
.fieldValueTranslations.en,
|
||||||
type: SCThingType.Floor,
|
type: SCThingType.Floor,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -130,9 +130,8 @@ export class SCMessageMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations
|
...new SCCreativeWorkMeta().fieldTranslations.de,
|
||||||
.de,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCMessageCategories,
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCMessageCategories,
|
|
||||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
||||||
audienceOrganizations: 'Zielgruppenorganisationen',
|
audienceOrganizations: 'Zielgruppenorganisationen',
|
||||||
audiences: 'Zielgruppen',
|
audiences: 'Zielgruppen',
|
||||||
@@ -141,9 +140,8 @@ export class SCMessageMeta
|
|||||||
sequenceIndex: 'Sequenzindex',
|
sequenceIndex: 'Sequenzindex',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations
|
...new SCCreativeWorkMeta().fieldTranslations.en,
|
||||||
.en,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCMessageCategories,
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCMessageCategories,
|
|
||||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
||||||
audienceOrganizations: 'audience organizations',
|
audienceOrganizations: 'audience organizations',
|
||||||
audiences: 'audiences',
|
audiences: 'audiences',
|
||||||
@@ -158,8 +156,9 @@ export class SCMessageMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
...new SCCreativeWorkMeta().fieldValueTranslations.de,
|
||||||
.fieldValueTranslations.de,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCMessageCategories,
|
||||||
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
||||||
audiences: {
|
audiences: {
|
||||||
employees: 'Angestellte',
|
employees: 'Angestellte',
|
||||||
guests: 'Gäste',
|
guests: 'Gäste',
|
||||||
@@ -171,8 +170,9 @@ export class SCMessageMeta
|
|||||||
type: 'Nachricht',
|
type: 'Nachricht',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
...new SCCreativeWorkMeta().fieldValueTranslations.en,
|
||||||
.fieldValueTranslations.en,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCMessageCategories,
|
||||||
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
||||||
type: SCThingType.Message,
|
type: SCThingType.Message,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -57,11 +57,11 @@ export class SCOrganizationMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations.de,
|
...new SCThingInPlaceMeta().fieldTranslations.de,
|
||||||
contactPoints: 'Kontaktinformationen',
|
contactPoints: 'Kontaktinformationen',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations.en,
|
...new SCThingInPlaceMeta().fieldTranslations.en,
|
||||||
contactPoints: 'contact details',
|
contactPoints: 'contact details',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -71,11 +71,11 @@ export class SCOrganizationMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldValueTranslations.de,
|
...new SCThingInPlaceMeta().fieldValueTranslations.de,
|
||||||
type: 'Einrichtung',
|
type: 'Einrichtung',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldValueTranslations.en,
|
...new SCThingInPlaceMeta().fieldValueTranslations.en,
|
||||||
type: SCThingType.Organization,
|
type: SCThingType.Organization,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import {
|
|||||||
SCCreativeWorkWithoutReferences,
|
SCCreativeWorkWithoutReferences,
|
||||||
} from './abstract/creative-work';
|
} from './abstract/creative-work';
|
||||||
import {SCThingMeta, SCThingType} from './abstract/thing';
|
import {SCThingMeta, SCThingType} from './abstract/thing';
|
||||||
|
import {SCAcademicPriceGroup, SCThingThatCanBeOffered, SCThingThatCanBeOfferedMeta, SCThingThatCanBeOfferedTranslatableProperties, SCThingThatCanBeOfferedWithoutReferences} from './abstract/thing-that-can-be-offered';
|
||||||
import {
|
import {
|
||||||
SCThingWithCategoriesSpecificValues,
|
SCThingWithCategoriesSpecificValues,
|
||||||
SCThingWithCategoriesTranslatableProperties,
|
SCThingWithCategoriesTranslatableProperties,
|
||||||
@@ -37,6 +38,7 @@ export type SCPeriodicalCategories = 'journal' | 'electronic';
|
|||||||
*/
|
*/
|
||||||
export interface SCPeriodicalWithoutReferences
|
export interface SCPeriodicalWithoutReferences
|
||||||
extends SCCreativeWorkWithoutReferences,
|
extends SCCreativeWorkWithoutReferences,
|
||||||
|
SCThingThatCanBeOfferedWithoutReferences,
|
||||||
SCThingWithCategoriesWithoutReferences<SCPeriodicalCategories, SCThingWithCategoriesSpecificValues> {
|
SCThingWithCategoriesWithoutReferences<SCPeriodicalCategories, SCThingWithCategoriesSpecificValues> {
|
||||||
/**
|
/**
|
||||||
* Categories of a periodical
|
* Categories of a periodical
|
||||||
@@ -68,7 +70,9 @@ export interface SCPeriodicalWithoutReferences
|
|||||||
* @indexable
|
* @indexable
|
||||||
*/
|
*/
|
||||||
export interface SCPeriodical
|
export interface SCPeriodical
|
||||||
extends SCCreativeWork, SCPeriodicalWithoutReferences {
|
extends SCCreativeWork,
|
||||||
|
SCThingThatCanBeOffered<SCAcademicPriceGroup>,
|
||||||
|
SCPeriodicalWithoutReferences {
|
||||||
/**
|
/**
|
||||||
* Translated properties of a periodical
|
* Translated properties of a periodical
|
||||||
*/
|
*/
|
||||||
@@ -84,7 +88,9 @@ export interface SCPeriodical
|
|||||||
* Translatable properties of a periodical
|
* Translatable properties of a periodical
|
||||||
*/
|
*/
|
||||||
export interface SCPeriodicalTranslatableFields
|
export interface SCPeriodicalTranslatableFields
|
||||||
extends SCThingWithCategoriesTranslatableProperties, SCCreativeWorkTranslatableProperties {
|
extends SCThingWithCategoriesTranslatableProperties,
|
||||||
|
SCThingThatCanBeOfferedTranslatableProperties,
|
||||||
|
SCCreativeWorkTranslatableProperties {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -96,16 +102,18 @@ export class SCPeriodicalMeta extends SCThingMeta implements SCMetaTranslations<
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations.de,
|
...new SCCreativeWorkMeta().fieldTranslations.de,
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCPeriodicalCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCPeriodicalCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
||||||
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldTranslations.de,
|
||||||
categories: 'Format',
|
categories: 'Format',
|
||||||
ISSNs: 'ISSN',
|
ISSNs: 'ISSN',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations.en,
|
...new SCCreativeWorkMeta().fieldTranslations.en,
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCPeriodicalCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCPeriodicalCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
||||||
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldTranslations.en,
|
||||||
categories: 'format',
|
categories: 'format',
|
||||||
ISSNs: 'ISSN',
|
ISSNs: 'ISSN',
|
||||||
},
|
},
|
||||||
@@ -116,8 +124,10 @@ export class SCPeriodicalMeta extends SCThingMeta implements SCMetaTranslations<
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
...new SCCreativeWorkMeta().fieldValueTranslations.de,
|
||||||
.fieldValueTranslations.de,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCPeriodicalCategories,
|
||||||
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
||||||
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldValueTranslations.de,
|
||||||
type: 'Periodikum',
|
type: 'Periodikum',
|
||||||
categories: {
|
categories: {
|
||||||
electronic: 'E-Journal',
|
electronic: 'E-Journal',
|
||||||
@@ -125,8 +135,10 @@ export class SCPeriodicalMeta extends SCThingMeta implements SCMetaTranslations<
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
...new SCCreativeWorkMeta().fieldValueTranslations.en,
|
||||||
.fieldValueTranslations.en,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCPeriodicalCategories,
|
||||||
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
||||||
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldValueTranslations.en,
|
||||||
type: 'periodical',
|
type: 'periodical',
|
||||||
categories: {
|
categories: {
|
||||||
electronic: 'E-Journal',
|
electronic: 'E-Journal',
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ export class SCPersonMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
|
...new SCThingMeta().fieldTranslations.de,
|
||||||
additionalName: 'Zusatzname',
|
additionalName: 'Zusatzname',
|
||||||
affiliations: 'Zugehörigkeiten',
|
affiliations: 'Zugehörigkeiten',
|
||||||
birthDate: 'Geburtsdatum',
|
birthDate: 'Geburtsdatum',
|
||||||
@@ -192,7 +192,7 @@ export class SCPersonMeta
|
|||||||
workLocations: 'Arbeitsstandorte',
|
workLocations: 'Arbeitsstandorte',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
|
...new SCThingMeta().fieldTranslations.en,
|
||||||
additionalName: 'additional name',
|
additionalName: 'additional name',
|
||||||
affiliations: 'affiliations',
|
affiliations: 'affiliations',
|
||||||
birthDate: 'birth date',
|
birthDate: 'birth date',
|
||||||
@@ -217,7 +217,7 @@ export class SCPersonMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
|
...new SCThingMeta().fieldValueTranslations.de,
|
||||||
gender: {
|
gender: {
|
||||||
'female': 'weiblich',
|
'female': 'weiblich',
|
||||||
'inter': 'divers',
|
'inter': 'divers',
|
||||||
@@ -227,7 +227,7 @@ export class SCPersonMeta
|
|||||||
type: 'Person',
|
type: 'Person',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
|
...new SCThingMeta().fieldValueTranslations.en,
|
||||||
type: SCThingType.Person,
|
type: SCThingType.Person,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -82,17 +82,17 @@ export class SCPointOfInterestMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCPointOfInterestCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCPointOfInterestCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
||||||
...SCPlaceWithoutReferencesMeta.getInstance<SCPlaceWithoutReferencesMeta>().fieldTranslations.de,
|
...new SCPlaceWithoutReferencesMeta().fieldTranslations.de,
|
||||||
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations
|
...new SCThingInPlaceMeta().fieldTranslations
|
||||||
.de,
|
.de,
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCPointOfInterestCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCPointOfInterestCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
||||||
...SCPlaceWithoutReferencesMeta.getInstance<SCPlaceWithoutReferencesMeta>().fieldTranslations.en,
|
...new SCPlaceWithoutReferencesMeta().fieldTranslations.en,
|
||||||
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations
|
...new SCThingInPlaceMeta().fieldTranslations
|
||||||
.en,
|
.en,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -102,9 +102,9 @@ export class SCPointOfInterestMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCPointOfInterestCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCPointOfInterestCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
||||||
...SCPlaceWithoutReferencesMeta.getInstance<SCPlaceWithoutReferencesMeta>().fieldValueTranslations.de,
|
...new SCPlaceWithoutReferencesMeta().fieldValueTranslations.de,
|
||||||
categories: {
|
categories: {
|
||||||
'card charger': 'Kartenaufwerter',
|
'card charger': 'Kartenaufwerter',
|
||||||
'computer': 'Computer',
|
'computer': 'Computer',
|
||||||
@@ -115,9 +115,9 @@ export class SCPointOfInterestMeta
|
|||||||
type: 'Sonderziel',
|
type: 'Sonderziel',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCPointOfInterestCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCPointOfInterestCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
||||||
...SCPlaceWithoutReferencesMeta.getInstance<SCPlaceWithoutReferencesMeta>().fieldValueTranslations.en,
|
...new SCPlaceWithoutReferencesMeta().fieldValueTranslations.en,
|
||||||
type: SCThingType.PointOfInterest,
|
type: SCThingType.PointOfInterest,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -78,12 +78,12 @@ export class SCPublicationEventMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCEventMeta.getInstance<SCEventMeta>().fieldTranslations.de,
|
...new SCEventMeta().fieldTranslations.de,
|
||||||
locations: 'Erscheinungsorte',
|
locations: 'Erscheinungsorte',
|
||||||
publisher: 'Verlag',
|
publisher: 'Verlag',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCEventMeta.getInstance<SCEventMeta>().fieldTranslations.en,
|
...new SCEventMeta().fieldTranslations.en,
|
||||||
locations: 'places of publication',
|
locations: 'places of publication',
|
||||||
publisher: 'publisher',
|
publisher: 'publisher',
|
||||||
},
|
},
|
||||||
@@ -94,11 +94,11 @@ export class SCPublicationEventMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCEventMeta.getInstance<SCEventMeta>().fieldValueTranslations.de,
|
...new SCEventMeta().fieldValueTranslations.de,
|
||||||
type: 'Veröffentlichung',
|
type: 'Veröffentlichung',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCEventMeta.getInstance<SCEventMeta>().fieldValueTranslations.en,
|
...new SCEventMeta().fieldValueTranslations.en,
|
||||||
type: 'publication event',
|
type: 'publication event',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -127,23 +127,23 @@ export class SCRoomMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCPlaceWithoutReferencesMeta.getInstance<SCPlaceWithoutReferencesMeta>().fieldTranslations.de,
|
...new SCPlaceWithoutReferencesMeta().fieldTranslations.de,
|
||||||
...SCThingThatAcceptsPaymentsWithoutReferencesMeta.getInstance<SCThingThatAcceptsPaymentsWithoutReferencesMeta>()
|
...new SCThingThatAcceptsPaymentsWithoutReferencesMeta()
|
||||||
.fieldTranslations.de,
|
.fieldTranslations.de,
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCRoomCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCRoomCategories,
|
||||||
SCRoomSpecificValues>().fieldTranslations.de,
|
SCRoomSpecificValues>().fieldTranslations.de,
|
||||||
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations
|
...new SCThingInPlaceMeta().fieldTranslations
|
||||||
.de,
|
.de,
|
||||||
floorName: 'Etagenbezeichnung',
|
floorName: 'Etagenbezeichnung',
|
||||||
inventory: 'Bestand',
|
inventory: 'Bestand',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCPlaceWithoutReferencesMeta.getInstance<SCPlaceWithoutReferencesMeta>().fieldTranslations.en,
|
...new SCPlaceWithoutReferencesMeta().fieldTranslations.en,
|
||||||
...SCThingThatAcceptsPaymentsWithoutReferencesMeta.getInstance<SCThingThatAcceptsPaymentsWithoutReferencesMeta>()
|
...new SCThingThatAcceptsPaymentsWithoutReferencesMeta()
|
||||||
.fieldTranslations.en,
|
.fieldTranslations.en,
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCRoomCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCRoomCategories,
|
||||||
SCRoomSpecificValues>().fieldTranslations.en,
|
SCRoomSpecificValues>().fieldTranslations.en,
|
||||||
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations
|
...new SCThingInPlaceMeta().fieldTranslations
|
||||||
.en,
|
.en,
|
||||||
floorName: 'floor name',
|
floorName: 'floor name',
|
||||||
inventory: 'inventory',
|
inventory: 'inventory',
|
||||||
@@ -155,12 +155,12 @@ export class SCRoomMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCPlaceWithoutReferencesMeta.getInstance<SCPlaceWithoutReferencesMeta>().fieldValueTranslations.de,
|
...new SCPlaceWithoutReferencesMeta().fieldValueTranslations.de,
|
||||||
...SCThingThatAcceptsPaymentsWithoutReferencesMeta.getInstance<SCThingThatAcceptsPaymentsWithoutReferencesMeta>()
|
...new SCThingThatAcceptsPaymentsWithoutReferencesMeta()
|
||||||
.fieldValueTranslations.de,
|
.fieldValueTranslations.de,
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCRoomCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCRoomCategories,
|
||||||
SCRoomSpecificValues>().fieldValueTranslations.de,
|
SCRoomSpecificValues>().fieldValueTranslations.de,
|
||||||
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>()
|
...new SCThingInPlaceMeta()
|
||||||
.fieldValueTranslations.de,
|
.fieldValueTranslations.de,
|
||||||
categories: {
|
categories: {
|
||||||
'cafe': 'Café',
|
'cafe': 'Café',
|
||||||
@@ -180,12 +180,12 @@ export class SCRoomMeta
|
|||||||
type: 'Raum',
|
type: 'Raum',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCPlaceWithoutReferencesMeta.getInstance<SCPlaceWithoutReferencesMeta>().fieldValueTranslations.en,
|
...new SCPlaceWithoutReferencesMeta().fieldValueTranslations.en,
|
||||||
...SCThingThatAcceptsPaymentsWithoutReferencesMeta.getInstance<SCThingThatAcceptsPaymentsWithoutReferencesMeta>()
|
...new SCThingThatAcceptsPaymentsWithoutReferencesMeta()
|
||||||
.fieldValueTranslations.en,
|
.fieldValueTranslations.en,
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCRoomCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCRoomCategories,
|
||||||
SCRoomSpecificValues>().fieldValueTranslations.en,
|
SCRoomSpecificValues>().fieldValueTranslations.en,
|
||||||
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>()
|
...new SCThingInPlaceMeta()
|
||||||
.fieldValueTranslations.en,
|
.fieldValueTranslations.en,
|
||||||
type: SCThingType.Room,
|
type: SCThingType.Room,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ export class SCSemesterMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCAcademicTermWithoutReferencesMeta.getInstance<SCAcademicTermWithoutReferencesMeta>().fieldTranslations.de,
|
...new SCAcademicTermWithoutReferencesMeta().fieldTranslations.de,
|
||||||
acronym: 'Abkürzung',
|
acronym: 'Abkürzung',
|
||||||
endDate: 'Ende',
|
endDate: 'Ende',
|
||||||
eventsEndDate: 'Vorlesungsschluss',
|
eventsEndDate: 'Vorlesungsschluss',
|
||||||
@@ -73,7 +73,7 @@ export class SCSemesterMeta
|
|||||||
startDate: 'Beginn',
|
startDate: 'Beginn',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCAcademicTermWithoutReferencesMeta.getInstance<SCAcademicTermWithoutReferencesMeta>().fieldTranslations.en,
|
...new SCAcademicTermWithoutReferencesMeta().fieldTranslations.en,
|
||||||
acronym: 'acronym',
|
acronym: 'acronym',
|
||||||
endDate: 'end date',
|
endDate: 'end date',
|
||||||
eventsEndDate: 'semester ending',
|
eventsEndDate: 'semester ending',
|
||||||
@@ -87,12 +87,12 @@ export class SCSemesterMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCAcademicTermWithoutReferencesMeta.getInstance<SCAcademicTermWithoutReferencesMeta>()
|
...new SCAcademicTermWithoutReferencesMeta()
|
||||||
.fieldValueTranslations.de,
|
.fieldValueTranslations.de,
|
||||||
type: 'Semester',
|
type: 'Semester',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCAcademicTermWithoutReferencesMeta.getInstance<SCAcademicTermWithoutReferencesMeta>()
|
...new SCAcademicTermWithoutReferencesMeta()
|
||||||
.fieldValueTranslations.en,
|
.fieldValueTranslations.en,
|
||||||
type: SCThingType.Semester,
|
type: SCThingType.Semester,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ export class SCSettingMeta extends SCThingMeta implements SCMetaTranslations<SCS
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCSettingCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCSettingCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
||||||
defaultValue: 'Standard Wert',
|
defaultValue: 'Standard Wert',
|
||||||
inputType: 'Eingabetyp',
|
inputType: 'Eingabetyp',
|
||||||
@@ -138,7 +138,7 @@ export class SCSettingMeta extends SCThingMeta implements SCMetaTranslations<SCS
|
|||||||
values: 'Werte',
|
values: 'Werte',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCSettingCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCSettingCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
||||||
defaultValue: 'default value',
|
defaultValue: 'default value',
|
||||||
inputType: 'input type',
|
inputType: 'input type',
|
||||||
@@ -153,7 +153,7 @@ export class SCSettingMeta extends SCThingMeta implements SCMetaTranslations<SCS
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCSettingCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCSettingCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
||||||
categories: {
|
categories: {
|
||||||
credentials: 'Anmeldedaten',
|
credentials: 'Anmeldedaten',
|
||||||
@@ -171,7 +171,7 @@ export class SCSettingMeta extends SCThingMeta implements SCMetaTranslations<SCS
|
|||||||
type: 'Einstellung',
|
type: 'Einstellung',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCSettingCategories,
|
...new SCThingWithCategoriesWithoutReferencesMeta<SCSettingCategories,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
||||||
type: SCThingType.Setting,
|
type: SCThingType.Setting,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -52,10 +52,10 @@ export class SCSportCourseMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCEventMeta.getInstance<SCEventMeta>().fieldTranslations.de,
|
...new SCEventMeta().fieldTranslations.de,
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCEventMeta.getInstance<SCEventMeta>().fieldTranslations.en,
|
...new SCEventMeta().fieldTranslations.en,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -64,11 +64,11 @@ export class SCSportCourseMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCEventMeta.getInstance<SCEventMeta>().fieldValueTranslations.de,
|
...new SCEventMeta().fieldValueTranslations.de,
|
||||||
type: 'Sportkurs',
|
type: 'Sportkurs',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCEventMeta.getInstance<SCEventMeta>().fieldValueTranslations.en,
|
...new SCEventMeta().fieldValueTranslations.en,
|
||||||
type: SCThingType.SportCourse,
|
type: SCThingType.SportCourse,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -150,8 +150,8 @@ export class SCStudyModuleMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance().fieldTranslations.de,
|
...new SCThingMeta().fieldTranslations.de,
|
||||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
|
||||||
.fieldTranslations.de,
|
.fieldTranslations.de,
|
||||||
academicEvents: 'Veranstaltungen',
|
academicEvents: 'Veranstaltungen',
|
||||||
ects: 'ECTS-Punkte',
|
ects: 'ECTS-Punkte',
|
||||||
@@ -164,8 +164,8 @@ export class SCStudyModuleMeta
|
|||||||
secretary: 'Sekretariat',
|
secretary: 'Sekretariat',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance().fieldTranslations.en,
|
...new SCThingMeta().fieldTranslations.en,
|
||||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
|
||||||
.fieldTranslations.en,
|
.fieldTranslations.en,
|
||||||
academicEvents: 'academic events',
|
academicEvents: 'academic events',
|
||||||
ects: 'ECTS points',
|
ects: 'ECTS points',
|
||||||
@@ -184,8 +184,8 @@ export class SCStudyModuleMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
|
...new SCThingMeta().fieldValueTranslations.de,
|
||||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
|
||||||
.fieldValueTranslations.de,
|
.fieldValueTranslations.de,
|
||||||
necessity: {
|
necessity: {
|
||||||
'elective': 'Wahlfach',
|
'elective': 'Wahlfach',
|
||||||
@@ -195,8 +195,8 @@ export class SCStudyModuleMeta
|
|||||||
type: 'Studiengangmodul',
|
type: 'Studiengangmodul',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
|
...new SCThingMeta().fieldValueTranslations.en,
|
||||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
|
||||||
.fieldValueTranslations.en,
|
.fieldValueTranslations.en,
|
||||||
type: SCThingType.StudyModule,
|
type: SCThingType.StudyModule,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -70,14 +70,14 @@ export class SCTicketMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations
|
...new SCThingInPlaceMeta().fieldTranslations
|
||||||
.de,
|
.de,
|
||||||
approxWaitingTime: 'ungefähre Wartezeit',
|
approxWaitingTime: 'ungefähre Wartezeit',
|
||||||
currentTicketNumber: 'aktuelle Ticketnummer',
|
currentTicketNumber: 'aktuelle Ticketnummer',
|
||||||
serviceType: 'Service Kategorie',
|
serviceType: 'Service Kategorie',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations
|
...new SCThingInPlaceMeta().fieldTranslations
|
||||||
.en,
|
.en,
|
||||||
approxWaitingTime: 'approximate waiting time',
|
approxWaitingTime: 'approximate waiting time',
|
||||||
currentTicketNumber: 'current ticket number',
|
currentTicketNumber: 'current ticket number',
|
||||||
@@ -90,12 +90,12 @@ export class SCTicketMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>()
|
...new SCThingInPlaceMeta()
|
||||||
.fieldValueTranslations.de,
|
.fieldValueTranslations.de,
|
||||||
type: 'Ticket',
|
type: 'Ticket',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>()
|
...new SCThingInPlaceMeta()
|
||||||
.fieldValueTranslations.en,
|
.fieldValueTranslations.en,
|
||||||
type: SCThingType.Ticket,
|
type: SCThingType.Ticket,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -88,14 +88,14 @@ export class SCToDoMeta extends SCThingMeta implements SCMetaTranslations<SCToDo
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<string,
|
...new SCThingWithCategoriesWithoutReferencesMeta<string,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
||||||
done: 'Erledigt',
|
done: 'Erledigt',
|
||||||
dueDate: 'Fälligkeitsdatum',
|
dueDate: 'Fälligkeitsdatum',
|
||||||
priority: 'Priorität',
|
priority: 'Priorität',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<string,
|
...new SCThingWithCategoriesWithoutReferencesMeta<string,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
||||||
done: 'done',
|
done: 'done',
|
||||||
dueDate: 'due date',
|
dueDate: 'due date',
|
||||||
@@ -108,12 +108,12 @@ export class SCToDoMeta extends SCThingMeta implements SCMetaTranslations<SCToDo
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<string,
|
...new SCThingWithCategoriesWithoutReferencesMeta<string,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
||||||
type: 'ToDo',
|
type: 'ToDo',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<string,
|
...new SCThingWithCategoriesWithoutReferencesMeta<string,
|
||||||
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
||||||
type: SCThingType.ToDo,
|
type: SCThingType.ToDo,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -65,12 +65,12 @@ export class SCTourMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
|
...new SCThingMeta().fieldTranslations.de,
|
||||||
init: 'Initiales Skript',
|
init: 'Initiales Skript',
|
||||||
steps: 'Schritte',
|
steps: 'Schritte',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
|
...new SCThingMeta().fieldTranslations.en,
|
||||||
init: 'initial script',
|
init: 'initial script',
|
||||||
steps: 'steps',
|
steps: 'steps',
|
||||||
},
|
},
|
||||||
@@ -81,11 +81,11 @@ export class SCTourMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
|
...new SCThingMeta().fieldValueTranslations.de,
|
||||||
type: 'Tour',
|
type: 'Tour',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
|
...new SCThingMeta().fieldValueTranslations.en,
|
||||||
type: SCThingType.Tour,
|
type: SCThingType.Tour,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,17 +12,19 @@
|
|||||||
* 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} from '../general/i18n';
|
import {SCLanguage, SCMetaTranslations, SCTranslations} from '../general/i18n';
|
||||||
import {SCISO8601Duration} from '../general/time';
|
import {SCISO8601Duration} from '../general/time';
|
||||||
import {SCCreativeWork, SCCreativeWorkMeta, SCCreativeWorkWithoutReferences} from './abstract/creative-work';
|
import {SCCreativeWork, SCCreativeWorkMeta, SCCreativeWorkTranslatableProperties, SCCreativeWorkWithoutReferences} from './abstract/creative-work';
|
||||||
import {SCThingMeta, SCThingType} from './abstract/thing';
|
import {SCThingMeta, SCThingType} from './abstract/thing';
|
||||||
|
import {SCAcademicPriceGroup, SCThingThatCanBeOffered, SCThingThatCanBeOfferedMeta, SCThingThatCanBeOfferedTranslatableProperties, SCThingThatCanBeOfferedWithoutReferences} from './abstract/thing-that-can-be-offered';
|
||||||
import {SCPersonWithoutReferences} from './person';
|
import {SCPersonWithoutReferences} from './person';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A video without references
|
* A video without references
|
||||||
*/
|
*/
|
||||||
export interface SCVideoWithoutReferences
|
export interface SCVideoWithoutReferences
|
||||||
extends SCCreativeWorkWithoutReferences {
|
extends SCCreativeWorkWithoutReferences,
|
||||||
|
SCThingThatCanBeOfferedWithoutReferences {
|
||||||
/**
|
/**
|
||||||
* The Duration of the Video
|
* The Duration of the Video
|
||||||
*/
|
*/
|
||||||
@@ -52,6 +54,11 @@ export interface SCVideoWithoutReferences
|
|||||||
*/
|
*/
|
||||||
transcript?: string;
|
transcript?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translated fields of a video
|
||||||
|
*/
|
||||||
|
translations?: SCTranslations<SCVideoTranslatableFields>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type of an Video
|
* Type of an Video
|
||||||
*/
|
*/
|
||||||
@@ -123,18 +130,34 @@ export interface SCVideoTrack {
|
|||||||
* @indexable
|
* @indexable
|
||||||
*/
|
*/
|
||||||
export interface SCVideo
|
export interface SCVideo
|
||||||
extends SCCreativeWork, SCVideoWithoutReferences {
|
extends SCCreativeWork,
|
||||||
|
SCThingThatCanBeOffered<SCAcademicPriceGroup>,
|
||||||
|
SCVideoWithoutReferences {
|
||||||
/**
|
/**
|
||||||
* Persons acting in the Video
|
* Persons acting in the Video
|
||||||
*/
|
*/
|
||||||
actors?: SCPersonWithoutReferences[];
|
actors?: SCPersonWithoutReferences[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translated fields of a video
|
||||||
|
*/
|
||||||
|
translations?: SCTranslations<SCVideoTranslatableFields>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type of a video
|
* Type of a video
|
||||||
*/
|
*/
|
||||||
type: SCThingType.Video;
|
type: SCThingType.Video;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translatable properties of a video
|
||||||
|
*/
|
||||||
|
export interface SCVideoTranslatableFields
|
||||||
|
extends SCCreativeWorkTranslatableProperties,
|
||||||
|
SCThingThatCanBeOfferedTranslatableProperties {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Meta information about a video
|
* Meta information about a video
|
||||||
*/
|
*/
|
||||||
@@ -146,8 +169,9 @@ export class SCVideoMeta
|
|||||||
*/
|
*/
|
||||||
fieldTranslations = {
|
fieldTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations
|
...new SCCreativeWorkMeta().fieldTranslations
|
||||||
.de,
|
.de,
|
||||||
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldTranslations.de,
|
||||||
actors: 'Darsteller',
|
actors: 'Darsteller',
|
||||||
duration: 'Dauer',
|
duration: 'Dauer',
|
||||||
sources: 'Quellen',
|
sources: 'Quellen',
|
||||||
@@ -156,8 +180,9 @@ export class SCVideoMeta
|
|||||||
transcript: 'Transkript',
|
transcript: 'Transkript',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations
|
...new SCCreativeWorkMeta().fieldTranslations
|
||||||
.en,
|
.en,
|
||||||
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldTranslations.en,
|
||||||
actors: 'actors',
|
actors: 'actors',
|
||||||
duration: 'duration',
|
duration: 'duration',
|
||||||
sources: 'sources',
|
sources: 'sources',
|
||||||
@@ -172,12 +197,16 @@ export class SCVideoMeta
|
|||||||
*/
|
*/
|
||||||
fieldValueTranslations = {
|
fieldValueTranslations = {
|
||||||
de: {
|
de: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
...new SCCreativeWorkMeta()
|
||||||
|
.fieldValueTranslations.de,
|
||||||
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
|
||||||
.fieldValueTranslations.de,
|
.fieldValueTranslations.de,
|
||||||
type: 'Video',
|
type: 'Video',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
...new SCCreativeWorkMeta()
|
||||||
|
.fieldValueTranslations.en,
|
||||||
|
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
|
||||||
.fieldValueTranslations.en,
|
.fieldValueTranslations.en,
|
||||||
type: SCThingType.Video,
|
type: SCThingType.Video,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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 clone = require('fast-clone');
|
|
||||||
import equal = require('fast-deep-equal/es6');
|
import equal = require('fast-deep-equal/es6');
|
||||||
|
import clone = require('rfdc');
|
||||||
import {Defined, TSOCType} from 'ts-optchain';
|
import {Defined, TSOCType} from 'ts-optchain';
|
||||||
import {SCLanguageCode} from './general/i18n';
|
import {SCLanguageCode} from './general/i18n';
|
||||||
import {isThing} from './guards';
|
import {isThing} from './guards';
|
||||||
@@ -77,6 +77,13 @@ export class SCThingTranslator {
|
|||||||
this.sourceCache = new LRUCache(cacheCapacity);
|
this.sourceCache = new LRUCache(cacheCapacity);
|
||||||
this._language = language;
|
this._language = language;
|
||||||
this.metaClasses = SCClasses;
|
this.metaClasses = SCClasses;
|
||||||
|
|
||||||
|
// Initalize all meta classes once
|
||||||
|
if (typeof (this.metaClasses as any)[Object.keys(this.metaClasses)[0]] === 'function') {
|
||||||
|
for (const metaClass of Object.keys(this.metaClasses)) {
|
||||||
|
(this.metaClasses as any)[metaClass] = new (SCClasses as any)[metaClass]();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -143,7 +150,7 @@ export class SCThingTranslator {
|
|||||||
*/
|
*/
|
||||||
private getMetaClassInstance(thingType: SCThingType): any {
|
private getMetaClassInstance(thingType: SCThingType): any {
|
||||||
if (thingType in this.metaClasses) {
|
if (thingType in this.metaClasses) {
|
||||||
return new (this.metaClasses as any)[thingType]();
|
return this.metaClasses[thingType];
|
||||||
}
|
}
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
@@ -234,7 +241,7 @@ export class SCThingTranslator {
|
|||||||
return cachedInstance as T;
|
return cachedInstance as T;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const translatedInstance = this.translateThingInPlaceDestructively(clone(thing));
|
const translatedInstance = this.translateThingInPlaceDestructively(clone()(thing));
|
||||||
delete translatedInstance.translations;
|
delete translatedInstance.translations;
|
||||||
this.cache.putObject(translatedInstance);
|
this.cache.putObject(translatedInstance);
|
||||||
this.sourceCache.putObject(thing);
|
this.sourceCache.putObject(thing);
|
||||||
@@ -267,7 +274,7 @@ export class SCThingTranslator {
|
|||||||
return this.deeptranslate((objTranslatedFromCache as any)[key]);
|
return this.deeptranslate((objTranslatedFromCache as any)[key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const objTranslated = this.translateThingInPlaceDestructively(clone(obj));
|
const objTranslated = this.translateThingInPlaceDestructively(clone()(obj));
|
||||||
this.cache.putObject(objTranslated);
|
this.cache.putObject(objTranslated);
|
||||||
this.sourceCache.putObject(thing);
|
this.sourceCache.putObject(thing);
|
||||||
|
|
||||||
@@ -281,7 +288,7 @@ 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 type The type whose property names will be translated
|
* @param type The type whose property names will be translated
|
||||||
* @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
|
||||||
*/
|
*/
|
||||||
|
|||||||
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;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
36
test/resources/Assessment.1.json
Normal file
36
test/resources/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/Assessment.2.json
Normal file
51
test/resources/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"
|
||||||
|
}
|
||||||
@@ -16,13 +16,13 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"firstPublished": "2008",
|
"firstPublished": "2008",
|
||||||
"sameAs": "https://hds2test.hebis.de/ubffm/Record/HEB198305427",
|
"sameAs": "https://ubffm.hds.hebis.de/Record/HEB198305427",
|
||||||
"origin": {
|
"origin": {
|
||||||
"indexed": "2018-09-11T12:30:00Z",
|
"indexed": "2018-09-11T12:30:00Z",
|
||||||
"name": "HeBIS HDS",
|
"name": "HeBIS HDS",
|
||||||
"originalId": "HEB198305427",
|
"originalId": "HEB198305427",
|
||||||
"type": "remote",
|
"type": "remote",
|
||||||
"url": "https://hds2test.hebis.de/ubffm/"
|
"url": "https://ubffm.hds.hebis.de"
|
||||||
},
|
},
|
||||||
"isPartOf": {
|
"isPartOf": {
|
||||||
"uid": "bc5e5399-a24c-5c01-9c1b-0c8b83272087",
|
"uid": "bc5e5399-a24c-5c01-9c1b-0c8b83272087",
|
||||||
@@ -16,13 +16,13 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"firstPublished": "2002",
|
"firstPublished": "2002",
|
||||||
"sameAs": "https://hds2test.hebis.de/ubffm/Record/HEB107025590",
|
"sameAs": "https://ubffm.hds.hebis.de/Record/HEB107025590",
|
||||||
"origin": {
|
"origin": {
|
||||||
"indexed": "2018-09-11T12:30:00Z",
|
"indexed": "2018-09-11T12:30:00Z",
|
||||||
"name": "HeBIS HDS",
|
"name": "HeBIS HDS",
|
||||||
"originalId": "HEB107025590",
|
"originalId": "HEB107025590",
|
||||||
"type": "remote",
|
"type": "remote",
|
||||||
"url": "https://hds2test.hebis.de/ubffm/"
|
"url": "https://ubffm.hds.hebis.de"
|
||||||
},
|
},
|
||||||
"isPartOf": {
|
"isPartOf": {
|
||||||
"uid": "f84c1851-042e-542f-ba7a-158b32dfb82f",
|
"uid": "f84c1851-042e-542f-ba7a-158b32dfb82f",
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"firstPublished": "[ca. 1991]",
|
"firstPublished": "[ca. 1991]",
|
||||||
|
"lastPublished": "2000 Q1",
|
||||||
"publications": [
|
"publications": [
|
||||||
{
|
{
|
||||||
"uid": "603a6574-8910-588a-9e83-cd26e6988c74",
|
"uid": "603a6574-8910-588a-9e83-cd26e6988c74",
|
||||||
@@ -27,13 +28,13 @@
|
|||||||
"name": "VDI"
|
"name": "VDI"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"sameAs": "https://hds2test.hebis.de/ubffm/Record/HEB022992618",
|
"sameAs": "https://ubffm.hds.hebis.de/Record/HEB022992618",
|
||||||
"origin": {
|
"origin": {
|
||||||
"indexed": "2018-09-11T12:30:00Z",
|
"indexed": "2018-09-11T12:30:00Z",
|
||||||
"name": "HeBIS HDS",
|
"name": "HeBIS HDS",
|
||||||
"originalId": "HEB022992618",
|
"originalId": "HEB022992618",
|
||||||
"type": "remote",
|
"type": "remote",
|
||||||
"url": "https://hds2test.hebis.de/ubffm/"
|
"url": "https://ubffm.hds.hebis.de"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"schema": "SCBook"
|
"schema": "SCBook"
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
"firstPublished": "2001",
|
"firstPublished": "2001",
|
||||||
"publications": [
|
"publications": [
|
||||||
{
|
{
|
||||||
"uid": "603a6574-8910-588a-9e83-cd26e6988c74",
|
"uid": "6333427c-0725-5398-9a04-11604680dae3",
|
||||||
"type": "publication event",
|
"type": "publication event",
|
||||||
"locations": [
|
"locations": [
|
||||||
"Paris"
|
"Paris"
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
"name": "Belles Lettres"
|
"name": "Belles Lettres"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"sameAs": "https://hds2test.hebis.de/ubffm/Record/HEB102248788",
|
"sameAs": "https://ubffm.hds.hebis.de/Record/HEB102248788",
|
||||||
"ISBNs": [
|
"ISBNs": [
|
||||||
"2251760385"
|
"2251760385"
|
||||||
],
|
],
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
"name": "HeBIS HDS",
|
"name": "HeBIS HDS",
|
||||||
"originalId": "HEB102248788",
|
"originalId": "HEB102248788",
|
||||||
"type": "remote",
|
"type": "remote",
|
||||||
"url": "https://hds2test.hebis.de/ubffm/"
|
"url": "https://ubffm.hds.hebis.de"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"schema": "SCBook"
|
"schema": "SCBook"
|
||||||
@@ -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"
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user