mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-19 08:02:55 +00:00
feat: add core
This commit is contained in:
113
src/core/things/AcademicEvent.ts
Normal file
113
src/core/things/AcademicEvent.ts
Normal file
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* Copyright (C) 2018 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCEvent, SCEventWithoutReferences} from '../base/Event';
|
||||
import {
|
||||
SCThingWithCategoriesSpecificValues,
|
||||
SCThingWithCategoriesTranslatableProperties,
|
||||
SCThingWithCategoriesWithoutReferences,
|
||||
} from '../base/ThingWithCategories';
|
||||
import {SCThingMeta} from '../Thing';
|
||||
import {SCTranslations} from '../types/i18n';
|
||||
|
||||
/**
|
||||
* Type of an academic event
|
||||
*/
|
||||
export type SCAcademicEventType = 'academic event';
|
||||
|
||||
/**
|
||||
* An academic event without references
|
||||
*/
|
||||
export interface SCAcademicEventWithoutReferences
|
||||
extends SCEventWithoutReferences,
|
||||
SCThingWithCategoriesWithoutReferences<SCAcademicEventCategories,
|
||||
SCThingWithCategoriesSpecificValues> {
|
||||
/**
|
||||
* Majors of the academic event that this event belongs to
|
||||
*/
|
||||
majors?: string[];
|
||||
|
||||
/**
|
||||
* Original unmapped category from the source of the academic event
|
||||
*/
|
||||
originalCategory?: string;
|
||||
|
||||
/**
|
||||
* Translated fields of an academic event
|
||||
*/
|
||||
translations?: SCTranslations<SCAcademicEventTranslatableProperties>;
|
||||
|
||||
/**
|
||||
* Type of an academic event
|
||||
*/
|
||||
type: SCAcademicEventType;
|
||||
}
|
||||
|
||||
export interface SCAcademicEvent extends SCEvent, SCAcademicEventWithoutReferences {
|
||||
/**
|
||||
* Translated fields of an academic event
|
||||
*/
|
||||
translations?: SCTranslations<SCAcademicEventTranslatableProperties>;
|
||||
|
||||
/**
|
||||
* Type of an academic event
|
||||
*/
|
||||
type: SCAcademicEventType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Event meta data
|
||||
*/
|
||||
export class SCAcademicEventMeta extends SCThingMeta {
|
||||
static fieldValueTranslations = {
|
||||
...SCThingMeta.fieldValueTranslations,
|
||||
de: {
|
||||
type: 'Event',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Categories of academic events
|
||||
*/
|
||||
export type SCAcademicEventCategories =
|
||||
'lecture'
|
||||
| 'seminar'
|
||||
| 'integrated course'
|
||||
| 'written exam'
|
||||
| 'tutorial'
|
||||
| 'project'
|
||||
| 'colloquium'
|
||||
| 'practicum'
|
||||
| 'introductory class'
|
||||
| 'course'
|
||||
| 'practicum introduction'
|
||||
| 'excursion'
|
||||
| 'special';
|
||||
|
||||
/**
|
||||
* Translatable properties of an academic event
|
||||
*/
|
||||
export interface SCAcademicEventTranslatableProperties
|
||||
extends SCThingWithCategoriesTranslatableProperties {
|
||||
/**
|
||||
* Translations of the majors of the academic event that this event belongs to
|
||||
*/
|
||||
majors?: string[];
|
||||
|
||||
/**
|
||||
* Translation of the original unmapped category from the source of the academic event
|
||||
*/
|
||||
originalCategory?: string;
|
||||
}
|
||||
98
src/core/things/Article.ts
Normal file
98
src/core/things/Article.ts
Normal file
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* Copyright (C) 2018 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {
|
||||
SCCreativeWork,
|
||||
SCCreativeWorkTranslatableProperties,
|
||||
SCCreativeWorkWithoutReferences,
|
||||
} from '../base/CreativeWork';
|
||||
import {
|
||||
SCThingWithCategoriesSpecificValues,
|
||||
SCThingWithCategoriesTranslatableProperties,
|
||||
SCThingWithCategoriesWithoutReferences,
|
||||
} from '../base/ThingWithCategories';
|
||||
import {SCThingMeta} from '../Thing';
|
||||
import {SCTranslations} from '../types/i18n';
|
||||
|
||||
/**
|
||||
* Type of an article
|
||||
*/
|
||||
export type SCArticleType = 'article';
|
||||
|
||||
/**
|
||||
* An article without references
|
||||
*/
|
||||
export interface SCArticleWithoutReferences
|
||||
extends SCCreativeWorkWithoutReferences,
|
||||
SCThingWithCategoriesWithoutReferences<SCArticleCategories,
|
||||
SCThingWithCategoriesSpecificValues> {
|
||||
/**
|
||||
* Article itself as markdown
|
||||
*/
|
||||
articleBody: string;
|
||||
|
||||
/**
|
||||
* Translated fields of an article
|
||||
*/
|
||||
translations?: SCTranslations<SCArticleTranslatableProperties>;
|
||||
|
||||
/**
|
||||
* Type of an article
|
||||
*/
|
||||
type: SCArticleType;
|
||||
}
|
||||
|
||||
/**
|
||||
* An article
|
||||
*/
|
||||
export interface SCArticle extends SCCreativeWork, SCArticleWithoutReferences {
|
||||
/**
|
||||
* Translated fields of an article
|
||||
*/
|
||||
translations?: SCTranslations<SCArticleTranslatableProperties>;
|
||||
|
||||
/**
|
||||
* Type of an article
|
||||
*/
|
||||
type: SCArticleType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Meta information about an article
|
||||
*/
|
||||
export class SCArticleMeta extends SCThingMeta {
|
||||
static fieldTranslations = {
|
||||
...SCThingMeta.fieldTranslations,
|
||||
de: {
|
||||
articleBody: 'Artikeltext',
|
||||
categories: 'Kategorien',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Categories of articles
|
||||
*/
|
||||
export type SCArticleCategories = 'unipedia';
|
||||
|
||||
/**
|
||||
* Translatable properties of creative works
|
||||
*/
|
||||
export interface SCArticleTranslatableProperties
|
||||
extends SCThingWithCategoriesTranslatableProperties, SCCreativeWorkTranslatableProperties {
|
||||
/**
|
||||
* Translation of the article itself as markdown
|
||||
*/
|
||||
articleBody?: string[];
|
||||
}
|
||||
103
src/core/things/Book.ts
Normal file
103
src/core/things/Book.ts
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* Copyright (C) 2018 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {
|
||||
SCCreativeWork,
|
||||
SCCreativeWorkTranslatableProperties,
|
||||
SCCreativeWorkWithoutReferences,
|
||||
} from '../base/CreativeWork';
|
||||
import {SCThingWithCategoriesTranslatableProperties} from '../base/ThingWithCategories';
|
||||
import {SCThingMeta} from '../Thing';
|
||||
import {SCTranslations} from '../types/i18n';
|
||||
import {SCPersonWithoutReferences} from './Person';
|
||||
|
||||
/**
|
||||
* Type of a book
|
||||
*/
|
||||
export type SCBookType = 'book';
|
||||
|
||||
/**
|
||||
* A book without references
|
||||
*/
|
||||
export interface SCBookWithoutReferences extends SCCreativeWorkWithoutReferences {
|
||||
/**
|
||||
* Edition of a book
|
||||
*/
|
||||
bookEdition?: string;
|
||||
|
||||
/**
|
||||
* ISBN of a book
|
||||
*/
|
||||
isbn: string;
|
||||
|
||||
/**
|
||||
* Number of pages of a book
|
||||
*/
|
||||
numberOfPages?: number;
|
||||
|
||||
/**
|
||||
* Translated properties of a book
|
||||
*/
|
||||
translations?: SCTranslations<SCBookTranslatableFields>;
|
||||
|
||||
/**
|
||||
* Type of a book
|
||||
*/
|
||||
type: SCBookType;
|
||||
}
|
||||
|
||||
/**
|
||||
* A book
|
||||
*/
|
||||
export interface SCBook extends SCCreativeWork, SCBookWithoutReferences {
|
||||
/**
|
||||
* Authors of the creative work
|
||||
*/
|
||||
authors: SCPersonWithoutReferences[];
|
||||
|
||||
/**
|
||||
* Translated properties of a book
|
||||
*/
|
||||
translations?: SCTranslations<SCBookTranslatableFields>;
|
||||
|
||||
/**
|
||||
* Type of a book
|
||||
*/
|
||||
type: SCBookType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Meta information about a book
|
||||
*/
|
||||
export class SCBookMeta extends SCThingMeta {
|
||||
static fieldTranslations = {
|
||||
...SCThingMeta.fieldTranslations,
|
||||
de: {
|
||||
bookEdition: 'Edition',
|
||||
isbn: 'ISBN',
|
||||
numberOfPages: 'Seitenanzahl',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Translatable properties of a book
|
||||
*/
|
||||
export interface SCBookTranslatableFields
|
||||
extends SCThingWithCategoriesTranslatableProperties, SCCreativeWorkTranslatableProperties {
|
||||
/**
|
||||
* Translation of an edition of a book
|
||||
*/
|
||||
bookEdition?: string;
|
||||
}
|
||||
83
src/core/things/Building.ts
Normal file
83
src/core/things/Building.ts
Normal file
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright (C) 2018 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCPlaceWithoutReferences} from '../base/Place';
|
||||
import {
|
||||
SCThingWithCategoriesSpecificValues,
|
||||
SCThingWithCategoriesTranslatableProperties,
|
||||
SCThingWithCategoriesWithoutReferences,
|
||||
} from '../base/ThingWithCategories';
|
||||
import {SCThingMeta} from '../Thing';
|
||||
import {SCTranslations} from '../types/i18n';
|
||||
|
||||
export type SCBuildingType = 'building';
|
||||
|
||||
export type SCBuildingCategories =
|
||||
'cafe'
|
||||
| 'education'
|
||||
| 'library'
|
||||
| 'office'
|
||||
| 'canteen'
|
||||
| 'student canteen'
|
||||
| 'restaurant'
|
||||
| 'restroom';
|
||||
|
||||
export interface SCBuildingWithoutReferences
|
||||
extends SCThingWithCategoriesWithoutReferences<SCBuildingCategories,
|
||||
SCThingWithCategoriesSpecificValues>,
|
||||
SCPlaceWithoutReferences {
|
||||
/**
|
||||
* Categories of a building
|
||||
*/
|
||||
categories: SCBuildingCategories[];
|
||||
|
||||
/**
|
||||
* List of floor names of the place
|
||||
*/
|
||||
floors?: string[];
|
||||
|
||||
/**
|
||||
* Translated fields of a building
|
||||
*/
|
||||
translations?: SCTranslations<SCThingWithCategoriesTranslatableProperties>;
|
||||
|
||||
/**
|
||||
* Type of the building
|
||||
*/
|
||||
type: SCBuildingType;
|
||||
}
|
||||
|
||||
export interface SCBuilding extends SCBuildingWithoutReferences {
|
||||
}
|
||||
|
||||
/**
|
||||
* Meta information about a place
|
||||
*/
|
||||
export class SCBuildingMeta extends SCThingMeta {
|
||||
static fieldValueTranslations = {
|
||||
...SCThingMeta.fieldValueTranslations,
|
||||
de: {
|
||||
categories: {
|
||||
'cafe': 'Café',
|
||||
'canteen': 'Kantine',
|
||||
'education': 'Bildung',
|
||||
'library': 'Bibliothek',
|
||||
'office': 'Büro',
|
||||
'restaurant': 'Restaurant',
|
||||
'restroom': 'Toilette',
|
||||
'student canteen': 'Mensa',
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
72
src/core/things/Catalog.ts
Normal file
72
src/core/things/Catalog.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Copyright (C) 2018 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCAcademicTermWithoutReferences} from '../base/AcademicTerm';
|
||||
import {SCThingWithCategoriesSpecificValues, SCThingWithCategoriesWithoutReferences} from '../base/ThingWithCategories';
|
||||
import {SCThingMeta} from '../Thing';
|
||||
|
||||
/**
|
||||
* Type of a catalog
|
||||
*/
|
||||
export type SCCatalogType = 'catalog';
|
||||
|
||||
/**
|
||||
* A catalog without references
|
||||
*/
|
||||
export interface SCCatalogWithoutReferences
|
||||
extends SCThingWithCategoriesWithoutReferences<SCCatalogCategories,
|
||||
SCThingWithCategoriesSpecificValues> {
|
||||
/**
|
||||
* Level of the catalog (0 for 'root catalog', 1 for its subcatalog, 2 for its subcatalog etc.)
|
||||
*
|
||||
* Needed for keeping order in catalog inheritance array.
|
||||
*/
|
||||
level: number;
|
||||
|
||||
/**
|
||||
* Type of a catalog
|
||||
*/
|
||||
type: SCCatalogType;
|
||||
}
|
||||
|
||||
/**
|
||||
* A catalog
|
||||
*/
|
||||
export interface SCCatalog extends SCCatalogWithoutReferences {
|
||||
/**
|
||||
* Academic term that a catalog belongs to (e.g. semester)
|
||||
*/
|
||||
academicTerm?: SCAcademicTermWithoutReferences;
|
||||
|
||||
/**
|
||||
* The direct parent of a catalog
|
||||
*/
|
||||
superCatalog?: SCCatalogWithoutReferences;
|
||||
|
||||
/**
|
||||
* An array of catalogs from the 'level 0' (root) catalog to the direct parent
|
||||
*/
|
||||
superCatalogs?: SCCatalogWithoutReferences[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Catalog meta data
|
||||
*/
|
||||
export class SCCatalogMeta extends SCThingMeta {
|
||||
}
|
||||
|
||||
/**
|
||||
* Categories of catalogs
|
||||
*/
|
||||
export type SCCatalogCategories = 'university events';
|
||||
125
src/core/things/DateSeries.ts
Normal file
125
src/core/things/DateSeries.ts
Normal file
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* Copyright (C) 2018 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCThingInPlace} from '../base/ThingInPlace';
|
||||
import {
|
||||
SCAcademicPriceGroup,
|
||||
SCThingThatCanBeOffered,
|
||||
SCThingThatCanBeOfferedTranslatableProperties,
|
||||
} from '../base/ThingThatCanBeOffered';
|
||||
import {SCThingMeta} from '../Thing';
|
||||
import {SCTranslations} from '../types/i18n';
|
||||
import {SCISO8601Date, SCISO8601Duration} from '../types/Time';
|
||||
import {SCAcademicEventWithoutReferences} from './AcademicEvent';
|
||||
import {SCPersonWithoutReferences} from './Person';
|
||||
import {SCSportCourseWithoutReferences} from './SportCourse';
|
||||
|
||||
/**
|
||||
* Type of a date series
|
||||
*/
|
||||
export type SCDateSeriesType = 'date series';
|
||||
|
||||
/**
|
||||
* Price groups for sport courses
|
||||
*/
|
||||
export interface SCSportCoursePriceGroup extends SCAcademicPriceGroup {
|
||||
/**
|
||||
* Price for alumnis
|
||||
*/
|
||||
alumni: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* A date without references
|
||||
*/
|
||||
export interface SCDateSeriesWithoutReferences
|
||||
extends SCThingThatCanBeOffered<SCSportCoursePriceGroup> {
|
||||
/**
|
||||
* Dates of the date series that are initially planned to be held
|
||||
*/
|
||||
dates: SCISO8601Date[];
|
||||
|
||||
/**
|
||||
* Duration of the date series
|
||||
*/
|
||||
duration: SCISO8601Duration;
|
||||
|
||||
/**
|
||||
* Dates that where initially planned to be held but are cancelled
|
||||
*/
|
||||
exceptions?: SCISO8601Date[];
|
||||
|
||||
/**
|
||||
* Frequency of the date series
|
||||
*/
|
||||
frequency: string;
|
||||
|
||||
/**
|
||||
* Translated properties
|
||||
*/
|
||||
translations?: SCTranslations<SCDateSeriesTranslatableProperties>;
|
||||
|
||||
/**
|
||||
* Type of a date series
|
||||
*/
|
||||
type: SCDateSeriesType;
|
||||
}
|
||||
|
||||
/**
|
||||
* A date series
|
||||
*/
|
||||
export interface SCDateSeries extends SCDateSeriesWithoutReferences, SCThingInPlace {
|
||||
/**
|
||||
* Event to which the date series belongs
|
||||
*/
|
||||
event: SCAcademicEventWithoutReferences
|
||||
| SCSportCourseWithoutReferences;
|
||||
|
||||
/**
|
||||
* Performers of the date series
|
||||
*/
|
||||
performers?: SCPersonWithoutReferences[];
|
||||
|
||||
/**
|
||||
* Translated properties
|
||||
*/
|
||||
translations?: SCTranslations<SCDateSeriesTranslatableProperties>;
|
||||
|
||||
/**
|
||||
* Type of a date series
|
||||
*/
|
||||
type: SCDateSeriesType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date series meta data
|
||||
*/
|
||||
export class SCDateSeriesMeta extends SCThingMeta {
|
||||
static fieldTranslations = {
|
||||
...SCThingMeta.fieldTranslations,
|
||||
de: {
|
||||
dates: 'Einzeltermine',
|
||||
duration: 'Dauer',
|
||||
frequency: 'Wiederholung',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Translatable properties of date series'
|
||||
*/
|
||||
export interface SCDateSeriesTranslatableProperties
|
||||
extends SCThingThatCanBeOfferedTranslatableProperties {
|
||||
frequency?: string;
|
||||
}
|
||||
71
src/core/things/Diff.ts
Normal file
71
src/core/things/Diff.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright (C) 2018 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCThingsWithoutDiff} from '../Classes';
|
||||
import {SCThing, SCThingMeta} from '../Thing';
|
||||
import {SCISO8601Date} from '../types/Time';
|
||||
|
||||
/**
|
||||
* Type of a diff
|
||||
*/
|
||||
export type SCDiffType = 'diff';
|
||||
|
||||
/**
|
||||
* A diff without references
|
||||
*/
|
||||
export interface SCDiffWithoutReferences extends SCThing {
|
||||
/**
|
||||
* Action of the diff
|
||||
*/
|
||||
action: 'changed' | 'removed';
|
||||
|
||||
/**
|
||||
* Diff patch. Only when action === 'changed'
|
||||
*/
|
||||
changes?: jsonpatch.OpPatch[];
|
||||
|
||||
/**
|
||||
* Creation date of the diff.
|
||||
*/
|
||||
dateCreated: SCISO8601Date;
|
||||
|
||||
/**
|
||||
* Type of a diff
|
||||
*/
|
||||
type: SCDiffType;
|
||||
}
|
||||
|
||||
/**
|
||||
* A diff
|
||||
*/
|
||||
export interface SCDiff extends SCDiffWithoutReferences {
|
||||
/**
|
||||
* Original object the diff was generated on
|
||||
*/
|
||||
object: SCThingsWithoutDiff;
|
||||
}
|
||||
|
||||
/**
|
||||
* Diff meta data
|
||||
*/
|
||||
export class SCDiffMeta extends SCThingMeta {
|
||||
static fieldTranslations = {
|
||||
...SCThingMeta.fieldTranslations,
|
||||
de: {
|
||||
action: 'Aktion',
|
||||
changes: 'Änderungen',
|
||||
dateCreated: 'Erstellungsdatum',
|
||||
},
|
||||
};
|
||||
}
|
||||
174
src/core/things/Dish.ts
Normal file
174
src/core/things/Dish.ts
Normal file
@@ -0,0 +1,174 @@
|
||||
/*
|
||||
* Copyright (C) 2018 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCThingInPlace} from '../base/ThingInPlace';
|
||||
import {
|
||||
SCAcademicPriceGroup,
|
||||
SCThingThatCanBeOffered,
|
||||
SCThingThatCanBeOfferedTranslatableProperties,
|
||||
} from '../base/ThingThatCanBeOffered';
|
||||
import {
|
||||
SCThingWithCategoriesSpecificValues,
|
||||
SCThingWithCategoriesTranslatableProperties,
|
||||
SCThingWithCategoriesWithoutReferences,
|
||||
} from '../base/ThingWithCategories';
|
||||
import {SCThingMeta} from '../Thing';
|
||||
import {SCTranslations} from '../types/i18n';
|
||||
|
||||
/**
|
||||
* Type of a dish
|
||||
*/
|
||||
export type SCDishType = 'dish';
|
||||
|
||||
/**
|
||||
* A dish without references
|
||||
*/
|
||||
export interface SCDishWithoutReferences
|
||||
extends SCThingWithCategoriesWithoutReferences<SCDishCategories,
|
||||
SCThingWithCategoriesSpecificValues>,
|
||||
SCThingThatCanBeOffered<SCAcademicPriceGroup> {
|
||||
/**
|
||||
* Additives of the dish
|
||||
*/
|
||||
additives?: string[];
|
||||
|
||||
/**
|
||||
* Category of the dish
|
||||
*/
|
||||
categories: SCDishCategories[];
|
||||
|
||||
/**
|
||||
* Characteristics of the dish
|
||||
*/
|
||||
characteristics?: string[];
|
||||
|
||||
/**
|
||||
* Nutrition information (calories and nutrients with amounts)
|
||||
*/
|
||||
nutrition?: SCNutritionInformation;
|
||||
|
||||
/**
|
||||
* Translated fields of a dish
|
||||
*/
|
||||
translations?: SCTranslations<SCDishTranslatableProperties>;
|
||||
|
||||
/**
|
||||
* Type of a dish
|
||||
*/
|
||||
type: SCDishType;
|
||||
}
|
||||
|
||||
/**
|
||||
* A dish
|
||||
*/
|
||||
export interface SCDish extends SCDishWithoutReferences, SCThingInPlace {
|
||||
/**
|
||||
* Dishes ("Beilagen") that are served with the dish (if only certain supplement dishes can be taken with a dish)
|
||||
*/
|
||||
dishAddOns?: SCDishWithoutReferences[];
|
||||
|
||||
/**
|
||||
* Translated fields of a dish
|
||||
*/
|
||||
translations?: SCTranslations<SCDishTranslatableProperties>;
|
||||
|
||||
/**
|
||||
* Type of a dish
|
||||
*/
|
||||
type: SCDishType;
|
||||
}
|
||||
|
||||
export interface SCDishTranslatableProperties
|
||||
extends SCThingWithCategoriesTranslatableProperties, SCThingThatCanBeOfferedTranslatableProperties {
|
||||
}
|
||||
|
||||
/**
|
||||
* Dish meta data
|
||||
*/
|
||||
export class SCDishMeta extends SCThingMeta {
|
||||
static fieldTranslations = {
|
||||
...SCThingMeta.fieldTranslations,
|
||||
de: {
|
||||
categories: 'Kategorien',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of categories for dishes
|
||||
*/
|
||||
export type SCDishCategories =
|
||||
'appetizer'
|
||||
| 'salad'
|
||||
| 'main dish'
|
||||
| 'dessert'
|
||||
| 'soup'
|
||||
| 'side dish';
|
||||
|
||||
/**
|
||||
* A list of categories for drinks
|
||||
*/
|
||||
export type SCDrinkCategories =
|
||||
'wine'
|
||||
| 'beer'
|
||||
| 'coffee'
|
||||
| 'tea'
|
||||
| 'milk drink'
|
||||
| 'juice'
|
||||
| 'short drink'
|
||||
| 'sparkling wine'
|
||||
| 'water'
|
||||
| 'soft drink';
|
||||
|
||||
/**
|
||||
* Type definition for SCNutritionInformation
|
||||
*
|
||||
* @see https://schema.org/NutritionInformation
|
||||
*/
|
||||
export interface SCNutritionInformation {
|
||||
/**
|
||||
* Number of calories contained (in kcal)
|
||||
*/
|
||||
calories?: number;
|
||||
|
||||
/**
|
||||
* Content of carbohydrates (in grams)
|
||||
*/
|
||||
carbohydrateContent?: number;
|
||||
|
||||
/**
|
||||
* Content of fat (in grams)
|
||||
*/
|
||||
fatContent?: number;
|
||||
|
||||
/**
|
||||
* Content of proteins (in grams)
|
||||
*/
|
||||
proteinContent?: number;
|
||||
|
||||
/**
|
||||
* Content of salt (in grams)
|
||||
*/
|
||||
saltContent?: number;
|
||||
|
||||
/**
|
||||
* Content of saturated fat (in grams)
|
||||
*/
|
||||
saturatedFatContent?: number;
|
||||
|
||||
/**
|
||||
* Content of sugar (in grams)
|
||||
*/
|
||||
sugarContent?: number;
|
||||
}
|
||||
78
src/core/things/Favorite.ts
Normal file
78
src/core/things/Favorite.ts
Normal file
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright (C) 2018 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCThing, SCThingMeta} from '../Thing';
|
||||
import {SCISO8601Date} from '../types/Time';
|
||||
import {SCAcademicEventWithoutReferences} from './AcademicEvent';
|
||||
import {SCArticleWithoutReferences} from './Article';
|
||||
import {SCBookWithoutReferences} from './Book';
|
||||
import {SCBuildingWithoutReferences} from './Building';
|
||||
import {SCPersonWithoutReferences} from './Person';
|
||||
import {SCPointOfInterestWithoutReferences} from './PointOfInterest';
|
||||
import {SCRoomWithoutReferences} from './Room';
|
||||
import {SCSportCourseWithoutReferences} from './SportCourse';
|
||||
|
||||
/**
|
||||
* Type of a favorite
|
||||
*/
|
||||
export type SCFavoriteType = 'favorite';
|
||||
|
||||
/**
|
||||
* A favorite without references
|
||||
*/
|
||||
export interface SCFavoriteWithoutReferences extends SCThing {
|
||||
/**
|
||||
* When the favorite was last changed.
|
||||
*/
|
||||
changed: SCISO8601Date;
|
||||
|
||||
/**
|
||||
* When the favorite was created.
|
||||
*/
|
||||
created: SCISO8601Date;
|
||||
|
||||
/**
|
||||
* If it is deleted or not, defaults to false.
|
||||
*/
|
||||
deleted?: boolean;
|
||||
|
||||
/**
|
||||
* Type of a favorite
|
||||
*/
|
||||
type: SCFavoriteType;
|
||||
}
|
||||
|
||||
/**
|
||||
* A favorite
|
||||
*/
|
||||
export interface SCFavorite extends SCFavoriteWithoutReferences {
|
||||
/**
|
||||
* The contained thing.
|
||||
*/
|
||||
data:
|
||||
SCAcademicEventWithoutReferences
|
||||
| SCArticleWithoutReferences
|
||||
| SCBookWithoutReferences
|
||||
| SCBuildingWithoutReferences
|
||||
| SCPersonWithoutReferences
|
||||
| SCPointOfInterestWithoutReferences
|
||||
| SCRoomWithoutReferences
|
||||
| SCSportCourseWithoutReferences;
|
||||
}
|
||||
|
||||
/**
|
||||
* Meta information about a favorite
|
||||
*/
|
||||
export class SCFavoriteMeta extends SCThingMeta {
|
||||
}
|
||||
103
src/core/things/Floor.ts
Normal file
103
src/core/things/Floor.ts
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* Copyright (C) 2018 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {Feature, FeatureCollection, GeometryObject, LineString} from 'geojson';
|
||||
import {SCThingInPlace} from '../base/ThingInPlace';
|
||||
import {SCThing, SCThingMeta, SCThingTranslatableProperties} from '../Thing';
|
||||
import {SCTranslations} from '../types/i18n';
|
||||
import {SCPointOfInterestWithoutReferences} from './PointOfInterest';
|
||||
import {SCRoomWithoutReferences} from './Room';
|
||||
|
||||
/**
|
||||
* Type of a floor
|
||||
*/
|
||||
export type SCFloorType = 'floor';
|
||||
|
||||
/**
|
||||
* A floor without references
|
||||
*/
|
||||
export interface SCFloorWithoutReferences extends SCThing {
|
||||
/**
|
||||
* Floor name in the place it is in e.g. "first floor", "ground floor". This doesn't reference the building name.
|
||||
*/
|
||||
floorName: string;
|
||||
|
||||
/**
|
||||
* Floor plan
|
||||
*/
|
||||
plan: SCFloorFeatureCollectionWithPlaces<LineString, any>;
|
||||
|
||||
/**
|
||||
* Translated fields of a floor
|
||||
*/
|
||||
translations?: SCTranslations<SCFloorTranslatableProperties>;
|
||||
|
||||
/**
|
||||
* Type of a floor
|
||||
*/
|
||||
type: SCFloorType;
|
||||
}
|
||||
|
||||
/**
|
||||
* A floor
|
||||
*/
|
||||
export interface SCFloor extends SCFloorWithoutReferences, SCThingInPlace {
|
||||
/**
|
||||
* Translated fields of a floor
|
||||
*/
|
||||
translations?: SCTranslations<SCFloorTranslatableProperties>;
|
||||
|
||||
/**
|
||||
* Type of a floor
|
||||
*/
|
||||
type: SCFloorType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Meta information about a floor
|
||||
*/
|
||||
export class SCFloorMeta extends SCThingMeta {
|
||||
}
|
||||
|
||||
/**
|
||||
* A feature collection
|
||||
*/
|
||||
export interface SCFloorFeatureCollectionWithPlaces<T extends GeometryObject, P = any>
|
||||
extends FeatureCollection<T, P> {
|
||||
/**
|
||||
* Features of the collection
|
||||
*/
|
||||
features: Array<SCFloorFeatureWithPlace<T, P>>;
|
||||
}
|
||||
|
||||
/***
|
||||
* A feature with a place
|
||||
*/
|
||||
export interface SCFloorFeatureWithPlace<T extends GeometryObject, P = any>
|
||||
extends Feature<T, P> {
|
||||
/**
|
||||
* The place of the feature
|
||||
*/
|
||||
place?: SCRoomWithoutReferences | SCPointOfInterestWithoutReferences;
|
||||
}
|
||||
|
||||
/**
|
||||
* Translatable properties of a floor
|
||||
*/
|
||||
export interface SCFloorTranslatableProperties extends SCThingTranslatableProperties {
|
||||
/**
|
||||
* Translation of the floor name
|
||||
*/
|
||||
floorName?: string;
|
||||
}
|
||||
98
src/core/things/Message.ts
Normal file
98
src/core/things/Message.ts
Normal file
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* Copyright (C) 2018 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {
|
||||
SCCreativeWork,
|
||||
SCCreativeWorkTranslatableProperties,
|
||||
SCCreativeWorkWithoutReferences,
|
||||
} from '../base/CreativeWork';
|
||||
import {SCThingThatCanBeOfferedTranslatableProperties} from '../base/ThingThatCanBeOffered';
|
||||
import {SCThingMeta} from '../Thing';
|
||||
import {SCTranslations} from '../types/i18n';
|
||||
import {SCISO8601Date} from '../types/Time';
|
||||
|
||||
/**
|
||||
* Type of a message
|
||||
*/
|
||||
export type SCMessageType = 'message';
|
||||
|
||||
/**
|
||||
* A message without references
|
||||
*/
|
||||
export interface SCMessageWithoutReferences extends SCCreativeWorkWithoutReferences {
|
||||
/**
|
||||
* Audience of the message
|
||||
*/
|
||||
audiences: SCMessageAudience[];
|
||||
|
||||
/**
|
||||
* When the message was created
|
||||
*/
|
||||
dateCreated?: SCISO8601Date;
|
||||
|
||||
/**
|
||||
* Message itself
|
||||
*/
|
||||
message: string;
|
||||
|
||||
/**
|
||||
* Translated fields of a message
|
||||
*/
|
||||
translations?: SCTranslations<SCMessageTranslatableProperties>;
|
||||
|
||||
/**
|
||||
* Type of a message
|
||||
*/
|
||||
type: SCMessageType;
|
||||
}
|
||||
|
||||
/**
|
||||
* A message
|
||||
*/
|
||||
export interface SCMessage extends SCCreativeWork, SCMessageWithoutReferences {
|
||||
/**
|
||||
* Translated fields of a message
|
||||
*/
|
||||
translations?: SCTranslations<SCMessageTranslatableProperties>;
|
||||
|
||||
/**
|
||||
* Type of a message
|
||||
*/
|
||||
type: SCMessageType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Meta information about a message
|
||||
*/
|
||||
export class SCMessageMeta extends SCThingMeta {
|
||||
}
|
||||
|
||||
/**
|
||||
* Audiences for messages
|
||||
*/
|
||||
export type SCMessageAudience =
|
||||
'students'
|
||||
| 'employees'
|
||||
| 'guests';
|
||||
|
||||
/**
|
||||
* Translatable properties of a message
|
||||
*/
|
||||
export interface SCMessageTranslatableProperties
|
||||
extends SCCreativeWorkTranslatableProperties, SCThingThatCanBeOfferedTranslatableProperties {
|
||||
/**
|
||||
* Message itself
|
||||
*/
|
||||
message?: string;
|
||||
}
|
||||
47
src/core/things/Organization.ts
Normal file
47
src/core/things/Organization.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (C) 2018 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCThingInPlace} from '../base/ThingInPlace';
|
||||
import {SCThing, SCThingMeta} from '../Thing';
|
||||
|
||||
/**
|
||||
* Type of an organization
|
||||
*/
|
||||
export type SCOrganizationType = 'organization';
|
||||
|
||||
/**
|
||||
* An organization without references
|
||||
*/
|
||||
export interface SCOrganizationWithoutReferences extends SCThing {
|
||||
/**
|
||||
* Type of an organization
|
||||
*/
|
||||
type: SCOrganizationType;
|
||||
}
|
||||
|
||||
/**
|
||||
* An organization
|
||||
*/
|
||||
export interface SCOrganization extends SCOrganizationWithoutReferences, SCThingInPlace {
|
||||
/**
|
||||
* Type of an organization
|
||||
*/
|
||||
type: SCOrganizationType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Meta information about an organization
|
||||
*/
|
||||
export class SCOrganizationMeta extends SCThingMeta {
|
||||
}
|
||||
177
src/core/things/Person.ts
Normal file
177
src/core/things/Person.ts
Normal file
@@ -0,0 +1,177 @@
|
||||
/*
|
||||
* Copyright (C) 2018 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCThing, SCThingMeta} from '../Thing';
|
||||
import {SCNationality} from '../types/i18n';
|
||||
import {SCISO8601Date} from '../types/Time';
|
||||
import {SCBuildingWithoutReferences} from './Building';
|
||||
import {SCOrganizationWithoutReferences} from './Organization';
|
||||
import {SCPointOfInterestWithoutReferences} from './PointOfInterest';
|
||||
import {SCRoomWithoutReferences} from './Room';
|
||||
|
||||
/**
|
||||
* Type of a person
|
||||
*/
|
||||
export type SCPersonType = 'person';
|
||||
|
||||
/**
|
||||
* A person without references
|
||||
*/
|
||||
export interface SCPersonWithoutReferences extends SCThing {
|
||||
/**
|
||||
* Additional first names of the person.
|
||||
*/
|
||||
additionalName?: string;
|
||||
|
||||
/**
|
||||
* The birth date of the person.
|
||||
*/
|
||||
birthDate?: SCISO8601Date;
|
||||
|
||||
/**
|
||||
* The private email address of the person.
|
||||
*
|
||||
* @TJS-format email
|
||||
*/
|
||||
email?: string;
|
||||
|
||||
/**
|
||||
* The family name of the person.
|
||||
*/
|
||||
familyName: string;
|
||||
|
||||
/**
|
||||
* The private fax number of the person.
|
||||
*/
|
||||
faxNumber?: string;
|
||||
|
||||
/**
|
||||
* The gender of the person.
|
||||
*/
|
||||
gender?: SCPersonGender;
|
||||
|
||||
/**
|
||||
* The first name of the person.
|
||||
*/
|
||||
givenName: string;
|
||||
|
||||
/**
|
||||
* Honorific prefix of the person.
|
||||
*/
|
||||
honorificPrefix?: string;
|
||||
|
||||
/**
|
||||
* Honorific suffix of the person.
|
||||
*/
|
||||
honorificSuffix?: string;
|
||||
|
||||
/**
|
||||
* Titles of jobs that the person has.
|
||||
*/
|
||||
jobTitles?: string[];
|
||||
|
||||
/**
|
||||
* The complete name of the person combining all the parts of the name into one.
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* The nationality of the person.
|
||||
*/
|
||||
nationality?: SCNationality;
|
||||
|
||||
/**
|
||||
* The private telephone number of the person.
|
||||
*/
|
||||
telephone?: string;
|
||||
|
||||
/**
|
||||
* Type of a person
|
||||
*/
|
||||
type: SCPersonType;
|
||||
}
|
||||
|
||||
/**
|
||||
* A person
|
||||
*/
|
||||
export interface SCPerson extends SCPersonWithoutReferences {
|
||||
/**
|
||||
* Organization the person works for
|
||||
*/
|
||||
affiliations?: SCOrganizationWithoutReferences[];
|
||||
|
||||
/**
|
||||
* A list of homes of the person
|
||||
*/
|
||||
homeLocations?: Array<SCBuildingWithoutReferences
|
||||
| SCPointOfInterestWithoutReferences
|
||||
| SCRoomWithoutReferences>;
|
||||
|
||||
/**
|
||||
* Locations where the person performs her/his work
|
||||
*/
|
||||
workLocations?: SCContactPoint[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Meta information about a person
|
||||
*/
|
||||
export class SCPersonMeta extends SCThingMeta {
|
||||
}
|
||||
|
||||
/**
|
||||
* A contact point
|
||||
*
|
||||
* @see http://schema.org/ContactPoint
|
||||
*/
|
||||
export interface SCContactPoint {
|
||||
/**
|
||||
* Exact place where work is performed
|
||||
*/
|
||||
areaServed?: SCRoomWithoutReferences;
|
||||
|
||||
/**
|
||||
* E-mail at the work location
|
||||
*/
|
||||
email?: string;
|
||||
|
||||
/**
|
||||
* Fax number at the work location
|
||||
*/
|
||||
faxNumber?: string;
|
||||
|
||||
/**
|
||||
* Times available for contacting at the work location
|
||||
*/
|
||||
hoursAvailable?: string;
|
||||
|
||||
/**
|
||||
* Contact number at the work location
|
||||
*/
|
||||
telephone?: string;
|
||||
|
||||
/**
|
||||
* URL at the work location
|
||||
*/
|
||||
url?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gender of a person
|
||||
*/
|
||||
export type SCPersonGender =
|
||||
'male'
|
||||
| 'female'
|
||||
| 'inter'
|
||||
| 'undefined';
|
||||
77
src/core/things/PointOfInterest.ts
Normal file
77
src/core/things/PointOfInterest.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Copyright (C) 2018 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCPlaceWithoutReferences} from '../base/Place';
|
||||
import {SCThingInPlace} from '../base/ThingInPlace';
|
||||
import {
|
||||
SCThingWithCategoriesSpecificValues,
|
||||
SCThingWithCategoriesTranslatableProperties,
|
||||
SCThingWithCategoriesWithoutReferences,
|
||||
} from '../base/ThingWithCategories';
|
||||
import {SCThingMeta} from '../Thing';
|
||||
import {SCTranslations} from '../types/i18n';
|
||||
|
||||
/**
|
||||
* Type of a point of interest
|
||||
*/
|
||||
export type SCPointOfInterestType = 'point of interest';
|
||||
|
||||
/**
|
||||
* A point of interest without references
|
||||
*/
|
||||
export interface SCPointOfInterestWithoutReferences
|
||||
extends SCThingWithCategoriesWithoutReferences<SCPointOfInterestCategories,
|
||||
SCThingWithCategoriesSpecificValues>,
|
||||
SCPlaceWithoutReferences {
|
||||
/**
|
||||
* Translated properties of a point of interest
|
||||
*/
|
||||
translations?: SCTranslations<SCThingWithCategoriesTranslatableProperties>;
|
||||
|
||||
/**
|
||||
* Type of a point of interest
|
||||
*/
|
||||
type: SCPointOfInterestType;
|
||||
}
|
||||
|
||||
/**
|
||||
* A point of interest
|
||||
*/
|
||||
export interface SCPointOfInterest extends SCPointOfInterestWithoutReferences, SCThingInPlace {
|
||||
/**
|
||||
* Translated properties of a point of interest
|
||||
*/
|
||||
translations?: SCTranslations<SCThingWithCategoriesTranslatableProperties>;
|
||||
|
||||
/**
|
||||
* Type of a point of interest
|
||||
*/
|
||||
type: SCPointOfInterestType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Categories of a point of interest
|
||||
*/
|
||||
export type SCPointOfInterestCategories =
|
||||
'computer'
|
||||
| 'validator'
|
||||
| 'card charger'
|
||||
| 'printer'
|
||||
| 'disabled access';
|
||||
|
||||
/**
|
||||
* Meta data of a point of interest
|
||||
*/
|
||||
export class SCPointOfInterestMeta extends SCThingMeta {
|
||||
}
|
||||
125
src/core/things/Room.ts
Normal file
125
src/core/things/Room.ts
Normal file
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* Copyright (C) 2018 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCPlaceWithoutReferences} from '../base/Place';
|
||||
import {SCThingInPlace} from '../base/ThingInPlace';
|
||||
import {SCThingThatAcceptsPaymentsWithoutReferences} from '../base/ThingThatAcceptsPayments';
|
||||
import {
|
||||
SCThingWithCategoriesSpecificValues,
|
||||
SCThingWithCategoriesTranslatableProperties,
|
||||
SCThingWithCategoriesWithoutReferences,
|
||||
} from '../base/ThingWithCategories';
|
||||
import {SCThingMeta} from '../Thing';
|
||||
import {SCTranslations} from '../types/i18n';
|
||||
|
||||
/**
|
||||
* Type of a room
|
||||
*/
|
||||
export type SCRoomType = 'room';
|
||||
|
||||
/**
|
||||
* Categories of a room
|
||||
*/
|
||||
export type SCRoomCategories =
|
||||
'cafe'
|
||||
| 'education'
|
||||
| 'learn'
|
||||
| 'library'
|
||||
| 'office'
|
||||
| 'restaurant'
|
||||
| 'canteen'
|
||||
| 'student canteen'
|
||||
| 'restroom'
|
||||
| 'lounge'
|
||||
| 'student union';
|
||||
|
||||
/**
|
||||
* A room without references
|
||||
*/
|
||||
export interface SCRoomWithoutReferences
|
||||
extends SCPlaceWithoutReferences, SCThingThatAcceptsPaymentsWithoutReferences,
|
||||
SCThingWithCategoriesWithoutReferences<SCRoomCategories, SCRoomSpecificValues> {
|
||||
/**
|
||||
* The name of the floor in which the room is in.
|
||||
*/
|
||||
floor?: string;
|
||||
|
||||
/**
|
||||
* The inventory of the place/room as a list of items and their quantity.
|
||||
*/
|
||||
inventory?: Array<{ key: string, value: number }>;
|
||||
|
||||
/**
|
||||
* Translations of specific values of the object
|
||||
*
|
||||
* Take precedence over "main" value for selected languages.
|
||||
*/
|
||||
translations?: SCTranslations<SCThingWithCategoriesTranslatableProperties>;
|
||||
|
||||
/**
|
||||
* Type of the room
|
||||
*/
|
||||
type: SCRoomType;
|
||||
}
|
||||
|
||||
/**
|
||||
* A room
|
||||
*/
|
||||
export interface SCRoom extends SCRoomWithoutReferences, SCThingInPlace {
|
||||
/**
|
||||
* Translations of specific values of the object
|
||||
*
|
||||
* Take precedence over "main" value for selected languages.
|
||||
*/
|
||||
translations?: SCTranslations<SCThingWithCategoriesTranslatableProperties>;
|
||||
|
||||
/**
|
||||
* Type of the room
|
||||
*/
|
||||
type: SCRoomType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Category specific values of a room
|
||||
*/
|
||||
export interface SCRoomSpecificValues extends SCThingWithCategoriesSpecificValues {
|
||||
/**
|
||||
* Category specific opening hours of the room
|
||||
*/
|
||||
openingHours?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Meta information about a place
|
||||
*/
|
||||
export class SCRoomMeta extends SCThingMeta {
|
||||
static fieldValueTranslations = {
|
||||
...SCThingMeta.fieldValueTranslations,
|
||||
de: {
|
||||
categories: {
|
||||
'cafe': 'Café',
|
||||
'canteen': 'Kantine',
|
||||
'education': 'Bildung',
|
||||
'learn': 'Lernen',
|
||||
'library': 'Bibliothek',
|
||||
'lounge': 'Lounge',
|
||||
'office': 'Büro',
|
||||
'restaurant': 'Restaurant',
|
||||
'restroom': 'Toilette',
|
||||
'student canteen': 'Mensa',
|
||||
'student union': 'Studentenvereinigung',
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
60
src/core/things/Semester.ts
Normal file
60
src/core/things/Semester.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (C) 2018 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCAcademicTermWithoutReferences} from '../base/AcademicTerm';
|
||||
import {SCThingMeta} from '../Thing';
|
||||
|
||||
/**
|
||||
* Type of a semester
|
||||
*/
|
||||
export type SCSemesterType = 'semester';
|
||||
|
||||
/**
|
||||
* A semester without references
|
||||
*/
|
||||
export interface SCSemesterWithoutReferences extends SCAcademicTermWithoutReferences {
|
||||
/**
|
||||
* The short name of the semester, using the given pattern.
|
||||
*
|
||||
* @pattern ^(WS|SS) [0-9]{4}(/[0-9]{2})?$
|
||||
*/
|
||||
acronym: string;
|
||||
|
||||
/**
|
||||
* Type of the semester
|
||||
*/
|
||||
type: SCSemesterType;
|
||||
}
|
||||
|
||||
/**
|
||||
* A semester
|
||||
*/
|
||||
export interface SCSemester extends SCSemesterWithoutReferences {
|
||||
}
|
||||
|
||||
/**
|
||||
* Semester meta data
|
||||
*/
|
||||
export class SCSemesterMeta extends SCThingMeta {
|
||||
static fieldTranslations = {
|
||||
...SCThingMeta.fieldTranslations,
|
||||
de: {
|
||||
acronym: 'Abkürzung',
|
||||
endDate: 'Ende',
|
||||
eventsEndDate: 'Vorlesungsschluss',
|
||||
eventsStartDate: 'Vorlesungsbeginn',
|
||||
startDate: 'Beginn',
|
||||
},
|
||||
};
|
||||
}
|
||||
126
src/core/things/Setting.ts
Normal file
126
src/core/things/Setting.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* Copyright (C) 2018 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {
|
||||
SCThingWithCategoriesSpecificValues, SCThingWithCategoriesTranslatableProperties,
|
||||
SCThingWithCategoriesWithoutReferences,
|
||||
} from '../base/ThingWithCategories';
|
||||
import {SCThingMeta} from '../Thing';
|
||||
import { SCTranslations } from '../types/i18n';
|
||||
|
||||
export type SCSettingType = 'setting';
|
||||
export type SCSettingCategories = string;
|
||||
|
||||
/**
|
||||
* A setting without references
|
||||
*/
|
||||
export interface SCSettingWithoutReferences
|
||||
extends SCThingWithCategoriesWithoutReferences<SCSettingCategories, SCThingWithCategoriesSpecificValues> {
|
||||
|
||||
/**
|
||||
* The type of input/value this setting is carrying
|
||||
*/
|
||||
input: SCSettingInputType;
|
||||
/**
|
||||
* The order number this setting should show up in its category list
|
||||
*/
|
||||
order: number;
|
||||
/**
|
||||
* Translated fields of a setting
|
||||
*/
|
||||
translations?: SCTranslations<SCSettingValueTranslatableProperties>;
|
||||
/**
|
||||
* The type of this model
|
||||
*/
|
||||
type: SCSettingType;
|
||||
}
|
||||
|
||||
/**
|
||||
* The types of input/value a setting object can carry
|
||||
*/
|
||||
export type SCSettingInputType = SCSettingSingleChoice
|
||||
| SCSettingMultipleChoice
|
||||
| SCSettingNumber
|
||||
| SCSettingText
|
||||
| SCSettingPassword;
|
||||
|
||||
/**
|
||||
* A setting with references
|
||||
*/
|
||||
export interface SCSetting extends SCSettingWithoutReferences {
|
||||
}
|
||||
|
||||
/**
|
||||
* Input type with single choice as value
|
||||
*/
|
||||
export interface SCSettingSingleChoice {
|
||||
defaultValue: SCSettingValue;
|
||||
inputType: 'singleChoice';
|
||||
value?: SCSettingValue;
|
||||
values: SCSettingValue[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Input type with multiple choice as value
|
||||
*/
|
||||
export interface SCSettingMultipleChoice {
|
||||
defaultValue: SCSettingValue[];
|
||||
inputType: 'multipleChoice';
|
||||
value?: SCSettingValue[];
|
||||
values: SCSettingValue[];
|
||||
}
|
||||
|
||||
export type SCSettingValue = string | number | boolean;
|
||||
|
||||
/**
|
||||
* Input type with number as value
|
||||
*/
|
||||
export interface SCSettingNumber {
|
||||
defaultValue: number;
|
||||
inputType: 'number';
|
||||
value?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Input type with text as value
|
||||
*/
|
||||
export interface SCSettingText {
|
||||
defaultValue: string;
|
||||
inputType: 'text';
|
||||
value?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Input type with secret text (eq. password) as value
|
||||
*/
|
||||
export interface SCSettingPassword {
|
||||
defaultValue: string;
|
||||
inputType: 'password';
|
||||
value?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Translatable properties of a setting
|
||||
*/
|
||||
export interface SCSettingValueTranslatableProperties extends SCThingWithCategoriesTranslatableProperties {
|
||||
}
|
||||
|
||||
/**
|
||||
* Meta information about a setting
|
||||
*/
|
||||
export class SCSettingMeta extends SCThingMeta {
|
||||
static fieldTranslations = {
|
||||
...SCThingMeta.fieldTranslations,
|
||||
};
|
||||
}
|
||||
53
src/core/things/SportCourse.ts
Normal file
53
src/core/things/SportCourse.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2018 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCEvent, SCEventWithoutReferences} from '../base/Event';
|
||||
import {SCThingMeta} from '../Thing';
|
||||
|
||||
/**
|
||||
* Type of a sport course
|
||||
*/
|
||||
export type SCSportCourseType = 'sport course';
|
||||
|
||||
/**
|
||||
* A sport course without references
|
||||
*/
|
||||
export interface SCSportCourseWithoutReferences extends SCEventWithoutReferences {
|
||||
/**
|
||||
* Type of a sport course
|
||||
*/
|
||||
type: SCSportCourseType;
|
||||
}
|
||||
|
||||
/**
|
||||
* A sport course
|
||||
*/
|
||||
export interface SCSportCourse extends SCEvent, SCSportCourseWithoutReferences {
|
||||
/**
|
||||
* Type of a sport course
|
||||
*/
|
||||
type: SCSportCourseType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sport course meta data
|
||||
*/
|
||||
export class SCSportCourseMeta extends SCThingMeta {
|
||||
static fieldValueTranslations = {
|
||||
...SCThingMeta.fieldValueTranslations,
|
||||
de: {
|
||||
type: 'Sportkurs',
|
||||
},
|
||||
};
|
||||
}
|
||||
69
src/core/things/Ticket.ts
Normal file
69
src/core/things/Ticket.ts
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (C) 2018 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCThingInPlace} from '../base/ThingInPlace';
|
||||
import {SCThing, SCThingMeta} from '../Thing';
|
||||
import {SCISO8601Duration} from '../types/Time';
|
||||
|
||||
/**
|
||||
* Type of a ticket
|
||||
*/
|
||||
export type SCTicketType = 'ticket';
|
||||
|
||||
/**
|
||||
* A ticket without references
|
||||
*/
|
||||
export interface SCTicketWithoutReferences extends SCThing {
|
||||
/**
|
||||
* Approximate wait time
|
||||
*/
|
||||
approxWaitingTime: SCISO8601Duration;
|
||||
|
||||
/**
|
||||
* Waiting number of the ticket
|
||||
*/
|
||||
currentTicketNumber: string;
|
||||
|
||||
/**
|
||||
* Service type of the ticket
|
||||
*/
|
||||
serviceType: any;
|
||||
|
||||
/**
|
||||
* Type of a ticket
|
||||
*/
|
||||
type: SCTicketType;
|
||||
}
|
||||
|
||||
/**
|
||||
* A ticket
|
||||
*/
|
||||
export interface SCTicket extends SCTicketWithoutReferences, SCThingInPlace {
|
||||
/**
|
||||
* Type of a ticket
|
||||
*/
|
||||
type: SCTicketType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Meta information about a ticket
|
||||
*/
|
||||
export class SCTicketMeta extends SCThingMeta {
|
||||
static fieldValueTranslations = {
|
||||
...SCThingMeta.fieldValueTranslations,
|
||||
de: {
|
||||
type: 'Ticket',
|
||||
},
|
||||
};
|
||||
}
|
||||
139
src/core/things/Tour.ts
Normal file
139
src/core/things/Tour.ts
Normal file
@@ -0,0 +1,139 @@
|
||||
/*
|
||||
* Copyright (C) 2018 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCThing, SCThingMeta} from '../Thing';
|
||||
|
||||
/**
|
||||
* Type of a tour
|
||||
*/
|
||||
export type SCTourType = 'tour';
|
||||
|
||||
/**
|
||||
* A tour without references
|
||||
*/
|
||||
export interface SCTourWithoutReferences extends SCThing {
|
||||
/**
|
||||
* Init script for the tour
|
||||
*/
|
||||
init?: string;
|
||||
|
||||
/**
|
||||
* Steps of a tour
|
||||
*/
|
||||
steps: SCTourStep[];
|
||||
|
||||
/**
|
||||
* Type of a tour
|
||||
*/
|
||||
type: SCTourType;
|
||||
}
|
||||
|
||||
/**
|
||||
* A tour
|
||||
*/
|
||||
export interface SCTour extends SCTourWithoutReferences {
|
||||
}
|
||||
|
||||
/**
|
||||
* Meta information about a tour
|
||||
*/
|
||||
export class SCTourMeta extends SCThingMeta {
|
||||
}
|
||||
|
||||
/**
|
||||
* A step in a tour
|
||||
*/
|
||||
export type SCTourStep =
|
||||
SCTourStepMenu
|
||||
| SCTourStepLocation
|
||||
| SCTourStepTooltip;
|
||||
|
||||
/**
|
||||
* A location of a tour step
|
||||
*/
|
||||
export interface SCTourStepLocation {
|
||||
/**
|
||||
* Location to go to
|
||||
*/
|
||||
location: string;
|
||||
|
||||
/**
|
||||
* Type of the step
|
||||
*/
|
||||
type: 'location';
|
||||
}
|
||||
|
||||
/**
|
||||
* A tooltip in a tour step
|
||||
*/
|
||||
export interface SCTourStepTooltip {
|
||||
/**
|
||||
* Whether the tooltip may fail or not
|
||||
*/
|
||||
canFail?: boolean;
|
||||
|
||||
/**
|
||||
* Element that the tooltip shall be pointing at or a list of elements to try in the specified order
|
||||
*/
|
||||
element: string | string[];
|
||||
|
||||
/**
|
||||
* Position of the tooltip
|
||||
*/
|
||||
position?: 'bottom' | 'left' | 'right' | 'top';
|
||||
|
||||
/**
|
||||
* How the step shall be resolved
|
||||
*/
|
||||
resolved?: { element: string } | { event: string } | { location: { is: string } | { match: string } } | {
|
||||
menu:
|
||||
'open-left'
|
||||
| 'open-right';
|
||||
};
|
||||
|
||||
/**
|
||||
* Text that the tooltip shall contain
|
||||
*/
|
||||
text: string;
|
||||
|
||||
/**
|
||||
* How often it shall be retried
|
||||
*/
|
||||
tries?: number;
|
||||
|
||||
/**
|
||||
* Type of the step
|
||||
*/
|
||||
type: 'tooltip';
|
||||
}
|
||||
|
||||
/**
|
||||
* Menu interaction of a tour step
|
||||
*/
|
||||
export interface SCTourStepMenu {
|
||||
/**
|
||||
* The action that needs to be completed on the menu
|
||||
*/
|
||||
action: 'close';
|
||||
|
||||
/**
|
||||
* The side of the menu that the step refers to
|
||||
*/
|
||||
side: 'right';
|
||||
|
||||
/**
|
||||
* The type of the step
|
||||
*/
|
||||
type: 'menu';
|
||||
}
|
||||
155
src/core/things/Video.ts
Normal file
155
src/core/things/Video.ts
Normal file
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
* Copyright (C) 2018 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCCreativeWork, SCCreativeWorkWithoutReferences} from '../base/CreativeWork';
|
||||
import {SCThingMeta} from '../Thing';
|
||||
import {SCLanguage} from '../types/i18n';
|
||||
import {SCISO8601Duration} from '../types/Time';
|
||||
import {SCPersonWithoutReferences} from './Person';
|
||||
|
||||
/**
|
||||
* Type of a video
|
||||
*/
|
||||
export type SCVideoType = 'video';
|
||||
|
||||
/**
|
||||
* A video without references
|
||||
*/
|
||||
export interface SCVideoWithoutReferences extends SCCreativeWorkWithoutReferences {
|
||||
/**
|
||||
* The Duration of the Video
|
||||
*/
|
||||
duration?: SCISO8601Duration;
|
||||
|
||||
/**
|
||||
* Downloadable/Streamable Files of the Video
|
||||
*/
|
||||
sources?: SCVideoSource[];
|
||||
|
||||
/**
|
||||
* URLs to a thumbnails for the Video
|
||||
*/
|
||||
thumbnails?: string[];
|
||||
|
||||
/**
|
||||
* Track Files for the Video
|
||||
*/
|
||||
tracks?: SCVideoTrack;
|
||||
|
||||
/**
|
||||
* A Transcript of the Video
|
||||
*/
|
||||
transcript?: string;
|
||||
|
||||
/**
|
||||
* Type of an Video
|
||||
*/
|
||||
type: SCVideoType;
|
||||
}
|
||||
|
||||
export interface SCVideoSource {
|
||||
/**
|
||||
* Pixel Height of the Video
|
||||
*/
|
||||
height?: number;
|
||||
|
||||
/**
|
||||
* MIME-Type of the source File
|
||||
*/
|
||||
mimeType: SCVideoMimeType;
|
||||
|
||||
/**
|
||||
* Size of the Video File in bytes
|
||||
*/
|
||||
size?: number;
|
||||
|
||||
/**
|
||||
* URL to the Video File
|
||||
*/
|
||||
url: string;
|
||||
|
||||
/**
|
||||
* Pixel Width of the Video
|
||||
*/
|
||||
width?: number;
|
||||
}
|
||||
|
||||
export interface SCVideoTrack {
|
||||
/**
|
||||
* Language of the Subtitle
|
||||
*/
|
||||
language: SCLanguage;
|
||||
|
||||
/**
|
||||
* Content Type of the Track File
|
||||
*/
|
||||
type: SCVideoTrackTypes;
|
||||
|
||||
/**
|
||||
* URL to the Track File
|
||||
*/
|
||||
url: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* A video
|
||||
*/
|
||||
export interface SCVideo extends SCCreativeWork, SCVideoWithoutReferences {
|
||||
/**
|
||||
* Persons acting in the Video
|
||||
*/
|
||||
actors?: SCPersonWithoutReferences[];
|
||||
|
||||
/**
|
||||
* Type of a video
|
||||
*/
|
||||
type: SCVideoType;
|
||||
}
|
||||
|
||||
export class SCVideoMeta extends SCThingMeta {
|
||||
static fieldValueTranslations = {
|
||||
...SCThingMeta.fieldValueTranslations,
|
||||
de: {
|
||||
actors: 'Darsteller',
|
||||
duration: 'Länge',
|
||||
height: 'Höhe',
|
||||
language: 'Sprache',
|
||||
size: 'Größe',
|
||||
sources: 'Quellen',
|
||||
transcript: 'Abschrift',
|
||||
type: 'Video',
|
||||
width: 'Breite',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Video Encoding Formats
|
||||
*/
|
||||
export type SCVideoMimeType =
|
||||
'video/mp4'
|
||||
| 'video/ogg'
|
||||
| 'video/webm'
|
||||
| 'application/vnd.apple.mpegurl'
|
||||
| 'application/dash+xml';
|
||||
|
||||
/**
|
||||
* Video Track Types
|
||||
*/
|
||||
export type SCVideoTrackTypes =
|
||||
'captions'
|
||||
| 'chapters'
|
||||
| 'description'
|
||||
| 'metadata'
|
||||
| 'subtitles';
|
||||
Reference in New Issue
Block a user