feat: add ES annotations

This commit is contained in:
Benjamin Jöckel
2019-05-10 11:47:06 +02:00
parent 55b5248660
commit 9c424b0f96
41 changed files with 263 additions and 2 deletions

View File

@@ -54,22 +54,29 @@ export enum SCThingType {
export interface SCThingWithoutReferences {
/**
* Alternate names of the thing
*
* @keyword
*/
alternateNames?: string[];
/**
* Description of the thing
*
* @minLength 1
* @text
*/
description?: string;
/**
* URL of an image of the thing
*
* @keyword
*/
image?: string;
/**
* Name of the thing
*
* @minLength 1
* @sortable ducet
* @text
*/
name: string;
/**
@@ -80,6 +87,9 @@ export interface SCThingWithoutReferences {
translations?: SCTranslations<SCThingTranslatableProperties>;
/**
* Type of the thing
*
* @sortable ducet
* @aggregatable
*/
type: SCThingType;
/**
@@ -143,6 +153,8 @@ export interface SCThingRemoteOrigin extends SCThingOrigin {
/**
* Name of the origin
*
* @text
*/
name: string;
@@ -200,10 +212,14 @@ export interface SCThingUserOrigin extends SCThingOrigin {
export interface SCThingTranslatableProperties {
/**
* Translation of the description of the thing
*
* @text
*/
description?: string;
/**
* Translation of the name of the thing
*
* @text
*/
name?: string;
/**
@@ -218,6 +234,8 @@ export interface SCThingTranslatableProperties {
export interface SCThingTranslatablePropertyOrigin {
/**
* Translation of the name of the origin
*
* @text
*/
name: string;
}

View File

@@ -43,6 +43,7 @@ export class SCThingTranslator {
private metaClasses: typeof SCClasses;
/**
*
* @constructor
* @example
* // returns translator instance for german

View File

@@ -28,12 +28,16 @@ export interface SCAcademicDegreeWithoutReferences
/**
* The achievable academic degree with academic field specification
* (eg. Master of Science)
*
* @keyword
*/
academicDegreewithField: string;
/**
* The achievable academic degree with academic field specification
* shorted (eg. M.Sc.).
*
* @keyword
*/
academicDegreewithFieldShort: string;
}

View File

@@ -23,6 +23,9 @@ export interface SCAcademicTermWithoutReferences
extends SCThingWithoutReferences {
/**
* Short name of the academic term, using the given pattern
*
* @aggregatable
* @keyword
*/
acronym: string;

View File

@@ -42,6 +42,9 @@ export interface SCCreativeWorkWithoutReferences
/**
* Keywords of the creative work
*
* @aggregatable
* @keyword
*/
keywords?: string[];
@@ -79,6 +82,8 @@ export interface SCCreativeWorkTranslatableProperties
extends SCThingTranslatableProperties, SCThingThatCanBeOfferedTranslatableProperties {
/**
* Translation of the keywords of the creative work
*
* @keyword
*/
keywords?: string[];
}

View File

@@ -28,6 +28,8 @@ export interface SCEventWithoutReferences
* Maximum number of participants of the event
*
* A maximum number of people that can participate in the event.
*
* @integer
*/
maximumParticipants?: number;
@@ -35,6 +37,8 @@ export interface SCEventWithoutReferences
* Remaining attendee capacity of the event
*
* This number represents the remaining open spots.
*
* @integer
*/
remainingAttendeeCapacity?: number;
}

View File

@@ -37,7 +37,9 @@ export interface SCPlaceWithoutReferences
/**
* Opening hours of the place
*
* @see http://wiki.openstreetmap.org/wiki/Key:opening_hours/specification
* @keyword
*/
openingHours?: string;

View File

@@ -25,6 +25,9 @@ import {SCISO8601Date} from '../types/Time';
export interface SCPriceGroup {
/**
* Default price of the thing
*
* @sortable price
* @float
*/
default: number;
}
@@ -36,16 +39,25 @@ export interface SCAcademicPriceGroup
extends SCPriceGroup {
/**
* Price for employees
*
* @sortable price
* @float
*/
employee?: number;
/**
* Price for guests
*
* @sortable price
* @float
*/
guest?: number;
/**
* Price for students
*
* @sortable price
* @float
*/
student?: number;
}
@@ -115,6 +127,8 @@ export interface SCThingThatCanBeOfferedTranslatableProperties
extends SCThingTranslatableProperties {
/**
* Availability of an offer
*
* @keyword
*/
'offers[].availability'?: string;
}

View File

@@ -20,12 +20,15 @@ import {SCMap} from '../types/Map';
* A thing without references with categories
*
* !!! BEWARE !!!
* `T` should be a union type - e.g. `T = 'foo' | 'bar' | 'foobar';`
* `T` should be a string literal union type - e.g. `T = 'foo' | 'bar' | 'foobar';`
*/
export interface SCThingWithCategoriesWithoutReferences<T, U extends SCThingWithCategoriesSpecificValues>
extends SCThingWithoutReferences {
/**
* Categories of a thing with categories
*
* @sortable ducet
* @aggregatable
*/
categories: T[];
@@ -72,26 +75,36 @@ export interface SCThingWithCategoriesTranslatableProperties
export interface SCThingWithCategoriesSpecificValues {
/**
* Category specific alternate names of a thing
*
* @keyword
*/
alternateNames?: string[];
/**
* Category specific description of a thing
*
* @text
*/
description?: string;
/**
* URL of a category specific image of a thing
*
* @keyword
*/
image?: string;
/**
* Category specific name of a thing
*
* @text
*/
name?: string;
/**
* Category specific URL of a thing
*
* @keyword
*/
url?: string;
}

View File

@@ -112,6 +112,7 @@ export class SCMethodNotAllowedErrorResponse extends SCError {
export class SCRequestBodyTooLargeErrorResponse extends SCError {
/**
* Create a SCRequestBodyTooLargeErrorResponse
*
* @param stack Set to true if a stack trace should be created
*/
constructor(stack?: boolean) {

View File

@@ -26,6 +26,7 @@ import {
/**
* Request to check the availability of books
*
* @validatable
*/
export type SCBookAvailabilityRequest = SCBookAvailabilityRequestByIsbn | SCBookAvailabilityRequestByUuid;

View File

@@ -16,6 +16,7 @@ import {SCAcademicPriceGroup, SCThingThatCanBeOfferedOffer} from '../../../base/
/**
* List of availabilities of a book
*
* @validatable
*/
export type SCBookAvailabilityResponse = Array<SCThingThatCanBeOfferedOffer<SCAcademicPriceGroup>>;

View File

@@ -26,6 +26,7 @@ import {
/**
* Request to add a thing to a bulk
*
* @validatable
*/
export type SCBulkAddRequest = SCThings;

View File

@@ -14,6 +14,7 @@
*/
/**
* Response to a request to add a thing to a bulk
*
* @validatable
*/
export interface SCBulkAddResponse {

View File

@@ -25,6 +25,7 @@ import {
/**
* Request to change the bulk state to done (close the bulk process)
*
* @validatable
*/
export interface SCBulkDoneRequest {

View File

@@ -14,6 +14,7 @@
*/
/**
* Response to a request to change the state of a bulk to done
*
* @validatable
*/
export interface SCBulkDoneResponse {

View File

@@ -31,11 +31,16 @@ export interface SCAcademicEventWithoutReferences
SCThingWithCategoriesWithoutReferences<SCAcademicEventCategories, SCThingWithCategoriesSpecificValues> {
/**
* Majors of the academic event that this event belongs to
*
* @aggregatable
* @keyword
*/
majors?: string[];
/**
* Original unmapped category from the source of the academic event
*
* @keyword
*/
originalCategory?: string;
@@ -54,6 +59,7 @@ export interface SCAcademicEventWithoutReferences
* An academic event
*
* @validatable
* @indexable
*/
export interface SCAcademicEvent
extends SCEvent, SCAcademicEventWithoutReferences,
@@ -95,11 +101,15 @@ export interface SCAcademicEventTranslatableProperties
extends SCThingWithCategoriesTranslatableProperties {
/**
* Translations of the majors of the academic event that this event belongs to
*
* @keyword
*/
majors?: string[];
/**
* Translation of the original unmapped category from the source of the academic event
*
* @keyword
*/
originalCategory?: string;
}

View File

@@ -36,6 +36,8 @@ export interface SCArticleWithoutReferences
SCThingWithCategoriesWithoutReferences<SCArticleCategories, SCThingWithCategoriesSpecificValues> {
/**
* Article itself as markdown
*
* @text
*/
articleBody: string;
@@ -54,6 +56,7 @@ export interface SCArticleWithoutReferences
* An article
*
* @validatable
* @indexable
*/
export interface SCArticle
extends SCCreativeWork, SCArticleWithoutReferences,
@@ -81,6 +84,8 @@ export interface SCArticleTranslatableProperties
extends SCThingWithCategoriesTranslatableProperties, SCCreativeWorkTranslatableProperties {
/**
* Translation of the article itself as markdown
*
* @text
*/
articleBody?: string[];
}

View File

@@ -30,16 +30,22 @@ export interface SCBookWithoutReferences
extends SCCreativeWorkWithoutReferences {
/**
* Edition of a book
*
* @keyword
*/
bookEdition?: string;
/**
* ISBN of a book
*
* @keyword
*/
isbn: string;
/**
* Number of pages of a book
*
* @integer
*/
numberOfPages?: number;
@@ -58,6 +64,7 @@ export interface SCBookWithoutReferences
* A book
*
* @validatable
* @indexable
*/
export interface SCBook
extends SCCreativeWork, SCBookWithoutReferences {
@@ -84,6 +91,8 @@ export interface SCBookTranslatableFields
extends SCThingWithCategoriesTranslatableProperties, SCCreativeWorkTranslatableProperties {
/**
* Translation of an edition of a book
*
* @keyword
*/
bookEdition?: string;
}

View File

@@ -43,11 +43,16 @@ export interface SCBuildingWithoutReferences
SCPlaceWithoutReferences {
/**
* Categories of a building
*
* @sortable ducet
* @aggregatable
*/
categories: SCBuildingCategories[];
/**
* List of floor names of the place
*
* @keyword
*/
floors?: string[];
@@ -66,6 +71,7 @@ export interface SCBuildingWithoutReferences
* A building
*
* @validatable
* @indexable
*/
export interface SCBuilding
extends SCBuildingWithoutReferences, SCPlace,

View File

@@ -32,6 +32,8 @@ export interface SCCatalogWithoutReferences
* 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.
*
* @integer
*/
level: number;
@@ -44,7 +46,8 @@ export interface SCCatalogWithoutReferences
/**
* A catalog
*
* @validatable
* @validatable
* @indexable
*/
export interface SCCatalog
extends SCCatalogWithoutReferences, SCThing,

View File

@@ -38,6 +38,8 @@ export interface SCCourseOfStudiesWithoutReferences
/**
* Actual major of the course of studies (eg. physics)
*
* @keyword
*/
major: string;
@@ -66,6 +68,7 @@ export interface SCCourseOfStudiesWithoutReferences
* A course of studies
*
* @validatable
* @indexable
*/
export interface SCCourseOfStudies
extends SCCourseOfStudiesWithoutReferences, SCThingThatCanBeOffered<SCAcademicPriceGroup>, SCAcademicDegree {

View File

@@ -34,6 +34,8 @@ export interface SCSportCoursePriceGroup
extends SCAcademicPriceGroup {
/**
* Price for alumnis
*
* @float
*/
alumni?: number;
}
@@ -60,6 +62,8 @@ export interface SCDateSeriesWithoutReferences
/**
* Frequency of the date series
*
* @keyword
*/
frequency: string;
@@ -78,6 +82,7 @@ export interface SCDateSeriesWithoutReferences
* A date series
*
* @validatable
* @indexable
*/
export interface SCDateSeries
extends SCDateSeriesWithoutReferences,

View File

@@ -48,6 +48,7 @@ export interface SCDiffWithoutReferences
* A diff
*
* @validatable
* @indexable
*/
export interface SCDiff
extends SCDiffWithoutReferences, SCThing {

View File

@@ -37,11 +37,16 @@ export interface SCDishWithoutReferences
SCThingWithCategoriesWithoutReferences<SCDishCategories, SCThingWithCategoriesSpecificValues> {
/**
* Additives of the dish
*
* @keyword
*/
additives?: string[];
/**
* Category of the dish
*
* @sortable ducet
* @aggregatable
*/
categories: SCDishCategories[];
@@ -70,6 +75,7 @@ export interface SCDishWithoutReferences
* A dish
*
* @validatable
* @indexable
*/
export interface SCDish
extends SCDishWithoutReferences, SCThingThatCanBeOffered<SCAcademicPriceGroup>,
@@ -104,11 +110,15 @@ export interface SCDishTranslatableProperties
export interface SCDishCharacteristic {
/**
* URL of an image of the characteristic
*
* @keyword
*/
image?: string;
/**
* Name of the characteristic
*
* @text
*/
name: string;
}
@@ -132,36 +142,50 @@ export type SCDishCategories =
export interface SCNutritionInformation {
/**
* Number of calories contained (in kcal)
*
* @float
*/
calories?: number;
/**
* Content of carbohydrates (in grams)
*
* @float
*/
carbohydrateContent?: number;
/**
* Content of fat (in grams)
*
* @float
*/
fatContent?: number;
/**
* Content of proteins (in grams)
*
* @float
*/
proteinContent?: number;
/**
* Content of salt (in grams)
*
* @float
*/
saltContent?: number;
/**
* Content of saturated fat (in grams)
*
* @float
*/
saturatedFatContent?: number;
/**
* Content of sugar (in grams)
*
* @float
*/
sugarContent?: number;
}

View File

@@ -49,6 +49,7 @@ export interface SCFavoriteWithoutReferences
* A favorite
*
* @validatable
* @indexable
*/
export interface SCFavorite
extends SCSaveableThing<SCFavoriteDataTypes>, SCFavoriteWithoutReferences {

View File

@@ -26,6 +26,8 @@ export interface SCFloorWithoutReferences
extends SCThingWithoutReferences {
/**
* Floor name in the place it is in e.g. "first floor", "ground floor". This doesn't reference the building name.
*
* @text
*/
floorName: string;
@@ -49,6 +51,7 @@ export interface SCFloorWithoutReferences
* A floor
*
* @validatable
* @indexable
*/
export interface SCFloor
extends SCFloorWithoutReferences, SCThingInPlace {
@@ -92,6 +95,8 @@ export interface SCFloorTranslatableProperties
extends SCThingTranslatableProperties {
/**
* Translation of the floor name
*
* @text
*/
floorName?: string;
}

View File

@@ -40,6 +40,8 @@ export interface SCMessageWithoutReferences
/**
* Message itself
*
* @text
*/
messageBody: string;
@@ -58,6 +60,7 @@ export interface SCMessageWithoutReferences
* A message
*
* @validatable
* @indexable
*/
export interface SCMessage
extends SCCreativeWork, SCMessageWithoutReferences {
@@ -87,6 +90,8 @@ export interface SCMessageTranslatableProperties
extends SCCreativeWorkTranslatableProperties, SCThingThatCanBeOfferedTranslatableProperties {
/**
* Message itself
*
* @text
*/
messageBody?: string;
}

View File

@@ -31,6 +31,7 @@ export interface SCOrganizationWithoutReferences
* An organization
*
* @validatable
* @indexable
*/
export interface SCOrganization
extends SCOrganizationWithoutReferences, SCThingInPlace {

View File

@@ -27,6 +27,8 @@ export interface SCPersonWithoutReferences
extends SCThingWithoutReferences {
/**
* Additional first names of the person.
*
* @keyword
*/
additionalName?: string;
@@ -39,16 +41,22 @@ export interface SCPersonWithoutReferences
* The private email address of the person.
*
* @TJS-format email
*
* @keyword
*/
email?: string;
/**
* The family name of the person.
*
* @keyword
*/
familyName: string;
/**
* The private fax number of the person.
*
* @keyword
*/
faxNumber?: string;
@@ -59,26 +67,36 @@ export interface SCPersonWithoutReferences
/**
* The first name of the person.
*
* @keyword
*/
givenName: string;
/**
* Honorific prefix of the person.
*
* @keyword
*/
honorificPrefix?: string;
/**
* Honorific suffix of the person.
*
* @keyword
*/
honorificSuffix?: string;
/**
* Titles of jobs that the person has.
*
* @keyword
*/
jobTitles?: string[];
/**
* The complete name of the person combining all the parts of the name into one.
*
* @text
*/
name: string;
@@ -89,6 +107,8 @@ export interface SCPersonWithoutReferences
/**
* The private telephone number of the person.
*
* @keyword
*/
telephone?: string;
@@ -102,6 +122,7 @@ export interface SCPersonWithoutReferences
* A person
*
* @validatable
* @indexable
*/
export interface SCPerson
extends SCPersonWithoutReferences, SCThing {
@@ -210,26 +231,36 @@ export interface SCContactPoint {
/**
* E-mail at the work location
*
* @keyword
*/
email?: string;
/**
* Fax number at the work location
*
* @keyword
*/
faxNumber?: string;
/**
* Times available for contacting at the work location
*
* @keyword
*/
hoursAvailable?: string;
/**
* Contact number at the work location
*
* @keyword
*/
telephone?: string;
/**
* URL at the work location
*
* @keyword
*/
url?: string;
}

View File

@@ -45,6 +45,7 @@ export interface SCPointOfInterestWithoutReferences
* A point of interest
*
* @validatable
* @indexable
*/
export interface SCPointOfInterest
extends SCPointOfInterestWithoutReferences, SCThingInPlace, SCPlace,

View File

@@ -57,6 +57,8 @@ export interface SCRoomWithoutReferences
SCThingWithCategoriesWithoutReferences<SCRoomCategories, SCRoomSpecificValues> {
/**
* The name of the floor in which the room is in.
*
* @text
*/
floorName?: string;
@@ -82,6 +84,7 @@ export interface SCRoomWithoutReferences
* A room
*
* @validatable
* @indexable
*/
export interface SCRoom
extends SCRoomWithoutReferences, SCThingInPlace, SCThingThatAcceptsPayments, SCPlace,
@@ -106,6 +109,8 @@ export interface SCRoomSpecificValues
extends SCThingWithCategoriesSpecificValues {
/**
* Category specific opening hours of the room
*
* @keyword
*/
openingHours?: string;
}

View File

@@ -29,6 +29,7 @@ export interface SCSemesterWithoutReferences
* The short name of the semester, using the given pattern.
*
* @pattern ^(WS|SS) [0-9]{4}(/[0-9]{2})?$
* @keyword
*/
acronym: string;
@@ -42,6 +43,7 @@ export interface SCSemesterWithoutReferences
* A semester
*
* @validatable
* @indexable
*/
export interface SCSemester
extends SCSemesterWithoutReferences, SCAcademicTerm {

View File

@@ -41,6 +41,8 @@ export interface SCSettingWithoutReferences
inputType: SCSettingInputType;
/**
* The order number this setting should show up in its category list
*
* @integer
*/
order: number;
/**
@@ -85,6 +87,7 @@ export enum SCSettingInputType {
* A setting with references
*
* @validatable
* @indexable
*/
export interface SCSetting
extends SCSettingWithoutReferences, SCThing,
@@ -115,6 +118,8 @@ export type SCSettingValues = SCSettingValue[];
export interface SCSettingValueTranslatableProperties extends SCThingWithCategoriesTranslatableProperties {
/**
* The translations of the possible values of a setting
*
* @keyword
*/
values?: string[];
}

View File

@@ -31,6 +31,7 @@ export interface SCSportCourseWithoutReferences
* A sport course
*
* @validatable
* @indexable
*/
export interface SCSportCourse
extends SCEvent, SCSportCourseWithoutReferences {

View File

@@ -34,6 +34,8 @@ export interface SCStudyModuleWithoutReferences
/**
* ECTS points (European Credit Transfer System)
*
* @float
*/
ects: number;
@@ -44,6 +46,8 @@ export interface SCStudyModuleWithoutReferences
/**
* Majors that this study module is meant for
*
* @keyword
*/
majors: string[];
@@ -67,6 +71,7 @@ export interface SCStudyModuleWithoutReferences
* A study module
*
* @validatable
* @indexable
*/
export interface SCStudyModule
extends SCStudyModuleWithoutReferences, SCThingThatCanBeOffered<SCAcademicPriceGroup> {
@@ -111,6 +116,8 @@ export interface SCStudyModuleTranslatableProperties
extends SCThingThatCanBeOfferedTranslatableProperties {
/**
* Translations of the majors that this study module is meant for
*
* @keyword
*/
majors?: string[];

View File

@@ -29,6 +29,8 @@ export interface SCTicketWithoutReferences
/**
* Waiting number of the ticket
*
* @keyword
*/
currentTicketNumber: string;
@@ -47,6 +49,7 @@ export interface SCTicketWithoutReferences
* A ticket
*
* @validatable
* @indexable
*/
export interface SCTicket
extends SCTicketWithoutReferences, SCThingInPlace {

View File

@@ -53,6 +53,7 @@ export interface SCToDoWithoutReferences
* A "to do"
*
* @validatable
* @indexable
*/
export interface SCToDo
extends SCToDoWithoutReferences, SCThing, SCThingWithCategories<string, SCThingWithCategoriesSpecificValues> {

View File

@@ -22,16 +22,22 @@ export interface SCTourWithoutReferences
extends SCThingWithoutReferences {
/**
* Init script for the tour
*
* @text
*/
init?: string;
/**
* Steps of a tour
*
* @keyword
*/
steps: SCTourStep[];
/**
* Type of a tour
*
* @keyword
*/
type: SCThingType.Tour;
}
@@ -40,6 +46,7 @@ export interface SCTourWithoutReferences
* A tour
*
* @validatable
* @indexable
*/
export interface SCTour
extends SCTourWithoutReferences, SCThing {
@@ -100,6 +107,8 @@ export type SCTourStep =
export interface SCTourStepLocation {
/**
* Location to go to
*
* @keyword
*/
location: string;
@@ -120,6 +129,8 @@ export interface SCTourStepTooltip {
/**
* Element that the tooltip shall be pointing at or a list of elements to try in the specified order
*
* @keyword
*/
element: string | string[];
@@ -135,11 +146,15 @@ export interface SCTourStepTooltip {
/**
* Text that the tooltip shall contain
*
* @text
*/
text: string;
/**
* How often it shall be retried
*
* @integer
*/
tries?: number;
@@ -175,6 +190,8 @@ export interface SCTourStepMenu {
export interface SCTourResolvedElement {
/**
* Element name
*
* @keyword
*/
element: string;
}
@@ -185,6 +202,8 @@ export interface SCTourResolvedElement {
export interface SCTourResolvedEvent {
/**
* Event name
*
* @keyword
*/
event: string;
}
@@ -205,6 +224,8 @@ export interface SCTourResolvedLocation {
export interface SCTourResolvedLocationTypeIs {
/**
* Specific location name
*
* @keyword
*/
is: string;
}
@@ -215,6 +236,8 @@ export interface SCTourResolvedLocationTypeIs {
export interface SCTourResolvedLocationTypeMatch {
/**
* Regex location name
*
* @keyword
*/
match: string;
}

View File

@@ -35,6 +35,8 @@ export interface SCVideoWithoutReferences
/**
* URLs to a thumbnails for the Video
*
* @keyword
*/
thumbnails?: string[];
@@ -45,6 +47,8 @@ export interface SCVideoWithoutReferences
/**
* A Transcript of the Video
*
* @text
*/
transcript?: string;
@@ -57,6 +61,8 @@ export interface SCVideoWithoutReferences
export interface SCVideoSource {
/**
* Pixel Height of the Video
*
* @integer
*/
height?: number;
@@ -67,16 +73,22 @@ export interface SCVideoSource {
/**
* Size of the Video File in bytes
*
* @integer
*/
size?: number;
/**
* URL to the Video File
*
* @keyword
*/
url: string;
/**
* Pixel Width of the Video
*
* @integer
*/
width?: number;
}
@@ -94,6 +106,8 @@ export interface SCVideoTrack {
/**
* URL to the Track File
*
* @keyword
*/
url: string;
}
@@ -102,6 +116,7 @@ export interface SCVideoTrack {
* A video
*
* @validatable
* @indexable
*/
export interface SCVideo
extends SCCreativeWork, SCVideoWithoutReferences {