mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-18 15:42:54 +00:00
refactor: untangle SCCreativeWork inheritance
This commit is contained in:
@@ -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<SCAcademicPriceGroup> {
|
||||
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<SCThingMeta>().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<SCThingMeta>().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<SCThingMeta>().fieldValueTranslations.de,
|
||||
...SCThingThatCanBeOfferedMeta.getInstance().fieldValueTranslations.de,
|
||||
},
|
||||
en: {
|
||||
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
|
||||
...SCThingThatCanBeOfferedMeta.getInstance().fieldValueTranslations.en,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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
|
||||
*
|
||||
@@ -119,6 +125,7 @@ export class SCArticleMeta
|
||||
.de,
|
||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCArticleCategories,
|
||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>().fieldTranslations.de,
|
||||
categories: 'Format',
|
||||
reference: 'Referenz',
|
||||
articleBody: 'Artikelinhalt',
|
||||
@@ -128,6 +135,7 @@ export class SCArticleMeta
|
||||
.en,
|
||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCArticleCategories,
|
||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>().fieldTranslations.en,
|
||||
categories: 'format',
|
||||
reference: 'reference',
|
||||
articleBody: 'article body',
|
||||
@@ -141,6 +149,8 @@ export class SCArticleMeta
|
||||
de: {
|
||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
||||
.fieldValueTranslations.de,
|
||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
|
||||
.fieldValueTranslations.de,
|
||||
categories: {
|
||||
article: 'Artikel',
|
||||
eArticle: 'E-Aufsatz',
|
||||
@@ -151,6 +161,8 @@ export class SCArticleMeta
|
||||
en: {
|
||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
||||
.fieldValueTranslations.en,
|
||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
|
||||
.fieldValueTranslations.en,
|
||||
type: SCThingType.Article,
|
||||
categories: {
|
||||
article: 'article',
|
||||
|
||||
@@ -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 {
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,6 +130,7 @@ export class SCBookMeta extends SCThingMeta implements SCMetaTranslations<SCBook
|
||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations.de,
|
||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBookCategories,
|
||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>().fieldTranslations.de,
|
||||
categories: 'Format',
|
||||
ISBNs: 'ISBN',
|
||||
numberOfPages: 'Seitenanzahl',
|
||||
@@ -132,6 +139,7 @@ export class SCBookMeta extends SCThingMeta implements SCMetaTranslations<SCBook
|
||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations.en,
|
||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBookCategories,
|
||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>().fieldTranslations.en,
|
||||
categories: 'format',
|
||||
ISBNs: 'ISBN',
|
||||
numberOfPages: 'number of pages',
|
||||
@@ -147,6 +155,8 @@ export class SCBookMeta extends SCThingMeta implements SCMetaTranslations<SCBook
|
||||
.fieldValueTranslations.de,
|
||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBookCategories,
|
||||
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
|
||||
.fieldValueTranslations.de,
|
||||
categories: {
|
||||
audio: 'Tonträger',
|
||||
book: 'Buch',
|
||||
@@ -174,6 +184,8 @@ export class SCBookMeta extends SCThingMeta implements SCMetaTranslations<SCBook
|
||||
.fieldValueTranslations.en,
|
||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBookCategories,
|
||||
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
|
||||
.fieldValueTranslations.en,
|
||||
type: SCThingType.Book,
|
||||
categories: {
|
||||
audio: 'audio material',
|
||||
|
||||
@@ -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 {
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -99,6 +105,7 @@ export class SCPeriodicalMeta extends SCThingMeta implements SCMetaTranslations<
|
||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations.de,
|
||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCPeriodicalCategories,
|
||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>().fieldTranslations.de,
|
||||
categories: 'Format',
|
||||
ISSNs: 'ISSN',
|
||||
},
|
||||
@@ -106,6 +113,7 @@ export class SCPeriodicalMeta extends SCThingMeta implements SCMetaTranslations<
|
||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations.en,
|
||||
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCPeriodicalCategories,
|
||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>().fieldTranslations.en,
|
||||
categories: 'format',
|
||||
ISSNs: 'ISSN',
|
||||
},
|
||||
@@ -118,6 +126,8 @@ export class SCPeriodicalMeta extends SCThingMeta implements SCMetaTranslations<
|
||||
de: {
|
||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
||||
.fieldValueTranslations.de,
|
||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
|
||||
.fieldValueTranslations.de,
|
||||
type: 'Periodikum',
|
||||
categories: {
|
||||
electronic: 'E-Journal',
|
||||
@@ -127,6 +137,8 @@ export class SCPeriodicalMeta extends SCThingMeta implements SCMetaTranslations<
|
||||
en: {
|
||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
||||
.fieldValueTranslations.en,
|
||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
|
||||
.fieldValueTranslations.en,
|
||||
type: 'periodical',
|
||||
categories: {
|
||||
electronic: 'E-Journal',
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
@@ -148,6 +171,7 @@ export class SCVideoMeta
|
||||
de: {
|
||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations
|
||||
.de,
|
||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>().fieldTranslations.de,
|
||||
actors: 'Darsteller',
|
||||
duration: 'Dauer',
|
||||
sources: 'Quellen',
|
||||
@@ -158,6 +182,7 @@ export class SCVideoMeta
|
||||
en: {
|
||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations
|
||||
.en,
|
||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>().fieldTranslations.en,
|
||||
actors: 'actors',
|
||||
duration: 'duration',
|
||||
sources: 'sources',
|
||||
@@ -174,11 +199,15 @@ export class SCVideoMeta
|
||||
de: {
|
||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
||||
.fieldValueTranslations.de,
|
||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
|
||||
.fieldValueTranslations.de,
|
||||
type: 'Video',
|
||||
},
|
||||
en: {
|
||||
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>()
|
||||
.fieldValueTranslations.en,
|
||||
...SCThingThatCanBeOfferedMeta.getInstance<SCAcademicPriceGroup>()
|
||||
.fieldValueTranslations.en,
|
||||
type: SCThingType.Video,
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user