diff --git a/src/things/abstract/creative-work.ts b/src/things/abstract/creative-work.ts index d61a2649..2ac9b773 100644 --- a/src/things/abstract/creative-work.ts +++ b/src/things/abstract/creative-work.ts @@ -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 @@ -88,7 +82,7 @@ export interface SCCreativeWorkWithoutReferences * A creative work */ export interface SCCreativeWork - extends SCCreativeWorkWithoutReferences, SCThingThatCanBeOffered { + extends SCCreativeWorkWithoutReferences, SCThing { /** * Authors of the creative work */ @@ -124,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 * @@ -144,7 +138,6 @@ export class SCCreativeWorkMeta fieldTranslations = { de: { ...SCThingMeta.getInstance().fieldTranslations.de, - ...SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.de, name: 'Titel', authors: 'beteiligte Personen', availableLanguages: 'verfügbare Übersetzungen', @@ -161,7 +154,6 @@ export class SCCreativeWorkMeta }, en: { ...SCThingMeta.getInstance().fieldTranslations.en, - ...SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.en, name: 'title', authors: 'involved persons', availableLanguages: 'available languages', @@ -184,11 +176,9 @@ export class SCCreativeWorkMeta fieldValueTranslations = { de: { ...SCThingMeta.getInstance().fieldValueTranslations.de, - ...SCThingThatCanBeOfferedMeta.getInstance().fieldValueTranslations.de, }, en: { ...SCThingMeta.getInstance().fieldValueTranslations.en, - ...SCThingThatCanBeOfferedMeta.getInstance().fieldValueTranslations.en, }, }; } diff --git a/src/things/article.ts b/src/things/article.ts index bd65d278..484a07cd 100644 --- a/src/things/article.ts +++ b/src/things/article.ts @@ -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 { /** * Article itself as markdown @@ -71,7 +73,9 @@ export interface SCArticleWithoutReferences * @indexable */ export interface SCArticle - extends SCCreativeWork, SCArticleWithoutReferences { + extends SCCreativeWork, + SCThingThatCanBeOffered, + 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 * @@ -119,6 +125,7 @@ export class SCArticleMeta .de, ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.de, + ...SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.de, categories: 'Format', reference: 'Referenz', articleBody: 'Artikelinhalt', @@ -128,6 +135,7 @@ export class SCArticleMeta .en, ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.en, + ...SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.en, categories: 'format', reference: 'reference', articleBody: 'article body', @@ -141,6 +149,8 @@ export class SCArticleMeta de: { ...SCCreativeWorkMeta.getInstance() .fieldValueTranslations.de, + ...SCThingThatCanBeOfferedMeta.getInstance() + .fieldValueTranslations.de, categories: { article: 'Artikel', eArticle: 'E-Aufsatz', @@ -151,6 +161,8 @@ export class SCArticleMeta en: { ...SCCreativeWorkMeta.getInstance() .fieldValueTranslations.en, + ...SCThingThatCanBeOfferedMeta.getInstance() + .fieldValueTranslations.en, type: SCThingType.Article, categories: { article: 'article', diff --git a/src/things/book.ts b/src/things/book.ts index 079f3e2a..c3124b43 100644 --- a/src/things/book.ts +++ b/src/things/book.ts @@ -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 { /** * Categories of a book @@ -93,7 +95,9 @@ export interface SCBookWithoutReferences * @indexable */ export interface SCBook - extends SCCreativeWork, SCBookWithoutReferences { + extends SCCreativeWork, + SCThingThatCanBeOffered, + 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 { } /** @@ -124,6 +130,7 @@ export class SCBookMeta extends SCThingMeta implements SCMetaTranslations().fieldTranslations.de, ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.de, + ...SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.de, categories: 'Format', ISBNs: 'ISBN', numberOfPages: 'Seitenanzahl', @@ -132,6 +139,7 @@ export class SCBookMeta extends SCThingMeta implements SCMetaTranslations().fieldTranslations.en, ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.en, + ...SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.en, categories: 'format', ISBNs: 'ISBN', numberOfPages: 'number of pages', @@ -147,6 +155,8 @@ export class SCBookMeta extends SCThingMeta implements SCMetaTranslations().fieldValueTranslations.de, + ...SCThingThatCanBeOfferedMeta.getInstance() + .fieldValueTranslations.de, categories: { audio: 'Tonträger', book: 'Buch', @@ -174,6 +184,8 @@ export class SCBookMeta extends SCThingMeta implements SCMetaTranslations().fieldValueTranslations.en, + ...SCThingThatCanBeOfferedMeta.getInstance() + .fieldValueTranslations.en, type: SCThingType.Book, categories: { audio: 'audio material', diff --git a/src/things/periodical.ts b/src/things/periodical.ts index c13c49c8..b9c7b822 100644 --- a/src/things/periodical.ts +++ b/src/things/periodical.ts @@ -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 { /** * Categories of a periodical @@ -68,7 +70,9 @@ export interface SCPeriodicalWithoutReferences * @indexable */ export interface SCPeriodical - extends SCCreativeWork, SCPeriodicalWithoutReferences { + extends SCCreativeWork, + SCThingThatCanBeOffered, + 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 { } /** @@ -99,6 +105,7 @@ export class SCPeriodicalMeta extends SCThingMeta implements SCMetaTranslations< ...SCCreativeWorkMeta.getInstance().fieldTranslations.de, ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.de, + ...SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.de, categories: 'Format', ISSNs: 'ISSN', }, @@ -106,6 +113,7 @@ export class SCPeriodicalMeta extends SCThingMeta implements SCMetaTranslations< ...SCCreativeWorkMeta.getInstance().fieldTranslations.en, ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.en, + ...SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.en, categories: 'format', ISSNs: 'ISSN', }, @@ -118,6 +126,8 @@ export class SCPeriodicalMeta extends SCThingMeta implements SCMetaTranslations< de: { ...SCCreativeWorkMeta.getInstance() .fieldValueTranslations.de, + ...SCThingThatCanBeOfferedMeta.getInstance() + .fieldValueTranslations.de, type: 'Periodikum', categories: { electronic: 'E-Journal', @@ -127,6 +137,8 @@ export class SCPeriodicalMeta extends SCThingMeta implements SCMetaTranslations< en: { ...SCCreativeWorkMeta.getInstance() .fieldValueTranslations.en, + ...SCThingThatCanBeOfferedMeta.getInstance() + .fieldValueTranslations.en, type: 'periodical', categories: { electronic: 'E-Journal', diff --git a/src/things/video.ts b/src/things/video.ts index 16b48c03..dd9f1444 100644 --- a/src/things/video.ts +++ b/src/things/video.ts @@ -12,17 +12,19 @@ * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ -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; + /** * Type of an Video */ @@ -123,18 +130,34 @@ export interface SCVideoTrack { * @indexable */ export interface SCVideo - extends SCCreativeWork, SCVideoWithoutReferences { + extends SCCreativeWork, + SCThingThatCanBeOffered, + SCVideoWithoutReferences { /** * Persons acting in the Video */ actors?: SCPersonWithoutReferences[]; + /** + * Translated fields of a video + */ + translations?: SCTranslations; + /** * Type of a video */ type: SCThingType.Video; } +/** + * Translatable properties of a video + */ +export interface SCVideoTranslatableFields +extends SCCreativeWorkTranslatableProperties, + SCThingThatCanBeOfferedTranslatableProperties { +} + + /** * Meta information about a video */ @@ -148,6 +171,7 @@ export class SCVideoMeta de: { ...SCCreativeWorkMeta.getInstance().fieldTranslations .de, + ...SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.de, actors: 'Darsteller', duration: 'Dauer', sources: 'Quellen', @@ -158,6 +182,7 @@ export class SCVideoMeta en: { ...SCCreativeWorkMeta.getInstance().fieldTranslations .en, + ...SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.en, actors: 'actors', duration: 'duration', sources: 'sources', @@ -174,11 +199,15 @@ export class SCVideoMeta de: { ...SCCreativeWorkMeta.getInstance() .fieldValueTranslations.de, + ...SCThingThatCanBeOfferedMeta.getInstance() + .fieldValueTranslations.de, type: 'Video', }, en: { ...SCCreativeWorkMeta.getInstance() .fieldValueTranslations.en, + ...SCThingThatCanBeOfferedMeta.getInstance() + .fieldValueTranslations.en, type: SCThingType.Video, }, };