Compare commits

...

52 Commits

Author SHA1 Message Date
Rainer Killinger
8b9bb45868 0.68.0 2022-06-27 16:04:08 +02:00
openstappsbot
77f1f0a5b8 refactor: update all 2022-06-27 15:56:36 +02:00
Rainer Killinger
1015fd24ac docs: update changelog 2022-05-31 16:13:54 +02:00
Rainer Killinger
618a9046bc 0.67.0 2022-05-31 16:13:51 +02:00
Rainer Killinger
c43e2b38e6 refactor: remove SCMetaTranslations singletons 2022-05-31 16:10:41 +02:00
Rainer Killinger
9d0ff36af5 refactor: untangle SCCreativeWork inheritance 2022-05-30 17:00:14 +02:00
Rainer Killinger
31bb7e89ea docs: update changelog 2022-05-27 16:54:09 +02:00
Rainer Killinger
942f04e250 0.66.1 2022-05-27 16:54:06 +02:00
Rainer Killinger
930b574618 refactor: update dependencies 2022-05-27 16:51:08 +02:00
Rainer Killinger
7b88be3a75 refactor: initalize meta classes in translator 2022-05-27 15:21:59 +02:00
Jovan Krunić
5277f7601c docs: update changelog 2022-05-11 13:54:54 +02:00
Jovan Krunić
5241a01b55 0.66.0 2022-05-11 13:54:52 +02:00
484be6a890 feat: add geo filter envelope support 2022-04-28 09:50:44 +02:00
Rainer Killinger
45e0f26391 docs: update changelog 2022-04-04 20:56:06 +02:00
Rainer Killinger
ead47aca19 0.65.1 2022-04-04 20:56:04 +02:00
Rainer Killinger
f9c2414000 docs: adjust typedoc option 'entryPointStrategy' 2022-04-04 20:55:16 +02:00
Rainer Killinger
523de51160 docs: update changelog 2022-04-04 20:47:21 +02:00
Rainer Killinger
d912c03eb0 0.65.0 2022-04-04 20:47:19 +02:00
Rainer Killinger
a638f5447b refactor: update dependencies 2022-04-04 20:42:01 +02:00
Rainer Killinger
cecf95aa46 docs: update changelog 2022-03-21 11:05:27 +01:00
Rainer Killinger
6fd8c5adf3 0.64.0 2022-03-21 11:05:25 +01:00
Rainer Killinger
db24b41d99 test: adjust HDS samples to production version 2022-03-21 11:00:11 +01:00
Rainer Killinger
b1fcd22ab2 refactor: update dependencies 2022-03-17 12:44:59 +01:00
Rainer Killinger
268588fb6f docs: update changelog 2022-01-24 14:47:04 +01:00
Rainer Killinger
d3048a12d8 0.63.0 2022-01-24 14:47:02 +01:00
Rainer Killinger
e14993114f fix: add auth object to index route 2022-01-24 14:45:17 +01:00
Rainer Killinger
4237f6ad60 docs: update changelog 2022-01-21 17:15:16 +01:00
Rainer Killinger
e7c1000bc4 0.62.0 2022-01-21 17:15:14 +01:00
Rainer Killinger
e0adb2332e fix: add missing lastPublished to SCCreativeWork 2022-01-21 17:14:16 +01:00
Rainer Killinger
e5696b23e7 docs: update changelog 2022-01-21 15:07:16 +01:00
Rainer Killinger
659d0974f7 0.61.0 2022-01-21 15:07:14 +01:00
Rainer Killinger
e8304eeeb4 refactor: remove unused auth provider properties 2022-01-21 15:06:11 +01:00
Rainer Killinger
dca9d26c66 docs: update changelog 2022-01-21 12:29:55 +01:00
Rainer Killinger
852e0f5373 0.60.0 2022-01-21 12:29:52 +01:00
Rainer Killinger
26dd531d24 refactor: split up SCUserConfiguration type 2022-01-21 12:22:13 +01:00
Rainer Killinger
52bdf93356 docs: update changelog 2022-01-20 14:20:17 +01:00
Rainer Killinger
7509610145 0.59.0 2022-01-20 14:20:15 +01:00
Rainer Killinger
972cdf392d refactor: make config auth provides be optional 2022-01-20 14:18:50 +01:00
Rainer Killinger
4f758f7d0c docs: update changelog 2022-01-18 15:13:06 +01:00
Rainer Killinger
980e899807 0.58.0 2022-01-18 15:13:04 +01:00
Rainer Killinger
d1c5bb9595 refactor: use SCMap for feature configurations 2022-01-18 15:12:05 +01:00
Rainer Killinger
dc9c0f528f docs: update changelog 2022-01-18 11:06:18 +01:00
Rainer Killinger
66d64e0858 0.57.0 2022-01-18 11:06:16 +01:00
Rainer Killinger
06339786c2 refactor: update dependencies 2022-01-18 11:01:01 +01:00
Rainer Killinger
8ed68481fa refactor: rename urlFragment in routes 2022-01-18 09:50:46 +01:00
Rainer Killinger
e26042957c refactor: remodel features in app config 2022-01-18 09:50:44 +01:00
Rainer Killinger
7553620a5d feat: extend config to describe auth providers 2022-01-18 09:50:00 +01:00
Rainer Killinger
322c001e70 docs: update changelog 2021-12-17 10:35:53 +01:00
Rainer Killinger
830e249ac4 0.56.0 2021-12-17 10:35:50 +01:00
Rainer Killinger
8c9df3ea9a test: adjust testing resources 2021-12-17 10:34:03 +01:00
Rainer Killinger
f85768d32e refactor: update dependencies 2021-12-17 10:33:20 +01:00
Rainer Killinger
580ace368f docs: update changelog 2021-12-15 13:15:12 +01:00
70 changed files with 1753 additions and 1267 deletions

View File

@@ -1,3 +1,83 @@
# [0.67.0](https://gitlab.com/openstapps/core/compare/v0.66.1...v0.67.0) (2022-05-31)
## [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)

1949
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "@openstapps/core",
"version": "0.55.0",
"version": "0.68.0",
"description": "StAppsCore - Generalized model of data",
"keywords": [
"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'",
"check-configuration": "openstapps-configuration",
"compile": "rimraf lib && tsc",
"documentation": "typedoc --name \"@openstapps/core\" --includeVersion --out docs --readme README.md --listInvalidSymbolLinks src",
"documentation": "typedoc --name \"@openstapps/core\" --includeVersion --out docs --readme README.md --listInvalidSymbolLinks --entryPointStrategy expand src",
"pack": "openstapps-core-tools pack",
"postversion": "npm run changelog",
"prepublishOnly": "npm ci && npm run build",
@@ -45,40 +45,40 @@
"Wieland Schöbl"
],
"dependencies": {
"@openstapps/core-tools": "0.27.0",
"@openstapps/core-tools": "0.31.0",
"@types/geojson": "1.0.6",
"@types/json-patch": "0.0.30",
"@types/json-schema": "7.0.9",
"@types/node": "14.18.0",
"fast-clone": "1.5.13",
"@types/json-schema": "7.0.11",
"@types/node": "14.18.21",
"fast-deep-equal": "3.1.3",
"http-status-codes": "2.1.4",
"http-status-codes": "2.2.0",
"json-patch": "0.7.0",
"json-schema": "0.4.0",
"rfdc": "1.3.0",
"ts-optchain": "0.1.8"
},
"devDependencies": {
"@openstapps/configuration": "0.29.0",
"@openstapps/es-mapping-generator": "0.0.3",
"@openstapps/logger": "0.8.0",
"@openstapps/configuration": "0.29.1",
"@openstapps/es-mapping-generator": "0.2.0",
"@openstapps/logger": "0.8.1",
"@testdeck/mocha": "0.2.0",
"@types/chai": "4.3.0",
"@types/lodash": "4.14.178",
"@types/mocha": "9.0.0",
"@types/chai": "4.3.1",
"@types/lodash": "4.14.182",
"@types/mocha": "9.1.1",
"@types/rimraf": "3.0.2",
"chai": "4.3.4",
"conditional-type-checks": "1.0.5",
"conventional-changelog-cli": "2.1.1",
"chai": "4.3.6",
"conditional-type-checks": "1.0.6",
"conventional-changelog-cli": "2.2.2",
"lodash": "4.17.21",
"mocha": "9.1.3",
"mocha": "10.0.0",
"nyc": "15.1.0",
"rimraf": "3.0.2",
"source-map-support": "0.5.21",
"surge": "0.23.0",
"ts-node": "10.4.0",
"surge": "0.23.1",
"ts-node": "10.8.0",
"tslint": "6.1.3",
"typedoc": "0.21.6",
"typescript": "4.3.5"
"typedoc": "0.22.17",
"typescript": "4.4.4"
},
"nyc": {
"all": true,

View File

@@ -17,6 +17,7 @@ import {Polygon} from 'geojson';
import {SCTranslations} from '../general/i18n';
import {SCMap} from '../general/map';
import {SCLanguageSetting, SCSetting, SCUserGroupSetting} from '../things/setting';
import {SCFeatureConfiguration} from './feature';
/**
* An app configuration menu item
@@ -94,9 +95,9 @@ export interface SCAppConfiguration {
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
@@ -135,16 +136,6 @@ export interface SCAppConfiguration {
url?: string;
}
/**
* Map of features
*/
export interface SCAppConfigurationFeature {
/**
* Whether or not widgets are enabled
*/
widgets: boolean;
}
/**
* URLs of published apps
*/

View 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
View 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;
}

View File

@@ -14,6 +14,7 @@
*/
import {SCLicensePlate} from '../general/namespaces';
import {SCAppConfiguration} from './app';
import {SCAuthorizationProvider, SCAuthorizationProviderType} from './authorization';
import {SCBackendConfiguration, SCBackendInternalConfiguration} from './backend';
/**
@@ -27,6 +28,11 @@ export interface SCConfigFile {
*/
app: SCAppConfiguration;
/**
* Configuration for the supported authorization providers
*/
auth: { [key in SCAuthorizationProviderType]?: SCAuthorizationProvider; };
/**
* Configuration for the backend that is visible to clients
*/

64
src/config/user.ts Normal file
View 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;
}

View File

@@ -78,9 +78,9 @@ export interface SCRoute {
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;
/**
* @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[] = [];
if (typeof this.obligatoryParameters === 'object') {
@@ -132,7 +132,7 @@ export abstract class SCAbstractRoute implements SCRoute {
throw new Error('Extraneous parameters provided.');
}
return this.urlFragment
return this.urlPath
.split('/')
.map((part) => {
if (part.indexOf(':') !== 0) {

View File

@@ -89,6 +89,6 @@ export class SCBookAvailabilityRoute extends SCAbstractRoute {
this.requestBodyName = 'SCBookAvailabilityRequest';
this.responseBodyName = 'SCBookAvailabilityResponse';
this.statusCodeSuccess = StatusCodes.OK;
this.urlFragment = '/bookAvailability';
this.urlPath = '/bookAvailability';
}
}

View File

@@ -60,6 +60,6 @@ export class SCBulkAddRoute extends SCAbstractRoute {
this.requestBodyName = 'SCBulkAddRequest';
this.responseBodyName = 'SCBulkAddResponse';
this.statusCodeSuccess = StatusCodes.CREATED;
this.urlFragment = '/bulk/:UID';
this.urlPath = '/bulk/:UID';
}
}

View File

@@ -60,6 +60,6 @@ export class SCBulkDoneRoute extends SCAbstractRoute {
this.requestBodyName = 'SCBulkDoneRequest';
this.responseBodyName = 'SCBulkDoneResponse';
this.statusCodeSuccess = StatusCodes.NO_CONTENT;
this.urlFragment = '/bulk/:UID/done';
this.urlPath = '/bulk/:UID/done';
}
}

View File

@@ -99,6 +99,6 @@ export class SCBulkRoute extends SCAbstractRoute {
this.requestBodyName = 'SCBulkRequest';
this.responseBodyName = 'SCBulkResponse';
this.statusCodeSuccess = StatusCodes.OK;
this.urlFragment = '/bulk';
this.urlPath = '/bulk';
}
}

View File

@@ -60,7 +60,7 @@ export class SCFeedbackRoute extends SCAbstractRoute {
this.requestBodyName = 'SCFeedbackRequest';
this.responseBodyName = 'SCFeedbackResponse';
this.statusCodeSuccess = StatusCodes.OK;
this.urlFragment = '/feedback';
this.urlPath = '/feedback';
}
}

View File

@@ -14,6 +14,7 @@
*/
import {StatusCodes} from 'http-status-codes';
import {SCAppConfiguration} from '../../config/app';
import {SCAuthorizationProvider, SCAuthorizationProviderType} from '../../config/authorization';
import {SCBackendConfiguration} from '../../config/backend';
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
import {SCMethodNotAllowedErrorResponse} from '../errors/method-not-allowed';
@@ -42,6 +43,11 @@ export interface SCIndexResponse {
*/
app: SCAppConfiguration;
/**
* @see SCAuthorizationProvider
*/
auth: { [key in SCAuthorizationProviderType]?: SCAuthorizationProvider; };
/**
* @see SCBackendConfiguration
*/
@@ -66,6 +72,6 @@ export class SCIndexRoute extends SCAbstractRoute {
this.requestBodyName = 'SCIndexRequest';
this.responseBodyName = 'SCIndexResponse';
this.statusCodeSuccess = StatusCodes.OK;
this.urlFragment = '/';
this.urlPath = '/';
}
}

View File

@@ -123,6 +123,6 @@ export class SCPluginRegisterRoute extends SCAbstractRoute {
this.requestBodyName = 'SCPluginRegisterRequest';
this.responseBodyName = 'SCPluginRegisterResponse';
this.statusCodeSuccess = StatusCodes.OK;
this.urlFragment = '/plugin/register';
this.urlPath = '/plugin/register';
}
}

View File

@@ -64,6 +64,6 @@ export class SCMultiSearchRoute extends SCAbstractRoute {
this.requestBodyName = 'SCMultiSearchRequest';
this.responseBodyName = 'SCMultiSearchResponse';
this.statusCodeSuccess = StatusCodes.OK;
this.urlFragment = '/search/multi';
this.urlPath = '/search/multi';
}
}

View File

@@ -57,6 +57,6 @@ export class SCSearchRoute extends SCAbstractRoute {
this.requestBodyName = 'SCSearchRequest';
this.responseBodyName = 'SCSearchResponse';
this.statusCodeSuccess = StatusCodes.OK;
this.urlFragment = '/search';
this.urlPath = '/search';
}
}

View File

@@ -61,6 +61,6 @@ export class SCThingUpdateRoute extends SCAbstractRoute {
this.requestBodyName = 'SCThingUpdateRequest';
this.responseBodyName = 'SCThingUpdateResponse';
this.statusCodeSuccess = StatusCodes.OK;
this.urlFragment = '/:TYPE/:UID';
this.urlPath = '/:TYPE/:UID';
}
}

View File

@@ -13,7 +13,7 @@
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
// tslint:disable-next-line:no-implicit-dependencies
import {Polygon} from 'geojson';
import {Polygon, Position} from 'geojson';
import {SCThingsField} from '../../../meta';
import {SCSearchAbstractFilter, SCSearchAbstractFilterArguments} from '../filter';
@@ -29,6 +29,24 @@ export interface SCGeoFilter extends SCSearchAbstractFilter<SCGeoFilterArguments
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
*/
@@ -41,7 +59,7 @@ export interface SCGeoFilterArguments extends SCSearchAbstractFilterArguments {
/**
* Geo data to check up on
*/
shape: Polygon;
shape: Polygon | Envelope;
/**
* Spatial relation between the provided shape and the shape of the field.

View File

@@ -61,13 +61,13 @@ export class SCAcademicDegreeMeta
*/
fieldTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
...new SCThingMeta().fieldTranslations.de,
academicDegree: 'Abschlussgrad',
academicDegreewithField: 'Abschlussbezeichnung',
academicDegreewithFieldShort: 'Abschlussbezeichnung (kurz)',
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
...new SCThingMeta().fieldTranslations.en,
academicDegree: 'academic degree',
academicDegreewithField: 'acedemic degree and discipline',
academicDegreewithFieldShort: 'acedemic degree and discipline (short)',
@@ -79,10 +79,10 @@ export class SCAcademicDegreeMeta
*/
fieldValueTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
...new SCThingMeta().fieldValueTranslations.de,
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
...new SCThingMeta().fieldValueTranslations.en,
},
};
}

View File

@@ -77,7 +77,7 @@ export class SCAcademicTermWithoutReferencesMeta
*/
fieldTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
...new SCThingMeta().fieldTranslations.de,
acronym: 'Akronym',
endDate: 'Enddatum',
eventsEndDate: 'Enddatum der Veranstaltungen',
@@ -85,7 +85,7 @@ export class SCAcademicTermWithoutReferencesMeta
startDate: 'Startdatum',
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
...new SCThingMeta().fieldTranslations.en,
acronym: 'acronym',
endDate: 'end date',
eventsEndDate: 'end date of events',
@@ -99,10 +99,10 @@ export class SCAcademicTermWithoutReferencesMeta
*/
fieldValueTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
...new SCThingMeta().fieldValueTranslations.de,
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
...new SCThingMeta().fieldValueTranslations.en,
},
};
}

View File

@@ -17,19 +17,13 @@ import {SCISO8601Date} from '../../general/time';
import {SCOrganizationWithoutReferences} from '../organization';
import {SCPersonWithoutReferences} from '../person';
import {SCPublicationEventWithoutReferences} from '../publication-event';
import {SCThingMeta, SCThingTranslatableProperties, SCThingWithoutReferences} from './thing';
import {
SCAcademicPriceGroup,
SCThingThatCanBeOffered, SCThingThatCanBeOfferedMeta,
SCThingThatCanBeOfferedTranslatableProperties,
SCThingThatCanBeOfferedWithoutReferences,
} from './thing-that-can-be-offered';
import {SCThing, SCThingMeta, SCThingTranslatableProperties, SCThingWithoutReferences} from './thing';
/**
* A creative work without references
*/
export interface SCCreativeWorkWithoutReferences
extends SCThingWithoutReferences, SCThingThatCanBeOfferedWithoutReferences {
extends SCThingWithoutReferences {
/**
* Languages this creative work is available in
@@ -71,6 +65,13 @@ export interface SCCreativeWorkWithoutReferences
*/
keywords?: string[];
/**
* Date (in text form) the creative work was most recently
*
* @keyword
*/
lastPublished?: string;
/**
* Translated fields of the creative work
*/
@@ -81,7 +82,7 @@ export interface SCCreativeWorkWithoutReferences
* A creative work
*/
export interface SCCreativeWork
extends SCCreativeWorkWithoutReferences, SCThingThatCanBeOffered<SCAcademicPriceGroup> {
extends SCCreativeWorkWithoutReferences, SCThing {
/**
* Authors of the creative work
*/
@@ -117,7 +118,7 @@ export interface SCCreativeWork
* Translatable properties of creative works
*/
export interface SCCreativeWorkTranslatableProperties
extends SCThingTranslatableProperties, SCThingThatCanBeOfferedTranslatableProperties {
extends SCThingTranslatableProperties {
/**
* Translation of the keywords of the creative work
*
@@ -136,8 +137,7 @@ export class SCCreativeWorkMeta
*/
fieldTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
...SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.de,
...new SCThingMeta().fieldTranslations.de,
name: 'Titel',
authors: 'beteiligte Personen',
availableLanguages: 'verfügbare Übersetzungen',
@@ -153,8 +153,7 @@ export class SCCreativeWorkMeta
sourceOrganization: 'Körperschaft',
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
...SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.en,
...new SCThingMeta().fieldTranslations.en,
name: 'title',
authors: 'involved persons',
availableLanguages: 'available languages',
@@ -176,12 +175,10 @@ export class SCCreativeWorkMeta
*/
fieldValueTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
...SCThingThatCanBeOfferedMeta.getInstance().fieldValueTranslations.de,
...new SCThingMeta().fieldValueTranslations.de,
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
...SCThingThatCanBeOfferedMeta.getInstance().fieldValueTranslations.en,
...new SCThingMeta().fieldValueTranslations.en,
},
};
}

View File

@@ -86,7 +86,7 @@ export class SCEventMeta
*/
fieldTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
...new SCThingMeta().fieldTranslations.de,
academicTerms: 'Semester',
catalogs: 'Verzeichnis',
creativeWorks: 'begleitende Werke',
@@ -96,7 +96,7 @@ export class SCEventMeta
remainingAttendeeCapacity: 'verfügbare Anzahl an Teilnehmern',
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
...new SCThingMeta().fieldTranslations.en,
academicTerms: 'academic terms',
catalogs: 'catalogs',
creativeWorks: 'related material',
@@ -112,10 +112,10 @@ export class SCEventMeta
*/
fieldValueTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
...new SCThingMeta().fieldValueTranslations.de,
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
...new SCThingMeta().fieldValueTranslations.en,
},
};
}

View File

@@ -145,13 +145,13 @@ export class SCPlaceWithoutReferencesMeta
*/
fieldTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
...new SCThingMeta().fieldTranslations.de,
address: 'Adresse',
geo: 'Geoinformation',
openingHours: 'Öffnungszeiten',
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
...new SCThingMeta().fieldTranslations.en,
address: 'address',
geo: 'geographic information',
openingHours: 'opening hours',
@@ -163,10 +163,10 @@ export class SCPlaceWithoutReferencesMeta
*/
fieldValueTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
...new SCThingMeta().fieldValueTranslations.de,
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
...new SCThingMeta().fieldValueTranslations.en,
},
};
}

View File

@@ -34,11 +34,11 @@ export class SCThingInPlaceMeta
*/
fieldTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
...new SCThingMeta().fieldTranslations.de,
inPlace: 'Ort',
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
...new SCThingMeta().fieldTranslations.en,
inPlace: 'location',
},
};
@@ -48,10 +48,10 @@ export class SCThingInPlaceMeta
*/
fieldValueTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
...new SCThingMeta().fieldValueTranslations.de,
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
...new SCThingMeta().fieldValueTranslations.en,
},
};
}

View File

@@ -54,11 +54,11 @@ export class SCThingThatAcceptsPaymentsWithoutReferencesMeta
*/
fieldTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
...new SCThingMeta().fieldTranslations.de,
paymentsAccepted: 'Bezahlmethoden',
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
...new SCThingMeta().fieldTranslations.en,
paymentsAccepted: 'accepted payment methods',
},
};
@@ -68,7 +68,7 @@ export class SCThingThatAcceptsPaymentsWithoutReferencesMeta
*/
fieldValueTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
...new SCThingMeta().fieldValueTranslations.de,
paymentsAccepted: {
'cafeteria card': 'Mensakarte',
'cash': 'Bar',
@@ -76,7 +76,7 @@ export class SCThingThatAcceptsPaymentsWithoutReferencesMeta
},
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
...new SCThingMeta().fieldValueTranslations.en,
},
};
}

View File

@@ -150,21 +150,16 @@ export type SCThingThatCanBeOfferedAvailability =
export class SCThingThatCanBeOfferedMeta<T extends SCPriceGroup>
implements SCMetaTranslations<SCThingThatCanBeOffered<T>> {
/**
* Instance
*/
protected static _instance = new Map<string, unknown>();
/**
* Translations of fields
*/
fieldTranslations = {
de: {
...SCThingMeta.getInstance().fieldTranslations.de,
...new SCThingMeta().fieldTranslations.de,
offers: 'Angebote',
},
en: {
...SCThingMeta.getInstance().fieldTranslations.en,
...new SCThingMeta().fieldTranslations.en,
offers: 'offers',
},
};
@@ -174,26 +169,10 @@ export class SCThingThatCanBeOfferedMeta<T extends SCPriceGroup>
*/
fieldValueTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
...new SCThingMeta().fieldValueTranslations.de,
},
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() {
}
}

View File

@@ -120,22 +120,17 @@ export interface SCThingWithCategoriesSpecificValues {
export class SCThingWithCategoriesWithoutReferencesMeta<T, U>
implements SCMetaTranslations<SCThingWithCategoriesWithoutReferences<T, U>> {
/**
* Instance
*/
protected static _instance = new Map<string, unknown>();
/**
* Translations of fields
*/
fieldTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
...new SCThingMeta().fieldTranslations.de,
categories: 'Kategorien',
categorySpecificValues: 'besondere Kategorien',
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
...new SCThingMeta().fieldTranslations.en,
categories: 'categories',
categorySpecificValues: 'category with specific values',
},
@@ -146,27 +141,10 @@ export class SCThingWithCategoriesWithoutReferencesMeta<T, U>
*/
fieldValueTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
...new SCThingMeta().fieldValueTranslations.de,
},
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() {
}
}

View File

@@ -269,11 +269,6 @@ export interface SCThingTranslatablePropertyOrigin {
* Meta information about things
*/
export class SCThingMeta implements SCMetaTranslations<SCThing> {
/**
* Set type definition for singleton instance
*/
protected static _instance = new Map<string, unknown>();
/**
* Translations of fields
*/
@@ -315,19 +310,4 @@ export class SCThingMeta implements SCMetaTranslations<SCThing> {
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() {
}
}

View File

@@ -128,15 +128,15 @@ export class SCAcademicEventMeta
*/
fieldTranslations = {
de: {
...SCEventMeta.getInstance<SCEventMeta>().fieldTranslations.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCAcademicEventCategories,
...new SCEventMeta().fieldTranslations.de,
...new SCThingWithCategoriesWithoutReferencesMeta<SCAcademicEventCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
majors: 'Hauptfächer',
originalCategory: 'ursprüngliche Kategorie',
},
en: {
...SCEventMeta.getInstance<SCEventMeta>().fieldTranslations.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCAcademicEventCategories,
...new SCEventMeta().fieldTranslations.en,
...new SCThingWithCategoriesWithoutReferencesMeta<SCAcademicEventCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
majors: 'majors',
originalCategory: 'original category',
@@ -148,8 +148,8 @@ export class SCAcademicEventMeta
*/
fieldValueTranslations = {
de: {
...SCEventMeta.getInstance<SCEventMeta>().fieldValueTranslations.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCAcademicEventCategories,
...new SCEventMeta().fieldValueTranslations.de,
...new SCThingWithCategoriesWithoutReferencesMeta<SCAcademicEventCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
categories: {
'colloquium': 'Kolloquium',
@@ -171,8 +171,8 @@ export class SCAcademicEventMeta
type: 'akademische Veranstaltung',
},
en: {
...SCEventMeta.getInstance<SCEventMeta>().fieldValueTranslations.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCAcademicEventCategories,
...new SCEventMeta().fieldValueTranslations.en,
...new SCThingWithCategoriesWithoutReferencesMeta<SCAcademicEventCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
type: SCThingType.AcademicEvent,
},

View File

@@ -20,6 +20,7 @@ import {
SCCreativeWorkWithoutReferences,
} from './abstract/creative-work';
import {SCThingMeta, SCThingType} from './abstract/thing';
import {SCAcademicPriceGroup, SCThingThatCanBeOffered, SCThingThatCanBeOfferedMeta, SCThingThatCanBeOfferedTranslatableProperties, SCThingThatCanBeOfferedWithoutReferences} from './abstract/thing-that-can-be-offered';
import {
SCThingWithCategoriesSpecificValues,
SCThingWithCategoriesTranslatableProperties,
@@ -40,6 +41,7 @@ export type SCArticleCategories = 'unipedia'
*/
export interface SCArticleWithoutReferences
extends SCCreativeWorkWithoutReferences,
SCThingThatCanBeOfferedWithoutReferences,
SCThingWithCategoriesWithoutReferences<SCArticleCategories, SCThingWithCategoriesSpecificValues> {
/**
* Article itself as markdown
@@ -71,7 +73,9 @@ export interface SCArticleWithoutReferences
* @indexable
*/
export interface SCArticle
extends SCCreativeWork, SCArticleWithoutReferences {
extends SCCreativeWork,
SCThingThatCanBeOffered<SCAcademicPriceGroup>,
SCArticleWithoutReferences {
/**
* A periodical to which this article belongs
*/
@@ -96,7 +100,9 @@ export interface SCArticle
* Translatable properties of an article
*/
export interface SCArticleTranslatableProperties
extends SCThingWithCategoriesTranslatableProperties, SCCreativeWorkTranslatableProperties {
extends SCThingWithCategoriesTranslatableProperties,
SCThingThatCanBeOfferedTranslatableProperties,
SCCreativeWorkTranslatableProperties {
/**
* Translation of the article itself as markdown
*
@@ -115,19 +121,21 @@ export class SCArticleMeta
*/
fieldTranslations = {
de: {
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations
...new SCCreativeWorkMeta().fieldTranslations
.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCArticleCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCArticleCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldTranslations.de,
categories: 'Format',
reference: 'Referenz',
articleBody: 'Artikelinhalt',
},
en: {
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations
...new SCCreativeWorkMeta().fieldTranslations
.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCArticleCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCArticleCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldTranslations.en,
categories: 'format',
reference: 'reference',
articleBody: 'article body',
@@ -139,8 +147,11 @@ export class SCArticleMeta
*/
fieldValueTranslations = {
de: {
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
...new SCCreativeWorkMeta().fieldValueTranslations.de,
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
.fieldValueTranslations.de,
...new SCThingWithCategoriesWithoutReferencesMeta<SCArticleCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
categories: {
article: 'Artikel',
eArticle: 'E-Aufsatz',
@@ -149,8 +160,11 @@ export class SCArticleMeta
type: 'Artikel',
},
en: {
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
...new SCCreativeWorkMeta().fieldValueTranslations.en,
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
.fieldValueTranslations.en,
...new SCThingWithCategoriesWithoutReferencesMeta<SCArticleCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
type: SCThingType.Article,
categories: {
article: 'article',

View File

@@ -121,7 +121,7 @@ export interface SCAssessmentTranslatableProperties
*/
fieldTranslations = {
de: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCAssessmentCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCAssessmentCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
attempt: 'Versuch',
courseOfStudy: 'Studiengang',
@@ -132,7 +132,7 @@ export interface SCAssessmentTranslatableProperties
superAssessments: 'übergeordnete Prüfungen',
},
en: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCAssessmentCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCAssessmentCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
attempt: 'attempt',
courseOfStudy: 'course of study',
@@ -149,12 +149,12 @@ export interface SCAssessmentTranslatableProperties
*/
fieldValueTranslations = {
de: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCAssessmentCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCAssessmentCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
type: 'Prüfung',
},
en: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCAssessmentCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCAssessmentCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
type: SCThingType.Assessment,
},

View File

@@ -20,6 +20,7 @@ import {
SCCreativeWorkWithoutReferences,
} from './abstract/creative-work';
import {SCThingMeta, SCThingType} from './abstract/thing';
import {SCAcademicPriceGroup, SCThingThatCanBeOffered, SCThingThatCanBeOfferedMeta, SCThingThatCanBeOfferedTranslatableProperties, SCThingThatCanBeOfferedWithoutReferences} from './abstract/thing-that-can-be-offered';
import {
SCThingWithCategoriesSpecificValues,
SCThingWithCategoriesTranslatableProperties,
@@ -54,6 +55,7 @@ export type SCBookCategories = 'audio'
*/
export interface SCBookWithoutReferences
extends SCCreativeWorkWithoutReferences,
SCThingThatCanBeOfferedWithoutReferences,
SCThingWithCategoriesWithoutReferences<SCBookCategories, SCThingWithCategoriesSpecificValues> {
/**
* Categories of a book
@@ -93,7 +95,9 @@ export interface SCBookWithoutReferences
* @indexable
*/
export interface SCBook
extends SCCreativeWork, SCBookWithoutReferences {
extends SCCreativeWork,
SCThingThatCanBeOffered<SCAcademicPriceGroup>,
SCBookWithoutReferences {
/**
* Translated properties of a book
*/
@@ -109,7 +113,9 @@ export interface SCBook
* Translatable properties of a book
*/
export interface SCBookTranslatableFields
extends SCThingWithCategoriesTranslatableProperties, SCCreativeWorkTranslatableProperties {
extends SCThingWithCategoriesTranslatableProperties,
SCThingThatCanBeOfferedTranslatableProperties,
SCCreativeWorkTranslatableProperties {
}
/**
@@ -121,17 +127,19 @@ export class SCBookMeta extends SCThingMeta implements SCMetaTranslations<SCBook
*/
fieldTranslations = {
de: {
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBookCategories,
...new SCCreativeWorkMeta().fieldTranslations.de,
...new SCThingWithCategoriesWithoutReferencesMeta<SCBookCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldTranslations.de,
categories: 'Format',
ISBNs: 'ISBN',
numberOfPages: 'Seitenanzahl',
},
en: {
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBookCategories,
...new SCCreativeWorkMeta().fieldTranslations.en,
...new SCThingWithCategoriesWithoutReferencesMeta<SCBookCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldTranslations.en,
categories: 'format',
ISBNs: 'ISBN',
numberOfPages: 'number of pages',
@@ -143,10 +151,12 @@ export class SCBookMeta extends SCThingMeta implements SCMetaTranslations<SCBook
*/
fieldValueTranslations = {
de: {
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
...new SCCreativeWorkMeta()
.fieldValueTranslations.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBookCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCBookCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
.fieldValueTranslations.de,
categories: {
audio: 'Tonträger',
book: 'Buch',
@@ -170,10 +180,12 @@ export class SCBookMeta extends SCThingMeta implements SCMetaTranslations<SCBook
type: 'Buch',
},
en: {
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
...new SCCreativeWorkMeta()
.fieldValueTranslations.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBookCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCBookCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
.fieldValueTranslations.en,
type: SCThingType.Book,
categories: {
audio: 'audio material',

View File

@@ -99,15 +99,15 @@ export class SCBuildingMeta
*/
fieldTranslations = {
de: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBuildingCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCBuildingCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
...SCPlaceWithoutReferencesMeta.getInstance<SCPlaceWithoutReferencesMeta>().fieldTranslations.de,
...new SCPlaceWithoutReferencesMeta().fieldTranslations.de,
floors: 'Etagen',
},
en: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBuildingCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCBuildingCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
...SCPlaceWithoutReferencesMeta.getInstance<SCPlaceWithoutReferencesMeta>().fieldTranslations.en,
...new SCPlaceWithoutReferencesMeta().fieldTranslations.en,
floors: 'floors',
},
};
@@ -117,9 +117,9 @@ export class SCBuildingMeta
*/
fieldValueTranslations = {
de: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBuildingCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCBuildingCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
...SCPlaceWithoutReferencesMeta.getInstance<SCPlaceWithoutReferencesMeta>().fieldValueTranslations.de,
...new SCPlaceWithoutReferencesMeta().fieldValueTranslations.de,
categories: {
'cafe': 'Café',
'canteen': 'Kantine',
@@ -133,9 +133,9 @@ export class SCBuildingMeta
type: 'Gebäude',
},
en: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBuildingCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCBuildingCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
...SCPlaceWithoutReferencesMeta.getInstance<SCPlaceWithoutReferencesMeta>().fieldValueTranslations.en,
...new SCPlaceWithoutReferencesMeta().fieldValueTranslations.en,
type: SCThingType.Building,
},
};

View File

@@ -89,7 +89,7 @@ export class SCCatalogMeta
*/
fieldTranslations = {
de: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCCatalogCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCCatalogCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
academicTerm: 'Semester',
level: 'Ebene',
@@ -97,7 +97,7 @@ export class SCCatalogMeta
superCatalogs: 'übergeordnete Verzeichnisse',
},
en: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCCatalogCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCCatalogCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
academicTerm: 'academic term',
level: 'level',
@@ -111,7 +111,7 @@ export class SCCatalogMeta
*/
fieldValueTranslations = {
de: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCCatalogCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCCatalogCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
categories: {
'university events': 'Universitätsveranstaltung',
@@ -119,7 +119,7 @@ export class SCCatalogMeta
type: 'Verzeichnis',
},
en: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCCatalogCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCCatalogCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
type: SCThingType.Catalog,
},

View File

@@ -73,7 +73,7 @@ export interface SCContactPointWithoutReferences
* A contact point
*
* @see http://schema.org/ContactPoint
*
*
* @validatable
* @indexable
*/
@@ -101,7 +101,7 @@ export class SCContactPointMeta
*/
fieldTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
...new SCThingMeta().fieldTranslations.de,
areaServed: 'Arbeitsraum',
email: 'E-Mail-Addresse',
faxNumber: 'Faxnummer',
@@ -110,7 +110,7 @@ export class SCContactPointMeta
url: 'Link',
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
...new SCThingMeta().fieldTranslations.en,
areaServed: 'location',
email: 'email address',
faxNumber: 'fax number',
@@ -125,11 +125,11 @@ export class SCContactPointMeta
*/
fieldValueTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
...new SCThingMeta().fieldValueTranslations.de,
type: 'Kontaktinformation',
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
...new SCThingMeta().fieldValueTranslations.en,
type: SCThingType.ContactPoint,
},
};

View File

@@ -115,9 +115,9 @@ export class SCCourseOfStudyMeta
*/
fieldTranslations = {
de: {
...SCAcademicDegreeMeta.getInstance<SCAcademicDegreeMeta>()
...new SCAcademicDegreeMeta()
.fieldTranslations.de,
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
.fieldTranslations.de,
department: 'Fachbereich',
mainLanguage: 'Unterrichtssprache',
@@ -127,9 +127,9 @@ export class SCCourseOfStudyMeta
timeMode: 'Zeitmodell',
},
en: {
...SCAcademicDegreeMeta.getInstance<SCAcademicDegreeMeta>()
...new SCAcademicDegreeMeta()
.fieldTranslations.en,
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
.fieldTranslations.de,
department: 'department',
mainLanguage: 'main language',
@@ -145,7 +145,7 @@ export class SCCourseOfStudyMeta
*/
fieldValueTranslations = {
de: {
...SCAcademicDegreeMeta.getInstance().fieldValueTranslations.de,
...new SCAcademicDegreeMeta().fieldValueTranslations.de,
modes: {
combination: 'Kombinationsstudiengang',
'double-degree': 'Doppelstudium',
@@ -159,7 +159,7 @@ export class SCCourseOfStudyMeta
type: 'Studiengang',
},
en: {
...SCAcademicDegreeMeta.getInstance().fieldValueTranslations.en,
...new SCAcademicDegreeMeta().fieldValueTranslations.en,
modes: {
combination: 'combination course of study',
'double-degree': 'double degree course of study',

View File

@@ -123,9 +123,9 @@ export class SCDateSeriesMeta
*/
fieldTranslations = {
de: {
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations
...new SCThingInPlaceMeta().fieldTranslations
.de,
...SCThingThatCanBeOfferedMeta.getInstance<SCSportCoursePriceGroup>()
...new SCThingThatCanBeOfferedMeta<SCSportCoursePriceGroup>()
.fieldTranslations.de,
dates: 'Einzeltermine',
duration: 'Dauer',
@@ -135,9 +135,9 @@ export class SCDateSeriesMeta
performers: 'Vortragende',
},
en: {
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations
...new SCThingInPlaceMeta().fieldTranslations
.en,
...SCThingThatCanBeOfferedMeta.getInstance<SCSportCoursePriceGroup>()
...new SCThingThatCanBeOfferedMeta<SCSportCoursePriceGroup>()
.fieldTranslations.en,
dates: 'dates',
duration: 'duration',
@@ -153,16 +153,16 @@ export class SCDateSeriesMeta
*/
fieldValueTranslations = {
de: {
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>()
...new SCThingInPlaceMeta()
.fieldValueTranslations.de,
...SCThingThatCanBeOfferedMeta.getInstance<SCSportCoursePriceGroup>()
...new SCThingThatCanBeOfferedMeta<SCSportCoursePriceGroup>()
.fieldValueTranslations.de,
type: 'Terminserie',
},
en: {
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>()
...new SCThingInPlaceMeta()
.fieldValueTranslations.en,
...SCThingThatCanBeOfferedMeta.getInstance<SCSportCoursePriceGroup>()
...new SCThingThatCanBeOfferedMeta<SCSportCoursePriceGroup>()
.fieldValueTranslations.en,
type: SCThingType.DateSeries,
},

View File

@@ -73,14 +73,14 @@ export class SCDiffMeta
*/
fieldTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
...new SCThingMeta().fieldTranslations.de,
action: 'Aktion',
changes: 'Änderungen',
dateCreated: 'Erstellungsdatum',
object: 'Objekt',
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
...new SCThingMeta().fieldTranslations.en,
action: 'action',
changes: 'changes',
dateCreated: 'date created',
@@ -93,7 +93,7 @@ export class SCDiffMeta
*/
fieldValueTranslations = {
de: {
...SCThingMeta.getInstance().fieldValueTranslations.de,
...new SCThingMeta().fieldValueTranslations.de,
action: {
'changed': 'geändert',
'removed': 'gelöscht',
@@ -101,7 +101,7 @@ export class SCDiffMeta
type: 'Unterschied',
},
en: {
...SCThingMeta.getInstance().fieldValueTranslations.en,
...new SCThingMeta().fieldValueTranslations.en,
type: SCThingType.Diff,
},
};

View File

@@ -202,9 +202,9 @@ export class SCDishMeta
*/
fieldTranslations = {
de: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCDishCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCDishCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
.fieldTranslations.de,
additives: 'Zusatzstoffe',
characteristics: 'Merkmale',
@@ -212,9 +212,9 @@ export class SCDishMeta
nutrition: 'Nährwertangaben',
},
en: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCDishCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCDishCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
.fieldTranslations.en,
additives: 'additives',
characteristics: 'characteristics',
@@ -228,9 +228,9 @@ export class SCDishMeta
*/
fieldValueTranslations = {
de: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCDishCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCDishCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
.fieldValueTranslations.de,
categories: {
appetizer: 'Vorspeise',
@@ -243,9 +243,9 @@ export class SCDishMeta
type: 'Essen',
},
en: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCDishCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCDishCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
.fieldValueTranslations.en,
type: SCThingType.Dish,
},

View File

@@ -114,13 +114,13 @@ export class SCFloorMeta
*/
fieldTranslations = {
de: {
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations
...new SCThingInPlaceMeta().fieldTranslations
.de,
floorName: 'Etagenbezeichnung',
plan: 'Grundriss',
},
en: {
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations
...new SCThingInPlaceMeta().fieldTranslations
.en,
floorName: 'floor name',
plan: 'plan',
@@ -132,12 +132,12 @@ export class SCFloorMeta
*/
fieldValueTranslations = {
de: {
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>()
...new SCThingInPlaceMeta()
.fieldValueTranslations.de,
type: 'Etage',
},
en: {
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>()
...new SCThingInPlaceMeta()
.fieldValueTranslations.en,
type: SCThingType.Floor,
},

View File

@@ -130,9 +130,8 @@ export class SCMessageMeta
*/
fieldTranslations = {
de: {
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations
.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCMessageCategories,
...new SCCreativeWorkMeta().fieldTranslations.de,
...new SCThingWithCategoriesWithoutReferencesMeta<SCMessageCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
audienceOrganizations: 'Zielgruppenorganisationen',
audiences: 'Zielgruppen',
@@ -141,9 +140,8 @@ export class SCMessageMeta
sequenceIndex: 'Sequenzindex',
},
en: {
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations
.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCMessageCategories,
...new SCCreativeWorkMeta().fieldTranslations.en,
...new SCThingWithCategoriesWithoutReferencesMeta<SCMessageCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
audienceOrganizations: 'audience organizations',
audiences: 'audiences',
@@ -158,8 +156,9 @@ export class SCMessageMeta
*/
fieldValueTranslations = {
de: {
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
.fieldValueTranslations.de,
...new SCCreativeWorkMeta().fieldValueTranslations.de,
...new SCThingWithCategoriesWithoutReferencesMeta<SCMessageCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
audiences: {
employees: 'Angestellte',
guests: 'Gäste',
@@ -171,8 +170,9 @@ export class SCMessageMeta
type: 'Nachricht',
},
en: {
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
.fieldValueTranslations.en,
...new SCCreativeWorkMeta().fieldValueTranslations.en,
...new SCThingWithCategoriesWithoutReferencesMeta<SCMessageCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
type: SCThingType.Message,
},
};

View File

@@ -57,11 +57,11 @@ export class SCOrganizationMeta
*/
fieldTranslations = {
de: {
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations.de,
...new SCThingInPlaceMeta().fieldTranslations.de,
contactPoints: 'Kontaktinformationen',
},
en: {
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations.en,
...new SCThingInPlaceMeta().fieldTranslations.en,
contactPoints: 'contact details',
},
};
@@ -71,11 +71,11 @@ export class SCOrganizationMeta
*/
fieldValueTranslations = {
de: {
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldValueTranslations.de,
...new SCThingInPlaceMeta().fieldValueTranslations.de,
type: 'Einrichtung',
},
en: {
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldValueTranslations.en,
...new SCThingInPlaceMeta().fieldValueTranslations.en,
type: SCThingType.Organization,
},
};

View File

@@ -20,6 +20,7 @@ import {
SCCreativeWorkWithoutReferences,
} from './abstract/creative-work';
import {SCThingMeta, SCThingType} from './abstract/thing';
import {SCAcademicPriceGroup, SCThingThatCanBeOffered, SCThingThatCanBeOfferedMeta, SCThingThatCanBeOfferedTranslatableProperties, SCThingThatCanBeOfferedWithoutReferences} from './abstract/thing-that-can-be-offered';
import {
SCThingWithCategoriesSpecificValues,
SCThingWithCategoriesTranslatableProperties,
@@ -37,6 +38,7 @@ export type SCPeriodicalCategories = 'journal' | 'electronic';
*/
export interface SCPeriodicalWithoutReferences
extends SCCreativeWorkWithoutReferences,
SCThingThatCanBeOfferedWithoutReferences,
SCThingWithCategoriesWithoutReferences<SCPeriodicalCategories, SCThingWithCategoriesSpecificValues> {
/**
* Categories of a periodical
@@ -68,7 +70,9 @@ export interface SCPeriodicalWithoutReferences
* @indexable
*/
export interface SCPeriodical
extends SCCreativeWork, SCPeriodicalWithoutReferences {
extends SCCreativeWork,
SCThingThatCanBeOffered<SCAcademicPriceGroup>,
SCPeriodicalWithoutReferences {
/**
* Translated properties of a periodical
*/
@@ -84,7 +88,9 @@ export interface SCPeriodical
* Translatable properties of a periodical
*/
export interface SCPeriodicalTranslatableFields
extends SCThingWithCategoriesTranslatableProperties, SCCreativeWorkTranslatableProperties {
extends SCThingWithCategoriesTranslatableProperties,
SCThingThatCanBeOfferedTranslatableProperties,
SCCreativeWorkTranslatableProperties {
}
/**
@@ -96,16 +102,18 @@ export class SCPeriodicalMeta extends SCThingMeta implements SCMetaTranslations<
*/
fieldTranslations = {
de: {
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCPeriodicalCategories,
...new SCCreativeWorkMeta().fieldTranslations.de,
...new SCThingWithCategoriesWithoutReferencesMeta<SCPeriodicalCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldTranslations.de,
categories: 'Format',
ISSNs: 'ISSN',
},
en: {
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCPeriodicalCategories,
...new SCCreativeWorkMeta().fieldTranslations.en,
...new SCThingWithCategoriesWithoutReferencesMeta<SCPeriodicalCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldTranslations.en,
categories: 'format',
ISSNs: 'ISSN',
},
@@ -116,8 +124,10 @@ export class SCPeriodicalMeta extends SCThingMeta implements SCMetaTranslations<
*/
fieldValueTranslations = {
de: {
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
.fieldValueTranslations.de,
...new SCCreativeWorkMeta().fieldValueTranslations.de,
...new SCThingWithCategoriesWithoutReferencesMeta<SCPeriodicalCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldValueTranslations.de,
type: 'Periodikum',
categories: {
electronic: 'E-Journal',
@@ -125,8 +135,10 @@ export class SCPeriodicalMeta extends SCThingMeta implements SCMetaTranslations<
},
},
en: {
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
.fieldValueTranslations.en,
...new SCCreativeWorkMeta().fieldValueTranslations.en,
...new SCThingWithCategoriesWithoutReferencesMeta<SCPeriodicalCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldValueTranslations.en,
type: 'periodical',
categories: {
electronic: 'E-Journal',

View File

@@ -174,7 +174,7 @@ export class SCPersonMeta
*/
fieldTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
...new SCThingMeta().fieldTranslations.de,
additionalName: 'Zusatzname',
affiliations: 'Zugehörigkeiten',
birthDate: 'Geburtsdatum',
@@ -192,7 +192,7 @@ export class SCPersonMeta
workLocations: 'Arbeitsstandorte',
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
...new SCThingMeta().fieldTranslations.en,
additionalName: 'additional name',
affiliations: 'affiliations',
birthDate: 'birth date',
@@ -217,7 +217,7 @@ export class SCPersonMeta
*/
fieldValueTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
...new SCThingMeta().fieldValueTranslations.de,
gender: {
'female': 'weiblich',
'inter': 'divers',
@@ -227,7 +227,7 @@ export class SCPersonMeta
type: 'Person',
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
...new SCThingMeta().fieldValueTranslations.en,
type: SCThingType.Person,
},
};

View File

@@ -82,17 +82,17 @@ export class SCPointOfInterestMeta
*/
fieldTranslations = {
de: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCPointOfInterestCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCPointOfInterestCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
...SCPlaceWithoutReferencesMeta.getInstance<SCPlaceWithoutReferencesMeta>().fieldTranslations.de,
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations
...new SCPlaceWithoutReferencesMeta().fieldTranslations.de,
...new SCThingInPlaceMeta().fieldTranslations
.de,
},
en: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCPointOfInterestCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCPointOfInterestCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
...SCPlaceWithoutReferencesMeta.getInstance<SCPlaceWithoutReferencesMeta>().fieldTranslations.en,
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations
...new SCPlaceWithoutReferencesMeta().fieldTranslations.en,
...new SCThingInPlaceMeta().fieldTranslations
.en,
},
};
@@ -102,9 +102,9 @@ export class SCPointOfInterestMeta
*/
fieldValueTranslations = {
de: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCPointOfInterestCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCPointOfInterestCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
...SCPlaceWithoutReferencesMeta.getInstance<SCPlaceWithoutReferencesMeta>().fieldValueTranslations.de,
...new SCPlaceWithoutReferencesMeta().fieldValueTranslations.de,
categories: {
'card charger': 'Kartenaufwerter',
'computer': 'Computer',
@@ -115,9 +115,9 @@ export class SCPointOfInterestMeta
type: 'Sonderziel',
},
en: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCPointOfInterestCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCPointOfInterestCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
...SCPlaceWithoutReferencesMeta.getInstance<SCPlaceWithoutReferencesMeta>().fieldValueTranslations.en,
...new SCPlaceWithoutReferencesMeta().fieldValueTranslations.en,
type: SCThingType.PointOfInterest,
},
};

View File

@@ -78,12 +78,12 @@ export class SCPublicationEventMeta
*/
fieldTranslations = {
de: {
...SCEventMeta.getInstance<SCEventMeta>().fieldTranslations.de,
...new SCEventMeta().fieldTranslations.de,
locations: 'Erscheinungsorte',
publisher: 'Verlag',
},
en: {
...SCEventMeta.getInstance<SCEventMeta>().fieldTranslations.en,
...new SCEventMeta().fieldTranslations.en,
locations: 'places of publication',
publisher: 'publisher',
},
@@ -94,11 +94,11 @@ export class SCPublicationEventMeta
*/
fieldValueTranslations = {
de: {
...SCEventMeta.getInstance<SCEventMeta>().fieldValueTranslations.de,
...new SCEventMeta().fieldValueTranslations.de,
type: 'Veröffentlichung',
},
en: {
...SCEventMeta.getInstance<SCEventMeta>().fieldValueTranslations.en,
...new SCEventMeta().fieldValueTranslations.en,
type: 'publication event',
},
};

View File

@@ -127,23 +127,23 @@ export class SCRoomMeta
*/
fieldTranslations = {
de: {
...SCPlaceWithoutReferencesMeta.getInstance<SCPlaceWithoutReferencesMeta>().fieldTranslations.de,
...SCThingThatAcceptsPaymentsWithoutReferencesMeta.getInstance<SCThingThatAcceptsPaymentsWithoutReferencesMeta>()
...new SCPlaceWithoutReferencesMeta().fieldTranslations.de,
...new SCThingThatAcceptsPaymentsWithoutReferencesMeta()
.fieldTranslations.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCRoomCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCRoomCategories,
SCRoomSpecificValues>().fieldTranslations.de,
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations
...new SCThingInPlaceMeta().fieldTranslations
.de,
floorName: 'Etagenbezeichnung',
inventory: 'Bestand',
},
en: {
...SCPlaceWithoutReferencesMeta.getInstance<SCPlaceWithoutReferencesMeta>().fieldTranslations.en,
...SCThingThatAcceptsPaymentsWithoutReferencesMeta.getInstance<SCThingThatAcceptsPaymentsWithoutReferencesMeta>()
...new SCPlaceWithoutReferencesMeta().fieldTranslations.en,
...new SCThingThatAcceptsPaymentsWithoutReferencesMeta()
.fieldTranslations.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCRoomCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCRoomCategories,
SCRoomSpecificValues>().fieldTranslations.en,
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations
...new SCThingInPlaceMeta().fieldTranslations
.en,
floorName: 'floor name',
inventory: 'inventory',
@@ -155,12 +155,12 @@ export class SCRoomMeta
*/
fieldValueTranslations = {
de: {
...SCPlaceWithoutReferencesMeta.getInstance<SCPlaceWithoutReferencesMeta>().fieldValueTranslations.de,
...SCThingThatAcceptsPaymentsWithoutReferencesMeta.getInstance<SCThingThatAcceptsPaymentsWithoutReferencesMeta>()
...new SCPlaceWithoutReferencesMeta().fieldValueTranslations.de,
...new SCThingThatAcceptsPaymentsWithoutReferencesMeta()
.fieldValueTranslations.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCRoomCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCRoomCategories,
SCRoomSpecificValues>().fieldValueTranslations.de,
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>()
...new SCThingInPlaceMeta()
.fieldValueTranslations.de,
categories: {
'cafe': 'Café',
@@ -180,12 +180,12 @@ export class SCRoomMeta
type: 'Raum',
},
en: {
...SCPlaceWithoutReferencesMeta.getInstance<SCPlaceWithoutReferencesMeta>().fieldValueTranslations.en,
...SCThingThatAcceptsPaymentsWithoutReferencesMeta.getInstance<SCThingThatAcceptsPaymentsWithoutReferencesMeta>()
...new SCPlaceWithoutReferencesMeta().fieldValueTranslations.en,
...new SCThingThatAcceptsPaymentsWithoutReferencesMeta()
.fieldValueTranslations.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCRoomCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCRoomCategories,
SCRoomSpecificValues>().fieldValueTranslations.en,
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>()
...new SCThingInPlaceMeta()
.fieldValueTranslations.en,
type: SCThingType.Room,
},

View File

@@ -65,7 +65,7 @@ export class SCSemesterMeta
*/
fieldTranslations = {
de: {
...SCAcademicTermWithoutReferencesMeta.getInstance<SCAcademicTermWithoutReferencesMeta>().fieldTranslations.de,
...new SCAcademicTermWithoutReferencesMeta().fieldTranslations.de,
acronym: 'Abkürzung',
endDate: 'Ende',
eventsEndDate: 'Vorlesungsschluss',
@@ -73,7 +73,7 @@ export class SCSemesterMeta
startDate: 'Beginn',
},
en: {
...SCAcademicTermWithoutReferencesMeta.getInstance<SCAcademicTermWithoutReferencesMeta>().fieldTranslations.en,
...new SCAcademicTermWithoutReferencesMeta().fieldTranslations.en,
acronym: 'acronym',
endDate: 'end date',
eventsEndDate: 'semester ending',
@@ -87,12 +87,12 @@ export class SCSemesterMeta
*/
fieldValueTranslations = {
de: {
...SCAcademicTermWithoutReferencesMeta.getInstance<SCAcademicTermWithoutReferencesMeta>()
...new SCAcademicTermWithoutReferencesMeta()
.fieldValueTranslations.de,
type: 'Semester',
},
en: {
...SCAcademicTermWithoutReferencesMeta.getInstance<SCAcademicTermWithoutReferencesMeta>()
...new SCAcademicTermWithoutReferencesMeta()
.fieldValueTranslations.en,
type: SCThingType.Semester,
},

View File

@@ -129,7 +129,7 @@ export class SCSettingMeta extends SCThingMeta implements SCMetaTranslations<SCS
*/
fieldTranslations = {
de: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCSettingCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCSettingCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
defaultValue: 'Standard Wert',
inputType: 'Eingabetyp',
@@ -138,7 +138,7 @@ export class SCSettingMeta extends SCThingMeta implements SCMetaTranslations<SCS
values: 'Werte',
},
en: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCSettingCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCSettingCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
defaultValue: 'default value',
inputType: 'input type',
@@ -153,7 +153,7 @@ export class SCSettingMeta extends SCThingMeta implements SCMetaTranslations<SCS
*/
fieldValueTranslations = {
de: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCSettingCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCSettingCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
categories: {
credentials: 'Anmeldedaten',
@@ -171,7 +171,7 @@ export class SCSettingMeta extends SCThingMeta implements SCMetaTranslations<SCS
type: 'Einstellung',
},
en: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCSettingCategories,
...new SCThingWithCategoriesWithoutReferencesMeta<SCSettingCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
type: SCThingType.Setting,
},

View File

@@ -52,10 +52,10 @@ export class SCSportCourseMeta
*/
fieldTranslations = {
de: {
...SCEventMeta.getInstance<SCEventMeta>().fieldTranslations.de,
...new SCEventMeta().fieldTranslations.de,
},
en: {
...SCEventMeta.getInstance<SCEventMeta>().fieldTranslations.en,
...new SCEventMeta().fieldTranslations.en,
},
};
@@ -64,11 +64,11 @@ export class SCSportCourseMeta
*/
fieldValueTranslations = {
de: {
...SCEventMeta.getInstance<SCEventMeta>().fieldValueTranslations.de,
...new SCEventMeta().fieldValueTranslations.de,
type: 'Sportkurs',
},
en: {
...SCEventMeta.getInstance<SCEventMeta>().fieldValueTranslations.en,
...new SCEventMeta().fieldValueTranslations.en,
type: SCThingType.SportCourse,
},
};

View File

@@ -150,8 +150,8 @@ export class SCStudyModuleMeta
*/
fieldTranslations = {
de: {
...SCThingMeta.getInstance().fieldTranslations.de,
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
...new SCThingMeta().fieldTranslations.de,
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
.fieldTranslations.de,
academicEvents: 'Veranstaltungen',
ects: 'ECTS-Punkte',
@@ -164,8 +164,8 @@ export class SCStudyModuleMeta
secretary: 'Sekretariat',
},
en: {
...SCThingMeta.getInstance().fieldTranslations.en,
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
...new SCThingMeta().fieldTranslations.en,
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
.fieldTranslations.en,
academicEvents: 'academic events',
ects: 'ECTS points',
@@ -184,8 +184,8 @@ export class SCStudyModuleMeta
*/
fieldValueTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
...new SCThingMeta().fieldValueTranslations.de,
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
.fieldValueTranslations.de,
necessity: {
'elective': 'Wahlfach',
@@ -195,8 +195,8 @@ export class SCStudyModuleMeta
type: 'Studiengangmodul',
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
...new SCThingMeta().fieldValueTranslations.en,
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
.fieldValueTranslations.en,
type: SCThingType.StudyModule,
},

View File

@@ -70,14 +70,14 @@ export class SCTicketMeta
*/
fieldTranslations = {
de: {
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations
...new SCThingInPlaceMeta().fieldTranslations
.de,
approxWaitingTime: 'ungefähre Wartezeit',
currentTicketNumber: 'aktuelle Ticketnummer',
serviceType: 'Service Kategorie',
},
en: {
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>().fieldTranslations
...new SCThingInPlaceMeta().fieldTranslations
.en,
approxWaitingTime: 'approximate waiting time',
currentTicketNumber: 'current ticket number',
@@ -90,12 +90,12 @@ export class SCTicketMeta
*/
fieldValueTranslations = {
de: {
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>()
...new SCThingInPlaceMeta()
.fieldValueTranslations.de,
type: 'Ticket',
},
en: {
...SCThingInPlaceMeta.getInstance<SCThingInPlaceMeta>()
...new SCThingInPlaceMeta()
.fieldValueTranslations.en,
type: SCThingType.Ticket,
},

View File

@@ -88,14 +88,14 @@ export class SCToDoMeta extends SCThingMeta implements SCMetaTranslations<SCToDo
*/
fieldTranslations = {
de: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<string,
...new SCThingWithCategoriesWithoutReferencesMeta<string,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
done: 'Erledigt',
dueDate: 'Fälligkeitsdatum',
priority: 'Priorität',
},
en: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<string,
...new SCThingWithCategoriesWithoutReferencesMeta<string,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
done: 'done',
dueDate: 'due date',
@@ -108,12 +108,12 @@ export class SCToDoMeta extends SCThingMeta implements SCMetaTranslations<SCToDo
*/
fieldValueTranslations = {
de: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<string,
...new SCThingWithCategoriesWithoutReferencesMeta<string,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
type: 'ToDo',
},
en: {
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<string,
...new SCThingWithCategoriesWithoutReferencesMeta<string,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
type: SCThingType.ToDo,
},

View File

@@ -65,12 +65,12 @@ export class SCTourMeta
*/
fieldTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
...new SCThingMeta().fieldTranslations.de,
init: 'Initiales Skript',
steps: 'Schritte',
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
...new SCThingMeta().fieldTranslations.en,
init: 'initial script',
steps: 'steps',
},
@@ -81,11 +81,11 @@ export class SCTourMeta
*/
fieldValueTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
...new SCThingMeta().fieldValueTranslations.de,
type: 'Tour',
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
...new SCThingMeta().fieldValueTranslations.en,
type: SCThingType.Tour,
},
};

View File

@@ -12,17 +12,19 @@
* 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 {SCLanguage, SCMetaTranslations} from '../general/i18n';
import {SCLanguage, SCMetaTranslations, SCTranslations} from '../general/i18n';
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 {SCAcademicPriceGroup, SCThingThatCanBeOffered, SCThingThatCanBeOfferedMeta, SCThingThatCanBeOfferedTranslatableProperties, SCThingThatCanBeOfferedWithoutReferences} from './abstract/thing-that-can-be-offered';
import {SCPersonWithoutReferences} from './person';
/**
* A video without references
*/
export interface SCVideoWithoutReferences
extends SCCreativeWorkWithoutReferences {
extends SCCreativeWorkWithoutReferences,
SCThingThatCanBeOfferedWithoutReferences {
/**
* The Duration of the Video
*/
@@ -52,6 +54,11 @@ export interface SCVideoWithoutReferences
*/
transcript?: string;
/**
* Translated fields of a video
*/
translations?: SCTranslations<SCVideoTranslatableFields>;
/**
* Type of an Video
*/
@@ -123,18 +130,34 @@ export interface SCVideoTrack {
* @indexable
*/
export interface SCVideo
extends SCCreativeWork, SCVideoWithoutReferences {
extends SCCreativeWork,
SCThingThatCanBeOffered<SCAcademicPriceGroup>,
SCVideoWithoutReferences {
/**
* Persons acting in the Video
*/
actors?: SCPersonWithoutReferences[];
/**
* Translated fields of a video
*/
translations?: SCTranslations<SCVideoTranslatableFields>;
/**
* Type of a video
*/
type: SCThingType.Video;
}
/**
* Translatable properties of a video
*/
export interface SCVideoTranslatableFields
extends SCCreativeWorkTranslatableProperties,
SCThingThatCanBeOfferedTranslatableProperties {
}
/**
* Meta information about a video
*/
@@ -146,8 +169,9 @@ export class SCVideoMeta
*/
fieldTranslations = {
de: {
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations
...new SCCreativeWorkMeta().fieldTranslations
.de,
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldTranslations.de,
actors: 'Darsteller',
duration: 'Dauer',
sources: 'Quellen',
@@ -156,8 +180,9 @@ export class SCVideoMeta
transcript: 'Transkript',
},
en: {
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations
...new SCCreativeWorkMeta().fieldTranslations
.en,
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldTranslations.en,
actors: 'actors',
duration: 'duration',
sources: 'sources',
@@ -172,12 +197,16 @@ export class SCVideoMeta
*/
fieldValueTranslations = {
de: {
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
...new SCCreativeWorkMeta()
.fieldValueTranslations.de,
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
.fieldValueTranslations.de,
type: 'Video',
},
en: {
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
...new SCCreativeWorkMeta()
.fieldValueTranslations.en,
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>()
.fieldValueTranslations.en,
type: SCThingType.Video,
},

View File

@@ -12,8 +12,8 @@
* 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 clone = require('fast-clone');
import equal = require('fast-deep-equal/es6');
import clone = require('rfdc');
import {Defined, TSOCType} from 'ts-optchain';
import {SCLanguageCode} from './general/i18n';
import {isThing} from './guards';
@@ -77,6 +77,13 @@ export class SCThingTranslator {
this.sourceCache = new LRUCache(cacheCapacity);
this._language = language;
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 {
if (thingType in this.metaClasses) {
return new (this.metaClasses as any)[thingType]();
return this.metaClasses[thingType];
}
return undefined;
@@ -234,7 +241,7 @@ export class SCThingTranslator {
return cachedInstance as T;
}
}
const translatedInstance = this.translateThingInPlaceDestructively(clone(thing));
const translatedInstance = this.translateThingInPlaceDestructively(clone()(thing));
delete translatedInstance.translations;
this.cache.putObject(translatedInstance);
this.sourceCache.putObject(thing);
@@ -267,7 +274,7 @@ export class SCThingTranslator {
return this.deeptranslate((objTranslatedFromCache as any)[key]);
}
}
const objTranslated = this.translateThingInPlaceDestructively(clone(obj));
const objTranslated = this.translateThingInPlaceDestructively(clone()(obj));
this.cache.putObject(objTranslated);
this.sourceCache.putObject(thing);

View File

@@ -16,13 +16,13 @@
}
],
"firstPublished": "2008",
"sameAs": "https://hds2test.hebis.de/ubffm/Record/HEB198305427",
"sameAs": "https://ubffm.hds.hebis.de/Record/HEB198305427",
"origin": {
"indexed": "2018-09-11T12:30:00Z",
"name": "HeBIS HDS",
"originalId": "HEB198305427",
"type": "remote",
"url": "https://hds2.hebis.de/ubffm/"
"url": "https://ubffm.hds.hebis.de"
},
"isPartOf": {
"uid": "bc5e5399-a24c-5c01-9c1b-0c8b83272087",

View File

@@ -16,13 +16,13 @@
}
],
"firstPublished": "2002",
"sameAs": "https://hds2test.hebis.de/ubffm/Record/HEB107025590",
"sameAs": "https://ubffm.hds.hebis.de/Record/HEB107025590",
"origin": {
"indexed": "2018-09-11T12:30:00Z",
"name": "HeBIS HDS",
"originalId": "HEB107025590",
"type": "remote",
"url": "https://hds2.hebis.de/ubffm/"
"url": "https://ubffm.hds.hebis.de"
},
"isPartOf": {
"uid": "f84c1851-042e-542f-ba7a-158b32dfb82f",

View File

@@ -16,6 +16,7 @@
}
],
"firstPublished": "[ca. 1991]",
"lastPublished": "2000 Q1",
"publications": [
{
"uid": "603a6574-8910-588a-9e83-cd26e6988c74",
@@ -27,13 +28,13 @@
"name": "VDI"
}
],
"sameAs": "https://hds2test.hebis.de/ubffm/Record/HEB022992618",
"sameAs": "https://ubffm.hds.hebis.de/Record/HEB022992618",
"origin": {
"indexed": "2018-09-11T12:30:00Z",
"name": "HeBIS HDS",
"originalId": "HEB022992618",
"type": "remote",
"url": "https://hds2.hebis.de/ubffm/"
"url": "https://ubffm.hds.hebis.de"
}
},
"schema": "SCBook"

View File

@@ -27,7 +27,7 @@
"name": "Belles Lettres"
}
],
"sameAs": "https://hds2test.hebis.de/ubffm/Record/HEB102248788",
"sameAs": "https://ubffm.hds.hebis.de/Record/HEB102248788",
"ISBNs": [
"2251760385"
],
@@ -36,7 +36,7 @@
"name": "HeBIS HDS",
"originalId": "HEB102248788",
"type": "remote",
"url": "https://hds2.hebis.de/ubffm/"
"url": "https://ubffm.hds.hebis.de"
}
},
"schema": "SCBook"

View File

@@ -5,7 +5,7 @@
"instance": {
"type": "message",
"invalid-non-existing-key-in-schema": 1,
"uid": "4706ef24-b631-5c20-91d1-3c627decca5a",
"uid": "4706ef24-b631-5c20-91d1-3c627deccf5a",
"image": "https://backend/res/img/message_small.png",
"name": "Lösung für das Problem des Zurücksetzens der StApps-App gefunden",
"messageBody": "Wie bereits berichtet, klagten User über das Löschen ihres Stundenplans beim Update von Version 0.8.0 auf 0.8.1. Wir haben eine Lösung für das Problem gefunden und testen diese ausführlich bis zum Ende dieser Woche. Wenn alles glatt verläuft, dann kommt am Wochenende die fehlerbereinige Version 0.8.2 heraus.\n\n*(25.Okt 2016)*",

View File

@@ -5,7 +5,7 @@
"instance": {
"type": "message",
"invalid-non-existing-key-in-schema": 1,
"uid": "4706ef24-b631-5c20-91d1-3c627decca5a",
"uid": "4706ef24-b631-5c20-91d1-3c627deccfff",
"image": "https://backend/res/img/message_small.png",
"name": "Lösung für das Problem des Zurücksetzens der StApps-App gefunden",
"messageBody": "Wie bereits berichtet, klagten User über das Löschen ihres Stundenplans beim Update von Version 0.8.0 auf 0.8.1. Wir haben eine Lösung für das Problem gefunden und testen diese ausführlich bis zum Ende dieser Woche. Wenn alles glatt verläuft, dann kommt am Wochenende die fehlerbereinige Version 0.8.2 heraus.\n\n*(25.Okt 2016)*",

View File

@@ -22,13 +22,13 @@
"ISSNs": [
"0024-6085"
],
"sameAs": "https://hds2test.hebis.de/ubffm/Record/HEB046847146",
"sameAs": "https://ubffm.hds.hebis.de/Record/HEB046847146",
"origin": {
"indexed": "2018-09-11T12:30:00Z",
"name": "HeBIS HDS",
"originalId": "HEB046847146",
"type": "remote",
"url": "https://hds2.hebis.de/ubffm/"
"url": "https://ubffm.hds.hebis.de"
}
},
"schema": "SCPeriodical"

View File

@@ -19,13 +19,13 @@
"name": "Frankfurter Allg. Zeitung"
}
],
"sameAs": "https://hds2test.hebis.de/ubffm/Record/HEB048624853",
"sameAs": "https://ubffm.hds.hebis.de/Record/HEB048624853",
"origin": {
"indexed": "2018-09-11T12:30:00Z",
"name": "HeBIS HDS",
"originalId": "HEB048624853",
"type": "remote",
"url": "https://hds2.hebis.de/ubffm/"
"url": "https://ubffm.hds.hebis.de"
}
},
"schema": "SCPeriodical"

View File

@@ -21,26 +21,26 @@ import {SCThingUpdateRoute} from '../src/protocol/routes/thing-update';
@suite(timeout(10000), slow(5000))
export class RoutesSpec {
@test
public bulkAddRouteUrlFragment() {
public bulkAddRouteUrlPath() {
const bulkAddRoute = new SCBulkAddRoute();
expect(bulkAddRoute.getUrlFragment({
expect(bulkAddRoute.getUrlPath({
UID: '540862f3-ea30-5b8f-8678-56b4dc217140',
})).to.equal('/bulk/540862f3-ea30-5b8f-8678-56b4dc217140');
}
@test
public bulkRouteUrlFragment() {
public bulkRouteUrlPath() {
const bulkRoute = new SCBulkRoute();
expect(bulkRoute.getUrlFragment()).to.equal('/bulk');
expect(bulkRoute.getUrlPath()).to.equal('/bulk');
}
@test
public thingUpdateRouteUrlFragment() {
public thingUpdateRouteUrlPath() {
const thingUpdateRoute = new SCThingUpdateRoute();
expect(thingUpdateRoute.getUrlFragment({
expect(thingUpdateRoute.getUrlPath({
TYPE: 'dish',
UID: '540862f3-ea30-5b8f-8678-56b4dc217140',
})).to.equal('/dish/540862f3-ea30-5b8f-8678-56b4dc217140');
@@ -51,7 +51,7 @@ export class RoutesSpec {
const thingUpdateRoute = new SCThingUpdateRoute();
const fn = () => {
thingUpdateRoute.getUrlFragment({
thingUpdateRoute.getUrlPath({
FOO: 'bar',
TYPE: 'dish',
UID: '540862f3-ea30-5b8f-8678-56b4dc217140',
@@ -66,7 +66,7 @@ export class RoutesSpec {
const thingUpdateRoute = new SCThingUpdateRoute();
const fn = () => {
thingUpdateRoute.getUrlFragment({
thingUpdateRoute.getUrlPath({
TYPO: 'dish',
UID: '540862f3-ea30-5b8f-8678-56b4dc217140',
});

View File

@@ -13,7 +13,7 @@
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {expect} from 'chai';
import clone = require('fast-clone');
import clone from 'rfdc';
import {slow, suite, test, timeout} from '@testdeck/mocha';
import {SCThingOriginType, SCThingType, SCThingRemoteOrigin} from '../src/things/abstract/thing';
import {SCBuildingWithoutReferences} from '../src/things/building';
@@ -264,7 +264,7 @@ export class TranslationSpecInplace {
@test
public reaccessWithChangedSourceOmitsLRUCache() {
const translatorDE = new SCThingTranslator('de');
const dishCopy = clone(dish);
const dishCopy = clone()(dish);
const translatedDish = translatorDE.translatedAccess(dish);
const distructivelyTranslatedDish = translatorDE.translate(dish);
@@ -304,8 +304,8 @@ export class MetaTranslationSpec {
const dishMetaTranslationsDE = translator.translatedPropertyNames(dish.type);
const dishMetaTranslationsEN = translatorEN.translatedPropertyNames(dish.type);
expect(dishMetaTranslationsEN).to.not.deep.equal(dishMetaTranslationsDE);
expect(dishMetaTranslationsDE).to.deep.equal(SCDishMeta.getInstance().fieldTranslations.de);
expect(dishMetaTranslationsEN).to.deep.equal(SCDishMeta.getInstance().fieldTranslations.en);
expect(dishMetaTranslationsDE).to.deep.equal(new SCDishMeta().fieldTranslations.de);
expect(dishMetaTranslationsEN).to.deep.equal(new SCDishMeta().fieldTranslations.en);
}
@test
@@ -313,9 +313,9 @@ export class MetaTranslationSpec {
const dishTypeDE = translator.translatedPropertyValue(dish.type, 'type');
const dishTypeEN = translatorEN.translatedPropertyValue(dish.type, 'type', undefined);
const dishTypeBASE = translatorWithFallback.translatedPropertyValue(dish.type, 'type');
expect(dishTypeDE).to.deep.equal(SCDishMeta.getInstance().fieldValueTranslations.de.type);
expect(dishTypeEN).to.deep.equal(SCDishMeta.getInstance().fieldValueTranslations.en.type);
expect(dishTypeBASE).to.deep.equal(SCDishMeta.getInstance().fieldValueTranslations.en.type);
expect(dishTypeDE).to.deep.equal(new SCDishMeta().fieldValueTranslations.de.type);
expect(dishTypeEN).to.deep.equal(new SCDishMeta().fieldValueTranslations.en.type);
expect(dishTypeBASE).to.deep.equal(new SCDishMeta().fieldValueTranslations.en.type);
}
@test
@@ -323,14 +323,14 @@ export class MetaTranslationSpec {
const dishTypeDE = translator.translatedPropertyValue(dish.type, 'categories', 'main dish');
const dishTypeEN = translatorEN.translatedPropertyValue(dish.type, 'categories', 'main dish');
const dishTypeBASE = translatorWithFallback.translatedPropertyValue(dish.type, 'categories', 'main dish');
expect(dishTypeDE).to.deep.equal(SCDishMeta.getInstance<SCDishMeta>().fieldValueTranslations.de.categories['main dish']);
expect(dishTypeDE).to.deep.equal(new SCDishMeta().fieldValueTranslations.de.categories['main dish']);
expect(dishTypeEN).to.deep.equal(dish.categories[0]);
expect(dishTypeBASE).to.deep.equal(dish.categories[0]);
}
@test
public thingWithoutMetaClass() {
const dishCopy = clone(dish);
const dishCopy = clone()(dish);
const typeNonExistant = eval("(x) => x + 'typeNonExistant';");
// this will assign a non existant SCThingType to dishCopy
dishCopy.type = typeNonExistant();